From d529e4c4d041c14488829aac9560fa4a4e19247b Mon Sep 17 00:00:00 2001 From: Eric Barr Date: Mon, 31 Mar 2014 09:55:49 -0700 Subject: [PATCH] Removed files that don't need to be tracked --- .../compiled/game/script/.deps/ai/ai.script | 2 - .../.deps/ai/ai_combat_target.scriptlib | 2 - .../.deps/ai/bark_string_on_initialize.script | 2 - .../script/.deps/ai/creature_combat.script | 2 - .../script/.deps/base/remote_object.script | 2 - .../.deps/base/remote_object_requester.script | 2 - .../game/script/.deps/base_class.java | 2 - .../game/script/.deps/base_script.script | 2 - .../script/.deps/city/guard_spawner.script | 2 - .../game/script/.deps/combat_engine.java | 2 - .../bib_fortuna_mos_eisley.script | 2 - .../.deps/conversation/blacksun_guri.script | 2 - .../boss_terminal_mining_cave.script | 2 - ...oss_terminal_mining_cave_controller.script | 2 - .../boss_terminal_mining_cave_foreman.script | 2 - ...oss_terminal_mining_research_barnet.script | 2 - ...boss_terminal_mining_research_lapaz.script | 2 - .../boss_terminal_pirate_cave.script | 2 - .../boss_terminal_research_barnet.script | 2 - .../boss_terminal_research_lapaz.script | 2 - .../.deps/conversation/bounty_probot.script | 2 - .../.deps/conversation/cale_serasai.script | 2 - .../conversation/camp_beta_leader.script | 2 - .../conversation/camp_delta_leader.script | 2 - .../conversation/camp_epsilon_leader.script | 2 - .../conversation/camp_gamma_leader.script | 2 - .../.deps/conversation/camp_survivor.java | 2 - .../.deps/conversation/camp_survivor.script | 2 - .../.deps/conversation/captain_piett.script | 2 - .../conversation/choster_lok_cantina.script | 2 - .../collections_ice_cream_part_eight.script | 2 - .../collections_ice_cream_part_five.script | 2 - .../collections_ice_cream_part_four.script | 2 - .../collections_ice_cream_part_nine.script | 2 - .../collections_ice_cream_part_one.script | 2 - .../collections_ice_cream_part_seven.script | 2 - .../collections_ice_cream_part_six.script | 2 - .../collections_ice_cream_part_ten.script | 2 - .../collections_ice_cream_part_three.script | 2 - .../collections_ice_cream_part_two.script | 2 - .../conversation/delivery_chardle.script | 2 - .../.deps/conversation/delivery_hassel.script | 2 - .../conversation/delivery_pirrohn.script | 2 - .../conversation/detainment_npc_rescue.script | 2 - .../conversation/disgruntled_leader.script | 2 - .../conversation/doctor_griffax_jin.script | 2 - .../ep3_rodian_junk_dealer.script | 2 - .../conversation/ep3_wke_junk_dealer.script | 2 - .../faction_recruiter_imperial.script | 2 - .../faction_recruiter_rebel.script | 2 - .../gcw_demoralized_soldier.script | 2 - .../gcw_introduction_talon_karrde.script | 2 - .../.deps/conversation/grenz_zittoun.script | 2 - .../hacker_lok_pirate_cave.script | 2 - .../conversation/happer_mos_eisley.script | 2 - .../script/.deps/conversation/hx_138.script | 2 - .../imperial_empire_day_kaythree.script | 2 - .../imperial_empire_day_major_tantor.script | 2 - .../imperial_empire_day_mara_jade.script | 2 - .../imperial_empire_day_supply_officer.script | 2 - .../conversation/imperial_general.script | 2 - .../.deps/conversation/injured_agent.script | 2 - .../conversation/inquisitor_admin.script | 2 - .../conversation/jedi_robe_jinsu_taker.script | 2 - .../script/.deps/conversation/jinkins.script | 2 - .../conversation/junk_dealer_generic.script | 2 - .../conversation/junk_dealer_jawa.script | 2 - .../conversation/junk_dealer_smuggler.script | 2 - .../script/.deps/conversation/kole.script | 2 - .../script/.deps/conversation/kusak.script | 2 - .../.deps/conversation/mako_ghast.script | 2 - .../conversation/moore_lok_cantina.script | 2 - .../mtp_corellia_times_contact.script | 2 - .../mtp_corsec_intelligence_officer.script | 2 - .../conversation/mtp_hideout_bomb_tech.script | 2 - .../mtp_hideout_food_supply_tech.script | 2 - .../conversation/mtp_hideout_map_tech.script | 2 - .../conversation/mtp_hideout_safe_tech.script | 2 - .../mtp_hideout_weapon_supply_tech.script | 2 - .../.deps/conversation/novicecollector.script | 2 - .../game/script/.deps/conversation/nym.script | 2 - .../conversation/nym_arena_referee.script | 2 - .../nym_themepark_quatermaster.script | 2 - .../nym_themepark_smuggler.script | 2 - .../outbreak_defense_erlem_math_delta.script | 2 - .../outbreak_defense_kyraa_naa.script | 2 - .../outbreak_defense_mika_horn_alpha.script | 2 - ...k_defense_stephon_sprocketfire_beta.script | 2 - .../outbreak_defense_zsu_val_epsilon.script | 2 - .../conversation/outbreak_han_solo.script | 2 - .../conversation/prisoner_pirate_cave.script | 2 - ..._delivery_deathtrooper_conversation.script | 2 - .../.deps/conversation/ran_machado.script | 2 - .../.deps/conversation/rebel_general.script | 2 - .../rebel_offensive_supply_terminal.script | 2 - .../conversation/rebel_pilot_rescue.script | 2 - ...ebel_remembrance_day_captain_derlin.script | 2 - .../rebel_remembrance_day_rieekan.script | 2 - .../rebel_remembrance_day_wedge.script | 2 - ...ebel_remembrance_day_wedge_antilles.script | 2 - .../.deps/conversation/rek_thelcar.script | 2 - .../conversation/scientist_collection.script | 2 - .../script/.deps/conversation/sheeli.script | 2 - .../shuttle_control_terminal.script | 2 - .../conversation/slicer_01_mos_taike.script | 2 - .../.deps/conversation/slicer_02_lok.script | 2 - .../.deps/conversation/stuvany_inglen.script | 2 - .../.deps/conversation/trig_longo.script | 2 - .../.deps/conversation/vana_sage.script | 2 - .../.deps/conversation/water_treatment.script | 2 - .../.deps/conversation/zahara_cody.script | 2 - .../game/script/.deps/corpse/ai_corpse.script | 2 - .../.deps/creature/dynamic_enemy.script | 2 - .../.deps/creature/foraging_enemy.script | 2 - .../game/script/.deps/creature/sarlacc.script | 2 - .../.deps/creature/serving_droid.script | 2 - .../.deps/event/dianoga_dumpster.script | 2 - .../emp_day/crash_site_requisition.script | 2 - .../empire_day_interior_spawn_npc.script | 2 - .../empired_day_interior_spawn_npc.script | 2 - .../factional_guard_self_destruct.script | 2 - .../give_multiple_items_to_supply_npc.script | 2 - .../event/emp_day/goodbye_path_destroy.script | 2 - .../event/emp_day/imperial_empty_sign.script | 2 - .../emp_day/imperial_recruitment_sign.script | 2 - .../event/emp_day/rebel_empty_sign.script | 2 - .../emp_day/rebel_resistance_sign.script | 2 - .../rescue_faction_npc_trigger_volume.script | 2 - .../event/emperorsday/emperor_statue.script | 2 - .../event/emperorsday/imperial_npc.script | 2 - .../emperorsday/imperial_npc_corpse.script | 2 - .../.deps/event/emperorsday/rebel_npc.script | 2 - .../event/emperorsday/rebel_npc_corpse.script | 2 - .../event/emperorsday/yoda_fountain.script | 2 - .../.deps/event/gcwraids/cheerleader.script | 2 - .../.deps/event/holiday_controller.script | 2 - .../sarlacc_furniture_terminal.script | 2 - .../.deps/event/planet_event_handler.script | 2 - .../.deps/faction_perk/hq/loader.script | 2 - .../.deps/faction_perk/hq/terminal.script | 2 - .../armor/biolink_item_non_faction.script | 2 - .../script/.deps/item/armor/new_armor.script | 2 - ...buff_click_biolink_item_non_faction.script | 2 - .../script/.deps/item/buff_click_item.script | 2 - .../.deps/item/clicky_biolink_item.script | 2 - .../.deps/item/droid/serving_droid.script | 2 - .../item/droid/serving_droid_terminal.script | 2 - .../.deps/item/ice_cream_fryer/fryer.script | 2 - .../ice_cream_fryer/ice_cream_buff.script | 2 - .../ice_cream_fryer/ice_cream_fail.script | 2 - .../ice_cream_fryer/ice_cream_nobuff.script | 2 - .../.deps/item/loot_kits/loot_kit_base.script | 2 - .../item/loot_schematic/loot_schematic.script | 2 - .../item/publish_gift/holopet_emitter.script | 2 - .../script/.deps/item/static_item_base.script | 2 - .../item/structure_deed/city_hall_deed.script | 2 - .../player_structure_deed.script | 2 - .../crafted_armor_customization_kit.script | 2 - .../tool/crafted_armor_recolor_kit.script | 2 - .../tool/structure_customization_kit.script | 2 - .../.deps/item/trigger_breach_music.script | 2 - .../wearable/allow_player_custom_color.script | 2 - .../set_non_armor_wearable_socket.script | 2 - .../.deps/library/advanced_turret.scriptlib | 2 - .../script/.deps/library/ai_lib.scriptlib | 2 - .../script/.deps/library/attrib.scriptlib | 2 - .../game/script/.deps/library/badge.scriptlib | 2 - .../script/.deps/library/beast_lib.scriptlib | 2 - .../.deps/library/bounty_hunter.scriptlib | 2 - .../game/script/.deps/library/buff.scriptlib | 2 - .../script/.deps/library/camping.scriptlib | 2 - .../script/.deps/library/collection.scriptlib | 2 - .../script/.deps/library/consumable.scriptlib | 2 - .../script/.deps/library/corpse.scriptlib | 2 - .../script/.deps/library/create.scriptlib | 2 - .../script/.deps/library/factions.scriptlib | 2 - .../game/script/.deps/library/gcw.scriptlib | 2 - .../.deps/library/groundquests.scriptlib | 2 - .../game/script/.deps/library/guild.scriptlib | 2 - .../script/.deps/library/healing.scriptlib | 2 - .../script/.deps/library/holiday.scriptlib | 2 - .../game/script/.deps/library/hq.java | 2 - .../game/script/.deps/library/hq.scriptlib | 2 - .../game/script/.deps/library/loot.scriptlib | 2 - .../script/.deps/library/movement.scriptlib | 2 - .../game/script/.deps/library/pclib.scriptlib | 2 - .../.deps/library/performance.scriptlib | 2 - .../.deps/library/player_structure.scriptlib | 2 - .../script/.deps/library/resource.scriptlib | 2 - .../script/.deps/library/ship_ai.scriptlib | 2 - .../script/.deps/library/smuggler.scriptlib | 2 - .../.deps/library/space_combat.scriptlib | 2 - .../.deps/library/space_crafting.scriptlib | 2 - .../.deps/library/space_create.scriptlib | 2 - .../script/.deps/library/spawning.scriptlib | 2 - .../.deps/library/static_item.scriptlib | 2 - .../script/.deps/library/stealth.scriptlib | 2 - .../game/script/.deps/library/sui.scriptlib | 2 - .../game/script/.deps/library/tcg.scriptlib | 2 - .../game/script/.deps/library/trial.scriptlib | 2 - .../game/script/.deps/library/utils.scriptlib | 2 - .../script/.deps/library/vehicle.scriptlib | 2 - .../script/.deps/library/vendor_lib.scriptlib | 2 - .../script/.deps/library/weapons.scriptlib | 2 - .../game/script/.deps/library/xp.scriptlib | 2 - .../.deps/npc/converse/junk_dealer.script | 2 - .../npc/faction_recruiter/biolink_item.script | 2 - .../npc/faction_recruiter/faction_item.script | 2 - .../faction_recruiter.script | 2 - .../npc/jawa_traders/jawa_trader_01.script | 2 - .../npc/jawa_traders/jawa_trader_02.script | 2 - .../npc/jawa_traders/jawa_trader_03.script | 2 - .../jawa_traders/jawa_trader_bounty.script | 2 - .../.deps/npc/vendor/object_for_sale.script | 2 - .../game/script/.deps/object/autostack.script | 2 - .../script/.deps/planet/planet_base.script | 2 - .../.deps/player/base/base_player.script | 2 - .../.deps/player/live_conversions.script | 2 - .../.deps/player/player_building.script | 2 - .../.deps/player/player_collection.script | 2 - .../script/.deps/player/player_faction.script | 2 - .../game/script/.deps/player/player_gm.script | 2 - .../.deps/player/player_instance.script | 2 - .../script/.deps/player/player_sui.script | 2 - .../script/.deps/player/player_utility.script | 2 - .../.deps/player/skill/player_teaching.script | 2 - .../quest/force_sensitive/fs_buff_item.script | 2 - .../intellect_spawn_control.script | 2 - .../game/script/.deps/quest/task/craft.script | 2 - .../.deps/quest/task/ground/base_task.script | 2 - .../.deps/quest/task/ground/defend.script | 2 - .../.deps/quest/task/ground/escort.script | 2 - .../util/quest_use_object_on_object.script | 2 - .../quest/task/ground/wait_for_signal.script | 2 - .../ground/wave_event_controller_npc.script | 2 - .../quest/utility/destroy_notification.script | 2 - .../dynamic_spawn_off_quest_item.script | 2 - .../script/.deps/space/ai/space_ai.script | 2 - .../.deps/space/combat/combat_ship.script | 2 - .../space/quest_logic/assassinate.script | 2 - .../space/quest_logic/assassinate_ship.script | 2 - .../.deps/space/quest_logic/recovery.script | 2 - .../structure/permanent_structure.script | 2 - .../.deps/systems/buff/buff_handler.script | 2 - .../collection_handle_object_on_object.script | 2 - .../collection_use_object_on_object.script | 2 - .../systems/collections/consume_click.script | 2 - .../systems/collections/consume_loot.script | 2 - .../collections/grant_collection_quest.script | 2 - .../publish_gift_quest_giver_object.script | 2 - .../publish_gift/publish_gift_shuttle.script | 2 - .../publish_gift_quest_giver_object.script | 2 - .../collections/publish_gift_shuttle.script | 2 - .../systems/combat/combat_actions.script | 2 - .../.deps/systems/combat/combat_base.script | 2 - .../.deps/systems/combat/combat_weapon.script | 2 - .../armor/crafting_customization_base.script | 2 - .../.deps/systems/crafting/base_tool.script | 2 - .../systems/crafting/crafting_base.script | 2 - .../furniture/crafting_base_furniture.script | 2 - ...afting_base_furniture_customization.script | 2 - .../structure_customization_kit.script | 2 - .../armor_analysis_tool.script | 2 - .../dungeon_sequencer/ai_controller.script | 2 - .../sequence_controller.script | 2 - .../.deps/systems/gcw/flip_banner.script | 2 - .../systems/gcw/flip_banner_onpole.script | 2 - .../.deps/systems/gcw/gcw_barricade.script | 2 - .../script/.deps/systems/gcw/gcw_camp.script | 2 - .../script/.deps/systems/gcw/gcw_city.script | 2 - .../.deps/systems/gcw/gcw_city_kit.script | 2 - .../systems/gcw/gcw_city_kit_turret.script | 2 - .../.deps/systems/gcw/gcw_city_pylon.script | 2 - .../gcw/gcw_city_pylon_barricade.script | 2 - .../systems/gcw/gcw_city_pylon_patrol.script | 2 - .../systems/gcw/gcw_city_pylon_tower.script | 2 - .../systems/gcw/gcw_city_pylon_turret.script | 2 - .../systems/gcw/gcw_city_pylon_vehicle.script | 2 - .../gcw/gcw_city_pylon_vehicle_boss.script | 2 - .../systems/gcw/gcw_damaged_vehicle.script | 2 - .../gcw/gcw_defensive_general_boss.script | 2 - .../gcw/gcw_entertainer_faction_quest.script | 2 - .../.deps/systems/gcw/gcw_npc_hurt.script | 2 - .../.deps/systems/gcw/gcw_patrol.script | 2 - .../gcw/gcw_patrol_point_npc_ai.script | 2 - .../systems/gcw/gcw_poi_guard_spawning.script | 2 - .../.deps/systems/gcw/gcw_poi_spawner.script | 2 - .../systems/gcw/gcw_smuggler_device.script | 2 - .../script/.deps/systems/gcw/gcw_tower.script | 2 - .../.deps/systems/gcw/gcw_turret.script | 2 - .../systems/gcw/gcw_vehicle_patrol.script | 2 - .../gcw/static_base/base_master.script | 2 - .../systems/jedi/jedi_saber_component.script | 2 - .../systems/missions/base/mission_base.script | 2 - .../missions/base/mission_dynamic_base.script | 2 - .../dynamic/bounty_probe_droid.script | 2 - .../missions/dynamic/bounty_probot.script | 2 - .../missions/dynamic/bounty_seeker.script | 2 - .../dynamic/deliver_npc_spawner.script | 2 - .../missions/dynamic/mission_bounty.script | 2 - .../dynamic/mission_deliver_npc.script | 2 - .../npc_lair/lair_interactivity.script | 2 - .../.deps/systems/npc_lair/npc_lair.script | 2 - .../.deps/systems/npc_lair/npc_lair_ai.script | 2 - .../script/.deps/systems/sign/sign.script | 2 - .../systems/spawning/dropship/base.script | 2 - .../spawning/dropship/player_shuttle.script | 2 - .../systems/spawning/spawn_tangible.script | 2 - .../systems/spawning/spawned_tracker.script | 2 - .../base/dummy_treasure_drum.script | 2 - .../treasure_map/base/treasure_drum.script | 2 - .../treasure_map/base/treasure_guard.script | 2 - .../treasure_map/base/treasure_map.script | 2 - .../systems/turret/advanced_turret_ai.script | 2 - .../vehicle_control_device.script | 2 - .../structure_storage_increase_deed.script | 2 - .../.deps/terminal/base/base_terminal.script | 2 - .../script/.deps/terminal/city_vote.script | 2 - .../terminal/gcw_publish_gift_terminal.script | 2 - .../game/script/.deps/terminal/greeter.script | 2 - .../script/.deps/terminal/nonvendor.script | 2 - .../script/.deps/terminal/npc_vendor.script | 2 - .../.deps/terminal/terminal_camp.script | 2 - .../terminal_character_builder.script | 2 - .../.deps/terminal/terminal_city.script | 2 - .../terminal/terminal_city_junk_dealer.script | 2 - .../terminal/terminal_gcw_publish_gift.script | 2 - .../.deps/terminal/terminal_guild.script | 2 - .../.deps/terminal/terminal_structure.script | 2 - .../terminal/terminal_travel_instant.script | 2 - .../terminal_travel_instant_one_use.script | 2 - .../.deps/test/cannot_die_healing_test.script | 2 - .../script/.deps/test/jhaskell_test.script | 2 - .../script/.deps/test/shuttle_test.script | 2 - .../empire_day_interior_npc_spawner.script | 2 - .../.deps/theme_park/lok/cantina.script | 2 - .../meatlump/code_break_minigame.script | 2 - .../meatlump/destroy_food_supplies.script | 2 - .../meatlump/destroy_weapon_cache.script | 2 - .../meatlump/destroy_weapon_cachev2.script | 2 - .../meatlump/disarm_bomb_puzzle.script | 2 - .../meatlump/grant_map_quest_object.script | 2 - .../meatlump_guard_trigger_volume.script | 2 - .../meatlump_spy_trigger_volume.script | 2 - .../meatlump/qrant_map_quest_object.script | 2 - .../meatlump/slicing_minigame.script | 2 - .../meatlump/target_map_puzzle.script | 2 - .../theme_park/nym/boss_controller.script | 2 - .../.deps/theme_park/nym/boss_foreman.script | 2 - .../theme_park/nym/boss_kell_lapaz.script | 2 - .../nym/boss_nyms_girlfriend.script | 2 - .../theme_park/nym/boss_nyms_themepark.script | 2 - .../theme_park/nym/boss_udo_barnet.script | 2 - .../.deps/theme_park/nym/cave_hacker.script | 2 - .../.deps/theme_park/nym/computer.script | 2 - .../.deps/theme_park/nym/droid_cave.script | 2 - .../nym/droid_cave_collectible.script | 2 - .../theme_park/nym/droid_cave_died.script | 2 - .../theme_park/nym/droid_cave_gate.script | 2 - .../theme_park/nym/droid_cave_prisoner.script | 2 - .../.deps/theme_park/nym/droid_module.script | 2 - .../nym/dumpster_quest_object.script | 2 - .../.deps/theme_park/nym/gas_filter.script | 2 - .../.deps/theme_park/nym/grenade_crate.script | 2 - .../nym/kusak_nyms_themepark.script | 2 - .../.deps/theme_park/nym/mining_cave.script | 2 - .../.deps/theme_park/nym/nym_ambush_ai.script | 2 - .../nym/nym_dungeon_collectible.script | 2 - .../theme_park/nym/nym_elevator_down.script | 2 - .../theme_park/nym/nym_elevator_up.script | 2 - .../.deps/theme_park/nym/research_lab.script | 2 - .../theme_park/nym/research_lab_died.script | 2 - .../.deps/theme_park/nym/stronghold.script | 2 - .../theme_park/nym/stronghold_ladder.script | 2 - .../water_filtration_chemical_deposit.script | 2 - .../theme_park/nym/weed_quest_object.script | 2 - .../.deps/theme_park/nym/weed_spawning.script | 2 - .../theme_park/outbreak/beast_pathing.script | 2 - .../blackwing_canister_destroy.script | 2 - .../camp_arrival_trigger_volume.script | 2 - .../theme_park/outbreak/camp_defense.script | 2 - .../outbreak/camp_defense_spawner.script | 2 - .../outbreak/camp_survivor_spawning.script | 2 - .../outbreak/delivery_beast_spawner.script | 2 - .../outbreak/outbreak_defense_enemy.script | 2 - .../outbreak/rescue_trigger_volume.script | 2 - .../outbreak/survivor_pathing.script | 2 - .../outbreak_prolog/dead_npc_script.script | 2 - .../publish_gift_prolog_quest.script | 2 - .../script/.deps/theme_park/poi/base.script | 2 - .../script/.deps/working/cannot_die.script | 2 - .../.deps/working/color_index_testing.script | 2 - .../script/.deps/working/jhaskell_test.script | 2 - .../compiled/game/script/ai/ai.java | 3114 --- .../game/script/ai/ai_combat_target.java | 127 - .../script/ai/bark_string_on_initialize.java | 66 - .../game/script/ai/creature_combat.java | 1575 -- .../compiled/game/script/base_script.java | 291 - .../game/script/city/guard_spawner.java | 445 - .../conversation/bib_fortuna_mos_eisley.java | 1017 - .../script/conversation/blacksun_guri.java | 3996 ---- .../boss_terminal_mining_cave.java | 302 - .../boss_terminal_mining_cave_controller.java | 440 - .../boss_terminal_mining_cave_foreman.java | 440 - .../boss_terminal_mining_research_barnet.java | 302 - .../boss_terminal_mining_research_lapaz.java | 302 - .../boss_terminal_pirate_cave.java | 446 - .../boss_terminal_research_barnet.java | 440 - .../boss_terminal_research_lapaz.java | 440 - .../script/conversation/bounty_probot.java | 288 - .../script/conversation/cale_serasai.java | 735 - .../script/conversation/camp_beta_leader.java | 629 - .../conversation/camp_delta_leader.java | 622 - .../conversation/camp_epsilon_leader.java | 448 - .../conversation/camp_gamma_leader.java | 691 - .../script/conversation/camp_survivor.java | 510 - .../script/conversation/captain_piett.java | 3843 --- .../conversation/choster_lok_cantina.java | 3295 --- .../collections_ice_cream_part_eight.java | 498 - .../collections_ice_cream_part_five.java | 440 - .../collections_ice_cream_part_four.java | 440 - .../collections_ice_cream_part_nine.java | 614 - .../collections_ice_cream_part_one.java | 325 - .../collections_ice_cream_part_seven.java | 440 - .../collections_ice_cream_part_six.java | 440 - .../collections_ice_cream_part_ten.java | 498 - .../collections_ice_cream_part_three.java | 383 - .../collections_ice_cream_part_two.java | 440 - .../script/conversation/delivery_chardle.java | 601 - .../script/conversation/delivery_hassel.java | 646 - .../script/conversation/delivery_pirrohn.java | 601 - .../conversation/detainment_npc_rescue.java | 412 - .../conversation/disgruntled_leader.java | 494 - .../conversation/doctor_griffax_jin.java | 496 - .../conversation/ep3_rodian_junk_dealer.java | 268 - .../conversation/ep3_wke_junk_dealer.java | 422 - .../faction_recruiter_imperial.java | 3743 --- .../conversation/faction_recruiter_rebel.java | 3719 --- .../conversation/gcw_demoralized_soldier.java | 953 - .../gcw_introduction_talon_karrde.java | 1874 -- .../script/conversation/grenz_zittoun.java | 2117 -- .../conversation/hacker_lok_pirate_cave.java | 3524 --- .../conversation/happer_mos_eisley.java | 531 - .../game/script/conversation/hx_138.java | 3878 --- .../imperial_empire_day_kaythree.java | 5509 ----- .../imperial_empire_day_major_tantor.java | 5263 ----- .../imperial_empire_day_mara_jade.java | 3291 --- .../imperial_empire_day_supply_officer.java | 313 - .../script/conversation/imperial_general.java | 2537 -- .../script/conversation/injured_agent.java | 212 - .../script/conversation/inquisitor_admin.java | 1108 - .../conversation/jedi_robe_jinsu_taker.java | 1118 - .../game/script/conversation/jinkins.java | 1352 -- .../conversation/junk_dealer_generic.java | 1027 - .../script/conversation/junk_dealer_jawa.java | 390 - .../conversation/junk_dealer_smuggler.java | 591 - .../game/script/conversation/kole.java | 1262 - .../game/script/conversation/kusak.java | 930 - .../game/script/conversation/mako_ghast.java | 1652 -- .../conversation/moore_lok_cantina.java | 2523 -- .../mtp_corellia_times_contact.java | 1227 - .../mtp_corsec_intelligence_officer.java | 757 - .../conversation/mtp_hideout_bomb_tech.java | 180 - .../mtp_hideout_food_supply_tech.java | 180 - .../conversation/mtp_hideout_map_tech.java | 180 - .../conversation/mtp_hideout_safe_tech.java | 725 - .../mtp_hideout_weapon_supply_tech.java | 180 - .../script/conversation/novicecollector.java | 752 - .../game/script/conversation/nym.java | 2081 -- .../conversation/nym_arena_referee.java | 603 - .../nym_themepark_quatermaster.java | 1269 - .../conversation/nym_themepark_smuggler.java | 578 - .../outbreak_defense_erlem_math_delta.java | 891 - .../outbreak_defense_kyraa_naa.java | 963 - .../outbreak_defense_mika_horn_alpha.java | 831 - ...eak_defense_stephon_sprocketfire_beta.java | 891 - .../outbreak_defense_zsu_val_epsilon.java | 894 - .../conversation/outbreak_han_solo.java | 3553 --- .../conversation/prisoner_pirate_cave.java | 563 - ...io_delivery_deathtrooper_conversation.java | 1352 -- .../game/script/conversation/ran_machado.java | 617 - .../script/conversation/rebel_general.java | 2492 -- .../rebel_offensive_supply_terminal.java | 3247 --- .../conversation/rebel_pilot_rescue.java | 307 - .../rebel_remembrance_day_captain_derlin.java | 4564 ---- .../rebel_remembrance_day_rieekan.java | 4448 ---- .../rebel_remembrance_day_wedge.java | 490 - .../rebel_remembrance_day_wedge_antilles.java | 2973 --- .../game/script/conversation/rek_thelcar.java | 2137 -- .../conversation/scientist_collection.java | 824 - .../game/script/conversation/sheeli.java | 441 - .../shuttle_control_terminal.java | 523 - .../conversation/slicer_01_mos_taike.java | 2830 --- .../script/conversation/slicer_02_lok.java | 977 - .../script/conversation/stuvany_inglen.java | 1998 -- .../game/script/conversation/trig_longo.java | 1007 - .../game/script/conversation/vana_sage.java | 2302 -- .../script/conversation/water_treatment.java | 1090 - .../game/script/conversation/zahara_cody.java | 2311 -- .../game/script/corpse/ai_corpse.java | 587 - .../game/script/creature/dynamic_enemy.java | 185 - .../game/script/creature/foraging_enemy.java | 275 - .../game/script/creature/sarlacc.java | 227 - .../game/script/creature/serving_droid.java | 847 - .../game/script/event/dianoga_dumpster.java | 1591 -- .../event/emp_day/crash_site_requisition.java | 232 - .../empire_day_interior_spawn_npc.java | 73 - .../empired_day_interior_spawn_npc.java | 40 - .../factional_guard_self_destruct.java | 37 - .../give_multiple_items_to_supply_npc.java | 366 - .../event/emp_day/goodbye_path_destroy.java | 219 - .../event/emp_day/imperial_empty_sign.java | 258 - .../emp_day/imperial_recruitment_sign.java | 258 - .../event/emp_day/rebel_empty_sign.java | 258 - .../event/emp_day/rebel_resistance_sign.java | 258 - .../rescue_faction_npc_trigger_volume.java | 191 - .../event/emperorsday/emperor_statue.java | 1575 -- .../event/emperorsday/imperial_npc.java | 257 - .../emperorsday/imperial_npc_corpse.java | 107 - .../script/event/emperorsday/rebel_npc.java | 322 - .../event/emperorsday/rebel_npc_corpse.java | 110 - .../event/emperorsday/yoda_fountain.java | 1652 -- .../script/event/gcwraids/cheerleader.java | 469 - .../game/script/event/holiday_controller.java | 471 - .../sarlacc_furniture_terminal.java | 1234 - .../script/event/planet_event_handler.java | 336 - .../game/script/faction_perk/hq/loader.java | 262 - .../game/script/faction_perk/hq/terminal.java | 1499 -- .../item/armor/biolink_item_non_faction.java | 186 - .../game/script/item/armor/new_armor.java | 478 - .../buff_click_biolink_item_non_faction.java | 183 - .../game/script/item/buff_click_item.java | 190 - .../game/script/item/clicky_biolink_item.java | 184 - .../game/script/item/droid/serving_droid.java | 847 - .../item/droid/serving_droid_terminal.java | 449 - .../script/item/ice_cream_fryer/fryer.java | 641 - .../item/ice_cream_fryer/ice_cream_buff.java | 89 - .../item/ice_cream_fryer/ice_cream_fail.java | 269 - .../ice_cream_fryer/ice_cream_nobuff.java | 268 - .../script/item/loot_kits/loot_kit_base.java | 567 - .../item/loot_schematic/loot_schematic.java | 432 - .../item/publish_gift/holopet_emitter.java | 822 - .../game/script/item/static_item_base.java | 496 - .../item/structure_deed/city_hall_deed.java | 115 - .../tool/crafted_armor_customization_kit.java | 392 - .../item/tool/crafted_armor_recolor_kit.java | 464 - .../tool/structure_customization_kit.java | 360 - .../script/item/trigger_breach_music.java | 201 - .../wearable/allow_player_custom_color.java | 112 - .../set_non_armor_wearable_socket.java | 48 - .../game/script/library/advanced_turret.java | 690 - .../compiled/game/script/library/ai_lib.java | 2372 -- .../compiled/game/script/library/attrib.java | 38 - .../compiled/game/script/library/badge.java | 773 - .../game/script/library/beast_lib.java | 6351 ----- .../game/script/library/bounty_hunter.java | 782 - .../compiled/game/script/library/buff.java | 2250 -- .../compiled/game/script/library/camping.java | 970 - .../game/script/library/collection.java | 1946 -- .../game/script/library/consumable.java | 1110 - .../compiled/game/script/library/corpse.java | 1438 -- .../compiled/game/script/library/create.java | 1539 -- .../game/script/library/factions.java | 3159 --- .../compiled/game/script/library/gcw.java | 3677 --- .../game/script/library/groundquests.java | 2269 -- .../compiled/game/script/library/guild.java | 1163 - .../compiled/game/script/library/healing.java | 6827 ------ .../compiled/game/script/library/holiday.java | 1755 -- .../compiled/game/script/library/hq.java | 1871 -- .../compiled/game/script/library/loot.java | 3051 --- .../game/script/library/movement.java | 757 - .../compiled/game/script/library/pclib.java | 1960 -- .../game/script/library/performance.java | 4482 ---- .../game/script/library/player_structure.java | 9495 -------- .../game/script/library/resource.java | 1468 -- .../compiled/game/script/library/ship_ai.java | 1056 - .../game/script/library/smuggler.java | 1812 -- .../game/script/library/space_combat.java | 6243 ----- .../game/script/library/space_crafting.java | 3335 --- .../game/script/library/space_create.java | 524 - .../game/script/library/spawning.java | 351 - .../game/script/library/static_item.java | 2695 --- .../compiled/game/script/library/stealth.java | 4649 ---- .../compiled/game/script/library/sui.java | 2391 -- .../compiled/game/script/library/tcg.java | 1079 - .../compiled/game/script/library/trial.java | 3616 --- .../compiled/game/script/library/utils.java | 10190 -------- .../compiled/game/script/library/vehicle.java | 1267 - .../game/script/library/vendor_lib.java | 996 - .../compiled/game/script/library/weapons.java | 3457 --- .../compiled/game/script/library/xp.java | 2890 --- .../compiled/game/script/make_debug | 20 - .../compiled/game/script/make_debug.btm | 23 - .../compiled/game/script/make_release | 10 - .../compiled/game/script/make_release.btm | 18 - .../compiled/game/script/make_script | 22 - .../compiled/game/script/makedata.btm | 24 - .../compiled/game/script/makescriptd.btm | 20 - .../compiled/game/script/makescriptj.btm | 20 - .../game/script/npc/converse/junk_dealer.java | 226 - .../npc/faction_recruiter/biolink_item.java | 236 - .../npc/faction_recruiter/faction_item.java | 75 - .../faction_recruiter/faction_recruiter.java | 975 - .../npc/jawa_traders/jawa_trader_01.java | 94 - .../npc/jawa_traders/jawa_trader_02.java | 94 - .../npc/jawa_traders/jawa_trader_03.java | 95 - .../npc/jawa_traders/jawa_trader_bounty.java | 94 - .../script/npc/vendor/object_for_sale.java | 497 - .../game/script/object/autostack.java | 365 - .../game/script/planet/planet_base.java | 271 - .../game/script/player/base/base_player.java | 15557 ------------- .../game/script/player/live_conversions.java | 1236 - .../game/script/player/player_building.java | 6956 ------ .../game/script/player/player_collection.java | 140 - .../game/script/player/player_faction.java | 781 - .../game/script/player/player_gm.java | 105 - .../game/script/player/player_instance.java | 1014 - .../game/script/player/player_sui.java | 262 - .../game/script/player/player_utility.java | 3802 --- .../script/player/skill/player_teaching.java | 419 - .../quest/force_sensitive/fs_buff_item.java | 314 - .../intellect_spawn_control.java | 391 - .../game/script/quest/task/craft.java | 150 - .../game/script/quest/task/ground/defend.java | 403 - .../game/script/quest/task/ground/escort.java | 310 - .../util/quest_use_object_on_object.java | 158 - .../quest/task/ground/wait_for_signal.java | 340 - .../ground/wave_event_controller_npc.java | 589 - .../quest/utility/destroy_notification.java | 110 - .../utility/dynamic_spawn_off_quest_item.java | 128 - .../game/script/space/ai/space_ai.java | 185 - .../game/script/space/combat/combat_ship.java | 1381 -- .../script/space/quest_logic/assassinate.java | 367 - .../space/quest_logic/assassinate_ship.java | 79 - .../script/structure/permanent_structure.java | 1945 -- .../script/systems/buff/buff_handler.java | 6178 ----- .../collection_handle_object_on_object.java | 31 - .../collection_use_object_on_object.java | 266 - .../systems/collections/consume_click.java | 249 - .../systems/collections/consume_loot.java | 387 - .../collections/grant_collection_quest.java | 146 - .../publish_gift_quest_giver_object.java | 220 - .../publish_gift/publish_gift_shuttle.java | 80 - .../script/systems/combat/combat_actions.java | 19424 ---------------- .../script/systems/combat/combat_weapon.java | 686 - .../script/systems/crafting/base_tool.java | 480 - ...crafting_base_furniture_customization.java | 69 - .../structure_customization_kit.java | 88 - .../armor_analysis_tool.java | 332 - .../dungeon_sequencer/ai_controller.java | 1005 - .../sequence_controller.java | 2651 --- .../systems/gcw/flip_banner_onpole.java | 88 - .../script/systems/gcw/gcw_barricade.java | 342 - .../game/script/systems/gcw/gcw_camp.java | 216 - .../game/script/systems/gcw/gcw_city.java | 1388 -- .../game/script/systems/gcw/gcw_city_kit.java | 327 - .../systems/gcw/gcw_city_kit_turret.java | 160 - .../script/systems/gcw/gcw_city_pylon.java | 499 - .../systems/gcw/gcw_city_pylon_barricade.java | 37 - .../systems/gcw/gcw_city_pylon_patrol.java | 39 - .../systems/gcw/gcw_city_pylon_tower.java | 37 - .../systems/gcw/gcw_city_pylon_turret.java | 37 - .../systems/gcw/gcw_city_pylon_vehicle.java | 37 - .../gcw/gcw_city_pylon_vehicle_boss.java | 71 - .../systems/gcw/gcw_damaged_vehicle.java | 258 - .../gcw/gcw_defensive_general_boss.java | 495 - .../gcw/gcw_entertainer_faction_quest.java | 133 - .../game/script/systems/gcw/gcw_npc_hurt.java | 200 - .../game/script/systems/gcw/gcw_patrol.java | 667 - .../systems/gcw/gcw_patrol_point_npc_ai.java | 58 - .../systems/gcw/gcw_poi_guard_spawning.java | 80 - .../script/systems/gcw/gcw_poi_spawner.java | 80 - .../systems/gcw/gcw_smuggler_device.java | 186 - .../game/script/systems/gcw/gcw_tower.java | 259 - .../game/script/systems/gcw/gcw_turret.java | 295 - .../systems/gcw/gcw_vehicle_patrol.java | 444 - .../systems/gcw/static_base/base_master.java | 519 - .../systems/jedi/jedi_saber_component.java | 525 - .../missions/dynamic/bounty_probe_droid.java | 388 - .../missions/dynamic/bounty_probot.java | 100 - .../missions/dynamic/bounty_seeker.java | 46 - .../missions/dynamic/deliver_npc_spawner.java | 51 - .../missions/dynamic/mission_bounty.java | 785 - .../missions/dynamic/mission_deliver_npc.java | 349 - .../systems/npc_lair/lair_interactivity.java | 144 - .../script/systems/npc_lair/npc_lair.java | 1526 -- .../script/systems/npc_lair/npc_lair_ai.java | 972 - .../game/script/systems/sign/sign.java | 133 - .../spawning/dropship/player_shuttle.java | 76 - .../systems/spawning/spawn_tangible.java | 162 - .../systems/spawning/spawned_tracker.java | 95 - .../base/dummy_treasure_drum.java | 412 - .../treasure_map/base/treasure_drum.java | 47 - .../treasure_map/base/treasure_guard.java | 338 - .../treasure_map/base/treasure_map.java | 1320 -- .../systems/turret/advanced_turret_ai.java | 135 - .../vehicle_control_device.java | 1158 - .../structure_storage_increase_deed.java | 192 - .../game/script/terminal/city_vote.java | 675 - .../terminal/gcw_publish_gift_terminal.java | 55 - .../game/script/terminal/greeter.java | 4167 ---- .../game/script/terminal/nonvendor.java | 256 - .../game/script/terminal/npc_vendor.java | 636 - .../game/script/terminal/terminal_camp.java | 136 - .../terminal/terminal_character_builder.java | 10666 --------- .../game/script/terminal/terminal_city.java | 1995 -- .../terminal/terminal_city_junk_dealer.java | 267 - .../terminal/terminal_gcw_publish_gift.java | 580 - .../game/script/terminal/terminal_guild.java | 2043 -- .../script/terminal/terminal_structure.java | 1000 - .../terminal/terminal_travel_instant.java | 233 - .../terminal_travel_instant_one_use.java | 144 - .../script/test/cannot_die_healing_test.java | 37 - .../game/script/test/jhaskell_test.java | 237 - .../game/script/test/shuttle_test.java | 67 - .../empire_day_interior_npc_spawner.java | 432 - .../game/script/theme_park/lok/cantina.java | 226 - .../meatlump/code_break_minigame.java | 530 - .../meatlump/destroy_food_supplies.java | 398 - .../meatlump/destroy_weapon_cache.java | 589 - .../meatlump/destroy_weapon_cachev2.java | 595 - .../meatlump/disarm_bomb_puzzle.java | 792 - .../meatlump/grant_map_quest_object.java | 136 - .../meatlump_guard_trigger_volume.java | 192 - .../meatlump/meatlump_spy_trigger_volume.java | 131 - .../meatlump/qrant_map_quest_object.java | 281 - .../theme_park/meatlump/slicing_minigame.java | 667 - .../meatlump/target_map_puzzle.java | 870 - .../theme_park/nym/boss_controller.java | 132 - .../script/theme_park/nym/boss_foreman.java | 132 - .../theme_park/nym/boss_kell_lapaz.java | 132 - .../theme_park/nym/boss_nyms_girlfriend.java | 205 - .../theme_park/nym/boss_nyms_themepark.java | 531 - .../theme_park/nym/boss_udo_barnet.java | 132 - .../script/theme_park/nym/cave_hacker.java | 345 - .../game/script/theme_park/nym/computer.java | 64 - .../script/theme_park/nym/droid_cave.java | 262 - .../nym/droid_cave_collectible.java | 65 - .../theme_park/nym/droid_cave_died.java | 43 - .../theme_park/nym/droid_cave_gate.java | 39 - .../theme_park/nym/droid_cave_prisoner.java | 109 - .../script/theme_park/nym/droid_module.java | 65 - .../theme_park/nym/dumpster_quest_object.java | 192 - .../script/theme_park/nym/gas_filter.java | 66 - .../script/theme_park/nym/grenade_crate.java | 64 - .../theme_park/nym/kusak_nyms_themepark.java | 391 - .../script/theme_park/nym/mining_cave.java | 252 - .../script/theme_park/nym/nym_ambush_ai.java | 208 - .../nym/nym_dungeon_collectible.java | 65 - .../theme_park/nym/nym_elevator_down.java | 106 - .../theme_park/nym/nym_elevator_up.java | 58 - .../script/theme_park/nym/research_lab.java | 226 - .../theme_park/nym/research_lab_died.java | 35 - .../script/theme_park/nym/stronghold.java | 683 - .../theme_park/nym/stronghold_ladder.java | 52 - .../water_filtration_chemical_deposit.java | 211 - .../theme_park/nym/weed_quest_object.java | 346 - .../script/theme_park/nym/weed_spawning.java | 161 - .../theme_park/outbreak/beast_pathing.java | 618 - .../outbreak/blackwing_canister_destroy.java | 173 - .../outbreak/camp_arrival_trigger_volume.java | 67 - .../theme_park/outbreak/camp_defense.java | 404 - .../outbreak/camp_defense_spawner.java | 352 - .../outbreak/camp_survivor_spawning.java | 130 - .../outbreak/delivery_beast_spawner.java | 311 - .../outbreak/outbreak_defense_enemy.java | 235 - .../outbreak/rescue_trigger_volume.java | 223 - .../theme_park/outbreak/survivor_pathing.java | 375 - .../outbreak_prolog/dead_npc_script.java | 269 - .../publish_gift_prolog_quest.java | 210 - .../game/script/working/cannot_die.java | 37 - .../script/working/color_index_testing.java | 115 - .../game/script/working/jhaskell_test.java | 2709 --- 773 files changed, 397558 deletions(-) delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/ai/ai.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/ai/ai_combat_target.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/ai/bark_string_on_initialize.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/ai/creature_combat.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/base/remote_object.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/base/remote_object_requester.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/base_class.java delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/base_script.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/city/guard_spawner.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/combat_engine.java delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/bib_fortuna_mos_eisley.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/blacksun_guri.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave_controller.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave_foreman.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_research_barnet.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_research_lapaz.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_pirate_cave.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_research_barnet.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_research_lapaz.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/bounty_probot.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/cale_serasai.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/camp_beta_leader.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/camp_delta_leader.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/camp_epsilon_leader.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/camp_gamma_leader.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/camp_survivor.java delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/camp_survivor.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/captain_piett.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/choster_lok_cantina.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_eight.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_five.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_four.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_nine.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_one.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_seven.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_six.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_ten.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_three.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_two.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_chardle.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_hassel.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_pirrohn.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/detainment_npc_rescue.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/disgruntled_leader.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/doctor_griffax_jin.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/ep3_rodian_junk_dealer.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/ep3_wke_junk_dealer.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/faction_recruiter_imperial.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/faction_recruiter_rebel.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/gcw_demoralized_soldier.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/gcw_introduction_talon_karrde.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/grenz_zittoun.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/hacker_lok_pirate_cave.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/happer_mos_eisley.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/hx_138.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_kaythree.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_major_tantor.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_mara_jade.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_supply_officer.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_general.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/injured_agent.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/inquisitor_admin.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/jedi_robe_jinsu_taker.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/jinkins.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_generic.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_jawa.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_smuggler.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/kole.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/kusak.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/mako_ghast.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/moore_lok_cantina.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_corellia_times_contact.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_corsec_intelligence_officer.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_bomb_tech.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_food_supply_tech.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_map_tech.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_safe_tech.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_weapon_supply_tech.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/novicecollector.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/nym.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/nym_arena_referee.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/nym_themepark_quatermaster.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/nym_themepark_smuggler.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_erlem_math_delta.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_kyraa_naa.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_mika_horn_alpha.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_stephon_sprocketfire_beta.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_zsu_val_epsilon.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_han_solo.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/prisoner_pirate_cave.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/radio_delivery_deathtrooper_conversation.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/ran_machado.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_general.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_offensive_supply_terminal.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_pilot_rescue.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_captain_derlin.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_rieekan.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_wedge.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_wedge_antilles.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/rek_thelcar.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/scientist_collection.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/sheeli.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/shuttle_control_terminal.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/slicer_01_mos_taike.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/slicer_02_lok.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/stuvany_inglen.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/trig_longo.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/vana_sage.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/water_treatment.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/conversation/zahara_cody.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/corpse/ai_corpse.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/creature/dynamic_enemy.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/creature/foraging_enemy.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/creature/sarlacc.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/creature/serving_droid.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/dianoga_dumpster.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/crash_site_requisition.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/empire_day_interior_spawn_npc.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/empired_day_interior_spawn_npc.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/factional_guard_self_destruct.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/give_multiple_items_to_supply_npc.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/goodbye_path_destroy.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/imperial_empty_sign.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/imperial_recruitment_sign.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rebel_empty_sign.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rebel_resistance_sign.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rescue_faction_npc_trigger_volume.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/emperor_statue.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/imperial_npc.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/imperial_npc_corpse.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/rebel_npc.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/rebel_npc_corpse.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/yoda_fountain.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/gcwraids/cheerleader.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/holiday_controller.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/housepackup/sarlacc_furniture_terminal.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/event/planet_event_handler.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/faction_perk/hq/loader.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/faction_perk/hq/terminal.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/armor/biolink_item_non_faction.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/armor/new_armor.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/buff_click_biolink_item_non_faction.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/buff_click_item.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/clicky_biolink_item.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/droid/serving_droid.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/droid/serving_droid_terminal.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/fryer.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_buff.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_fail.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_nobuff.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/loot_kits/loot_kit_base.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/loot_schematic/loot_schematic.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/publish_gift/holopet_emitter.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/static_item_base.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/structure_deed/city_hall_deed.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/structure_deed/player_structure_deed.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/tool/crafted_armor_customization_kit.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/tool/crafted_armor_recolor_kit.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/tool/structure_customization_kit.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/trigger_breach_music.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/wearable/allow_player_custom_color.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/item/wearable/set_non_armor_wearable_socket.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/advanced_turret.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/ai_lib.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/attrib.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/badge.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/beast_lib.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/bounty_hunter.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/buff.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/camping.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/collection.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/consumable.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/corpse.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/create.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/factions.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/gcw.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/groundquests.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/guild.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/healing.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/holiday.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/hq.java delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/hq.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/loot.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/movement.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/pclib.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/performance.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/player_structure.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/resource.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/ship_ai.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/smuggler.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/space_combat.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/space_crafting.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/space_create.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/spawning.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/static_item.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/stealth.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/sui.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/tcg.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/trial.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/utils.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/vehicle.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/vendor_lib.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/weapons.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/library/xp.scriptlib delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/npc/converse/junk_dealer.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/biolink_item.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/faction_item.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/faction_recruiter.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_01.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_02.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_03.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_bounty.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/npc/vendor/object_for_sale.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/object/autostack.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/planet/planet_base.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/player/base/base_player.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/player/live_conversions.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/player/player_building.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/player/player_collection.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/player/player_faction.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/player/player_gm.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/player/player_instance.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/player/player_sui.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/player/player_utility.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/player/skill/player_teaching.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/force_sensitive/fs_buff_item.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/hero_of_tatooine/intellect_spawn_control.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/task/craft.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/base_task.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/defend.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/escort.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/util/quest_use_object_on_object.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/wait_for_signal.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/wave_event_controller_npc.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/utility/destroy_notification.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/quest/utility/dynamic_spawn_off_quest_item.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/space/ai/space_ai.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/space/combat/combat_ship.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/assassinate.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/assassinate_ship.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/recovery.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/structure/permanent_structure.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/buff/buff_handler.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/collections/collection_handle_object_on_object.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/collections/collection_use_object_on_object.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/collections/consume_click.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/collections/consume_loot.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/collections/grant_collection_quest.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift/publish_gift_quest_giver_object.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift/publish_gift_shuttle.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift_quest_giver_object.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift_shuttle.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_actions.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_base.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_weapon.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/crafting/armor/crafting_customization_base.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/crafting/base_tool.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/crafting/crafting_base.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/crafting_base_furniture.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/crafting_base_furniture_customization.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/specific_item/structure_customization_kit.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/crafting/space/reverse_engineering/armor_analysis_tool.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/dungeon_sequencer/ai_controller.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/dungeon_sequencer/sequence_controller.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/flip_banner.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/flip_banner_onpole.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_barricade.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_camp.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_kit.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_kit_turret.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_barricade.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_patrol.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_tower.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_turret.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_vehicle.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_vehicle_boss.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_damaged_vehicle.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_defensive_general_boss.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_entertainer_faction_quest.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_npc_hurt.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_patrol.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_patrol_point_npc_ai.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_poi_guard_spawning.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_poi_spawner.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_smuggler_device.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_tower.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_turret.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_vehicle_patrol.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/gcw/static_base/base_master.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/jedi/jedi_saber_component.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/missions/base/mission_base.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/missions/base/mission_dynamic_base.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_probe_droid.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_probot.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_seeker.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/deliver_npc_spawner.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/mission_bounty.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/mission_deliver_npc.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/lair_interactivity.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/npc_lair.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/npc_lair_ai.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/sign/sign.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/spawning/dropship/base.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/spawning/dropship/player_shuttle.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/spawning/spawn_tangible.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/spawning/spawned_tracker.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/dummy_treasure_drum.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_drum.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_guard.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_map.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/turret/advanced_turret_ai.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/vehicle_system/vehicle_control_device.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/systems/veteran_reward/structure_storage_increase_deed.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/base/base_terminal.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/city_vote.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/gcw_publish_gift_terminal.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/greeter.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/nonvendor.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/npc_vendor.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_camp.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_character_builder.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_city.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_city_junk_dealer.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_gcw_publish_gift.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_guild.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_structure.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_travel_instant.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_travel_instant_one_use.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/test/cannot_die_healing_test.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/test/jhaskell_test.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/test/shuttle_test.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/dungeon/empire_day_interior_npc_spawner.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/lok/cantina.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/code_break_minigame.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_food_supplies.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_weapon_cache.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_weapon_cachev2.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/disarm_bomb_puzzle.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/grant_map_quest_object.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/meatlump_guard_trigger_volume.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/meatlump_spy_trigger_volume.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/qrant_map_quest_object.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/slicing_minigame.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/target_map_puzzle.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_controller.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_foreman.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_kell_lapaz.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_nyms_girlfriend.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_nyms_themepark.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_udo_barnet.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/cave_hacker.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/computer.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_collectible.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_died.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_gate.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_prisoner.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_module.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/dumpster_quest_object.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/gas_filter.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/grenade_crate.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/kusak_nyms_themepark.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/mining_cave.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_ambush_ai.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_dungeon_collectible.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_elevator_down.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_elevator_up.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/research_lab.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/research_lab_died.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/stronghold.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/stronghold_ladder.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/water_filtration_chemical_deposit.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/weed_quest_object.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/weed_spawning.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/beast_pathing.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/blackwing_canister_destroy.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_arrival_trigger_volume.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_defense.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_defense_spawner.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_survivor_spawning.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/delivery_beast_spawner.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/outbreak_defense_enemy.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/rescue_trigger_volume.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/survivor_pathing.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak_prolog/dead_npc_script.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak_prolog/publish_gift_prolog_quest.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/theme_park/poi/base.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/working/cannot_die.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/working/color_index_testing.script delete mode 100644 sku.0/sys.server/compiled/game/script/.deps/working/jhaskell_test.script delete mode 100644 sku.0/sys.server/compiled/game/script/ai/ai.java delete mode 100644 sku.0/sys.server/compiled/game/script/ai/ai_combat_target.java delete mode 100644 sku.0/sys.server/compiled/game/script/ai/bark_string_on_initialize.java delete mode 100644 sku.0/sys.server/compiled/game/script/ai/creature_combat.java delete mode 100644 sku.0/sys.server/compiled/game/script/base_script.java delete mode 100644 sku.0/sys.server/compiled/game/script/city/guard_spawner.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/bib_fortuna_mos_eisley.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/blacksun_guri.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_controller.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_foreman.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_barnet.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_lapaz.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/boss_terminal_pirate_cave.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_barnet.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_lapaz.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/bounty_probot.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/cale_serasai.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/camp_beta_leader.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/camp_delta_leader.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/camp_epsilon_leader.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/camp_gamma_leader.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/camp_survivor.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/captain_piett.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/choster_lok_cantina.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_eight.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_five.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_four.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_nine.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_one.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_seven.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_six.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_ten.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_three.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_two.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/delivery_chardle.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/delivery_hassel.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/delivery_pirrohn.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/detainment_npc_rescue.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/disgruntled_leader.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/doctor_griffax_jin.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/ep3_rodian_junk_dealer.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/ep3_wke_junk_dealer.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/faction_recruiter_imperial.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/faction_recruiter_rebel.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/gcw_demoralized_soldier.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/gcw_introduction_talon_karrde.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/grenz_zittoun.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/hacker_lok_pirate_cave.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/happer_mos_eisley.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/hx_138.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_kaythree.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_major_tantor.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_mara_jade.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_supply_officer.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/imperial_general.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/injured_agent.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/inquisitor_admin.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/jedi_robe_jinsu_taker.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/jinkins.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/junk_dealer_generic.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/junk_dealer_jawa.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/junk_dealer_smuggler.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/kole.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/kusak.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/mako_ghast.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/moore_lok_cantina.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/mtp_corellia_times_contact.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/mtp_corsec_intelligence_officer.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_bomb_tech.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_food_supply_tech.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_map_tech.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_safe_tech.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_weapon_supply_tech.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/novicecollector.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/nym.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/nym_arena_referee.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/nym_themepark_quatermaster.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/nym_themepark_smuggler.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_erlem_math_delta.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_kyraa_naa.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_mika_horn_alpha.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_stephon_sprocketfire_beta.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_zsu_val_epsilon.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/outbreak_han_solo.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/prisoner_pirate_cave.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/radio_delivery_deathtrooper_conversation.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/ran_machado.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/rebel_general.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/rebel_offensive_supply_terminal.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/rebel_pilot_rescue.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_captain_derlin.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_rieekan.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge_antilles.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/rek_thelcar.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/scientist_collection.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/sheeli.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/shuttle_control_terminal.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/slicer_01_mos_taike.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/slicer_02_lok.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/stuvany_inglen.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/trig_longo.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/vana_sage.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/water_treatment.java delete mode 100644 sku.0/sys.server/compiled/game/script/conversation/zahara_cody.java delete mode 100644 sku.0/sys.server/compiled/game/script/corpse/ai_corpse.java delete mode 100644 sku.0/sys.server/compiled/game/script/creature/dynamic_enemy.java delete mode 100644 sku.0/sys.server/compiled/game/script/creature/foraging_enemy.java delete mode 100644 sku.0/sys.server/compiled/game/script/creature/sarlacc.java delete mode 100644 sku.0/sys.server/compiled/game/script/creature/serving_droid.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/dianoga_dumpster.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/crash_site_requisition.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/empire_day_interior_spawn_npc.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/empired_day_interior_spawn_npc.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/factional_guard_self_destruct.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/give_multiple_items_to_supply_npc.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/goodbye_path_destroy.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/imperial_empty_sign.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/imperial_recruitment_sign.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/rebel_empty_sign.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/rebel_resistance_sign.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emp_day/rescue_faction_npc_trigger_volume.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emperorsday/emperor_statue.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emperorsday/imperial_npc.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emperorsday/imperial_npc_corpse.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emperorsday/rebel_npc.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emperorsday/rebel_npc_corpse.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/emperorsday/yoda_fountain.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/gcwraids/cheerleader.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/holiday_controller.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/housepackup/sarlacc_furniture_terminal.java delete mode 100644 sku.0/sys.server/compiled/game/script/event/planet_event_handler.java delete mode 100644 sku.0/sys.server/compiled/game/script/faction_perk/hq/loader.java delete mode 100644 sku.0/sys.server/compiled/game/script/faction_perk/hq/terminal.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/armor/biolink_item_non_faction.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/armor/new_armor.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/buff_click_biolink_item_non_faction.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/buff_click_item.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/clicky_biolink_item.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/droid/serving_droid.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/droid/serving_droid_terminal.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/fryer.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_buff.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_fail.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_nobuff.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/loot_kits/loot_kit_base.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/loot_schematic/loot_schematic.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/publish_gift/holopet_emitter.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/static_item_base.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/structure_deed/city_hall_deed.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/tool/crafted_armor_customization_kit.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/tool/crafted_armor_recolor_kit.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/tool/structure_customization_kit.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/trigger_breach_music.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/wearable/allow_player_custom_color.java delete mode 100644 sku.0/sys.server/compiled/game/script/item/wearable/set_non_armor_wearable_socket.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/advanced_turret.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/ai_lib.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/attrib.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/badge.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/beast_lib.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/bounty_hunter.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/buff.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/camping.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/collection.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/consumable.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/corpse.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/create.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/factions.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/gcw.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/groundquests.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/guild.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/healing.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/holiday.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/hq.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/loot.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/movement.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/pclib.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/performance.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/player_structure.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/resource.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/ship_ai.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/smuggler.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/space_combat.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/space_crafting.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/space_create.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/spawning.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/static_item.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/stealth.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/sui.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/tcg.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/trial.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/utils.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/vehicle.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/vendor_lib.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/weapons.java delete mode 100644 sku.0/sys.server/compiled/game/script/library/xp.java delete mode 100644 sku.0/sys.server/compiled/game/script/make_debug delete mode 100644 sku.0/sys.server/compiled/game/script/make_debug.btm delete mode 100644 sku.0/sys.server/compiled/game/script/make_release delete mode 100644 sku.0/sys.server/compiled/game/script/make_release.btm delete mode 100644 sku.0/sys.server/compiled/game/script/make_script delete mode 100644 sku.0/sys.server/compiled/game/script/makedata.btm delete mode 100644 sku.0/sys.server/compiled/game/script/makescriptd.btm delete mode 100644 sku.0/sys.server/compiled/game/script/makescriptj.btm delete mode 100644 sku.0/sys.server/compiled/game/script/npc/converse/junk_dealer.java delete mode 100644 sku.0/sys.server/compiled/game/script/npc/faction_recruiter/biolink_item.java delete mode 100644 sku.0/sys.server/compiled/game/script/npc/faction_recruiter/faction_item.java delete mode 100644 sku.0/sys.server/compiled/game/script/npc/faction_recruiter/faction_recruiter.java delete mode 100644 sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_01.java delete mode 100644 sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_02.java delete mode 100644 sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_03.java delete mode 100644 sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_bounty.java delete mode 100644 sku.0/sys.server/compiled/game/script/npc/vendor/object_for_sale.java delete mode 100644 sku.0/sys.server/compiled/game/script/object/autostack.java delete mode 100644 sku.0/sys.server/compiled/game/script/planet/planet_base.java delete mode 100644 sku.0/sys.server/compiled/game/script/player/base/base_player.java delete mode 100644 sku.0/sys.server/compiled/game/script/player/live_conversions.java delete mode 100644 sku.0/sys.server/compiled/game/script/player/player_building.java delete mode 100644 sku.0/sys.server/compiled/game/script/player/player_collection.java delete mode 100644 sku.0/sys.server/compiled/game/script/player/player_faction.java delete mode 100644 sku.0/sys.server/compiled/game/script/player/player_gm.java delete mode 100644 sku.0/sys.server/compiled/game/script/player/player_instance.java delete mode 100644 sku.0/sys.server/compiled/game/script/player/player_sui.java delete mode 100644 sku.0/sys.server/compiled/game/script/player/player_utility.java delete mode 100644 sku.0/sys.server/compiled/game/script/player/skill/player_teaching.java delete mode 100644 sku.0/sys.server/compiled/game/script/quest/force_sensitive/fs_buff_item.java delete mode 100644 sku.0/sys.server/compiled/game/script/quest/hero_of_tatooine/intellect_spawn_control.java delete mode 100644 sku.0/sys.server/compiled/game/script/quest/task/craft.java delete mode 100644 sku.0/sys.server/compiled/game/script/quest/task/ground/defend.java delete mode 100644 sku.0/sys.server/compiled/game/script/quest/task/ground/escort.java delete mode 100644 sku.0/sys.server/compiled/game/script/quest/task/ground/util/quest_use_object_on_object.java delete mode 100644 sku.0/sys.server/compiled/game/script/quest/task/ground/wait_for_signal.java delete mode 100644 sku.0/sys.server/compiled/game/script/quest/task/ground/wave_event_controller_npc.java delete mode 100644 sku.0/sys.server/compiled/game/script/quest/utility/destroy_notification.java delete mode 100644 sku.0/sys.server/compiled/game/script/quest/utility/dynamic_spawn_off_quest_item.java delete mode 100644 sku.0/sys.server/compiled/game/script/space/ai/space_ai.java delete mode 100644 sku.0/sys.server/compiled/game/script/space/combat/combat_ship.java delete mode 100644 sku.0/sys.server/compiled/game/script/space/quest_logic/assassinate.java delete mode 100644 sku.0/sys.server/compiled/game/script/space/quest_logic/assassinate_ship.java delete mode 100644 sku.0/sys.server/compiled/game/script/structure/permanent_structure.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/collections/collection_handle_object_on_object.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/collections/collection_use_object_on_object.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/collections/consume_click.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/collections/consume_loot.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/collections/grant_collection_quest.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/collections/publish_gift/publish_gift_quest_giver_object.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/collections/publish_gift/publish_gift_shuttle.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/combat/combat_actions.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/combat/combat_weapon.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/crafting/base_tool.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/crafting/furniture/crafting_base_furniture_customization.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/crafting/furniture/specific_item/structure_customization_kit.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/crafting/space/reverse_engineering/armor_analysis_tool.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/dungeon_sequencer/ai_controller.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/dungeon_sequencer/sequence_controller.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/flip_banner_onpole.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_barricade.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_camp.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_kit.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_kit_turret.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_barricade.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_patrol.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_tower.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_turret.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_vehicle.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_vehicle_boss.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_damaged_vehicle.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_defensive_general_boss.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_entertainer_faction_quest.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_npc_hurt.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_patrol.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_patrol_point_npc_ai.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_poi_guard_spawning.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_poi_spawner.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_smuggler_device.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_tower.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_turret.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/gcw_vehicle_patrol.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/gcw/static_base/base_master.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/jedi/jedi_saber_component.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_probe_droid.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_probot.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_seeker.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/missions/dynamic/deliver_npc_spawner.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/missions/dynamic/mission_bounty.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/missions/dynamic/mission_deliver_npc.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/npc_lair/lair_interactivity.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/npc_lair/npc_lair.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/npc_lair/npc_lair_ai.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/sign/sign.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/spawning/dropship/player_shuttle.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/spawning/spawn_tangible.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/spawning/spawned_tracker.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/treasure_map/base/dummy_treasure_drum.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_drum.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_guard.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_map.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/turret/advanced_turret_ai.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/vehicle_system/vehicle_control_device.java delete mode 100644 sku.0/sys.server/compiled/game/script/systems/veteran_reward/structure_storage_increase_deed.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/city_vote.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/gcw_publish_gift_terminal.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/greeter.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/nonvendor.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/npc_vendor.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/terminal_camp.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/terminal_city.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/terminal_city_junk_dealer.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/terminal_gcw_publish_gift.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/terminal_guild.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/terminal_structure.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant.java delete mode 100644 sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant_one_use.java delete mode 100644 sku.0/sys.server/compiled/game/script/test/cannot_die_healing_test.java delete mode 100644 sku.0/sys.server/compiled/game/script/test/jhaskell_test.java delete mode 100644 sku.0/sys.server/compiled/game/script/test/shuttle_test.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/dungeon/empire_day_interior_npc_spawner.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/lok/cantina.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/code_break_minigame.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_food_supplies.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_weapon_cache.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_weapon_cachev2.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/disarm_bomb_puzzle.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/grant_map_quest_object.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/meatlump_guard_trigger_volume.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/meatlump_spy_trigger_volume.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/qrant_map_quest_object.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/slicing_minigame.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/meatlump/target_map_puzzle.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/boss_controller.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/boss_foreman.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/boss_kell_lapaz.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/boss_nyms_girlfriend.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/boss_nyms_themepark.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/boss_udo_barnet.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/cave_hacker.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/computer.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_collectible.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_died.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_gate.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_prisoner.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/droid_module.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/dumpster_quest_object.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/gas_filter.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/grenade_crate.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/kusak_nyms_themepark.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/mining_cave.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/nym_ambush_ai.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/nym_dungeon_collectible.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/nym_elevator_down.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/nym_elevator_up.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/research_lab.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/research_lab_died.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/stronghold.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/stronghold_ladder.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/water_filtration_chemical_deposit.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/weed_quest_object.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/nym/weed_spawning.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak/beast_pathing.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak/blackwing_canister_destroy.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak/camp_arrival_trigger_volume.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak/camp_defense.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak/camp_defense_spawner.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak/camp_survivor_spawning.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak/delivery_beast_spawner.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak/outbreak_defense_enemy.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak/rescue_trigger_volume.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak/survivor_pathing.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak_prolog/dead_npc_script.java delete mode 100644 sku.0/sys.server/compiled/game/script/theme_park/outbreak_prolog/publish_gift_prolog_quest.java delete mode 100644 sku.0/sys.server/compiled/game/script/working/cannot_die.java delete mode 100644 sku.0/sys.server/compiled/game/script/working/color_index_testing.java delete mode 100644 sku.0/sys.server/compiled/game/script/working/jhaskell_test.java diff --git a/sku.0/sys.server/compiled/game/script/.deps/ai/ai.script b/sku.0/sys.server/compiled/game/script/.deps/ai/ai.script deleted file mode 100644 index 0238666e5..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/ai/ai.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_aggro ai/ai_combat ai/ai_combat_assist library/ai_lib library/attrib library/beast_lib library/buff library/callable library/camping library/chat library/collection library/colors library/corpse library/create library/factions library/gcw library/groundquests library/group library/instance library/locations library/loot library/performance library/permissions library/pet_lib library/posture library/prose library/resource library/scenario library/scheduled_drop library/scout library/static_item library/stealth library/storyteller library/sui library/utils library/xp -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnAddedToWorld#obj_id OnAttach#obj_id OnBehaviorChange#obj_id#int#int#int[] OnChangedPosture#obj_id#int#int OnDeath#obj_id#obj_id#obj_id OnDefenderCombatAction#obj_id#obj_id#obj_id#int OnDestroy#obj_id OnEndNpcConversation#obj_id#obj_id OnEnteredCombat#obj_id OnExitedCombat#obj_id OnFleePathNotFound#obj_id#obj_id OnFleeTargetLost#obj_id#obj_id OnFleeWaypoint#obj_id#obj_id OnFollowMoving#obj_id#obj_id OnFollowPathNotFound#obj_id#obj_id OnFollowTargetLost#obj_id#obj_id OnFollowWaiting#obj_id#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnGiveItem#obj_id#obj_id#obj_id OnIncapacitateTarget#obj_id#obj_id OnIncapacitated#obj_id#obj_id OnInvulnerableChanged#obj_id#boolean OnLoiterWaiting#obj_id#modifiable_float OnMovePathComplete#obj_id OnMovePathNotFound#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnRemovingFromWorld#obj_id OnSawAttack#obj_id#obj_id#obj_id[] OnStartNpcConversation#obj_id#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id aiCorpsePrepared#obj_id#dictionary applyModTrap#obj_id#dictionary attemptMilkHandler#obj_id#dictionary clearCollectionCameraParticle#obj_id#dictionary clearScriptVar#obj_id#dictionary corpseCleanup#obj_id#dictionary destroyAbandonedPet#obj_id#dictionary disableAI#obj_id#dictionary dizzyCheckFailed#obj_id#dictionary forceAnimalAttack#obj_id#dictionary handleAbortConversation#obj_id#dictionary handleAddMaster#obj_id#dictionary handleAnimationAction#obj_id#dictionary handleClearPathingFlag#obj_id#dictionary handleEntertainmentStart#obj_id#dictionary handleEntertainmentStop#obj_id#dictionary handleMilking#obj_id#dictionary handleMonitorMovement#obj_id#dictionary handleNoEntertainment#obj_id#dictionary handleOnAddedToWorldDelay#obj_id#dictionary handlePerformerStopPerforming#obj_id#dictionary handleRemoveMaster#obj_id#dictionary handleSetDefaultBehavior#obj_id#dictionary handleSpawnParameters#obj_id#dictionary handleWailingPet#obj_id#dictionary milkingCreatureStunFail#obj_id#dictionary milkingCreatureStunRemoval#obj_id#dictionary milkingCreatureStunned#obj_id#dictionary playDelayedClientEffect#obj_id#dictionary removeMeatlumpInvestigatorScriptVar#obj_id#dictionary removeMeatlumpRecruitmentScriptVar#obj_id#dictionary removeModTrap#obj_id#dictionary resumeDefaultCalmBehavior#obj_id#dictionary snareEffectOff#obj_id#dictionary stopFleeing#obj_id#dictionary xpDelegated#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/ai/ai_combat_target.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/ai/ai_combat_target.scriptlib deleted file mode 100644 index c805945ff..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/ai/ai_combat_target.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/buff library/pet_lib library/target_dummy library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/ai/bark_string_on_initialize.script b/sku.0/sys.server/compiled/game/script/.deps/ai/bark_string_on_initialize.script deleted file mode 100644 index 0e11d7406..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/ai/bark_string_on_initialize.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/chat -PROTOTYPES: OnAttach#obj_id barkString#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/ai/creature_combat.script b/sku.0/sys.server/compiled/game/script/.deps/ai/creature_combat.script deleted file mode 100644 index 15dc6607e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/ai/creature_combat.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_aggro ai/ai_combat ai/ai_combat_assist ai/ai_combat_damage ai/ai_combat_movement ai/ai_combat_target library/ai_lib library/beast_lib library/buff library/colors library/combat library/combat_consts library/factions library/instance library/movement library/pclib library/pet_lib library/posture library/scout library/stealth library/storyteller library/trial library/utils library/xp systems/combat/combat_base -PROTOTYPES: OnAddedToWorld#obj_id OnAiCombatFrame#obj_id OnAiPrimaryWeaponEquipped#obj_id#obj_id OnAiSecondaryWeaponEquipped#obj_id#obj_id OnAiTetherComplete#obj_id OnAiTetherStart#obj_id OnChangedPosture#obj_id#int#int OnCreatureDamaged#obj_id#obj_id#obj_id#int[] OnDestroy#obj_id OnDotPulse#obj_id#dictionary OnEnteredCombat#obj_id OnExitedCombat#obj_id OnFleePathNotFound#obj_id#obj_id OnFleeTargetLost#obj_id#obj_id OnFleeWaypoint#obj_id#obj_id OnFollowMoving#obj_id#obj_id OnFollowPathNotFound#obj_id#obj_id OnFollowTargetLost#obj_id#obj_id OnFollowWaiting#obj_id#obj_id OnHateTargetAdded#obj_id#obj_id OnHateTargetChanged#obj_id#obj_id OnHateTargetRemoved#obj_id#obj_id OnIncapacitateTarget#obj_id#obj_id OnIncapacitated#obj_id#obj_id OnMoveMoving#obj_id OnMovePathComplete#obj_id OnMovePathNotFound#obj_id checkForBeastSpecialsTakeOne#obj_id#dictionary checkForSpecials#obj_id#dictionary handleAggroCheck#obj_id#dictionary handleAggroStart#obj_id#dictionary handleCombatDestructionDelay#obj_id#dictionary handleMoveRandomClear#obj_id#dictionary handleSawRecapacitation#obj_id#dictionary handleTaunt#obj_id#dictionary persist_combat#obj_id#dictionary postCombatPathHome#obj_id#dictionary vocalizeEndCombat#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/base/remote_object.script b/sku.0/sys.server/compiled/game/script/.deps/base/remote_object.script deleted file mode 100644 index df6395717..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/base/remote_object.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/base/remote_object_requester.script b/sku.0/sys.server/compiled/game/script/.deps/base/remote_object_requester.script deleted file mode 100644 index 888331a26..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/base/remote_object_requester.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: base/remote_object library/utils -PROTOTYPES: OnClusterWideDataResponse#obj_id#String#String#int#String[]#dictionary[]#int createRemoteObjectResponse#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/base_class.java b/sku.0/sys.server/compiled/game/script/.deps/base_class.java deleted file mode 100644 index 30f12d7df..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/base_class.java +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: obj_id region -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/base_script.script b/sku.0/sys.server/compiled/game/script/.deps/base_script.script deleted file mode 100644 index 266bbbd77..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/base_script.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnGetAttributes#obj_id#obj_id#String[]#String[] OnGetScriptvars#obj_id#obj_id#String[]#String[] OnLocateObject#obj_id#dictionary OnSetWaypointActive#obj_id#dictionary OnSetWaypointLocation#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/city/guard_spawner.script b/sku.0/sys.server/compiled/game/script/.deps/city/guard_spawner.script deleted file mode 100644 index 3e056ce55..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/city/guard_spawner.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/create library/gcw library/locations library/utils -PROTOTYPES: OnAttach#obj_id OnHearSpeech#obj_id#obj_id#String OnInitialize#obj_id checkForStart#obj_id#dictionary cityMobKilled#obj_id#dictionary guardSpawnerRespawnNpc#obj_id#dictionary startSpawning#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/combat_engine.java b/sku.0/sys.server/compiled/game/script/.deps/combat_engine.java deleted file mode 100644 index 7df9a6517..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/combat_engine.java +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: base_class library/combat_consts library/utils location obj_id -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/bib_fortuna_mos_eisley.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/bib_fortuna_mos_eisley.script deleted file mode 100644 index cc6c68d74..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/bib_fortuna_mos_eisley.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/buff library/chat library/collection library/conversation library/create library/factions library/groundquests library/space_quest library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnDetach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/blacksun_guri.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/blacksun_guri.script deleted file mode 100644 index 2a2e5c4df..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/blacksun_guri.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/factions library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave.script deleted file mode 100644 index 154d2806e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id handleQuestFlavorObjectCleanup#obj_id#dictionary spawnEnemies#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave_controller.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave_controller.script deleted file mode 100644 index 154d2806e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave_controller.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id handleQuestFlavorObjectCleanup#obj_id#dictionary spawnEnemies#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave_foreman.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave_foreman.script deleted file mode 100644 index 154d2806e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_cave_foreman.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id handleQuestFlavorObjectCleanup#obj_id#dictionary spawnEnemies#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_research_barnet.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_research_barnet.script deleted file mode 100644 index 154d2806e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_research_barnet.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id handleQuestFlavorObjectCleanup#obj_id#dictionary spawnEnemies#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_research_lapaz.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_research_lapaz.script deleted file mode 100644 index 154d2806e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_mining_research_lapaz.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id handleQuestFlavorObjectCleanup#obj_id#dictionary spawnEnemies#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_pirate_cave.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_pirate_cave.script deleted file mode 100644 index 154d2806e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_pirate_cave.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id handleQuestFlavorObjectCleanup#obj_id#dictionary spawnEnemies#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_research_barnet.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_research_barnet.script deleted file mode 100644 index 154d2806e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_research_barnet.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id handleQuestFlavorObjectCleanup#obj_id#dictionary spawnEnemies#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_research_lapaz.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_research_lapaz.script deleted file mode 100644 index 154d2806e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/boss_terminal_research_lapaz.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id handleQuestFlavorObjectCleanup#obj_id#dictionary spawnEnemies#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/bounty_probot.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/bounty_probot.script deleted file mode 100644 index 198e8efa5..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/bounty_probot.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/cale_serasai.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/cale_serasai.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/cale_serasai.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_beta_leader.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_beta_leader.script deleted file mode 100644 index ce5db87c9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_beta_leader.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_delta_leader.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_delta_leader.script deleted file mode 100644 index ce5db87c9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_delta_leader.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_epsilon_leader.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_epsilon_leader.script deleted file mode 100644 index ce5db87c9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_epsilon_leader.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_gamma_leader.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_gamma_leader.script deleted file mode 100644 index ce5db87c9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_gamma_leader.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_survivor.java b/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_survivor.java deleted file mode 100644 index 36681b9e9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_survivor.java +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: * base_class/* base_script combat_engine/* library/ai_lib library/attrib library/chat library/collection library/conversation library/create library/groundquests library/spawning library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_survivor.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_survivor.script deleted file mode 100644 index f56a1ea4b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/camp_survivor.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/chat library/collection library/conversation library/create library/groundquests library/spawning library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnMovePathComplete#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id checkOwnerValidity#obj_id#dictionary cleanUpCampNpcAndParent#obj_id#dictionary cleanUpWhileConversing#obj_id#dictionary spawnEnemies#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/captain_piett.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/captain_piett.script deleted file mode 100644 index 2a2e5c4df..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/captain_piett.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/factions library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/choster_lok_cantina.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/choster_lok_cantina.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/choster_lok_cantina.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_eight.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_eight.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_eight.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_five.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_five.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_five.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_four.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_four.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_four.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_nine.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_nine.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_nine.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_one.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_one.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_one.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_seven.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_seven.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_seven.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_six.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_six.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_six.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_ten.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_ten.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_ten.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_three.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_three.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_three.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_two.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_two.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/collections_ice_cream_part_two.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_chardle.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_chardle.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_chardle.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_hassel.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_hassel.script deleted file mode 100644 index 5b3ae4f8e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_hassel.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_pirrohn.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_pirrohn.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/delivery_pirrohn.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/detainment_npc_rescue.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/detainment_npc_rescue.script deleted file mode 100644 index d6182b5fd..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/detainment_npc_rescue.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/buff library/chat library/collection library/conversation library/create library/factions library/groundquests library/holiday library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnDetach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/disgruntled_leader.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/disgruntled_leader.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/disgruntled_leader.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/doctor_griffax_jin.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/doctor_griffax_jin.script deleted file mode 100644 index 07fe37f3c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/doctor_griffax_jin.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id transformIntoMonster#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/ep3_rodian_junk_dealer.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/ep3_rodian_junk_dealer.script deleted file mode 100644 index b54b7e33f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/ep3_rodian_junk_dealer.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/smuggler library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/ep3_wke_junk_dealer.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/ep3_wke_junk_dealer.script deleted file mode 100644 index b54b7e33f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/ep3_wke_junk_dealer.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/smuggler library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/faction_recruiter_imperial.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/faction_recruiter_imperial.script deleted file mode 100644 index af7a83dd6..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/faction_recruiter_imperial.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/faction_perk library/factions library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/faction_recruiter_rebel.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/faction_recruiter_rebel.script deleted file mode 100644 index af7a83dd6..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/faction_recruiter_rebel.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/faction_perk library/factions library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/gcw_demoralized_soldier.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/gcw_demoralized_soldier.script deleted file mode 100644 index ead2d0751..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/gcw_demoralized_soldier.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/factions library/gcw library/groundquests library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/gcw_introduction_talon_karrde.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/gcw_introduction_talon_karrde.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/gcw_introduction_talon_karrde.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/grenz_zittoun.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/grenz_zittoun.script deleted file mode 100644 index efa3a5502..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/grenz_zittoun.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/collection library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/hacker_lok_pirate_cave.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/hacker_lok_pirate_cave.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/hacker_lok_pirate_cave.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/happer_mos_eisley.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/happer_mos_eisley.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/happer_mos_eisley.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/hx_138.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/hx_138.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/hx_138.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_kaythree.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_kaythree.script deleted file mode 100644 index d6182b5fd..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_kaythree.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/buff library/chat library/collection library/conversation library/create library/factions library/groundquests library/holiday library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnDetach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_major_tantor.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_major_tantor.script deleted file mode 100644 index 86a0aff3c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_major_tantor.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/buff library/chat library/collection library/conversation library/create library/factions library/groundquests library/holiday library/space_quest library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnDetach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_mara_jade.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_mara_jade.script deleted file mode 100644 index d6182b5fd..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_mara_jade.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/buff library/chat library/collection library/conversation library/create library/factions library/groundquests library/holiday library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnDetach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_supply_officer.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_supply_officer.script deleted file mode 100644 index d7fd4de41..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_empire_day_supply_officer.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/holiday library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_general.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_general.script deleted file mode 100644 index eae3ef1de..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/imperial_general.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/buff library/chat library/conversation library/create library/factions library/gcw library/groundquests library/holiday library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id playQuestIcon#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/injured_agent.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/injured_agent.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/injured_agent.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/inquisitor_admin.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/inquisitor_admin.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/inquisitor_admin.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/jedi_robe_jinsu_taker.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/jedi_robe_jinsu_taker.script deleted file mode 100644 index ae9e171cb..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/jedi_robe_jinsu_taker.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/jinkins.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/jinkins.script deleted file mode 100644 index efa3a5502..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/jinkins.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/collection library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_generic.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_generic.script deleted file mode 100644 index b54b7e33f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_generic.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/smuggler library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_jawa.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_jawa.script deleted file mode 100644 index b54b7e33f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_jawa.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/smuggler library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_smuggler.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_smuggler.script deleted file mode 100644 index 66e7fc645..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/junk_dealer_smuggler.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/group library/quests library/smuggler library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/kole.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/kole.script deleted file mode 100644 index efa3a5502..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/kole.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/collection library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/kusak.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/kusak.script deleted file mode 100644 index 6c5ce4d58..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/kusak.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id destroySelf#obj_id#dictionary setupWeedVar#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/mako_ghast.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/mako_ghast.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/mako_ghast.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/moore_lok_cantina.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/moore_lok_cantina.script deleted file mode 100644 index 2ceb93ea7..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/moore_lok_cantina.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/money library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_corellia_times_contact.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_corellia_times_contact.script deleted file mode 100644 index 1572d64ac..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_corellia_times_contact.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/collection library/conversation library/groundquests library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_corsec_intelligence_officer.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_corsec_intelligence_officer.script deleted file mode 100644 index fc729e0a4..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_corsec_intelligence_officer.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_bomb_tech.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_bomb_tech.script deleted file mode 100644 index fc729e0a4..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_bomb_tech.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_food_supply_tech.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_food_supply_tech.script deleted file mode 100644 index fc729e0a4..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_food_supply_tech.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_map_tech.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_map_tech.script deleted file mode 100644 index fc729e0a4..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_map_tech.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_safe_tech.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_safe_tech.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_safe_tech.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_weapon_supply_tech.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_weapon_supply_tech.script deleted file mode 100644 index fc729e0a4..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/mtp_hideout_weapon_supply_tech.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/novicecollector.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/novicecollector.script deleted file mode 100644 index 513b9d4be..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/novicecollector.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/nym.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/nym.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/nym.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/nym_arena_referee.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/nym_arena_referee.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/nym_arena_referee.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/nym_themepark_quatermaster.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/nym_themepark_quatermaster.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/nym_themepark_quatermaster.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/nym_themepark_smuggler.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/nym_themepark_smuggler.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/nym_themepark_smuggler.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_erlem_math_delta.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_erlem_math_delta.script deleted file mode 100644 index d9d13f7b8..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_erlem_math_delta.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id findGuardPosts#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_kyraa_naa.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_kyraa_naa.script deleted file mode 100644 index d9d13f7b8..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_kyraa_naa.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id findGuardPosts#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_mika_horn_alpha.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_mika_horn_alpha.script deleted file mode 100644 index d9d13f7b8..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_mika_horn_alpha.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id findGuardPosts#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_stephon_sprocketfire_beta.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_stephon_sprocketfire_beta.script deleted file mode 100644 index d9d13f7b8..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_stephon_sprocketfire_beta.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id findGuardPosts#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_zsu_val_epsilon.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_zsu_val_epsilon.script deleted file mode 100644 index d9d13f7b8..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_defense_zsu_val_epsilon.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id findGuardPosts#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_han_solo.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_han_solo.script deleted file mode 100644 index 30b344de1..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/outbreak_han_solo.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/factions library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id findChewie#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/prisoner_pirate_cave.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/prisoner_pirate_cave.script deleted file mode 100644 index d7f05a38f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/prisoner_pirate_cave.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/groundquests library/prose library/utils -PROTOTYPES: OnAttach#obj_id OnDestroy#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id checkArrivalLoopHandler#obj_id#dictionary handleDestroySelf#obj_id#dictionary handleUpdatePrisonerRescueQuest#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/radio_delivery_deathtrooper_conversation.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/radio_delivery_deathtrooper_conversation.script deleted file mode 100644 index ce5db87c9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/radio_delivery_deathtrooper_conversation.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/ran_machado.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/ran_machado.script deleted file mode 100644 index 1572d64ac..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/ran_machado.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/collection library/conversation library/groundquests library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_general.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_general.script deleted file mode 100644 index eae3ef1de..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_general.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/buff library/chat library/conversation library/create library/factions library/gcw library/groundquests library/holiday library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id playQuestIcon#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_offensive_supply_terminal.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_offensive_supply_terminal.script deleted file mode 100644 index a764b8bb0..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_offensive_supply_terminal.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/factions library/gcw library/groundquests library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_pilot_rescue.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_pilot_rescue.script deleted file mode 100644 index d6182b5fd..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_pilot_rescue.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/buff library/chat library/collection library/conversation library/create library/factions library/groundquests library/holiday library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnDetach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_captain_derlin.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_captain_derlin.script deleted file mode 100644 index 86a0aff3c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_captain_derlin.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/buff library/chat library/collection library/conversation library/create library/factions library/groundquests library/holiday library/space_quest library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnDetach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_rieekan.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_rieekan.script deleted file mode 100644 index d6182b5fd..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_rieekan.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/buff library/chat library/collection library/conversation library/create library/factions library/groundquests library/holiday library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnDetach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_wedge.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_wedge.script deleted file mode 100644 index 8c24b9fa3..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_wedge.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/buff library/chat library/collection library/conversation library/create library/factions library/groundquests library/holiday library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_wedge_antilles.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_wedge_antilles.script deleted file mode 100644 index d6182b5fd..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/rebel_remembrance_day_wedge_antilles.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/buff library/chat library/collection library/conversation library/create library/factions library/groundquests library/holiday library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnDetach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/rek_thelcar.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/rek_thelcar.script deleted file mode 100644 index 1572d64ac..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/rek_thelcar.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/collection library/conversation library/groundquests library/static_item library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/scientist_collection.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/scientist_collection.script deleted file mode 100644 index efa3a5502..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/scientist_collection.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/collection library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/sheeli.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/sheeli.script deleted file mode 100644 index 6b722c2a1..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/sheeli.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id checkArrivalLoopHandler#obj_id#dictionary handleDestroySelf#obj_id#dictionary handleUpdatePrisonerRescueQuest#obj_id#dictionary startFollowingOwner#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/shuttle_control_terminal.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/shuttle_control_terminal.script deleted file mode 100644 index b971c4d6a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/shuttle_control_terminal.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/create library/features library/groundquests library/space_quest library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id handleQuestFlavorObjectCleanup#obj_id#dictionary removeTerminalLock#obj_id#dictionary signalPlayerEnvoy#obj_id#dictionary spawnEnemies#obj_id#dictionary spawnHeroes#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/slicer_01_mos_taike.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/slicer_01_mos_taike.script deleted file mode 100644 index 20a7fc6b5..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/slicer_01_mos_taike.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/factions library/groundquests library/prose library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/slicer_02_lok.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/slicer_02_lok.script deleted file mode 100644 index 04fbb4a49..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/slicer_02_lok.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/prose library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/stuvany_inglen.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/stuvany_inglen.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/stuvany_inglen.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/trig_longo.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/trig_longo.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/trig_longo.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/vana_sage.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/vana_sage.script deleted file mode 100644 index efa3a5502..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/vana_sage.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/collection library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/water_treatment.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/water_treatment.script deleted file mode 100644 index f494c644b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/water_treatment.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/conversation/zahara_cody.script b/sku.0/sys.server/compiled/game/script/.deps/conversation/zahara_cody.script deleted file mode 100644 index b1cf91a90..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/conversation/zahara_cody.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/buff library/chat library/conversation library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnStartNpcConversation#obj_id#obj_id findNpc#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/corpse/ai_corpse.script b/sku.0/sys.server/compiled/game/script/.deps/corpse/ai_corpse.script deleted file mode 100644 index fbc7f04a3..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/corpse/ai_corpse.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/beast_lib library/corpse library/group library/loot library/money library/permissions library/pet_lib library/prose library/smuggler library/utils -PROTOTYPES: OnAttach#obj_id OnLootLotterySelected#obj_id#obj_id#obj_id[] OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int fireLotteryPulse#obj_id#dictionary handleAttemptCorpseCleanup#obj_id#dictionary handleCorpseEmpty#obj_id#dictionary handleCorpseExpire#obj_id#dictionary handleLootAddFail#obj_id#dictionary handleLootAddPass#obj_id#dictionary handleLootWithdrawFail#obj_id#dictionary handleLootWithdrawPass#obj_id#dictionary harvestCorpse#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/creature/dynamic_enemy.script b/sku.0/sys.server/compiled/game/script/.deps/creature/dynamic_enemy.script deleted file mode 100644 index 91a272c11..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/creature/dynamic_enemy.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/chat library/create library/groundquests library/prose -PROTOTYPES: OnAttach#obj_id OnIncapacitateTarget#obj_id#obj_id OnLoiterMoving#obj_id attackPlayer#obj_id#dictionary barkAttack#obj_id#dictionary barkDefeat#obj_id#dictionary cleanUp#obj_id#dictionary clientEffect#obj_id#dictionary expression#obj_id#dictionary runAwayThenCleanUp#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/creature/foraging_enemy.script b/sku.0/sys.server/compiled/game/script/.deps/creature/foraging_enemy.script deleted file mode 100644 index 4f35fc858..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/creature/foraging_enemy.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/anims library/chat library/create library/groundquests library/group library/prose library/utils -PROTOTYPES: OnAttach#obj_id OnIncapacitateTarget#obj_id#obj_id OnLoiterMoving#obj_id attackForager#obj_id#dictionary barkAttack#obj_id#dictionary barkDefeat#obj_id#dictionary cleanUpGuard#obj_id#dictionary expression#obj_id#dictionary removeASlot#obj_id#dictionary runAwayThenCleanUpGuard#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/creature/sarlacc.script b/sku.0/sys.server/compiled/game/script/.deps/creature/sarlacc.script deleted file mode 100644 index e5d906329..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/creature/sarlacc.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/dot library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTriggerVolumeEntered#obj_id#String#obj_id poisonArea#obj_id#dictionary resetBile#obj_id#dictionary resetBileEject#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/creature/serving_droid.script b/sku.0/sys.server/compiled/game/script/.deps/creature/serving_droid.script deleted file mode 100644 index d30403c8d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/creature/serving_droid.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/hue library/player_structure library/sui library/utils -PROTOTYPES: OnDestroy#obj_id OnInitialize#obj_id OnMoveMoving#obj_id OnMovePathComplete#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int fromLastPointGoBackToStart#obj_id#dictionary getUserOidSetFirstPoint#obj_id#dictionary handleActivateDroid#obj_id#dictionary handleDeactivateDroid#obj_id#dictionary handleDialogInput#obj_id#dictionary handlePrimaryColorize#obj_id#dictionary handleSecondaryColorize#obj_id#dictionary initializeDroidVariables#obj_id#dictionary pathDirectlyToStart#obj_id#dictionary reColorDroid#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/dianoga_dumpster.script b/sku.0/sys.server/compiled/game/script/.deps/event/dianoga_dumpster.script deleted file mode 100644 index 97cfbd37c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/dianoga_dumpster.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/collection library/house_pet library/prose library/smuggler library/space_utils library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnDestroy#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTransferred#obj_id#obj_id#obj_id#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id checkTriggerVolume#obj_id#dictionary growlAnimation#obj_id#dictionary handleSarlaccEatSui#obj_id#dictionary playCute#obj_id#dictionary removeRepeatAvoidanceScriptVar#obj_id#dictionary verifySarlaccEatSui#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/crash_site_requisition.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/crash_site_requisition.script deleted file mode 100644 index b73d7c465..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/crash_site_requisition.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/create library/factions library/groundquests library/holiday library/static_item library/stealth library/sui library/trial library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroySelf#obj_id#dictionary handleObjectSwapTimer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/empire_day_interior_spawn_npc.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/empire_day_interior_spawn_npc.script deleted file mode 100644 index 57c3d6136..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/empire_day_interior_spawn_npc.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/performance -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id removeConversationScripts#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/empired_day_interior_spawn_npc.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/empired_day_interior_spawn_npc.script deleted file mode 100644 index dd4fef888..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/empired_day_interior_spawn_npc.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id removeConversationScripts#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/factional_guard_self_destruct.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/factional_guard_self_destruct.script deleted file mode 100644 index 0f8329cb1..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/factional_guard_self_destruct.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id selfDestruct#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/give_multiple_items_to_supply_npc.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/give_multiple_items_to_supply_npc.script deleted file mode 100644 index 53f71cecd..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/give_multiple_items_to_supply_npc.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/factions library/groundquests library/holiday library/static_item library/utils -PROTOTYPES: OnGiveItem#obj_id#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/goodbye_path_destroy.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/goodbye_path_destroy.script deleted file mode 100644 index 99576c94f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/goodbye_path_destroy.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/chat library/create library/groundquests library/holiday library/prose library/stealth library/utils -PROTOTYPES: OnAttach#obj_id OnMoveMoving#obj_id OnMovePathComplete#obj_id pathToExit#obj_id#dictionary selfDestruct#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/imperial_empty_sign.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/imperial_empty_sign.script deleted file mode 100644 index 9331fac37..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/imperial_empty_sign.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/create library/factions library/groundquests library/holiday library/pet_lib library/static_item library/stealth library/sui library/trial library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroySelf#obj_id#dictionary handleObjectSwapTimer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/imperial_recruitment_sign.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/imperial_recruitment_sign.script deleted file mode 100644 index 9331fac37..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/imperial_recruitment_sign.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/create library/factions library/groundquests library/holiday library/pet_lib library/static_item library/stealth library/sui library/trial library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroySelf#obj_id#dictionary handleObjectSwapTimer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rebel_empty_sign.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rebel_empty_sign.script deleted file mode 100644 index 9331fac37..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rebel_empty_sign.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/create library/factions library/groundquests library/holiday library/pet_lib library/static_item library/stealth library/sui library/trial library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroySelf#obj_id#dictionary handleObjectSwapTimer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rebel_resistance_sign.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rebel_resistance_sign.script deleted file mode 100644 index 9331fac37..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rebel_resistance_sign.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/create library/factions library/groundquests library/holiday library/pet_lib library/static_item library/stealth library/sui library/trial library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroySelf#obj_id#dictionary handleObjectSwapTimer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rescue_faction_npc_trigger_volume.script b/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rescue_faction_npc_trigger_volume.script deleted file mode 100644 index 1c9146796..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emp_day/rescue_faction_npc_trigger_volume.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/chat library/create library/factions library/groundquests library/holiday library/prose library/stealth library/utils -PROTOTYPES: OnInitialize#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/emperor_statue.script b/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/emperor_statue.script deleted file mode 100644 index 87b327735..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/emperor_statue.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/collection library/create library/factions library/firework library/holiday library/performance library/prose library/static_item library/trial library/utils -PROTOTYPES: OnDestroy#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnHearSpeech#obj_id#obj_id#String OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int darth1#obj_id#dictionary darth2#obj_id#dictionary darth3#obj_id#dictionary darth4#obj_id#dictionary darth5#obj_id#dictionary darth6#obj_id#dictionary destroyParade#obj_id#dictionary finalMarch#obj_id#dictionary launchRandomFirework#obj_id#dictionary launchRandomTieFighterFlyBy#obj_id#dictionary moveParade#obj_id#dictionary normalMusic#obj_id#dictionary npcTypeList#obj_id#dictionary parade#obj_id#dictionary prepareParade#obj_id#dictionary shuttleAdjust#obj_id#dictionary spawnDarkTroopers1#obj_id#dictionary spawnDarkTroopers2#obj_id#dictionary spawnVader#obj_id#dictionary startConversation#obj_id#dictionary vaderLeaving#obj_id#dictionary vendor2#obj_id#dictionary vendor3#obj_id#dictionary vendorReplyAnnoyed#obj_id#dictionary vendorReplyWaiting#obj_id#dictionary waitingDone#obj_id#dictionary waitingHalf#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/imperial_npc.script b/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/imperial_npc.script deleted file mode 100644 index b641bbb5b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/imperial_npc.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/anims library/chat library/colors library/factions library/holiday library/pclib library/prose library/stealth library/utils -PROTOTYPES: OnAttach#obj_id OnMovePathComplete#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnSawEmote#obj_id#obj_id#String playerKnockedOut#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/imperial_npc_corpse.script b/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/imperial_npc_corpse.script deleted file mode 100644 index 871d21139..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/imperial_npc_corpse.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/factions library/groundquests library/holiday -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int knockDown#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/rebel_npc.script b/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/rebel_npc.script deleted file mode 100644 index b641bbb5b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/rebel_npc.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/anims library/chat library/colors library/factions library/holiday library/pclib library/prose library/stealth library/utils -PROTOTYPES: OnAttach#obj_id OnMovePathComplete#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnSawEmote#obj_id#obj_id#String playerKnockedOut#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/rebel_npc_corpse.script b/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/rebel_npc_corpse.script deleted file mode 100644 index 871d21139..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/rebel_npc_corpse.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/factions library/groundquests library/holiday -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int knockDown#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/yoda_fountain.script b/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/yoda_fountain.script deleted file mode 100644 index 3466b91a1..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/emperorsday/yoda_fountain.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/collection library/create library/factions library/firework library/holiday library/performance library/prose library/static_item library/trial library/utils -PROTOTYPES: OnDestroy#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnHearSpeech#obj_id#obj_id#String OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroyParade#obj_id#dictionary finalMarch#obj_id#dictionary hanAngry#obj_id#dictionary hanHappy#obj_id#dictionary launchRandomFirework#obj_id#dictionary launchRandomRebelShipFlyBy#obj_id#dictionary leia1#obj_id#dictionary leia2#obj_id#dictionary leia3#obj_id#dictionary leia4#obj_id#dictionary leia5#obj_id#dictionary leia6#obj_id#dictionary leiaLeaving#obj_id#dictionary moveChewie#obj_id#dictionary moveHan#obj_id#dictionary moveLeia#obj_id#dictionary normalMusic#obj_id#dictionary npcTypeList#obj_id#dictionary parade#obj_id#dictionary prepareParade#obj_id#dictionary spawnChewie#obj_id#dictionary spawnHan#obj_id#dictionary spawnLeia#obj_id#dictionary startConversation#obj_id#dictionary vendor2#obj_id#dictionary vendor3#obj_id#dictionary vendorReplyAnnoyed#obj_id#dictionary vendorReplyWaiting#obj_id#dictionary waitingDone#obj_id#dictionary waitingHalf#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/gcwraids/cheerleader.script b/sku.0/sys.server/compiled/game/script/.deps/event/gcwraids/cheerleader.script deleted file mode 100644 index 34375e7d9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/gcwraids/cheerleader.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/create library/gcw library/locations library/utils -PROTOTYPES: celebStartGivingQuests#obj_id#dictionary cleanupShuttleAndStuff#obj_id#dictionary createShuttle#obj_id#dictionary endEvent#obj_id#dictionary engageInJingoisticRhetoric#obj_id#dictionary escortDied#obj_id#dictionary everyoneWalkBack#obj_id#dictionary landShuttle#obj_id#dictionary spawnEscortsAndCeleb#obj_id#dictionary startCheerleaderEvent#obj_id#dictionary walkForwardCeleb#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/holiday_controller.script b/sku.0/sys.server/compiled/game/script/.deps/event/holiday_controller.script deleted file mode 100644 index 5c004977c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/holiday_controller.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/holiday library/utils -PROTOTYPES: OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnHearSpeech#obj_id#obj_id#String OnInitialize#obj_id empiredayServerStart#obj_id#dictionary halloweenServerStart#obj_id#dictionary lifedayServerStart#obj_id#dictionary lovedayServerStart#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/housepackup/sarlacc_furniture_terminal.script b/sku.0/sys.server/compiled/game/script/.deps/event/housepackup/sarlacc_furniture_terminal.script deleted file mode 100644 index c70e08254..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/housepackup/sarlacc_furniture_terminal.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/collection library/house_pet library/prose library/smuggler library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnDestroy#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTransferred#obj_id#obj_id#obj_id#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id checkTriggerVolume#obj_id#dictionary growlAnimation#obj_id#dictionary handleSarlaccEatSui#obj_id#dictionary playBurp#obj_id#dictionary playCute#obj_id#dictionary updateSarlaccPet#obj_id#dictionary verifySarlaccEatSui#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/event/planet_event_handler.script b/sku.0/sys.server/compiled/game/script/.deps/event/planet_event_handler.script deleted file mode 100644 index a6d3aff50..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/event/planet_event_handler.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/holiday library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id lifeDayDailyAlarm#obj_id#dictionary lifeDayScoreBoardUpdate#obj_id#dictionary resetEventDataAfterDelay#obj_id#dictionary setUpEventLeaderBoard#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/faction_perk/hq/loader.script b/sku.0/sys.server/compiled/game/script/.deps/faction_perk/hq/loader.script deleted file mode 100644 index 8a552e7bf..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/faction_perk/hq/loader.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/gcw library/hq library/player_structure library/utils -PROTOTYPES: OnAboutToReceiveItem#obj_id#obj_id#obj_id#obj_id OnAttach#obj_id OnClusterWideDataResponse#obj_id#String#String#int#String[]#dictionary[]#int OnDestroy#obj_id OnInitialize#obj_id OnLostItem#obj_id#obj_id#obj_id#obj_id OnReceivedItem#obj_id#obj_id#obj_id#obj_id handleDelayedRefundChecker#obj_id#dictionary handleHqDetonation#obj_id#dictionary handleHqExplosions#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/faction_perk/hq/terminal.script b/sku.0/sys.server/compiled/game/script/.deps/faction_perk/hq/terminal.script deleted file mode 100644 index 9808ec495..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/faction_perk/hq/terminal.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/hq library/money library/player_structure library/prose library/stealth library/sui library/utils terminal/base/base_terminal -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleAlarmMute#obj_id#dictionary handleCountdown#obj_id#dictionary handleCreditDonation#obj_id#dictionary handleDefenseRemoveConfirm#obj_id#dictionary handleDefenseSelection#obj_id#dictionary handleDonateDeed#obj_id#dictionary handleDonateResourceAmt#obj_id#dictionary handleDonateResourceType#obj_id#dictionary handleFacilityReboot#obj_id#dictionary handleRequestDonation#obj_id#dictionary handleShutdownConfirm#obj_id#dictionary handleShutdownCountdownComplete#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/armor/biolink_item_non_faction.script b/sku.0/sys.server/compiled/game/script/.deps/item/armor/biolink_item_non_faction.script deleted file mode 100644 index cb094e5ef..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/armor/biolink_item_non_faction.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/combat library/sui library/utils -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnAttach#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleEquipBioLinkSui#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/armor/new_armor.script b/sku.0/sys.server/compiled/game/script/.deps/item/armor/new_armor.script deleted file mode 100644 index 9f55bdf2a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/armor/new_armor.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/armor library/craftinglib library/metrics library/prose library/static_item library/utils -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnAttach#obj_id OnCustomizeFinished#obj_id#obj_id#String OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnTransferred#obj_id#obj_id#obj_id#obj_id checkArmorData#obj_id#dictionary delayedEquip#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/buff_click_biolink_item_non_faction.script b/sku.0/sys.server/compiled/game/script/.deps/item/buff_click_biolink_item_non_faction.script deleted file mode 100644 index cb094e5ef..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/buff_click_biolink_item_non_faction.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/combat library/sui library/utils -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnAttach#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleEquipBioLinkSui#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/buff_click_item.script b/sku.0/sys.server/compiled/game/script/.deps/item/buff_click_item.script deleted file mode 100644 index ee5a4ae24..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/buff_click_item.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/prose library/static_item library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/clicky_biolink_item.script b/sku.0/sys.server/compiled/game/script/.deps/item/clicky_biolink_item.script deleted file mode 100644 index cb094e5ef..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/clicky_biolink_item.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/combat library/sui library/utils -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnAttach#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleEquipBioLinkSui#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/droid/serving_droid.script b/sku.0/sys.server/compiled/game/script/.deps/item/droid/serving_droid.script deleted file mode 100644 index d30403c8d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/droid/serving_droid.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/hue library/player_structure library/sui library/utils -PROTOTYPES: OnDestroy#obj_id OnInitialize#obj_id OnMoveMoving#obj_id OnMovePathComplete#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int fromLastPointGoBackToStart#obj_id#dictionary getUserOidSetFirstPoint#obj_id#dictionary handleActivateDroid#obj_id#dictionary handleDeactivateDroid#obj_id#dictionary handleDialogInput#obj_id#dictionary handlePrimaryColorize#obj_id#dictionary handleSecondaryColorize#obj_id#dictionary initializeDroidVariables#obj_id#dictionary pathDirectlyToStart#obj_id#dictionary reColorDroid#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/droid/serving_droid_terminal.script b/sku.0/sys.server/compiled/game/script/.deps/item/droid/serving_droid_terminal.script deleted file mode 100644 index 31ffaa6ad..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/droid/serving_droid_terminal.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/player_structure library/utils -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnDestroy#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroyDroid#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/fryer.script b/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/fryer.script deleted file mode 100644 index 0158a74c8..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/fryer.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/collection library/create library/prose library/static_item library/sui library/utils -PROTOTYPES: OnGetAttributes#obj_id#obj_id#String[]#String[] OnLostItem#obj_id#obj_id#obj_id#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnReceivedItem#obj_id#obj_id#obj_id#obj_id repairFryer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_buff.script b/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_buff.script deleted file mode 100644 index da7468bcc..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_buff.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/utils -PROTOTYPES: OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] removeItemFoodScript#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_fail.script b/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_fail.script deleted file mode 100644 index 0791cb9cb..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_fail.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/utils -PROTOTYPES: OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int removeItemFoodScript#obj_id#dictionary setUpBuff#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_nobuff.script b/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_nobuff.script deleted file mode 100644 index 0791cb9cb..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/ice_cream_fryer/ice_cream_nobuff.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/utils -PROTOTYPES: OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int removeItemFoodScript#obj_id#dictionary setUpBuff#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/loot_kits/loot_kit_base.script b/sku.0/sys.server/compiled/game/script/.deps/item/loot_kits/loot_kit_base.script deleted file mode 100644 index 1c26a8566..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/loot_kits/loot_kit_base.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/sui library/utils -PROTOTYPES: OnAboutToReceiveItem#obj_id#obj_id#obj_id#obj_id OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnReceivedItem#obj_id#obj_id#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/loot_schematic/loot_schematic.script b/sku.0/sys.server/compiled/game/script/.deps/item/loot_schematic/loot_schematic.script deleted file mode 100644 index f9ccb9d2b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/loot_schematic/loot_schematic.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/beast_lib library/prose library/skill library/static_item library/temp_schematic library/utils -PROTOTYPES: OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handlerReInitialize#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/publish_gift/holopet_emitter.script b/sku.0/sys.server/compiled/game/script/.deps/item/publish_gift/holopet_emitter.script deleted file mode 100644 index 1808b87b6..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/publish_gift/holopet_emitter.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/player_structure library/prose library/static_item library/sui library/utils -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnAttach#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnPack#obj_id#dictionary OnTransferred#obj_id#obj_id#obj_id#obj_id handleActivateHolograms#obj_id#dictionary handleHologramHeartbeat#obj_id#dictionary handleLoadDataCube#obj_id#dictionary handleNamePet#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/static_item_base.script b/sku.0/sys.server/compiled/game/script/.deps/item/static_item_base.script deleted file mode 100644 index 5e4f27350..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/static_item_base.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/armor library/beast_lib library/buff library/proc library/static_item library/utils -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnDestroy#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTransferred#obj_id#obj_id#obj_id#obj_id handleStaticReEquipItem#obj_id#dictionary handlerVersionUpdate#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/structure_deed/city_hall_deed.script b/sku.0/sys.server/compiled/game/script/.deps/item/structure_deed/city_hall_deed.script deleted file mode 100644 index fbfe4c811..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/structure_deed/city_hall_deed.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: item/structure_deed/player_structure_deed library/city library/player_structure library/sui library/utils -PROTOTYPES: handleNoReclaimConfirm#obj_id#dictionary handleSetCityName#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/structure_deed/player_structure_deed.script b/sku.0/sys.server/compiled/game/script/.deps/item/structure_deed/player_structure_deed.script deleted file mode 100644 index ae4ae6d0a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/structure_deed/player_structure_deed.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/player_structure library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleNoReclaimConfirm#obj_id#dictionary validateHopper#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/tool/crafted_armor_customization_kit.script b/sku.0/sys.server/compiled/game/script/.deps/item/tool/crafted_armor_customization_kit.script deleted file mode 100644 index 9ab7bb0c1..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/tool/crafted_armor_customization_kit.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/hue library/metrics library/static_item library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int cancelTool#obj_id#dictionary decrementTool#obj_id#dictionary handleArmorSelection#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/tool/crafted_armor_recolor_kit.script b/sku.0/sys.server/compiled/game/script/.deps/item/tool/crafted_armor_recolor_kit.script deleted file mode 100644 index a7b8249ba..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/tool/crafted_armor_recolor_kit.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/hue library/metrics library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleArmorSelection#obj_id#dictionary handleCommit#obj_id#dictionary handlePaletteUpdate#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/tool/structure_customization_kit.script b/sku.0/sys.server/compiled/game/script/.deps/item/tool/structure_customization_kit.script deleted file mode 100644 index dcff9e657..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/tool/structure_customization_kit.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/hue library/player_structure library/static_item library/sui library/utils -PROTOTYPES: OnGetAttributes#obj_id#obj_id#String[]#String[] OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int cancelTool#obj_id#dictionary decrementTool#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/trigger_breach_music.script b/sku.0/sys.server/compiled/game/script/.deps/item/trigger_breach_music.script deleted file mode 100644 index 9e343dc3a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/trigger_breach_music.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/space_utils library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTransferred#obj_id#obj_id#obj_id#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id handleTriggerBreachMusicItemTransferred#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/wearable/allow_player_custom_color.script b/sku.0/sys.server/compiled/game/script/.deps/item/wearable/allow_player_custom_color.script deleted file mode 100644 index d62faff07..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/wearable/allow_player_custom_color.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/hue library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handlePrimaryColorize#obj_id#dictionary handleSecondaryColorize#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/item/wearable/set_non_armor_wearable_socket.script b/sku.0/sys.server/compiled/game/script/.deps/item/wearable/set_non_armor_wearable_socket.script deleted file mode 100644 index fe0c52530..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/item/wearable/set_non_armor_wearable_socket.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnAttach#obj_id setSocket#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/advanced_turret.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/advanced_turret.scriptlib deleted file mode 100644 index 897000557..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/advanced_turret.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/pclib library/stealth library/trace library/utils library/vehicle library/weapons -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/ai_lib.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/ai_lib.scriptlib deleted file mode 100644 index 5f7431485..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/ai_lib.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/beast_lib library/buff library/chat library/combat_consts library/dot library/locations library/movement library/pet_lib library/skill -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/attrib.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/attrib.scriptlib deleted file mode 100644 index df6395717..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/attrib.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/badge.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/badge.scriptlib deleted file mode 100644 index a49452df2..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/badge.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/prose library/respec -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/beast_lib.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/beast_lib.scriptlib deleted file mode 100644 index 07d9b3018..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/beast_lib.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/armor library/buff library/callable library/colors library/corpse library/group library/hue library/incubator library/instance library/pet_lib library/prose library/storyteller library/utils library/xp -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/bounty_hunter.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/bounty_hunter.scriptlib deleted file mode 100644 index c8905368b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/bounty_hunter.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/anims library/chat library/money library/prose library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/buff.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/buff.scriptlib deleted file mode 100644 index aefc62b72..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/buff.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/beast_lib library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/camping.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/camping.scriptlib deleted file mode 100644 index 490ddadcd..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/camping.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/battlefield library/factions library/locations library/pclib library/player_structure library/structure library/utils library/xp -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/collection.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/collection.scriptlib deleted file mode 100644 index 7219c3f88..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/collection.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/badge library/buff library/gcw library/groundquests library/prose library/skill library/static_item library/stealth library/sui library/utils library/xp -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/consumable.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/consumable.scriptlib deleted file mode 100644 index ae61fed15..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/consumable.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/doctor_bag library/food library/healing library/metrics library/player_stomach library/prose library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/corpse.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/corpse.scriptlib deleted file mode 100644 index f44a61846..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/corpse.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/collection library/group library/npe library/prose library/static_item library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/create.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/create.scriptlib deleted file mode 100644 index 915a4d25c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/create.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/attrib library/dressup library/factions library/hue library/stealth library/utils library/weapons -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/factions.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/factions.scriptlib deleted file mode 100644 index 9a6eed4f8..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/factions.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/callable library/combat library/luck library/performance library/pet_lib library/skill library/space_flags library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/gcw.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/gcw.scriptlib deleted file mode 100644 index f94e48a83..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/gcw.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/buff library/colors_hex library/faction_perk library/factions library/loot library/pet_lib library/prose library/regions library/space_flags library/trial library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/groundquests.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/groundquests.scriptlib deleted file mode 100644 index 283305ac7..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/groundquests.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/badge library/factions library/gcw library/loot library/money library/prose library/utils library/weapons library/xp -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/guild.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/guild.scriptlib deleted file mode 100644 index df6395717..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/guild.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/healing.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/healing.scriptlib deleted file mode 100644 index 00a212741..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/healing.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/beast_lib library/buff library/camping library/combat library/consumable library/cybernetic library/dot library/factions library/group library/luck library/metrics library/pet_lib library/player_structure library/prose library/pvp library/stealth library/sui library/utils library/vehicle library/xp -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/holiday.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/holiday.scriptlib deleted file mode 100644 index 064ebc2b2..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/holiday.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/gcw library/groundquests library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/hq.java b/sku.0/sys.server/compiled/game/script/.deps/library/hq.java deleted file mode 100644 index b877b19f9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/hq.java +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: * base_class/* base_script combat_engine/* library/gcw library/planetary_map library/player_structure library/structure library/theater library/trial library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/hq.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/hq.scriptlib deleted file mode 100644 index c3e75153b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/hq.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/planetary_map library/player_structure library/structure library/theater library/trial library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/loot.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/loot.scriptlib deleted file mode 100644 index 606ac63a2..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/loot.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/buff library/consumable library/corpse library/craftinglib library/factions library/healing library/hue library/money library/pet_lib library/resource library/slots library/static_item library/storyteller library/trace library/utils library/weapons -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/movement.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/movement.scriptlib deleted file mode 100644 index 5c0259938..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/movement.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/pclib.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/pclib.scriptlib deleted file mode 100644 index 5780030a0..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/pclib.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/battlefield library/bounty_hunter library/buff library/city library/combat library/corpse library/dot library/factions library/force_rank library/group library/healing library/innate library/jedi library/meditation library/missions library/money library/player_stomach library/player_structure library/prose library/pvp library/slots library/smuggler library/structure library/sui library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/performance.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/performance.scriptlib deleted file mode 100644 index 8a3a34306..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/performance.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/beast_lib library/buff library/camping library/city library/colors library/combat library/datatable library/factions library/groundquests library/group library/pet_lib library/prose library/regions library/respec library/session library/sui library/utils library/xp -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/player_structure.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/player_structure.scriptlib deleted file mode 100644 index fdd5b51d5..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/player_structure.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/prose library/regions library/static_item library/sui library/target_dummy library/trace library/trial library/utils library/vendor_lib -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/resource.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/resource.scriptlib deleted file mode 100644 index fb58b5c10..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/resource.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/city library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/ship_ai.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/ship_ai.scriptlib deleted file mode 100644 index 0259ec401..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/ship_ai.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/utils transform vector -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/smuggler.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/smuggler.scriptlib deleted file mode 100644 index 2231f9313..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/smuggler.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/chat library/corpse library/groundquests library/luck library/prose library/skill library/static_item library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/space_combat.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/space_combat.scriptlib deleted file mode 100644 index c7090852d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/space_combat.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/badge library/buff library/callable library/factions library/groundquests library/ship_ai library/smuggler library/space_crafting library/space_flags library/space_utils library/utils library/xp -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/space_crafting.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/space_crafting.scriptlib deleted file mode 100644 index db6ccaf02..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/space_crafting.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/badge library/groundquests library/space_combat library/space_quest library/space_utils library/sui library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/space_create.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/space_create.scriptlib deleted file mode 100644 index 55bc4e70f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/space_create.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/hue library/ship_ai library/sui transform vector -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/spawning.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/spawning.scriptlib deleted file mode 100644 index 208b1cbfd..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/spawning.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/space_utils library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/static_item.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/static_item.scriptlib deleted file mode 100644 index f4e5240b2..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/static_item.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/jedi library/loot library/storyteller -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/stealth.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/stealth.scriptlib deleted file mode 100644 index b0a4b2b24..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/stealth.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/beast_lib library/buff library/city library/colors library/combat library/dot library/factions library/group library/locations library/loot library/luck library/money library/pet_lib library/prose library/static_item library/sui library/utils library/vehicle library/weapons library/xp -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/sui.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/sui.scriptlib deleted file mode 100644 index 1528cd250..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/sui.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/colors_hex -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/tcg.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/tcg.scriptlib deleted file mode 100644 index 0d96a6e06..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/tcg.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/beast_lib library/incubator library/spawning library/static_item library/target_dummy library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/trial.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/trial.scriptlib deleted file mode 100644 index 1dfdd8e2b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/trial.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/attrib library/beast_lib library/colors library/prose library/space_dungeon library/stealth library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/utils.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/utils.scriptlib deleted file mode 100644 index 41ae1b6a0..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/utils.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/armor library/chat library/cloninglib library/healing library/pclib library/performance library/player_structure library/static_item library/trial script_entry -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/vehicle.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/vehicle.scriptlib deleted file mode 100644 index 8881e374a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/vehicle.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/buff library/callable library/colors library/group library/hue library/instance library/money library/pet_lib library/space_dungeon library/space_transition -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/vendor_lib.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/vendor_lib.scriptlib deleted file mode 100644 index 766124206..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/vendor_lib.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create library/player_structure library/static_item -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/weapons.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/weapons.scriptlib deleted file mode 100644 index b1ecb704e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/weapons.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/combat library/factions library/heavyweapons library/powerup library/smuggler library/trace library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/library/xp.scriptlib b/sku.0/sys.server/compiled/game/script/.deps/library/xp.scriptlib deleted file mode 100644 index 24d42e81c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/library/xp.scriptlib +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/beast_lib library/buff library/collection library/combat library/gcw library/group library/performance library/pet_lib library/space_flags library/utils -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/npc/converse/junk_dealer.script b/sku.0/sys.server/compiled/game/script/.deps/npc/converse/junk_dealer.script deleted file mode 100644 index 5abb05146..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/npc/converse/junk_dealer.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/group library/luck library/money library/prose library/smuggler library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id handleBuyBackSui#obj_id#dictionary handleFlagJunkSui#obj_id#dictionary handleSellJunkSui#obj_id#dictionary handleSoldJunk#obj_id#dictionary handleTheBuyBack#obj_id#dictionary startBuyBack#obj_id#dictionary startDealing#obj_id#dictionary startFlaggingItemsNoSale#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/biolink_item.script b/sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/biolink_item.script deleted file mode 100644 index 14a84e079..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/biolink_item.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/combat library/faction_perk library/factions library/sui library/utils -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnAttach#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleEquipBioLinkSui#obj_id#dictionary handleSpendFactionPointsSui#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/faction_item.script b/sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/faction_item.script deleted file mode 100644 index 4f967628a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/faction_item.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/utils -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] diff --git a/sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/faction_recruiter.script b/sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/faction_recruiter.script deleted file mode 100644 index 8a8729145..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/npc/faction_recruiter/faction_recruiter.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/badge library/chat library/faction_perk library/factions library/gcw library/money library/prose library/sui library/utils library/xp -PROTOTYPES: OnAttach#obj_id OnGiveItem#obj_id#obj_id#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info fromAccountPass#obj_id#dictionary gaveReward#obj_id#dictionary msgFactionItemPurchaseSelected#obj_id#dictionary msgFactionItemRankSelected#obj_id#dictionary msgFactionTrainingAmountSelected#obj_id#dictionary msgFactionTrainingAmountSelectedXpResult#obj_id#dictionary msgFactionTrainingTypeSelected#obj_id#dictionary payBribe#obj_id#dictionary xferFail#obj_id#dictionary xferPass#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_01.script b/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_01.script deleted file mode 100644 index 207eb6f4e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_01.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/factions library/locations library/luck library/money library/prose library/quests library/skill library/smuggler library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_02.script b/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_02.script deleted file mode 100644 index 207eb6f4e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_02.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/factions library/locations library/luck library/money library/prose library/quests library/skill library/smuggler library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_03.script b/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_03.script deleted file mode 100644 index 207eb6f4e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_03.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/factions library/locations library/luck library/money library/prose library/quests library/skill library/smuggler library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_bounty.script b/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_bounty.script deleted file mode 100644 index 207eb6f4e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/npc/jawa_traders/jawa_trader_bounty.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/factions library/locations library/luck library/money library/prose library/quests library/skill library/smuggler library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/npc/vendor/object_for_sale.script b/sku.0/sys.server/compiled/game/script/.deps/npc/vendor/object_for_sale.script deleted file mode 100644 index d686421ff..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/npc/vendor/object_for_sale.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/money library/prose library/static_item library/township library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnObjectMenuSelect#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/object/autostack.script b/sku.0/sys.server/compiled/game/script/.deps/object/autostack.script deleted file mode 100644 index 85b8487ab..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/object/autostack.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/loot library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTransferred#obj_id#obj_id#obj_id#obj_id clearUnstackingScriptVar#obj_id#dictionary msgStackItem#obj_id#dictionary msgUnstackItem#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/planet/planet_base.script b/sku.0/sys.server/compiled/game/script/.deps/planet/planet_base.script deleted file mode 100644 index 02f6a727c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/planet/planet_base.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/cloninglib library/gcw library/regions library/scheduled_drop library/utils -PROTOTYPES: OnDetach#obj_id OnUniverseComplete#obj_id doSpawnSetup#obj_id#dictionary gcwGetInvasionObject#obj_id#dictionary gcwInvasionTracker#obj_id#dictionary registerCloningFacility#obj_id#dictionary unregisterCloningFacility#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/player/base/base_player.script b/sku.0/sys.server/compiled/game/script/.deps/player/base/base_player.script deleted file mode 100644 index 4dc9d4dff..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/player/base/base_player.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/anims library/armor library/badge library/beast_lib library/bio_engineer library/bounty_hunter library/buff library/callable library/chat library/city library/cloninglib library/collection library/colors library/colors_hex library/combat library/consumable library/corpse library/cts library/dot library/dump library/event_perk library/expertise library/factions library/features library/food library/force_rank library/fs_quests library/gcw library/gm library/gmlib library/groundquests library/group library/guild library/healing library/hq library/hue library/incubator library/instance library/jedi library/jedi_trials library/list library/locations library/loot library/luck library/meditation library/metrics library/missions library/money library/movement library/npe library/pclib library/performance library/permissions library/pet_lib library/pgc_quests library/player_stomach library/player_structure library/proc library/prose library/pvp library/regions library/resource library/respec library/restuss_event library/reverse_engineering library/scout library/session library/skill library/skill_template library/slicing library/smuggler library/space_combat library/space_crafting library/space_dungeon library/space_dungeon_data library/space_flags library/space_quest library/space_skill library/space_transition library/space_utils library/squad_leader library/static_item library/stealth library/storyteller library/structure library/sui library/temp_schematic library/township library/trace library/travel library/trial library/utils library/vehicle library/vendor_lib library/veteran_deprecated library/weapons library/xp -PROTOTYPES: HandleCoverCharge#obj_id#dictionary HandleSetCoverCharge#obj_id#dictionary OnAboutToBeIncapacitated#obj_id#obj_id OnAboutToReceiveItem#obj_id#obj_id#obj_id#obj_id OnAddedToGroup#obj_id#obj_id OnAttach#obj_id OnCSCreateItem#obj_id#obj_id#String OnChangedPosture#obj_id#int#int OnCityChanged#obj_id#int#int OnClusterWideDataResponse#obj_id#String#String#int#String[]#dictionary[]#int OnCombatLevelChanged#obj_id#int#int OnCreatureDamaged#obj_id#obj_id#obj_id#int[] OnCustomizeFinished#obj_id#obj_id#String OnDownloadCharacter#obj_id#byte[] OnEnterRegion#obj_id#String#String OnEnteredCombat#obj_id OnEnvironmentalDeath#obj_id OnExitRegion#obj_id#String#String OnGetAttributes#obj_id#obj_id#String[]#String[] OnGetStaticItemsAttributes#obj_id#String#String[]#String[] OnGroupDisbanded#obj_id#obj_id OnGroupLeaderChanged#obj_id#obj_id#obj_id#obj_id OnImmediateLogout#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnLogin#obj_id OnLogout#obj_id OnLostItem#obj_id#obj_id#obj_id#obj_id OnMadeAuthoritative#obj_id OnNewbieTutorialResponse#obj_id#String OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnPerformEmote#obj_id#String OnPvpRankingChanged#obj_id#int#int OnPvpTypeChanged#obj_id#int#int OnQuestActivated#obj_id#int OnQuestCleared#obj_id#int OnQuestCompleted#obj_id#int OnQuestReceivedReward#obj_id#int#String OnRecapacitated#obj_id OnReceivedItem#obj_id#obj_id#obj_id#obj_id OnRemovedFromGroup#obj_id#obj_id OnRemovingFromWorld#obj_id OnRequestStaticItemData#obj_id#String OnSkillAboutToBeRevoked#obj_id#String OnSkillGranted#obj_id#String OnSkillModDone#obj_id#String#boolean OnSkillModsChanged#obj_id#String[]#int[] OnSkillRevoked#obj_id#String OnSkillTemplateChanged#obj_id#String#boolean OnStartCharacterUpload#obj_id#byte[]#modifiable_int#boolean#boolean OnStomachUpdate#obj_id OnSurveyDataReceived#obj_id#float[]#float[]#float[] OnTargeted#obj_id#obj_id OnTransferred#obj_id#obj_id#obj_id#obj_id OnUnloadedFromMemory#obj_id OnUploadCharacter#obj_id#dictionary addSmugglingBuffs#obj_id#dictionary applyJediStance#obj_id#dictionary applyMountBuff#obj_id#dictionary applySmugglingBonuses#obj_id#dictionary clearRecentDeathScriptVar#obj_id#dictionary clearScriptVar#obj_id#dictionary cmdActivateClone#obj_id#obj_id#String#float cmdActivateCloneFail#obj_id#obj_id#String#float cmdCheckForceStatus#obj_id#obj_id#String#float cmdCityInfo#obj_id#obj_id#String#float cmdCityban#obj_id#obj_id#String#float cmdCitypardon#obj_id#obj_id#String#float cmdClearQueue#obj_id#obj_id#String#float cmdConsent#obj_id#obj_id#String#float cmdCorpse#obj_id#obj_id#String#float cmdCoupDeGrace#obj_id#obj_id#String#float cmdEat#obj_id#obj_id#String#float cmdEject#obj_id#obj_id#String#float cmdFlashSpeeder#obj_id#obj_id#String#float cmdGetGalaxyMessage#obj_id#obj_id#String#float cmdGetVeteranRewardTime#obj_id#obj_id#String#float cmdGrantStorytellerZoningRights#obj_id#obj_id#String#float cmdGrantZoningRights#obj_id#obj_id#String#float cmdHarvestDNA#obj_id#obj_id#String#float cmdHarvestDNAFail#obj_id#obj_id#String#float cmdHaveConsent#obj_id#obj_id#String#float cmdInstallMissionTerminal#obj_id#obj_id#String#float cmdListVeteranRewards#obj_id#obj_id#String#float cmdLoot#obj_id#obj_id#String#float cmdLootPlayer#obj_id#obj_id#String#float cmdMeditate#obj_id#obj_id#String#float cmdMeditateFail#obj_id#obj_id#String#float cmdOpenFail#obj_id#obj_id#String#float cmdSetBind#obj_id#obj_id#String#float cmdSetExperienceResult#obj_id#dictionary cmdShowLockout#obj_id#obj_id#String#float cmdSpaceWaypoint#obj_id#obj_id#String#float cmdStartLogout#obj_id#obj_id#String#float cmdTip#obj_id#obj_id#String#float cmdTipFail#obj_id#obj_id#String#float cmdUnconsent#obj_id#obj_id#String#float cmdUseSkillBuff#obj_id#obj_id#String#float cmdWaypoint#obj_id#obj_id#String#float completeHarvestDNA#obj_id#dictionary concealEnable#obj_id#dictionary createCreature#obj_id#obj_id#String#float createNPC#obj_id#obj_id#String#float createOfficerGroupWaypoint#obj_id#dictionary ctsCompletedForCharacter#obj_id#dictionary death_troopers_apply_virus#obj_id#dictionary decayJediDeath#obj_id#dictionary delayRespecInstructions#obj_id#dictionary disconnectPlayerCtsCompletedOrInProgress#obj_id#dictionary doForcedGmCommand#obj_id#dictionary factionBaseLotRefund#obj_id#dictionary factionBaseUnitRefund#obj_id#dictionary failConceal#obj_id#obj_id#String#float failMaskscent#obj_id#obj_id#String#float finishEntertainerRespec#obj_id#dictionary getPrototype#obj_id#obj_id#String#float gmForceCommand#obj_id#obj_id#String#float gmRevive#obj_id#obj_id#String#float grantSquadLeaderXpResult#obj_id#dictionary grantUnmodifiedExperienceOnSelf#obj_id#dictionary groupWaypoint#obj_id#obj_id#String#float handleAwardedBountyCheck#obj_id#dictionary handleAwardedPlayerBounty#obj_id#dictionary handleBountyMissionIncomplete#obj_id#dictionary handleBountyMissionTimeout#obj_id#dictionary handleBuyBackSui#obj_id#dictionary handleChatPersistentMessage#obj_id#dictionary handleClientLogin#obj_id#obj_id#String#float handleCloneRespawn#obj_id#dictionary handleCloneSuiUpdate#obj_id#dictionary handleCloningDataUpdate#obj_id#dictionary handleConsentToLogout#obj_id#dictionary handleCorpseCleanup#obj_id#dictionary handleCorpseCoinLoot#obj_id#dictionary handleCorpseCoinLootFailed#obj_id#dictionary handleCorpseExpire#obj_id#dictionary handleCorpseWaypointUpdate#obj_id#dictionary handleCoupDeGrace#obj_id#dictionary handleDailyMissionReset#obj_id#dictionary handleDecayReport#obj_id#dictionary handleDelayedClone#obj_id#dictionary handleDelayedCloneCancel#obj_id#dictionary handleDelayedEjection#obj_id#dictionary handleEjection#obj_id#dictionary handleFlagJunkSui#obj_id#dictionary handleGenericDownerEffect#obj_id#dictionary handleHealOverTimeTick#obj_id#dictionary handleIncapCounterDeath#obj_id#dictionary handleInstallMissionTerminal#obj_id#dictionary handleInstanceClonePause#obj_id#dictionary handleInstanceCloneSelection#obj_id#dictionary handleInstanceRessurect#obj_id#dictionary handleInstanceTimeRemainingMessage#obj_id#dictionary handleJediDeathCount#obj_id#dictionary handleListenRadialCmd#obj_id#dictionary handleLoginLocResolved#obj_id#dictionary handleMTFeeFail#obj_id#dictionary handleMTFeeSuccess#obj_id#dictionary handleMeditationTick#obj_id#dictionary handlePlayerBountyEngagement#obj_id#dictionary handlePlayerBountyTimeout#obj_id#dictionary handlePlayerDeath#obj_id#dictionary handlePlayerResuscitated#obj_id#dictionary handlePlayerRevive#obj_id#dictionary handleReceivedConsent#obj_id#dictionary handleReceivedUnconsent#obj_id#dictionary handleRepairItems#obj_id#dictionary handleRequestCoinLoot#obj_id#dictionary handleRetireWarning#obj_id#dictionary handleReviveExpirationMessage#obj_id#dictionary handleReviveSUI#obj_id#dictionary handleReviveSUITimeout#obj_id#dictionary handleReviveStand#obj_id#dictionary handleSTFeeFail#obj_id#dictionary handleSTFeeSuccess#obj_id#dictionary handleSelectCity#obj_id#dictionary handleSelectCityInfo#obj_id#dictionary handleSelectPlanet#obj_id#dictionary handleSelectRunner#obj_id#dictionary handleSellJunkSui#obj_id#dictionary handleSendSmugglerBootstrapRequest#obj_id#dictionary handleSetBounty#obj_id#dictionary handleSetBountyTransaction#obj_id#dictionary handleSkillPurchase#obj_id#dictionary handleSmugglerFenceAbility#obj_id#obj_id#String#float handleSmugglerMissionFailureSignal#obj_id#dictionary handleSoldJunk#obj_id#dictionary handleSpiceDownerEffect#obj_id#dictionary handleStartJediKnightTrials#obj_id#dictionary handleStatProfileSUI#obj_id#dictionary handleStopDanceMessage#obj_id#dictionary handleStoryTellerAssistantAccepted#obj_id#dictionary handleStoryTellerAssistantRequest#obj_id#dictionary handleStoryTellerInviteAccepted#obj_id#dictionary handleStoryTellerInviteRequest#obj_id#dictionary handleStoryTellerRemoveAssistant#obj_id#dictionary handleStoryTellerRemovedFromStory#obj_id#dictionary handleSurveyGambleChoice#obj_id#dictionary handleSurveyNodeChoice#obj_id#dictionary handleSurveyToolbarSetup#obj_id#dictionary handleTellStorytellerIDeclinedAssistant#obj_id#dictionary handleTellStorytellerIDeclinedInvite#obj_id#dictionary handleTheBuyBack#obj_id#dictionary handleTipEscrowFail#obj_id#dictionary handleTipEscrowPass#obj_id#dictionary handleTipEscrowRequest#obj_id#dictionary handleTipFail#obj_id#dictionary handleTipRefundFail#obj_id#dictionary handleTipRefundPass#obj_id#dictionary handleTipRefundRequest#obj_id#dictionary handleTipSuccess#obj_id#dictionary handleUnconsentMenu#obj_id#dictionary handleUpdateBountyMissionTime#obj_id#dictionary handleVeteranMilestoneSelected#obj_id#dictionary handleVeteranRewardConfirmed#obj_id#dictionary handleVeteranRewardSelected#obj_id#dictionary handleWatchRadialCmd#obj_id#dictionary handleWireConfirm#obj_id#dictionary handleZoningRightsSelect#obj_id#dictionary handlerRemoveGroupBuffEffect#obj_id#dictionary maskscent#obj_id#obj_id#String#float messageSendQuestSystemMessage#obj_id#dictionary messageUpdateMissionCriticalObjects#obj_id#dictionary milkCreature#obj_id#obj_id#String#float msgCoupDeGraceAuthoritativeCheck#obj_id#dictionary msgFlashSpeederConfirmed#obj_id#dictionary msgFlashSpeederPaid#obj_id#dictionary myCityMotdResponse#obj_id#dictionary onGuildCreateTerminalDataObject#obj_id#dictionary playDelayedClientEffect#obj_id#dictionary recalcWeaponRange#obj_id#dictionary recapacitationDelay#obj_id#dictionary receiveCreditForKill#obj_id#dictionary removeConceal#obj_id#dictionary removeDelayedFoodEffect#obj_id#dictionary removeDungeonArea#obj_id#dictionary removeDurationFoodEffect#obj_id#dictionary removeIncubatorFromUser#obj_id#dictionary removeOfficerGroupWaypoint#obj_id#dictionary removeScentMask#obj_id#dictionary removeScentMaskNoNotify#obj_id#dictionary removeSmugglingBonuses#obj_id#dictionary reportJediDeathCount#obj_id#obj_id#String#float requestMissionLocations#obj_id#dictionary searchLair#obj_id#obj_id#String#float sendSystemMessageProseAuthoritative#obj_id#dictionary setDisplayOnlyDefensiveMods#obj_id#dictionary setRespecVersion#obj_id#dictionary showReviveSUI#obj_id#dictionary stampDungeonArea#obj_id#dictionary startTraceLogging#obj_id#obj_id#String#float stopTraceLogging#obj_id#obj_id#String#float sysGroup#obj_id#obj_id#String#float transferMoneyToNamedAccount#obj_id#dictionary transferMoneyToNamedAccount_failCallback#obj_id#dictionary transferMoneyToNamedAccount_successCallback#obj_id#dictionary updateGCWStanding#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/player/live_conversions.script b/sku.0/sys.server/compiled/game/script/.deps/player/live_conversions.script deleted file mode 100644 index fa668e60d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/player/live_conversions.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/badge library/buff library/craftinglib library/dot library/factions library/groundquests library/guild library/pclib library/player_structure library/respec library/skill library/skill_template library/space_flags library/static_item library/sui library/utils library/weapons -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnLogin#obj_id OnNewbieTutorialResponse#obj_id#String fullExpertiseReset#obj_id#dictionary handleBirthDateCallBack#obj_id#dictionary handleContentPathContinuation#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/player/player_building.script b/sku.0/sys.server/compiled/game/script/.deps/player/player_building.script deleted file mode 100644 index 0db14fa59..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/player/player_building.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/callable library/city library/colors_hex library/create library/dressup library/hq library/incubator library/money library/pclib library/performance library/player_structure library/prose library/resource library/session library/skill library/static_item library/sui library/tcg library/trial library/turnstile library/utils library/vendor_lib library/xp -PROTOTYPES: DoRestoreItemDecorationLayout#obj_id#obj_id#obj_id#location#boolean#float#float#float#float DoRestoreItemDecorationLayoutRotationOnly#obj_id#obj_id#float#float#float#float OnAddStructure#obj_id#dictionary OnClearConfirmDestroy#obj_id#dictionary OnConstructionComplete#obj_id#dictionary OnContentsLoadedForBuildingToBePacked#obj_id#obj_id OnMadeAuthoritative#obj_id OnPermissionListModify#obj_id#obj_id#String#String#String OnPlaceStructure#obj_id#obj_id#obj_id#location#int OnPlayerVendorCountReply#obj_id#int OnRemoveStructure#obj_id#dictionary assignDroid#obj_id#obj_id#String#float buildVendor#obj_id#dictionary callAirStrikePackAbandonedStructure#obj_id#dictionary cmdAddPower#obj_id#obj_id#String#float cmdDepositPowerIncubator#obj_id#obj_id#String#float cmdRemovePowerIncubator#obj_id#obj_id#String#float createVendor#obj_id#obj_id#String#float declareResidence#obj_id#obj_id#String#float destroyStructure#obj_id#obj_id#String#float failPlaceStructureMode#obj_id#obj_id#String#float getVendorInfoForPlayerRsp#obj_id#dictionary handleAdjustLotCount#obj_id#dictionary handleConfirmOverwriteSaveDecorationLayout#obj_id#dictionary handleDestroyBarnAndBeastsConfirm#obj_id#dictionary handleDestroyConfirm#obj_id#dictionary handleDestroyUi#obj_id#dictionary handleDroidModelSelect#obj_id#dictionary handleFailedStructurePackup#obj_id#dictionary handlePlayerStructurePackupLockout#obj_id#dictionary handlePlayerStructurePackupLockoutRemoval#obj_id#dictionary handleRestoreDecorationLayout#obj_id#dictionary handleRestoreDecorationReturnToRoomMapping#obj_id#dictionary handleSaveDecorationLayout#obj_id#dictionary handleSaveDecorationLayoutEnterDescription#obj_id#dictionary handleSelectRestoreDecorationLayout#obj_id#dictionary handleSelectRestoreDecorationRoomMapping#obj_id#dictionary handleSelectRestoreDecorationTargetRoom#obj_id#dictionary handleSelectSaveDecorationLayout#obj_id#dictionary handleSetVendorName#obj_id#dictionary handleStatusUi#obj_id#dictionary handleTerminalDesignSelect#obj_id#dictionary handleVendorGenderSelect#obj_id#dictionary handleVendorRaceSelect#obj_id#dictionary handleVendorTypeSelect#obj_id#dictionary itemMoveBack#obj_id#obj_id#String#float itemMoveCopyHeight#obj_id#obj_id#String#float itemMoveCopyLocation#obj_id#obj_id#String#float itemMoveDown#obj_id#obj_id#String#float itemMoveForward#obj_id#obj_id#String#float itemMoveLeft#obj_id#obj_id#String#float itemMoveRight#obj_id#obj_id#String#float itemMoveUp#obj_id#obj_id#String#float itemRotateBackward#obj_id#obj_id#String#float itemRotateClockwise#obj_id#obj_id#String#float itemRotateCopy#obj_id#obj_id#String#float itemRotateCounterclockwise#obj_id#obj_id#String#float itemRotateForward#obj_id#obj_id#String#float itemRotateLeft#obj_id#obj_id#String#float itemRotateRandom#obj_id#obj_id#String#float itemRotateRandomPitch#obj_id#obj_id#String#float itemRotateRandomRoll#obj_id#obj_id#String#float itemRotateRandomYaw#obj_id#obj_id#String#float itemRotateReset#obj_id#obj_id#String#float itemRotateRight#obj_id#obj_id#String#float moveFurniture#obj_id#obj_id#String#float msgAddPower#obj_id#dictionary msgAdminPermissions#obj_id#dictionary msgAssignDroid#obj_id#dictionary msgBanPermissions#obj_id#dictionary msgConfirmHousePackup#obj_id#dictionary msgConfirmVendorPackup#obj_id#dictionary msgDepositPowerIncubator#obj_id#dictionary msgEnterPermissions#obj_id#dictionary msgFinalizePackup#obj_id#dictionary msgHopperPermissions#obj_id#dictionary msgNameStructure#obj_id#dictionary msgPAWithdrawFail#obj_id#dictionary msgPAWithdrawSuccess#obj_id#dictionary msgPayMaintenance#obj_id#dictionary msgVendorPermissions#obj_id#dictionary msgWithdrawMaintenance#obj_id#dictionary nameStructure#obj_id#obj_id#String#float paWithdraw#obj_id#obj_id#String#float packUpCityAbandonedStructure#obj_id#dictionary payMaintenance#obj_id#obj_id#String#float placeStructureMode#obj_id#obj_id#String#float rotateFurniture#obj_id#obj_id#String#float setPermission#obj_id#obj_id#String#float setPrivacy#obj_id#obj_id#String#float structureStatus#obj_id#obj_id#String#float transferStructure#obj_id#obj_id#String#float turnstileExpire#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/player/player_collection.script b/sku.0/sys.server/compiled/game/script/.deps/player/player_collection.script deleted file mode 100644 index 12438c25d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/player/player_collection.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/badge library/collection library/prose library/utils -PROTOTYPES: OnCollectionServerFirst#obj_id#String#String#String OnCollectionSlotModified#obj_id#String#String#String#String#boolean#int#int#int#boolean diff --git a/sku.0/sys.server/compiled/game/script/.deps/player/player_faction.script b/sku.0/sys.server/compiled/game/script/.deps/player/player_faction.script deleted file mode 100644 index 8f1ddd68f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/player/player_faction.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/colors_hex library/factions library/gcw library/instance library/prose library/pvp library/regions library/sui library/utils -PROTOTYPES: OnCreatureDamaged#obj_id#obj_id#obj_id#int[] OnEnterRegion#obj_id#String#String OnEnteredCombat#obj_id OnPvpFactionChanged#obj_id#int#int OnPvpTypeChanged#obj_id#int#int cmdDelegateFactionPoints#obj_id#obj_id#String#float cmdFactionalHelper#obj_id#obj_id#String#float cmdGcwScore#obj_id#obj_id#String#float cmdPVP#obj_id#obj_id#String#float displayGcwScoreSui#obj_id#dictionary executeFactionalHelperChoice#obj_id#dictionary gcwStatus#obj_id#obj_id#String#float handleCloneRespawn#obj_id#dictionary handleDelegateSui#obj_id#dictionary handleFactionalHelperChoice#obj_id#dictionary handleGoCovert#obj_id#dictionary handleGoOvert#obj_id#dictionary handleLeaveFactionSui#obj_id#dictionary msgGoCovert#obj_id#dictionary msgGoOnLeave#obj_id#dictionary msgGoOvert#obj_id#dictionary msgResignFromFaction#obj_id#dictionary recievePvpRegionBonus#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/player/player_gm.script b/sku.0/sys.server/compiled/game/script/.deps/player/player_gm.script deleted file mode 100644 index 4afe52137..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/player/player_gm.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/colors library/combat library/consumable library/dot library/group library/healing library/pclib library/pet_lib library/sui library/utils -PROTOTYPES: OnInitialize#obj_id cmdGenerateCraftedItem#obj_id#obj_id#String#float diff --git a/sku.0/sys.server/compiled/game/script/.deps/player/player_instance.script b/sku.0/sys.server/compiled/game/script/.deps/player/player_instance.script deleted file mode 100644 index 8a1c63819..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/player/player_instance.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/badge library/buff library/callable library/factions library/group library/instance library/locations library/prose library/skill library/static_item library/sui library/trial library/utils -PROTOTYPES: OnClusterWideDataResponse#obj_id#String#String#int#String[]#dictionary[]#int OnDuelRequest#obj_id#obj_id#obj_id OnHearSpeech#obj_id#obj_id#String OnLogin#obj_id OnUnsticking#obj_id clearInstanceScriptVar#obj_id#dictionary cmdShowInstanceInformation#obj_id#obj_id#String#float delayInstanceRequest#obj_id#dictionary handleAwardtoken#obj_id#dictionary instanceFailureMessage#obj_id#dictionary movePlayerToInstance#obj_id#dictionary requestInstance#obj_id#obj_id#String#float diff --git a/sku.0/sys.server/compiled/game/script/.deps/player/player_sui.script b/sku.0/sys.server/compiled/game/script/.deps/player/player_sui.script deleted file mode 100644 index 3567dab20..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/player/player_sui.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/player_structure library/sui library/utils -PROTOTYPES: handleCloseSui#obj_id#dictionary handleDecorSlotRemovalSelect#obj_id#dictionary handleDecorTypeSelect#obj_id#dictionary handleSetSuiAssociate#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/player/player_utility.script b/sku.0/sys.server/compiled/game/script/.deps/player/player_utility.script deleted file mode 100644 index 33d8bb269..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/player/player_utility.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/badge library/beast_lib library/buff library/colors library/combat library/create library/factions library/gcw library/gm library/groundquests library/healing library/holiday library/incubator library/locations library/loot library/luck library/marriage library/money library/pclib library/performance library/pet_lib library/planetary_map library/player_structure library/player_version library/prose library/regions library/respec library/session library/skill library/skill_template library/static_item library/stealth library/structure library/sui library/target_dummy library/trial library/turnstile library/utils library/vehicle library/weapons library/xp -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnIncapacitated#obj_id#obj_id OnInitialize#obj_id OnLogin#obj_id OnRemovingFromWorld#obj_id OnRequestAuctionFee#obj_id#obj_id#obj_id#obj_id#boolean#modifiable_int OnWaypointDestroyed#obj_id#obj_id addAppearanceItemEffect#obj_id#dictionary attemptedPayment#obj_id#dictionary bm_collect_dna#obj_id#obj_id#String#float channelHeal#obj_id#dictionary closeLeaderSui#obj_id#dictionary cmdAutoDeclineDuel#obj_id#obj_id#String#float cmdFind#obj_id#obj_id#String#float cmdPathClear#obj_id#obj_id#String#float cmdPathToLocation#obj_id#obj_id#String#float cmdRename#obj_id#obj_id#String#float cmdShowHousePackUpData#obj_id#obj_id#String#float costume_4lom#obj_id#obj_id#String#float costume_battle_droid#obj_id#obj_id#String#float costume_burning_ewok#obj_id#obj_id#String#float costume_chevin#obj_id#obj_id#String#float costume_chiss_01#obj_id#obj_id#String#float costume_dantari_f#obj_id#obj_id#String#float costume_dantari_m#obj_id#obj_id#String#float costume_darktrooper#obj_id#obj_id#String#float costume_droid_8t88#obj_id#obj_id#String#float costume_droideka#obj_id#obj_id#String#float costume_ewok#obj_id#obj_id#String#float costume_exar_kun_cultist#obj_id#obj_id#String#float costume_gamorrean_guard#obj_id#obj_id#String#float costume_gungan#obj_id#obj_id#String#float costume_ig106#obj_id#obj_id#String#float costume_jawa#obj_id#obj_id#String#float costume_lifeday_monkey_lizard#obj_id#obj_id#String#float costume_loveday_ewok_cupid#obj_id#obj_id#String#float costume_monkey_lizard#obj_id#obj_id#String#float costume_muftak#obj_id#obj_id#String#float costume_mustafarian_01#obj_id#obj_id#String#float costume_royal_guard#obj_id#obj_id#String#float costume_spider_droid#obj_id#obj_id#String#float costume_super_battle_droid#obj_id#obj_id#String#float costume_toydarian#obj_id#obj_id#String#float costume_undead_wookie#obj_id#obj_id#String#float displayCityUpdateTime#obj_id#dictionary forage#obj_id#obj_id#String#float handleAttachScript#obj_id#dictionary handleDelayedProseMessage#obj_id#dictionary handleDelayedSystemMessage#obj_id#dictionary handleDetachScript#obj_id#dictionary handleDivorce#obj_id#dictionary handleEntertainingGcwTroops#obj_id#dictionary handleFindSui#obj_id#dictionary handleGmGrantSkillLevelInput#obj_id#dictionary handleGmGrantSkillOptions#obj_id#dictionary handleGmGrantSkillRoadmapSelect#obj_id#dictionary handleGmGrantSkillSkillSelect#obj_id#dictionary handleGrantXp#obj_id#dictionary handleHoloTimeout#obj_id#dictionary handleOpposingFactionDestroyQuest#obj_id#dictionary handleOpposingFactionScoutQuest#obj_id#dictionary handlePerformanceBreach#obj_id#dictionary handleRemoveObjVar#obj_id#dictionary handleRenameCharacterConfirmation#obj_id#dictionary handleRenameCharacterNameInput#obj_id#dictionary handleSUI#obj_id#dictionary handleSmugglerDistanceCheck#obj_id#dictionary handleSmugglerGetLocationInfo#obj_id#dictionary handleSurveyDroidReport#obj_id#dictionary handleTargetDummyCombatReport#obj_id#dictionary handleTraderRepairQuest#obj_id#dictionary handleTurnstilePay#obj_id#dictionary handleTurnstilePayFail#obj_id#dictionary handleVendorDestroy#obj_id#dictionary handleVendorPayment#obj_id#dictionary handleWaypointDestroyRequest#obj_id#dictionary handleWaypointRenameRequest#obj_id#dictionary handlerCommunityBadgeGrant#obj_id#dictionary handlerForPlayerForaging#obj_id#dictionary notifyPlayerOfGcwCityEventAnnouncement#obj_id#dictionary onGcwFactionalPresenceTableDictionaryResponse#obj_id#dictionary recalculateCampDefenseUndeadArray#obj_id#dictionary reimburseTcgItem#obj_id#dictionary removeAppearanceItemEffect#obj_id#dictionary renameCharacterNameValidationFail#obj_id#dictionary renameCharacterNameValidationSuccess#obj_id#dictionary residentLinkFalse#obj_id#dictionary trigger_city_house_packup#obj_id#obj_id#String#float diff --git a/sku.0/sys.server/compiled/game/script/.deps/player/skill/player_teaching.script b/sku.0/sys.server/compiled/game/script/.deps/player/skill/player_teaching.script deleted file mode 100644 index 9410c166e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/player/skill/player_teaching.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/group library/prose library/skill library/sui library/utils library/xp -PROTOTYPES: OnLogin#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int msgTeachSkillConfirmed#obj_id#dictionary msgTeachSkillSelected#obj_id#dictionary teach#obj_id#obj_id#String#float diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/force_sensitive/fs_buff_item.script b/sku.0/sys.server/compiled/game/script/.deps/quest/force_sensitive/fs_buff_item.script deleted file mode 100644 index 38bad3389..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/force_sensitive/fs_buff_item.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/player_structure library/static_item library/utils -PROTOTYPES: OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/hero_of_tatooine/intellect_spawn_control.script b/sku.0/sys.server/compiled/game/script/.deps/quest/hero_of_tatooine/intellect_spawn_control.script deleted file mode 100644 index 419304487..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/hero_of_tatooine/intellect_spawn_control.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/utils -PROTOTYPES: OnAttach#obj_id OnHearSpeech#obj_id#obj_id#String OnInitialize#obj_id handleAllValidationCheck#obj_id#dictionary handleCompletion#obj_id#dictionary handleForcedValidation#obj_id#dictionary handleLocationResponse#obj_id#dictionary handleSingleValidationCheck#obj_id#dictionary handleSpawnValidation#obj_id#dictionary handleValidation#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/task/craft.script b/sku.0/sys.server/compiled/game/script/.deps/quest/task/craft.script deleted file mode 100644 index 72390eac6..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/task/craft.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/quests library/utils -PROTOTYPES: OnCraftedPrototype#obj_id#obj_id#draft_schematic OnQuestActivated#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/base_task.script b/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/base_task.script deleted file mode 100644 index 6adbdc657..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/base_task.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: base/remote_object_requester library/groundquests library/utils -PROTOTYPES: OnLogin#obj_id OnTaskActivated#obj_id#int#int OnTaskCleared#obj_id#int#int OnTaskCompleted#obj_id#int#int OnTaskFailed#obj_id#int#int QuestBaseTaskTimerTaskCompleted#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/defend.script b/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/defend.script deleted file mode 100644 index 4ed055486..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/defend.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/create library/groundquests library/locations library/prose library/quests library/utils quest/task/ground/base_task -PROTOTYPES: OnDetach#obj_id OnInitialize#obj_id OnLogout#obj_id OnTaskActivated#obj_id#int#int OnTaskCleared#obj_id#int#int OnTaskCompleted#obj_id#int#int OnTaskFailed#obj_id#int#int destroyNotification#obj_id#dictionary messageDefendCheckDistance#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/escort.script b/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/escort.script deleted file mode 100644 index fb9e06f7c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/escort.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/create library/groundquests library/locations library/prose library/quests library/spawning library/utils quest/task/ground/base_task -PROTOTYPES: OnDetach#obj_id OnInitialize#obj_id OnLogout#obj_id OnTaskActivated#obj_id#int#int OnTaskCleared#obj_id#int#int OnTaskCompleted#obj_id#int#int OnTaskFailed#obj_id#int#int destroyNotification#obj_id#dictionary messageEscortCheckDistance#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/util/quest_use_object_on_object.script b/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/util/quest_use_object_on_object.script deleted file mode 100644 index c2984f181..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/util/quest_use_object_on_object.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/static_item library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/wait_for_signal.script b/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/wait_for_signal.script deleted file mode 100644 index 692fcbe87..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/wait_for_signal.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/utils quest/task/ground/base_task -PROTOTYPES: OnDetach#obj_id OnInitialize#obj_id OnLogout#obj_id OnTaskActivated#obj_id#int#int OnTaskCleared#obj_id#int#int OnTaskCompleted#obj_id#int#int OnTaskFailed#obj_id#int#int questSignal#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/wave_event_controller_npc.script b/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/wave_event_controller_npc.script deleted file mode 100644 index 18ad90724..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/task/ground/wave_event_controller_npc.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create library/groundquests library/prose library/spawning library/stealth library/sui library/trial library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int cleanupEvent#obj_id#dictionary defaultEventReset#obj_id#dictionary waveEventChildDestroyed#obj_id#dictionary waveEventControllerNPCForceReset#obj_id#dictionary waveEventControllerNPCStart#obj_id#dictionary waveEventSpawnNextWave#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/utility/destroy_notification.script b/sku.0/sys.server/compiled/game/script/.deps/quest/utility/destroy_notification.script deleted file mode 100644 index 21c99f423..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/utility/destroy_notification.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnDestroy#obj_id OnIncapacitated#obj_id#obj_id OnObjectDisabled#obj_id#obj_id addNotification#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/quest/utility/dynamic_spawn_off_quest_item.script b/sku.0/sys.server/compiled/game/script/.deps/quest/utility/dynamic_spawn_off_quest_item.script deleted file mode 100644 index e21426d28..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/quest/utility/dynamic_spawn_off_quest_item.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/attrib library/create library/groundquests library/locations library/trial library/utils -PROTOTYPES: handleQuestFlavorObject#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/space/ai/space_ai.script b/sku.0/sys.server/compiled/game/script/.deps/space/ai/space_ai.script deleted file mode 100644 index e4158308a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/space/ai/space_ai.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/attrib library/ship_ai library/space_combat library/space_utils library/utils transform vector -PROTOTYPES: OnArrivedAtLocation#obj_id#String OnAttach#obj_id OnInitialize#obj_id OnShipBehaviorChanged#obj_id#int#int OnShipIsHitting#obj_id#obj_id#int#int OnShipWasHit#obj_id#obj_id#int#boolean#int#int#boolean#float#float#float OnSpaceUnitDocked#obj_id#obj_id handleUnitIncreaseHate#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/space/combat/combat_ship.script b/sku.0/sys.server/compiled/game/script/.deps/space/combat/combat_ship.script deleted file mode 100644 index 1dffe6fbc..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/space/combat/combat_ship.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/gcw library/pclib library/ship_ai library/space_battlefield library/space_combat library/space_content library/space_crafting library/space_pilot_command library/space_transition library/space_utils library/utils -PROTOTYPES: OnAttach#obj_id OnDestroy#obj_id OnDroppedItemOntoShipComponent#obj_id#int#obj_id#obj_id OnInitialize#obj_id OnLogin#obj_id OnShipComponentInstalled#obj_id#obj_id#int OnShipComponentInstalling#obj_id#obj_id#obj_id#int OnShipComponentPowerInsufficient#obj_id#int#float#float OnShipComponentPowerSufficient#obj_id#int#float OnShipComponentUninstalled#obj_id#obj_id#obj_id#int#obj_id OnShipComponentUninstalling#obj_id#obj_id#int#obj_id OnShipDisabled#obj_id#dictionary OnShipFiredCountermeasure#obj_id#int#obj_id OnShipFiredMissile#obj_id#int#int#int#obj_id#obj_id#int OnShipHitByEnvironment#obj_id#int#float OnShipHitByLightning#obj_id#int#float OnShipWasHit#obj_id#obj_id#int#boolean#int#int#boolean#float#float#float OnSpaceUnitDocked#obj_id#obj_id OnSpaceUnitEnterCombat#obj_id#obj_id OnSpaceUnitUnDocked#obj_id#obj_id#boolean OnSpeaking#obj_id#String OnTryToEquipDroidControlDeviceInShip#obj_id#obj_id#obj_id checkSpacePVPStatus#obj_id#dictionary componentsStunned#obj_id#dictionary destroySelf#obj_id#dictionary disableSelf#obj_id#dictionary emergencyPowerTimeout#obj_id#dictionary flightDroidVocalize#obj_id#dictionary killSpacePlayer#obj_id#dictionary megaDamage#obj_id#dictionary notifyOnDestroy#obj_id#dictionary objectDestroyed#obj_id#dictionary openComm#obj_id#dictionary reactorPumpPulseTimeout#obj_id#dictionary selfDestruct#obj_id#dictionary setupRotationalVelocity#obj_id#dictionary targetDestroyed#obj_id#dictionary targetDisabled#obj_id#dictionary unScramReactor#obj_id#dictionary vRepairDamageCEFLoop#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/assassinate.script b/sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/assassinate.script deleted file mode 100644 index a0817b212..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/assassinate.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/money library/prose library/ship_ai library/space_create library/space_quest library/space_transition library/space_utils library/utils space/quest_logic/recovery -PROTOTYPES: OnAttach#obj_id assassinateSuccess#obj_id#dictionary handleShipDestroyed#obj_id#dictionary targetEscaped#obj_id#dictionary warpInTarget#obj_id#dictionary warpoutFailure#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/assassinate_ship.script b/sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/assassinate_ship.script deleted file mode 100644 index 5477c8878..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/assassinate_ship.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/prose library/space_quest library/space_utils library/utils -PROTOTYPES: OnAttach#obj_id missionAbort#obj_id#dictionary objectDestroyed#obj_id#dictionary warpOut#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/recovery.script b/sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/recovery.script deleted file mode 100644 index dbea58d73..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/space/quest_logic/recovery.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/prose library/ship_ai library/space_crafting library/space_create library/space_quest library/space_transition library/space_utils library/utils -PROTOTYPES: OnAttach#obj_id abortMission#obj_id#dictionary cleanupShipsMsg#obj_id#dictionary completeQuestMsg#obj_id#dictionary handleShipDestroyed#obj_id#dictionary initializedQuestPlayer#obj_id#dictionary launchAttack#obj_id#dictionary playerShipDestroyed#obj_id#dictionary recoverPhase1#obj_id#dictionary recoverPhase2#obj_id#dictionary recoverShipDisabled#obj_id#dictionary recoveryComplete#obj_id#dictionary recoveryFailed#obj_id#dictionary removeQuest#obj_id#dictionary startCapturedShipPathing#obj_id#dictionary targetDestroyed#obj_id#dictionary updateTargetWaypoint#obj_id#dictionary warpInTarget#obj_id#dictionary warpoutFailureRecovery#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/structure/permanent_structure.script b/sku.0/sys.server/compiled/game/script/.deps/structure/permanent_structure.script deleted file mode 100644 index 44c10d371..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/structure/permanent_structure.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/money library/player_structure library/prose library/sui library/utils library/vendor_lib library/xp -PROTOTYPES: OnAboutToLoseItem#obj_id#obj_id#obj_id#obj_id OnAboutToReceiveItem#obj_id#obj_id#obj_id#obj_id OnAttach#obj_id OnDestroy#obj_id OnInitialize#obj_id OnLostItem#obj_id#obj_id#obj_id#obj_id OnMaintenanceLoop#obj_id#dictionary OnReceivedItem#obj_id#obj_id#obj_id#obj_id checkAndMarkForAbandon#obj_id#dictionary checkAndMarkForPreAbandon#obj_id#dictionary checkResidenceLinks#obj_id#dictionary cityMapRegister#obj_id#dictionary cityMapUnregister#obj_id#dictionary createStructureObjects#obj_id#dictionary getStructureCitizenInformation#obj_id#dictionary handleBankSuccess#obj_id#dictionary handleBankTransferError#obj_id#dictionary handleChangeSignSui#obj_id#dictionary handlePayment#obj_id#dictionary handleSpecialSignManagementSelection#obj_id#dictionary handleSpecialSignSelection#obj_id#dictionary handleStructurePackupLockoutRemoval#obj_id#dictionary handleUnloadedCityStructureReportData#obj_id#dictionary houseCheck#obj_id#dictionary logStructureInfo#obj_id#dictionary moneyTransferredFromOwner#obj_id#dictionary moveStructureToSCD#obj_id#dictionary msgDestroyStructure#obj_id#dictionary ownerNSF#obj_id#dictionary ownerNotOnline#obj_id#dictionary packAbandonedBuilding#obj_id#dictionary payCondemnedFees#obj_id#dictionary removeResidentVar#obj_id#dictionary repairCityDamage#obj_id#dictionary requestBankBalance#obj_id#dictionary requestName#obj_id#dictionary setNewMayor#obj_id#dictionary takeCityDamage#obj_id#dictionary validateHopper#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/buff/buff_handler.script b/sku.0/sys.server/compiled/game/script/.deps/systems/buff/buff_handler.script deleted file mode 100644 index 8d9d19c97..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/buff/buff_handler.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/armor library/beast_lib library/buff library/camping library/chat library/collection library/colors library/combat library/create library/dot library/event_perk library/expertise library/factions library/groundquests library/group library/healing library/holiday library/jedi library/locations library/movement library/pclib library/performance library/proc library/prose library/regions library/skill library/stealth library/sui library/trial library/utils library/weapons library/xp -PROTOTYPES: OnChangedPosture#obj_id#int#int OnCreatureDamaged#obj_id#obj_id#obj_id#int[] OnGroupDisbanded#obj_id#obj_id OnGroupMembersChanged#obj_id#obj_id#obj_id[]#obj_id[]#obj_id[] OnLogout#obj_id OnNewbieTutorialResponse#obj_id#String OnRemovedFromGroup#obj_id#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id actionRegenBuff#obj_id#dictionary cacheExpertiseProcReacList#obj_id#dictionary channelForsakeFearCountdownHandler#obj_id#dictionary checkChannelForsakeFear#obj_id#dictionary check_movement_immunity#obj_id#dictionary createAfflicted#obj_id#dictionary delayedAddBuff#obj_id#dictionary eventParticleReload#obj_id#dictionary gcwFatigueDecay#obj_id#dictionary handleCostumeBurningBuffEffect#obj_id#dictionary handleDoIceblock#obj_id#dictionary handleOutbreakStackingInfection#obj_id#dictionary handle_closed_fist_burn#obj_id#dictionary messageDetrimentalRemoved#obj_id#dictionary openSparkHandler#obj_id#dictionary recalcArmor#obj_id#dictionary recalcPools#obj_id#dictionary scoreBoardCheck#obj_id#dictionary setGroupBuffs#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/collection_handle_object_on_object.script b/sku.0/sys.server/compiled/game/script/.deps/systems/collections/collection_handle_object_on_object.script deleted file mode 100644 index a644f4625..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/collection_handle_object_on_object.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/static_item library/sui library/utils -PROTOTYPES: incapaciteSelf#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/collection_use_object_on_object.script b/sku.0/sys.server/compiled/game/script/.deps/systems/collections/collection_use_object_on_object.script deleted file mode 100644 index 75b7a5443..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/collection_use_object_on_object.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/groundquests library/static_item library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleDestroy#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/consume_click.script b/sku.0/sys.server/compiled/game/script/.deps/systems/collections/consume_click.script deleted file mode 100644 index 261fed99b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/consume_click.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/collection library/prose library/stealth library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int removeGcwCollectionLockout#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/consume_loot.script b/sku.0/sys.server/compiled/game/script/.deps/systems/collections/consume_loot.script deleted file mode 100644 index 0d0f3bbea..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/consume_loot.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/collection library/sui library/utils -PROTOTYPES: OnGetAttributes#obj_id#obj_id#String[]#String[] OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handlerSuiAddToCollection#obj_id#dictionary onCollectionListResponse#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/grant_collection_quest.script b/sku.0/sys.server/compiled/game/script/.deps/systems/collections/grant_collection_quest.script deleted file mode 100644 index 1a7f42426..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/grant_collection_quest.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/collection library/groundquests library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleQuestOfferResponse#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift/publish_gift_quest_giver_object.script b/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift/publish_gift_quest_giver_object.script deleted file mode 100644 index 9a5ebbcd5..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift/publish_gift_quest_giver_object.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/groundquests library/locations library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleQuestOfferResponse#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift/publish_gift_shuttle.script b/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift/publish_gift_shuttle.script deleted file mode 100644 index b96e776aa..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift/publish_gift_shuttle.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: cleanUp#obj_id#dictionary startLandingSequence#obj_id#dictionary startTakeOffSequence#obj_id#dictionary takeOff#obj_id#dictionary warpPlayer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift_quest_giver_object.script b/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift_quest_giver_object.script deleted file mode 100644 index b24e57cf9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift_quest_giver_object.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/sui library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleQuestOfferResponse#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift_shuttle.script b/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift_shuttle.script deleted file mode 100644 index 267d85e7f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/collections/publish_gift_shuttle.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: cleanUp#obj_id#dictionary startLandingSequence#obj_id#dictionary startTakeOffSequence#obj_id#dictionary takeOff#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_actions.script b/sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_actions.script deleted file mode 100644 index 5107ed073..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_actions.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/armor library/beast_lib library/bounty_hunter library/buff library/callable library/chat library/colors library/combat library/corpse library/craftinglib library/create library/dot library/faction_perk library/factions library/grenade library/groundquests library/group library/healing library/heavyweapons library/innate library/instance library/locations library/movement library/performance library/pet_lib library/prose library/smuggler library/space_dungeon library/space_utils library/squad_leader library/stealth library/sui library/trial library/utils library/vehicle library/weapons systems/combat/combat_base systems/missions/dynamic/bounty_probe_droid -PROTOTYPES: OnChangedPosture#obj_id#int#int OnEnteredCombat#obj_id OnExitedCombat#obj_id acid_aspect#obj_id#obj_id#String#float actOfWar#obj_id#obj_id#String#float ambush#obj_id#obj_id#String#float applyCritImmunityBuff#obj_id#dictionary applyStunImmunity#obj_id#dictionary applyVortexSnare#obj_id#dictionary assault#obj_id#obj_id#String#float axkva_contagion#obj_id#obj_id#String#float axkva_contagion_bomb#obj_id#obj_id#String#float axkva_crystalize#obj_id#obj_id#String#float axkva_drain#obj_id#obj_id#String#float axkva_force_storm#obj_id#obj_id#String#float axkva_warden_flame#obj_id#obj_id#String#float axkva_whirl_blast#obj_id#obj_id#String#float banner_buff_commando#obj_id#obj_id#String#float barrage#obj_id#obj_id#String#float bh_ae_dm_1#obj_id#obj_id#String#float bh_ae_dm_2#obj_id#obj_id#String#float bh_armor_duelist_1#obj_id#obj_id#String#float bh_armor_duelist_2#obj_id#obj_id#String#float bh_armor_duelist_3#obj_id#obj_id#String#float bh_armor_duelist_4#obj_id#obj_id#String#float bh_armor_duelist_5#obj_id#obj_id#String#float bh_armor_duelist_heal_1#obj_id#obj_id#String#float bh_armor_duelist_heal_2#obj_id#obj_id#String#float bh_armor_duelist_heal_3#obj_id#obj_id#String#float bh_armor_duelist_heal_4#obj_id#obj_id#String#float bh_armor_duelist_heal_5#obj_id#obj_id#String#float bh_armor_sprint_1#obj_id#obj_id#String#float bh_conceal_1#obj_id#obj_id#String#float bh_cover_1#obj_id#obj_id#String#float bh_del_cc_1#obj_id#obj_id#String#float bh_del_cc_2#obj_id#obj_id#String#float bh_del_cc_3#obj_id#obj_id#String#float bh_del_dm_cc_dot_1#obj_id#obj_id#String#float bh_del_dm_cc_dot_2#obj_id#obj_id#String#float bh_del_dm_cc_dot_3#obj_id#obj_id#String#float bh_detect_camouflage_1#obj_id#obj_id#String#float bh_dire_root_area_1#obj_id#obj_id#String#float bh_dm_1#obj_id#obj_id#String#float bh_dm_2#obj_id#obj_id#String#float bh_dm_3#obj_id#obj_id#String#float bh_dm_4#obj_id#obj_id#String#float bh_dm_5#obj_id#obj_id#String#float bh_dm_6#obj_id#obj_id#String#float bh_dm_7#obj_id#obj_id#String#float bh_dm_8#obj_id#obj_id#String#float bh_dm_cc_1#obj_id#obj_id#String#float bh_dm_cc_2#obj_id#obj_id#String#float bh_dm_cc_3#obj_id#obj_id#String#float bh_dm_crit_1#obj_id#obj_id#String#float bh_dm_crit_2#obj_id#obj_id#String#float bh_dm_crit_3#obj_id#obj_id#String#float bh_dm_crit_4#obj_id#obj_id#String#float bh_dm_crit_5#obj_id#obj_id#String#float bh_dm_crit_6#obj_id#obj_id#String#float bh_dm_crit_7#obj_id#obj_id#String#float bh_dm_crit_8#obj_id#obj_id#String#float bh_dread_strike_1#obj_id#obj_id#String#float bh_dread_strike_2#obj_id#obj_id#String#float bh_dread_strike_3#obj_id#obj_id#String#float bh_dread_strike_4#obj_id#obj_id#String#float bh_dread_strike_5#obj_id#obj_id#String#float bh_flawless_strike#obj_id#obj_id#String#float bh_fumble_1#obj_id#obj_id#String#float bh_fumble_2#obj_id#obj_id#String#float bh_fumble_3#obj_id#obj_id#String#float bh_fumble_4#obj_id#obj_id#String#float bh_fumble_5#obj_id#obj_id#String#float bh_fumble_6#obj_id#obj_id#String#float bh_innate_assault_1#obj_id#obj_id#String#float bh_intimidate_1#obj_id#obj_id#String#float bh_intimidate_2#obj_id#obj_id#String#float bh_intimidate_3#obj_id#obj_id#String#float bh_intimidate_4#obj_id#obj_id#String#float bh_intimidate_5#obj_id#obj_id#String#float bh_intimidate_6#obj_id#obj_id#String#float bh_prescience#obj_id#obj_id#String#float bh_relentless_1#obj_id#obj_id#String#float bh_return_fire_1#obj_id#obj_id#String#float bh_return_fire_command_1#obj_id#obj_id#String#float bh_sh_0#obj_id#obj_id#String#float bh_sh_1#obj_id#obj_id#String#float bh_sh_2#obj_id#obj_id#String#float bh_sh_3#obj_id#obj_id#String#float bh_shields_1#obj_id#obj_id#String#float bh_sniper_1#obj_id#obj_id#String#float bh_sniper_2#obj_id#obj_id#String#float bh_sniper_3#obj_id#obj_id#String#float bh_sniper_4#obj_id#obj_id#String#float bh_sniper_5#obj_id#obj_id#String#float bh_sniper_6#obj_id#obj_id#String#float bh_stun_1#obj_id#obj_id#String#float bh_stun_2#obj_id#obj_id#String#float bh_stun_3#obj_id#obj_id#String#float bh_stun_4#obj_id#obj_id#String#float bh_stun_5#obj_id#obj_id#String#float bh_taunt_1#obj_id#obj_id#String#float bh_taunt_2#obj_id#obj_id#String#float bh_taunt_3#obj_id#obj_id#String#float bh_taunt_4#obj_id#obj_id#String#float bh_taunt_5#obj_id#obj_id#String#float bh_taunt_6#obj_id#obj_id#String#float blastAway#obj_id#obj_id#String#float blindRecovery#obj_id#obj_id#String#float blueGlowie#obj_id#obj_id#String#float bm_bite_1#obj_id#obj_id#String#float bm_bite_2#obj_id#obj_id#String#float bm_bite_3#obj_id#obj_id#String#float bm_bite_4#obj_id#obj_id#String#float bm_bite_5#obj_id#obj_id#String#float bm_bolster_armor_1#obj_id#obj_id#String#float bm_bolster_armor_2#obj_id#obj_id#String#float bm_bolster_armor_3#obj_id#obj_id#String#float bm_bolster_armor_4#obj_id#obj_id#String#float bm_bolster_armor_5#obj_id#obj_id#String#float bm_charge_1#obj_id#obj_id#String#float bm_charge_2#obj_id#obj_id#String#float bm_charge_3#obj_id#obj_id#String#float bm_charge_4#obj_id#obj_id#String#float bm_charge_5#obj_id#obj_id#String#float bm_claw_1#obj_id#obj_id#String#float bm_claw_2#obj_id#obj_id#String#float bm_claw_3#obj_id#obj_id#String#float bm_claw_4#obj_id#obj_id#String#float bm_claw_5#obj_id#obj_id#String#float bm_damage_disease_1#obj_id#obj_id#String#float bm_damage_disease_2#obj_id#obj_id#String#float bm_damage_disease_3#obj_id#obj_id#String#float bm_damage_disease_4#obj_id#obj_id#String#float bm_damage_disease_5#obj_id#obj_id#String#float bm_damage_poison_1#obj_id#obj_id#String#float bm_damage_poison_2#obj_id#obj_id#String#float bm_damage_poison_3#obj_id#obj_id#String#float bm_damage_poison_4#obj_id#obj_id#String#float bm_damage_poison_5#obj_id#obj_id#String#float bm_dampen_pain_1#obj_id#obj_id#String#float bm_dampen_pain_2#obj_id#obj_id#String#float bm_dampen_pain_3#obj_id#obj_id#String#float bm_dampen_pain_4#obj_id#obj_id#String#float bm_dampen_pain_5#obj_id#obj_id#String#float bm_defensive_1#obj_id#obj_id#String#float bm_defensive_2#obj_id#obj_id#String#float bm_defensive_3#obj_id#obj_id#String#float bm_defensive_4#obj_id#obj_id#String#float bm_defensive_5#obj_id#obj_id#String#float bm_deflective_hide#obj_id#obj_id#String#float bm_enfeeble_1#obj_id#obj_id#String#float bm_enfeeble_2#obj_id#obj_id#String#float bm_enfeeble_3#obj_id#obj_id#String#float bm_enfeeble_4#obj_id#obj_id#String#float bm_enfeeble_5#obj_id#obj_id#String#float bm_enrage#obj_id#obj_id#String#float bm_flank_1#obj_id#obj_id#String#float bm_flank_2#obj_id#obj_id#String#float bm_flank_3#obj_id#obj_id#String#float bm_forage_enzyme_buff#obj_id#obj_id#String#float bm_frenzy#obj_id#obj_id#String#float bm_hamstring_1#obj_id#obj_id#String#float bm_hamstring_2#obj_id#obj_id#String#float bm_hamstring_3#obj_id#obj_id#String#float bm_hamstring_4#obj_id#obj_id#String#float bm_hamstring_5#obj_id#obj_id#String#float bm_kick_1#obj_id#obj_id#String#float bm_kick_2#obj_id#obj_id#String#float bm_kick_3#obj_id#obj_id#String#float bm_kick_4#obj_id#obj_id#String#float bm_kick_5#obj_id#obj_id#String#float bm_mend_pet_1#obj_id#obj_id#String#float bm_mend_pet_2#obj_id#obj_id#String#float bm_mend_pet_3#obj_id#obj_id#String#float bm_paralytic_poison#obj_id#obj_id#String#float bm_paralytic_poison_recourse#obj_id#dictionary bm_preperation#obj_id#obj_id#String#float bm_provoke_1#obj_id#obj_id#String#float bm_provoke_2#obj_id#obj_id#String#float bm_provoke_3#obj_id#obj_id#String#float bm_provoke_4#obj_id#obj_id#String#float bm_provoke_5#obj_id#obj_id#String#float bm_puncture_1#obj_id#obj_id#String#float bm_puncture_2#obj_id#obj_id#String#float bm_puncture_3#obj_id#obj_id#String#float bm_revive_pet_1#obj_id#obj_id#String#float bm_shaken_1#obj_id#obj_id#String#float bm_shaken_2#obj_id#obj_id#String#float bm_shaken_3#obj_id#obj_id#String#float bm_shield_master#obj_id#obj_id#String#float bm_siphon_1#obj_id#obj_id#String#float bm_siphon_2#obj_id#obj_id#String#float bm_siphon_3#obj_id#obj_id#String#float bm_siphon_4#obj_id#obj_id#String#float bm_siphon_5#obj_id#obj_id#String#float bm_siphon_master#obj_id#obj_id#String#float bm_slash_1#obj_id#obj_id#String#float bm_slash_2#obj_id#obj_id#String#float bm_slash_3#obj_id#obj_id#String#float bm_slash_4#obj_id#obj_id#String#float bm_slash_5#obj_id#obj_id#String#float bm_soothing_comfort_1#obj_id#obj_id#String#float bm_spit_1#obj_id#obj_id#String#float bm_spit_2#obj_id#obj_id#String#float bm_spit_3#obj_id#obj_id#String#float bm_spit_4#obj_id#obj_id#String#float bm_spit_5#obj_id#obj_id#String#float bm_stomp_1#obj_id#obj_id#String#float bm_stomp_2#obj_id#obj_id#String#float bm_stomp_3#obj_id#obj_id#String#float bm_stomp_4#obj_id#obj_id#String#float bm_stomp_5#obj_id#obj_id#String#float bm_trample#obj_id#obj_id#String#float bm_wing_buffet_1#obj_id#obj_id#String#float bm_wing_buffet_2#obj_id#obj_id#String#float bm_wing_buffet_3#obj_id#obj_id#String#float bm_wing_buffet_4#obj_id#obj_id#String#float bm_wing_buffet_5#obj_id#obj_id#String#float bodyguard#obj_id#obj_id#String#float bothan_ability_1#obj_id#obj_id#String#float bountyTrackTarget#obj_id#obj_id#String#float bountycheck#obj_id#obj_id#String#float caretaker_blast#obj_id#obj_id#String#float caretaker_drain#obj_id#obj_id#String#float caretaker_shield#obj_id#obj_id#String#float caretaker_shield_reflect#obj_id#obj_id#String#float caretaker_vapors#obj_id#obj_id#String#float centerOfBeing#obj_id#obj_id#String#float cheapShot#obj_id#obj_id#String#float cloakOfLava#obj_id#obj_id#String#float closed_fist_burn#obj_id#obj_id#String#float closed_fist_burn_damage#obj_id#obj_id#String#float closed_fist_cleave#obj_id#obj_id#String#float closed_fist_toss#obj_id#obj_id#String#float co_ae_dm_1#obj_id#obj_id#String#float co_ae_dm_2#obj_id#obj_id#String#float co_ae_dm_3#obj_id#obj_id#String#float co_ae_hw_dot#obj_id#obj_id#String#float co_armor_cracker#obj_id#obj_id#String#float co_cluster_bomb#obj_id#obj_id#String#float co_cluster_bomblet#obj_id#obj_id#String#float co_conceal_device_1#obj_id#obj_id#String#float co_del_ae_cc_1_1#obj_id#obj_id#String#float co_del_ae_cc_1_2#obj_id#obj_id#String#float co_del_ae_cc_1_3#obj_id#obj_id#String#float co_del_ae_cc_2_1#obj_id#obj_id#String#float co_del_ae_cc_2_2#obj_id#obj_id#String#float co_del_ae_dm_1#obj_id#obj_id#String#float co_del_ae_dm_2#obj_id#obj_id#String#float co_del_ae_dm_3#obj_id#obj_id#String#float co_dm_1#obj_id#obj_id#String#float co_dm_2#obj_id#obj_id#String#float co_dm_3#obj_id#obj_id#String#float co_dm_4#obj_id#obj_id#String#float co_dm_5#obj_id#obj_id#String#float co_dm_6#obj_id#obj_id#String#float co_dm_7#obj_id#obj_id#String#float co_dm_8#obj_id#obj_id#String#float co_double_time#obj_id#obj_id#String#float co_empowered_attack#obj_id#obj_id#String#float co_enrage_1#obj_id#obj_id#String#float co_first_aid_training#obj_id#obj_id#String#float co_fld_dm_1#obj_id#obj_id#String#float co_fld_dm_2#obj_id#obj_id#String#float co_hw_dm_1#obj_id#obj_id#String#float co_hw_dm_2#obj_id#obj_id#String#float co_hw_dm_3#obj_id#obj_id#String#float co_hw_dm_4#obj_id#obj_id#String#float co_hw_dm_5#obj_id#obj_id#String#float co_hw_dm_6#obj_id#obj_id#String#float co_hw_dm_crit_1#obj_id#obj_id#String#float co_hw_dm_crit_2#obj_id#obj_id#String#float co_hw_dm_crit_3#obj_id#obj_id#String#float co_hw_dm_crit_4#obj_id#obj_id#String#float co_hw_dm_crit_5#obj_id#obj_id#String#float co_hw_dm_crit_6#obj_id#obj_id#String#float co_hw_dot#obj_id#obj_id#String#float co_kill_trap_1#obj_id#obj_id#String#float co_killing_spree#obj_id#obj_id#String#float co_killing_spree_attack#obj_id#obj_id#String#float co_mirror_armor#obj_id#obj_id#String#float co_position_secured#obj_id#obj_id#String#float co_remote_detonator_1#obj_id#obj_id#String#float co_remote_detonator_2#obj_id#obj_id#String#float co_remote_detonator_3#obj_id#obj_id#String#float co_remote_detonator_4#obj_id#obj_id#String#float co_remote_detonator_5#obj_id#obj_id#String#float co_riddle_armor#obj_id#obj_id#String#float co_sh_0#obj_id#obj_id#String#float co_sh_1#obj_id#obj_id#String#float co_sh_2#obj_id#obj_id#String#float co_sh_3#obj_id#obj_id#String#float co_shock_grenade_1#obj_id#obj_id#String#float co_shock_grenade_2#obj_id#obj_id#String#float co_shock_grenade_3#obj_id#obj_id#String#float co_shock_grenade_4#obj_id#obj_id#String#float co_shock_tracer_1#obj_id#obj_id#String#float co_shock_tracer_2#obj_id#obj_id#String#float co_shock_tracer_3#obj_id#obj_id#String#float co_shock_tracer_4#obj_id#obj_id#String#float co_stand_fast#obj_id#obj_id#String#float co_stim_armor#obj_id#obj_id#String#float co_suppressing_fire#obj_id#obj_id#String#float col_jedi_statue_dark_debuff#obj_id#obj_id#String#float col_jedi_statue_light_debuff#obj_id#obj_id#String#float cold_aspect#obj_id#obj_id#String#float combatTarget#obj_id#obj_id#String#float command_pvp_adrenaline_ability#obj_id#obj_id#String#float command_pvp_adrenaline_rebel_ability#obj_id#obj_id#String#float command_pvp_last_man_ability#obj_id#obj_id#String#float command_pvp_last_man_rebel_ability#obj_id#obj_id#String#float command_pvp_retaliation_ability#obj_id#obj_id#String#float command_pvp_retaliation_rebel_ability#obj_id#obj_id#String#float command_pvp_unstoppable_ability#obj_id#obj_id#String#float command_pvp_unstoppable_rebel_ability#obj_id#obj_id#String#float creatureAreaAttack#obj_id#obj_id#String#float creatureAreaBleeding#obj_id#obj_id#String#float creatureAreaCombo#obj_id#obj_id#String#float creatureAreaDisease#obj_id#obj_id#String#float creatureAreaDiseaseSuccess#obj_id#dictionary creatureAreaKnockdown#obj_id#obj_id#String#float creatureAreaPoison#obj_id#obj_id#String#float creatureAreaPoisonSuccess#obj_id#dictionary creatureBlindAttack#obj_id#obj_id#String#float creatureDizzyAttack#obj_id#obj_id#String#float creatureFireAttack#obj_id#obj_id#String#float creatureIntimidationAttack#obj_id#obj_id#String#float creatureKnockdownAttack#obj_id#obj_id#String#float creatureMeleeAttack#obj_id#obj_id#String#float creaturePoisonAttack#obj_id#obj_id#String#float creaturePostureDownAttack#obj_id#obj_id#String#float creaturePostureUpAttack#obj_id#obj_id#String#float creatureRangedAttack#obj_id#obj_id#String#float creatureSnareAttack#obj_id#obj_id#String#float creatureStunAttack#obj_id#obj_id#String#float creature_milking_buff#obj_id#obj_id#String#float crippleShot#obj_id#obj_id#String#float ct_guard_buff#obj_id#obj_id#String#float dazeRecourse#obj_id#dictionary death_troopers_afflicted_konk#obj_id#obj_id#String#float death_troopers_afflicted_splat#obj_id#obj_id#String#float death_troopers_afflicted_toss#obj_id#obj_id#String#float death_troopers_death_wing_afflict#obj_id#obj_id#String#float death_troopers_infection_1#obj_id#dictionary death_troopers_infection_1_delay#obj_id#dictionary death_troopers_infection_2#obj_id#dictionary death_troopers_infection_2_delay#obj_id#dictionary death_troopers_infection_3#obj_id#dictionary death_troopers_infection_3_delay#obj_id#dictionary death_troopers_inoculation#obj_id#dictionary decrepitStrike#obj_id#obj_id#String#float demolition#obj_id#obj_id#String#float devastating_strike#obj_id#obj_id#String#float dire_root_recourse#obj_id#dictionary dire_snare_recourse#obj_id#dictionary dizzyRecovery#obj_id#obj_id#String#float droid_battery_dump_1#obj_id#obj_id#String#float droid_battery_dump_2#obj_id#obj_id#String#float droid_battery_dump_3#obj_id#obj_id#String#float droid_droideka_shield_1#obj_id#obj_id#String#float droid_droideka_shield_2#obj_id#obj_id#String#float droid_droideka_shield_3#obj_id#obj_id#String#float droid_electrical_shock_1#obj_id#obj_id#String#float droid_electrical_shock_2#obj_id#obj_id#String#float droid_electrical_shock_3#obj_id#obj_id#String#float droid_flame_jet_1#obj_id#obj_id#String#float droid_flame_jet_2#obj_id#obj_id#String#float droid_flame_jet_3#obj_id#obj_id#String#float droid_regenerative_plating_1#obj_id#obj_id#String#float droid_regenerative_plating_2#obj_id#obj_id#String#float droid_regenerative_plating_3#obj_id#obj_id#String#float droid_torturous_needle_1#obj_id#obj_id#String#float droid_torturous_needle_2#obj_id#obj_id#String#float droid_torturous_needle_3#obj_id#obj_id#String#float eggDetonated#obj_id#dictionary elec_aspect#obj_id#obj_id#String#float en_dm_1#obj_id#obj_id#String#float en_dm_2#obj_id#obj_id#String#float en_dm_3#obj_id#obj_id#String#float en_dm_4#obj_id#obj_id#String#float en_dm_5#obj_id#obj_id#String#float en_dm_6#obj_id#obj_id#String#float en_dm_7#obj_id#obj_id#String#float en_dm_8#obj_id#obj_id#String#float en_holographic_image#obj_id#obj_id#String#float en_holographic_recall#obj_id#obj_id#String#float en_project_will_0#obj_id#obj_id#String#float en_project_will_1#obj_id#obj_id#String#float en_project_will_2#obj_id#obj_id#String#float en_project_will_3#obj_id#obj_id#String#float en_project_will_4#obj_id#obj_id#String#float en_project_will_5#obj_id#obj_id#String#float en_project_will_6#obj_id#obj_id#String#float en_sh_1#obj_id#obj_id#String#float en_sh_2#obj_id#obj_id#String#float en_sh_3#obj_id#obj_id#String#float en_spiral_kick_0#obj_id#obj_id#String#float en_spiral_kick_1#obj_id#obj_id#String#float en_spiral_kick_2#obj_id#obj_id#String#float en_spiral_kick_3#obj_id#obj_id#String#float en_spiral_kick_4#obj_id#obj_id#String#float en_strike_0#obj_id#obj_id#String#float en_strike_1#obj_id#obj_id#String#float en_strike_2#obj_id#obj_id#String#float en_strike_3#obj_id#obj_id#String#float en_strike_4#obj_id#obj_id#String#float en_strike_5#obj_id#obj_id#String#float en_strike_6#obj_id#obj_id#String#float en_sweeping_pirouette_0#obj_id#obj_id#String#float en_sweeping_pirouette_1#obj_id#obj_id#String#float en_sweeping_pirouette_2#obj_id#obj_id#String#float en_sweeping_pirouette_3#obj_id#obj_id#String#float en_sweeping_pirouette_4#obj_id#obj_id#String#float en_sweeping_pirouette_5#obj_id#obj_id#String#float en_thrill#obj_id#obj_id#String#float en_unhealthy_fixation#obj_id#obj_id#String#float en_void_dance#obj_id#obj_id#String#float entrench#obj_id#obj_id#String#float euphoria#obj_id#obj_id#String#float executioner_swipe#obj_id#obj_id#String#float expertise_buildabuff_heal_1_reac#obj_id#obj_id#String#float expertise_buildabuff_heal_2_reac#obj_id#obj_id#String#float expertise_buildabuff_heal_3_reac#obj_id#obj_id#String#float expertise_co_burst_fire_proc#obj_id#obj_id#String#float expertise_dueterium_rounds_proc#obj_id#obj_id#String#float expertise_fs_force_clarity_1_proc#obj_id#obj_id#String#float expertise_generic_test_proc#obj_id#obj_id#String#float expertise_generic_test_reac#obj_id#obj_id#String#float expertise_poison_knuckle_proc#obj_id#obj_id#String#float expertise_sm_card_melee_proc#obj_id#obj_id#String#float expertise_sm_card_ranged_proc#obj_id#obj_id#String#float expertise_sm_feeling_lucky_chance_proc#obj_id#obj_id#String#float expertise_sm_melee_proc#obj_id#obj_id#String#float expertise_sm_melee_stun_proc#obj_id#obj_id#String#float expertise_sm_ranged_shot_proc#obj_id#obj_id#String#float failDefaultAttack#obj_id#obj_id#String#float failProc#obj_id#obj_id#String#float failSpecialAttack#obj_id#obj_id#String#float failThrowGrenade#obj_id#obj_id#String#float fireAcidBeam#obj_id#obj_id#String#float fireAcidBeamAvatar#obj_id#obj_id#String#float fireAcidRifle#obj_id#obj_id#String#float fireCr1BlastCannon#obj_id#obj_id#String#float fireCrusaderHeavyRifle#obj_id#obj_id#String#float fireElitePistolLauncher#obj_id#obj_id#String#float fireFlameThrowerLight#obj_id#obj_id#String#float fireHeavyShotgun#obj_id#obj_id#String#float fireIceGun#obj_id#obj_id#String#float fireLavaCannon#obj_id#obj_id#String#float fireLavaCannonGeneric#obj_id#obj_id#String#float fireLightningBeam#obj_id#obj_id#String#float fireParticleBeam#obj_id#obj_id#String#float firePistolLauncher#obj_id#obj_id#String#float firePistolLauncherGeneric#obj_id#obj_id#String#float firePistolLauncherMedium#obj_id#obj_id#String#float firePistolLauncherTargeting#obj_id#obj_id#String#float firePlasmaFlameThrower#obj_id#obj_id#String#float firePulseCannon#obj_id#obj_id#String#float firePvpHeavy#obj_id#obj_id#String#float fireRepublicFlameThrower#obj_id#obj_id#String#float fireRepublicFlameThrowerGeneric#obj_id#obj_id#String#float fireRocketLauncher#obj_id#obj_id#String#float fireRocketLauncherGeneric#obj_id#obj_id#String#float fireStunCannon#obj_id#obj_id#String#float fireVoidRocketLauncher#obj_id#obj_id#String#float forceCrystalForce#obj_id#obj_id#String#float forceFocus#obj_id#obj_id#String#float forceRun#obj_id#obj_id#String#float forceStrike#obj_id#obj_id#String#float forceThrow#obj_id#obj_id#String#float fs_ae_dm_cc_1#obj_id#obj_id#String#float fs_ae_dm_cc_2#obj_id#obj_id#String#float fs_ae_dm_cc_3#obj_id#obj_id#String#float fs_ae_dm_cc_4#obj_id#obj_id#String#float fs_ae_dm_cc_5#obj_id#obj_id#String#float fs_ae_dm_cc_6#obj_id#obj_id#String#float fs_buff_ca_1#obj_id#obj_id#String#float fs_buff_def_1_1#obj_id#obj_id#String#float fs_buff_invis_1#obj_id#obj_id#String#float fs_dm_1#obj_id#obj_id#String#float fs_dm_2#obj_id#obj_id#String#float fs_dm_3#obj_id#obj_id#String#float fs_dm_4#obj_id#obj_id#String#float fs_dm_5#obj_id#obj_id#String#float fs_dm_6#obj_id#obj_id#String#float fs_dm_7#obj_id#obj_id#String#float fs_dm_cc_1#obj_id#obj_id#String#float fs_dm_cc_2#obj_id#obj_id#String#float fs_dm_cc_3#obj_id#obj_id#String#float fs_dm_cc_4#obj_id#obj_id#String#float fs_dm_cc_5#obj_id#obj_id#String#float fs_dm_cc_6#obj_id#obj_id#String#float fs_dm_cc_crit_1#obj_id#obj_id#String#float fs_dm_cc_crit_2#obj_id#obj_id#String#float fs_dm_cc_crit_3#obj_id#obj_id#String#float fs_dm_cc_crit_4#obj_id#obj_id#String#float fs_dm_cc_crit_5#obj_id#obj_id#String#float fs_dot_immunity_recourse#obj_id#dictionary fs_drain_1#obj_id#obj_id#String#float fs_drain_2#obj_id#obj_id#String#float fs_drain_3#obj_id#obj_id#String#float fs_drain_4#obj_id#obj_id#String#float fs_drain_5#obj_id#obj_id#String#float fs_flurry_1#obj_id#obj_id#String#float fs_flurry_2#obj_id#obj_id#String#float fs_flurry_3#obj_id#obj_id#String#float fs_flurry_4#obj_id#obj_id#String#float fs_flurry_5#obj_id#obj_id#String#float fs_flurry_6#obj_id#obj_id#String#float fs_flurry_7#obj_id#obj_id#String#float fs_force_spark#obj_id#obj_id#String#float fs_forsake_fear#obj_id#obj_id#String#float fs_hermetic_touch#obj_id#obj_id#String#float fs_maelstrom_1#obj_id#obj_id#String#float fs_maelstrom_2#obj_id#obj_id#String#float fs_maelstrom_3#obj_id#obj_id#String#float fs_maelstrom_4#obj_id#obj_id#String#float fs_maelstrom_5#obj_id#obj_id#String#float fs_mind_trick_1#obj_id#obj_id#String#float fs_mind_trick_2#obj_id#obj_id#String#float fs_riposte#obj_id#obj_id#String#float fs_saber_reflect#obj_id#obj_id#String#float fs_saber_reflect_buff#obj_id#obj_id#String#float fs_sense_danger_1#obj_id#obj_id#String#float fs_set_heroic_taunt_1#obj_id#obj_id#String#float fs_sh_0#obj_id#obj_id#String#float fs_sh_1#obj_id#obj_id#String#float fs_sh_2#obj_id#obj_id#String#float fs_sh_3#obj_id#obj_id#String#float fs_sweep_1#obj_id#obj_id#String#float fs_sweep_2#obj_id#obj_id#String#float fs_sweep_3#obj_id#obj_id#String#float fs_sweep_4#obj_id#obj_id#String#float fs_sweep_5#obj_id#obj_id#String#float fs_sweep_6#obj_id#obj_id#String#float fs_sweep_7#obj_id#obj_id#String#float fs_taunt#obj_id#obj_id#String#float gallop#obj_id#obj_id#String#float gallopStop#obj_id#obj_id#String#float gcw_atst_attack_tower#obj_id#obj_id#String#float gcw_base_damage_shield_a#obj_id#obj_id#String#float gcw_base_damage_shield_b#obj_id#obj_id#String#float gcw_base_damage_shield_c#obj_id#obj_id#String#float gcw_base_damage_shield_d#obj_id#obj_id#String#float gcw_base_damage_shield_e#obj_id#obj_id#String#float gcw_base_reactive_action_a#obj_id#obj_id#String#float gcw_base_reactive_action_b#obj_id#obj_id#String#float gcw_base_reactive_action_c#obj_id#obj_id#String#float gcw_base_reactive_action_d#obj_id#obj_id#String#float gcw_base_reactive_action_e#obj_id#obj_id#String#float gcw_base_reactive_heal_a#obj_id#obj_id#String#float gcw_base_reactive_heal_b#obj_id#obj_id#String#float gcw_base_reactive_heal_c#obj_id#obj_id#String#float gcw_base_reactive_heal_d#obj_id#obj_id#String#float gcw_base_reactive_heal_e#obj_id#obj_id#String#float gcw_reward_comlink#obj_id#obj_id#String#float gcw_rocket_hit#obj_id#dictionary gcw_rocket_launch#obj_id#obj_id#String#float gcw_rocket_launcher#obj_id#obj_id#String#float grenadier_acid#obj_id#obj_id#String#float grenadier_cold#obj_id#obj_id#String#float grenadier_heat#obj_id#obj_id#String#float grenadier_kinetic#obj_id#obj_id#String#float handleClearBuffEffect#obj_id#dictionary handlePostureRestore#obj_id#dictionary heat_aspect#obj_id#obj_id#String#float hipShot#obj_id#obj_id#String#float hoth_ai_speeder_shoot#obj_id#obj_id#String#float hoth_atat_mine#obj_id#obj_id#String#float hoth_atat_shoot#obj_id#obj_id#String#float hoth_atat_vehicle_shoot#obj_id#obj_id#String#float hoth_commando_rocket#obj_id#obj_id#String#float hoth_sapper_detonate#obj_id#obj_id#String#float hoth_sapper_place#obj_id#obj_id#String#float hoth_scout_cannon#obj_id#obj_id#String#float hoth_scout_ear_gun#obj_id#obj_id#String#float hoth_scout_ear_gun_switch#obj_id#obj_id#String#float hoth_scout_rocket#obj_id#obj_id#String#float hoth_scout_rocket_switch#obj_id#obj_id#String#float hoth_scout_shield#obj_id#obj_id#String#float hoth_speeder_bolt#obj_id#obj_id#String#float hoth_speeder_down#obj_id#obj_id#String#float hoth_speeder_down_reset#obj_id#dictionary hoth_speeder_land#obj_id#obj_id#String#float hoth_speeder_shoot#obj_id#obj_id#String#float hoth_speeder_takeoff#obj_id#obj_id#String#float hoth_speeder_up#obj_id#obj_id#String#float hoth_speeder_up_reset#obj_id#dictionary human_ability_1#obj_id#obj_id#String#float iceCreamRecourse#obj_id#dictionary ig88_bomb_explode#obj_id#obj_id#String#float ig88_droideka_electrify#obj_id#obj_id#String#float ig88_droideka_shield#obj_id#obj_id#String#float ig88_flame_thrower#obj_id#obj_id#String#float ig88_flame_thrower_vertical#obj_id#obj_id#String#float ig88_grenade#obj_id#obj_id#String#float ig88_rocket_hit#obj_id#dictionary ig88_rocket_launch#obj_id#obj_id#String#float ig88_rocket_launcher#obj_id#obj_id#String#float ig88_shield#obj_id#obj_id#String#float ig88_shockwave#obj_id#obj_id#String#float insidiousMalady#obj_id#obj_id#String#float ithorian_ability_1#obj_id#obj_id#String#float ito_nerve_gas#obj_id#obj_id#String#float kav_tuken_killer#obj_id#obj_id#String#float kenkirk_droid_blast#obj_id#obj_id#String#float kill_meter_co_armor_splash_proc#obj_id#obj_id#String#float kill_meter_co_it_burns_proc#obj_id#obj_id#String#float kill_meter_co_youll_regret_that_reac#obj_id#obj_id#String#float kimaru_flame_patch#obj_id#obj_id#String#float kimaru_generate_storm#obj_id#obj_id#String#float kimaru_storm_pulse#obj_id#obj_id#String#float king_head_crack#obj_id#obj_id#String#float king_rend#obj_id#obj_id#String#float king_sandstorm#obj_id#obj_id#String#float kneel#obj_id#obj_id#String#float kneelFail#obj_id#obj_id#String#float knockdownRecovery#obj_id#obj_id#String#float krix_burn#obj_id#obj_id#String#float krix_megaburn#obj_id#obj_id#String#float krix_megapatch#obj_id#obj_id#String#float kun_chaos_discord#obj_id#obj_id#String#float kun_chaos_set#obj_id#obj_id#String#float kun_eight_sacrifice#obj_id#obj_id#String#float kun_five_sacrifice#obj_id#obj_id#String#float kun_four_sacrifice#obj_id#obj_id#String#float kun_one_sacrifice#obj_id#obj_id#String#float kun_open_coil#obj_id#obj_id#String#float kun_order_discipline#obj_id#obj_id#String#float kun_order_set#obj_id#obj_id#String#float kun_seven_sacrifice#obj_id#obj_id#String#float kun_six_sacrifice#obj_id#obj_id#String#float kun_sword_break#obj_id#obj_id#String#float kun_sword_cleave#obj_id#obj_id#String#float kun_sword_defensive#obj_id#obj_id#String#float kun_sword_multi#obj_id#obj_id#String#float kun_three_sacrifice#obj_id#obj_id#String#float kun_two_sacrifice#obj_id#obj_id#String#float kun_veng_slam#obj_id#obj_id#String#float kun_veng_wave#obj_id#obj_id#String#float kun_word_coil#obj_id#obj_id#String#float kun_word_flurry#obj_id#obj_id#String#float kun_word_shaken#obj_id#obj_id#String#float kun_wrath_acid#obj_id#obj_id#String#float kun_wrath_cold#obj_id#obj_id#String#float kun_wrath_electrical#obj_id#obj_id#String#float kun_wrath_heat#obj_id#obj_id#String#float kun_wrath_ward#obj_id#obj_id#String#float lair_egg_buff#obj_id#obj_id#String#float lasher_increase_pain#obj_id#obj_id#String#float lasher_strike#obj_id#obj_id#String#float lelli_ambush#obj_id#obj_id#String#float lelli_bleed#obj_id#obj_id#String#float lelli_chain_cleave#obj_id#obj_id#String#float lelli_mine#obj_id#obj_id#String#float macy_ywing_bomb#obj_id#obj_id#String#float maladyRecourse#obj_id#dictionary maladyRecourse_1#obj_id#dictionary maladyRecourse_2#obj_id#dictionary maladyRecourse_3#obj_id#dictionary me_ae_heal_1#obj_id#obj_id#String#float me_ae_heal_2#obj_id#obj_id#String#float me_ae_heal_3#obj_id#obj_id#String#float me_ae_heal_4#obj_id#obj_id#String#float me_ae_heal_5#obj_id#obj_id#String#float me_ae_heal_6#obj_id#obj_id#String#float me_bacta_ampule_1#obj_id#obj_id#String#float me_bacta_ampule_2#obj_id#obj_id#String#float me_bacta_ampule_3#obj_id#obj_id#String#float me_bacta_ampule_4#obj_id#obj_id#String#float me_bacta_ampule_5#obj_id#obj_id#String#float me_bacta_ampule_6#obj_id#obj_id#String#float me_bacta_bomb_1#obj_id#obj_id#String#float me_bacta_bomb_2#obj_id#obj_id#String#float me_bacta_bomb_3#obj_id#obj_id#String#float me_bacta_bomb_4#obj_id#obj_id#String#float me_bacta_bomb_5#obj_id#obj_id#String#float me_bacta_grenade_1#obj_id#obj_id#String#float me_bacta_grenade_2#obj_id#obj_id#String#float me_bacta_grenade_3#obj_id#obj_id#String#float me_bacta_grenade_4#obj_id#obj_id#String#float me_bacta_grenade_5#obj_id#obj_id#String#float me_bacta_resistance_1#obj_id#obj_id#String#float me_blood_cleaners_1#obj_id#obj_id#String#float me_buff_health_1#obj_id#obj_id#String#float me_buff_health_2#obj_id#obj_id#String#float me_buff_health_3#obj_id#obj_id#String#float me_burst_1#obj_id#obj_id#String#float me_burst_2#obj_id#obj_id#String#float me_burst_3#obj_id#obj_id#String#float me_burst_4#obj_id#obj_id#String#float me_burst_5#obj_id#obj_id#String#float me_cranial_smash_1#obj_id#obj_id#String#float me_cranial_smash_2#obj_id#obj_id#String#float me_cranial_smash_3#obj_id#obj_id#String#float me_cranial_smash_4#obj_id#obj_id#String#float me_cranial_smash_5#obj_id#obj_id#String#float me_cure_affliction_1#obj_id#obj_id#String#float me_dm_1#obj_id#obj_id#String#float me_dm_2#obj_id#obj_id#String#float me_dm_3#obj_id#obj_id#String#float me_dm_4#obj_id#obj_id#String#float me_dm_5#obj_id#obj_id#String#float me_dm_6#obj_id#obj_id#String#float me_dm_8#obj_id#obj_id#String#float me_dm_dot_1#obj_id#obj_id#String#float me_dm_dot_2#obj_id#obj_id#String#float me_dm_dot_3#obj_id#obj_id#String#float me_dm_dot_4#obj_id#obj_id#String#float me_dm_dot_5#obj_id#obj_id#String#float me_dm_dot_6#obj_id#obj_id#String#float me_drag_1#obj_id#obj_id#String#float me_electrolyte_drain_1#obj_id#obj_id#String#float me_enhance_action_1#obj_id#obj_id#String#float me_enhance_action_2#obj_id#obj_id#String#float me_enhance_action_3#obj_id#obj_id#String#float me_enhance_agility_1#obj_id#obj_id#String#float me_enhance_agility_2#obj_id#obj_id#String#float me_enhance_agility_3#obj_id#obj_id#String#float me_enhance_block_1#obj_id#obj_id#String#float me_enhance_dodge_1#obj_id#obj_id#String#float me_enhance_precision_1#obj_id#obj_id#String#float me_enhance_precision_2#obj_id#obj_id#String#float me_enhance_precision_3#obj_id#obj_id#String#float me_enhance_strength_1#obj_id#obj_id#String#float me_enhance_strength_2#obj_id#obj_id#String#float me_enhance_strength_3#obj_id#obj_id#String#float me_evasion_1#obj_id#obj_id#String#float me_fld_dm_dot_1#obj_id#obj_id#String#float me_fld_dm_dot_2#obj_id#obj_id#String#float me_fld_dm_dot_3#obj_id#obj_id#String#float me_hot_1#obj_id#obj_id#String#float me_hot_2#obj_id#obj_id#String#float me_hot_3#obj_id#obj_id#String#float me_induce_insanity_1#obj_id#obj_id#String#float me_reckless_stimulation_1#obj_id#obj_id#String#float me_reckless_stimulation_2#obj_id#obj_id#String#float me_reckless_stimulation_3#obj_id#obj_id#String#float me_reckless_stimulation_4#obj_id#obj_id#String#float me_reckless_stimulation_5#obj_id#obj_id#String#float me_reckless_stimulation_6#obj_id#obj_id#String#float me_rv_area#obj_id#obj_id#String#float me_rv_combat#obj_id#obj_id#String#float me_rv_ooc#obj_id#obj_id#String#float me_rv_pvp_area#obj_id#obj_id#String#float me_rv_pvp_single#obj_id#obj_id#String#float me_serotonin_boost_1#obj_id#obj_id#String#float me_serotonin_purge_1#obj_id#obj_id#String#float me_sh_1#obj_id#obj_id#String#float me_stasis_1#obj_id#obj_id#String#float me_stasis_self_1#obj_id#obj_id#String#float me_thyroid_rupture_1#obj_id#obj_id#String#float me_traumatize_1#obj_id#obj_id#String#float me_traumatize_2#obj_id#obj_id#String#float me_traumatize_3#obj_id#obj_id#String#float me_traumatize_4#obj_id#obj_id#String#float me_traumatize_5#obj_id#obj_id#String#float meleeHit#obj_id#obj_id#String#float mezRecourse#obj_id#dictionary minder_luresh_drain#obj_id#obj_id#String#float moncal_ability_1#obj_id#obj_id#String#float nandina_fester#obj_id#obj_id#String#float nandina_heal#obj_id#obj_id#String#float neurotoxin#obj_id#obj_id#String#float ofAggroChannel#obj_id#obj_id#String#float of_ae_dm_boss#obj_id#obj_id#String#float of_ae_dm_cc_1#obj_id#obj_id#String#float of_ae_dm_cc_2#obj_id#obj_id#String#float of_ae_dm_cc_3#obj_id#obj_id#String#float of_buff_def_1#obj_id#obj_id#String#float of_buff_def_2#obj_id#obj_id#String#float of_buff_def_3#obj_id#obj_id#String#float of_buff_def_4#obj_id#obj_id#String#float of_buff_def_5#obj_id#obj_id#String#float of_buff_def_6#obj_id#obj_id#String#float of_buff_def_7#obj_id#obj_id#String#float of_buff_def_8#obj_id#obj_id#String#float of_buff_def_9#obj_id#obj_id#String#float of_charge_1#obj_id#obj_id#String#float of_deb_def_1#obj_id#obj_id#String#float of_deb_def_2#obj_id#obj_id#String#float of_deb_def_3#obj_id#obj_id#String#float of_deb_def_4#obj_id#obj_id#String#float of_deb_def_5#obj_id#obj_id#String#float of_deb_def_6#obj_id#obj_id#String#float of_deb_def_7#obj_id#obj_id#String#float of_deb_def_8#obj_id#obj_id#String#float of_decapitate_1#obj_id#obj_id#String#float of_decapitate_2#obj_id#obj_id#String#float of_decapitate_3#obj_id#obj_id#String#float of_decapitate_4#obj_id#obj_id#String#float of_decapitate_5#obj_id#obj_id#String#float of_decapitate_6#obj_id#obj_id#String#float of_del_ae_dm_1#obj_id#obj_id#String#float of_del_ae_dm_2#obj_id#obj_id#String#float of_del_ae_dm_3#obj_id#obj_id#String#float of_del_ae_dm_boss#obj_id#obj_id#String#float of_del_ae_dm_dot_1#obj_id#obj_id#String#float of_del_ae_dm_dot_2#obj_id#obj_id#String#float of_del_ae_dm_dot_3#obj_id#obj_id#String#float of_del_ae_dot_1#obj_id#obj_id#String#float of_dm_1#obj_id#obj_id#String#float of_dm_2#obj_id#obj_id#String#float of_dm_3#obj_id#obj_id#String#float of_dm_4#obj_id#obj_id#String#float of_dm_5#obj_id#obj_id#String#float of_dm_6#obj_id#obj_id#String#float of_dm_7#obj_id#obj_id#String#float of_dm_8#obj_id#obj_id#String#float of_dm_boss#obj_id#obj_id#String#float of_drillmaster_1#obj_id#obj_id#String#float of_drop_1#obj_id#obj_id#String#float of_firepower_1#obj_id#obj_id#String#float of_focus_fire_1#obj_id#obj_id#String#float of_focus_fire_2#obj_id#obj_id#String#float of_focus_fire_3#obj_id#obj_id#String#float of_focus_fire_4#obj_id#obj_id#String#float of_focus_fire_5#obj_id#obj_id#String#float of_focus_fire_6#obj_id#obj_id#String#float of_inspiration_1#obj_id#obj_id#String#float of_inspiration_2#obj_id#obj_id#String#float of_inspiration_3#obj_id#obj_id#String#float of_inspiration_4#obj_id#obj_id#String#float of_inspiration_5#obj_id#obj_id#String#float of_inspiration_6#obj_id#obj_id#String#float of_last_words_recourse#obj_id#dictionary of_medical_sup_1#obj_id#obj_id#String#float of_medical_sup_2#obj_id#obj_id#String#float of_medical_sup_3#obj_id#obj_id#String#float of_medical_sup_4#obj_id#obj_id#String#float of_medical_sup_5#obj_id#obj_id#String#float of_medical_sup_6#obj_id#obj_id#String#float of_pistol_bleed#obj_id#obj_id#String#float of_pistol_dm#obj_id#obj_id#String#float of_purge_1#obj_id#obj_id#String#float of_rally_point_def#obj_id#obj_id#String#float of_rally_point_off#obj_id#obj_id#String#float of_reinforcements_1#obj_id#obj_id#String#float of_reinforcements_2#obj_id#obj_id#String#float of_reinforcements_3#obj_id#obj_id#String#float of_reinforcements_4#obj_id#obj_id#String#float of_reinforcements_5#obj_id#obj_id#String#float of_scatter_1#obj_id#obj_id#String#float of_sh_0#obj_id#obj_id#String#float of_sh_1#obj_id#obj_id#String#float of_sh_2#obj_id#obj_id#String#float of_sh_3#obj_id#obj_id#String#float of_stimulator_1#obj_id#obj_id#String#float of_tactical_sup_1#obj_id#obj_id#String#float of_tactical_sup_2#obj_id#obj_id#String#float of_tactical_sup_3#obj_id#obj_id#String#float of_tactical_sup_4#obj_id#obj_id#String#float of_tactical_sup_5#obj_id#obj_id#String#float of_tactical_sup_6#obj_id#obj_id#String#float of_vortex_1#obj_id#obj_id#String#float of_vortex_2#obj_id#obj_id#String#float of_vortex_3#obj_id#obj_id#String#float of_vortex_4#obj_id#obj_id#String#float of_vortex_5#obj_id#obj_id#String#float of_vortex_6#obj_id#obj_id#String#float onehandThrow#obj_id#obj_id#String#float open_cultist_drain#obj_id#obj_id#String#float paintTarget#obj_id#obj_id#String#float performHateTick#obj_id#dictionary petBleedAttack#obj_id#obj_id#String#float petBlindAttack#obj_id#obj_id#String#float petDefenseBreakAttack#obj_id#obj_id#String#float petIntimidateAttack#obj_id#obj_id#String#float petKnockdownAttack#obj_id#obj_id#String#float petPinAttack#obj_id#obj_id#String#float petSnareAttack#obj_id#obj_id#String#float petStunAttack#obj_id#obj_id#String#float pingObject#obj_id#dictionary polearmThrow#obj_id#obj_id#String#float proc_content_charged_proc_cold#obj_id#obj_id#String#float proc_content_charged_proc_fire#obj_id#obj_id#String#float proc_content_charged_proc_melee_poison_1#obj_id#obj_id#String#float proc_content_charged_proc_melee_poison_2#obj_id#obj_id#String#float proc_content_charged_proc_range_heat_1#obj_id#obj_id#String#float proc_content_charged_proc_range_heat_2#obj_id#obj_id#String#float proc_cyber_shock#obj_id#obj_id#String#float proc_fire_attack#obj_id#obj_id#String#float proc_fire_attack_1#obj_id#obj_id#String#float proc_gcw_base_damage_a#obj_id#obj_id#String#float proc_gcw_base_damage_b#obj_id#obj_id#String#float proc_gcw_base_damage_c#obj_id#obj_id#String#float proc_gcw_base_damage_d#obj_id#obj_id#String#float proc_gcw_base_damage_e#obj_id#obj_id#String#float proc_generic_test#obj_id#obj_id#String#float proc_old_dark_jedi_gift#obj_id#obj_id#String#float proc_old_light_jedi_gift#obj_id#obj_id#String#float proc_pvp_despair#obj_id#obj_id#String#float proc_tow_proc_a_1#obj_id#obj_id#String#float proc_tow_proc_a_2#obj_id#obj_id#String#float proc_tow_proc_a_3#obj_id#obj_id#String#float proc_tow_proc_b_1#obj_id#obj_id#String#float proc_tow_proc_b_2#obj_id#obj_id#String#float proc_tow_proc_b_3#obj_id#obj_id#String#float proc_tow_proc_b_4#obj_id#obj_id#String#float proc_tow_proc_b_5#obj_id#obj_id#String#float proc_tow_proc_b_6#obj_id#obj_id#String#float proc_tow_proc_b_7#obj_id#obj_id#String#float proc_tow_proc_bracelet_combo#obj_id#obj_id#String#float proc_tow_proc_bracelet_melee#obj_id#obj_id#String#float proc_tow_proc_bracelet_range#obj_id#obj_id#String#float proc_tow_proc_coyn#obj_id#obj_id#String#float prone#obj_id#obj_id#String#float proneFail#obj_id#obj_id#String#float pvp_adrenaline_ability#obj_id#obj_id#String#float pvp_adrenaline_rebel_ability#obj_id#obj_id#String#float pvp_airstrike_ability#obj_id#obj_id#String#float pvp_airstrike_rebel_ability#obj_id#obj_id#String#float pvp_aura_buff_rebel_self#obj_id#obj_id#String#float pvp_aura_buff_self#obj_id#obj_id#String#float pvp_last_man_ability#obj_id#obj_id#String#float pvp_last_man_rebel_ability#obj_id#obj_id#String#float pvp_retaliation_ability#obj_id#obj_id#String#float pvp_retaliation_rebel_ability#obj_id#obj_id#String#float pvp_unstoppable_ability#obj_id#obj_id#String#float pvp_unstoppable_rebel_ability#obj_id#obj_id#String#float rampage#obj_id#obj_id#String#float rangedShot#obj_id#obj_id#String#float reac_generic_test#obj_id#obj_id#String#float rodian_ability_1#obj_id#obj_id#String#float saberBlock#obj_id#obj_id#String#float saberHit#obj_id#obj_id#String#float sd_obliterate#obj_id#obj_id#String#float seethingAnger#obj_id#obj_id#String#float seetingAngerRecourse#obj_id#dictionary seetingAngerRecourse_1#obj_id#dictionary seetingAngerRecourse_2#obj_id#dictionary seetingAngerRecourse_3#obj_id#dictionary server_droid_battery_dump_1#obj_id#obj_id#String#float server_droid_battery_dump_2#obj_id#obj_id#String#float server_droid_battery_dump_3#obj_id#obj_id#String#float server_droid_electrical_shock_1#obj_id#obj_id#String#float server_droid_electrical_shock_2#obj_id#obj_id#String#float server_droid_electrical_shock_3#obj_id#obj_id#String#float server_droid_flame_jet_1#obj_id#obj_id#String#float server_droid_flame_jet_2#obj_id#obj_id#String#float server_droid_flame_jet_3#obj_id#obj_id#String#float server_droid_regenerative_plating_1#obj_id#obj_id#String#float server_droid_regenerative_plating_2#obj_id#obj_id#String#float server_droid_regenerative_plating_3#obj_id#obj_id#String#float server_droid_torturous_needle_1#obj_id#obj_id#String#float server_droid_torturous_needle_2#obj_id#obj_id#String#float server_droid_torturous_needle_3#obj_id#obj_id#String#float set_bonus_bh_utility_a_1#obj_id#obj_id#String#float set_bonus_bh_utility_a_2#obj_id#obj_id#String#float set_bonus_bh_utility_a_3#obj_id#obj_id#String#float sherKarRage#obj_id#obj_id#String#float sk_shockWave#obj_id#obj_id#String#float sm_ae_cover_fire#obj_id#obj_id#String#float sm_ae_dm_1#obj_id#obj_id#String#float sm_ae_dm_2#obj_id#obj_id#String#float sm_ae_dm_3#obj_id#obj_id#String#float sm_ae_dm_4#obj_id#obj_id#String#float sm_ae_dm_5#obj_id#obj_id#String#float sm_ae_dm_6#obj_id#obj_id#String#float sm_ae_dm_cc_1#obj_id#obj_id#String#float sm_ae_dm_cc_2#obj_id#obj_id#String#float sm_ae_dm_cc_3#obj_id#obj_id#String#float sm_ae_dm_cc_4#obj_id#obj_id#String#float sm_ae_dm_cc_5#obj_id#obj_id#String#float sm_ae_dm_cc_melee_1#obj_id#obj_id#String#float sm_ae_dm_cc_melee_2#obj_id#obj_id#String#float sm_ae_dm_cc_melee_3#obj_id#obj_id#String#float sm_ae_dm_cc_melee_4#obj_id#obj_id#String#float sm_ae_dm_cc_melee_5#obj_id#obj_id#String#float sm_ae_dm_melee_1#obj_id#obj_id#String#float sm_ae_dm_melee_2#obj_id#obj_id#String#float sm_ae_dm_melee_3#obj_id#obj_id#String#float sm_ae_dm_melee_4#obj_id#obj_id#String#float sm_ae_dm_melee_5#obj_id#obj_id#String#float sm_ae_dm_melee_6#obj_id#obj_id#String#float sm_ae_pin_down#obj_id#obj_id#String#float sm_bad_odds_1#obj_id#obj_id#String#float sm_bad_odds_2#obj_id#obj_id#String#float sm_bad_odds_3#obj_id#obj_id#String#float sm_bad_odds_4#obj_id#obj_id#String#float sm_bad_odds_5#obj_id#obj_id#String#float sm_break_the_deal#obj_id#obj_id#String#float sm_break_the_deal_recourse#obj_id#dictionary sm_buff_invis_ally_1#obj_id#obj_id#String#float sm_concussion_shot#obj_id#obj_id#String#float sm_del_dm_cc_1#obj_id#obj_id#String#float sm_del_dm_cc_2#obj_id#obj_id#String#float sm_del_dm_cc_3#obj_id#obj_id#String#float sm_del_dm_cc_4#obj_id#obj_id#String#float sm_del_dm_cc_5#obj_id#obj_id#String#float sm_del_dm_cc_6#obj_id#obj_id#String#float sm_disarm_trap_1#obj_id#obj_id#String#float sm_dizzy#obj_id#obj_id#String#float sm_dm_1#obj_id#obj_id#String#float sm_dm_2#obj_id#obj_id#String#float sm_dm_3#obj_id#obj_id#String#float sm_dm_4#obj_id#obj_id#String#float sm_dm_5#obj_id#obj_id#String#float sm_dm_6#obj_id#obj_id#String#float sm_dm_7#obj_id#obj_id#String#float sm_dm_cc_1#obj_id#obj_id#String#float sm_dm_cc_2#obj_id#obj_id#String#float sm_dm_cc_3#obj_id#obj_id#String#float sm_dm_cc_4#obj_id#obj_id#String#float sm_dm_cc_5#obj_id#obj_id#String#float sm_dm_cc_6#obj_id#obj_id#String#float sm_dm_cc_melee_1#obj_id#obj_id#String#float sm_dm_cc_melee_2#obj_id#obj_id#String#float sm_dm_cc_melee_3#obj_id#obj_id#String#float sm_dm_cc_melee_4#obj_id#obj_id#String#float sm_dm_cc_melee_5#obj_id#obj_id#String#float sm_dm_cc_melee_6#obj_id#obj_id#String#float sm_dm_dot_1#obj_id#obj_id#String#float sm_dm_dot_2#obj_id#obj_id#String#float sm_dm_dot_3#obj_id#obj_id#String#float sm_dm_dot_4#obj_id#obj_id#String#float sm_dm_dot_melee_1#obj_id#obj_id#String#float sm_dm_dot_melee_2#obj_id#obj_id#String#float sm_dm_dot_melee_3#obj_id#obj_id#String#float sm_dm_dot_melee_4#obj_id#obj_id#String#float sm_dm_melee_1#obj_id#obj_id#String#float sm_dm_melee_2#obj_id#obj_id#String#float sm_dm_melee_3#obj_id#obj_id#String#float sm_dm_melee_4#obj_id#obj_id#String#float sm_dm_melee_5#obj_id#obj_id#String#float sm_dm_melee_6#obj_id#obj_id#String#float sm_dm_melee_7#obj_id#obj_id#String#float sm_double_fire_recourse#obj_id#dictionary sm_end_of_the_line#obj_id#obj_id#String#float sm_false_hope#obj_id#obj_id#String#float sm_false_hope_recourse#obj_id#dictionary sm_fast_draw#obj_id#obj_id#String#float sm_fast_talk#obj_id#obj_id#String#float sm_feeling_lucky_recourse#obj_id#dictionary sm_how_are_you#obj_id#obj_id#String#float sm_impossible_odds#obj_id#obj_id#String#float sm_inside_information#obj_id#obj_id#String#float sm_inspect_cargo#obj_id#obj_id#String#float sm_lucky_break_recourse#obj_id#dictionary sm_melee_stun_recourse#obj_id#dictionary sm_modify_pistol_1#obj_id#obj_id#String#float sm_modify_pistol_2#obj_id#obj_id#String#float sm_modify_pistol_3#obj_id#obj_id#String#float sm_narrow_escape_1#obj_id#obj_id#String#float sm_narrow_escape_2#obj_id#obj_id#String#float sm_narrow_escape_3#obj_id#obj_id#String#float sm_narrow_escape_4#obj_id#obj_id#String#float sm_nerf_herder#obj_id#obj_id#String#float sm_off_the_books#obj_id#obj_id#String#float sm_off_the_cuff#obj_id#obj_id#String#float sm_pistol_whip_1#obj_id#obj_id#String#float sm_pistol_whip_2#obj_id#obj_id#String#float sm_pistol_whip_3#obj_id#obj_id#String#float sm_pistol_whip_4#obj_id#obj_id#String#float sm_precision_strike#obj_id#obj_id#String#float sm_sh_0#obj_id#obj_id#String#float sm_sh_1#obj_id#obj_id#String#float sm_sh_2#obj_id#obj_id#String#float sm_sh_3#obj_id#obj_id#String#float sm_shoot_first_1#obj_id#obj_id#String#float sm_shoot_first_2#obj_id#obj_id#String#float sm_shoot_first_3#obj_id#obj_id#String#float sm_shoot_first_4#obj_id#obj_id#String#float sm_shoot_first_5#obj_id#obj_id#String#float sm_skullduggery#obj_id#obj_id#String#float sm_sly_lie#obj_id#obj_id#String#float sm_spot_a_sucker_1#obj_id#obj_id#String#float sm_spot_a_sucker_2#obj_id#obj_id#String#float sm_spot_a_sucker_3#obj_id#obj_id#String#float sm_spot_a_sucker_4#obj_id#obj_id#String#float sm_summon_medic#obj_id#obj_id#String#float sm_summon_smuggler#obj_id#obj_id#String#float smokeGrenade#obj_id#obj_id#String#float sp_action_regen#obj_id#obj_id#String#float sp_assassins_mark#obj_id#obj_id#String#float sp_assassins_mark_reac_proc#obj_id#obj_id#String#float sp_avoid_damage#obj_id#obj_id#String#float sp_buff_invis_1#obj_id#obj_id#String#float sp_buff_stealth_1#obj_id#obj_id#String#float sp_burst_of_shadows#obj_id#obj_id#String#float sp_cc_dot#obj_id#obj_id#String#float sp_cloaked_recovery_0#obj_id#obj_id#String#float sp_cloaked_recovery_1#obj_id#obj_id#String#float sp_cloaked_recovery_2#obj_id#obj_id#String#float sp_cloaked_recovery_3#obj_id#obj_id#String#float sp_cloaked_recovery_4#obj_id#obj_id#String#float sp_decoy#obj_id#obj_id#String#float sp_dm_1#obj_id#obj_id#String#float sp_dm_2#obj_id#obj_id#String#float sp_dm_3#obj_id#obj_id#String#float sp_dm_4#obj_id#obj_id#String#float sp_dm_5#obj_id#obj_id#String#float sp_dm_6#obj_id#obj_id#String#float sp_dm_7#obj_id#obj_id#String#float sp_dm_8#obj_id#obj_id#String#float sp_dot_0#obj_id#obj_id#String#float sp_dot_1#obj_id#obj_id#String#float sp_dot_2#obj_id#obj_id#String#float sp_dot_3#obj_id#obj_id#String#float sp_dot_4#obj_id#obj_id#String#float sp_dot_5#obj_id#obj_id#String#float sp_fld_debuff_ca#obj_id#obj_id#String#float sp_fldmot_1#obj_id#obj_id#String#float sp_fldmot_2#obj_id#obj_id#String#float sp_fldmot_3#obj_id#obj_id#String#float sp_hd_melee_0#obj_id#obj_id#String#float sp_hd_melee_1#obj_id#obj_id#String#float sp_hd_melee_2#obj_id#obj_id#String#float sp_hd_melee_3#obj_id#obj_id#String#float sp_hd_melee_4#obj_id#obj_id#String#float sp_hd_melee_5#obj_id#obj_id#String#float sp_hd_melee_6#obj_id#obj_id#String#float sp_hd_range_0#obj_id#obj_id#String#float sp_hd_range_1#obj_id#obj_id#String#float sp_hd_range_2#obj_id#obj_id#String#float sp_hd_range_3#obj_id#obj_id#String#float sp_hd_range_4#obj_id#obj_id#String#float sp_hd_range_5#obj_id#obj_id#String#float sp_hd_range_6#obj_id#obj_id#String#float sp_hide_device_1#obj_id#obj_id#String#float sp_improved_cc_dot_0#obj_id#obj_id#String#float sp_improved_cc_dot_1#obj_id#obj_id#String#float sp_improved_cc_dot_2#obj_id#obj_id#String#float sp_improved_cc_dot_3#obj_id#obj_id#String#float sp_neutralize_device_1#obj_id#obj_id#String#float sp_preparation#obj_id#obj_id#String#float sp_reveal_shadows#obj_id#obj_id#String#float sp_run_its_course#obj_id#obj_id#String#float sp_sh_0#obj_id#obj_id#String#float sp_sh_1#obj_id#obj_id#String#float sp_sh_2#obj_id#obj_id#String#float sp_sh_3#obj_id#obj_id#String#float sp_shifty_setup#obj_id#obj_id#String#float sp_smoke_mirrors#obj_id#obj_id#String#float sp_stealth_melee_0#obj_id#obj_id#String#float sp_stealth_melee_1#obj_id#obj_id#String#float sp_stealth_melee_2#obj_id#obj_id#String#float sp_stealth_melee_3#obj_id#obj_id#String#float sp_stealth_melee_4#obj_id#obj_id#String#float sp_stealth_melee_5#obj_id#obj_id#String#float sp_stealth_melee_6#obj_id#obj_id#String#float sp_stealth_ranged_0#obj_id#obj_id#String#float sp_stealth_ranged_1#obj_id#obj_id#String#float sp_stealth_ranged_2#obj_id#obj_id#String#float sp_stealth_ranged_3#obj_id#obj_id#String#float sp_stealth_ranged_4#obj_id#obj_id#String#float sp_stealth_ranged_5#obj_id#obj_id#String#float sp_stealth_ranged_6#obj_id#obj_id#String#float stand#obj_id#obj_id#String#float standFail#obj_id#obj_id#String#float stasis_recourse#obj_id#dictionary steal#obj_id#obj_id#String#float stealth#obj_id#obj_id#String#float stunGrenade#obj_id#obj_id#String#float stunRecovery#obj_id#obj_id#String#float subduer_decrease_damage#obj_id#obj_id#String#float subduer_strike#obj_id#obj_id#String#float suin_healing_debuff#obj_id#obj_id#String#float suin_rampage#obj_id#obj_id#String#float sullustan_ability_1#obj_id#obj_id#String#float targetAnatomy#obj_id#obj_id#String#float terminateTarget#obj_id#obj_id#String#float throwFan#obj_id#obj_id#String#float throwGrenade#obj_id#obj_id#String#float toggleBeastDefensive#obj_id#obj_id#String#float toggleBeastPassive#obj_id#obj_id#String#float togglePetAutoRepeatOff#obj_id#obj_id#String#float togglePetAutoRepeatOn#obj_id#obj_id#String#float tomb_guard_cleave#obj_id#obj_id#String#float tomb_guard_toss#obj_id#obj_id#String#float trample_random#obj_id#obj_id#String#float trandoshan_ability_1#obj_id#obj_id#String#float twilek_ability_1#obj_id#obj_id#String#float twohandThrow#obj_id#obj_id#String#float updateCrowdControlEffect#obj_id#dictionary vader_force_choke#obj_id#obj_id#String#float veteranPlayerBuff#obj_id#obj_id#String#float vicious_swing#obj_id#obj_id#String#float wampa_boss_ice_throw#obj_id#obj_id#String#float wampa_boss_ice_throw_prep#obj_id#obj_id#String#float wampa_boss_tauntaun_throw#obj_id#obj_id#String#float wampa_boss_tauntaun_throw_prep#obj_id#obj_id#String#float wookiee_ability_1#obj_id#obj_id#String#float zabrak_ability_1#obj_id#obj_id#String#float diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_base.script b/sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_base.script deleted file mode 100644 index e135b3845..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_base.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/armor library/beast_lib library/buff library/chat library/city library/colors library/combat library/combat_consts library/create library/cybernetic library/dot library/factions library/grenade library/groundquests library/group library/healing library/heavyweapons library/jedi library/locations library/loot library/luck library/metrics library/movement library/pclib library/pet_lib library/powerup library/proc library/prose library/scout library/sequencer library/session library/smuggler library/squad_leader library/stealth library/storyteller library/sui library/target_dummy library/utils library/vehicle library/weapons library/xp -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_weapon.script b/sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_weapon.script deleted file mode 100644 index 6803f438d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/combat/combat_weapon.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/buff library/combat library/jedi library/proc library/prose library/static_item library/sui library/trace library/utils library/weapons -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTransferred#obj_id#obj_id#obj_id#obj_id handleConvertSchemSui#obj_id#dictionary weaponConversion#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/armor/crafting_customization_base.script b/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/armor/crafting_customization_base.script deleted file mode 100644 index 7c8b5bb9c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/armor/crafting_customization_base.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/craftinglib library/utils systems/crafting/crafting_base -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/base_tool.script b/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/base_tool.script deleted file mode 100644 index e061d1287..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/base_tool.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/craftinglib library/jedi_trials library/pet_lib library/session library/temp_schematic library/utils -PROTOTYPES: OnAboutToLoseItem#obj_id#obj_id#obj_id#obj_id OnAboutToOpenContainer#obj_id#obj_id OnAboutToReceiveItem#obj_id#obj_id#obj_id#obj_id OnAttach#obj_id OnCraftingAddResource#obj_id#obj_id#obj_id#draft_schematic.slot#modifiable_int[] OnCraftingDone#obj_id#obj_id#String#int#boolean OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnRequestDraftSchematics#obj_id#obj_id#int[]#float[] getPrototype#obj_id#dictionary prototypeDone#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/crafting_base.script b/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/crafting_base.script deleted file mode 100644 index 709b8a2ec..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/crafting_base.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/collection library/craftinglib library/sui library/temp_schematic library/utils library/weapons library/xp -PROTOTYPES: OnCraftingExperiment#obj_id#obj_id#obj_id#string_id[]#int[]#int#modifiable_int#int OnFinalizeSchematic#obj_id#obj_id#obj_id#draft_schematic OnMakeCraftedItem#obj_id#obj_id#draft_schematic#float OnManufactureObject#obj_id#obj_id#obj_id#draft_schematic#boolean#boolean OnManufacturingSchematicCreation#obj_id#obj_id#obj_id#draft_schematic#modifiable_int#modifiable_int OnRequestResourceWeights#obj_id#obj_id#String[]#String[]#int[]#int[]#int[] diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/crafting_base_furniture.script b/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/crafting_base_furniture.script deleted file mode 100644 index 7c8b5bb9c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/crafting_base_furniture.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/craftinglib library/utils systems/crafting/crafting_base -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/crafting_base_furniture_customization.script b/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/crafting_base_furniture_customization.script deleted file mode 100644 index 7c8b5bb9c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/crafting_base_furniture_customization.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/craftinglib library/utils systems/crafting/crafting_base -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/specific_item/structure_customization_kit.script b/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/specific_item/structure_customization_kit.script deleted file mode 100644 index 7bdb2210a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/furniture/specific_item/structure_customization_kit.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/craftinglib library/utils systems/crafting/furniture/crafting_base_furniture_customization -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/space/reverse_engineering/armor_analysis_tool.script b/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/space/reverse_engineering/armor_analysis_tool.script deleted file mode 100644 index bf56caf97..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/crafting/space/reverse_engineering/armor_analysis_tool.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create library/space_crafting library/sui library/temp_schematic library/utils library/xp -PROTOTYPES: OnAboutToReceiveItem#obj_id#obj_id#obj_id#obj_id OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/dungeon_sequencer/ai_controller.script b/sku.0/sys.server/compiled/game/script/.deps/systems/dungeon_sequencer/ai_controller.script deleted file mode 100644 index 0bf21032e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/dungeon_sequencer/ai_controller.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/beast_lib library/buff library/chat library/create library/factions library/restuss_event library/trial library/utils -PROTOTYPES: OnAiTetherStart#obj_id OnArrivedAtLocation#obj_id#String OnAttach#obj_id OnDeath#obj_id#obj_id#obj_id OnEnteredCombat#obj_id OnExitedCombat#obj_id OnHearSpeech#obj_id#obj_id#String OnMoveMoving#obj_id OnObjectDisabled#obj_id#obj_id OnRemovingFromWorld#obj_id customSignal#obj_id#dictionary destroySelf#obj_id#dictionary doPathAction#obj_id#dictionary handleDelayedCleanup#obj_id#dictionary handleTriggerData#obj_id#dictionary resumeDefaultCalmBehavior#obj_id#dictionary resumeMovement#obj_id#dictionary setLocationTarget#obj_id#dictionary tether_delay#obj_id#dictionary wsDespawn#obj_id#dictionary wsDoAnimation#obj_id#dictionary wsPlayEmote#obj_id#dictionary wsSignalMaster#obj_id#dictionary wsToggleInvulnerability#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/dungeon_sequencer/sequence_controller.script b/sku.0/sys.server/compiled/game/script/.deps/systems/dungeon_sequencer/sequence_controller.script deleted file mode 100644 index df9e3521d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/dungeon_sequencer/sequence_controller.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/chat library/combat library/create library/factions library/instance library/movement library/restuss_event library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnDestroy#obj_id OnInitialize#obj_id beginSpawn#obj_id#dictionary cleanupSpawn#obj_id#dictionary delaySpawnActors#obj_id#dictionary doDelayedSpawnActors#obj_id#dictionary handleDelayCleanup#obj_id#dictionary handleDelayedDeleteSpawn#obj_id#dictionary handleDelayedSpawnRow#obj_id#dictionary registerObjectWithSequencer#obj_id#dictionary restartSpawn#obj_id#dictionary sendProxySignal#obj_id#dictionary terminationCallback#obj_id#dictionary triggerFired#obj_id#dictionary unregisterObjectWithSequencer#obj_id#dictionary view#obj_id#dictionary waitForComplete#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/flip_banner.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/flip_banner.script deleted file mode 100644 index cd462d5c4..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/flip_banner.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/create library/gcw library/utils -PROTOTYPES: OnDestroy#obj_id OnInitialize#obj_id OnUnloadedFromMemory#obj_id checkBannerImpulse#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/flip_banner_onpole.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/flip_banner_onpole.script deleted file mode 100644 index a2102c47a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/flip_banner_onpole.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/create library/gcw library/locations library/utils systems/gcw/flip_banner -PROTOTYPES: OnDestroy#obj_id OnInitialize#obj_id OnUnloadedFromMemory#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_barricade.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_barricade.script deleted file mode 100644 index 6c98aedf7..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_barricade.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/factions library/gcw library/groundquests library/resource library/restuss_event library/static_item library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnDeath#obj_id#obj_id#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectDisabled#obj_id#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroyGCWBarricade#obj_id#dictionary handleGCWBarricade#obj_id#dictionary handleQuestCallBack#obj_id#dictionary playQuestIcon#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_camp.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_camp.script deleted file mode 100644 index 779c0e361..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_camp.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/camping library/create library/factions library/gcw library/theater library/trial library/utils -PROTOTYPES: OnInitialize#obj_id initializeAdvancedCamp#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city.script deleted file mode 100644 index af8509767..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/colors_hex library/factions library/gcw library/planetary_map library/trial library/utils -PROTOTYPES: OnHearSpeech#obj_id#obj_id#String OnInitialize#obj_id beginInvasion#obj_id#dictionary beginInvasionNotifyFactions#obj_id#dictionary checkForInvasion#obj_id#dictionary cityAttackUnsuccessful#obj_id#dictionary cleanupInvasion#obj_id#dictionary constructionEndsSoon#obj_id#dictionary defendersEvacuate#obj_id#dictionary defenseGeneralUnderSustainedAttack#obj_id#dictionary endConstruction#obj_id#dictionary invasionEndsSoon#obj_id#dictionary invasionHalfWayPoint#obj_id#dictionary startFactionDefense#obj_id#dictionary updateGcwMapData#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_kit.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_kit.script deleted file mode 100644 index afb0f8105..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_kit.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/gcw library/trial library/utils -PROTOTYPES: OnHearSpeech#obj_id#obj_id#String OnInitialize#obj_id beginConstruction#obj_id#dictionary beginInvasion#obj_id#dictionary cleanup#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_kit_turret.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_kit_turret.script deleted file mode 100644 index 52139b670..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_kit_turret.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/advanced_turret library/create library/factions library/utils systems/gcw/gcw_city_kit -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon.script deleted file mode 100644 index 44f06fe93..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/factions library/gcw library/groundquests library/prose library/skill library/stealth library/sui library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnHearSpeech#obj_id#obj_id#String OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleConstructionAttemptResults#obj_id#dictionary handleSetup#obj_id#dictionary handleUpdateName#obj_id#dictionary playQuestIcon#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_barricade.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_barricade.script deleted file mode 100644 index ad9e68623..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_barricade.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/gcw library/groundquests library/resource library/skill library/utils systems/gcw/gcw_city_pylon -PROTOTYPES: OnAttach#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_patrol.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_patrol.script deleted file mode 100644 index ad9e68623..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_patrol.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/gcw library/groundquests library/resource library/skill library/utils systems/gcw/gcw_city_pylon -PROTOTYPES: OnAttach#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_tower.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_tower.script deleted file mode 100644 index ad9e68623..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_tower.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/gcw library/groundquests library/resource library/skill library/utils systems/gcw/gcw_city_pylon -PROTOTYPES: OnAttach#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_turret.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_turret.script deleted file mode 100644 index ad9e68623..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_turret.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/gcw library/groundquests library/resource library/skill library/utils systems/gcw/gcw_city_pylon -PROTOTYPES: OnAttach#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_vehicle.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_vehicle.script deleted file mode 100644 index ad9e68623..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_vehicle.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/gcw library/groundquests library/resource library/skill library/utils systems/gcw/gcw_city_pylon -PROTOTYPES: OnAttach#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_vehicle_boss.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_vehicle_boss.script deleted file mode 100644 index ad9e68623..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_city_pylon_vehicle_boss.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/gcw library/groundquests library/resource library/skill library/utils systems/gcw/gcw_city_pylon -PROTOTYPES: OnAttach#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_damaged_vehicle.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_damaged_vehicle.script deleted file mode 100644 index 0f06b1532..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_damaged_vehicle.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create library/factions library/gcw library/groundquests library/resource library/utils -PROTOTYPES: OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleSetup#obj_id#dictionary playQuestIcon#obj_id#dictionary repairComplete#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_defensive_general_boss.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_defensive_general_boss.script deleted file mode 100644 index a64484404..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_defensive_general_boss.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/armor library/buff library/factions library/gcw library/groundquests library/resource library/restuss_event library/static_item library/trial library/utils -PROTOTYPES: OnAboutToBeIncapacitated#obj_id#obj_id OnAttach#obj_id OnHateTargetAdded#obj_id#obj_id calculateGeneralHealthAndAbilities#obj_id#dictionary checkConstructionPhase#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_entertainer_faction_quest.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_entertainer_faction_quest.script deleted file mode 100644 index 915b9e889..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_entertainer_faction_quest.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/factions library/utils -PROTOTYPES: OnAttach#obj_id convinced#obj_id#dictionary lostInterest#obj_id#dictionary notConvinced#obj_id#dictionary readyToTalk#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_npc_hurt.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_npc_hurt.script deleted file mode 100644 index 45a5438df..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_npc_hurt.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create library/factions library/gcw library/groundquests library/resource library/utils -PROTOTYPES: OnAttach#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleSetup#obj_id#dictionary playQuestIcon#obj_id#dictionary repairComplete#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_patrol.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_patrol.script deleted file mode 100644 index 2b3c991db..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_patrol.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/buff library/chat library/create library/factions library/gcw library/groundquests library/resource library/restuss_event library/static_item library/stealth library/sui library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnDeath#obj_id#obj_id#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectDisabled#obj_id#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroyGCWPatrol#obj_id#dictionary flagGCWPatrolEntertained#obj_id#dictionary handleGCWPatrol#obj_id#dictionary handleOffensiveEntertainedNpcCleanUp#obj_id#dictionary playQuestIcon#obj_id#dictionary removeGCWPatrolEntertained#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_patrol_point_npc_ai.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_patrol_point_npc_ai.script deleted file mode 100644 index 0b6d3e730..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_patrol_point_npc_ai.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create library/factions library/utils systems/gcw/gcw_city_kit -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_poi_guard_spawning.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_poi_guard_spawning.script deleted file mode 100644 index a25acc242..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_poi_guard_spawning.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/create library/holiday library/utils -PROTOTYPES: OnAttach#obj_id OnDestroy#obj_id spawnSentry#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_poi_spawner.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_poi_spawner.script deleted file mode 100644 index a25acc242..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_poi_spawner.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/create library/holiday library/utils -PROTOTYPES: OnAttach#obj_id OnDestroy#obj_id spawnSentry#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_smuggler_device.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_smuggler_device.script deleted file mode 100644 index 8ca3fb0f9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_smuggler_device.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/factions library/gcw library/groundquests library/resource library/restuss_event library/static_item library/trial library/utils -PROTOTYPES: OnDeath#obj_id#obj_id#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectDisabled#obj_id#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroyGCWTower#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_tower.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_tower.script deleted file mode 100644 index c8fc9fcd1..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_tower.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/factions library/gcw library/groundquests library/resource library/restuss_event library/static_item library/trial library/utils -PROTOTYPES: OnDeath#obj_id#obj_id#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectDamaged#obj_id#obj_id#obj_id#int OnObjectDisabled#obj_id#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroyGCWTower#obj_id#dictionary handleGCWTower#obj_id#dictionary handleQuestCallBack#obj_id#dictionary playQuestIcon#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_turret.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_turret.script deleted file mode 100644 index 88df01096..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_turret.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/chat library/create library/factions library/gcw library/groundquests library/resource library/restuss_event library/static_item library/stealth library/sui library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnDestroy#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleQuestCallBack#obj_id#dictionary playQuestIcon#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_vehicle_patrol.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_vehicle_patrol.script deleted file mode 100644 index 5464b8642..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/gcw_vehicle_patrol.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/create library/factions library/gcw library/groundquests library/resource library/restuss_event library/static_item library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnDeath#obj_id#obj_id#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectDisabled#obj_id#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroyGCWPatrol#obj_id#dictionary handleGCWPatrol#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/static_base/base_master.script b/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/static_base/base_master.script deleted file mode 100644 index 45560d356..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/gcw/static_base/base_master.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id handleBaseInitializationRetry#obj_id#dictionary handleControlUpdate#obj_id#dictionary handleTerminalSetup#obj_id#dictionary handleTerminalSpawnRequest#obj_id#dictionary handleTerminalValidation#obj_id#dictionary handleTerminalValidationResponse#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/jedi/jedi_saber_component.script b/sku.0/sys.server/compiled/game/script/.deps/systems/jedi/jedi_saber_component.script deleted file mode 100644 index 05307e40c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/jedi/jedi_saber_component.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/colors_hex library/jedi library/jedi_trials library/static_item library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnDestroy#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectDisabled#obj_id#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleVerifyTune#obj_id#dictionary setCrystalLevel#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/base/mission_base.script b/sku.0/sys.server/compiled/game/script/.deps/systems/missions/base/mission_base.script deleted file mode 100644 index c7d90d0b3..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/base/mission_base.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/force_rank library/gcw library/group library/jedi library/missions library/money library/prose library/utils library/xp -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/base/mission_dynamic_base.script b/sku.0/sys.server/compiled/game/script/.deps/systems/missions/base/mission_dynamic_base.script deleted file mode 100644 index 8bf32ec94..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/base/mission_dynamic_base.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/anims library/battlefield library/chat library/create library/factions library/group library/jedi library/locations library/missions library/money library/regions library/utils systems/missions/base/mission_base -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_probe_droid.script b/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_probe_droid.script deleted file mode 100644 index fb68d3ce1..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_probe_droid.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/bounty_hunter library/groundquests library/locations library/regions library/utils systems/missions/base/mission_dynamic_base -PROTOTYPES: OnAttach#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int droid_Probot_Start#obj_id#dictionary probe_Droid_Countdown#obj_id#dictionary probe_Droid_Spawn#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_probot.script b/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_probot.script deleted file mode 100644 index 6efb26e95..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_probot.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/utils systems/missions/base/mission_dynamic_base -PROTOTYPES: OnAttach#obj_id delete_Self#obj_id#dictionary destroySelf#obj_id#dictionary setup_Droid#obj_id#dictionary take_Off#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_seeker.script b/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_seeker.script deleted file mode 100644 index 5afe6a09e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/bounty_seeker.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/utils systems/missions/base/mission_dynamic_base -PROTOTYPES: OnAttach#obj_id destroySelf#obj_id#dictionary takeOff#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/deliver_npc_spawner.script b/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/deliver_npc_spawner.script deleted file mode 100644 index c87d821dd..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/deliver_npc_spawner.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create library/locations -PROTOTYPES: OnInitialize#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/mission_bounty.script b/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/mission_bounty.script deleted file mode 100644 index 681803ba0..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/mission_bounty.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/jedi library/locations library/missions library/stealth library/utils systems/missions/base/mission_dynamic_base -PROTOTYPES: OnEndMission#obj_id#dictionary OnInitialize#obj_id OnStartMission#obj_id#dictionary abortMission#obj_id#dictionary bountyFailure#obj_id#dictionary bountyIncomplete#obj_id#dictionary bountySuccess#obj_id#dictionary bountyTimedOut#obj_id#dictionary findTarget#obj_id#dictionary foundObject#obj_id#dictionary halfwayNotification#obj_id#dictionary moveTarget#obj_id#dictionary onArrivedAtLocation#obj_id#dictionary probe_Droid_Find_Fail#obj_id#dictionary probe_Droid_Response#obj_id#dictionary probe_Droid_Track_Lost#obj_id#dictionary stopTracking#obj_id#dictionary timedOutMission#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/mission_deliver_npc.script b/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/mission_deliver_npc.script deleted file mode 100644 index 795c3dd2c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/missions/dynamic/mission_deliver_npc.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/anims library/chat library/factions library/missions library/utils systems/missions/base/mission_dynamic_base -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/lair_interactivity.script b/sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/lair_interactivity.script deleted file mode 100644 index de5e87255..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/lair_interactivity.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/resource library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int searchLair#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/npc_lair.script b/sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/npc_lair.script deleted file mode 100644 index 665d95016..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/npc_lair.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/create library/factions library/utils library/xp theme_park/poi/base -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id doTheater#obj_id#dictionary handleBuildingDestruction#obj_id#dictionary handleCallForHealing#obj_id#dictionary handleCreatureDeath#obj_id#dictionary handleDelayedTargetSetup#obj_id#dictionary handleNpcAiManagement#obj_id#dictionary handleNpcLairDecay#obj_id#dictionary handlePoiTimeOutDestruction#obj_id#dictionary handleRespawnCreature#obj_id#dictionary handleScoutAlarm#obj_id#dictionary handleSpawnBossMonster#obj_id#dictionary handleSpawnNextDefender#obj_id#dictionary handleSpawnWaveOfDefenders#obj_id#dictionary handleTargetDestroyed#obj_id#dictionary handleTheaterComplete#obj_id#dictionary makeSomeMobiles#obj_id#dictionary spawnCreatures#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/npc_lair_ai.script b/sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/npc_lair_ai.script deleted file mode 100644 index 6d9cef1f0..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/npc_lair/npc_lair_ai.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat ai/ai_combat_movement library/ai_lib library/factions library/healing library/pet_lib library/utils theme_park/poi/base -PROTOTYPES: OnAttach#obj_id OnCreatureDamaged#obj_id#obj_id#obj_id#int[] OnDestroy#obj_id OnDetach#obj_id OnEnteredCombat#obj_id OnExitedCombat#obj_id OnLostTarget#obj_id#obj_id OnMovePathBlocked#obj_id OnMovePathComplete#obj_id OnMovePathNotFound#obj_id OnSawAttack#obj_id#obj_id#obj_id[] handleDestruction#obj_id#dictionary handleDetachment#obj_id#dictionary handleNpcLairCustomAi#obj_id#dictionary handleRecoverFromHealingLair#obj_id#dictionary handleRequestToConverse#obj_id#dictionary handleResumeJob#obj_id#dictionary resumeDefaultCalmBehavior#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/sign/sign.script b/sku.0/sys.server/compiled/game/script/.deps/systems/sign/sign.script deleted file mode 100644 index 9e9cffb62..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/sign/sign.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/player_structure library/prose library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/dropship/base.script b/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/dropship/base.script deleted file mode 100644 index 385e76fa0..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/dropship/base.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnAttach#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/dropship/player_shuttle.script b/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/dropship/player_shuttle.script deleted file mode 100644 index 5aaf60631..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/dropship/player_shuttle.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/utils systems/spawning/dropship/base -PROTOTYPES: OnAttach#obj_id destroySelf#obj_id#dictionary explodeThenDestroySelf#obj_id#dictionary landShuttle#obj_id#dictionary takeOff#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/spawn_tangible.script b/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/spawn_tangible.script deleted file mode 100644 index 38fe79a11..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/spawn_tangible.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnInitialize#obj_id OnPreloadComplete#obj_id OnRemovingFromWorld#obj_id handleTangibleDestroy#obj_id#dictionary handleTangibleRespawn#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/spawned_tracker.script b/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/spawned_tracker.script deleted file mode 100644 index 77933f4ef..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/spawning/spawned_tracker.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/utils -PROTOTYPES: OnDestroy#obj_id OnIncapacitated#obj_id#obj_id OnRemovingFromWorld#obj_id selfDestruct#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/dummy_treasure_drum.script b/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/dummy_treasure_drum.script deleted file mode 100644 index ee4416b1a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/dummy_treasure_drum.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/create library/groundquests library/loot library/utils -PROTOTYPES: OnAttach#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info cleanUpFakeChest#obj_id#dictionary recalculateGuardArray#obj_id#dictionary setupChest#obj_id#dictionary spawnTreasureGuards#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_drum.script b/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_drum.script deleted file mode 100644 index 5d7ff9fcc..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_drum.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnAboutToReceiveItem#obj_id#obj_id#obj_id#obj_id OnAttach#obj_id cleanUpChest#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_guard.script b/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_guard.script deleted file mode 100644 index e1c0a05ba..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_guard.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/ai_lib library/anims library/chat library/create library/group library/prose library/utils -PROTOTYPES: OnAttach#obj_id OnCreatureDamaged#obj_id#obj_id#obj_id#int[] OnDeath#obj_id#obj_id#obj_id OnDestroy#obj_id attackThief#obj_id#dictionary barkAttack#obj_id#dictionary cleanUpGlowie#obj_id#dictionary cleanUpGuard#obj_id#dictionary expression_disappear#obj_id#dictionary expression_fist#obj_id#dictionary glow#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_map.script b/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_map.script deleted file mode 100644 index 6fc39a0bb..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/treasure_map/base/treasure_map.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/combat library/groundquests library/locations library/stealth library/sui library/utils -PROTOTYPES: OnAttach#obj_id OnDestroy#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int finishSearchArea#obj_id#dictionary getMapTreasurePlanet#obj_id#dictionary handleDialogInput#obj_id#dictionary spawnTreasure#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/turret/advanced_turret_ai.script b/sku.0/sys.server/compiled/game/script/.deps/systems/turret/advanced_turret_ai.script deleted file mode 100644 index 98d3e2ad2..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/turret/advanced_turret_ai.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/advanced_turret library/utils systems/combat/combat_base -PROTOTYPES: OnInitialize#obj_id OnObjectDamaged#obj_id#obj_id#obj_id#int OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id createTriggerVolume#obj_id#dictionary effectManager#obj_id#dictionary handleDestroyTurret#obj_id#dictionary turretShot#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/vehicle_system/vehicle_control_device.script b/sku.0/sys.server/compiled/game/script/.deps/systems/vehicle_system/vehicle_control_device.script deleted file mode 100644 index 551517945..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/vehicle_system/vehicle_control_device.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/battlefield library/beast_lib library/buff library/callable library/chat library/consumable library/create library/factions library/healing library/hue library/pclib library/pet_lib library/prose library/sui library/utils library/vehicle -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnAboutToReceiveItem#obj_id#obj_id#obj_id#obj_id OnAttach#obj_id OnDestroy#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTransferred#obj_id#obj_id#obj_id#obj_id handleFlagDeadCreature#obj_id#dictionary handleGrowthChoice#obj_id#dictionary handlePetDeathblow#obj_id#dictionary handleRemoveCurrentVehicle#obj_id#dictionary handleStorePetRequest#obj_id#dictionary handleStoreVehicleDamage#obj_id#dictionary handleValidatePet#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/systems/veteran_reward/structure_storage_increase_deed.script b/sku.0/sys.server/compiled/game/script/.deps/systems/veteran_reward/structure_storage_increase_deed.script deleted file mode 100644 index cb3fac463..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/systems/veteran_reward/structure_storage_increase_deed.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/player_structure library/prose library/space_utils library/static_item library/sui library/utils -PROTOTYPES: OnGetAttributes#obj_id#obj_id#String[]#String[] OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleStorageChoice#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/base/base_terminal.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/base/base_terminal.script deleted file mode 100644 index 111aa1ab3..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/base/base_terminal.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/structure library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/city_vote.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/city_vote.script deleted file mode 100644 index 2ed6c917b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/city_vote.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/prose library/sui library/utils terminal/base/base_terminal -PROTOTYPES: OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handlePlaceVote#obj_id#dictionary resetVoteTerminal#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/gcw_publish_gift_terminal.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/gcw_publish_gift_terminal.script deleted file mode 100644 index 49f5ef11e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/gcw_publish_gift_terminal.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/player_structure library/prose library/sui library/utils terminal/base/base_terminal -PROTOTYPES: OnDestroy#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/greeter.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/greeter.script deleted file mode 100644 index bc32bed83..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/greeter.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/dressup library/hue library/money library/player_structure library/prose library/session library/smuggler library/static_item library/sui library/turnstile library/utils library/vendor_lib library/xp terminal/base/base_terminal -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnAttach#obj_id OnGiveItem#obj_id#obj_id#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTriggerVolumeEntered#obj_id#String#obj_id changeGreeterDelay#obj_id#dictionary changeTriggerRadius#obj_id#dictionary colorGreeter#obj_id#dictionary handleCallGreeterUpdate#obj_id#dictionary handleCallVolumeToggleNoLife#obj_id#dictionary handleCallVolumeToggleOnInitialized#obj_id#dictionary handleConverseWithOtherGreeter#obj_id#dictionary handleConverseWithOtherGreeterAfterGreetDelay#obj_id#dictionary handleDelayedMainControlMenu#obj_id#dictionary handleDestroyGreeter#obj_id#dictionary handleGreeterInitialize#obj_id#dictionary handlePlayerEffectSelection#obj_id#dictionary handlePlayerGreeterAnimCategorySelect#obj_id#dictionary handlePlayerGreeterAnimSelect#obj_id#dictionary handlePlayerGreeterMoodCategorySelect#obj_id#dictionary handlePlayerGreeterMoodSelect#obj_id#dictionary handlePlayerGreetingMaintenanceSelect#obj_id#dictionary handlePlayerGreetingSelect#obj_id#dictionary handlePlayerLoadGreetingSelect#obj_id#dictionary handlePlayerProgramSelect#obj_id#dictionary handlePlayerStatementSelection#obj_id#dictionary handleSetSaveName#obj_id#dictionary handleSetVendorName#obj_id#dictionary resetBarkTimer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/nonvendor.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/nonvendor.script deleted file mode 100644 index dbd988a0d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/nonvendor.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/player_structure library/static_item library/utils library/vendor_lib terminal/base/base_terminal -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnDestroy#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnPack#obj_id#dictionary handleDestroyNonVendor#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/npc_vendor.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/npc_vendor.script deleted file mode 100644 index 78b8f1643..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/npc_vendor.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/dressup library/player_structure library/prose library/slots library/smuggler library/sui library/utils library/vendor_lib -PROTOTYPES: OnAboutToBeTransferred#obj_id#obj_id#obj_id OnAttach#obj_id OnGiveItem#obj_id#obj_id#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTriggerVolumeEntered#obj_id#String#obj_id checkNakedSlots#obj_id#dictionary handleSetCustomBark#obj_id#dictionary handleVendorAnimSelect#obj_id#dictionary handleVendorMoodSelect#obj_id#dictionary handleVendorStrCatSelect#obj_id#dictionary resetBarkTimer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_camp.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_camp.script deleted file mode 100644 index 8f7adfa43..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_camp.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/camping library/utils -PROTOTYPES: OnAttach#obj_id OnGetAttributes#obj_id#obj_id#String[]#String[] OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleTimeSensitiveData#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_character_builder.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_character_builder.script deleted file mode 100644 index d9f47058c..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_character_builder.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/armor library/beast_lib library/buff library/callable library/chat library/consumable library/craftinglib library/create library/expertise library/factions library/gm library/healing library/incubator library/instance library/jedi library/money library/pet_lib library/player_stomach library/prose library/resource library/respec library/skill library/skill_template library/space_crafting library/space_flags library/space_skill library/space_transition library/space_utils library/static_item library/stealth library/sui library/utils library/weapons -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleArmorSelect#obj_id#dictionary handleAssaultSelect#obj_id#dictionary handleAttachmentOneSelect#obj_id#dictionary handleAttachmentTwoSelect#obj_id#dictionary handleAttachmentsSelect#obj_id#dictionary handleAutoLevelSelect#obj_id#dictionary handleBasicArmorAttachment#obj_id#dictionary handleBasicArmorAttachmentOne#obj_id#dictionary handleBasicArmorAttachmentTwo#obj_id#dictionary handleBattleSelect#obj_id#dictionary handleBattlefieldSelect#obj_id#dictionary handleBeastSelect#obj_id#dictionary handleBestCategorySelection#obj_id#dictionary handleBestResourceSelection#obj_id#dictionary handleBestResourceSelectionWithAttribute#obj_id#dictionary handleBuffCrystalSelect#obj_id#dictionary handleCarbineSelect#obj_id#dictionary handleCategorySelection#obj_id#dictionary handleClothingSelect#obj_id#dictionary handleCollectionComponentSelect#obj_id#dictionary handleCraftQualityPercentage#obj_id#dictionary handleCraftingSelect#obj_id#dictionary handleCraftingSuitSelect#obj_id#dictionary handleCrystalSelect#obj_id#dictionary handleDeedSelect#obj_id#dictionary handleDraftSchematicsList#obj_id#dictionary handleEnhancementSelect#obj_id#dictionary handleFactionOptions#obj_id#dictionary handleFreelanceShipSelect#obj_id#dictionary handleGrenadeSelect#obj_id#dictionary handleHealOptions#obj_id#dictionary handleHeavySelect#obj_id#dictionary handleHeroicJewelrySelect#obj_id#dictionary handleImperialShipSelect#obj_id#dictionary handleJediSelect#obj_id#dictionary handleMedicineSelect#obj_id#dictionary handleMiscOptions#obj_id#dictionary handleMiscSelect#obj_id#dictionary handleMountSelect#obj_id#dictionary handleOneHandedSelect#obj_id#dictionary handleOptionSelect#obj_id#dictionary handleOtherShipSelect#obj_id#dictionary handlePASelect#obj_id#dictionary handlePayoutToPlayer#obj_id#dictionary handlePetAbilitySelection#obj_id#dictionary handlePilotSkillSelect#obj_id#dictionary handlePistolSelect#obj_id#dictionary handlePolearmSelect#obj_id#dictionary handlePowerUpSelect#obj_id#dictionary handleProtectionAmount#obj_id#dictionary handlePsgSelect#obj_id#dictionary handlePublishOptions#obj_id#dictionary handlePvPSelect#obj_id#dictionary handleRebelShipSelect#obj_id#dictionary handleReconSelect#obj_id#dictionary handleResourceSelection#obj_id#dictionary handleRifleSelect#obj_id#dictionary handleRoadmapChoiceSelection#obj_id#dictionary handleRoadmapSelect#obj_id#dictionary handleRoadmapSkillSelection#obj_id#dictionary handleRobeSelect#obj_id#dictionary handleSaberSelect#obj_id#dictionary handleSchematicSelect#obj_id#dictionary handleShipChasisSelection#obj_id#dictionary handleShipComponentArmorSelection#obj_id#dictionary handleShipComponentBoosterSelection#obj_id#dictionary handleShipComponentCapacitorSelection#obj_id#dictionary handleShipComponentDroidInterfaceSelection#obj_id#dictionary handleShipComponentEngineSelection#obj_id#dictionary handleShipComponentReactorSelection#obj_id#dictionary handleShipComponentSelection#obj_id#dictionary handleShipComponentShieldSelection#obj_id#dictionary handleShipComponentWeaponSelection#obj_id#dictionary handleShipMenuSelect#obj_id#dictionary handleShipOptions#obj_id#dictionary handleSmugglerSelect#obj_id#dictionary handleTwoHandedSelect#obj_id#dictionary handleUnarmedSelect#obj_id#dictionary handleVehicleOptions#obj_id#dictionary handleVehicleSelect#obj_id#dictionary handleWeaponOptions#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_city.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_city.script deleted file mode 100644 index c1227f26f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_city.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/money library/player_structure library/prose library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int depositTreasury#obj_id#dictionary handleAddMilitia#obj_id#dictionary handleCityObjectRemove#obj_id#dictionary handleCitySpecInfo#obj_id#dictionary handleConfirmObjectRemove#obj_id#dictionary handleForceRankConfirmed#obj_id#dictionary handleForceUpdateConfirmed#obj_id#dictionary handleForceUpdateElection#obj_id#dictionary handleForceUpdateNow#obj_id#dictionary handleMakeMayor#obj_id#dictionary handleRegisterCity#obj_id#dictionary handleRemoveMilitia#obj_id#dictionary handleRemoveMilitiaConfirmed#obj_id#dictionary handleResetCloneData#obj_id#dictionary handleResetShuttleData#obj_id#dictionary handleRevokeCitizenship#obj_id#dictionary handleSetCityName#obj_id#dictionary handleSetCitySpec#obj_id#dictionary handleSetCityZoning#obj_id#dictionary handleSetTax#obj_id#dictionary handleTaxInfoSelect#obj_id#dictionary handleUnregisterCity#obj_id#dictionary handleWithdrawFail#obj_id#dictionary handleWithdrawReason#obj_id#dictionary handleWithdrawSuccess#obj_id#dictionary withdrawTreasury#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_city_junk_dealer.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_city_junk_dealer.script deleted file mode 100644 index 746253eee..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_city_junk_dealer.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/money library/smuggler library/sui library/utils -PROTOTYPES: OnDestroy#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleBuyBackSui#obj_id#dictionary handleFlagJunkSui#obj_id#dictionary handleSellJunkSui#obj_id#dictionary handleSoldJunk#obj_id#dictionary handleTheBuyBack#obj_id#dictionary startBuyBack#obj_id#dictionary startDealing#obj_id#dictionary startFlaggingItemsNoSale#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_gcw_publish_gift.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_gcw_publish_gift.script deleted file mode 100644 index 8d8be388d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_gcw_publish_gift.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/gcw library/player_structure library/prose library/sui library/trial library/utils terminal/base/base_terminal -PROTOTYPES: OnClusterWideDataResponse#obj_id#String#String#int#String[]#dictionary[]#int OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int closeSui#obj_id#dictionary refreshSuiGcwData#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_guild.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_guild.script deleted file mode 100644 index eeeea5b0d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_guild.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/guild library/player_structure library/prose library/sui library/utils terminal/base/base_terminal -PROTOTYPES: OnGetAttributes#obj_id#obj_id#String[]#String[] OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int checkDisband#obj_id#dictionary endVote#obj_id#dictionary handleAcceptLeadership#obj_id#dictionary handleAcceptPAHall#obj_id#dictionary handleMakeLeader#obj_id#dictionary handlePlaceVote#obj_id#dictionary onGuildCreateAbbrevResponse#obj_id#dictionary onGuildCreateNameResponse#obj_id#dictionary onGuildDisbandResponse#obj_id#dictionary onGuildEnemiesResponse#obj_id#dictionary onGuildInfoResponse#obj_id#dictionary onGuildKickResponse#obj_id#dictionary onGuildMemberOptionsResponse#obj_id#dictionary onGuildMembersResponse#obj_id#dictionary onGuildNamechangeAbbrevResponse#obj_id#dictionary onGuildNamechangeNameResponse#obj_id#dictionary onGuildPermissionsResponse#obj_id#dictionary onGuildSponsorResponse#obj_id#dictionary onGuildSponsorVerifyResponse#obj_id#dictionary onGuildSponsoredOptionsResponse#obj_id#dictionary onGuildSponsoredResponse#obj_id#dictionary onGuildTitleResponse#obj_id#dictionary onGuildWarEnemyNameResponse#obj_id#dictionary resetVotes#obj_id#dictionary selectPermissionsMessage#obj_id#dictionary showGuildEnemiesMessage#obj_id#dictionary showGuildSponsoredMessage#obj_id#dictionary startVote#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_structure.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_structure.script deleted file mode 100644 index 94a53d83f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_structure.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/faction_perk library/player_structure library/prose library/session library/static_item library/sui library/turnstile library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int clearCollectionMeatlumpCamera#obj_id#dictionary handleDeleteAllItemsCodeConfirm#obj_id#dictionary handleDeleteAllItemsConfirmed#obj_id#dictionary handleDeleteSecondConfirm#obj_id#dictionary handleMoveFirstItem#obj_id#dictionary handlePlayerStructureFindItemsListResponse#obj_id#dictionary handlePlayerStructureFindItemsPageResponse#obj_id#dictionary handlePlayerStructureSearchItemsGetKeyword#obj_id#dictionary handlePlayerStructureSearchItemsSelectedResponse#obj_id#dictionary handleSetAccessFee#obj_id#dictionary handleSetAccessLength#obj_id#dictionary handleStorageRedeedChoice#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_travel_instant.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_travel_instant.script deleted file mode 100644 index 508c22c1e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_travel_instant.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/create library/locations library/pet_lib library/player_structure library/travel library/utils -PROTOTYPES: OnDestroy#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int OnTriggerVolumeExited#obj_id#String#obj_id initializeInstaTravelShip#obj_id#dictionary timeOutSelfExpire#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_travel_instant_one_use.script b/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_travel_instant_one_use.script deleted file mode 100644 index b2393f8b2..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/terminal/terminal_travel_instant_one_use.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/create library/locations library/pet_lib library/player_structure library/travel library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/test/cannot_die_healing_test.script b/sku.0/sys.server/compiled/game/script/.deps/test/cannot_die_healing_test.script deleted file mode 100644 index 54a3e37dc..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/test/cannot_die_healing_test.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnCreatureDamaged#obj_id#obj_id#obj_id#int[] OnIncapacitated#obj_id#obj_id OnObjectDamaged#obj_id#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/test/jhaskell_test.script b/sku.0/sys.server/compiled/game/script/.deps/test/jhaskell_test.script deleted file mode 100644 index 679e8d9ca..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/test/jhaskell_test.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/qa library/utils -PROTOTYPES: OnSpeaking#obj_id#String diff --git a/sku.0/sys.server/compiled/game/script/.deps/test/shuttle_test.script b/sku.0/sys.server/compiled/game/script/.deps/test/shuttle_test.script deleted file mode 100644 index 267d85e7f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/test/shuttle_test.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: cleanUp#obj_id#dictionary startLandingSequence#obj_id#dictionary startTakeOffSequence#obj_id#dictionary takeOff#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/dungeon/empire_day_interior_npc_spawner.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/dungeon/empire_day_interior_npc_spawner.script deleted file mode 100644 index 8a471ab83..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/dungeon/empire_day_interior_npc_spawner.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai library/ai_lib library/create library/holiday library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id animatedMood#obj_id#dictionary beginEmpireDaySpawning#obj_id#dictionary randomCreatureDied#obj_id#dictionary tellingMomIDied#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/lok/cantina.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/lok/cantina.script deleted file mode 100644 index 1004fa9da..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/lok/cantina.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai ai/ai_combat library/ai_lib library/create -PROTOTYPES: OnHearSpeech#obj_id#obj_id#String OnInitialize#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/code_break_minigame.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/code_break_minigame.script deleted file mode 100644 index 23a880745..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/code_break_minigame.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/consumable library/loot library/stealth library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int closeSui#obj_id#dictionary handleDialogInput#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_food_supplies.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_food_supplies.script deleted file mode 100644 index 42bad721b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_food_supplies.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/consumable library/stealth library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int closeSui#obj_id#dictionary yeastReceiverPuzzleCallback#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_weapon_cache.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_weapon_cache.script deleted file mode 100644 index 795070a6b..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_weapon_cache.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/consumable library/stealth library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int closeSui#obj_id#dictionary configProcessorPuzzleCallback#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_weapon_cachev2.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_weapon_cachev2.script deleted file mode 100644 index fead0f108..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/destroy_weapon_cachev2.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/collection library/stealth library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int configProcessorPuzzleCallback#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/disarm_bomb_puzzle.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/disarm_bomb_puzzle.script deleted file mode 100644 index b4e6769f2..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/disarm_bomb_puzzle.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/consumable library/stealth library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int closeSui#obj_id#dictionary handleDialogInput#obj_id#dictionary refreshSuiBombTimerData#obj_id#dictionary removeDefuseVar#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/grant_map_quest_object.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/grant_map_quest_object.script deleted file mode 100644 index f13651a84..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/grant_map_quest_object.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/collection library/groundquests library/locations library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handlerGetQuest#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/meatlump_guard_trigger_volume.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/meatlump_guard_trigger_volume.script deleted file mode 100644 index 3ed4951be..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/meatlump_guard_trigger_volume.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/attrib library/create library/group library/stealth library/utils -PROTOTYPES: OnInitialize#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/meatlump_spy_trigger_volume.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/meatlump_spy_trigger_volume.script deleted file mode 100644 index 4692fd5b7..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/meatlump_spy_trigger_volume.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create library/groundquests library/stealth library/utils -PROTOTYPES: OnInitialize#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/qrant_map_quest_object.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/qrant_map_quest_object.script deleted file mode 100644 index ebd2b38d9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/qrant_map_quest_object.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/city library/collection library/groundquests library/locations library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleGrantPublishGiftFromComlink#obj_id#dictionary handleQuestOfferResponse#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/slicing_minigame.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/slicing_minigame.script deleted file mode 100644 index 23a880745..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/slicing_minigame.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/consumable library/loot library/stealth library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int closeSui#obj_id#dictionary handleDialogInput#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/target_map_puzzle.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/target_map_puzzle.script deleted file mode 100644 index 8b96e3de2..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/meatlump/target_map_puzzle.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/consumable library/stealth library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int closeSui#obj_id#dictionary handleDialogInput#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_controller.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_controller.script deleted file mode 100644 index 313b457f9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_controller.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/hue library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnExitedCombat#obj_id colorize#obj_id#dictionary findTarget#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_foreman.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_foreman.script deleted file mode 100644 index 313b457f9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_foreman.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/hue library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnExitedCombat#obj_id colorize#obj_id#dictionary findTarget#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_kell_lapaz.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_kell_lapaz.script deleted file mode 100644 index 313b457f9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_kell_lapaz.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/hue library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnExitedCombat#obj_id colorize#obj_id#dictionary findTarget#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_nyms_girlfriend.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_nyms_girlfriend.script deleted file mode 100644 index b5ff49983..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_nyms_girlfriend.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/group library/hue library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnExitedCombat#obj_id OnIncapacitateTarget#obj_id#obj_id handleBossDistanceCheck#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_nyms_themepark.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_nyms_themepark.script deleted file mode 100644 index dd2515cf0..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_nyms_themepark.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/groundquests library/group library/hue library/trial library/utils -PROTOTYPES: OnAboutToBeIncapacitated#obj_id#obj_id OnAttach#obj_id OnEnteredCombat#obj_id OnExitedCombat#obj_id OnIncapacitateTarget#obj_id#obj_id checkCombatStatus#obj_id#dictionary handleBossDistanceCheck#obj_id#dictionary moveCreatureToWaypoint#obj_id#dictionary willDespawn#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_udo_barnet.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_udo_barnet.script deleted file mode 100644 index 313b457f9..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/boss_udo_barnet.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/hue library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnExitedCombat#obj_id colorize#obj_id#dictionary findTarget#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/cave_hacker.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/cave_hacker.script deleted file mode 100644 index b98f50f14..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/cave_hacker.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/money -PROTOTYPES: OnAttach#obj_id OnNpcConversationResponse#obj_id#String#obj_id#string_id OnStartNpcConversation#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/computer.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/computer.script deleted file mode 100644 index 7d3d3b127..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/computer.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/permissions library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int makeNewDrive#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave.script deleted file mode 100644 index 94c5c377f..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/create library/spawning library/utils -PROTOTYPES: OnInitialize#obj_id beginSpawnEnemies#obj_id#dictionary spawnQuestObjects#obj_id#dictionary tellingMomIDied#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_collectible.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_collectible.script deleted file mode 100644 index 22573b003..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_collectible.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/permissions library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int makeNewModule#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_died.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_died.script deleted file mode 100644 index dfab9883d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_died.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnDestroy#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_gate.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_gate.script deleted file mode 100644 index 79d2b7649..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_gate.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests -PROTOTYPES: OnAboutToReceiveItem#obj_id#obj_id#obj_id#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_prisoner.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_prisoner.script deleted file mode 100644 index 470a48033..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_cave_prisoner.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/utils -PROTOTYPES: OnIncapacitated#obj_id#obj_id handleDestroySelf#obj_id#dictionary handleUpdatePrisonerRescueQuest#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_module.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_module.script deleted file mode 100644 index 22573b003..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/droid_module.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/permissions library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int makeNewModule#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/dumpster_quest_object.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/dumpster_quest_object.script deleted file mode 100644 index d3e7fa21a..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/dumpster_quest_object.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/create library/factions library/groundquests library/holiday library/pclib library/pet_lib library/static_item library/stealth library/sui library/trial library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleObjectSwapTimer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/gas_filter.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/gas_filter.script deleted file mode 100644 index 22573b003..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/gas_filter.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/permissions library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int makeNewModule#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/grenade_crate.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/grenade_crate.script deleted file mode 100644 index 5ccbba347..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/grenade_crate.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/permissions library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int makeNewGrenade#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/kusak_nyms_themepark.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/kusak_nyms_themepark.script deleted file mode 100644 index 492d09c58..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/kusak_nyms_themepark.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/chat library/groundquests library/group library/hue library/trial library/utils -PROTOTYPES: OnAboutToBeIncapacitated#obj_id#obj_id OnAttach#obj_id OnEnteredCombat#obj_id OnExitedCombat#obj_id OnIncapacitateTarget#obj_id#obj_id handleBossDistanceCheck#obj_id#dictionary moveCreatureToWaypoint#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/mining_cave.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/mining_cave.script deleted file mode 100644 index 42e16ea78..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/mining_cave.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai ai/ai_combat library/ai_lib library/create library/spawning library/utils -PROTOTYPES: OnInitialize#obj_id handleSpawns#obj_id#dictionary spawnQuestObjects#obj_id#dictionary tellingMomIDied#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_ambush_ai.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_ambush_ai.script deleted file mode 100644 index 346fa539e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_ambush_ai.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/anims library/buff library/chat library/create library/factions library/groundquests library/group library/prose library/trial library/utils -PROTOTYPES: OnAttach#obj_id OnCreatureDamaged#obj_id#obj_id#obj_id#int[] OnEnteredCombat#obj_id OnExitedCombat#obj_id OnIncapacitateTarget#obj_id#obj_id OnIncapacitated#obj_id#obj_id OnObjectDamaged#obj_id#obj_id#obj_id#int destroySelf#obj_id#dictionary handleIntelligenceLoop#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_dungeon_collectible.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_dungeon_collectible.script deleted file mode 100644 index 22573b003..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_dungeon_collectible.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/permissions library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int makeNewModule#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_elevator_down.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_elevator_down.script deleted file mode 100644 index 84cf59081..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_elevator_down.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/groundquests library/locations library/utils -PROTOTYPES: OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int makeElevatorWork#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_elevator_up.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_elevator_up.script deleted file mode 100644 index 573045a29..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/nym_elevator_up.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/groundquests library/locations library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/research_lab.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/research_lab.script deleted file mode 100644 index 45d3e5a39..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/research_lab.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/create library/spawning library/utils -PROTOTYPES: OnInitialize#obj_id beginSpawn#obj_id#dictionary spawnQuestObjects#obj_id#dictionary tellingMomIDied#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/research_lab_died.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/research_lab_died.script deleted file mode 100644 index dfab9883d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/research_lab_died.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnDestroy#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/stronghold.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/stronghold.script deleted file mode 100644 index d22660100..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/stronghold.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai ai/ai_combat library/ai_lib library/create -PROTOTYPES: OnHearSpeech#obj_id#obj_id#String OnInitialize#obj_id makeDogSit#obj_id#dictionary spawnElevatorHandler#obj_id#dictionary spawnGuards#obj_id#dictionary spawnParty#obj_id#dictionary spawnPirates#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/stronghold_ladder.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/stronghold_ladder.script deleted file mode 100644 index 9a55f68b8..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/stronghold_ladder.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/locations library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/water_filtration_chemical_deposit.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/water_filtration_chemical_deposit.script deleted file mode 100644 index 6330948ef..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/water_filtration_chemical_deposit.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/create library/factions library/groundquests library/holiday library/pclib library/pet_lib library/static_item library/stealth library/sui library/trial library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroySelf#obj_id#dictionary handleObjectSwapTimer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/weed_quest_object.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/weed_quest_object.script deleted file mode 100644 index 62085e321..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/weed_quest_object.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/buff library/collection library/colors library/create library/factions library/groundquests library/holiday library/money library/pclib library/pet_lib library/prose library/static_item library/stealth library/sui library/trial library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int destroySelf#obj_id#dictionary handleObjectSwapTimer#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/weed_spawning.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/weed_spawning.script deleted file mode 100644 index 67b7442ad..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/nym/weed_spawning.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create -PROTOTYPES: OnAttach#obj_id destroySelf#obj_id#dictionary spawnObject#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/beast_pathing.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/beast_pathing.script deleted file mode 100644 index c41648736..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/beast_pathing.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/chat library/create library/factions library/groundquests library/stealth library/trial library/utils -PROTOTYPES: OnCreatureDamaged#obj_id#obj_id#obj_id#int[] OnDestroy#obj_id OnIncapacitated#obj_id#obj_id OnMovePathComplete#obj_id OnObjectDamaged#obj_id#obj_id#obj_id#int blowUp#obj_id#dictionary checkOwnerValidity#obj_id#dictionary cleanUpCampNpcAndParent#obj_id#dictionary cleanUpDeliveryBeast#obj_id#dictionary startBeastDeliveryPathing#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/blackwing_canister_destroy.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/blackwing_canister_destroy.script deleted file mode 100644 index c15864bff..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/blackwing_canister_destroy.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/groundquests library/trial library/utils -PROTOTYPES: OnAttach#obj_id blowUp#obj_id#dictionary setUp#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_arrival_trigger_volume.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_arrival_trigger_volume.script deleted file mode 100644 index af086b381..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_arrival_trigger_volume.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/attrib library/groundquests -PROTOTYPES: OnInitialize#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_defense.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_defense.script deleted file mode 100644 index 0bcf96067..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_defense.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/create library/groundquests library/stealth library/utils -PROTOTYPES: OnInitialize#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id failPlayerDefense#obj_id#dictionary findPathNodes#obj_id#dictionary triggerVolFailsafe#obj_id#dictionary updatePlayerDefense#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_defense_spawner.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_defense_spawner.script deleted file mode 100644 index 5ff4828d7..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_defense_spawner.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/create library/groundquests library/stealth library/utils -PROTOTYPES: OnInitialize#obj_id findPathNodes#obj_id#dictionary spawnDynamicEnemy#obj_id#dictionary startSpawning#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_survivor_spawning.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_survivor_spawning.script deleted file mode 100644 index eeeb02c78..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/camp_survivor_spawning.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/create library/holiday library/utils -PROTOTYPES: OnAttach#obj_id destroySelf#obj_id#dictionary spawnSurvivor#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/delivery_beast_spawner.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/delivery_beast_spawner.script deleted file mode 100644 index 4f72e2e12..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/delivery_beast_spawner.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/chat library/create library/groundquests library/utils -PROTOTYPES: OnInitialize#obj_id getAllEscortPathNodes#obj_id#dictionary spawnVolunteerNPC#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/outbreak_defense_enemy.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/outbreak_defense_enemy.script deleted file mode 100644 index 9f4a4e59e..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/outbreak_defense_enemy.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/groundquests library/utils -PROTOTYPES: OnAttach#obj_id OnDeath#obj_id#obj_id#obj_id OnIncapacitateTarget#obj_id#obj_id OnMovePathComplete#obj_id checkValidityOfOwner#obj_id#dictionary cleanUpEnemy#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/rescue_trigger_volume.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/rescue_trigger_volume.script deleted file mode 100644 index d0be22ee8..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/rescue_trigger_volume.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/create library/groundquests library/stealth library/utils -PROTOTYPES: OnInitialize#obj_id OnTriggerVolumeEntered#obj_id#String#obj_id OnTriggerVolumeExited#obj_id#String#obj_id getAllEscortPathNodes#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/survivor_pathing.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/survivor_pathing.script deleted file mode 100644 index fd925d307..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak/survivor_pathing.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/create library/groundquests library/stealth library/utils -PROTOTYPES: OnDestroy#obj_id OnIncapacitated#obj_id#obj_id OnMoveMoving#obj_id OnMovePathComplete#obj_id checkOwnerValidity#obj_id#dictionary cleanUpNpcTimer#obj_id#dictionary creditPlayerRescue#obj_id#dictionary startSurvivorPathing#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak_prolog/dead_npc_script.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak_prolog/dead_npc_script.script deleted file mode 100644 index 0303c8eec..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak_prolog/dead_npc_script.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/ai_lib library/attrib library/create library/factions library/groundquests library/holiday library/utils -PROTOTYPES: OnAttach#obj_id OnInitialize#obj_id OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int knockDown#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak_prolog/publish_gift_prolog_quest.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak_prolog/publish_gift_prolog_quest.script deleted file mode 100644 index f41b211f1..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/outbreak_prolog/publish_gift_prolog_quest.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/factions library/groundquests library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handleQuestOfferResponse#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/theme_park/poi/base.script b/sku.0/sys.server/compiled/game/script/.deps/theme_park/poi/base.script deleted file mode 100644 index d39ce2f41..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/theme_park/poi/base.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: ai/ai_combat library/poi -PROTOTYPES: diff --git a/sku.0/sys.server/compiled/game/script/.deps/working/cannot_die.script b/sku.0/sys.server/compiled/game/script/.deps/working/cannot_die.script deleted file mode 100644 index 54a3e37dc..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/working/cannot_die.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: -PROTOTYPES: OnCreatureDamaged#obj_id#obj_id#obj_id#int[] OnIncapacitated#obj_id#obj_id OnObjectDamaged#obj_id#obj_id#obj_id#int diff --git a/sku.0/sys.server/compiled/game/script/.deps/working/color_index_testing.script b/sku.0/sys.server/compiled/game/script/.deps/working/color_index_testing.script deleted file mode 100644 index d62faff07..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/working/color_index_testing.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/hue library/sui library/utils -PROTOTYPES: OnObjectMenuRequest#obj_id#obj_id#menu_info OnObjectMenuSelect#obj_id#obj_id#int handlePrimaryColorize#obj_id#dictionary handleSecondaryColorize#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/.deps/working/jhaskell_test.script b/sku.0/sys.server/compiled/game/script/.deps/working/jhaskell_test.script deleted file mode 100644 index f635e996d..000000000 --- a/sku.0/sys.server/compiled/game/script/.deps/working/jhaskell_test.script +++ /dev/null @@ -1,2 +0,0 @@ -DEPENDENCIES: library/advanced_turret library/ai_lib library/armor library/buff library/camping library/city library/collection library/factions library/gcw library/groundquests library/holiday library/house_pet library/loot library/money library/performance library/player_structure library/qa library/static_item library/stealth library/trial library/utils library/vendor_lib library/weapons -PROTOTYPES: OnSpeaking#obj_id#String spawnTreasure#obj_id#dictionary diff --git a/sku.0/sys.server/compiled/game/script/ai/ai.java b/sku.0/sys.server/compiled/game/script/ai/ai.java deleted file mode 100644 index d58a2ba2c..000000000 --- a/sku.0/sys.server/compiled/game/script/ai/ai.java +++ /dev/null @@ -1,3114 +0,0 @@ -package script.ai; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.ai.ai_aggro; -import script.ai.ai_combat; -import script.ai.ai_combat_assist; -import java.lang.Math; -import script.library.ai_lib; -import script.library.attrib; -import script.library.beast_lib; -import script.library.buff; -import script.library.callable; -import script.library.camping; -import script.library.chat; -import script.library.collection; -import script.library.colors; -import script.library.corpse; -import script.library.create; -import script.library.factions; -import script.library.gcw; -import script.library.group; -import script.library.groundquests; -import script.library.instance; -import script.library.locations; -import script.library.loot; -import script.library.performance; -import script.library.permissions; -import script.library.pet_lib; -import script.library.posture; -import script.library.prose; -import script.library.resource; -import script.library.scheduled_drop; -import script.library.scenario; -import script.library.scout; -import script.library.static_item; -import script.library.stealth; -import script.library.storyteller; -import script.library.sui; -import script.library.utils; -import script.library.xp; - - -public class ai extends script.base_script -{ - public ai() - { - } - public static final boolean LOGGING_ON = false; - public static final String LOGGING_CATEGORY = "ai_script"; - - public static final String MENU_FILE = "pet/pet_menu"; - - public static final float CORPSE_CLEANUP_DELAY = 300.0f; - - public static final String CREATURE_TABLE = "datatables/mob/creatures.iff"; - - public static final string_id SID_NOTIFY_STALKED = new string_id("skl_use","notify_stalked"); - public static final string_id SID_CANT_MILK = new string_id("skl_use","milk_cant"); - public static final string_id SID_MILK_NOT_HIDDEN = new string_id("skl_use","milk_not_hidden"); - public static final string_id SID_MILK_BEGIN = new string_id("skl_use","milk_begin"); - public static final string_id SID_MILK_TOO_FAR = new string_id("skl_use","milk_too_far"); - public static final string_id SID_CANT_MILK_THE_DEAD = new string_id("skl_use","milk_cant_milk_the_dead"); - public static final string_id SID_MILK_CONTINUE = new string_id("skl_use","milk_continue"); - public static final string_id SID_MILK_SUCCESS = new string_id("skl_use","milk_success"); - public static final string_id SID_BEING_MILKED = new string_id("skl_use","being_milked"); - public static final string_id SID_CANT_MILK_MOUNTED = new string_id("skl_use","milk_mounted"); - public static final string_id SID_CANT_MILK_COMBAT = new string_id("skl_use","milk_combat"); - public static final string_id SID_CANT_MILK_INV_FULL = new string_id("skl_use","milk_inventory_full"); - - public static final string_id SID_ALREADY_RECRUITED = new string_id("collection", "already_recruited"); - public static final string_id SID_ENEMY_RECRUIT = new string_id("collection", "enemy_recruit"); - public static final string_id SID_GAVE_RECRUIT_ITEM = new string_id("collection", "gave_recruit_item"); - public static final string_id SID_NPC_MEATLUMP_SPEAK = new string_id("collection", "npc_meatlump_speak"); - public static final string_id SID_NO_RECRUIT_REB_IMP = new string_id("collection", "no_recruit_reb_imp"); - - - public void initializeScript() throws InterruptedException - { - obj_id self = getSelf(); - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::initializeScript() self("+ self + ":"+ getName(self) + ")"); - - if (hasObjVar(self, "ai.threat")) - { - removeObjVar(self, "ai.threat"); - } - - if (ai_lib.isAggro(self)) - { - setCondition(self, CONDITION_AGGRESSIVE); - } - - location loc = getLocation(self); - boolean setHomeLoc = true; - if (loc == null) - { - setHomeLoc = false; - LOG("debug_ai", "WARNING: got null location in ai.initializeScript for creature "+ self); - } - else if (loc.area == null) - { - setHomeLoc = false; - LOG("debug_ai", "WARNING: null scene from getLocation in ai.initializeScript for creature "+ self); - } - else if (loc.area.length() == 0) - { - setHomeLoc = false; - LOG("debug_ai", "WARNING: empty scene from getLocation in ai.initializeScript for creature "+ self); - } - - if (setHomeLoc) - { - aiSetHomeLocation(self, loc); - } - - setWantSawAttackTriggers(self, aiIsAssist(self) || aiIsGuard(self)); - - if (!hasObjVar(self, "ai.defaultCalmBehavior")) - { - setObjVar(self, "ai.defaultCalmBehavior", ai_lib.BEHAVIOR_LOITER); - } - - ai_lib.resetAi(); - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnAttach() self("+ self + ":"+ getName(self) + ")"); - - initializeScript(); - - return SCRIPT_CONTINUE; - } - - - public int OnAddedToWorld(obj_id self) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnAddedToWorld() self("+ self + ":"+ getName(self) + ")"); - - messageTo(self, "handleOnAddedToWorldDelay", null, 2, false); - return SCRIPT_CONTINUE; - } - - - public int handleOnAddedToWorldDelay(obj_id self, dictionary params) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnAddedToWorld() self("+ self + ":"+ getName(self) + ")"); - - initializeScript(); - return SCRIPT_CONTINUE; - } - - - public int OnRemovingFromWorld(obj_id self) throws InterruptedException - { - if (ai_lib.isAiDead(self) && !pet_lib.isPet(self) && !beast_lib.isBeast(self) && isObjectPersisted(self)) - { - destroyObject(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnFleeTargetLost(obj_id self, obj_id oldTarget) throws InterruptedException - { - if (aiLoggingEnabled(self)) - { - debugSpeakMsg(self, "OnFleeTargetLost("+ oldTarget + ")"); - } - - removeObjVar(self, "ai.threat"); - doDefaultCalmBehavior(self); - - return SCRIPT_CONTINUE; - } - - - public int OnFleePathNotFound(obj_id self, obj_id oldTarget) throws InterruptedException - { - if (aiLoggingEnabled(self)) - { - debugSpeakMsg(self, "OnFleePathNotFound("+ oldTarget + ")"); - } - - doDefaultCalmBehavior(self); - - return SCRIPT_CONTINUE; - } - - - public int OnFleeWaypoint(obj_id self, obj_id target) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int resumeDefaultCalmBehavior(obj_id self, dictionary params) throws InterruptedException - { - if (isInNpcConversation(self) || aiIsTethered(self)) - { - if (!hasMessageTo(self, "resumeDefaultCalmBehavior")) - { - messageTo(self, "resumeDefaultCalmBehavior", null, 5, false); - } - - return SCRIPT_CONTINUE; - } - - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::resumeDefaultCalmBehavior() self("+ self + getName(self) + ")"); - - doDefaultCalmBehavior(self); - - return SCRIPT_CONTINUE; - } - - - public void doDefaultCalmBehavior(obj_id npc) throws InterruptedException - { - if (!npc.isLoaded() || !exists(npc)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc(?) ISN'T LOADED!"); - return; - } - - if (ai_lib.isInCombat(npc)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc("+ npc + ") I THINK I AM IN COMBAT"); - return; - } - - if (ai_lib.isAiDead(npc)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc("+ npc + ") I THINK I AM INCAPACITATED"); - return; - } - - removeObjVar(npc, "ai.threat"); - ai_lib.setMood(npc, ai_lib.MOOD_CALM); - - if (!hasObjVar(npc, "ai.rangedOnly")) - { - - } - - if (ai_lib.isFollowing(npc)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc("+ npc + ") FOLLOWING"); - - obj_id target = ai_lib.getFollowTarget(npc); - - if (isIdValid(target) && exists(target) && !ai_lib.isAiDead(target) && isInWorld(target)) - { - ai_lib.resumeFollow(npc); - return; - } - else - { - removeObjVar(npc, "ai.persistantFollowing"); - } - } - - if (hasObjVar(npc, "ai.inFormation")) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc("+ npc + ") IN FORMATION"); - - if (getPosture(npc) != POSTURE_UPRIGHT) - { - posture.stand(npc); - } - - ai_lib.resumeFormationFollowing(npc); - return; - } - - if (ai_lib.canPatrol(npc)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc("+ npc + ") PATROLING"); - - if (getPosture(npc) != POSTURE_UPRIGHT) - { - posture.stand(npc); - } - - ai_lib.resumePatrol(npc); - return; - } - - if (hasObjVar(npc, "ai.persistentPathing")) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc("+ npc + ") PATHING"); - - if (getPosture(npc) != POSTURE_UPRIGHT) - { - posture.stand(npc); - } - - location pathLoc = getLocationObjVar(npc, "ai.persistentPathing"); - pathTo(npc, pathLoc); - return; - } - - if (hasObjVar(npc, "ai.persistentPathingWaypoint")) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc("+ npc + ") ai.persistentPathingWaypoint"); - - if (getPosture(npc) != POSTURE_UPRIGHT) - { - posture.stand(npc); - } - - String pathWaypoint = getStringObjVar(npc, "ai.persistentPathingWaypoint"); - pathTo(npc, pathWaypoint); - return; - } - - if (getConfigSetting("GameServer", "disableAILoitering")!=null) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc("+ npc + ") disableAILoitering"); - return; - } - - final int defaultBehavior = ai_lib.getDefaultCalmBehavior(npc); - - switch (defaultBehavior) - { - case ai_lib.BEHAVIOR_STOP: - case ai_lib.BEHAVIOR_SENTINEL: - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::doDefaultCalmBehavior() npc("+ npc + getName(npc) + ") BEHAVIOR_STOP"); - stop(npc); - - break; - - default: - case ai_lib.BEHAVIOR_LOITER: - case ai_lib.BEHAVIOR_WANDER: - if (pet_lib.isPet(npc) || beast_lib.isBeast(npc)) - { - aiSetHomeLocation(npc, getLocation(npc)); - } - - final float collisionRadius = getObjectCollisionRadius(npc); - float minDistance = 0.0f; - float maxDistance = 0.0f; - - if (hasObjVar(npc, "ai.loiterMinRange")) - { - minDistance = getFloatObjVar(npc, "ai.loiterMinRange"); - maxDistance = getFloatObjVar(npc, "ai.loiterMaxRange"); - } - else - { - - final float cellDistanceModifier = !isIdValid(getLocation(npc).cell) ? 3.0f : 1.0f; - - maxDistance = Math.min(128.0f, collisionRadius * 7.0f * cellDistanceModifier); - minDistance = 0.0f; - } - - final float minDelay = Math.min(Math.max(8.0f, collisionRadius * 2.0f), 16.0f); - final float maxDelay = Math.min(Math.max(8.0f, collisionRadius * 4.0f), 16.0f); - - loiterLocation(npc, aiGetHomeLocation(npc), minDistance, maxDistance, minDelay, maxDelay); - - break; - } - } - - - public int OnFollowMoving(obj_id self, obj_id target) throws InterruptedException - { - if (ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isAiDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (getPosture(self) != POSTURE_UPRIGHT) - { - stop(self); - removeObjVar(self, "ai.combat.moveMode"); - posture.stand(self); - - messageTo(self, "resumeDefaultCalmBehavior", null, 2, false); - - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnFollowTargetLost(obj_id self, obj_id oldTarget) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnFollowTargetLost() self("+ self + ":"+ getName(self) + ")"); - - if (!ai_lib.isInCombat(self)) - { - ai_lib.aiStopFollowing(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - if (utils.hasScriptVar(self, "sentAllyDistressCall")) - { - utils.removeScriptVar(self, "sentAllyDistressCall"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnFollowWaiting(obj_id self, obj_id target) throws InterruptedException - { - if (!target.isLoaded() || !exists(target)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(target, "gm")) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(target) || ai_lib.isAiDead(target)) - { - ai_lib.aiStopFollowing(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnFollowPathNotFound(obj_id self, obj_id target) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnFollowPathNotFound() self("+ self + ":"+ getName(self) + ")"); - - if (!ai_lib.isInCombat(self)) - { - ai_lib.aiStopFollowing(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnMovePathComplete(obj_id self) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnMovePathComplete() self("+ self + ")"); - - if (hasObjVar(self, "ai.persistentPathing")) - { - location pathLoc = getLocationObjVar(self, "ai.persistentPathing"); - if (utils.getDistance(self, pathLoc) < 2.0f) - { - removeObjVar(self, "ai.persistentPathing"); - } - } - - if (hasObjVar(self, "ai.persistentWaypoint")) - { - removeObjVar(self, "ai.persistentPathingWaypoint"); - } - - if (!ai_lib.isInCombat(self)) - { - - if (getBehavior(self) <= BEHAVIOR_CALM) - { - ai_lib.resumePatrol(self); - } - - if (utils.hasScriptVar(self, "pathingToAttack")) - { - obj_id target = utils.getObjIdScriptVar(self, "pathingToAttack"); - - if (isIdValid(target)) - { - - startCombat(self, target); - } - - utils.removeScriptVar(self, "pathingToAttack"); - } - - } - - return SCRIPT_CONTINUE; - } - - - public int OnMovePathNotFound(obj_id self) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnMovePathNotFound() self("+ self + ":"+ getName(self) + ")"); - - if (utils.hasScriptVar(self, "pathingToAttack")) - { - utils.removeScriptVar(self, "pathingToAttack"); - } - - stop(self); - - if (getBehavior(self) <= BEHAVIOR_CALM && !ai_lib.isAiDead(self)) - { - setLocation(self, aiGetHomeLocation(self)); - messageTo(self, "resumeDefaultCalmBehavior", null, 5, false); - } - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - - if (utils.hasScriptVar(self, "petBeingInitialized")) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") self("+ self + ":"+ getName(self) + ") PET BEING INITIALIZED"); - return SCRIPT_CONTINUE; - } - - if (!isMob(breacher)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") SCRIPT_CONTINUE - The breacher is not a mob"); - return SCRIPT_CONTINUE; - } - - if (breacher == self) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") SCRIPT_CONTINUE - The breacher == self"); - return SCRIPT_CONTINUE; - } - - if (ai_lib.isAiDead(self)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "WARNING: ai::OnTriggerVolumeEntered("+ volumeName + ") self("+ self + ":"+ getName(self) + ") I AM DEAD"); - return SCRIPT_CONTINUE; - } - - if (beast_lib.isBeast(self) && (!beast_lib.getBeastDefensive(self) || !hasCommand(getMaster(self), beast_lib.BM_COMMAND_ATTACK))) - { - return SCRIPT_CONTINUE; - } - - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") self("+ self + ":"+ getName(self) + ") radius("+ getTriggerVolumeRadius(self, volumeName) + ") breacher("+ breacher + ":"+ getName(breacher) + ")"); - - final boolean breacherIsAPlayer = isPlayer(breacher); - - if (volumeName.equals(ai_lib.ALERT_VOLUME_NAME)) - { - if (isPlayer(breacher) && !ai_lib.isMonster(self)) - { - ai_lib.greet(self, breacher); - } - - if (hasTriggerVolume(self, ai_lib.AGGRO_VOLUME_NAME)) - { - boolean aggro = false; - - if (pvpIsEnemy(self, breacher)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") Breacher is a threat (pvp enemy)"); - aggro = true; - } - else - { - if (isPlayer(breacher)) - { - - final int factionStatus = factions.getFactionStatus(self, breacher); - - if (factionStatus == factions.STATUS_ENEMY) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") Player breacher is a threat (faction enemy)"); - aggro = true; - } - - else if ((factionStatus == factions.STATUS_NEUTRAL) && aiIsAggressive(self)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") Player breacher is a threat (faction neutral, I am aggressive)"); - aggro = true; - } - else if (pvpGetAlignedFaction(self) != 0) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") Player breacher is a NOT currently a threat (but could be with faction alignment change)"); - aggro = true; - } - else - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") Player breacher is a NOT a threat"); - } - } - else - { - if (aiIsGuard(self)) - { - - final String breacherFaction = factions.getFaction(breacher); - - if (( (breacherFaction != null) && (breacherFaction.equals("townsperson") || breacherFaction.equals("ImperialCitizen") || breacherFaction.equals("RebelCitizen")))) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") guard: AI breacher is a NOT a threat (townsperson)"); - } - else - { - if (ai_lib.isSameSocialGroup(self, breacher)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") guard: AI breacher is NOT a threat (same social group)"); - } - else if (pet_lib.isPet(breacher) || beast_lib.isBeast(breacher)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") guard: AI breacher is NOT a threat (pet)"); - } - else - { - if (ai_lib.isAnimal(breacher)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") guard: AI breacher is a threat (animal)"); - aggro = true; - } - else if (factions.getFactionStatus(self, breacher) == factions.STATUS_ENEMY) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") guard: AI breacher is a threat (factional enemy)"); - aggro = true; - } - else if (hasAttributeAttained(breacher, attrib.THUG)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") guard: AI breacher is a threat (thug)"); - aggro = true; - } - else - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") guard: AI breacher is NOT a threat"); - } - } - } - } - else - { - - if (ai_lib.isSameSocialGroup(self, breacher)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") AI breacher is NOT a threat (same social group)"); - } - else - { - final int factionStatus = factions.getFactionStatus(self, breacher); - - if (factionStatus == factions.STATUS_ENEMY) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") AI breacher is a threat (factional enemy)"); - aggro = true; - } - else - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") AI breacher is NOT a threat"); - } - } - } - } - } - - if (hasObjVar(self, "storytellerid")) - { - if (!utils.hasScriptVar(breacher, "storytellerid")) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") Player breacher is a NOT a member of my Story"); - aggro = false; - } - else - { - obj_id selfStoryTellerId = getObjIdObjVar(self, "storytellerid"); - obj_id breacherStoryTellerId = utils.getObjIdScriptVar(breacher, "storytellerid"); - if (selfStoryTellerId != breacherStoryTellerId) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeEntered("+ volumeName + ") Player breacher is a NOT a member of my Story (but he is a member of another Story)"); - aggro = false; - } - } - } - - if (aggro) - { - addTriggerVolumeEventSource(ai_lib.AGGRO_VOLUME_NAME, breacher); - - } - } - } - else if (volumeName.equals(ai_lib.AGGRO_VOLUME_NAME)) - { - if (!isPlayer(breacher)) - { - ai_aggro.requestAggroCheck(breacher); - } - else - { - if (scout.isScentMasked(breacher, self)) - { - - } - else - { - if (isIncapacitated(breacher)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::requestSawRecapacitation() self("+ self + ":"+ getName(self) + ") breacher("+ breacher + ":"+ getName(breacher) + ") Listening for breacher recapacitation"); - - listenToMessage(breacher, "handleSawRecapacitation"); - } - - ai_aggro.requestAggroCheck(breacher); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnTriggerVolumeExited("+ volumeName + ") self("+ self + ":"+ getName(self) + ") radius("+ getTriggerVolumeRadius(self, volumeName) + ") breacher("+ breacher + ":"+ getName(breacher) + ")"); - - if (utils.hasScriptVar(self, "petBeingInitialized")) - { - return SCRIPT_CONTINUE; - } - - if (volumeName.equals(ai_lib.ALERT_VOLUME_NAME)) - { - - if (( isPlayer(breacher) && !ai_lib.isMonster(self))) - { - ai_lib.dismiss(self, breacher); - } - - removeTriggerVolumeEventSource(ai_lib.AGGRO_VOLUME_NAME, breacher); - - if (hasScript(self, "systems.missions.dynamic.mission_bounty_target")) - { - obj_id objHunter = getObjIdObjVar(self, "objHunter"); - if (!isIdValid(objHunter) || objHunter != breacher) - { - pvpRemovePersonalEnemyFlags(self, breacher); - } - } - else - { - pvpRemovePersonalEnemyFlags(self, breacher); - } - } - else if (volumeName.equals(ai_lib.AGGRO_VOLUME_NAME)) - { - if (isPlayer(breacher)) - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::requestSawRecapacitation() self("+ self + ":"+ getName(self) + ") breacher("+ breacher + ":"+ getName(breacher) + ") Stop listening for breacher recapacitation"); - - stopListeningToMessage(breacher, "handleSawRecapacitation"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnLoiterWaiting(obj_id self, modifiable_float time) throws InterruptedException - { - - if (ai_lib.isHerdingCreature(self)) - { - ai_lib.doAction(self, "eat"); - } - - return SCRIPT_CONTINUE; - } - - - public boolean isThreat(obj_id npc, obj_id breacher) throws InterruptedException - { - if (hasObjVar(breacher, "gm")) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::isThreat() npc("+ npc + ") breacher("+ breacher + ") breacher is a gm"); - return false; - } - - if (!isValidId(breacher)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::isThreat() npc("+ npc + ") breacher("+ breacher + ") invalid breacher id"); - return false; - } - - if (!isMob(breacher)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::isThreat() npc("+ npc + ") breacher("+ breacher + ") breacher is not a mob"); - return false; - } - - if (ai_lib.isAiDead(npc)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::isThreat() npc("+ npc + ") breacher("+ breacher + ") npc is dead"); - return false; - } - - if (!isPlayer(breacher) && ai_lib.isAiDead(breacher)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::isThreat() npc("+ npc + ") breacher("+ breacher + ") breacher is dead ai"); - return false; - } - - if (isInvulnerable(npc)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::isThreat() npc("+ npc + ") breacher("+ breacher + ") npc is invulnerable"); - return false; - } - - if (isInvulnerable(breacher)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::isThreat() npc("+ npc + ") breacher("+ breacher + ") breacher is invulnerable"); - return false; - } - - if (!pvpCanAttack(npc, breacher)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::isThreat() !pvpCanAttack - npc("+ npc + ":"+ getName(npc) + ") npcPvpType("+ pvpGetType(npc) + ") npcPvpAlignedFaction("+ pvpGetAlignedFaction(npc) + ") breacher("+ breacher + ":"+ getName(breacher) + ") breacherPvpType("+ pvpGetType(breacher) + ") breacherPvpAlignedFaction("+ pvpGetAlignedFaction(breacher) + ")"); - return false; - } - - obj_id master = getMaster(breacher); - - if (isIdValid(master) && exists(master)) - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::isThreat() npc("+ npc + ") breacher("+ breacher + ") breacher is a pet/beast with a master"); - return false; - } - - return (ai_lib.isAggroToward(npc, breacher) || ai_lib.isAggroToward(breacher, npc)); - } - - - public void goAlert(obj_id npc) throws InterruptedException - { - - if (ai_lib.isAiDead(npc)) - { - return; - } - - if (ai_lib.isInCombat(npc)) - { - return; - } - - if (!hasObjVar(npc, "ai.pathingAwayFrom")) - { - stop(npc); - } - - ai_lib.doAction(npc, ai_lib.ACTION_ALERT); - ai_lib.setMood(npc, ai_lib.MOOD_NERVOUS); - - obj_id threat = getObjIdObjVar(npc, "ai.threat"); - - if (isIdValid(threat)) - { - debugSpeakMsg(npc, "FEAR 7"); - addToMentalStateToward(npc, threat, FEAR, -5.0f); - } - - } - - - public void goThreaten(obj_id npc) throws InterruptedException - { - - if (ai_lib.isAiDead(npc)) - { - return; - } - - if (ai_lib.isInCombat(npc)) - { - return; - } - - obj_id threat = getObjIdObjVar(npc, "ai.threat"); - - if (!isIdValid(threat)) - { - return; - } - - if (hasObjVar(threat, "gm")) - { - return; - } - - stop(npc); - faceTo(npc, threat); - ai_lib.doThreatenAnimation(npc); - debugSpeakMsg(npc, "FEAR 8"); - addToMentalStateToward(npc, threat, FEAR, -5.0f); - - if (!isPlayer(threat)) - { - debugSpeakMsg(threat, "FEAR 9"); - addToMentalStateToward(threat, npc, FEAR, 10.0f); - } - - ai_lib.setMood(npc, ai_lib.MOOD_NERVOUS); - } - - - public int OnBehaviorChange(obj_id self, int newBehavior, int oldBehavior, int[] changeFlags) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int handleSetDefaultBehavior(obj_id self, dictionary params) throws InterruptedException - { - doDefaultCalmBehavior(self); - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - - if (idx == -1) - { - blog("idx was negative 1"); - return super.OnGetAttributes(self, player, names, attribs); - } - - String milkType = ai_lib.getMilkType(self); - - if (milkType != null && ai_lib.isMonster(self) && !beast_lib.isBeast(self)) - { - names[idx] = "got_milk"; - string_id strIdMilkType = new string_id("resource/resource_names", milkType); - attribs[idx] = utils.packStringId(strIdMilkType); - idx++; - } - - final String creatureName = getCreatureName(self); - - if (creatureName == null) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - dictionary creatureKnowledge = beast_lib.getBeastMasterExamineInfo(player, self, names, attribs, idx); - names = creatureKnowledge.getStringArray("names"); - attribs = creatureKnowledge.getStringArray("attribs"); - idx = creatureKnowledge.getInt("idx"); - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int snareEffectOff(obj_id self, dictionary params) throws InterruptedException - { - - string_id strFlyText = new string_id("combat_effects", "no_snare"); - color colFlyText = colors.TOMATO; - showFlyText(self, strFlyText, 1.0f, colFlyText); - - return SCRIPT_CONTINUE; - } - - - public int OnDefenderCombatAction(obj_id self, obj_id attacker, obj_id weapon, int combatResult) throws InterruptedException - { - if (ai_lib.isAiDead(self) || isInvulnerable(self)) - { - return SCRIPT_OVERRIDE; - } - - if (combatResult == COMBAT_RESULT_HIT) - { - chat.setAngryMood(self); - ai_lib.barkString(self, "hit"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnSawAttack(obj_id self, obj_id defender, obj_id[] attackers) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnSawAttack() self("+ self + ":"+ getName(self) + ") defender ("+ defender + ") attackers.length("+ attackers.length + ")"); - - if (beast_lib.isBeast(self)) - { - return SCRIPT_CONTINUE; - } - - if (defendLair(self, defender, attackers, false)) - { - if (hasScript(self, "npc.converse.npc_convo")) - { - if (!isInNpcConversation(self) && !pet_lib.isPet(self) && !beast_lib.isBeast(self)) - { - detachScript(self, "npc.converse.npc_convo"); - clearCondition(self, CONDITION_CONVERSABLE); - } - } - - debugSpeakMsgc(aiLoggingEnabled(self), self, "lair defense"); - } - else - { - if (pet_lib.isPet(self) && pet_lib.isGuarding(self, defender)) - { - for (int i = 0; i < attackers.length; ++i) - { - testAbortScript(); - final obj_id attacker = attackers[i]; - - if (isIdValid(attacker)) - { - startCombat(self, attacker); - - if (!ai_lib.isInCombat(self) && (defender == getMaster(self))) - { - ai_lib.barkString(self, "ally"); - } - } - } - } - else if (aiIsGuard(self)) - { - boolean assistDefender = false; - final String defenderFaction = factions.getFaction(defender); - - if (defenderFaction != null) - { - if (defenderFaction.equals("townsperson") || defenderFaction.equals("ImperialCitizen") || defenderFaction.equals("RebelCitizen")) - { - assistDefender = true; - } - } - - if (!assistDefender && ai_lib.isSameSocialGroup(self, defender)) - { - assistDefender = true; - } - - for (int i = 0; i < attackers.length; ++i) - { - testAbortScript(); - final obj_id attacker = attackers[i]; - - if (isIdValid(attacker)) - { - - if ((assistDefender || hasAttributeAttained(attacker, attrib.THUG) || (ai_lib.isMonster(attacker) && (!pet_lib.isPet(attacker))))) - { - debugSpeakMsgc(aiLoggingEnabled(self), self, "OnSawAttackGuard() attacking("+ attacker + ")"); - - ai_combat_assist.assist(self, attacker); - break; - } - else if (ai_lib.isSameSocialGroup(self, attacker)) - { - debugSpeakMsgc(aiLoggingEnabled(self), self, "OnSawAttack() attacking("+ defender + ")"); - ai_combat_assist.assist(self, defender); - break; - } - } - } - } - else - { - - for (int i = 0; i < attackers.length; ++i) - { - testAbortScript(); - final obj_id attacker = attackers[i]; - - if (isIdValid(attacker)) - { - if (hasObjVar(self, "storytellerid")) - { - if (!utils.hasScriptVar(defender, "storytellerid") && !utils.hasScriptVar(attacker, "storytellerid")) - { - debugSpeakMsgc(aiLoggingEnabled(self), self, "OnSawAttack() not attacking("+ defender + ") or ("+ attacker + ") as they are not a part of my story"); - break; - } - else if (hasObjVar(defender, "storytellerid") && utils.hasScriptVar(attacker, "storytellerid")) - { - obj_id attackerStorytellerId = utils.getObjIdScriptVar(attacker, "storytellerid"); - obj_id defenderStorytellerId = getObjIdObjVar(defender, "storytellerid"); - obj_id myStorytellerId = getObjIdObjVar(self, "storytellerid"); - - if (myStorytellerId == defenderStorytellerId && ai_lib.isSameSocialGroup(self, defender)) - { - debugSpeakMsgc(aiLoggingEnabled(self), self, "OnSawAttack() attacking("+ attacker + ")"); - ai_combat_assist.assist(self, defender); - break; - } - - } - else if (utils.hasScriptVar(defender, "storytellerid") && hasObjVar(attacker, "storytellerid")) - { - obj_id attackerStorytellerId = getObjIdObjVar(attacker, "storytellerid"); - obj_id defenderStorytellerId = utils.getObjIdScriptVar(defender, "storytellerid"); - obj_id myStorytellerId = getObjIdObjVar(self, "storytellerid"); - - if (myStorytellerId == attackerStorytellerId && ai_lib.isSameSocialGroup(self, attacker)) - { - debugSpeakMsgc(aiLoggingEnabled(self), self, "OnSawAttack() attacking("+ defender + ")"); - ai_combat_assist.assist(self, attacker); - break; - } - } - } - - if (ai_lib.isSameSocialGroup(self, defender)) - { - debugSpeakMsgc(aiLoggingEnabled(self), self, "OnSawAttack() attacking("+ attacker + ")"); - ai_combat_assist.assist(self, attacker); - break; - } - else if (ai_lib.isSameSocialGroup(self, attacker)) - { - debugSpeakMsgc(aiLoggingEnabled(self), self, "OnSawAttack() attacking("+ defender + ")"); - ai_combat_assist.assist(self, defender); - break; - } - } - } - } - } - - return SCRIPT_CONTINUE; - } - - - public boolean defendLair(obj_id npc, obj_id defender, obj_id[] attackers, boolean isInCombat) throws InterruptedException - { - - if (isMob(defender)) - { - return false; - } - - if (utils.hasScriptVar(npc, "ai.noLair")) - { - return false; - } - - obj_id myPOI = ai_lib.getLair(npc); - - if (!isIdValid(myPOI)) - { - return false; - } - - if (!hasObjVar(defender, "poi.baseObject")) - { - return false; - } - - if (getObjIdObjVar(defender, "poi.baseObject") == myPOI) - { - - int curHP = getHitpoints(defender); - int maxHP = getMaxHitpoints(defender); - - if (curHP >= maxHP) - { - return true; - - } - - if (pvpGetAlignedFaction(npc) == (221551254)) - { - factions.setFaction(npc, "angry"); - } - - int endLoop = attackers.length; - - if (endLoop > 20) - { - endLoop = 20; - } - - for (int i = 0; i < endLoop; i++) - { - testAbortScript(); - if (isIdValid(attackers[i])) - { - if (!isInCombat) - { - - startCombat(npc, attackers[i]); - - if (utils.hasScriptVar(npc, "pathingToAttack")) - { - utils.removeScriptVar(npc, "pathingToAttack"); - } - - return true; - } - } - } - return true; - } - - return false; - } - - - public int stopFleeing(obj_id self, dictionary params) throws InterruptedException - { - debugSpeakMsg(self, "stopping fleeing"); - - if (!ai_lib.isInCombat(self)) - { - if (getDistance(getLocation(self), aiGetHomeLocation(self)) > 40.0f) - { - pathTo(self, aiGetHomeLocation(self)); - } - } - - if (getBehavior(self) <= BEHAVIOR_CALM) - { - messageTo(self, "resumeDefaultCalmBehavior", null, 5, false); - } - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id attacker) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", ("ai::OnIncapacitated() self("+ self + ":"+ getName(self) + ") attacker("+ attacker + ")")); - - debugSpeakMsgc(aiLoggingEnabled(self), self, "OnIncapacitated"); - - chat.setBadMood(self); - ai_lib.barkString(self, "death"); - - if (!pet_lib.isPet(self) && !beast_lib.isBeast(self) && !utils.hasScriptVar(self, "petBeingInitialized")) - { - - obj_id weapon = getCurrentWeapon(self); - - if (isIdValid(weapon) && !isDefaultWeapon(weapon)) - { - destroyObject(weapon); - } - - obj_id cInv = utils.getInventoryContainer(self); - - if (isIdValid(cInv)) - { - utils.emptyContainerExceptStorytellerLoot(cInv); - } - - ai_lib.clearCombatData(); - - setObjVar(self, xp.VAR_LANDED_DEATHBLOW, attacker); - - if (!kill(self)) - { - obj_id[] haters = getHateList(self); - - if (haters != null || haters.length > 0) - { - for (int i=0; i 0) - { - forceCloseSUIPage(pid); - } - - if (hasObjVar(self, gcw.GCW_PATROL_OBJ)) - { - obj_id patrolObject = getObjIdObjVar(self, gcw.GCW_PATROL_OBJ); - if (isValidId(patrolObject)) - { - dictionary webster = new dictionary(); - webster.put("npc",self); - webster.put("player",player); - messageTo(patrolObject, "handleOffensiveEntertainedNpcCleanUp", webster, 1, false); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int xpDelegated(obj_id self, dictionary params) throws InterruptedException - { - obj_id cInv = utils.getInventoryContainer(self); - - if (isIdValid(cInv)) - { - setOwner(cInv, obj_id.NULL_ID); - } - - if (!beast_lib.isBeast(self)) - { - attachScript(self, corpse.SCRIPT_AI_CORPSE); - - messageTo(self, "aiCorpsePrepared", null, 0, false); - } - else - { - xp.cleanupCreditForKills(); - } - - return SCRIPT_CONTINUE; - } - - - public int aiCorpsePrepared(obj_id self, dictionary params) throws InterruptedException - { - - obj_id[] killers = getObjIdArrayObjVar(self, scenario.VAR_PRIMARY_KILLERS); - - obj_id[] pks = null; - - if (killers != null && killers.length > 0) - { - pks = xp.getPlayersFromKillerList(killers); - } - - if (pks == null || pks.length <= 0) - { - return SCRIPT_CONTINUE; - } - - boolean hasLoot = loot.addLoot(self); - - int corpseLevel = getLevel(self); - boolean doNotDropCard = false; - int difficultyClass = getIntObjVar(self, "difficultyClass"); - int sourceSystem = scheduled_drop.SYSTEM_COMBAT_NORMAL; - - switch(difficultyClass) - { - - case 0: - sourceSystem = scheduled_drop.SYSTEM_COMBAT_NORMAL; - break; - case 1: - sourceSystem = scheduled_drop.SYSTEM_COMBAT_ELITE; - break; - case 2: - sourceSystem = scheduled_drop.SYSTEM_COMBAT_BOSS; - break; - } - - int delayCount = 0; - - for (int i = 0, j = pks.length; i < j; i++) - { - testAbortScript(); - if (isIdValid(pks[i]) && (corpseLevel + 5 < getLevel(pks[i]) || utils.isFreeTrial(pks[i]))) - { - doNotDropCard = true; - } - - if (isIdValid(pks[i]) && scheduled_drop.hasCardDelay(pks[i], sourceSystem)) - { - delayCount++; - } - } - - if (delayCount > pks.length / 2) - { - doNotDropCard = true; - } - - boolean canDrop = scheduled_drop.canDropCard(sourceSystem); - - for (int i = 0, j = pks.length; i < j; i++) - { - testAbortScript(); - if (isIdValid(pks[i])) - { - utils.setScriptVar(pks[i], scheduled_drop.PLAYER_SCRIPTVAR_DROP_TIME, getGameTime()); - - if (isGod(pks[i]) && hasObjVar(pks[i], "qa_tcg_always_drop")) - { - if (!doNotDropCard) - { - canDrop = true; - } - } - - if (isGod(pks[i]) && hasObjVar(pks[i], "qa_tcg")) - { - sendSystemMessageTestingOnly(pks[i], "QA TCG COMBAT. Do not drop card? "+ doNotDropCard + " hasCardDelay? "+ scheduled_drop.hasCardDelay(pks[i], sourceSystem) + " isTrial? "+ utils.isFreeTrial(pks[i]) + " bad level? "+ (corpseLevel + 5 < getLevel(pks[i])) ); - } - } - } - - if (!doNotDropCard) - { - obj_id inv = utils.getInventoryContainer(self); - - if (isIdValid(inv) && canDrop) - { - scheduled_drop.dropCard(sourceSystem, inv); - hasLoot = true; - } - } - - if (hasLoot) - { - corpse.showLootMeParticle(self); - } - - setObjVar(self, "readyToLoot", true); - - xp.cleanupCreditForKills(); - return SCRIPT_CONTINUE; - } - - - public int corpseCleanup(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int OnStartNpcConversation(obj_id self, obj_id speaker) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", ("ai::OnStartNpcConversation() self("+ self + ":"+ getName(self) + ") speaker("+ speaker + ":"+ getName(speaker) + ")")); - - if (!isInNpcConversation(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isAiDead(self)) - { - return SCRIPT_OVERRIDE; - } - - if (ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isInCombat(speaker)) - { - return SCRIPT_CONTINUE; - } - - ai_lib.setMood(self, ai_lib.MOOD_CALM); - stop(self); - faceTo(self, speaker); - - messageTo(self, "handleAbortConversation", null, 30, false); - - return SCRIPT_CONTINUE; - } - - - public int handleAbortConversation(obj_id self, dictionary params) throws InterruptedException - { - if (!isInNpcConversation(self)) - { - if (getBehavior(self) <= BEHAVIOR_CALM) - { - messageTo(self, "resumeDefaultCalmBehavior", null, 5, false); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnEndNpcConversation(obj_id self, obj_id speaker) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", ("ai::OnEndNpcConversation() self("+ self + ":"+ getName(self) + ") speaker("+ speaker + ":"+ getName(speaker) + ")")); - - if (ai_lib.isAiDead(self)) - { - return SCRIPT_OVERRIDE; - } - - if (getBehavior(self) <= BEHAVIOR_CALM) - { - messageTo(self, "resumeDefaultCalmBehavior", null, 5, false); - } - - return SCRIPT_CONTINUE; - } - - - public int disableAI(obj_id self, dictionary params) throws InterruptedException - { - String[] scriptList = getScriptList(self); - - for (int i = 0; i < scriptList.length; i++) - { - testAbortScript(); - if (scriptList[i].startsWith("ai.")) - { - detachScript(self, scriptList[i]); - } - } - - stop(self); - - return SCRIPT_CONTINUE; - } - - - public int handleClearPathingFlag(obj_id self, dictionary params) throws InterruptedException - { - removeObjVar(self, "ai.pathingAwayFrom"); - - if (getBehavior(self) <= BEHAVIOR_CALM) - { - messageTo(self, "resumeDefaultCalmBehavior", null, 5, false); - } - - return SCRIPT_CONTINUE; - } - - - public int handleAnimationAction(obj_id self, dictionary params) throws InterruptedException - { - - String anim = params.getString("anim"); - - if (anim != null) - { - - ai_lib.doAction(self, anim); - } - else - { - - String animMood = params.getString("animMood"); - - if (animMood != null) - { - ai_lib.setMood(self, animMood); - } - } - return SCRIPT_CONTINUE; - } - - - public int handleAddMaster(obj_id self, dictionary params) throws InterruptedException - { - obj_id pet = params.getObjId("pet"); - obj_id controlDevice = params.getObjId("controlDevice"); - - if (!isIdValid(controlDevice)) - { - controlDevice = callable.getCallableCD(pet); - } - - if (!isIdValid(controlDevice)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(pet)) - { - return SCRIPT_CONTINUE; - } - - if ((pet != self)) - { - return SCRIPT_CONTINUE; - } - - obj_id master = params.getObjId("master"); - - if (!isIdValid(master)) - { - return SCRIPT_CONTINUE; - } - - int petType = pet_lib.getPetType(self); - - if (pet_lib.hasMaxPets(master, petType, pet) && callable.hasCallableCD(self)) - { - destroyObject(self); - - return SCRIPT_CONTINUE; - } - if (!hasScript(self, "ai.pet")) - { - setMaster(self, master); - setOwner(utils.getInventoryContainer(self), master); - attachScript(self, "ai.pet"); - setObjVar(pet, "ai.pet.masterName", getEncodedName(master)); - - if (utils.hasScriptVar(self, "petBeingInitialized")) - { - utils.removeScriptVar(self, "petBeingInitialized"); - } - } - - if (!ai_lib.isMonster(self)) - { - pet_lib.setupDefaultCommands(self); - } - - pet_lib.addToPetList(master, self); - - return SCRIPT_CONTINUE; - } - - - public int handleRemoveMaster(obj_id self, dictionary params) throws InterruptedException - { - obj_id pet = params.getObjId("pet"); - - if (pet != self || !isIdValid(pet)) - { - return SCRIPT_CONTINUE; - } - - if (!pet_lib.hasMaster(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id master = getMaster(self); - params.put("master", master); - - final String creatureName = getCreatureName(self); - - if (creatureName != null) - { - params.put("ai.creatureName", creatureName); - } - - obj_id group = getGroupObject(pet); - queueCommand(pet, (1188179258), group, "", COMMAND_PRIORITY_DEFAULT); - - removeObjVar(pet, "ai.pet.masterName"); - - ai_lib.aiStopFollowing(pet); - stop(pet); - - setMaster(pet, null); - setOwner(utils.getInventoryContainer(self), obj_id.NULL_ID); - - removeTriggerVolume(ai_lib.ALERT_VOLUME_NAME); - - removeObjVar(pet, "ai.pet.friendList"); - removeObjVar(pet, "ai.pet.guarding"); - removeObjVar(pet, "ai.inFormation"); - - pet_lib.removeFromPetList(pet); - - if (hasScript(pet, "ai.pet")) - { - detachScript(pet, "ai.pet"); - } - - messageTo(pet, "destroyAbandonedPet", null, 300, true); - - ai_lib.setDefaultCalmBehavior(pet, ai_lib.BEHAVIOR_LOITER); - - if (ai_lib.isMonster(pet)) - { - messageTo(pet, "handleWailingPet", null, 5, false); - } - - return SCRIPT_CONTINUE; - } - - - public int handleWailingPet(obj_id self, dictionary params) throws InterruptedException - { - if (pet_lib.hasMaster(self) || ai_lib.isAiDead(self)) - { - return SCRIPT_CONTINUE; - } - - switch(rand(1,3)) - { - case 1 : - stop(self); - ai_lib.doAction(self, "ashamed"); - break; - case 2 : - stop(self); - ai_lib.doAction(self, "vocalize"); - break; - case 3 : - if (getBehavior(self) <= BEHAVIOR_CALM) - { - doDefaultCalmBehavior(self); - } - break; - } - - messageTo(self, "handleWailingPet", null, 15, false); - - return SCRIPT_CONTINUE; - } - - - public int destroyAbandonedPet(obj_id self, dictionary params) throws InterruptedException - { - if (!pet_lib.hasMaster(self)) - { - destroyObject(self); - } - - return SCRIPT_CONTINUE; - } - - - public boolean crossPortalBreach(obj_id npc, obj_id breacher) throws InterruptedException - { - obj_id myCell = getLocation(npc).cell; - obj_id yourCell = getLocation(breacher).cell; - - if (isIdValid(myCell) == isIdValid(yourCell)) - { - if (!canSee(npc,breacher)) - { - return true; - } - else - { - return false; - } - } - - return true; - } - - - public void manageCrossPortalBreach(obj_id npc, obj_id breacher) throws InterruptedException - { - if (!isPlayer(breacher)) - { - return; - } - - dictionary params = new dictionary(); - params.put("breacher", breacher); - messageTo(npc, "handleMonitorMovement", params, 5, false); - return; - } - - - public int handleMonitorMovement(obj_id self, dictionary params) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::handleMonitorMovement() self("+ self + ")"); - - if (ai_lib.isAiDead(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id breacher = params.getObjId("breacher"); - - if (!isIdValid(breacher) || !exists(breacher) || !isInWorld(breacher)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isAiDead(breacher)) - { - return SCRIPT_CONTINUE; - } - - obj_id[] myContents = getTriggerVolumeContents(self, ai_lib.ALERT_VOLUME_NAME); - - if (utils.getElementPositionInArray(myContents, breacher) == -1) - { - return SCRIPT_CONTINUE; - } - - obj_id myCell = getLocation(self).cell; - obj_id yourCell = getLocation(breacher).cell; - - if (!isIdValid(yourCell)) - { - return SCRIPT_CONTINUE; - } - - if (yourCell != myCell) - { - messageTo(self, "handleMonitorMovement", params, 3, false); - return SCRIPT_CONTINUE; - } - - if (ai_lib.isInCombat(self)) - { - messageTo(self, "handleMonitorMovement", params, 3, false); - return SCRIPT_CONTINUE; - } - - startCombat(self, breacher); - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - if (pet_lib.isPet(self)) - { - return SCRIPT_CONTINUE; - } - - if (beast_lib.isBeast(self)) - { - - return SCRIPT_CONTINUE; - } - - obj_id bldg = getTopMostContainer(destContainer); - - if (isPlayer(bldg)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(destContainer)) - { - return SCRIPT_CONTINUE; - } - - boolean wontEnter = false; - int niche = ai_lib.aiGetNiche(self); - - if (niche == NICHE_VEHICLE) - { - wontEnter = true; - } - - if (!permissionsIsAllowed(destContainer, self)) - { - wontEnter = true; - } - - if (wontEnter) - { - if (ai_lib.isInCombat(self)) - { - removeObjVar(self, "ai.combat.moveMode"); - stop(self); - } - else - { - stop(self); - pathTo(self, aiGetHomeLocation(self)); - messageTo(self, "resumeDefaultCalmBehavior", null, 20, false); - } - - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public boolean fightNotFlee(obj_id npc, obj_id threat) throws InterruptedException - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai::fightNotFlee() npc("+ npc + ") threat("+ threat + ")"); - - if (hasObjVar(threat, "gm")) - { - return false; - } - - if (!ai_lib.isInCombat(npc)) - { - if (factions.isAggro(npc) && factions.getFactionReaction(npc, threat)==factions.REACTION_NEGATIVE) - { - - startCombat(npc, threat); - - return true; - } - - if (pvpIsEnemy(npc, threat) && pvpCanAttack(npc, threat)) - { - - startCombat(npc, threat); - - return true; - } - - if (ai_lib.isMonster(npc) && ai_lib.isMonster(threat) && ai_lib.isAggro(npc)) - { - - startCombat(npc, threat); - - return true; - } - - if ((ai_lib.aiGetNiche(npc) == NICHE_CARNIVORE || ai_lib.aiGetNiche(npc) == NICHE_PREDATOR) && ai_lib.aiGetNiche(threat) == NICHE_HERBIVORE) - { - - startCombat(npc, threat); - - return true; - } - } - - return false; - } - - - public int handleEntertainmentStart(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("entertainer"); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isInCombat(self) || ai_lib.aiIsDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (isInNpcConversation(self)) - { - return SCRIPT_CONTINUE; - } - - if (!ai_lib.isInSameBuilding(self,player)) - { - return SCRIPT_CONTINUE; - } - - if (hasScript (self, "ai.soldier") && !hasObjVar(self, gcw.GCW_ENTERTAINMENT_FLAG)) - { - return SCRIPT_CONTINUE; - } - - if (instance.isInInstanceArea(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, performance.NPC_ENTERTAINMENT_NO_ENTERTAIN)) - { - return SCRIPT_CONTINUE; - } - - int niche = ai_lib.aiGetNiche(self); - - if (niche != NICHE_NPC) - { - return SCRIPT_CONTINUE; - } - - String npcType = getCreatureName(self); - - if (npcType.equals("darth_vader")) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, gcw.GCW_ENTERTAINMENT_FLAG) && !gcw.canEntertainGcwNonPlayingCharacter(player, self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, gcw.GCW_ENTERTAINMENT_FLAG) && utils.hasScriptVar(player, gcw.GCW_SCRIPTVAR_PARENT + ".gcwNpc")) - { - - return SCRIPT_CONTINUE; - } - - String entertainmentType = params.getString("perf_type"); - String skillName = "healing_music_ability"; - - if (entertainmentType != null) - { - if (entertainmentType.equals(performance.PERFORMANCE_TYPE_DANCE)) - { - skillName = "healing_dance_ability"; - } - else if (entertainmentType.equals(performance.PERFORMANCE_TYPE_JUGGLE)) - { - skillName = "healing_juggle_ability"; - } - } - - int skillMod = rand(1,100); - - if (entertainmentType != null) - { - skillMod = getSkillStatisticModifier(player, skillName); - } - - if (skillMod == 0) - { - skillMod = rand(1,100); - } - - if (utils.hasScriptVar(self, "ai.listeningTo")) - { - - int oldSkillMod = utils.getIntScriptVar(self, "ai.oldEntertainerSkillMod"); - - if (skillMod < oldSkillMod) - { - return SCRIPT_CONTINUE; - } - } - - if (hasObjVar(self, "faction_recruit_quest") && groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY)) - { - if (((factions.isImperialorImperialHelper(player) && factions.isImperialorImperialHelper(self)) || (factions.isRebelorRebelHelper(player) && factions.isRebelorRebelHelper(self)))) - { - utils.setScriptVar(self, "faction_ent",player); - - messageTo(self, "readyToTalk", params, 20, false); - - params.put("lostInterestTime", getGameTime()); - utils.setScriptVar(self, "lostInterestTime", getGameTime()); - messageTo(self, "lostInterest", params, 60, false ); - } - else - { - return SCRIPT_CONTINUE; - } - } - - utils.setScriptVar(self, "ai.oldEntertainerSkillMod", skillMod); - - if (!hasObjVar(self, "ai.oldYaw")) - { - setObjVar(self, "ai.oldYaw", getYaw(self)); - } - - utils.setScriptVar(self, "ai.listeningTo", player); - faceToBehavior(self, player); - - if (skillMod < 20) - { - if (rand(1,2)==1) - { - setAnimationMood(self, "npc_sad"); - } - else - { - setAnimationMood(self, "bored"); - } - } - - if (skillMod < 50) - { - if (rand(1,2)==1) - { - setAnimationMood(self, "bored"); - } - else - { - setAnimationMood(self, "entertained"); - } - } - else - { - setAnimationMood(self, "entertained"); - } - - listenToMessage(player, "handlePerformerStopPerforming"); - messageTo(self, "handleNoEntertainment", null, 30, false); - - if (hasObjVar(self, gcw.GCW_ENTERTAINMENT_FLAG)) - { - gcw.setEntertainGcwNonPlayerCharacter(player, self); - } - - return SCRIPT_CONTINUE; - } - - - public int handleNoEntertainment(obj_id self, dictionary params) throws InterruptedException - { - boolean stopListening = false; - - if (!utils.hasScriptVar(self, "ai.listeningTo")) - { - return SCRIPT_CONTINUE; - } - - obj_id player = utils.getObjIdScriptVar(self, "ai.listeningTo"); - - if (!isIdValid(player)) - { - stopListening = true; - } - else if (!exists(player) || !isInWorld(player) || !ai_lib.isInSameBuilding(self,player) || getPerformanceType(player) == 0) - { - stopListening = true; - } - - if (stopListening) - { - - utils.removeScriptVar(self, "ai.oldEntertainerSkillMod"); - utils.removeScriptVar(self, "ai.listeningTo"); - stop(self); - messageTo(self, "resumeDefaultCalmBehavior", null, 0, false); - } - else - { - - messageTo(self, "handleNoEntertainment", null, 30, false); - } - - return SCRIPT_CONTINUE; - } - - - public int handlePerformerStopPerforming(obj_id self, dictionary params) throws InterruptedException - { - - utils.notifyObject(self, "handleEntertainmentStop", params); - - return SCRIPT_CONTINUE; - } - - - public int handleEntertainmentStop(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = obj_id.NULL_ID; - if (params.containsKey("entertainer")) - { - player = params.getObjId("entertainer"); - } - else if (params.containsKey("performer")) - { - player = params.getObjId("performer"); - } - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id entertainer = utils.getObjIdScriptVar(self, "ai.listeningTo"); - - if (entertainer != player) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.aiIsDead(self) || ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - setAnimationMood(self, "calm"); - - int skillMod = utils.getIntScriptVar(self, "ai.oldEntertainerSkillMod"); - - if (skillMod == 0) - { - skillMod = rand(1,100); - } - if (skillMod < 20) - { - switch (rand(1,4)) - { - case 1 : - doAnimationAction(self, "hold_nose"); - break; - case 2 : - doAnimationAction(self, "cover_ears_mocking"); - break; - case 3 : - doAnimationAction(self, "point_away"); - break; - case 4 : - doAnimationAction(self, "shake_head_no"); - break; - } - } - else if (skillMod < 40) - { - switch (rand(1,4)) - { - case 1 : - doAnimationAction(self, "shake_head_no"); - break; - case 2 : - doAnimationAction(self, "applause_polite"); - break; - case 3 : - doAnimationAction(self, "yes"); - break; - case 4 : - doAnimationAction(self, "snap_finger1"); - break; - } - } - else if (skillMod < 60) - { - switch(rand(1,4)) - { - case 1 : - doAnimationAction(self, "snap_finger1"); - break; - case 2 : - doAnimationAction(self, "applause_polite"); - break; - case 3 : - doAnimationAction(self, "yes"); - break; - case 4 : - doAnimationAction(self, "applause_excited"); - break; - } - } - else - { - switch (rand(1,3)) - { - case 1 : - doAnimationAction(self, "applause_excited"); - break; - case 2 : - doAnimationAction(self, "clap_rousing"); - break; - case 3 : - doAnimationAction(self, "implore"); - break; - case 4 : - doAnimationAction(self, "applause_polite"); - break; - } - } - - utils.removeScriptVar(self, "ai.oldEntertainerSkillMod"); - utils.removeScriptVar(self, "ai.listeningTo"); - stop(self); - messageTo(self, "resumeDefaultCalmBehavior", null, 5, false); - - if (hasObjVar(self, gcw.GCW_ENTERTAINMENT_FLAG) && utils.hasScriptVar(self, gcw.GCW_SCRIPTVAR_PARENT + ".isGcwEntertained")) - { - LOG("gcw_entertainer","NPC is saving time player stopped entertaining"); - utils.setScriptVar(self, gcw.GCW_STOPPED_ENTERTAINING, getGameTime()); - if (hasObjVar(self, gcw.GCW_PATROL_OBJ)) - { - obj_id patrolObject = getObjIdObjVar(self, gcw.GCW_PATROL_OBJ); - if (isValidId(patrolObject)) - { - dictionary webster = new dictionary(); - webster.put("npc",self); - webster.put("player",player); - messageTo(patrolObject, "handleOffensiveEntertainedNpcCleanUp", webster, 1, false); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnEnteredCombat(obj_id self) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int OnChangedPosture(obj_id self, int before, int after) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - public int dizzyCheckFailed(obj_id self, dictionary params) throws InterruptedException - { - ai_lib.aiSetPosture(self, POSTURE_KNOCKED_DOWN); - return SCRIPT_CONTINUE; - } - - - public int applyModTrap(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, "trapmod.enable")) - { - return SCRIPT_CONTINUE; - } - - java.util.Enumeration keys = params.keys(); - - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)keys.nextElement(); - int mod = params.getInt(key); - - if (!key.equals("prefix")) - { - utils.setScriptVar(self, "trapmod."+key, mod); - } - } - - utils.setScriptVar(self, "trapmod.enable", 1); - - messageTo(self, "removeModTrap", params, 60.f, false); - - String prefix = params.getString("prefix"); - showFlyText(self, new string_id("trap/trap", prefix+"_on"), 1.2f, colors.ORANGERED); - - obj_id[] players = getPlayerCreaturesInRange(self, 50.f); - - for (int i=0; i getLocation(self) == null. WTF?!"); - return SCRIPT_CONTINUE; - } - - if (isIdValid(here.cell)) - { - return SCRIPT_CONTINUE; - } - - obj_id myContainer = getContainedBy(self); - - if (!isIdValid(myContainer)) - { - return SCRIPT_CONTINUE; - } - - destroyObject(self); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - obj_id group = getGroupObject(self); - - if (isIdValid(group)) - { - queueCommand(self, (1188179258), group, "", COMMAND_PRIORITY_DEFAULT); - } - - return SCRIPT_CONTINUE; - } - - - public int forceAnimalAttack(obj_id self, dictionary params) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::forceAnimalAttack() self("+ self + ")"); - - if (ai_lib.aiIsDead(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id target = params.getObjId("target"); - if (!isIdValid(target)) - { - return SCRIPT_CONTINUE; - } - - if (!pvpCanAttack(self, target)) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, "ai.combat.isTaunted", (getGameTime() + 20)); - - if (ai_lib.isInCombat(self)) - { - removeObjVar(self, "ai.combat.moveMode"); - stop(self); - setLookAtTarget(self, target); - } - else - { - - startCombat(self, target); - } - - return SCRIPT_CONTINUE; - } - - - public int attemptMilkHandler(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId("player"); - - attemptMilk(player, self); - - return SCRIPT_CONTINUE; - } - - - public void attemptMilk(obj_id player, obj_id self) throws InterruptedException - { - - obj_id playerCurrentMount = getMountId (player); - obj_id pInv = utils.getInventoryContainer(player); - if (!isValidId(pInv) || !exists(pInv)) - { - return; - } - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessage(self, SID_CANT_MILK_INV_FULL); - return; - } - - if (isIdValid(playerCurrentMount)) - { - sendSystemMessage(player, SID_CANT_MILK_MOUNTED); - return; - } - - if (utils.hasScriptVar(self, "milk.attempts")) - { - sendSystemMessage(player, SID_BEING_MILKED); - return; - } - - if (pet_lib.isPet(self) || beast_lib.isBeast(self)) - { - showFlyText(self, new string_id("npc_reaction/flytext", "threaten"), 2.0f, colors.ORANGERED); - sendSystemMessage(player, SID_CANT_MILK); - return; - } - - if (stealth.hasInvisibleBuff(player)) - { - showFlyText(self, new string_id("npc_reaction/flytext", "threaten"), 2.0f, colors.ORANGERED); - sendSystemMessage(player, SID_MILK_NOT_HIDDEN); - return; - } - - if (utils.hasScriptVar(self, "milk.lasttime")) - { - int milktime = utils.getIntScriptVar(self, "milk.lasttime"); - - if (getGameTime() - milktime < 3600) - { - showFlyText(self, new string_id("npc_reaction/flytext", "threaten"), 2.0f, colors.ORANGERED); - sendSystemMessage(player, SID_CANT_MILK); - return; - } - } - - float milkStunModified = 0.0f; - - if (buff.hasBuff(player, "creature_milking_buff") || buff.hasBuff(player, "drink_starshine_surprise")) - { - milkStunModified += ((float)getEnhancedSkillStatisticModifierUncapped(player, "milk_stun_modified")); - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" has a buff that gives a stun chance of: "+milkStunModified+"."); - } - - if (milkStunModified > 0) - { - int randStunRoll = rand(1, 100); - if (randStunRoll < milkStunModified) - { - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" has successfully stunned creature "+self+". The creature will stand still for a few seconds."); - - messageTo(self, "milkingCreatureStunned", null, 0, false); - messageTo(self, "milkingCreatureStunRemoval", null, 4, false); - } - else - { - messageTo(self, "milkingCreatureStunFail", null, 0, false); - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" failed to stun the creature."); - } - } - - showFlyText(self, new string_id("npc_reaction/flytext", "alert"), 2.0f, colors.MEDIUMSLATEBLUE); - - sendSystemMessage(player, SID_MILK_BEGIN); - - utils.setScriptVar(self, "milk.attempts", 0); - dictionary params = new dictionary(); - params.put("player", player); - messageTo(self, "handleMilking", params, 7, false); - } - - - public int handleMilking(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (isDead(self)) - { - sendSystemMessage(player, SID_CANT_MILK_THE_DEAD); - return SCRIPT_CONTINUE; - } - if (params == null) - { - return SCRIPT_CONTINUE; - } - - obj_id playerCurrentMount = getMountId (player); - - if (isIdValid(playerCurrentMount)) - { - sendSystemMessage(player, SID_CANT_MILK_MOUNTED); - return SCRIPT_CONTINUE; - } - - float dist = getDistance(self, player); - - if ((dist < -3) || (dist > 3)) - { - showFlyText(self, new string_id("npc_reaction/flytext", "threaten"), 2.0f, colors.ORANGERED); - sendSystemMessage(player, SID_MILK_TOO_FAR); - utils.removeScriptVar(self, "milk.attempts"); - return SCRIPT_CONTINUE; - } - if (stealth.hasInvisibleBuff(player) || ai_lib.isInCombat(self) || ai_lib.isInCombat(player)) - { - showFlyText(self, new string_id("npc_reaction/flytext", "threaten"), 2.0f, colors.ORANGERED); - sendSystemMessage(player, SID_MILK_NOT_HIDDEN); - utils.removeScriptVar(self, "milk.attempts"); - return SCRIPT_CONTINUE; - } - - int attempts = utils.getIntScriptVar(self, "milk.attempts"); - attempts++; - utils.setScriptVar(self, "milk.attempts", attempts); - - boolean shortenAttempts = false; - float milkQuantityModified = 0.0f; - float milkExceptionalModified = 0.0f; - float milkStunModified = 0.0f; - - if (buff.hasBuff(player, "creature_milking_buff") || buff.hasBuff(player, "drink_starshine_surprise")) - { - if (buff.hasBuff(player, "creature_milking_buff")) - { - CustomerServiceLog("buff", "creature_milking_buff Buff used by player: "+player+" Name: "+getName(player)+ " has creature_milking_buff "); - } - else if (buff.hasBuff(player, "drink_starshine_surprise")) - { - CustomerServiceLog("buff", "creature_milking_buff Buff used by player: "+player+" Name: "+getName(player)+ " has drink_starshine_surprise buff "); - } - - milkExceptionalModified += ((float)getEnhancedSkillStatisticModifierUncapped(player, "milk_exceptional_modified")); - CustomerServiceLog("buff", "creature_milking_buff Buff used by player: "+player+" Name: "+getName(player)+ " has a exceptional milk modifier of: "+milkExceptionalModified); - milkQuantityModified += ((float)getEnhancedSkillStatisticModifierUncapped(player, "milk_quantity_modified")); - CustomerServiceLog("buff", "creature_milking_buff Buff used by player: "+player+" Name: "+getName(player)+ " has a milk quantity modifier of: "+milkQuantityModified); - shortenAttempts = true; - } - - if (attempts == 3 || shortenAttempts) - { - - obj_id pInv = utils.getInventoryContainer(player); - if (!isValidId(pInv) || !exists(pInv)) - { - return SCRIPT_CONTINUE; - } - - else if (getVolumeFree(pInv) <= 0) - { - sendSystemMessage(self, SID_CANT_MILK_INV_FULL); - return SCRIPT_CONTINUE; - } - - int lev = ai_lib.getLevel(self); - if (lev > 50) - { - lev = 50; - } - int mlev = lev/2; - if (mlev < 1) - { - mlev = 1; - } - int amt = rand(mlev*10, lev*10); - - if (shortenAttempts && milkQuantityModified > 0) - { - amt = amt + (int)(amt * milkQuantityModified); - } - - String resourceType = ai_lib.getMilkType(self); - if (resourceType == null || resourceType.equals("")) - { - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" attempted to milk but could not retrieve a valid milk type on "+ self + " "+getName(self)); - blog("ai.handleMilking: cannot get resource type from ai_lib.getMilkType"); - return SCRIPT_CONTINUE; - } - String sceneName = getCurrentSceneName(); - if (sceneName == null || sceneName.equals("")) - { - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" attempted to milk but could not retrieve a valid scene name (planet name) while milking "+ self + " "+getName(self)); - blog("ai.handleMilking: cannot get scene name"); - return SCRIPT_CONTINUE; - } - - String rsrcMapTable = "datatables/creature_resource/resource_scene_map.iff"; - if (rsrcMapTable == null || rsrcMapTable.equals("")) - { - blog("ai.handleMilking: cannot get resource map table data"); - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" attempted to milk but could not retrieve resource map table data to receive the milk resources while milking "+ self + " "+getName(self)); - return SCRIPT_CONTINUE; - } - - String correctedPlanetName = dataTableGetString(rsrcMapTable, sceneName, 1); - if (correctedPlanetName == null || correctedPlanetName.equals("")) - { - correctedPlanetName = "tatooine"; - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" attempted to milk but received an invlaid Planet Name. As a result the milk resource planet attrib has been defaulted to TATOOINE."); - } - - resourceType = resourceType + "_"+ correctedPlanetName; - - int useDistMap = dataTableGetInt(rsrcMapTable, sceneName, "useDistributionMap"); - if (useDistMap < 0) - { - blog("ai.handleMilking: cannot get int data from distribution data table"); - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" attempted to milk but could not retrieve resource distribution data while milking "+ self + " "+getName(self)); - return SCRIPT_CONTINUE; - } - location worldLoc = getWorldLocation(self); - if (worldLoc == null) - { - blog("ai.handleMilking: cannot get world location from cpp"); - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" attempted to milk but could not retrieve world location while milking "+ self + " "+getName(self)); - return SCRIPT_CONTINUE; - } - if (useDistMap == 0) - { - worldLoc.area = correctedPlanetName; - } - - obj_id[] resourceList = resource.createRandom(resourceType, amt, worldLoc, pInv, player, 2); - if (resourceList == null) - { - blog("ai.handleMilking: cannot get resource data from resource.createRandom function"); - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" attempted to milk but could not resource data from resource.createRandom function while milking "+ self + " "+getName(self)); - return SCRIPT_CONTINUE; - } - - location curloc = getLocation(player); - if (curloc == null) - { - blog("ai.handleMilking: cannot get resource data from getLocation cpp"); - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" attempted to milk but could not retrieve location data while milking "+ self + " "+getName(self)); - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < resourceList.length; i++) - { - testAbortScript(); - - blog(""+resourceList[i]); - setLocation(resourceList[i], curloc); - putIn(resourceList[i], pInv, player); - } - - sendSystemMessage(player, SID_MILK_SUCCESS); - utils.setScriptVar(self, "milk.lasttime", getGameTime()); - utils.removeScriptVar(self, "milk.attempts"); - - if (!collection.collectionResource(player, "milk", (int)milkExceptionalModified)) - { - blog("ai.handleMilking: cannot get resource data from getLocation cpp"); - CustomerServiceLog("milking_and_lair_search", "handleMilking: Player: "+getName(player)+" OID: "+player+" did not receive an exceptional milk from creature "+ self + " "+getName(self)+". Check the collection logs for additional details."); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - else - { - sendSystemMessage(player, SID_MILK_CONTINUE); - } - - messageTo(self, "handleMilking", params, 7, false); - - return SCRIPT_CONTINUE; - } - - - public int handleSpawnParameters(obj_id self, dictionary params) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::handleSpawnParameters() self("+ self + ")"); - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - int actionCode = params.getInt("actionCode"); - obj_id target = params.getObjId("actionTarget"); - - switch (actionCode) - { - case gcw.AC_ATTACK: - if (isIdValid(target)) - { - startCombat(self, target); - } - break; - - case gcw.AC_SCAN: - int scanInterests = params.getInt("scanInterests"); - - if (scanInterests == 0) - { - gcw.assignScanInterests(self); - } - else - { - utils.setScriptVar(self, gcw.SCRIPTVAR_SCAN_INTEREST, scanInterests); - } - - gcw.harass(self, target); - break; - - default: - break; - } - - return SCRIPT_CONTINUE; - } - - - public int playDelayedClientEffect(obj_id self, dictionary params) throws InterruptedException - { - String clientEffect = params.getString("effect"); - obj_id target = params.getObjId("target"); - - playClientEffectObj(target, clientEffect, target, ""); - - return SCRIPT_CONTINUE; - } - - - public int clearScriptVar(obj_id self, dictionary params) throws InterruptedException - { - String scriptVarName = params.getString("name"); - - utils.removeScriptVar(self, scriptVarName); - - return SCRIPT_CONTINUE; - } - - - public int OnInvulnerableChanged(obj_id self, boolean invulnerable) throws InterruptedException - { - LOGC(aiLoggingEnabled(self), "debug_ai", "ai::OnInvulnerableChanged() self("+ self + ") invulerable("+ invulnerable + ")"); - - if (invulnerable) - { - removeTriggerVolume(ai_lib.ALERT_VOLUME_NAME); - removeTriggerVolume(ai_lib.AGGRO_VOLUME_NAME); - } - else - { - ai_lib.resetCombatTriggerVolumes(); - } - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitateTarget(obj_id self, obj_id victim) throws InterruptedException - { - if (!utils.hasScriptVar(self,"experienced")) - { - if (isIdValid(victim)) - { - if (isPlayer(victim)) - { - if (rand(1,1000)==999) - { - ai_lib.creatureLevelUp(self, victim); - utils.setScriptVar(self,"experienced",1); - } - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int clearCollectionCameraParticle(obj_id self, dictionary params) throws InterruptedException - { - - obj_id target = params.getObjId("target"); - - stopClientEffectObjByLabel(target, "root_buff"); - utils.removeScriptVar(target, "picture_taken_debuff"); - return SCRIPT_CONTINUE; - } - - - public int OnGiveItem(obj_id self, obj_id item, obj_id giver) throws InterruptedException - { - if (!hasCompletedCollectionSlot(giver, "meatlump_recruiter_starter")) - { - return SCRIPT_CONTINUE; - } - if (!isIdValid(giver) || !exists(giver)) - { - return SCRIPT_CONTINUE; - } - if (!isIdValid(item) || !exists(item)) - { - return SCRIPT_CONTINUE; - } - - String itemName = getStaticItemName(item); - if (!itemName.equals("col_meatlump_recruit_manual_02_01")) - { - return SCRIPT_CONTINUE; - } - - String mobName = getCreatureName(self); - String socialMeatlump = dataTableGetString(CREATURE_TABLE, mobName, "socialGroup"); - - if (socialMeatlump.startsWith("meatlump") || socialMeatlump.endsWith("meatlump")) - { - if (!ai_lib.isNpc(self)) - { - return SCRIPT_CONTINUE; - } - else - { - sendSystemMessage(giver, SID_ALREADY_RECRUITED); - } - return SCRIPT_CONTINUE; - } - if (toLower(socialMeatlump).equals("rebel") || toLower(socialMeatlump).equals("rebel")) - { - if (!ai_lib.isNpc(self)) - { - return SCRIPT_CONTINUE; - } - else - { - sendSystemMessage(giver, SID_NO_RECRUIT_REB_IMP); - } - return SCRIPT_CONTINUE; - } - - if (hasCompletedCollection(giver, "col_meatlump_recruiter_01")) - { - return SCRIPT_CONTINUE; - } - if (utils.hasScriptVar(self, "collection.recruited")) - { - sendSystemMessage(giver, SID_ALREADY_RECRUITED); - return SCRIPT_CONTINUE; - } - if (utils.hasScriptVar(self, "collection.investigator")) - { - sendSystemMessage(giver, SID_ENEMY_RECRUIT); - return SCRIPT_CONTINUE; - } - - if (!ai_lib.isNpc(self)) - { - return SCRIPT_CONTINUE; - } - - if (!isInvulnerable(self)) - { - return SCRIPT_CONTINUE; - } - - int attackRoll = rand(1,100); - if (attackRoll <= 10) - { - chat.chat(self, SID_NPC_MEATLUMP_SPEAK); - - float searchSize = 12.0f; - - obj_id mob = null; - - int mobLevel = getLevel(giver) -2; - - location currentLoc = getLocation(giver); - - location locGoodLocation = locations.getGoodLocationAroundLocationAvoidCollidables(currentLoc, searchSize, searchSize, searchSize, searchSize, false, false, 6.0f); - if (locGoodLocation == null) - { - locGoodLocation = (location)currentLoc.clone(); - } - - int mobCount = rand(1, 3); - - if (utils.isProfession(giver, utils.TRADER)) - { - - mobCount = 2; - } - - if (mobCount == 1) - { - mob = create.object("mtp_recruiter_corsec_detective", locGoodLocation, mobLevel); - } - if (mobCount == 2) - { - mob = create.object("mtp_recruiter_corsec_investigator", locGoodLocation, mobLevel); - } - if (mobCount == 3) - { - mob = create.object("mtp_recruiter_corsec_agent", locGoodLocation, mobLevel); - } - addHate(mob, giver, 1000.0f); - - utils.setScriptVar(self, "collection.investigator", 1); - messageTo(self, "removeMeatlumpInvestigatorScriptVar", null, 82800, false); - } - else - { - - sendSystemMessage(giver, SID_GAVE_RECRUIT_ITEM); - - int count = getCount(item); - count--; - - if (count <= 0) - { - - detachScript(item, "item.special.nodestroy"); - destroyObject(item); - } - else - { - setCount(item, count); - } - - modifyCollectionSlotValue(giver, "meatlump_recruiter_01", 1); - - utils.setScriptVar(self, "collection.recruited", 1); - messageTo(self, "removeMeatlumpRecruitmentScriptVar", null, 82800, false); - } - - return SCRIPT_CONTINUE; - } - - - public int removeMeatlumpRecruitmentScriptVar(obj_id self, dictionary params) throws InterruptedException - { - if (utils.hasScriptVar(self, "collection.recruited")) - { - utils.removeScriptVar(self, "collection.recruited"); - } - return SCRIPT_CONTINUE; - } - - - public int removeMeatlumpInvestigatorScriptVar(obj_id self, dictionary params) throws InterruptedException - { - if (utils.hasScriptVar(self, "collection.investigator")) - { - utils.removeScriptVar(self, "collection.investigator"); - } - return SCRIPT_CONTINUE; - } - - - public int milkingCreatureStunned(obj_id self, dictionary params) throws InterruptedException - { - showFlyText(self, new string_id("npc_reaction/flytext", "stun"), 2.0f, colors.ORANGERED); - - ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); - return SCRIPT_CONTINUE; - } - - - public int milkingCreatureStunFail(obj_id self, dictionary params) throws InterruptedException - { - showFlyText(self, new string_id("npc_reaction/flytext", "stun_fail"), 2.0f, colors.ORANGERED); - return SCRIPT_CONTINUE; - } - - - public int milkingCreatureStunRemoval(obj_id self, dictionary params) throws InterruptedException - { - showFlyText(self, new string_id("npc_reaction/flytext", "stun_expired"), 2.0f, colors.ORANGERED); - ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_LOITER); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/ai/ai_combat_target.java b/sku.0/sys.server/compiled/game/script/ai/ai_combat_target.java deleted file mode 100644 index 8607a7cff..000000000 --- a/sku.0/sys.server/compiled/game/script/ai/ai_combat_target.java +++ /dev/null @@ -1,127 +0,0 @@ -package script.ai; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.buff; -import script.library.pet_lib; -import script.library.target_dummy; -import script.library.utils; - - -public class ai_combat_target extends script.base_script -{ - public ai_combat_target() - { - } - - public static void clearTargetList() throws InterruptedException - { - final obj_id self = getSelf(); - - utils.removeScriptVarTree(self, "ai.combat.targetSocialGroup.verified"); - } - - - public static boolean isValidTarget(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - boolean result = true; - final obj_id self = getSelf(); - deltadictionary dict = self.getScriptVars(); - final String targetSocialGroupVerified = "ai.combat.targetSocialGroup.verified."+ target; - - if (!pvpCanAttack(self, target)) - { - - LOGC(aiLoggingEnabled(self), "debug_ai", "ai_combat_target::isValidTarget() self("+ self + ":"+ getName(self) + ") target("+ target + ":"+ getName(target) + ") CAN'T ATTACK THIS TARGET"); - result = false; - } - else if (isGameObjectTypeOf(getTopMostContainer(target), GOT_building_player) && !target_dummy.isTargetDummy(target)) - { - - LOGC(aiLoggingEnabled(self), "debug_ai", "ai_combat_target::isValidTarget() self("+ self + ":"+ getName(self) + ") target("+ target + ":"+ getName(target) + ") NOT ALLOWED IN STRUCTURE"); - result = false; - } - else if (dict.getBoolean(targetSocialGroupVerified) == false) - { - final String selfSocialGroup = ai_lib.getSocialGroup(self); - - if (selfSocialGroup != null && ai_lib.isMob(target)) - { - if (!isIdValid(getMaster(self)) && !isIdValid(getMaster(target)) && selfSocialGroup.equals(ai_lib.getSocialGroup(target))) - { - - LOGC(aiLoggingEnabled(self), "debug_ai", "ai_combat_target::isValidTarget() self("+ self + ":"+ getName(self) + ") target("+ target + ":"+ getName(target) + ") SAME SOCIAL GROUP"); - result = false; - } - else - { - - dict.put(targetSocialGroupVerified, true); - } - } - } - - String evasionObjVarName = "me_evasion."+ target; - - if (utils.hasScriptVar(self, evasionObjVarName) && buff.hasBuff(target, "me_evasion_1")) - { - obj_id[] thoseWhoHateMe = getHateList(self); - - if (thoseWhoHateMe.length < 2) - { - - return true; - } - - return false; - } - - if (hasObjVar(target, "ai.combat.limitAttackers") && !isPlayer(target) && !pet_lib.hasMaster(target)) - { - int attackers = getIntObjVar(target, "ai.combat.limitAttackers"); - - obj_id[] haters = getHateList(target); - - if (haters.length >= attackers) - { - int npcCount = 0; - - for (int i = 0, j = haters.length; i < j; i++) - { - testAbortScript(); - - if (isIdValid(haters[i]) && !isPlayer(haters[i]) && !pet_lib.hasMaster(haters[i])) - { - npcCount++; - } - - if (npcCount > attackers) - { - stopCombat(self); - - return false; - } - - if (isIdValid(haters[i]) && haters[i] == self) - { - return true; - } - } - } - } - - return result; - } -} diff --git a/sku.0/sys.server/compiled/game/script/ai/bark_string_on_initialize.java b/sku.0/sys.server/compiled/game/script/ai/bark_string_on_initialize.java deleted file mode 100644 index f50d35365..000000000 --- a/sku.0/sys.server/compiled/game/script/ai/bark_string_on_initialize.java +++ /dev/null @@ -1,66 +0,0 @@ -package script.ai; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.chat; - - -public class bark_string_on_initialize extends script.base_script -{ - public bark_string_on_initialize() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "barkString", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public int barkString(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, "bark_string_file") || !hasObjVar(self, "bark_string_id")) - { - if (!hasObjVar(self, "alreadyTriedBarking")) - { - setObjVar(self, "alreadyTriedBarking", 1); - } - else - { - - if (getIntObjVar(self, "alreadyTriedBarking") > 2) - { - return SCRIPT_CONTINUE; - } - - } - - messageTo(self, "barkString", null, 1, false); - return SCRIPT_CONTINUE; - } - - String stringFile = getStringObjVar(self, "bark_string_file"); - if (stringFile == null || stringFile.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String stringId = getStringObjVar(self, "bark_string_id"); - if (stringId == null || stringId.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - string_id message = new string_id(stringFile, stringId); - chat.chat(self, message); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/ai/creature_combat.java b/sku.0/sys.server/compiled/game/script/ai/creature_combat.java deleted file mode 100644 index b71b9f6d3..000000000 --- a/sku.0/sys.server/compiled/game/script/ai/creature_combat.java +++ /dev/null @@ -1,1575 +0,0 @@ -package script.ai; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.ai.ai_aggro; -import script.ai.ai_combat; -import script.ai.ai_combat_assist; -import script.ai.ai_combat_damage; -import script.ai.ai_combat_movement; -import script.ai.ai_combat_target; -import script.library.ai_lib; -import script.library.beast_lib; -import script.library.buff; -import script.library.colors; -import script.library.combat; -import script.library.combat_consts; -import script.library.factions; -import script.library.instance; -import script.library.movement; -import script.library.pclib; -import script.library.pet_lib; -import script.library.posture; -import script.library.scout; -import script.library.stealth; -import script.library.storyteller; -import script.library.trial; -import script.library.utils; -import script.library.xp; -import script.library.stealth; - - - -public class creature_combat extends script.systems.combat.combat_base -{ - public creature_combat() - { - } - public static final float MIN_MOVEMENT_DURING_COMBAT = 0.015f; - public static final float MAX_MOVEMENT_DURING_COMBAT = 0.05f; - - public static final float TOO_CLOSE_DISTANCE = 3f; - - - public void clog(String text) throws InterruptedException - { - if (text != null) - { - LOGC(aiLoggingEnabled(getSelf()), "debug_ai", "creature_combat::"+ text); - } - } - - - public int OnEnteredCombat(obj_id self) throws InterruptedException - { - - clog("OnEnteredCombat() ----- unit("+ self + ":"+ getName(self) + ")"); - - clearCombatActions(); - if (!stealth.isDecoy(self)) - { - aiEquipPrimaryWeapon(self); - } - - removeTriggerVolume(ai_lib.ALERT_VOLUME_NAME); - removeTriggerVolume(ai_lib.AGGRO_VOLUME_NAME); - - ai_combat_movement.aiClearMoveMode(); - setMovementRun(self); - - deltadictionary dict = self.getScriptVars(); - dict.put("ai.combat.cover.foundTarget", isPlayer(getHateTarget(self)) ? false : true); - - if (ai_combat_assist.isWaiting()) - { - ai_combat_movement.aiIdle(); - } - else - { - obj_id target = getHateTarget(self); - boolean targetCovered = stealth.hasInvisibleBuff(target); - boolean targetProne = posture.isProne(target); - - if (targetCovered || targetProne) - { - showFlyText(self, new string_id("npc_reaction/flytext", "alert"), 2.0f, colors.STEELBLUE); - } - - utils.setScriptVar(self, "creature_combat.lastCombatFrame", getGameTime()); - - if (ai_combat_assist.canCallForAssist()) - { - ai_combat_assist.callForAssist(); - } - - if (beast_lib.isBeast(self) && getState(self, STATE_COVER) == 1) - { - stealth.makeCreatureVisible(self); - } - - doCombatFrame(); - } - - messageTo(self, "checkForBeastSpecialsTakeOne", null, 1.0f, false); - - setRegenRate(self, HEALTH, 0); - - if (!beast_lib.isBeast(self)) - { - setRegenRate(self, ACTION, 20); - } - else - { - - setRegenRate(self, ACTION, 4); - } - - if (combat.isPersistCombatMode(self)) - { - messageTo(self, "persist_combat", trial.getSessionDict(self, combat.PERSIST_COMBAT), 5.0f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - LOG("get_participants", "OnExitedCombat init"); - - clog("OnExitedCombat() ----- unit("+ self + ":"+ getName(self) + ")"); - - ai_combat_target.clearTargetList(); - ai_combat_damage.clearAttackerList(); - ai_combat_movement.aiClearMoveMode(); - ai_combat_assist.clearNoAssistCall(); - setLookAtTarget(self, null); - - utils.removeScriptVarTree(self, "me_evasion"); - - if (!beast_lib.isBeast(self)) - { - ai_lib.resetCombatTriggerVolumes(); - - float healthRegenMod = hasObjVar(self, "regen_mod.health") ? getFloatObjVar(self, "regen_mod.health") : 1.0f; - float actionRegenMod = hasObjVar(self, "regen_mod.action") ? getFloatObjVar(self, "regen_mod.action") : 1.0f; - - float healthRegen = (getMaxAttrib(self, HEALTH) / 10.0f) * healthRegenMod; - float actionRegen = (getMaxAttrib(self, ACTION) / 10.0f) * actionRegenMod; - - setRegenRate(self, HEALTH, (int)healthRegen); - setRegenRate(self, ACTION, (int)actionRegen); - } - else - { - setRegenRate(self, HEALTH, 150); - setRegenRate(self, ACTION, 10); - - if (stealth.canBeastStealth(self)) - { - stealth.makeBeastInvisible(getMaster(self), "appearance/pt_smoke_puff.prt"); - } - } - - if (!ai_lib.isAiDead(self)) - { - if (posture.isKnockedDown(self)) - { - queueCommand(self, (-1322133240), self, "", COMMAND_PRIORITY_DEFAULT); - } - else if (!posture.isStanding(self)) - { - posture.stand(self); - } - - if (!beast_lib.isBeast(self)) - { - if (pet_lib.isPet(self)) - { - messageTo(self, "postCombatPathHome", null, 1, false); - } - else - { - aiTether(self); - } - } - } - - bumpSession(self); - trial.bumpSession(self, combat.PERSIST_COMBAT); - - return SCRIPT_CONTINUE; - } - - - public int OnAiTetherStart(obj_id self) throws InterruptedException - { - - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - ai_lib.setMood(self, ai_lib.MOOD_CALM); - ai_lib.clearCombatData(); - xp.cleanupCreditForKills(); - - return SCRIPT_CONTINUE; - } - - - public int OnAiTetherComplete(obj_id self) throws InterruptedException - { - clog("ai::OnAiTetherComplete() --- BEGIN --- self("+ self + ":"+ getName(self) + ")"); - - ai_lib.resetAi(); - - clog("ai::OnAiTetherComplete() --- END --- self("+ self + ":"+ getName(self) + ")"); - - return SCRIPT_CONTINUE; - } - - - public int OnHateTargetChanged(obj_id self, obj_id target) throws InterruptedException - { - clog("OnHateTargetChanged() self("+ self + ":"+ getName(self) + ") target("+ target + ")"); - - setLookAtTarget(self, target); - - if (ai_lib.isInCombat(self)) - { - ai_combat_assist.clearAssist(); - } - - if (pet_lib.isPet(self) && utils.hasScriptVar(self, "ai.combat.target")) - { - obj_id combatTarget = utils.getObjIdScriptVar(self, "ai.combat.target"); - - if (target != combatTarget) - { - float maxHate = getMaxHate(self); - setHate(self, combatTarget, maxHate + 5000); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnHateTargetAdded(obj_id self, obj_id target) throws InterruptedException - { - clog("creature_combat::OnHateTargetAdded() self("+ self + ":"+ getName(self) + ") target("+ target + ")"); - - return SCRIPT_CONTINUE; - } - - - public int OnHateTargetRemoved(obj_id self, obj_id target) throws InterruptedException - { - clog("creature_combat::OnHateTargetRemoved() self("+ self + ":"+ getName(self) + ") target("+ target + ")"); - - if (!isIdValid(target) || !exists(target)) - { - return SCRIPT_CONTINUE; - } - - final int factionStatus = factions.getFactionStatus(self, target); - - if (factionStatus == factions.STATUS_FRIEND || (factionStatus == factions.STATUS_NEUTRAL && !aiIsAggressive(self))) - { - - if (hasScript(self, "systems.missions.dynamic.mission_bounty_target")) - { - obj_id objHunter = getObjIdObjVar(self, "objHunter"); - - if (!isIdValid(objHunter) || (objHunter != target)) - { - pvpRemovePersonalEnemyFlags(self, target); - } - } - else - { - pvpRemovePersonalEnemyFlags(self, target); - } - } - - if (pet_lib.isPet(self) && utils.hasScriptVar(self, "ai.combat.target")) - { - obj_id combatTarget = utils.getObjIdScriptVar(self, "ai.combat.target"); - - if (target == combatTarget) - { - utils.removeScriptVar(self, "ai.combat.target"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnAiPrimaryWeaponEquipped(obj_id self, obj_id primaryWeapon) throws InterruptedException - { - clog("OnAiPrimaryWeaponEquipped() ai("+ self + ") primaryWeapon("+ primaryWeapon + ")"); - clearCombatActions(); - - return SCRIPT_CONTINUE; - } - - - public int OnAiSecondaryWeaponEquipped(obj_id self, obj_id secondaryWeapon) throws InterruptedException - { - clog("OnAiSecondaryWeaponEquipped() ai("+ self + ") secondaryWeapon("+ secondaryWeapon + ")"); - clearCombatActions(); - - return SCRIPT_CONTINUE; - } - - - public int OnAddedToWorld(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnAiCombatFrame(obj_id self) throws InterruptedException - { - - boolean assistWaiting = ai_combat_assist.isWaiting(); - - if (assistWaiting || getSkillStatisticModifier(self, "stifle") > 0) - { - - final obj_id hateTarget = getHateTarget(self); - faceTo(self, hateTarget); - - if (getCombatDuration(self) > ai_combat_assist.getWaitTime()) - { - ai_combat_assist.clearAssist(); - } - } - else - { - doCombatFrame(); - } - - return SCRIPT_CONTINUE; - } - - - public void doCombatFrame() throws InterruptedException - { - - final obj_id self = getSelf(); - final obj_id target = getBestTarget(self); - - int lastFrame = utils.getIntScriptVar(self, "creature_combat.lastCombatFrame"); - - utils.setScriptVar(self, "creature_combat.lastCombatFrame", getGameTime()); - - if (getState(self, STATE_COVER) == 1) - { - stealth.makeCreatureVisible(self); - } - - if (utils.hasScriptVar(self, "petIgnoreAttacks")) - { - - return; - } - - if (!isIdValid(target)) - { - - obj_id[] haters = getHateList(self); - - if (haters != null && haters.length > 0 && !utils.hasScriptVar(self, "hateListRetry")) - { - - Vector goodIds = new Vector(); - goodIds.setSize(0); - for (int i = 0; i < haters.length; ++i) - { - testAbortScript(); - - if (isIdValid(haters[i]) && exists(haters[i])) - { - utils.addElement(goodIds, haters[i]); - } - } - - if (goodIds != null & goodIds.size() > 0) - { - - int targetIndex = rand(0, goodIds.size() - 1); - - forceHateTarget(self, ((obj_id)(goodIds.get(targetIndex)))); - - utils.setScriptVar(self, "hateListRetry", 1); - - doCombatFrame(); - } - - } - - if (utils.hasScriptVar(self, "hateListRetry")) - { - utils.removeScriptVar(self, "hateListRetry"); - } - - if (beast_lib.isBeast(self)) - { - obj_id master = getMaster(self); - - if (isIdValid(master) && master.isLoaded()) - { - beast_lib.beastFollowTarget(self, master); - } - else - { - aiSetHomeLocation(self, getLocation(self)); - } - - return; - } - - if (pet_lib.isPet(self)) - { - messageTo(self, "postCombatPathHome", null, 1, false); - return; - } - - aiTether(self); - - return; - } - - boolean checkVE = isIdValid(target) && exists(target) && isIdValid(self) && exists(self); - - if (!storyteller.storytellerCombatCheck(self, target)) - { - - if (checkVE) - { - removeHateTarget(self, target); - } - - return; - } - - if (getState(target, STATE_FEIGN_DEATH) == 1) - { - - if (checkVE) - { - removeHateTarget(self, target); - } - - return; - } - else if (!ai_combat_target.isValidTarget(target)) - { - - if (checkVE) - { - removeHateTarget(self, target); - } - - return; - } - - final boolean targetCovered = stealth.hasInvisibleBuff(target); - final boolean targetProne = posture.isProne(target); - final int freeShotCount = targetCovered ? 3 : (targetProne ? 1 : 0); - - deltadictionary dict = self.getScriptVars(); - - if (!dict.getBoolean("ai.combat.cover.foundTarget")) - { - if ((getCombatDuration(self) > 10) || (freeShotCount == 0) || (ai_combat_damage.getAttackCount(target) > freeShotCount)) - { - if (freeShotCount > 0 && !hasScript(self, "systems.dungeon_sequencer.ai_controller")) - { - showFlyText(self, new string_id("npc_reaction/flytext", "threaten"), 2.0f, colors.ORANGERED); - } - - dict.put("ai.combat.cover.foundTarget", true); - } - } - - int combatRound = utils.getIntScriptVar(self, "aiCombatRoundCounter"); - combatRound++; - utils.setScriptVar(self, "aiCombatRoundCounter", combatRound); - - selectWeapon(target); - - final boolean commandQueueClear = (getCurrentCommand(self) == 0); - - if (commandQueueClear) - { - utils.removeScriptVar(self, "creature_combat.commandQueueTime"); - - if (posture.isKnockedDown(self)) - { - - final int knockDownTime = dict.getInt("ai.combat.knockdown_time"); - - if ((getGameTime() - knockDownTime) > aiGetKnockDownRecoveryTime(self)) - { - - queueCommand(self, (-1322133240), self, "", COMMAND_PRIORITY_DEFAULT); - } - } - else if (!posture.isStanding(self)) - { - posture.stand(self); - } - else - { - if (dict.getBoolean("ai.combat.cover.foundTarget")) - { - attack(target); - } - } - } - else - { - if (!utils.hasScriptVar(self, "creature_combat.commandQueueTime")) - { - utils.setScriptVar(self, "creature_combat.commandQueueTime", getGameTime()); - } - else - { - int time = utils.getIntScriptVar(self, "creature_combat.commandQueueTime"); - - if (getGameTime() - time > 2) - { - clearCombatActions(); - } - } - } - - move(target); - - } - - - public obj_id getBestTarget(obj_id self) throws InterruptedException - { - obj_id primaryTarget = getHateTarget(self); - - if (isIdValid(primaryTarget) && exists(primaryTarget) && !isDead(primaryTarget) && !stealth.hasInvisibleBuff(primaryTarget)) - { - return primaryTarget; - } - - obj_id[] hateList = getHateList(self); - - if (hateList == null || hateList.length == 0) - { - return null; - } - - float topHate = 0.0f; - primaryTarget = null; - - for (int i = 0; i < hateList.length; i++) - { - testAbortScript(); - if (!isIdValid(hateList[i]) || !exists(primaryTarget)) - { - continue; - } - - if (isDead(hateList[i]) || stealth.hasInvisibleBuff(hateList[i])) - { - - continue; - } - - if (hasObjVar(self, "noPursue") && !combat.cachedCanSee(self, hateList[i])) - { - continue; - } - - if (getHate(self, hateList[i]) > topHate) - { - primaryTarget = hateList[i]; - } - } - - return primaryTarget; - } - - - public void move(obj_id target) throws InterruptedException - { - - final obj_id self = getSelf(); - - if (ai_combat_movement.isAiImmobile(self)) - { - - return; - } - - if (!posture.isStanding(self)) - { - - return; - } - - if (!ai_lib.isWithinLeash(self)) - { - stopCombat(self); - - return; - } - - deltadictionary dict = self.getScriptVars(); - setLookAtTarget(self, target); - - final obj_id weapon = getCurrentWeapon(self); - final range_info weaponRange = aiGetWeaponRangeInfo(weapon); - final float distanceToTarget = getDistance(self, target); - final int weaponCategory = combat.getWeaponCategory(getWeaponType(weapon)); - final boolean targetCovered = stealth.hasInvisibleBuff(target); - - if (!canSee(self, target)) - { - ai_combat_movement.aiMoveToSee(target); - - return; - } - - if ((weaponCategory == combat.RANGED_WEAPON) && (combat.getWeaponCategory(getWeaponType(aiGetPrimaryWeapon(self))) != combat.MELEE_WEAPON)) - { - if ((distanceToTarget < TOO_CLOSE_DISTANCE) && isPlayer(target)) - { - ai_combat_movement.aiEvade(target, self, weaponRange, 1f, 1f); - - return; - } - else if (!ai_combat_movement.aiIsFleeing(self)) - {; - } - { - final float midRange = (weaponRange.maxRange - weaponRange.minRange) / 2.0f; - final float rangeVariation = midRange * 0.2f; - final float minFollowDistance = (weaponRange.minRange + midRange - rangeVariation); - final float maxFollowDistance = (weaponRange.minRange + midRange + rangeVariation); - - ai_combat_movement.aiFollow(target, minFollowDistance, maxFollowDistance); - faceTo(self, target); - } - } - else - { - float minFollowDistance = 1.5f; - float maxFollowDistance = 3.0f; - - if (!hasObjVar(self, "ai.noFollow")) - { - ai_combat_movement.aiFollow(target, minFollowDistance, maxFollowDistance); - } - else - { - if (distanceToTarget > 64) - { - stopCombat(self); - resumeMovement(self); - - return; - } - else - { - suspendMovement(self); - } - } - - faceTo(self, target); - } - - ai_combat_movement.aiEvade(target, self, weaponRange, MIN_MOVEMENT_DURING_COMBAT, MAX_MOVEMENT_DURING_COMBAT); - - } - - - public void selectWeapon(obj_id target) throws InterruptedException - { - - final obj_id self = getSelf(); - - if (beast_lib.isBeast(self)) - { - return; - } - - if (!aiHasPrimaryWeapon(self)) - { - - } - - if (!aiHasSecondaryWeapon(self)) - { - aiEquipPrimaryWeapon(self); - return; - } - - boolean equipPrimary = true; - final float distanceToTarget = getDistance(self, target); - - final obj_id primaryWeapon = aiGetPrimaryWeapon(self); - final obj_id secondaryWeapon = aiGetSecondaryWeapon(self); - - if (!exists(primaryWeapon) || !exists(secondaryWeapon)) - { - return; - } - - final range_info primaryWeaponRange = aiGetWeaponRangeInfo(primaryWeapon); - final boolean primaryWeaponInRange = (distanceToTarget >= primaryWeaponRange.minRange) && (distanceToTarget <= primaryWeaponRange.maxRange); - - final range_info secondaryWeaponRange = aiGetWeaponRangeInfo(secondaryWeapon); - final boolean secondaryWeaponInRange = (distanceToTarget >= secondaryWeaponRange.minRange) && (distanceToTarget <= secondaryWeaponRange.maxRange); - - if (aiUsingPrimaryWeapon(self) && aiHasSecondaryWeapon(self)) - { - if (secondaryWeaponInRange) - { - if (!primaryWeaponInRange) - { - aiEquipSecondaryWeapon(self); - } - else if (primaryWeaponRange.maxRange > secondaryWeaponRange.maxRange) - { - aiEquipSecondaryWeapon(self); - } - } - } - else if (aiUsingSecondaryWeapon(self) && primaryWeaponInRange) - { - if (!secondaryWeaponInRange) - { - aiEquipPrimaryWeapon(self); - } - else if (secondaryWeaponRange.maxRange > primaryWeaponRange.maxRange) - { - aiEquipPrimaryWeapon(self); - } - } - } - - - public void attack(obj_id target) throws InterruptedException - { - - final obj_id self = getSelf(); - String DEFAULT_ATTACK = combat.getAttackName(self); - - String currentActionString = null; - String forcedActionString = getStringObjVar(self, "ai.combat.forcedAction"); - String pendingActionString = getStringObjVar(self, "ai.combat.pendingAction"); - String oneShotActionString = getStringObjVar(self, "ai.combat.oneShotAction"); - - if (oneShotActionString != null && !hasObjVar(self, "oneShotActionComplete")) - { - forcedActionString = oneShotActionString; - setObjVar(self, "oneShotActionComplete", 1); - } - else - { - if (oneShotActionString != null) - { - - return; - } - } - - int pendingActionTime = getIntObjVar(self, "ai.combat.pendingActionTime"); - - currentActionString = DEFAULT_ATTACK; - - clog("attack() pre-check forcedActionString: "+ forcedActionString + " pendingActionString: "+ pendingActionString + (pendingActionTime > 0 ? " pendingActionTime: "+ (getGameTime() - pendingActionTime): "")); - - if (forcedActionString != null) - { - currentActionString = forcedActionString; - } - else if (pendingActionString != null) - { - if (getGameTime() - pendingActionTime < 2) - { - currentActionString = pendingActionString; - } - else - { - removeObjVar(self, "ai.combat.pendingAction"); - removeObjVar(self, "ai.combat.pendingActionTime"); - currentActionString = DEFAULT_ATTACK; - } - } - else - { - pendingActionString = aiGetCombatAction(self); - - if (pendingActionString != null) - { - currentActionString = pendingActionString; - - setObjVar(self, "ai.combat.pendingAction", pendingActionString); - setObjVar(self, "ai.combat.pendingActionTime", getGameTime()); - } - else - { - currentActionString = DEFAULT_ATTACK; - } - } - - clog("attack() post-check currentActionString: "+ currentActionString + " pendingActionString: "+ pendingActionString); - - int currentActionCrc = 0; - - final int result = combat.canPerformAction(currentActionString, self); - - clog("attack() post-check currentActionString: "+ currentActionString + " pendingActionString: "+ pendingActionString + " canPerformAction: "+ result); - - if (result == combat.ACTION_SUCCESS || oneShotActionString != null) - { - currentActionCrc = getStringCrc(currentActionString.toLowerCase()); - } - else if (result == combat.ACTION_TOO_TIRED) - { - - if (forcedActionString != null) - { - clog("attack() self("+ self + ") target("+ target + ") ACTION("+ forcedActionString + ") TOO TIRED - WAITING TO ATTEMPT FORCED ACTION"); - } - else - { - if (pendingActionString != null) - { - clog("attack() self("+ self + ") target("+ target + ") ACTION("+ pendingActionString + ") TOO TIRED - ATTEMPTING DEFAULT ATTACK"); - } - - if (!currentActionString.equals(DEFAULT_ATTACK)) - { - - if (combat.canPerformAction(DEFAULT_ATTACK, self) == combat.ACTION_SUCCESS) - { - currentActionString = DEFAULT_ATTACK; - currentActionCrc = getStringCrc(DEFAULT_ATTACK.toLowerCase()); - } - } - } - } - else if (result == combat.ACTION_INVALID_WEAPON) - { - - clearCombatActions(); - clog("attack() ERROR self("+ self + getName(self) + ") ACTION("+ currentActionString + ") weapon("+ (aiUsingPrimaryWeapon(self) ? "primary weapon": "secondary weapon") + ") INVALID WEAPON FOR ACTION, FIX THE DATA"); - } - else - { - - clearCombatActions(); - clog("attack() ERROR self("+ self + getName(self) + ") ACTION("+ currentActionString + ") UNEXPECTED RESULT FROM combat.canPerformAction()"); - } - - if (currentActionCrc != 0) - { - combat_data cd = combat_engine.getCombatData(currentActionString); - - if (cd == null) - { - - return; - } - - int groupCrc = getStringCrc(cd.cooldownGroup); - final float coolDownLeft = getCooldownTimeLeft(self, groupCrc); - - if (coolDownLeft <= 0.0f) - { - final float distanceToTarget = getDistance(self, target); - final range_info weaponRange = aiGetWeaponRangeInfo(getCurrentWeapon(self)); - - if (distanceToTarget < weaponRange.maxRange || distanceToTarget < cd.maxRange) - { - if (canSee(self, target)) - { - clog("attack() self("+ self + ") target("+ target + ") ACTION("+ currentActionCrc + ":"+ currentActionString + ")"); - - queueCommand(self, currentActionCrc, target, "", COMMAND_PRIORITY_DEFAULT); - - if (currentActionString.equals(forcedActionString)) - { - removeObjVar(self, "ai.combat.forcedAction"); - } - else if (currentActionString.equals(pendingActionString)) - { - removeObjVar(self, "ai.combat.pendingAction"); - } - } - } - } - } - - } - - - public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException - { - int lastFrame = utils.getIntScriptVar(self, "creature_combat.lastCombatFrame"); - - if (!stealth.hasInvisibleBuff(attacker)) - { - ai_combat_damage.addAttack(attacker); - } - - if (getGameTime() - lastFrame > 2) - { - clog("OnCreatureDamaged() !!!COMBAT STUCK!!! lastFrame: "+ lastFrame + " time elapsed: "+ (getGameTime() - lastFrame)); - doCombatFrame(); - } - - ai_lib.triggerAgroLinks(self, attacker); - - return SCRIPT_CONTINUE; - } - - - public int OnChangedPosture(obj_id self, int oldPosture, int newPosture) throws InterruptedException - { - if (newPosture == POSTURE_KNOCKED_DOWN) - { - final deltadictionary dict = self.getScriptVars(); - - dict.put("ai.combat.knockdown_time", getGameTime()); - } - - return SCRIPT_CONTINUE; - } - - - public int vocalizeEndCombat(obj_id self, dictionary params) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int postCombatPathHome(obj_id self, dictionary params) throws InterruptedException - { - if (ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - if (pet_lib.isPet(self) || beast_lib.isBeast(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isFollowing(self)) - { - ai_lib.resumeFollow(self); - } - else - { - pathTo(self, aiGetHomeLocation(self)); - } - - return SCRIPT_CONTINUE; - } - - - public boolean isNearLair(obj_id npc) throws InterruptedException - { - obj_id myLair = getObjIdObjVar(npc, "npc_lair.target"); - - if (!hasObjVar(npc, "lairSpawn") && !isIdValid(myLair)) - { - return false; - } - - if (!isIdValid(myLair)) - { - myLair = getObjIdObjVar(npc, "poi.baseObject"); - } - - if (isIdValid(myLair) && isInWorld(myLair) && exists(myLair)) - { - if (getDistance(npc, myLair) < 40f) - { - return true; - } - } - return false; - } - - - public void killPlayer(obj_id npc, obj_id target) throws InterruptedException - { - if (!isIdValid(target) || !isIncapacitated(target) || !isInWorld(target) || !exists(target) || ai_lib.isInCombat(npc)) - { - return; - } - - obj_id weapon = getCurrentWeapon(npc); - int weaponType = getWeaponType(weapon); - int weaponCat = combat.getWeaponCategory(weaponType); - float range = getDistance(npc, target); - - if (range > 2.0f) - { - setObjVar(npc, "ai.pathingToKill", target); - ai_lib.pathNear(npc, getLocation(target), 2f); - return; - } - - String skeleton = dataTableGetString("datatables/ai/species.iff", ai_lib.aiGetSpecies(npc), "Skeleton"); - - if (skeleton != null && !skeleton.equals("human")) - { - doAnimationAction(npc, "eat"); - pclib.coupDeGrace(target, npc); - } - else - { - pclib.coupDeGrace(target, npc, true); - } - } - - - public int OnFleeTargetLost(obj_id self, obj_id target) throws InterruptedException - { - if (!ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - clog("OnFleeTargetLost() self("+ self + ":"+ getName(self) + ") target("+ target + ")"); - - stopCombat(self); - - return SCRIPT_OVERRIDE; - } - - - public int OnFleeWaypoint(obj_id self, obj_id target) throws InterruptedException - { - if (!ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_OVERRIDE; - } - - - public int OnFleePathNotFound(obj_id self, obj_id target) throws InterruptedException - { - if (!ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - clog("OnFleePathNotFound() self("+ self + ":"+ getName(self) + ") target("+ target + ")"); - - stopCombat(self); - - return SCRIPT_OVERRIDE; - } - - - public int OnFollowWaiting(obj_id self, obj_id target) throws InterruptedException - { - - if (!ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, "ai.combat.pathingToHeal")) - { - - obj_id healingTarget = utils.getObjIdScriptVar(self, "ai.combat.pathingToHeal"); - - ai_combat.executeHealingMove(self, healingTarget); - return SCRIPT_OVERRIDE; - } - - faceTo(self, target); - - return SCRIPT_OVERRIDE; - } - - - public int OnFollowMoving(obj_id self, obj_id followTarget) throws InterruptedException - { - if (!ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, "ai.combat.pathingToHeal")) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_OVERRIDE; - } - - - public int OnFollowTargetLost(obj_id self, obj_id target) throws InterruptedException - { - if (!ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - clog("OnFollowTargetLost() self("+ self + ":"+ getName(self) + ") target("+ target + ")"); - - stopCombat(self); - - return SCRIPT_OVERRIDE; - } - - - public int OnFollowPathNotFound(obj_id self, obj_id target) throws InterruptedException - { - if (!ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - clog("OnFollowPathNotFound() self("+ self + ":"+ getName(self) + ") target("+ target + ")"); - - stopCombat(self); - - return SCRIPT_OVERRIDE; - } - - - public int OnMovePathComplete(obj_id self) throws InterruptedException - { - if (!ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - clog("OnMovePathComplete() self("+ self + ") The AI is dead."); - - if (ai_combat_movement.aiIsMovingToSee()) - { - ai_combat_movement.aiClearMoveMode(); - ai_combat_movement.aiMoveToSee(ai_combat_movement.aiGetMoveToSeeTarget()); - } - else if (ai_combat_movement.aiIsMovingToDeathBlow()) - { - - } - - return SCRIPT_CONTINUE; - } - - - public int OnMoveMoving(obj_id self) throws InterruptedException - { - if (!ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - clog("OnMoveMoving() self("+ self + ") The AI is dead."); - - return SCRIPT_OVERRIDE; - } - - - public int OnMovePathNotFound(obj_id self) throws InterruptedException - { - if (!ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_combat_movement.aiIsMovingToSee()) - { - final obj_id target = ai_combat_movement.aiGetMoveToSeeTarget(); - - clog("OnMovePathNotFound() self("+ self + ") The AI was moving to see("+ target + ":"+ getName(target) + ") and something went wrong so forcing tether."); - - stopCombat(self); - } - else if (ai_combat_movement.aiIsMovingToDeathBlow()) - { - - } - - return SCRIPT_OVERRIDE; - } - - - public int handleMoveRandomClear(obj_id self, dictionary params) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int handleTaunt(obj_id self, dictionary params) throws InterruptedException - { - if (ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id target = params.getObjId("player"); - - if (!isIdValid(target)) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, "ai.combat.isTaunted", (getGameTime() + 20)); - - stop(self); - - setTarget(self, target); - - return SCRIPT_CONTINUE; - } - - - public int getConfusionDuration(obj_id npc, obj_id attacker) throws InterruptedException - { - - if (getDistance(npc, attacker) < 10.0f) - { - return 0; - } - - int attackerPosture = getPosture(attacker); - int duration = 0; - - if (attackerPosture == POSTURE_CROUCHED) - { - duration = 5; - } - else if (attackerPosture == POSTURE_PRONE) - { - duration = 10; - } - - if (!ai_lib.isMonster(npc)) - { - return duration; - } - - boolean masked = false; - - if (scout.isScentMasked(attacker, npc)) - { - masked = true; - duration += 7; - } - - return duration; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - clog("OnDestroy() unit("+ self + ":"+ getName(self) + ")"); - - if (ai_lib.isAiDead(self)) - { - return SCRIPT_CONTINUE; - } - - int combatDestructionDelay = 0; - - if (pet_lib.isPet(self) || beast_lib.isBeast(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isInCombat(self)) - { - combatDestructionDelay = getGameTime() + 30; - utils.setScriptVar(self, "combatDestructionDelay", combatDestructionDelay); - - messageTo(self, "handleCombatDestructionDelay", null, 60, false); - - return SCRIPT_OVERRIDE; - } - - if (!utils.hasScriptVar(self, "combatDestructionDelay")) - { - return SCRIPT_CONTINUE; - } - else - { - combatDestructionDelay = utils.getIntScriptVar(self, "combatDestructionDelay"); - } - - if (getGameTime() > combatDestructionDelay) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "handleCombatDestructionDelay", null, 30, false); - - return SCRIPT_OVERRIDE; - } - - - public int handleCombatDestructionDelay(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int OnDotPulse(obj_id self, dictionary params) throws InterruptedException - { - clog("OnDotPulse() self("+ self + ":"+ getName(self) + ")"); - - if (ai_lib.isInCombat(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isAiDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (pet_lib.isPet(self) || beast_lib.isBeast(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id[] players = pvpGetEnemiesInRange(self, self, 128.0f); - - if (players == null || players.length < 1) - { - return SCRIPT_CONTINUE; - } - - for (int i=0; i < players.length; i++) - { - testAbortScript(); - if (isIdValid(players[i]) && exists(players[i]) && players[i] != self) - { - startCombat(self, players[i]); - return SCRIPT_CONTINUE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitateTarget(obj_id self, obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - clog("OnIncapacitateTarget() self("+ self + ":"+ getName(self) + ") target("+ target + ":"+ getName(target) + ") INVALID TARGET"); - return SCRIPT_CONTINUE; - } - - if (!isPlayer(target) && !pet_lib.isPet(target) && !beast_lib.isBeast(target)) - { - clog("OnIncapacitateTarget() self("+ self + ":"+ getName(self) + ") target("+ target + ":"+ getName(target) + ") TARGET IS NON-PLAYER"); - return SCRIPT_CONTINUE; - } - - if (aiIsKiller(self)) - { - - if (pet_lib.isPet(target)) - { - clog("OnIncapacitateTarget() self("+ self + ":"+ getName(self) + ") target("+ target + ":"+ getName(target) + ") DEATH BLOW PET"); - pet_lib.killPet(target); - } - else if (beast_lib.isBeast(target)) - { - clog("OnIncapacitateTarget() self("+ self + ":"+ getName(self) + ") target("+ target + ":"+ getName(target) + ") DEATH BLOW BEAST"); - beast_lib.killBeast(target, self); - } - else - { - clog("OnIncapacitateTarget() self("+ self + ":"+ getName(self) + ") target("+ target + ":"+ getName(target) + ") DEATH BLOW PLAYER"); - pclib.coupDeGrace(target, self); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - obj_id[] myHateList = getHateList(self); - - if (myHateList == null || myHateList.length == 0) - { - return SCRIPT_CONTINUE; - } - - for (int i=0; i= 0 && elem < names.length; ++i) - { - testAbortScript(); - obj_var o = objvars.getObjVar(i); - if (o != null) - { - if (o instanceof obj_var_list) - { - dumpObjvars(s, (obj_var_list)o, names, attribs); - elem = getFirstFreeIndex(names); - } - else - { - String name = "\""+ o.getName(); - Object v = o.getData(); - if (v != null) - { - String val = v.toString(); - names[elem] = name; - attribs[elem] = val; - elem++; - } - } - } - } - } - - - public void dumpScriptvars(String[] names, String[] attribs) throws InterruptedException - { - if ((names == null) || (attribs == null) || (names.length != attribs.length)) - { - return; - } - - int i = getFirstFreeIndex(names); - if (i != -1 && i < names.length) - { - final obj_id self = getSelf(); - deltadictionary scriptvars = self.getScriptVars(); - java.util.Enumeration keys = scriptvars.keys(); - names[i] = "\"***SCRIPTVARS***"; - attribs[i] = "******"; - i++; - - Map sortedValues = new TreeMap(); - while (keys.hasMoreElements() && i < names.length) - { - testAbortScript(); - Object k = keys.nextElement(); - String oldname = "\""+ k.toString(); - String name = oldname.replace('.', '+'); - debugServerConsoleMsg(self, "scriptvar name: "+ name); - Object v = scriptvars.getObject(k); - String attrib = v.toString(); - - sortedValues.put(name, attrib); - } - - Iterator keysSet = sortedValues.keySet().iterator(); - - while (keysSet.hasNext() && i < names.length) - { - testAbortScript(); - names[i] = (String)keysSet.next(); - attribs[i] = (String)sortedValues.get((String)names[i]); - ++i; - } - } - } - - - public int OnGetScriptvars(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - - if (player != null) - { - - ArrayList scripts = self.getScriptArrayList(); - if (scripts == null || scripts.size() == 0) - { - return SCRIPT_CONTINUE; - } - - String lastScript = (String)(scripts.get(scripts.size()-1)); - if (lastScript == null) - { - return SCRIPT_CONTINUE; - } - - if (!lastScript.equals(getClass().getName())) - { - return SCRIPT_CONTINUE; - } - - if (isGod(player)) - { - dumpScriptvars(names, attribs); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - if ((names == null) || (attribs == null) || (names.length != attribs.length)) - { - return SCRIPT_CONTINUE; - } - - if (player != null) - { - - ArrayList scripts = self.getScriptArrayList(); - if (scripts == null || scripts.size() == 0) - { - return SCRIPT_CONTINUE; - } - - String lastScript = (String)(scripts.get(scripts.size()-1)); - if (lastScript == null) - { - return SCRIPT_CONTINUE; - } - - if (!lastScript.equals(getClass().getName())) - { - return SCRIPT_CONTINUE; - } - - if (isGod(player)) - { - dumpScriptvars(names, attribs); - - final int firstFreeIndex = getFirstFreeIndex(names); - - if (( (firstFreeIndex >= 0) && (firstFreeIndex < names.length))) - { - names[firstFreeIndex] = "\"***OBJVARS***"; - attribs[firstFreeIndex] = "******"; - } - - obj_var_list rootList = getObjVarList(self, ""); - if (rootList != null) - { - dumpObjvars(self, rootList, names, attribs); - } - } - } - return SCRIPT_CONTINUE; - } - - - public String UploadCharacter(obj_id player) throws InterruptedException - { - dictionary params = new dictionary(); - Object[] triggerParams = new Object[2]; - triggerParams[0] = player; - triggerParams[1] = params; - - try - { - int err = script_entry.runScripts("OnUploadCharacter", triggerParams); - if (err == SCRIPT_CONTINUE) - { - byte[] packedData = params.pack(); - return new String(packedData); - } - } - catch(Throwable t) - { - return null; - } - - return null; - } - - public String DownloadCharacter(obj_id player, String packedData) throws InterruptedException - { - byte[] data = packedData.getBytes(); - dictionary params = dictionary.unpack(data); - - Object[] triggerParams = new Object[2]; - triggerParams[0] = player; - triggerParams[1] = params; - try - { - script_entry.runScripts("OnDownloadCharacter", triggerParams); - } - catch(Throwable t) - { - return null; - } - return "OK"; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/city/guard_spawner.java b/sku.0/sys.server/compiled/game/script/city/guard_spawner.java deleted file mode 100644 index 90eeb1e4e..000000000 --- a/sku.0/sys.server/compiled/game/script/city/guard_spawner.java +++ /dev/null @@ -1,445 +0,0 @@ -package script.city; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.create; -import script.library.utils; -import script.library.locations; -import script.library.gcw; - - -public class guard_spawner extends script.base_script -{ - public guard_spawner() - { - } - public static final String guardTable = "datatables/npc/guard_spawner/guard.iff"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo( self, "checkForStart", null, 3, false ); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - location here = getLocation( self ); - String city = locations.getCityName( here ); - if (city != null) - { - if (city.equals("bestine")) - { - if (!hasScript( self, "city.bestine.politician_event_npc" )) - { - attachScript( self, "city.bestine.politician_event_npc"); - } - } - else if (city.equals("theed")) - { - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (empiredayRunning != null && (empiredayRunning.equals("true") || empiredayRunning.equals("1"))) - { - utils.setScriptVar(self, "OFF", "DUE TO EMPIRE DAY"); - - return SCRIPT_CONTINUE; - - } - } - - } - - if (hasObjVar (self, "current")) - { - killAll( self ); - messageTo( self, "checkForStart", null, 30, false ); - } - else - { - messageTo( self, "checkForStart", null, 30, false ); - } - - if (!hasScript( self, "systems.gcw.gcw_data_updater" )) - { - attachScript( self, "systems.gcw.gcw_data_updater"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException - { - if (!hasObjVar (speaker, "gm")) - { - return SCRIPT_OVERRIDE; - } - int stringCheck = text.indexOf("max"); - String population = text.substring( text.indexOf(" ")+1, text.length() ); - int maxPop = utils.stringToInt( population ); - if (stringCheck > -1) - { - setObjVar (self, "pop", maxPop); - } - if (text.equals("killall")) - { - killAll( self ); - } - else if (text.equals("restart")) - { - messageTo( self, "startSpawning", null, 1, false ); - } - - return SCRIPT_CONTINUE; - } - - - public int checkForStart(obj_id self, dictionary params) throws InterruptedException - { - if (hasObjVar (self, "pop")) - { - messageTo( self, "startSpawning", null, 10, false ); - return SCRIPT_CONTINUE; - } - else - { - setObjVar( self, "pop", 5 ); - messageTo( self, "checkForStart", null, 3, false ); - return SCRIPT_CONTINUE; - } - } - - - public int startSpawning(obj_id self, dictionary params) throws InterruptedException - { - - if (!utils.hasScriptVar( self, "police" )) - { - if (rand() < 0.25f) - { - utils.setScriptVar( self, "police", 1 ); - } - else - { - utils.setScriptVar( self, "police", 0 ); - } - } - - int maxPop = getIntObjVar( self, "pop"); - - if (maxPop <= 5) - { - location here = getLocation( self ); - String city = locations.getCityName( here ); - if (city != null) - { - if (city.equals("bestine") && hasObjVar(self, "bestine.electionWinner")) - { - String electionWinner = getStringObjVar( self, "bestine.electionWinner"); - if (electionWinner.equals("victor") || electionWinner.equals("Victor")) - { - maxPop = (int)(maxPop*2.5); - } - else - { - maxPop = (int)(maxPop*1.5); - } - } - } - } - - if (!hasObjVar (self, "current")) - { - setObjVar( self, "current", 0 ); - doSpawn( self, false ); - } - else - { - int currentPop = getIntObjVar( self, "current"); - if (currentPop < maxPop) - { - doSpawn( self, false ); - } - else - { - utils.removeScriptVar( self, "police"); - return SCRIPT_OVERRIDE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int guardSpawnerRespawnNpc(obj_id self, dictionary params) throws InterruptedException - { - doSpawn( self, true ); - return SCRIPT_CONTINUE; - } - - - public void doSpawn(obj_id self, boolean onlySpawnOne) throws InterruptedException - { - String type = getGuardArea( self ); - - location me = getLocation(self); - location here = locations.getGoodLocationAroundLocation(me, 1f, 1f, 1.5f, 1.5f); - if (here == null) - { - debugServerConsoleMsg (self, "guard_spawner couldn't find a good location"); - return; - } - - String spawn = npcToSpawn( type ); - obj_id npc = create.object( spawn, here ); - if (!isIdValid(npc)) - { - logScriptDataError("unable to spawn "+ spawn + " + at loc "+ here ); - return; - } - attachScript (npc, "city.guard_wander"); - attachScript (npc, "city.city_mob_death_msg"); - - setObjVar(npc, "cityMobSpawner", self); - - if (!hasObjVar (self, "myCreations")) - { - Vector myCreations = new Vector(); - myCreations.setSize(0); - utils.addElement (myCreations, npc); - setObjVar (self, "myCreations", myCreations); - } - else - { - Vector theList = getResizeableObjIdArrayObjVar (self, "myCreations"); - int maxPop = getIntObjVar (self, "pop"); - - if (theList.size() >= maxPop) - { - CustomerServiceLog ("SPAWNER_OVERLOAD", "Tried to spawn something even though the list was full."); - return; - } - else - { - theList.add (npc); - setObjVar (self, "myCreations", theList); - } - } - - int currentPop = getIntObjVar (self, "current"); - currentPop = currentPop + 1; - - if (currentPop == 1) - { - setObjVar (self, "leader", npc); - } - else - { - obj_id leader = getObjIdObjVar (self, "leader"); - ai_lib.followInFormation( npc, leader , ai_lib.FORMATION_COLUMN, currentPop-1); - debugSpeakMsg (self, "Formation # "+ (currentPop-1)); - } - - setObjVar (self, "current", currentPop); - - if (!onlySpawnOne) - { - messageTo (self, "startSpawning", null, 10, false); - } - - return; - } - - - public String npcToSpawn(String type) throws InterruptedException - { - String[] guardList = dataTableGetStringColumnNoDefaults( guardTable, type ); - int guardNum = rand( 0, guardList.length -1 ); - String guard = guardList[guardNum]; - return guard; - } - - - public int cityMobKilled(obj_id self, dictionary params) throws InterruptedException - { - obj_id deadNpc = params.getObjId ("deadNpc"); - - if (!hasObjVar (self, "myCreations")) - { - CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner "+ self + " tried to spawn a replacement for "+ deadNpc + " but I don't have a list!"); - return SCRIPT_CONTINUE; - } - - Vector spawnedList = getResizeableObjIdArrayObjVar (self, "myCreations"); - - if (spawnedList.contains(deadNpc)) - { - int currentPop = getIntObjVar (self, "current"); - currentPop = currentPop - 1; - - if (currentPop < 0) - { - currentPop = 0; - CustomerServiceLog ("SPAWNER_OVERLOAD", "Count went below 0 on "+ self + " in Guard_spawner script."); - } - - setObjVar(self, "current", currentPop); - - spawnedList.remove(deadNpc); - - if (spawnedList.size() > 0) - { - setObjVar (self, "myCreations", spawnedList); - } - else - { - removeObjVar (self, "myCreations"); - } - - messageTo (self, "guardSpawnerRespawnNpc", null, 10, false); - } - else - { - CustomerServiceLog ("SPAWNER_OVERLOAD", "Spawner "+ self + " tried to spawn a replacement for "+ deadNpc + " but he's not on my list!"); - } - - return SCRIPT_CONTINUE; - } - - - public void killAll(obj_id self) throws InterruptedException - { - - if (hasObjVar (self, "spawn")) - { - int increment = 1; - int totalBodies = getIntObjVar (self, "pop"); - - while (increment <= totalBodies) - { - testAbortScript(); - obj_id npcToKill = getObjIdObjVar( self, "spawn."+ increment); - - if (npcToKill != null) - { - destroyObject (npcToKill); - removeObjVar (self, "spawn."+ increment); - } - increment = increment + 1; - } - - removeObjVar( self, "spawn"); - } - - if (hasObjVar (self, "myCreations")) - { - Vector theList = getResizeableObjIdArrayObjVar (self, "myCreations"); - - for (int i = 0; i < theList.size(); ++i) - { - testAbortScript(); - destroyObject( ((obj_id)(theList.get(i))) ); - } - - removeObjVar( self, "myCreations"); - } - - removeObjVar( self, "current"); - return; - } - - - public String getGuardArea(obj_id self) throws InterruptedException - { - String guardAreaName = "tatooine"; - - location here = getLocation( getSelf() ); - String planet = here.area; - String city = locations.getCityName( here ); - - if (city == null) - { - city = locations.getGuardSpawnerRegionName( here ); - } - - if ((city != null) && (planet.equals("tatooine") || planet.equals("naboo") || planet.equals("corellia"))) - { - - float imp_r = gcw.getImperialRatio( self ); - float reb_r = gcw.getRebelRatio( self ); - - String test_city = city; - if (imp_r >= reb_r) - { - float delta = imp_r - reb_r; - if (delta > 2.f) - { - test_city = test_city + "_imperial_hard"; - } - else - { - test_city = test_city + "_imperial"; - } - } - else - { - float delta = reb_r - imp_r; - if (delta > 2.f) - { - test_city = test_city + "_rebel_hard"; - } - else - { - test_city = test_city + "_rebel"; - } - } - - if (utils.getIntScriptVar( self, "police" ) == 1) - { - LOG( "spawn_guard", "Trying police! "+ city); - if (dataTableHasColumn( guardTable, city + "_police" )) - { - test_city = city + "_police"; - } - } - - if (dataTableHasColumn( guardTable, test_city )) - { - city = test_city; - } - - LOG( "spawn_guard", "Spawning a guard from table "+ city + " (tried "+ test_city + ")"); - } - - if (city == null) - { - guardAreaName = planet; - } - else - { - - if (dataTableHasColumn(guardTable, city)) - { - guardAreaName = city; - } - else - { - guardAreaName = planet; - } - } - - setObjVar( getSelf(), "guardArea", guardAreaName ); - return guardAreaName; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/bib_fortuna_mos_eisley.java b/sku.0/sys.server/compiled/game/script/conversation/bib_fortuna_mos_eisley.java deleted file mode 100644 index e2f654e46..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/bib_fortuna_mos_eisley.java +++ /dev/null @@ -1,1017 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.buff; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.space_quest; -import script.library.static_item; -import script.library.utils; - - -public class bib_fortuna_mos_eisley extends script.base_script -{ - public bib_fortuna_mos_eisley() - { - } - String c_stringFile = "conversation/bib_fortuna_mos_eisley"; - - - public boolean bib_fortuna_mos_eisley_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neut(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "quest_01_comlink_call_to_adventure_neut_faction"); - } - - - public boolean bib_fortuna_mos_eisley_condition_hasComlinkQuest01Pos(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "quest_01_comlink_call_to_adventure_pos_faction"); - } - - - public boolean bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neg(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "quest_01_comlink_call_to_adventure_neg_faction"); - } - - - public boolean bib_fortuna_mos_eisley_condition_hasTheBiolabClue(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return ( (groundquests.isQuestActive(player, "quest_02_investigate_murder") && groundquests.isTaskActive(player, "quest_02_investigate_murder", "talkBibFortunaBiolabClue")) || (groundquests.hasCompletedQuest(player, "quest_02_investigate_murder") && !groundquests.isQuestActiveOrComplete(player, "quest_03_investigate_biolab")) ); - } - - - public boolean bib_fortuna_mos_eisley_condition_hasBiolabQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_02_investigate_murder") && groundquests.isQuestActive(player, "quest_03_investigate_biolab"); - } - - - public boolean bib_fortuna_mos_eisley_condition_hasCompletedBiolabQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_03_investigate_biolab") && groundquests.isQuestActive(player, "quest_04_meet_cale_herron"); - } - - - public boolean bib_fortuna_mos_eisley_condition_needsToGatherClues(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "quest_02_investigate_murder", "speakHapper") || groundquests.isTaskActive(player, "quest_02_investigate_murder", "identifyBody") || groundquests.isTaskActive(player, "quest_02_investigate_murder", "getClues"); - } - - - public boolean bib_fortuna_mos_eisley_condition_hasQuestOneNotQuestTwo(obj_id player, obj_id npc) throws InterruptedException - { - return ( !groundquests.isQuestActiveOrComplete(player, "quest_02_investigate_murder") && (groundquests.hasCompletedQuest(player, "quest_01_comlink_call_to_adventure_pos_faction") || groundquests.hasCompletedQuest(player, "quest_01_comlink_call_to_adventure_neg_faction") || groundquests.hasCompletedQuest(player, "quest_01_comlink_call_to_adventure_neut_faction")) ); - } - - - public boolean bib_fortuna_mos_eisley_condition_hasCompletedBiolabButCancelHerron(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "quest_03_investigate_biolab") && !groundquests.isQuestActiveOrComplete(player, "quest_04_meet_cale_herron"); - } - - - public boolean bib_fortuna_mos_eisley_condition_hasCompletedInvestigationCancelBiolab(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "quest_02_investigate_murder") && !groundquests.isQuestActiveOrComplete(player, "quest_03_investigate_biolab"); - } - - - public void bib_fortuna_mos_eisley_action_comlinkQuestOnceSignal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "bibWaitingForPlayer"); - } - - - public void bib_fortuna_mos_eisley_action_grantQuest02Investigate(obj_id player, obj_id npc) throws InterruptedException - { - bib_fortuna_mos_eisley_action_comlinkQuestOnceSignal(player, npc); - groundquests.grantQuest(player, "quest_02_investigate_murder"); - } - - - public void bib_fortuna_mos_eisley_action_sendSignalAndGrantQuest03Biolab(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "quest02PlayerHasClues"); - } - - - public void bib_fortuna_mos_eisley_action_grantQuest03(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "quest_03_investigate_biolab"); - } - - - public void bib_fortuna_mos_eisley_action_clearQuest03(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.clearQuest(player, "quest_03_investigate_biolab"); - } - - - public void bib_fortuna_mos_eisley_action_clearThenGrantQuest03(obj_id player, obj_id npc) throws InterruptedException - { - bib_fortuna_mos_eisley_action_clearQuest03(player, npc); - bib_fortuna_mos_eisley_action_grantQuest03(player, npc); - } - - - public int bib_fortuna_mos_eisley_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - bib_fortuna_mos_eisley_action_clearThenGrantQuest03 (player, npc); - - string_id message = new string_id (c_stringFile, "s_43"); - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int bib_fortuna_mos_eisley_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_23")) - { - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_25"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int bib_fortuna_mos_eisley_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_25")) - { - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int bib_fortuna_mos_eisley_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_27")) - { - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - bib_fortuna_mos_eisley_action_sendSignalAndGrantQuest03Biolab (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int bib_fortuna_mos_eisley_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_30")) - { - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int bib_fortuna_mos_eisley_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_30")) - { - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int bib_fortuna_mos_eisley_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_30")) - { - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int bib_fortuna_mos_eisley_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_34")) - { - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int bib_fortuna_mos_eisley_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_39")) - { - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - bib_fortuna_mos_eisley_action_grantQuest02Investigate (player, npc); - - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int bib_fortuna_mos_eisley_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_39")) - { - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - bib_fortuna_mos_eisley_action_grantQuest02Investigate (player, npc); - - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.bib_fortuna_mos_eisley"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.bib_fortuna_mos_eisley"); - - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (bib_fortuna_mos_eisley_condition_hasCompletedBiolabButCancelHerron (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_41"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 1); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (bib_fortuna_mos_eisley_condition_hasCompletedBiolabQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (bib_fortuna_mos_eisley_condition_hasBiolabQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_19"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (bib_fortuna_mos_eisley_condition_hasCompletedInvestigationCancelBiolab (player, npc)) - { - bib_fortuna_mos_eisley_action_grantQuest03 (player, npc); - - string_id message = new string_id (c_stringFile, "s_47"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (bib_fortuna_mos_eisley_condition_hasTheBiolabClue (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_23"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 6); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (bib_fortuna_mos_eisley_condition_needsToGatherClues (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neg (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_201"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 13); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (bib_fortuna_mos_eisley_condition_hasComlinkQuest01Neut (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_203"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 13); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (bib_fortuna_mos_eisley_condition_hasComlinkQuest01Pos (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_205"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 13); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (bib_fortuna_mos_eisley_condition_hasQuestOneNotQuestTwo (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_46"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - utils.setScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId", 15); - - npcStartConversation (player, npc, "bib_fortuna_mos_eisley", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (bib_fortuna_mos_eisley_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_195"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("bib_fortuna_mos_eisley")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - if (branchId == 1 && bib_fortuna_mos_eisley_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && bib_fortuna_mos_eisley_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && bib_fortuna_mos_eisley_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && bib_fortuna_mos_eisley_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && bib_fortuna_mos_eisley_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && bib_fortuna_mos_eisley_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && bib_fortuna_mos_eisley_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && bib_fortuna_mos_eisley_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && bib_fortuna_mos_eisley_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && bib_fortuna_mos_eisley_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.bib_fortuna_mos_eisley.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/blacksun_guri.java b/sku.0/sys.server/compiled/game/script/conversation/blacksun_guri.java deleted file mode 100644 index a893d5125..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/blacksun_guri.java +++ /dev/null @@ -1,3996 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.factions; -import script.library.groundquests; -import script.library.utils; - - -public class blacksun_guri extends script.base_script -{ - public blacksun_guri() - { - } - String c_stringFile = "conversation/blacksun_guri"; - - - public boolean blacksun_guri_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean blacksun_guri_condition_hasNotStartedQuestLine(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_imperial") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_neutral")); - } - - - public boolean blacksun_guri_condition_hasFirstQuestNeutral(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_01_neutral"); - } - - - public boolean blacksun_guri_condition_hasSecondQuestImperial(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_02_neutral"); - } - - - public boolean blacksun_guri_condition_hasFoundStormtroopers(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral"); - } - - - public boolean blacksun_guri_condition_hasCompletedMissions(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "speakPietteDebrief"); - } - - - public boolean blacksun_guri_condition_hasCompletedAll(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_quest_facility_05_neutral") && groundquests.hasCompletedQuest(player, "outbreak_quest_final_neutral"); - } - - - public boolean blacksun_guri_condition_isLiveConversion(obj_id player, obj_id npc) throws InterruptedException - { - return blacksun_guri_condition_hasNotStartedQuestLine(player,npc) && (groundquests.isTaskActive(player, "outbreak_live_conversion_neutral", "speakGuri") || groundquests.hasCompletedQuest(player, "outbreak_live_conversion_neutral")) || (groundquests.isTaskActive(player, "outbreak_switch_to_neutral", "speakGuri") || groundquests.hasCompletedQuest(player, "outbreak_switch_to_neutral")); - } - - - public boolean blacksun_guri_condition_isPlayerRebel(obj_id player, obj_id npc) throws InterruptedException - { - return factions.isRebel(player); - } - - - public boolean blacksun_guri_condition_isPlayerImp(obj_id player, obj_id npc) throws InterruptedException - { - return factions.isImperial(player); - } - - - public boolean blacksun_guri_condition_hasDeletedLiveConversion(obj_id player, obj_id npc) throws InterruptedException - { - if ((groundquests.hasCompletedQuest(player, "quest_08_dathomir_outpost_final") || groundquests.hasCompletedQuest(player, "quest_08_dathomir_outpost"))) - { - if ((!groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_imperial") && !groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_neutral") && !groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_neutral") && !groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_imperial"))) - { - return true; - } - } - return false; - } - - - public void blacksun_guri_action_grantMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.grantQuest(player, "quest/outbreak_quest_01_neutral"); - } - - - public void blacksun_guri_action_completeQuest5(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasSpokenPietteDebreif"); - if (!hasCompletedCollectionSlot(player, "outbreak_flare_s_slot")) - { - modifyCollectionSlotValue(player, "outbreak_flare_s_slot", 1); - } - } - - - public void blacksun_guri_action_clearLiveConversion(obj_id player, obj_id npc) throws InterruptedException - { - if ((!groundquests.isTaskActive(player, "outbreak_live_conversion_neutral", "speakGuri") && !groundquests.isTaskActive(player, "outbreak_switch_to_neutral", "speakGuri"))) - { - return; - } - - groundquests.sendSignal(player, "liveConversionSpokeGuri"); - } - - - public void blacksun_guri_action_revokeNeutralGiveImperial(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_neutral")) - { - groundquests.clearQuest(player, "outbreak_live_conversion_neutral"); - groundquests.grantQuest(player, "outbreak_switch_to_imperial"); - } - if (groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_neutral")) - { - groundquests.clearQuest(player, "outbreak_switch_to_neutral"); - groundquests.grantQuest(player, "outbreak_switch_to_imperial"); - } - - } - - - public void blacksun_guri_action_revokeNeutralGiveRebel(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_neutral")) - { - groundquests.clearQuest(player, "outbreak_live_conversion_neutral"); - groundquests.grantQuest(player, "outbreak_switch_to_rebel"); - } - if (groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_neutral")) - { - groundquests.clearQuest(player, "outbreak_switch_to_neutral"); - groundquests.grantQuest(player, "outbreak_switch_to_rebel"); - } - } - - - public void blacksun_guri_action_revokeEntireNeutQuestLine(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_neutral")) - { - groundquests.clearQuest(player, "outbreak_live_conversion_neutral"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_neutral")) - { - groundquests.clearQuest(player, "outbreak_switch_to_neutral"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_neutral")) - { - groundquests.clearQuest(player, "outbreak_quest_01_neutral"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_neutral")) - { - groundquests.clearQuest(player, "outbreak_quest_02_neutral"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01b")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01b"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01c")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01c"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01d")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01d"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_02")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_02"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_03")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_03"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_04")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_04"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_05")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_05"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_06")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_06"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_07")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_07"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_08")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_08"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_09")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_09"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_10")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_10"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_11")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_11"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_12")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_12"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_13")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_13"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_14")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_14"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_15")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_15"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_16")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_16"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_shuttle_parts")) - { - groundquests.clearQuest(player, "outbreak_quest_shuttle_parts"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_neutral_01")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_neutral_01"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_neutral_02")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_neutral_02"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_neutral_03")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_neutral_03"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_neutral_04")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_neutral_04"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_01")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_01"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_02")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_02"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_02_neutral")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_02_neutral"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_03")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_03"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_04")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_04"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_05_neutral")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_05_neutral"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_final_neutral")) - { - groundquests.clearQuest(player, "outbreak_quest_final_neutral"); - } - - } - - - public void blacksun_guri_action_grantRebQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_switch_to_rebel"); - } - - - public void blacksun_guri_action_grantImpQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_switch_to_imperial"); - } - - - public void blacksun_guri_action_grantNeutQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_switch_to_neutral"); - } - - - public int blacksun_guri_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_95")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_97")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_99"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 3); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_99")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_revokeEntireNeutQuestLine (player, npc); - - string_id message = new string_id (c_stringFile, "s_100"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_102"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_103"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_grantNeutQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_104"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_102")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_grantRebQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_105"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_103")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_grantImpQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_106"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_124")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - string_id message = new string_id (c_stringFile, "s_125"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_126")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_128"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 10); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_128")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - blacksun_guri_action_completeQuest5 (player, npc); - - string_id message = new string_id (c_stringFile, "s_129"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_29")) - { - - if (blacksun_guri_condition_isPlayerRebel (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_71"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_72"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (blacksun_guri_condition_isPlayerImp (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_72")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_90"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_73")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_84"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_90")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_revokeNeutralGiveRebel (player, npc); - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_85")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_140")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_142"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_76")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_92"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_77")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_80"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_81"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_93")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_revokeNeutralGiveImperial (player, npc); - - string_id message = new string_id (c_stringFile, "s_94"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_81")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_83"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_140")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_142"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_140")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_142"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_144")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_146"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_148"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 28); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_148")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_multiple"); - - string_id message = new string_id (c_stringFile, "s_150"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_152"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 29); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_152")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_154"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_156")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_242"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_243"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_243")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_244"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_245"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_245")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_247"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_249"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_249")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_260"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_261"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_261")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_262"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_263"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_263")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_264"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_265"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_265")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_266"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_267"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 37); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_267")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_268"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_269"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_269")) - { - doAnimationAction (player, "shrug_hands"); - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_271"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_273"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 39); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch39(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_273")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_275"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_277"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch40(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_277")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_279"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 41); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch41(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_280")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_281"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_283"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_293"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_303"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_309"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 42); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch42(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_283")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_285"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_287"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_293")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_295"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_297"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 46); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_303")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_305"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_283"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_293"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_303"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_309"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_309")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_311"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch43(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_287")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_289"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_291"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 44); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch44(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_291")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_312"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_283"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_293"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_303"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_309"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch45(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_283")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_285"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_287"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_293")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_295"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_297"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 46); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_303")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_305"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_283"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_293"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_303"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_309"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_309")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_311"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch46(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_297")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_299"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_301"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 47); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch47(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_301")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_313"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_314"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 48); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch48(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_314")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_315"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_283"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_293"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_303"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_309"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch49(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_283")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_285"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_287"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_293")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_295"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_297"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 46); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_303")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_305"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_283"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_293"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_303"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_309"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_309")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_311"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch50(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_283")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_285"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_287"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_293")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_295"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_297"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 46); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_303")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_305"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_283"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_293"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_303"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_309"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_309")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_311"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int blacksun_guri_handleBranch52(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_149")) - { - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - blacksun_guri_action_grantNeutQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_153"); - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.blacksun_guri"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.blacksun_guri"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (blacksun_guri_condition_hasCompletedAll (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_95"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 1); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "blacksun_guri", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (blacksun_guri_condition_hasCompletedMissions (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 8); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "blacksun_guri", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (blacksun_guri_condition_hasFoundStormtroopers (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_122"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (blacksun_guri_condition_hasSecondQuestImperial (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_121"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (blacksun_guri_condition_hasFirstQuestNeutral (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (blacksun_guri_condition_isLiveConversion (player, npc)) - { - doAnimationAction (npc, "nod"); - - blacksun_guri_action_clearLiveConversion (player, npc); - - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_29"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 15); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "blacksun_guri", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (blacksun_guri_condition_hasDeletedLiveConversion (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_147"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_149"); - } - - utils.setScriptVar (player, "conversation.blacksun_guri.branchId", 52); - - npcStartConversation (player, npc, "blacksun_guri", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (blacksun_guri_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_157"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("blacksun_guri")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.blacksun_guri.branchId"); - - if (branchId == 1 && blacksun_guri_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && blacksun_guri_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && blacksun_guri_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && blacksun_guri_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && blacksun_guri_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && blacksun_guri_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && blacksun_guri_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && blacksun_guri_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && blacksun_guri_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && blacksun_guri_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && blacksun_guri_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && blacksun_guri_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && blacksun_guri_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && blacksun_guri_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && blacksun_guri_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && blacksun_guri_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && blacksun_guri_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && blacksun_guri_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && blacksun_guri_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && blacksun_guri_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && blacksun_guri_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && blacksun_guri_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && blacksun_guri_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && blacksun_guri_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && blacksun_guri_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && blacksun_guri_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && blacksun_guri_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && blacksun_guri_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && blacksun_guri_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 39 && blacksun_guri_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 40 && blacksun_guri_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 41 && blacksun_guri_handleBranch41 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 42 && blacksun_guri_handleBranch42 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 43 && blacksun_guri_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 44 && blacksun_guri_handleBranch44 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 45 && blacksun_guri_handleBranch45 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 46 && blacksun_guri_handleBranch46 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 47 && blacksun_guri_handleBranch47 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 48 && blacksun_guri_handleBranch48 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 49 && blacksun_guri_handleBranch49 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 50 && blacksun_guri_handleBranch50 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 52 && blacksun_guri_handleBranch52 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.blacksun_guri.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave.java b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave.java deleted file mode 100644 index c907f03e6..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave.java +++ /dev/null @@ -1,302 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class boss_terminal_mining_cave extends script.base_script -{ - public boss_terminal_mining_cave() - { - } - String c_stringFile = "conversation/boss_terminal_mining_cave"; - - - public boolean boss_terminal_mining_cave_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean boss_terminal_mining_cave_condition_hasQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); - } - - - public boolean boss_terminal_mining_cave_condition_hasGroup(obj_id player, obj_id npc) throws InterruptedException - { - obj_id groupid = getGroupObject(player); - if (!isValidId(groupid)) - { - - return false; - } - return true; - } - - - public boolean boss_terminal_mining_cave_condition_hasBossTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "findNymsGirlfriend") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "fightNymsGirlfriend"); - } - - - public boolean boss_terminal_mining_cave_condition_hasQuestAndGroup(obj_id player, obj_id npc) throws InterruptedException - { - if (!boss_terminal_mining_cave_condition_hasGroup(player,npc)) - { - return false; - } - if (!boss_terminal_mining_cave_condition_hasQuest(player,npc)) - { - return false; - } - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); - } - - - public boolean boss_terminal_mining_cave_condition_wave_event_active(obj_id player, obj_id npc) throws InterruptedException - { - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; - } - - - public void boss_terminal_mining_cave_action_startEvent(obj_id player, obj_id npc) throws InterruptedException - { - - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); - } - - - public void boss_terminal_mining_cave_action_foundTerminal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundNymsGirlfriend"); - } - - - public void boss_terminal_mining_cave_action_unauthorizedUse(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); - } - - - public void boss_terminal_mining_cave_action_busyWithOtherPlayer(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); - } - - - public int boss_terminal_mining_cave_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (boss_terminal_mining_cave_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_action_startEvent (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int spawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int handleQuestFlavorObjectCleanup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if (objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; 1 < objList.length; i++) - { - testAbortScript(); - if (!isValidId(objList[i])) - { - continue; - } - - messageTo(objList[i], "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (boss_terminal_mining_cave_condition_wave_event_active (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_mining_cave_condition_hasBossTask (player, npc)) - { - boss_terminal_mining_cave_action_foundTerminal (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave.branchId", 2); - - npcStartConversation (player, npc, "boss_terminal_mining_cave", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_mining_cave_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_action_unauthorizedUse (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("boss_terminal_mining_cave")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_cave.branchId"); - - if (branchId == 2 && boss_terminal_mining_cave_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_controller.java b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_controller.java deleted file mode 100644 index a7e76025b..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_controller.java +++ /dev/null @@ -1,440 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class boss_terminal_mining_cave_controller extends script.base_script -{ - public boss_terminal_mining_cave_controller() - { - } - String c_stringFile = "conversation/boss_terminal_mining_cave_controller"; - - - public boolean boss_terminal_mining_cave_controller_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean boss_terminal_mining_cave_controller_condition_hasQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); - } - - - public boolean boss_terminal_mining_cave_controller_condition_hasGroup(obj_id player, obj_id npc) throws InterruptedException - { - obj_id groupid = getGroupObject(player); - if (!isValidId(groupid)) - { - - return false; - } - return true; - } - - - public boolean boss_terminal_mining_cave_controller_condition_hasBossTask(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "FindControllerMine") || groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "killControllerMine")) && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_mine_activate"); - } - - - public boolean boss_terminal_mining_cave_controller_condition_hasQuestAndGroup(obj_id player, obj_id npc) throws InterruptedException - { - if (!boss_terminal_mining_cave_controller_condition_hasGroup(player,npc)) - { - return false; - } - if (!boss_terminal_mining_cave_controller_condition_hasQuest(player,npc)) - { - return false; - } - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); - } - - - public boolean boss_terminal_mining_cave_controller_condition_wave_event_active(obj_id player, obj_id npc) throws InterruptedException - { - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; - } - - - public void boss_terminal_mining_cave_controller_action_startEvent(obj_id player, obj_id npc) throws InterruptedException - { - boss_terminal_mining_cave_controller_action_foundTerminal(player,npc); - - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); - } - - - public void boss_terminal_mining_cave_controller_action_foundTerminal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "HasFoundControllerMine"); - obj_id myGroup = getGroupObject(player); - if (isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for (int i = 0; i < members.length; i++) - { - testAbortScript(); - if (!isIdValid(members[i]) || !exists(members[i])) - { - continue; - } - - if (getDistance(members[i], npc) > 200) - { - continue; - } - - if (boss_terminal_mining_cave_controller_condition_hasBossTask(members[i], npc)) - { - groundquests.sendSignal(members[i], "HasFoundControllerMine"); - } - } - } - } - - - public void boss_terminal_mining_cave_controller_action_unauthorizedUse(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); - } - - - public void boss_terminal_mining_cave_controller_action_busyWithOtherPlayer(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); - } - - - public int boss_terminal_mining_cave_controller_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int boss_terminal_mining_cave_controller_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_controller_action_startEvent (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int boss_terminal_mining_cave_controller_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_16"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int spawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int handleQuestFlavorObjectCleanup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if (objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; 1 < objList.length; i++) - { - testAbortScript(); - if (!isValidId(objList[i])) - { - continue; - } - - messageTo(objList[i], "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (boss_terminal_mining_cave_controller_condition_wave_event_active (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId", 1); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_controller", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_mining_cave_controller_condition_hasBossTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId", 3); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_controller", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_controller_action_unauthorizedUse (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_controller_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId", 5); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_controller", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("boss_terminal_mining_cave_controller")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); - - if (branchId == 1 && boss_terminal_mining_cave_controller_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && boss_terminal_mining_cave_controller_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && boss_terminal_mining_cave_controller_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_controller.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_foreman.java b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_foreman.java deleted file mode 100644 index fdf907a1c..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_cave_foreman.java +++ /dev/null @@ -1,440 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class boss_terminal_mining_cave_foreman extends script.base_script -{ - public boss_terminal_mining_cave_foreman() - { - } - String c_stringFile = "conversation/boss_terminal_mining_cave_foreman"; - - - public boolean boss_terminal_mining_cave_foreman_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean boss_terminal_mining_cave_foreman_condition_hasQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); - } - - - public boolean boss_terminal_mining_cave_foreman_condition_hasGroup(obj_id player, obj_id npc) throws InterruptedException - { - obj_id groupid = getGroupObject(player); - if (!isValidId(groupid)) - { - - return false; - } - return true; - } - - - public boolean boss_terminal_mining_cave_foreman_condition_hasBossTask(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "findForemanMine") || groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "killGrandForeman")) && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_mine_activate"); - } - - - public boolean boss_terminal_mining_cave_foreman_condition_hasQuestAndGroup(obj_id player, obj_id npc) throws InterruptedException - { - if (!boss_terminal_mining_cave_foreman_condition_hasGroup(player,npc)) - { - return false; - } - if (!boss_terminal_mining_cave_foreman_condition_hasQuest(player,npc)) - { - return false; - } - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); - } - - - public boolean boss_terminal_mining_cave_foreman_condition_wave_event_active(obj_id player, obj_id npc) throws InterruptedException - { - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; - } - - - public void boss_terminal_mining_cave_foreman_action_startEvent(obj_id player, obj_id npc) throws InterruptedException - { - boss_terminal_mining_cave_foreman_action_foundTerminal(player,npc); - - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); - } - - - public void boss_terminal_mining_cave_foreman_action_foundTerminal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundForemanMine"); - obj_id myGroup = getGroupObject(player); - if (isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for (int i = 0; i < members.length; i++) - { - testAbortScript(); - if (!isIdValid(members[i]) || !exists(members[i])) - { - continue; - } - - if (getDistance(members[i], npc) > 200) - { - continue; - } - - if (boss_terminal_mining_cave_foreman_condition_hasBossTask(members[i], npc)) - { - groundquests.sendSignal(members[i], "hasFoundForemanMine"); - } - } - } - } - - - public void boss_terminal_mining_cave_foreman_action_unauthorizedUse(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); - } - - - public void boss_terminal_mining_cave_foreman_action_busyWithOtherPlayer(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); - } - - - public int boss_terminal_mining_cave_foreman_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int boss_terminal_mining_cave_foreman_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_foreman_action_startEvent (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int boss_terminal_mining_cave_foreman_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_16"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int spawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int handleQuestFlavorObjectCleanup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if (objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; 1 < objList.length; i++) - { - testAbortScript(); - if (!isValidId(objList[i])) - { - continue; - } - - messageTo(objList[i], "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (boss_terminal_mining_cave_foreman_condition_wave_event_active (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId", 1); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_foreman", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_mining_cave_foreman_condition_hasBossTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId", 3); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_foreman", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_cave_foreman_action_unauthorizedUse (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_mining_cave_foreman_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId", 5); - - npcStartConversation (player, npc, "boss_terminal_mining_cave_foreman", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("boss_terminal_mining_cave_foreman")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); - - if (branchId == 1 && boss_terminal_mining_cave_foreman_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && boss_terminal_mining_cave_foreman_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && boss_terminal_mining_cave_foreman_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_mining_cave_foreman.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_barnet.java b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_barnet.java deleted file mode 100644 index 158f255a1..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_barnet.java +++ /dev/null @@ -1,302 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class boss_terminal_mining_research_barnet extends script.base_script -{ - public boss_terminal_mining_research_barnet() - { - } - String c_stringFile = "conversation/boss_terminal_mining_research_barnet"; - - - public boolean boss_terminal_mining_research_barnet_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean boss_terminal_mining_research_barnet_condition_hasQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); - } - - - public boolean boss_terminal_mining_research_barnet_condition_hasGroup(obj_id player, obj_id npc) throws InterruptedException - { - obj_id groupid = getGroupObject(player); - if (!isValidId(groupid)) - { - - return false; - } - return true; - } - - - public boolean boss_terminal_mining_research_barnet_condition_hasBossTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findUdoBarnet") || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "killUdoBarnet"); - } - - - public boolean boss_terminal_mining_research_barnet_condition_hasQuestAndGroup(obj_id player, obj_id npc) throws InterruptedException - { - if (!boss_terminal_mining_research_barnet_condition_hasGroup(player,npc)) - { - return false; - } - if (!boss_terminal_mining_research_barnet_condition_hasQuest(player,npc)) - { - return false; - } - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); - } - - - public boolean boss_terminal_mining_research_barnet_condition_wave_event_active(obj_id player, obj_id npc) throws InterruptedException - { - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; - } - - - public void boss_terminal_mining_research_barnet_action_startEvent(obj_id player, obj_id npc) throws InterruptedException - { - - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); - } - - - public void boss_terminal_mining_research_barnet_action_foundTerminal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundUdoBarnet"); - } - - - public void boss_terminal_mining_research_barnet_action_unauthorizedUse(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); - } - - - public void boss_terminal_mining_research_barnet_action_busyWithOtherPlayer(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); - } - - - public int boss_terminal_mining_research_barnet_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (boss_terminal_mining_research_barnet_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_research_barnet_action_startEvent (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_barnet.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int spawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int handleQuestFlavorObjectCleanup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if (objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; 1 < objList.length; i++) - { - testAbortScript(); - if (!isValidId(objList[i])) - { - continue; - } - - messageTo(objList[i], "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (boss_terminal_mining_research_barnet_condition_wave_event_active (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_mining_research_barnet_condition_hasBossTask (player, npc)) - { - boss_terminal_mining_research_barnet_action_foundTerminal (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_mining_research_barnet_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_mining_research_barnet.branchId", 2); - - npcStartConversation (player, npc, "boss_terminal_mining_research_barnet", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_mining_research_barnet_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_research_barnet_action_unauthorizedUse (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("boss_terminal_mining_research_barnet")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_research_barnet.branchId"); - - if (branchId == 2 && boss_terminal_mining_research_barnet_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_barnet.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_lapaz.java b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_lapaz.java deleted file mode 100644 index 5cd9e8cf4..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_mining_research_lapaz.java +++ /dev/null @@ -1,302 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class boss_terminal_mining_research_lapaz extends script.base_script -{ - public boss_terminal_mining_research_lapaz() - { - } - String c_stringFile = "conversation/boss_terminal_mining_research_lapaz"; - - - public boolean boss_terminal_mining_research_lapaz_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean boss_terminal_mining_research_lapaz_condition_hasQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); - } - - - public boolean boss_terminal_mining_research_lapaz_condition_hasGroup(obj_id player, obj_id npc) throws InterruptedException - { - obj_id groupid = getGroupObject(player); - if (!isValidId(groupid)) - { - - return false; - } - return true; - } - - - public boolean boss_terminal_mining_research_lapaz_condition_hasBossTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findKellLapaz") || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "KillKellLapaz"); - } - - - public boolean boss_terminal_mining_research_lapaz_condition_hasQuestAndGroup(obj_id player, obj_id npc) throws InterruptedException - { - if (!boss_terminal_mining_research_lapaz_condition_hasGroup(player,npc)) - { - return false; - } - if (!boss_terminal_mining_research_lapaz_condition_hasQuest(player,npc)) - { - return false; - } - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); - } - - - public boolean boss_terminal_mining_research_lapaz_condition_wave_event_active(obj_id player, obj_id npc) throws InterruptedException - { - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; - } - - - public void boss_terminal_mining_research_lapaz_action_startEvent(obj_id player, obj_id npc) throws InterruptedException - { - - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); - } - - - public void boss_terminal_mining_research_lapaz_action_foundTerminal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundKellLapaz"); - } - - - public void boss_terminal_mining_research_lapaz_action_unauthorizedUse(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); - } - - - public void boss_terminal_mining_research_lapaz_action_busyWithOtherPlayer(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); - } - - - public int boss_terminal_mining_research_lapaz_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (boss_terminal_mining_research_lapaz_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_research_lapaz_action_startEvent (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int spawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int handleQuestFlavorObjectCleanup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if (objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; 1 < objList.length; i++) - { - testAbortScript(); - if (!isValidId(objList[i])) - { - continue; - } - - messageTo(objList[i], "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (boss_terminal_mining_research_lapaz_condition_wave_event_active (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_mining_research_lapaz_condition_hasBossTask (player, npc)) - { - boss_terminal_mining_research_lapaz_action_foundTerminal (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_mining_research_lapaz_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.branchId", 2); - - npcStartConversation (player, npc, "boss_terminal_mining_research_lapaz", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_mining_research_lapaz_condition__defaultCondition (player, npc)) - { - boss_terminal_mining_research_lapaz_action_unauthorizedUse (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("boss_terminal_mining_research_lapaz")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.branchId"); - - if (branchId == 2 && boss_terminal_mining_research_lapaz_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_mining_research_lapaz.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_pirate_cave.java b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_pirate_cave.java deleted file mode 100644 index f4307943e..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_pirate_cave.java +++ /dev/null @@ -1,446 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class boss_terminal_pirate_cave extends script.base_script -{ - public boss_terminal_pirate_cave() - { - } - String c_stringFile = "conversation/boss_terminal_pirate_cave"; - - - public boolean boss_terminal_pirate_cave_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean boss_terminal_pirate_cave_condition_hasQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); - } - - - public boolean boss_terminal_pirate_cave_condition_hasGroup(obj_id player, obj_id npc) throws InterruptedException - { - obj_id groupid = getGroupObject(player); - if (!isValidId(groupid)) - { - - return false; - } - return true; - } - - - public boolean boss_terminal_pirate_cave_condition_hasBossTask(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "findNymsGirlfriend") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "fightNymsGirlfriend")) && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_hideout_activate"); - } - - - public boolean boss_terminal_pirate_cave_condition_hasFightTask(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean boss_terminal_pirate_cave_condition_hasQuestAndGroup(obj_id player, obj_id npc) throws InterruptedException - { - if (!boss_terminal_pirate_cave_condition_hasGroup(player,npc)) - { - return false; - } - if (!boss_terminal_pirate_cave_condition_hasQuest(player,npc)) - { - return false; - } - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); - } - - - public boolean boss_terminal_pirate_cave_condition_wave_event_active(obj_id player, obj_id npc) throws InterruptedException - { - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; - } - - - public void boss_terminal_pirate_cave_action_startEvent(obj_id player, obj_id npc) throws InterruptedException - { - - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); - } - - - public void boss_terminal_pirate_cave_action_foundTerminal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundNymsGirlfriend"); - obj_id myGroup = getGroupObject(player); - if (isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for (int i = 0; i < members.length; i++) - { - testAbortScript(); - if (!isIdValid(members[i]) || !exists(members[i])) - { - continue; - } - - if (getDistance(members[i], npc) > 200) - { - continue; - } - - if (boss_terminal_pirate_cave_condition_hasBossTask(members[i], npc)) - { - groundquests.sendSignal(members[i], "hasFoundNymsGirlfriend"); - } - } - } - } - - - public void boss_terminal_pirate_cave_action_unauthorizedUse(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); - } - - - public void boss_terminal_pirate_cave_action_busyWithOtherPlayer(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); - } - - - public int boss_terminal_pirate_cave_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_11")) - { - - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_12"); - utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int boss_terminal_pirate_cave_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - boss_terminal_pirate_cave_action_startEvent (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int boss_terminal_pirate_cave_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_16"); - utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int spawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int handleQuestFlavorObjectCleanup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if (objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; 1 < objList.length; i++) - { - testAbortScript(); - if (!isValidId(objList[i])) - { - continue; - } - - messageTo(objList[i], "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (boss_terminal_pirate_cave_condition_wave_event_active (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_11"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId", 1); - - npcStartConversation (player, npc, "boss_terminal_pirate_cave", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_pirate_cave_condition_hasBossTask (player, npc)) - { - boss_terminal_pirate_cave_action_foundTerminal (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId", 3); - - npcStartConversation (player, npc, "boss_terminal_pirate_cave", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - boss_terminal_pirate_cave_action_unauthorizedUse (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId", 5); - - npcStartConversation (player, npc, "boss_terminal_pirate_cave", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("boss_terminal_pirate_cave")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); - - if (branchId == 1 && boss_terminal_pirate_cave_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && boss_terminal_pirate_cave_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && boss_terminal_pirate_cave_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_pirate_cave.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_barnet.java b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_barnet.java deleted file mode 100644 index da8ca1171..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_barnet.java +++ /dev/null @@ -1,440 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class boss_terminal_research_barnet extends script.base_script -{ - public boss_terminal_research_barnet() - { - } - String c_stringFile = "conversation/boss_terminal_research_barnet"; - - - public boolean boss_terminal_research_barnet_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean boss_terminal_research_barnet_condition_hasQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); - } - - - public boolean boss_terminal_research_barnet_condition_hasGroup(obj_id player, obj_id npc) throws InterruptedException - { - obj_id groupid = getGroupObject(player); - if (!isValidId(groupid)) - { - - return false; - } - return true; - } - - - public boolean boss_terminal_research_barnet_condition_hasBossTask(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findUdoBarnet") || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "killUdoBarnet")) && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_lab_activate"); - } - - - public boolean boss_terminal_research_barnet_condition_hasQuestAndGroup(obj_id player, obj_id npc) throws InterruptedException - { - if (!boss_terminal_research_barnet_condition_hasGroup(player,npc)) - { - return false; - } - if (!boss_terminal_research_barnet_condition_hasQuest(player,npc)) - { - return false; - } - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); - } - - - public boolean boss_terminal_research_barnet_condition_wave_event_active(obj_id player, obj_id npc) throws InterruptedException - { - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; - } - - - public void boss_terminal_research_barnet_action_startEvent(obj_id player, obj_id npc) throws InterruptedException - { - boss_terminal_research_barnet_action_foundTerminal(player,npc); - - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); - } - - - public void boss_terminal_research_barnet_action_foundTerminal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundUdoBarnet"); - obj_id myGroup = getGroupObject(player); - if (isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for (int i = 0; i < members.length; i++) - { - testAbortScript(); - if (!isIdValid(members[i]) || !exists(members[i])) - { - continue; - } - - if (getDistance(members[i], npc) > 200) - { - continue; - } - - if (boss_terminal_research_barnet_condition_hasBossTask(members[i], npc)) - { - groundquests.sendSignal(members[i], "hasFoundUdoBarnet"); - } - } - } - } - - - public void boss_terminal_research_barnet_action_unauthorizedUse(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); - } - - - public void boss_terminal_research_barnet_action_busyWithOtherPlayer(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); - } - - - public int boss_terminal_research_barnet_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_11")) - { - - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_12"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int boss_terminal_research_barnet_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - boss_terminal_research_barnet_action_startEvent (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int boss_terminal_research_barnet_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_16"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int spawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int handleQuestFlavorObjectCleanup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if (objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; 1 < objList.length; i++) - { - testAbortScript(); - if (!isValidId(objList[i])) - { - continue; - } - - messageTo(objList[i], "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (boss_terminal_research_barnet_condition_wave_event_active (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_11"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_research_barnet.branchId", 1); - - npcStartConversation (player, npc, "boss_terminal_research_barnet", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_research_barnet_condition_hasBossTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_research_barnet.branchId", 3); - - npcStartConversation (player, npc, "boss_terminal_research_barnet", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - boss_terminal_research_barnet_action_unauthorizedUse (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_research_barnet_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_research_barnet.branchId", 5); - - npcStartConversation (player, npc, "boss_terminal_research_barnet", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("boss_terminal_research_barnet")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); - - if (branchId == 1 && boss_terminal_research_barnet_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && boss_terminal_research_barnet_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && boss_terminal_research_barnet_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_research_barnet.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_lapaz.java b/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_lapaz.java deleted file mode 100644 index 86b466a92..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/boss_terminal_research_lapaz.java +++ /dev/null @@ -1,440 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class boss_terminal_research_lapaz extends script.base_script -{ - public boss_terminal_research_lapaz() - { - } - String c_stringFile = "conversation/boss_terminal_research_lapaz"; - - - public boolean boss_terminal_research_lapaz_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean boss_terminal_research_lapaz_condition_hasQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); - } - - - public boolean boss_terminal_research_lapaz_condition_hasGroup(obj_id player, obj_id npc) throws InterruptedException - { - obj_id groupid = getGroupObject(player); - if (!isValidId(groupid)) - { - - return false; - } - return true; - } - - - public boolean boss_terminal_research_lapaz_condition_hasBossTask(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "findKellLapaz") || groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "KillKellLapaz")) && hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_lab_activate"); - } - - - public boolean boss_terminal_research_lapaz_condition_hasQuestAndGroup(obj_id player, obj_id npc) throws InterruptedException - { - if (!boss_terminal_research_lapaz_condition_hasGroup(player,npc)) - { - return false; - } - if (!boss_terminal_research_lapaz_condition_hasQuest(player,npc)) - { - return false; - } - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); - } - - - public boolean boss_terminal_research_lapaz_condition_wave_event_active(obj_id player, obj_id npc) throws InterruptedException - { - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; - } - - - public void boss_terminal_research_lapaz_action_startEvent(obj_id player, obj_id npc) throws InterruptedException - { - boss_terminal_research_lapaz_action_foundTerminal(player,npc); - - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 4, false); - } - - - public void boss_terminal_research_lapaz_action_foundTerminal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundKellLapaz"); - obj_id myGroup = getGroupObject(player); - if (isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for (int i = 0; i < members.length; i++) - { - testAbortScript(); - if (!isIdValid(members[i]) || !exists(members[i])) - { - continue; - } - - if (getDistance(members[i], npc) > 200) - { - continue; - } - - if (boss_terminal_research_lapaz_condition_hasBossTask(members[i], npc)) - { - groundquests.sendSignal(members[i], "hasFoundKellLapaz"); - } - } - } - } - - - public void boss_terminal_research_lapaz_action_unauthorizedUse(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); - } - - - public void boss_terminal_research_lapaz_action_busyWithOtherPlayer(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); - } - - - public int boss_terminal_research_lapaz_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_11")) - { - - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_12"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int boss_terminal_research_lapaz_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - boss_terminal_research_lapaz_action_startEvent (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int boss_terminal_research_lapaz_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_16"); - utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int spawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int handleQuestFlavorObjectCleanup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if (objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; 1 < objList.length; i++) - { - testAbortScript(); - if (!isValidId(objList[i])) - { - continue; - } - - messageTo(objList[i], "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (boss_terminal_research_lapaz_condition_wave_event_active (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_11"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId", 1); - - npcStartConversation (player, npc, "boss_terminal_research_lapaz", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_research_lapaz_condition_hasBossTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId", 3); - - npcStartConversation (player, npc, "boss_terminal_research_lapaz", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - boss_terminal_research_lapaz_action_unauthorizedUse (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (boss_terminal_research_lapaz_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId", 5); - - npcStartConversation (player, npc, "boss_terminal_research_lapaz", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("boss_terminal_research_lapaz")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); - - if (branchId == 1 && boss_terminal_research_lapaz_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && boss_terminal_research_lapaz_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && boss_terminal_research_lapaz_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.boss_terminal_research_lapaz.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/bounty_probot.java b/sku.0/sys.server/compiled/game/script/conversation/bounty_probot.java deleted file mode 100644 index 3aeae5f33..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/bounty_probot.java +++ /dev/null @@ -1,288 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.utils; - - -public class bounty_probot extends script.base_script -{ - public bounty_probot() - { - } - String c_stringFile = "conversation/bounty_probot"; - - - public boolean bounty_probot_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean bounty_probot_condition_notMyHunter(obj_id player, obj_id npc) throws InterruptedException - { - obj_id objPlayer = getObjIdObjVar(npc, "objPlayer"); - obj_id objBountyMission = null; - obj_id objMission = getObjIdObjVar(npc, "objMission"); - - if (player != null) - { - obj_id[] objMissionArray = getMissionObjects(objPlayer); - if (objMissionArray != null) - { - for (int intI = 0; intI 0) - { - if (groundquests.isQuestActiveOrComplete(player, questName)) - { - groundquests.clearQuest(player, questName); - } - - groundquests.grantQuest(player, questName); - } - - obj_id parentObject = getObjIdObjVar(npc, "objParent"); - if (!isValidId(parentObject) || !exists(parentObject)) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Master Object does not exist"); - return; - } - - setInvulnerable(npc, false); - pathTo(npc,getLocation(parentObject)); - - setObjVar(npc, "ignoreEarlyDestroy", 1); - } - messageTo(npc, "spawnEnemies", null, 0, false); - messageTo(npc, "checkOwnerValidity", null, 10, false); - } - - - public int camp_survivor_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_96")) - { - - if (camp_survivor_condition__defaultCondition (player, npc)) - { - camp_survivor_action_claimSpawner (player, npc); - - string_id message = new string_id (c_stringFile, "s_97"); - utils.removeScriptVar (player, "conversation.camp_survivor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - public static final string_id SID_YOU_WENT_TOO_FAR = new string_id("theme_park/outbreak/outbreak","delivery_you_went_too_far"); - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.camp_survivor"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnMovePathComplete(obj_id self) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id parentObject = getObjIdObjVar(self, "objParent"); - if (!isValidId(parentObject) || !exists(parentObject)) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.OnMovingPathComplete() Master Object does not exist"); - return SCRIPT_CONTINUE; - } - pathTo(self,getLocation(parentObject)); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.camp_survivor"); - - if (hasObjVar(self, "myEscort")) - { - obj_id player = getObjIdObjVar(self, "myEscort"); - if (isValidId(player) && exists(player)) - { - String questName = getStringObjVar(self, "questName"); - if (questName != null && questName.length() > 0) - { - String failMessage = getStringObjVar(self,"failMessage"); - if (failMessage != null && failMessage.length() > 0) - { - if (groundquests.isQuestActive(player, questName)) - { - groundquests.sendSignal(player, failMessage); - } - } - } - } - } - - obj_id parent = getObjIdObjVar(self,"mySpawner"); - if (isValidId(parent) && exists(parent)) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.cleanUpCampNpcAndParent() Destroying parent: "+parent); - destroyObject(parent); - } - return SCRIPT_CONTINUE; - } - - - public int cleanUpWhileConversing(obj_id self, dictionary params) throws InterruptedException - { - if (hasObjVar(self, "ignoreEarlyDestroy")) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "cleanUpCampNpcAndParent", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public int cleanUpCampNpcAndParent(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.cleanUpCampNpcAndParent() Initalized Message Handler."); - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "myEscort")) - { - obj_id player = getObjIdObjVar(self, "myEscort"); - if (isValidId(player) && exists(player)) - { - String questName = getStringObjVar(self, "questName"); - if (questName != null && questName.length() > 0) - { - String creatureType = getStringObjVar(self,"creature_type"); - if (creatureType != null && creatureType.length() > 0) - { - if (groundquests.isQuestActive(player, questName)) - { - groundquests.sendSignal(player, creatureType); - } - if (!hasCompletedCollectionSlot(player, creatureType + "_counter")) - { - modifyCollectionSlotValue(player, creatureType + "_counter", 1); - } - } - } - } - } - - obj_id parent = getObjIdObjVar(self,"mySpawner"); - if (isValidId(parent) && exists(parent)) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.cleanUpCampNpcAndParent() Destroying parent: "+parent); - destroyObject(parent); - } - CustomerServiceLog("outbreak_themepark", "survivor_pathing.cleanUpCampNpcAndParent() Destroying self."); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int spawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.spawnEnemies() Initalized Message Handler."); - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "myEscort")) - { - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(self, "myEscort"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int combatLevel = getLevel(player); - if (combatLevel < 0 || combatLevel > 90) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor.spawnEnemies() Player "+player+" has a level that is invalid. Player level is: "+combatLevel+". Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < 2; i++) - { - testAbortScript(); - - obj_id mob = create.object("outbreak_afflicted_defense", spawning.getRandomLocationAtDistance(getLocation(self), 10.0f)); - if (!isValidId(mob) || !exists(mob)) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor.spawnEnemies() Mob: "+mob+" could not be created!"); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_survivor.spawnEnemies() Mob level is set to match player level"); - - setObjVar(mob, create.INITIALIZE_CREATURE_DO_NOT_SCALE_OBJVAR, 1); - - dictionary creatureDict = utils.dataTableGetRow("datatables/mob/creatures.iff", "outbreak_afflicted_defense"); - if (creatureDict != null) - { - create.initializeCreature (mob, "outbreak_afflicted_defense", creatureDict, combatLevel); - } - CustomerServiceLog("outbreak_themepark", "camp_survivor.spawnEnemies() Mob level is set to match player level."); - - setInvulnerable(mob, false); - clearCondition(mob, CONDITION_CONVERSABLE); - setMovementRun(mob); - setBaseRunSpeed(mob, (getBaseRunSpeed(self)-8)); - setAttributeAttained(mob, attrib.OUTBREAK_AFFLICTED); - setObjVar(mob, "ow/sener", player); - - attachScript(mob, "theme_park.outbreak.dynamic_enemy"); - startCombat(mob, self); - - } - return SCRIPT_CONTINUE; - } - - - public int checkOwnerValidity(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, "myEscort")) - { - return SCRIPT_CONTINUE; - } - - obj_id owner = getObjIdObjVar(self, "myEscort"); - if (!isValidId(owner) || !exists(owner)) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor.checkOwnerValidity() Mob: "+self+" FAILED TO FIND OWNER OBJVAR."); - return SCRIPT_CONTINUE; - } - - location ownerLoc = getLocation(owner); - float distanceCheck = utils.getDistance2D(getLocation(self), ownerLoc); - if (distanceCheck > 20) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor.checkOwnerValidity() Mob: "+self+" has been left alone and is destroying self, failing quest for player. The distance between player and NPC was: "+distanceCheck); - - sendSystemMessage(owner, SID_YOU_WENT_TOO_FAR); - if (groundquests.isQuestActive(owner, "camp_alpha_survivor_rescue")) - { - groundquests.sendSignal(owner, "outbreak_camp_alpha_survivor_failed"); - } - else if (groundquests.isQuestActive(owner, "camp_beta_survivor_rescue")) - { - groundquests.sendSignal(owner, "outbreak_camp_beta_survivor_failed"); - } - else if (groundquests.isQuestActive(owner, "camp_gamma_survivor_rescue")) - { - groundquests.sendSignal(owner, "outbreak_camp_gamma_survivor_failed"); - } - else - { - groundquests.sendSignal(owner, "outbreak_camp_delta_survivor_failed"); - } - - } - - obj_id parentObject = getObjIdObjVar(self, "objParent"); - if (!isValidId(parentObject) || !exists(parentObject)) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.OnMovingPathComplete() Master Object does not exist"); - return SCRIPT_CONTINUE; - } - pathTo(self,getLocation(parentObject)); - - messageTo(self, "checkOwnerValidity", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (camp_survivor_condition_isCloseToCamp (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_9"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (camp_survivor_condition_isUnclaimedSpawner (player, npc)) - { - camp_survivor_action_startDestroyTimer (player, npc); - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (camp_survivor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_96"); - } - - utils.setScriptVar (player, "conversation.camp_survivor.branchId", 2); - - npcStartConversation (player, npc, "camp_survivor", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (camp_survivor_condition_isOwner (player, npc)) - { - camp_survivor_action_claimSpawner (player, npc); - - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (camp_survivor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_60"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("camp_survivor")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.camp_survivor.branchId"); - - if (branchId == 2 && camp_survivor_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.camp_survivor.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/captain_piett.java b/sku.0/sys.server/compiled/game/script/conversation/captain_piett.java deleted file mode 100644 index 1971272d4..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/captain_piett.java +++ /dev/null @@ -1,3843 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.factions; -import script.library.groundquests; -import script.library.utils; - - -public class captain_piett extends script.base_script -{ - public captain_piett() - { - } - String c_stringFile = "conversation/captain_piett"; - - - public boolean captain_piett_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean captain_piett_condition_hasNotStartedQuestLine(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_imperial") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_neutral")); - } - - - public boolean captain_piett_condition_hasFirstQuestImperial(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_01_imperial"); - } - - - public boolean captain_piett_condition_hasSecondQuestImperial(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_02_imperial"); - } - - - public boolean captain_piett_condition_hasFoundStormtroopers(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial"); - } - - - public boolean captain_piett_condition_hasCompletedMissions(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "speakPietteDebrief"); - } - - - public boolean captain_piett_condition_hasCompletedAll(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_quest_facility_05_imperial") && groundquests.hasCompletedQuest(player, "outbreak_quest_final_imperial"); - } - - - public boolean captain_piett_condition_isLiveConversion(obj_id player, obj_id npc) throws InterruptedException - { - - return captain_piett_condition_hasNotStartedQuestLine(player,npc) && (groundquests.isTaskActive(player, "outbreak_live_conversion_imperial", "speakPiett") || groundquests.hasCompletedQuest(player, "outbreak_live_conversion_imperial")) || (groundquests.isTaskActive(player, "outbreak_switch_to_imperial", "speakPiett") || groundquests.hasCompletedQuest(player, "outbreak_switch_to_imperial")); - } - - - public boolean captain_piett_condition_isPlayerNeutral(obj_id player, obj_id npc) throws InterruptedException - { - return captain_piett_condition_isLiveConversion(player, npc) && !factions.isImperial(player) && !factions.isRebel(player); - } - - - public boolean captain_piett_condition_isPlayerRebel(obj_id player, obj_id npc) throws InterruptedException - { - return captain_piett_condition_isLiveConversion(player, npc) && factions.isRebel(player); - } - - - public boolean captain_piett_condition_hasDeletedLiveConversion(obj_id player, obj_id npc) throws InterruptedException - { - if ((groundquests.hasCompletedQuest(player, "quest_08_dathomir_outpost_final") || groundquests.hasCompletedQuest(player, "quest_08_dathomir_outpost"))) - { - if ((!groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_imperial") && !groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_neutral") && !groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_neutral") && !groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_imperial"))) - { - return true; - } - } - return false; - } - - - public void captain_piett_action_grantMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.grantQuest(player, "quest/outbreak_quest_01_imperial"); - } - - - public void captain_piett_action_completeQuest5(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasSpokenPietteDebreif"); - if (!hasCompletedCollectionSlot(player, "outbreak_flare_s_slot")) - { - modifyCollectionSlotValue(player, "outbreak_flare_s_slot", 1); - } - } - - - public void captain_piett_action_clearLiveConversion(obj_id player, obj_id npc) throws InterruptedException - { - if ((!groundquests.isTaskActive(player, "outbreak_live_conversion_imperial", "speakPiett") && !groundquests.isTaskActive(player, "outbreak_switch_to_imperial", "speakPiett"))) - { - return; - } - groundquests.sendSignal(player, "liveConversionSpokePiett"); - } - - - public void captain_piett_action_revokeImpGrantReb(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_imperial")) - { - groundquests.clearQuest(player, "outbreak_live_conversion_imperial"); - groundquests.grantQuest(player, "outbreak_switch_to_rebel"); - } - if (groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_imperial")) - { - groundquests.clearQuest(player, "outbreak_switch_to_imperial"); - groundquests.grantQuest(player, "outbreak_switch_to_rebel"); - } - } - - - public void captain_piett_action_revokeImpGrantNeut(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_imperial")) - { - groundquests.clearQuest(player, "outbreak_live_conversion_imperial"); - groundquests.grantQuest(player, "outbreak_switch_to_neutral"); - } - if (groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_imperial")) - { - groundquests.clearQuest(player, "outbreak_switch_to_imperial"); - groundquests.grantQuest(player, "outbreak_switch_to_neutral"); - } - } - - - public void captain_piett_action_revokeEntireImpQuestLine(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_imperial")) - { - groundquests.clearQuest(player, "outbreak_live_conversion_imperial"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_imperial")) - { - groundquests.clearQuest(player, "outbreak_switch_to_imperial"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_imperial")) - { - groundquests.clearQuest(player, "outbreak_quest_01_imperial"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_b_imperial")) - { - groundquests.clearQuest(player, "outbreak_quest_01_b_imperial"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_imperial")) - { - groundquests.clearQuest(player, "outbreak_quest_02_imperial"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01b")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01b"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01c")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01c"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01d")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01d"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_02")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_02"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_03")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_03"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_04")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_04"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_05")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_05"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_06")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_06"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_07")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_07"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_08")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_08"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_09")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_09"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_10")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_10"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_11")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_11"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_12")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_12"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_13")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_13"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_14")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_14"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_15")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_15"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_16")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_16"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_shuttle_parts")) - { - groundquests.clearQuest(player, "outbreak_quest_shuttle_parts"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_imperial_01")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_imperial_01"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_imperial_02")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_imperial_02"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_imperial_03")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_imperial_03"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_imperial_04")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_imperial_04"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_01")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_01"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_02")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_02"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_02_imperial")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_02_imperial"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_03")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_03"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_04")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_04"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_05_imperial")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_05_imperial"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_final_imperial")) - { - groundquests.clearQuest(player, "outbreak_quest_final_imperial"); - } - - } - - - public void captain_piett_action_grantRebQuest(obj_id player, obj_id npc) throws InterruptedException - { - - groundquests.grantQuest(player, "outbreak_switch_to_rebel"); - } - - - public void captain_piett_action_grantImpQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_switch_to_imperial"); - } - - - public void captain_piett_action_grantNeutQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_switch_to_neutral"); - } - - - public int captain_piett_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_157")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_159"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_159")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_160"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_161"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 3); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_161")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - captain_piett_action_revokeEntireImpQuestLine (player, npc); - - string_id message = new string_id (c_stringFile, "s_162"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_163"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_165"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_163")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - captain_piett_action_grantImpQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_164"); - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_165")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - captain_piett_action_grantRebQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_167"); - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_166")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - captain_piett_action_grantNeutQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_168"); - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_124")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - string_id message = new string_id (c_stringFile, "s_125"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_126")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_128"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_128")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - doAnimationAction (player, "salute1"); - - captain_piett_action_completeQuest5 (player, npc); - - string_id message = new string_id (c_stringFile, "s_129"); - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_29")) - { - doAnimationAction (player, "salute1"); - - if (captain_piett_condition_isPlayerNeutral (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_141"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_143"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (captain_piett_condition_isPlayerRebel (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_140"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_142"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_192"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_141")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_145"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_149"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_143")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_146"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_150"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_149")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - captain_piett_action_revokeImpGrantNeut (player, npc); - - string_id message = new string_id (c_stringFile, "s_153"); - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_150")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_156"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_192"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 26); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_51")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_53"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_192")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_194"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_196"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 49); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_142")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_147"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_151"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_144")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_148"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_152"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_151")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - captain_piett_action_revokeImpGrantReb (player, npc); - - string_id message = new string_id (c_stringFile, "s_154"); - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_152")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_155"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_192"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 26); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_51")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_53"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_192")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_194"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_196"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 49); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_51")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_53"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_192")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_194"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_196"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 49); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_55")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_57"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 28); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_59")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 29); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_63")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nervous"); - - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_67")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_69"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 32); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_76")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_80"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_190"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_80")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_82"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_184"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_190")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_86"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_84")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_86"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_184")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_186"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_188"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 48); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_88")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_92"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_92")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_94"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_96"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_96")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_174"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_180"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_100")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_102"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_104"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_114")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_134")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_136"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_138"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 44); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_174")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_176"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_178"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 46); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_180")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - captain_piett_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_182"); - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch39(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_104")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - captain_piett_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_106"); - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_108")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_110"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 41); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch41(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_112")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_174"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_180"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch42(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_118")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_120"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_132"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch43(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_132")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_174"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_180"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch44(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_138")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_170"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_172"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 45); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch45(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_172")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_174"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_180"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch46(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_178")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_174"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_180"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch48(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_188")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_86"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch49(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_196")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_80"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_190"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int captain_piett_handleBranch50(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_200")) - { - - if (captain_piett_condition__defaultCondition (player, npc)) - { - captain_piett_action_grantImpQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_202"); - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.captain_piett"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.captain_piett"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (captain_piett_condition_hasCompletedAll (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_157"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 1); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "captain_piett", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (captain_piett_condition_hasCompletedMissions (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 8); - - npcStartConversation (player, npc, "captain_piett", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (captain_piett_condition_hasFoundStormtroopers (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_122"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (captain_piett_condition_hasSecondQuestImperial (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_121"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (captain_piett_condition_hasFirstQuestImperial (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (captain_piett_condition_isLiveConversion (player, npc)) - { - doAnimationAction (npc, "nod"); - - captain_piett_action_clearLiveConversion (player, npc); - - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_29"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 15); - - npcStartConversation (player, npc, "captain_piett", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (captain_piett_condition_hasDeletedLiveConversion (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_199"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (captain_piett_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_200"); - } - - utils.setScriptVar (player, "conversation.captain_piett.branchId", 50); - - npcStartConversation (player, npc, "captain_piett", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (captain_piett_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_204"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("captain_piett")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.captain_piett.branchId"); - - if (branchId == 1 && captain_piett_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && captain_piett_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && captain_piett_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && captain_piett_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && captain_piett_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && captain_piett_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && captain_piett_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && captain_piett_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && captain_piett_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && captain_piett_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && captain_piett_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && captain_piett_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && captain_piett_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && captain_piett_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && captain_piett_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && captain_piett_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && captain_piett_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && captain_piett_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && captain_piett_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && captain_piett_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && captain_piett_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && captain_piett_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && captain_piett_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && captain_piett_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && captain_piett_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && captain_piett_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && captain_piett_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && captain_piett_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && captain_piett_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 39 && captain_piett_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 41 && captain_piett_handleBranch41 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 42 && captain_piett_handleBranch42 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 43 && captain_piett_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 44 && captain_piett_handleBranch44 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 45 && captain_piett_handleBranch45 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 46 && captain_piett_handleBranch46 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 48 && captain_piett_handleBranch48 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 49 && captain_piett_handleBranch49 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 50 && captain_piett_handleBranch50 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.captain_piett.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/choster_lok_cantina.java b/sku.0/sys.server/compiled/game/script/conversation/choster_lok_cantina.java deleted file mode 100644 index 2ba035675..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/choster_lok_cantina.java +++ /dev/null @@ -1,3295 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class choster_lok_cantina extends script.base_script -{ - public choster_lok_cantina() - { - } - String c_stringFile = "conversation/choster_lok_cantina"; - - - public boolean choster_lok_cantina_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean choster_lok_cantina_condition_hasChosterTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_interview_choster", "findChoster"); - } - - - public boolean choster_lok_cantina_condition_hasCompletedPirate(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean choster_lok_cantina_condition_hasCompletedChoster(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.isTaskActive(player, "u16_nym_themepark_interview_choster", "tellVanaChosterMsg") || groundquests.hasCompletedQuest(player, "u16_nym_themepark_interview_choster")); - } - - - public boolean choster_lok_cantina_condition_hasSavedSheeli(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_negotiate_peace"); - } - - - public void choster_lok_cantina_action_finishChosterInterview(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasSpokenChoster"); - } - - - public int choster_lok_cantina_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_103"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_104"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 3); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_102")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "airguitar"); - - string_id message = new string_id (c_stringFile, "s_106"); - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_104")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - string_id message = new string_id (c_stringFile, "s_105"); - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_92")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_93")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_94")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_97"); - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_95")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_63")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_64")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_66")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_68")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_75"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_69")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_75")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_76"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_80"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_77")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_79")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_80")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_83")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_84")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_85")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_110")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_111")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_86")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - choster_lok_cantina_action_finishChosterInterview (player, npc); - - string_id message = new string_id (c_stringFile, "s_87"); - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_83")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_84")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_85")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_110")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_111")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_86")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - choster_lok_cantina_action_finishChosterInterview (player, npc); - - string_id message = new string_id (c_stringFile, "s_87"); - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_83")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_84")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_85")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_110")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_111")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_86")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - choster_lok_cantina_action_finishChosterInterview (player, npc); - - string_id message = new string_id (c_stringFile, "s_87"); - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_83")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_84")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_85")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_110")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_111")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_86")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - choster_lok_cantina_action_finishChosterInterview (player, npc); - - string_id message = new string_id (c_stringFile, "s_87"); - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_107")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_76"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_80"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_108")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_75"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int choster_lok_cantina_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_75"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.choster_lok_cantina"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.choster_lok_cantina"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (choster_lok_cantina_condition_hasSavedSheeli (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_52"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (choster_lok_cantina_condition_hasCompletedPirate (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_100"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_102"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 2); - - npcStartConversation (player, npc, "choster_lok_cantina", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (choster_lok_cantina_condition_hasCompletedChoster (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_92"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_94"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_95"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 6); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "choster_lok_cantina", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (choster_lok_cantina_condition_hasChosterTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_62"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - utils.setScriptVar (player, "conversation.choster_lok_cantina.branchId", 11); - - npcStartConversation (player, npc, "choster_lok_cantina", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (choster_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_61"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("choster_lok_cantina")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - if (branchId == 2 && choster_lok_cantina_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && choster_lok_cantina_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && choster_lok_cantina_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && choster_lok_cantina_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && choster_lok_cantina_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && choster_lok_cantina_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && choster_lok_cantina_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && choster_lok_cantina_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && choster_lok_cantina_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && choster_lok_cantina_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && choster_lok_cantina_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && choster_lok_cantina_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && choster_lok_cantina_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && choster_lok_cantina_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && choster_lok_cantina_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.choster_lok_cantina.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_eight.java b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_eight.java deleted file mode 100644 index b57b4479b..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_eight.java +++ /dev/null @@ -1,498 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class collections_ice_cream_part_eight extends script.base_script -{ - public collections_ice_cream_part_eight() - { - } - String c_stringFile = "conversation/collections_ice_cream_part_eight"; - - - public boolean collections_ice_cream_part_eight_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean collections_ice_cream_part_eight_condition_hasActiveTask(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_nore_brrea"); - } - return false; - } - - - public void collections_ice_cream_part_eight_action_signalNextTask(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "col_fried_icecream_part_08", 1); - groundquests.sendSignal(player, "meet_nore_brrea"); - } - - - public int collections_ice_cream_part_eight_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_eight_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_eight_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_eight_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_eight_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_eight_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_27")) - { - - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_eight_action_signalNextTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.collections_ice_cream_part_eight"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.collections_ice_cream_part_eight"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (collections_ice_cream_part_eight_condition_hasActiveTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_eight", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (collections_ice_cream_part_eight_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_30"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("collections_ice_cream_part_eight")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - if (branchId == 1 && collections_ice_cream_part_eight_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && collections_ice_cream_part_eight_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && collections_ice_cream_part_eight_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && collections_ice_cream_part_eight_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && collections_ice_cream_part_eight_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && collections_ice_cream_part_eight_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_eight.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_five.java b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_five.java deleted file mode 100644 index cb746b45f..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_five.java +++ /dev/null @@ -1,440 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class collections_ice_cream_part_five extends script.base_script -{ - public collections_ice_cream_part_five() - { - } - String c_stringFile = "conversation/collections_ice_cream_part_five"; - - - public boolean collections_ice_cream_part_five_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean collections_ice_cream_part_five_condition_hasActiveTask(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_kerhi_hilak"); - } - return false; - } - - - public void collections_ice_cream_part_five_action_signalNextTask(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "col_fried_icecream_part_05", 1); - groundquests.sendSignal(player, "meet_kerhi_hilak"); - } - - - public int collections_ice_cream_part_five_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_five_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_five_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_five_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_five_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_five_action_signalNextTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.collections_ice_cream_part_five"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.collections_ice_cream_part_five"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (collections_ice_cream_part_five_condition_hasActiveTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_five.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_five", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (collections_ice_cream_part_five_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("collections_ice_cream_part_five")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - if (branchId == 1 && collections_ice_cream_part_five_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && collections_ice_cream_part_five_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && collections_ice_cream_part_five_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && collections_ice_cream_part_five_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && collections_ice_cream_part_five_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_five.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_four.java b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_four.java deleted file mode 100644 index 6a846445c..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_four.java +++ /dev/null @@ -1,440 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class collections_ice_cream_part_four extends script.base_script -{ - public collections_ice_cream_part_four() - { - } - String c_stringFile = "conversation/collections_ice_cream_part_four"; - - - public boolean collections_ice_cream_part_four_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean collections_ice_cream_part_four_condition_hasActiveTask(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_eteto_topan"); - } - return false; - } - - - public void collections_ice_cream_part_four_action_signalNextTask(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "col_fried_icecream_part_04", 1); - groundquests.sendSignal(player, "meet_eteto_topan"); - } - - - public int collections_ice_cream_part_four_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_four_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_four_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_four_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_four_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_four_action_signalNextTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.collections_ice_cream_part_four"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.collections_ice_cream_part_four"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (collections_ice_cream_part_four_condition_hasActiveTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_four.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_four", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (collections_ice_cream_part_four_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("collections_ice_cream_part_four")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - if (branchId == 1 && collections_ice_cream_part_four_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && collections_ice_cream_part_four_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && collections_ice_cream_part_four_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && collections_ice_cream_part_four_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && collections_ice_cream_part_four_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_four.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_nine.java b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_nine.java deleted file mode 100644 index e5a588aa0..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_nine.java +++ /dev/null @@ -1,614 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class collections_ice_cream_part_nine extends script.base_script -{ - public collections_ice_cream_part_nine() - { - } - String c_stringFile = "conversation/collections_ice_cream_part_nine"; - - - public boolean collections_ice_cream_part_nine_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean collections_ice_cream_part_nine_condition_hasActiveTask(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_otonon_tracks"); - } - return false; - } - - - public void collections_ice_cream_part_nine_action_signalNextTask(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "col_fried_icecream_part_09", 1); - groundquests.sendSignal(player, "meet_otonon_tracks"); - } - - - public int collections_ice_cream_part_nine_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_nine_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_nine_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_nine_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_nine_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_nine_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_27")) - { - - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_31"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_nine_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_31")) - { - - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_nine_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_34")) - { - - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_nine_action_signalNextTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.collections_ice_cream_part_nine"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.collections_ice_cream_part_nine"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (collections_ice_cream_part_nine_condition_hasActiveTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_nine", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (collections_ice_cream_part_nine_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_38"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("collections_ice_cream_part_nine")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - if (branchId == 1 && collections_ice_cream_part_nine_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && collections_ice_cream_part_nine_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && collections_ice_cream_part_nine_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && collections_ice_cream_part_nine_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && collections_ice_cream_part_nine_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && collections_ice_cream_part_nine_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && collections_ice_cream_part_nine_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && collections_ice_cream_part_nine_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_nine.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_one.java b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_one.java deleted file mode 100644 index fecd5d7bd..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_one.java +++ /dev/null @@ -1,325 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class collections_ice_cream_part_one extends script.base_script -{ - public collections_ice_cream_part_one() - { - } - String c_stringFile = "conversation/collections_ice_cream_part_one"; - - - public boolean collections_ice_cream_part_one_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean collections_ice_cream_part_one_condition_hasActiveTask(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_hunde_decan"); - } - - return false; - } - - - public void collections_ice_cream_part_one_action_signalNextTask(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "col_fried_icecream_part_01", 1); - groundquests.sendSignal(player, "meet_hunde_decan"); - } - - - public int collections_ice_cream_part_one_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_one.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_one_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_one.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_one_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_one_action_signalNextTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_18"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.collections_ice_cream_part_one"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.collections_ice_cream_part_one"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (collections_ice_cream_part_one_condition_hasActiveTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_one.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_one", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (collections_ice_cream_part_one_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_17"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("collections_ice_cream_part_one")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); - - if (branchId == 1 && collections_ice_cream_part_one_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && collections_ice_cream_part_one_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && collections_ice_cream_part_one_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_one.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_seven.java b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_seven.java deleted file mode 100644 index 44ab973d2..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_seven.java +++ /dev/null @@ -1,440 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class collections_ice_cream_part_seven extends script.base_script -{ - public collections_ice_cream_part_seven() - { - } - String c_stringFile = "conversation/collections_ice_cream_part_seven"; - - - public boolean collections_ice_cream_part_seven_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean collections_ice_cream_part_seven_condition_hasActiveTask(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_lepwalk_chan"); - } - return false; - } - - - public void collections_ice_cream_part_seven_action_signalNextTask(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "col_fried_icecream_part_07", 1); - groundquests.sendSignal(player, "meet_lepwalk_chan"); - } - - - public int collections_ice_cream_part_seven_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_seven_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_seven_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_seven_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_seven_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_seven_action_signalNextTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.collections_ice_cream_part_seven"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.collections_ice_cream_part_seven"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (collections_ice_cream_part_seven_condition_hasActiveTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_seven", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (collections_ice_cream_part_seven_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("collections_ice_cream_part_seven")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - if (branchId == 1 && collections_ice_cream_part_seven_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && collections_ice_cream_part_seven_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && collections_ice_cream_part_seven_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && collections_ice_cream_part_seven_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && collections_ice_cream_part_seven_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_seven.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_six.java b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_six.java deleted file mode 100644 index a8a0dda18..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_six.java +++ /dev/null @@ -1,440 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class collections_ice_cream_part_six extends script.base_script -{ - public collections_ice_cream_part_six() - { - } - String c_stringFile = "conversation/collections_ice_cream_part_six"; - - - public boolean collections_ice_cream_part_six_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean collections_ice_cream_part_six_condition_hasActiveTask(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_tombl_blaus"); - } - return false; - } - - - public void collections_ice_cream_part_six_action_signalNextTask(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "col_fried_icecream_part_06", 1); - groundquests.sendSignal(player, "meet_tombl_blaus"); - } - - - public int collections_ice_cream_part_six_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_six_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_six_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_six_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_six_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_six_action_signalNextTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.collections_ice_cream_part_six"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.collections_ice_cream_part_six"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (collections_ice_cream_part_six_condition_hasActiveTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_six.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_six", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (collections_ice_cream_part_six_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("collections_ice_cream_part_six")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - if (branchId == 1 && collections_ice_cream_part_six_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && collections_ice_cream_part_six_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && collections_ice_cream_part_six_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && collections_ice_cream_part_six_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && collections_ice_cream_part_six_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_six.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_ten.java b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_ten.java deleted file mode 100644 index 8c7a88044..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_ten.java +++ /dev/null @@ -1,498 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class collections_ice_cream_part_ten extends script.base_script -{ - public collections_ice_cream_part_ten() - { - } - String c_stringFile = "conversation/collections_ice_cream_part_ten"; - - - public boolean collections_ice_cream_part_ten_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean collections_ice_cream_part_ten_condition_hasActiveTask(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_ice_cream_man"); - } - return false; - } - - - public void collections_ice_cream_part_ten_action_signalNextTask(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "col_fried_icecream_part_10", 1); - groundquests.sendSignal(player, "meet_ice_cream_man"); - } - - - public int collections_ice_cream_part_ten_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_ten_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_ten_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_ten_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_ten_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_35")) - { - - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_37"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_ten_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_37")) - { - - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_ten_action_signalNextTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_38"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.collections_ice_cream_part_ten"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.collections_ice_cream_part_ten"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (collections_ice_cream_part_ten_condition_hasActiveTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_ten", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (collections_ice_cream_part_ten_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_30"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("collections_ice_cream_part_ten")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - if (branchId == 1 && collections_ice_cream_part_ten_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && collections_ice_cream_part_ten_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && collections_ice_cream_part_ten_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && collections_ice_cream_part_ten_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && collections_ice_cream_part_ten_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && collections_ice_cream_part_ten_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_ten.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_three.java b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_three.java deleted file mode 100644 index aee3fb610..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_three.java +++ /dev/null @@ -1,383 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class collections_ice_cream_part_three extends script.base_script -{ - public collections_ice_cream_part_three() - { - } - String c_stringFile = "conversation/collections_ice_cream_part_three"; - - - public boolean collections_ice_cream_part_three_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean collections_ice_cream_part_three_condition_hasActiveTask(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_mikfa_faaus"); - } - return false; - } - - - public void collections_ice_cream_part_three_action_signalNextTask(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "col_fried_icecream_part_03", 1); - groundquests.sendSignal(player, "meet_mikfa_faaus"); - } - - - public int collections_ice_cream_part_three_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_three_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_three_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_three_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_three_action_signalNextTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_20"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.collections_ice_cream_part_three"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.collections_ice_cream_part_three"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (collections_ice_cream_part_three_condition_hasActiveTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_three.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_three", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (collections_ice_cream_part_three_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_22"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("collections_ice_cream_part_three")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - if (branchId == 1 && collections_ice_cream_part_three_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && collections_ice_cream_part_three_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && collections_ice_cream_part_three_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && collections_ice_cream_part_three_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_three.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_two.java b/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_two.java deleted file mode 100644 index 774523d78..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/collections_ice_cream_part_two.java +++ /dev/null @@ -1,440 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class collections_ice_cream_part_two extends script.base_script -{ - public collections_ice_cream_part_two() - { - } - String c_stringFile = "conversation/collections_ice_cream_part_two"; - - - public boolean collections_ice_cream_part_two_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean collections_ice_cream_part_two_condition_hasActiveTask(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter9_ice_cream")) - { - return groundquests.isTaskActive(player, "chapter9_ice_cream", "meet_amyva_vanew"); - } - return false; - } - - - public void collections_ice_cream_part_two_action_signalNextTask(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "col_fried_icecream_part_02", 1); - groundquests.sendSignal(player, "meet_amyva_vanew"); - } - - - public int collections_ice_cream_part_two_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_two_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_two_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_two_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int collections_ice_cream_part_two_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - collections_ice_cream_part_two_action_signalNextTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_24"); - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.collections_ice_cream_part_two"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.collections_ice_cream_part_two"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (collections_ice_cream_part_two_condition_hasActiveTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.collections_ice_cream_part_two.branchId", 1); - - npcStartConversation (player, npc, "collections_ice_cream_part_two", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (collections_ice_cream_part_two_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("collections_ice_cream_part_two")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - if (branchId == 1 && collections_ice_cream_part_two_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && collections_ice_cream_part_two_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && collections_ice_cream_part_two_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && collections_ice_cream_part_two_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && collections_ice_cream_part_two_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.collections_ice_cream_part_two.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/delivery_chardle.java b/sku.0/sys.server/compiled/game/script/conversation/delivery_chardle.java deleted file mode 100644 index cb2414dae..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/delivery_chardle.java +++ /dev/null @@ -1,601 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class delivery_chardle extends script.base_script -{ - public delivery_chardle() - { - } - String c_stringFile = "conversation/delivery_chardle"; - - - public boolean delivery_chardle_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean delivery_chardle_condition_noAntivirus(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); - } - - - public boolean delivery_chardle_condition_hasNotFoundBeta(obj_id player, obj_id npc) throws InterruptedException - { - return !hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_epsilon"); - } - - - public boolean delivery_chardle_condition_neverDelivered(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!groundquests.isQuestActiveOrComplete(player, "camp_delta_delivery_01")); - } - - - public boolean delivery_chardle_condition_hasMeetingTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "camp_delta_delivery_01", "getBeastDelta"); - } - - - public boolean delivery_chardle_condition_hasEscortTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "camp_delta_delivery_01", "escortTaskDelta"); - } - - - public boolean delivery_chardle_condition_hasDeliveredBefore(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "camp_delta_delivery_01"); - } - - - public boolean delivery_chardle_condition_tooLowLevel(obj_id player, obj_id npc) throws InterruptedException - { - return getLevel(player) < 60; - } - - - public void delivery_chardle_action_giveQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (groundquests.hasCompletedQuest(player, "camp_delta_delivery_01")) - { - delivery_chardle_action_clearDeliveryQuest(player, npc); - } - groundquests.grantQuest(player, "camp_delta_delivery_01"); - } - - - public void delivery_chardle_action_clearDeliveryQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.clearQuest(player, "camp_delta_delivery_01"); - } - - - public int delivery_chardle_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_96")) - { - - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_chardle_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_chardle_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_20")) - { - - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_chardle_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_chardle_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_28")) - { - - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - delivery_chardle_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_chardle_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_34")) - { - - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - delivery_chardle_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.delivery_chardle"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.delivery_chardle"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (delivery_chardle_condition_noAntivirus (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_chardle_condition_tooLowLevel (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_chardle_condition_hasNotFoundBeta (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_chardle_condition_hasEscortTask (player, npc)) - { - delivery_chardle_action_clearDeliveryQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_16"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_chardle_condition_hasMeetingTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_15"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_chardle_condition_neverDelivered (player, npc)) - { - doAnimationAction (npc, "thumb_up"); - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_96"); - } - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 6); - - npcStartConversation (player, npc, "delivery_chardle", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (delivery_chardle_condition_hasDeliveredBefore (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - utils.setScriptVar (player, "conversation.delivery_chardle.branchId", 12); - - npcStartConversation (player, npc, "delivery_chardle", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (delivery_chardle_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_60"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("delivery_chardle")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.delivery_chardle.branchId"); - - if (branchId == 6 && delivery_chardle_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && delivery_chardle_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && delivery_chardle_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && delivery_chardle_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && delivery_chardle_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && delivery_chardle_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.delivery_chardle.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/delivery_hassel.java b/sku.0/sys.server/compiled/game/script/conversation/delivery_hassel.java deleted file mode 100644 index 129aaf146..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/delivery_hassel.java +++ /dev/null @@ -1,646 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.groundquests; -import script.library.utils; - - -public class delivery_hassel extends script.base_script -{ - public delivery_hassel() - { - } - String c_stringFile = "conversation/delivery_hassel"; - - - public boolean delivery_hassel_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean delivery_hassel_condition_noAntivirus(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); - } - - - public boolean delivery_hassel_condition_hasNotFoundNextCamp(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!hasObjVar(npc, "questName")) - { - return false; - } - - String questName = getStringObjVar(npc, "questName"); - if (questName == null || questName.length() <= 0) - { - return false; - } - - String collectionSlot = ""; - if (questName.startsWith("camp_alpha_delivery_0")) - { - collectionSlot = "exp_icon_deathtroopers_camp_beta"; - } - else if (questName.startsWith("camp_beta_delivery_0")) - { - collectionSlot = "exp_icon_deathtroopers_camp_gamma"; - } - else if (questName.startsWith("camp_gamma_delivery_0")) - { - collectionSlot = "exp_icon_deathtroopers_camp_delta"; - } - else if (questName.startsWith("camp_delta_delivery_0")) - { - collectionSlot = "exp_icon_deathtroopers_camp_epsilon"; - } - - if (collectionSlot == null || collectionSlot.length() <= 0) - { - return false; - } - - return !hasCompletedCollectionSlot(player, collectionSlot); - } - - - public boolean delivery_hassel_condition_neverDelivered(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!hasObjVar(npc, "questName")) - { - return false; - } - - String questName = getStringObjVar(npc, "questName"); - if (questName == null || questName.length() <= 0) - { - return false; - } - return (!groundquests.isQuestActiveOrComplete(player, questName)); - } - - - public boolean delivery_hassel_condition_hasDeliveredBefore(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!hasObjVar(npc, "questName")) - { - return false; - } - - String questName = getStringObjVar(npc, "questName"); - if (questName == null || questName.length() <= 0) - { - return false; - } - - return groundquests.hasCompletedQuest(player, questName); - } - - - public boolean delivery_hassel_condition_hasQuestCompleted(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!hasObjVar(npc, "questName")) - { - return false; - } - - String questName = getStringObjVar(npc, "questName"); - if (questName == null || questName.length() <= 0) - { - return false; - } - - return (groundquests.hasCompletedQuest(player, questName)); - } - - - public void delivery_hassel_action_giveQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!hasObjVar(npc, "questName")) - { - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() npc "+npc+" has no questName objvar. Aborting the camp defense functionality."); - return; - } - - String questName = getStringObjVar(npc, "questName"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() npc "+npc+" has an invalid questName objvar. Aborting the camp defense functionality."); - return; - } - - if (groundquests.hasCompletedQuest(player, questName)) - { - groundquests.clearQuest(player, questName); - } - - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" has questName: "+questName+"."); - - String creatureName = getStringObjVar(npc, "creature_type"); - if (creatureName == null || creatureName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" has an invalid creatureName. Aborting the camp defense functionality."); - return; - } - - int combatLevel = getLevel(player); - if (combatLevel < 0 || combatLevel > 90) - { - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() Player "+player+" has a level that is invalid. Player level is: "+combatLevel+". Aborting the camp defense."); - return; - } - - int maxLevel = getIntObjVar(npc, "maxLevel"); - if (maxLevel < 0 || maxLevel > 90) - { - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" has an invalid maxLevel. Aborting the camp defense."); - return; - } - - if (combatLevel > maxLevel) - { - combatLevel = maxLevel; - } - - CustomerServiceLog("outbreak_themepark", "conversation.delivery_hassel() NPC "+npc+" is attempting to give player: "+player+" the quest: "+questName+"."); - - groundquests.grantQuest(player, questName); - - setObjVar(npc, "combatLevel", combatLevel); - setObjVar(npc, "owner", player); - setObjVar(npc, create.INITIALIZE_CREATURE_DO_NOT_SCALE_OBJVAR, 1); - - dictionary creatureDict = utils.dataTableGetRow("datatables/mob/creatures.iff", creatureName); - if (creatureDict != null) - { - create.initializeCreature (npc, creatureName, creatureDict, combatLevel); - } - - setName(npc, "Delivery Volunteer ("+getPlayerName(player)+")"); - setInvulnerable(npc, false); - utils.setScriptVar(npc, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - clearCondition(npc, CONDITION_CONVERSABLE); - clearCondition(npc, CONDITION_INTERESTING); - setAttrib(npc, HEALTH, getMaxAttrib( npc, HEALTH )); - messageTo(npc, "startBeastDeliveryPathing", null, 1, false); - } - - - public void delivery_hassel_action_clearDeliveryQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!hasObjVar(npc, "questName")) - { - return; - } - - String questName = getStringObjVar(npc, "questName"); - if (questName == null || questName.length() <= 0) - { - return; - } - groundquests.clearQuest(player, questName); - } - - - public int delivery_hassel_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_96")) - { - - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_13"); - } - - utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_hassel_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_13")) - { - - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_17"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_hassel_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_hassel_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - delivery_hassel_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_40"); - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_hassel_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_33")) - { - - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - delivery_hassel_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.delivery_hassel"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.delivery_hassel"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (delivery_hassel_condition_noAntivirus (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_hassel_condition_hasNotFoundNextCamp (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_hassel_condition_neverDelivered (player, npc)) - { - doAnimationAction (npc, "thumb_up"); - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_96"); - } - - utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 3); - - npcStartConversation (player, npc, "delivery_hassel", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (delivery_hassel_condition_hasDeliveredBefore (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_33"); - } - - utils.setScriptVar (player, "conversation.delivery_hassel.branchId", 8); - - npcStartConversation (player, npc, "delivery_hassel", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (delivery_hassel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_60"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("delivery_hassel")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.delivery_hassel.branchId"); - - if (branchId == 3 && delivery_hassel_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && delivery_hassel_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && delivery_hassel_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && delivery_hassel_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && delivery_hassel_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.delivery_hassel.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/delivery_pirrohn.java b/sku.0/sys.server/compiled/game/script/conversation/delivery_pirrohn.java deleted file mode 100644 index 00d67edd8..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/delivery_pirrohn.java +++ /dev/null @@ -1,601 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class delivery_pirrohn extends script.base_script -{ - public delivery_pirrohn() - { - } - String c_stringFile = "conversation/delivery_pirrohn"; - - - public boolean delivery_pirrohn_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean delivery_pirrohn_condition_noAntivirus(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); - } - - - public boolean delivery_pirrohn_condition_hasNotFoundBeta(obj_id player, obj_id npc) throws InterruptedException - { - return !hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_gamma"); - } - - - public boolean delivery_pirrohn_condition_neverDelivered(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!groundquests.isQuestActiveOrComplete(player, "camp_beta_delivery_01")); - } - - - public boolean delivery_pirrohn_condition_hasMeetingTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "camp_beta_delivery_01", "getBeastBeta"); - } - - - public boolean delivery_pirrohn_condition_hasEscortTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "camp_beta_delivery_01", "escortTaskBeta"); - } - - - public boolean delivery_pirrohn_condition_hasDeliveredBefore(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "camp_beta_delivery_01"); - } - - - public boolean delivery_pirrohn_condition_tooLowLevel(obj_id player, obj_id npc) throws InterruptedException - { - return getLevel(player) < 20; - } - - - public void delivery_pirrohn_action_giveQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (groundquests.hasCompletedQuest(player, "camp_beta_delivery_01")) - { - delivery_pirrohn_action_clearDeliveryQuest(player, npc); - } - groundquests.grantQuest(player, "camp_beta_delivery_01"); - } - - - public void delivery_pirrohn_action_clearDeliveryQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.clearQuest(player, "camp_beta_delivery_01"); - } - - - public int delivery_pirrohn_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_96")) - { - - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_pirrohn_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_pirrohn_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_20")) - { - - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_pirrohn_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_pirrohn_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_28")) - { - - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - delivery_pirrohn_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int delivery_pirrohn_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_34")) - { - - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - delivery_pirrohn_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.delivery_pirrohn"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.delivery_pirrohn"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (delivery_pirrohn_condition_noAntivirus (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_pirrohn_condition_tooLowLevel (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_pirrohn_condition_hasNotFoundBeta (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_pirrohn_condition_hasEscortTask (player, npc)) - { - delivery_pirrohn_action_clearDeliveryQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_16"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_pirrohn_condition_hasMeetingTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_15"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (delivery_pirrohn_condition_neverDelivered (player, npc)) - { - doAnimationAction (npc, "thumb_up"); - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_96"); - } - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 6); - - npcStartConversation (player, npc, "delivery_pirrohn", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (delivery_pirrohn_condition_hasDeliveredBefore (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - utils.setScriptVar (player, "conversation.delivery_pirrohn.branchId", 12); - - npcStartConversation (player, npc, "delivery_pirrohn", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (delivery_pirrohn_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_60"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("delivery_pirrohn")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - if (branchId == 6 && delivery_pirrohn_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && delivery_pirrohn_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && delivery_pirrohn_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && delivery_pirrohn_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && delivery_pirrohn_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && delivery_pirrohn_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.delivery_pirrohn.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/detainment_npc_rescue.java b/sku.0/sys.server/compiled/game/script/conversation/detainment_npc_rescue.java deleted file mode 100644 index 38dfd24da..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/detainment_npc_rescue.java +++ /dev/null @@ -1,412 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.buff; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.static_item; -import script.library.utils; - - -public class detainment_npc_rescue extends script.base_script -{ - public detainment_npc_rescue() - { - } - String c_stringFile = "conversation/detainment_npc_rescue"; - - - public boolean detainment_npc_rescue_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean detainment_npc_rescue_condition_hasTheMisionActiveAndIsMyRescuer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!hasObjVar(npc, "rescuer") || !hasObjVar(npc, "rescuerQuest")) - { - return false; - } - - obj_id rescuer = getObjIdObjVar(npc, "rescuer"); - if (!isValidId(rescuer) || !exists(rescuer)) - { - return false; - } - - if (rescuer != player) - { - return false; - } - - String activeQuest = getStringObjVar(npc, "rescuerQuest"); - if (activeQuest == null || activeQuest.length() <= 0) - { - return false; - } - - if (!groundquests.isQuestActive(player, activeQuest)) - { - return false; - } - - return true; - } - - - public boolean detainment_npc_rescue_condition_isNotMyRescuer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!hasObjVar(npc, "rescuer") || !hasObjVar(npc, "rescuerQuest")) - { - return true; - } - - obj_id rescuer = getObjIdObjVar(npc, "rescuer"); - if (!isValidId(rescuer) || !exists(rescuer)) - { - return true; - } - - if (rescuer != player) - { - return true; - } - - return false; - } - - - public void detainment_npc_rescue_action_changeIntoDisguiseIncrCollection(obj_id player, obj_id npc) throws InterruptedException - { - String disguise = getStringObjVar(npc, "disguise"); - if (disguise == null || disguise.length() <= 0) - { - LOG("empire_day_trigger", "The disguise objvar is missing"); - destroyObject(npc); - return; - } - if (disguise.startsWith("reb_")) - { - LOG("empire_day_trigger", "CONVERSATION: imp disguise found, reb collection"); - if (hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_RESCUE_COUNTER_SLOT)) - { - modifyCollectionSlotValue(player, holiday.IMPERIAL_RESCUE_COUNTER_SLOT, 1); - } - } - else - { - LOG("empire_day_trigger", "CONVERSATION: imp disguise found, reb collection"); - if (hasCompletedCollectionSlotPrereq(player, holiday.REBEL_RESCUE_COUNTER_SLOT)) - { - modifyCollectionSlotValue(player, holiday.REBEL_RESCUE_COUNTER_SLOT, 1); - } - } - groundquests.sendSignal(player, "hasReceivedDisguise"); - - location mobLoc = getLocation(npc); - if (mobLoc == null) - { - LOG("empire_day_trigger", "The location of the mob is missing"); - destroyObject(npc); - return; - } - - obj_id rescuer = getObjIdObjVar(npc, "rescuer"); - if (!isValidId(rescuer) || !exists(rescuer)) - { - LOG("empire_day_trigger", "The rescuer objvar is missing"); - destroyObject(npc); - return; - } - obj_id mob = create.object(disguise, mobLoc, 100); - if (!isValidId(mob)) - { - LOG("empire_day_trigger", "The Mob was not properly created"); - } - setObjVar(mob, "rescuer", rescuer); - destroyObject(npc); - } - - - public String detainment_npc_rescue_tokenTO_timeLeftRecruitment(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public String detainment_npc_rescue_tokenTO_timeLeftPropaganda(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public int detainment_npc_rescue_tokenDI_notUsed(obj_id player, obj_id npc) throws InterruptedException - { - return 0; - } - - - public int detainment_npc_rescue_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_79")) - { - - if (detainment_npc_rescue_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_80"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (detainment_npc_rescue_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_8"); - } - - utils.setScriptVar (player, "conversation.detainment_npc_rescue.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.detainment_npc_rescue.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int detainment_npc_rescue_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_8")) - { - - if (detainment_npc_rescue_condition__defaultCondition (player, npc)) - { - detainment_npc_rescue_action_changeIntoDisguiseIncrCollection (player, npc); - - string_id message = new string_id (c_stringFile, "s_10"); - utils.removeScriptVar (player, "conversation.detainment_npc_rescue.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.detainment_npc_rescue"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.detainment_npc_rescue"); - - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (detainment_npc_rescue_condition_isNotMyRescuer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_81"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (detainment_npc_rescue_condition_hasTheMisionActiveAndIsMyRescuer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (detainment_npc_rescue_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - utils.setScriptVar (player, "conversation.detainment_npc_rescue.branchId", 2); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "detainment_npc_rescue", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("detainment_npc_rescue")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.detainment_npc_rescue.branchId"); - - if (branchId == 2 && detainment_npc_rescue_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && detainment_npc_rescue_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.detainment_npc_rescue.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/disgruntled_leader.java b/sku.0/sys.server/compiled/game/script/conversation/disgruntled_leader.java deleted file mode 100644 index 846e9215a..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/disgruntled_leader.java +++ /dev/null @@ -1,494 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class disgruntled_leader extends script.base_script -{ - public disgruntled_leader() - { - } - String c_stringFile = "conversation/disgruntled_leader"; - - - public boolean disgruntled_leader_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean disgruntled_leader_condition_hasQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findTownsPeople"); - - } - - - public boolean disgruntled_leader_condition_hasFinishedQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_return_townsperson", "returnToTownsPerson"); - } - - - public boolean disgruntled_leader_condition_isWorkingOnIt(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findFiltrationGuy") || (groundquests.hasCompletedQuest(player, "u16_nym_meet_townspeople") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson")); - } - - - public void disgruntled_leader_action_signalToGoToNym(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundTownsPeopleAgain"); - } - - - public void disgruntled_leader_action_hasMetTownsPeople(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundTownsPeople"); - } - - - public int disgruntled_leader_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_17")) - { - doAnimationAction (player, "shake_head_disgust"); - - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - disgruntled_leader_action_signalToGoToNym (player, npc); - - string_id message = new string_id (c_stringFile, "s_18"); - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int disgruntled_leader_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_10")) - { - doAnimationAction (player, "point_to_self"); - - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int disgruntled_leader_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - doAnimationAction (player, "taken_aback"); - - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "poke"); - - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_21"); - } - - utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int disgruntled_leader_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_21")) - { - doAnimationAction (player, "taken_aback"); - - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_25"); - } - - utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int disgruntled_leader_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_25")) - { - - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - disgruntled_leader_action_hasMetTownsPeople (player, npc); - - string_id message = new string_id (c_stringFile, "s_27"); - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.disgruntled_leader"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.disgruntled_leader"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (disgruntled_leader_condition_hasFinishedQuest (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - string_id message = new string_id (c_stringFile, "s_16"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_17"); - } - - utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 1); - - npcStartConversation (player, npc, "disgruntled_leader", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (disgruntled_leader_condition_isWorkingOnIt (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - doAnimationAction (player, "standing_placate"); - - string_id message = new string_id (c_stringFile, "s_29"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (disgruntled_leader_condition_hasQuest (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - string_id message = new string_id (c_stringFile, "s_8"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_10"); - } - - utils.setScriptVar (player, "conversation.disgruntled_leader.branchId", 4); - - npcStartConversation (player, npc, "disgruntled_leader", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (disgruntled_leader_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - string_id message = new string_id (c_stringFile, "s_30"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("disgruntled_leader")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.disgruntled_leader.branchId"); - - if (branchId == 1 && disgruntled_leader_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && disgruntled_leader_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && disgruntled_leader_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && disgruntled_leader_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && disgruntled_leader_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.disgruntled_leader.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/doctor_griffax_jin.java b/sku.0/sys.server/compiled/game/script/conversation/doctor_griffax_jin.java deleted file mode 100644 index 9c735d9ca..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/doctor_griffax_jin.java +++ /dev/null @@ -1,496 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.groundquests; -import script.library.utils; - - -public class doctor_griffax_jin extends script.base_script -{ - public doctor_griffax_jin() - { - } - String c_stringFile = "conversation/doctor_griffax_jin"; - - - public boolean doctor_griffax_jin_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean doctor_griffax_jin_condition_hasTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "outbreak_quest_facility_04", "findJin") || groundquests.isTaskActive(player, "outbreak_quest_facility_04", "defeatJin"); - } - - - public void doctor_griffax_jin_action_transformMonster(obj_id player, obj_id npc) throws InterruptedException - { - npcEndConversation (npc); - string_id barkString = new string_id("theme_park/outbreak/outbreak", "griffax_jin_last_words"); - chat.chat(npc, barkString); - - dictionary params = new dictionary(); - params.put("player", player); - messageTo(npc, "transformIntoMonster", params, 4, false); - ai_lib.setMood(npc, "npc_dead_02"); - } - - - public int doctor_griffax_jin_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_39")) - { - - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - utils.setScriptVar (player, "conversation.doctor_griffax_jin.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.doctor_griffax_jin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int doctor_griffax_jin_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_41")) - { - - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_43"); - } - - utils.setScriptVar (player, "conversation.doctor_griffax_jin.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.doctor_griffax_jin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int doctor_griffax_jin_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_43")) - { - - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_45"); - } - - utils.setScriptVar (player, "conversation.doctor_griffax_jin.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.doctor_griffax_jin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int doctor_griffax_jin_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_45")) - { - - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.doctor_griffax_jin.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.doctor_griffax_jin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int doctor_griffax_jin_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - doctor_griffax_jin_action_transformMonster (player, npc); - - string_id message = new string_id (c_stringFile, "s_56"); - utils.removeScriptVar (player, "conversation.doctor_griffax_jin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - public static final String MENU_STRING_FILE = "theme_park/outbreak/outbreak"; - public static final string_id SID_NOT_ENOUGH_POWER = new string_id(MENU_STRING_FILE, "not_enough_power"); - public static final string_id SID_MAIN_PWR_ON = new string_id(MENU_STRING_FILE, "main_power_on"); - public static final string_id SID_MAIN_PWR_OFF = new string_id(MENU_STRING_FILE, "main_power_off"); - public static final string_id SID_BKUP_PWR_ON = new string_id(MENU_STRING_FILE, "backup_power_on"); - public static final string_id SID_BKUP_PWR_OFF = new string_id(MENU_STRING_FILE, "backup_power_off"); - public static final string_id SID_DMG_CTRL_SYS_ON = new string_id(MENU_STRING_FILE, "damage_control_info_sys_on"); - public static final string_id SID_DMG_CTRL_SYS_OFF = new string_id(MENU_STRING_FILE, "damage_control_info_sys_off"); - public static final string_id SID_COMM_SYS_ON = new string_id(MENU_STRING_FILE, "internal_communications_sys_on"); - public static final string_id SID_COMM_SYS_OFF = new string_id(MENU_STRING_FILE, "internal_communications_sys_off"); - public static final string_id SID_ACCESS_DENIED = new string_id(MENU_STRING_FILE, "access_denied"); - public static final string_id SID_NO_BKUP_PWR = new string_id(MENU_STRING_FILE, "no_bkup_power"); - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.doctor_griffax_jin"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.doctor_griffax_jin"); - - return SCRIPT_CONTINUE; - } - - - public int transformIntoMonster(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - if (!params.containsKey("player")) - { - CustomerServiceLog("outbreak_themepark", "doctor_griffax_jin.transformIntoMonster() player param not found."); - return SCRIPT_CONTINUE; - } - obj_id player = params.getObjId("player"); - if (!isValidId(player) || !exists(player)) - { - CustomerServiceLog("outbreak_themepark", "doctor_griffax_jin.transformIntoMonster() player OID invalid."); - return SCRIPT_CONTINUE; - } - npcEndConversation (self); - groundquests.sendSignal(player, "hasFoundJin"); - location curLoc = getLocation(self); - if (curLoc == null) - { - return SCRIPT_CONTINUE; - } - - obj_id mob = create.object("outbreak_scientist_griffax_jin_afflicted", curLoc); - if (!isValidId(mob) || !exists(mob)) - { - return SCRIPT_CONTINUE; - } - - setObjVar(mob, "owner", player); - startCombat(mob, player); - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (doctor_griffax_jin_condition_hasTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - utils.setScriptVar (player, "conversation.doctor_griffax_jin.branchId", 1); - - npcStartConversation (player, npc, "doctor_griffax_jin", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (doctor_griffax_jin_condition__defaultCondition (player, npc)) - { - doAnimationAction (player, "shrug_shoulders"); - - string_id message = new string_id (c_stringFile, "s_65"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("doctor_griffax_jin")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.doctor_griffax_jin.branchId"); - - if (branchId == 1 && doctor_griffax_jin_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && doctor_griffax_jin_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && doctor_griffax_jin_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && doctor_griffax_jin_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && doctor_griffax_jin_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.doctor_griffax_jin.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/ep3_rodian_junk_dealer.java b/sku.0/sys.server/compiled/game/script/conversation/ep3_rodian_junk_dealer.java deleted file mode 100644 index 14e56b0ff..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/ep3_rodian_junk_dealer.java +++ /dev/null @@ -1,268 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.smuggler; -import script.library.utils; - - -public class ep3_rodian_junk_dealer extends script.base_script -{ - public ep3_rodian_junk_dealer() - { - } - String c_stringFile = "conversation/ep3_rodian_junk_dealer"; - - - public boolean ep3_rodian_junk_dealer_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean ep3_rodian_junk_dealer_condition_checkBuyBackContainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!smuggler.hasBuyBackContainer(player)) - { - ep3_rodian_junk_dealer_action_createBuyBackContainer(player, npc); - } - return true; - } - - - public boolean ep3_rodian_junk_dealer_condition_hasBuyBackItems(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - obj_id[] listOfBuyBacks = smuggler.getBuyBackItemsInContainer(player); - return listOfBuyBacks != null && listOfBuyBacks.length > 0; - } - - - public void ep3_rodian_junk_dealer_action_start_dealing(obj_id player, obj_id npc) throws InterruptedException - { - playClientEffectObj(npc, "clienteffect/voc_wookiee_med_4sec.cef", player, ""); - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startDealing", params, 1.0f, false); - } - - - public void ep3_rodian_junk_dealer_action_startBuyBack(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startBuyBack", params, 0.0f, false); - } - - - public void ep3_rodian_junk_dealer_action_startFlagNoSale(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); - } - - - public void ep3_rodian_junk_dealer_action_createBuyBackContainer(obj_id player, obj_id npc) throws InterruptedException - { - if (!isValidId(smuggler.createBuyBackContainerOnPlayer(player))) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: "+ player + ") did not get his buy back container set up properly."); - } - } - - - public int ep3_rodian_junk_dealer_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_54fab04f")) - { - - if (ep3_rodian_junk_dealer_condition__defaultCondition (player, npc)) - { - ep3_rodian_junk_dealer_action_start_dealing (player, npc); - - string_id message = new string_id (c_stringFile, "s_84a67771"); - utils.removeScriptVar (player, "conversation.ep3_rodian_junk_dealer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_cd7a3f41")) - { - - if (ep3_rodian_junk_dealer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4bd9d15e"); - utils.removeScriptVar (player, "conversation.ep3_rodian_junk_dealer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isMob (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.ep3_rodian_junk_dealer"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - faceTo(self, player); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.ep3_rodian_junk_dealer"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (ep3_rodian_junk_dealer_condition_checkBuyBackContainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_bef51e38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (ep3_rodian_junk_dealer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (ep3_rodian_junk_dealer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_cd7a3f41"); - } - - utils.setScriptVar (player, "conversation.ep3_rodian_junk_dealer.branchId", 1); - - npcStartConversation (player, npc, "ep3_rodian_junk_dealer", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("ep3_rodian_junk_dealer")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.ep3_rodian_junk_dealer.branchId"); - - if (branchId == 1 && ep3_rodian_junk_dealer_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.ep3_rodian_junk_dealer.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/ep3_wke_junk_dealer.java b/sku.0/sys.server/compiled/game/script/conversation/ep3_wke_junk_dealer.java deleted file mode 100644 index 08acd54b3..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/ep3_wke_junk_dealer.java +++ /dev/null @@ -1,422 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.smuggler; -import script.library.utils; - - -public class ep3_wke_junk_dealer extends script.base_script -{ - public ep3_wke_junk_dealer() - { - } - String c_stringFile = "conversation/ep3_wke_junk_dealer"; - - - public boolean ep3_wke_junk_dealer_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean ep3_wke_junk_dealer_condition_check_inv(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - String datatable = "datatables/npc/junk_dealer/junk_dealer.iff"; - - String item = ""; - String itemTemplate = ""; - - int itemLength = dataTableGetNumRows(datatable); - - int x = 0; - int y = 0; - - obj_id inventory = utils.getInventoryContainer(player); - - if (isIdValid(inventory)) - { - obj_id[] contents = utils.getContents(inventory, true); - - if (contents != null) - { - for (x = 0; x < contents.length; x++) - { - testAbortScript(); - y = 0; - if (hasObjVar(contents[x], "junkDealer.intPrice")) - { - return true; - } - - if (!isCrafted(contents[x])) - { - itemTemplate = getTemplateName(contents[x]); - - while (y < itemLength) - { - testAbortScript(); - - item = dataTableGetString(datatable, y, "items"); - - if (itemTemplate.equals(item)) - { - - return true; - } - - y++; - } - } - } - } - } - - return false; - } - - - public boolean ep3_wke_junk_dealer_condition_cannotSpeakWookiee(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (hasSkill(player, "combat_smuggler_underworld_01")) - { - return false; - } - if (hasSkill(player, "social_language_wookiee_comprehend")) - { - return false; - } - else - { - return true; - } - } - - - public boolean ep3_wke_junk_dealer_condition_checkBuyBackContainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - faceTo(npc, player); - if (!smuggler.hasBuyBackContainer(player)) - { - ep3_wke_junk_dealer_action_createBuyBackContainer(player, npc); - } - return true; - } - - - public boolean ep3_wke_junk_dealer_condition_hasBuyBackItems(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - obj_id[] listOfBuyBacks = smuggler.getBuyBackItemsInContainer(player); - return listOfBuyBacks != null && listOfBuyBacks.length > 0; - } - - - public void ep3_wke_junk_dealer_action_start_dealing(obj_id player, obj_id npc) throws InterruptedException - { - playClientEffectObj(npc, "clienteffect/voc_wookiee_med_4sec.cef", player, ""); - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startDealing", params, 1.0f, false); - } - - - public void ep3_wke_junk_dealer_action_vocalizeMed(obj_id player, obj_id npc) throws InterruptedException - { - playClientEffectObj(npc, "clienteffect/voc_wookiee_med_4sec.cef", player, ""); - } - - - public void ep3_wke_junk_dealer_action_createBuyBackContainer(obj_id player, obj_id npc) throws InterruptedException - { - if (!isValidId(smuggler.createBuyBackContainerOnPlayer(player))) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: "+ player + ") did not get his buy back container set up properly."); - } - } - - - public void ep3_wke_junk_dealer_action_starFlagNoSale(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); - } - - - public void ep3_wke_junk_dealer_action_startBuyBack(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startBuyBack", params, 0.0f, false); - } - - - public int ep3_wke_junk_dealer_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (ep3_wke_junk_dealer_condition__defaultCondition (player, npc)) - { - ep3_wke_junk_dealer_action_startBuyBack (player, npc); - - string_id message = new string_id (c_stringFile, "s_10"); - utils.removeScriptVar (player, "conversation.ep3_wke_junk_dealer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_54fab04f")) - { - - if (ep3_wke_junk_dealer_condition__defaultCondition (player, npc)) - { - ep3_wke_junk_dealer_action_start_dealing (player, npc); - - string_id message = new string_id (c_stringFile, "s_84a67771"); - utils.removeScriptVar (player, "conversation.ep3_wke_junk_dealer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_11")) - { - - if (ep3_wke_junk_dealer_condition__defaultCondition (player, npc)) - { - ep3_wke_junk_dealer_action_starFlagNoSale (player, npc); - - string_id message = new string_id (c_stringFile, "s_12"); - utils.removeScriptVar (player, "conversation.ep3_wke_junk_dealer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_cd7a3f41")) - { - - if (ep3_wke_junk_dealer_condition__defaultCondition (player, npc)) - { - ep3_wke_junk_dealer_action_vocalizeMed (player, npc); - - string_id message = new string_id (c_stringFile, "s_4bd9d15e"); - utils.removeScriptVar (player, "conversation.ep3_wke_junk_dealer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isMob (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.ep3_wke_junk_dealer"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - faceTo(self, player); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.ep3_wke_junk_dealer"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (ep3_wke_junk_dealer_condition_cannotSpeakWookiee (player, npc)) - { - ep3_wke_junk_dealer_action_vocalizeMed (player, npc); - - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (ep3_wke_junk_dealer_condition_checkBuyBackContainer (player, npc)) - { - ep3_wke_junk_dealer_action_vocalizeMed (player, npc); - - string_id message = new string_id (c_stringFile, "s_bef51e38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (ep3_wke_junk_dealer_condition_hasBuyBackItems (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (ep3_wke_junk_dealer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (ep3_wke_junk_dealer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (ep3_wke_junk_dealer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_11"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_cd7a3f41"); - } - - utils.setScriptVar (player, "conversation.ep3_wke_junk_dealer.branchId", 2); - - npcStartConversation (player, npc, "ep3_wke_junk_dealer", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("ep3_wke_junk_dealer")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.ep3_wke_junk_dealer.branchId"); - - if (branchId == 2 && ep3_wke_junk_dealer_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.ep3_wke_junk_dealer.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/faction_recruiter_imperial.java b/sku.0/sys.server/compiled/game/script/conversation/faction_recruiter_imperial.java deleted file mode 100644 index 0e650d252..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/faction_recruiter_imperial.java +++ /dev/null @@ -1,3743 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.faction_perk; -import script.library.factions; -import script.library.utils; - - -public class faction_recruiter_imperial extends script.base_script -{ - public faction_recruiter_imperial() - { - } - String c_stringFile = "conversation/faction_recruiter_imperial"; - - - public boolean faction_recruiter_imperial_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean faction_recruiter_imperial_condition_isInFaction(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isInFriendlyFaction(player, npc)&&(!factions.isOnLeaveFromFriendlyFaction(player,npc)))&&(!factions.isPVPStatusChanging(player)); - - } - - - public boolean faction_recruiter_imperial_condition_isEnemyFaction(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isInEnemyFaction(player, npc)&&(!factions.isPVPStatusChanging(player))); - } - - - public boolean faction_recruiter_imperial_condition_isBlockedByJoinTimer(obj_id player, obj_id npc) throws InterruptedException - { - int factionId = pvpGetAlignedFaction(npc); - String faction = factions.getFactionNameByHashCode(factionId); - - return factions.isGatedByJoinTimer(player, faction); - } - - - public boolean faction_recruiter_imperial_condition_playerQualifiesForPromotion(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.qualifiesForPromotion(player, pvpGetAlignedFaction(npc))&&(!factions.isPVPStatusChanging(player))); - - } - - - public boolean faction_recruiter_imperial_condition_isChangingFaction(obj_id player, obj_id npc) throws InterruptedException - { - return factions.isPVPStatusChanging(player); - - } - - - public boolean faction_recruiter_imperial_condition_onLeaveFromFriendlyFaction(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isOnLeaveFromFriendlyFaction(player, npc)&&(!factions.isPVPStatusChanging(player))); - - } - - - public boolean faction_recruiter_imperial_condition_onLeaveFromEnemyFaction(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isOnLeaveFromEnemyFaction(player, npc)&&(!factions.isPVPStatusChanging(player))); - } - - - public boolean faction_recruiter_imperial_condition_isCovert(obj_id player, obj_id npc) throws InterruptedException - { - return(pvpGetType(player)==PVPTYPE_COVERT)&&(!factions.isPVPStatusChanging(player)); - - } - - - public boolean faction_recruiter_imperial_condition_isOvert(obj_id player, obj_id npc) throws InterruptedException - { - return ((pvpGetType(player)==PVPTYPE_DECLARED)&&(!factions.isPVPStatusChanging(player))); - } - - - public boolean faction_recruiter_imperial_condition_playerCanBuyFaction(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isSmuggler(player)&&(factions.canBuyFaction(player, npc))&&(!factions.isPVPStatusChanging(player))); - - } - - - public boolean faction_recruiter_imperial_condition_isAllowedToJoinFaction(obj_id player, obj_id npc) throws InterruptedException - { - return factions.canJoinFaction(player, pvpGetAlignedFaction(npc)); - } - - - public boolean faction_recruiter_imperial_condition_isImperialMercForGcw(obj_id player, obj_id npc) throws InterruptedException - { - return factions.isImperialHelper(player); - } - - - public boolean faction_recruiter_imperial_condition_canChangeStatus(obj_id player, obj_id npc) throws InterruptedException - { - return factions.canGoOnLeave(player); - } - - - public boolean faction_recruiter_imperial_condition_canBeMerc(obj_id player, obj_id npc) throws InterruptedException - { - return factions.canChangeNeutralMercenaryStatus(player); - } - - - public boolean faction_recruiter_imperial_condition_isRebMercForGcw(obj_id player, obj_id npc) throws InterruptedException - { - return factions.isRebelHelper(player); - } - - - public boolean faction_recruiter_imperial_condition_isRebOrImpMerc(obj_id player, obj_id npc) throws InterruptedException - { - return faction_recruiter_imperial_condition_isRebMercForGcw(player, npc) || faction_recruiter_imperial_condition_isImperialMercForGcw(player, npc); - } - - - public void faction_recruiter_imperial_action_showFactionGcwRewardUi(obj_id player, obj_id npc) throws InterruptedException - { - dictionary d = new dictionary(); - d.put("player", player); - messageTo(npc, "showInventorySUI", d, 0, false); - - } - - - public void faction_recruiter_imperial_action_enablePVPTimer(obj_id player, obj_id npc) throws InterruptedException - { - factions.goOvertWithDelay(player,30); - } - - - public void faction_recruiter_imperial_action_playerJoinFaction(obj_id player, obj_id npc) throws InterruptedException - { - factions.joinFaction(player,pvpGetAlignedFaction(npc)); - } - - - public void faction_recruiter_imperial_action_playerGoOnLeaveTimer(obj_id player, obj_id npc) throws InterruptedException - { - factions.goOnLeaveWithDelay(player,300); - } - - - public void faction_recruiter_imperial_action_makeImpMercCombatant(obj_id player, obj_id npc) throws InterruptedException - { - factions.setNeturalMercenaryCovert(player, factions.FACTION_FLAG_IMPERIAL); - } - - - public void faction_recruiter_imperial_action_maekImpMercSF(obj_id player, obj_id npc) throws InterruptedException - { - factions.setNeturalMercenaryOvert(player, factions.FACTION_FLAG_IMPERIAL); - } - - - public void faction_recruiter_imperial_action_playerGoCovertTimer(obj_id player, obj_id npc) throws InterruptedException - { - factions.goCovertWithDelay(player,300); - } - - - public void faction_recruiter_imperial_action_grantPromotion(obj_id player, obj_id npc) throws InterruptedException - { - factions.applyPromotion(player, pvpGetAlignedFaction(npc)); - } - - - public void faction_recruiter_imperial_action_buy1250FactionPoints(obj_id player, obj_id npc) throws InterruptedException - { - factions.buyFaction(player, npc, 100000); - } - - - public void faction_recruiter_imperial_action_buy250FactionPoints(obj_id player, obj_id npc) throws InterruptedException - { - factions.buyFaction(player, npc, 20000); - } - - - public void faction_recruiter_imperial_action_completelyResign(obj_id player, obj_id npc) throws InterruptedException - { - - factions.leaveFaction(player, pvpGetAlignedFaction(npc)); - - } - - - public void faction_recruiter_imperial_action_goCovertShortTimer(obj_id player, obj_id npc) throws InterruptedException - { - factions.goCovertWithDelay(player,30); - } - - - public void faction_recruiter_imperial_action_showGcwRewardsList(obj_id player, obj_id npc) throws InterruptedException - { - int playerGcwRank = pvpGetCurrentGcwRank(player); - int faction_id = pvpGetAlignedFaction(player); - String playerGcwFaction = factions.getFactionNameByHashCode(faction_id); - - faction_perk.displayAvailableFactionItemRanks(player, npc, playerGcwRank, playerGcwFaction); - - return; - } - - - public String faction_recruiter_imperial_tokenTO_getFactionRankName(obj_id player, obj_id npc) throws InterruptedException - { - int current_rank = pvpGetCurrentGcwRank(player); - String faction = factions.getFaction(player); - if (current_rank > factions.MAXIMUM_RANK) - { - current_rank = 1; - } - - return "@faction_recruiter:" + factions.getRankName(current_rank, faction); - } - - - public String faction_recruiter_imperial_tokenTO_getFactionNextRankName(obj_id player, obj_id npc) throws InterruptedException - { - int current_rank = pvpGetCurrentGcwRank(player); - String faction = factions.getFaction(player); - if (current_rank > factions.MAXIMUM_RANK) - { - current_rank = 1; - } - - current_rank = current_rank+1; - return "@faction_recruiter:" + factions.getRankName(current_rank, faction); - } - - - public String faction_recruiter_imperial_tokenTO_getRebelScoreString(obj_id player, obj_id npc) throws InterruptedException - { - int intTest = getIntObjVar(npc, "Rebel.controlScore"); - return ""+intTest; - - } - - - public int faction_recruiter_imperial_tokenDI_getImperialScore(obj_id player, obj_id npc) throws InterruptedException - { - return getIntObjVar(npc, "Imperial.controlScore"); - } - - - public int faction_recruiter_imperial_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_294")) - { - doAnimationAction (player, "salute1"); - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_296"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_298"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_302"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_298")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_goCovertShortTimer (player, npc); - - string_id message = new string_id (c_stringFile, "s_300"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_302")) - { - doAnimationAction (player, "shake_head_no"); - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_304"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_324")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_326"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_410")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_412"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_52")) - { - - if (faction_recruiter_imperial_condition_isOvert (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_54"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_56"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_isCovert (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_64"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_70"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_74")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_76"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_88")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_92"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_96"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_55")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_57"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_56")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_playerGoCovertTimer (player, npc); - - string_id message = new string_id (c_stringFile, "s_58"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_60")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_62"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_324")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_326"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_410")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_412"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_66")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_enablePVPTimer (player, npc); - - string_id message = new string_id (c_stringFile, "s_68"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_70")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_324")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_326"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_410")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_412"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_79")) - { - faction_recruiter_imperial_action_playerGoOnLeaveTimer (player, npc); - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_playerGoOnLeaveTimer (player, npc); - - string_id message = new string_id (c_stringFile, "s_82"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_84")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_86"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_324")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_326"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_410")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_412"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_92")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_completelyResign (player, npc); - - string_id message = new string_id (c_stringFile, "s_94"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_96")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_324")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_326"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_410")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_412"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_324")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_326"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_410")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_412"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_imperial_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_imperial_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_67")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_69"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_85")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_87"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_428")) - { - - if (faction_recruiter_imperial_condition_isAllowedToJoinFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_432"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_434"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_440"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_isBlockedByJoinTimer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_111"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_430"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_89")) - { - - if (faction_recruiter_imperial_condition_canBeMerc (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 28); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_102"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_93")) - { - - if (faction_recruiter_imperial_condition_canBeMerc (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - faction_recruiter_imperial_action_maekImpMercSF (player, npc); - - string_id message = new string_id (c_stringFile, "s_95"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_101"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_97")) - { - - if (faction_recruiter_imperial_condition_canBeMerc (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - faction_recruiter_imperial_action_makeImpMercCombatant (player, npc); - - string_id message = new string_id (c_stringFile, "s_99"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_100"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_434")) - { - - if (faction_recruiter_imperial_condition_isRebOrImpMerc (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_114"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_playerJoinFaction (player, npc); - - string_id message = new string_id (c_stringFile, "s_436"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_438"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_440")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_442"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_115")) - { - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - faction_recruiter_imperial_action_playerJoinFaction (player, npc); - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_117")) - { - - if (faction_recruiter_imperial_condition_onLeaveFromFriendlyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_80"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_294"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 1); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_onLeaveFromEnemyFaction (player, npc)) - { - doAnimationAction (npc, "shake_head_disgust"); - - string_id message = new string_id (c_stringFile, "s_306"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_isEnemyFaction (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - string_id message = new string_id (c_stringFile, "s_308"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_isInFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_310"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!faction_recruiter_imperial_condition_isChangingFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_414"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition_isImperialMercForGcw (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition_canBeMerc (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_428"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_444"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_imperial_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_438")) - { - - if (faction_recruiter_imperial_condition_onLeaveFromFriendlyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_80"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_294"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 1); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_onLeaveFromEnemyFaction (player, npc)) - { - doAnimationAction (npc, "shake_head_disgust"); - - string_id message = new string_id (c_stringFile, "s_306"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_isEnemyFaction (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - string_id message = new string_id (c_stringFile, "s_308"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_isInFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_310"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!faction_recruiter_imperial_condition_isChangingFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_414"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition_isImperialMercForGcw (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition_canBeMerc (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_428"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_444"); - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isMob (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.faction_recruiter_imperial"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.faction_recruiter_imperial"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (faction_recruiter_imperial_condition_onLeaveFromFriendlyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_80"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_294"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 1); - - npcStartConversation (player, npc, "faction_recruiter_imperial", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_onLeaveFromEnemyFaction (player, npc)) - { - doAnimationAction (npc, "shake_head_disgust"); - - string_id message = new string_id (c_stringFile, "s_306"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_isEnemyFaction (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - string_id message = new string_id (c_stringFile, "s_308"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition_isInFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_310"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_410"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 7); - - npcStartConversation (player, npc, "faction_recruiter_imperial", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!faction_recruiter_imperial_condition_isChangingFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_414"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_imperial_condition_isImperialMercForGcw (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_imperial_condition_canBeMerc (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_428"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_imperial.branchId", 25); - - npcStartConversation (player, npc, "faction_recruiter_imperial", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_imperial_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_444"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("faction_recruiter_imperial")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - if (branchId == 1 && faction_recruiter_imperial_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && faction_recruiter_imperial_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && faction_recruiter_imperial_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && faction_recruiter_imperial_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && faction_recruiter_imperial_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && faction_recruiter_imperial_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && faction_recruiter_imperial_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && faction_recruiter_imperial_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && faction_recruiter_imperial_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && faction_recruiter_imperial_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && faction_recruiter_imperial_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && faction_recruiter_imperial_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && faction_recruiter_imperial_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && faction_recruiter_imperial_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && faction_recruiter_imperial_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && faction_recruiter_imperial_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && faction_recruiter_imperial_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && faction_recruiter_imperial_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && faction_recruiter_imperial_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && faction_recruiter_imperial_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.faction_recruiter_imperial.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/faction_recruiter_rebel.java b/sku.0/sys.server/compiled/game/script/conversation/faction_recruiter_rebel.java deleted file mode 100644 index c4e2f8a6d..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/faction_recruiter_rebel.java +++ /dev/null @@ -1,3719 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.faction_perk; -import script.library.factions; -import script.library.utils; - - -public class faction_recruiter_rebel extends script.base_script -{ - public faction_recruiter_rebel() - { - } - String c_stringFile = "conversation/faction_recruiter_rebel"; - - - public boolean faction_recruiter_rebel_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean faction_recruiter_rebel_condition_isInFaction(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isInFriendlyFaction(player, npc)&&(!factions.isOnLeaveFromFriendlyFaction(player,npc)))&&(!factions.isPVPStatusChanging(player)); - - } - - - public boolean faction_recruiter_rebel_condition_isEnemyFaction(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isInEnemyFaction(player, npc)&&(!factions.isPVPStatusChanging(player))); - } - - - public boolean faction_recruiter_rebel_condition_isBlockedByJoinTimer(obj_id player, obj_id npc) throws InterruptedException - { - int factionId = pvpGetAlignedFaction(npc); - String faction = factions.getFactionNameByHashCode(factionId); - - return factions.isGatedByJoinTimer(player, faction); - } - - - public boolean faction_recruiter_rebel_condition_playerQualifiesForPromotion(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.qualifiesForPromotion(player, pvpGetAlignedFaction(npc))&&(!factions.isPVPStatusChanging(player))); - - } - - - public boolean faction_recruiter_rebel_condition_isChangingFaction(obj_id player, obj_id npc) throws InterruptedException - { - return factions.isPVPStatusChanging(player); - - } - - - public boolean faction_recruiter_rebel_condition_onLeaveFromFriendlyFaction(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isOnLeaveFromFriendlyFaction(player, npc)&&(!factions.isPVPStatusChanging(player))); - - } - - - public boolean faction_recruiter_rebel_condition_onLeaveFromEnemyFaction(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isOnLeaveFromEnemyFaction(player, npc)&&(!factions.isPVPStatusChanging(player))); - } - - - public boolean faction_recruiter_rebel_condition_isCovert(obj_id player, obj_id npc) throws InterruptedException - { - return(pvpGetType(player)==PVPTYPE_COVERT)&&(!factions.isPVPStatusChanging(player)); - - } - - - public boolean faction_recruiter_rebel_condition_isOvert(obj_id player, obj_id npc) throws InterruptedException - { - return ((pvpGetType(player)==PVPTYPE_DECLARED)&&(!factions.isPVPStatusChanging(player))); - } - - - public boolean faction_recruiter_rebel_condition_playerCanBuyFaction(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isSmuggler(player)&&(factions.canBuyFaction(player, npc))&&(!factions.isPVPStatusChanging(player))); - - } - - - public boolean faction_recruiter_rebel_condition_isAllowedToJoinFaction(obj_id player, obj_id npc) throws InterruptedException - { - return factions.canJoinFaction(player, pvpGetAlignedFaction(npc)); - } - - - public boolean faction_recruiter_rebel_condition_isRebelMercForGcw(obj_id player, obj_id npc) throws InterruptedException - { - return factions.isRebelHelper(player); - } - - - public boolean faction_recruiter_rebel_condition_canChangeStatus(obj_id player, obj_id npc) throws InterruptedException - { - return factions.canGoOnLeave(player); - } - - - public boolean faction_recruiter_rebel_condition_canBeMerc(obj_id player, obj_id npc) throws InterruptedException - { - return factions.canChangeNeutralMercenaryStatus(player); - } - - - public boolean faction_recruiter_rebel_condition_isRebOrImpMerc(obj_id player, obj_id npc) throws InterruptedException - { - return faction_recruiter_rebel_condition_isRebelMercForGcw(player, npc) || faction_recruiter_rebel_condition_isImpMercForGcw(player, npc); - } - - - public boolean faction_recruiter_rebel_condition_isImpMercForGcw(obj_id player, obj_id npc) throws InterruptedException - { - return factions.isImperialHelper(player); - } - - - public void faction_recruiter_rebel_action_showFactionGcwRewardUi(obj_id player, obj_id npc) throws InterruptedException - { - dictionary d = new dictionary(); - d.put("player", player); - messageTo(npc, "showInventorySUI", d, 0, false); - } - - - public void faction_recruiter_rebel_action_enablePVPTimer(obj_id player, obj_id npc) throws InterruptedException - { - factions.goOvertWithDelay(player,30); - } - - - public void faction_recruiter_rebel_action_playerJoinFaction(obj_id player, obj_id npc) throws InterruptedException - { - factions.joinFaction(player,pvpGetAlignedFaction(npc)); - } - - - public void faction_recruiter_rebel_action_playerGoOnLeaveTimer(obj_id player, obj_id npc) throws InterruptedException - { - factions.goOnLeaveWithDelay(player,300); - } - - - public void faction_recruiter_rebel_action_makeRebMercSF(obj_id player, obj_id npc) throws InterruptedException - { - factions.setNeturalMercenaryOvert(player, factions.FACTION_FLAG_REBEL); - } - - - public void faction_recruiter_rebel_action_makeRebMercCombatant(obj_id player, obj_id npc) throws InterruptedException - { - factions.setNeturalMercenaryCovert(player, factions.FACTION_FLAG_REBEL); - } - - - public void faction_recruiter_rebel_action_playerGoCovertTimer(obj_id player, obj_id npc) throws InterruptedException - { - factions.goCovertWithDelay(player,300); - } - - - public void faction_recruiter_rebel_action_grantPromotion(obj_id player, obj_id npc) throws InterruptedException - { - factions.applyPromotion(player, pvpGetAlignedFaction(npc)); - } - - - public void faction_recruiter_rebel_action_buy1250FactionPoints(obj_id player, obj_id npc) throws InterruptedException - { - factions.buyFaction(player, npc, 100000); - } - - - public void faction_recruiter_rebel_action_buy250FactionPoints(obj_id player, obj_id npc) throws InterruptedException - { - factions.buyFaction(player, npc, 20000); - } - - - public void faction_recruiter_rebel_action_completelyResign(obj_id player, obj_id npc) throws InterruptedException - { - - factions.leaveFaction(player, pvpGetAlignedFaction(npc)); - - } - - - public void faction_recruiter_rebel_action_goCovertShortTimer(obj_id player, obj_id npc) throws InterruptedException - { - factions.goCovertWithDelay(player,30); - } - - - public void faction_recruiter_rebel_action_showGcwRewardsList(obj_id player, obj_id npc) throws InterruptedException - { - int playerGcwRank = pvpGetCurrentGcwRank(player); - int faction_id = pvpGetAlignedFaction(player); - String playerGcwFaction = factions.getFactionNameByHashCode(faction_id); - - faction_perk.displayAvailableFactionItemRanks(player, npc, playerGcwRank, playerGcwFaction); - - return; - } - - - public String faction_recruiter_rebel_tokenTO_getFactionRankName(obj_id player, obj_id npc) throws InterruptedException - { - int current_rank = pvpGetCurrentGcwRank(player); - String faction = factions.getFaction(player); - if (current_rank > factions.MAXIMUM_RANK) - { - current_rank = 1; - } - current_rank = current_rank+1; - return "@faction_recruiter:" + factions.getRankName(current_rank, faction); - } - - - public String faction_recruiter_rebel_tokenTO_getRebelScoreString(obj_id player, obj_id npc) throws InterruptedException - { - return ""+getIntObjVar(npc, "Rebel.controlScore"); - } - - - public int faction_recruiter_rebel_tokenDI_getImperialScore(obj_id player, obj_id npc) throws InterruptedException - { - return getIntObjVar(npc, "Imperial.controlScore"); - } - - - public int faction_recruiter_rebel_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_218")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_220"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_222"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_226"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_222")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_goCovertShortTimer (player, npc); - - string_id message = new string_id (c_stringFile, "s_224"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_226")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_228"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_248")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_250"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_330")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_332"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_52")) - { - - if (faction_recruiter_rebel_condition_isOvert (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_54"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_56"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_isCovert (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_64"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_70"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_86")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_90"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_94"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_74")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_76"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_78"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_55")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_57"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_56")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_playerGoCovertTimer (player, npc); - - string_id message = new string_id (c_stringFile, "s_58"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_60")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_62"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_248")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_250"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_330")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_332"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_66")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_enablePVPTimer (player, npc); - - string_id message = new string_id (c_stringFile, "s_68"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_70")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_248")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_250"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_330")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_332"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_90")) - { - faction_recruiter_rebel_action_playerGoOnLeaveTimer (player, npc); - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_playerGoOnLeaveTimer (player, npc); - - string_id message = new string_id (c_stringFile, "s_92"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_94")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_248")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_250"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_330")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_332"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_78")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_disgust"); - - faction_recruiter_rebel_action_completelyResign (player, npc); - - string_id message = new string_id (c_stringFile, "s_80"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_82")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_84"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_248")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_250"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_330")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_332"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_248")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showGcwRewardsList (player, npc); - - string_id message = new string_id (c_stringFile, "s_250"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_49")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition_canChangeStatus (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_330")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_332"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (faction_recruiter_rebel_tokenTO_getRebelScoreString (player, npc)); - pp.digitInteger = faction_recruiter_rebel_tokenDI_getImperialScore (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_69")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_showFactionGcwRewardUi (player, npc); - - string_id message = new string_id (c_stringFile, "s_71"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_83")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_85"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_87"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_348")) - { - - if (faction_recruiter_rebel_condition_isAllowedToJoinFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_352"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_354"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_360"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_isBlockedByJoinTimer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_117"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_350"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_87")) - { - - if (faction_recruiter_rebel_condition_canBeMerc (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_95"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 28); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_93")) - { - - if (faction_recruiter_rebel_condition_canBeMerc (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - faction_recruiter_rebel_action_makeRebMercSF (player, npc); - - string_id message = new string_id (c_stringFile, "s_97"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_95")) - { - - if (faction_recruiter_rebel_condition_canBeMerc (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - faction_recruiter_rebel_action_makeRebMercCombatant (player, npc); - - string_id message = new string_id (c_stringFile, "s_99"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_100"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_354")) - { - - if (faction_recruiter_rebel_condition_isRebOrImpMerc (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_playerJoinFaction (player, npc); - - string_id message = new string_id (c_stringFile, "s_356"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_358"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_360")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_362"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_114")) - { - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - faction_recruiter_rebel_action_playerJoinFaction (player, npc); - - string_id message = new string_id (c_stringFile, "s_115"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_116"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_116")) - { - - if (faction_recruiter_rebel_condition_onLeaveFromFriendlyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_216"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_218"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 1); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_onLeaveFromEnemyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_230"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_isEnemyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_232"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_isInFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_234"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!faction_recruiter_rebel_condition_isChangingFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_334"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition_isRebelMercForGcw (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition_canBeMerc (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_348"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_364"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int faction_recruiter_rebel_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_358")) - { - - if (faction_recruiter_rebel_condition_onLeaveFromFriendlyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_216"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_218"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 1); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_onLeaveFromEnemyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_230"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_isEnemyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_232"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_isInFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_234"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!faction_recruiter_rebel_condition_isChangingFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_334"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition_isRebelMercForGcw (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition_canBeMerc (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_348"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_364"); - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isMob (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.faction_recruiter_rebel"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.faction_recruiter_rebel"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (faction_recruiter_rebel_condition_onLeaveFromFriendlyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_216"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_218"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 1); - - npcStartConversation (player, npc, "faction_recruiter_rebel", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_onLeaveFromEnemyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_230"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_isEnemyFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_232"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition_isInFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_234"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_248"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_330"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 7); - - npcStartConversation (player, npc, "faction_recruiter_rebel", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!faction_recruiter_rebel_condition_isChangingFaction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_334"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (faction_recruiter_rebel_condition_isRebelMercForGcw (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (faction_recruiter_rebel_condition_canBeMerc (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_348"); - } - - utils.setScriptVar (player, "conversation.faction_recruiter_rebel.branchId", 25); - - npcStartConversation (player, npc, "faction_recruiter_rebel", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (faction_recruiter_rebel_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_364"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("faction_recruiter_rebel")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - if (branchId == 1 && faction_recruiter_rebel_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && faction_recruiter_rebel_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && faction_recruiter_rebel_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && faction_recruiter_rebel_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && faction_recruiter_rebel_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && faction_recruiter_rebel_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && faction_recruiter_rebel_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && faction_recruiter_rebel_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && faction_recruiter_rebel_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && faction_recruiter_rebel_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && faction_recruiter_rebel_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && faction_recruiter_rebel_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && faction_recruiter_rebel_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && faction_recruiter_rebel_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && faction_recruiter_rebel_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && faction_recruiter_rebel_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && faction_recruiter_rebel_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && faction_recruiter_rebel_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && faction_recruiter_rebel_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && faction_recruiter_rebel_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.faction_recruiter_rebel.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/gcw_demoralized_soldier.java b/sku.0/sys.server/compiled/game/script/conversation/gcw_demoralized_soldier.java deleted file mode 100644 index 4803d91ea..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/gcw_demoralized_soldier.java +++ /dev/null @@ -1,953 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.trial; -import script.library.utils; - - -public class gcw_demoralized_soldier extends script.base_script -{ - public gcw_demoralized_soldier() - { - } - String c_stringFile = "conversation/gcw_demoralized_soldier"; - - - public boolean gcw_demoralized_soldier_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean gcw_demoralized_soldier_condition_isReadyToTalkImperial(obj_id player, obj_id npc) throws InterruptedException - { - if ((utils.hasObjVar(npc, "faction_recruit_quest") && utils.hasScriptVar(npc, "faction_ent") && factions.isImperial(npc) && groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY))) - { - int questStatus = utils.getIntObjVar(npc, "faction_recruit_quest"); - obj_id faction_ent = utils.getObjIdScriptVar(npc, "faction_ent"); - if ((questStatus == 1) &&(faction_ent == player)) - { - return true; - } - } - return false; - } - - - public boolean gcw_demoralized_soldier_condition_isReadyToTalkRebel(obj_id player, obj_id npc) throws InterruptedException - { - if ((utils.hasObjVar(npc, "faction_recruit_quest") && utils.hasScriptVar(npc, "faction_ent") && factions.isRebel(npc) && groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY))) - { - int questStatus = utils.getIntObjVar(npc, "faction_recruit_quest"); - obj_id faction_ent = utils.getObjIdScriptVar(npc, "faction_ent"); - if ((questStatus == 1) &&(faction_ent == player)) - { - return true; - } - } - return false; - } - - - public void gcw_demoralized_soldier_action_convinced(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "gcw_rally_demoralized"); - trial.addNonInstanceFactionParticipant(player, npc); - messageTo(npc, "convinced", null, 2.0f, false ); - } - - - public void gcw_demoralized_soldier_action_notConvinced(obj_id player, obj_id npc) throws InterruptedException - { - messageTo(npc, "notConvinced", null, 0f, false ); - } - - - public int gcw_demoralized_soldier_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_6")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_8"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_17"); - } - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_14")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_23"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_30")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_demoralized_soldier_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_20")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_17")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_19"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_demoralized_soldier_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_23")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_26")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_demoralized_soldier_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_34")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_38")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_40"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_demoralized_soldier_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_44")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_46"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_48"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_56")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_68")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_72"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_demoralized_soldier_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_48")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_50"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_52")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_demoralized_soldier_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_60")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_62"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_64")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_66"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_demoralized_soldier_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_72")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_convinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_74"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_76")) - { - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - gcw_demoralized_soldier_action_notConvinced (player, npc); - - string_id message = new string_id (c_stringFile, "s_78"); - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.gcw_demoralized_soldier"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.gcw_demoralized_soldier"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (gcw_demoralized_soldier_condition_isReadyToTalkImperial (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_6"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 1); - - npcStartConversation (player, npc, "gcw_demoralized_soldier", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (gcw_demoralized_soldier_condition_isReadyToTalkRebel (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_44"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_56"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - utils.setScriptVar (player, "conversation.gcw_demoralized_soldier.branchId", 11); - - npcStartConversation (player, npc, "gcw_demoralized_soldier", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (gcw_demoralized_soldier_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_80"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("gcw_demoralized_soldier")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - if (branchId == 1 && gcw_demoralized_soldier_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && gcw_demoralized_soldier_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && gcw_demoralized_soldier_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && gcw_demoralized_soldier_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && gcw_demoralized_soldier_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && gcw_demoralized_soldier_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && gcw_demoralized_soldier_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && gcw_demoralized_soldier_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.gcw_demoralized_soldier.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/gcw_introduction_talon_karrde.java b/sku.0/sys.server/compiled/game/script/conversation/gcw_introduction_talon_karrde.java deleted file mode 100644 index f77f450d3..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/gcw_introduction_talon_karrde.java +++ /dev/null @@ -1,1874 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class gcw_introduction_talon_karrde extends script.base_script -{ - public gcw_introduction_talon_karrde() - { - } - String c_stringFile = "conversation/gcw_introduction_talon_karrde"; - - - public boolean gcw_introduction_talon_karrde_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean gcw_introduction_talon_karrde_condition_hasIntroTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "gcw_introduction_quest", "contactSmuggler"); - } - - - public boolean gcw_introduction_talon_karrde_condition_completedIntroNotNextStep(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "gcw_introduction_quest") && !groundquests.hasCompletedQuest(player, "gcw_introduction_rebel_tatooine") && !groundquests.hasCompletedQuest(player, "gcw_introduction_imperial_tatooine"); - } - - - public boolean gcw_introduction_talon_karrde_condition_hasToken(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return true; - } - - - public void gcw_introduction_talon_karrde_action_grantImperialQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - } - - - public void gcw_introduction_talon_karrde_action_grantRebelQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - } - - - public void gcw_introduction_talon_karrde_action_giveBadge(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - } - - - public int gcw_introduction_talon_karrde_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_50")) - { - - if (gcw_introduction_talon_karrde_condition_hasToken (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_53"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 2); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_52"); - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_53")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - gcw_introduction_talon_karrde_action_giveBadge (player, npc); - - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_43")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_45"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_47"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_45")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_46")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_37"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_47")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_5")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_6"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_7"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_8"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_7")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_11"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_8")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_11"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_11")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_13"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_15"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_17"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_18"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_18")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_20")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_25"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_25")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_37"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_26")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_28")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_29"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_30")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_33"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_32")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_37"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_33")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_38"); - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_37")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_33"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_39")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_40"); - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_41")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_33"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int gcw_introduction_talon_karrde_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_11")) - { - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_13"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.gcw_introduction_talon_karrde"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.gcw_introduction_talon_karrde"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (gcw_introduction_talon_karrde_condition_hasToken (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_50"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 1); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "gcw_introduction_talon_karrde", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - doAnimationAction (player, "shake_head_disgust"); - - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_43"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 5); - - npcStartConversation (player, npc, "gcw_introduction_talon_karrde", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (gcw_introduction_talon_karrde_condition_hasIntroTask (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (gcw_introduction_talon_karrde_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_5"); - } - - utils.setScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId", 7); - - npcStartConversation (player, npc, "gcw_introduction_talon_karrde", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("gcw_introduction_talon_karrde")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - if (branchId == 1 && gcw_introduction_talon_karrde_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && gcw_introduction_talon_karrde_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && gcw_introduction_talon_karrde_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && gcw_introduction_talon_karrde_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && gcw_introduction_talon_karrde_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && gcw_introduction_talon_karrde_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && gcw_introduction_talon_karrde_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && gcw_introduction_talon_karrde_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && gcw_introduction_talon_karrde_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && gcw_introduction_talon_karrde_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && gcw_introduction_talon_karrde_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && gcw_introduction_talon_karrde_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && gcw_introduction_talon_karrde_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && gcw_introduction_talon_karrde_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && gcw_introduction_talon_karrde_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && gcw_introduction_talon_karrde_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && gcw_introduction_talon_karrde_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && gcw_introduction_talon_karrde_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && gcw_introduction_talon_karrde_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.gcw_introduction_talon_karrde.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/grenz_zittoun.java b/sku.0/sys.server/compiled/game/script/conversation/grenz_zittoun.java deleted file mode 100644 index 2a40d636f..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/grenz_zittoun.java +++ /dev/null @@ -1,2117 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class grenz_zittoun extends script.base_script -{ - public grenz_zittoun() - { - } - String c_stringFile = "conversation/grenz_zittoun"; - - - public boolean grenz_zittoun_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean grenz_zittoun_condition_isElligibleHideoutBoss(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_boss_1") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean grenz_zittoun_condition_hasReturnedHideoutBoss(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_boss_1", "returnKillHideoutBossComplete"); - } - - - public boolean grenz_zittoun_condition_hasHideoutBossNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isQuestActive(player, "u16_nym_themepark_pirate_boss_1"); - } - - - public boolean grenz_zittoun_condition_isElligibleMineBoss(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine_boss") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_boss_1") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine"); - } - - - public boolean grenz_zittoun_condition_isElligibleLabBoss(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_lab_boss") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine_boss"); - } - - - public boolean grenz_zittoun_condition_hasReturnedMineBoss(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_mine_boss", "returnKillMineBossComplete"); - } - - - public boolean grenz_zittoun_condition_hasReturnedLabBoss(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_lab_boss", "returnKillLabBossComplete"); - } - - - public boolean grenz_zittoun_condition_hasMineBossNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isQuestActive(player, "u16_nym_themepark_mine_boss"); - } - - - public boolean grenz_zittoun_condition_hasLabBossNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isQuestActive(player, "u16_nym_themepark_lab_boss"); - } - - - public boolean grenz_zittoun_condition_hasntDoneHideout(obj_id player, obj_id npc) throws InterruptedException - { - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean grenz_zittoun_condition_hasntDoneMine(obj_id player, obj_id npc) throws InterruptedException - { - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_boss_1"); - } - - - public boolean grenz_zittoun_condition_hasntDoneLab(obj_id player, obj_id npc) throws InterruptedException - { - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine_boss"); - } - - - public boolean grenz_zittoun_condition_hasCompletedPirateBossCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "kill_nyms_themepark_boss_hideout") && groundquests.isQuestActive(player, "u16_nym_themepark_pirate_boss_1"); - } - - - public boolean grenz_zittoun_condition_hasCompletedMinerBossCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "kill_nyms_themepark_boss_mine") && groundquests.isQuestActive(player, "u16_nym_themepark_mine_boss"); - } - - - public boolean grenz_zittoun_condition_hasCompletedLabBossCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "kill_nyms_themepark_boss_lab") && groundquests.isQuestActive(player, "u16_nym_themepark_lab_boss"); - } - - - public void grenz_zittoun_action_grantHideoutBossQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_pirate_boss_1"); - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_hideout_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_boss_hideout_activate", 1); - } - } - - - public void grenz_zittoun_action_completeHideoutBossQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedKillHideoutBoss"); - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_1")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_boss_1", 1); - } - } - - - public void grenz_zittoun_action_grantMineBossQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_mine_boss"); - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_mine_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_boss_mine_activate", 1); - } - } - - - public void grenz_zittoun_action_completeMineBossQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedKillMineBoss"); - if (!hasCompletedCollectionSlot(player, "u16_nym_themepark_mine_boss")) - { - modifyCollectionSlotValue(player, "u16_nym_themepark_mine_boss", 1); - } - } - - - public void grenz_zittoun_action_grantLabBossQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_lab_boss"); - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_boss_lab_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_boss_lab_activate", 1); - } - } - - - public void grenz_zittoun_action_completeLabBoss(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedKillLabBoss"); - if (!hasCompletedCollectionSlot(player, "u16_nym_themepark_lab_boss")) - { - modifyCollectionSlotValue(player, "u16_nym_themepark_lab_boss", 1); - } - } - - - public void grenz_zittoun_action_BruteForceCompletePirateBoss(obj_id player, obj_id npc) throws InterruptedException - { - if (grenz_zittoun_condition_hasCompletedPirateBossCollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_pirate_boss_1")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_pirate_boss_1 for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_pirate_boss_1"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public void grenz_zittoun_action_BruteForceCompleteMineBoss(obj_id player, obj_id npc) throws InterruptedException - { - if (grenz_zittoun_condition_hasCompletedMinerBossCollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_mine_boss")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_mine_boss for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_mine_boss"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - - } - - - public void grenz_zittoun_action_BruteForceCompleteLabBoss(obj_id player, obj_id npc) throws InterruptedException - { - if (grenz_zittoun_condition_hasCompletedLabBossCollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_lab_boss")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_lab_boss for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_lab_boss"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public String grenz_zittoun_tokenTO_firstName(obj_id player, obj_id npc) throws InterruptedException - { - return new String(getFirstName(player)); - } - - - public int grenz_zittoun_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_82")) - { - doAnimationAction (player, "flex_biceps"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - string_id message = new string_id (c_stringFile, "s_83"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 2); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_84")) - { - doAnimationAction (player, "flex3"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - grenz_zittoun_action_completeLabBoss (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_79")) - { - doAnimationAction (player, "shake_head_no"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_80"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_66")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_64")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_65"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_68")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_69"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_70"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 9); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_70")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "elbow"); - - string_id message = new string_id (c_stringFile, "s_71"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_72"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_72")) - { - doAnimationAction (player, "belly_laugh"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "he_dies"); - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_75"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_74")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "goodbye"); - - grenz_zittoun_action_grantLabBossQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_76"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_75")) - { - doAnimationAction (player, "yawn"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_77"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_61")) - { - doAnimationAction (player, "nod_head_once"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - grenz_zittoun_action_completeMineBossQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_62"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_58")) - { - doAnimationAction (player, "apologize"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_disgust"); - - string_id message = new string_id (c_stringFile, "s_59"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_47")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_48"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_87")) - { - doAnimationAction (player, "check_wrist_device"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "goodbye"); - - string_id message = new string_id (c_stringFile, "s_89"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_51")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - string_id message = new string_id (c_stringFile, "s_52"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_53"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 24); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_53")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "goodbye"); - - grenz_zittoun_action_grantMineBossQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_55")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - string_id message = new string_id (c_stringFile, "s_56"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_94")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "bow5"); - - grenz_zittoun_action_completeHideoutBossQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_96"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - doAnimationAction (player, "tap_head"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_disgust"); - - string_id message = new string_id (c_stringFile, "s_103"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_107")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_109"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_127")) - { - doAnimationAction (player, "check_wrist_device"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_131"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_111")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nervous"); - - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 36); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_115")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "whisper"); - - string_id message = new string_id (c_stringFile, "s_117"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_119")) - { - doAnimationAction (player, "cover_mouth"); - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - string_id message = new string_id (c_stringFile, "s_121"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_123"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int grenz_zittoun_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_123")) - { - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "goodbye"); - - grenz_zittoun_action_grantHideoutBossQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_125"); - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.grenz_zittoun"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.grenz_zittoun"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (grenz_zittoun_condition_hasReturnedLabBoss (player, npc)) - { - doAnimationAction (npc, "greet"); - - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 1); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "grenz_zittoun", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasCompletedLabBossCollection (player, npc)) - { - grenz_zittoun_action_BruteForceCompleteLabBoss (player, npc); - - string_id message = new string_id (c_stringFile, "s_135"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasLabBossNotComplete (player, npc)) - { - doAnimationAction (npc, "greet"); - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 5); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "grenz_zittoun", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_isElligibleLabBoss (player, npc)) - { - doAnimationAction (npc, "beckon"); - - string_id message = new string_id (c_stringFile, "s_63"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "grenz_zittoun", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasntDoneLab (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_129"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasReturnedMineBoss (player, npc)) - { - doAnimationAction (npc, "greet"); - - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_61"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 16); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "grenz_zittoun", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasCompletedMinerBossCollection (player, npc)) - { - grenz_zittoun_action_BruteForceCompleteMineBoss (player, npc); - - string_id message = new string_id (c_stringFile, "s_134"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasMineBossNotComplete (player, npc)) - { - doAnimationAction (npc, "cough_polite"); - - string_id message = new string_id (c_stringFile, "s_57"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_58"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 19); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcStartConversation (player, npc, "grenz_zittoun", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_isElligibleMineBoss (player, npc)) - { - doAnimationAction (npc, "beckon"); - - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_47"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_87"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 21); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "grenz_zittoun", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasntDoneMine (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasReturnedHideoutBoss (player, npc)) - { - doAnimationAction (npc, "greet"); - - string_id message = new string_id (c_stringFile, "s_92"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_94"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 29); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "grenz_zittoun", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasCompletedPirateBossCollection (player, npc)) - { - grenz_zittoun_action_BruteForceCompletePirateBoss (player, npc); - - string_id message = new string_id (c_stringFile, "s_133"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasHideoutBossNotComplete (player, npc)) - { - doAnimationAction (npc, "cough_polite"); - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 32); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "grenz_zittoun", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_isElligibleHideoutBoss (player, npc)) - { - doAnimationAction (npc, "beckon"); - - string_id message = new string_id (c_stringFile, "s_105"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_127"); - } - - utils.setScriptVar (player, "conversation.grenz_zittoun.branchId", 34); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - npcStartConversation (player, npc, "grenz_zittoun", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition_hasntDoneHideout (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_136"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (grenz_zittoun_tokenTO_firstName (player, npc)); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (grenz_zittoun_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - string_id message = new string_id (c_stringFile, "s_138"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("grenz_zittoun")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.grenz_zittoun.branchId"); - - if (branchId == 1 && grenz_zittoun_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && grenz_zittoun_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && grenz_zittoun_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && grenz_zittoun_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && grenz_zittoun_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && grenz_zittoun_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && grenz_zittoun_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && grenz_zittoun_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && grenz_zittoun_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && grenz_zittoun_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && grenz_zittoun_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && grenz_zittoun_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && grenz_zittoun_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && grenz_zittoun_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && grenz_zittoun_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && grenz_zittoun_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && grenz_zittoun_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && grenz_zittoun_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && grenz_zittoun_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && grenz_zittoun_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && grenz_zittoun_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.grenz_zittoun.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/hacker_lok_pirate_cave.java b/sku.0/sys.server/compiled/game/script/conversation/hacker_lok_pirate_cave.java deleted file mode 100644 index ef871214d..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/hacker_lok_pirate_cave.java +++ /dev/null @@ -1,3524 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class hacker_lok_pirate_cave extends script.base_script -{ - public hacker_lok_pirate_cave() - { - } - String c_stringFile = "conversation/hacker_lok_pirate_cave"; - - - public boolean hacker_lok_pirate_cave_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean hacker_lok_pirate_cave_condition_hasCompletedPirate(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean hacker_lok_pirate_cave_condition_hasHackTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "findSecuritySystem") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "helpSliceSecurity"); - } - - - public boolean hacker_lok_pirate_cave_condition_hasReturnTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "returnPirateComplete"); - } - - - public boolean hacker_lok_pirate_cave_condition_hasColorWheelTaskActive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "colorWheel"); - } - - - public boolean hacker_lok_pirate_cave_condition_hasJokeTaskActive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "joke"); - } - - - public boolean hacker_lok_pirate_cave_condition_hasNumberTaskActive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "number"); - } - - - public boolean hacker_lok_pirate_cave_condition_hasSlicedTheSystem(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "findDroidDisk"); - } - - - public void hacker_lok_pirate_cave_action_colorWheelDone(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "colorWheelDone"); - } - - - public void hacker_lok_pirate_cave_action_foundSecuritySys(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundSecuritySystem"); - } - - - public void hacker_lok_pirate_cave_action_numbersDone(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "numberDone"); - } - - - public void hacker_lok_pirate_cave_action_jokeDone(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "jokeDone"); - } - - - public int hacker_lok_pirate_cave_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_56")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_57")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_59")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_82")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_109"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_112")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_113")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_114")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_115")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_117")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_120"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_118")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_121"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_119")) - { - hacker_lok_pirate_cave_action_colorWheelDone (player, npc); - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_122"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_141"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_142"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_149"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_112")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_113")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_114")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_115")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_112")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_113")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_114")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_115")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_141")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_142")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_149")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_124")) - { - hacker_lok_pirate_cave_action_numbersDone (player, npc); - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_143"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_148"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_125")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_126")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_129"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_143")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_144")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_148")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_112")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_113")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_114")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_115")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_112")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_113")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_114")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_115")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_133")) - { - hacker_lok_pirate_cave_action_jokeDone (player, npc); - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_136"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_145"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_134")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_137"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_135")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_138"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition_hasColorWheelTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition_hasNumberTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition_hasJokeTaskActive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_145")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_147")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_112")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_113")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_114")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_115")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hacker_lok_pirate_cave_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_112")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_113")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_114")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_134"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_115")) - { - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.hacker_lok_pirate_cave"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.hacker_lok_pirate_cave"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (hacker_lok_pirate_cave_condition_hasCompletedPirate (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_54"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hacker_lok_pirate_cave_condition_hasReturnTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_53"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hacker_lok_pirate_cave_condition_hasSlicedTheSystem (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_52"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hacker_lok_pirate_cave_condition_hasHackTask (player, npc)) - { - hacker_lok_pirate_cave_action_foundSecuritySys (player, npc); - - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_56"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId", 4); - - npcStartConversation (player, npc, "hacker_lok_pirate_cave", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (hacker_lok_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_61"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("hacker_lok_pirate_cave")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - if (branchId == 4 && hacker_lok_pirate_cave_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && hacker_lok_pirate_cave_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && hacker_lok_pirate_cave_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && hacker_lok_pirate_cave_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && hacker_lok_pirate_cave_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && hacker_lok_pirate_cave_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && hacker_lok_pirate_cave_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && hacker_lok_pirate_cave_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && hacker_lok_pirate_cave_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && hacker_lok_pirate_cave_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && hacker_lok_pirate_cave_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && hacker_lok_pirate_cave_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && hacker_lok_pirate_cave_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && hacker_lok_pirate_cave_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && hacker_lok_pirate_cave_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && hacker_lok_pirate_cave_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.hacker_lok_pirate_cave.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/happer_mos_eisley.java b/sku.0/sys.server/compiled/game/script/conversation/happer_mos_eisley.java deleted file mode 100644 index e769ce2b3..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/happer_mos_eisley.java +++ /dev/null @@ -1,531 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class happer_mos_eisley extends script.base_script -{ - public happer_mos_eisley() - { - } - String c_stringFile = "conversation/happer_mos_eisley"; - - - public boolean happer_mos_eisley_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean happer_mos_eisley_condition_hasInvestigateQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "quest_02_investigate_murder"); - } - - - public boolean happer_mos_eisley_condition_hasCompletedInvestigate(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_02_investigate_murder"); - } - - - public boolean happer_mos_eisley_condition_hasGatheredTheClue(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedTask(player, "quest_02_investigate_murder", "getClues") || happer_mos_eisley_condition_hasCompletedInvestigate(player, npc); - } - - - public void happer_mos_eisley_action_sendSignalClueUpdate(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "getCluesHapper"); - } - - - public void happer_mos_eisley_action_sendSignalIdentifyBody(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "happerIdentifyBody"); - } - - - public void happer_mos_eisley_action_sendSignalTalkHapper(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "speakWithHapper"); - } - - - public int happer_mos_eisley_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - happer_mos_eisley_action_sendSignalIdentifyBody (player, npc); - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_11"); - } - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int happer_mos_eisley_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_11")) - { - - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int happer_mos_eisley_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_16"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_18"); - } - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int happer_mos_eisley_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_18")) - { - - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int happer_mos_eisley_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int happer_mos_eisley_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_26")) - { - - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - happer_mos_eisley_action_sendSignalClueUpdate (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.happer_mos_eisley"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.happer_mos_eisley"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (happer_mos_eisley_condition_hasGatheredTheClue (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_30"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (happer_mos_eisley_condition_hasInvestigateQuest (player, npc)) - { - happer_mos_eisley_action_sendSignalTalkHapper (player, npc); - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.happer_mos_eisley.branchId", 2); - - npcStartConversation (player, npc, "happer_mos_eisley", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (happer_mos_eisley_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("happer_mos_eisley")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - if (branchId == 2 && happer_mos_eisley_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && happer_mos_eisley_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && happer_mos_eisley_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && happer_mos_eisley_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && happer_mos_eisley_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && happer_mos_eisley_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.happer_mos_eisley.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/hx_138.java b/sku.0/sys.server/compiled/game/script/conversation/hx_138.java deleted file mode 100644 index 12b110d14..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/hx_138.java +++ /dev/null @@ -1,3878 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class hx_138 extends script.base_script -{ - public hx_138() - { - } - String c_stringFile = "conversation/hx_138"; - - - public boolean hx_138_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean hx_138_condition_firstMeeting(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.isTaskActive(player, "outbreak_quest_02_imperial", "findTroopers") || groundquests.isTaskActive(player, "outbreak_quest_02_rebel", "findTroopers") || groundquests.isTaskActive(player, "outbreak_quest_02_neutral", "findTroopers") ); - } - - - public boolean hx_138_condition_hasRescueQuestActive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_011", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_012", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "coaxingPleyer") || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "spawnSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "coaxingPleyer") ); - } - - - public boolean hx_138_condition_failedRescueOne(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_01_fail"); - } - - - public boolean hx_138_condition_failedRescueTwo(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_02_fail"); - } - - - public boolean hx_138_condition_failedRescueThree(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_03_fail"); - } - - - public boolean hx_138_condition_failedRescueFour(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_04_fail"); - } - - - public boolean hx_138_condition_successRescueOne(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_01_success"); - } - - - public boolean hx_138_condition_successRescueTwo(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_02_success"); - } - - - public boolean hx_138_condition_successRescueThree(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_03_success"); - } - - - public boolean hx_138_condition_successRescueFour(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_rescue_04_success"); - } - - - public boolean hx_138_condition_hasShuttlePartQuestActive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_shuttle_parts"); - } - - - public boolean hx_138_condition_isStuckRescuing(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - - return (groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_04", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_05", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_06", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_07", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_08", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_011", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_012", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_09", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_010", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_011", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_012", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_013", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_014", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_015", "speakSurvivor") || groundquests.isTaskActive(player, "outbreak_quest_rescue_016", "speakSurvivor") ); - } - - - public boolean hx_138_condition_finishedRescueCanceledShuttle(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_04_success") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_shuttle_parts"); - } - - - public boolean hx_138_condition_hasShuttlePartsNotMechanic(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "outbreak_quest_shuttle_parts", "deliverMechanic"); - } - - - public boolean hx_138_condition_isImperialQuestPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial"); - } - - - public boolean hx_138_condition_isRebelQuestPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel"); - } - - - public boolean hx_138_condition_isNeutralQuestPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral"); - } - - - public boolean hx_138_condition_hasGivenPartsMechanic(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "outbreak_quest_shuttle_parts", "seeHX138"); - } - - - public boolean hx_138_condition_readyFirstRescue(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial") || groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel") || groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral")) && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_05") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_06") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_07"); - } - - - public boolean hx_138_condition_hasFinishedShuttleParts(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_shuttle_parts"); - } - - - public boolean hx_138_condition_isPlayerGodMode(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return isGod(player); - } - - - public boolean hx_138_condition_hasCompletedRescue3Del4(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_03") || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_011") || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_012") || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_013")) && (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_04") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_014") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_015") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_016")); - } - - - public boolean hx_138_condition_hasCompletedRescue2Del3(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_02") || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_08") || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_09") || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_010")) && (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_03") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_011") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_012") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_013")); - } - - - public boolean hx_138_condition_hasCompletedRescue1Del2(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_01") || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_05") || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_06") || groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_07")) && (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_02") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_08") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_09") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_010")); - } - - - public boolean hx_138_condition_isOnDungeonMissions(obj_id player, obj_id npc) throws InterruptedException - { - String faction = ""; - if (hx_138_condition_isImperialQuestPlayer(player,npc)) - { - faction = "imperial"; - } - else if (hx_138_condition_isRebelQuestPlayer(player,npc)) - { - faction = "rebel"; - } - else - { - faction = "neutral"; - } - - if (faction == null || faction.length() <= 0) - { - return false; - } - - boolean hasAValidQuest = false; - for (int i = 1; i <= 5; i++) - { - testAbortScript(); - if (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_" + faction + "_0" + i)) - { - continue; - } - - hasAValidQuest = true; - break; - } - - return hasAValidQuest; - } - - - public boolean hx_138_condition_shuttleEscape(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "seeHX138") || groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "seeHX138") || groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "seeHX138")); - } - - - public boolean hx_138_condition_hasCompletedRescue4DelShuttle(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "outbreak_quest_rescue_04") || groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_014") || groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_015") || groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_016") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_shuttle_parts")); - } - - - public boolean hx_138_condition_hasRadio(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findEpsilonContact"); - } - - - public void hx_138_action_sendSignalMetHX138(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "playerFoundStormtroopers"); - } - - - public void hx_138_action_resetRescueOne(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_01_fail"); - if (groundquests.isQuestActive(player, "outbreak_quest_rescue_01")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_05")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_05"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_06")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_06"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_07")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_07"); - } - - hx_138_action_giveFirstSurvivorQuest(player,npc); - } - - - public void hx_138_action_giveSecondSurvivorQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_01_success"); - - int randNum = rand(1,4); - if (randNum <= 0 || randNum > 4) - { - return; - } - switch(randNum) - { - case 1: - groundquests.grantQuest(player, "outbreak_quest_rescue_02"); - break; - case 2: - groundquests.grantQuest(player, "outbreak_quest_rescue_08"); - break; - case 3: - groundquests.grantQuest(player, "outbreak_quest_rescue_09"); - break; - case 4: - groundquests.grantQuest(player, "outbreak_quest_rescue_010"); - break; - } - } - - - public void hx_138_action_giveThirdSurvivorQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_02_success"); - - int randNum = rand(1,4); - if (randNum <= 0 || randNum > 4) - { - return; - } - switch(randNum) - { - case 1: - groundquests.grantQuest(player, "outbreak_quest_rescue_03"); - break; - case 2: - groundquests.grantQuest(player, "outbreak_quest_rescue_011"); - break; - case 3: - groundquests.grantQuest(player, "outbreak_quest_rescue_012"); - break; - case 4: - groundquests.grantQuest(player, "outbreak_quest_rescue_013"); - break; - } - - } - - - public void hx_138_action_giveFourthSurvivorQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_03_success"); - - int randNum = rand(1,4); - if (randNum <= 0 || randNum > 4) - { - return; - } - switch(randNum) - { - case 1: - groundquests.grantQuest(player, "outbreak_quest_rescue_04"); - break; - case 2: - groundquests.grantQuest(player, "outbreak_quest_rescue_014"); - break; - case 3: - groundquests.grantQuest(player, "outbreak_quest_rescue_015"); - break; - case 4: - groundquests.grantQuest(player, "outbreak_quest_rescue_016"); - break; - } - } - - - public void hx_138_action_resetRescueTwo(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_02_fail"); - - if (groundquests.isQuestActive(player, "outbreak_quest_rescue_02")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_02"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_08")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_08"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_09")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_09"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_010")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_010"); - } - - hx_138_action_giveSecondSurvivorQuest(player,npc); - } - - - public void hx_138_action_resetRescueThree(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_03_fail"); - - if (groundquests.isQuestActive(player, "outbreak_quest_rescue_03")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_03"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_011")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_011"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_012")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_012"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_013")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_013"); - } - - hx_138_action_giveThirdSurvivorQuest(player,npc); - } - - - public void hx_138_action_resetRescueFour(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_04_fail"); - - if (groundquests.isQuestActive(player, "outbreak_quest_rescue_04")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_04"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_014")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_014"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_015")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_015"); - } - else if (groundquests.isQuestActive(player, "outbreak_quest_rescue_016")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_016"); - } - - hx_138_action_giveFourthSurvivorQuest(player,npc); - } - - - public void hx_138_action_fixPlayerRescueQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (groundquests.isTaskActive(player, "outbreak_quest_rescue_01", "rescueCompleted")) - { - hx_138_action_resetRescueOne (player, npc); - } - else if (groundquests.isTaskActive(player, "outbreak_quest_rescue_02", "rescueCompleted")) - { - hx_138_action_resetRescueTwo (player, npc); - } - else if (groundquests.isTaskActive(player, "outbreak_quest_rescue_03", "rescueCompleted")) - { - hx_138_action_resetRescueThree (player, npc); - } - else - { - hx_138_action_resetRescueFour (player, npc); - } - } - - - public void hx_138_action_finishRescueGiveShuttleQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.clearQuest(player, "outbreak_quest_rescue_04_success"); - hx_138_action_giveShuttleQuest(player,npc); - } - - - public void hx_138_action_giveShuttleQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.grantQuest(player, "outbreak_quest_shuttle_parts"); - } - - - public void hx_138_action_finishShuttleParts(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "deliveredShuttleSupplies"); - } - - - public void hx_138_action_giveFirstSurvivorQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - int randNum = rand(1,4); - if (randNum <= 0 || randNum > 4) - { - return; - } - switch(randNum) - { - case 1: - groundquests.grantQuest(player, "outbreak_quest_rescue_01"); - break; - case 2: - groundquests.grantQuest(player, "outbreak_quest_rescue_05"); - break; - case 3: - groundquests.grantQuest(player, "outbreak_quest_rescue_06"); - break; - case 4: - groundquests.grantQuest(player, "outbreak_quest_rescue_07"); - break; - } - - } - - - public void hx_138_action_giveRandomInquisitorQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - int randNumber = rand(1,5); - if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_0"+randNumber); - } - else if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_0"+randNumber); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_0"+randNumber); - } - } - - - public void hx_138_action_giveInquisitorQuestOne(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_01"); - } - else if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_01"); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_01"); - } - } - - - public void hx_138_action_giveInquisitorQuestTwo(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_02"); - } - else if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_02"); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_02"); - } - } - - - public void hx_138_action_giveInquisitorQuestFive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_05"); - } - else if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_05"); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_05"); - } - } - - - public void hx_138_action_giveInquisitorQuestFour(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_04"); - } - else if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_04"); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_04"); - } - } - - - public void hx_138_action_giveInquisitorQuestThree(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_imperial_03"); - } - else if (groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")) - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_rebel_03"); - } - else - { - groundquests.grantQuest(player, "outbreak_quest_administrative_building_neutral_03"); - } - } - - - public void hx_138_action_fixRescueGates(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 1; i <= 5; i++) - { - testAbortScript(); - if ((groundquests.isTaskActive(player, "outbreak_quest_rescue_0"+i, "rescueCompleted") || groundquests.isTaskActive(player, "outbreak_quest_rescue_0"+i, "speakSurvivor"))) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_0"+i); - groundquests.grantQuest(player, "outbreak_quest_rescue_0"+i); - return; - } - } - } - - - public void hx_138_action_godModeRescue01a(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_01"); - } - - - public void hx_138_action_godModeRescue01d(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_07"); - } - - - public void hx_138_action_godModeRescue01c(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_06"); - } - - - public void hx_138_action_godModeRescue01b(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_05"); - } - - - public void hx_138_action_godModeRescue02a(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_02"); - } - - - public void hx_138_action_godModeRescue02d(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_010"); - } - - - public void hx_138_action_godModeRescue02c(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_09"); - } - - - public void hx_138_action_godModeRescue02b(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_08"); - } - - - public void hx_138_action_godModeRescue03d(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_013"); - } - - - public void hx_138_action_godModeRescue03c(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_012"); - } - - - public void hx_138_action_godModeRescue03b(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_011"); - } - - - public void hx_138_action_godModeRescue03a(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_03"); - } - - - public void hx_138_action_godModeRescue04d(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_016"); - } - - - public void hx_138_action_godModeRescue04c(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_015"); - } - - - public void hx_138_action_godModeRescue04b(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_014"); - } - - - public void hx_138_action_godModeRescue04a(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_quest_rescue_04"); - } - - - public int hx_138_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_122")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_138"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_177")) - { - - if (hx_138_condition_isImperialQuestPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_178"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_181"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_182"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_183"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_184"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_185"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_isRebelQuestPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_179"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_191"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_192"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_193"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_194"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_195"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_isNeutralQuestPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_180"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_196"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_197"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_198"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_199"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_200"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_138")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "laugh"); - - string_id message = new string_id (c_stringFile, "s_139"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_140")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_141"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_142"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_142")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_143"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_144")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_145"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_146")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "bow3"); - - hx_138_action_giveRandomInquisitorQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_147"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_181")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_186"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_182")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_187"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_183")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_188"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_184")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_189"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_185")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_190"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_191")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_201"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_192")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_202"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_193")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_203"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_194")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_204"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_195")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_205"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_196")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_206"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_197")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_207"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_198")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_208"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_199")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_209"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_200")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveInquisitorQuestFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_210"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_104")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_fixRescueGates (player, npc); - - string_id message = new string_id (c_stringFile, "s_105"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_63")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_67")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_69"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_75"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_75")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_77"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_79")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_finishRescueGiveShuttleQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_81"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch40(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_85")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_resetRescueFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_87"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch42(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_91")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_93"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_95"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 43); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_99")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveFourthSurvivorQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_101"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_356")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_357"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_358"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_359"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_360"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_361"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 46); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch43(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_95")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveFourthSurvivorQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_97"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch46(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_358")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue04a (player, npc); - - string_id message = new string_id (c_stringFile, "s_362"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_359")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue04b (player, npc); - - string_id message = new string_id (c_stringFile, "s_364"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_360")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue04c (player, npc); - - string_id message = new string_id (c_stringFile, "s_363"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_361")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue04d (player, npc); - - string_id message = new string_id (c_stringFile, "s_365"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch51(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_121")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_resetRescueThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_125"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch53(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_129")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_131"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 54); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_345")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_346"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_347"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_349"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_350"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_351"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 56); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch54(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_133")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveThirdSurvivorQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_135"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch56(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_347")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue03a (player, npc); - - string_id message = new string_id (c_stringFile, "s_348"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_349")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue03b (player, npc); - - string_id message = new string_id (c_stringFile, "s_352"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_350")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue03c (player, npc); - - string_id message = new string_id (c_stringFile, "s_353"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_351")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue03d (player, npc); - - string_id message = new string_id (c_stringFile, "s_354"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch61(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_159")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_resetRescueTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_161"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch63(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_165")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveSecondSurvivorQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_167"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_320")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_321"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_325"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_334"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_338"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_342"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 65); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch65(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_325")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue02a (player, npc); - - string_id message = new string_id (c_stringFile, "s_326"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_334")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue02b (player, npc); - - string_id message = new string_id (c_stringFile, "s_336"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_338")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue02c (player, npc); - - string_id message = new string_id (c_stringFile, "s_340"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_342")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue02d (player, npc); - - string_id message = new string_id (c_stringFile, "s_344"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch70(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_216")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shakefist"); - - hx_138_action_resetRescueOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_218"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch77(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_305")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_307"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_308"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 78); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_310")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_311"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_312"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_313"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_314"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_315"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 80); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch78(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_308")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_giveFirstSurvivorQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_309"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch80(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_312")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue01a (player, npc); - - string_id message = new string_id (c_stringFile, "s_316"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_313")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue01b (player, npc); - - string_id message = new string_id (c_stringFile, "s_317"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_314")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue01c (player, npc); - - string_id message = new string_id (c_stringFile, "s_318"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_315")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_godModeRescue01d (player, npc); - - string_id message = new string_id (c_stringFile, "s_319"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int hx_138_handleBranch85(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_244")) - { - - if (hx_138_condition__defaultCondition (player, npc)) - { - hx_138_action_sendSignalMetHX138 (player, npc); - - string_id message = new string_id (c_stringFile, "s_249"); - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.hx_138"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.hx_138"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (hx_138_condition_shuttleEscape (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - string_id message = new string_id (c_stringFile, "s_253"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_isOnDungeonMissions (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_251"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_hasFinishedShuttleParts (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition_isPlayerGodMode (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 3); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "hx_138", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_hasGivenPartsMechanic (player, npc)) - { - doAnimationAction (npc, "celebrate"); - - hx_138_action_finishShuttleParts (player, npc); - - string_id message = new string_id (c_stringFile, "s_174"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_hasShuttlePartsNotMechanic (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_110"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_finishedRescueCanceledShuttle (player, npc)) - { - hx_138_action_giveShuttleQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_109"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_hasShuttlePartQuestActive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_56"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_isStuckRescuing (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_103"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_104"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 32); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_successRescueFour (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 34); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "hx_138", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_failedRescueFour (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_83"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 40); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "hx_138", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_successRescueThree (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (hx_138_condition_isPlayerGodMode (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_91"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_99"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_356"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 42); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "hx_138", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_failedRescueThree (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_119"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_121"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 51); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "hx_138", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_successRescueTwo (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition_isPlayerGodMode (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_129"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_345"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 53); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_failedRescueTwo (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_157"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_159"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 61); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_successRescueOne (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_163"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition_isPlayerGodMode (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_165"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_320"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 63); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_failedRescueOne (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_216"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 70); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_hasRescueQuestActive (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - string_id message = new string_id (c_stringFile, "s_220"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_hasCompletedRescue4DelShuttle (player, npc)) - { - hx_138_action_giveShuttleQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_255"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_hasCompletedRescue3Del4 (player, npc)) - { - hx_138_action_giveFourthSurvivorQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_245"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_hasCompletedRescue2Del3 (player, npc)) - { - hx_138_action_giveThirdSurvivorQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_246"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_hasCompletedRescue1Del2 (player, npc)) - { - hx_138_action_giveSecondSurvivorQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_247"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_readyFirstRescue (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_226"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (hx_138_condition_isPlayerGodMode (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_305"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_310"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 77); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_firstMeeting (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_242"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (hx_138_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_244"); - } - - utils.setScriptVar (player, "conversation.hx_138.branchId", 85); - - npcStartConversation (player, npc, "hx_138", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition_hasRadio (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_257"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (hx_138_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_258"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("hx_138")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.hx_138.branchId"); - - if (branchId == 3 && hx_138_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && hx_138_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && hx_138_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && hx_138_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && hx_138_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && hx_138_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && hx_138_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && hx_138_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && hx_138_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && hx_138_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && hx_138_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && hx_138_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && hx_138_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && hx_138_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && hx_138_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 40 && hx_138_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 42 && hx_138_handleBranch42 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 43 && hx_138_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 46 && hx_138_handleBranch46 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 51 && hx_138_handleBranch51 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 53 && hx_138_handleBranch53 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 54 && hx_138_handleBranch54 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 56 && hx_138_handleBranch56 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 61 && hx_138_handleBranch61 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 63 && hx_138_handleBranch63 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 65 && hx_138_handleBranch65 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 70 && hx_138_handleBranch70 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 77 && hx_138_handleBranch77 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 78 && hx_138_handleBranch78 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 80 && hx_138_handleBranch80 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 85 && hx_138_handleBranch85 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.hx_138.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_kaythree.java b/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_kaythree.java deleted file mode 100644 index 2bad2772f..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_kaythree.java +++ /dev/null @@ -1,5509 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.buff; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.static_item; -import script.library.utils; - - -public class imperial_empire_day_kaythree extends script.base_script -{ - public imperial_empire_day_kaythree() - { - } - String c_stringFile = "conversation/imperial_empire_day_kaythree"; - - - public boolean imperial_empire_day_kaythree_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean imperial_empire_day_kaythree_condition_isEntertainerOrTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_kaythree_condition_isEntertainer(player, npc) || imperial_empire_day_kaythree_condition_isTrader(player, npc)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasNotCraftedSupplies(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 0; i < holiday.ALL_IMPERIAL_QUESTS.length; i++) - { - testAbortScript(); - if ((groundquests.isQuestActive(player, holiday.ALL_IMPERIAL_QUESTS[i]) && groundquests.isTaskActive(player, holiday.ALL_IMPERIAL_QUESTS[i], "crafteSupplies"))) - { - return true; - } - } - return false; - } - - - public boolean imperial_empire_day_kaythree_condition_isEntertainerOrTraderAndNeverMetNotChampion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_kaythree_condition_isEntertainerOrTrader(player, npc) && !imperial_empire_day_kaythree_condition_alreadyKnowsKaythree(player, npc) && !imperial_empire_day_kaythree_condition_isChampion(player, npc)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompletedEntertainerOneNotTwo(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_01) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_02)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasAMissionActive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 0; i < holiday.ALL_IMPERIAL_QUESTS.length; i++) - { - testAbortScript(); - if (groundquests.isQuestActive(player, holiday.ALL_IMPERIAL_QUESTS[i])) - { - return true; - } - } - return false; - } - - - public boolean imperial_empire_day_kaythree_condition_alreadyKnowsKaythree(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_01) || groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_DOMESTICS) || groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_ENG) || groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_MUNITIONS) || groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_STRUC); - } - - - public boolean imperial_empire_day_kaythree_condition_hasRecoveryCollectionPrerequisite(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT); - } - - - public boolean imperial_empire_day_kaythree_condition_isChampion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlot(player, holiday.EMPIRE_DAY_CHAMPION_BADGE); - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompletedEntertainerTwoNotThree(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_02) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_03)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompletedEntertainerThreeNotFour(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_03) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_04)); - } - - - public boolean imperial_empire_day_kaythree_condition_isRebelPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isRebel(player)); - } - - - public boolean imperial_empire_day_kaythree_condition_isNeutralPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return(!factions.isImperial(player) && !factions.isRebel(player)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompletedEntertainerFourNotFive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_04) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_05)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompletedEntertainerFiveNotSix(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_05) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_06)); - } - - - public boolean imperial_empire_day_kaythree_condition_isEntertainerWaitingForSignal(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_kaythree_condition_isEntertainer(player, npc) && imperial_empire_day_kaythree_condition_alreadyKnowsKaythree(player, npc) && imperial_empire_day_kaythree_condition_hasEntertainerMissionWithTask(player, npc)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasEntertainerMissionWithTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 0; i < holiday.ALL_IMPERIAL_ENTERTAINER_QUESTS.length; i++) - { - testAbortScript(); - if ((groundquests.isQuestActive(player, holiday.ALL_IMPERIAL_ENTERTAINER_QUESTS[i]) && groundquests.isTaskActive(player, holiday.ALL_IMPERIAL_ENTERTAINER_QUESTS[i], "waitingForCredit"))) - { - return true; - } - } - return false; - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompleted1stMissionNot2nd(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_DOMESTICS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_DOMESTICS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_ENG) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_ENG)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_MUNITIONS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_MUNITIONS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_STRUC) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_STRUC)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompleted2ndMissionNot3rd(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_DOMESTICS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_DOMESTICS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_ENG) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_ENG)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_MUNITIONS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_MUNITIONS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_STRUC) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_STRUC)); - } - - - public boolean imperial_empire_day_kaythree_condition_isEnterainerOrTraderAndNeverMetKaythreeIsChampion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_kaythree_condition_isChampion(player, npc) && !imperial_empire_day_kaythree_condition_alreadyKnowsKaythree(player, npc)); - } - - - public boolean imperial_empire_day_kaythree_condition_isChampionKnowsKaythree(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_kaythree_condition_isChampion(player, npc) && imperial_empire_day_kaythree_condition_alreadyKnowsKaythree(player, npc)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompleted3rdMissionNot4th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_DOMESTICS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_DOMESTICS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_ENG) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_ENG)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_MUNITIONS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_MUNITIONS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_STRUC) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_STRUC)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompleted4thMissionNot5th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_DOMESTICS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_DOMESTICS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_ENG) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_ENG)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_MUNITIONS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_MUNITIONS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_STRUC) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_STRUC)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompleted5thMissionNot6th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_DOMESTICS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_DOMESTICS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_ENG) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_ENG)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_MUNITIONS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_MUNITIONS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_STRUC) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_STRUC)); - } - - - public boolean imperial_empire_day_kaythree_condition_hasCompleted6thMission(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_06) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_DOMESTICS) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_ENG) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_MUNITIONS) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_STRUC); - } - - - public boolean imperial_empire_day_kaythree_condition_isEntertainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.ENTERTAINER); - } - - - public boolean imperial_empire_day_kaythree_condition_isTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.TRADER); - } - - - public boolean imperial_empire_day_kaythree_condition_isStructuresTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasSkill(player, "class_structures_phase1_novice"); - } - - - public boolean imperial_empire_day_kaythree_condition_isEngineeringTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasSkill(player, "class_engineering_phase1_novice"); - } - - - public boolean imperial_empire_day_kaythree_condition_isMunitionsTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasSkill(player, "class_munitions_phase1_novice"); - } - - - public boolean imperial_empire_day_kaythree_condition_isDomesticsTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasSkill(player, "class_domestics_phase1_novice"); - } - - - public void imperial_empire_day_kaythree_action_grantDomesticsMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_DOMESTICS); - if (getCollectionSlotValue(player, holiday.IMPERIAL_ENGINEERING_START_SLOT) <= 0) - { - imperial_empire_day_kaythree_action_grantEngineeringCollectionStart(player, npc); - } - } - - - public void imperial_empire_day_kaythree_action_grantDomesticsMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_DOMESTICS); - } - - - public void imperial_empire_day_kaythree_action_grantDomesticsMissionThree(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_DOMESTICS); - } - - - public void imperial_empire_day_kaythree_action_grantDomesticsMissionFour(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_DOMESTICS); - } - - - public void imperial_empire_day_kaythree_action_grantDomesticsMissionFive(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_DOMESTICS); - } - - - public void imperial_empire_day_kaythree_action_spawnTroopers(obj_id player, obj_id npc) throws InterruptedException - { - - for (int i = 0; i < 3; i++) - { - testAbortScript(); - location guardLocation = groundquests.getRandom2DLocationAroundLocation(npc, 1, 1, 5, 12); - int mobLevel = getLevel(player); - obj_id guard = create.object("imperial_emperorsday_ceremony_sentry", guardLocation, mobLevel); - attachScript(guard, "event.emp_day.factional_guard_self_destruct"); - startCombat(guard, player); - } - } - - - public void imperial_empire_day_kaythree_action_grantDomesticsMissionSix(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_DOMESTICS); - } - - - public void imperial_empire_day_kaythree_action_grantEntertainerOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_01); - modifyCollectionSlotValue(player, holiday.IMPERIAL_ENTERTAINER_START_SLOT, 1); - } - - - public void imperial_empire_day_kaythree_action_grantEntertainerTwo(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_02); - } - - - public void imperial_empire_day_kaythree_action_grantEntertainerThree(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_03); - } - - - public void imperial_empire_day_kaythree_action_grantEntertainerFour(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_04); - } - - - public void imperial_empire_day_kaythree_action_grantEntertainerFive(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_05); - } - - - public void imperial_empire_day_kaythree_action_checkHolidayTimeStampOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - } - - - public void imperial_empire_day_kaythree_action_grantEntertainerSix(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_ENTERTAINER_06); - } - - - public void imperial_empire_day_kaythree_action_entertainerSendSignalIncrementCollection(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "creditReceived"); - if (hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_ENTERTAINER_COUNTER_SLOT)) - { - modifyCollectionSlotValue(player, holiday.IMPERIAL_ENTERTAINER_COUNTER_SLOT, 1); - } - } - - - public void imperial_empire_day_kaythree_action_grantEngineeringCollectionStart(obj_id player, obj_id npc) throws InterruptedException - { - if (getCollectionSlotValue(player, holiday.IMPERIAL_ENGINEERING_START_SLOT) <= 0) - { - modifyCollectionSlotValue(player, holiday.IMPERIAL_ENGINEERING_START_SLOT, 1); - } - - } - - - public void imperial_empire_day_kaythree_action_grantEngineeringMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_ENG); - if (getCollectionSlotValue(player, holiday.IMPERIAL_ENGINEERING_START_SLOT) <= 0) - { - imperial_empire_day_kaythree_action_grantEngineeringCollectionStart(player, npc); - } - } - - - public void imperial_empire_day_kaythree_action_grantEngineeringMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_ENG); - } - - - public void imperial_empire_day_kaythree_action_grantEngineeringMissionThree(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_ENG); - } - - - public void imperial_empire_day_kaythree_action_grantEngineeringMissionFour(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_ENG); - } - - - public void imperial_empire_day_kaythree_action_grantEngineeringMissionFive(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_ENG); - } - - - public void imperial_empire_day_kaythree_action_grantEnigineeringMissionSix(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_ENG); - } - - - public void imperial_empire_day_kaythree_action_grantMunitionsMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_MUNITIONS); - if (getCollectionSlotValue(player, holiday.IMPERIAL_ENGINEERING_START_SLOT) <= 0) - { - imperial_empire_day_kaythree_action_grantEngineeringCollectionStart(player, npc); - } - } - - - public void imperial_empire_day_kaythree_action_grantMunitionsMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_MUNITIONS); - } - - - public void imperial_empire_day_kaythree_action_grantMunitionsMissionThree(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_MUNITIONS); - } - - - public void imperial_empire_day_kaythree_action_grantMunitionsMissionFour(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_MUNITIONS); - } - - - public void imperial_empire_day_kaythree_action_grantMunitionsMissionFive(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_MUNITIONS); - } - - - public void imperial_empire_day_kaythree_action_grantMunitionsMissionSix(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_MUNITIONS); - } - - - public void imperial_empire_day_kaythree_action_grantStructuresMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_STRUC); - if (getCollectionSlotValue(player, holiday.IMPERIAL_ENGINEERING_START_SLOT) <= 0) - { - imperial_empire_day_kaythree_action_grantEngineeringCollectionStart(player, npc); - } - } - - - public void imperial_empire_day_kaythree_action_grantStructuresMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_02_STRUC); - } - - - public void imperial_empire_day_kaythree_action_grantStructuresMissionThree(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_03_STRUC); - } - - - public void imperial_empire_day_kaythree_action_grantStructuresMissionFour(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_04_STRUC); - } - - - public void imperial_empire_day_kaythree_action_grantStructuresMissionFive(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_05_STRUC); - } - - - public void imperial_empire_day_kaythree_action_grantStructuresMissionSix(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_06_STRUC); - } - - - public String imperial_empire_day_kaythree_tokenTO_timeLeftRecruitment(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public String imperial_empire_day_kaythree_tokenTO_timeLeftPropaganda(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public int imperial_empire_day_kaythree_tokenDI_notUsed(obj_id player, obj_id npc) throws InterruptedException - { - return 0; - } - - - public int imperial_empire_day_kaythree_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_298")) - { - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerOneNotTwo (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_148"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_150"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 73); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerTwoNotThree (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_157"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_161"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 75); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerThreeNotFour (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_189"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_253"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 77); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerFourNotFive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_257"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_259"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 79); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerFiveNotSix (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_263"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_265"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 81); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted6thMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_301"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_303"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_192")) - { - - if (imperial_empire_day_kaythree_condition_hasCompleted1stMissionNot2nd (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_197"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_198"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted2ndMissionNot3rd (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_207"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_208"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_233"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted3rdMissionNot4th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_215"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted4thMissionNot5th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_225"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_226"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_237"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 46); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted5thMissionNot6th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_230"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_231"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_243"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_247"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 56); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_289"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerOneNotTwo (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_148"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_150"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 73); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerTwoNotThree (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_157"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_161"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 75); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerThreeNotFour (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_189"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_253"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 77); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerFourNotFive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_257"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_259"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 79); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerFiveNotSix (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_263"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_265"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 81); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted6thMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_301"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_303"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_192")) - { - - if (imperial_empire_day_kaythree_condition_hasCompleted1stMissionNot2nd (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_197"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_198"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted2ndMissionNot3rd (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_207"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_208"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_233"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted3rdMissionNot4th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_215"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted4thMissionNot5th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_225"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_226"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_237"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 46); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted5thMissionNot6th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_230"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_231"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_243"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_247"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 56); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_289"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerOneNotTwo (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_148"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_150"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 73); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerTwoNotThree (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_157"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_161"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 75); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerThreeNotFour (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_189"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_253"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 77); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerFourNotFive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_257"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_259"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 79); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompletedEntertainerFiveNotSix (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_263"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_265"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 81); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted6thMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_301"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_303"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_198")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_199"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_200"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 9); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_200")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_201"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_202"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_205"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 10); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_202")) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionTwo (player, npc); - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_203"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_141"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_143"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_205")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_206"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_153"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_159"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_160"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_208")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_209"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_210"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_233")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_234"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_165"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_166"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_167"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_210")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_211"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_212"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 21); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_212")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_213"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_162"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_163"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_164"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_215")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_216"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_217"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_235"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 31); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_217")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_218"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_219"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_220"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 32); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_235")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_236"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_176"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_178"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_179"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_219")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_221"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_222"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_220")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_223"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_172"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_173"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_175"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_222")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_224"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_168"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_169"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_170"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch46(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_226")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_227"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_228"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 47); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_237")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_238"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_183"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_184"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_185"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch47(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_228")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_229"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_180"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_181"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_182"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch56(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_231")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_232"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_239"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 57); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_243")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_244"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_245"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 63); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_247")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_248"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEnigineeringMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_250"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_251"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_252"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch57(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_239")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_240"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_241"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 58); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch58(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_241")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_242"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEnigineeringMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_186"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_187"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_188"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch63(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_245")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_246"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEnigineeringMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_191"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_204"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_249"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch73(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_150")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - imperial_empire_day_kaythree_action_grantEntertainerTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_155"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch75(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_161")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - imperial_empire_day_kaythree_action_grantEntertainerThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_174"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch77(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_253")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - imperial_empire_day_kaythree_action_grantEntertainerFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_255"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch79(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_259")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - imperial_empire_day_kaythree_action_grantEntertainerFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_261"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch81(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_265")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - imperial_empire_day_kaythree_action_grantEntertainerSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_267"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch85(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_193")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_194"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_151"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_292"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_296"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 90); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_195")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_196"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_151"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_292"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_296"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 90); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch86(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_151")) - { - - if (imperial_empire_day_kaythree_condition_isEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_154"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_171"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 91); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isTrader (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_260"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_264"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 95); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_292")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_294"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_296")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_300"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch87(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_151")) - { - - if (imperial_empire_day_kaythree_condition_isEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_154"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_171"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 91); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isTrader (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_260"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_264"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 95); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_292")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_294"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_296")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_300"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch88(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_140")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_144"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_151"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_292"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_296"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 90); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_147")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_149"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_151"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_292"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_296"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 90); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch89(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_151")) - { - - if (imperial_empire_day_kaythree_condition_isEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_154"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_171"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 91); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isTrader (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_260"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_264"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 95); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_292")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_294"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_296")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_300"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch90(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_151")) - { - - if (imperial_empire_day_kaythree_condition_isEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_154"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_171"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 91); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isTrader (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_260"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_264"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 95); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_292")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_294"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_296")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_300"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch91(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_156")) - { - - if (imperial_empire_day_kaythree_condition_isEntertainer (player, npc)) - { - imperial_empire_day_kaythree_action_grantEntertainerOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_158"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_171")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_177"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_190"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 93); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch93(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_190")) - { - - if (imperial_empire_day_kaythree_condition_isEntertainerOrTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEntertainerOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_256"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch95(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_264")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_268"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_270"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 96); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_280")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_282"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_284"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_286"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_288"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch96(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_270")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_272"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_274"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 97); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch97(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_274")) - { - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_276"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_278"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 98); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_kaythree_handleBranch98(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_278")) - { - - if (imperial_empire_day_kaythree_condition_isDomesticsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantDomesticsMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_282"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEngineeringTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantEngineeringMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_284"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isMunitionsTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantMunitionsMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_286"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isStructuresTrader (player, npc)) - { - imperial_empire_day_kaythree_action_grantStructuresMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_288"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.imperial_empire_day_kaythree"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.imperial_empire_day_kaythree"); - - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (imperial_empire_day_kaythree_condition_isNeutralPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_291"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isRebelPlayer (player, npc)) - { - doAnimationAction (npc, "backhand_threaten"); - - string_id message = new string_id (c_stringFile, "s_50"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasCompleted6thMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_145"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_hasNotCraftedSupplies (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_138"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEntertainerWaitingForSignal (player, npc)) - { - imperial_empire_day_kaythree_action_entertainerSendSignalIncrementCollection (player, npc); - - string_id message = new string_id (c_stringFile, "s_297"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_298"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 5); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "imperial_empire_day_kaythree", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isChampionKnowsKaythree (player, npc)) - { - imperial_empire_day_kaythree_action_checkHolidayTimeStampOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_192"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "imperial_empire_day_kaythree", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_alreadyKnowsKaythree (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_192"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "imperial_empire_day_kaythree", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEnterainerOrTraderAndNeverMetKaythreeIsChampion (player, npc)) - { - doAnimationAction (npc, "salute2"); - - doAnimationAction (player, "salute2"); - - string_id message = new string_id (c_stringFile, "s_131"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_193"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_195"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 85); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "imperial_empire_day_kaythree", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition_isEntertainerOrTraderAndNeverMetNotChampion (player, npc)) - { - doAnimationAction (npc, "salute2"); - - string_id message = new string_id (c_stringFile, "s_137"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId", 88); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "imperial_empire_day_kaythree", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_kaythree_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_304"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("imperial_empire_day_kaythree")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - if (branchId == 5 && imperial_empire_day_kaythree_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && imperial_empire_day_kaythree_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && imperial_empire_day_kaythree_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && imperial_empire_day_kaythree_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && imperial_empire_day_kaythree_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && imperial_empire_day_kaythree_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && imperial_empire_day_kaythree_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && imperial_empire_day_kaythree_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && imperial_empire_day_kaythree_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && imperial_empire_day_kaythree_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && imperial_empire_day_kaythree_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && imperial_empire_day_kaythree_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && imperial_empire_day_kaythree_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 46 && imperial_empire_day_kaythree_handleBranch46 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 47 && imperial_empire_day_kaythree_handleBranch47 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 56 && imperial_empire_day_kaythree_handleBranch56 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 57 && imperial_empire_day_kaythree_handleBranch57 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 58 && imperial_empire_day_kaythree_handleBranch58 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 63 && imperial_empire_day_kaythree_handleBranch63 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 73 && imperial_empire_day_kaythree_handleBranch73 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 75 && imperial_empire_day_kaythree_handleBranch75 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 77 && imperial_empire_day_kaythree_handleBranch77 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 79 && imperial_empire_day_kaythree_handleBranch79 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 81 && imperial_empire_day_kaythree_handleBranch81 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 85 && imperial_empire_day_kaythree_handleBranch85 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 86 && imperial_empire_day_kaythree_handleBranch86 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 87 && imperial_empire_day_kaythree_handleBranch87 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 88 && imperial_empire_day_kaythree_handleBranch88 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 89 && imperial_empire_day_kaythree_handleBranch89 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 90 && imperial_empire_day_kaythree_handleBranch90 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 91 && imperial_empire_day_kaythree_handleBranch91 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 93 && imperial_empire_day_kaythree_handleBranch93 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 95 && imperial_empire_day_kaythree_handleBranch95 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 96 && imperial_empire_day_kaythree_handleBranch96 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 97 && imperial_empire_day_kaythree_handleBranch97 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 98 && imperial_empire_day_kaythree_handleBranch98 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.imperial_empire_day_kaythree.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_major_tantor.java b/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_major_tantor.java deleted file mode 100644 index 7c57c0966..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_major_tantor.java +++ /dev/null @@ -1,5263 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.buff; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.space_quest; -import script.library.static_item; -import script.library.utils; - - -public class imperial_empire_day_major_tantor extends script.base_script -{ - public imperial_empire_day_major_tantor() - { - } - String c_stringFile = "conversation/imperial_empire_day_major_tantor"; - - - public boolean imperial_empire_day_major_tantor_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean imperial_empire_day_major_tantor_condition_alreadyDoingRecruitment(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT) || buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF); - } - - - public boolean imperial_empire_day_major_tantor_condition_hasCompletedBothCollections(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_major_tantor_condition_hasCompletedPropagandaCollection(player, npc) && imperial_empire_day_major_tantor_condition_hasCompletedRecruitmentCollection(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isSpecialForcesImperial(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isDeclared(player) && factions.isImperial(player)); - } - - - public boolean imperial_empire_day_major_tantor_condition_hasRecruitmentCollectionPrerequisite(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT); - } - - - public boolean imperial_empire_day_major_tantor_condition_alreadyDoingPropaganda(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT) || buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF); - } - - - public boolean imperial_empire_day_major_tantor_condition_alreadyKnowsTantor(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_major_tantor_condition_hasRecruitmentCollectionPrerequisite(player, npc) || imperial_empire_day_major_tantor_condition_hasPropagandaCollectionPrerequisite(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_hasPropagandaCollectionPrerequisite(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT); - } - - - public boolean imperial_empire_day_major_tantor_condition_hasEmpireDayBadge(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlot(player, holiday.EMPIRE_DAY_CHAMPION_BADGE); - } - - - public boolean imperial_empire_day_major_tantor_condition_isQualifiedRecruitmentSpecialForces(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_major_tantor_condition_isSpecialForcesImperial(player, npc) && !imperial_empire_day_major_tantor_condition_alreadyDoingRecruitment(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isQualifiedPropagandaSpecialForces(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_major_tantor_condition_isSpecialForcesImperial(player, npc) && !imperial_empire_day_major_tantor_condition_alreadyDoingPropaganda(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isRebelPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isRebel(player)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isNeutralPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return(!factions.isImperial(player) && !factions.isRebel(player)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isQualifiedRecruitmentCombatant(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!imperial_empire_day_major_tantor_condition_isSpecialForcesImperial(player, npc) && !imperial_empire_day_major_tantor_condition_alreadyDoingRecruitment(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isQualifiedPropagandaCombatant(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!imperial_empire_day_major_tantor_condition_isSpecialForcesImperial(player, npc) && !imperial_empire_day_major_tantor_condition_alreadyDoingPropaganda(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_hasCompletedRecruitmentCollection(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollection(player, holiday.IMPERIAL_RECRUITING_COLLECTION); - } - - - public boolean imperial_empire_day_major_tantor_condition_hasCompletedPropagandaCollection(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollection(player, holiday.IMPERIAL_ANTIPROP_COLLECTION); - } - - - public boolean imperial_empire_day_major_tantor_condition_isLockedOutOfEvents(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_major_tantor_condition_isLockedOutOfRecruitment(player, npc) && imperial_empire_day_major_tantor_condition_isLockedOutOfPropaganda(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_hasNotCompletedBothCollections(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!imperial_empire_day_major_tantor_condition_hasCompletedPropagandaCollection(player, npc) && !imperial_empire_day_major_tantor_condition_hasCompletedRecruitmentCollection(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_alreadyDoingBothPropagandaRecruitment(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_major_tantor_condition_alreadyDoingPropaganda(player, npc) && imperial_empire_day_major_tantor_condition_alreadyDoingRecruitment(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isChampionDoesntKnowTantor(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_major_tantor_condition_hasEmpireDayBadge(player, npc) && !imperial_empire_day_major_tantor_condition_alreadyKnowsTantor(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isChampionKnowsTantor(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_major_tantor_condition_hasEmpireDayBadge(player, npc) && imperial_empire_day_major_tantor_condition_alreadyKnowsTantor(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_hasCollectionsButNotCompleted(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_major_tantor_condition_hasNotCompletedBothCollections(player, npc) && imperial_empire_day_major_tantor_condition_hasPropagandaCollectionPrerequisite(player, npc) && imperial_empire_day_major_tantor_condition_hasRecruitmentCollectionPrerequisite(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isLockedOutOfPropaganda(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasObjVar(player, holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT); - } - - - public boolean imperial_empire_day_major_tantor_condition_isLockedOutOfRecruitment(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasObjVar(player, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT); - } - - - public boolean imperial_empire_day_major_tantor_condition_canDoPropagandaEvent(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!imperial_empire_day_major_tantor_condition_alreadyDoingPropaganda(player, npc) && !imperial_empire_day_major_tantor_condition_isLockedOutOfPropaganda(player, npc) && !imperial_empire_day_major_tantor_condition_hasCompletedPropagandaCollection(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_canDoRecruitmentEvent(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!imperial_empire_day_major_tantor_condition_alreadyDoingRecruitment(player, npc) && !imperial_empire_day_major_tantor_condition_isLockedOutOfRecruitment(player, npc) && !imperial_empire_day_major_tantor_condition_hasCompletedRecruitmentCollection(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (imperial_empire_day_major_tantor_condition_canDoRecruitmentEvent(player, npc) || imperial_empire_day_major_tantor_condition_canDoPropagandaEvent(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.TRADER); - } - - - public boolean imperial_empire_day_major_tantor_condition_isEntertainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.ENTERTAINER); - } - - - public boolean imperial_empire_day_major_tantor_condition_isTraderOrEntertainer(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_empire_day_major_tantor_condition_isTrader(player, npc) || imperial_empire_day_major_tantor_condition_isEntertainer(player, npc); - } - - - public boolean imperial_empire_day_major_tantor_condition_canCheckLeaderBoard(obj_id player, obj_id npc) throws InterruptedException - { - - obj_id tatooine = getPlanetByName("tatooine"); - if (!isIdValid(tatooine) || !exists(tatooine)) - { - CustomerServiceLog("holidayEvent", "tantor_conversation.getLeaderBoardSui: Could not find Tatooine OID."); - return false; - } - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE)) - { - return false; - } - - int playerScore = getIntObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE); - if (playerScore <= 0) - { - return false; - } - - String playerName = getPlayerFullName(player); - if (playerName == null || playerName.length() <= 0) - { - return false; - } - - if (!holiday.setEmpireDayLeaderScores(tatooine, player, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY + holiday.PLANET_VAR_SCORE, playerScore, playerName, holiday.IMPERIAL_PLAYER)) - { - CustomerServiceLog("holidayEvent", "tantor_conversation.getLeaderBoardSui: Player: ("+player+") "+playerName+ " was unable to attain leader board data. Their score was: "+playerScore); - return false; - } - return true; - } - - - public boolean imperial_empire_day_major_tantor_condition_hasScore(obj_id player, obj_id npc) throws InterruptedException - { - return hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE); - } - - - public boolean imperial_empire_day_major_tantor_condition_isNeutralRebel(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_REB); - } - - - public boolean imperial_empire_day_major_tantor_condition_isNewNeutralPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_IMP) && imperial_empire_day_major_tantor_condition_isNeutralPlayer(player, npc)); - } - - - public boolean imperial_empire_day_major_tantor_condition_isNeutralRebelButImperial(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if ((hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_REB) && factions.isImperial(player))) - { - return true; - } - return false; - } - - - public void imperial_empire_day_major_tantor_action_setSFRecruitmentEventOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - if (getCollectionSlotValue(player, holiday.IMPERIAL_RECRUITING_START_SLOT) <= 0) - { - imperial_empire_day_major_tantor_action_setRecruitmentCollectionStarterSlot(player, npc); - } - - buff.applyBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF); - } - - - public void imperial_empire_day_major_tantor_action_resetPropagandaAndRecruitmentCollections(obj_id player, obj_id npc) throws InterruptedException - { - if (imperial_empire_day_major_tantor_condition_hasCompletedPropagandaCollection(player, npc) && imperial_empire_day_major_tantor_condition_hasCompletedRecruitmentCollection(player, npc)) - { - - String[] recruitingSlotsInCollection = getAllCollectionSlotsInCollection(holiday.IMPERIAL_RECRUITING_COLLECTION); - - for (int i = 0; i < recruitingSlotsInCollection.length; i++) - { - testAbortScript(); - - long collectionSlotValue = getCollectionSlotValue(player, recruitingSlotsInCollection[i]) * -1; - - modifyCollectionSlotValue(player, recruitingSlotsInCollection[i], collectionSlotValue); - } - - String[] slotsInCollection = getAllCollectionSlotsInCollection(holiday.IMPERIAL_ANTIPROP_COLLECTION); - - for (int i = 0; i < slotsInCollection.length; i++) - { - testAbortScript(); - - long collectionSlotValue = getCollectionSlotValue(player, slotsInCollection[i]) * -1; - - modifyCollectionSlotValue(player, slotsInCollection[i], collectionSlotValue); - } - - imperial_empire_day_major_tantor_action_setPropagandaCollectionStarterSlot(player, npc); - imperial_empire_day_major_tantor_action_setRecruitmentCollectionStarterSlot(player, npc); - } - } - - - public void imperial_empire_day_major_tantor_action_setRecruitmentTimeStampOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - holiday.setEventLockOutTimeStamp(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - } - - - public void imperial_empire_day_major_tantor_action_setSFPropagandaEventOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - if (getCollectionSlotValue(player, holiday.IMPERIAL_ANTIPROP_START_SLOT) <= 0) - { - imperial_empire_day_major_tantor_action_setPropagandaCollectionStarterSlot(player, npc); - } - - buff.applyBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF); - } - - - public void imperial_empire_day_major_tantor_action_giveMaraKaythreeWaypoint(obj_id player, obj_id npc) throws InterruptedException - { - location loc = new location(-5533, 6, 4372, "naboo"); - obj_id maraWpt = createWaypointInDatapad(player, loc); - setWaypointName(maraWpt, "Unknown Imperial Parties"); - setWaypointActive(maraWpt, true); - } - - - public void imperial_empire_day_major_tantor_action_spawnTroopers(obj_id player, obj_id npc) throws InterruptedException - { - - for (int i = 0; i < 3; i++) - { - testAbortScript(); - location guardLocation = groundquests.getRandom2DLocationAroundLocation(npc, 1, 1, 5, 12); - int mobLevel = getLevel(player); - obj_id guard = create.object("imperial_emperorsday_ceremony_sentry", guardLocation, mobLevel); - attachScript(guard, "event.emp_day.factional_guard_self_destruct"); - startCombat(guard, player); - } - } - - - public void imperial_empire_day_major_tantor_action_getLeaderBoardSui(obj_id player, obj_id npc) throws InterruptedException - { - obj_id tatooine = getPlanetByName("tatooine"); - if (!isIdValid(tatooine) || !exists(tatooine)) - { - CustomerServiceLog("holidayEvent", "tantor_conversation.getLeaderBoardSui: Could not find Tatooine OID."); - return; - } - - String data = holiday.getEventHighScores(tatooine, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY + holiday.PLANET_VAR_SCORE, true); - if (data == null || data.length() <= 0) - { - CustomerServiceLog("holidayEvent", "tantor_conversation.getLeaderBoardSui: High Score Data Invalid."); - return; - } - - if (!holiday.createEventLeaderBoardUI(player, holiday.LEADER_BOARD_TITLE, data)) - { - CustomerServiceLog("holidayEvent", "tantor_conversation.getLeaderBoardSui: createEventLeaderBoardUI failed."); - return; - } - - CustomerServiceLog("holidayEvent", "tantor_conversation.getLeaderBoardSui: High Score Data received by player: "+player+"."); - } - - - public void imperial_empire_day_major_tantor_action_setRecruitmentCollectionStarterSlot(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, holiday.IMPERIAL_RECRUITING_START_SLOT, 1); - } - - - public void imperial_empire_day_major_tantor_action_setPropagandaCollectionStarterSlot(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, holiday.IMPERIAL_ANTIPROP_START_SLOT, 1); - } - - - public void imperial_empire_day_major_tantor_action_setCombatantRecruitmentEventOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - if (getCollectionSlotValue(player, holiday.IMPERIAL_RECRUITING_START_SLOT) <= 0) - { - imperial_empire_day_major_tantor_action_setRecruitmentCollectionStarterSlot(player, npc); - } - - buff.applyBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT); - } - - - public void imperial_empire_day_major_tantor_action_setCombatantPropagandaEventOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - if (getCollectionSlotValue(player, holiday.IMPERIAL_ANTIPROP_START_SLOT) <= 0) - { - imperial_empire_day_major_tantor_action_setPropagandaCollectionStarterSlot(player, npc); - } - - buff.applyBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT); - } - - - public void imperial_empire_day_major_tantor_action_setPropagandaTimeStampOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - holiday.setEventLockOutTimeStamp(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - } - - - public void imperial_empire_day_major_tantor_action_checkHolidayTimeStampOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - holiday.checkEventLockOutRemoval(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT); - holiday.checkEventLockOutRemoval(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP, holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT); - } - - - public void imperial_empire_day_major_tantor_action_setLeaderBoardScore(obj_id player, obj_id npc) throws InterruptedException - { - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE)) - { - return; - } - - int playerScore = getIntObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE); - if (playerScore <= 0) - { - return; - } - - String playerName = getPlayerFullName(player); - if (playerName == null || playerName.length() <= 0) - { - return; - } - - obj_id tatooine = getPlanetByName("tatooine"); - if (!isIdValid(tatooine) || !exists(tatooine)) - { - CustomerServiceLog("holidayEvent", "tantor_conversation.getLeaderBoardSui: Could not find Tatooine OID."); - return; - } - - if (!holiday.setEmpireDayLeaderScores(tatooine, player, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY + holiday.PLANET_VAR_SCORE, playerScore, playerName, holiday.IMPERIAL_PLAYER)) - { - CustomerServiceLog("holidayEvent", "tantor_conversation.getLeaderBoardSui: Player: ("+player+") "+playerName+ " was unable to attain leader board data. Their score was: "+playerScore); - return; - } - - } - - - public void imperial_empire_day_major_tantor_action_makeNeutralImperial(obj_id player, obj_id npc) throws InterruptedException - { - play2dNonLoopingSound(player, space_quest.MUSIC_QUEST_EVENT); - setObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_IMP, true); - } - - - public void imperial_empire_day_major_tantor_action_removeNeutralRebel(obj_id player, obj_id npc) throws InterruptedException - { - removeObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_REB); - } - - - public String imperial_empire_day_major_tantor_tokenTO_timeLeftRecruitment(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public String imperial_empire_day_major_tantor_tokenTO_timeLeftPropaganda(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public String imperial_empire_day_major_tantor_tokenTO_currentScore(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE)) - { - return "no points so far."; - } - - int playerScore = getIntObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE); - if (playerScore <= 0) - { - return "no points so far."; - } - - return playerScore+" points so far."; - } - - - public int imperial_empire_day_major_tantor_tokenDI_notUsed(obj_id player, obj_id npc) throws InterruptedException - { - return 0; - } - - - public int imperial_empire_day_major_tantor_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_173")) - { - - if (imperial_empire_day_major_tantor_condition_hasCompletedBothCollections (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_212"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_214"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 6); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_isLockedOutOfEvents (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_175"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 10); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (!imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_56"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_176"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition_canDoRecruitmentEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition_canDoPropagandaEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_major_tantor_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_major_tantor_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!imperial_empire_day_major_tantor_condition_hasEmpireDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_250"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_276"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_157"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_301"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_248"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_121")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_122")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_124"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_108")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_110"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (imperial_empire_day_major_tantor_tokenTO_currentScore (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_190")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_192"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_173")) - { - - if (imperial_empire_day_major_tantor_condition_hasCompletedBothCollections (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_212"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_214"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 6); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_isLockedOutOfEvents (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_175"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 10); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (!imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_56"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_176"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition_canDoRecruitmentEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition_canDoPropagandaEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_major_tantor_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_major_tantor_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!imperial_empire_day_major_tantor_condition_hasEmpireDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_250"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_276"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_157"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_301"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_248"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_121")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_122")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_124"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_108")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_110"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (imperial_empire_day_major_tantor_tokenTO_currentScore (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_190")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_192"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_214")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_216"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition_hasCompletedRecruitmentCollection (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_218"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_218")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_220"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_222"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_222")) - { - - if (imperial_empire_day_major_tantor_condition_hasCompletedBothCollections (player, npc)) - { - imperial_empire_day_major_tantor_action_resetPropagandaAndRecruitmentCollections (player, npc); - - string_id message = new string_id (c_stringFile, "s_224"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition_canDoRecruitmentEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition_canDoPropagandaEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_major_tantor_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_major_tantor_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!imperial_empire_day_major_tantor_condition_hasEmpireDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_250"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_276"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_157"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_301"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_250")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_252"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_254"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_276")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_278"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_156")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_162"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 48); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_157")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_160"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 50); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_301")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_302"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_150"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_64")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_91"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_92"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_57")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_59"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_91")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_95"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (imperial_empire_day_major_tantor_tokenTO_timeLeftRecruitment (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_92")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (imperial_empire_day_major_tantor_tokenTO_timeLeftPropaganda (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_60")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_giveMaraKaythreeWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_61"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_250")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_252"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_254"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_276")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_278"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_156")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_162"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 48); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_157")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_160"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 50); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_301")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_302"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_150"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_125")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_giveMaraKaythreeWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_127"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_126")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_giveMaraKaythreeWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_128"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_69")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_103")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_104"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_105"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_105")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_106"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 28); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_107")) - { - doAnimationAction (player, "salute1"); - - imperial_empire_day_major_tantor_action_makeNeutralImperial (player, npc); - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_69")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_76")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "pound_fist_palm"); - - string_id message = new string_id (c_stringFile, "s_80"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition_canDoRecruitmentEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition_canDoPropagandaEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_major_tantor_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_major_tantor_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!imperial_empire_day_major_tantor_condition_hasEmpireDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_250"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_276"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_157"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_301"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 31); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_250")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_252"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_254"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_276")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_278"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_156")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_162"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 48); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_157")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_160"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 50); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_301")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_302"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_150"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_254")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_256"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_258"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_258")) - { - - if (imperial_empire_day_major_tantor_condition_isQualifiedRecruitmentCombatant (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_260"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_262"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_isQualifiedRecruitmentSpecialForces (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_268"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_270"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_262")) - { - - if (imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - imperial_empire_day_major_tantor_action_setCombatantRecruitmentEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_264"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition_canDoRecruitmentEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition_canDoPropagandaEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_major_tantor_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_major_tantor_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!imperial_empire_day_major_tantor_condition_hasEmpireDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_250"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_276"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_157"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_301"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - imperial_empire_day_major_tantor_action_setCombatantRecruitmentEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_266"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_250")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_252"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_254"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_276")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_278"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_156")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_162"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 48); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_157")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_160"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 50); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_301")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_302"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_150"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_270")) - { - - if (imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - imperial_empire_day_major_tantor_action_setSFRecruitmentEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_272"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition_canDoRecruitmentEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition_canDoPropagandaEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_major_tantor_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_major_tantor_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!imperial_empire_day_major_tantor_condition_hasEmpireDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_250"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_276"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_157"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_301"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - imperial_empire_day_major_tantor_action_setSFRecruitmentEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_274"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_250")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_252"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_254"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_276")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_278"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_156")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_162"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 48); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_157")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_160"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 50); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_301")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_302"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_150"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch40(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_280")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_282"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_284"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 41); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch41(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_284")) - { - - if (imperial_empire_day_major_tantor_condition_isQualifiedPropagandaCombatant (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_286"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_288"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_isQualifiedPropagandaSpecialForces (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_294"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_296"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 45); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch42(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_288")) - { - - if (imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - imperial_empire_day_major_tantor_action_setCombatantPropagandaEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_290"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition_canDoRecruitmentEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition_canDoPropagandaEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_major_tantor_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_major_tantor_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!imperial_empire_day_major_tantor_condition_hasEmpireDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_250"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_276"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_157"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_301"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - imperial_empire_day_major_tantor_action_setCombatantPropagandaEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_292"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch43(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_250")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_252"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_254"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_276")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_278"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_156")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_162"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 48); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_157")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_160"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 50); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_301")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_302"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_150"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch45(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_296")) - { - - if (imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - imperial_empire_day_major_tantor_action_setSFPropagandaEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_298"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition_canDoRecruitmentEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition_canDoPropagandaEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_major_tantor_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_major_tantor_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!imperial_empire_day_major_tantor_condition_hasEmpireDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_250"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_276"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_157"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_301"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!imperial_empire_day_major_tantor_condition_canDoAtLeastOneEvent (player, npc)) - { - imperial_empire_day_major_tantor_action_setSFPropagandaEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_300"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch46(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_250")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_252"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_254"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_276")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_278"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_156")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_162"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 48); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_157")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_160"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 50); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_301")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_302"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_150"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch48(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_162")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_giveMaraKaythreeWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_164"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_major_tantor_handleBranch50(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_166")) - { - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - imperial_empire_day_major_tantor_action_giveMaraKaythreeWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_174"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.imperial_empire_day_major_tantor"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.imperial_empire_day_major_tantor"); - - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (imperial_empire_day_major_tantor_condition_isRebelPlayer (player, npc)) - { - doAnimationAction (npc, "backhand_threaten"); - - string_id message = new string_id (c_stringFile, "s_50"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_isNeutralRebelButImperial (player, npc)) - { - imperial_empire_day_major_tantor_action_removeNeutralRebel (player, npc); - - string_id message = new string_id (c_stringFile, "s_112"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_isNeutralRebel (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_111"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_isChampionKnowsTantor (player, npc)) - { - imperial_empire_day_major_tantor_action_checkHolidayTimeStampOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_major_tantor_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_major_tantor_condition_hasScore (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_173"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_121"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_190"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 5); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "imperial_empire_day_major_tantor", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_alreadyKnowsTantor (player, npc)) - { - imperial_empire_day_major_tantor_action_checkHolidayTimeStampOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_major_tantor_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_major_tantor_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_major_tantor_condition_hasScore (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_173"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_121"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_190"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 5); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "imperial_empire_day_major_tantor", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_isChampionDoesntKnowTantor (player, npc)) - { - doAnimationAction (npc, "salute2"); - - doAnimationAction (player, "salute2"); - - string_id message = new string_id (c_stringFile, "s_109"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 29); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "imperial_empire_day_major_tantor", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition_isNewNeutralPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_102"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_103"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 26); - - npcStartConversation (player, npc, "imperial_empire_day_major_tantor", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute2"); - - doAnimationAction (player, "salute2"); - - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_major_tantor_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId", 29); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "imperial_empire_day_major_tantor", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("imperial_empire_day_major_tantor")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - if (branchId == 4 && imperial_empire_day_major_tantor_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && imperial_empire_day_major_tantor_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && imperial_empire_day_major_tantor_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && imperial_empire_day_major_tantor_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && imperial_empire_day_major_tantor_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && imperial_empire_day_major_tantor_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && imperial_empire_day_major_tantor_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && imperial_empire_day_major_tantor_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && imperial_empire_day_major_tantor_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && imperial_empire_day_major_tantor_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && imperial_empire_day_major_tantor_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && imperial_empire_day_major_tantor_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && imperial_empire_day_major_tantor_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && imperial_empire_day_major_tantor_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && imperial_empire_day_major_tantor_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && imperial_empire_day_major_tantor_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && imperial_empire_day_major_tantor_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && imperial_empire_day_major_tantor_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && imperial_empire_day_major_tantor_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && imperial_empire_day_major_tantor_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && imperial_empire_day_major_tantor_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && imperial_empire_day_major_tantor_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && imperial_empire_day_major_tantor_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && imperial_empire_day_major_tantor_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && imperial_empire_day_major_tantor_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 40 && imperial_empire_day_major_tantor_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 41 && imperial_empire_day_major_tantor_handleBranch41 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 42 && imperial_empire_day_major_tantor_handleBranch42 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 43 && imperial_empire_day_major_tantor_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 45 && imperial_empire_day_major_tantor_handleBranch45 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 46 && imperial_empire_day_major_tantor_handleBranch46 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 48 && imperial_empire_day_major_tantor_handleBranch48 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 50 && imperial_empire_day_major_tantor_handleBranch50 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.imperial_empire_day_major_tantor.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_mara_jade.java b/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_mara_jade.java deleted file mode 100644 index 01129b9d1..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_mara_jade.java +++ /dev/null @@ -1,3291 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.buff; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.static_item; -import script.library.utils; - - -public class imperial_empire_day_mara_jade extends script.base_script -{ - public imperial_empire_day_mara_jade() - { - } - String c_stringFile = "conversation/imperial_empire_day_mara_jade"; - - - public boolean imperial_empire_day_mara_jade_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean imperial_empire_day_mara_jade_condition_isBelow60thLevelOrTraderEntertainer(obj_id player, obj_id npc) throws InterruptedException - { - return (imperial_empire_day_mara_jade_condition_isBelow60thLevel(player, npc) || imperial_empire_day_mara_jade_condition_isEntertainer(player, npc) || imperial_empire_day_mara_jade_condition_isTrader(player, npc)); - } - - - public boolean imperial_empire_day_mara_jade_condition_isEntertainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.ENTERTAINER); - } - - - public boolean imperial_empire_day_mara_jade_condition_isTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.TRADER); - } - - - public boolean imperial_empire_day_mara_jade_condition_isBelow60thLevel(obj_id player, obj_id npc) throws InterruptedException - { - return (60 > getLevel(player)); - } - - - public boolean imperial_empire_day_mara_jade_condition_hasNotCompletedMission1(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_01) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_01); - } - - - public boolean imperial_empire_day_mara_jade_condition_hasAnIncompleteCombatMission(obj_id player, obj_id npc) throws InterruptedException - { - return (!imperial_empire_day_mara_jade_condition_completed7thQuest(player, npc) && (imperial_empire_day_mara_jade_condition_hasCompleted1stMissionNot2nd(player, npc) || imperial_empire_day_mara_jade_condition_hasCompleted2ndMissionNot3rd(player, npc) || imperial_empire_day_mara_jade_condition_hasCompleted3rdMissionNot4th(player, npc) || imperial_empire_day_mara_jade_condition_hasCompleted4thMissionNot5th(player, npc) || imperial_empire_day_mara_jade_condition_hasCompleted5thMissionNot6th(player, npc) || imperial_empire_day_mara_jade_condition_hasCompleted6thMissionNot7th(player, npc))); - } - - - public boolean imperial_empire_day_mara_jade_condition_isOnSecondMission(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_02) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_03)); - } - - - public boolean imperial_empire_day_mara_jade_condition_isChampion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlot(player, holiday.REMEMBRANCE_DAY_CHAMPION_BADGE); - } - - - public boolean imperial_empire_day_mara_jade_condition_completed7thQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_07); - } - - - public boolean imperial_empire_day_mara_jade_condition_completed7thQuestNoAutograph(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_empire_day_mara_jade_condition_completed7thQuest(player, npc) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_NUMBER); - } - - - public boolean imperial_empire_day_mara_jade_condition_isRebelPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isRebel(player)); - } - - - public boolean imperial_empire_day_mara_jade_condition_isNeutralPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return(!factions.isImperial(player) && !factions.isRebel(player)); - } - - - public boolean imperial_empire_day_mara_jade_condition_completed7thQuestHasAutograph(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_empire_day_mara_jade_condition_completed7thQuest(player, npc) && groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_NUMBER); - } - - - public boolean imperial_empire_day_mara_jade_condition_hasCompleted7thMission(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_07)); - } - - - public boolean imperial_empire_day_mara_jade_condition_hasCompleted1stMissionNot2nd(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_01) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_02)); - } - - - public boolean imperial_empire_day_mara_jade_condition_hasCompleted2ndMissionNot3rd(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_02) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_03)); - } - - - public boolean imperial_empire_day_mara_jade_condition_hasCompleted3rdMissionNot4th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_03) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_04)); - } - - - public boolean imperial_empire_day_mara_jade_condition_hasCompleted4thMissionNot5th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_04) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_05)); - } - - - public boolean imperial_empire_day_mara_jade_condition_hasCompleted5thMissionNot6th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_05) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_06)); - } - - - public boolean imperial_empire_day_mara_jade_condition_hasCompleted6thMissionNot7th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_06) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_07); - } - - - public void imperial_empire_day_mara_jade_action_grantMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_01); - } - - - public void imperial_empire_day_mara_jade_action_grantMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - if (getCollectionSlotValue(player, holiday.IMPERIAL_RESCUE_START_SLOT) <= 0) - { - modifyCollectionSlotValue(player, holiday.IMPERIAL_RESCUE_START_SLOT, 1); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_02); - } - - - public void imperial_empire_day_mara_jade_action_revokeMission2Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_02)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_02); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_02); - } - - - public void imperial_empire_day_mara_jade_action_revokeMission3Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_03)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_03); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_03); - } - - - public void imperial_empire_day_mara_jade_action_revokeMission4Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_04)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_04); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_04); - } - - - public void imperial_empire_day_mara_jade_action_spawnTroopers(obj_id player, obj_id npc) throws InterruptedException - { - - for (int i = 0; i < 3; i++) - { - testAbortScript(); - location guardLocation = groundquests.getRandom2DLocationAroundLocation(npc, 1, 1, 5, 12); - int mobLevel = getLevel(player); - obj_id guard = create.object("rebel_emperorsday_ceremony_sentry", guardLocation, mobLevel); - attachScript(guard, "event.emp_day.factional_guard_self_destruct"); - startCombat(guard, player); - } - } - - - public void imperial_empire_day_mara_jade_action_revokeMission5Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_05)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_05); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_05); - } - - - public void imperial_empire_day_mara_jade_action_revokeMission6Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_06)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_06); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_06); - } - - - public void imperial_empire_day_mara_jade_action_revokeMission7Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_07)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_07); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_07); - } - - - public void imperial_empire_day_mara_jade_action_grantAutograph(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_NUMBER); - } - - - public void imperial_empire_day_mara_jade_action_giveWaypoint(obj_id player, obj_id npc) throws InterruptedException - { - location loc = new location(4000, 37, -6168, "corellia"); - obj_id wpt = createWaypointInDatapad(player, loc); - setWaypointName(wpt, "Detention Facility"); - setWaypointActive(wpt, true); - } - - - public String imperial_empire_day_mara_jade_tokenTO_timeLeftRecruitment(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public String imperial_empire_day_mara_jade_tokenTO_timeLeftPropaganda(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public int imperial_empire_day_mara_jade_tokenDI_notUsed(obj_id player, obj_id npc) throws InterruptedException - { - return 0; - } - - - public int imperial_empire_day_mara_jade_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_83")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - imperial_empire_day_mara_jade_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_84")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_87"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition_hasCompleted1stMissionNot2nd (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_mara_jade_condition_hasCompleted2ndMissionNot3rd (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_mara_jade_condition_hasCompleted3rdMissionNot4th (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_empire_day_mara_jade_condition_hasCompleted4thMissionNot5th (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_empire_day_mara_jade_condition_hasCompleted5thMissionNot6th (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (imperial_empire_day_mara_jade_condition_hasCompleted6thMissionNot7th (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_89")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_93")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_103"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_104"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_101")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_107"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_112")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_115"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_122")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_129"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_140")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_145"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_149"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_100")) - { - imperial_empire_day_mara_jade_action_revokeMission2Regrant (player, npc); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_191"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_104")) - { - imperial_empire_day_mara_jade_action_revokeMission3Regrant (player, npc); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_106"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_123"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_123")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - imperial_empire_day_mara_jade_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_111")) - { - imperial_empire_day_mara_jade_action_revokeMission4Regrant (player, npc); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_124")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - imperial_empire_day_mara_jade_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_117")) - { - imperial_empire_day_mara_jade_action_revokeMission5Regrant (player, npc); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_119"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_125")) - { - imperial_empire_day_mara_jade_action_revokeMission5Regrant (player, npc); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - imperial_empire_day_mara_jade_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_129")) - { - imperial_empire_day_mara_jade_action_revokeMission6Regrant (player, npc); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_131"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_135")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - imperial_empire_day_mara_jade_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_149")) - { - imperial_empire_day_mara_jade_action_revokeMission7Regrant (player, npc); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_153"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_156")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - imperial_empire_day_mara_jade_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_158")) - { - doAnimationAction (player, "thumb_up"); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_160"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_161"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_161")) - { - doAnimationAction (player, "embarrassed"); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "laugh"); - - string_id message = new string_id (c_stringFile, "s_162"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_163"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_163")) - { - doAnimationAction (player, "shrug_shoulders"); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_164"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_173"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_173")) - { - doAnimationAction (player, "cough_polite"); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "kiss_blow_kiss"); - - imperial_empire_day_mara_jade_action_grantAutograph (player, npc); - - string_id message = new string_id (c_stringFile, "s_174"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_51")) - { - - if (imperial_empire_day_mara_jade_condition_isBelow60thLevel (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_53"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 25); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_mara_jade_condition_isTrader (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 29); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_mara_jade_condition_isEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_80"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 31); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_82"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 32); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_55")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_57"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_59")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_63")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 32); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_88")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_94"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_69")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_71"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_73")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_77")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_71"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_80")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_88")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_94"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_94")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_98"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_98")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_105"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_121"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_137"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_109")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_114"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_121")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "backhand_threaten"); - - string_id message = new string_id (c_stringFile, "s_128"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_132"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_137")) - { - doAnimationAction (player, "shake_head_no"); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_175"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 38); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_118")) - { - doAnimationAction (player, "shrug_shoulders"); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_175"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 38); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_132")) - { - doAnimationAction (player, "shrug_shoulders"); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_175"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 38); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_175")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "kiss"); - - string_id message = new string_id (c_stringFile, "s_176"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_179"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_177")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - doAnimationAction (player, "salute1"); - - imperial_empire_day_mara_jade_action_grantMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_178"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch39(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_179")) - { - doAnimationAction (player, "embarrassed"); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - imperial_empire_day_mara_jade_action_grantMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_180"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch43(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_154")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - string_id message = new string_id (c_stringFile, "s_159"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_167"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 44); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch44(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_167")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "rub_chin_thoughtful"); - - string_id message = new string_id (c_stringFile, "s_169"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_171"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 45); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch45(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_171")) - { - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_181"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_183"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 46); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch46(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_183")) - { - doAnimationAction (player, "salute1"); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_185"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_187"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 47); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_mara_jade_handleBranch47(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_187")) - { - doAnimationAction (player, "salute1"); - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - imperial_empire_day_mara_jade_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_190"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.imperial_empire_day_mara_jade"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.imperial_empire_day_mara_jade"); - - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (imperial_empire_day_mara_jade_condition_isRebelPlayer (player, npc)) - { - doAnimationAction (npc, "weeping"); - - string_id message = new string_id (c_stringFile, "s_133"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_mara_jade_condition_isNeutralPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_134"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_mara_jade_condition_hasAnIncompleteCombatMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 3); - - npcStartConversation (player, npc, "imperial_empire_day_mara_jade", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_mara_jade_condition_completed7thQuestHasAutograph (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_165"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_mara_jade_condition_completed7thQuestNoAutograph (player, npc)) - { - doAnimationAction (npc, "greet"); - - string_id message = new string_id (c_stringFile, "s_157"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_158"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 19); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "imperial_empire_day_mara_jade", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_mara_jade_condition_hasCompleted1stMissionNot2nd (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 24); - - npcStartConversation (player, npc, "imperial_empire_day_mara_jade", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_mara_jade_condition_hasNotCompletedMission1 (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_189"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_151"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_mara_jade_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_154"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId", 43); - - npcStartConversation (player, npc, "imperial_empire_day_mara_jade", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("imperial_empire_day_mara_jade")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - if (branchId == 3 && imperial_empire_day_mara_jade_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && imperial_empire_day_mara_jade_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && imperial_empire_day_mara_jade_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && imperial_empire_day_mara_jade_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && imperial_empire_day_mara_jade_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && imperial_empire_day_mara_jade_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && imperial_empire_day_mara_jade_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && imperial_empire_day_mara_jade_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && imperial_empire_day_mara_jade_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && imperial_empire_day_mara_jade_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && imperial_empire_day_mara_jade_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && imperial_empire_day_mara_jade_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && imperial_empire_day_mara_jade_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && imperial_empire_day_mara_jade_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && imperial_empire_day_mara_jade_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && imperial_empire_day_mara_jade_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && imperial_empire_day_mara_jade_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && imperial_empire_day_mara_jade_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && imperial_empire_day_mara_jade_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && imperial_empire_day_mara_jade_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && imperial_empire_day_mara_jade_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && imperial_empire_day_mara_jade_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && imperial_empire_day_mara_jade_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && imperial_empire_day_mara_jade_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && imperial_empire_day_mara_jade_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && imperial_empire_day_mara_jade_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && imperial_empire_day_mara_jade_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && imperial_empire_day_mara_jade_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && imperial_empire_day_mara_jade_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && imperial_empire_day_mara_jade_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 39 && imperial_empire_day_mara_jade_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 43 && imperial_empire_day_mara_jade_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 44 && imperial_empire_day_mara_jade_handleBranch44 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 45 && imperial_empire_day_mara_jade_handleBranch45 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 46 && imperial_empire_day_mara_jade_handleBranch46 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 47 && imperial_empire_day_mara_jade_handleBranch47 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.imperial_empire_day_mara_jade.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_supply_officer.java b/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_supply_officer.java deleted file mode 100644 index cdb9d2893..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/imperial_empire_day_supply_officer.java +++ /dev/null @@ -1,313 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.holiday; -import script.library.utils; - - -public class imperial_empire_day_supply_officer extends script.base_script -{ - public imperial_empire_day_supply_officer() - { - } - String c_stringFile = "conversation/imperial_empire_day_supply_officer"; - - - public boolean imperial_empire_day_supply_officer_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean imperial_empire_day_supply_officer_condition_hasNotCraftedSupplies(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 0; i < holiday.ALL_IMPERIAL_QUESTS.length; i++) - { - testAbortScript(); - if ((groundquests.isQuestActive(player, holiday.ALL_IMPERIAL_QUESTS[i]) && groundquests.isTaskActive(player, holiday.ALL_IMPERIAL_QUESTS[i], "crafteSupplies"))) - { - return true; - } - } - return false; - } - - - public boolean imperial_empire_day_supply_officer_condition_hasCompletedFirstMission(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_DOMESTICS) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_ENG) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_MUNITIONS) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_IMP_CRASHSITE_01_STRUC); - } - - - public boolean imperial_empire_day_supply_officer_condition_hasImperialMissionActiveWithTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 0; i < holiday.ALL_IMPERIAL_QUESTS.length; i++) - { - testAbortScript(); - if ((groundquests.isQuestActive(player, holiday.ALL_IMPERIAL_QUESTS[i]) && groundquests.isTaskActive(player, holiday.ALL_IMPERIAL_QUESTS[i], holiday.ALL_IMPERIAL_QUESTS[i]))) - { - return true; - } - } - return false; - } - - - public void imperial_empire_day_supply_officer_action_activateDeliverySignal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "spokeToSupplyOfficer"); - } - - - public int imperial_empire_day_supply_officer_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_7")) - { - - if (!imperial_empire_day_supply_officer_condition_hasCompletedFirstMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_9"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_supply_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_11"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_supply_officer.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_empire_day_supply_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_supply_officer_condition_hasCompletedFirstMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_15"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_supply_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_empire_day_supply_officer_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_11")) - { - - if (imperial_empire_day_supply_officer_condition__defaultCondition (player, npc)) - { - imperial_empire_day_supply_officer_action_activateDeliverySignal (player, npc); - - string_id message = new string_id (c_stringFile, "s_13"); - utils.removeScriptVar (player, "conversation.imperial_empire_day_supply_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.imperial_empire_day_supply_officer"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.imperial_empire_day_supply_officer"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (imperial_empire_day_supply_officer_condition_hasNotCraftedSupplies (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_17"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_supply_officer_condition_hasImperialMissionActiveWithTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_5"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_empire_day_supply_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_7"); - } - - utils.setScriptVar (player, "conversation.imperial_empire_day_supply_officer.branchId", 2); - - npcStartConversation (player, npc, "imperial_empire_day_supply_officer", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_empire_day_supply_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("imperial_empire_day_supply_officer")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.imperial_empire_day_supply_officer.branchId"); - - if (branchId == 2 && imperial_empire_day_supply_officer_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && imperial_empire_day_supply_officer_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.imperial_empire_day_supply_officer.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/imperial_general.java b/sku.0/sys.server/compiled/game/script/conversation/imperial_general.java deleted file mode 100644 index 21672ec07..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/imperial_general.java +++ /dev/null @@ -1,2537 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.buff; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.holiday; -import script.library.trial; -import script.library.utils; - - -public class imperial_general extends script.base_script -{ - public imperial_general() - { - } - String c_stringFile = "conversation/imperial_general"; - - - public boolean imperial_general_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean imperial_general_condition_isEntertainerPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.ENTERTAINER); - } - - - public boolean imperial_general_condition_isPlayerImperial(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isImperial(player) || factions.isPlayerSameGcwFactionAsSchedulerObject(player, npc)); - - } - - - public boolean imperial_general_condition_isPlayerRebel(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isRebel(player) || factions.isPlayerSameGcwFactionAsSchedulerObject(player, npc)); - } - - - public boolean imperial_general_condition_isPlayerNeutral(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return(!factions.isImperial(player) && !factions.isRebel(player) && pvpNeutralGetMercenaryFaction(player) == 0); - } - - - public boolean imperial_general_condition_isTraderPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.TRADER); - } - - - public boolean imperial_general_condition_isForceSensitivePlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.FORCE_SENSITIVE); - } - - - public boolean imperial_general_condition_isSmugglerPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.SMUGGLER); - } - - - public boolean imperial_general_condition_isMedicPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.MEDIC); - } - - - public boolean imperial_general_condition_isOfficerPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.OFFICER); - } - - - public boolean imperial_general_condition_isSpyPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.SPY); - } - - - public boolean imperial_general_condition_isBountyHunterPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.BOUNTY_HUNTER); - } - - - public boolean imperial_general_condition_isCommandoPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.COMMANDO); - } - - - public boolean imperial_general_condition_generalIsOffensive(obj_id player, obj_id npc) throws InterruptedException - { - return (hasObjVar(npc, "offense") && getIntObjVar(npc, "offense") == 1); - } - - - public boolean imperial_general_condition_generalIsImperial(obj_id player, obj_id npc) throws InterruptedException - { - return (hasObjVar(npc, "factionFlag") && getIntObjVar(npc, "factionFlag") == factions.FACTION_FLAG_IMPERIAL); - } - - - public boolean imperial_general_condition_generalIsDefensive(obj_id player, obj_id npc) throws InterruptedException - { - return (hasObjVar(npc, "offense") && getIntObjVar(npc, "offense") == 0); - } - - - public boolean imperial_general_condition_generalIsRebel(obj_id player, obj_id npc) throws InterruptedException - { - return (hasObjVar(npc, "factionFlag") && getIntObjVar(npc, "factionFlag") == factions.FACTION_FLAG_REBEL); - } - - - public boolean imperial_general_condition_isGeneralRebAndOffense(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_isPlayerRebel(player, npc) && imperial_general_condition_generalIsRebel(player, npc) && imperial_general_condition_generalIsOffensive(player, npc); - } - - - public boolean imperial_general_condition_isConstructionPhase(obj_id player, obj_id npc) throws InterruptedException - { - return (gcw.getGcwCityInvasionPhase(npc) == gcw.GCW_CITY_PHASE_CONSTRUCTION); - } - - - public boolean imperial_general_condition_isCombatPhase(obj_id player, obj_id npc) throws InterruptedException - { - return (gcw.getGcwCityInvasionPhase(npc) == gcw.GCW_CITY_PHASE_COMBAT); - } - - - public boolean imperial_general_condition_isGeneralRebAndDefense(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_isPlayerRebel(player, npc) && imperial_general_condition_generalIsRebel(player, npc) && imperial_general_condition_generalIsDefensive(player, npc); - } - - - public boolean imperial_general_condition_isGeneralImpAndOffense(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_isPlayerImperial(player, npc) && imperial_general_condition_generalIsImperial(player, npc) && imperial_general_condition_generalIsOffensive(player, npc); - } - - - public boolean imperial_general_condition_isGeneralImpAndDefense(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_isPlayerImperial(player, npc) && imperial_general_condition_generalIsImperial(player, npc) && imperial_general_condition_generalIsDefensive(player, npc); - } - - - public boolean imperial_general_condition_hasImperialQuest(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_isPlayerImperial(player, npc) && (imperial_general_condition_hasSpyScoutPatrolQuest(player, npc) || imperial_general_condition_hasSpyDestroyPatrolQuest(player, npc) || imperial_general_condition_hasSpyDestroyPatrolQuestNeedsExplosives(player, npc) || imperial_general_condition_hasDestroyBarricadeQuest(player, npc) || imperial_general_condition_hasDestroyTurretQuest(player, npc) ); - } - - - public boolean imperial_general_condition_hasSpyScoutPatrolQuest(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_isSpyPlayer(player, npc) && groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST); - } - - - public boolean imperial_general_condition_hasSpyDestroyPatrolQuestNeedsExplosives(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_isSpyPlayer(player, npc) && groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST) && (buff.getBuffStackCount(player, "gcw_spy_destroy_patrol_explosive_stack") < 5); - } - - - public boolean imperial_general_condition_hasSpyDestroyPatrolQuest(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_isSpyPlayer(player, npc) && groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST); - } - - - public boolean imperial_general_condition_hasDestroyTurretQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, gcw.GCW_DESTROY_TURRET); - } - - - public boolean imperial_general_condition_hasDestroyBarricadeQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, gcw.GCW_DESTROY_BARRICADE); - } - - - public boolean imperial_general_condition_hasDestroyQuest(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_hasSpyDestroyPatrolQuest(player, npc) || imperial_general_condition_hasDestroyTurretQuest(player, npc) || imperial_general_condition_hasDestroyBarricadeQuest(player, npc); - } - - - public boolean imperial_general_condition_enemyPatrolPointsExist(obj_id player, obj_id npc) throws InterruptedException - { - obj_id parent = trial.getParent(npc); - if (!isValidId(parent) || !exists(parent)) - { - return false; - } - - if (imperial_general_condition_generalIsDefensive(player, npc)) - { - obj_id[] patrols = trial.getObjectsInInstanceBySpawnId(parent, "offense_quest_asset"); - if (patrols == null || patrols.length <= 0) - { - return false; - } - - return patrols.length > 0; - } - else if (imperial_general_condition_generalIsOffensive(player, npc)) - { - obj_id[] patrols = trial.getObjectsInInstanceBySpawnId(parent, "defense_quest_asset"); - if (patrols == null || patrols.length <= 0) - { - return false; - } - - return patrols.length > 0; - } - - return false; - } - - - public boolean imperial_general_condition_enemyPatrolsExistAndIsCombatPhase(obj_id player, obj_id npc) throws InterruptedException - { - return (imperial_general_condition_enemyPatrolPointsExist(player, npc) && imperial_general_condition_isCombatPhase(player, npc)); - } - - - public boolean imperial_general_condition_enemyPatrolPointsDestroyed(obj_id player, obj_id npc) throws InterruptedException - { - return (imperial_general_condition_isCombatPhase(player, npc) && !imperial_general_condition_enemyPatrolPointsExist(player, npc)); - } - - - public boolean imperial_general_condition_canBeMerc(obj_id player, obj_id npc) throws InterruptedException - { - return factions.canChangeNeutralMercenaryStatus(player); - } - - - public boolean imperial_general_condition_patrolPointsExistNoScoutQuest(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_enemyPatrolPointsExist(player, npc) && !groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST); - } - - - public boolean imperial_general_condition_patrolPointsExistNoDestroyQuest(obj_id player, obj_id npc) throws InterruptedException - { - return imperial_general_condition_enemyPatrolPointsExist(player, npc) && !groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST); - } - - - public void imperial_general_action_spawnGuards(obj_id player, obj_id npc) throws InterruptedException - { - - for (int i = 0; i < 3; i++) - { - testAbortScript(); - location guardLocation = groundquests.getRandom2DLocationAroundLocation(npc, 1, 1, 5, 12); - int mobLevel = getLevel(player); - obj_id guard = create.object("rebel_emperorsday_ceremony_sentry", guardLocation, mobLevel); - attachScript(guard, "event.emp_day.factional_guard_self_destruct"); - startCombat(guard, player); - } - } - - - public void imperial_general_action_grantSpyScoutPatrol(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST)) - { - groundquests.clearQuest(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST); - } - - groundquests.grantQuest(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST); - } - - - public void imperial_general_action_grantSpyDestroyPatrol(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST)) - { - groundquests.clearQuest(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST); - } - - buff.applyBuffWithStackCount(player, gcw.BUFF_SPY_EXPLOSIVES, 5); - groundquests.grantQuest(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST); - } - - - public void imperial_general_action_grantMoreSpyDestroyPatrolExplosives(obj_id player, obj_id npc) throws InterruptedException - { - buff.applyBuffWithStackCount(player, gcw.BUFF_SPY_EXPLOSIVES, 5); - } - - - public void imperial_general_action_grantCombatDestroyBarricade(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_DESTROY_BARRICADE)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_DESTROY_BARRICADE)) - { - groundquests.clearQuest(player, gcw.GCW_DESTROY_BARRICADE); - } - - groundquests.grantQuest(player, gcw.GCW_DESTROY_BARRICADE); - } - - - public void imperial_general_action_grantCombatDestroyTurret(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_DESTROY_TURRET)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_DESTROY_TURRET)) - { - groundquests.clearQuest(player, gcw.GCW_DESTROY_TURRET); - } - - groundquests.grantQuest(player, gcw.GCW_DESTROY_TURRET); - } - - - public void imperial_general_action_grantEntertainRallyQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_ENTERTAIN_RALLY)) - { - groundquests.clearQuest(player, gcw.GCW_ENTERTAIN_RALLY); - } - - groundquests.grantQuest(player, gcw.GCW_ENTERTAIN_RALLY); - } - - - public void imperial_general_action_grantEntertainFatigueQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_FATIGUE)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_ENTERTAIN_FATIGUE)) - { - groundquests.clearQuest(player, gcw.GCW_ENTERTAIN_FATIGUE); - } - - groundquests.grantQuest(player, gcw.GCW_ENTERTAIN_FATIGUE); - } - - - public void imperial_general_action_grantEntertainerQuests(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_FATIGUE)) - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_ENTERTAIN_FATIGUE)) - { - groundquests.clearQuest(player, gcw.GCW_ENTERTAIN_FATIGUE); - } - - groundquests.grantQuest(player, gcw.GCW_ENTERTAIN_FATIGUE); - } - - if (!groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY)) - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_ENTERTAIN_RALLY)) - { - groundquests.clearQuest(player, gcw.GCW_ENTERTAIN_RALLY); - } - - groundquests.grantQuest(player, gcw.GCW_ENTERTAIN_RALLY); - } - } - - - public void imperial_general_action_grantCombatQuests(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActive(player, gcw.GCW_DESTROY_BARRICADE)) - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_DESTROY_BARRICADE)) - { - groundquests.clearQuest(player, gcw.GCW_DESTROY_BARRICADE); - } - - groundquests.grantQuest(player, gcw.GCW_DESTROY_BARRICADE); - } - - if (!groundquests.isQuestActive(player, gcw.GCW_DESTROY_TURRET)) - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_DESTROY_TURRET)) - { - groundquests.clearQuest(player, gcw.GCW_DESTROY_TURRET); - } - - groundquests.grantQuest(player, gcw.GCW_DESTROY_TURRET); - } - - if (!groundquests.isQuestActive(player, gcw.GCW_ELIMINATE_REBELS)) - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_ELIMINATE_REBELS)) - { - groundquests.clearQuest(player, gcw.GCW_ELIMINATE_REBELS); - } - - groundquests.grantQuest(player, gcw.GCW_ELIMINATE_REBELS); - } - } - - - public void imperial_general_action_makeImpMercCombatant(obj_id player, obj_id npc) throws InterruptedException - { - factions.setNeturalMercenaryCovert(player, factions.FACTION_FLAG_IMPERIAL); - } - - - public void imperial_general_action_makeImpMercSF(obj_id player, obj_id npc) throws InterruptedException - { - factions.setNeturalMercenaryOvert(player, factions.FACTION_FLAG_IMPERIAL); - } - - - public int imperial_general_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_28")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_30"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_111")) - { - - if (imperial_general_condition_canBeMerc (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_112"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_125"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_113")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_115"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_116"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_116")) - { - - if (imperial_general_condition_canBeMerc (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_118"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_120"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_119")) - { - - if (imperial_general_condition_canBeMerc (player, npc)) - { - imperial_general_action_makeImpMercSF (player, npc); - - string_id message = new string_id (c_stringFile, "s_123"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_131"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_120")) - { - - if (imperial_general_condition_canBeMerc (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - imperial_general_action_makeImpMercCombatant (player, npc); - - string_id message = new string_id (c_stringFile, "s_122"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_132"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_23")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - imperial_general_action_grantEntertainerQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_26"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - imperial_general_action_grantEntertainFatigueQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_185"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_34")) - { - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_183"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_39")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - imperial_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_172"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_213"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_51")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - imperial_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_187"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_215"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_61")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - imperial_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_190"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_217"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_71")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - imperial_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_193"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_219"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_81")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_196"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition_patrolPointsExistNoScoutQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_general_condition_patrolPointsExistNoDestroyQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_197"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_198"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_199"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_221"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_102")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - imperial_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_201"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_223"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_114")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - imperial_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_204"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_225"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_312")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - imperial_general_action_grantMoreSpyDestroyPatrolExplosives (player, npc); - - string_id message = new string_id (c_stringFile, "s_314"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_316")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_318"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_320")) - { - - if (imperial_general_condition_hasSpyDestroyPatrolQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_322"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_hasDestroyBarricadeQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_324"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_hasDestroyTurretQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_326"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_197")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - imperial_general_action_grantSpyScoutPatrol (player, npc); - - string_id message = new string_id (c_stringFile, "s_244"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_198")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - imperial_general_action_grantSpyDestroyPatrol (player, npc); - - string_id message = new string_id (c_stringFile, "s_232"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_199")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - imperial_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_228"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch39(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_126")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_277"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_305"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_207"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_295"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 44); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_148"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_181"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_151")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_153"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_209"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_156")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_211"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_161")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_163"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_227"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_166")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_168"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_229"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_276")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_286"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_288"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_233")) - { - - if (imperial_general_condition_enemyPatrolsExistAndIsCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_241"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition_patrolPointsExistNoScoutQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_general_condition_patrolPointsExistNoDestroyQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_245"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_261"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_143"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 58); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_292"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_enemyPatrolPointsDestroyed (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_302"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_299")) - { - - if (imperial_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_301"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_308"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch40(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_277")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_278"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_279"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 41); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_305")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - imperial_general_action_grantEntertainFatigueQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_306"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch41(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_279")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - imperial_general_action_grantEntertainRallyQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_280"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch44(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_295")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - imperial_general_action_grantEntertainFatigueQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_296"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch58(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_245")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_249"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_253"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 59); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_261")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_265"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_269"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_287"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 61); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_143")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_144"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch59(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_253")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - imperial_general_action_grantSpyScoutPatrol (player, npc); - - string_id message = new string_id (c_stringFile, "s_257"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch61(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_269")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_273"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_275"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 62); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_287")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - imperial_general_action_grantSpyDestroyPatrol (player, npc); - - string_id message = new string_id (c_stringFile, "s_290"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int imperial_general_handleBranch62(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_275")) - { - - if (imperial_general_condition__defaultCondition (player, npc)) - { - imperial_general_action_grantSpyDestroyPatrol (player, npc); - - string_id message = new string_id (c_stringFile, "s_290"); - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.imperial_general"); - } - - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - dictionary params = new dictionary(); - location loc = getLocation(self); - params.put("particleLoc", loc); - int playIconTime = getGameTime(); - params.put("iconMessageTime", playIconTime); - utils.setScriptVar(self, "iconMessageTime", playIconTime); - messageTo(self, "playQuestIcon", params, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.imperial_general"); - - return SCRIPT_CONTINUE; - } - - - public int playQuestIcon(obj_id self, dictionary params) throws InterruptedException - { - gcw.playQuestIconHandler(self, params); - if (!utils.hasScriptVar(self, "faction")) - { - if (!hasObjVar(self, "factionFlag")) - { - return SCRIPT_CONTINUE; - } - - int faction = getIntObjVar(self, "factionFlag"); - utils.setScriptVar(self, "faction", faction); - } - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (imperial_general_condition_isPlayerNeutral (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 1); - - npcStartConversation (player, npc, "imperial_general", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isGeneralImpAndOffense (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition_isEntertainerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_general_condition_isTraderPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_general_condition_isCommandoPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_general_condition_isForceSensitivePlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_general_condition_isSmugglerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (imperial_general_condition_isBountyHunterPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - boolean hasResponse6 = false; - if (imperial_general_condition_isSpyPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse6 = true; - } - - boolean hasResponse7 = false; - if (imperial_general_condition_isMedicPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse7 = true; - } - - boolean hasResponse8 = false; - if (imperial_general_condition_isOfficerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse8 = true; - } - - boolean hasResponse9 = false; - if (imperial_general_condition_hasSpyDestroyPatrolQuestNeedsExplosives (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse9 = true; - } - - boolean hasResponse10 = false; - if (imperial_general_condition_hasSpyScoutPatrolQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse10 = true; - } - - boolean hasResponse11 = false; - if (imperial_general_condition_hasDestroyQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse11 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_23"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_61"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse6) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_81"); - } - - if (hasResponse7) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_102"); - } - - if (hasResponse8) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse9) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_312"); - } - - if (hasResponse10) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_316"); - } - - if (hasResponse11) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_320"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 12); - - npcStartConversation (player, npc, "imperial_general", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition_isGeneralImpAndDefense (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_124"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (imperial_general_condition_isEntertainerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (imperial_general_condition_isTraderPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (imperial_general_condition_isCommandoPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (imperial_general_condition_isForceSensitivePlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (imperial_general_condition_isSmugglerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (imperial_general_condition_isBountyHunterPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - boolean hasResponse6 = false; - if (imperial_general_condition_isMedicPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse6 = true; - } - - boolean hasResponse7 = false; - if (imperial_general_condition_isSpyPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse7 = true; - } - - boolean hasResponse8 = false; - if (imperial_general_condition_isOfficerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse8 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_151"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_161"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - if (hasResponse6) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_276"); - } - - if (hasResponse7) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_233"); - } - - if (hasResponse8) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_299"); - } - - utils.setScriptVar (player, "conversation.imperial_general.branchId", 39); - - npcStartConversation (player, npc, "imperial_general", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (imperial_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_310"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("imperial_general")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.imperial_general.branchId"); - - if (branchId == 1 && imperial_general_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && imperial_general_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && imperial_general_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && imperial_general_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && imperial_general_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && imperial_general_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && imperial_general_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 39 && imperial_general_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 40 && imperial_general_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 41 && imperial_general_handleBranch41 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 44 && imperial_general_handleBranch44 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 58 && imperial_general_handleBranch58 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 59 && imperial_general_handleBranch59 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 61 && imperial_general_handleBranch61 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 62 && imperial_general_handleBranch62 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.imperial_general.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/injured_agent.java b/sku.0/sys.server/compiled/game/script/conversation/injured_agent.java deleted file mode 100644 index 1670ff342..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/injured_agent.java +++ /dev/null @@ -1,212 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class injured_agent extends script.base_script -{ - public injured_agent() - { - } - String c_stringFile = "conversation/injured_agent"; - - - public boolean injured_agent_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean injured_agent_condition_hasDelivery(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_save_agent", "findAgent") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_save_agent") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_safe")); - } - - - public void injured_agent_action_clearDelivery(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedAgentTask"); - } - - - public void injured_agent_action_giveReturnQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_safe"); - } - - - public int injured_agent_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_6")) - { - - if (injured_agent_condition__defaultCondition (player, npc)) - { - injured_agent_action_giveReturnQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_8"); - utils.removeScriptVar (player, "conversation.injured_agent.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.injured_agent"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.injured_agent"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (injured_agent_condition_hasDelivery (player, npc)) - { - injured_agent_action_clearDelivery (player, npc); - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (injured_agent_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_6"); - } - - utils.setScriptVar (player, "conversation.injured_agent.branchId", 1); - - npcStartConversation (player, npc, "injured_agent", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (injured_agent_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("injured_agent")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.injured_agent.branchId"); - - if (branchId == 1 && injured_agent_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.injured_agent.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/inquisitor_admin.java b/sku.0/sys.server/compiled/game/script/conversation/inquisitor_admin.java deleted file mode 100644 index f74d8635f..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/inquisitor_admin.java +++ /dev/null @@ -1,1108 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class inquisitor_admin extends script.base_script -{ - public inquisitor_admin() - { - } - String c_stringFile = "conversation/inquisitor_admin"; - - - public boolean inquisitor_admin_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean inquisitor_admin_condition_isNeutQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral"); - } - - - public boolean inquisitor_admin_condition_isRebQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel"); - } - - - public boolean inquisitor_admin_condition_hasQuestForInq(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial") || groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral") || groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel")); - } - - - public boolean inquisitor_admin_condition_hasPreviousQuests(obj_id player, obj_id npc) throws InterruptedException - { - return (inquisitor_admin_condition_isImpQuest(player, npc) || inquisitor_admin_condition_isRebQuest(player, npc) || inquisitor_admin_condition_isNeutQuest(player, npc) && inquisitor_admin_condition_hasARandomInquisitorQuest(player, npc)); - } - - - public boolean inquisitor_admin_condition_isPlayerGodMode(obj_id player, obj_id npc) throws InterruptedException - { - return isGod(player); - } - - - public boolean inquisitor_admin_condition_hasARandomInquisitorQuest(obj_id player, obj_id npc) throws InterruptedException - { - String faction = ""; - if (inquisitor_admin_condition_isImpQuest(player,npc)) - { - faction = "imperial"; - } - else if (inquisitor_admin_condition_isRebQuest(player,npc)) - { - faction = "rebel"; - } - else - { - faction = "neutral"; - } - - if (faction == null || faction.length() <= 0) - { - return false; - } - - boolean hasAValidQuest = false; - for (int i = 1; i <= 5; i++) - { - testAbortScript(); - if (!groundquests.isQuestActive(player, "outbreak_quest_administrative_building_" + faction + "_0" + i)) - { - continue; - } - - hasAValidQuest = true; - break; - } - - return hasAValidQuest; - } - - - public boolean inquisitor_admin_condition_hasKey(obj_id player, obj_id npc) throws InterruptedException - { - String faction = ""; - if (inquisitor_admin_condition_isImpQuest(player,npc)) - { - faction = "imperial"; - } - else if (inquisitor_admin_condition_isRebQuest(player,npc)) - { - faction = "rebel"; - } - else - { - faction = "neutral"; - } - - if (faction == null || faction.length() <= 0) - { - return false; - } - - boolean hasAValidTask = false; - for (int i = 1; i <= 5; i++) - { - testAbortScript(); - if (!groundquests.isTaskActive(player, "outbreak_quest_administrative_building_" + faction + "_0" + i, "returnInquisitor")) - { - continue; - } - - hasAValidTask = true; - break; - } - - return hasAValidTask; - } - - - public boolean inquisitor_admin_condition_isNeutralOrRebelQuest(obj_id player, obj_id npc) throws InterruptedException - { - return inquisitor_admin_condition_isRebQuest(player, npc) || inquisitor_admin_condition_isNeutQuest(player, npc); - } - - - public boolean inquisitor_admin_condition_hasCompletedKeyDeletedDungeon(obj_id player, obj_id npc) throws InterruptedException - { - String faction = ""; - if (inquisitor_admin_condition_isImpQuest(player,npc)) - { - faction = "imperial"; - } - else if (inquisitor_admin_condition_isRebQuest(player,npc)) - { - faction = "rebel"; - } - else - { - faction = "neutral"; - } - - if (faction == null || faction.length() <= 0) - { - return false; - } - - String theKeyQuest = ""; - for (int i = 1; i <= 5; i++) - { - testAbortScript(); - if (!groundquests.hasCompletedQuest(player, "outbreak_quest_administrative_building_" + faction + "_0" + i)) - { - continue; - } - - theKeyQuest = "outbreak_quest_administrative_building_"+ faction + "_0"+ i; - break; - } - - if (theKeyQuest == null || theKeyQuest.length() <= 0) - { - return false; - } - - return groundquests.hasCompletedQuest(player, theKeyQuest); - - } - - - public boolean inquisitor_admin_condition_isImpQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial"); - } - - - public boolean inquisitor_admin_condition_hasFindKeyTaskActive(obj_id player, obj_id npc) throws InterruptedException - { - String faction = ""; - if (inquisitor_admin_condition_isImpQuest(player,npc)) - { - faction = "imperial"; - } - else if (inquisitor_admin_condition_isRebQuest(player,npc)) - { - faction = "rebel"; - } - else - { - faction = "neutral"; - } - - if (faction == null || faction.length() <= 0) - { - return false; - } - - boolean hasAValidQuest = false; - for (int i = 1; i <= 5; i++) - { - testAbortScript(); - if (!groundquests.isTaskActive(player, "outbreak_quest_administrative_building_" + faction + "_0" + i, "findKey")) - { - continue; - } - - hasAValidQuest = true; - break; - } - - return hasAValidQuest; - } - - - public boolean inquisitor_admin_condition_hasRadio(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findEpsilonContact"); - } - - - public void inquisitor_admin_action_sendSignalGoAdminBuilding(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "hasSpokenInquisitor"); - } - - - public void inquisitor_admin_action_grantDungeonQuest(obj_id player, obj_id npc) throws InterruptedException - { - - groundquests.grantQuest(player, "outbreak_quest_facility_01"); - } - - - public void inquisitor_admin_action_sendSignalReturnedInquisitor(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasReturnedInquisitor"); - inquisitor_admin_action_grantDungeonQuest(player, npc); - } - - - public int inquisitor_admin_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_40"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_40")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_41"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_43"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_52")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_54"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_56"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_56")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_59")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - inquisitor_admin_action_sendSignalReturnedInquisitor (player, npc); - - string_id message = new string_id (c_stringFile, "s_61"); - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_20")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - doAnimationAction (player, "handshake_tandem"); - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_28")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shakefist"); - - string_id message = new string_id (c_stringFile, "s_30"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_32")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_47"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int inquisitor_admin_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_47")) - { - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - inquisitor_admin_action_sendSignalGoAdminBuilding (player, npc); - - string_id message = new string_id (c_stringFile, "s_49"); - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.inquisitor_admin"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.inquisitor_admin"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (inquisitor_admin_condition_hasCompletedKeyDeletedDungeon (player, npc)) - { - inquisitor_admin_action_grantDungeonQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_62"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (inquisitor_admin_condition_hasKey (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 2); - - npcStartConversation (player, npc, "inquisitor_admin", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (inquisitor_admin_condition_hasFindKeyTaskActive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (inquisitor_admin_condition_hasPreviousQuests (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (inquisitor_admin_condition_hasQuestForInq (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - utils.setScriptVar (player, "conversation.inquisitor_admin.branchId", 10); - - npcStartConversation (player, npc, "inquisitor_admin", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (inquisitor_admin_condition_hasRadio (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_53"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (inquisitor_admin_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shoo"); - - string_id message = new string_id (c_stringFile, "s_65"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("inquisitor_admin")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.inquisitor_admin.branchId"); - - if (branchId == 2 && inquisitor_admin_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && inquisitor_admin_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && inquisitor_admin_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && inquisitor_admin_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && inquisitor_admin_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && inquisitor_admin_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && inquisitor_admin_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && inquisitor_admin_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && inquisitor_admin_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && inquisitor_admin_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && inquisitor_admin_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && inquisitor_admin_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.inquisitor_admin.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/jedi_robe_jinsu_taker.java b/sku.0/sys.server/compiled/game/script/conversation/jedi_robe_jinsu_taker.java deleted file mode 100644 index cede7abfc..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/jedi_robe_jinsu_taker.java +++ /dev/null @@ -1,1118 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.static_item; -import script.library.utils; - - -public class jedi_robe_jinsu_taker extends script.base_script -{ - public jedi_robe_jinsu_taker() - { - } - String c_stringFile = "conversation/jedi_robe_jinsu_taker"; - - - public boolean jedi_robe_jinsu_taker_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean jedi_robe_jinsu_taker_condition_readyToHandOverJinsu(obj_id player, obj_id npc) throws InterruptedException - { - if (hasCompletedCollectionSlotPrereq(player, "col_lightsaber_1h_01_02")) - { - if (!hasCompletedCollectionSlot(player, "col_lightsaber_1h_01_02")) - { - String jinsuTemplate = "object/weapon/melee/sword/crafted_saber/sword_lightsaber_mandalorian.iff"; - if (utils.playerHasItemByTemplateInInventoryOrEquipped(player, jinsuTemplate)) - { - return true; - } - } - } - - return false; - } - - - public boolean jedi_robe_jinsu_taker_condition_alreadyGaveJinsu(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollectionSlot(player, "col_lightsaber_1h_01_02"); - } - - - public boolean jedi_robe_jinsu_taker_condition_takeJinsu(obj_id player, obj_id npc) throws InterruptedException - { - obj_id jinsuSaber = obj_id.NULL_ID; - String desiredTemplate = "object/weapon/melee/sword/crafted_saber/sword_lightsaber_mandalorian.iff"; - - obj_id[] contents = getInventoryAndEquipment(player); - if (contents != null) - { - for (int i = 0; i 0) - { - for (int i = 0; i < jinsuCrystals.length; i++) - { - testAbortScript(); - obj_id crystal = jinsuCrystals[i]; - if (isIdValid(crystal)) - { - putInOverloaded(crystal, playerInv); - } - } - } - } - - destroyObject(jinsuSaber); - modifyCollectionSlotValue(player, "col_lightsaber_1h_01_02", 1); - return true; - } - - return false; - } - - - public boolean jedi_robe_jinsu_taker_condition_canReceive5GenPvP(obj_id player, obj_id npc) throws InterruptedException - { - obj_id pvpSaberSchematic1Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_01"); - if (isIdValid(pvpSaberSchematic1Hand) && hasCompletedCollection(player, "col_lightsaber_1h_01")) - { - return true; - } - - obj_id pvpSaberSchematic2Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_02"); - if (isIdValid(pvpSaberSchematic2Hand) && hasCompletedCollection(player, "col_lightsaber_2h_01")) - { - return true; - } - - obj_id pvpSaberSchematicStaff = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_03"); - if (isIdValid(pvpSaberSchematicStaff) && hasCompletedCollection(player, "col_lightsaber_polearm_01")) - { - return true; - } - - return false; - } - - - public boolean jedi_robe_jinsu_taker_condition_canTrade1Hand(obj_id player, obj_id npc) throws InterruptedException - { - return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_01")); - } - - - public boolean jedi_robe_jinsu_taker_condition_canTrade2Hand(obj_id player, obj_id npc) throws InterruptedException - { - return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_02")); - } - - - public boolean jedi_robe_jinsu_taker_condition_canTradeStaff(obj_id player, obj_id npc) throws InterruptedException - { - return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_03")); - } - - - public boolean jedi_robe_jinsu_taker_condition_canReceive5thGenSaber(obj_id player, obj_id npc) throws InterruptedException - { - return jedi_robe_jinsu_taker_condition_canReceive5GenPvP(player, npc) || jedi_robe_jinsu_taker_condition_canReceive5GenGCW(player, npc); - } - - - public boolean jedi_robe_jinsu_taker_condition_canReceive5GenGCW(obj_id player, obj_id npc) throws InterruptedException - { - obj_id gcwSaberSchematic1Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_1h_gen4"); - if (isIdValid(gcwSaberSchematic1Hand) && hasCompletedCollection(player, "col_lightsaber_1h_01")) - { - return true; - } - - obj_id gcwSaberSchematic2Hand = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_2h_gen4"); - if (isIdValid(gcwSaberSchematic2Hand) && hasCompletedCollection(player, "col_lightsaber_2h_01")) - { - return true; - } - return false; - } - - - public boolean jedi_robe_jinsu_taker_condition_canTradeGcw1Hand(obj_id player, obj_id npc) throws InterruptedException - { - return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_1h_gen4")); - } - - - public boolean jedi_robe_jinsu_taker_condition_canTradeGcw2Hand(obj_id player, obj_id npc) throws InterruptedException - { - return isIdValid(utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_2h_gen4")); - } - - - public void jedi_robe_jinsu_taker_action_upgrade1HandPvP(obj_id player, obj_id npc) throws InterruptedException - { - obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_01"); - obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_04", player); - - if ((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) - { - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "("+ player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "("+ oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); - destroyObject(oldSchematic); - } - else - { - sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "("+ player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "("+ oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = "+ (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = "+ isIdValid(newSchematic)); - } - } - - - public void jedi_robe_jinsu_taker_action_upgrade2HandPvP(obj_id player, obj_id npc) throws InterruptedException - { - obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_02"); - obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_05", player); - - if ((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) - { - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "("+ player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "("+ oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); - destroyObject(oldSchematic); - } - else - { - sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "("+ player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "("+ oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = "+ (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = "+ isIdValid(newSchematic)); - } - } - - - public void jedi_robe_jinsu_taker_action_upgradeStaffPvP(obj_id player, obj_id npc) throws InterruptedException - { - obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_bf_saber_03_03"); - obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_06", player); - - if ((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) - { - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "("+ player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "("+ oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); - destroyObject(oldSchematic); - } - else - { - sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "("+ player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "("+ oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = "+ (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = "+ isIdValid(newSchematic)); - } - } - - - public void jedi_robe_jinsu_taker_action_upgradeGcw1Handed(obj_id player, obj_id npc) throws InterruptedException - { - obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_1h_gen4"); - obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_gcw_saber_1h_gen5", player); - - if ((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) - { - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "("+ player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "("+ oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); - destroyObject(oldSchematic); - } - else - { - sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "("+ player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "("+ oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = "+ (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = "+ isIdValid(newSchematic)); - } - } - - - public void jedi_robe_jinsu_taker_action_upgradeGcw2Handed(obj_id player, obj_id npc) throws InterruptedException - { - obj_id oldSchematic = utils.getStaticItemInInventory(player, "item_schematic_pvp_gcw_saber_2h_gen4"); - obj_id newSchematic = static_item.createNewItemFunction("item_schematic_pvp_gcw_saber_2h_gen5", player); - - if ((isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) && isIdValid(newSchematic)) - { - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "("+ player + ") has upgraded their saber schematic "+ getStaticItemName(oldSchematic)+ "("+ oldSchematic + ") to a 5th Gen version "+ getStaticItemName(newSchematic) +"("+newSchematic+"). This will destroy the old one."); - destroyObject(oldSchematic); - } - else - { - sendSystemMessage(player, new string_id("spam", "couldnt_upgrade_saber_schematic")); - CustomerServiceLog("jediSaberTrade", getFirstName(player) + "("+ player + ") could NOT upgrade their schematic "+ getStaticItemName(oldSchematic)+ "("+ oldSchematic + ") to a 5th Gen version. One of these statements returned false: (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player) = "+ (isIdValid(oldSchematic) && utils.getContainingPlayer(oldSchematic) == player)+ "or isIdValid(newSchematic) = "+ isIdValid(newSchematic)); - } - } - - - public int jedi_robe_jinsu_taker_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_29")) - { - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition_canTrade1Hand (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (jedi_robe_jinsu_taker_condition_canTrade2Hand (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (jedi_robe_jinsu_taker_condition_canTradeStaff (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (jedi_robe_jinsu_taker_condition_canTradeGcw1Hand (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (jedi_robe_jinsu_taker_condition_canTradeGcw2Hand (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_45"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_56"); - } - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_33")) - { - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_51"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jedi_robe_jinsu_taker_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (jedi_robe_jinsu_taker_condition_canTrade1Hand (player, npc)) - { - jedi_robe_jinsu_taker_action_upgrade1HandPvP (player, npc); - - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_53"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_45")) - { - - if (jedi_robe_jinsu_taker_condition_canTrade2Hand (player, npc)) - { - jedi_robe_jinsu_taker_action_upgrade2HandPvP (player, npc); - - string_id message = new string_id (c_stringFile, "s_48"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_46")) - { - - if (jedi_robe_jinsu_taker_condition_canTradeStaff (player, npc)) - { - jedi_robe_jinsu_taker_action_upgradeStaffPvP (player, npc); - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_55"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_63")) - { - - if (jedi_robe_jinsu_taker_condition_canTradeGcw1Hand (player, npc)) - { - jedi_robe_jinsu_taker_action_upgradeGcw1Handed (player, npc); - - string_id message = new string_id (c_stringFile, "s_65"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_67"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_64")) - { - - if (jedi_robe_jinsu_taker_condition_canTradeGcw2Hand (player, npc)) - { - jedi_robe_jinsu_taker_action_upgradeGcw2Handed (player, npc); - - string_id message = new string_id (c_stringFile, "s_66"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_68"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_56")) - { - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_57"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jedi_robe_jinsu_taker_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jedi_robe_jinsu_taker_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jedi_robe_jinsu_taker_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jedi_robe_jinsu_taker_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_43"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_70")) - { - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "applause_polite"); - - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jedi_robe_jinsu_taker_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_43")) - { - - if (jedi_robe_jinsu_taker_condition_takeJinsu (player, npc)) - { - doAnimationAction (npc, "bow"); - - string_id message = new string_id (c_stringFile, "s_49"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shoo"); - - string_id message = new string_id (c_stringFile, "s_58"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_60")) - { - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_disgust"); - - string_id message = new string_id (c_stringFile, "s_62"); - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.jedi_robe_jinsu_taker"); - } - - setCondition (self, CONDITION_CONVERSABLE); - ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - faceTo( self, player ); - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.jedi_robe_jinsu_taker"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (jedi_robe_jinsu_taker_condition_canReceive5thGenSaber (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_29"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_33"); - } - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 1); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "jedi_robe_jinsu_taker", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (jedi_robe_jinsu_taker_condition_alreadyGaveJinsu (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_30"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (jedi_robe_jinsu_taker_condition_readyToHandOverJinsu (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_70"); - } - - utils.setScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId", 17); - - npcStartConversation (player, npc, "jedi_robe_jinsu_taker", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (jedi_robe_jinsu_taker_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("jedi_robe_jinsu_taker")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - if (branchId == 1 && jedi_robe_jinsu_taker_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && jedi_robe_jinsu_taker_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && jedi_robe_jinsu_taker_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && jedi_robe_jinsu_taker_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && jedi_robe_jinsu_taker_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && jedi_robe_jinsu_taker_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && jedi_robe_jinsu_taker_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.jedi_robe_jinsu_taker.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/jinkins.java b/sku.0/sys.server/compiled/game/script/conversation/jinkins.java deleted file mode 100644 index 245393c8c..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/jinkins.java +++ /dev/null @@ -1,1352 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class jinkins extends script.base_script -{ - public jinkins() - { - } - String c_stringFile = "conversation/jinkins"; - - - public boolean jinkins_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean jinkins_condition_hasCompletedPirate(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_vana_to_jinkins") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_interview_moore"); - } - - - public boolean jinkins_condition_hasReturnedFromMoore(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_interview_moore", "tellJinkinsMoore") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_interview_moore") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine")); - } - - - public boolean jinkins_condition_hasMineQuestIncomplete(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "u16_nym_themepark_mine"); - } - - - public boolean jinkins_condition_hasMineFilter(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_mine", "returnMineComplete"); - } - - - public boolean jinkins_condition_isDoneMineQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine"); - } - - - public boolean jinkins_condition_allQuestsComplete(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_jinkins_kole"); - } - - - public boolean jinkins_condition_hasCompletedThemePark(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_shuttle_ambush"); - } - - - public boolean jinkins_condition_hasNotCompletedPirate(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout") || !groundquests.hasCompletedQuest(player, "u16_nym_themepark_vana_to_jinkins"); - } - - - public void jinkins_action_giveMooreQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_interview_moore"); - } - - - public void jinkins_action_grantMineQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_mine"); - - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_enraged_miner_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_enraged_miner_activate", 1); - } - - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_mine_droideka_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_mine_droideka_activate", 1); - } - } - - - public void jinkins_action_completeMooreQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "hasToldJinkinsMoore"); - } - - - public void jinkins_action_completeMineQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "hasCompletedMine"); - } - - - public void jinkins_action_hasFoundJinkins(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundJinkins"); - } - - - public void jinkins_action_gotoKole(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_jinkins_kole"); - } - - - public int jinkins_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_39")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - jinkins_action_completeMineQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_40"); - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_147")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "backhand"); - - string_id message = new string_id (c_stringFile, "s_148"); - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_136")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_137"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_138"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_138")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_140")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_141"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_142"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_142")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_143"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_144")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_145"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_46")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - jinkins_action_grantMineQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_47"); - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_102"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_104"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_103")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_106"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_104")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_106"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_107")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_108"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_109")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_110"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_119")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_121"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_123"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_123")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_125"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_127"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_132"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_127")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_129"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_133"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_132")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - jinkins_action_giveMooreQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_134"); - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int jinkins_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_133")) - { - - if (jinkins_condition__defaultCondition (player, npc)) - { - jinkins_action_giveMooreQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_134"); - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.jinkins"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.jinkins"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (jinkins_condition_hasCompletedThemePark (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_52"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (jinkins_condition_allQuestsComplete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_48"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (jinkins_condition_isDoneMineQuest (player, npc)) - { - jinkins_action_gotoKole (player, npc); - - string_id message = new string_id (c_stringFile, "s_50"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (jinkins_condition_hasMineFilter (player, npc)) - { - doAnimationAction (npc, "nod_head_multiple"); - - string_id message = new string_id (c_stringFile, "s_38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 4); - - npcStartConversation (player, npc, "jinkins", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (jinkins_condition_hasMineQuestIncomplete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_146"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 6); - - npcStartConversation (player, npc, "jinkins", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (jinkins_condition_hasReturnedFromMoore (player, npc)) - { - doAnimationAction (npc, "adjust"); - - jinkins_action_completeMooreQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_135"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_136"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 8); - - npcStartConversation (player, npc, "jinkins", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (jinkins_condition_hasCompletedPirate (player, npc)) - { - doAnimationAction (npc, "clap_rousing"); - - jinkins_action_hasFoundJinkins (player, npc); - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (jinkins_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_103"); - } - - utils.setScriptVar (player, "conversation.jinkins.branchId", 15); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "jinkins", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (jinkins_condition_hasNotCompletedPirate (player, npc)) - { - doAnimationAction (npc, "shoo"); - - string_id message = new string_id (c_stringFile, "s_105"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (jinkins_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - string_id message = new string_id (c_stringFile, "s_100"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("jinkins")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.jinkins.branchId"); - - if (branchId == 4 && jinkins_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && jinkins_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && jinkins_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && jinkins_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && jinkins_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && jinkins_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && jinkins_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && jinkins_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && jinkins_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && jinkins_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && jinkins_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && jinkins_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && jinkins_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && jinkins_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && jinkins_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && jinkins_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.jinkins.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_generic.java b/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_generic.java deleted file mode 100644 index f6413c2a3..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_generic.java +++ /dev/null @@ -1,1027 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.smuggler; -import script.library.utils; - - -public class junk_dealer_generic extends script.base_script -{ - public junk_dealer_generic() - { - } - String c_stringFile = "conversation/junk_dealer_generic"; - - - public boolean junk_dealer_generic_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean junk_dealer_generic_condition_check_inv(obj_id player, obj_id npc) throws InterruptedException - { - return smuggler.checkInventory(player, npc); - } - - - public boolean junk_dealer_generic_condition_hasNoInv(obj_id player, obj_id npc) throws InterruptedException - { - boolean hasNoInvRoom = false; - obj_id playerInv = utils.getInventoryContainer(player); - if (isIdValid(playerInv)) - { - int free_space = getVolumeFree(playerInv); - if (free_space < 1) - { - hasNoInvRoom = true; - } - } - return hasNoInvRoom; - } - - - public boolean junk_dealer_generic_condition_checkForKit(obj_id player, obj_id npc) throws InterruptedException - { - obj_id[] objContents = utils.getContents(player, true); - - if (objContents != null) - { - for (int intI = 0; intI 0; - } - - - public boolean junk_dealer_generic_condition_checkBuyBackContainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!smuggler.hasBuyBackContainer(player)) - { - junk_dealer_generic_action_createBuyBackContainer(player, npc); - } - return true; - } - - - public void junk_dealer_generic_action_start_dealing(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startDealing", params, 0.0f, false); - } - - - public void junk_dealer_generic_action_face_to(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - } - - - public void junk_dealer_generic_action_giveOrange(obj_id player, obj_id npc) throws InterruptedException - { - obj_id playerInv = getObjectInSlot( player, "inventory"); - if (isIdValid(playerInv)) - { - obj_id item = createObject( "object/tangible/loot/collectible/kits/orange_rug_kit.iff", playerInv, ""); - } - return; - } - - - public void junk_dealer_generic_action_giveBlue(obj_id player, obj_id npc) throws InterruptedException - { - obj_id playerInv = getObjectInSlot( player, "inventory"); - if (isIdValid(playerInv)) - { - obj_id item = createObject( "object/tangible/loot/collectible/kits/blue_rug_kit.iff", playerInv, ""); - } - return; - } - - - public void junk_dealer_generic_action_giveGong(obj_id player, obj_id npc) throws InterruptedException - { - obj_id playerInv = getObjectInSlot( player, "inventory"); - if (isIdValid(playerInv)) - { - obj_id item = createObject( "object/tangible/loot/collectible/kits/gong_kit.iff", playerInv, ""); - } - return; - } - - - public void junk_dealer_generic_action_giveSculpture(obj_id player, obj_id npc) throws InterruptedException - { - obj_id playerInv = getObjectInSlot( player, "inventory"); - if (isIdValid(playerInv)) - { - obj_id item = createObject( "object/tangible/loot/collectible/kits/sculpture_kit.iff", playerInv, ""); - } - return; - } - - - public void junk_dealer_generic_action_giveTable(obj_id player, obj_id npc) throws InterruptedException - { - obj_id playerInv = getObjectInSlot( player, "inventory"); - if (isIdValid(playerInv)) - { - obj_id item = createObject( "object/tangible/loot/collectible/kits/light_table_kit.iff", playerInv, ""); - } - return; - } - - - public void junk_dealer_generic_action_startBuyBack(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startBuyBack", params, 0.0f, false); - } - - - public void junk_dealer_generic_action_createBuyBackContainer(obj_id player, obj_id npc) throws InterruptedException - { - if (!isValidId(smuggler.createBuyBackControlDeviceOnPlayer(player))) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: "+ player + ") did not get his buy back container set up properly."); - } - } - - - public void junk_dealer_generic_action_startFlagNoSale(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); - } - - - public int junk_dealer_generic_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_43")) - { - - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_47"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - junk_dealer_generic_action_startBuyBack (player, npc); - - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_54fab04f")) - { - - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - junk_dealer_generic_action_start_dealing (player, npc); - - string_id message = new string_id (c_stringFile, "s_84a67771"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_48")) - { - - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - junk_dealer_generic_action_startFlagNoSale (player, npc); - - string_id message = new string_id (c_stringFile, "s_50"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_cd7a3f41")) - { - - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4bd9d15e"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_3aa18b2d")) - { - - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_d9e6b751"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_6d53d062"); - } - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int junk_dealer_generic_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_6d53d062")) - { - - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_e29f48dc"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_324b9b0f"); - } - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int junk_dealer_generic_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_324b9b0f")) - { - - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_12fe83a6"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_e1a103e5"); - } - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int junk_dealer_generic_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_e1a103e5")) - { - - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4d65752"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_d347bee3"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_b60b73f8"); - } - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int junk_dealer_generic_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_d347bee3")) - { - - if (junk_dealer_generic_condition_checkForKit (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_3fc7eb45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_ee977dee"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_8f39769"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_fe657cdd"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9ede4b84"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_87c5851b"); - } - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (junk_dealer_generic_condition_checkForKitToo (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_3df21ea0"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_b60b73f8")) - { - - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_3633b5a5"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int junk_dealer_generic_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_ee977dee")) - { - - if (!junk_dealer_generic_condition_hasNoInv (player, npc)) - { - junk_dealer_generic_action_giveOrange (player, npc); - - string_id message = new string_id (c_stringFile, "s_14efaaa2"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_5b10c0b9"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_8f39769")) - { - - if (!junk_dealer_generic_condition_hasNoInv (player, npc)) - { - junk_dealer_generic_action_giveBlue (player, npc); - - string_id message = new string_id (c_stringFile, "s_27"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_fe657cdd")) - { - - if (!junk_dealer_generic_condition_hasNoInv (player, npc)) - { - junk_dealer_generic_action_giveGong (player, npc); - - string_id message = new string_id (c_stringFile, "s_32"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_34"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_9ede4b84")) - { - - if (!junk_dealer_generic_condition_hasNoInv (player, npc)) - { - junk_dealer_generic_action_giveTable (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_87c5851b")) - { - - if (!junk_dealer_generic_condition_hasNoInv (player, npc)) - { - junk_dealer_generic_action_giveSculpture (player, npc); - - string_id message = new string_id (c_stringFile, "s_42"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (junk_dealer_generic_condition_hasNoInv (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_49"); - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isMob (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.junk_dealer_generic"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.junk_dealer_generic"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (junk_dealer_generic_condition_checkBuyBackContainer (player, npc)) - { - junk_dealer_generic_action_face_to (player, npc); - - string_id message = new string_id (c_stringFile, "s_bef51e38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (junk_dealer_generic_condition_hasBuyBackItems (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (junk_dealer_generic_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (junk_dealer_generic_condition_check_inv (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_43"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_48"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_cd7a3f41"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_3aa18b2d"); - } - - utils.setScriptVar (player, "conversation.junk_dealer_generic.branchId", 1); - - npcStartConversation (player, npc, "junk_dealer_generic", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("junk_dealer_generic")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - if (branchId == 1 && junk_dealer_generic_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && junk_dealer_generic_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && junk_dealer_generic_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && junk_dealer_generic_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && junk_dealer_generic_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && junk_dealer_generic_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.junk_dealer_generic.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_jawa.java b/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_jawa.java deleted file mode 100644 index d724da602..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_jawa.java +++ /dev/null @@ -1,390 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.smuggler; -import script.library.utils; - - -public class junk_dealer_jawa extends script.base_script -{ - public junk_dealer_jawa() - { - } - String c_stringFile = "conversation/junk_dealer_jawa"; - - - public boolean junk_dealer_jawa_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean junk_dealer_jawa_condition_hasNoInv(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - boolean hasNoInvRoom = false; - obj_id playerInv = utils.getInventoryContainer(player); - if (isIdValid(playerInv)) - { - int free_space = getVolumeFree(playerInv); - if (free_space < 1) - { - hasNoInvRoom = true; - } - } - return hasNoInvRoom; - } - - - public boolean junk_dealer_jawa_condition_hasBuyBackItems(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - obj_id[] listOfBuyBacks = smuggler.getBuyBackItemsInContainer(player); - return listOfBuyBacks != null && listOfBuyBacks.length > 0; - } - - - public boolean junk_dealer_jawa_condition_checkBuyBackContainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!smuggler.hasBuyBackContainer(player)) - { - junk_dealer_jawa_action_createBuyBackContainer(player, npc); - } - return true; - } - - - public void junk_dealer_jawa_action_start_dealing(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startDealing", params, 0.0f, false); - } - - - public void junk_dealer_jawa_action_face_to(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - } - - - public void junk_dealer_jawa_action_startBuyBack(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startBuyBack", params, 0.0f, false); - } - - - public void junk_dealer_jawa_action_createBuyBackContainer(obj_id player, obj_id npc) throws InterruptedException - { - if (!isValidId(smuggler.createBuyBackControlDeviceOnPlayer(player))) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: "+ player + ") did not get his buy back container set up properly."); - } - } - - - public void junk_dealer_jawa_action_startFlagNoSale(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); - } - - - public int junk_dealer_jawa_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_43")) - { - - if (junk_dealer_jawa_condition_hasNoInv (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_53"); - } - - utils.setScriptVar (player, "conversation.junk_dealer_jawa.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - junk_dealer_jawa_action_startBuyBack (player, npc); - - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_54fab04f")) - { - - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - junk_dealer_jawa_action_start_dealing (player, npc); - - string_id message = new string_id (c_stringFile, "s_84a67771"); - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_48")) - { - - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - junk_dealer_jawa_action_startFlagNoSale (player, npc); - - string_id message = new string_id (c_stringFile, "s_50"); - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int junk_dealer_jawa_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_53")) - { - - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isMob (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.junk_dealer_jawa"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.junk_dealer_jawa"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (junk_dealer_jawa_condition_checkBuyBackContainer (player, npc)) - { - junk_dealer_jawa_action_face_to (player, npc); - - string_id message = new string_id (c_stringFile, "s_bef51e38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (junk_dealer_jawa_condition_hasBuyBackItems (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (junk_dealer_jawa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_43"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_48"); - } - - utils.setScriptVar (player, "conversation.junk_dealer_jawa.branchId", 1); - - npcStartConversation (player, npc, "junk_dealer_jawa", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("junk_dealer_jawa")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - if (branchId == 1 && junk_dealer_jawa_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && junk_dealer_jawa_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.junk_dealer_jawa.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_smuggler.java b/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_smuggler.java deleted file mode 100644 index 9987b0e5b..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/junk_dealer_smuggler.java +++ /dev/null @@ -1,591 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.group; -import script.library.quests; -import script.library.smuggler; -import script.library.utils; - - -public class junk_dealer_smuggler extends script.base_script -{ - public junk_dealer_smuggler() - { - } - String c_stringFile = "conversation/junk_dealer_smuggler"; - - - public boolean junk_dealer_smuggler_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean junk_dealer_smuggler_condition_check_inv(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return smuggler.checkInventory(player, npc); - } - - - public boolean junk_dealer_smuggler_condition_hasNoInv(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - boolean hasNoInvRoom = false; - obj_id playerInv = utils.getInventoryContainer(player); - if (isIdValid(playerInv)) - { - int free_space = getVolumeFree(playerInv); - if (free_space < 1) - { - hasNoInvRoom = true; - } - } - return hasNoInvRoom; - } - - - public boolean junk_dealer_smuggler_condition_check_master(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - obj_id master = utils.getObjIdScriptVar(npc, "smugglerMaster"); - - if (master != player) - { - return false; - } - - return true; - } - - - public boolean junk_dealer_smuggler_condition_isInParty(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - obj_id master = utils.getObjIdScriptVar(npc, "smugglerMaster"); - - if (player == master) - { - return true; - } - - if (group.isGrouped(master)) - { - Vector party = group.getPCMembersInRange(master, 32f); - - if (party != null) - { - for (int i = 0; i < party.size(); i++) - { - testAbortScript(); - obj_id who = (obj_id)party.elementAt(i); - - if (player == who) - { - return true; - } - } - } - } - - return false; - } - - - public boolean junk_dealer_smuggler_condition_canGetPistolQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - obj_id module = utils.getStaticItemInInventory(player, "item_reward_modify_pistol_01_01"); - - if (!isIdValid(module) || getCount(module) <= 0) - { - return false; - } - - if (groundquests.isQuestActive(player, "quest/smuggler_modules_for_pistol")) - { - return false; - } - - return true; - } - - - public boolean junk_dealer_smuggler_condition_canGetPistolQuestComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - obj_id module = utils.getStaticItemInInventory(player, "item_reward_modify_pistol_01_01"); - - if (!isIdValid(module) || getCount(module) < 100) - { - return false; - } - - if (!groundquests.isQuestActive(player, "quest/smuggler_modules_for_pistol")) - { - return false; - } - - return true; - } - - - public boolean junk_dealer_smuggler_condition_hasBuyBackItems(obj_id player, obj_id npc) throws InterruptedException - { - obj_id[] listOfBuyBacks = smuggler.getBuyBackItemsInContainer(player); - return listOfBuyBacks != null && listOfBuyBacks.length > 0; - } - - - public boolean junk_dealer_smuggler_condition_isInPartyWithBuyBack(obj_id player, obj_id npc) throws InterruptedException - { - return junk_dealer_smuggler_condition_isInParty(player, npc) && junk_dealer_smuggler_condition_hasBuyBackItems(player, npc); - } - - - public boolean junk_dealer_smuggler_condition_checkBuyBackContainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!smuggler.hasBuyBackContainer(player)) - { - junk_dealer_smuggler_action_createBuyBackContainer(player, npc); - } - return true; - } - - - public void junk_dealer_smuggler_action_start_dealing(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startDealing", params, 0.0f, false); - } - - - public void junk_dealer_smuggler_action_face_to(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - } - - - public void junk_dealer_smuggler_action_grant_pistol_quest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.requestGrantQuest(player, "quest/smuggler_modules_for_pistol", true); - } - - - public void junk_dealer_smuggler_action_complete_pistol_quest(obj_id player, obj_id npc) throws InterruptedException - { - obj_id module = utils.getStaticItemInInventory(player, "item_reward_modify_pistol_01_01"); - - if (!isIdValid(module) || getCount(module) < 100) - { - return; - } - - int count = getCount(module); - - count -= 100; - - if (count <= 0) - { - destroyObject(module); - } - else - { - setCount(module, count); - } - - groundquests.sendSignal(player, "smugglerModulesCollected"); - } - - - public void junk_dealer_smuggler_action_startBuyBack(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startBuyBack", params, 0.0f, false); - } - - - public void junk_dealer_smuggler_action_createBuyBackContainer(obj_id player, obj_id npc) throws InterruptedException - { - if (!isValidId(smuggler.createBuyBackControlDeviceOnPlayer(player))) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer_generic conversation - Player (OID: "+ player + ") did not get his buy back container set up properly."); - } - } - - - public void junk_dealer_smuggler_action_dismiss(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "dismissDealer", params, 1.0f, false); - } - - - public void junk_dealer_smuggler_action_startFlagNoSale(obj_id player, obj_id npc) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(npc, "startFlaggingItemsNoSale", params, 0.0f, false); - } - - - public int junk_dealer_smuggler_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_17")) - { - - if (junk_dealer_smuggler_condition_hasNoInv (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_startBuyBack (player, npc); - - string_id message = new string_id (c_stringFile, "s_19"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_54fab04f")) - { - - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_start_dealing (player, npc); - - string_id message = new string_id (c_stringFile, "s_84a67771"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_20")) - { - - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_startFlagNoSale (player, npc); - - string_id message = new string_id (c_stringFile, "s_23"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_cd7a3f41")) - { - - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4bd9d15e"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_43")) - { - - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_dismiss (player, npc); - - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_15")) - { - - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_grant_pistol_quest (player, npc); - - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_24")) - { - - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - junk_dealer_smuggler_action_complete_pistol_quest (player, npc); - - string_id message = new string_id (c_stringFile, "s_26"); - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isMob (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.junk_dealer_smuggler"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.junk_dealer_smuggler"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (junk_dealer_smuggler_condition_checkBuyBackContainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_bef51e38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (junk_dealer_smuggler_condition_isInPartyWithBuyBack (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (junk_dealer_smuggler_condition_isInParty (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (junk_dealer_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (junk_dealer_smuggler_condition_check_master (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (junk_dealer_smuggler_condition_canGetPistolQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - boolean hasResponse6 = false; - if (junk_dealer_smuggler_condition_canGetPistolQuestComplete (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse6 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_17"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54fab04f"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_cd7a3f41"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_43"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_15"); - } - - if (hasResponse6) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.junk_dealer_smuggler.branchId", 1); - - npcStartConversation (player, npc, "junk_dealer_smuggler", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("junk_dealer_smuggler")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - if (branchId == 1 && junk_dealer_smuggler_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.junk_dealer_smuggler.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/kole.java b/sku.0/sys.server/compiled/game/script/conversation/kole.java deleted file mode 100644 index d194919d9..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/kole.java +++ /dev/null @@ -1,1262 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class kole extends script.base_script -{ - public kole() - { - } - String c_stringFile = "conversation/kole"; - - - public boolean kole_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean kole_condition_hasCompletedMine(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_jinkins_kole") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_second_interview_moore"); - } - - - public boolean kole_condition_hasCompletedMoore(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_second_interview_moore", "tellKoleMoore"); - } - - - public boolean kole_condition_hasMooreQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_second_interview_moore"); - } - - - public boolean kole_condition_hasMooreNotResearch(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, "u16_nym_themepark_second_interview_moore") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility")); - } - - - public boolean kole_condition_hasDoneResearchFacility(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_research_facility", "returnResearchFacilityComplete"); - } - - - public boolean kole_condition_hasCompletedResearchFacilityDoesntHaveArena(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_research_facility") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_nym_arena"); - } - - - public boolean kole_condition_hasResearchQuestOrNeedsQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_research_facility") || kole_condition_hasMooreNotResearch(player, npc); - } - - - public boolean kole_condition_hasCompletedThemepark(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_shuttle_ambush"); - } - - - public void kole_action_grantInterviewMoore(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.grantQuest(player, "u16_nym_themepark_second_interview_moore"); - } - - - public void kole_action_grantFacilityQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility")) - { - groundquests.grantQuest(player, "u16_nym_themepark_research_facility"); - } - - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_mercenary_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_mercenary_activate", 1); - } - - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_lab_droideka_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_lab_droideka_activate", 1); - } - - if (groundquests.isTaskActive(player, "u16_nym_themepark_second_interview_moore", "tellKoleMoore")) - { - groundquests.sendSignal(player, "hasToldKoleMoore"); - } - } - - - public void kole_action_finishMooreQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "hasToldKoleMoore"); - } - - - public void kole_action_completeResearchFacility(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "hasCompletedResearchFacility"); - } - - - public void kole_action_hasFoundKole(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundKole"); - } - - - public void kole_action_gotoNym(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_kole_to_nym"); - } - - - public int kole_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_57")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_59")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - kole_action_completeResearchFacility (player, npc); - - string_id message = new string_id (c_stringFile, "s_60"); - utils.removeScriptVar (player, "conversation.kole.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - kole_action_grantFacilityQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_71"); - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_25")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_27")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_69")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - kole_action_grantFacilityQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_71"); - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_29"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_31"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_31")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_35")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_54")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_63"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_65"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_39")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_43"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_45"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_41")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_43"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_45"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_45")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - kole_action_grantInterviewMoore (player, npc); - - string_id message = new string_id (c_stringFile, "s_51"); - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_65")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_70"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kole_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_70")) - { - - if (kole_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kole.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.kole"); - } - - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.kole"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (kole_condition_hasCompletedThemepark (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_75"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (kole_condition_hasCompletedResearchFacilityDoesntHaveArena (player, npc)) - { - kole_action_gotoNym (player, npc); - - string_id message = new string_id (c_stringFile, "s_61"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (kole_condition_hasDoneResearchFacility (player, npc)) - { - doAnimationAction (npc, "applause_excited"); - - string_id message = new string_id (c_stringFile, "s_56"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 3); - - npcStartConversation (player, npc, "kole", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (kole_condition_hasResearchQuestOrNeedsQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 6); - - npcStartConversation (player, npc, "kole", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (kole_condition_hasCompletedMoore (player, npc)) - { - doAnimationAction (npc, "applause_polite"); - - kole_action_finishMooreQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_25"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 7); - - npcStartConversation (player, npc, "kole", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (kole_condition_hasMooreQuest (player, npc)) - { - doAnimationAction (npc, "backhand_threaten"); - - string_id message = new string_id (c_stringFile, "s_53"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (kole_condition_hasCompletedMine (player, npc)) - { - doAnimationAction (npc, "shoo"); - - kole_action_hasFoundKole (player, npc); - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kole_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - utils.setScriptVar (player, "conversation.kole.branchId", 12); - - npcStartConversation (player, npc, "kole", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (kole_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "rude"); - - string_id message = new string_id (c_stringFile, "s_74"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("kole")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.kole.branchId"); - - if (branchId == 3 && kole_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && kole_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && kole_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && kole_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && kole_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && kole_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && kole_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && kole_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && kole_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && kole_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && kole_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && kole_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && kole_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && kole_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.kole.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/kusak.java b/sku.0/sys.server/compiled/game/script/conversation/kusak.java deleted file mode 100644 index abda530eb..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/kusak.java +++ /dev/null @@ -1,930 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.utils; - - -public class kusak extends script.base_script -{ - public kusak() - { - } - String c_stringFile = "conversation/kusak"; - - - public boolean kusak_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean kusak_condition_hasWeed(obj_id player, obj_id npc) throws InterruptedException - { - if (hasObjVar(npc, "alreadyFed")) - { - return false; - } - - if (!hasObjVar(npc, "kusak")) - { - return false; - } - - int kusakNum = getIntObjVar(npc, "kusak"); - if (kusakNum < 0 || kusakNum > 10) - { - return false; - } - - String collectionSlot = "icon_nyms_kusak_feeding_"+kusakNum; - - if (hasCompletedCollectionSlot(player, collectionSlot)) - { - LOG("kusak","hasWeed player has slot"); - return false; - } - - for (int i=0; i < ALL_WEED_TEMPLATES.length; i++) - { - testAbortScript(); - obj_id object = utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[i]); - if (isValidId(object)) - { - return true; - } - } - return false; - } - - - public boolean kusak_condition_hasWeedType1(obj_id player, obj_id npc) throws InterruptedException - { - return isValidId(utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[0])) && hasCompletedCollectionSlot(player, "icon_nyms_duty_01"); - } - - - public boolean kusak_condition_hasWeedType10(obj_id player, obj_id npc) throws InterruptedException - { - return isValidId(utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[9])) && hasCompletedCollectionSlot(player, "icon_nyms_duty_10"); - } - - - public boolean kusak_condition_hasWeedType9(obj_id player, obj_id npc) throws InterruptedException - { - return isValidId(utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[8])) && hasCompletedCollectionSlot(player, "icon_nyms_duty_09"); - } - - - public boolean kusak_condition_hasWeedType8(obj_id player, obj_id npc) throws InterruptedException - { - return isValidId(utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[7])) && hasCompletedCollectionSlot(player, "icon_nyms_duty_08"); - } - - - public boolean kusak_condition_hasWeedType7(obj_id player, obj_id npc) throws InterruptedException - { - return isValidId(utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[6])) && hasCompletedCollectionSlot(player, "icon_nyms_duty_07"); - } - - - public boolean kusak_condition_hasWeedType6(obj_id player, obj_id npc) throws InterruptedException - { - return isValidId(utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[5])) && hasCompletedCollectionSlot(player, "icon_nyms_duty_06"); - } - - - public boolean kusak_condition_hasWeedType4(obj_id player, obj_id npc) throws InterruptedException - { - return isValidId(utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[3])) && hasCompletedCollectionSlot(player, "icon_nyms_duty_04"); - } - - - public boolean kusak_condition_hasWeedType3(obj_id player, obj_id npc) throws InterruptedException - { - return isValidId(utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[2])) && hasCompletedCollectionSlot(player, "icon_nyms_duty_03"); - } - - - public boolean kusak_condition_hasWeedType2(obj_id player, obj_id npc) throws InterruptedException - { - return isValidId(utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[1])) && hasCompletedCollectionSlot(player, "icon_nyms_duty_02"); - } - - - public boolean kusak_condition_hasWeedType5(obj_id player, obj_id npc) throws InterruptedException - { - return isValidId(utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[4])) && hasCompletedCollectionSlot(player, "icon_nyms_duty_05"); - } - - - public void kusak_action_validateWeedOne(obj_id player, obj_id npc) throws InterruptedException - { - LOG("kusak","validateWeedOne init"); - if (!hasObjVar(npc, "weed_type")) - { - LOG("kusak","validateWeedOne no var"); - doAnimationAction(npc, "trick_1"); - return; - } - - int weedType = getIntObjVar(npc, "weed_type"); - if (weedType != WEEDTYPE01) - { - LOG("kusak","validateWeedOne type not "+WEEDTYPE01); - doAnimationAction(npc, "ashamed"); - return; - } - - setObjVar(npc, "weedObj", utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[0])); - - kusak_action_awardPlayer(player, npc); - } - - - public void kusak_action_validateWeedTen(obj_id player, obj_id npc) throws InterruptedException - { - LOG("kusak","validateWeedTen init"); - if (!hasObjVar(npc, "weed_type")) - { - LOG("kusak","validateWeedTen no var"); - doAnimationAction(npc, "trick_1"); - return; - } - - int weedType = getIntObjVar(npc, "weed_type"); - if (weedType != WEEDTYPE10) - { - LOG("kusak","validateWeedTen type not "+WEEDTYPE10); - doAnimationAction(npc, "ashamed"); - return; - } - setObjVar(npc, "weedObj", utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[9])); - kusak_action_awardPlayer(player, npc); - } - - - public void kusak_action_validateWeedNine(obj_id player, obj_id npc) throws InterruptedException - { - LOG("kusak","validateWeedNine init"); - if (!hasObjVar(npc, "weed_type")) - { - LOG("kusak","validateWeedNine no var"); - doAnimationAction(npc, "trick_1"); - return; - } - - int weedType = getIntObjVar(npc, "weed_type"); - if (weedType != WEEDTYPE09) - { - LOG("kusak","validateWeedNine type not "+WEEDTYPE09); - doAnimationAction(npc, "ashamed"); - return; - } - setObjVar(npc, "weedObj", utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[8])); - kusak_action_awardPlayer(player, npc); - } - - - public void kusak_action_validateWeedEight(obj_id player, obj_id npc) throws InterruptedException - { - LOG("kusak","validateWeedEight init"); - if (!hasObjVar(npc, "weed_type")) - { - LOG("kusak","validateWeedEight no var"); - doAnimationAction(npc, "trick_1"); - return; - } - - int weedType = getIntObjVar(npc, "weed_type"); - if (weedType != WEEDTYPE08) - { - LOG("kusak","validateWeedEight type not "+WEEDTYPE08); - doAnimationAction(npc, "ashamed"); - return; - } - setObjVar(npc, "weedObj", utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[7])); - kusak_action_awardPlayer(player, npc); - } - - - public void kusak_action_validateWeedSeven(obj_id player, obj_id npc) throws InterruptedException - { - LOG("kusak","validateWeedSeven init"); - if (!hasObjVar(npc, "weed_type")) - { - LOG("kusak","validateWeedSeven no var"); - doAnimationAction(npc, "trick_1"); - return; - } - - int weedType = getIntObjVar(npc, "weed_type"); - if (weedType != WEEDTYPE07) - { - LOG("kusak","validateWeedSeven type not "+WEEDTYPE07); - doAnimationAction(npc, "ashamed"); - return; - } - setObjVar(npc, "weedObj", utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[6])); - kusak_action_awardPlayer(player, npc); - } - - - public void kusak_action_validateWeedSix(obj_id player, obj_id npc) throws InterruptedException - { - LOG("kusak","validateWeedSix init"); - if (!hasObjVar(npc, "weed_type")) - { - LOG("kusak","validateWeedSix no var"); - doAnimationAction(npc, "trick_1"); - return; - } - - int weedType = getIntObjVar(npc, "weed_type"); - if (weedType != WEEDTYPE06) - { - LOG("kusak","validateWeedSix type not "+WEEDTYPE06); - doAnimationAction(npc, "ashamed"); - return; - } - setObjVar(npc, "weedObj", utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[5])); - kusak_action_awardPlayer(player, npc); - } - - - public void kusak_action_validateWeedFive(obj_id player, obj_id npc) throws InterruptedException - { - LOG("kusak","validateWeedFive init"); - if (!hasObjVar(npc, "weed_type")) - { - LOG("kusak","validateWeedFive no var"); - doAnimationAction(npc, "trick_1"); - return; - } - - int weedType = getIntObjVar(npc, "weed_type"); - if (weedType != WEEDTYPE05) - { - LOG("kusak","validateWeedFive type not "+WEEDTYPE05); - doAnimationAction(npc, "ashamed"); - return; - } - setObjVar(npc, "weedObj", utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[4])); - kusak_action_awardPlayer(player, npc); - } - - - public void kusak_action_validateWeedFour(obj_id player, obj_id npc) throws InterruptedException - { - LOG("kusak","validateWeedFour init"); - if (!hasObjVar(npc, "weed_type")) - { - LOG("kusak","validateWeedFour no var"); - doAnimationAction(npc, "trick_1"); - return; - } - - int weedType = getIntObjVar(npc, "weed_type"); - if (weedType != WEEDTYPE04) - { - LOG("kusak","validateWeedFour type not "+WEEDTYPE04); - doAnimationAction(npc, "ashamed"); - return; - } - setObjVar(npc, "weedObj", utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[3])); - kusak_action_awardPlayer(player, npc); - } - - - public void kusak_action_validateWeedThree(obj_id player, obj_id npc) throws InterruptedException - { - LOG("kusak","validateWeedThree init"); - if (!hasObjVar(npc, "weed_type")) - { - LOG("kusak","validateWeedThree no var"); - doAnimationAction(npc, "trick_1"); - return; - } - - int weedType = getIntObjVar(npc, "weed_type"); - if (weedType != WEEDTYPE03) - { - LOG("kusak","validateWeedThree type not "+WEEDTYPE03); - doAnimationAction(npc, "ashamed"); - return; - } - setObjVar(npc, "weedObj", utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[2])); - kusak_action_awardPlayer(player, npc); - } - - - public void kusak_action_validateWeedTwo(obj_id player, obj_id npc) throws InterruptedException - { - LOG("kusak","validateWeedTwo init"); - if (!hasObjVar(npc, "weed_type")) - { - LOG("kusak","validateWeedTwo no var"); - doAnimationAction(npc, "trick_1"); - return; - } - - int weedType = getIntObjVar(npc, "weed_type"); - if (weedType != WEEDTYPE02) - { - LOG("kusak","validateWeedTwo type not "+WEEDTYPE02); - doAnimationAction(npc, "ashamed"); - return; - } - setObjVar(npc, "weedObj", utils.getItemByTemplateInInventoryOrEquipped(player, ALL_WEED_TEMPLATES[1])); - kusak_action_awardPlayer(player, npc); - } - - - public void kusak_action_awardPlayer(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(npc, "kusak")) - { - return; - } - - int kusakNum = getIntObjVar(npc, "kusak"); - if (kusakNum < 0 || kusakNum > 10) - { - return; - } - - if (!hasObjVar(npc, "weedObj")) - { - return; - } - - obj_id weedObj = getObjIdObjVar(npc, "weedObj"); - if (!isValidId(weedObj) || !exists(weedObj)) - { - return; - } - - String collectionSlot = "icon_nyms_kusak_feeding_"+kusakNum; - - if (!hasCompletedCollectionSlot(player, collectionSlot)) - { - if (modifyCollectionSlotValue(player, collectionSlot, 1)) - { - decrementCount(weedObj); - String trickName = "trick_"+rand(1,2); - doAnimationAction(npc, trickName); - messageTo(npc, "destroySelf", null, 3, false); - setObjVar(npc, "alreadyFed", 1); - } - } - } - - - public int kusak_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_6")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kusak_condition_hasWeedType1 (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (kusak_condition_hasWeedType2 (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (kusak_condition_hasWeedType3 (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (kusak_condition_hasWeedType4 (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (kusak_condition_hasWeedType5 (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (kusak_condition_hasWeedType6 (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - boolean hasResponse6 = false; - if (kusak_condition_hasWeedType7 (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse6 = true; - } - - boolean hasResponse7 = false; - if (kusak_condition_hasWeedType8 (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse7 = true; - } - - boolean hasResponse8 = false; - if (kusak_condition_hasWeedType9 (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse8 = true; - } - - boolean hasResponse9 = false; - if (kusak_condition_hasWeedType10 (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse9 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_21"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_23"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_25"); - } - - if (hasResponse6) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - if (hasResponse7) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - if (hasResponse8) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - if (hasResponse9) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - utils.setScriptVar (player, "conversation.kusak.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int kusak_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_20")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - kusak_action_validateWeedOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_21")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - kusak_action_validateWeedTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_31"); - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_22")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - kusak_action_validateWeedThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_32"); - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_23")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - kusak_action_validateWeedFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_24")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - kusak_action_validateWeedFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_25")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - kusak_action_validateWeedSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_28")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - kusak_action_validateWeedSeven (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_38")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - kusak_action_validateWeedEight (player, npc); - - string_id message = new string_id (c_stringFile, "s_40"); - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_42")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - kusak_action_validateWeedNine (player, npc); - - string_id message = new string_id (c_stringFile, "s_44"); - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_46")) - { - - if (kusak_condition__defaultCondition (player, npc)) - { - kusak_action_validateWeedTen (player, npc); - - string_id message = new string_id (c_stringFile, "s_48"); - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - public static final String[] ALL_WEED_TEMPLATES = - { - "object/tangible/collection/col_nym_weed_01.iff", - "object/tangible/collection/col_nym_weed_02.iff", - "object/tangible/collection/col_nym_weed_03.iff", - "object/tangible/collection/col_nym_weed_04.iff", - "object/tangible/collection/col_nym_weed_05.iff", - "object/tangible/collection/col_nym_weed_06.iff", - "object/tangible/collection/col_nym_weed_07.iff", - "object/tangible/collection/col_nym_weed_08.iff", - "object/tangible/collection/col_nym_weed_09.iff", - "object/tangible/collection/col_nym_weed_10.iff" - }; - - public static final int WEEDTYPE01 = 1; - public static final int WEEDTYPE02 = 2; - public static final int WEEDTYPE03 = 3; - public static final int WEEDTYPE04 = 4; - public static final int WEEDTYPE05 = 5; - public static final int WEEDTYPE06 = 6; - public static final int WEEDTYPE07 = 7; - public static final int WEEDTYPE08 = 8; - public static final int WEEDTYPE09 = 9; - public static final int WEEDTYPE10 = 10; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.kusak"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - messageTo(self, "setupWeedVar", null, 3, false); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.kusak"); - - return SCRIPT_CONTINUE; - } - - - public int setupWeedVar(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - setObjVar(self, "weed_type", rand(1,10)); - - return SCRIPT_CONTINUE; - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (kusak_condition_hasWeed (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (kusak_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_6"); - } - - utils.setScriptVar (player, "conversation.kusak.branchId", 1); - - npcStartConversation (player, npc, "kusak", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (kusak_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("kusak")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.kusak.branchId"); - - if (branchId == 1 && kusak_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && kusak_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.kusak.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/mako_ghast.java b/sku.0/sys.server/compiled/game/script/conversation/mako_ghast.java deleted file mode 100644 index ea19c4fcd..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/mako_ghast.java +++ /dev/null @@ -1,1652 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class mako_ghast extends script.base_script -{ - public mako_ghast() - { - } - String c_stringFile = "conversation/mako_ghast"; - - - public boolean mako_ghast_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean mako_ghast_condition_canDoEliteHideout(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_elite_kill_pirate_cave_collection") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean mako_ghast_condition_hasEliteHideoutNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); - } - - - public boolean mako_ghast_condition_hasReturnedEliteHideout(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection", "returnKillCaveTrollComplete"); - } - - - public boolean mako_ghast_condition_canDoEliteCave(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_elite_kill_miner_cave_collection") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_pirate_cave_collection") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine"); - } - - - public boolean mako_ghast_condition_hasEliteCaveNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); - } - - - public boolean mako_ghast_condition_hasReturnedEliteCave(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection", "returnMineElitesComplete"); - } - - - public boolean mako_ghast_condition_canDoEliteLab(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_elite_kill_imperial_facility_collection") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_miner_cave_collection") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility"); - } - - - public boolean mako_ghast_condition_hasEliteLabNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection"); - } - - - public boolean mako_ghast_condition_hasReturnedEliteLab(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection", "returnResearchFacilityElitesComplete"); - } - - - public boolean mako_ghast_condition_hasntDoneLab(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); - } - - - public boolean mako_ghast_condition_hasntDoneCave(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); - } - - - public boolean mako_ghast_condition_hasntDoneHideout(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean mako_ghast_condition_hasCompletedPirateEliteCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "kill_nyms_themepark_elite_hideout") && groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); - } - - - public boolean mako_ghast_condition_hasCompletedLabEliteCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "kill_nyms_themepark_elite_lab") && groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection"); - } - - - public boolean mako_ghast_condition_hasCompletedMinerEliteCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "kill_nyms_themepark_elite_cave") && groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); - } - - - public void mako_ghast_action_grantHideoutKill(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_elite_kill_pirate_cave_collection"); - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_cave_troll_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_cave_troll_activate", 1); - } - } - - - public void mako_ghast_action_completeHideoutKill(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedKillCaveTroll"); - } - - - public void mako_ghast_action_grantCaveKill(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_elite_kill_miner_cave_collection"); - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_elite_cave_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_elite_cave_activate", 1); - } - } - - - public void mako_ghast_action_completeCaveKill(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedMineElites"); - } - - - public void mako_ghast_action_grantLabKill(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_elite_kill_imperial_facility_collection"); - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_elite_lab_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_elite_lab_activate", 1); - } - } - - - public void mako_ghast_action_completeLabKill(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedResearchFacilityElites"); - } - - - public void mako_ghast_action_BruteForceCompletePirateElite(obj_id player, obj_id npc) throws InterruptedException - { - if (mako_ghast_condition_hasCompletedPirateEliteCollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_pirate_cave_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_elite_kill_pirate_cave_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_elite_kill_pirate_cave_collection"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public void mako_ghast_action_BruteForceCompleteLabElite(obj_id player, obj_id npc) throws InterruptedException - { - if (mako_ghast_condition_hasCompletedLabEliteCollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_imperial_facility_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_elite_kill_imperial_facility_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_elite_kill_imperial_facility_collection"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public void mako_ghast_action_BruteForceCompleteMinerElite(obj_id player, obj_id npc) throws InterruptedException - { - if (mako_ghast_condition_hasCompletedMinerEliteCollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_elite_kill_miner_cave_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_elite_kill_miner_cave_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_elite_kill_miner_cave_collection"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public int mako_ghast_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_94"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 2); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_94")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_completeLabKill (player, npc); - - string_id message = new string_id (c_stringFile, "s_95"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_34")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_32")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_88"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_88")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_90"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_90")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_92"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_92")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_grantLabKill (player, npc); - - string_id message = new string_id (c_stringFile, "s_93"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_27")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_completeCaveKill (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_41")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_43"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_47")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_67")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_68"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_69")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_75"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_75")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_grantCaveKill (player, npc); - - string_id message = new string_id (c_stringFile, "s_76"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_64")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_completeHideoutKill (player, npc); - - string_id message = new string_id (c_stringFile, "s_66"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_81")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_83"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_87")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_99"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_99")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_101"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_103"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mako_ghast_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_103")) - { - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - mako_ghast_action_grantHideoutKill (player, npc); - - string_id message = new string_id (c_stringFile, "s_107"); - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.mako_ghast"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.mako_ghast"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (mako_ghast_condition_hasReturnedEliteLab (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 1); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasCompletedLabEliteCollection (player, npc)) - { - mako_ghast_action_BruteForceCompleteLabElite (player, npc); - - string_id message = new string_id (c_stringFile, "s_109"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasEliteLabNotComplete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_30"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 5); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_canDoEliteLab (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_29"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "mako_ghast", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasntDoneLab (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_105"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasReturnedEliteCave (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 13); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasCompletedMinerEliteCollection (player, npc)) - { - mako_ghast_action_BruteForceCompleteMinerElite (player, npc); - - string_id message = new string_id (c_stringFile, "s_110"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasEliteCaveNotComplete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 16); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_canDoEliteCave (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_47"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 18); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasntDoneCave (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_104"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasReturnedEliteHideout (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_62"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 26); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasCompletedPirateEliteCollection (player, npc)) - { - mako_ghast_action_BruteForceCompletePirateElite (player, npc); - - string_id message = new string_id (c_stringFile, "s_111"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasEliteHideoutNotComplete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_81"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 29); - - npcStartConversation (player, npc, "mako_ghast", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_canDoEliteHideout (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_85"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mako_ghast_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_87"); - } - - utils.setScriptVar (player, "conversation.mako_ghast.branchId", 31); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "mako_ghast", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition_hasntDoneHideout (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_112"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (mako_ghast_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_114"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("mako_ghast")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.mako_ghast.branchId"); - - if (branchId == 1 && mako_ghast_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && mako_ghast_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && mako_ghast_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && mako_ghast_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && mako_ghast_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && mako_ghast_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && mako_ghast_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && mako_ghast_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && mako_ghast_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && mako_ghast_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && mako_ghast_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && mako_ghast_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && mako_ghast_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && mako_ghast_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && mako_ghast_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && mako_ghast_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && mako_ghast_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && mako_ghast_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && mako_ghast_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && mako_ghast_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.mako_ghast.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/moore_lok_cantina.java b/sku.0/sys.server/compiled/game/script/conversation/moore_lok_cantina.java deleted file mode 100644 index 6bc04065d..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/moore_lok_cantina.java +++ /dev/null @@ -1,2523 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.money; -import script.library.utils; - - -public class moore_lok_cantina extends script.base_script -{ - public moore_lok_cantina() - { - } - String c_stringFile = "conversation/moore_lok_cantina"; - - - public boolean moore_lok_cantina_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean moore_lok_cantina_condition_hasMooreTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_interview_moore", "findSgtMoore"); - } - - - public boolean moore_lok_cantina_condition_has2ndInterviewTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_second_interview_moore", "findSgtMoore2nd"); - } - - - public boolean moore_lok_cantina_condition_hasCompletedMoore(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.isTaskActive(player, "u16_nym_themepark_interview_moore", "tellJinkinsMoore") || groundquests.hasCompletedQuest(player, "u16_nym_themepark_interview_moore")); - } - - - public boolean moore_lok_cantina_condition_hasCompleted2ndMoore(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.isTaskActive(player, "u16_nym_themepark_second_interview_moore", "tellKoleMoore") || groundquests.hasCompletedQuest(player, "u16_nym_themepark_second_interview_moore")); - } - - - public void moore_lok_cantina_action_pay50(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!utils.hasScriptVar(player, "pay50")) - { - faceTo(npc, player); - dictionary params = new dictionary(); - money.requestPayment(player, npc, 50, "pass_fail", params, true); - utils.setScriptVar(player, "pay50", true); - } - } - - - public void moore_lok_cantina_action_finishMooreInterview(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "hasSpokenSgtMoore"); - } - - - public void moore_lok_cantina_action_pay100(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!utils.hasScriptVar(player, "pay100")) - { - dictionary params = new dictionary(); - money.requestPayment(player, npc, 100, "pass_fail", params, true); - utils.setScriptVar(player, "pay100", true); - } - } - - - public void moore_lok_cantina_action_pay150(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!utils.hasScriptVar(player, "payLast")) - { - faceTo(npc, player); - dictionary params = new dictionary(); - money.requestPayment(player, npc, 150, "pass_fail", params, true); - utils.setScriptVar(player, "payLast", true); - } - } - - - public void moore_lok_cantina_action_pay200(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!utils.hasScriptVar(player, "payLast")) - { - faceTo(npc, player); - dictionary params = new dictionary(); - money.requestPayment(player, npc, 200, "pass_fail", params, true); - utils.setScriptVar(player, "payLast", true); - } - } - - - public void moore_lok_cantina_action_finish2ndMooreInterview(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "hasSpokenSgtMoore2nd"); - } - - - public int moore_lok_cantina_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_32")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_34")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_pay200 (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_38")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_40"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_35")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_43"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_40")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_pay150 (player, npc); - - string_id message = new string_id (c_stringFile, "s_41"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_51")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_62"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_63")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_64"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_65"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_65")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_66"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_67")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_68"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_100")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_102"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_103"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_103")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_finish2ndMooreInterview (player, npc); - - string_id message = new string_id (c_stringFile, "s_105"); - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_40"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_43")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_48"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_52")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_54"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_56"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_48")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_40"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_56")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_40"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_60")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_71"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - moore_lok_cantina_action_pay50 (player, npc); - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_122")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_77")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_86")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_82")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_115")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_117")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_pay100 (player, npc); - - string_id message = new string_id (c_stringFile, "s_118"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_120"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_109")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_112")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_114")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_pay100 (player, npc); - - string_id message = new string_id (c_stringFile, "s_118"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_120"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_119")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_finishMooreInterview (player, npc); - - string_id message = new string_id (c_stringFile, "s_121"); - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_120")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_124"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_108")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_110"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_120"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_125")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_finishMooreInterview (player, npc); - - string_id message = new string_id (c_stringFile, "s_126"); - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_119")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - moore_lok_cantina_action_finishMooreInterview (player, npc); - - string_id message = new string_id (c_stringFile, "s_121"); - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_120")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_124"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_108")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_110"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_120"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int moore_lok_cantina_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_73")) - { - moore_lok_cantina_action_pay50 (player, npc); - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_122")) - { - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.moore_lok_cantina"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.moore_lok_cantina"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (moore_lok_cantina_condition_hasCompleted2ndMoore (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_69"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (moore_lok_cantina_condition_has2ndInterviewTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 2); - - npcStartConversation (player, npc, "moore_lok_cantina", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (moore_lok_cantina_condition_hasCompletedMoore (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (moore_lok_cantina_condition_hasMooreTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - utils.setScriptVar (player, "conversation.moore_lok_cantina.branchId", 18); - - npcStartConversation (player, npc, "moore_lok_cantina", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (moore_lok_cantina_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("moore_lok_cantina")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - if (branchId == 2 && moore_lok_cantina_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && moore_lok_cantina_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && moore_lok_cantina_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && moore_lok_cantina_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && moore_lok_cantina_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && moore_lok_cantina_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && moore_lok_cantina_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && moore_lok_cantina_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && moore_lok_cantina_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && moore_lok_cantina_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && moore_lok_cantina_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && moore_lok_cantina_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && moore_lok_cantina_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && moore_lok_cantina_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && moore_lok_cantina_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && moore_lok_cantina_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && moore_lok_cantina_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && moore_lok_cantina_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && moore_lok_cantina_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && moore_lok_cantina_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && moore_lok_cantina_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && moore_lok_cantina_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && moore_lok_cantina_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && moore_lok_cantina_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && moore_lok_cantina_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.moore_lok_cantina.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/mtp_corellia_times_contact.java b/sku.0/sys.server/compiled/game/script/conversation/mtp_corellia_times_contact.java deleted file mode 100644 index f152d12af..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/mtp_corellia_times_contact.java +++ /dev/null @@ -1,1227 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.groundquests; -import script.library.static_item; -import script.library.utils; - - -public class mtp_corellia_times_contact extends script.base_script -{ - public mtp_corellia_times_contact() - { - } - String c_stringFile = "conversation/mtp_corellia_times_contact"; - - - public boolean mtp_corellia_times_contact_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean mtp_corellia_times_contact_condition_isVaniPointerActive(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "mtp_hideout_pointer"); - } - - - public boolean mtp_corellia_times_contact_condition_allMeatlumpCollectionsComplete(obj_id player, obj_id npc) throws InterruptedException - { - return ((mtp_corellia_times_contact_condition_isMeatlumpFoodCollectionComplete(player, npc) && mtp_corellia_times_contact_condition_isMeatlumpWeaponCollectionComplete(player, npc) && mtp_corellia_times_contact_condition_isMeatlumpBombCollectionComplete(player, npc) && mtp_corellia_times_contact_condition_isMeatlumpMapCollectionComplete(player, npc) && mtp_corellia_times_contact_condition_isMeatlumpContainerCollectionComplete(player, npc)) && mtp_corellia_times_contact_condition_isMeatlumpSafeCollectionComplete(player, npc)); - } - - - public boolean mtp_corellia_times_contact_condition_isMeatlumpSafeCollectionComplete(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "col_meatlump_safe_01"); - } - - - public boolean mtp_corellia_times_contact_condition_isMeatlumpContainerCollectionComplete(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "col_meatlump_container_01"); - } - - - public boolean mtp_corellia_times_contact_condition_isMeatlumpMapCollectionComplete(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "col_meatlump_map_01"); - } - - - public boolean mtp_corellia_times_contact_condition_isMeatlumpBombCollectionComplete(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "col_meatlump_bomb_sabotage_01"); - } - - - public boolean mtp_corellia_times_contact_condition_isMeatlumpWeaponCollectionComplete(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "col_meatlump_weapon_sabotage_01"); - } - - - public boolean mtp_corellia_times_contact_condition_isMeatlumpFoodCollectionComplete(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "col_meatlump_food_sabotage_01"); - } - - - public boolean mtp_corellia_times_contact_condition_mealtumpCollectionCompleteQuestActive(obj_id player, obj_id npc) throws InterruptedException - { - return (mtp_corellia_times_contact_condition_allMeatlumpCollectionsComplete(player, npc) && groundquests.isTaskActive(player, "mtp_collection_tracking", "goBackToHaldenWes")); - } - - - public boolean mtp_corellia_times_contact_condition_repeatMeatlumpQuestComplete(obj_id player, obj_id npc) throws InterruptedException - { - return (mtp_corellia_times_contact_condition_allMeatlumpCollectionsComplete(player, npc) && groundquests.isTaskActive(player, "mtp_collection_tracking_02", "goBackToHaldenWes")); - } - - - public boolean mtp_corellia_times_contact_condition_meatlumpCollectionCompleteQuestComplete(obj_id player, obj_id npc) throws InterruptedException - { - return (mtp_corellia_times_contact_condition_allMeatlumpCollectionsComplete(player, npc) && groundquests.hasCompletedQuest(player, "mtp_collection_tracking")); - } - - - public boolean mtp_corellia_times_contact_condition_hasSafeDeviceStack(obj_id player, obj_id npc) throws InterruptedException - { - return utils.playerHasItemByTemplateInBankOrInventory(player, "object/tangible/meatlump/event/slicing_device_meatlump_safe.iff"); - } - - - public boolean mtp_corellia_times_contact_condition_hasContainerDeviceStack(obj_id player, obj_id npc) throws InterruptedException - { - return utils.playerHasItemByTemplateInBankOrInventory(player, "object/tangible/meatlump/event/slicing_device_meatlump_container.iff"); - } - - - public boolean mtp_corellia_times_contact_condition_hasMapDeviceStack(obj_id player, obj_id npc) throws InterruptedException - { - return utils.playerHasItemByTemplateInBankOrInventory(player, "object/tangible/meatlump/event/slicing_device_meatlump_map.iff"); - } - - - public boolean mtp_corellia_times_contact_condition_hasWeaponDeviceStack(obj_id player, obj_id npc) throws InterruptedException - { - return utils.playerHasItemByTemplateInBankOrInventory(player, "object/tangible/meatlump/event/slicing_device_meatlump_weapon.iff"); - } - - - public boolean mtp_corellia_times_contact_condition_hasFoodDeviceStack(obj_id player, obj_id npc) throws InterruptedException - { - return utils.playerHasItemByTemplateInBankOrInventory(player, "object/tangible/meatlump/event/slicing_device_meatlump_food.iff"); - } - - - public boolean mtp_corellia_times_contact_condition_hasBombDeviceStack(obj_id player, obj_id npc) throws InterruptedException - { - return utils.playerHasItemByTemplateInBankOrInventory(player, "object/tangible/meatlump/event/slicing_device_meatlump_bomb.iff"); - } - - - public boolean mtp_corellia_times_contact_condition_hasAllDevices(obj_id player, obj_id npc) throws InterruptedException - { - return (mtp_corellia_times_contact_condition_hasBombDeviceStack(player, npc) && mtp_corellia_times_contact_condition_hasFoodDeviceStack(player, npc) && mtp_corellia_times_contact_condition_hasWeaponDeviceStack(player, npc) && mtp_corellia_times_contact_condition_hasMapDeviceStack(player, npc) && mtp_corellia_times_contact_condition_hasContainerDeviceStack(player, npc) && mtp_corellia_times_contact_condition_hasSafeDeviceStack(player, npc)); - } - - - public boolean mtp_corellia_times_contact_condition_hasCollectionQuestActive(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "mtp_collection_tracking"); - } - - - public boolean mtp_corellia_times_contact_condition_hasQuestButNotAllDevices(obj_id player, obj_id npc) throws InterruptedException - { - return (mtp_corellia_times_contact_condition_hasCollectionQuestActive(player, npc) && !mtp_corellia_times_contact_condition_hasAllDevices(player, npc)); - } - - - public boolean mtp_corellia_times_contact_condition_isReadyForCollectionQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (!mtp_corellia_times_contact_condition_hasCollectionQuestActive(player, npc) && (mtp_corellia_times_contact_condition_isVaniPointerActive(player, npc)) || mtp_corellia_times_contact_condition_hasCompletedPrerequisites(player, npc)); - } - - - public boolean mtp_corellia_times_contact_condition_hasCompletedPrerequisites(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "mtp_hideout_pointer") && !groundquests.isQuestActive(player, "mtp_corellia_times_contact")); - } - - - public boolean mtp_corellia_times_contact_condition_isSomehowBroken(obj_id player, obj_id npc) throws InterruptedException - { - return (mtp_corellia_times_contact_condition_isMeatlumpBombCollectionComplete(player, npc) && !mtp_corellia_times_contact_condition_hasCollectionQuestActive(player, npc) || mtp_corellia_times_contact_condition_isMeatlumpContainerCollectionComplete(player, npc) && !mtp_corellia_times_contact_condition_hasCollectionQuestActive(player, npc) || mtp_corellia_times_contact_condition_isMeatlumpFoodCollectionComplete(player, npc) && !mtp_corellia_times_contact_condition_hasCollectionQuestActive(player, npc) || mtp_corellia_times_contact_condition_isMeatlumpMapCollectionComplete(player, npc) && !mtp_corellia_times_contact_condition_hasCollectionQuestActive(player, npc) || mtp_corellia_times_contact_condition_isMeatlumpSafeCollectionComplete(player, npc) && !mtp_corellia_times_contact_condition_hasCollectionQuestActive(player, npc) || mtp_corellia_times_contact_condition_isMeatlumpWeaponCollectionComplete(player, npc) && !mtp_corellia_times_contact_condition_hasCollectionQuestActive(player, npc)); - } - - - public void mtp_corellia_times_contact_action_sendVaniPointerSignal(obj_id player, obj_id npc) throws InterruptedException - { - if (mtp_corellia_times_contact_condition_isVaniPointerActive(player, npc)) - { - groundquests.sendSignal(player, "mtp_hideout_pointer_03"); - } - } - - - public void mtp_corellia_times_contact_action_removeAndReactivateMeatlumpCollectionsAndQuest(obj_id player, obj_id npc) throws InterruptedException - { - mtp_corellia_times_contact_action_removeMeatlumpCollections(player, npc); - mtp_corellia_times_contact_action_activateMeatlumpCollections(player, npc); - groundquests.clearQuest(player, "mtp_collection_tracking"); - groundquests.grantQuest(player, "mtp_collection_tracking"); - } - - - public void mtp_corellia_times_contact_action_grantMeatlumpCollectionAndQuest(obj_id player, obj_id npc) throws InterruptedException - { - mtp_corellia_times_contact_action_activateMeatlumpCollections(player, npc); - mtp_corellia_times_contact_action_grantCollectionQuest(player, npc); - } - - - public void mtp_corellia_times_contact_action_activateMeatlumpCollections(obj_id player, obj_id npc) throws InterruptedException - { - String activationStringList[] = - { - "meatlump_safe_activation_01", - "meatlump_container_activation_01", - "meatlump_map_activation_01", - "meatlump_bomb_activation_01", - "meatlump_weapon_activation_01", - "meatlump_food_activation_01" - }; - - for (int b = 0; b < activationStringList.length; b++) - { - testAbortScript(); - modifyCollectionSlotValue(player, activationStringList[b], 1); - } - } - - - public void mtp_corellia_times_contact_action_removeMeatlumpCollections(obj_id player, obj_id npc) throws InterruptedException - { - String collectionStringList[] = - { - "col_meatlump_safe_01", - "col_meatlump_container_01", - "col_meatlump_map_01", - "col_meatlump_bomb_sabotage_01", - "col_meatlump_weapon_sabotage_01", - "col_meatlump_food_sabotage_01" - }; - for (int a = 0; a < collectionStringList.length; a++) - { - testAbortScript(); - collection.removeCompletedCollection(player, collectionStringList[a]); - } - } - - - public void mtp_corellia_times_contact_action_completeCollectionQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "returnToHaldenWes"); - } - - - public void mtp_corellia_times_contact_action_giveSafeDevices(obj_id player, obj_id npc) throws InterruptedException - { - obj_id inv = utils.getInventoryContainer(player); - if (!isIdValid(inv) || !exists(inv)) - { - return; - } - - static_item.createNewItemFunction("item_meatlump_device_safe_01", inv); - } - - - public void mtp_corellia_times_contact_action_giveContainerDevices(obj_id player, obj_id npc) throws InterruptedException - { - obj_id inv = utils.getInventoryContainer(player); - if (!isIdValid(inv) || !exists(inv)) - { - return; - } - - static_item.createNewItemFunction("item_meatlump_device_container_01", inv); - } - - - public void mtp_corellia_times_contact_action_giveMapDevices(obj_id player, obj_id npc) throws InterruptedException - { - obj_id inv = utils.getInventoryContainer(player); - if (!isIdValid(inv) || !exists(inv)) - { - return; - } - - static_item.createNewItemFunction("item_meatlump_device_map_01", inv); - } - - - public void mtp_corellia_times_contact_action_giveBombDevices(obj_id player, obj_id npc) throws InterruptedException - { - obj_id inv = utils.getInventoryContainer(player); - if (!isIdValid(inv) || !exists(inv)) - { - return; - } - - static_item.createNewItemFunction("item_meatlump_device_bomb_01", inv); - } - - - public void mtp_corellia_times_contact_action_giveWeaponDevices(obj_id player, obj_id npc) throws InterruptedException - { - obj_id inv = utils.getInventoryContainer(player); - if (!isIdValid(inv) || !exists(inv)) - { - return; - } - - static_item.createNewItemFunction("item_meatlump_device_weapon_01", inv); - } - - - public void mtp_corellia_times_contact_action_giveFoodDevices(obj_id player, obj_id npc) throws InterruptedException - { - obj_id inv = utils.getInventoryContainer(player); - if (!isIdValid(inv) || !exists(inv)) - { - return; - } - - static_item.createNewItemFunction("item_meatlump_device_food_01", inv); - } - - - public void mtp_corellia_times_contact_action_giveAllDevices(obj_id player, obj_id npc) throws InterruptedException - { - mtp_corellia_times_contact_action_giveFoodDevices(player, npc); - mtp_corellia_times_contact_action_giveWeaponDevices(player, npc); - mtp_corellia_times_contact_action_giveBombDevices(player, npc); - mtp_corellia_times_contact_action_giveMapDevices(player, npc); - mtp_corellia_times_contact_action_giveContainerDevices(player, npc); - mtp_corellia_times_contact_action_giveSafeDevices(player, npc); - } - - - public void mtp_corellia_times_contact_action_grantCollectionQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "mtp_collection_tracking"); - } - - - public int mtp_corellia_times_contact_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_39")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - mtp_corellia_times_contact_action_removeAndReactivateMeatlumpCollectionsAndQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_41"); - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_43")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_45"); - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corellia_times_contact_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.mtp_corellia_times_contact.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corellia_times_contact_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_21"); - } - - utils.setScriptVar (player, "conversation.mtp_corellia_times_contact.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corellia_times_contact_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_21")) - { - doAnimationAction (player, "laugh"); - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_25"); - } - - utils.setScriptVar (player, "conversation.mtp_corellia_times_contact.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corellia_times_contact_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_25")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_29"); - } - - utils.setScriptVar (player, "conversation.mtp_corellia_times_contact.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corellia_times_contact_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_29")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_33"); - } - - utils.setScriptVar (player, "conversation.mtp_corellia_times_contact.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corellia_times_contact_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_33")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - mtp_corellia_times_contact_action_giveAllDevices (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.mtp_corellia_times_contact.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corellia_times_contact_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute2"); - - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - utils.setScriptVar (player, "conversation.mtp_corellia_times_contact.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corellia_times_contact_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_46")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - mtp_corellia_times_contact_action_grantMeatlumpCollectionAndQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_48"); - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corellia_times_contact_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_52")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - mtp_corellia_times_contact_action_giveBombDevices (player, npc); - - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_56")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - mtp_corellia_times_contact_action_giveFoodDevices (player, npc); - - string_id message = new string_id (c_stringFile, "s_58"); - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_60")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - mtp_corellia_times_contact_action_giveWeaponDevices (player, npc); - - string_id message = new string_id (c_stringFile, "s_62"); - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_64")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - mtp_corellia_times_contact_action_giveMapDevices (player, npc); - - string_id message = new string_id (c_stringFile, "s_66"); - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_68")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - mtp_corellia_times_contact_action_giveContainerDevices (player, npc); - - string_id message = new string_id (c_stringFile, "s_70"); - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_72")) - { - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - mtp_corellia_times_contact_action_giveSafeDevices (player, npc); - - string_id message = new string_id (c_stringFile, "s_74"); - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.mtp_corellia_times_contact"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.mtp_corellia_times_contact"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (mtp_corellia_times_contact_condition_meatlumpCollectionCompleteQuestComplete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_39"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_43"); - } - - utils.setScriptVar (player, "conversation.mtp_corellia_times_contact.branchId", 1); - - npcStartConversation (player, npc, "mtp_corellia_times_contact", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mtp_corellia_times_contact_condition_mealtumpCollectionCompleteQuestActive (player, npc)) - { - doAnimationAction (npc, "bow"); - - doAnimationAction (player, "thumb_up"); - - mtp_corellia_times_contact_action_completeCollectionQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_19"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (mtp_corellia_times_contact_condition_isReadyForCollectionQuest (player, npc)) - { - mtp_corellia_times_contact_action_sendVaniPointerSignal (player, npc); - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.mtp_corellia_times_contact.branchId", 5); - - npcStartConversation (player, npc, "mtp_corellia_times_contact", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mtp_corellia_times_contact_condition_hasQuestButNotAllDevices (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (!mtp_corellia_times_contact_condition_hasBombDeviceStack (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (!mtp_corellia_times_contact_condition_hasFoodDeviceStack (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (!mtp_corellia_times_contact_condition_hasWeaponDeviceStack (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (!mtp_corellia_times_contact_condition_hasMapDeviceStack (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (!mtp_corellia_times_contact_condition_hasContainerDeviceStack (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!mtp_corellia_times_contact_condition_hasSafeDeviceStack (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_56"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_72"); - } - - utils.setScriptVar (player, "conversation.mtp_corellia_times_contact.branchId", 14); - - npcStartConversation (player, npc, "mtp_corellia_times_contact", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mtp_corellia_times_contact_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_76"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("mtp_corellia_times_contact")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - if (branchId == 1 && mtp_corellia_times_contact_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && mtp_corellia_times_contact_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && mtp_corellia_times_contact_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && mtp_corellia_times_contact_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && mtp_corellia_times_contact_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && mtp_corellia_times_contact_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && mtp_corellia_times_contact_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && mtp_corellia_times_contact_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && mtp_corellia_times_contact_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && mtp_corellia_times_contact_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.mtp_corellia_times_contact.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/mtp_corsec_intelligence_officer.java b/sku.0/sys.server/compiled/game/script/conversation/mtp_corsec_intelligence_officer.java deleted file mode 100644 index 5958e5f4e..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/mtp_corsec_intelligence_officer.java +++ /dev/null @@ -1,757 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.utils; - - -public class mtp_corsec_intelligence_officer extends script.base_script -{ - public mtp_corsec_intelligence_officer() - { - } - String c_stringFile = "conversation/mtp_corsec_intelligence_officer"; - - - public boolean mtp_corsec_intelligence_officer_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public int mtp_corsec_intelligence_officer_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_4")) - { - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_5"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_6"); - } - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corsec_intelligence_officer_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_6")) - { - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_8"); - } - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corsec_intelligence_officer_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_8")) - { - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_9"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_10"); - } - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corsec_intelligence_officer_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_10")) - { - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_11"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corsec_intelligence_officer_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_13"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corsec_intelligence_officer_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_15"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corsec_intelligence_officer_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_17"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_19"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_22"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corsec_intelligence_officer_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corsec_intelligence_officer_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_26")) - { - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_corsec_intelligence_officer_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_28")) - { - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.mtp_corsec_intelligence_officer"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.mtp_corsec_intelligence_officer"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_3"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_corsec_intelligence_officer_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_4"); - } - - utils.setScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId", 1); - - npcStartConversation (player, npc, "mtp_corsec_intelligence_officer", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("mtp_corsec_intelligence_officer")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - if (branchId == 1 && mtp_corsec_intelligence_officer_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && mtp_corsec_intelligence_officer_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && mtp_corsec_intelligence_officer_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && mtp_corsec_intelligence_officer_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && mtp_corsec_intelligence_officer_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && mtp_corsec_intelligence_officer_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && mtp_corsec_intelligence_officer_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && mtp_corsec_intelligence_officer_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && mtp_corsec_intelligence_officer_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && mtp_corsec_intelligence_officer_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.mtp_corsec_intelligence_officer.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_bomb_tech.java b/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_bomb_tech.java deleted file mode 100644 index 758012e91..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_bomb_tech.java +++ /dev/null @@ -1,180 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.utils; - - -public class mtp_hideout_bomb_tech extends script.base_script -{ - public mtp_hideout_bomb_tech() - { - } - String c_stringFile = "conversation/mtp_hideout_bomb_tech"; - - - public boolean mtp_hideout_bomb_tech_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public int mtp_hideout_bomb_tech_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_6")) - { - - if (mtp_hideout_bomb_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_8"); - utils.removeScriptVar (player, "conversation.mtp_hideout_bomb_tech.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.mtp_hideout_bomb_tech"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.mtp_hideout_bomb_tech"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (mtp_hideout_bomb_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_bomb_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_6"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_bomb_tech.branchId", 1); - - npcStartConversation (player, npc, "mtp_hideout_bomb_tech", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("mtp_hideout_bomb_tech")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.mtp_hideout_bomb_tech.branchId"); - - if (branchId == 1 && mtp_hideout_bomb_tech_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.mtp_hideout_bomb_tech.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_food_supply_tech.java b/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_food_supply_tech.java deleted file mode 100644 index 0592c2439..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_food_supply_tech.java +++ /dev/null @@ -1,180 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.utils; - - -public class mtp_hideout_food_supply_tech extends script.base_script -{ - public mtp_hideout_food_supply_tech() - { - } - String c_stringFile = "conversation/mtp_hideout_food_supply_tech"; - - - public boolean mtp_hideout_food_supply_tech_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public int mtp_hideout_food_supply_tech_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_6")) - { - - if (mtp_hideout_food_supply_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_8"); - utils.removeScriptVar (player, "conversation.mtp_hideout_food_supply_tech.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.mtp_hideout_food_supply_tech"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.mtp_hideout_food_supply_tech"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (mtp_hideout_food_supply_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_food_supply_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_6"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_food_supply_tech.branchId", 1); - - npcStartConversation (player, npc, "mtp_hideout_food_supply_tech", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("mtp_hideout_food_supply_tech")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.mtp_hideout_food_supply_tech.branchId"); - - if (branchId == 1 && mtp_hideout_food_supply_tech_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.mtp_hideout_food_supply_tech.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_map_tech.java b/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_map_tech.java deleted file mode 100644 index 1e1f6f7ed..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_map_tech.java +++ /dev/null @@ -1,180 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.utils; - - -public class mtp_hideout_map_tech extends script.base_script -{ - public mtp_hideout_map_tech() - { - } - String c_stringFile = "conversation/mtp_hideout_map_tech"; - - - public boolean mtp_hideout_map_tech_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public int mtp_hideout_map_tech_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_4")) - { - - if (mtp_hideout_map_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_5"); - utils.removeScriptVar (player, "conversation.mtp_hideout_map_tech.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.mtp_hideout_map_tech"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.mtp_hideout_map_tech"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (mtp_hideout_map_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_3"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_map_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_4"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_map_tech.branchId", 1); - - npcStartConversation (player, npc, "mtp_hideout_map_tech", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("mtp_hideout_map_tech")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.mtp_hideout_map_tech.branchId"); - - if (branchId == 1 && mtp_hideout_map_tech_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.mtp_hideout_map_tech.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_safe_tech.java b/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_safe_tech.java deleted file mode 100644 index b1751c229..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_safe_tech.java +++ /dev/null @@ -1,725 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class mtp_hideout_safe_tech extends script.base_script -{ - public mtp_hideout_safe_tech() - { - } - String c_stringFile = "conversation/mtp_hideout_safe_tech"; - - - public boolean mtp_hideout_safe_tech_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean mtp_hideout_safe_tech_condition_isEligible(obj_id player, obj_id npc) throws InterruptedException - { - return ( (!groundquests.isQuestActiveOrComplete(player, "quest/mtp_find_infiltrator_1")) && (!groundquests.isQuestActiveOrComplete(player, "quest/mtp_find_infiltrator_2")) && (!groundquests.isQuestActiveOrComplete(player, "quest/mtp_find_infiltrator_3")) && (!groundquests.isQuestActiveOrComplete(player, "quest/mtp_find_infiltrator_4")) && (!groundquests.isQuestActiveOrComplete(player, "quest/mtp_find_infiltrator_5")) ); - } - - - public boolean mtp_hideout_safe_tech_condition_hasCompleted(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "quest/mtp_find_infiltrator_1") || groundquests.hasCompletedQuest(player, "quest/mtp_find_infiltrator_2") || groundquests.hasCompletedQuest(player, "quest/mtp_find_infiltrator_3") || groundquests.hasCompletedQuest(player, "quest/mtp_find_infiltrator_4") || groundquests.hasCompletedQuest(player, "quest/mtp_find_infiltrator_5") ); - } - - - public boolean mtp_hideout_safe_tech_condition_isActive(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isQuestActive(player, "quest/mtp_find_infiltrator_1") || groundquests.isQuestActive(player, "quest/mtp_find_infiltrator_2") || groundquests.isQuestActive(player, "quest/mtp_find_infiltrator_3") || groundquests.isQuestActive(player, "quest/mtp_find_infiltrator_4") || groundquests.isQuestActive(player, "quest/mtp_find_infiltrator_5") ); - } - - - public boolean mtp_hideout_safe_tech_condition_isReturningSuccess(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isTaskActive(player, "quest/mtp_find_infiltrator_1", "returnToLocksmith")) || (groundquests.isTaskActive(player, "quest/mtp_find_infiltrator_2", "returnToLocksmith")) || (groundquests.isTaskActive(player, "quest/mtp_find_infiltrator_3", "returnToLocksmith")) || (groundquests.isTaskActive(player, "quest/mtp_find_infiltrator_4", "returnToLocksmith")) || (groundquests.isTaskActive(player, "quest/mtp_find_infiltrator_5", "returnToLocksmith")); - } - - - public void mtp_hideout_safe_tech_action_giveQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "quest/mtp_find_infiltrator_"+rand(1,5)); - } - - - public void mtp_hideout_safe_tech_action_completeTask(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "returnedToMeatlumpLocksmith"); - } - - - public void mtp_hideout_safe_tech_action_giveLocations(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "quest/mtp_camp_quest_rori_talus"); - } - - - public int mtp_hideout_safe_tech_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_6")) - { - - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_8"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_10"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_hideout_safe_tech_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_10")) - { - - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_hideout_safe_tech_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_16"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_18"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_hideout_safe_tech_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_18")) - { - - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_hideout_safe_tech_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_hideout_safe_tech_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_26")) - { - - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - mtp_hideout_safe_tech_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_hideout_safe_tech_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - mtp_hideout_safe_tech_action_completeTask (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_hideout_safe_tech_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_40"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int mtp_hideout_safe_tech_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_40")) - { - - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - mtp_hideout_safe_tech_action_giveLocations (player, npc); - - string_id message = new string_id (c_stringFile, "s_41"); - utils.removeScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.mtp_hideout_safe_tech"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.mtp_hideout_safe_tech"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (mtp_hideout_safe_tech_condition_isEligible (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_6"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId", 1); - - npcStartConversation (player, npc, "mtp_hideout_safe_tech", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mtp_hideout_safe_tech_condition_isReturningSuccess (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId", 8); - - npcStartConversation (player, npc, "mtp_hideout_safe_tech", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (mtp_hideout_safe_tech_condition_isActive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_30"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (mtp_hideout_safe_tech_condition_hasCompleted (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (mtp_hideout_safe_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_34"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("mtp_hideout_safe_tech")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - if (branchId == 1 && mtp_hideout_safe_tech_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && mtp_hideout_safe_tech_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && mtp_hideout_safe_tech_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && mtp_hideout_safe_tech_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && mtp_hideout_safe_tech_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && mtp_hideout_safe_tech_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && mtp_hideout_safe_tech_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && mtp_hideout_safe_tech_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && mtp_hideout_safe_tech_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.mtp_hideout_safe_tech.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_weapon_supply_tech.java b/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_weapon_supply_tech.java deleted file mode 100644 index fc8ecd30c..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/mtp_hideout_weapon_supply_tech.java +++ /dev/null @@ -1,180 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.utils; - - -public class mtp_hideout_weapon_supply_tech extends script.base_script -{ - public mtp_hideout_weapon_supply_tech() - { - } - String c_stringFile = "conversation/mtp_hideout_weapon_supply_tech"; - - - public boolean mtp_hideout_weapon_supply_tech_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public int mtp_hideout_weapon_supply_tech_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_6")) - { - - if (mtp_hideout_weapon_supply_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_8"); - utils.removeScriptVar (player, "conversation.mtp_hideout_weapon_supply_tech.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.mtp_hideout_weapon_supply_tech"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.mtp_hideout_weapon_supply_tech"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (mtp_hideout_weapon_supply_tech_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (mtp_hideout_weapon_supply_tech_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_6"); - } - - utils.setScriptVar (player, "conversation.mtp_hideout_weapon_supply_tech.branchId", 1); - - npcStartConversation (player, npc, "mtp_hideout_weapon_supply_tech", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("mtp_hideout_weapon_supply_tech")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.mtp_hideout_weapon_supply_tech.branchId"); - - if (branchId == 1 && mtp_hideout_weapon_supply_tech_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.mtp_hideout_weapon_supply_tech.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/novicecollector.java b/sku.0/sys.server/compiled/game/script/conversation/novicecollector.java deleted file mode 100644 index 84e989c7c..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/novicecollector.java +++ /dev/null @@ -1,752 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.groundquests; -import script.library.utils; - - -public class novicecollector extends script.base_script -{ - public novicecollector() - { - } - String c_stringFile = "conversation/novicecollector"; - - - public boolean novicecollector_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean novicecollector_condition_hasPublishGiftToken(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "chapter7_publish_gift_activation"); - - } - - - public boolean novicecollector_condition_hasFoundClickCollection(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "chapter7_beginning_click_collection", "publishClickCollectionReturnToCollectionNPC"); - } - - - public boolean novicecollector_condition_hasCompletedClickCollection(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "chapter7_beginning_click_collection"); - } - - - public boolean novicecollector_condition_hasFoundInventoryCollection(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isTaskActive(player, "chapter7_beginning_inventory_collection_01", "returnToCollectorInventoryCollectionComplete")) - { - return true; - } - else if (groundquests.isTaskActive(player, "chapter7_beginning_inventory_collection_02", "returnToCollectorInventoryCollectionComplete")) - { - return true; - } - else if (groundquests.isTaskActive(player, "chapter7_beginning_inventory_collection_03", "returnToCollectorInventoryCollectionComplete")) - { - return true; - } - else if (groundquests.isTaskActive(player, "chapter7_beginning_inventory_collection_04", "returnToCollectorInventoryCollectionComplete")) - { - return true; - } - return false; - } - - - public boolean novicecollector_condition_hasCompletedClickInventoryCollection(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.hasCompletedQuest(player, "chapter7_beginning_click_collection") && groundquests.hasCompletedQuest(player, "chapter7_beginning_inventory_collection_01")) - { - return true; - } - else if (groundquests.hasCompletedQuest(player, "chapter7_beginning_click_collection") && groundquests.hasCompletedQuest(player, "chapter7_beginning_inventory_collection_02")) - { - return true; - } - else if (groundquests.hasCompletedQuest(player, "chapter7_beginning_click_collection") && groundquests.hasCompletedQuest(player, "chapter7_beginning_inventory_collection_03")) - { - return true; - } - else if (groundquests.hasCompletedQuest(player, "chapter7_beginning_click_collection") && groundquests.hasCompletedQuest(player, "chapter7_beginning_inventory_collection_04")) - { - return true; - } - return false; - } - - - public boolean novicecollector_condition_hasFulfilledCounterQuota(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "chapter7_beginning_counter_collection", "publishCounterReturn"); - } - - - public boolean novicecollector_condition_allCollectionsComplete(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "chapter7_beginning_counter_collection"); - } - - - public boolean novicecollector_condition_clickCollectionActive(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "chapter7_beginning_click_collection"); - } - - - public boolean novicecollector_condition_inventoryCollectionActive(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, "chapter7_beginning_inventory_collection_01") || groundquests.isQuestActive(player, "chapter7_beginning_inventory_collection_02") || groundquests.isQuestActive(player, "chapter7_beginning_inventory_collection_03") || groundquests.isQuestActive(player, "chapter7_beginning_inventory_collection_04")) - { - return true; - } - - return false; - } - - - public boolean novicecollector_condition_counterCollectionActive(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isQuestActive(player, "chapter7_beginning_counter_collection")); - } - - - public void novicecollector_action_grantCollectionQuest(obj_id player, obj_id npc) throws InterruptedException - { - - groundquests.sendSignal(player, "publishClickCollectionActivation"); - - modifyCollectionSlotValue(player, "publish_chapter7_click_activation_03", 1); - - groundquests.grantQuest(player, "chapter7_beginning_click_collection"); - } - - - public void novicecollector_action_completeClickCollection(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "publishClickCollectionReturnToCollectionNPC"); - } - - - public void novicecollector_action_grantInventoryQuest(obj_id player, obj_id npc) throws InterruptedException - { - - modifyCollectionSlotValue(player, "publish_chapter7_activation_02", 1); - int number = rand(1,4); - groundquests.grantQuest(player, "chapter7_beginning_inventory_collection_0"+number); - } - - - public void novicecollector_action_completeInventoryCollection(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "returnToCollectorInventoryCollectionComplete"); - } - - - public void novicecollector_action_grantCounterQuest(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "kill_tusken_activate", 1); - groundquests.grantQuest(player, "chapter7_beginning_counter_collection"); - } - - - public void novicecollector_action_completeCounterCollection(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, "kill_tusken_complete", 1); - groundquests.sendSignal(player, "publishCounterReturn"); - } - - - public void novicecollector_action_sendActivationSignal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "publishClickCollectionActivation"); - } - - - public int novicecollector_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_53")) - { - - if (novicecollector_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_54"); - utils.removeScriptVar (player, "conversation.novicecollector.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int novicecollector_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_26")) - { - - if (novicecollector_condition__defaultCondition (player, npc)) - { - novicecollector_action_grantCounterQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.novicecollector.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_34")) - { - - if (novicecollector_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - utils.removeScriptVar (player, "conversation.novicecollector.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int novicecollector_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_18")) - { - - if (novicecollector_condition__defaultCondition (player, npc)) - { - novicecollector_action_grantInventoryQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_20"); - utils.removeScriptVar (player, "conversation.novicecollector.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_32")) - { - - if (novicecollector_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_33"); - utils.removeScriptVar (player, "conversation.novicecollector.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int novicecollector_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_31")) - { - - if (novicecollector_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (novicecollector_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (novicecollector_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - utils.setScriptVar (player, "conversation.novicecollector.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.novicecollector.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int novicecollector_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_41")) - { - - if (novicecollector_condition__defaultCondition (player, npc)) - { - novicecollector_action_grantCollectionQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_43"); - utils.removeScriptVar (player, "conversation.novicecollector.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_46")) - { - - if (novicecollector_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_48"); - utils.removeScriptVar (player, "conversation.novicecollector.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.novicecollector"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.novicecollector"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (novicecollector_condition_allCollectionsComplete (player, npc)) - { - doAnimationAction (npc, "goodbye"); - - string_id message = new string_id (c_stringFile, "s_37"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (novicecollector_condition_hasFulfilledCounterQuota (player, npc)) - { - doAnimationAction (npc, "applause_polite"); - - doAnimationAction (player, "bow"); - - novicecollector_action_completeCounterCollection (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (novicecollector_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_53"); - } - - utils.setScriptVar (player, "conversation.novicecollector.branchId", 2); - - npcStartConversation (player, npc, "novicecollector", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (novicecollector_condition_counterCollectionActive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_51"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (novicecollector_condition_hasCompletedClickInventoryCollection (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (novicecollector_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (novicecollector_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - utils.setScriptVar (player, "conversation.novicecollector.branchId", 5); - - npcStartConversation (player, npc, "novicecollector", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (novicecollector_condition_hasFoundInventoryCollection (player, npc)) - { - doAnimationAction (npc, "thumbs_up"); - - novicecollector_action_completeInventoryCollection (player, npc); - - string_id message = new string_id (c_stringFile, "s_23"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (novicecollector_condition_inventoryCollectionActive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (novicecollector_condition_hasCompletedClickCollection (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_16"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (novicecollector_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (novicecollector_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_18"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - utils.setScriptVar (player, "conversation.novicecollector.branchId", 10); - - npcStartConversation (player, npc, "novicecollector", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (novicecollector_condition_hasFoundClickCollection (player, npc)) - { - doAnimationAction (npc, "thumb_up"); - - novicecollector_action_completeClickCollection (player, npc); - - string_id message = new string_id (c_stringFile, "s_22"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (novicecollector_condition_clickCollectionActive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_49"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (novicecollector_condition_hasPublishGiftToken (player, npc)) - { - doAnimationAction (npc, "curtsey"); - - string_id message = new string_id (c_stringFile, "s_29"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (novicecollector_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_31"); - } - - utils.setScriptVar (player, "conversation.novicecollector.branchId", 15); - - npcStartConversation (player, npc, "novicecollector", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (novicecollector_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_52"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("novicecollector")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.novicecollector.branchId"); - - if (branchId == 2 && novicecollector_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && novicecollector_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && novicecollector_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && novicecollector_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && novicecollector_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.novicecollector.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/nym.java b/sku.0/sys.server/compiled/game/script/conversation/nym.java deleted file mode 100644 index 82a781f41..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/nym.java +++ /dev/null @@ -1,2081 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class nym extends script.base_script -{ - public nym() - { - } - String c_stringFile = "conversation/nym"; - - - public boolean nym_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean nym_condition_hasCompletedFacility(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_kole_to_nym") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_nym_arena"); - } - - - public boolean nym_condition_hasNotCompletedArena(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "u16_nym_themepark_nym_arena"); - } - - - public boolean nym_condition_hasCompletedArenaTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasCompletedArenaForNym"); - } - - - public boolean nym_condition_isReadyForQuestAfterArena(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_nym_arena"); - } - - - public boolean nym_condition_hasCompletedShuttleTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_shuttle_ambush", "hasCompletedShuttleForNym"); - } - - - public boolean nym_condition_isReadyForFinale(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_negotiate_peace"); - } - - - public boolean nym_condition_hasFinishedTownsPeople(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_return_townsperson", "nymTownpersonDone"); - } - - - public boolean nym_condition_isReadyPeaceMission(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "u16_nym_return_townsperson") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_negotiate_peace"); - } - - - public boolean nym_condition_hasCompletedPeaceMission(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_negotiate_peace", "returnToNymSheeli"); - } - - - public boolean nym_condition_isDoneThemePark(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_shuttle_ambush"); - } - - - public boolean nym_condition_hasPeaceMission(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "u16_nym_themepark_negotiate_peace"); - } - - - public boolean nym_condition_hasShuttleQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "u16_nym_themepark_shuttle_ambush"); - } - - - public void nym_action_grantArenaQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_nym_arena")) - { - groundquests.grantQuest(player, "u16_nym_themepark_nym_arena"); - } - } - - - public void nym_action_completeArenaQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasCompletedArenaForNym")) - { - groundquests.sendSignal(player, "nymAwardedArenaCompletion"); - } - if (!hasCompletedCollectionSlot(player, "bdge_nmys_arena_champion_badge")) - { - modifyCollectionSlotValue(player, "bdge_nmys_arena_champion_badge", 1); - } - if (!hasCompletedCollectionSlot(player, "icon_arena_badge_received")) - { - modifyCollectionSlotValue(player, "icon_arena_badge_received", 1); - } - } - - - public void nym_action_grantShuttleQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_shuttle_ambush")) - { - groundquests.grantQuest(player, "u16_nym_themepark_shuttle_ambush"); - } - } - - - public void nym_action_completeShuttleQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isTaskActive(player, "u16_nym_themepark_shuttle_ambush", "hasCompletedShuttleForNym")) - { - groundquests.sendSignal(player, "nymAwardedShuttleCompletion"); - } - if (!hasCompletedCollectionSlot(player, "bdge_nmys_emissary_badge")) - { - modifyCollectionSlotValue(player, "bdge_nmys_emissary_badge", 1); - } - if (!hasCompletedCollectionSlot(player, "icon_emissary_badge_received")) - { - modifyCollectionSlotValue(player, "icon_emissary_badge_received", 1); - } - } - - - public void nym_action_hasFoundNym(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundNym"); - } - - - public void nym_action_grantTownspersonQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActiveOrComplete(player, "u16_nym_meet_townspeople")) - { - groundquests.grantQuest(player, "u16_nym_meet_townspeople"); - } - } - - - public void nym_action_finishTownsPeople(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedTownPersonQuest"); - } - - - public void nym_action_givePeaceMission(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_negotiate_peace")) - { - groundquests.grantQuest(player, "u16_nym_themepark_negotiate_peace"); - } - } - - - public void nym_action_finishPeaceMission(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasReturnedToNymSheeli"); - } - - - public void nym_action_validateAllNymRewards(obj_id player, obj_id npc) throws InterruptedException - { - nym_action_completeArenaQuest(player, npc); - nym_action_completeShuttleQuest(player, npc); - } - - - public int nym_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - doAnimationAction (player, "salute1"); - - nym_action_completeShuttleQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_39"); - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_25")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_27")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_29"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_29")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - nym_action_grantShuttleQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.nym.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_87")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - nym_action_finishPeaceMission (player, npc); - - string_id message = new string_id (c_stringFile, "s_102"); - utils.removeScriptVar (player, "conversation.nym.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_89")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_104"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_104")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_105"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_106"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_106")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_107"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_108"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_108")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_109"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 17); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_110")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_111"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_112")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - nym_action_givePeaceMission (player, npc); - - string_id message = new string_id (c_stringFile, "s_113"); - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_83")) - { - doAnimationAction (player, "hold_nose"); - - if (nym_condition__defaultCondition (player, npc)) - { - nym_action_finishTownsPeople (player, npc); - - string_id message = new string_id (c_stringFile, "s_84"); - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_50")) - { - doAnimationAction (player, "shrug_hands"); - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_52"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_56")) - { - doAnimationAction (player, "flex_biceps"); - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_54")) - { - doAnimationAction (player, "fakepunch"); - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_60")) - { - doAnimationAction (player, "point_to_self"); - - if (nym_condition__defaultCondition (player, npc)) - { - doAnimationAction (player, "nod"); - - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_66")) - { - doAnimationAction (player, "shrug_hands"); - - if (nym_condition__defaultCondition (player, npc)) - { - doAnimationAction (player, "nod"); - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_68")) - { - doAnimationAction (player, "point_to_self"); - - if (nym_condition__defaultCondition (player, npc)) - { - nym_action_grantTownspersonQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_70"); - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_78")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_80"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_91"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_93")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_95"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_91")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_95"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_97")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_122")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_124"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_114")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_118")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - nym_action_grantArenaQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_120"); - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_126")) - { - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.nym"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.nym"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (nym_condition_isDoneThemePark (player, npc)) - { - nym_action_validateAllNymRewards (player, npc); - - string_id message = new string_id (c_stringFile, "s_103"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (nym_condition_hasCompletedShuttleTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 2); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (nym_condition_hasShuttleQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (nym_condition_isReadyForFinale (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_25"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 5); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (nym_condition_hasCompletedPeaceMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_85"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_87"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 9); - - npcStartConversation (player, npc, "nym", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_condition_hasPeaceMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (nym_condition_isReadyPeaceMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_86"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 13); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (nym_condition_hasFinishedTownsPeople (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_82"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 20); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (nym_condition_isReadyForQuestAfterArena (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_48"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_50"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_56"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 22); - - npcStartConversation (player, npc, "nym", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_condition_hasCompletedArenaTask (player, npc)) - { - nym_action_completeArenaQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_72"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (nym_condition_hasNotCompletedArena (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (nym_condition_hasCompletedFacility (player, npc)) - { - nym_action_hasFoundNym (player, npc); - - string_id message = new string_id (c_stringFile, "s_76"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (nym_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_78"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - utils.setScriptVar (player, "conversation.nym.branchId", 30); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (nym_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_130"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("nym")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.nym.branchId"); - - if (branchId == 2 && nym_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && nym_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && nym_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && nym_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && nym_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && nym_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && nym_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && nym_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && nym_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && nym_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && nym_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && nym_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && nym_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && nym_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && nym_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && nym_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && nym_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && nym_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && nym_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && nym_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && nym_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && nym_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && nym_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && nym_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.nym.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/nym_arena_referee.java b/sku.0/sys.server/compiled/game/script/conversation/nym_arena_referee.java deleted file mode 100644 index 2dd1b75eb..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/nym_arena_referee.java +++ /dev/null @@ -1,603 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class nym_arena_referee extends script.base_script -{ - public nym_arena_referee() - { - } - String c_stringFile = "conversation/nym_arena_referee"; - - - public boolean nym_arena_referee_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean nym_arena_referee_condition_hasFirstArenaTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasFirstArenaFight"); - } - - - public boolean nym_arena_referee_condition_hasSecondArenaTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasSecondArenaFight"); - } - - - public boolean nym_arena_referee_condition_hasThirdArenaTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasThirdArenaFight"); - } - - - public boolean nym_arena_referee_condition_hasFourthArenaTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasFourthArenaFight"); - } - - - public boolean nym_arena_referee_condition_hasFifthAreanaTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasFifthArenaFight"); - } - - - public boolean nym_arena_referee_condition_hasCompletedArenaTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_nym_arena", "hasCompletedArenaForNym") || groundquests.hasCompletedQuest(player, "u16_nym_themepark_nym_arena"); - } - - - public boolean nym_arena_referee_condition_wave_event_active(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; - } - - - public void nym_arena_referee_action_spawnOpponent(obj_id player, obj_id npc) throws InterruptedException - { - dictionary webster = new dictionary(); - webster.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", webster, 0, false); - } - - - public int nym_arena_referee_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_34")) - { - - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute2"); - - nym_arena_referee_action_spawnOpponent (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_arena_referee_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_32")) - { - - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "clap_rousing"); - - nym_arena_referee_action_spawnOpponent (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_arena_referee_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_30")) - { - - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "bow3"); - - nym_arena_referee_action_spawnOpponent (player, npc); - - string_id message = new string_id (c_stringFile, "s_31"); - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_arena_referee_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_28")) - { - - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "applause_polite"); - - nym_arena_referee_action_spawnOpponent (player, npc); - - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_arena_referee_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "celebrate1"); - - nym_arena_referee_action_spawnOpponent (player, npc); - - string_id message = new string_id (c_stringFile, "s_23"); - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.nym_arena_referee"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.nym_arena_referee"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (nym_arena_referee_condition_wave_event_active (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_20"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (nym_arena_referee_condition_hasCompletedArenaTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (nym_arena_referee_condition_hasFifthAreanaTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 3); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym_arena_referee", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (nym_arena_referee_condition_hasFourthArenaTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 5); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym_arena_referee", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (nym_arena_referee_condition_hasThirdArenaTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym_arena_referee", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (nym_arena_referee_condition_hasSecondArenaTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 9); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym_arena_referee", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (nym_arena_referee_condition_hasFirstArenaTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - utils.setScriptVar (player, "conversation.nym_arena_referee.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "nym_arena_referee", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (nym_arena_referee_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_100"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("nym_arena_referee")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.nym_arena_referee.branchId"); - - if (branchId == 3 && nym_arena_referee_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && nym_arena_referee_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && nym_arena_referee_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && nym_arena_referee_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && nym_arena_referee_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.nym_arena_referee.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/nym_themepark_quatermaster.java b/sku.0/sys.server/compiled/game/script/conversation/nym_themepark_quatermaster.java deleted file mode 100644 index b80f47b7f..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/nym_themepark_quatermaster.java +++ /dev/null @@ -1,1269 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class nym_themepark_quatermaster extends script.base_script -{ - public nym_themepark_quatermaster() - { - } - String c_stringFile = "conversation/nym_themepark_quatermaster"; - - - public boolean nym_themepark_quatermaster_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean nym_themepark_quatermaster_condition_isOnFirstQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_1", "findQuartermaster") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_1") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_smuggler_01")); - } - - - public boolean nym_themepark_quatermaster_condition_isOnSecondQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_2", "goQuartermaster") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_2") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_under_pressure")); - } - - - public boolean nym_themepark_quatermaster_condition_isOnThridQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_3", "goQuartermasterAgain") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_3") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_save_agent")); - } - - - public boolean nym_themepark_quatermaster_condition_isAlmostDone(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_safe", "backQuartermaster") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_safe") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_repair_flocculation_chamber")); - } - - - public boolean nym_themepark_quatermaster_condition_hasFailedDelivery(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_save_agent_fail", "returnRaliaFail"); - } - - - public boolean nym_themepark_quatermaster_condition_hasSmugglerQuestNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_smuggler_01"); - } - - - public boolean nym_themepark_quatermaster_condition_hasAgentQuestNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_save_agent"); - } - - - public boolean nym_themepark_quatermaster_condition_hasPressureQuestNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_under_pressure"); - } - - - public void nym_themepark_quatermaster_action_signalFirstJumperQuestDone(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundQuartermaster"); - } - - - public void nym_themepark_quatermaster_action_signalSecondJumperQuestDone(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasGoneQuartermaster"); - } - - - public void nym_themepark_quatermaster_action_signalAgentSafe(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasGoneBackQuartermaster"); - } - - - public void nym_themepark_quatermaster_action_grantSmugglerQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_smuggler_01"); - } - - - public void nym_themepark_quatermaster_action_grantAgentQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_save_agent"); - } - - - public void nym_themepark_quatermaster_action_grantPressureQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_under_pressure"); - } - - - public void nym_themepark_quatermaster_action_sendPlayerToFixChamber(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_repair_flocculation_chamber"); - } - - - public void nym_themepark_quatermaster_action_clearDeliveryFailQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.clearQuest(player, "u16_nym_themepark_save_agent_fail"); - groundquests.clearQuest(player, "u16_nym_themepark_save_agent"); - nym_themepark_quatermaster_action_grantAgentQuest(player, npc); - } - - - public void nym_themepark_quatermaster_action_signalThirdJumperQuestDone(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasGoneQuartermasterAgain"); - } - - - public int nym_themepark_quatermaster_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_17")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thank"); - - nym_themepark_quatermaster_action_sendPlayerToFixChamber (player, npc); - - string_id message = new string_id (c_stringFile, "s_18"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_20")) - { - doAnimationAction (player, "shake_head_disgust"); - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_down"); - - nym_themepark_quatermaster_action_clearDeliveryFailQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_74")) - { - doAnimationAction (player, "taken_aback"); - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - string_id message = new string_id (c_stringFile, "s_75"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_15")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_finger_warning"); - - string_id message = new string_id (c_stringFile, "s_23"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_46")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_48"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_48")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_50"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_50")) - { - doAnimationAction (player, "taken_aback"); - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - nym_themepark_quatermaster_action_grantAgentQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_51"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - doAnimationAction (player, "shake_head_no"); - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "rub_chin_thoughtful"); - - string_id message = new string_id (c_stringFile, "s_38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_40"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_40")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_44"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_44")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_52"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_54")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - nym_themepark_quatermaster_action_grantPressureQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_56"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_68")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - string_id message = new string_id (c_stringFile, "s_69"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_63")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_76")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "rub_chin_thoughtful"); - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_80"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_quatermaster_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_80")) - { - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - nym_themepark_quatermaster_action_grantSmugglerQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_82"); - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.nym_themepark_quatermaster"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.nym_themepark_quatermaster"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (nym_themepark_quatermaster_condition_isAlmostDone (player, npc)) - { - doAnimationAction (npc, "celebrate"); - - nym_themepark_quatermaster_action_signalAgentSafe (player, npc); - - string_id message = new string_id (c_stringFile, "s_16"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_17"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 1); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_quatermaster_condition_hasFailedDelivery (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 3); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_quatermaster_condition_hasAgentQuestNotComplete (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 5); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_quatermaster_condition_isOnThridQuest (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - nym_themepark_quatermaster_action_signalThirdJumperQuestDone (player, npc); - - string_id message = new string_id (c_stringFile, "s_13"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_15"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 7); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_quatermaster_condition_hasPressureQuestNotComplete (player, npc)) - { - doAnimationAction (npc, "cover_mouth"); - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 12); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_quatermaster_condition_isOnSecondQuest (player, npc)) - { - nym_themepark_quatermaster_action_signalSecondJumperQuestDone (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 14); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_quatermaster_condition_hasSmugglerQuestNotComplete (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 19); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_quatermaster_condition_isOnFirstQuest (player, npc)) - { - doAnimationAction (npc, "tap_foot"); - - nym_themepark_quatermaster_action_signalFirstJumperQuestDone (player, npc); - - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_quatermaster.branchId", 21); - - npcStartConversation (player, npc, "nym_themepark_quatermaster", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_quatermaster_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - string_id message = new string_id (c_stringFile, "s_84"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("nym_themepark_quatermaster")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - if (branchId == 1 && nym_themepark_quatermaster_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && nym_themepark_quatermaster_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && nym_themepark_quatermaster_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && nym_themepark_quatermaster_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && nym_themepark_quatermaster_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && nym_themepark_quatermaster_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && nym_themepark_quatermaster_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && nym_themepark_quatermaster_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && nym_themepark_quatermaster_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && nym_themepark_quatermaster_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && nym_themepark_quatermaster_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && nym_themepark_quatermaster_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && nym_themepark_quatermaster_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && nym_themepark_quatermaster_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && nym_themepark_quatermaster_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && nym_themepark_quatermaster_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.nym_themepark_quatermaster.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/nym_themepark_smuggler.java b/sku.0/sys.server/compiled/game/script/conversation/nym_themepark_smuggler.java deleted file mode 100644 index ec6f83aac..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/nym_themepark_smuggler.java +++ /dev/null @@ -1,578 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class nym_themepark_smuggler extends script.base_script -{ - public nym_themepark_smuggler() - { - } - String c_stringFile = "conversation/nym_themepark_smuggler"; - - - public boolean nym_themepark_smuggler_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean nym_themepark_smuggler_condition_isReadyToGetChems(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_smuggler_01", "findSmuggler") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_smuggler_01") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_gather_chemicals")); - } - - - public boolean nym_themepark_smuggler_condition_hasChems(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_gather_chemicals", "goSeeSmuggler"); - } - - - public boolean nym_themepark_smuggler_condition_deletedFixQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_gather_chemicals") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_repair_mixing_chamber"); - } - - - public void nym_themepark_smuggler_action_giveChemQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_gather_chemicals"); - } - - - public void nym_themepark_smuggler_action_finishUpchem(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasSeenSmuggler"); - } - - - public void nym_themepark_smuggler_action_finishUpJumper(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundSmuggler"); - } - - - public void nym_themepark_smuggler_action_giveFixQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_repair_mixing_chamber"); - } - - - public int nym_themepark_smuggler_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_11")) - { - - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - nym_themepark_smuggler_action_giveFixQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_12"); - utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_smuggler_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_17"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_smuggler_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_17")) - { - - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_smuggler_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_20")) - { - - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_smuggler_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int nym_themepark_smuggler_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_28")) - { - - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - nym_themepark_smuggler_action_giveChemQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_32")) - { - - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_34"); - utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.nym_themepark_smuggler"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.nym_themepark_smuggler"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (nym_themepark_smuggler_condition_deletedFixQuest (player, npc)) - { - nym_themepark_smuggler_action_giveFixQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_smuggler_condition_hasChems (player, npc)) - { - nym_themepark_smuggler_action_finishUpchem (player, npc); - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_11"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 2); - - npcStartConversation (player, npc, "nym_themepark_smuggler", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_smuggler_condition_isReadyToGetChems (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - nym_themepark_smuggler_action_finishUpJumper (player, npc); - - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.nym_themepark_smuggler.branchId", 4); - - npcStartConversation (player, npc, "nym_themepark_smuggler", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (nym_themepark_smuggler_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_36"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("nym_themepark_smuggler")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.nym_themepark_smuggler.branchId"); - - if (branchId == 2 && nym_themepark_smuggler_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && nym_themepark_smuggler_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && nym_themepark_smuggler_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && nym_themepark_smuggler_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && nym_themepark_smuggler_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && nym_themepark_smuggler_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.nym_themepark_smuggler.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_erlem_math_delta.java b/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_erlem_math_delta.java deleted file mode 100644 index 979debe60..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_erlem_math_delta.java +++ /dev/null @@ -1,891 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class outbreak_defense_erlem_math_delta extends script.base_script -{ - public outbreak_defense_erlem_math_delta() - { - } - String c_stringFile = "conversation/outbreak_defense_erlem_math_delta"; - - - public boolean outbreak_defense_erlem_math_delta_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean outbreak_defense_erlem_math_delta_condition_hasCompletedDefenseQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "camp_delta_defense_01") || groundquests.hasCompletedQuest(player, "camp_delta_defense_02") || groundquests.hasCompletedQuest(player, "camp_delta_defense_03") || groundquests.hasCompletedQuest(player, "camp_delta_defense_04") && outbreak_defense_erlem_math_delta_condition_hasAvailableGuardPosts(player,npc)); - } - - - public boolean outbreak_defense_erlem_math_delta_condition_isWaitingForRewardSignal(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "camp_delta_defense_01", "collectRewardDelta") || groundquests.isTaskActive(player, "camp_delta_defense_02", "collectRewardDelta") || groundquests.isTaskActive(player, "camp_delta_defense_03", "collectRewardDelta") || groundquests.isTaskActive(player, "camp_delta_defense_04", "collectRewardDelta"); - } - - - public boolean outbreak_defense_erlem_math_delta_condition_hasNeverSpoken(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_delta") && !groundquests.isQuestActiveOrComplete(player, "camp_delta_defense_01") && !groundquests.isQuestActiveOrComplete(player, "camp_delta_defense_02") && !groundquests.isQuestActiveOrComplete(player, "camp_delta_defense_03") && !groundquests.isQuestActiveOrComplete(player, "camp_delta_defense_04") && outbreak_defense_erlem_math_delta_condition_hasAvailableGuardPosts(player,npc); - } - - - public boolean outbreak_defense_erlem_math_delta_condition_isGodPlayerTester(obj_id player, obj_id npc) throws InterruptedException - { - return isGod(player); - } - - - public boolean outbreak_defense_erlem_math_delta_condition_levelTooHigh(obj_id player, obj_id npc) throws InterruptedException - { - return getLevel(player) >= 80; - } - - - public boolean outbreak_defense_erlem_math_delta_condition_levelTooLow(obj_id player, obj_id npc) throws InterruptedException - { - return getLevel(player) < 60; - } - - - public boolean outbreak_defense_erlem_math_delta_condition_noAntiVirus(obj_id player, obj_id npc) throws InterruptedException - { - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); - } - - - public boolean outbreak_defense_erlem_math_delta_condition_hasDefenseQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isQuestActive(player, "camp_delta_defense_01") || groundquests.isQuestActive(player, "camp_delta_defense_02") || groundquests.isQuestActive(player, "camp_delta_defense_03") || groundquests.isQuestActive(player, "camp_delta_defense_04")) ; - } - - - public boolean outbreak_defense_erlem_math_delta_condition_hasAvailableGuardPosts(obj_id player, obj_id npc) throws InterruptedException - { - - if (!utils.hasScriptVar(npc, "guardPostList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.hasAvailableGuardPosts() the npc, "+npc+" has no guardPostList script var."); - return false; - } - obj_id[] guardPostList = utils.getObjIdArrayScriptVar(npc, "guardPostList"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.hasAvailableGuardPosts() the npc, "+npc+" has an invalid guardPostList script var."); - return false; - } - - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - if (!isValidId(guardPostList[i]) || !exists(guardPostList[i])) - { - continue; - } - if (!utils.hasScriptVar(guardPostList[i], "occupied")) - { - return true; - } - } - - return false; - } - - - public void outbreak_defense_erlem_math_delta_action_giveQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.hasCompletedQuest(player, "camp_delta_defense_01")) - { - groundquests.clearQuest(player, "camp_delta_defense_01"); - } - if (groundquests.hasCompletedQuest(player, "camp_delta_defense_02")) - { - groundquests.clearQuest(player, "camp_delta_defense_02"); - } - if (groundquests.hasCompletedQuest(player, "camp_delta_defense_03")) - { - groundquests.clearQuest(player, "camp_delta_defense_03"); - } - if (groundquests.hasCompletedQuest(player, "camp_delta_defense_04")) - { - groundquests.clearQuest(player, "camp_delta_defense_04"); - } - - if (!utils.hasScriptVar(npc, "guardPostList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has no guardPostList script var."); - } - else - { - obj_id[] guardPostList = utils.getObjIdArrayScriptVar(npc, "guardPostList"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has an invalid guardPostList script var."); - } - else - { - - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - if (!isValidId(guardPostList[i]) || !exists(guardPostList[i])) - { - continue; - } - if (!utils.hasScriptVar(guardPostList[i], "occupied")) - { - String questName = getStringObjVar(guardPostList[i], "questObject"); - if (questName == null || questName.length() <=0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has an invalid guardPostList script var."); - } - else - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" is granting the player: "+player+" has an invalid guardPostList script var."); - groundquests.grantQuest(player, questName); - } - } - } - } - } - } - - - public void outbreak_defense_erlem_math_delta_action_sendQuestSignal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedDelta"); - - } - - - public void outbreak_defense_erlem_math_delta_action_action0001(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_delta_defense_01"); - } - - - public void outbreak_defense_erlem_math_delta_action_action0002(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_delta_defense_02"); - } - - - public void outbreak_defense_erlem_math_delta_action_action0003(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_delta_defense_03"); - } - - - public void outbreak_defense_erlem_math_delta_action_action0004(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_delta_defense_04"); - } - - - public int outbreak_defense_erlem_math_delta_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_45")) - { - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_46"); - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_erlem_math_delta_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - outbreak_defense_erlem_math_delta_action_action0001 (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_23")) - { - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - outbreak_defense_erlem_math_delta_action_action0002 (player, npc); - - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_26")) - { - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - outbreak_defense_erlem_math_delta_action_action0003 (player, npc); - - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_27")) - { - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - outbreak_defense_erlem_math_delta_action_action0004 (player, npc); - - string_id message = new string_id (c_stringFile, "s_31"); - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_erlem_math_delta_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_62")) - { - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_63"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_erlem_math_delta_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_59")) - { - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - outbreak_defense_erlem_math_delta_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_61"); - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_erlem_math_delta_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_erlem_math_delta_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_53"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_erlem_math_delta_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_53")) - { - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - outbreak_defense_erlem_math_delta_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_77"); - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - messageTo(self, "findGuardPosts", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - messageTo(self, "findGuardPosts", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int findGuardPosts(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] guardPostList = getAllObjectsWithObjVar(getLocation(self), 200, "questObject"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" failed to find any valid guard post objects within 100 of "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - Vector guardPostsFound = null; - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - String spawnerQuestNameMatch = getStringObjVar(guardPostList[i], "questObject"); - if (spawnerQuestNameMatch == null || spawnerQuestNameMatch.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found a guard post object that did not have a quest string. Guard Post: "+guardPostList[i]); - continue; - } - if (!spawnerQuestNameMatch.startsWith("camp_delta_defense")) - { - continue; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found a guard post object. Adding the object to the list. Guard Post: "+guardPostList[i]); - utils.addElement(guardPostsFound, guardPostList[i]); - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" loop for all the available guard posts has finished. Length of list: "+guardPostList.length); - if (guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" had a problem finding guard posts."); - return SCRIPT_CONTINUE; - } - if (guardPostList.length != 4) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found less or greater than 4 guard posts!"); - } - - utils.setScriptVar(self, "guardPostList", guardPostList); - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" has a list of guard posts as scriptvar."); - return SCRIPT_CONTINUE; - - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (outbreak_defense_erlem_math_delta_condition_noAntiVirus (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_69"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_erlem_math_delta_condition_levelTooLow (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_45"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId", 2); - - npcStartConversation (player, npc, "outbreak_defense_erlem_math_delta", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_erlem_math_delta_condition_isWaitingForRewardSignal (player, npc)) - { - outbreak_defense_erlem_math_delta_action_sendQuestSignal (player, npc); - - string_id message = new string_id (c_stringFile, "s_64"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_erlem_math_delta_condition_isGodPlayerTester (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_23"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId", 5); - - npcStartConversation (player, npc, "outbreak_defense_erlem_math_delta", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_erlem_math_delta_condition_hasCompletedDefenseQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_62"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId", 10); - - npcStartConversation (player, npc, "outbreak_defense_erlem_math_delta", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_erlem_math_delta_condition_hasDefenseQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_erlem_math_delta_condition_hasNeverSpoken (player, npc)) - { - doAnimationAction (npc, "beckon"); - - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId", 14); - - npcStartConversation (player, npc, "outbreak_defense_erlem_math_delta", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_erlem_math_delta_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("outbreak_defense_erlem_math_delta")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - if (branchId == 2 && outbreak_defense_erlem_math_delta_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && outbreak_defense_erlem_math_delta_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && outbreak_defense_erlem_math_delta_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && outbreak_defense_erlem_math_delta_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && outbreak_defense_erlem_math_delta_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && outbreak_defense_erlem_math_delta_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && outbreak_defense_erlem_math_delta_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.outbreak_defense_erlem_math_delta.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_kyraa_naa.java b/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_kyraa_naa.java deleted file mode 100644 index cd232b7ef..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_kyraa_naa.java +++ /dev/null @@ -1,963 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class outbreak_defense_kyraa_naa extends script.base_script -{ - public outbreak_defense_kyraa_naa() - { - } - String c_stringFile = "conversation/outbreak_defense_kyraa_naa"; - - - public boolean outbreak_defense_kyraa_naa_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean outbreak_defense_kyraa_naa_condition_hasCompletedDefenseQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "camp_gamma_defense_01") || groundquests.hasCompletedQuest(player, "camp_gamma_defense_02") || groundquests.hasCompletedQuest(player, "camp_gamma_defense_03") || groundquests.hasCompletedQuest(player, "camp_gamma_defense_04") && outbreak_defense_kyraa_naa_condition_hasAvailableGuardPosts(player,npc)); - } - - - public boolean outbreak_defense_kyraa_naa_condition_isWaitingForRewardSignal(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "camp_gamma_defense_01", "collectRewardGamma") || groundquests.isTaskActive(player, "camp_gamma_defense_02", "collectRewardGamma") || groundquests.isTaskActive(player, "camp_gamma_defense_03", "collectRewardGamma") || groundquests.isTaskActive(player, "camp_gamma_defense_04", "collectRewardGamma"); - } - - - public boolean outbreak_defense_kyraa_naa_condition_hasNeverSpoken(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_gamma") && !groundquests.isQuestActiveOrComplete(player, "camp_gamma_defense_01") && !groundquests.isQuestActiveOrComplete(player, "camp_gamma_defense_02") && !groundquests.isQuestActiveOrComplete(player, "camp_gamma_defense_03") && !groundquests.isQuestActiveOrComplete(player, "camp_gamma_defense_04") && outbreak_defense_kyraa_naa_condition_hasAvailableGuardPosts(player,npc); - } - - - public boolean outbreak_defense_kyraa_naa_condition_isGodPlayerTester(obj_id player, obj_id npc) throws InterruptedException - { - return isGod(player); - } - - - public boolean outbreak_defense_kyraa_naa_condition_levelTooHigh(obj_id player, obj_id npc) throws InterruptedException - { - return getLevel(player) >= 60; - } - - - public boolean outbreak_defense_kyraa_naa_condition_levelTooLow(obj_id player, obj_id npc) throws InterruptedException - { - return getLevel(player) < 40; - } - - - public boolean outbreak_defense_kyraa_naa_condition_noAntiVirus(obj_id player, obj_id npc) throws InterruptedException - { - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); - } - - - public boolean outbreak_defense_kyraa_naa_condition_hasDefenseQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isQuestActive(player, "camp_gamma_defense_01") || groundquests.isQuestActive(player, "camp_gamma_defense_02") || groundquests.isQuestActive(player, "camp_gamma_defense_03") || groundquests.isQuestActive(player, "camp_gamma_defense_04")) ; - } - - - public boolean outbreak_defense_kyraa_naa_condition_hasAvailableGuardPosts(obj_id player, obj_id npc) throws InterruptedException - { - - if (!utils.hasScriptVar(npc, "guardPostList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.hasAvailableGuardPosts() the npc, "+npc+" has no guardPostList script var."); - return false; - } - obj_id[] guardPostList = utils.getObjIdArrayScriptVar(npc, "guardPostList"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.hasAvailableGuardPosts() the npc, "+npc+" has an invalid guardPostList script var."); - return false; - } - - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - if (!isValidId(guardPostList[i]) || !exists(guardPostList[i])) - { - continue; - } - if (!utils.hasScriptVar(guardPostList[i], "occupied")) - { - return true; - } - } - - return false; - } - - - public void outbreak_defense_kyraa_naa_action_giveQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.hasCompletedQuest(player, "camp_gamma_defense_01")) - { - groundquests.clearQuest(player, "camp_gamma_defense_01"); - } - if (groundquests.hasCompletedQuest(player, "camp_gamma_defense_02")) - { - groundquests.clearQuest(player, "camp_gamma_defense_02"); - } - if (groundquests.hasCompletedQuest(player, "camp_gamma_defense_03")) - { - groundquests.clearQuest(player, "camp_gamma_defense_03"); - } - if (groundquests.hasCompletedQuest(player, "camp_gamma_defense_04")) - { - groundquests.clearQuest(player, "camp_gamma_defense_04"); - } - - if (!utils.hasScriptVar(npc, "guardPostList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has no guardPostList script var."); - } - else - { - obj_id[] guardPostList = utils.getObjIdArrayScriptVar(npc, "guardPostList"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has an invalid guardPostList script var."); - } - else - { - - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - if (!isValidId(guardPostList[i]) || !exists(guardPostList[i])) - { - continue; - } - if (!utils.hasScriptVar(guardPostList[i], "occupied")) - { - String questName = getStringObjVar(guardPostList[i], "questObject"); - if (questName == null || questName.length() <=0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has an invalid guardPostList script var."); - } - else - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" is granting the player: "+player+" has an invalid guardPostList script var."); - groundquests.grantQuest(player, questName); - } - } - } - } - } - } - - - public void outbreak_defense_kyraa_naa_action_sendQuestSignal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedGamma"); - - } - - - public void outbreak_defense_kyraa_naa_action_action0001(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_gamma_defense_01"); - } - - - public void outbreak_defense_kyraa_naa_action_action0002(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_gamma_defense_02"); - } - - - public void outbreak_defense_kyraa_naa_action_action0003(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_gamma_defense_03"); - } - - - public void outbreak_defense_kyraa_naa_action_action0004(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_gamma_defense_04"); - } - - - public int outbreak_defense_kyraa_naa_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_45")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_46"); - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_kyraa_naa_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - outbreak_defense_kyraa_naa_action_action0001 (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_23")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - outbreak_defense_kyraa_naa_action_action0002 (player, npc); - - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_26")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - outbreak_defense_kyraa_naa_action_action0003 (player, npc); - - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_27")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - outbreak_defense_kyraa_naa_action_action0004 (player, npc); - - string_id message = new string_id (c_stringFile, "s_31"); - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_kyraa_naa_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_62")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_63"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_kyraa_naa_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_51")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_52"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_kyraa_naa_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_54")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "laugh_cackle"); - - outbreak_defense_kyraa_naa_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_57"); - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_kyraa_naa_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_40")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_53"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_kyraa_naa_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_53")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_kyraa_naa_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_60")) - { - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_right"); - - outbreak_defense_kyraa_naa_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_77"); - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - messageTo(self, "findGuardPosts", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - messageTo(self, "findGuardPosts", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int findGuardPosts(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] guardPostList = getAllObjectsWithObjVar(getLocation(self), 200, "questObject"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" failed to find any valid guard post objects within 100 of "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - Vector guardPostsFound = null; - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - String spawnerQuestNameMatch = getStringObjVar(guardPostList[i], "questObject"); - if (spawnerQuestNameMatch == null || spawnerQuestNameMatch.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found a guard post object that did not have a quest string. Guard Post: "+guardPostList[i]); - continue; - } - if (!spawnerQuestNameMatch.startsWith("camp_gamma_defense")) - { - continue; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found a guard post object. Adding the object to the list. Guard Post: "+guardPostList[i]); - utils.addElement(guardPostsFound, guardPostList[i]); - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" loop for all the available guard posts has finished. Length of list: "+guardPostList.length); - if (guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" had a problem finding guard posts."); - return SCRIPT_CONTINUE; - } - if (guardPostList.length != 4) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found less or greater than 4 guard posts!"); - } - - utils.setScriptVar(self, "guardPostList", guardPostList); - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" has a list of guard posts as scriptvar."); - return SCRIPT_CONTINUE; - - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (outbreak_defense_kyraa_naa_condition_noAntiVirus (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_69"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_kyraa_naa_condition_levelTooLow (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_45"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId", 2); - - npcStartConversation (player, npc, "outbreak_defense_kyraa_naa", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_kyraa_naa_condition_isWaitingForRewardSignal (player, npc)) - { - outbreak_defense_kyraa_naa_action_sendQuestSignal (player, npc); - - string_id message = new string_id (c_stringFile, "s_64"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_kyraa_naa_condition_isGodPlayerTester (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_23"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId", 5); - - npcStartConversation (player, npc, "outbreak_defense_kyraa_naa", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_kyraa_naa_condition_hasCompletedDefenseQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_62"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId", 10); - - npcStartConversation (player, npc, "outbreak_defense_kyraa_naa", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_kyraa_naa_condition_hasDefenseQuest (player, npc)) - { - doAnimationAction (npc, "backhand_threaten"); - - string_id message = new string_id (c_stringFile, "s_50"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_kyraa_naa_condition_hasNeverSpoken (player, npc)) - { - doAnimationAction (npc, "beckon"); - - string_id message = new string_id (c_stringFile, "s_38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_40"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId", 15); - - npcStartConversation (player, npc, "outbreak_defense_kyraa_naa", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!outbreak_defense_kyraa_naa_condition_hasAvailableGuardPosts (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_48"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_kyraa_naa_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("outbreak_defense_kyraa_naa")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - if (branchId == 2 && outbreak_defense_kyraa_naa_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && outbreak_defense_kyraa_naa_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && outbreak_defense_kyraa_naa_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && outbreak_defense_kyraa_naa_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && outbreak_defense_kyraa_naa_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && outbreak_defense_kyraa_naa_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && outbreak_defense_kyraa_naa_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && outbreak_defense_kyraa_naa_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.outbreak_defense_kyraa_naa.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_mika_horn_alpha.java b/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_mika_horn_alpha.java deleted file mode 100644 index ad23a1b80..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_mika_horn_alpha.java +++ /dev/null @@ -1,831 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class outbreak_defense_mika_horn_alpha extends script.base_script -{ - public outbreak_defense_mika_horn_alpha() - { - } - String c_stringFile = "conversation/outbreak_defense_mika_horn_alpha"; - - - public boolean outbreak_defense_mika_horn_alpha_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean outbreak_defense_mika_horn_alpha_condition_hasCompletedDefenseQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "camp_alpha_defense") || groundquests.hasCompletedQuest(player, "camp_alpha_defense_02") || groundquests.hasCompletedQuest(player, "camp_alpha_defense_03") || groundquests.hasCompletedQuest(player, "camp_alpha_defense_04")); - } - - - public boolean outbreak_defense_mika_horn_alpha_condition_isWaitingForRewardSignal(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "camp_alpha_defense", "collectRewardAlpha") || groundquests.isTaskActive(player, "camp_alpha_defense_02", "collectRewardAlpha") || groundquests.isTaskActive(player, "camp_alpha_defense_03", "collectRewardAlpha") || groundquests.isTaskActive(player, "camp_alpha_defense_04", "collectRewardAlpha"); - } - - - public boolean outbreak_defense_mika_horn_alpha_condition_hasNeverSpoken(obj_id player, obj_id npc) throws InterruptedException - { - - return (hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_alpha") && !groundquests.isQuestActiveOrComplete(player, "camp_alpha_defense") && !groundquests.isQuestActiveOrComplete(player, "camp_alpha_defense_02") && !groundquests.isQuestActiveOrComplete(player, "camp_alpha_defense_03") && !groundquests.isQuestActiveOrComplete(player, "camp_alpha_defense_04") && outbreak_defense_mika_horn_alpha_condition_hasAvailableGuardPosts(player,npc)); - - } - - - public boolean outbreak_defense_mika_horn_alpha_condition_isGodPlayerTester(obj_id player, obj_id npc) throws InterruptedException - { - return isGod(player); - } - - - public boolean outbreak_defense_mika_horn_alpha_condition_levelTooHigh(obj_id player, obj_id npc) throws InterruptedException - { - return getLevel(player) >= 15; - } - - - public boolean outbreak_defense_mika_horn_alpha_condition_hasDefenseQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isQuestActive(player, "camp_alpha_defense") || groundquests.isQuestActive(player, "camp_alpha_defense_02") || groundquests.isQuestActive(player, "camp_alpha_defense_03") || groundquests.isQuestActive(player, "camp_alpha_defense_04")); - } - - - public boolean outbreak_defense_mika_horn_alpha_condition_noAntiVirus(obj_id player, obj_id npc) throws InterruptedException - { - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); - } - - - public boolean outbreak_defense_mika_horn_alpha_condition_hasAvailableGuardPosts(obj_id player, obj_id npc) throws InterruptedException - { - - if (!utils.hasScriptVar(npc, "guardPostList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.hasAvailableGuardPosts() the npc, "+npc+" has no guardPostList script var."); - return false; - } - obj_id[] guardPostList = utils.getObjIdArrayScriptVar(npc, "guardPostList"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.hasAvailableGuardPosts() the npc, "+npc+" has an invalid guardPostList script var."); - return false; - } - - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - if (!isValidId(guardPostList[i]) || !exists(guardPostList[i])) - { - continue; - } - if (!utils.hasScriptVar(guardPostList[i], "occupied")) - { - return true; - } - } - - return false; - } - - - public void outbreak_defense_mika_horn_alpha_action_giveQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.hasCompletedQuest(player, "camp_alpha_defense")) - { - groundquests.clearQuest(player, "camp_alpha_defense"); - } - if (groundquests.hasCompletedQuest(player, "camp_alpha_defense_02")) - { - groundquests.clearQuest(player, "camp_alpha_defense_02"); - } - if (groundquests.hasCompletedQuest(player, "camp_alpha_defense_03")) - { - groundquests.clearQuest(player, "camp_alpha_defense_03"); - } - if (groundquests.hasCompletedQuest(player, "camp_alpha_defense_04")) - { - groundquests.clearQuest(player, "camp_alpha_defense_04"); - } - - if (!utils.hasScriptVar(npc, "guardPostList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has no guardPostList script var."); - } - else - { - obj_id[] guardPostList = utils.getObjIdArrayScriptVar(npc, "guardPostList"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has an invalid guardPostList script var."); - } - else - { - - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - if (!isValidId(guardPostList[i]) || !exists(guardPostList[i])) - { - continue; - } - if (!utils.hasScriptVar(guardPostList[i], "occupied")) - { - String questName = getStringObjVar(guardPostList[i], "questObject"); - if (questName == null || questName.length() <=0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has an invalid guardPostList script var."); - } - else - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" is granting the player: "+player+" has an invalid guardPostList script var."); - groundquests.grantQuest(player, questName); - } - } - } - } - } - } - - - public void outbreak_defense_mika_horn_alpha_action_sendQuestSignal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedAlpha"); - - } - - - public void outbreak_defense_mika_horn_alpha_action_action0001(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_alpha_defense"); - } - - - public void outbreak_defense_mika_horn_alpha_action_action0002(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_alpha_defense_02"); - } - - - public void outbreak_defense_mika_horn_alpha_action_action0003(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_alpha_defense_03"); - } - - - public void outbreak_defense_mika_horn_alpha_action_action0004(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_alpha_defense_04"); - } - - - public int outbreak_defense_mika_horn_alpha_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - outbreak_defense_mika_horn_alpha_action_action0001 (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_23")) - { - - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - outbreak_defense_mika_horn_alpha_action_action0002 (player, npc); - - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_26")) - { - - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - outbreak_defense_mika_horn_alpha_action_action0003 (player, npc); - - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_27")) - { - - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - outbreak_defense_mika_horn_alpha_action_action0004 (player, npc); - - string_id message = new string_id (c_stringFile, "s_31"); - utils.removeScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_mika_horn_alpha_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_62")) - { - - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_63"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_mika_horn_alpha_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - outbreak_defense_mika_horn_alpha_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_32"); - utils.removeScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_mika_horn_alpha_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_37")) - { - - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_mika_horn_alpha_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_41")) - { - - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_43"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_mika_horn_alpha_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - outbreak_defense_mika_horn_alpha_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_77"); - utils.removeScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - messageTo(self, "findGuardPosts", null, 5, false); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - messageTo(self, "findGuardPosts", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int findGuardPosts(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] guardPostList = getAllObjectsWithObjVar(getLocation(self), 200, "questObject"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" failed to find any valid guard post objects within 100 of "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - Vector guardPostsFound = null; - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - String spawnerQuestNameMatch = getStringObjVar(guardPostList[i], "questObject"); - if (spawnerQuestNameMatch == null || spawnerQuestNameMatch.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found a guard post object that did not have a quest string. Guard Post: "+guardPostList[i]); - continue; - } - if (!spawnerQuestNameMatch.startsWith("camp_alpha_defense")) - { - continue; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found a guard post object. Adding the object to the list. Guard Post: "+guardPostList[i]); - utils.addElement(guardPostsFound, guardPostList[i]); - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" loop for all the available guard posts has finished. Length of list: "+guardPostList.length); - if (guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" had a problem finding guard posts."); - return SCRIPT_CONTINUE; - } - if (guardPostList.length != 4) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found less or greater than 4 guard posts!"); - } - - utils.setScriptVar(self, "guardPostList", guardPostList); - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" has a list of guard posts as scriptvar."); - return SCRIPT_CONTINUE; - - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (outbreak_defense_mika_horn_alpha_condition_noAntiVirus (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_69"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_mika_horn_alpha_condition_isWaitingForRewardSignal (player, npc)) - { - outbreak_defense_mika_horn_alpha_action_sendQuestSignal (player, npc); - - string_id message = new string_id (c_stringFile, "s_64"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_mika_horn_alpha_condition_isGodPlayerTester (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_23"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId", 3); - - npcStartConversation (player, npc, "outbreak_defense_mika_horn_alpha", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_mika_horn_alpha_condition_hasCompletedDefenseQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_62"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId", 8); - - npcStartConversation (player, npc, "outbreak_defense_mika_horn_alpha", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_mika_horn_alpha_condition_hasDefenseQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_47"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_mika_horn_alpha_condition_hasNeverSpoken (player, npc)) - { - doAnimationAction (npc, "beckon"); - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_37"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId", 12); - - npcStartConversation (player, npc, "outbreak_defense_mika_horn_alpha", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!outbreak_defense_mika_horn_alpha_condition_hasAvailableGuardPosts (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_mika_horn_alpha_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("outbreak_defense_mika_horn_alpha")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - if (branchId == 3 && outbreak_defense_mika_horn_alpha_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && outbreak_defense_mika_horn_alpha_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && outbreak_defense_mika_horn_alpha_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && outbreak_defense_mika_horn_alpha_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && outbreak_defense_mika_horn_alpha_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && outbreak_defense_mika_horn_alpha_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.outbreak_defense_mika_horn_alpha.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_stephon_sprocketfire_beta.java b/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_stephon_sprocketfire_beta.java deleted file mode 100644 index 0b8533dab..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_stephon_sprocketfire_beta.java +++ /dev/null @@ -1,891 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class outbreak_defense_stephon_sprocketfire_beta extends script.base_script -{ - public outbreak_defense_stephon_sprocketfire_beta() - { - } - String c_stringFile = "conversation/outbreak_defense_stephon_sprocketfire_beta"; - - - public boolean outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean outbreak_defense_stephon_sprocketfire_beta_condition_hasCompletedDefenseQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "camp_beta_defense_01") || groundquests.hasCompletedQuest(player, "camp_beta_defense_02") || groundquests.hasCompletedQuest(player, "camp_beta_defense_03") || groundquests.hasCompletedQuest(player, "camp_beta_defense_04") && outbreak_defense_stephon_sprocketfire_beta_condition_hasAvailableGuardPosts(player,npc)); - } - - - public boolean outbreak_defense_stephon_sprocketfire_beta_condition_isWaitingForRewardSignal(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "camp_beta_defense_01", "collectRewardBeta") || groundquests.isTaskActive(player, "camp_beta_defense_02", "collectRewardBeta") || groundquests.isTaskActive(player, "camp_beta_defense_03", "collectRewardBeta") || groundquests.isTaskActive(player, "camp_beta_defense_04", "collectRewardBeta"); - } - - - public boolean outbreak_defense_stephon_sprocketfire_beta_condition_hasNeverSpoken(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_beta") && !groundquests.isQuestActiveOrComplete(player, "camp_beta_defense_01") && !groundquests.isQuestActiveOrComplete(player, "camp_beta_defense_02") && !groundquests.isQuestActiveOrComplete(player, "camp_beta_defense_03") && !groundquests.isQuestActiveOrComplete(player, "camp_beta_defense_04") && outbreak_defense_stephon_sprocketfire_beta_condition_hasAvailableGuardPosts(player,npc); - } - - - public boolean outbreak_defense_stephon_sprocketfire_beta_condition_isGodPlayerTester(obj_id player, obj_id npc) throws InterruptedException - { - return isGod(player); - } - - - public boolean outbreak_defense_stephon_sprocketfire_beta_condition_levelTooHigh(obj_id player, obj_id npc) throws InterruptedException - { - return getLevel(player) >= 40; - } - - - public boolean outbreak_defense_stephon_sprocketfire_beta_condition_levelTooLow(obj_id player, obj_id npc) throws InterruptedException - { - return getLevel(player) < 15; - } - - - public boolean outbreak_defense_stephon_sprocketfire_beta_condition_noAntiVirus(obj_id player, obj_id npc) throws InterruptedException - { - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); - } - - - public boolean outbreak_defense_stephon_sprocketfire_beta_condition_hasDefenseQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isQuestActive(player, "camp_beta_defense_01") || groundquests.isQuestActive(player, "camp_beta_defense_02") || groundquests.isQuestActive(player, "camp_beta_defense_03") || groundquests.isQuestActive(player, "camp_beta_defense_04")) ; - } - - - public boolean outbreak_defense_stephon_sprocketfire_beta_condition_hasAvailableGuardPosts(obj_id player, obj_id npc) throws InterruptedException - { - - if (!utils.hasScriptVar(npc, "guardPostList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.hasAvailableGuardPosts() the npc, "+npc+" has no guardPostList script var."); - return false; - } - obj_id[] guardPostList = utils.getObjIdArrayScriptVar(npc, "guardPostList"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.hasAvailableGuardPosts() the npc, "+npc+" has an invalid guardPostList script var."); - return false; - } - - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - if (!isValidId(guardPostList[i]) || !exists(guardPostList[i])) - { - continue; - } - if (!utils.hasScriptVar(guardPostList[i], "occupied")) - { - return true; - } - } - - return false; - } - - - public void outbreak_defense_stephon_sprocketfire_beta_action_giveQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.hasCompletedQuest(player, "camp_beta_defense_01")) - { - groundquests.clearQuest(player, "camp_beta_defense_01"); - } - if (groundquests.hasCompletedQuest(player, "camp_beta_defense_02")) - { - groundquests.clearQuest(player, "camp_beta_defense_02"); - } - if (groundquests.hasCompletedQuest(player, "camp_beta_defense_03")) - { - groundquests.clearQuest(player, "camp_beta_defense_03"); - } - if (groundquests.hasCompletedQuest(player, "camp_beta_defense_04")) - { - groundquests.clearQuest(player, "camp_beta_defense_04"); - } - - if (!utils.hasScriptVar(npc, "guardPostList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has no guardPostList script var."); - } - else - { - obj_id[] guardPostList = utils.getObjIdArrayScriptVar(npc, "guardPostList"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has an invalid guardPostList script var."); - } - else - { - - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - if (!isValidId(guardPostList[i]) || !exists(guardPostList[i])) - { - continue; - } - if (!utils.hasScriptVar(guardPostList[i], "occupied")) - { - String questName = getStringObjVar(guardPostList[i], "questObject"); - if (questName == null || questName.length() <=0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has an invalid guardPostList script var."); - } - else - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" is granting the player: "+player+" has an invalid guardPostList script var."); - groundquests.grantQuest(player, questName); - } - } - } - } - } - } - - - public void outbreak_defense_stephon_sprocketfire_beta_action_sendQuestSignal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedBeta"); - - } - - - public void outbreak_defense_stephon_sprocketfire_beta_action_action0001(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_beta_defense_01"); - } - - - public void outbreak_defense_stephon_sprocketfire_beta_action_action0002(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_beta_defense_02"); - } - - - public void outbreak_defense_stephon_sprocketfire_beta_action_action0003(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_beta_defense_03"); - } - - - public void outbreak_defense_stephon_sprocketfire_beta_action_action0004(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_beta_defense_04"); - } - - - public int outbreak_defense_stephon_sprocketfire_beta_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_48")) - { - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_49"); - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_stephon_sprocketfire_beta_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - outbreak_defense_stephon_sprocketfire_beta_action_action0001 (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_23")) - { - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - outbreak_defense_stephon_sprocketfire_beta_action_action0002 (player, npc); - - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_26")) - { - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - outbreak_defense_stephon_sprocketfire_beta_action_action0003 (player, npc); - - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_27")) - { - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - outbreak_defense_stephon_sprocketfire_beta_action_action0004 (player, npc); - - string_id message = new string_id (c_stringFile, "s_31"); - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_stephon_sprocketfire_beta_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_62")) - { - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_63"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_33"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_stephon_sprocketfire_beta_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_33")) - { - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - outbreak_defense_stephon_sprocketfire_beta_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_stephon_sprocketfire_beta_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_40")) - { - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_stephon_sprocketfire_beta_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_51")) - { - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_53"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_56"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_stephon_sprocketfire_beta_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_56")) - { - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - outbreak_defense_stephon_sprocketfire_beta_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_77"); - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - messageTo(self, "findGuardPosts", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - messageTo(self, "findGuardPosts", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int findGuardPosts(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] guardPostList = getAllObjectsWithObjVar(getLocation(self), 200, "questObject"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" failed to find any valid guard post objects within 100 of "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - Vector guardPostsFound = null; - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - String spawnerQuestNameMatch = getStringObjVar(guardPostList[i], "questObject"); - if (spawnerQuestNameMatch == null || spawnerQuestNameMatch.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found a guard post object that did not have a quest string. Guard Post: "+guardPostList[i]); - continue; - } - if (!spawnerQuestNameMatch.startsWith("camp_beta_defense")) - { - continue; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found a guard post object. Adding the object to the list. Guard Post: "+guardPostList[i]); - utils.addElement(guardPostsFound, guardPostList[i]); - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" loop for all the available guard posts has finished. Length of list: "+guardPostList.length); - if (guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" had a problem finding guard posts."); - return SCRIPT_CONTINUE; - } - if (guardPostList.length != 4) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found less or greater than 4 guard posts!"); - } - - utils.setScriptVar(self, "guardPostList", guardPostList); - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" has a list of guard posts as scriptvar."); - return SCRIPT_CONTINUE; - - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (outbreak_defense_stephon_sprocketfire_beta_condition_noAntiVirus (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_69"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_stephon_sprocketfire_beta_condition_levelTooLow (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_48"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId", 2); - - npcStartConversation (player, npc, "outbreak_defense_stephon_sprocketfire_beta", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_stephon_sprocketfire_beta_condition_isWaitingForRewardSignal (player, npc)) - { - outbreak_defense_stephon_sprocketfire_beta_action_sendQuestSignal (player, npc); - - string_id message = new string_id (c_stringFile, "s_64"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_stephon_sprocketfire_beta_condition_isGodPlayerTester (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_23"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId", 5); - - npcStartConversation (player, npc, "outbreak_defense_stephon_sprocketfire_beta", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_stephon_sprocketfire_beta_condition_hasCompletedDefenseQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_62"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId", 10); - - npcStartConversation (player, npc, "outbreak_defense_stephon_sprocketfire_beta", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_stephon_sprocketfire_beta_condition_hasDefenseQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_stephon_sprocketfire_beta_condition_hasNeverSpoken (player, npc)) - { - doAnimationAction (npc, "beckon"); - - string_id message = new string_id (c_stringFile, "s_38"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_40"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId", 14); - - npcStartConversation (player, npc, "outbreak_defense_stephon_sprocketfire_beta", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_stephon_sprocketfire_beta_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("outbreak_defense_stephon_sprocketfire_beta")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - if (branchId == 2 && outbreak_defense_stephon_sprocketfire_beta_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && outbreak_defense_stephon_sprocketfire_beta_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && outbreak_defense_stephon_sprocketfire_beta_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && outbreak_defense_stephon_sprocketfire_beta_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && outbreak_defense_stephon_sprocketfire_beta_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && outbreak_defense_stephon_sprocketfire_beta_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && outbreak_defense_stephon_sprocketfire_beta_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.outbreak_defense_stephon_sprocketfire_beta.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_zsu_val_epsilon.java b/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_zsu_val_epsilon.java deleted file mode 100644 index f3331fa9a..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/outbreak_defense_zsu_val_epsilon.java +++ /dev/null @@ -1,894 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class outbreak_defense_zsu_val_epsilon extends script.base_script -{ - public outbreak_defense_zsu_val_epsilon() - { - } - String c_stringFile = "conversation/outbreak_defense_zsu_val_epsilon"; - - - public boolean outbreak_defense_zsu_val_epsilon_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean outbreak_defense_zsu_val_epsilon_condition_hasCompletedDefenseQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "camp_epsilon_defense_01") || groundquests.hasCompletedQuest(player, "camp_epsilon_defense_02") || groundquests.hasCompletedQuest(player, "camp_epsilon_defense_03") || groundquests.hasCompletedQuest(player, "camp_epsilon_defense_04") && outbreak_defense_zsu_val_epsilon_condition_hasAvailableGuardPosts(player,npc)); - } - - - public boolean outbreak_defense_zsu_val_epsilon_condition_isWaitingForRewardSignal(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "camp_epsilon_defense_01", "collectRewardEpsilon") || groundquests.isTaskActive(player, "camp_epsilon_defense_02", "collectRewardEpsilon") || groundquests.isTaskActive(player, "camp_epsilon_defense_03", "collectRewardEpsilon") || groundquests.isTaskActive(player, "camp_epsilon_defense_04", "collectRewardEpsilon"); - } - - - public boolean outbreak_defense_zsu_val_epsilon_condition_hasNeverSpoken(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollectionSlot(player, "exp_icon_deathtroopers_camp_epsilon") && !groundquests.isQuestActiveOrComplete(player, "camp_epsilon_defense_01") && !groundquests.isQuestActiveOrComplete(player, "camp_epsilon_defense_02") && !groundquests.isQuestActiveOrComplete(player, "camp_epsilon_defense_03") && !groundquests.isQuestActiveOrComplete(player, "camp_epsilon_defense_04") && outbreak_defense_zsu_val_epsilon_condition_hasAvailableGuardPosts(player,npc); - } - - - public boolean outbreak_defense_zsu_val_epsilon_condition_isGodPlayerTester(obj_id player, obj_id npc) throws InterruptedException - { - return isGod(player); - } - - - public boolean outbreak_defense_zsu_val_epsilon_condition_hasAvailableGuardPosts(obj_id player, obj_id npc) throws InterruptedException - { - - if (!utils.hasScriptVar(npc, "guardPostList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.hasAvailableGuardPosts() the npc, "+npc+" has no guardPostList script var."); - return false; - } - obj_id[] guardPostList = utils.getObjIdArrayScriptVar(npc, "guardPostList"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.hasAvailableGuardPosts() the npc, "+npc+" has an invalid guardPostList script var."); - return false; - } - - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - if (!isValidId(guardPostList[i]) || !exists(guardPostList[i])) - { - continue; - } - if (!utils.hasScriptVar(guardPostList[i], "occupied")) - { - return true; - } - } - - return false; - } - - - public boolean outbreak_defense_zsu_val_epsilon_condition_levelTooLow(obj_id player, obj_id npc) throws InterruptedException - { - return getLevel(player) < 80; - } - - - public boolean outbreak_defense_zsu_val_epsilon_condition_noAntiVirus(obj_id player, obj_id npc) throws InterruptedException - { - return (!groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral")); - } - - - public boolean outbreak_defense_zsu_val_epsilon_condition_hasDefenseQuest(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isQuestActive(player, "camp_epsilon_defense_01") || groundquests.isQuestActive(player, "camp_epsilon_defense_02") || groundquests.isQuestActive(player, "camp_epsilon_defense_03") || groundquests.isQuestActive(player, "camp_epsilon_defense_04")) ; - } - - - public void outbreak_defense_zsu_val_epsilon_action_giveQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.hasCompletedQuest(player, "camp_epsilon_defense_01")) - { - groundquests.clearQuest(player, "camp_epsilon_defense_01"); - } - if (groundquests.hasCompletedQuest(player, "camp_epsilon_defense_02")) - { - groundquests.clearQuest(player, "camp_epsilon_defense_02"); - } - if (groundquests.hasCompletedQuest(player, "camp_epsilon_defense_03")) - { - groundquests.clearQuest(player, "camp_epsilon_defense_03"); - } - if (groundquests.hasCompletedQuest(player, "camp_epsilon_defense_04")) - { - groundquests.clearQuest(player, "camp_epsilon_defense_04"); - } - - if (!utils.hasScriptVar(npc, "guardPostList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has no guardPostList script var."); - } - else - { - obj_id[] guardPostList = utils.getObjIdArrayScriptVar(npc, "guardPostList"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has an invalid guardPostList script var."); - } - else - { - - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - if (!isValidId(guardPostList[i]) || !exists(guardPostList[i])) - { - continue; - } - if (!utils.hasScriptVar(guardPostList[i], "occupied")) - { - String questName = getStringObjVar(guardPostList[i], "questObject"); - if (questName == null || questName.length() <=0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" has an invalid guardPostList script var."); - } - else - { - CustomerServiceLog("outbreak_themepark", "camp_defense.giveQuest() the npc, "+npc+" is granting the player: "+player+" has an invalid guardPostList script var."); - groundquests.grantQuest(player, questName); - } - } - } - } - } - } - - - public void outbreak_defense_zsu_val_epsilon_action_sendQuestSignal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedEpsilon"); - - } - - - public void outbreak_defense_zsu_val_epsilon_action_action0001(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_epsilon_defense_01"); - } - - - public void outbreak_defense_zsu_val_epsilon_action_action0002(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_epsilon_defense_02"); - } - - - public void outbreak_defense_zsu_val_epsilon_action_action0003(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_epsilon_defense_03"); - } - - - public void outbreak_defense_zsu_val_epsilon_action_action0004(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "camp_epsilon_defense_04"); - } - - - public int outbreak_defense_zsu_val_epsilon_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_45")) - { - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_46"); - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_zsu_val_epsilon_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_22")) - { - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - outbreak_defense_zsu_val_epsilon_action_action0001 (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_23")) - { - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - outbreak_defense_zsu_val_epsilon_action_action0002 (player, npc); - - string_id message = new string_id (c_stringFile, "s_29"); - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_26")) - { - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - outbreak_defense_zsu_val_epsilon_action_action0003 (player, npc); - - string_id message = new string_id (c_stringFile, "s_30"); - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_27")) - { - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - outbreak_defense_zsu_val_epsilon_action_action0004 (player, npc); - - string_id message = new string_id (c_stringFile, "s_31"); - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_zsu_val_epsilon_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_62")) - { - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_63"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_zsu_val_epsilon_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_59")) - { - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - outbreak_defense_zsu_val_epsilon_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_61"); - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_zsu_val_epsilon_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_zsu_val_epsilon_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_53"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_defense_zsu_val_epsilon_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_53")) - { - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - outbreak_defense_zsu_val_epsilon_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_77"); - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - messageTo(self, "findGuardPosts", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - messageTo(self, "findGuardPosts", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int findGuardPosts(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] guardPostList = getAllObjectsWithObjVar(getLocation(self), 200, "questObject"); - if (guardPostList == null || guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" failed to find any valid guard post objects within 100 of "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - Vector guardPostsFound = null; - for (int i = 0; i < guardPostList.length; i++) - { - testAbortScript(); - String spawnerQuestNameMatch = getStringObjVar(guardPostList[i], "questObject"); - if (spawnerQuestNameMatch == null || spawnerQuestNameMatch.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found a guard post object that did not have a quest string. Guard Post: "+guardPostList[i]); - continue; - } - if (!spawnerQuestNameMatch.startsWith("camp_epsilon_defense")) - { - continue; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found a guard post object. Adding the object to the list. Guard Post: "+guardPostList[i]); - utils.addElement(guardPostsFound, guardPostList[i]); - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" loop for all the available guard posts has finished. Length of list: "+guardPostList.length); - if (guardPostList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" had a problem finding guard posts."); - return SCRIPT_CONTINUE; - } - if (guardPostList.length != 4) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" found less or greater than 4 guard posts!"); - } - - utils.setScriptVar(self, "guardPostList", guardPostList); - CustomerServiceLog("outbreak_themepark", "camp_defense.findGuardPosts() the npc, "+self+" has a list of guard posts as scriptvar."); - return SCRIPT_CONTINUE; - - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (outbreak_defense_zsu_val_epsilon_condition_noAntiVirus (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_69"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_zsu_val_epsilon_condition_levelTooLow (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_45"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId", 2); - - npcStartConversation (player, npc, "outbreak_defense_zsu_val_epsilon", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_zsu_val_epsilon_condition_isWaitingForRewardSignal (player, npc)) - { - outbreak_defense_zsu_val_epsilon_action_sendQuestSignal (player, npc); - - string_id message = new string_id (c_stringFile, "s_64"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_zsu_val_epsilon_condition_isGodPlayerTester (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_22"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_23"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId", 5); - - npcStartConversation (player, npc, "outbreak_defense_zsu_val_epsilon", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_zsu_val_epsilon_condition_hasCompletedDefenseQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_62"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId", 10); - - npcStartConversation (player, npc, "outbreak_defense_zsu_val_epsilon", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_zsu_val_epsilon_condition_hasDefenseQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_50"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_zsu_val_epsilon_condition_hasNeverSpoken (player, npc)) - { - doAnimationAction (npc, "beckon"); - - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId", 14); - - npcStartConversation (player, npc, "outbreak_defense_zsu_val_epsilon", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!outbreak_defense_zsu_val_epsilon_condition_hasAvailableGuardPosts (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_47"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_defense_zsu_val_epsilon_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("outbreak_defense_zsu_val_epsilon")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - if (branchId == 2 && outbreak_defense_zsu_val_epsilon_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && outbreak_defense_zsu_val_epsilon_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && outbreak_defense_zsu_val_epsilon_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && outbreak_defense_zsu_val_epsilon_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && outbreak_defense_zsu_val_epsilon_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && outbreak_defense_zsu_val_epsilon_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && outbreak_defense_zsu_val_epsilon_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.outbreak_defense_zsu_val_epsilon.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/outbreak_han_solo.java b/sku.0/sys.server/compiled/game/script/conversation/outbreak_han_solo.java deleted file mode 100644 index 3c5a28fd2..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/outbreak_han_solo.java +++ /dev/null @@ -1,3553 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.factions; -import script.library.groundquests; -import script.library.utils; - - -public class outbreak_han_solo extends script.base_script -{ - public outbreak_han_solo() - { - } - String c_stringFile = "conversation/outbreak_han_solo"; - - - public boolean outbreak_han_solo_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean outbreak_han_solo_condition_hasNotStartedQuestLine(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_imperial") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_neutral")); - } - - - public boolean outbreak_han_solo_condition_hasFirstQuestImperial(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_01_rebel"); - } - - - public boolean outbreak_han_solo_condition_hasSecondQuestImperial(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "outbreak_quest_02_rebel"); - } - - - public boolean outbreak_han_solo_condition_hasFoundStormtroopers(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel"); - } - - - public boolean outbreak_han_solo_condition_hasCompletedMissions(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "speakPietteDebrief"); - } - - - public boolean outbreak_han_solo_condition_hasCompletedAll(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_quest_final_rebel") && groundquests.hasCompletedQuest(player, "outbreak_quest_final_rebel"); - } - - - public boolean outbreak_han_solo_condition_isLiveConversation(obj_id player, obj_id npc) throws InterruptedException - { - return outbreak_han_solo_condition_hasNotStartedQuestLine(player,npc) && (groundquests.isTaskActive(player, "outbreak_live_conversion_rebel", "speakSolo") || groundquests.hasCompletedQuest(player, "outbreak_live_conversion_rebel")) || (groundquests.isTaskActive(player, "outbreak_switch_to_rebel", "speakSolo") || groundquests.hasCompletedQuest(player, "outbreak_switch_to_rebel")); - } - - - public boolean outbreak_han_solo_condition_isPlayerImperial(obj_id player, obj_id npc) throws InterruptedException - { - return outbreak_han_solo_condition_isLiveConversation(player, npc) && factions.isImperial(player); - } - - - public boolean outbreak_han_solo_condition_isPlayerNeutral(obj_id player, obj_id npc) throws InterruptedException - { - return outbreak_han_solo_condition_isLiveConversation(player, npc) && !factions.isImperial(player) && !factions.isRebel(player); - } - - - public boolean outbreak_han_solo_condition_hasDeletedLiveConversion(obj_id player, obj_id npc) throws InterruptedException - { - if ((groundquests.hasCompletedQuest(player, "quest_08_dathomir_outpost_final") || groundquests.hasCompletedQuest(player, "quest_08_dathomir_outpost"))) - { - if ((!groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_imperial") && !groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_neutral") && !groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_neutral") && !groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_imperial"))) - { - return true; - } - } - return false; - } - - - public void outbreak_han_solo_action_grantMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.grantQuest(player, "quest/outbreak_quest_01_rebel"); - outbreak_han_solo_action_makeChewieGoodLuck(player,npc); - } - - - public void outbreak_han_solo_action_completeQuest5(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasSpokenPietteDebreif"); - if (!hasCompletedCollectionSlot(player, "outbreak_flare_s_slot")) - { - modifyCollectionSlotValue(player, "outbreak_flare_s_slot", 1); - } - } - - - public void outbreak_han_solo_action_makeChewieSayRight(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(npc, "myChewie")) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has no Chewie objvar. Self: "+npc); - return; - } - - obj_id myChewie = getObjIdObjVar(npc, "myChewie"); - if (!isValidId(myChewie) || !exists(myChewie)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has a Chewie objvar that is invalid. Self: "+ npc); - return; - } - - string_id wookSpeak = new string_id(STRINGFILE, "chewie_hrrrrrnnnn"); - chat.chat(myChewie, wookSpeak); - faceTo(myChewie, player); - playClientEffectObj(player, "sound/voc_shyriiwook_blurt_rnd.snd", player, ""); - doAnimationAction(myChewie, "scratch_head"); - } - - - public void outbreak_han_solo_action_makeChewieCheer(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(npc, "myChewie")) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has no Chewie objvar. Self: "+npc); - return; - } - - obj_id myChewie = getObjIdObjVar(npc, "myChewie"); - if (!isValidId(myChewie) || !exists(myChewie)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has a Chewie objvar that is invalid. Self: "+ npc); - return; - } - - string_id wookSpeak = new string_id(STRINGFILE, "chewie_huwaa_muaa_mumwa"); - chat.chat(myChewie, wookSpeak); - faceTo(myChewie, player); - playClientEffectObj(player, "sound/voc_shyriiwook_blurt_rnd.snd", player, ""); - doAnimationAction(myChewie, "celebrate1"); - } - - - public void outbreak_han_solo_action_makeChewieImplore(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(npc, "myChewie")) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has no Chewie objvar. Self: "+npc); - return; - } - - obj_id myChewie = getObjIdObjVar(npc, "myChewie"); - if (!isValidId(myChewie) || !exists(myChewie)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has a Chewie objvar that is invalid. Self: "+ npc); - return; - } - - string_id wookSpeak = new string_id(STRINGFILE, "chewie_wwrcahwowhwa"); - chat.chat(myChewie, wookSpeak); - faceTo(myChewie, player); - playClientEffectObj(player, "sound/voc_shyriiwook_blurt_rnd.snd", player, ""); - doAnimationAction(myChewie, "force_strength"); - } - - - public void outbreak_han_solo_action_makeChewieGoodLuck(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(npc, "myChewie")) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has no Chewie objvar. Self: "+npc); - return; - } - - obj_id myChewie = getObjIdObjVar(npc, "myChewie"); - if (!isValidId(myChewie) || !exists(myChewie)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has a Chewie objvar that is invalid. Self: "+ npc); - return; - } - - string_id wookSpeak = new string_id(STRINGFILE, "chewie_ur_oh"); - chat.chat(myChewie, wookSpeak); - faceTo(myChewie, player); - playClientEffectObj(player, "sound/voc_shyriiwook_blurt_rnd.snd", player, ""); - doAnimationAction(myChewie, "fc_yawn"); - - } - - - public void outbreak_han_solo_action_makeChewieCheer2(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(npc, "myChewie")) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has no Chewie objvar. Self: "+npc); - return; - } - - obj_id myChewie = getObjIdObjVar(npc, "myChewie"); - if (!isValidId(myChewie) || !exists(myChewie)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has a Chewie objvar that is invalid. Self: "+ npc); - return; - } - - string_id wookSpeak = new string_id(STRINGFILE, "chewie_huwaa_muaa_mumwa"); - chat.chat(myChewie, wookSpeak); - faceTo(myChewie, player); - playClientEffectObj(player, "sound/voc_shyriiwook_blurt_rnd.snd", player, ""); - doAnimationAction(myChewie, "celebrate"); - } - - - public void outbreak_han_solo_action_makeChewieSalute(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(npc, "myChewie")) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has no Chewie objvar. Self: "+npc); - return; - } - - obj_id myChewie = getObjIdObjVar(npc, "myChewie"); - if (!isValidId(myChewie) || !exists(myChewie)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has a Chewie objvar that is invalid. Self: "+ npc); - return; - } - - faceTo(myChewie, player); - playClientEffectObj(player, "sound/voc_shyriiwook_blurt_rnd.snd", player, ""); - doAnimationAction(myChewie, "salute1"); - } - - - public void outbreak_han_solo_action_makeChewieWave(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(npc, "myChewie")) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has no Chewie objvar. Self: "+npc); - return; - } - - obj_id myChewie = getObjIdObjVar(npc, "myChewie"); - if (!isValidId(myChewie) || !exists(myChewie)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has a Chewie objvar that is invalid. Self: "+ npc); - return; - } - - faceTo(myChewie, player); - playClientEffectObj(player, "sound/voc_shyriiwook_blurt_rnd.snd", player, ""); - doAnimationAction(myChewie, "wave1"); - } - - - public void outbreak_han_solo_action_makeChewieDirect(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(npc, "myChewie")) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has no Chewie objvar. Self: "+npc); - return; - } - - obj_id myChewie = getObjIdObjVar(npc, "myChewie"); - if (!isValidId(myChewie) || !exists(myChewie)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han has a Chewie objvar that is invalid. Self: "+ npc); - return; - } - - faceTo(myChewie, player); - playClientEffectObj(player, "sound/voc_shyriiwook_blurt_rnd.snd", player, ""); - doAnimationAction(myChewie, "wave_on_directing"); - - } - - - public void outbreak_han_solo_action_clearLiveConversion(obj_id player, obj_id npc) throws InterruptedException - { - if ((!groundquests.isTaskActive(player, "outbreak_live_conversion_rebel", "speakSolo") && !groundquests.isTaskActive(player, "outbreak_switch_to_rebel", "speakSolo"))) - { - return; - } - - groundquests.sendSignal(player, "liveConversionSpokeSolo"); - } - - - public void outbreak_han_solo_action_revokeRebGrantNeu(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_rebel")) - { - groundquests.clearQuest(player, "outbreak_live_conversion_rebel"); - groundquests.grantQuest(player, "outbreak_switch_to_neutral"); - } - if (groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_rebel")) - { - groundquests.clearQuest(player, "outbreak_switch_to_rebel"); - groundquests.grantQuest(player, "outbreak_switch_to_neutral"); - } - } - - - public void outbreak_han_solo_action_revokeRebGrantImp(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_rebel")) - { - groundquests.clearQuest(player, "outbreak_live_conversion_rebel"); - groundquests.grantQuest(player, "outbreak_switch_to_imperial"); - } - if (groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_rebel")) - { - groundquests.clearQuest(player, "outbreak_switch_to_rebel"); - groundquests.grantQuest(player, "outbreak_switch_to_imperial"); - } - } - - - public void outbreak_han_solo_action_revokeEntireRebQuestLine(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_rebel")) - { - groundquests.clearQuest(player, "outbreak_live_conversion_rebel"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_rebel")) - { - groundquests.clearQuest(player, "outbreak_switch_to_rebel"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_rebel")) - { - groundquests.clearQuest(player, "outbreak_quest_01_rebel"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_b_rebel")) - { - groundquests.clearQuest(player, "outbreak_quest_01_b_rebel"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_rebel")) - { - groundquests.clearQuest(player, "outbreak_quest_02_rebel"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01b")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01b"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01c")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01c"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_01d")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_01d"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_02")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_02"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_03")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_03"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_04")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_04"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_05")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_05"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_06")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_06"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_07")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_07"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_08")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_08"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_09")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_09"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_10")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_10"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_11")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_11"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_12")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_12"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_13")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_13"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_14")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_14"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_15")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_15"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_rescue_16")) - { - groundquests.clearQuest(player, "outbreak_quest_rescue_16"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_shuttle_parts")) - { - groundquests.clearQuest(player, "outbreak_quest_shuttle_parts"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_rebel_01")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_rebel_01"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_rebel_02")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_rebel_02"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_rebel_03")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_rebel_03"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_administrative_building_rebel_04")) - { - groundquests.clearQuest(player, "outbreak_quest_administrative_building_rebel_04"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_01")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_01"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_02")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_02"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_02_rebel")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_02_rebel"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_03")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_03"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_04")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_04"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_facility_05_rebel")) - { - groundquests.clearQuest(player, "outbreak_quest_facility_05_rebel"); - } - - if (groundquests.isQuestActiveOrComplete(player, "outbreak_quest_final_rebel")) - { - groundquests.clearQuest(player, "outbreak_quest_final_rebel"); - } - - } - - - public void outbreak_han_solo_action_grantRebQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_switch_to_rebel"); - } - - - public void outbreak_han_solo_action_grantImpQuest(obj_id player, obj_id npc) throws InterruptedException - { - - groundquests.grantQuest(player, "outbreak_switch_to_imperial"); - } - - - public void outbreak_han_solo_action_grantNeutQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_switch_to_neutral"); - } - - - public int outbreak_han_solo_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_97")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_99"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_99")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_100"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 3); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_revokeEntireRebQuestLine (player, npc); - - string_id message = new string_id (c_stringFile, "s_102"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_103"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_104"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_105"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_103")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_grantRebQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_106"); - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_104")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_grantImpQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_107"); - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_105")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_grantNeutQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_108"); - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_124")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - string_id message = new string_id (c_stringFile, "s_125"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_126")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_128"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_128")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_129"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave1"); - - outbreak_han_solo_action_completeQuest5 (player, npc); - - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_64")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_90")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_94"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_67")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_revokeRebGrantNeu (player, npc); - - string_id message = new string_id (c_stringFile, "s_69"); - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_94")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_95"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 26); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_63")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_66"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_89")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_92"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_68")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_revokeRebGrantImp (player, npc); - - string_id message = new string_id (c_stringFile, "s_70"); - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_93")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 26); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_140")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_makeChewieSayRight (player, npc); - - string_id message = new string_id (c_stringFile, "s_142"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 28); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_144")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_146"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_148"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 29); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_148")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_multiple"); - - string_id message = new string_id (c_stringFile, "s_150"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_152"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_152")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_154"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_156")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_242"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_243"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_243")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_244"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_245"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_245")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_makeChewieImplore (player, npc); - - string_id message = new string_id (c_stringFile, "s_247"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_249"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_249")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_260"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_261"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_261")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_83"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_85")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_87"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_109")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_111"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_113")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_115"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch39(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_117")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_119"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_131"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch40(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_131")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_133"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 41); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch41(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_135")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_137"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_139"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch42(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_139")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_makeChewieCheer (player, npc); - - string_id message = new string_id (c_stringFile, "s_143"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_155"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_160"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch43(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_147")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_151"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_155"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_160"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_155")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_155"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_160"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_160")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_162"); - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch44(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_147")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_151"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_155"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_160"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_155")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_155"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_160"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_160")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_162"); - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch45(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_147")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_151"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_155"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_160"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_155")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_155"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_160"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_160")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_162"); - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int outbreak_han_solo_handleBranch47(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_166")) - { - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_grantRebQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_168"); - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - public static final String STRINGFILE = "theme_park/outbreak/outbreak"; - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.outbreak_han_solo"); - } - - setCondition (self, CONDITION_CONVERSABLE); - messageTo(self, "findChewie", null, 2, false); - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han is looking for Chewie. Self: "+self); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - messageTo(self, "findChewie", null, 2, false); - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo conversation: Han is looking for Chewie. Self: "+self); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.outbreak_han_solo"); - - return SCRIPT_CONTINUE; - } - - - public int findChewie(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo findChewie(): Initialized"); - obj_id[] chewieList = getAllObjectsWithObjVar(getLocation(self), 3.f, "chewie"); - - if (chewieList == null || chewieList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo findChewie(): Failed to find chewie var on any objects within range."); - messageTo(self, "findChewie", null, 60, false); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo findChewie(): Found Chewie within range."); - setObjVar(self, "myChewie", chewieList[0]); - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (outbreak_han_solo_condition_hasCompletedAll (player, npc)) - { - outbreak_han_solo_action_makeChewieWave (player, npc); - - string_id message = new string_id (c_stringFile, "s_130"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 1); - - npcStartConversation (player, npc, "outbreak_han_solo", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_han_solo_condition_hasCompletedMissions (player, npc)) - { - doAnimationAction (npc, "thumbs_up"); - - outbreak_han_solo_action_makeChewieCheer2 (player, npc); - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 8); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "outbreak_han_solo", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_han_solo_condition_hasFoundStormtroopers (player, npc)) - { - outbreak_han_solo_action_makeChewieSayRight (player, npc); - - string_id message = new string_id (c_stringFile, "s_122"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (outbreak_han_solo_condition_hasSecondQuestImperial (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_121"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (outbreak_han_solo_condition_hasFirstQuestImperial (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (outbreak_han_solo_condition_isPlayerNeutral (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_90"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 16); - - npcStartConversation (player, npc, "outbreak_han_solo", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_han_solo_condition_isPlayerImperial (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_62"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 21); - - npcStartConversation (player, npc, "outbreak_han_solo", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_han_solo_condition_isLiveConversation (player, npc)) - { - doAnimationAction (npc, "nod"); - - outbreak_han_solo_action_clearLiveConversion (player, npc); - - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 26); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "outbreak_han_solo", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_han_solo_condition_hasDeletedLiveConversion (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_165"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - utils.setScriptVar (player, "conversation.outbreak_han_solo.branchId", 47); - - npcStartConversation (player, npc, "outbreak_han_solo", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (outbreak_han_solo_condition__defaultCondition (player, npc)) - { - outbreak_han_solo_action_makeChewieDirect (player, npc); - - string_id message = new string_id (c_stringFile, "s_170"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("outbreak_han_solo")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - if (branchId == 1 && outbreak_han_solo_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && outbreak_han_solo_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && outbreak_han_solo_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && outbreak_han_solo_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && outbreak_han_solo_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && outbreak_han_solo_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && outbreak_han_solo_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && outbreak_han_solo_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && outbreak_han_solo_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && outbreak_han_solo_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && outbreak_han_solo_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && outbreak_han_solo_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && outbreak_han_solo_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && outbreak_han_solo_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && outbreak_han_solo_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && outbreak_han_solo_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && outbreak_han_solo_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && outbreak_han_solo_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && outbreak_han_solo_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && outbreak_han_solo_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && outbreak_han_solo_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && outbreak_han_solo_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && outbreak_han_solo_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && outbreak_han_solo_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && outbreak_han_solo_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && outbreak_han_solo_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && outbreak_han_solo_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && outbreak_han_solo_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && outbreak_han_solo_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 39 && outbreak_han_solo_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 40 && outbreak_han_solo_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 41 && outbreak_han_solo_handleBranch41 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 42 && outbreak_han_solo_handleBranch42 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 43 && outbreak_han_solo_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 44 && outbreak_han_solo_handleBranch44 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 45 && outbreak_han_solo_handleBranch45 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 47 && outbreak_han_solo_handleBranch47 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.outbreak_han_solo.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/prisoner_pirate_cave.java b/sku.0/sys.server/compiled/game/script/conversation/prisoner_pirate_cave.java deleted file mode 100644 index a95218450..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/prisoner_pirate_cave.java +++ /dev/null @@ -1,563 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.groundquests; -import script.library.prose; -import script.library.utils; - - -public class prisoner_pirate_cave extends script.base_script -{ - public prisoner_pirate_cave() - { - } - String c_stringFile = "conversation/prisoner_pirate_cave"; - - - public boolean prisoner_pirate_cave_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean prisoner_pirate_cave_condition_hasRescueTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection", "findPrisoner") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01", "findPrisoner") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02", "findPrisoner"); - } - - - public boolean prisoner_pirate_cave_condition_isTraveling(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasObjVar(npc, "traveling") && getIntObjVar(npc, "traveling") == 1 && groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection", "isEscortingPrisoner") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01", "isEscortingPrisoner") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02", "isEscortingPrisoner"); - } - - - public boolean prisoner_pirate_cave_condition_hasArrived(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection", "waitingForShuttle") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01", "waitingForShuttle") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02", "waitingForShuttle"); - } - - - public void prisoner_pirate_cave_action_startEscort(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundPrisoner"); - ai_lib.aiFollow(npc, player, 1.0f, 3.0f); - - setMovementRun(npc); - setBaseRunSpeed(npc, (getBaseRunSpeed(npc)-8)); - setObjVar(npc, "traveling", 1); - setObjVar(npc, "playerOwner", player); - setInvulnerable(npc, false); - setMaster(npc, player); - messageTo(npc, "checkArrivalLoopHandler", null, 5, false); - LOG("prisoner_error_log","prisoner being rescued. Sending message to checkArrivalLoopHandler in 60 seconds."); - } - - - public void prisoner_pirate_cave_action_walkFaster(obj_id player, obj_id npc) throws InterruptedException - { - setMovementRun(npc); - setBaseRunSpeed(npc, (getBaseRunSpeed(npc)-8)); - ai_lib.aiFollow(npc, player, 1.0f, 3.0f); - } - - - public int prisoner_pirate_cave_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_8")) - { - - if (prisoner_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (prisoner_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.prisoner_pirate_cave.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.prisoner_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int prisoner_pirate_cave_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (prisoner_pirate_cave_condition__defaultCondition (player, npc)) - { - prisoner_pirate_cave_action_startEscort (player, npc); - - string_id message = new string_id (c_stringFile, "s_14"); - utils.removeScriptVar (player, "conversation.prisoner_pirate_cave.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - public static final string_id SID_TOO_FAR = new string_id("spam","too_far_from_prisoner"); - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.prisoner_pirate_cave"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - failRescueQuest(self); - tellMomIDied(self); - setObjVar(self, "toldMom", 1); - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - if (hasObjVar(self, "toldMom")) - { - return SCRIPT_CONTINUE; - } - - tellMomIDied(self); - setObjVar(self, "toldMom", 1); - return SCRIPT_CONTINUE; - } - - - public int handleUpdatePrisonerRescueQuest(obj_id self, dictionary params) throws InterruptedException - { - - if (!isValidId(self)) - { - CustomerServiceLog("nyms_themepark","handleUpdatePrisonerRescueQuest - NPC is not a valid OID."); - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(self, "playerOwner"); - if (!isValidId(player)) - { - messageTo(self, "handleDestroySelf", null, 1, false); - CustomerServiceLog("nyms_themepark","handleUpdatePrisonerRescueQuest - could not get valid player OID."); - return SCRIPT_CONTINUE; - } - - String signal = getStringObjVar(self, "signal"); - if (signal == null || signal.length() <= 0) - { - messageTo(self, "handleDestroySelf", null, 1, false); - CustomerServiceLog("nyms_themepark","handleUpdatePrisonerRescueQuest - could not get valid signal to update quest."); - - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlot(player, "icon_nyms_rescue_prisoner")) - { - modifyCollectionSlotValue(player, "icon_nyms_rescue_prisoner", 1); - } - - groundquests.sendSignal(player, signal); - - return SCRIPT_CONTINUE; - } - - - public int handleDestroySelf(obj_id self, dictionary params) throws InterruptedException - { - tellMomIDied(self); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int checkArrivalLoopHandler(obj_id self, dictionary params) throws InterruptedException - { - setMovementRun(self); - setBaseRunSpeed(self, getBaseRunSpeed(self)); - - obj_id player = getObjIdObjVar(self, "playerOwner"); - if (!isValidId(player)) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - could not get valid player OID."); - messageTo(self, "handleDestroySelf", null, 1, false); - return SCRIPT_CONTINUE; - } - - if (isDead(player)) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Player Died."); - failRescueQuest(self); - return SCRIPT_CONTINUE; - } - - if ((!groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection") && !groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01") && !groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02"))) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - player no longer had required quest active!"); - failRescueQuest(self); - return SCRIPT_CONTINUE; - } - else if (((groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection", "waitingForShuttle") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection", "stuvCom")) || (groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01", "waitingForShuttle") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01", "stuvCom")) || (groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02", "waitingForShuttle") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02", "stuvCom")))) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Calling SHuttle!"); - callShuttle(self, player); - return SCRIPT_CONTINUE; - } - else if ((groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection", "findPrisoner") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01", "findPrisoner") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02", "findPrisoner"))) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - could not get valid player OID."); - messageTo(self, "handleDestroySelf", null, 1, false); - return SCRIPT_CONTINUE; - } - - if (getDistance(self, player) > 10) - { - if (utils.hasScriptVar(player, "timer")) - { - int timeStarted = utils.getIntScriptVar(player, "timer"); - - if (getGameTime() - timeStarted > 10) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - player out of bounds too long, failing quest."); - failRescueQuest(self); - return SCRIPT_CONTINUE; - } - - int count = 10 - (getGameTime() - timeStarted); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_TOO_FAR); - pp = prose.setDI(pp, count); - sendQuestSystemMessage(player, pp); - } - else - { - - int count = 10; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_TOO_FAR); - pp = prose.setDI(pp, count); - sendQuestSystemMessage(player, pp); - utils.setScriptVar(player, "timer", getGameTime()); - } - } - else - { - utils.removeScriptVar(player, "timer"); - } - - ai_lib.aiFollow(self, player, 1.0f, 3.0f); - messageTo(self, "checkArrivalLoopHandler", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public boolean callShuttle(obj_id self, obj_id player) throws InterruptedException - { - LOG("prisoner_error_log","callShuttle - Shuttle Called"); - if (!isValidId(player)) - { - return false; - } - if (!isValidId(self)) - { - return false; - } - - ai_lib.aiStopFollowing(self); - removeObjVar(self, "traveling"); - setInvulnerable(self, true); - - location[] prisonerPath = new location[1]; - prisonerPath[0] = new location(-3048, 37, -719, "lok", null); - setYaw(self, -95.0f); - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); - utils.setScriptVar(self, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, prisonerPath); - utils.setScriptVar(self, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(self, prisonerPath, 0); - - location landLocation = new location(-3067, 34, -727, "lok", null); - obj_id shuttle = create.object("object/creature/npc/theme_park/player_shuttle.iff", landLocation); - if (!isIdValid(shuttle)) - { - return false; - } - - setYaw(shuttle, 75); - detachScript(shuttle, "ai.ai"); - detachScript(shuttle, "ai.creature_combat"); - detachScript(shuttle, "skeleton.humanoid"); - detachScript(shuttle, "systems.combat.combat_actions"); - detachScript(shuttle, "systems.combat.combat_actions_creature"); - detachScript(shuttle, "systems.combat.credit_for_kills"); - stop(shuttle); - - utils.setScriptVar(shuttle, "prisoner", self); - utils.setScriptVar(shuttle, "playerOwner", player); - setPosture(shuttle, POSTURE_PRONE); - attachScript(shuttle, "systems.spawning.dropship.player_shuttle"); - - messageTo(shuttle, "landShuttle", null, 0, false); - messageTo(shuttle, "takeOff", null, 37, false); - messageTo(self, "handleUpdatePrisonerRescueQuest", null, 30, false); - messageTo(self, "handleDestroySelf", null, 32, false); - return true; - } - - - public boolean tellMomIDied(obj_id self) throws InterruptedException - { - if (!isValidId(self)) - { - return false; - } - - obj_id mom = getObjIdObjVar (self, "mom"); - if (!isValidId(mom)) - { - CustomerServiceLog("bad_spawner_data", "droid_cave_died.OnIncapacitated() Nym Pirate Cave Spawner Failed. Could not retrieve Cave OID to respawn the NPC."); - return false; - } - - int spawnNum = getIntObjVar (self, "spawn_number"); - if (spawnNum <= 0) - { - CustomerServiceLog("bad_spawner_data", "droid_cave_died.OnIncapacitated() Nym Pirate Cave Spawner Failed. Could not retrieve NPC spawnNum from NPC Object."); - return false; - } - - dictionary info = new dictionary(); - info.put ("spawnNumber", spawnNum ); - info.put ("spawnMob", self ); - - messageTo(mom, "tellingMomIDied", info, 5, false ); - return true; - } - - - public boolean failRescueQuest(obj_id self) throws InterruptedException - { - obj_id player = getObjIdObjVar(self, "playerOwner"); - if (!isValidId(player)) - { - messageTo(self, "handleDestroySelf", null, 1, false); - return false; - } - - String failSignal = getStringObjVar(self, "failSignal"); - if (failSignal == null || failSignal.length() <= 0) - { - messageTo(self, "handleDestroySelf", null, 1, false); - return false; - } - - groundquests.sendSignal(player, failSignal); - messageTo(self, "handleDestroySelf", null, 1, false); - return true; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (prisoner_pirate_cave_condition_hasArrived (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_16"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (prisoner_pirate_cave_condition_isTraveling (player, npc)) - { - prisoner_pirate_cave_action_walkFaster (player, npc); - - string_id message = new string_id (c_stringFile, "s_15"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (prisoner_pirate_cave_condition_hasRescueTask (player, npc)) - { - doAnimationAction (npc, "scared"); - - string_id message = new string_id (c_stringFile, "s_6"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (prisoner_pirate_cave_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_8"); - } - - utils.setScriptVar (player, "conversation.prisoner_pirate_cave.branchId", 3); - - npcStartConversation (player, npc, "prisoner_pirate_cave", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (prisoner_pirate_cave_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_18"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("prisoner_pirate_cave")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.prisoner_pirate_cave.branchId"); - - if (branchId == 3 && prisoner_pirate_cave_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && prisoner_pirate_cave_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.prisoner_pirate_cave.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/radio_delivery_deathtrooper_conversation.java b/sku.0/sys.server/compiled/game/script/conversation/radio_delivery_deathtrooper_conversation.java deleted file mode 100644 index 072edc720..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/radio_delivery_deathtrooper_conversation.java +++ /dev/null @@ -1,1352 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class radio_delivery_deathtrooper_conversation extends script.base_script -{ - public radio_delivery_deathtrooper_conversation() - { - } - String c_stringFile = "conversation/radio_delivery_deathtrooper_conversation"; - - - public boolean radio_delivery_deathtrooper_conversation_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean radio_delivery_deathtrooper_conversation_condition_hasDeliveryQuestActive(obj_id player, obj_id npc) throws InterruptedException - { - boolean returnVal = false; - - for (int i = 1; i <= 3; i++) - { - testAbortScript(); - if ((groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "findCamp") || groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "hiddenSearchArea") || groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "findBossInCharge") || groundquests.isTaskActive(player, "outbreak_radio_delivery_0"+i, "goodWork"))) - { - returnVal = true; - } - if (i == 3 && !returnVal) - { - if ((groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "findEpsilonContact") || groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "comGoodWork2"))) - { - returnVal = true; - } - } - } - return returnVal; - } - - - public boolean radio_delivery_deathtrooper_conversation_condition_hasRadioQuest1Complete(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_01"); - } - - - public boolean radio_delivery_deathtrooper_conversation_condition_hasNeverSpoken(obj_id player, obj_id npc) throws InterruptedException - { - return !groundquests.isQuestActiveOrComplete(player, "outbreak_radio_delivery_01"); - } - - - public boolean radio_delivery_deathtrooper_conversation_condition_hasRadioOneDelivered(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "outbreak_radio_delivery_01", "talkToMaris"); - } - - - public boolean radio_delivery_deathtrooper_conversation_condition_hasRadioTwoDelivered(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "outbreak_radio_delivery_02", "talkToMaris"); - } - - - public boolean radio_delivery_deathtrooper_conversation_condition_hasRadioQuest2Complete(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_02"); - } - - - public boolean radio_delivery_deathtrooper_conversation_condition_noAntiVirus(obj_id player, obj_id npc) throws InterruptedException - { - return !groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral"); - } - - - public boolean radio_delivery_deathtrooper_conversation_condition_hasLastRadiosDelivered(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "outbreak_radio_delivery_03", "talkToMaris"); - } - - - public boolean radio_delivery_deathtrooper_conversation_condition_hasCompletedAll(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_03"); - } - - - public boolean radio_delivery_deathtrooper_conversation_condition_hasHelmet(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "outbreak_bomber_helmet_hidden_content", "hasHelmet"); - } - - - public void radio_delivery_deathtrooper_conversation_action_giveFirstDeliveryQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_radio_delivery_01"); - } - - - public void radio_delivery_deathtrooper_conversation_action_deliveryOneCompleted(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "spokenToZebMaris"); - } - - - public void radio_delivery_deathtrooper_conversation_action_giveSecondDeliveryQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_radio_delivery_02"); - } - - - public void radio_delivery_deathtrooper_conversation_action_giveThirdDeliveryQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "outbreak_radio_delivery_03"); - } - - - public void radio_delivery_deathtrooper_conversation_action_deliverTwoCompleted(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "spokenToZebMarisGamma"); - } - - - public void radio_delivery_deathtrooper_conversation_action_deliverThreeCompleted(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "spokenToZebMarisDelta"); - } - - - public void radio_delivery_deathtrooper_conversation_action_hasDeliveredHelmet(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasDeliveredHelmet"); - if (!hasCompletedCollectionSlot(player, "hidden_content_tie_helmet")) - { - modifyCollectionSlotValue(player, "hidden_content_tie_helmet", 1); - } - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_92")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "celebrate1"); - - radio_delivery_deathtrooper_conversation_action_hasDeliveredHelmet (player, npc); - - string_id message = new string_id (c_stringFile, "s_93"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_deliverThreeCompleted (player, npc); - - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_73")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_deliverThreeCompleted (player, npc); - - string_id message = new string_id (c_stringFile, "s_74"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_41")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_53"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_64")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_66")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_giveThirdDeliveryQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_67"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_55")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_56"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_57")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_59")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_62"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_62")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_giveSecondDeliveryQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_63"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_37")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_46")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_48"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_50"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_50")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_52"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_77")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_81"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_81")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_83"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_85")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_87"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int radio_delivery_deathtrooper_conversation_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_89")) - { - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_giveFirstDeliveryQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_94"); - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (radio_delivery_deathtrooper_conversation_condition_hasHelmet (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_92"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 1); - - npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (radio_delivery_deathtrooper_conversation_condition_hasCompletedAll (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_75"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (radio_delivery_deathtrooper_conversation_condition_hasDeliveryQuestActive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_31"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (radio_delivery_deathtrooper_conversation_condition_hasLastRadiosDelivered (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 5); - - npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (radio_delivery_deathtrooper_conversation_condition_hasRadioQuest2Complete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 8); - - npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (radio_delivery_deathtrooper_conversation_condition_hasRadioTwoDelivered (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_deliverTwoCompleted (player, npc); - - string_id message = new string_id (c_stringFile, "s_68"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (radio_delivery_deathtrooper_conversation_condition_hasRadioQuest1Complete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_54"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 13); - - npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (radio_delivery_deathtrooper_conversation_condition_hasRadioOneDelivered (player, npc)) - { - radio_delivery_deathtrooper_conversation_action_deliveryOneCompleted (player, npc); - - string_id message = new string_id (c_stringFile, "s_61"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (radio_delivery_deathtrooper_conversation_condition_noAntiVirus (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_69"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (radio_delivery_deathtrooper_conversation_condition_hasNeverSpoken (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_37"); - } - - utils.setScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId", 20); - - npcStartConversation (player, npc, "radio_delivery_deathtrooper_conversation", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (radio_delivery_deathtrooper_conversation_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("radio_delivery_deathtrooper_conversation")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - if (branchId == 1 && radio_delivery_deathtrooper_conversation_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && radio_delivery_deathtrooper_conversation_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && radio_delivery_deathtrooper_conversation_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && radio_delivery_deathtrooper_conversation_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && radio_delivery_deathtrooper_conversation_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && radio_delivery_deathtrooper_conversation_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && radio_delivery_deathtrooper_conversation_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && radio_delivery_deathtrooper_conversation_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && radio_delivery_deathtrooper_conversation_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && radio_delivery_deathtrooper_conversation_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && radio_delivery_deathtrooper_conversation_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && radio_delivery_deathtrooper_conversation_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && radio_delivery_deathtrooper_conversation_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && radio_delivery_deathtrooper_conversation_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && radio_delivery_deathtrooper_conversation_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && radio_delivery_deathtrooper_conversation_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && radio_delivery_deathtrooper_conversation_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.radio_delivery_deathtrooper_conversation.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/ran_machado.java b/sku.0/sys.server/compiled/game/script/conversation/ran_machado.java deleted file mode 100644 index 0033853be..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/ran_machado.java +++ /dev/null @@ -1,617 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.groundquests; -import script.library.static_item; -import script.library.utils; - - -public class ran_machado extends script.base_script -{ - public ran_machado() - { - } - String c_stringFile = "conversation/ran_machado"; - - - public boolean ran_machado_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean ran_machado_condition_isElligibleFirstTime(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_weed_pulling"); - } - - - public boolean ran_machado_condition_hasCompletedReq(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_weed_pulling", "returnForPay"); - } - - - public boolean ran_machado_condition_isElligibleSecondTime(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return !groundquests.isQuestActive(player, "u16_nym_themepark_weed_pulling") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_weed_pulling"); - } - - - public boolean ran_machado_condition_hasQuestActive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isQuestActive(player, "u16_nym_themepark_weed_pulling"); - } - - - public boolean ran_machado_condition_hasFailQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "u16_nym_themepark_weed_pulling_fail"); - } - - - public void ran_machado_action_giveQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.hasCompletedQuest(player, "u16_nym_themepark_weed_pulling")) - { - groundquests.clearQuest(player, "u16_nym_themepark_weed_pulling"); - } - if (!groundquests.isQuestActive(player, "u16_nym_themepark_weed_pulling")) - { - groundquests.grantQuest(player, "u16_nym_themepark_weed_pulling"); - } - - } - - - public void ran_machado_action_rewardPlayer(obj_id player, obj_id npc) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - if (isValidId(pInv) && exists(pInv)) - { - groundquests.sendSignal(player, "hasBeenPaid"); - collection.getRandomCollectionItemShowLootBox(player, pInv, "datatables/loot/dungeon/nym_weed_loot.iff", "weeds"); - } - } - - - public void ran_machado_action_clearFail(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.clearQuest(player, "u16_nym_themepark_weed_pulling_fail"); - } - - - public int ran_machado_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_34")) - { - - if (ran_machado_condition__defaultCondition (player, npc)) - { - ran_machado_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - utils.removeScriptVar (player, "conversation.ran_machado.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int ran_machado_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_19")) - { - - if (ran_machado_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thank"); - - ran_machado_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_20"); - utils.removeScriptVar (player, "conversation.ran_machado.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int ran_machado_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (ran_machado_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (ran_machado_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_23"); - } - - utils.setScriptVar (player, "conversation.ran_machado.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.ran_machado.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int ran_machado_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_23")) - { - - if (ran_machado_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "forage"); - - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (ran_machado_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - utils.setScriptVar (player, "conversation.ran_machado.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.ran_machado.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int ran_machado_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_27")) - { - - if (ran_machado_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_left"); - - string_id message = new string_id (c_stringFile, "s_29"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (ran_machado_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_31"); - } - - utils.setScriptVar (player, "conversation.ran_machado.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.ran_machado.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int ran_machado_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_31")) - { - - if (ran_machado_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shoo"); - - ran_machado_action_giveQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - utils.removeScriptVar (player, "conversation.ran_machado.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.ran_machado"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.ran_machado"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (ran_machado_condition_hasCompletedReq (player, npc)) - { - doAnimationAction (npc, "celebrate"); - - ran_machado_action_rewardPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_17"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (ran_machado_condition_hasFailQuest (player, npc)) - { - doAnimationAction (npc, "backhand_threaten"); - - ran_machado_action_clearFail (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (ran_machado_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - utils.setScriptVar (player, "conversation.ran_machado.branchId", 2); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "ran_machado", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (ran_machado_condition_hasQuestActive (player, npc)) - { - doAnimationAction (npc, "shakefist"); - - string_id message = new string_id (c_stringFile, "s_16"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (ran_machado_condition_isElligibleSecondTime (player, npc)) - { - doAnimationAction (npc, "celebrate"); - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (ran_machado_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_19"); - } - - utils.setScriptVar (player, "conversation.ran_machado.branchId", 5); - - npcStartConversation (player, npc, "ran_machado", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (ran_machado_condition_isElligibleFirstTime (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (ran_machado_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - utils.setScriptVar (player, "conversation.ran_machado.branchId", 7); - - npcStartConversation (player, npc, "ran_machado", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (ran_machado_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_38"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("ran_machado")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.ran_machado.branchId"); - - if (branchId == 2 && ran_machado_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && ran_machado_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && ran_machado_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && ran_machado_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && ran_machado_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && ran_machado_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.ran_machado.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/rebel_general.java b/sku.0/sys.server/compiled/game/script/conversation/rebel_general.java deleted file mode 100644 index c3c9d11f4..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/rebel_general.java +++ /dev/null @@ -1,2492 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.buff; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.holiday; -import script.library.trial; -import script.library.utils; - - -public class rebel_general extends script.base_script -{ - public rebel_general() - { - } - String c_stringFile = "conversation/rebel_general"; - - - public boolean rebel_general_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean rebel_general_condition_isEntertainerPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.ENTERTAINER); - } - - - public boolean rebel_general_condition_isPlayerImperial(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isImperial(player) || factions.isPlayerSameGcwFactionAsSchedulerObject(player, npc)); - } - - - public boolean rebel_general_condition_isPlayerRebel(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isRebel(player) || factions.isPlayerSameGcwFactionAsSchedulerObject(player, npc)); - } - - - public boolean rebel_general_condition_isPlayerNeutral(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return(!factions.isImperial(player) && !factions.isRebel(player) && pvpNeutralGetMercenaryFaction(player) == 0); - } - - - public boolean rebel_general_condition_isTraderPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.TRADER); - } - - - public boolean rebel_general_condition_isForceSensitivePlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.FORCE_SENSITIVE); - } - - - public boolean rebel_general_condition_isSmugglerPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.SMUGGLER); - } - - - public boolean rebel_general_condition_isMedicPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.MEDIC); - } - - - public boolean rebel_general_condition_isOfficerPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.OFFICER); - } - - - public boolean rebel_general_condition_isSpyPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.SPY); - } - - - public boolean rebel_general_condition_isBountyHunterPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.BOUNTY_HUNTER); - } - - - public boolean rebel_general_condition_isCommandoPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.COMMANDO); - } - - - public boolean rebel_general_condition_generalIsOffensive(obj_id player, obj_id npc) throws InterruptedException - { - return (hasObjVar(npc, "offense") && getIntObjVar(npc, "offense") == 1); - } - - - public boolean rebel_general_condition_generalIsImperial(obj_id player, obj_id npc) throws InterruptedException - { - return (hasObjVar(npc, "factionFlag") && getIntObjVar(npc, "factionFlag") == factions.FACTION_FLAG_IMPERIAL); - } - - - public boolean rebel_general_condition_generalIsDefensive(obj_id player, obj_id npc) throws InterruptedException - { - return (hasObjVar(npc, "offense") && getIntObjVar(npc, "offense") == 0); - } - - - public boolean rebel_general_condition_generalIsRebel(obj_id player, obj_id npc) throws InterruptedException - { - return (hasObjVar(npc, "factionFlag") && getIntObjVar(npc, "factionFlag") == factions.FACTION_FLAG_REBEL); - } - - - public boolean rebel_general_condition_isGeneralRebAndOffense(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_isPlayerRebel(player, npc) && rebel_general_condition_generalIsRebel(player, npc) && rebel_general_condition_generalIsOffensive(player, npc); - } - - - public boolean rebel_general_condition_isCombatPhase(obj_id player, obj_id npc) throws InterruptedException - { - return (gcw.getGcwCityInvasionPhase(npc) == gcw.GCW_CITY_PHASE_COMBAT); - } - - - public boolean rebel_general_condition_isConstructionPhase(obj_id player, obj_id npc) throws InterruptedException - { - return (gcw.getGcwCityInvasionPhase(npc) == gcw.GCW_CITY_PHASE_CONSTRUCTION); - } - - - public boolean rebel_general_condition_isGeneralRebAndDefense(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_isPlayerRebel(player, npc) && rebel_general_condition_generalIsRebel(player, npc) && rebel_general_condition_generalIsDefensive(player, npc); - } - - - public boolean rebel_general_condition_isGeneralImpAndOffense(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_isPlayerImperial(player, npc) && rebel_general_condition_generalIsImperial(player, npc) && rebel_general_condition_generalIsOffensive(player, npc); - } - - - public boolean rebel_general_condition_isGeneralImpAndDefense(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_isPlayerImperial(player, npc) && rebel_general_condition_generalIsImperial(player, npc) && rebel_general_condition_generalIsDefensive(player, npc); - } - - - public boolean rebel_general_condition_hasRebelQuest(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_isPlayerRebel(player, npc) && (rebel_general_condition_hasSpyScoutPatrolQuest(player, npc) || rebel_general_condition_hasSpyDestroyPatrolQuest(player, npc) || rebel_general_condition_hasSpyDestroyPatrolQuestNeedsExplosives(player, npc) || rebel_general_condition_hasDestroyBarricadeQuest(player, npc) || rebel_general_condition_hasDestroyTurretQuest(player, npc) ); - } - - - public boolean rebel_general_condition_hasSpyDestroyPatrolQuestNeedsExplosives(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_isSpyPlayer(player, npc) && groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST) && (buff.getBuffStackCount(player, "gcw_spy_destroy_patrol_explosive_stack") < 5); - } - - - public boolean rebel_general_condition_hasSpyScoutPatrolQuest(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_isSpyPlayer(player, npc) && groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST); - } - - - public boolean rebel_general_condition_hasSpyDestroyPatrolQuest(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_isSpyPlayer(player, npc) && groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST); - } - - - public boolean rebel_general_condition_hasDestroyTurretQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, gcw.GCW_DESTROY_TURRET); - } - - - public boolean rebel_general_condition_hasDestroyBarricadeQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, gcw.GCW_DESTROY_BARRICADE); - } - - - public boolean rebel_general_condition_hasDestroyQuest(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_hasSpyDestroyPatrolQuest(player, npc) || rebel_general_condition_hasDestroyTurretQuest(player, npc) || rebel_general_condition_hasDestroyBarricadeQuest(player, npc); - } - - - public boolean rebel_general_condition_hasEntertainRallyQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY); - } - - - public boolean rebel_general_condition_enemyPatrolPointsExist(obj_id player, obj_id npc) throws InterruptedException - { - obj_id parent = trial.getParent(npc); - if (!isValidId(parent) || !exists(parent)) - { - return false; - } - - if (rebel_general_condition_generalIsDefensive(player, npc)) - { - obj_id[] patrols = trial.getObjectsInInstanceBySpawnId(parent, "offense_quest_asset"); - if (patrols == null || patrols.length <= 0) - { - return false; - } - - return patrols.length > 0; - } - else if (rebel_general_condition_generalIsOffensive(player, npc)) - { - obj_id[] patrols = trial.getObjectsInInstanceBySpawnId(parent, "defense_quest_asset"); - if (patrols == null || patrols.length <= 0) - { - return false; - } - - return patrols.length > 0; - } - - return false; - } - - - public boolean rebel_general_condition_enemyPatrolsExistAndIsCombatPhase(obj_id player, obj_id npc) throws InterruptedException - { - return (rebel_general_condition_enemyPatrolPointsExist(player, npc) && rebel_general_condition_isCombatPhase(player, npc)); - } - - - public boolean rebel_general_condition_enemyPatrolPointsDestroyed(obj_id player, obj_id npc) throws InterruptedException - { - return (rebel_general_condition_isCombatPhase(player, npc) && !rebel_general_condition_enemyPatrolPointsExist(player, npc)); - } - - - public boolean rebel_general_condition_canCommandoQuest(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_isCommandoPlayer(player, npc) && (!groundquests.isQuestActive(player, gcw.GCW_DESTROY_BARRICADE) || !groundquests.isQuestActive(player, gcw.GCW_DESTROY_TURRET)); - } - - - public boolean rebel_general_condition_canEntertainerQuest(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_isEntertainerPlayer(player, npc) && (!groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY) || !groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_FATIGUE)); - } - - - public boolean rebel_general_condition_canBeMerc(obj_id player, obj_id npc) throws InterruptedException - { - return factions.canChangeNeutralMercenaryStatus(player); - } - - - public boolean rebel_general_condition_patrolPointsExistNoScoutQuest(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_enemyPatrolPointsExist(player, npc) && !groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST); - } - - - public boolean rebel_general_condition_patrolPointsExistNoDestroyQuest(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_general_condition_enemyPatrolPointsExist(player, npc) && !groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST); - } - - - public void rebel_general_action_spawnGuards(obj_id player, obj_id npc) throws InterruptedException - { - - for (int i = 0; i < 3; i++) - { - testAbortScript(); - location guardLocation = groundquests.getRandom2DLocationAroundLocation(npc, 1, 1, 5, 12); - int mobLevel = getLevel(player); - obj_id guard = create.object("rebel_emperorsday_ceremony_sentry", guardLocation, mobLevel); - attachScript(guard, "event.emp_day.factional_guard_self_destruct"); - startCombat(guard, player); - } - } - - - public void rebel_general_action_grantSpyDestroyPatrol(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST)) - { - groundquests.clearQuest(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST); - } - - buff.applyBuffWithStackCount(player, gcw.BUFF_SPY_EXPLOSIVES, 5); - groundquests.grantQuest(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST); - } - - - public void rebel_general_action_grantSpyScoutPatrol(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST)) - { - groundquests.clearQuest(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST); - } - - groundquests.grantQuest(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST); - } - - - public void rebel_general_action_grantMoreSpyDestroyPatrolExplosives(obj_id player, obj_id npc) throws InterruptedException - { - buff.applyBuffWithStackCount(player, gcw.BUFF_SPY_EXPLOSIVES, 5); - } - - - public void rebel_general_action_grantCombatDestroyBarricade(obj_id player, obj_id npc) throws InterruptedException - { - - } - - - public void rebel_general_action_grantCombatDestroyTurret(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_DESTROY_TURRET)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_DESTROY_TURRET)) - { - groundquests.clearQuest(player, gcw.GCW_DESTROY_TURRET); - } - - groundquests.grantQuest(player, gcw.GCW_DESTROY_TURRET); - } - - - public void rebel_general_action_grantEntertainRallyQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_ENTERTAIN_RALLY)) - { - groundquests.clearQuest(player, gcw.GCW_ENTERTAIN_RALLY); - } - - groundquests.grantQuest(player, gcw.GCW_ENTERTAIN_RALLY); - } - - - public void rebel_general_action_grantEntertainFatigueQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_FATIGUE)) - { - return; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_ENTERTAIN_FATIGUE)) - { - groundquests.clearQuest(player, gcw.GCW_ENTERTAIN_FATIGUE); - } - - groundquests.grantQuest(player, gcw.GCW_ENTERTAIN_FATIGUE); - } - - - public void rebel_general_action_grantEntertainerQuests(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_FATIGUE)) - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_ENTERTAIN_FATIGUE)) - { - groundquests.clearQuest(player, gcw.GCW_ENTERTAIN_FATIGUE); - } - - groundquests.grantQuest(player, gcw.GCW_ENTERTAIN_FATIGUE); - } - - if (!groundquests.isQuestActive(player, gcw.GCW_ENTERTAIN_RALLY)) - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_ENTERTAIN_RALLY)) - { - groundquests.clearQuest(player, gcw.GCW_ENTERTAIN_RALLY); - } - - groundquests.grantQuest(player, gcw.GCW_ENTERTAIN_RALLY); - } - } - - - public void rebel_general_action_grantCombatQuests(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActive(player, gcw.GCW_DESTROY_BARRICADE)) - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_DESTROY_BARRICADE)) - { - groundquests.clearQuest(player, gcw.GCW_DESTROY_BARRICADE); - } - - groundquests.grantQuest(player, gcw.GCW_DESTROY_BARRICADE); - } - - if (!groundquests.isQuestActive(player, gcw.GCW_DESTROY_TURRET)) - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_DESTROY_TURRET)) - { - groundquests.clearQuest(player, gcw.GCW_DESTROY_TURRET); - } - - groundquests.grantQuest(player, gcw.GCW_DESTROY_TURRET); - } - - if (!groundquests.isQuestActive(player, gcw.GCW_ELIMINATE_IMPERIALS)) - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_ELIMINATE_IMPERIALS)) - { - groundquests.clearQuest(player, gcw.GCW_ELIMINATE_IMPERIALS); - } - - groundquests.grantQuest(player, gcw.GCW_ELIMINATE_IMPERIALS); - } - } - - - public void rebel_general_action_makeRebMercCombatant(obj_id player, obj_id npc) throws InterruptedException - { - factions.setNeturalMercenaryCovert(player, factions.FACTION_FLAG_REBEL); - } - - - public void rebel_general_action_makeRebMercSF(obj_id player, obj_id npc) throws InterruptedException - { - factions.setNeturalMercenaryOvert(player, factions.FACTION_FLAG_REBEL); - } - - - public int rebel_general_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_46")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_48"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_110"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_110")) - { - - if (rebel_general_condition_canBeMerc (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_111"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_123"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_112")) - { - - if (rebel_general_condition_canBeMerc (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_116"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_115"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_116")) - { - - if (rebel_general_condition_canBeMerc (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - rebel_general_action_makeRebMercSF (player, npc); - - string_id message = new string_id (c_stringFile, "s_118"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_119"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_117")) - { - - if (rebel_general_condition_canBeMerc (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - rebel_general_action_makeRebMercCombatant (player, npc); - - string_id message = new string_id (c_stringFile, "s_120"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_121"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_21")) - { - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - rebel_general_action_grantEntertainerQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_328"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - rebel_general_action_grantEntertainFatigueQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_331"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_31")) - { - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_33"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_183"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_36")) - { - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_192"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - rebel_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_330"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_51")) - { - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_194"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - rebel_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_332"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_61")) - { - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_196"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - rebel_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_333"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_71")) - { - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_201"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - rebel_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_335"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_81")) - { - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_222"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition_patrolPointsExistNoScoutQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_general_condition_patrolPointsExistNoDestroyQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_223"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_224"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_225"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_203"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_102")) - { - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_205"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - rebel_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_337"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_114")) - { - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_207"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - rebel_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_339"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_312")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - rebel_general_action_grantMoreSpyDestroyPatrolExplosives (player, npc); - - string_id message = new string_id (c_stringFile, "s_314"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_316")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_318"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_320")) - { - - if (rebel_general_condition_hasSpyDestroyPatrolQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_322"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_hasDestroyBarricadeQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_324"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_hasDestroyTurretQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_326"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_223")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - rebel_general_action_grantSpyScoutPatrol (player, npc); - - string_id message = new string_id (c_stringFile, "s_228"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_224")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - rebel_general_action_grantSpyDestroyPatrol (player, npc); - - string_id message = new string_id (c_stringFile, "s_234"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_225")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - rebel_general_action_grantCombatQuests (player, npc); - - string_id message = new string_id (c_stringFile, "s_246"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_126")) - { - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_281"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_304"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_185"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_295"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_146")) - { - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_148"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_190"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_151")) - { - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_153"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_212"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_156")) - { - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_158"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_213"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_161")) - { - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_163"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_166")) - { - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_169"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_216"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_177")) - { - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_218"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition_patrolPointsExistNoScoutQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_general_condition_patrolPointsExistNoDestroyQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_227"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_247"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_138"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 55); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_286"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_enemyPatrolsExistAndIsCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_302"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_289")) - { - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_291"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_297"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_299")) - { - - if (rebel_general_condition_isCombatPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_301"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isConstructionPhase (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_308"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch39(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_281")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_282"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_283"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_304")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - rebel_general_action_grantEntertainFatigueQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_305"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch40(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_283")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - rebel_general_action_grantEntertainRallyQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_284"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch43(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_295")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - rebel_general_action_grantEntertainFatigueQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_296"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch55(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_227")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_235"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_239"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 56); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_247")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_251"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_261"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_273"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 58); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_138")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch56(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_239")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - rebel_general_action_grantSpyScoutPatrol (player, npc); - - string_id message = new string_id (c_stringFile, "s_243"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch58(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_261")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_265"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_269"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 59); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_273")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - rebel_general_action_grantSpyDestroyPatrol (player, npc); - - string_id message = new string_id (c_stringFile, "s_276"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_general_handleBranch59(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_269")) - { - - if (rebel_general_condition__defaultCondition (player, npc)) - { - rebel_general_action_grantSpyDestroyPatrol (player, npc); - - string_id message = new string_id (c_stringFile, "s_276"); - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.rebel_general"); - } - - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - dictionary params = new dictionary(); - location loc = getLocation(self); - params.put("particleLoc", loc); - int playIconTime = getGameTime(); - params.put("iconMessageTime", playIconTime); - utils.setScriptVar(self, "iconMessageTime", playIconTime); - messageTo(self, "playQuestIcon", params, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.rebel_general"); - - return SCRIPT_CONTINUE; - } - - - public int playQuestIcon(obj_id self, dictionary params) throws InterruptedException - { - gcw.playQuestIconHandler(self, params); - - if (!utils.hasScriptVar(self, "faction")) - { - if (!hasObjVar(self, "factionFlag")) - { - return SCRIPT_CONTINUE; - } - - int faction = getIntObjVar(self, "factionFlag"); - utils.setScriptVar(self, "faction", faction); - } - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (rebel_general_condition_isPlayerNeutral (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 1); - - npcStartConversation (player, npc, "rebel_general", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isGeneralRebAndOffense (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition_canEntertainerQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_general_condition_isTraderPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_general_condition_isCommandoPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_general_condition_isForceSensitivePlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_general_condition_isSmugglerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (rebel_general_condition_isBountyHunterPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - boolean hasResponse6 = false; - if (rebel_general_condition_isSpyPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse6 = true; - } - - boolean hasResponse7 = false; - if (rebel_general_condition_isMedicPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse7 = true; - } - - boolean hasResponse8 = false; - if (rebel_general_condition_isOfficerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse8 = true; - } - - boolean hasResponse9 = false; - if (rebel_general_condition_hasSpyDestroyPatrolQuestNeedsExplosives (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse9 = true; - } - - boolean hasResponse10 = false; - if (rebel_general_condition_hasSpyScoutPatrolQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse10 = true; - } - - boolean hasResponse11 = false; - if (rebel_general_condition_hasDestroyQuest (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse11 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_21"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_31"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_61"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse6) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_81"); - } - - if (hasResponse7) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_102"); - } - - if (hasResponse8) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - if (hasResponse9) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_312"); - } - - if (hasResponse10) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_316"); - } - - if (hasResponse11) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_320"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 11); - - npcStartConversation (player, npc, "rebel_general", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition_isGeneralRebAndDefense (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_124"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_general_condition_isEntertainerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_general_condition_isTraderPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_general_condition_isCommandoPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_general_condition_isForceSensitivePlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_general_condition_isSmugglerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (rebel_general_condition_isBountyHunterPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - boolean hasResponse6 = false; - if (rebel_general_condition_isSpyPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse6 = true; - } - - boolean hasResponse7 = false; - if (rebel_general_condition_isMedicPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse7 = true; - } - - boolean hasResponse8 = false; - if (rebel_general_condition_isOfficerPlayer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse8 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_151"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_161"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - if (hasResponse6) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - if (hasResponse7) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_289"); - } - - if (hasResponse8) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_299"); - } - - utils.setScriptVar (player, "conversation.rebel_general.branchId", 38); - - npcStartConversation (player, npc, "rebel_general", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_general_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_310"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("rebel_general")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.rebel_general.branchId"); - - if (branchId == 1 && rebel_general_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && rebel_general_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && rebel_general_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && rebel_general_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && rebel_general_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && rebel_general_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && rebel_general_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 39 && rebel_general_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 40 && rebel_general_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 43 && rebel_general_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 55 && rebel_general_handleBranch55 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 56 && rebel_general_handleBranch56 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 58 && rebel_general_handleBranch58 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 59 && rebel_general_handleBranch59 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.rebel_general.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/rebel_offensive_supply_terminal.java b/sku.0/sys.server/compiled/game/script/conversation/rebel_offensive_supply_terminal.java deleted file mode 100644 index 4acab0bd1..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/rebel_offensive_supply_terminal.java +++ /dev/null @@ -1,3247 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.static_item; -import script.library.sui; -import script.library.utils; - - -public class rebel_offensive_supply_terminal extends script.base_script -{ - public rebel_offensive_supply_terminal() - { - } - String c_stringFile = "conversation/rebel_offensive_supply_terminal"; - - - public boolean rebel_offensive_supply_terminal_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean rebel_offensive_supply_terminal_condition_isTrader(obj_id player, obj_id npc) throws InterruptedException - { - - return utils.isProfession(player, utils.TRADER); - } - - - public boolean rebel_offensive_supply_terminal_condition_isRebelPlayer(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isRebelorRebelHelper(player) || factions.isOnLeave(player)); - } - - - public boolean rebel_offensive_supply_terminal_condition_isImperialPlayer(obj_id player, obj_id npc) throws InterruptedException - { - return (factions.isImperialorImperialHelper(player)); - } - - - public boolean rebel_offensive_supply_terminal_condition_isNeutralPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - return(!factions.isImperialorImperialHelper(player) && !factions.isRebelorRebelHelper(player)); - } - - - public boolean rebel_offensive_supply_terminal_condition_hasGcwSchematic(obj_id player, obj_id npc) throws InterruptedException - { - if ((hasSchematic(player, "object/draft_schematic/item/gcw_vehicle_tool.iff") && hasSchematic(player, "object/draft_schematic/item/gcw_patrol_tool.iff"))) - { - return true; - } - - return false; - - } - - - public boolean rebel_offensive_supply_terminal_condition_isGodCheck(obj_id player, obj_id npc) throws InterruptedException - { - return isGod(player); - } - - - public boolean rebel_offensive_supply_terminal_condition_isSmuggler(obj_id player, obj_id npc) throws InterruptedException - { - - return utils.isProfession(player, utils.SMUGGLER); - - } - - - public boolean rebel_offensive_supply_terminal_condition_ifOperationsCore(obj_id player, obj_id npc) throws InterruptedException - { - int slice = getIntObjVar(npc, "sliced"); - if (slice == 3) - { - return true; - } - - return false; - - } - - - public boolean rebel_offensive_supply_terminal_condition_ifInstructionHandler(obj_id player, obj_id npc) throws InterruptedException - { - int slice = getIntObjVar(npc, "sliced"); - if (slice == 2) - { - return true; - } - - return false; - - } - - - public boolean rebel_offensive_supply_terminal_condition_ifDataPipeline(obj_id player, obj_id npc) throws InterruptedException - { - int slice = getIntObjVar(npc, "sliced"); - if (slice == 1) - { - return true; - } - - return false; - - } - - - public boolean rebel_offensive_supply_terminal_condition_isSlicing(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, gcw.GCW_SMUGGLER_SLICING)) - { - return true; - } - return false; - } - - - public boolean rebel_offensive_supply_terminal_condition_isMaxScanLevel(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActive(player, gcw.GCW_SMUGGLER_SLICING)) - { - return false; - } - - if (utils.hasScriptVar(player, "gcw.terminalScanTier")) - { - int scanTier = utils.getIntScriptVar(player, "gcw.terminalScanTier"); - - if (scanTier >= 10) - { - return true; - } - } - - return false; - } - - - public boolean rebel_offensive_supply_terminal_condition_maxScanLevel(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActive(player, gcw.GCW_SMUGGLER_SLICING)) - { - return false; - } - - if (utils.hasScriptVar(player, "gcw.terminalScanTier")) - { - int scanTier = utils.getIntScriptVar(player, "gcw.terminalScanTier"); - - if (scanTier >= 10) - { - return false; - } - } - - return true; - } - - - public boolean rebel_offensive_supply_terminal_condition_missingSequence(obj_id player, obj_id npc) throws InterruptedException - { - if (!utils.hasScriptVar(player, "gcw.sliceSequence")) - { - groundquests.clearQuest(player, gcw.GCW_SMUGGLER_SLICING); - return true; - } - return false; - } - - - public boolean rebel_offensive_supply_terminal_condition_noSlicingQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (!groundquests.isQuestActive(player, gcw.GCW_SMUGGLER_SLICING)) - { - return true; - } - return false; - } - - - public boolean rebel_offensive_supply_terminal_condition_notMissingCombination(obj_id player, obj_id npc) throws InterruptedException - { - if (utils.hasScriptVar(player, "gcw.sliceSequence")) - { - return true; - } - return false; - } - - - public boolean rebel_offensive_supply_terminal_condition_sliceInstruction(obj_id player, obj_id npc) throws InterruptedException - { - - int scanTier = 0; - if (utils.hasScriptVar(player, "gcw.terminalScanTier")) - { - scanTier = utils.getIntScriptVar(player, "gcw.terminalScanTier"); - } - - if (!utils.hasScriptVar(player, "gcw.sliceSequence")) - { - return false; - } - int[] sliceSequence = utils.getIntArrayScriptVar(player, "gcw.sliceSequence"); - if (sliceSequence[scanTier] == 2) - { - return true; - } - - return false; - } - - - public boolean rebel_offensive_supply_terminal_condition_sliceOpCore(obj_id player, obj_id npc) throws InterruptedException - { - - int scanTier = 0; - if (utils.hasScriptVar(player, "gcw.terminalScanTier")) - { - scanTier = utils.getIntScriptVar(player, "gcw.terminalScanTier"); - } - - if (!utils.hasScriptVar(player, "gcw.sliceSequence")) - { - return false; - } - int[] sliceSequence = utils.getIntArrayScriptVar(player, "gcw.sliceSequence"); - if (sliceSequence[scanTier] == 3) - { - return true; - } - - return false; - } - - - public boolean rebel_offensive_supply_terminal_condition_slicePipeline(obj_id player, obj_id npc) throws InterruptedException - { - - int scanTier = 0; - if (utils.hasScriptVar(player, "gcw.terminalScanTier")) - { - scanTier = utils.getIntScriptVar(player, "gcw.terminalScanTier"); - } - - if (!utils.hasScriptVar(player, "gcw.sliceSequence")) - { - return false; - } - int[] sliceSequence = utils.getIntArrayScriptVar(player, "gcw.sliceSequence"); - if (sliceSequence[scanTier] == 1) - { - return true; - } - - return false; - } - - - public void rebel_offensive_supply_terminal_action_givePatrolItems(obj_id player, obj_id npc) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - obj_id obj1 = createObject("object/tangible/gcw/crafting_quest/gcw_landing_beacon.iff", pInv, ""); - obj_id obj2 = createObject("object/tangible/gcw/crafting_quest/gcw_signal_amplifier.iff", pInv, ""); - - if (hasObjVar(npc, "contraband")) - { - int cband = getIntObjVar(npc, "contraband"); - if (cband > 0) - { - float fcband = (int)cband; - obj_id obj3 = createObject("object/tangible/gcw/crafting_quest/gcw_manufacturing_boosters.iff", pInv, ""); - setObjVar(obj3, "crafting_components.charge", fcband); - } - } - } - - - public void rebel_offensive_supply_terminal_action_resetSlicing(obj_id player, obj_id npc) throws InterruptedException - { - if (hasObjVar(npc, "sliced")) - { - removeObjVar(npc, "sliced"); - } - } - - - public void rebel_offensive_supply_terminal_action_giveVehicleItems(obj_id player, obj_id npc) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - obj_id obj1 = createObject("object/tangible/gcw/crafting_quest/gcw_engine_booster.iff", pInv, ""); - obj_id obj2 = createObject("object/tangible/gcw/crafting_quest/gcw_weapon_stabilizers.iff", pInv, ""); - - if (hasObjVar(npc, "contraband")) - { - int cband = getIntObjVar(npc, "contraband"); - if (cband > 0) - { - float fcband = (int)cband; - obj_id obj3 = createObject("object/tangible/gcw/crafting_quest/gcw_manufacturing_boosters.iff", pInv, ""); - setObjVar(obj3, "crafting_components.charge", fcband); - } - } - } - - - public void rebel_offensive_supply_terminal_action_closeSliceSUI(obj_id player, obj_id npc) throws InterruptedException - { - int pid = utils.getIntScriptVar(player, "PIDvar"); - sui.closeSUI(player, pid); - } - - - public void rebel_offensive_supply_terminal_action_grantGcwSchematic(obj_id player, obj_id npc) throws InterruptedException - { - - if (!hasSchematic(player, "object/draft_schematic/item/gcw_vehicle_tool.iff")) - { - grantSchematic(player, "object/draft_schematic/item/gcw_vehicle_tool.iff"); - } - - if (!hasSchematic(player, "object/draft_schematic/item/gcw_patrol_tool.iff")) - { - grantSchematic(player, "object/draft_schematic/item/gcw_patrol_tool.iff"); - } - - }; - - - public void rebel_offensive_supply_terminal_action_grantSchematics(obj_id player, obj_id npc) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - static_item.createNewItemFunction("item_gcw_schematic_barricades_tool", pInv); - static_item.createNewItemFunction("item_gcw_schematic_reinforcement_tool", pInv); - static_item.createNewItemFunction("item_gcw_schematic_tower_tool", pInv); - static_item.createNewItemFunction("item_gcw_schematic_turret_tool", pInv); - } - - - public void rebel_offensive_supply_terminal_action_increaseCharge(obj_id player, obj_id npc) throws InterruptedException - { - int charges; - if (!hasObjVar(npc, "contraband")) - { - charges = 0; - setObjVar(npc, "contraband", charges); - } - charges = getIntObjVar(npc, "contraband"); - charges++; - setObjVar(npc, "contraband", charges); - - } - - - public void rebel_offensive_supply_terminal_action_resetCharges(obj_id player, obj_id npc) throws InterruptedException - { - int charges = 0; - setObjVar(npc, "contraband", charges); - } - - - public void rebel_offensive_supply_terminal_action_correctSlice(obj_id player, obj_id npc) throws InterruptedException - { - if (!utils.hasScriptVar(player, "gcw.terminalScanTier")) - { - utils.setScriptVar(player, "gcw.terminalScanTier", 0); - } - - int tier = utils.getIntScriptVar(player, "gcw.terminalScanTier"); - tier++; - utils.setScriptVar(player, "gcw.terminalScanTier", tier); - - } - - - public void rebel_offensive_supply_terminal_action_grantSlicingQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.hasCompletedQuest(player, gcw.GCW_SMUGGLER_SLICING)) - { - groundquests.clearQuest(player, gcw.GCW_SMUGGLER_SLICING); - } - - utils.setScriptVar(player, "gcw.tier", 0); - utils.setScriptVar(player, "gcw.maxTier", 0); - utils.setScriptVar(player, "gcw.terminalScanTier", 0); - - int[] sliceSeqence = new int[10]; - for (int i = 0; i < sliceSeqence.length; i++) - { - testAbortScript(); - sliceSeqence[i] = rand(1, 3); - if (isGod(player)) - { - sendSystemMessage(player, "sequence nr."+i+" is set to:"+sliceSeqence[i], null); - } - utils.setScriptVar(player, "gcw.sliceSequence", sliceSeqence); - } - - groundquests.grantQuest(player, gcw.GCW_SMUGGLER_SLICING); - } - - - public void rebel_offensive_supply_terminal_action_startSlicing(obj_id player, obj_id npc) throws InterruptedException - { - - dictionary params = new dictionary(); - params.put("player", player); - messageTo(npc, "startSlicing", params, 1.0f, false); - - } - - - public void rebel_offensive_supply_terminal_action_incorrectSlice(obj_id player, obj_id npc) throws InterruptedException - { - utils.setScriptVar(player, "gcw.terminalScanTier", 0); - } - - - public int rebel_offensive_supply_terminal_tokenDI_sliceTier(obj_id player, obj_id npc) throws InterruptedException - { - int tier = 0; - if (utils.hasScriptVar(player, "gcw.terminalScanTier")) - {; - } - { - tier = utils.getIntScriptVar(player, "gcw.terminalScanTier"); - } - tier++; - return tier; - } - - - public int rebel_offensive_supply_terminal_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (rebel_offensive_supply_terminal_condition_isImperialPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_39"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition_isRebelPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition_isSmuggler (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_offensive_supply_terminal_condition_isGodCheck (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_43"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_94"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_43")) - { - - if (rebel_offensive_supply_terminal_condition_hasGcwSchematic (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_47"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - rebel_offensive_supply_terminal_action_grantGcwSchematic (player, npc); - - string_id message = new string_id (c_stringFile, "s_142"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_143"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_32")) - { - rebel_offensive_supply_terminal_action_grantSlicingQuest (player, npc); - - if (rebel_offensive_supply_terminal_condition_maxScanLevel (player, npc)) - { - rebel_offensive_supply_terminal_action_closeSliceSUI (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition_noSlicingQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_135")) - { - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_137"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_144")) - { - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_145"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_147"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_152"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_47")) - { - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_51"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_59")) - { - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_61"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_117")) - { - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_121"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_51")) - { - rebel_offensive_supply_terminal_action_giveVehicleItems (player, npc); - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_53"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_55")) - { - - if (rebel_offensive_supply_terminal_condition_hasGcwSchematic (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_47"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - rebel_offensive_supply_terminal_action_grantGcwSchematic (player, npc); - - string_id message = new string_id (c_stringFile, "s_142"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_143"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_63")) - { - rebel_offensive_supply_terminal_action_givePatrolItems (player, npc); - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_65"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_67")) - { - - if (rebel_offensive_supply_terminal_condition_hasGcwSchematic (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_47"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - rebel_offensive_supply_terminal_action_grantGcwSchematic (player, npc); - - string_id message = new string_id (c_stringFile, "s_142"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_143"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_143")) - { - - if (rebel_offensive_supply_terminal_condition_hasGcwSchematic (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_47"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - rebel_offensive_supply_terminal_action_grantGcwSchematic (player, npc); - - string_id message = new string_id (c_stringFile, "s_142"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_143"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_34")) - { - - if (rebel_offensive_supply_terminal_condition_slicePipeline (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_41"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 12); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - rebel_offensive_supply_terminal_action_incorrectSlice (player, npc); - - string_id message = new string_id (c_stringFile, "s_52"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 13); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_35")) - { - - if (rebel_offensive_supply_terminal_condition_sliceInstruction (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_42"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 14); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - rebel_offensive_supply_terminal_action_incorrectSlice (player, npc); - - string_id message = new string_id (c_stringFile, "s_48"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 15); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_60")) - { - - if (rebel_offensive_supply_terminal_condition_sliceOpCore (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_64"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 16); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - rebel_offensive_supply_terminal_action_incorrectSlice (player, npc); - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 17); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_86")) - { - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - rebel_offensive_supply_terminal_action_startSlicing (player, npc); - - string_id message = new string_id (c_stringFile, "s_87"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_54")) - { - rebel_offensive_supply_terminal_action_correctSlice (player, npc); - - if (rebel_offensive_supply_terminal_condition_maxScanLevel (player, npc)) - { - rebel_offensive_supply_terminal_action_closeSliceSUI (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition_noSlicingQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_83")) - { - - if (rebel_offensive_supply_terminal_condition_maxScanLevel (player, npc)) - { - rebel_offensive_supply_terminal_action_closeSliceSUI (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition_noSlicingQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_57")) - { - rebel_offensive_supply_terminal_action_correctSlice (player, npc); - - if (rebel_offensive_supply_terminal_condition_maxScanLevel (player, npc)) - { - rebel_offensive_supply_terminal_action_closeSliceSUI (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition_noSlicingQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_84")) - { - - if (rebel_offensive_supply_terminal_condition_maxScanLevel (player, npc)) - { - rebel_offensive_supply_terminal_action_closeSliceSUI (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition_noSlicingQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_68")) - { - rebel_offensive_supply_terminal_action_correctSlice (player, npc); - - if (rebel_offensive_supply_terminal_condition_maxScanLevel (player, npc)) - { - rebel_offensive_supply_terminal_action_closeSliceSUI (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition_noSlicingQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_85")) - { - - if (rebel_offensive_supply_terminal_condition_maxScanLevel (player, npc)) - { - rebel_offensive_supply_terminal_action_closeSliceSUI (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition_noSlicingQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_89")) - { - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - rebel_offensive_supply_terminal_action_startSlicing (player, npc); - - string_id message = new string_id (c_stringFile, "s_90"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_147")) - { - rebel_offensive_supply_terminal_action_increaseCharge (player, npc); - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_149"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_152")) - { - rebel_offensive_supply_terminal_action_resetCharges (player, npc); - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_154"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_offensive_supply_terminal_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_98")) - { - - if (rebel_offensive_supply_terminal_condition_maxScanLevel (player, npc)) - { - rebel_offensive_supply_terminal_action_closeSliceSUI (player, npc); - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_34"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_35"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_60"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.digitInteger = rebel_offensive_supply_terminal_tokenDI_sliceTier (player, npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition_noSlicingQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_100")) - { - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_102"); - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.rebel_offensive_supply_terminal"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.rebel_offensive_supply_terminal"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 1); - - npcStartConversation (player, npc, "rebel_offensive_supply_terminal", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_offensive_supply_terminal_condition_maxScanLevel (player, npc)) - { - rebel_offensive_supply_terminal_action_closeSliceSUI (player, npc); - - string_id message = new string_id (c_stringFile, "s_96"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_offensive_supply_terminal_condition_notMissingCombination (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_offensive_supply_terminal_condition_missingSequence (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_98"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - utils.setScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId", 27); - - npcStartConversation (player, npc, "rebel_offensive_supply_terminal", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("rebel_offensive_supply_terminal")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - if (branchId == 1 && rebel_offensive_supply_terminal_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && rebel_offensive_supply_terminal_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && rebel_offensive_supply_terminal_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && rebel_offensive_supply_terminal_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && rebel_offensive_supply_terminal_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && rebel_offensive_supply_terminal_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && rebel_offensive_supply_terminal_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && rebel_offensive_supply_terminal_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && rebel_offensive_supply_terminal_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && rebel_offensive_supply_terminal_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && rebel_offensive_supply_terminal_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && rebel_offensive_supply_terminal_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && rebel_offensive_supply_terminal_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && rebel_offensive_supply_terminal_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && rebel_offensive_supply_terminal_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && rebel_offensive_supply_terminal_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.rebel_offensive_supply_terminal.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/rebel_pilot_rescue.java b/sku.0/sys.server/compiled/game/script/conversation/rebel_pilot_rescue.java deleted file mode 100644 index 01491c912..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/rebel_pilot_rescue.java +++ /dev/null @@ -1,307 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.buff; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.static_item; -import script.library.utils; - - -public class rebel_pilot_rescue extends script.base_script -{ - public rebel_pilot_rescue() - { - } - String c_stringFile = "conversation/rebel_pilot_rescue"; - - - public boolean rebel_pilot_rescue_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean rebel_pilot_rescue_condition_hasTheMisionActiveAndIsMyRescuer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!hasObjVar(npc, "rescuer") || !hasObjVar(npc, "rescuerQuest")) - { - return false; - } - - obj_id rescuer = getObjIdObjVar(npc, "rescuer"); - if (!isValidId(rescuer) || !exists(rescuer)) - { - return false; - } - - if (rescuer != player) - { - return false; - } - - String activeQuest = getStringObjVar(npc, "rescuerQuest"); - if (activeQuest == null || activeQuest.length() <= 0) - { - return false; - } - - if (!groundquests.isQuestActive(player, activeQuest)) - { - return false; - } - - return true; - } - - - public boolean rebel_pilot_rescue_condition_isNotMyRescuer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (!hasObjVar(npc, "rescuer") || !hasObjVar(npc, "rescuerQuest")) - { - return true; - } - - obj_id rescuer = getObjIdObjVar(npc, "rescuer"); - if (!isValidId(rescuer) || !exists(rescuer)) - { - return true; - } - - if (rescuer != player) - { - return true; - } - - return false; - } - - - public void rebel_pilot_rescue_action_changeIntoDisguise(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01); - } - - - public String rebel_pilot_rescue_tokenTO_timeLeftRecruitment(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public String rebel_pilot_rescue_tokenTO_timeLeftPropaganda(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public int rebel_pilot_rescue_tokenDI_notUsed(obj_id player, obj_id npc) throws InterruptedException - { - return 0; - } - - - public int rebel_pilot_rescue_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_79")) - { - - if (rebel_pilot_rescue_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_80"); - utils.removeScriptVar (player, "conversation.rebel_pilot_rescue.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.rebel_pilot_rescue"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.rebel_pilot_rescue"); - - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (rebel_pilot_rescue_condition_isNotMyRescuer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_81"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_pilot_rescue_condition_hasTheMisionActiveAndIsMyRescuer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_pilot_rescue_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - utils.setScriptVar (player, "conversation.rebel_pilot_rescue.branchId", 2); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_pilot_rescue", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("rebel_pilot_rescue")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.rebel_pilot_rescue.branchId"); - - if (branchId == 2 && rebel_pilot_rescue_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.rebel_pilot_rescue.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_captain_derlin.java b/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_captain_derlin.java deleted file mode 100644 index ed278f9e3..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_captain_derlin.java +++ /dev/null @@ -1,4564 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.buff; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.space_quest; -import script.library.static_item; -import script.library.utils; - - -public class rebel_remembrance_day_captain_derlin extends script.base_script -{ - public rebel_remembrance_day_captain_derlin() - { - } - String c_stringFile = "conversation/rebel_remembrance_day_captain_derlin"; - - - public boolean rebel_remembrance_day_captain_derlin_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_alreadyDoingResistance(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT) || buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_hasCompletedOneOrMoreCollections(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_captain_derlin_condition_hasCompletedVandalCollection(player, npc) || rebel_remembrance_day_captain_derlin_condition_hasCompletedResistanceCollection(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isSpecialForcesRebel(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isDeclared(player) && factions.isRebel(player)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_hasResistanceCollectionPrerequisite(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlotPrereq(player, holiday.REBEL_RESISTANCE_COUNTER_SLOT); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_alreadyDoingVandal(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT) || buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_SF); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_alreadyKnowsDerlin(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_captain_derlin_condition_hasResistanceCollectionPrerequisite(player, npc) || rebel_remembrance_day_captain_derlin_condition_hasVandalCollectionPrerequisite(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_hasVandalCollectionPrerequisite(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlotPrereq(player, holiday.REBEL_VANDAL_COUNTER_SLOT); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlot(player, holiday.REMEMBRANCE_DAY_CHAMPION_BADGE); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isQualifiedResistanceSpecialForces(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_captain_derlin_condition_isSpecialForcesRebel(player, npc) && !rebel_remembrance_day_captain_derlin_condition_alreadyDoingResistance(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isQualifiedVandalSpecialForces(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_captain_derlin_condition_isSpecialForcesRebel(player, npc) && !rebel_remembrance_day_captain_derlin_condition_alreadyDoingVandal(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isImperialPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isImperial(player)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isNeutralPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return(!factions.isImperial(player) && !factions.isRebel(player)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isQualifiedResistanceCombatant(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!rebel_remembrance_day_captain_derlin_condition_isSpecialForcesRebel(player, npc) && !rebel_remembrance_day_captain_derlin_condition_alreadyDoingResistance(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isQualifiedVandalCombatant(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!rebel_remembrance_day_captain_derlin_condition_isSpecialForcesRebel(player, npc) && !rebel_remembrance_day_captain_derlin_condition_alreadyDoingVandal(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_hasCompletedResistanceCollection(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollection(player, holiday.REBEL_RESISTANCE_COLLECTION); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_hasCompletedVandalCollection(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollection(player, holiday.REBEL_VANDAL_COLLECTION); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isLockedOutOfEvents(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_captain_derlin_condition_isLockedOutOfResistance(player, npc) && rebel_remembrance_day_captain_derlin_condition_isLockedOutOfVandal(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_hasNotCompletedBothCollections(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!rebel_remembrance_day_captain_derlin_condition_hasCompletedVandalCollection(player, npc) && !rebel_remembrance_day_captain_derlin_condition_hasCompletedResistanceCollection(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_alreadyDoingBothVandalResistance(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_captain_derlin_condition_alreadyDoingResistance(player, npc) && rebel_remembrance_day_captain_derlin_condition_alreadyDoingVandal(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isChampionDoesntKnowDerlin(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge(player, npc) && !rebel_remembrance_day_captain_derlin_condition_alreadyKnowsDerlin(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isChampionKnowsDerlin(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge(player, npc) && rebel_remembrance_day_captain_derlin_condition_alreadyKnowsDerlin(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_hasCollectionsButNotCompleted(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if (rebel_remembrance_day_captain_derlin_condition_hasVandalCollectionPrerequisite(player, npc) && rebel_remembrance_day_captain_derlin_condition_hasResistanceCollectionPrerequisite(player, npc) && rebel_remembrance_day_captain_derlin_condition_hasNotCompletedBothCollections(player, npc)) - { - if (!rebel_remembrance_day_captain_derlin_condition_alreadyDoingVandal(player, npc) || !rebel_remembrance_day_captain_derlin_condition_alreadyDoingResistance(player, npc)) - { - return false; - } - } - return true; - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isLockedOutOfVandal(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasObjVar(player, holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isLockedOutOfResistance(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasObjVar(player, holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_canDoVandalEvent(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!rebel_remembrance_day_captain_derlin_condition_alreadyDoingVandal(player, npc) && !rebel_remembrance_day_captain_derlin_condition_isLockedOutOfVandal(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_canDoResistanceEvent(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!rebel_remembrance_day_captain_derlin_condition_alreadyDoingResistance(player, npc) && !rebel_remembrance_day_captain_derlin_condition_isLockedOutOfResistance(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_captain_derlin_condition_canDoResistanceEvent(player, npc) || rebel_remembrance_day_captain_derlin_condition_canDoVandalEvent(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.TRADER); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isEntertainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.ENTERTAINER); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isTraderOrEntertainer(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_remembrance_day_captain_derlin_condition_isTrader(player, npc) || rebel_remembrance_day_captain_derlin_condition_isEntertainer(player, npc); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_hasCompletedBothCollections(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_captain_derlin_condition_hasCompletedVandalCollection(player, npc) && rebel_remembrance_day_captain_derlin_condition_hasCompletedResistanceCollection(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_hasScore(obj_id player, obj_id npc) throws InterruptedException - { - return hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isNeutralImperial(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_IMP); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isNewNeutralPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_REB) && rebel_remembrance_day_captain_derlin_condition_isNeutralPlayer(player, npc)); - } - - - public boolean rebel_remembrance_day_captain_derlin_condition_isNeutralImperialButRebel(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - if ((hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_IMP) && factions.isRebel(player))) - { - return true; - } - return false; - } - - - public void rebel_remembrance_day_captain_derlin_action_setSFResistanceEventOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - if (getCollectionSlotValue(player, holiday.REBEL_RESISTANCE_START_SLOT) <= 0) - { - rebel_remembrance_day_captain_derlin_action_setResistanceCollectionStarterSlot(player, npc); - } - - buff.applyBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF); - } - - - public void rebel_remembrance_day_captain_derlin_action_resetBothCollections(obj_id player, obj_id npc) throws InterruptedException - { - if (rebel_remembrance_day_captain_derlin_condition_hasCompletedResistanceCollection(player, npc) && rebel_remembrance_day_captain_derlin_condition_hasCompletedVandalCollection(player, npc)) - { - - String[] resistanceSlotsInCollection = getAllCollectionSlotsInCollection(holiday.REBEL_RESISTANCE_COLLECTION); - - for (int i = 0; i < resistanceSlotsInCollection.length; i++) - { - testAbortScript(); - - long collectionSlotValue = getCollectionSlotValue(player, resistanceSlotsInCollection[i]) * -1; - - modifyCollectionSlotValue(player, resistanceSlotsInCollection[i], collectionSlotValue); - } - - String[] slotsInCollection = getAllCollectionSlotsInCollection(holiday.REBEL_VANDAL_COLLECTION); - - for (int i = 0; i < slotsInCollection.length; i++) - { - testAbortScript(); - - long collectionSlotValue = getCollectionSlotValue(player, slotsInCollection[i]) * -1; - - modifyCollectionSlotValue(player, slotsInCollection[i], collectionSlotValue); - } - - rebel_remembrance_day_captain_derlin_action_setResistanceCollectionStarterSlot(player, npc); - rebel_remembrance_day_captain_derlin_action_setVandalCollectionStarterSlot(player, npc); - } - } - - - public void rebel_remembrance_day_captain_derlin_action_getLeaderBoardSui(obj_id player, obj_id npc) throws InterruptedException - { - obj_id tatooine = getPlanetByName("tatooine"); - if (!isIdValid(tatooine) || !exists(tatooine)) - { - CustomerServiceLog("holidayEvent", "derlin_conversation.getLeaderBoardSui: Could not find Tatooine OID."); - return; - } - - String data = holiday.getEventHighScores(tatooine, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY + holiday.PLANET_VAR_SCORE, true); - if (data == null || data.length() <= 0) - { - CustomerServiceLog("holidayEvent", "derlin_conversation.getLeaderBoardSui: High Score Data Invalid."); - return; - } - - if (!holiday.createEventLeaderBoardUI(player, holiday.LEADER_BOARD_TITLE, data)) - { - CustomerServiceLog("holidayEvent", "derlin_conversation.getLeaderBoardSui: createEventLeaderBoardUI failed."); - return; - } - - CustomerServiceLog("holidayEvent", "derlin_conversation.getLeaderBoardSui: High Score Data received by player: "+player+"."); - } - - - public void rebel_remembrance_day_captain_derlin_action_setSFVandalEventOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - if (getCollectionSlotValue(player, holiday.REBEL_VANDAL_START_SLOT) <= 0) - { - rebel_remembrance_day_captain_derlin_action_setVandalCollectionStarterSlot(player, npc); - } - - buff.applyBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_SF); - } - - - public void rebel_remembrance_day_captain_derlin_action_giveWedgeAntillesWaypoint(obj_id player, obj_id npc) throws InterruptedException - { - location loc = new location(-247, 28, 4151, "corellia"); - obj_id wedgeWpt = createWaypointInDatapad(player, loc); - setWaypointName(wedgeWpt, "Squadron Representative"); - setWaypointActive(wedgeWpt, true); - } - - - public void rebel_remembrance_day_captain_derlin_action_spawnTroopers(obj_id player, obj_id npc) throws InterruptedException - { - - for (int i = 0; i < 3; i++) - { - testAbortScript(); - location guardLocation = groundquests.getRandom2DLocationAroundLocation(npc, 1, 1, 5, 12); - int mobLevel = getLevel(player); - obj_id guard = create.object("rebel_emperorsday_ceremony_sentry", guardLocation, mobLevel); - attachScript(guard, "event.emp_day.factional_guard_self_destruct"); - startCombat(guard, player); - } - } - - - public void rebel_remembrance_day_captain_derlin_action_setLeaderBoardScore(obj_id player, obj_id npc) throws InterruptedException - { - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE)) - { - return; - } - - int playerScore = getIntObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE); - if (playerScore <= 0) - { - return; - } - - String playerName = getPlayerFullName(player); - if (playerName == null || playerName.length() <= 0) - { - return; - } - - obj_id tatooine = getPlanetByName("tatooine"); - if (!isIdValid(tatooine) || !exists(tatooine)) - { - CustomerServiceLog("holidayEvent", "derlin_conversation.getLeaderBoardSui: Could not find Tatooine OID."); - return; - } - - if (!holiday.setEmpireDayLeaderScores(tatooine, player, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY + holiday.PLANET_VAR_SCORE, playerScore, playerName, holiday.REBEL_PLAYER)) - { - CustomerServiceLog("holidayEvent", "derlin_conversation.getLeaderBoardSui: Player: ("+player+") "+playerName+ " was unable to attain leader board data. Their score was: "+playerScore); - return; - } - - } - - - public void rebel_remembrance_day_captain_derlin_action_setResistanceCollectionStarterSlot(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, holiday.REBEL_RESISTANCE_START_SLOT, 1); - } - - - public void rebel_remembrance_day_captain_derlin_action_setVandalCollectionStarterSlot(obj_id player, obj_id npc) throws InterruptedException - { - modifyCollectionSlotValue(player, holiday.REBEL_VANDAL_START_SLOT, 1); - } - - - public void rebel_remembrance_day_captain_derlin_action_setCombatantResistanceEventOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - if (getCollectionSlotValue(player, holiday.REBEL_RESISTANCE_START_SLOT) <= 0) - { - rebel_remembrance_day_captain_derlin_action_setResistanceCollectionStarterSlot(player, npc); - } - - buff.applyBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT); - } - - - public void rebel_remembrance_day_captain_derlin_action_setCombatantVandalEventOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - if (getCollectionSlotValue(player, holiday.REBEL_VANDAL_START_SLOT) <= 0) - { - rebel_remembrance_day_captain_derlin_action_setVandalCollectionStarterSlot(player, npc); - } - - buff.applyBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT); - } - - - public void rebel_remembrance_day_captain_derlin_action_makeNeutralRebel(obj_id player, obj_id npc) throws InterruptedException - { - play2dNonLoopingSound(player, space_quest.MUSIC_QUEST_EVENT); - setObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_REB, true); - } - - - public void rebel_remembrance_day_captain_derlin_action_checkHolidayTimeStampOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - holiday.checkEventLockOutRemoval(player, holiday.EMPIRE_DAY_RESISTANCE_TIMESTAMP, holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT); - holiday.checkEventLockOutRemoval(player, holiday.EMPIRE_DAY_VANDAL_TIMESTAMP, holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT); - } - - - public void rebel_remembrance_day_captain_derlin_action_removeNeutralImperial(obj_id player, obj_id npc) throws InterruptedException - { - removeObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_IMP); - } - - - public String rebel_remembrance_day_captain_derlin_tokenTO_timeLeftVandal(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_VANDAL_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public String rebel_remembrance_day_captain_derlin_tokenTO_timeLeftResistance(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_RESISTANCE_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public String rebel_remembrance_day_captain_derlin_tokenTO_currentScore(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE)) - { - return "no points so far."; - } - - int playerScore = getIntObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE); - if (playerScore <= 0) - { - return "no points so far."; - } - - return playerScore+" points so far."; - } - - - public int rebel_remembrance_day_captain_derlin_tokenDI_notUsed(obj_id player, obj_id npc) throws InterruptedException - { - return 0; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_173")) - { - - if (rebel_remembrance_day_captain_derlin_condition_hasCompletedBothCollections (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_178"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_179"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 6); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_isLockedOutOfEvents (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_175"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_56"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_176"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoResistanceEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoVandalEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_captain_derlin_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_captain_derlin_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_208"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_212"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_216"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_220"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_117"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_121")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_123")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_93")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_94"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (rebel_remembrance_day_captain_derlin_tokenTO_currentScore (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_126")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_136"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_173")) - { - - if (rebel_remembrance_day_captain_derlin_condition_hasCompletedBothCollections (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_178"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_179"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 6); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_isLockedOutOfEvents (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_175"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_56"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_176"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoResistanceEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoVandalEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_captain_derlin_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_captain_derlin_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_208"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_212"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_216"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_220"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_117"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_121")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_123")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_93")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_94"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (rebel_remembrance_day_captain_derlin_tokenTO_currentScore (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_126")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_136"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_179")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_180"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition_hasCompletedResistanceCollection (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_181"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_181")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_182"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_185"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_185")) - { - - if (rebel_remembrance_day_captain_derlin_condition_hasCompletedBothCollections (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_resetBothCollections (player, npc); - - string_id message = new string_id (c_stringFile, "s_188"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoResistanceEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoVandalEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_captain_derlin_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_captain_derlin_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_208"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_212"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_216"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_220"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_97")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_106"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_166")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_177"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_184"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_208")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_210"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_212")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_216")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_218"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_220")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_222"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_64")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_90"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_91"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_92"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_57")) - { - - if (rebel_remembrance_day_captain_derlin_condition_isTraderOrEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_59"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (!rebel_remembrance_day_captain_derlin_condition_isTraderOrEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_120"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_91")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_95"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (rebel_remembrance_day_captain_derlin_tokenTO_timeLeftVandal (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_92")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - pp.other.set (rebel_remembrance_day_captain_derlin_tokenTO_timeLeftResistance (player, npc)); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_122")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_giveWedgeAntillesWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_124"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_97")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_106"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_166")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_177"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_184"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_208")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_210"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_212")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_216")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_218"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_220")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_222"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_69")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 29); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_98")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_100"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_102"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_103"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_103")) - { - doAnimationAction (player, "salute1"); - - rebel_remembrance_day_captain_derlin_action_makeNeutralRebel (player, npc); - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 29); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_69")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 29); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_76")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "pound_fist_palm"); - - string_id message = new string_id (c_stringFile, "s_80"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoResistanceEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoVandalEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_captain_derlin_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_captain_derlin_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_208"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_212"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_216"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_220"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 30); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_97")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_106"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_166")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_177"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_184"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_208")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_210"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_212")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_216")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_218"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_220")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_222"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_106")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_110"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_114")) - { - - if (rebel_remembrance_day_captain_derlin_condition_isQualifiedResistanceCombatant (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_138"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_142"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_isQualifiedResistanceSpecialForces (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_154"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_142")) - { - - if (rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_setCombatantResistanceEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_146"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoResistanceEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoVandalEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_captain_derlin_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_captain_derlin_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_208"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_212"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_216"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_220"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_setCombatantResistanceEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_150"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_97")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_106"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_166")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_177"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_184"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_208")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_210"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_212")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_216")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_218"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_220")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_222"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_156")) - { - - if (rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_setSFResistanceEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_158"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoResistanceEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoVandalEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_captain_derlin_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_captain_derlin_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_208"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_212"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_216"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_220"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_setSFResistanceEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_162"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_97")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_106"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_166")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_177"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_184"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_208")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_210"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_212")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_216")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_218"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_220")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_222"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch39(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_184")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_187"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_190"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch40(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_190")) - { - - if (rebel_remembrance_day_captain_derlin_condition_isQualifiedVandalCombatant (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_192"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_194"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 41); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_isQualifiedVandalSpecialForces (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_200"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_202"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 44); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch41(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_194")) - { - - if (rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_setCombatantVandalEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_196"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoResistanceEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoVandalEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_captain_derlin_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_captain_derlin_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_208"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_212"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_216"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_220"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_setCombatantVandalEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_198"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch42(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_97")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_106"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_166")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_177"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_184"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_208")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_210"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_212")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_216")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_218"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_220")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_222"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch44(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_202")) - { - - if (rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_setSFVandalEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_204"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoResistanceEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition_canDoVandalEvent (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_captain_derlin_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_captain_derlin_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (!rebel_remembrance_day_captain_derlin_condition_hasRemembranceDayBadge (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_166"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_208"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_212"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_216"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_220"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!rebel_remembrance_day_captain_derlin_condition_canDoAtLeastOneEvent (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_setSFVandalEventOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_206"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_captain_derlin_handleBranch45(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_97")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_106"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_166")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_177"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_184"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_208")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_210"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_212")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_216")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_getLeaderBoardSui (player, npc); - - string_id message = new string_id (c_stringFile, "s_218"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_220")) - { - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_222"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.rebel_remembrance_day_captain_derlin"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.rebel_remembrance_day_captain_derlin"); - - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (rebel_remembrance_day_captain_derlin_condition_isImperialPlayer (player, npc)) - { - doAnimationAction (npc, "backhand_threaten"); - - string_id message = new string_id (c_stringFile, "s_50"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_isNeutralImperialButRebel (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_removeNeutralImperial (player, npc); - - string_id message = new string_id (c_stringFile, "s_104"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_isNeutralImperial (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_isChampionKnowsDerlin (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_checkHolidayTimeStampOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_captain_derlin_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_captain_derlin_condition_hasScore (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_173"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_121"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_123"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 5); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_remembrance_day_captain_derlin", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_alreadyKnowsDerlin (player, npc)) - { - rebel_remembrance_day_captain_derlin_action_checkHolidayTimeStampOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_captain_derlin_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_captain_derlin_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_captain_derlin_condition_hasScore (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_173"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_121"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_123"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_126"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 5); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_remembrance_day_captain_derlin", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_isChampionDoesntKnowDerlin (player, npc)) - { - doAnimationAction (npc, "salute2"); - - doAnimationAction (player, "salute2"); - - string_id message = new string_id (c_stringFile, "s_109"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 28); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_remembrance_day_captain_derlin", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition_isNewNeutralPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_98"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 25); - - npcStartConversation (player, npc, "rebel_remembrance_day_captain_derlin", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute2"); - - doAnimationAction (player, "salute2"); - - string_id message = new string_id (c_stringFile, "s_58"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_captain_derlin_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId", 28); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_remembrance_day_captain_derlin", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("rebel_remembrance_day_captain_derlin")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - if (branchId == 4 && rebel_remembrance_day_captain_derlin_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && rebel_remembrance_day_captain_derlin_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && rebel_remembrance_day_captain_derlin_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && rebel_remembrance_day_captain_derlin_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && rebel_remembrance_day_captain_derlin_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && rebel_remembrance_day_captain_derlin_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && rebel_remembrance_day_captain_derlin_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && rebel_remembrance_day_captain_derlin_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && rebel_remembrance_day_captain_derlin_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && rebel_remembrance_day_captain_derlin_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && rebel_remembrance_day_captain_derlin_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && rebel_remembrance_day_captain_derlin_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && rebel_remembrance_day_captain_derlin_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && rebel_remembrance_day_captain_derlin_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && rebel_remembrance_day_captain_derlin_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && rebel_remembrance_day_captain_derlin_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && rebel_remembrance_day_captain_derlin_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && rebel_remembrance_day_captain_derlin_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && rebel_remembrance_day_captain_derlin_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && rebel_remembrance_day_captain_derlin_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && rebel_remembrance_day_captain_derlin_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && rebel_remembrance_day_captain_derlin_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && rebel_remembrance_day_captain_derlin_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 39 && rebel_remembrance_day_captain_derlin_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 40 && rebel_remembrance_day_captain_derlin_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 41 && rebel_remembrance_day_captain_derlin_handleBranch41 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 42 && rebel_remembrance_day_captain_derlin_handleBranch42 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 44 && rebel_remembrance_day_captain_derlin_handleBranch44 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 45 && rebel_remembrance_day_captain_derlin_handleBranch45 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_captain_derlin.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_rieekan.java b/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_rieekan.java deleted file mode 100644 index d4d1eabc0..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_rieekan.java +++ /dev/null @@ -1,4448 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.buff; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.static_item; -import script.library.utils; - - -public class rebel_remembrance_day_rieekan extends script.base_script -{ - public rebel_remembrance_day_rieekan() - { - } - String c_stringFile = "conversation/rebel_remembrance_day_rieekan"; - - - public boolean rebel_remembrance_day_rieekan_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean rebel_remembrance_day_rieekan_condition_isEntertainerOrTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_rieekan_condition_isEntertainer(player, npc) || rebel_remembrance_day_rieekan_condition_isTrader(player, npc)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isNotFirstSupplyDropMission(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return rebel_remembrance_day_rieekan_condition_hasSupplyDropMissionWithTask(player, npc) && !rebel_remembrance_day_rieekan_condition_isReadyForFirstSupplyDrop(player, npc); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isEntertainerOrTraderAndNeverMetNotChampion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_rieekan_condition_isEntertainerOrTrader(player, npc) && !rebel_remembrance_day_rieekan_condition_alreadyKnowsRieekan(player, npc) && !rebel_remembrance_day_rieekan_condition_isChampion(player, npc)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasNotCraftedSupplies(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 0; i < holiday.ALL_REBEL_QUESTS.length; i++) - { - testAbortScript(); - if ((groundquests.isQuestActive(player, holiday.ALL_REBEL_QUESTS[i]) && groundquests.isTaskActive(player, holiday.ALL_REBEL_QUESTS[i], "crafteSupplies"))) - { - return true; - } - } - return false; - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasAMisionActive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 0; i < holiday.ALL_REBEL_QUESTS.length; i++) - { - testAbortScript(); - if (groundquests.isQuestActive(player, holiday.ALL_REBEL_QUESTS[i])) - { - return true; - } - } - return false; - } - - - public boolean rebel_remembrance_day_rieekan_condition_alreadyKnowsRieekan(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_01) || groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_DOMESTICS) || groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_ENG) || groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_MUNITIONS) || groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_STRUC); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isEntertainerAndIsWaitingForSignal(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_rieekan_condition_isEntertainer(player, npc) && rebel_remembrance_day_rieekan_condition_alreadyKnowsRieekan(player, npc) && rebel_remembrance_day_rieekan_condition_hasEntertainerMissionWithTask(player, npc)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isChampion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlot(player, holiday.REMEMBRANCE_DAY_CHAMPION_BADGE); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasEntertainerMissionWithTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 0; i < holiday.ALL_REBEL_ENTERTAINER_QUESTS.length; i++) - { - testAbortScript(); - if ((groundquests.isQuestActive(player, holiday.ALL_REBEL_ENTERTAINER_QUESTS[i]) && groundquests.isTaskActive(player, holiday.ALL_REBEL_ENTERTAINER_QUESTS[i], "waitingForCredit"))) - { - return true; - } - } - return false; - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerOneNotTwo(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_01) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_02)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isImperialPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isImperial(player)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isNeutralPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return(!factions.isImperial(player) && !factions.isRebel(player)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerTwoNotThree(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_02) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_03)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerThreeNotFour(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_03) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_04)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerFourNotFive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_04) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_05)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompeletedEntertainerFiveNotSix(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_05) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_06)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isLockedOutOfRecoveryEvent(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return false; - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompleted1stMissionNot2nd(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_DOMESTICS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_DOMESTICS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_ENG) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_ENG)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_MUNITIONS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_MUNITIONS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_STRUC) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_STRUC)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompleted2ndMissionNot3rd(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_DOMESTICS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_DOMESTICS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_ENG) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_ENG)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_MUNITIONS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_MUNITIONS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_STRUC) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_STRUC)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isEnterainerOrTraderAndNeverMetRiekanIsChampion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_rieekan_condition_isEntertainerOrTrader(player, npc) && rebel_remembrance_day_rieekan_condition_isChampion(player, npc) && !rebel_remembrance_day_rieekan_condition_alreadyKnowsRieekan(player, npc)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isChampionKnowsKaythree(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (rebel_remembrance_day_rieekan_condition_isChampion(player, npc) && rebel_remembrance_day_rieekan_condition_alreadyKnowsRieekan(player, npc)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isImperialOnLeave(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isImperial(player) && factions.isOnLeave(player)); - - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompleted3rdMissionNot4th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_DOMESTICS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_DOMESTICS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_ENG) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_ENG)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_MUNITIONS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_MUNITIONS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_STRUC) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_STRUC)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompleted4thMissionNot5th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_DOMESTICS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_DOMESTICS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_ENG) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_ENG)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_MUNITIONS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_MUNITIONS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_STRUC) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_STRUC)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompleted5thMissionNot6th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_DOMESTICS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_DOMESTICS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_ENG) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_ENG)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_MUNITIONS) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_MUNITIONS)) || (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_STRUC) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_STRUC)); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompleted6thMission(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_DOMESTICS) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_ENG) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_MUNITIONS) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_STRUC) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_06); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isReadyForFirstSupplyDrop(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return rebel_remembrance_day_rieekan_condition_hasCompletedFirstMission(player, npc) && rebel_remembrance_day_rieekan_condition_hasSupplyDropMissionWithTask(player, npc); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isEntertainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.ENTERTAINER); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.TRADER); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isStructuresTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasSkill(player, "class_structures_phase1_novice"); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isEngineeringTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasSkill(player, "class_engineering_phase1_novice"); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isMunitionsTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasSkill(player, "class_munitions_phase1_novice"); - } - - - public boolean rebel_remembrance_day_rieekan_condition_isDomesticsTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasSkill(player, "class_domestics_phase1_novice"); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasCompletedFirstMission(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_DOMESTICS) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_ENG) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_MUNITIONS) || groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_STRUC); - } - - - public boolean rebel_remembrance_day_rieekan_condition_hasSupplyDropMissionWithTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 0; i < holiday.ALL_REBEL_QUESTS.length; i++) - { - testAbortScript(); - if ((groundquests.isQuestActive(player, holiday.ALL_REBEL_QUESTS[i]) && groundquests.isTaskActive(player, holiday.ALL_REBEL_QUESTS[i], holiday.ALL_REBEL_QUESTS[i]))) - { - return true; - } - } - return false; - } - - - public void rebel_remembrance_day_rieekan_action_grantDomesticsMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_DOMESTICS); - if (getCollectionSlotValue(player, holiday.REBEL_ENGINEERING_START_SLOT) <= 0) - { - rebel_remembrance_day_rieekan_action_grantEngineeringCollectionStart(player, npc); - } - } - - - public void rebel_remembrance_day_rieekan_action_grantDomesticsMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_DOMESTICS); - } - - - public void rebel_remembrance_day_rieekan_action_grantDomesticsMissionThree(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_DOMESTICS); - } - - - public void rebel_remembrance_day_rieekan_action_grantDomesticsMissionFour(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_DOMESTICS); - } - - - public void rebel_remembrance_day_rieekan_action_grantDomesticsMissionFive(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_DOMESTICS); - } - - - public void rebel_remembrance_day_rieekan_action_grantDomesticsMissionSix(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_DOMESTICS); - } - - - public void rebel_remembrance_day_rieekan_action_grantEntertainerMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_01); - modifyCollectionSlotValue(player, holiday.REBEL_ENTERTAINER_START_SLOT, 1); - } - - - public void rebel_remembrance_day_rieekan_action_grantEntertainerMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_02); - } - - - public void rebel_remembrance_day_rieekan_action_checkHolidayTimeStampOnPlayer(obj_id player, obj_id npc) throws InterruptedException - { - - } - - - public void rebel_remembrance_day_rieekan_action_grantEngineeringCollectionStart(obj_id player, obj_id npc) throws InterruptedException - { - if (getCollectionSlotValue(player, holiday.REBEL_ENGINEERING_START_SLOT) <= 0) - { - modifyCollectionSlotValue(player, holiday.REBEL_ENGINEERING_START_SLOT, 1); - } - - } - - - public void rebel_remembrance_day_rieekan_action_grantEngineeringMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_ENG); - if (getCollectionSlotValue(player, holiday.REBEL_ENGINEERING_START_SLOT) <= 0) - { - rebel_remembrance_day_rieekan_action_grantEngineeringCollectionStart(player, npc); - } - } - - - public void rebel_remembrance_day_rieekan_action_grantEngineeringMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_ENG); - } - - - public void rebel_remembrance_day_rieekan_action_grantEngineeringMissionThree(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_ENG); - } - - - public void rebel_remembrance_day_rieekan_action_grantEngineeringMissionFour(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_ENG); - } - - - public void rebel_remembrance_day_rieekan_action_grantEngineeringMissionFive(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_ENG); - } - - - public void rebel_remembrance_day_rieekan_action_grantEnigineeringMissionSix(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_ENG); - } - - - public void rebel_remembrance_day_rieekan_action_grantMunitionsMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_MUNITIONS); - if (getCollectionSlotValue(player, holiday.REBEL_ENGINEERING_START_SLOT) <= 0) - { - rebel_remembrance_day_rieekan_action_grantEngineeringCollectionStart(player, npc); - } - } - - - public void rebel_remembrance_day_rieekan_action_grantMunitionsMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_MUNITIONS); - } - - - public void rebel_remembrance_day_rieekan_action_grantMunitionsMissionThree(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_MUNITIONS); - } - - - public void rebel_remembrance_day_rieekan_action_grantMunitionsMissionFour(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_MUNITIONS); - } - - - public void rebel_remembrance_day_rieekan_action_grantMunitionsMissionFive(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_MUNITIONS); - } - - - public void rebel_remembrance_day_rieekan_action_grantMunitionsMissionSix(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_MUNITIONS); - } - - - public void rebel_remembrance_day_rieekan_action_grantStructuresMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_01_STRUC); - if (getCollectionSlotValue(player, holiday.REBEL_ENGINEERING_START_SLOT) <= 0) - { - rebel_remembrance_day_rieekan_action_grantEngineeringCollectionStart(player, npc); - } - } - - - public void rebel_remembrance_day_rieekan_action_grantStructuresMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_02_STRUC); - } - - - public void rebel_remembrance_day_rieekan_action_grantStructuresMissionThree(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_03_STRUC); - } - - - public void rebel_remembrance_day_rieekan_action_grantStructuresMissionFour(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_04_STRUC); - } - - - public void rebel_remembrance_day_rieekan_action_grantStructuresMissionFive(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_05_STRUC); - } - - - public void rebel_remembrance_day_rieekan_action_grantStructuresMissionSix(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_CRASHSITE_06_STRUC); - } - - - public void rebel_remembrance_day_rieekan_action_activateDeliverySignal(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "spokeToSupplyOfficer"); - } - - - public void rebel_remembrance_day_rieekan_action_grantEntertainerMissionThree(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_03); - } - - - public void rebel_remembrance_day_rieekan_action_grantEntertainerMissionFour(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_04); - } - - - public void rebel_remembrance_day_rieekan_action_grantEntertainerMissionFive(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_05); - } - - - public void rebel_remembrance_day_rieekan_action_grantEntertainerMissionSix(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_ENTERTAINER_06); - } - - - public void rebel_remembrance_day_rieekan_action_entertainerSignalIncrementCollection(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "creditReceived"); - if (hasCompletedCollectionSlotPrereq(player, holiday.REBEL_ENTERTAINER_COUNTER_SLOT)) - { - modifyCollectionSlotValue(player, holiday.REBEL_ENTERTAINER_COUNTER_SLOT, 1); - } - } - - - public String rebel_remembrance_day_rieekan_tokenTO_timeLeftRecruitment(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public String rebel_remembrance_day_rieekan_tokenTO_timeLeftPropaganda(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public int rebel_remembrance_day_rieekan_tokenDI_notUsed(obj_id player, obj_id npc) throws InterruptedException - { - return 0; - } - - - public int rebel_remembrance_day_rieekan_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_90")) - { - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerOneNotTwo (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_92"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerTwoNotThree (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_95"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 12); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerThreeNotFour (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerFourNotFive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_102"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompeletedEntertainerFiveNotSix (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_103"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 18); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted6thMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_108"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_91")) - { - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerOneNotTwo (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_92"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerTwoNotThree (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_95"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 12); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerThreeNotFour (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerFourNotFive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_102"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompeletedEntertainerFiveNotSix (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_103"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 18); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted6thMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_108"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_192")) - { - - if (rebel_remembrance_day_rieekan_condition_hasCompleted1stMissionNot2nd (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_197"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_198"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted2ndMissionNot3rd (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_207"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_233"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 29); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted3rdMissionNot4th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_215"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted4thMissionNot5th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_225"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_237"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 41); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted5thMissionNot6th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_230"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_243"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 46); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_289"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_91")) - { - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerOneNotTwo (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_92"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerTwoNotThree (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_95"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 12); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerThreeNotFour (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_96"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompletedEntertainerFourNotFive (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_102"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompeletedEntertainerFiveNotSix (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_103"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 18); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted6thMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_108"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_192")) - { - - if (rebel_remembrance_day_rieekan_condition_hasCompleted1stMissionNot2nd (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_197"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_198"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted2ndMissionNot3rd (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_207"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_233"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 29); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted3rdMissionNot4th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_214"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_215"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted4thMissionNot5th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_225"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_237"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 41); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted5thMissionNot6th (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_230"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_243"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 46); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_289"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_93")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEntertainerMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_94"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_100")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEntertainerMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_104"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEntertainerMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_105"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_102")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEntertainerMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_106"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_103")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEntertainerMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_107"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_198")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_199"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_200"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 23); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_200")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_201"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_205"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 24); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_205")) - { - - if (rebel_remembrance_day_rieekan_condition_isDomesticsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantDomesticsMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_206"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isEngineeringTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEngineeringMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_153"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isMunitionsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantMunitionsMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_159"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isStructuresTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantStructuresMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_160"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_233")) - { - - if (rebel_remembrance_day_rieekan_condition_isDomesticsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantDomesticsMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_234"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isEngineeringTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEngineeringMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_165"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isMunitionsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantMunitionsMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_166"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isStructuresTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantStructuresMissionThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_167"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_215")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_216"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_217"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_217")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_218"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_291"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_291")) - { - - if (rebel_remembrance_day_rieekan_condition_isDomesticsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantDomesticsMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_293"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isEngineeringTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEngineeringMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_295"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isMunitionsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantMunitionsMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_297"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isStructuresTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantStructuresMissionFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_299"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch41(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_237")) - { - - if (rebel_remembrance_day_rieekan_condition_isDomesticsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantDomesticsMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_238"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isEngineeringTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEngineeringMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_183"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isMunitionsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantMunitionsMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_184"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isStructuresTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantStructuresMissionFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_185"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch46(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_243")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_244"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_245"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 47); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch47(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_245")) - { - - if (rebel_remembrance_day_rieekan_condition_isDomesticsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantDomesticsMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_246"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isEngineeringTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEnigineeringMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_191"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isMunitionsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantMunitionsMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_204"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isStructuresTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantStructuresMissionSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_249"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch53(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_193")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_194"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_149"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_284"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 58); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_195")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_196"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_149"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_284"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 58); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch54(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_149")) - { - - if (rebel_remembrance_day_rieekan_condition_isEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_151"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_154"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_158"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 59); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isTrader (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_254"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_256"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_270"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 63); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_280")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_282"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_284")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_286"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch55(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_149")) - { - - if (rebel_remembrance_day_rieekan_condition_isEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_151"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_154"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_158"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 59); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isTrader (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_254"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_256"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_270"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 63); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_280")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_282"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_284")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_286"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch56(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_137")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_140"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_149"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_284"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 58); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_144")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_147"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_149"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_280"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_284"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 58); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch57(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_149")) - { - - if (rebel_remembrance_day_rieekan_condition_isEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_151"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_154"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_158"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 59); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isTrader (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_254"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_256"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_270"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 63); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_280")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_282"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_284")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_286"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch58(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_149")) - { - - if (rebel_remembrance_day_rieekan_condition_isEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_151"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_154"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_158"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 59); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isTrader (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_254"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_256"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_270"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 63); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_280")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_282"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_284")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_286"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch59(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_154")) - { - - if (rebel_remembrance_day_rieekan_condition_isEntertainer (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEntertainerMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_156"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_158")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_171"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 61); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch61(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_177")) - { - - if (rebel_remembrance_day_rieekan_condition_isEntertainer (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEntertainerMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_190"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch63(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_256")) - { - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_258"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_260"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 64); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_270")) - { - - if (rebel_remembrance_day_rieekan_condition_isDomesticsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantDomesticsMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_272"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isEngineeringTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEngineeringMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_274"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isMunitionsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantMunitionsMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_276"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isStructuresTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantStructuresMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_278"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_rieekan_handleBranch64(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_260")) - { - - if (rebel_remembrance_day_rieekan_condition_isDomesticsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantDomesticsMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_272"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isEngineeringTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantEngineeringMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_274"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isMunitionsTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantMunitionsMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_276"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isStructuresTrader (player, npc)) - { - rebel_remembrance_day_rieekan_action_grantStructuresMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_278"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.rebel_remembrance_day_rieekan"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.rebel_remembrance_day_rieekan"); - - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (rebel_remembrance_day_rieekan_condition_isNeutralPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_85"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isImperialPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_133"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isReadyForFirstSupplyDrop (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_300"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasNotCraftedSupplies (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_87"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isNotFirstSupplyDropMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_301"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_hasCompleted6thMission (player, npc)) - { - doAnimationAction (npc, "salute1"); - - doAnimationAction (player, "salute1"); - - string_id message = new string_id (c_stringFile, "s_145"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isEntertainerAndIsWaitingForSignal (player, npc)) - { - rebel_remembrance_day_rieekan_action_entertainerSignalIncrementCollection (player, npc); - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_90"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_remembrance_day_rieekan", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isChampionKnowsKaythree (player, npc)) - { - rebel_remembrance_day_rieekan_action_checkHolidayTimeStampOnPlayer (player, npc); - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_91"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_192"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 9); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_remembrance_day_rieekan", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_alreadyKnowsRieekan (player, npc)) - { - doAnimationAction (npc, "salute1"); - - doAnimationAction (player, "salute1"); - - string_id message = new string_id (c_stringFile, "s_116"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_91"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_192"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 9); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_remembrance_day_rieekan", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isEnterainerOrTraderAndNeverMetRiekanIsChampion (player, npc)) - { - doAnimationAction (npc, "salute2"); - - doAnimationAction (player, "salute2"); - - string_id message = new string_id (c_stringFile, "s_129"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition_isTrader (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition_isEntertainer (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_193"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_195"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 53); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_remembrance_day_rieekan", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isEntertainerOrTraderAndNeverMetNotChampion (player, npc)) - { - doAnimationAction (npc, "salute2"); - - doAnimationAction (player, "salute2"); - - string_id message = new string_id (c_stringFile, "s_135"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_137"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId", 56); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_remembrance_day_rieekan", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition_isChampion (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_131"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_rieekan_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_288"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("rebel_remembrance_day_rieekan")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - if (branchId == 7 && rebel_remembrance_day_rieekan_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && rebel_remembrance_day_rieekan_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && rebel_remembrance_day_rieekan_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && rebel_remembrance_day_rieekan_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && rebel_remembrance_day_rieekan_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && rebel_remembrance_day_rieekan_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && rebel_remembrance_day_rieekan_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && rebel_remembrance_day_rieekan_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && rebel_remembrance_day_rieekan_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && rebel_remembrance_day_rieekan_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && rebel_remembrance_day_rieekan_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && rebel_remembrance_day_rieekan_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && rebel_remembrance_day_rieekan_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && rebel_remembrance_day_rieekan_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && rebel_remembrance_day_rieekan_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 41 && rebel_remembrance_day_rieekan_handleBranch41 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 46 && rebel_remembrance_day_rieekan_handleBranch46 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 47 && rebel_remembrance_day_rieekan_handleBranch47 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 53 && rebel_remembrance_day_rieekan_handleBranch53 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 54 && rebel_remembrance_day_rieekan_handleBranch54 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 55 && rebel_remembrance_day_rieekan_handleBranch55 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 56 && rebel_remembrance_day_rieekan_handleBranch56 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 57 && rebel_remembrance_day_rieekan_handleBranch57 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 58 && rebel_remembrance_day_rieekan_handleBranch58 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 59 && rebel_remembrance_day_rieekan_handleBranch59 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 61 && rebel_remembrance_day_rieekan_handleBranch61 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 63 && rebel_remembrance_day_rieekan_handleBranch63 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 64 && rebel_remembrance_day_rieekan_handleBranch64 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_rieekan.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge.java b/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge.java deleted file mode 100644 index 5abecb70c..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge.java +++ /dev/null @@ -1,490 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.buff; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.static_item; -import script.library.utils; - - -public class rebel_remembrance_day_wedge extends script.base_script -{ - public rebel_remembrance_day_wedge() - { - } - String c_stringFile = "conversation/rebel_remembrance_day_wedge"; - - - public boolean rebel_remembrance_day_wedge_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean rebel_remembrance_day_wedge_condition_isImperialPlayer(obj_id player, obj_id npc) throws InterruptedException - { - rebel_remembrance_day_wedge_action_faceTo(npc, player); - return (factions.isImperial(player)); - } - - - public boolean rebel_remembrance_day_wedge_condition_isNeutralPlayer(obj_id player, obj_id npc) throws InterruptedException - { - return(!factions.isImperial(player) && !factions.isRebel(player)); - } - - - public void rebel_remembrance_day_wedge_action_faceTo(obj_id player, obj_id npc) throws InterruptedException - { - rebel_remembrance_day_wedge_action_faceTo(npc, player); - } - - - public void rebel_remembrance_day_wedge_action_spawnTroopers(obj_id player, obj_id npc) throws InterruptedException - { - - for (int i = 0; i < 3; i++) - { - testAbortScript(); - location guardLocation = groundquests.getRandom2DLocationAroundLocation(npc, 1, 1, 5, 12); - int mobLevel = getLevel(player); - obj_id guard = create.object("rebel_emperorsday_ceremony_sentry", guardLocation, mobLevel); - attachScript(guard, "event.emp_day.factional_guard_self_destruct"); - startCombat(guard, player); - } - } - - - public void rebel_remembrance_day_wedge_action_grantFirstMission(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01); - } - - - public int rebel_remembrance_day_wedge_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_8")) - { - - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - string_id message = new string_id (c_stringFile, "s_9"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_10"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_10")) - { - - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "rub_chin_thoughtful"); - - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_17"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_17")) - { - - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - string_id message = new string_id (c_stringFile, "s_18"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_20")) - { - - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - string_id message = new string_id (c_stringFile, "s_22"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_24"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_24")) - { - - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - string_id message = new string_id (c_stringFile, "s_25"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.rebel_remembrance_day_wedge"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.rebel_remembrance_day_wedge"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (rebel_remembrance_day_wedge_condition_isImperialPlayer (player, npc)) - { - rebel_remembrance_day_wedge_action_spawnTroopers (player, npc); - - string_id message = new string_id (c_stringFile, "s_26"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_condition_isNeutralPlayer (player, npc)) - { - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - string_id message = new string_id (c_stringFile, "s_27"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_action_faceTo (player, npc); - - string_id message = new string_id (c_stringFile, "s_7"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_8"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId", 3); - - npcStartConversation (player, npc, "rebel_remembrance_day_wedge", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("rebel_remembrance_day_wedge")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - if (branchId == 3 && rebel_remembrance_day_wedge_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && rebel_remembrance_day_wedge_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && rebel_remembrance_day_wedge_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && rebel_remembrance_day_wedge_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && rebel_remembrance_day_wedge_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge_antilles.java b/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge_antilles.java deleted file mode 100644 index e268ac094..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/rebel_remembrance_day_wedge_antilles.java +++ /dev/null @@ -1,2973 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.buff; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.static_item; -import script.library.utils; - - -public class rebel_remembrance_day_wedge_antilles extends script.base_script -{ - public rebel_remembrance_day_wedge_antilles() - { - } - String c_stringFile = "conversation/rebel_remembrance_day_wedge_antilles"; - - - public boolean rebel_remembrance_day_wedge_antilles_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_isBelow60thLevelOrTraderEntertainer(obj_id player, obj_id npc) throws InterruptedException - { - return (rebel_remembrance_day_wedge_antilles_condition_isBelow60thLevel(player, npc) || rebel_remembrance_day_wedge_antilles_condition_isEntertainer(player, npc) || rebel_remembrance_day_wedge_antilles_condition_isTrader(player, npc)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_isEntertainer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.ENTERTAINER); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_isTrader(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return utils.isProfession(player, utils.TRADER); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_isBelow60thLevel(obj_id player, obj_id npc) throws InterruptedException - { - return (60 > getLevel(player)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_hasAMisionActive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - for (int i = 0; i < holiday.ALL_REBEL_QUESTS.length; i++) - { - testAbortScript(); - if (groundquests.isQuestActive(player, holiday.ALL_REBEL_QUESTS[i])) - { - return true; - } - } - return false; - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_hasAnIncompleteCombatMission(obj_id player, obj_id npc) throws InterruptedException - { - return (!rebel_remembrance_day_wedge_antilles_condition_completed7thQuest(player, npc) && (rebel_remembrance_day_wedge_antilles_condition_hasCompleted1stMissionNot2nd(player, npc) || rebel_remembrance_day_wedge_antilles_condition_hasCompleted2ndMissionNot3rd(player, npc) || rebel_remembrance_day_wedge_antilles_condition_hasCompleted3rdMissionNot4th(player, npc) || rebel_remembrance_day_wedge_antilles_condition_hasCompleted4thMissionNot5th(player, npc) || rebel_remembrance_day_wedge_antilles_condition_hasCompleted5thMissionNot6th(player, npc) || rebel_remembrance_day_wedge_antilles_condition_hasCompleted6thMissionNot7th(player, npc))); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_isOnSecondMission(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_02) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_COMBAT_03)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_isChampion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasCompletedCollectionSlot(player, holiday.REMEMBRANCE_DAY_CHAMPION_BADGE); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_completed7thQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_07); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_completed7thQuestNoAutograph(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_remembrance_day_wedge_antilles_condition_completed7thQuest(player, npc) && !groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_COMBAT_AUTOGRAPH); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_isImperialPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isImperial(player)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_isNeutralPlayer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return(!factions.isImperial(player) && !factions.isRebel(player)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_completed7thQuestHasAutograph(obj_id player, obj_id npc) throws InterruptedException - { - return rebel_remembrance_day_wedge_antilles_condition_completed7thQuest(player, npc) && groundquests.isQuestActiveOrComplete(player, holiday.EMPIREDAYQUEST_REB_COMBAT_AUTOGRAPH); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_hasCompleted7thMission(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_07)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_hasNotCompletedMission1(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_hasCompleted1stMissionNot2nd(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_02)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_hasCompleted2ndMissionNot3rd(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_02) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_03)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_hasCompleted3rdMissionNot4th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_03) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_04)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_hasCompleted4thMissionNot5th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_04) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_05)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_hasCompleted5thMissionNot6th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_05) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_06)); - } - - - public boolean rebel_remembrance_day_wedge_antilles_condition_hasCompleted6thMissionNot7th(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_06) && !groundquests.hasCompletedQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_07); - } - - - public void rebel_remembrance_day_wedge_antilles_action_grantMissionOne(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01); - } - - - public void rebel_remembrance_day_wedge_antilles_action_grantMissionTwo(obj_id player, obj_id npc) throws InterruptedException - { - if (getCollectionSlotValue(player, holiday.REBEL_RESCUE_START_SLOT) <= 0) - { - modifyCollectionSlotValue(player, holiday.REBEL_RESCUE_START_SLOT, 1); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_02); - } - - - public void rebel_remembrance_day_wedge_antilles_action_revokeMission2Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_02)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_02); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_02); - } - - - public void rebel_remembrance_day_wedge_antilles_action_revokeMission3Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_03)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_03); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_03); - } - - - public void rebel_remembrance_day_wedge_antilles_action_revokeMission4Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_04)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_04); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_04); - } - - - public void rebel_remembrance_day_wedge_antilles_action_spawnTroopers(obj_id player, obj_id npc) throws InterruptedException - { - - for (int i = 0; i < 3; i++) - { - testAbortScript(); - location guardLocation = groundquests.getRandom2DLocationAroundLocation(npc, 1, 1, 5, 12); - int mobLevel = getLevel(player); - obj_id guard = create.object("rebel_emperorsday_ceremony_sentry", guardLocation, mobLevel); - attachScript(guard, "event.emp_day.factional_guard_self_destruct"); - startCombat(guard, player); - } - } - - - public void rebel_remembrance_day_wedge_antilles_action_revokeMission5Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_05)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_05); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_05); - } - - - public void rebel_remembrance_day_wedge_antilles_action_revokeMission6Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_06)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_06); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_06); - } - - - public void rebel_remembrance_day_wedge_antilles_action_revokeMission7Regrant(obj_id player, obj_id npc) throws InterruptedException - { - if (groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_07)) - { - groundquests.clearQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_07); - } - - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_07); - } - - - public void rebel_remembrance_day_wedge_antilles_action_grantAutograph(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, holiday.EMPIREDAYQUEST_REB_COMBAT_AUTOGRAPH); - } - - - public void rebel_remembrance_day_wedge_antilles_action_giveWaypoint(obj_id player, obj_id npc) throws InterruptedException - { - location loc = new location(4000, 37, -6168, "yavin4"); - obj_id wpt = createWaypointInDatapad(player, loc); - setWaypointName(wpt, "Detention Facility"); - setWaypointActive(wpt, true); - } - - - public String rebel_remembrance_day_wedge_antilles_tokenTO_timeLeftRecruitment(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public String rebel_remembrance_day_wedge_antilles_tokenTO_timeLeftPropaganda(obj_id player, obj_id npc) throws InterruptedException - { - String returnString = holiday.getTimeRemainingBeforeLockoutRemoved(player, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - if (returnString == null || returnString.equals("")) - { - return "might have to contact Customer Service. I can't seem to get any time data off your character."; - } - return returnString; - } - - - public int rebel_remembrance_day_wedge_antilles_tokenDI_notUsed(obj_id player, obj_id npc) throws InterruptedException - { - return 0; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_83")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_antilles_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_84")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_87"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition_hasCompleted1stMissionNot2nd (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_wedge_antilles_condition_hasCompleted2ndMissionNot3rd (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_wedge_antilles_condition_hasCompleted3rdMissionNot4th (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (rebel_remembrance_day_wedge_antilles_condition_hasCompleted4thMissionNot5th (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (rebel_remembrance_day_wedge_antilles_condition_hasCompleted5thMissionNot6th (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (rebel_remembrance_day_wedge_antilles_condition_hasCompleted6thMissionNot7th (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_112"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_122"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_89")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_100"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_93")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_103"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_104"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_101")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_107"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_112")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_115"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_122")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_129"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_140")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_145"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_149"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_100")) - { - rebel_remembrance_day_wedge_antilles_action_revokeMission2Regrant (player, npc); - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_175"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_104")) - { - rebel_remembrance_day_wedge_antilles_action_revokeMission3Regrant (player, npc); - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_106"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_123"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_123")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_antilles_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_111")) - { - rebel_remembrance_day_wedge_antilles_action_revokeMission4Regrant (player, npc); - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_124")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_antilles_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_117")) - { - rebel_remembrance_day_wedge_antilles_action_revokeMission5Regrant (player, npc); - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_119"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_125")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_antilles_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_129")) - { - rebel_remembrance_day_wedge_antilles_action_revokeMission6Regrant (player, npc); - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_131"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_135")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_antilles_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_149")) - { - rebel_remembrance_day_wedge_antilles_action_revokeMission7Regrant (player, npc); - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_153"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_156")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_antilles_action_giveWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_85"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_158")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_160"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_161"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_161")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "huh"); - - string_id message = new string_id (c_stringFile, "s_162"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_163"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_163")) - { - doAnimationAction (player, "embarrassed"); - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - rebel_remembrance_day_wedge_antilles_action_grantAutograph (player, npc); - - string_id message = new string_id (c_stringFile, "s_164"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (rebel_remembrance_day_wedge_antilles_condition_isBelow60thLevel (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_53"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 24); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_antilles_condition_isTrader (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 28); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_antilles_condition_isEntertainer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_75"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 30); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_80"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 31); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_53")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_55"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_57")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_59"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_61"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_61")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_63"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 31); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_82")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_91"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_67")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_69"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_71")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_59"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_61"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_75")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_69"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_77")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_59"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_61"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_82")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_91"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_91")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_94"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_96"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_96")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_98"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_105"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_118"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_132"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_105")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_109"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_118")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "backhand_threaten"); - - string_id message = new string_id (c_stringFile, "s_121"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_128"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_132")) - { - doAnimationAction (player, "shake_head_no"); - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_antilles_action_grantMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_137"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_114")) - { - doAnimationAction (player, "shrug_shoulders"); - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_antilles_action_grantMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_137"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_128")) - { - doAnimationAction (player, "shrug_shoulders"); - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_antilles_action_grantMissionTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_137"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch39(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_143")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - string_id message = new string_id (c_stringFile, "s_146"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_148"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch40(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_148")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "rub_chin_thoughtful"); - - string_id message = new string_id (c_stringFile, "s_151"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_154"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 41); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch41(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_154")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_159"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_167"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch42(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_167")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_169"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_171"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rebel_remembrance_day_wedge_antilles_handleBranch43(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_171")) - { - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - rebel_remembrance_day_wedge_antilles_action_grantMissionOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_174"); - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.rebel_remembrance_day_wedge_antilles"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setCondition (self, CONDITION_CONVERSABLE); - setCondition (self, CONDITION_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.rebel_remembrance_day_wedge_antilles"); - - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (rebel_remembrance_day_wedge_antilles_condition_isImperialPlayer (player, npc)) - { - doAnimationAction (npc, "weeping"); - - string_id message = new string_id (c_stringFile, "s_133"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_antilles_condition_isNeutralPlayer (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_134"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_antilles_condition_hasAnIncompleteCombatMission (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 3); - - npcStartConversation (player, npc, "rebel_remembrance_day_wedge_antilles", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_antilles_condition_completed7thQuestHasAutograph (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_165"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_antilles_condition_completed7thQuestNoAutograph (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_157"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_158"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 19); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rebel_remembrance_day_wedge_antilles", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_antilles_condition_hasCompleted1stMissionNot2nd (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 23); - - npcStartConversation (player, npc, "rebel_remembrance_day_wedge_antilles", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_antilles_condition_hasNotCompletedMission1 (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_173"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_141"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rebel_remembrance_day_wedge_antilles_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_143"); - } - - utils.setScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId", 39); - - npcStartConversation (player, npc, "rebel_remembrance_day_wedge_antilles", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("rebel_remembrance_day_wedge_antilles")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - if (branchId == 3 && rebel_remembrance_day_wedge_antilles_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && rebel_remembrance_day_wedge_antilles_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && rebel_remembrance_day_wedge_antilles_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && rebel_remembrance_day_wedge_antilles_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && rebel_remembrance_day_wedge_antilles_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && rebel_remembrance_day_wedge_antilles_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && rebel_remembrance_day_wedge_antilles_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && rebel_remembrance_day_wedge_antilles_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && rebel_remembrance_day_wedge_antilles_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && rebel_remembrance_day_wedge_antilles_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && rebel_remembrance_day_wedge_antilles_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && rebel_remembrance_day_wedge_antilles_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && rebel_remembrance_day_wedge_antilles_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && rebel_remembrance_day_wedge_antilles_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && rebel_remembrance_day_wedge_antilles_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && rebel_remembrance_day_wedge_antilles_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && rebel_remembrance_day_wedge_antilles_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && rebel_remembrance_day_wedge_antilles_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && rebel_remembrance_day_wedge_antilles_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && rebel_remembrance_day_wedge_antilles_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && rebel_remembrance_day_wedge_antilles_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && rebel_remembrance_day_wedge_antilles_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && rebel_remembrance_day_wedge_antilles_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && rebel_remembrance_day_wedge_antilles_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && rebel_remembrance_day_wedge_antilles_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && rebel_remembrance_day_wedge_antilles_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && rebel_remembrance_day_wedge_antilles_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && rebel_remembrance_day_wedge_antilles_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 39 && rebel_remembrance_day_wedge_antilles_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 40 && rebel_remembrance_day_wedge_antilles_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 41 && rebel_remembrance_day_wedge_antilles_handleBranch41 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 42 && rebel_remembrance_day_wedge_antilles_handleBranch42 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 43 && rebel_remembrance_day_wedge_antilles_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.rebel_remembrance_day_wedge_antilles.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/rek_thelcar.java b/sku.0/sys.server/compiled/game/script/conversation/rek_thelcar.java deleted file mode 100644 index 03b588419..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/rek_thelcar.java +++ /dev/null @@ -1,2137 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.groundquests; -import script.library.static_item; -import script.library.utils; - - -public class rek_thelcar extends script.base_script -{ - public rek_thelcar() - { - } - String c_stringFile = "conversation/rek_thelcar"; - - - public boolean rek_thelcar_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean rek_thelcar_condition_isEligibleSurveillance(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_surveillance_collection") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean rek_thelcar_condition_isElligibleMinerDna(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_miner_dna_collection") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_surveillance_collection") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine"); - } - - - public boolean rek_thelcar_condition_isElligibleQuestion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_question_scientist_collection") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_miner_dna_collection") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility"); - } - - - public boolean rek_thelcar_condition_hasReturnedMinerDna(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_miner_dna_collection", "returnExtractMinerDnaComplete"); - } - - - public boolean rek_thelcar_condition_hasReturnedQuestion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_question_scientist_collection", "returnQuestionComplete"); - } - - - public boolean rek_thelcar_condition_hasSurveillanceNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_pirate_surveillance_collection"); - } - - - public boolean rek_thelcar_condition_hasMinerDnaNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_miner_dna_collection"); - } - - - public boolean rek_thelcar_condition_hasQuestionNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_question_scientist_collection"); - } - - - public boolean rek_thelcar_condition_hasReturnedSurveillance(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_surveillance_collection", "returnSurveillanceComplete"); - } - - - public boolean rek_thelcar_condition_hasntDoneSurveillance(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean rek_thelcar_condition_hasntDoneMinerDNA(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_surveillance_collection"); - } - - - public boolean rek_thelcar_condition_hasntDoneQuestion(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_miner_dna_collection"); - - } - - - public boolean rek_thelcar_condition_hasCompletedScientistCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "nyms_question_scientist") && groundquests.isQuestActive(player, "u16_nym_themepark_question_scientist_collection"); - } - - - public boolean rek_thelcar_condition_hasCompletedDNACollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "nyms_miner_dna") && groundquests.isQuestActive(player, "u16_nym_themepark_miner_dna_collection"); - } - - - public boolean rek_thelcar_condition_hasCompletedDeviceCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "nyms_surveillance_device") && groundquests.isQuestActive(player, "u16_nym_themepark_pirate_surveillance_collection"); - } - - - public void rek_thelcar_action_grantSurveillanceQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_pirate_surveillance_collection"); - if (!hasCompletedCollectionSlot(player, "nym_surveillance_activation")) - { - modifyCollectionSlotValue(player, "nym_surveillance_activation", 1); - } - } - - - public void rek_thelcar_action_grantMinerDnaQuest(obj_id player, obj_id npc) throws InterruptedException - { - obj_id playerInv = utils.getInventoryContainer(player); - static_item.createNewItemFunction("item_nym_themepark_dna_extractor", playerInv); - groundquests.grantQuest(player, "u16_nym_themepark_miner_dna_collection"); - if (!hasCompletedCollectionSlot(player, "nym_miner_dna_activation")) - { - modifyCollectionSlotValue(player, "nym_miner_dna_activation", 1); - } - } - - - public void rek_thelcar_action_grantQuestionScientistQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_question_scientist_collection"); - if (!hasCompletedCollectionSlot(player, "nym_question_scientist_activation")) - { - modifyCollectionSlotValue(player, "nym_question_scientist_activation", 1); - } - } - - - public void rek_thelcar_action_completeSurveillanceQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedSurveillance"); - if (!hasCompletedCollectionSlot(player, "icon_nyms_master_collection_1_surveillance")) - { - modifyCollectionSlotValue(player, "icon_nyms_master_collection_1_surveillance", 1); - } - } - - - public void rek_thelcar_action_completeMinerDnaQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedMinerDna"); - if (!hasCompletedCollectionSlot(player, "icon_nyms_master_collection_1_dna")) - { - modifyCollectionSlotValue(player, "icon_nyms_master_collection_1_dna", 1); - } - } - - - public void rek_thelcar_action_completeQuestionQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedQuestion"); - if (!hasCompletedCollectionSlot(player, "icon_nyms_master_collection_1_scientist")) - { - modifyCollectionSlotValue(player, "icon_nyms_master_collection_1_scientist", 1); - } - } - - - public void rek_thelcar_action_BruteForceCompleteScientist(obj_id player, obj_id npc) throws InterruptedException - { - if (rek_thelcar_condition_hasCompletedDNACollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_question_scientist_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_question_scientist_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_question_scientist_collection"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public void rek_thelcar_action_BruteForceCompleteDNA(obj_id player, obj_id npc) throws InterruptedException - { - if (rek_thelcar_condition_hasCompletedDNACollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_miner_dna_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_miner_dna_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_miner_dna_collection"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public void rek_thelcar_action_BruteForceCompleteDevice(obj_id player, obj_id npc) throws InterruptedException - { - if (rek_thelcar_condition_hasCompletedDeviceCollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_pirate_surveillance_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_pirate_surveillance_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_pirate_surveillance_collection"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public int rek_thelcar_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_114")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "whisper"); - - string_id message = new string_id (c_stringFile, "s_115"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_116"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_116")) - { - doAnimationAction (player, "cough_polite"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - rek_thelcar_action_completeQuestionQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_117"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_105")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_106"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_44")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - string_id message = new string_id (c_stringFile, "s_45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_80")) - { - doAnimationAction (player, "check_wrist_device"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "hug_self"); - - string_id message = new string_id (c_stringFile, "s_104"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_46")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_disgust"); - - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_48"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_48")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - string_id message = new string_id (c_stringFile, "s_49"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_50"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_52"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_50")) - { - doAnimationAction (player, "huh"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shoo"); - - rek_thelcar_action_grantQuestionScientistQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_51"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_52")) - { - doAnimationAction (player, "wave_on_dismissing"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "sigh_deeply"); - - string_id message = new string_id (c_stringFile, "s_53"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_109")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "rub_chin_thoughtful"); - - string_id message = new string_id (c_stringFile, "s_110"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_111")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - rek_thelcar_action_completeMinerDnaQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_112"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_102")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_103"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - doAnimationAction (player, "nod"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_multiple"); - - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_41")) - { - doAnimationAction (player, "shake_head_no"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_54"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_79")) - { - doAnimationAction (player, "check_wrist_device"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_on_dismissing"); - - string_id message = new string_id (c_stringFile, "s_101"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_57")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_hands"); - - string_id message = new string_id (c_stringFile, "s_59"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_61"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_57")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_hands"); - - string_id message = new string_id (c_stringFile, "s_59"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_61"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_61")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "poke"); - - string_id message = new string_id (c_stringFile, "s_63"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_65"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_69"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_65")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shoo"); - - rek_thelcar_action_grantMinerDnaQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_67"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_69")) - { - doAnimationAction (player, "thumbs_up"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - string_id message = new string_id (c_stringFile, "s_71"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_87")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "hands_above_head"); - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_89")) - { - doAnimationAction (player, "shrug_shoulders"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "bow5"); - - rek_thelcar_action_completeSurveillanceQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_90"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_93")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shoo"); - - string_id message = new string_id (c_stringFile, "s_95"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_99")) - { - doAnimationAction (player, "shrug_shoulders"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - doAnimationAction (player, "rub_chin_thoughtful"); - - string_id message = new string_id (c_stringFile, "s_107"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_135")) - { - doAnimationAction (player, "check_wrist_device"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - string_id message = new string_id (c_stringFile, "s_139"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_119")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "hands_behind_head"); - - string_id message = new string_id (c_stringFile, "s_121"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_123"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_123")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "laugh"); - - string_id message = new string_id (c_stringFile, "s_125"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_127"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_131"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int rek_thelcar_handleBranch39(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_127")) - { - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shoo"); - - rek_thelcar_action_grantSurveillanceQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_129"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_131")) - { - doAnimationAction (player, "check_wrist_device"); - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - string_id message = new string_id (c_stringFile, "s_133"); - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.rek_thelcar"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.rek_thelcar"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (rek_thelcar_condition_hasReturnedQuestion (player, npc)) - { - doAnimationAction (npc, "hair_flip"); - - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_114"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 1); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rek_thelcar", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasCompletedScientistCollection (player, npc)) - { - rek_thelcar_action_BruteForceCompleteScientist (player, npc); - - string_id message = new string_id (c_stringFile, "s_142"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasQuestionNotComplete (player, npc)) - { - doAnimationAction (npc, "applause_excited"); - - string_id message = new string_id (c_stringFile, "s_85"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_105"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 5); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rek_thelcar", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_isElligibleQuestion (player, npc)) - { - doAnimationAction (npc, "greet"); - - string_id message = new string_id (c_stringFile, "s_43"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_44"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_80"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 7); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rek_thelcar", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasntDoneQuestion (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_137"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasReturnedMinerDna (player, npc)) - { - doAnimationAction (npc, "bounce"); - - string_id message = new string_id (c_stringFile, "s_108"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 15); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rek_thelcar", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasCompletedDNACollection (player, npc)) - { - rek_thelcar_action_BruteForceCompleteDNA (player, npc); - - string_id message = new string_id (c_stringFile, "s_144"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasMinerDnaNotComplete (player, npc)) - { - doAnimationAction (npc, "bounce"); - - string_id message = new string_id (c_stringFile, "s_84"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_102"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 19); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rek_thelcar", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_isElligibleMinerDna (player, npc)) - { - doAnimationAction (npc, "greet"); - - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_41"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 21); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rek_thelcar", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasntDoneMinerDNA (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_136"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasReturnedSurveillance (player, npc)) - { - doAnimationAction (npc, "greet"); - - string_id message = new string_id (c_stringFile, "s_86"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_87"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 30); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rek_thelcar", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasCompletedDeviceCollection (player, npc)) - { - rek_thelcar_action_BruteForceCompleteDevice (player, npc); - - string_id message = new string_id (c_stringFile, "s_146"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasSurveillanceNotComplete (player, npc)) - { - doAnimationAction (npc, "applause_excited"); - - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_93"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 34); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rek_thelcar", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_isEligibleSurveillance (player, npc)) - { - doAnimationAction (npc, "beckon"); - - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_99"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.rek_thelcar.branchId", 36); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "rek_thelcar", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition_hasntDoneSurveillance (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_141"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (rek_thelcar_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "hi5_tandem"); - - string_id message = new string_id (c_stringFile, "s_145"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("rek_thelcar")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.rek_thelcar.branchId"); - - if (branchId == 1 && rek_thelcar_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && rek_thelcar_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && rek_thelcar_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && rek_thelcar_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && rek_thelcar_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && rek_thelcar_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && rek_thelcar_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && rek_thelcar_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && rek_thelcar_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && rek_thelcar_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && rek_thelcar_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && rek_thelcar_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && rek_thelcar_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && rek_thelcar_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && rek_thelcar_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && rek_thelcar_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && rek_thelcar_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && rek_thelcar_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && rek_thelcar_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && rek_thelcar_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && rek_thelcar_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 39 && rek_thelcar_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.rek_thelcar.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/scientist_collection.java b/sku.0/sys.server/compiled/game/script/conversation/scientist_collection.java deleted file mode 100644 index d5a9f1610..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/scientist_collection.java +++ /dev/null @@ -1,824 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class scientist_collection extends script.base_script -{ - public scientist_collection() - { - } - String c_stringFile = "conversation/scientist_collection"; - - - public boolean scientist_collection_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean scientist_collection_condition_isSlotOne(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_1"); - } - - - public boolean scientist_collection_condition_isSlotTen(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_10"); - } - - - public boolean scientist_collection_condition_isSlotNine(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_9"); - } - - - public boolean scientist_collection_condition_isSlotEight(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_8"); - } - - - public boolean scientist_collection_condition_isSlotSeven(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_7"); - } - - - public boolean scientist_collection_condition_isSlotSix(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_6"); - } - - - public boolean scientist_collection_condition_isSlotFive(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_5"); - } - - - public boolean scientist_collection_condition_isSlotFour(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_4"); - } - - - public boolean scientist_collection_condition_isSlotThree(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_3"); - } - - - public boolean scientist_collection_condition_isSlotTwo(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getStringObjVar(npc, "collection.slotName").equals("nyms_question_scientist:icon_nyms_question_scientist_2"); - } - - - public boolean scientist_collection_condition_playerHasQuestAndCollection(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_question_scientist_collection") && getCollectionSlotValue(player, "nym_question_scientist_activation") > 0; - } - - - public boolean scientist_collection_condition_ifNothing(obj_id player, obj_id npc) throws InterruptedException - { - return (!scientist_collection_condition_isSlotEight(player, npc) && !scientist_collection_condition_isSlotNine(player, npc) && !scientist_collection_condition_isSlotTen(player, npc) && !scientist_collection_condition_isSlotOne(player, npc) && !scientist_collection_condition_isSlotTwo(player, npc) && !scientist_collection_condition_isSlotThree(player, npc) && !scientist_collection_condition_isSlotFour(player, npc) && !scientist_collection_condition_isSlotFive(player, npc) && !scientist_collection_condition_isSlotSix(player, npc) && !scientist_collection_condition_isSlotSeven(player, npc)); - } - - - public boolean scientist_collection_condition_playerAlreadyQuestioned(obj_id player, obj_id npc) throws InterruptedException - { - if (!scientist_collection_condition_playerHasQuestAndCollection(player, npc)) - { - return false; - } - - String baseSlotName = getStringObjVar(npc, "collection.slotName"); - if (baseSlotName == null || baseSlotName.length() <= 0) - { - return false; - } - - String[] splitSlotNames = split(baseSlotName, ':'); - if (splitSlotNames == null || splitSlotNames.length < 0) - { - return false; - } - - String slotName = splitSlotNames[1]; - if (slotName == null || slotName.length() <= 0) - { - return false; - } - - return hasCompletedCollectionSlot(player, slotName); - } - - - public void scientist_collection_action_awardSlotOne(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_1")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_1", 1); - } - } - - - public void scientist_collection_action_awardSlotTwo(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_2")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_2", 1); - } - } - - - public void scientist_collection_action_awardSlotThree(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_3")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_3", 1); - } - } - - - public void scientist_collection_action_awardSlotFour(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_4")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_4", 1); - } - } - - - public void scientist_collection_action_awardSlotFive(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_5")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_5", 1); - } - } - - - public void scientist_collection_action_awardSlotSix(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_6")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_6", 1); - } - } - - - public void scientist_collection_action_awardSlotSeven(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_7")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_7", 1); - } - } - - - public void scientist_collection_action_awardSlotEight(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_8")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_8", 1); - } - } - - - public void scientist_collection_action_awardSlotNine(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_9")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_9", 1); - } - } - - - public void scientist_collection_action_awardSlotTen(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasCompletedCollectionSlot(player, "icon_nyms_question_scientist_10")) - { - modifyCollectionSlotValue(player, "icon_nyms_question_scientist_10", 1); - } - } - - - public int scientist_collection_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_6")) - { - doAnimationAction (player, "backhand_threaten"); - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "taken_aback"); - - string_id message = new string_id (c_stringFile, "s_8"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (scientist_collection_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_10"); - } - - utils.setScriptVar (player, "conversation.scientist_collection.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int scientist_collection_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_10")) - { - doAnimationAction (player, "point_accusingly"); - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "scared"); - - string_id message = new string_id (c_stringFile, "s_12"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (scientist_collection_condition_isSlotOne (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (scientist_collection_condition_isSlotTwo (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (scientist_collection_condition_isSlotThree (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (scientist_collection_condition_isSlotFour (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (scientist_collection_condition_isSlotFive (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - boolean hasResponse5 = false; - if (scientist_collection_condition_isSlotSix (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse5 = true; - } - - boolean hasResponse6 = false; - if (scientist_collection_condition_isSlotSeven (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse6 = true; - } - - boolean hasResponse7 = false; - if (scientist_collection_condition_isSlotEight (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse7 = true; - } - - boolean hasResponse8 = false; - if (scientist_collection_condition_isSlotNine (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse8 = true; - } - - boolean hasResponse9 = false; - if (scientist_collection_condition_isSlotTen (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse9 = true; - } - - boolean hasResponse10 = false; - if (scientist_collection_condition_ifNothing (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse10 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_14"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_17"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_20"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - if (hasResponse5) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54"); - } - - if (hasResponse6) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_58"); - } - - if (hasResponse7) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_62"); - } - - if (hasResponse8) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - if (hasResponse9) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_70"); - } - - if (hasResponse10) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_73"); - } - - utils.setScriptVar (player, "conversation.scientist_collection.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int scientist_collection_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_14")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotOne (player, npc); - - string_id message = new string_id (c_stringFile, "s_21"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_17")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotTwo (player, npc); - - string_id message = new string_id (c_stringFile, "s_22"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_20")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotThree (player, npc); - - string_id message = new string_id (c_stringFile, "s_24"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_26")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotFour (player, npc); - - string_id message = new string_id (c_stringFile, "s_28"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_30")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotFive (player, npc); - - string_id message = new string_id (c_stringFile, "s_32"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_54")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotSix (player, npc); - - string_id message = new string_id (c_stringFile, "s_56"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_58")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotSeven (player, npc); - - string_id message = new string_id (c_stringFile, "s_60"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_62")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotEight (player, npc); - - string_id message = new string_id (c_stringFile, "s_64"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_66")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotNine (player, npc); - - string_id message = new string_id (c_stringFile, "s_68"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_70")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - scientist_collection_action_awardSlotTen (player, npc); - - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_73")) - { - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.scientist_collection"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.scientist_collection"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (scientist_collection_condition_playerAlreadyQuestioned (player, npc)) - { - doAnimationAction (npc, "apologize"); - - string_id message = new string_id (c_stringFile, "s_49"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (scientist_collection_condition_playerHasQuestAndCollection (player, npc)) - { - doAnimationAction (npc, "blame"); - - string_id message = new string_id (c_stringFile, "s_4"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (scientist_collection_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_6"); - } - - utils.setScriptVar (player, "conversation.scientist_collection.branchId", 2); - - npcStartConversation (player, npc, "scientist_collection", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (scientist_collection_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_46"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("scientist_collection")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.scientist_collection.branchId"); - - if (branchId == 2 && scientist_collection_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && scientist_collection_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && scientist_collection_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.scientist_collection.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/sheeli.java b/sku.0/sys.server/compiled/game/script/conversation/sheeli.java deleted file mode 100644 index 587103235..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/sheeli.java +++ /dev/null @@ -1,441 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.groundquests; -import script.library.utils; - - -public class sheeli extends script.base_script -{ - public sheeli() - { - } - String c_stringFile = "conversation/sheeli"; - - - public boolean sheeli_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean sheeli_condition_isRescuer(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "rescueSheeli"); - } - - - public boolean sheeli_condition_hasArrived(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "waitingForShuttle"); - } - - - public boolean sheeli_condition_isTraveling(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return hasObjVar(npc, "traveling") && getIntObjVar(npc, "traveling") == 1 && groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "getToPickUp"); - } - - - public void sheeli_action_startEscort(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasRescuedSheeli"); - ai_lib.aiFollow(npc, player, 1.0f, 3.0f); - - setMovementRun(npc); - setBaseRunSpeed(npc, (getBaseRunSpeed(npc)-8)); - setObjVar(npc, "traveling", 1); - setObjVar(npc, "playerOwner", player); - setInvulnerable(npc, false); - setMaster(npc, player); - messageTo(npc, "checkArrivalLoopHandler", null, 5, false); - } - - - public void sheeli_action_walkFaster(obj_id player, obj_id npc) throws InterruptedException - { - setMovementRun(npc); - setBaseRunSpeed(npc, (getBaseRunSpeed(npc)-8)); - ai_lib.aiFollow(npc, player, 1.0f, 3.0f); - } - - - public int sheeli_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_8")) - { - - if (sheeli_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thank"); - - sheeli_action_startEscort (player, npc); - - string_id message = new string_id (c_stringFile, "s_10"); - utils.removeScriptVar (player, "conversation.sheeli.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.sheeli"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - CustomerServiceLog("nyms_themepark","OnAttach - init."); - messageTo(self, "startFollowingOwner", null, 3, false); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - if (!hasObjVar(self, "quest.owner")) - { - CustomerServiceLog("nyms_themepark","OnObjectMenuRequest - quest.owner not valid."); - messageTo(self, "handleDestroySelf", null, 0, false); - return SCRIPT_OVERRIDE; - } - - if (player != getObjIdObjVar(self, "quest.owner")) - { - CustomerServiceLog("nyms_themepark","OnObjectMenuRequest - quest.owner var found but not valid."); - return SCRIPT_OVERRIDE; - } - - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.sheeli"); - - return SCRIPT_CONTINUE; - } - - - public int handleDestroySelf(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int startFollowingOwner(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, "quest.owner")) - { - CustomerServiceLog("nyms_themepark","startFollowingOwner - quest.owner not valid."); - messageTo(self, "handleDestroySelf", null, 0, false); - return SCRIPT_CONTINUE; - } - - obj_id owner = getObjIdObjVar(self, "quest.owner"); - if (!isValidId(owner) || !exists(owner)) - { - messageTo(self, "handleDestroySelf", null, 0, false); - return SCRIPT_CONTINUE; - } - setInvulnerable(self, true); - ai_lib.aiFollow(self, owner, 1.0f, 3.0f); - - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); - setObjVar(self, "traveling", 1); - setInvulnerable(self, false); - setMaster(self, owner); - messageTo(self, "checkArrivalLoopHandler", null, 5, false); - - return SCRIPT_CONTINUE; - } - - - public int checkArrivalLoopHandler(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Setting move to run."); - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); - - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - init."); - obj_id player = getObjIdObjVar(self, "quest.owner"); - if (!isValidId(player)) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - could not get valid player OID."); - messageTo(self, "handleDestroySelf", null, 1, false); - return SCRIPT_CONTINUE; - } - - if (isDead(player)) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Player Died."); - failRescueQuest(self); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - player: "+ player); - - if (!groundquests.isQuestActive(player, "u16_nym_themepark_rescue_sheeli")) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - player no longer had required quest active!"); - failRescueQuest(self); - return SCRIPT_CONTINUE; - } - else if (groundquests.isTaskActive(player, "u16_nym_themepark_rescue_sheeli", "waitingForShuttle")) - { - CustomerServiceLog("nyms_themepark","checkArrivalLoopHandler - Calling SHuttle!"); - callShuttle(self, player); - return SCRIPT_CONTINUE; - } - - ai_lib.aiFollow(self, player, 1.0f, 3.0f); - messageTo(self, "checkArrivalLoopHandler", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public int handleUpdatePrisonerRescueQuest(obj_id self, dictionary params) throws InterruptedException - { - - if (!isValidId(self)) - { - CustomerServiceLog("nyms_themepark","handleUpdatePrisonerRescueQuest - NPC is not a valid OID."); - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(self, "quest.owner"); - if (!isValidId(player)) - { - messageTo(self, "handleDestroySelf", null, 1, false); - CustomerServiceLog("nyms_themepark","handleUpdatePrisonerRescueQuest - could not get valid player OID."); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, "shuttleHasArrived"); - return SCRIPT_CONTINUE; - } - - - public boolean callShuttle(obj_id self, obj_id player) throws InterruptedException - { - CustomerServiceLog("nyms_themepark","callShuttle - Shuttle Called"); - if (!isValidId(player)) - { - return false; - } - if (!isValidId(self)) - { - return false; - } - - ai_lib.aiStopFollowing(self); - removeObjVar(self, "traveling"); - - location[] prisonerPath = new location[1]; - prisonerPath[0] = new location(-42, 11, 2741, "lok", null); - setYaw(self, 27.0f); - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); - utils.setScriptVar(self, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, prisonerPath); - utils.setScriptVar(self, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(self, prisonerPath, 0); - - location landLocation = new location(-28, 11, 2759, "lok", null); - obj_id shuttle = create.object("object/creature/npc/theme_park/player_shuttle.iff", landLocation); - if (!isIdValid(shuttle)) - { - return false; - } - - setYaw(shuttle, -140); - detachScript(shuttle, "ai.ai"); - detachScript(shuttle, "ai.creature_combat"); - detachScript(shuttle, "skeleton.humanoid"); - detachScript(shuttle, "systems.combat.combat_actions"); - detachScript(shuttle, "systems.combat.combat_actions_creature"); - detachScript(shuttle, "systems.combat.credit_for_kills"); - stop(shuttle); - - utils.setScriptVar(shuttle, "prisoner", self); - utils.setScriptVar(shuttle, "playerOwner", player); - setPosture(shuttle, POSTURE_PRONE); - attachScript(shuttle, "systems.spawning.dropship.player_shuttle"); - - messageTo(shuttle, "landShuttle", null, 0, false); - messageTo(shuttle, "takeOff", null, 37, false); - messageTo(self, "handleUpdatePrisonerRescueQuest", null, 30, false); - messageTo(self, "handleDestroySelf", null, 32, false); - return true; - } - - - public boolean failRescueQuest(obj_id self) throws InterruptedException - { - obj_id player = getObjIdObjVar(self, "quest.owne"); - if (!isValidId(player)) - { - messageTo(self, "handleDestroySelf", null, 1, false); - return false; - } - - groundquests.sendSignal(player, "hasFailedQuest"); - messageTo(self, "handleDestroySelf", null, 1, false); - return true; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (sheeli_condition_hasArrived (player, npc)) - { - doAnimationAction (npc, "scream"); - - string_id message = new string_id (c_stringFile, "s_11"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (sheeli_condition_isTraveling (player, npc)) - { - sheeli_action_walkFaster (player, npc); - - string_id message = new string_id (c_stringFile, "s_13"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (sheeli_condition_isRescuer (player, npc)) - { - doAnimationAction (npc, "nervous"); - - string_id message = new string_id (c_stringFile, "s_6"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (sheeli_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_8"); - } - - utils.setScriptVar (player, "conversation.sheeli.branchId", 3); - - npcStartConversation (player, npc, "sheeli", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (sheeli_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_14"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("sheeli")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.sheeli.branchId"); - - if (branchId == 3 && sheeli_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.sheeli.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/shuttle_control_terminal.java b/sku.0/sys.server/compiled/game/script/conversation/shuttle_control_terminal.java deleted file mode 100644 index 357825d1d..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/shuttle_control_terminal.java +++ /dev/null @@ -1,523 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.create; -import script.library.features; -import script.library.groundquests; -import script.library.space_quest; -import script.library.utils; - - -public class shuttle_control_terminal extends script.base_script -{ - public shuttle_control_terminal() - { - } - String c_stringFile = "conversation/shuttle_control_terminal"; - - - public boolean shuttle_control_terminal_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean shuttle_control_terminal_condition_hasQuest(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isQuestActive(player, "outbreak_undead_rancor_boss_fight"); - } - - - public boolean shuttle_control_terminal_condition_hasGroup(obj_id player, obj_id npc) throws InterruptedException - { - obj_id groupid = getGroupObject(player); - if (!isValidId(groupid)) - { - - return false; - } - return true; - } - - - public boolean shuttle_control_terminal_condition_grantPermissionLandTask(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.isTaskActive(player, "u16_nym_themepark_shuttle_ambush", "grantPermissionToLand"); - } - - - public boolean shuttle_control_terminal_condition_hasQuestAndGroup(obj_id player, obj_id npc) throws InterruptedException - { - if (!shuttle_control_terminal_condition_hasGroup(player,npc)) - { - return false; - } - if (!shuttle_control_terminal_condition_hasQuest(player,npc)) - { - return false; - } - return groundquests.isTaskActive(player, "outbreak_undead_rancor_boss_fight", "defeatUndeadRancor"); - } - - - public boolean shuttle_control_terminal_condition_wave_event_active(obj_id player, obj_id npc) throws InterruptedException - { - if (utils.hasScriptVar(npc, "terminalLocked")) - { - return true; - } - - int wave = utils.getIntScriptVar(npc, "waveEventCurrentWave"); - return wave > 0; - } - - - public void shuttle_control_terminal_action_createShuttleSendSignal(obj_id player, obj_id npc) throws InterruptedException - { - - dictionary dict = new dictionary(); - dict.put("player", player); - messageTo(npc, "waveEventControllerNPCStart", dict, 0, false); - - utils.setScriptVar(npc, "terminalLocked", 1); - messageTo(npc, "removeTerminalLock", null, 90, false); - - location landLocation = new location( 475.3f, 12.3f, 4867.6f, "lok", null); - obj_id shuttle = create.object("object/creature/npc/theme_park/player_shuttle.iff", landLocation); - if (!isIdValid(shuttle)) - { - return; - } - - setYaw(shuttle, 75); - detachScript(shuttle, "ai.ai"); - detachScript(shuttle, "ai.creature_combat"); - detachScript(shuttle, "skeleton.humanoid"); - detachScript(shuttle, "systems.combat.combat_actions"); - detachScript(shuttle, "systems.combat.combat_actions_creature"); - detachScript(shuttle, "systems.combat.credit_for_kills"); - stop(shuttle); - - utils.setScriptVar(shuttle, "terminal", npc); - utils.setScriptVar(shuttle, "owner", player); - setPosture(shuttle, POSTURE_PRONE); - attachScript(shuttle, "systems.spawning.dropship.player_shuttle"); - - messageTo(shuttle, "landShuttle", null, 2, false); - groundquests.sendSignal(player, "hasGrantedPermissionToLand"); - - location explosionLocaitonList[] = new location[6]; - explosionLocaitonList[0] = new location(475, 12, 4867, "lok", null); - explosionLocaitonList[1] = new location(469, 12, 4867, "lok", null); - explosionLocaitonList[2] = new location(471, 12, 4864, "lok", null); - explosionLocaitonList[3] = new location(477, 12, 4864, "lok", null); - explosionLocaitonList[4] = new location(480, 12, 4871, "lok", null); - explosionLocaitonList[5] = new location(472, 12, 4872, "lok", null); - - dictionary webster = new dictionary(); - webster.put("player", player); - webster.put("explosionLocaitonList", explosionLocaitonList); - - messageTo(npc, "signalPlayerEnvoy", webster, 32, false); - - messageTo(npc, "spawnEnemies", webster, 35, false); - - messageTo(npc, "spawnHeroes", webster, 42, false); - - messageTo(shuttle, "explodeThenDestroySelf", webster, 120, false); - - } - - - public void shuttle_control_terminal_action_unauthorizedUse(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_unauthorized"); - chat.chat(npc, barkString); - } - - - public void shuttle_control_terminal_action_busyWithOtherPlayer(obj_id player, obj_id npc) throws InterruptedException - { - string_id barkString = new string_id("theme_park_nym/messages", "terminal_busy"); - chat.chat(npc, barkString); - } - - - public int shuttle_control_terminal_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_36")) - { - - if (shuttle_control_terminal_condition__defaultCondition (player, npc)) - { - shuttle_control_terminal_action_createShuttleSendSignal (player, npc); - - string_id message = new string_id (c_stringFile, "s_37"); - utils.removeScriptVar (player, "conversation.shuttle_control_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int shuttle_control_terminal_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_9")) - { - - if (shuttle_control_terminal_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_10"); - utils.removeScriptVar (player, "conversation.shuttle_control_terminal.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int signalPlayerEnvoy(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - obj_id player = params.getObjId("player"); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, "u16_nym_themepark_shuttle_ambush", "greetEnvoy")) - { - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, "hasGreetedEnvoy"); - return SCRIPT_CONTINUE; - } - - - public int spawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "waveEventControllerNPCStart", params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int handleQuestFlavorObjectCleanup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "handleQuestFlavorObjectCleanup")) - { - return SCRIPT_CONTINUE; - } - - obj_id objList[] = utils.getObjIdArrayScriptVar(self, "handleQuestFlavorObjectCleanup"); - if (objList == null || objList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; 1 < objList.length; i++) - { - testAbortScript(); - if (!isValidId(objList[i])) - { - continue; - } - - messageTo(objList[i], "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public int spawnHeroes(obj_id self, dictionary params) throws InterruptedException - { - LOG("nym_themepark_log", "spawnHeroes: init"); - obj_id player = utils.getObjIdScriptVar(self, "waveEventPlayer"); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - LOG("nym_themepark_log", "spawnHeroes: player OID received: "+player); - location locNymSpawn = new location(471, 13, 4833, "lok", null); - obj_id nym = create.object("nym_themepark_nym_ambush", locNymSpawn); - if (isValidId(nym)) - { - LOG("nym_themepark_log", "spawnHeroes: Nym Created: "+nym); - setObjVar(nym, "parent", self); - location[] locNymPath = new location[1]; - locNymPath[0] = new location(459, 12, 4854, "lok", null); - setYaw(nym, -6.0f); - setMovementRun(nym); - setBaseRunSpeed(nym, (getBaseRunSpeed(nym)-8)); - setInvulnerable(nym, false); - utils.setScriptVar(nym, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locNymPath); - utils.setScriptVar(nym, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(nym, locNymPath, 0); - - } - - location locKoleSpawn = new location(465, 13, 4832, "lok", null); - obj_id kole = create.object("nym_themepark_kole_ambush", locKoleSpawn); - if (isValidId(kole)) - { - setObjVar(kole, "parent", self); - location[] locKolePath = new location[1]; - locKolePath[0] = new location(469, 12, 4851, "lok", null); - setYaw(kole, -6.0f); - setMovementRun(kole); - setBaseRunSpeed(kole, (getBaseRunSpeed(kole)-8)); - setInvulnerable(kole, false); - utils.setScriptVar(kole, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locKolePath); - utils.setScriptVar(kole, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(kole, locKolePath, 0); - - } - - location locVanaSpawn = new location(480, 13, 4833, "lok", null); - obj_id vana = create.object("nym_themepark_vana_ambush", locVanaSpawn); - if (isValidId(vana)) - { - setObjVar(vana, "parent", self); - location[] locVanaPath = new location[1]; - locVanaPath[0] = new location(469, 12, 4851, "lok", null); - setYaw(vana, -6.0f); - setMovementRun(vana); - setBaseRunSpeed(vana, (getBaseRunSpeed(vana)-8)); - setInvulnerable(vana, false); - utils.setScriptVar(vana, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locVanaPath); - utils.setScriptVar(vana, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(vana, locVanaPath, 0); - } - - location locJinkinsSpawn = new location(487, 13, 4831, "lok", null); - obj_id jinkins = create.object("nym_themepark_jinkins_ambush", locJinkinsSpawn); - if (isValidId(jinkins)) - { - setObjVar(jinkins, "parent", self); - location[] locJinkinsPath = new location[1]; - locJinkinsPath[0] = new location(484, 12, 4852, "lok", null); - setYaw(jinkins, -6.0f); - setMovementRun(jinkins); - setBaseRunSpeed(jinkins, (getBaseRunSpeed(jinkins)-8)); - setInvulnerable(jinkins, false); - utils.setScriptVar(jinkins, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, locJinkinsPath); - utils.setScriptVar(jinkins, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(jinkins, locJinkinsPath, 0); - } - - obj_id objectList[] = new obj_id[4]; - objectList[0] = vana; - objectList[1] = jinkins; - objectList[2] = kole; - objectList[3] = nym; - - utils.setScriptVar(self, "handleQuestFlavorObjectCleanup", objectList); - - return SCRIPT_CONTINUE; - } - - - public int removeTerminalLock(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar(self, "terminalLocked"); - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (shuttle_control_terminal_condition_wave_event_active (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_7"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (shuttle_control_terminal_condition_grantPermissionLandTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (shuttle_control_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_36"); - } - - utils.setScriptVar (player, "conversation.shuttle_control_terminal.branchId", 2); - - npcStartConversation (player, npc, "shuttle_control_terminal", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (shuttle_control_terminal_condition__defaultCondition (player, npc)) - { - shuttle_control_terminal_action_unauthorizedUse (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (shuttle_control_terminal_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_9"); - } - - utils.setScriptVar (player, "conversation.shuttle_control_terminal.branchId", 4); - - npcStartConversation (player, npc, "shuttle_control_terminal", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("shuttle_control_terminal")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.shuttle_control_terminal.branchId"); - - if (branchId == 2 && shuttle_control_terminal_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && shuttle_control_terminal_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.shuttle_control_terminal.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/slicer_01_mos_taike.java b/sku.0/sys.server/compiled/game/script/conversation/slicer_01_mos_taike.java deleted file mode 100644 index 2f2d6adf7..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/slicer_01_mos_taike.java +++ /dev/null @@ -1,2830 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.factions; -import script.library.groundquests; -import script.library.prose; -import script.library.utils; - - -public class slicer_01_mos_taike extends script.base_script -{ - public slicer_01_mos_taike() - { - } - String c_stringFile = "conversation/slicer_01_mos_taike"; - - - public boolean slicer_01_mos_taike_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean slicer_01_mos_taike_condition_shouldBeOnLok(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "quest_06_conspire_cale") && groundquests.isTaskActive(player, "quest_06_conspire_cale", "TravelToLokOutpost"); - } - - - public boolean slicer_01_mos_taike_condition_hasInitialQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "quest_04_meet_cale_herron"); - } - - - public boolean slicer_01_mos_taike_condition_shouldBeLadyValerian(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "quest_05_frame_valarians", "gotoLuckyDespot"); - } - - - public boolean slicer_01_mos_taike_condition_hasCompletedInitQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "quest_04_meet_cale_herron","speakCaleCompleteQuest"); - } - - - public boolean slicer_01_mos_taike_condition_hasCompletedValarian(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (slicer_01_mos_taike_condition_failedToDefeatAssassin(player, npc) || slicer_01_mos_taike_condition_successDefeatAssassin(player, npc)) && !groundquests.isQuestActiveOrComplete(player, "quest_07_descend_into_labratory"); - } - - - public boolean slicer_01_mos_taike_condition_failedToDefeatAssassin(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_05_frame_valarians_failed_assassin") && groundquests.isTaskActive(player, "quest_06_conspire_cale", "visitCaleHerron"); - } - - - public boolean slicer_01_mos_taike_condition_successDefeatAssassin(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_05_frame_valarians_success_assassin") && groundquests.isTaskActive(player, "quest_06_conspire_cale", "visitCaleHerron"); - } - - - public boolean slicer_01_mos_taike_condition_hasCompletedDathomir(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "quest_08_dathomir_outpost_final", "finishUpProlog") || groundquests.isTaskActive(player, "quest_08_dathomir_outpost", "finishUpProlog"); - } - - - public boolean slicer_01_mos_taike_condition_isRebelCheck(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isRebel(player)); - } - - - public boolean slicer_01_mos_taike_condition_isNeutralCheck(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (!factions.isImperial(player) && !factions.isRebel(player)); - } - - - public boolean slicer_01_mos_taike_condition_isImperialCheck(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (factions.isImperial(player)); - } - - - public boolean slicer_01_mos_taike_condition_isRebelOrNeutral(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return slicer_01_mos_taike_condition_isNeutralCheck(player, npc) || slicer_01_mos_taike_condition_isRebelCheck(player, npc); - } - - - public boolean slicer_01_mos_taike_condition_hasCompletedProlog(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "quest_08_dathomir_outpost_final"); - } - - - public boolean slicer_01_mos_taike_condition_canceledQuest06(obj_id player, obj_id npc) throws InterruptedException - { - return !groundquests.isQuestActiveOrComplete(player, "quest_06_conspire_cale") && (groundquests.hasCompletedQuest(player, "quest_05_frame_valarians_failed_assassin") || groundquests.hasCompletedQuest(player, "quest_05_frame_valarians_success_assassin")); - } - - - public boolean slicer_01_mos_taike_condition_isCheckingWithBib(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "quest_04_meet_cale_herron", "invisTimer") || groundquests.isTaskActive(player, "quest_04_meet_cale_herron", "bibCommCheckin"); - } - - - public boolean slicer_01_mos_taike_condition_completedQuest04Deleted05(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_04_meet_cale_herron") && !groundquests.isQuestActiveOrComplete(player, "quest_05_frame_valarians") ; - - } - - - public void slicer_01_mos_taike_action_sendSignalSpokeCale(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "playerSpokeToCaleHerron"); - } - - - public void slicer_01_mos_taike_action_startCommunication(obj_id player, obj_id npc) throws InterruptedException - { - prose_package pp = new prose_package(); - prose.setStringId(pp, new string_id("theme_park/outbreak/outbreak", "derg_pratis")); - commPlayers(player, "object/mobile/dressed_biologist_04.iff", "", 10f, player, pp); - } - - - public void slicer_01_mos_taike_action_grantFrameValarainQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "quest_05_frame_valarians"); - } - - - public void slicer_01_mos_taike_action_sendSignalGoLok(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "metWithCaleHerron"); - } - - - public void slicer_01_mos_taike_action_finishPrologGetRewards(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "PlayerFinishedUp"); - slicer_01_mos_taike_action_grantOutbreakQuest(player,npc); - } - - - public void slicer_01_mos_taike_action_grantQuest06(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "quest_06_conspire_cale"); - } - - - public void slicer_01_mos_taike_action_sendSignalCompleteQuest04(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "spokenCale"); - } - - - public void slicer_01_mos_taike_action_grantOutbreakQuest(obj_id player, obj_id npc) throws InterruptedException - { - if (factions.isRebel(player)) - { - groundquests.grantQuest(player, "outbreak_live_conversion_rebel"); - return; - } - else if (factions.isImperial(player)) - { - groundquests.grantQuest(player, "outbreak_live_conversion_imperial"); - return; - } - - groundquests.grantQuest(player, "outbreak_live_conversion_neutral"); - return; - - } - - - public int slicer_01_mos_taike_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_129")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_131"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_135"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_135")) - { - - if (slicer_01_mos_taike_condition_isRebelOrNeutral (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_136"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_141"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 4); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_140"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_143"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 6); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_141")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - slicer_01_mos_taike_action_finishPrologGetRewards (player, npc); - - string_id message = new string_id (c_stringFile, "s_142"); - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_143")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - slicer_01_mos_taike_action_finishPrologGetRewards (player, npc); - - string_id message = new string_id (c_stringFile, "s_142"); - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_71")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_74"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_75"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_72")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_75"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 11); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcSpeak (player, pp); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_75")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "apologize"); - - string_id message = new string_id (c_stringFile, "s_76"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_75")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "apologize"); - - string_id message = new string_id (c_stringFile, "s_76"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_77")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_78"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_80"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_79")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_80")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_86"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_87"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_82")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - slicer_01_mos_taike_action_sendSignalGoLok (player, npc); - - string_id message = new string_id (c_stringFile, "s_92"); - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_83")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_85"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_91"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_91")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - slicer_01_mos_taike_action_sendSignalGoLok (player, npc); - - string_id message = new string_id (c_stringFile, "s_92"); - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_87")) - { - - if (slicer_01_mos_taike_condition_isRebelOrNeutral (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_88"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_89"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_90"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition_isImperialCheck (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_137"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_138"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_139"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_89")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_93"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_94"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_90")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_94")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_95"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_96"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_96")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_97"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_98"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_98")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - slicer_01_mos_taike_action_sendSignalGoLok (player, npc); - - string_id message = new string_id (c_stringFile, "s_92"); - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_138")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - slicer_01_mos_taike_action_sendSignalGoLok (player, npc); - - string_id message = new string_id (c_stringFile, "s_92"); - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_139")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_83"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_55")) - { - doAnimationAction (player, "wave_on_dismissing"); - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave_finger_warning"); - - string_id message = new string_id (c_stringFile, "s_56"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_57"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 26); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_57")) - { - doAnimationAction (player, "shrug_hands"); - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_170"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_171"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 27); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_171")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "poke"); - - string_id message = new string_id (c_stringFile, "s_175"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_179"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 28); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_179")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_183"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_187"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 29); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_187")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_191"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_194"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 30); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch30(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_194")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_196"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_198"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 31); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch31(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_198")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - string_id message = new string_id (c_stringFile, "s_200"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_202"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 32); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_202")) - { - doAnimationAction (player, "shake_head_no"); - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_204"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_206"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 33); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch33(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_206")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_208"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_210"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 34); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_210")) - { - doAnimationAction (player, "shake_head_disgust"); - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "slit_throat"); - - string_id message = new string_id (c_stringFile, "s_212"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_214"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_214")) - { - doAnimationAction (player, "nervous"); - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - slicer_01_mos_taike_action_sendSignalCompleteQuest04 (player, npc); - - string_id message = new string_id (c_stringFile, "s_216"); - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_109")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_111"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 39); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch39(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_113")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "squirm"); - - string_id message = new string_id (c_stringFile, "s_115"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_117"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 40); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch40(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_117")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_119"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_121"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 41); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch41(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_121")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - slicer_01_mos_taike_action_startCommunication (player, npc); - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_125"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 42); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch42(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_125")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "pound_fist_palm"); - - string_id message = new string_id (c_stringFile, "s_128"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_159"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 43); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch43(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_159")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_161"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_163"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 44); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch44(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_163")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "scared"); - - string_id message = new string_id (c_stringFile, "s_165"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_167"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 45); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_01_mos_taike_handleBranch45(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_167")) - { - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - doAnimationAction (player, "handshake_tandem"); - - slicer_01_mos_taike_action_sendSignalSpokeCale (player, npc); - - string_id message = new string_id (c_stringFile, "s_169"); - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.slicer_01_mos_taike"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.slicer_01_mos_taike"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (slicer_01_mos_taike_condition_hasCompletedProlog (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_134"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition_hasCompletedDathomir (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_129"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 2); - - npcStartConversation (player, npc, "slicer_01_mos_taike", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition_canceledQuest06 (player, npc)) - { - slicer_01_mos_taike_action_grantQuest06 (player, npc); - - string_id message = new string_id (c_stringFile, "s_146"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition_shouldBeOnLok (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_30"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition_hasCompletedValarian (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition_failedToDefeatAssassin (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (slicer_01_mos_taike_condition_successDefeatAssassin (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_71"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_72"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 9); - - npcStartConversation (player, npc, "slicer_01_mos_taike", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition_shouldBeLadyValerian (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_48"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition_completedQuest04Deleted05 (player, npc)) - { - slicer_01_mos_taike_action_grantFrameValarainQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_149"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition_hasCompletedInitQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_54"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_55"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 25); - - npcStartConversation (player, npc, "slicer_01_mos_taike", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition_isCheckingWithBib (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_147"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition_hasInitialQuest (player, npc)) - { - doAnimationAction (npc, "wave_finger_warning"); - - string_id message = new string_id (c_stringFile, "s_107"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - utils.setScriptVar (player, "conversation.slicer_01_mos_taike.branchId", 38); - - npcStartConversation (player, npc, "slicer_01_mos_taike", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (slicer_01_mos_taike_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_157"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("slicer_01_mos_taike")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - if (branchId == 2 && slicer_01_mos_taike_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && slicer_01_mos_taike_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && slicer_01_mos_taike_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && slicer_01_mos_taike_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && slicer_01_mos_taike_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && slicer_01_mos_taike_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && slicer_01_mos_taike_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && slicer_01_mos_taike_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && slicer_01_mos_taike_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && slicer_01_mos_taike_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && slicer_01_mos_taike_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && slicer_01_mos_taike_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && slicer_01_mos_taike_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && slicer_01_mos_taike_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && slicer_01_mos_taike_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && slicer_01_mos_taike_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && slicer_01_mos_taike_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && slicer_01_mos_taike_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && slicer_01_mos_taike_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && slicer_01_mos_taike_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && slicer_01_mos_taike_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && slicer_01_mos_taike_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 30 && slicer_01_mos_taike_handleBranch30 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 31 && slicer_01_mos_taike_handleBranch31 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && slicer_01_mos_taike_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 33 && slicer_01_mos_taike_handleBranch33 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && slicer_01_mos_taike_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && slicer_01_mos_taike_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && slicer_01_mos_taike_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 39 && slicer_01_mos_taike_handleBranch39 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 40 && slicer_01_mos_taike_handleBranch40 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 41 && slicer_01_mos_taike_handleBranch41 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 42 && slicer_01_mos_taike_handleBranch42 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 43 && slicer_01_mos_taike_handleBranch43 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 44 && slicer_01_mos_taike_handleBranch44 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 45 && slicer_01_mos_taike_handleBranch45 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.slicer_01_mos_taike.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/slicer_02_lok.java b/sku.0/sys.server/compiled/game/script/conversation/slicer_02_lok.java deleted file mode 100644 index f7b30c103..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/slicer_02_lok.java +++ /dev/null @@ -1,977 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.prose; -import script.library.utils; - - -public class slicer_02_lok extends script.base_script -{ - public slicer_02_lok() - { - } - String c_stringFile = "conversation/slicer_02_lok"; - - - public boolean slicer_02_lok_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean slicer_02_lok_condition_isGoingToDungeon(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "quest_06_conspire_cale", "GoToLabratory"); - } - - - public boolean slicer_02_lok_condition_isGoingToDathomir(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "quest_08_dathomir_outpost", "travelDathomir"); - } - - - public boolean slicer_02_lok_condition_isReadyForDungeon(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "quest_06_conspire_cale", "TravelToLokOutpost"); - } - - - public boolean slicer_02_lok_condition_hasCompletedlokDungeon(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "quest_07_descend_into_labratory", "TakeDataPadCale"); - } - - - public boolean slicer_02_lok_condition_canceledQuest06(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "quest_06_conspire_cale") && (groundquests.hasCompletedQuest(player, "quest_05_frame_valarians_failed_assassin") || groundquests.hasCompletedQuest(player, "quest_05_frame_valarians_success_assassin")); - } - - - public boolean slicer_02_lok_condition_canceledQuest07(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_06_conspire_cale") && !groundquests.isQuestActiveOrComplete(player, "quest_07_descend_into_labratory"); - } - - - public boolean slicer_02_lok_condition_canceledQuest08(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "quest_07_descend_into_labratory") && !groundquests.isQuestActiveOrComplete(player, "quest_08_dathomir_outpost"); - } - - - public void slicer_02_lok_action_sendSignalLokDungeon(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "TravelToLokOutpostComplete"); - } - - - public void slicer_02_lok_action_grantQuest07WithWaypoint(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.grantQuest(player, "quest_07_descend_into_labratory"); - slicer_02_lok_action_giveDungeonWaypoint(player,npc); - } - - - public void slicer_02_lok_action_sendDathomirSignal(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "TookDataPadCale"); - } - - - public void slicer_02_lok_action_giveDungeonWaypoint(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - location loc = new location(-415, 92, 7608, "lok"); - obj_id maraWpt = createWaypointInDatapad(player, loc); - setWaypointName(maraWpt, "Secret Laboratory"); - setWaypointActive(maraWpt, true); - } - - - public void slicer_02_lok_action_giveQuest08(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "quest_08_dathomir_outpost"); - } - - - public int slicer_02_lok_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_131")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_135"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_136"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_136")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_137"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_138"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_138")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_139"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_140"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_140")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_141"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_142"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_142")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_143"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_144"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_144")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_145"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_146"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_146")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_147"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_148"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_148")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - slicer_02_lok_action_sendSignalLokDungeon (player, npc); - - string_id message = new string_id (c_stringFile, "s_149"); - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_150")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_151"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_152"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_152")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_155"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_156"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 17); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_156")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_157"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_158"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int slicer_02_lok_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_158")) - { - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - slicer_02_lok_action_sendDathomirSignal (player, npc); - - string_id message = new string_id (c_stringFile, "s_159"); - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.slicer_02_lok"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.slicer_02_lok"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (slicer_02_lok_condition_canceledQuest08 (player, npc)) - { - slicer_02_lok_action_giveQuest08 (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_02_lok_condition_canceledQuest07 (player, npc)) - { - slicer_02_lok_action_grantQuest07WithWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_02_lok_condition_canceledQuest06 (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_34"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_02_lok_condition_isGoingToDungeon (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_30"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_02_lok_condition_isGoingToDathomir (player, npc)) - { - doAnimationAction (npc, "laugh_cackle"); - - doAnimationAction (player, "shake_head_no"); - - string_id message = new string_id (c_stringFile, "s_31"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (slicer_02_lok_condition_isReadyForDungeon (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_127"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_131"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 6); - - npcStartConversation (player, npc, "slicer_02_lok", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (slicer_02_lok_condition_hasCompletedlokDungeon (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_129"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_150"); - } - - utils.setScriptVar (player, "conversation.slicer_02_lok.branchId", 15); - - npcStartConversation (player, npc, "slicer_02_lok", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (slicer_02_lok_condition__defaultCondition (player, npc)) - { - slicer_02_lok_action_giveQuest08 (player, npc); - - string_id message = new string_id (c_stringFile, "s_132"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("slicer_02_lok")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.slicer_02_lok.branchId"); - - if (branchId == 6 && slicer_02_lok_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && slicer_02_lok_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && slicer_02_lok_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && slicer_02_lok_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && slicer_02_lok_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && slicer_02_lok_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && slicer_02_lok_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && slicer_02_lok_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && slicer_02_lok_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && slicer_02_lok_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && slicer_02_lok_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && slicer_02_lok_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.slicer_02_lok.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/stuvany_inglen.java b/sku.0/sys.server/compiled/game/script/conversation/stuvany_inglen.java deleted file mode 100644 index ccb826146..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/stuvany_inglen.java +++ /dev/null @@ -1,1998 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class stuvany_inglen extends script.base_script -{ - public stuvany_inglen() - { - } - String c_stringFile = "conversation/stuvany_inglen"; - - - public boolean stuvany_inglen_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean stuvany_inglen_condition_canDoPrisoner(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_prisoner_rescue_collection") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean stuvany_inglen_condition_hasReturnedPrisoner(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection", "returnPrisonerRescueComplete") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01", "returnPrisonerRescueComplete") || groundquests.isTaskActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02", "returnPrisonerRescueComplete"); - } - - - public boolean stuvany_inglen_condition_hasPrisonerQuestNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection") || groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01") || groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02"); - } - - - public boolean stuvany_inglen_condition_canDoStealOre(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_steal_mined_ore_collection") && (groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_prisoner_rescue_collection") || groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01") || groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02")) && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine"); - } - - - public boolean stuvany_inglen_condition_hasStealOreQuestNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_pirate_steal_mined_ore_collection"); - } - - - public boolean stuvany_inglen_condition_hasReturnedStealOre(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_steal_mined_ore_collection", "returnStealMinedOreComplete"); - } - - - public boolean stuvany_inglen_condition_canDoStealData(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_steal_lab_data_collection") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_steal_mined_ore_collection") && groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility"); - } - - - public boolean stuvany_inglen_condition_hasStealDataQuestNotComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_pirate_steal_lab_data_collection"); - } - - - public boolean stuvany_inglen_condition_hasReturnedStealData(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_steal_lab_data_collection", "returnStealLabDataComplete"); - } - - - public boolean stuvany_inglen_condition_hasntDonePrisoner(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean stuvany_inglen_condition_hasntDoneOre(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_mine") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_prisoner_rescue_collection"); - } - - - public boolean stuvany_inglen_condition_hasntDoneData(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_research_facility") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_mine") && groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_steal_mined_ore_collection"); - } - - - public boolean stuvany_inglen_condition_hasCompletedPrisonerRescueCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "nyms_rescue_prisoner") && (groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection") || groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01") || groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02")); - } - - - public boolean stuvany_inglen_condition_hasCompletedMinedOreCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "nyms_steal_mined_ore") && groundquests.isQuestActive(player, "u16_nym_themepark_pirate_steal_mined_ore_collection"); - } - - - public boolean stuvany_inglen_condition_hasCompletedLabDataCollection(obj_id player, obj_id npc) throws InterruptedException - { - return hasCompletedCollection(player, "nyms_steal_lab_data") && groundquests.isQuestActive(player, "u16_nym_themepark_pirate_steal_lab_data_collection"); - } - - - public void stuvany_inglen_action_grantPrisonerQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_pirate_prisoner_rescue_collection"); - if (!hasCompletedCollectionSlot(player, "nym_prisoner_rescue_activation")) - { - modifyCollectionSlotValue(player, "nym_prisoner_rescue_activation", 1); - } - } - - - public void stuvany_inglen_action_completePrisonerQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedPrisonerRescue"); - if (!hasCompletedCollectionSlot(player, "icon_nyms_master_collection_2_rescue_prisoner")) - { - modifyCollectionSlotValue(player, "icon_nyms_master_collection_2_rescue_prisoner", 1); - } - } - - - public void stuvany_inglen_action_completeStealOreQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedStealMinedOre"); - if (!hasCompletedCollectionSlot(player, "icon_nyms_master_collection_2_steal_ore")) - { - modifyCollectionSlotValue(player, "icon_nyms_master_collection_2_steal_ore", 1); - } - } - - - public void stuvany_inglen_action_grantStealOreQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_pirate_steal_mined_ore_collection"); - if (!hasCompletedCollectionSlot(player, "nym_mined_ore_activation")) - { - modifyCollectionSlotValue(player, "nym_mined_ore_activation", 1); - } - } - - - public void stuvany_inglen_action_grantStealDataQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_pirate_steal_lab_data_collection"); - if (!hasCompletedCollectionSlot(player, "nym_lab_data_activation")) - { - modifyCollectionSlotValue(player, "nym_lab_data_activation", 1); - } - } - - - public void stuvany_inglen_action_completeStealDataQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedStealLabData"); - if (!hasCompletedCollectionSlot(player, "icon_nyms_master_collection_2_lab_data")) - { - modifyCollectionSlotValue(player, "icon_nyms_master_collection_2_lab_data", 1); - } - } - - - public void stuvany_inglen_action_BruteForceCompletePrisoner(obj_id player, obj_id npc) throws InterruptedException - { - - if (stuvany_inglen_condition_hasCompletedPrisonerRescueCollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_pirate_prisoner_rescue_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_pirate_prisoner_rescue_collection"); - CustomerServiceLog("nyms_themepark", "Quest Id: "+questid); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - CustomerServiceLog("nyms_themepark", "Quest Id: "+questid); - questCompleteQuest(questid, player); - } - } - if (groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_01")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_pirate_prisoner_rescue_retry_01 for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_pirate_prisoner_rescue_retry_01"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - if (groundquests.isQuestActive(player, "u16_nym_themepark_pirate_prisoner_rescue_retry_02")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_pirate_prisoner_rescue_retry_02 for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_pirate_prisoner_rescue_retry_02"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public void stuvany_inglen_action_BruteForceCompleteLabData(obj_id player, obj_id npc) throws InterruptedException - { - - if (stuvany_inglen_condition_hasCompletedLabDataCollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_pirate_steal_lab_data_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_pirate_steal_lab_data_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_pirate_steal_lab_data_collection"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public void stuvany_inglen_action_BruteForceCompleteMinedOre(obj_id player, obj_id npc) throws InterruptedException - { - - if (stuvany_inglen_condition_hasCompletedMinedOreCollection(player,npc)) - { - if (groundquests.isQuestActive(player, "u16_nym_themepark_pirate_steal_mined_ore_collection")) - { - CustomerServiceLog("nyms_themepark", "NPC Conversation - Brute Force completing quest: u16_nym_themepark_pirate_steal_mined_ore_collection for player: "+player+" so they do not remailn bugged."); - int questid = questGetQuestId("quest/u16_nym_themepark_pirate_steal_mined_ore_collection"); - if ((questid != 0) && questIsQuestActive(questid, player)) - { - questCompleteQuest(questid, player); - } - } - } - } - - - public int stuvany_inglen_handleBranch1(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_28")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_29"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_90"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 2); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_90")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_91"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_92"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_92")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_93"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_94"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 4); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_94")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_95"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_96"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 5); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_96")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - stuvany_inglen_action_completeStealDataQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_97"); - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_30")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_31"); - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_32")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_33"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_84"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_84")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_85"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_86"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_86")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - stuvany_inglen_action_grantStealDataQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_87"); - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - stuvany_inglen_action_completeStealOreQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_82"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_82")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - stuvany_inglen_action_completeStealOreQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_83"); - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_47")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_49"); - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_72")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_73"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_74"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_74")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_76"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_76")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_77"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_78"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 24); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch24(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_78")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_80"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 25); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_80")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - stuvany_inglen_action_grantStealOreQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_81"); - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_66")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_69"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_70"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 29); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_70")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - stuvany_inglen_action_completePrisonerQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_88"); - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch32(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_103"); - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch34(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_107")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_109"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_111"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 35); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch35(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_111")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_113"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_115"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 36); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch36(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_115")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_117"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_119"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 37); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch37(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_119")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_121"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_123"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 38); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int stuvany_inglen_handleBranch38(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_123")) - { - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - stuvany_inglen_action_grantPrisonerQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_127"); - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.stuvany_inglen"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.stuvany_inglen"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (stuvany_inglen_condition_hasReturnedStealData (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_25"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_28"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 1); - - npcStartConversation (player, npc, "stuvany_inglen", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasCompletedLabDataCollection (player, npc)) - { - stuvany_inglen_action_BruteForceCompleteLabData (player, npc); - - string_id message = new string_id (c_stringFile, "s_131"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasStealDataQuestNotComplete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 8); - - npcStartConversation (player, npc, "stuvany_inglen", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_canDoStealData (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 10); - - npcStartConversation (player, npc, "stuvany_inglen", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasntDoneData (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_125"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasReturnedStealOre (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 15); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "stuvany_inglen", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasCompletedMinedOreCollection (player, npc)) - { - stuvany_inglen_action_BruteForceCompleteMinedOre (player, npc); - - string_id message = new string_id (c_stringFile, "s_130"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasStealOreQuestNotComplete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_45"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_47"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 19); - - npcStartConversation (player, npc, "stuvany_inglen", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_canDoStealOre (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_72"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 21); - - npcStartConversation (player, npc, "stuvany_inglen", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasntDoneOre (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_124"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasReturnedPrisoner (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_64"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 28); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "stuvany_inglen", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasCompletedPrisonerRescueCollection (player, npc)) - { - stuvany_inglen_action_BruteForceCompletePrisoner (player, npc); - - string_id message = new string_id (c_stringFile, "s_129"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasPrisonerQuestNotComplete (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 32); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "stuvany_inglen", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_canDoPrisoner (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_105"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_107"); - } - - utils.setScriptVar (player, "conversation.stuvany_inglen.branchId", 34); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "stuvany_inglen", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition_hasntDonePrisoner (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_132"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (stuvany_inglen_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_134"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("stuvany_inglen")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.stuvany_inglen.branchId"); - - if (branchId == 1 && stuvany_inglen_handleBranch1 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 2 && stuvany_inglen_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && stuvany_inglen_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 4 && stuvany_inglen_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 5 && stuvany_inglen_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && stuvany_inglen_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && stuvany_inglen_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && stuvany_inglen_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && stuvany_inglen_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && stuvany_inglen_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && stuvany_inglen_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && stuvany_inglen_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && stuvany_inglen_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && stuvany_inglen_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && stuvany_inglen_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 24 && stuvany_inglen_handleBranch24 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && stuvany_inglen_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && stuvany_inglen_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && stuvany_inglen_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 32 && stuvany_inglen_handleBranch32 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 34 && stuvany_inglen_handleBranch34 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 35 && stuvany_inglen_handleBranch35 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 36 && stuvany_inglen_handleBranch36 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 37 && stuvany_inglen_handleBranch37 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 38 && stuvany_inglen_handleBranch38 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.stuvany_inglen.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/trig_longo.java b/sku.0/sys.server/compiled/game/script/conversation/trig_longo.java deleted file mode 100644 index 83e2032ef..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/trig_longo.java +++ /dev/null @@ -1,1007 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class trig_longo extends script.base_script -{ - public trig_longo() - { - } - String c_stringFile = "conversation/trig_longo"; - - - public boolean trig_longo_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean trig_longo_condition_isNotImmunized(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.isTaskActive(player, "outbreak_quest_01_imperial", "codyInnoculate") || groundquests.isTaskActive(player, "outbreak_quest_01_rebel", "codyInnoculate") || groundquests.isTaskActive(player, "outbreak_quest_01_neutral", "codyInnoculate") ); - } - - - public boolean trig_longo_condition_hasTrigTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "outbreak_quest_01_b_imperial", "talkToTrig") || groundquests.isTaskActive(player, "outbreak_quest_01_b_rebel", "talkToTrig") || groundquests.isTaskActive(player, "outbreak_quest_01_b_neutral", "talkToTrig"); - } - - - public boolean trig_longo_condition_hasDeletedQuest2(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_imperial") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_imperial")) || (groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_rebel")) || (groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_neutral") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_neutral")); - } - - - public boolean trig_longo_condition_hasCompletedQuestLine(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_quest_final_imperial") || groundquests.hasCompletedQuest(player, "outbreak_quest_final_neutral") || groundquests.hasCompletedQuest(player, "outbreak_quest_final_rebel"); - } - - - public boolean trig_longo_condition_hasDeliveredRadioEpsilon(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_03"); - } - - - public boolean trig_longo_condition_hasCompletedQuest2(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial") || groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel") || groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral"); - } - - - public boolean trig_longo_condition_isNeutral(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral"); - } - - - public boolean trig_longo_condition_isRebel(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel"); - } - - - public void trig_longo_action_updatedQuestWaypoint(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - - groundquests.sendSignal(player, "spokenToTrigQuest01"); - } - - - public void trig_longo_action_giveQuest2(obj_id player, obj_id npc) throws InterruptedException - { - if ((groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_imperial") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_imperial"))) - { - groundquests.grantQuest(player, "outbreak_quest_02_imperial"); - return; - } - - if ((groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_rebel"))) - { - groundquests.grantQuest(player, "outbreak_quest_02_rebel"); - return; - } - - if ((groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral") && groundquests.hasCompletedQuest(player, "outbreak_quest_01_b_neutral") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_02_neutral"))) - { - groundquests.grantQuest(player, "outbreak_quest_02_neutral"); - return; - } - } - - - public int trig_longo_handleBranch5(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_61")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_62"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (trig_longo_condition_isRebel (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (trig_longo_condition_isNeutral (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_63"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_27"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_33"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 6); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int trig_longo_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_63")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_64"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_65"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 7); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_27")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_31"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_32"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_33")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_35"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_37"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int trig_longo_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_65")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_66"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int trig_longo_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_67")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "slump_head"); - - string_id message = new string_id (c_stringFile, "s_68"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_75"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int trig_longo_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_75")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_77"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int trig_longo_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_79")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_85")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - trig_longo_action_updatedQuestWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_93"); - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int trig_longo_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_79")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_85")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - trig_longo_action_updatedQuestWaypoint (player, npc); - - string_id message = new string_id (c_stringFile, "s_93"); - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int trig_longo_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_32")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_66"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int trig_longo_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_37")) - { - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_66"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_67"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.trig_longo"); - } - - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.trig_longo"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (trig_longo_condition_hasCompletedQuestLine (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_26"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (trig_longo_condition_hasDeliveredRadioEpsilon (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_25"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (trig_longo_condition_hasCompletedQuest2 (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_24"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (trig_longo_condition_hasDeletedQuest2 (player, npc)) - { - trig_longo_action_giveQuest2 (player, npc); - - string_id message = new string_id (c_stringFile, "s_22"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (trig_longo_condition_hasTrigTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_59"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (trig_longo_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_61"); - } - - utils.setScriptVar (player, "conversation.trig_longo.branchId", 5); - - npcStartConversation (player, npc, "trig_longo", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (trig_longo_condition_isNotImmunized (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_73"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (trig_longo_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_60"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("trig_longo")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.trig_longo.branchId"); - - if (branchId == 5 && trig_longo_handleBranch5 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && trig_longo_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && trig_longo_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && trig_longo_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && trig_longo_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && trig_longo_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && trig_longo_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && trig_longo_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && trig_longo_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.trig_longo.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/vana_sage.java b/sku.0/sys.server/compiled/game/script/conversation/vana_sage.java deleted file mode 100644 index 640f1a477..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/vana_sage.java +++ /dev/null @@ -1,2302 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.collection; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class vana_sage extends script.base_script -{ - public vana_sage() - { - } - String c_stringFile = "conversation/vana_sage"; - - - public boolean vana_sage_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean vana_sage_condition_hasInitialQuestTask(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_01") || groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_02") && !groundquests.isQuestActive(player, "u16_nym_themepark_interview_choster")) || (groundquests.isTaskActive(player, "u16_nym_themepark_pointer_01", "findVanaSage") || groundquests.isTaskActive(player, "u16_nym_themepark_pointer_02", "findVanaSage")); - } - - - public boolean vana_sage_condition_hasntSpokenChosterHasQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_01") || groundquests.hasCompletedQuest(player, "u16_nym_themepark_pointer_02")) && (groundquests.isQuestActive(player, "u16_nym_themepark_interview_choster")); - } - - - public boolean vana_sage_condition_hasNotCompletedChoster(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_interview_choster"); - } - - - public boolean vana_sage_condition_playerIsHighLvl(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return getLevel(player) >= 56; - } - - - public boolean vana_sage_condition_hasMetChoster(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_interview_choster", "tellVanaChosterMsg"); - } - - - public boolean vana_sage_condition_metChosterNoPirateQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_interview_choster") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean vana_sage_condition_hasntCompletedPirate(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isQuestActive(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean vana_sage_condition_hasReturnedWithDroid(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "returnPirateComplete"); - } - - - public boolean vana_sage_condition_hasCompletedPirate(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_pirate_hideout"); - } - - - public boolean vana_sage_condition_allQuestsComplete(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_vana_to_jinkins"); - } - - - public boolean vana_sage_condition_hasCompletedThemePark(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return groundquests.hasCompletedQuest(player, "u16_nym_themepark_shuttle_ambush"); - } - - - public void vana_sage_action_giveChosterQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_interview_choster"); - } - - - public void vana_sage_action_finishInitialQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundVanaSage"); - } - - - public void vana_sage_action_givePirateQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_pirate_hideout"); - - if (!hasCompletedCollectionSlot(player, "kill_nyms_themepark_sulfur_lake_pirate_activate")) - { - modifyCollectionSlotValue(player, "kill_nyms_themepark_sulfur_lake_pirate_activate", 1); - } - } - - - public void vana_sage_action_finishChoster(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasToldVanaChosterMsg"); - } - - - public void vana_sage_action_finishPirateQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasCompletedPirate"); - } - - - public void vana_sage_action_gotoJinkins(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_vana_to_jinkins"); - } - - - public int vana_sage_handleBranch4(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_90")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thumb_up"); - - vana_sage_action_finishPirateQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_91"); - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_71"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_95"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_68")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_69"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_70"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_70")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_71"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_95"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_95")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - vana_sage_action_givePirateQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_97"); - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_33")) - { - doAnimationAction (player, "embarrassed"); - - if (vana_sage_condition_hasntSpokenChosterHasQuest (player, npc)) - { - doAnimationAction (npc, "point_away"); - - vana_sage_action_giveChosterQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_34"); - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - vana_sage_action_giveChosterQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_35"); - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_26")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_38")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_30")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_26")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_38")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_77")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_79")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_46")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_hands"); - - string_id message = new string_id (c_stringFile, "s_48"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_50"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_50")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_52"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_54"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_54")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_56"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_58"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_58")) - { - doAnimationAction (player, "nod"); - - if (vana_sage_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_62"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_66")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_58"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch23(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_62")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "point_away"); - - vana_sage_action_giveChosterQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_64"); - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch25(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_58")) - { - doAnimationAction (player, "nod"); - - if (vana_sage_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_60"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_62"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 23); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_66")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_58"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch26(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_26")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_38")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_40"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch27(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_85")) - { - doAnimationAction (player, "shake_head_no"); - - if (vana_sage_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_87"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_92"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_98"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 28); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch28(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_92")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_94"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_79"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_98")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int vana_sage_handleBranch29(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_44"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_46"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_77")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "salute1"); - - string_id message = new string_id (c_stringFile, "s_28"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_30"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_79")) - { - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_81"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.vana_sage"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.vana_sage"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (vana_sage_condition_hasCompletedThemePark (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_105"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition_allQuestsComplete (player, npc)) - { - doAnimationAction (npc, "handshake_tandem"); - - string_id message = new string_id (c_stringFile, "s_99"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition_hasCompletedPirate (player, npc)) - { - vana_sage_action_gotoJinkins (player, npc); - - string_id message = new string_id (c_stringFile, "s_103"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition_hasReturnedWithDroid (player, npc)) - { - doAnimationAction (npc, "expect_tip"); - - string_id message = new string_id (c_stringFile, "s_89"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_90"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 4); - - npcStartConversation (player, npc, "vana_sage", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition_hasntCompletedPirate (player, npc)) - { - doAnimationAction (npc, "point_away"); - - string_id message = new string_id (c_stringFile, "s_73"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition_metChosterNoPirateQuest (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_72"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 7); - - npcStartConversation (player, npc, "vana_sage", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition_hasMetChoster (player, npc)) - { - vana_sage_action_finishChoster (player, npc); - - string_id message = new string_id (c_stringFile, "s_67"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 8); - - npcStartConversation (player, npc, "vana_sage", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition_hasNotCompletedChoster (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_32"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_33"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 12); - - npcStartConversation (player, npc, "vana_sage", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition_hasInitialQuestTask (player, npc)) - { - doAnimationAction (npc, "nod"); - - vana_sage_action_finishInitialQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_24"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_26"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 15); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcStartConversation (player, npc, "vana_sage", null, pp, responses); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - } - - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition_playerIsHighLvl (player, npc)) - { - doAnimationAction (npc, "point_accusingly"); - - string_id message = new string_id (c_stringFile, "s_83"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (vana_sage_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_85"); - } - - utils.setScriptVar (player, "conversation.vana_sage.branchId", 27); - - npcStartConversation (player, npc, "vana_sage", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (!vana_sage_condition_playerIsHighLvl (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - string_id message = new string_id (c_stringFile, "s_102"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (vana_sage_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - string_id message = new string_id (c_stringFile, "s_106"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("vana_sage")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.vana_sage.branchId"); - - if (branchId == 4 && vana_sage_handleBranch4 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 7 && vana_sage_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && vana_sage_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && vana_sage_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && vana_sage_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && vana_sage_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && vana_sage_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && vana_sage_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && vana_sage_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && vana_sage_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && vana_sage_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && vana_sage_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && vana_sage_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && vana_sage_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 23 && vana_sage_handleBranch23 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 25 && vana_sage_handleBranch25 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 26 && vana_sage_handleBranch26 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 27 && vana_sage_handleBranch27 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 28 && vana_sage_handleBranch28 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 29 && vana_sage_handleBranch29 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.vana_sage.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/water_treatment.java b/sku.0/sys.server/compiled/game/script/conversation/water_treatment.java deleted file mode 100644 index 0aa48a2db..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/water_treatment.java +++ /dev/null @@ -1,1090 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class water_treatment extends script.base_script -{ - public water_treatment() - { - } - String c_stringFile = "conversation/water_treatment"; - - - public boolean water_treatment_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean water_treatment_condition_hasInitialQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_meet_townspeople", "findFiltrationGuy") || (groundquests.hasCompletedQuest(player, "u16_nym_meet_townspeople") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_1")); - } - - - public boolean water_treatment_condition_isFinishingFirstQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_repair_mixing_chamber", "returnChemical") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_repair_mixing_chamber") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_2")); - } - - - public boolean water_treatment_condition_isFinishingSecondQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_under_pressure", "returnValves") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_under_pressure") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_parts_3")); - } - - - public boolean water_treatment_condition_isFinishingThirdQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_repair_flocculation_chamber", "returnRegulator") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_repair_flocculation_chamber") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson")); - } - - - public boolean water_treatment_condition_hasFinishedAllQuests(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isQuestActiveOrComplete(player, "u16_nym_return_townsperson"); - - } - - - public boolean water_treatment_condition_hasFirstQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_1", "findQuartermaster") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_1") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_repair_mixing_chamber")); - } - - - public boolean water_treatment_condition_hasSecondQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_2", "goQuartermaster") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_2") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_under_pressure")); - } - - - public boolean water_treatment_condition_hasThirdQuest(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_parts_3", "goQuartermasterAgain") || (groundquests.hasCompletedQuest(player, "u16_nym_themepark_parts_3") && !groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_save_agent")); - } - - - public boolean water_treatment_condition_hasNotFixedMixer(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_repair_mixing_chamber", "fixMixingChamber"); - } - - - public boolean water_treatment_condition_hasNotFixedSediment(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_under_pressure", "fixSedimentation"); - } - - - public boolean water_treatment_condition_hasNotFixedFlocculation(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc,player); - return groundquests.isTaskActive(player, "u16_nym_themepark_repair_flocculation_chamber", "fixFlocculation"); - } - - - public void water_treatment_action_signalMeetingFirstTime(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasFoundFiltrationGuy"); - } - - - public void water_treatment_action_giveFirstQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_parts_1"); - } - - - public void water_treatment_action_giveSecondQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_parts_2"); - } - - - public void water_treatment_action_giveThirdQuest(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_themepark_parts_3"); - } - - - public void water_treatment_action_finishUpMixingChamber(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasReturnedChemical"); - } - - - public void water_treatment_action_grantReturnTownPerson(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.grantQuest(player, "u16_nym_return_townsperson"); - } - - - public void water_treatment_action_finishUpFloc(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasReturnedRegulator"); - } - - - public void water_treatment_action_finishUpPressure(obj_id player, obj_id npc) throws InterruptedException - { - groundquests.sendSignal(player, "hasReturnedValves"); - } - - - public int water_treatment_handleBranch2(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_18")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shrug_shoulders"); - - string_id message = new string_id (c_stringFile, "s_19"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_42"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 3); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch3(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_42")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "thank"); - - water_treatment_action_grantReturnTownPerson (player, npc); - - string_id message = new string_id (c_stringFile, "s_43"); - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - npcEndConversationWithMessage (player, pp); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch6(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_66")) - { - doAnimationAction (player, "standing_placate"); - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "udaman"); - - string_id message = new string_id (c_stringFile, "s_67"); - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_16")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - string_id message = new string_id (c_stringFile, "s_21"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_40"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_40")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - water_treatment_action_giveThirdQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_41"); - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_29")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "shake_head_no"); - - string_id message = new string_id (c_stringFile, "s_37"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_38"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_38")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod_head_once"); - - water_treatment_action_giveSecondQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_39"); - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_45")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_47"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_49"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_49")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "sigh_deeply"); - - string_id message = new string_id (c_stringFile, "s_51"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_53"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 20); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_53")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "slump_head"); - - string_id message = new string_id (c_stringFile, "s_55"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_59"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_59")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "explain"); - - string_id message = new string_id (c_stringFile, "s_68"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_70"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 22); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int water_treatment_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_70")) - { - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "wave1"); - - water_treatment_action_giveFirstQuest (player, npc); - - string_id message = new string_id (c_stringFile, "s_72"); - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.water_treatment"); - } - - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - setCondition( self, CONDITION_INTERESTING ); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.water_treatment"); - - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (water_treatment_condition_hasFinishedAllQuests (player, npc)) - { - doAnimationAction (player, "udaman"); - - string_id message = new string_id (c_stringFile, "s_57"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition_isFinishingThirdQuest (player, npc)) - { - doAnimationAction (npc, "celebrate1"); - - water_treatment_action_finishUpFloc (player, npc); - - string_id message = new string_id (c_stringFile, "s_17"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_18"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 2); - - npcStartConversation (player, npc, "water_treatment", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition_hasThirdQuest (player, npc)) - { - doAnimationAction (npc, "yawn"); - - doAnimationAction (player, "explain"); - - string_id message = new string_id (c_stringFile, "s_62"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition_hasNotFixedFlocculation (player, npc)) - { - doAnimationAction (npc, "applause_excited"); - - string_id message = new string_id (c_stringFile, "s_65"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_66"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 6); - - npcStartConversation (player, npc, "water_treatment", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition_isFinishingSecondQuest (player, npc)) - { - doAnimationAction (npc, "thank"); - - water_treatment_action_finishUpPressure (player, npc); - - string_id message = new string_id (c_stringFile, "s_14"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_16"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 8); - - npcStartConversation (player, npc, "water_treatment", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition_hasSecondQuest (player, npc)) - { - doAnimationAction (player, "slump_head"); - - string_id message = new string_id (c_stringFile, "s_61"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition_hasNotFixedSediment (player, npc)) - { - doAnimationAction (npc, "nod_head_multiple"); - - string_id message = new string_id (c_stringFile, "s_64"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition_isFinishingFirstQuest (player, npc)) - { - doAnimationAction (npc, "applause_polite"); - - water_treatment_action_finishUpMixingChamber (player, npc); - - string_id message = new string_id (c_stringFile, "s_27"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_29"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 13); - - npcStartConversation (player, npc, "water_treatment", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition_hasFirstQuest (player, npc)) - { - doAnimationAction (npc, "shrug_hands"); - - string_id message = new string_id (c_stringFile, "s_58"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition_hasNotFixedMixer (player, npc)) - { - doAnimationAction (npc, "standing_placate"); - - string_id message = new string_id (c_stringFile, "s_63"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition_hasInitialQuest (player, npc)) - { - doAnimationAction (npc, "gesticulate_wildly"); - - water_treatment_action_signalMeetingFirstTime (player, npc); - - string_id message = new string_id (c_stringFile, "s_36"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (water_treatment_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_45"); - } - - utils.setScriptVar (player, "conversation.water_treatment.branchId", 18); - - npcStartConversation (player, npc, "water_treatment", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (water_treatment_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "sneeze"); - - string_id message = new string_id (c_stringFile, "s_74"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("water_treatment")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.water_treatment.branchId"); - - if (branchId == 2 && water_treatment_handleBranch2 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 3 && water_treatment_handleBranch3 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 6 && water_treatment_handleBranch6 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && water_treatment_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && water_treatment_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && water_treatment_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && water_treatment_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && water_treatment_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && water_treatment_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && water_treatment_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && water_treatment_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && water_treatment_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.water_treatment.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/conversation/zahara_cody.java b/sku.0/sys.server/compiled/game/script/conversation/zahara_cody.java deleted file mode 100644 index 29b037270..000000000 --- a/sku.0/sys.server/compiled/game/script/conversation/zahara_cody.java +++ /dev/null @@ -1,2311 +0,0 @@ -package script.conversation; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.buff; -import script.library.chat; -import script.library.conversation; -import script.library.groundquests; -import script.library.utils; - - -public class zahara_cody extends script.base_script -{ - public zahara_cody() - { - } - String c_stringFile = "conversation/zahara_cody"; - - - public boolean zahara_cody_condition__defaultCondition(obj_id player, obj_id npc) throws InterruptedException - { - return true; - } - - - public boolean zahara_cody_condition_isImperialNotImmunized(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - return (groundquests.isQuestActive(player, "outbreak_quest_01_imperial") || groundquests.isQuestActive(player, "outbreak_quest_01_rebel") || groundquests.isQuestActive(player, "outbreak_quest_01_neutral")); - } - - - public boolean zahara_cody_condition_hasTrigTask(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.isTaskActive(player, "outbreak_quest_01_b_imperial", "talkToTrig") || groundquests.isTaskActive(player, "outbreak_quest_01_b_rebel", "talkToTrig") || groundquests.isTaskActive(player, "outbreak_quest_01_b_neutral", "talkToTrig") ); - } - - - public boolean zahara_cody_condition_hasFoundEpsilon(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_quest_02_imperial") || groundquests.hasCompletedQuest(player, "outbreak_quest_02_rebel") || groundquests.hasCompletedQuest(player, "outbreak_quest_02_neutral"); - } - - - public boolean zahara_cody_condition_hasDeliveredRadioEpsilon(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_radio_delivery_03"); - } - - - public boolean zahara_cody_condition_hasCompletedQuest01(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") || groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") || groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral"); - } - - - public boolean zahara_cody_condition_hasCompletedQuestLine(obj_id player, obj_id npc) throws InterruptedException - { - return groundquests.hasCompletedQuest(player, "outbreak_quest_final_imperial") || groundquests.hasCompletedQuest(player, "outbreak_quest_final_neutral") || groundquests.hasCompletedQuest(player, "outbreak_quest_final_rebel"); - } - - - public boolean zahara_cody_condition_hasDeletedQuest01b(obj_id player, obj_id npc) throws InterruptedException - { - return (groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_b_imperial")) || (groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_b_rebel")) || (groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_b_neutral")); - } - - - public void zahara_cody_action_giveAntiVirus(obj_id player, obj_id npc) throws InterruptedException - { - faceTo(npc, player); - groundquests.sendSignal(player, "hasBeenInnoculated"); - utils.setScriptVar(player, "outbreak.innoculated", 1); - - buff.removeBuff(player, "death_troopers_infection_1"); - buff.removeBuff(player, "death_troopers_infection_2"); - buff.removeBuff(player, "death_troopers_infection_3"); - } - - - public void zahara_cody_action_makeTrigWave(obj_id player, obj_id npc) throws InterruptedException - { - if (!hasObjVar(npc, "myTrig")) - { - CustomerServiceLog("outbreak_themepark", "outbreak_zahara_cody conversation: Han has no Trig objvar. Self: "+npc); - return; - } - - obj_id myTrig = getObjIdObjVar(npc, "myTrig"); - if (!isValidId(myTrig) || !exists(myTrig)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_zahara_cody conversation: Cody has a trig objvar that is invalid. Self: "+ npc); - return; - } - faceTo(myTrig, player); - doAnimationAction(myTrig, "wave1"); - } - - - public void zahara_cody_action_giveQuest1b(obj_id player, obj_id npc) throws InterruptedException - { - if ((groundquests.hasCompletedQuest(player, "outbreak_quest_01_imperial") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_b_imperial"))) - { - groundquests.grantQuest(player, "outbreak_quest_01_b_imperial"); - return; - } - - if ((groundquests.hasCompletedQuest(player, "outbreak_quest_01_rebel") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_b_rebel"))) - { - groundquests.grantQuest(player, "outbreak_quest_01_b_rebel"); - return; - } - - if ((groundquests.hasCompletedQuest(player, "outbreak_quest_01_neutral") && !groundquests.isQuestActiveOrComplete(player, "outbreak_quest_01_b_neutral"))) - { - groundquests.grantQuest(player, "outbreak_quest_01_b_neutral"); - return; - } - } - - - public int zahara_cody_handleBranch7(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_12")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - zahara_cody_action_makeTrigWave (player, npc); - - string_id message = new string_id (c_stringFile, "s_123"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_124"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 8); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch8(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_124")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_128"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_64"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 9); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch9(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_64")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_66"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_68"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 10); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch10(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_68")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_70"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_72"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 11); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch11(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_72")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_75"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_105"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_169"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_207"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch12(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_77")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_81"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_97")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_105")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_107"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_169")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_173"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_207")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "pet_creature_medium"); - - zahara_cody_action_giveAntiVirus (player, npc); - - string_id message = new string_id (c_stringFile, "s_208"); - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch13(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_81")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_167"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_168"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 14); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch14(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_168")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_199"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_105"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_169"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_207"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch15(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_77")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_81"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_97")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_105")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_107"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_169")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_173"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_207")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "pet_creature_medium"); - - zahara_cody_action_giveAntiVirus (player, npc); - - string_id message = new string_id (c_stringFile, "s_208"); - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch16(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_101")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_103"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_105"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_169"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_207"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch17(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_77")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_81"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_97")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_105")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_107"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_169")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_173"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_207")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "pet_creature_medium"); - - zahara_cody_action_giveAntiVirus (player, npc); - - string_id message = new string_id (c_stringFile, "s_208"); - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch18(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_109")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_111"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_113"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 19); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch19(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_113")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_115"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_105"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_169"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_207"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch20(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_77")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_81"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_97")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_105")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_107"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_169")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_173"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_207")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "pet_creature_medium"); - - zahara_cody_action_giveAntiVirus (player, npc); - - string_id message = new string_id (c_stringFile, "s_208"); - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch21(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_177")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_181"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - boolean hasResponse1 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse1 = true; - } - - boolean hasResponse2 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse2 = true; - } - - boolean hasResponse3 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse3 = true; - } - - boolean hasResponse4 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse4 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_77"); - } - - if (hasResponse1) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_97"); - } - - if (hasResponse2) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_105"); - } - - if (hasResponse3) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_169"); - } - - if (hasResponse4) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_207"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 12); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int zahara_cody_handleBranch22(obj_id player, obj_id npc, string_id response) throws InterruptedException - { - - if (response.equals("s_77")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_79"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_81"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 13); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_97")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_99"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_101"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 16); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_105")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_107"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_109"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 18); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_169")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_173"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_177"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 21); - - npcSpeak (player, message); - npcSetConversationResponses (player, responses); - } - else - { - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - } - - return SCRIPT_CONTINUE; - } - - } - - if (response.equals("s_207")) - { - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - doAnimationAction (npc, "pet_creature_medium"); - - zahara_cody_action_giveAntiVirus (player, npc); - - string_id message = new string_id (c_stringFile, "s_208"); - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - npcEndConversationWithMessage (player, message); - - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_DEFAULT; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if ((!isTangible (self)) || (isPlayer (self))) - { - detachScript(self, "conversation.zahara_cody"); - } - - setCondition (self, CONDITION_CONVERSABLE); - messageTo(self, "findNpc", null, 2, false); - CustomerServiceLog("outbreak_themepark", "outbreak_zahara_cody conversation: Cody is looking for Trig. Self: "+self); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCondition (self, CONDITION_CONVERSABLE); - messageTo(self, "findNpc", null, 2, false); - CustomerServiceLog("outbreak_themepark", "outbreak_zahara_cody conversation: Cody is looking for Trig. Self: "+self); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info menuInfo) throws InterruptedException - { - int menu = menuInfo.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data menuInfoData = menuInfo.getMenuItemById (menu); - menuInfoData.setServerNotify (false); - setCondition (self, CONDITION_CONVERSABLE); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - clearCondition (self, CONDITION_CONVERSABLE); - detachScript (self, "conversation.zahara_cody"); - - return SCRIPT_CONTINUE; - } - - - public int findNpc(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "outbreak_zahara_cody findNpc(): Initialized"); - obj_id[] npcList = getAllObjectsWithObjVar(getLocation(self), 3.f, "trig"); - if (npcList == null || npcList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "outbreak_zahara_cody findNpc(): Failed to find NPC var on any objects within range."); - messageTo(self, "findNpc", null, 60, false); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "outbreak_han_solo findNpc(): Found NPC within range."); - setObjVar(self, "myTrig", npcList[0]); - return SCRIPT_CONTINUE; - } - - - public boolean npcStartConversation(obj_id player, obj_id npc, String convoName, string_id greetingId, prose_package greetingProse, string_id[] responses) throws InterruptedException - { - Object[] objects = new Object[responses.length]; - System.arraycopy(responses, 0, objects, 0, responses.length); - return npcStartConversation(player, npc, convoName, greetingId, greetingProse, objects); - } - - - public int OnStartNpcConversation(obj_id self, obj_id player) throws InterruptedException - { - obj_id npc = self; - - if (ai_lib.isInCombat (npc) || ai_lib.isInCombat (player)) - { - return SCRIPT_OVERRIDE; - } - - if (zahara_cody_condition_hasCompletedQuestLine (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_212"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (zahara_cody_condition_hasDeliveredRadioEpsilon (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_210"); - prose_package pp = new prose_package (); - pp.stringId = message; - pp.actor.set (player); - pp.target.set (npc); - - chat.chat (npc, player, null, null, pp); - return SCRIPT_CONTINUE; - } - - if (zahara_cody_condition_hasFoundEpsilon (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_209"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (zahara_cody_condition_hasDeletedQuest01b (player, npc)) - { - zahara_cody_action_giveQuest1b (player, npc); - - string_id message = new string_id (c_stringFile, "s_213"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (zahara_cody_condition_hasCompletedQuest01 (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_211"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (zahara_cody_condition_hasTrigTask (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_59"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - if (zahara_cody_condition_isImperialNotImmunized (player, npc)) - { - doAnimationAction (npc, "nod"); - - string_id message = new string_id (c_stringFile, "s_10"); - int numberOfResponses = 0; - - boolean hasResponse = false; - - boolean hasResponse0 = false; - if (zahara_cody_condition__defaultCondition (player, npc)) - { - ++numberOfResponses; - hasResponse = true; - hasResponse0 = true; - } - - if (hasResponse) - { - int responseIndex = 0; - string_id responses[] = new string_id[numberOfResponses]; - - if (hasResponse0) - { - responses[responseIndex++] = new string_id (c_stringFile, "s_12"); - } - - utils.setScriptVar (player, "conversation.zahara_cody.branchId", 7); - - npcStartConversation (player, npc, "zahara_cody", message, responses); - } - else - { - chat.chat (npc, player, message); - } - - return SCRIPT_CONTINUE; - } - - if (zahara_cody_condition__defaultCondition (player, npc)) - { - - string_id message = new string_id (c_stringFile, "s_73"); - chat.chat (npc, player, message); - - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: All conditions for OnStartNpcConversation were false."); - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String conversationId, obj_id player, string_id response) throws InterruptedException - { - if (!conversationId.equals("zahara_cody")) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = self; - - int branchId = utils.getIntScriptVar (player, "conversation.zahara_cody.branchId"); - - if (branchId == 7 && zahara_cody_handleBranch7 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 8 && zahara_cody_handleBranch8 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 9 && zahara_cody_handleBranch9 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 10 && zahara_cody_handleBranch10 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 11 && zahara_cody_handleBranch11 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 12 && zahara_cody_handleBranch12 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 13 && zahara_cody_handleBranch13 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 14 && zahara_cody_handleBranch14 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 15 && zahara_cody_handleBranch15 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 16 && zahara_cody_handleBranch16 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 17 && zahara_cody_handleBranch17 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 18 && zahara_cody_handleBranch18 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 19 && zahara_cody_handleBranch19 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 20 && zahara_cody_handleBranch20 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 21 && zahara_cody_handleBranch21 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - if (branchId == 22 && zahara_cody_handleBranch22 (player, npc, response) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - chat.chat (npc, "Error: Fell through all branches and responses for OnNpcConversationResponse."); - - utils.removeScriptVar (player, "conversation.zahara_cody.branchId"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/corpse/ai_corpse.java b/sku.0/sys.server/compiled/game/script/corpse/ai_corpse.java deleted file mode 100644 index f64fef6db..000000000 --- a/sku.0/sys.server/compiled/game/script/corpse/ai_corpse.java +++ /dev/null @@ -1,587 +0,0 @@ -package script.corpse; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.pet_lib; -import script.library.beast_lib; -import script.library.utils; -import script.library.corpse; -import script.library.permissions; -import script.library.money; -import script.library.prose; -import script.library.group; -import script.library.ai_lib; -import script.library.loot; -import script.library.smuggler; - - -public class ai_corpse extends script.base_script -{ - public ai_corpse() - { - } - public static final string_id SID_NO_ITEMS = new string_id( "loot_n", "no_items"); - public static final string_id SID_NOT_IN_COMBAT = new string_id( "loot_n", "not_in_combat"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCreatureStatic(self, true); - - if (beast_lib.isBeast(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id inventory = utils.getInventoryContainer(self); - if (!hasScript(inventory, corpse.SCRIPT_AI_CORPSE_INVENTORY)) - { - attachScript(inventory, corpse.SCRIPT_AI_CORPSE_INVENTORY); - } - utils.setScriptVar( self, "timeLootable", getGameTime() + 1 ); - messageTo(self, corpse.HANDLER_CORPSE_EXPIRE, null, corpse.AI_CORPSE_EXPIRATION_TIME, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (beast_lib.isBeast(self)) - { - return SCRIPT_CONTINUE; - } - - boolean canOpen = corpse.hasLootPermissions(self, player); - - int mnu = -1; - menu_info_data mid = mi.getMenuItemByType(menu_info_types.LOOT); - - if (mid == null) - { - mnu = mi.addRootMenu (menu_info_types.LOOT, new string_id("","")); - } - else - { - mid.setServerNotify(true); - mnu = mid.getId(); - } - - if (mnu > 0) - { - if (canOpen) - { - if (canHarvest( self, player )) - { - int[] hasResource = getIntArrayObjVar(self, corpse.VAR_HAS_RESOURCE); - if (hasResource != null) - { - int hm = mi.addRootMenu( menu_info_types.SERVER_HARVEST_CORPSE, corpse.SID_HARVEST_CORPSE ); - if (hasResource[corpse.CCR_MEAT] > 0) - { - mi.addSubMenu( hm, menu_info_types.SERVER_MENU5, corpse.SID_HARVEST_MEAT ); - } - - if (hasResource[corpse.CCR_HIDE] > 0) - { - mi.addSubMenu( hm, menu_info_types.SERVER_MENU6, corpse.SID_HARVEST_HIDE ); - } - - if (hasResource[corpse.CCR_BONE] > 0) - { - mi.addSubMenu( hm, menu_info_types.SERVER_MENU7, corpse.SID_HARVEST_BONE ); - } - } - } - } - } - - String strLootTable = getStringObjVar(self, "loot.lootTable"); - - if (strLootTable == null || strLootTable.length() < 1) - { - return SCRIPT_CONTINUE; - } - - if ((!strLootTable.startsWith("npc") && !strLootTable.startsWith("droid")) || utils.hasScriptVar(self, "contrabandChecked")) - { - return SCRIPT_CONTINUE; - } - - String playerClass = getSkillTemplate(player); - - if (isIdValid(player) && canOpen && playerClass.startsWith("smuggler") && getLevel(player) > 9) - { - mnu = mi.addRootMenu(menu_info_types.SERVER_MENU1, new string_id("smuggler/items", "mnu_find_illicit_goods")); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (getState( player, STATE_COMBAT ) == 1) - { - sendSystemMessage( player, SID_NOT_IN_COMBAT ); - return SCRIPT_OVERRIDE; - } - - if (utils.getDistance2D( self, player) > 10) - { - return SCRIPT_OVERRIDE; - } - - if (beast_lib.isBeast(self)) - { - return SCRIPT_CONTINUE; - } - - int timeLootable = utils.getIntScriptVar( self, "timeLootable"); - int currentTime = getGameTime(); - if (timeLootable >= currentTime) - { - return SCRIPT_OVERRIDE; - } - - boolean canOpen = corpse.hasLootPermissions(self, player); - - if (!isMob(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!isIncapacitated(self)) - { - return SCRIPT_OVERRIDE; - } - - if (isIncapacitated(player)) - { - return SCRIPT_OVERRIDE; - } - - if (pet_lib.isPet (self)) - { - return SCRIPT_OVERRIDE; - } - - if (!hasObjVar(self, "readyToLoot")) - { - return SCRIPT_OVERRIDE; - } - - if (item == menu_info_types.SERVER_MENU1) - { - String playerClass = getSkillTemplate(player); - - if (isIdValid(player) && canOpen && playerClass.startsWith("smuggler") && getLevel(player) > 9) - { - smuggler.inspectCorpseForContraband(player, self); - } - } - - obj_id inv = utils.getInventoryContainer(self); - obj_id[] items = getContents(inv); - boolean emptyCorpse = (items == null || items.length < 1); - - if (item == menu_info_types.LOOT) - { - if (canOpen) - { - if (isIdValid(inv)) - { - if (!isIdValid(player) || !isPlayer(player) || getContainerType(self) == 0) - { - return SCRIPT_OVERRIDE; - } - - if (pet_lib.isPet(self)) - { - return SCRIPT_OVERRIDE; - } - - if (group.isGrouped (player)) - { - obj_id team = getGroupObject(player); - int lootRule = getGroupLootRule (team); - - if (lootRule == group.MASTER_LOOTER) - { - - if (!loot.doGroupLootAllCheck (player, self)) - { - return SCRIPT_OVERRIDE; - } - } - - else if (lootRule == group.LOTTERY) - { - if (hasObjVar (self, "allowedToOpenFromFailedTransfer_" + player )) - { - - if (!emptyCorpse) - { - queueCommand(player, (1880585606), inv, "", COMMAND_PRIORITY_DEFAULT); - } - else - { - sendSystemMessage( player, SID_NO_ITEMS ); - if (!canHarvest(self,player) && !utils.hasScriptVar(self,"quickDestroy")) - { - utils.setScriptVar(self,"quickDestroy", true); - messageTo(self, corpse.HANDLER_CORPSE_EXPIRE, null, 2.0f, false); - } - } - return SCRIPT_CONTINUE; - } - - if (!loot.doGroupLootAllCheck (player, self)) - { - return SCRIPT_OVERRIDE; - } - } - } - - if (!emptyCorpse) - { - queueCommand(player, (1880585606), inv, "", COMMAND_PRIORITY_DEFAULT); - } - else - { - sendSystemMessage( player, SID_NO_ITEMS ); - if (!canHarvest(self,player) && !utils.hasScriptVar(self,"quickDestroy")) - { - utils.setScriptVar(self,"quickDestroy", true); - messageTo(self, corpse.HANDLER_CORPSE_EXPIRE, null, 2.0f, false); - } - } - } - - return SCRIPT_CONTINUE; - } - } - - else - { - if (canOpen) - { - if (canHarvest( self, player )) - { - if (item == menu_info_types.SERVER_HARVEST_CORPSE) - { - queueCommand( player, (43846853), self, "", COMMAND_PRIORITY_DEFAULT ); - } - else if (item == menu_info_types.SERVER_MENU5) - { - queueCommand( player, (43846853), self, "meat", COMMAND_PRIORITY_DEFAULT ); - } - else if (item == menu_info_types.SERVER_MENU6) - { - queueCommand( player, (43846853), self, "hide", COMMAND_PRIORITY_DEFAULT ); - } - else if (item == menu_info_types.SERVER_MENU7) - { - queueCommand( player, (43846853), self, "bone", COMMAND_PRIORITY_DEFAULT ); - } - - sendDirtyObjectMenuNotification(self); - } - } - } - - if (!canOpen) - { - sendSystemMessage( player, permissions.SID_NO_CORPSE_PERMISSION ); - } - - return SCRIPT_CONTINUE; - } - - - public int harvestCorpse(obj_id self, dictionary params) throws InterruptedException - { - - if (params == null) - { - return SCRIPT_CONTINUE; - } - obj_id player = params.getObjId( "player"); - if (!isIdValid( player )) - { - return SCRIPT_CONTINUE; - } - String args = params.getString( "args"); - - corpse.harvestCreatureCorpse( player, self, args ); - - return SCRIPT_CONTINUE; - } - - - public int handleLootAddPass(obj_id self, dictionary params) throws InterruptedException - { - int bankBalance = getBankBalance(self); - - withdrawCashFromBank(self, bankBalance, money.HANDLER_LOOT_WITHDRAW_PASS, money.HANDLER_LOOT_WITHDRAW_FAIL, params); - return SCRIPT_CONTINUE; - } - - - public int handleLootAddFail(obj_id self, dictionary params) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int handleLootWithdrawPass(obj_id self, dictionary params) throws InterruptedException - { - if (params != null) - { - int amt = params.getInt(money.DICT_AMOUNT); - - } - else - { - - } - return SCRIPT_CONTINUE; - } - - - public int handleLootWithdrawFail(obj_id self, dictionary params) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int handleCorpseExpire(obj_id self, dictionary params) throws InterruptedException - { - obj_id inv = utils.getInventoryContainer(self); - if (isIdValid(inv)) - { - obj_id[] contents = getContents(inv); - if ((contents != null) && (contents.length != 0)) - { - int time = getGameTime(); - int lootTime = utils.getIntScriptVar(self, "lootTimestamp"); - - if (time - lootTime < 60) - { - messageTo(self, corpse.HANDLER_CORPSE_EXPIRE, null, 10, false); - return SCRIPT_CONTINUE; - } - } - } - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int handleCorpseEmpty(obj_id self, dictionary params) throws InterruptedException - { - LOG("loot","handleCorpseEmpty INIT"); - - obj_id inv = utils.getInventoryContainer(self); - if (isIdValid(inv)) - { - obj_id[] contents = getContents(inv); - if ((contents == null) || (contents.length == 0)) - { - int cash = getCashBalance(self); - if (cash == 0) - { - if (!hasObjVar(self, corpse.VAR_HAS_RESOURCE)) - { - messageTo(self, corpse.HANDLER_CORPSE_EXPIRE, null, 0, false); - return SCRIPT_CONTINUE; - } - else - { - messageTo(self, corpse.HANDLER_CORPSE_EXPIRE, null, corpse.AI_CORPSE_EMPTY_TIME, false); - return SCRIPT_CONTINUE; - } - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleAttemptCorpseCleanup(obj_id self, dictionary params) throws InterruptedException - { - LOG("loot","handleAttemptCorpseCleanup:DESTROYING CORPSE"); - messageTo(self, "handleCorpseEmpty", null, 0, false); - return SCRIPT_CONTINUE; - } - - - public int OnLootLotterySelected(obj_id self, obj_id player, obj_id[] selection_ids) throws InterruptedException - { - obj_id selfInv = utils.getInventoryContainer (self); - - int numWindowsOpen = getIntObjVar(self, "numWindowsOpen"); - numWindowsOpen = numWindowsOpen - 1; - setObjVar (self, "numWindowsOpen", numWindowsOpen); - - for (int i = 0; i < selection_ids.length; ++i) - { - testAbortScript(); - obj_id thisObject = selection_ids[i]; - - if (!hasObjVar (thisObject, "numLotteryPlayers")) - { - setObjVar (thisObject, "numLotteryPlayers", 1); - setObjVar (thisObject, "lotteryPlayer1", player); - } - else - { - int numLotteryPlayers = getIntObjVar (thisObject, "numLotteryPlayers"); - numLotteryPlayers = numLotteryPlayers + 1; - setObjVar (thisObject, "lotteryPlayer"+ numLotteryPlayers, player); - setObjVar (thisObject, "numLotteryPlayers", numLotteryPlayers); - } - } - return SCRIPT_CONTINUE; - } - - - public int fireLotteryPulse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId ("player"); - obj_id corpseInv = params.getObjId ("corpseInv"); - obj_id corpseId = getContainedBy(corpseInv); - int numTimesFired = params.getInt ("fired"); - int numWindowsOpen = getIntObjVar (corpseId, "numWindowsOpen"); - numTimesFired = numTimesFired + 1; - - if (!utils.hasScriptVar(self, "default_money_recipient_inventory")) - { - utils.setScriptVar(self, "default_money_recipient_inventory", utils.getInventoryContainer(player)); - } - - if (numTimesFired > 18 || numWindowsOpen <= 0) - { - boolean allTransfersComplete = true; - - obj_id[] corpseContents = getContents (corpseInv); - for (int i = 0; i < corpseContents.length; ++i) - { - testAbortScript(); - obj_id item = corpseContents[i]; - - int numLotteryPlayers = getIntObjVar (item, "numLotteryPlayers"); - - int lotteryNumber = rand (1, numLotteryPlayers); - obj_id lottoWinner = getObjIdObjVar (item, "lotteryPlayer"+ lotteryNumber); - - if (numWindowsOpen > 0) - { - setObjVar (item, "pickupable", lottoWinner); - } - - obj_id winventory = utils.getInventoryContainer(lottoWinner); - - utils.setScriptVar(lottoWinner, "autostack.ignoreitems", 1); - - if (loot.isCashLootItem(item)) - { - - if (isIdNull(winventory)) - { - winventory = utils.getObjIdScriptVar(self, "default_money_recipient_inventory"); - } - - putIn(item, winventory); - continue; - } - - if (!putIn(item, winventory)) - { - - if (!loot.isCashLootItem(item)) - { - - String transferProblem = "full_inventory_free_for_all"; - - boolean inventoryHasRoom = (getVolumeFree(winventory) > 0); - - if (inventoryHasRoom) - { - - transferProblem = "unable_to_transfer"; - setObjVar (corpseId, "allowedToOpenFromFailedTransfer_"+ lottoWinner, 1); - setObjVar (item, "pickupable", lottoWinner); - } - else - { - - loot.setAutoLootComplete(lottoWinner, corpseId, item); - } - - dictionary proseParameters = new dictionary(); - proseParameters.put ("stf", group.GROUP_STF); - proseParameters.put ("message", transferProblem); - proseParameters.put ("TO", item); - proseParameters.put ("TT", lottoWinner); - - obj_id gid = getGroupObject (lottoWinner); - obj_id[] members = utils.getLocalGroupMemberIds(gid); - - for (int x = 0; x < members.length; ++x) - { - testAbortScript(); - messageTo(members[x], "sendSystemMessageProseAuthoritative", proseParameters, 1, true); - } - - allTransfersComplete = false; - } - - } - else - { - - loot.sendGroupLootSystemMessage (item, lottoWinner, "loot_n", "group_looted"); - - messageTo(item, "msgStackItem", null, 1, false); - } - - utils.removeScriptVar(lottoWinner, "autostack.ignoreitems"); - } - - if (allTransfersComplete) - { - - messageTo(corpseId, "handleCorpseEmpty", null, 1f, isObjectPersisted(corpseId)); - } - return SCRIPT_CONTINUE; - } - dictionary lottery = new dictionary(); - - lottery.put ("fired", numTimesFired); - lottery.put ("player", player); - lottery.put ("corpseInv", corpseInv); - - obj_id team = getGroupObject (player); - obj_id[] objMembersWhoExist = utils.getLocalGroupMemberIds(team); - messageTo(self, "fireLotteryPulse", lottery, 2, true); - return SCRIPT_CONTINUE; - } - - - public boolean canHarvest(obj_id self, obj_id player) throws InterruptedException - { - return ( hasObjVar(self, corpse.VAR_HAS_RESOURCE) && !utils.hasScriptVar(self, "harvestedBy." + player) ); - } - -} diff --git a/sku.0/sys.server/compiled/game/script/creature/dynamic_enemy.java b/sku.0/sys.server/compiled/game/script/creature/dynamic_enemy.java deleted file mode 100644 index d94dc4d7a..000000000 --- a/sku.0/sys.server/compiled/game/script/creature/dynamic_enemy.java +++ /dev/null @@ -1,185 +0,0 @@ -package script.creature; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.chat; -import script.library.create; -import script.library.groundquests; -import script.library.prose; -import script.ai.ai_combat; - - -public class dynamic_enemy extends script.base_script -{ - public dynamic_enemy() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - - messageTo(self, "clientEffect", null, 400, true); - - messageTo(self, "attackPlayer", null, 1, false); - messageTo(self, "barkAttack", null, 1, false); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitateTarget(obj_id self, obj_id victim) throws InterruptedException - { - obj_id player = getObjIdObjVar(self, "player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (player != victim) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "expression", null, 3, true); - - return SCRIPT_CONTINUE; - } - - - public int OnLoiterMoving(obj_id self) throws InterruptedException - { - messageTo(self, "clientEffect", null, 3, true); - return SCRIPT_CONTINUE; - } - - - public int clientEffect(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, "clientEffect")) - { - messageTo(self, "cleanUp", null, 0, true); - } - else - { - playClientEffectObj(self, getStringObjVar(self, "clientEffect"), self, ""); - - messageTo(self, "cleanUp", null, 1, true); - } - return SCRIPT_CONTINUE; - } - - - public int cleanUp(obj_id self, dictionary params) throws InterruptedException - { - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int expression(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = getObjIdObjVar(self, "player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - faceTo(self, player); - messageTo(self, "barkDefeat", null, 1, false); - - location body = getLocation(player); - pathTo(self, body); - - messageTo(self, "runAwayThenCleanUp", null, 4, false); - - return SCRIPT_CONTINUE; - } - - - public int runAwayThenCleanUp(obj_id self, dictionary params) throws InterruptedException - { - - location l = groundquests.getRandom2DLocationAroundPlayer(self, 20, 50); - pathTo(self, l); - messageTo( self, "clientEffect", null, 6, true ); - - return SCRIPT_CONTINUE; - } - - - public int attackPlayer(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = getObjIdObjVar(self, "player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - startCombat(self, player); - - return SCRIPT_CONTINUE; - } - - - public int barkAttack(obj_id self, dictionary params) throws InterruptedException - { - obj_id mob = self; - if (params == null) - { - return SCRIPT_CONTINUE; - } - else if (!hasObjVar(mob, "phrase_string_file")) - { - return SCRIPT_OVERRIDE; - } - - String stringFile = getStringObjVar(mob, "phrase_string_file"); - - String attackString = getStringObjVar(mob, "attack_phrase"); - if ((attackString == null) || (attackString.equals(""))) - { - return SCRIPT_OVERRIDE; - } - - string_id attack_phrase = new string_id(stringFile, attackString); - chat.chat(mob, chat.CHAT_SHOUT, chat.MOOD_ANGRY, attack_phrase); - - return SCRIPT_CONTINUE; - } - - - public int barkDefeat(obj_id self, dictionary params) throws InterruptedException - { - obj_id mob = self; - if (params == null) - { - return SCRIPT_CONTINUE; - } - else if (!hasObjVar(mob, "phrase_string_file")) - { - return SCRIPT_OVERRIDE; - } - - String stringFile = getStringObjVar(mob, "phrase_string_file"); - - String defeatString = getStringObjVar(mob, "defeat_phrase"); - if ((defeatString == null) || (defeatString.equals(""))) - { - return SCRIPT_OVERRIDE; - } - - string_id defeat_phrase = new string_id(stringFile, defeatString); - chat.chat(mob, chat.CHAT_SHOUT, chat.MOOD_ANGRY, defeat_phrase); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/creature/foraging_enemy.java b/sku.0/sys.server/compiled/game/script/creature/foraging_enemy.java deleted file mode 100644 index 8088822fc..000000000 --- a/sku.0/sys.server/compiled/game/script/creature/foraging_enemy.java +++ /dev/null @@ -1,275 +0,0 @@ -package script.creature; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.anims; -import script.library.chat; -import script.library.create; -import script.library.group; -import script.library.groundquests; -import script.library.prose; -import script.library.utils; -import script.ai.ai_combat; - - -public class foraging_enemy extends script.base_script -{ - public foraging_enemy() - { - } - public static final String STRING_PREFIX = "foraging/forage_enemy"; - public static final string_id SID_STEAL_SLOT = new string_id(STRING_PREFIX,"slot_removed"); - public static final String FORAGING_ENEMY_TABLE = "datatables/foraging/forage_enemy.iff"; - public static final String FORAGING_COLLECTION = "kill_forage_worm"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - - messageTo(self, "cleanUpGuard", null, 400, true); - - messageTo(self, "attackForager", null, 1, false); - messageTo(self, "barkAttack", null, 1, false); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitateTarget(obj_id self, obj_id victim) throws InterruptedException - { - obj_id player = getObjIdObjVar(self, "player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (player != victim) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "expression", null, 7, true); - - return SCRIPT_CONTINUE; - } - - - public int OnLoiterMoving(obj_id self) throws InterruptedException - { - messageTo(self, "cleanUpGuard", null, 6, true); - return SCRIPT_CONTINUE; - } - - - public int cleanUpGuard(obj_id self, dictionary params) throws InterruptedException - { - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int expression(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = getObjIdObjVar(self, "player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - faceTo(self, player); - messageTo(self, "barkDefeat", null, 1, false); - - location body = getLocation(player); - pathTo(self, body); - - messageTo(self, "runAwayThenCleanUpGuard", null, 4, false); - - return SCRIPT_CONTINUE; - } - - - public int runAwayThenCleanUpGuard(obj_id self, dictionary params) throws InterruptedException - { - location l = groundquests.getRandom2DLocationAroundPlayer(self, 20, 50); - pathTo(self, l); - messageTo( self, "cleanUpGuard", null, 12, true ); - - return SCRIPT_CONTINUE; - } - - - public int attackForager(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = getObjIdObjVar(self, "player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - startCombat(self, player); - - return SCRIPT_CONTINUE; - } - - - public boolean isThief(obj_id mob) throws InterruptedException - { - if (!isValidId(mob)) - { - return false; - } - - String mobName = getStringObjVar(mob, "creature_type"); - - if ((mobName == null) || (mobName.equals(""))) - { - return false; - } - - int index = mobName.indexOf("forage_"); - if (index == 0) - { - return true; - } - - return false; - } - - - public boolean removeFirstSlotFound(obj_id player) throws InterruptedException - { - if (!isValidId(player)) - { - return false; - } - - if (hasCompletedCollection(player, FORAGING_COLLECTION)) - { - return false; - } - - String[] slotsInCollection = getAllCollectionSlotsInCollection(FORAGING_COLLECTION); - - for (int i = 0; i < slotsInCollection.length; i++) - { - testAbortScript(); - - long collectionSlotValue = getCollectionSlotValue(player, slotsInCollection[i]); - if (collectionSlotValue > 0) - { - - modifyCollectionSlotValue(player, slotsInCollection[i], (collectionSlotValue * -1)); - - prose_package pp = new prose_package(); - prose.setStringId(pp, SID_STEAL_SLOT); - prose.setTT(pp, new string_id("collection_n", slotsInCollection[i])); - sendSystemMessageProse(player, pp); - - break; - } - } - - return true; - } - - - public int barkAttack(obj_id self, dictionary params) throws InterruptedException - { - obj_id guard = self; - if (params == null) - { - return SCRIPT_CONTINUE; - } - - boolean isThief = isThief(guard); - if (!isThief) - { - return SCRIPT_CONTINUE; - } - - String mob = getStringObjVar(guard, "creature_type"); - if ((mob == null) || (mob.equals(""))) - { - return SCRIPT_OVERRIDE; - } - - int row = dataTableSearchColumnForString(mob, "enemy", FORAGING_ENEMY_TABLE); - String type = dataTableGetString(FORAGING_ENEMY_TABLE, row, "bark_attack"); - if ((type == null) || (type.equals(""))) - { - return SCRIPT_OVERRIDE; - } - - chat.chat(self, chat.CHAT_SHOUT, chat.MOOD_ANGRY, new string_id("foraging/forage_enemy", "bark_"+type)); - - return SCRIPT_CONTINUE; - } - - - public int barkDefeat(obj_id self, dictionary params) throws InterruptedException - { - obj_id guard = self; - if (params == null) - { - return SCRIPT_CONTINUE; - } - - boolean isThief = isThief(guard); - if (!isThief) - { - return SCRIPT_CONTINUE; - } - - String mob = getStringObjVar(guard, "creature_type"); - if ((mob == null) || (mob.equals(""))) - { - return SCRIPT_OVERRIDE; - } - - int row = dataTableSearchColumnForString(mob, "enemy", FORAGING_ENEMY_TABLE); - String type = dataTableGetString(FORAGING_ENEMY_TABLE, row, "bark_defeat"); - if ((type == null) || (type.equals(""))) - { - return SCRIPT_OVERRIDE; - } - - chat.chat(self, chat.CHAT_SHOUT, chat.MOOD_ANGRY, new string_id("foraging/forage_enemy", "bark_"+type)); - messageTo( self, "removeASlot", null, 4, true ); - - return SCRIPT_CONTINUE; - } - - - public int removeASlot(obj_id self, dictionary params) throws InterruptedException - { - obj_id guard = self; - if (params == null) - { - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(self, "player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - boolean success = removeFirstSlotFound(player); - if (success) - { - doAnimationAction(self, anims.PLAYER_FLEX_BICEPS); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/creature/sarlacc.java b/sku.0/sys.server/compiled/game/script/creature/sarlacc.java deleted file mode 100644 index 4d9decc48..000000000 --- a/sku.0/sys.server/compiled/game/script/creature/sarlacc.java +++ /dev/null @@ -1,227 +0,0 @@ -package script.creature; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.dot; -import script.library.buff; - - -public class sarlacc extends script.base_script -{ - public sarlacc() - { - } - public static final string_id SID_EXTRACT_BILE = new string_id("mob/sarlacc", "extract_bile"); - public static final string_id SID_BILE_FAIL = new string_id("mob/sarlacc", "bile_fail"); - public static final string_id SID_BILE_SUCCESS = new string_id("mob/sarlacc", "bile_success"); - public static final string_id SID_BILE_ALREADY = new string_id("mob/sarlacc", "bile_already"); - public static final string_id SID_SARLACC_ERUPT = new string_id("mob/sarlacc", "sarlacc_erupt"); - public static final string_id SID_SARLACC_POISON = new string_id("mob/sarlacc", "sarlacc_poison"); - public static final string_id SID_SARLACC_DOT = new string_id("mob/sarlacc", "sarlacc_dot"); - - public static final String BILE_OBJECT = "object/tangible/loot/quest/quest_item_sarlacc_bile_jar.iff"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (!hasTriggerVolume( self, "sarlaccBreach" )) - { - createTriggerVolume( "sarlaccBreach", 30.f, true ); - } - if (!hasTriggerVolume( self, "sarlaccPreBreach" )) - { - createTriggerVolume( "sarlaccPreBreach", 60.f, true ); - } - - messageTo( self, "poisonArea", null, 300, false ); - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - - sendSystemMessageTestingOnly(whoTriggeredMe, "triggerend"); - - if (volumeName.equals("sarlaccBreach")) - { - - if (!isPlayer( whoTriggeredMe )) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar( self, "bile.eject" )) - { - playClientEffectLoc( whoTriggeredMe, "clienteffect/cr_sarlacc_erupt.cef", getLocation(self), 3f ); - - obj_id[] contents = getTriggerVolumeContents( self, "sarlaccBreach"); - if (contents != null) - { - for (int i=0; i -1) - { - - colorPrimary(droid, terminal, idx); - } - return SCRIPT_CONTINUE; - } - - - public int handleSecondaryColorize(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getColorPickerIndex(params); - int bp = sui.getIntButtonPressed(params); - obj_id player = sui.getPlayerId(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - if (idx > -1) - { - - colorSecondary(droid, terminal, idx); - } - return SCRIPT_CONTINUE; - } - - - public int getUserOidSetFirstPoint(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(droid, "user"); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - doSetPatrolPoint(droid, player); - return SCRIPT_CONTINUE; - } - - - public int pathDirectlyToStart(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc != null) - { - stop(droid); - pathTo(droid, patrolLoc[0]); - } - return SCRIPT_CONTINUE; - } - - - public int fromLastPointGoBackToStart(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc != null) - { - int patrolLength = patrolLoc.length; - location[] temp = new location[patrolLength]; - for (int i = 0; i < patrolLength; ++i) - { - testAbortScript(); - temp[i] = patrolLoc[(patrolLength-1)-i]; - } - - patrolOnce(droid, temp); - } - return SCRIPT_CONTINUE; - } - - - public int handleActivateDroid(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(droid, "user"); - doPatrol(droid); - return SCRIPT_CONTINUE; - } - - - public int handleDeactivateDroid(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(droid, "user"); - - stop(droid); - if (utils.hasScriptVar(droid, DROID_MOVING)) - { - utils.removeScriptVar(droid, DROID_MOVING); - } - - return SCRIPT_CONTINUE; - } - - - public int reColorDroid(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(terminal, "color.primary") && !hasObjVar(terminal, "color.secondary")) - { - setObjVar(terminal, "color.primary", 0); - setObjVar(terminal, "color.secondary",22); - } - - int primary = getIntObjVar(terminal, "color.primary"); - int secondary = getIntObjVar(terminal, "color.secondary"); - - if (primary < 0 || secondary < 0) - { - return SCRIPT_CONTINUE; - } - - hue.setColor(droid, "/private/index_color_1", primary); - hue.setColor(droid, "/private/index_color_2", secondary); - - return SCRIPT_CONTINUE; - } - - - public int initializeDroidVariables(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - obj_id house = getTopMostContainer(self); - - if (!isIdValid(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(house) || !player_structure.isBuilding(house) || utils.isNestedWithinAPlayer(droid)) - { - messageTo(terminal, "destroyDroid", null, 1, false); - return SCRIPT_CONTINUE; - } - setObjVar(droid, "house", house); - - if (!hasObjVar(terminal, OBJVAR_DROID_PATROL_POINTS)) - { - messageTo(droid, "getUserOidSetFirstPoint", null, 1, false); - } - - if (!hasScript(house, "structure.serving_droid_control")) - { - attachScript(house, "structure.serving_droid_control"); - } - - if (!hasObjVar(house, "serving_droid.droid")) - { - setObjVar(house, "serving_droid.droid", droid); - } - - if (hasObjVar(terminal, "color.primary")) - { - messageTo(droid, "reColorDroid", null, 0, false); - } - - listenToMessage(house, "handleActivateDroid"); - listenToMessage(house, "handleDeactivateDroid"); - return SCRIPT_CONTINUE; - } - - - public int handleDialogInput(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - utils.removeScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU); - } - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - utils.removeScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU); - } - return SCRIPT_CONTINUE; - } - int bp = sui.getIntButtonPressed(params); - switch (bp) - { - case sui.BP_OK: - doPatrol(droid, player); - return SCRIPT_CONTINUE; - - case sui.BP_CANCEL: - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - utils.removeScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU); - } - - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } - - - public boolean colorPrimary(obj_id droid, obj_id terminal, int idx) throws InterruptedException - { - setObjVar(terminal, "color.primary", idx); - hue.setColor(droid, "/private/index_color_1", idx); - return true; - } - - - public boolean colorSecondary(obj_id droid, obj_id terminal, int idx) throws InterruptedException - { - setObjVar(terminal, "color.secondary", idx); - hue.setColor(droid, "/private/index_color_2", idx); - return true; - } - - - public boolean doPatrol(obj_id droid) throws InterruptedException - { - if (!isValidId(droid)) - { - return false; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return false; - } - - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc == null) - { - return false; - } - - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_LOOP)) - { - ai_lib.setPatrolPath(droid, patrolLoc); - return true; - } - else - { - patrolOnce(droid, patrolLoc); - messageTo(droid, "fromLastPointGoBackToStart", null, 120, false); - return true; - } - } - - - public boolean doPatrol(obj_id droid, obj_id player) throws InterruptedException - { - if (!isValidId(droid) || !isValidId(player)) - { - return false; - } - - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - utils.removeScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU); - } - - if (utils.hasScriptVar(droid, DROID_SETTING_PATROL)) - { - utils.removeScriptVar(droid, DROID_SETTING_PATROL); - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return false; - } - - if (!hasObjVar(terminal, OBJVAR_DROID_PATROL_POINTS)) - { - sendSystemMessage(player, ASTROMECH_NO_WAYPOINTS); - return false; - } - - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc == null) - { - return false; - } - - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_LOOP)) - { - ai_lib.setPatrolPath(droid, patrolLoc); - return true; - } - else - { - patrolOnce(droid, patrolLoc); - messageTo(droid, "fromLastPointGoBackToStart", null, 120, false); - return true; - } - } - - - public void doSetPatrolPoint(obj_id droid, obj_id player) throws InterruptedException - { - if (!isValidId(droid) || !isValidId(player)) - { - return; - } - - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - utils.removeScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU); - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return; - } - - if (!utils.hasScriptVar(droid, DROID_SETTING_PATROL)) - { - utils.setScriptVar(droid, DROID_SETTING_PATROL, true); - } - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc == null) - { - patrolLoc = new location[1]; - } - else if (patrolLoc.length < MAX_WAYPOINTS) - { - location[] temp = new location[patrolLoc.length + 1]; - for (int i = 0; i < patrolLoc.length; ++i) - { - testAbortScript(); - temp[i] = patrolLoc[i]; - } - patrolLoc = temp; - } - else - { - sendSystemMessage(player, ASTROMECH_MAX_WAYPOINTS); - return; - } - - location playerLoc = getLocation(player); - if (!isValidId(playerLoc.cell)) - { - sendSystemMessage(player, ASTROMECH_NOT_IN_HOUSE); - return; - } - patrolLoc[patrolLoc.length - 1] = playerLoc; - - setObjVar(terminal, OBJVAR_DROID_PATROL_POINTS, patrolLoc); - - sendSystemMessage(player, SYS_PATROL_ADDED); - sendConsoleMessage(player, "Patrol points left: "+(MAX_WAYPOINTS - patrolLoc.length)); - - pathTo(droid, playerLoc); - } - - - public void doClearPatrolPoints(obj_id droid, obj_id player) throws InterruptedException - { - if (!isValidId(droid) || !isValidId(player)) - { - return; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return; - } - - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_POINTS)) - { - removeObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - sendSystemMessage(player, SYS_PATROL_REMOVED); - - ai_lib.clearPatrolPath(droid); - stop(droid); - messageTo( droid, "resumeDefaultCalmBehavior", null, 1, false ); - } - else - { - sendSystemMessage(player, ASTROMECH_WAYPOINTS_NOT_CLEAR); - } - } - - - public void removeLastPatrolPoint(obj_id droid, obj_id player) throws InterruptedException - { - if (!isValidId(droid) || !isValidId(player)) - { - return; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return; - } - - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_POINTS)) - { - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc == null) - { - sendSystemMessage(player, ASTROMECH_WAYPOINTS_NOT_CLEAR); - } - else if (patrolLoc.length > 0) - { - location[] temp = new location[patrolLoc.length-1]; - for (int i = 0; i < patrolLoc.length-1; ++i) - { - testAbortScript(); - temp[i] = patrolLoc[i]; - } - patrolLoc = temp; - setObjVar(terminal, OBJVAR_DROID_PATROL_POINTS, patrolLoc); - sendSystemMessage(player, SYS_PATROL_ADDED); - sendConsoleMessage(player, "Patrol points left: "+(MAX_WAYPOINTS - patrolLoc.length)); - } - - location playerLoc = getLocation(player); - - if (isValidId(playerLoc.cell)) - { - pathTo(droid, playerLoc); - return; - } - } - } - - - public boolean setPatrolLoop(obj_id droid, obj_id player, obj_id terminal) throws InterruptedException - { - if (!isValidId(droid) || !isValidId(player)) - { - return false; - } - - if (!isValidId(terminal) || !isValidId(terminal)) - { - return false; - } - - if (!hasObjVar(terminal, OBJVAR_DROID_PATROL_LOOP)) - { - setObjVar(terminal, OBJVAR_DROID_PATROL_LOOP, true); - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_ONCE)) - { - removeObjVar(terminal, OBJVAR_DROID_PATROL_ONCE); - } - sendConsoleMessage(player, "Patrol loop setting applied."); - if (utils.hasScriptVar(droid, DROID_MOVING)) - { - stop(droid); - doPatrol(droid, player); - } - - return true; - } - return false; - } - - - public boolean setPatrolOnce(obj_id droid, obj_id player, obj_id terminal) throws InterruptedException - { - if (!hasObjVar(terminal, OBJVAR_DROID_PATROL_ONCE)) - { - setObjVar(terminal, OBJVAR_DROID_PATROL_ONCE, true); - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_LOOP)) - { - removeObjVar(terminal, OBJVAR_DROID_PATROL_LOOP); - } - sendConsoleMessage(player, "Patrol once only setting applied."); - if (utils.hasScriptVar(droid, DROID_MOVING)) - { - stop(droid); - doPatrol(droid, player); - } - return true; - } - return false; - } - - - public int createHelpDialog(obj_id droid, obj_id player) throws InterruptedException - { - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - return -1; - } - - if (!isIdValid(player)) - { - return -1; - } - if (!isIdValid(droid)) - { - return -1; - } - - int pid = sui.createSUIPage( sui.SUI_MSGBOX, droid, player, "handleDialogInput"); - - sui.setSUIProperty( pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, INFO_UI_TEXT ); - sui.setSUIProperty (pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, INFO_UI_TITLE ); - - sui.msgboxButtonSetup( pid, sui.OK_CANCEL ); - sui.setSUIProperty( pid, sui.MSGBOX_BTN_CANCEL, sui.PROP_TEXT, CLOSE); - sui.setSUIProperty( pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, TEST_PATROL); - - sui.showSUIPage(pid); - utils.setScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU, true); - return pid; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/dianoga_dumpster.java b/sku.0/sys.server/compiled/game/script/event/dianoga_dumpster.java deleted file mode 100644 index b6d752d19..000000000 --- a/sku.0/sys.server/compiled/game/script/event/dianoga_dumpster.java +++ /dev/null @@ -1,1591 +0,0 @@ -package script.event; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.util.HashSet; -import script.library.collection; -import script.library.house_pet; -import script.library.prose; -import script.library.smuggler; -import script.library.static_item; -import script.library.space_utils; -import script.library.sui; -import script.library.utils; - - -public class dianoga_dumpster extends script.base_script -{ - public dianoga_dumpster() - { - } - public static final boolean LOGGING_ON = false; - public static final String LOGGING_CATEGORY = "sarlacc"; - - public static final string_id SID_MENU_FEED = new string_id("sarlacc_minigame", "mnu_feed"); - public static final string_id SID_MENU_REWARD = new string_id("sarlacc_minigame", "mnu_reward_dianoga"); - public static final string_id SID_SIFT_SARLACC_BOX = new string_id("sarlacc_minigame", "must_sift_sarlacc_box_dianoga"); - public static final string_id SID_SARLACC_FED = new string_id("sarlacc_minigame", "dianoga_fed"); - public static final string_id SID_FOUND_REWARD = new string_id("sarlacc_minigame", "sifted_reward"); - public static final string_id SID_SARLACC_NOTHING_FOUND = new string_id("sarlacc_minigame", "no_junk_inventory_dianoga"); - public static final string_id SID_VERIFICATION_MSG = new string_id("sarlacc_minigame", "verify_consumption_dianoga"); - public static final string_id SID_ITEM_NOT_FED = new string_id("sarlacc_minigame", "item_not_fed_dianoga"); - public static final string_id SID_ITEM_NOT_BIOLINK_FED = new string_id("sarlacc_minigame", "item_not_biolink_fed_dianoga"); - public static final string_id SID_ITEM_NOT_INVENTORY = new string_id("sarlacc_minigame", "item_not_inventory"); - public static final string_id SID_ITEM_EQUIPPED = new string_id("sarlacc_minigame", "item_not_equipped_dianoga"); - public static final string_id SID_ITEM_NOT_VALID = new string_id("sarlacc_minigame", "item_not_valid_dianoga"); - public static final string_id SID_OUT_OF_RANGE = new string_id("sarlacc_minigame", "out_of_range_dianoga"); - public static final string_id SID_QUEST_ITEM = new string_id("sarlacc_minigame", "item_quest_item_dianoga"); - public static final string_id SID_MENU_GOD_FEED = new string_id("sarlacc_minigame", "use_cs_tool"); - public static final string_id SID_GOD_FEED_MESSAGE = new string_id("sarlacc_minigame", "god_feed_message_dianoga"); - public static final string_id SID_GOD_FEED_NO_FOOD = new string_id("sarlacc_minigame", "god_no_food_message_dianoga"); - public static final string_id SID_FEEDING_DUE_TO_GODMODE = new string_id("sarlacc_minigame", "fed_due_to_godmode_dianoga"); - public static final string_id SID_GOD_ALLOW_PLAYER_SIFT = new string_id("sarlacc_minigame", "god_allow_player_sift_dianoga"); - public static final string_id SID_SOUND_ON = new string_id("sarlacc_minigame", "dianoga_sound_on"); - public static final string_id SID_SOUND_OFF = new string_id("sarlacc_minigame", "dianoga_sound_off"); - public static final string_id SID_MENU_SOUND_OFF = new string_id("sarlacc_minigame", "dianoga_sound_menu_off"); - public static final string_id SID_MENU_SOUND_ON = new string_id("sarlacc_minigame", "dianoga_sound_menu_on"); - - public static final String FEED_TITLE = "@sarlacc_minigame:edible_title_dianoga"; - public static final String FEED_PROMPT = "@sarlacc_minigame:edible_prompt_dianoga"; - public static final String BTN_SELL = "@sarlacc_minigame:btn_feed"; - - public static final String SOUND_SIFT = "sound/sarlacc_drawer_open.snd"; - public static final String SOUND_CUTE = "sound/dianoga_dumpster.snd"; - - public static final String ANIMATON_GROWL = "vocalize"; - public static final String ANIMATON_FEED = "eat"; - - - public int OnDestroy(obj_id self) throws InterruptedException - { - customerSvcLogVerbose(self, "Dianoga: "+self+" is being destroyed."); - - house_pet.stopPlayingMusic(self); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - setUpFirstTime(self); - messageTo(self, "checkTriggerVolume", null, 2, false); - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (!isValidId(getOwner(self)) && utils.isNestedWithinAPlayer(self)) - { - house_pet.setObjectOwner(self); - return SCRIPT_CONTINUE; - } - blog("Sarlacc - OnObjectMenuSelect - init"); - if (hasObjVar(self, house_pet.SARLACC_LAST_FED)) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" has been initialized. Attempting to update Dianoga data."); - if (!updateSarlaccPet(self)) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" could not be updated properly or the update attempt was too soon."); - } - } - - messageTo(self, "checkTriggerVolume", null, 2, false); - return SCRIPT_CONTINUE; - } - - - public int OnTransferred(obj_id self, obj_id sourceContainer, obj_id destContainer, obj_id transferer) throws InterruptedException - { - if (!isValidId(getOwner(self))) - { - house_pet.setObjectOwner(self); - } - - if (!house_pet.validateNpcPlacementInStructure(self)) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!utils.isInHouseCellSpace(self) && !space_utils.isNestedWithinPobShip(self)) - { - return SCRIPT_CONTINUE; - } - if (utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (!isValidId(getOwner(self))) - { - house_pet.setObjectOwner(self); - } - - if (player != getOwner(self) && !isGod(player)) - { - return SCRIPT_CONTINUE; - } - - mi.addRootMenu(menu_info_types.EXAMINE, new string_id("ui_radial", "examine")); - - if (hasObjVar(self, house_pet.NO_SARLACC_SOUND)) - { - mi.addRootMenu(menu_info_types.SERVER_MENU4, SID_MENU_SOUND_ON); - } - else - { - mi.addRootMenu(menu_info_types.SERVER_MENU4, SID_MENU_SOUND_OFF); - } - - if (isGod(player)) - { - if (!hasObjVar(self, house_pet.SARLACC_REWARD_AVAILABLE)) - { - mi.addRootMenu(menu_info_types.SERVER_MENU3, SID_MENU_GOD_FEED); - } - else - { - sendSystemMessage(player, SID_GOD_ALLOW_PLAYER_SIFT); - } - return SCRIPT_CONTINUE; - } - - else if (!isGod(player) && hasObjVar(self, house_pet.SARLACC_REWARD_AVAILABLE)) - { - mi.addRootMenu(menu_info_types.SERVER_MENU2, SID_MENU_REWARD); - return SCRIPT_CONTINUE; - } - - else if (getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE) >= house_pet.SARLACC_HUNGRY) - { - mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_MENU_FEED); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public boolean setUpFirstTime(obj_id self) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - - setObjVar(self, house_pet.SARLACC_CURRENT_PHASE, house_pet.SARLACC_STARVING); - setObjVar(self, house_pet.SARLACC_BORN, getCalendarTime()); - setObjVar(self, house_pet.SARLACC_PHASE_START, getCalendarTime()); - setObjVar(self, house_pet.SARLACC_FEEDING_ITERATION, 0); - - if (!utils.isNestedWithinAPlayer(self) && !hasObjVar(self, house_pet.CHILD_OBJ_ID)) - { - messageTo(self, "createSarlaccPet", null, 0, false); - } - - customerSvcLogVerbose(self, "Dianoga: "+self+" has been set up for the very first time."); - return true; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - blog("Sarlacc - OnObjectMenuSelect - init"); - if (utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (player != getOwner(self) && !isGod(player)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, house_pet.SARLACC_LAST_FED)) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" has been feed previously and used via radial option. Attempting to update Dianoga data."); - if (!updateSarlaccPet(self)) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" could not be updated properly or the update attempt was too soon."); - } - } - - if (item == menu_info_types.SERVER_MENU1) - { - if (getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE) < house_pet.SARLACC_HUNGRY) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is hungry and the owner: "+player+" has selected the feed option via radial."); - - utils.removeScriptVar(self, house_pet.SARLACC_AVOID_REPEATED_UPDATES); - if (!updateSarlaccPet(self)) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" could not be updated properly or the update attempt was too soon."); - } - - getEdibleContents(player, self); - sendDirtyObjectMenuNotification(self); - - return SCRIPT_CONTINUE; - } - else if (item == menu_info_types.SERVER_MENU2) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" has a reward for the owner: "+player+" and the owner has selected the reward option via radial."); - - utils.removeScriptVar(self, house_pet.SARLACC_AVOID_REPEATED_UPDATES); - if (!updateSarlaccPet(self)) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" could not be updated properly or the update attempt was too soon."); - } - - getPlayerReward(player, self); - sendDirtyObjectMenuNotification(self); - return SCRIPT_CONTINUE; - } - else if (item == menu_info_types.SERVER_MENU3) - { - if (!isGod(player)) - { - return SCRIPT_CONTINUE; - } - - sendSystemMessage(player, SID_GOD_FEED_MESSAGE); - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is being fed by CS or God Player: "+player+"."); - - utils.removeScriptVar(self, house_pet.SARLACC_AVOID_REPEATED_UPDATES); - - if (!getEdibleContents(player, self)) - { - sendSystemMessage(player, SID_GOD_FEED_NO_FOOD); - } - sendDirtyObjectMenuNotification(self); - return SCRIPT_CONTINUE; - } - else if (item == menu_info_types.SERVER_MENU4) - { - if (hasObjVar(self, house_pet.NO_SARLACC_SOUND)) - { - removeObjVar(self, house_pet.NO_SARLACC_SOUND); - sendSystemMessage(player, SID_SOUND_ON); - } - else - { - setObjVar(self, house_pet.NO_SARLACC_SOUND, true); - sendSystemMessage(player, SID_SOUND_OFF); - } - } - sendDirtyObjectMenuNotification(self); - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (hasObjVar(self, house_pet.SARLACC_CURRENT_PHASE)) - { - int currentStatus = getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE); - if (currentStatus < house_pet.SARLACC_FED || currentStatus > house_pet.SARLACC_DEATH) - { - blog("getSarlaccCollectionColumn currentStatus : "+currentStatus); - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "status"; - attribs[idx] = "@obj_attr_n:" + house_pet.SARLACC_PHASES[currentStatus]; - idx++; - - if (hasObjVar(self, house_pet.SARLACC_LAST_FED)) - { - int lastFed = getIntObjVar(self, house_pet.SARLACC_LAST_FED); - if (lastFed < 0) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "last_fed"; - attribs[idx] = getCalendarTimeStringLocal(lastFed); - idx++; - - int succesFeeds = getIntObjVar(self, house_pet.SARLACC_FEEDING_ITERATION); - if (succesFeeds > 0) - { - names[idx] = "times_fed"; - attribs[idx] = ""+succesFeeds; - idx++; - } - - names[idx] = "next_feed"; - if (currentStatus == 0) - { - attribs[idx] = getCalendarTimeStringLocal(lastFed + house_pet.getUpdateWeekly(self)); - } - else if (currentStatus == 1) - { - attribs[idx] = "Now"; - } - else - { - attribs[idx] = "Hopefully Soon"; - } - - idx++; - - names[idx] = "time_now"; - attribs[idx] = getCalendarTimeStringLocal(getCalendarTime()); - idx++; - } - else - { - - names[idx] = "last_fed"; - attribs[idx] = "Never"; - idx++; - - names[idx] = "next_feed"; - attribs[idx] = "Hopefully Soon"; - idx++; - } - } - - if (hasObjVar(self, house_pet.SARLACC_BORN)) - { - int birthDay = getIntObjVar(self, house_pet.SARLACC_BORN); - if (birthDay <= 0) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "born"; - attribs[idx] = getCalendarTimeStringLocal(birthDay); - idx++; - } - - if (isValidId(getOwner(self))) - { - obj_id owner = getOwner(self); - - names[idx] = "owner"; - attribs[idx] = getPlayerFullName(owner); - idx++; - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(breacher) || !isPlayer(breacher)) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(breacher, "breathe")) - { - if (utils.getObjIdScriptVar(breacher, "breathe") == self) - { - return SCRIPT_CONTINUE; - } - - } - if (breacher == getOwner(self)) - { - dictionary params = new dictionary(); - params.put("player", breacher); - - if (!hasObjVar(self, house_pet.NO_SARLACC_SOUND)) - { - messageTo(self, "playCute", params, 1, false); - } - - messageTo(self, "growlAnimation", params, 0, false); - } - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(breacher) || !isPlayer(breacher)) - { - return SCRIPT_CONTINUE; - } - stopClientEffectObjByLabel(breacher, self, house_pet.PET_SOUND_LABEL); - - return SCRIPT_CONTINUE; - } - - - public int handleSarlaccEatSui(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - blog("handleSarlaccEatSui - Init"); - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.hasPid(player, "confirm_sui")) - { - int pid = sui.getPid(player, "confirm_sui"); - forceCloseSUIPage(pid); - } - - int idx = sui.getListboxSelectedRow(params); - int bp = sui.getIntButtonPressed(params); - if (idx < 0) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is hungry and the owner: "+player+" selected an invalid option in the list of edibles."); - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - if (bp == sui.BP_CANCEL) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is hungry and the owner: "+player+" selected cancel."); - - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - else - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is hungry and the owner: "+player+" selected a valid edible item."); - - obj_id[] junkFood = utils.getObjIdBatchScriptVar(player, house_pet.EDIBLES_IDS); - - if ((junkFood == null) || (junkFood.length == 0)) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is hungry and the owner: "+player+" selected something but the list of items came back corrupt or invalid."); - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - if (idx > junkFood.length - 1) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is hungry and the owner: "+player+" selected an invalid option in the list of edibles."); - cleanupSui(player); - return SCRIPT_CONTINUE; - } - blog("verifySarlaccEatSui: Setting junk item script var: "+junkFood[idx]); - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is hungry and the owner: "+player+" has selected item: "+junkFood[idx]+" name: "+getName(junkFood[idx])+" from the UI list."); - - utils.setScriptVar(player, "junkfood.junk_item", junkFood[idx]); - blog("verifySarlaccEatSui: ScriptVar: "+utils.getObjIdScriptVar(player, "junkfood.junk_item")); - int pid = sui.msgbox(self, player, utils.packStringId(SID_VERIFICATION_MSG), sui.YES_NO, "verifySarlaccEatSui"); - sui.setPid(player, pid, "confirm_sui"); - } - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - - public int verifySarlaccEatSui(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - blog("verifySarlaccEatSui: Init."); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is hungry and the owner: "+player+" has cancelled the feeding via the verificaiton UI."); - blog("verifySarlaccEatSui: Selected Cancel or No."); - return SCRIPT_CONTINUE; - } - - blog("verifySarlaccEatSui: Getting junk item from script var."); - if (!utils.hasScriptVar(player, "junkfood.junk_item")) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is hungry and the owner: "+player+" somehow lost their item variable needed to feeding the sarlacc."); - blog("verifySarlaccEatSui: No Junk item Found"); - cleanupSui(player); - return SCRIPT_CONTINUE; - } - obj_id junkFood = utils.getObjIdScriptVar(player, "junkfood.junk_item"); - blog("verifySarlaccEatSui: Junk item: "+junkFood); - - if (!isValidId(junkFood) || !exists(junkFood)) - { - CustomerServiceLog("sarlacc_minigame: ","Dianoga: "+self+" is hungry and the owner: "+player+" somehow deleted the item he was about to feed to the sarlacc."); - - blog("verifySarlaccEatSui: Junk item Invalid..bailing out"); - - sendSystemMessage(player, SID_ITEM_NOT_VALID); - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - blog("verifySarlaccEatSui: Junk Confirmed, eating."); - - if (!eatJunkItem(self, player, junkFood)) - { - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(player) + " OID: "+ player + ") FAILED TO FEED Dianoga: " +self+" item ("+ getName(junkFood) + " OID: "+ junkFood + ")."); - } - - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - - public int growlAnimation(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - doAnimationAction(self, ANIMATON_GROWL); - return SCRIPT_CONTINUE; - } - - - public int playCute(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId("player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, house_pet.NO_SARLACC_SOUND)) - { - return SCRIPT_CONTINUE; - } - - play2dNonLoopingSound(player, SOUND_CUTE); - - return SCRIPT_CONTINUE; - } - - - public int checkTriggerVolume(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!hasTriggerVolume(self, house_pet.PET_TRIG_VOLUME)) - { - float range = 2f; - createTriggerVolume(house_pet.PET_TRIG_VOLUME, range, true); - setObjVar(self, house_pet.MUSIC_RANGE, range); - } - - return SCRIPT_CONTINUE; - } - - - public int removeRepeatAvoidanceScriptVar(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("sarlacc_minigame: ","Sarlacc - removeRepeatAvoidanceScriptVar removing lockout scriptvar"); - - utils.removeScriptVar(self, house_pet.SARLACC_AVOID_REPEATED_UPDATES); - - return SCRIPT_CONTINUE; - } - - - public boolean updateSarlaccPet(obj_id sarlacc) throws InterruptedException - { - if (!isValidId(sarlacc) || !exists(sarlacc)) - { - return false; - } - - blog("updateSarlaccPet - RECEIVED Update request - Current phase: "+getIntObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE)+" time: "+ getCalendarTime()); - if (utils.hasScriptVar(sarlacc, house_pet.SARLACC_AVOID_REPEATED_UPDATES)) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" avoiding repeated calls to this function. Bailing early."); - return false; - } - else - { - utils.setScriptVar(sarlacc, house_pet.SARLACC_AVOID_REPEATED_UPDATES, true); - messageTo(sarlacc, "removeRepeatAvoidanceScriptVar", null, 60, false); - } - - customerSvcLogVerbose(sarlacc, "updateSarlaccPet - RECEIVED MESSAGE TO UPDATE Dianoga: "+sarlacc+" at: time: "+ getCalendarTime()); - - if (!hasObjVar(sarlacc, house_pet.SARLACC_LAST_FED)) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has never been fed. Exiting updateSarlaccPet."); - blog("updateSarlaccPet - no last feed time"); - return false; - } - else - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has been either been fed previously or has a valid empty variable. Continuing debug procedures."); - } - - if (!hasObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE)) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has NO CURRENT PHASE VAR. Exiting updateSarlaccPet."); - blog("updateSarlaccPet - no phase for sarlacc"); - return false; - } - else - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has a current phase, continuing debug procedures."); - } - - if (!hasObjVar(sarlacc, house_pet.SARLACC_FEEDING_ITERATION)) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has NO FEEDING ITERATION VAR. Exiting updateSarlaccPet."); - blog("updateSarlaccPet - no feeding iteration for sarlacc"); - return false; - } - else - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has a feeding iteration, continuing debug procedures."); - } - - int currentPhase = getIntObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE); - - if (currentPhase == house_pet.SARLACC_DEATH) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" we haven't even started updating yet and the Dianoga is currently DEAD."); - } - else if (currentPhase == house_pet.SARLACC_STARVING) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" we haven't even started updating yet and the Dianoga is currently STARVING."); - } - else if (currentPhase == house_pet.SARLACC_HUNGRY) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" we haven't even started updating yet and the Dianoga is currently HUNGRY."); - } - else if (currentPhase == house_pet.SARLACC_FED) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" we haven't even started updating yet and the Dianoga is currently FED."); - } - - if (getIntObjVar(sarlacc, house_pet.SARLACC_FEEDING_ITERATION) >= house_pet.SARLACC_PHASE_WEEKS) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" is currently dead."); - String collectionCol = getSarlaccCollectionColumn(sarlacc); - if (collectionCol == null || collectionCol.equals("")) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" reward is about to be issued but a correct column was not returned. Setting reward to pick from generic_collectible"); - blog("updateSarlaccPet - getSarlaccCollectionColumn FAILED!"); - collectionCol = "generic_collectible"; - } - else - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" reward is about to be issued. The random column returned was:"+collectionCol); - } - - blog("updateSarlaccPet - getSarlaccCollectionColumn: "+collectionCol); - customerSvcLogVerbose(sarlacc, "updateSarlaccPet - Collection column received. We are going to reset the Feeding iteration, Feeding list and set the Dianoga to reward the player. Before we do this, lets get verbose data. "); - - setObjVar(sarlacc, house_pet.SARLACC_FEEDING_ITERATION, 0); - - removeObjVar(sarlacc, house_pet.SARLACC_FEED_ARRAY); - - setObjVar(sarlacc, house_pet.SARLACC_REWARD_AVAILABLE, true); - - setObjVar(sarlacc, house_pet.SARLACC_REWARD_COLUMN, collectionCol); - - updateSarlaccPet(sarlacc); - return true; - } - - int currentGameTime = getCalendarTime(); - int updateWeek = house_pet.getUpdateWeekly(sarlacc); - int updateDay = house_pet.getUpdateDaily(sarlacc); - int currentIteration = getIntObjVar(sarlacc, house_pet.SARLACC_FEEDING_ITERATION); - int lastFed = getIntObjVar(sarlacc, house_pet.SARLACC_LAST_FED); - - if (currentPhase >= house_pet.SARLACC_DEATH) - { - - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" is currently dead."); - setObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE, house_pet.SARLACC_DEATH); - return false; - } - - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" is not dead. We are continuing the updated."); - - if (currentPhase < house_pet.SARLACC_FED) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" current phase was -1."); - blog("updateSarlaccPet - currentPhase WAS -1"); - currentPhase = house_pet.SARLACC_FED; - } - - if (hasObjVar(sarlacc, house_pet.SARLACC_VERSION_VAR)) - { - int verVar = getIntObjVar(sarlacc, house_pet.SARLACC_VERSION_VAR); - if (verVar != house_pet.SARLACC_VERSION) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has no version number so the Dianoga is being stamped for the first time. The Dianoga also gets the free chance variable (or it resets this variable)."); - setObjVar(sarlacc, house_pet.SARLACC_VERSION_VAR, house_pet.SARLACC_VERSION); - setObjVar(sarlacc, house_pet.SARLACC_FREE_CHANCE, false); - } - } - else - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has no version number so the Dianoga is being stamped for the first time. "); - setObjVar(sarlacc, house_pet.SARLACC_VERSION_VAR, house_pet.SARLACC_VERSION); - } - - if (currentGameTime < (lastFed + updateWeek)) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has received an update before the request too soon. Bailing out."); - blog("updateSarlaccPet - Last Fed Timer: "+(lastFed + updateWeek)+" currentGameTime: "+currentGameTime); - return false; - } - - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - It has been at least a week since the Dianoga: "+sarlacc+" has had food."); - - if (currentGameTime < (lastFed + (updateWeek * 2))) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" is supposed to be hungry but has time before being Very Hungry. We are going to check the current phase."); - - if (currentPhase != house_pet.SARLACC_HUNGRY) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" had a bugged current phase of: "+currentPhase+" so we will correct that now."); - setObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE, house_pet.SARLACC_HUNGRY); - } - else - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" had a bugged current phase is Hungry which is correct."); - } - - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" is currently hungry but still has time before moving to very hungry. Bailing out."); - return false; - } - - if ((currentGameTime >= (lastFed + updateWeek) && currentGameTime < (lastFed + (updateWeek * 2)))) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" was phase "+currentPhase+" and is now being set to HUNGRY."); - setObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE, house_pet.SARLACC_HUNGRY); - return true; - } - - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has been neglected by owner. Checking for penalties."); - - if (currentGameTime >= (lastFed + (updateWeek * 2)) && (!hasObjVar(sarlacc, house_pet.SARLACC_FREE_CHANCE) || !getBooleanObjVar(sarlacc, house_pet.SARLACC_FREE_CHANCE))) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - It has been at least 2 weeks since the Dianoga: "+sarlacc+" has had food but the player hasn't used up their free chance yet. We'll take care of this when the player feed this sarlacc."); - - setObjVar(sarlacc, house_pet.SARLACC_PENALTY_VAR, true); - setObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE, house_pet.SARLACC_HUNGRY); - - return false; - } - - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" has been neglected by owner and the free chance has been used."); - - if (currentGameTime >= (lastFed + (updateWeek * 3))) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - It has been at least 2 weeks since the Dianoga: "+sarlacc+" has had food, but less than 3 weeks."); - currentPhase += 3; - } - - else if (currentGameTime >= (lastFed + (updateWeek * 2))) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - It has been at least 2 weeks since the Dianoga: "+sarlacc+" has had food, but less than 3 weeks."); - currentPhase += 2; - } - - if (currentPhase >= house_pet.SARLACC_DEATH) - { - - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" was neglected and is currently dead (Starving)."); - currentPhase = house_pet.SARLACC_DEATH; - } - - if (currentPhase >= house_pet.SARLACC_STARVING) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" is about to be set to have data removed because phase is: "+currentPhase); - - if (!setSarlaccStarvingOrDead(sarlacc, currentPhase)) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" could not remove data. This is a big error that needs to be reported to SWG Development. Phase is: "+currentPhase); - return false; - } - } - return true; - } - - - public boolean getEdibleContents(obj_id player, obj_id sarlacc) throws InterruptedException - { - blog("getEdibleContents - Init"); - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(sarlacc) || !exists(sarlacc)) - { - return false; - } - - if (sui.hasPid(player, house_pet.EDIBLES_SUI)) - { - int pid = sui.getPid(player, house_pet.EDIBLES_SUI); - forceCloseSUIPage(pid); - } - if (sui.hasPid(player, "confirm_sui")) - { - int pid = sui.getPid(player, "confirm_sui"); - forceCloseSUIPage(pid); - } - - if (!isGod(player)) - { - - if (getIntObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE) < house_pet.SARLACC_HUNGRY) - { - return false; - } - } - else - { - if (getIntObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE) < house_pet.SARLACC_HUNGRY) - { - CustomerServiceLog("sarlacc_minigame: ","updateSarlaccPet - Dianoga: "+sarlacc+" was fed, even though the Dianoga was not hungry because the CS Representative: "+player+" did so intentionally while in godmode"); - sendSystemMessage(player, SID_FEEDING_DUE_TO_GODMODE); - } - } - - if (getBooleanObjVar(sarlacc, house_pet.SARLACC_REWARD_AVAILABLE)) - { - sendSystemMessage(player, SID_SIFT_SARLACC_BOX); - return false; - } - blog("getEdibleContents - About to create array of junk"); - - if (!checkPlayerInventoryForSarlaccFood(player)) - { - sendSystemMessage(player, SID_SARLACC_NOTHING_FOUND); - return false; - } - - blog("getEdibleContents - Player has junk"); - - obj_id[] edibleItems = smuggler.getAllJunkItems(player); - if (edibleItems == null && edibleItems.length <= 0) - { - return false; - } - - String[] edibleMenu = new String[edibleItems.length]; - - for (int i = 0; i < edibleItems.length; i++) - { - testAbortScript(); - - String name = getAssignedName(edibleItems[i]); - if (name.equals("") || name == null) - { - name = getString(getNameStringId(edibleItems[i])); - } - edibleMenu[i] = name; - } - - if (edibleMenu == null && edibleMenu.length <= 0) - { - return false; - } - - int pid = sui.listbox(sarlacc, player, FEED_PROMPT, sui.YES_NO, FEED_TITLE, edibleMenu, "handleSarlaccEatSui", false, false); - - if (pid > -1) - { - - setSUIProperty(pid, sui.LISTBOX_BTN_OK, sui.PROP_TEXT, BTN_SELL); - - showSUIPage(pid); - - utils.setBatchScriptVar(player, house_pet.EDIBLES_IDS, edibleItems); - sui.setPid(player, pid, house_pet.EDIBLES_SUI); - } - return true; - } - - - public boolean eatJunkItem(obj_id self, obj_id player, obj_id item) throws InterruptedException - { - blog("eatJunkItem - Init"); - - if (!isIdValid(self) || !exists(self)) - { - return false; - } - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - CustomerServiceLog("sarlacc_minigame: ", "eatJunkItem - Player ( OID: "+ player + ") has fed Dianoga item ("+ item + "). Processing"); - - if (!isIdValid(item) || !exists(item)) - { - - sendSystemMessage(player, SID_ITEM_NOT_VALID); - return false; - } - - obj_id bioLink = getBioLink(item); - if (isIdValid(bioLink) && utils.stringToLong(bioLink.toString()) != 1) - { - - sendSystemMessage(player, SID_ITEM_NOT_BIOLINK_FED); - return false; - } - - if (utils.outOfRange(self, player, 10.0f, true)) - { - - sendSystemMessage(player, SID_OUT_OF_RANGE); - return false; - } - - if (!validateItemForSarlacc(player, item)) - { - return false; - } - - String playerName = getName(player); - String itemName = getEncodedName(item); - CustomerServiceLog("sarlacc_minigame: ", "Player ("+ playerName + " OID: "+ player + ") fed Dianoga item ("+ itemName + " OID: "+ item + ")."); - - String templateName = getTemplateName(item); - if (templateName == null || templateName.equals("")) - { - return false; - } - - if (!hasObjVar(self, house_pet.SARLACC_FEED_ARRAY)) - { - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" has NO previous feeding list. Creating a new one."); - - blog("Received Item - Created new feed list"); - String[] feedingList = new String[1]; - feedingList[0] = templateName; - setObjVar(self, house_pet.SARLACC_FEED_ARRAY, feedingList); - } - else - { - - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" has A previous feeding list. Getting data."); - - String[] feedingList = getStringArrayObjVar(self, house_pet.SARLACC_FEED_ARRAY); - if (feedingList == null || feedingList.length <= 0) - { - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" previous feeding list was bugged or null. Creating a new list."); - - blog("Received Item - ERROR -NO PREVIOUS feedingList found, making new."); - String[] newList = new String[1]; - newList[0] = templateName; - setObjVar(self, house_pet.SARLACC_FEED_ARRAY, newList); - } - else if (feedingList.length > 0 && feedingList.length < 4) - { - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" previous feeding list was "+feedingList.length+" in length. Adding another item to this list."); - - blog("Received Item - ARRAY COPY!!!!!!!!!!!!!!!!!!!!!!!!"); - blog("Received Item - feedingList.length "+feedingList.length); - String[] newList = new String[feedingList.length+1]; - System.arraycopy(feedingList, 0, newList, 0, feedingList.length); - newList[newList.length-1] = templateName; - blog("Received Item - newList.length "+newList.length); - setObjVar(self, house_pet.SARLACC_FEED_ARRAY, newList); - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" new feeding list NOW has "+newList.length+" items."); - } - } - - int currentIteration = getIntObjVar(self, house_pet.SARLACC_FEEDING_ITERATION); - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" Current Feeding Iteration: "+currentIteration); - - currentIteration++; - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" Current Feeding Iteration is now: "+currentIteration); - - setObjVar(self, house_pet.SARLACC_FEEDING_ITERATION, currentIteration); - - blog("Received Item - setting phase fed and setting time fed"); - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" Current Phase right after being fed is: "+getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE)); - - setObjVar(self, house_pet.SARLACC_CURRENT_PHASE, house_pet.SARLACC_FED); - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" Current Phase now is: "+getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE)); - - if (!hasObjVar(self, house_pet.NO_SARLACC_SOUND)) - { - play2dNonLoopingSound(player, SOUND_CUTE); - } - - doAnimationAction(self, ANIMATON_FEED); - - decrementCount(item); - sendSystemMessage(player, SID_SARLACC_FED); - - blog("Received Item - end, current phase: "+getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE)); - - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" Last Fed WAS: "+getIntObjVar(self, house_pet.SARLACC_LAST_FED)); - - setObjVar(self, house_pet.SARLACC_LAST_FED, getCalendarTime()); - CustomerServiceLog("sarlacc_minigame: ", "Dianoga: "+self+" Last Fed NOW: "+getIntObjVar(self, house_pet.SARLACC_LAST_FED)); - - if (hasObjVar(self, house_pet.SARLACC_PENALTY_VAR)) - { - setObjVar(self, house_pet.SARLACC_FREE_CHANCE, true); - removeObjVar(self, house_pet.SARLACC_PENALTY_VAR); - } - - dictionary params = new dictionary(); - params.put("player", player); - - messageTo(self, "growlAnimation", params, 2, false); - - return true; - } - - - public boolean validateItemForSarlacc(obj_id player, obj_id item) throws InterruptedException - { - if (utils.getContainingPlayer(item) != (player)) - { - CustomerServiceLog("sarlacc_minigame: ", "Player: "+player+" is attempting to give a Dianoga item: "+item+" but that item is not in their inventory"); - - sendSystemMessage(player, SID_ITEM_NOT_INVENTORY); - return false; - } - - if (smuggler.hasItemsInContainer(item)) - { - CustomerServiceLog("sarlacc_minigame: ", "Player: "+player+" is attempting to give a Dianoga item: "+item+" but that item is not in their ROOT inventory. It may be nested in another container."); - - sendSystemMessage(player, SID_ITEM_NOT_INVENTORY); - return false; - } - - if (utils.isEquipped(item)) - { - - return false; - } - - if (hasObjVar(item, "quest_item")) - { - CustomerServiceLog("sarlacc_minigame: ", "Player: "+player+" is attempting to give a Dianoga item: "+item+" but that item is a quest item."); - - sendSystemMessage(player, SID_QUEST_ITEM); - return false; - } - - return true; - } - - - public String getSarlaccCollectionColumn(obj_id self) throws InterruptedException - { - blog("getSarlaccCollectionColumn - Init"); - if (!isValidId(self) || !exists(self)) - { - return null; - } - - blog("getSarlaccCollectionColumn - initial validation ok"); - - if (!hasObjVar(self, house_pet.SARLACC_FEED_ARRAY)) - { - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" could not select a reward collection column because there war no list of items fed on the sarlacc."); - return null; - } - - blog("getSarlaccCollectionColumn - array of feed exists"); - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" is selecting a reward collection column based on the list of items fed."); - - String[] foodList = getStringArrayObjVar(self, house_pet.SARLACC_FEED_ARRAY); - if (foodList == null || foodList.length < house_pet.SARLACC_PHASE_WEEKS) - { - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" found a corrupt list of items fed and could not continue."); - blog("getSarlaccCollectionColumn - foodList.length: "+foodList.length); - return null; - } - blog("getSarlaccCollectionColumn - foodList[0]: "+foodList[0]); - blog("getSarlaccCollectionColumn - foodList[1]: "+foodList[1]); - blog("getSarlaccCollectionColumn - foodList[2]: "+foodList[2]); - blog("getSarlaccCollectionColumn - foodList[3]: "+foodList[3]); - - String listData = getListOfFoodItems(self); - if (listData != null && listData.length() > 0) - { - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" has eaten the following: "+listData); - } - - HashSet allEdibles = new HashSet(); - - for (int i = 0; i < foodList.length-1; i++) - { - testAbortScript(); - if (foodList[i] == null || foodList.equals("")) - { - continue; - } - - allEdibles.add(foodList[i]); - } - - if (allEdibles.isEmpty()) - { - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" could not put all fed items into a hashset and failed out of the Collection Column function!"); - blog("getSarlaccCollectionColumn - severe issue with feed array"); - return null; - } - - blog("getSarlaccCollectionColumn - allEdibles.size(): "+allEdibles.size()); - String[] templateArray = new String[allEdibles.size()]; - allEdibles.toArray(templateArray); - if (templateArray == null || templateArray.length <= 0) - { - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" failed in the Collection Column function when attempting to make a hashset and array!"); - blog("getSarlaccCollectionColumn - severe issue with hashset conversion of feed array"); - return null; - } - blog("getSarlaccCollectionColumn - templateArray.length: "+templateArray.length); - - if (templateArray.length == 1) - { - int lootRow = dataTableSearchColumnForString(templateArray[0], "item", house_pet.SARLACC_CTS_CRC_TABLE); - if (lootRow < 0) - { - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" could not find the table row needed for the item fed and returned the default random column."); - blog("getSarlaccCollectionColumn - lootRow: "+lootRow); - return "generic_collectible"; - } - - String lootColumn = dataTableGetString(house_pet.SARLACC_CTS_CRC_TABLE, lootRow, "collectible_cols"); - blog("getSarlaccCollectionColumn - lootColumn: "+lootColumn); - if (lootColumn == null || lootColumn.equals("")) - { - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" could not find the collectible_cols row needed for the item fed and returned the default random column."); - return "generic_collectible"; - } - else - { - String[] possibleCols = split(lootColumn,','); - if (possibleCols == null || possibleCols.length <= 0) - { - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" had corrupt data and returned default generic_collectible."); - return "generic_collectible"; - } - else if (possibleCols.length == 1) - { - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" had length of 1 and is returning: "+possibleCols[0]); - return possibleCols[0]; - } - else - { - int randNum = rand(0,possibleCols.length-1); - CustomerServiceLog("sarlacc_minigame: ", "getSarlaccCollectionColumn - Dianoga: "+self+" had length of 1 and is returning a random item: "+possibleCols[randNum]); - return possibleCols[randNum]; - } - } - } - else - { - String randTemplate = templateArray[rand(0, templateArray.length-1)]; - int lootRow = dataTableSearchColumnForString(randTemplate, "item", house_pet.SARLACC_CTS_CRC_TABLE); - - String lootColumn = dataTableGetString(house_pet.SARLACC_CTS_CRC_TABLE, lootRow, "collectible_cols"); - blog("getSarlaccCollectionColumn - lootColumn: "+lootColumn); - if (lootColumn == null || lootColumn.equals("")) - { - return "generic_collectible"; - } - else - { - String[] possibleCols = split(lootColumn,','); - if (possibleCols == null || possibleCols.length <= 0) - { - return "generic_collectible"; - } - else if (possibleCols.length == 1) - { - return possibleCols[0]; - } - else - { - return possibleCols[rand(0,possibleCols.length-1)]; - } - } - } - } - - - public boolean getPlayerReward(obj_id owner, obj_id self) throws InterruptedException - { - if (!isValidId(owner) || !exists(owner)) - { - return false; - } - if (!isValidId(self) || !exists(self)) - { - return false; - } - - obj_id playerInventory = utils.getInventoryContainer(owner); - if (!isValidId(playerInventory) || !exists(playerInventory)) - { - return false; - } - - if (!hasObjVar(self,house_pet.SARLACC_REWARD_COLUMN)) - { - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(owner) + " OID: "+ owner + ") could not receive reward for feeding sarlacc. Dianoga reward column objvar was not on the Dianoga item. THIS MIGHT BE DUE TO THE PLAYER ATTEMPTING TO GET MULTIPLE REWARDS via quick radial select exploit."); - - return false; - } - - String rewardCol = getStringObjVar(self, house_pet.SARLACC_REWARD_COLUMN); - if (rewardCol == null || rewardCol.equals("")) - { - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(owner) + " OID: "+ owner + ") could not receive reward for properly feeding sarlacc. Dianoga reward column objvar was found but invalid."); - - return false; - } - - blog("rewardPlayer - getRandomCollectionItem for col: "+rewardCol); - - if (!hasObjVar(self, house_pet.NO_SARLACC_SOUND)) - { - play2dNonLoopingSound(owner, SOUND_SIFT); - } - - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(owner) + " OID: "+ owner + ") is about to receive Dianoga reward. Using collection library for reward. Check the CollectionLootChannel logs for specifics or search for the player OID to get full details."); - - if (!collection.getRandomCollectionItemShowLootBox(owner, playerInventory, house_pet.SARLACC_LOOT_TABLE, rewardCol)) - { - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(owner) + " OID: "+ owner + ") FAILED TO ISSUE PLAYER REWARD. Dianoga: " +self+". This probably failed in the collection library being used to grant the player a reward item."); - - blog("rewardPlayer - severe issue with getRandomCollectionItem for col: "+rewardCol); - } - - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(owner) + " OID: "+ owner + ") has received reward. Check the CollectionLootChannel logs for specifics or search for the player OID to get full details."); - - removeObjVar(self, house_pet.SARLACC_REWARD_AVAILABLE); - removeObjVar(self, house_pet.SARLACC_REWARD_COLUMN); - sendSystemMessage(owner, SID_FOUND_REWARD); - blog("rewardPlayer - REWARD GIVEN"); - - return true; - } - - - public boolean checkPlayerInventoryForSarlaccFood(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - obj_id inventory = utils.getInventoryContainer(player); - if (!isIdValid(inventory) || !exists(inventory)) - { - return false; - } - - obj_id[] contents = utils.getContents(inventory, true); - if (contents == null || contents.length <= 0) - { - return false; - } - - for (int x = 0; x < contents.length; x++) - { - testAbortScript(); - - if (!validateItemForSarlacc(player, contents[x])) - { - continue; - } - - if (hasObjVar(contents[x], "noTrade") || utils.isEquipped(contents[x])) - { - continue; - } - - if (isCrafted(contents[x])) - { - continue; - } - - if (static_item.getStaticObjectValue(getStaticItemName(contents[x])) > 0) - { - return true; - } - - String itemTemplate = getTemplateName(contents[x]); - if (dataTableSearchColumnForString(itemTemplate, "items", smuggler.TBL) > -1) - { - return true; - } - - } - return false; - } - - - public boolean setSarlaccStarvingOrDead(obj_id sarlacc, int currentPhase) throws InterruptedException - { - if (!isValidId(sarlacc) || !exists(sarlacc)) - { - return false; - } - - customerSvcLogVerbose(sarlacc, "updateSarlaccPet - About to Wipe Dianoga data and set feeding iteration to 0. This is the last point in which you will see previous data. Current time: "+ getCalendarTime()); - - setObjVar(sarlacc, house_pet.SARLACC_FEEDING_ITERATION, 0); - removeObjVar(sarlacc, house_pet.SARLACC_FEED_ARRAY); - setObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE, currentPhase); - return true; - } - - - public void cleanupSui(obj_id player) throws InterruptedException - { - blog("cleanupSui removing vars"); - utils.removeScriptVar(player, house_pet.EDIBLES_SUI); - utils.removeBatchScriptVar(player, house_pet.EDIBLES_IDS); - utils.removeScriptVar(player, "junkfood"); - } - - - public boolean customerSvcLogVerbose(obj_id sarlacc, String msg) throws InterruptedException - { - if (!isValidId(sarlacc) || !exists(sarlacc)) - { - return false; - } - - String logData = ""; - if (msg != null && !msg.equals("")) - { - logData += msg; - } - - if (isValidId(getOwner(sarlacc))) - { - logData += " Owner: "+getOwner(sarlacc) + "."; - } - else - { - logData += " No valid Dianoga owner."; - } - - if (hasObjVar(sarlacc, house_pet.SARLACC_BORN)) - { - int birthDay = getIntObjVar(sarlacc, house_pet.SARLACC_BORN); - logData += " Cal Birth Date: "+ getCalendarTimeStringLocal(birthDay) + "."; - logData += " Cal Date Int: "+ birthDay + "."; - } - else - { - logData += " No birth date for this sarlacc."; - } - - if (hasObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE)) - { - int phase = getIntObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE); - logData += " Phase: "+ phase + "."; - } - else - { - logData += " No current phase for this sarlacc."; - } - - if (hasObjVar(sarlacc, house_pet.SARLACC_PHASE_START)) - { - int phaseStart = getIntObjVar(sarlacc, house_pet.SARLACC_PHASE_START); - logData += " Cal Phase Start: "+ getCalendarTimeStringLocal(phaseStart) + "."; - logData += " Phase Start Int: "+ phaseStart + "."; - } - else - { - logData += " No Feeding phase start for this sarlacc."; - } - - if (hasObjVar(sarlacc, house_pet.SARLACC_LAST_FED)) - { - int lastFed = getIntObjVar(sarlacc, house_pet.SARLACC_LAST_FED); - logData += " Cal Last Fed: "+ getCalendarTimeStringLocal(lastFed) + "."; - logData += " Last Fed Int: "+ lastFed + "."; - } - else - { - logData += " Dianoga has never been fed."; - } - - if (hasObjVar(sarlacc, house_pet.SARLACC_FEEDING_ITERATION)) - { - int currentIteration = getIntObjVar(sarlacc, house_pet.SARLACC_FEEDING_ITERATION); - logData += " Feeding Iteration: "+ currentIteration + "."; - } - else - { - logData += " No Feeding iteration for this sarlacc."; - } - - String listData = getListOfFoodItems(sarlacc); - if (listData != null && listData.length() > 0) - { - logData += " "+ listData + " "; - } - else - { - logData += " No Feeding list for this sarlacc."; - } - - if (hasObjVar(sarlacc, house_pet.SARLACC_VERSION_VAR)) - { - int sarlaccVer = getIntObjVar(sarlacc, house_pet.SARLACC_VERSION_VAR); - logData += " Dianoga Version Number: "+sarlaccVer+"."; - } - else - { - logData += " No Dianoga Version Number for this sarlacc."; - } - - if (hasObjVar(sarlacc, house_pet.SARLACC_FREE_CHANCE)) - { - boolean freeChanceUsed = getBooleanObjVar(sarlacc, house_pet.SARLACC_FREE_CHANCE); - logData += " Has Used Free Chance (T/F): "+freeChanceUsed+"."; - } - else - { - logData += " No Dianoga Free Chance Variable for this sarlacc."; - } - - if (hasObjVar(sarlacc, house_pet.SARLACC_PENALTY_VAR)) - { - logData += " Dianoga has PENALTY VARIABLE."; - } - else - { - logData += " No Dianoga Penalty Variable."; - } - if (logData == null || logData.equals("")) - { - return false; - } - - CustomerServiceLog("sarlacc_minigame: ",logData); - - return true; - } - - - public String getListOfFoodItems(obj_id sarlacc) throws InterruptedException - { - if (!isValidId(sarlacc)) - { - return null; - } - if (!hasObjVar(sarlacc, house_pet.SARLACC_FEED_ARRAY)) - { - return null; - } - - String logData = ""; - String[] feedingList = getStringArrayObjVar(sarlacc, house_pet.SARLACC_FEED_ARRAY); - if (feedingList != null && feedingList.length > 0) - { - for (int i = 0; i < feedingList.length; i++) - { - testAbortScript(); - logData += " Fed Item "+(i+1)+": "+ feedingList[i] + ". "; - } - } - return logData; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/crash_site_requisition.java b/sku.0/sys.server/compiled/game/script/event/emp_day/crash_site_requisition.java deleted file mode 100644 index 025ca66f9..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/crash_site_requisition.java +++ /dev/null @@ -1,232 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.static_item; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class crash_site_requisition extends script.base_script -{ - public crash_site_requisition() - { - } - public static final String EMPIREDAY = "event/empire_day"; - public static final String LIFEDAY = "event/life_day"; - - public static final string_id SID_WRONG_FACTION = new string_id(EMPIREDAY, "wrong_faction"); - public static final string_id SID_MNU_DRESS = new string_id(EMPIREDAY, "hang_recruitment_sign"); - public static final string_id SID_ZIP_DRESSING = new string_id(EMPIREDAY, "post_zip_bar_text"); - public static final string_id SID_PICK_PATH = new string_id(EMPIREDAY, "pick_path"); - public static final string_id SID_MOUNTED = new string_id(LIFEDAY, "mounted"); - - public static final int COUNTDOWN_TIMER = 3; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!getTemplateName(self).equals(holiday.IMPERIAL_EMPTY_KIOSK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isRebel(player) || !factions.isImperial(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT)) - { - - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT) && !buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF)) - { - - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - - menu_info_data data = mi.getMenuItemByType (menu_info_types.ITEM_USE); - mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_DRESS); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!getTemplateName(self).equals(holiday.IMPERIAL_EMPTY_KIOSK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isRebel(player) || !factions.isImperial(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT)) - { - - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT) && !buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF)) - { - - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - int startTime = 0; - int range = 3; - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - - stealth.testInvisNonCombatAction(player, self); - int countdownSui = sui.smartCountdownTimerSUI(self, player, "quest_countdown_timer", SID_ZIP_DRESSING, startTime, COUNTDOWN_TIMER, "handleObjectSwapTimer", range, flags); - doAnimationAction(player, "manipulate_high"); - return SCRIPT_CONTINUE; - } - - - public int handleObjectSwapTimer(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - obj_id player = params.getObjId("player"); - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - return SCRIPT_CONTINUE; - } - - else if (bp == sui.BP_REVERT) - { - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_locomotion")); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_incapacitated")); - } - else if (event == sui.CD_EVENT_DAMAGED) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_damaged")); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR)) - { - return SCRIPT_CONTINUE; - } - - int test_pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - if (!holiday.replaceEventObject(self, player, holiday.IMPERIAL_PLAYER_RECRUITMENT_KIOSK)) - { - - return SCRIPT_CONTINUE; - } - else - { - - String parentBuffName = ""; - - if (buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT)) - { - parentBuffName = holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT; - } - else if (buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF)) - { - parentBuffName = holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF; - } - - if (parentBuffName == null || parentBuffName.equals("")) - { - - return SCRIPT_CONTINUE; - } - if (!holiday.rewardEmpireDayPlayer(player, holiday.IMPERIAL_PLAYER, parentBuffName, holiday.BUFF_IMPERIAL_RECRUITMENT_COUNTER, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - - } - return SCRIPT_CONTINUE; - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/empire_day_interior_spawn_npc.java b/sku.0/sys.server/compiled/game/script/event/emp_day/empire_day_interior_spawn_npc.java deleted file mode 100644 index 241087e01..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/empire_day_interior_spawn_npc.java +++ /dev/null @@ -1,73 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.performance; - - -public class empire_day_interior_spawn_npc extends script.base_script -{ - public empire_day_interior_spawn_npc() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "removeConversationScripts", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "removeConversationScripts", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int removeConversationScripts(obj_id self, dictionary params) throws InterruptedException - { - if (hasScript(self, "conversation.faction_recruiter_rebel")) - { - detachScript(self, "conversation.faction_recruiter_rebel"); - } - if (hasScript(self, "conversation.faction_recruiter_imperial")) - { - detachScript(self, "conversation.faction_recruiter_imperial"); - } - if (hasScript(self, "npc.faction_recruiter.faction_recruiter")) - { - detachScript(self, "npc.faction_recruiter.faction_recruiter"); - } - if (hasScript(self, "npc.faction_recruiter.recruiter_setup")) - { - detachScript(self, "npc.faction_recruiter.recruiter_setup"); - } - if (hasScript(self, "systems.gcw.gcw_data_updater")) - { - detachScript(self, "systems.gcw.gcw_data_updater"); - } - if (hasScript(self, "ai.soldier")) - { - detachScript(self, "ai.soldier"); - } - if (!hasScript(self, "ai.ai")) - { - attachScript(self, "ai.ai"); - } - - clearCondition (self, CONDITION_CONVERSABLE); - if (hasObjVar(self, performance.NPC_ENTERTAINMENT_NO_ENTERTAIN)) - { - removeObjVar(self,performance.NPC_ENTERTAINMENT_NO_ENTERTAIN); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/empired_day_interior_spawn_npc.java b/sku.0/sys.server/compiled/game/script/event/emp_day/empired_day_interior_spawn_npc.java deleted file mode 100644 index 0a193e3c5..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/empired_day_interior_spawn_npc.java +++ /dev/null @@ -1,40 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -public class empired_day_interior_spawn_npc extends script.base_script -{ - public empired_day_interior_spawn_npc() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "removeConversationScripts", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "removeConversationScripts", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int removeConversationScripts(obj_id self, dictionary params) throws InterruptedException - { - if (hasScript(self, "npc.faction_recruiter.recruiter_setup")) - { - detachScript(self, "npc.faction_recruiter.recruiter_setup"); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/factional_guard_self_destruct.java b/sku.0/sys.server/compiled/game/script/event/emp_day/factional_guard_self_destruct.java deleted file mode 100644 index 6ff8c1183..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/factional_guard_self_destruct.java +++ /dev/null @@ -1,37 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -public class factional_guard_self_destruct extends script.base_script -{ - public factional_guard_self_destruct() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "selfDestruct", null, 300, false); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "selfDestruct", null, 300, false); - return SCRIPT_CONTINUE; - } - - - public int selfDestruct(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/give_multiple_items_to_supply_npc.java b/sku.0/sys.server/compiled/game/script/event/emp_day/give_multiple_items_to_supply_npc.java deleted file mode 100644 index 9669fc77b..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/give_multiple_items_to_supply_npc.java +++ /dev/null @@ -1,366 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.static_item; -import script.library.utils; - - -public class give_multiple_items_to_supply_npc extends script.base_script -{ - public give_multiple_items_to_supply_npc() - { - } - public static final boolean LOGGING_ON = true; - public static final String LOGGING_CATEGORY = "holidayTrader"; - - public static final string_id noGiveDuringCombat = new string_id("quest/ground/system_message", "no_give_during_combat"); - - - public int OnGiveItem(obj_id self, obj_id item, obj_id giver) throws InterruptedException - { - if (ai_lib.isInCombat(giver)) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: isInCombat"); - sendQuestSystemMessage(giver, noGiveDuringCombat); - return SCRIPT_CONTINUE; - } - - int faction = getIntObjVar(self, "holidayFaction"); - if (faction < holiday.IMPERIAL_PLAYER || faction > holiday.REBEL_PLAYER) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: not a faction"); - - doAnimationAction(self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - if (isOpposingFaction(giver, faction)) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: opposing faction"); - - doAnimationAction(self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - if (!utils.isProfession(giver, utils.TRADER)) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: not trader"); - - doAnimationAction(self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - String itemName = getTemplateName(item); - if (itemName == null || itemName.equals("")) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: template corrupt"); - - doAnimationAction(self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - if (!hasEmpireDayQuest(giver, faction)) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: no quest"); - - doAnimationAction(self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - if (!isCrateItem(giver, itemName, faction)) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: not crate item"); - - doAnimationAction(self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - String crateRequired = getEmpireDayCrateForQuestName(giver, faction); - if (crateRequired == null || crateRequired.length() <= 0) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: not quest for crate item"); - - doAnimationAction(self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - if (!crateRequired.equals(itemName)) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: not the crate I want for quest"); - - doAnimationAction(self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - String questName = getEmpireDayQuestName(giver, faction); - if (questName == null || questName.length() <= 0) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: quest name wrong"); - - doAnimationAction(self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - int questCrc = groundquests.getQuestIdFromString(questName); - - int taskId = groundquests.getTaskId (questCrc, questName); - questCompleteTask(questCrc, taskId, giver); - if (!incrementCollection(self, giver, faction)) - { - blog("give_multiple_items_to_supply_npc.OnGiveItem: collection incr failed."); - - } - return SCRIPT_OVERRIDE; - } - - - public boolean isOpposingFaction(obj_id player, int npcFaction) throws InterruptedException - { - if (npcFaction == holiday.IMPERIAL_PLAYER && factions.isRebel(player)) - { - return true; - } - if (npcFaction == holiday.REBEL_PLAYER && factions.isImperial(player)) - { - return true; - } - - return false; - } - - - public boolean isCrateItem(obj_id player, String itemName, int faction) throws InterruptedException - { - blog("give_multiple_items_to_supply_npc.isCrateItem: init."); - - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (itemName == null || itemName.length() <= 0) - { - return false; - } - - blog("give_multiple_items_to_supply_npc.isCrateItem: validation."); - - boolean foundMatch = false; - if (faction == holiday.IMPERIAL_PLAYER) - { - for (int i = 0; i < holiday.ALL_IMPERIAL_CRATE_TEMPLATES.length; i++) - { - testAbortScript(); - if (!itemName.equals(holiday.ALL_IMPERIAL_CRATE_TEMPLATES[i])) - { - continue; - } - - foundMatch = true; - } - } - else - { - blog("give_multiple_items_to_supply_npc.isCrateItem: reb player."); - - for (int i = 0; i < holiday.ALL_REBEL_CRATE_TEMPLATES.length; i++) - { - testAbortScript(); - if (!itemName.equals(holiday.ALL_REBEL_CRATE_TEMPLATES[i])) - { - continue; - } - - foundMatch = true; - } - } - - return foundMatch; - } - - - public boolean hasEmpireDayQuest(obj_id player, int faction) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - boolean hasQuest = false; - if (faction == holiday.IMPERIAL_PLAYER) - { - for (int i = 0; i < holiday.ALL_IMPERIAL_QUESTS.length; i++) - { - testAbortScript(); - if (!groundquests.isQuestActive(player, holiday.ALL_IMPERIAL_QUESTS[i])) - { - continue; - } - - hasQuest = true; - } - } - else - { - for (int i = 0; i < holiday.ALL_REBEL_QUESTS.length; i++) - { - testAbortScript(); - if (!groundquests.isQuestActive(player, holiday.ALL_REBEL_QUESTS[i])) - { - continue; - } - - hasQuest = true; - } - } - return hasQuest; - } - - - public String getEmpireDayCrateForQuestName(obj_id player, int faction) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return null; - } - - if (faction == holiday.IMPERIAL_PLAYER) - { - for (int i = 0; i < holiday.ALL_IMPERIAL_QUESTS.length; i++) - { - testAbortScript(); - if (!groundquests.isQuestActive(player, holiday.ALL_IMPERIAL_QUESTS[i])) - { - continue; - } - - return holiday.ALL_IMPERIAL_QUEST_TEMPLATES[i]; - } - } - else - { - for (int i = 0; i < holiday.ALL_REBEL_QUESTS.length; i++) - { - testAbortScript(); - if (!groundquests.isQuestActive(player, holiday.ALL_REBEL_QUESTS[i])) - { - continue; - } - - return holiday.ALL_REBEL_QUEST_TEMPLATES[i]; - } - } - return null; - } - - - public String getEmpireDayQuestName(obj_id player, int faction) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return null; - } - - if (faction == holiday.IMPERIAL_PLAYER) - { - for (int i = 0; i < holiday.ALL_IMPERIAL_QUESTS.length; i++) - { - testAbortScript(); - if (!groundquests.isQuestActive(player, holiday.ALL_IMPERIAL_QUESTS[i])) - { - continue; - } - - return holiday.ALL_IMPERIAL_QUESTS[i]; - } - } - else - { - for (int i = 0; i < holiday.ALL_REBEL_QUESTS.length; i++) - { - testAbortScript(); - if (!groundquests.isQuestActive(player, holiday.ALL_REBEL_QUESTS[i])) - { - continue; - } - - return holiday.ALL_REBEL_QUESTS[i]; - } - } - return null; - } - - - public boolean incrementCollection(obj_id npc, obj_id player, int faction) throws InterruptedException - { - blog("give_multiple_items_to_supply_npc.incrementCollection init."); - - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (faction == holiday.IMPERIAL_PLAYER) - { - blog("give_multiple_items_to_supply_npc.incrementCollection IMPERIAL."); - - if (getCollectionSlotValue(player, holiday.IMPERIAL_ENGINEERING_START_SLOT) <= 0) - { - blog("give_multiple_items_to_supply_npc.incrementCollection IMPERIAL start slot not found."); - - return false; - } - if (!modifyCollectionSlotValue(player, holiday.IMPERIAL_ENGINEERING_COUNTER_SLOT, 1)) - { - blog("give_multiple_items_to_supply_npc.incrementCollection COULDNT MODIFY COLLECTION."); - - return false; - } - if (hasCompletedCollection(player, holiday.IMPERIAL_ENGINEERING_COLLECTION)) - { - faceTo(npc, player); - doAnimationAction(npc, "celebrate"); - } - - } - else - { - if (getCollectionSlotValue(player, holiday.REBEL_ENGINEERING_START_SLOT) <= 0) - { - - return false; - } - - if (!modifyCollectionSlotValue(player, holiday.REBEL_ENGINEERING_COUNTER_SLOT, 1)) - { - return false; - } - if (hasCompletedCollection(player, holiday.REBEL_ENGINEERING_COLLECTION)) - { - faceTo(npc, player); - doAnimationAction(npc, "celebrate"); - } - } - return true; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/goodbye_path_destroy.java b/sku.0/sys.server/compiled/game/script/event/emp_day/goodbye_path_destroy.java deleted file mode 100644 index 36974cccd..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/goodbye_path_destroy.java +++ /dev/null @@ -1,219 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.chat; -import script.library.create; -import script.library.groundquests; -import script.library.holiday; -import script.library.prose; -import script.library.stealth; -import script.library.utils; - -public class goodbye_path_destroy extends script.base_script -{ - public goodbye_path_destroy() - { - } - public static final boolean LOGGING_ON = true; - public static final String MEATLUMP_LOG = "empire_day_trigger"; - - public static final String CLIENT_EFFECT = "appearance/pt_smoke_puff.prt"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - blog("GOODBYE OnAttach"); - - messageTo(self, "pathToExit", null, 2, false); - messageTo(self, "selfDestruct", null, 120, false); - - return SCRIPT_CONTINUE; - } - - - public int OnMovePathComplete(obj_id self) throws InterruptedException - { - blog("GOODBYE OnMovePathComplete"); - - if (!hasObjVar(self, "exitPoint")) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "exitLocation")) - { - return SCRIPT_CONTINUE; - } - - if (getLocation(self) == getLocationObjVar(self, "exitLocation")) - { - signal(self); - messageTo(self, "selfDestruct", null, 2, false); - return SCRIPT_CONTINUE; - } - - pathTo(self, getLocationObjVar(self, "exitLocation")); - return SCRIPT_CONTINUE; - } - - - public int OnMoveMoving(obj_id self) throws InterruptedException - { - blog("GOODBYE OnMoveMoving"); - - if (!hasObjVar(self, "exitPoint")) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "exitLocation")) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "saidGoodbye")) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "rescuer")) - { - setObjVar(self, "saidGoodbye", true); - return SCRIPT_CONTINUE; - } - - obj_id rescuer = getObjIdObjVar(self, "rescuer"); - if (!isValidId(rescuer) || !exists(rescuer)) - { - setObjVar(self, "saidGoodbye", true); - return SCRIPT_CONTINUE; - } - - prose_package pp = prose.getPackage(new string_id("event/empire_day", "see_you_topside"), rescuer); - chat.publicChat(self, rescuer, null, null, pp); - setObjVar(self, "saidGoodbye", true); - - return SCRIPT_CONTINUE; - } - - - public int pathToExit(obj_id self, dictionary params) throws InterruptedException - { - blog("GOODBYE pathToExit"); - String mobDisguise = getStringObjVar(self, "disguise_npc"); - if (mobDisguise == null || mobDisguise.length() <= 0) - { - blog("GOODBYE pathToExit - Mob had no diguise"); - signal(self); - messageTo(self, "selfDestruct", null, 2, false); - return SCRIPT_CONTINUE; - } - - obj_id[] exitPoints = getAllObjectsWithObjVar(getLocation(self), 50f, "disguise_exit"); - if (exitPoints == null || exitPoints.length <= 0) - { - blog("GOODBYE pathToExit - NO POINTS FOUND"); - - signal(self); - messageTo(self, "selfDestruct", null, 2, false); - return SCRIPT_CONTINUE; - } - - obj_id point = obj_id.NULL_ID; - for (int i = 0; i < exitPoints.length; i++) - { - testAbortScript(); - String var = getStringObjVar(exitPoints[i], "disguise_exit"); - if (var == null || !var.equals(mobDisguise)) - { - blog("GOODBYE pathToExit - var: "+var +" mobDisguise: "+mobDisguise); - continue; - } - point = exitPoints[i]; - } - - if (!isValidId(point) || !exists(point)) - { - blog("GOODBYE pathToExit - NO POINTS FOUND AFTER LOOP"); - - signal(self); - messageTo(self, "selfDestruct", null, 2, false); - return SCRIPT_CONTINUE; - } - - location exitLocation = getLocation(point); - if (exitLocation == null) - { - blog("GOODBYE pathToExit - LOCATION OF POINT 0 INVALID"); - - signal(self); - messageTo(self, "selfDestruct", null, 2, false); - return SCRIPT_CONTINUE; - } - - blog("GOODBYE pathToExit - NPC should be pathing"); - - pathTo(self, exitLocation); - setObjVar(self, "exitPoint", point); - setObjVar(self, "exitLocation", exitLocation); - signal(self); - messageTo(self, "selfDestruct", null, 9, false); - - return SCRIPT_CONTINUE; - } - - - public int selfDestruct(obj_id self, dictionary params) throws InterruptedException - { - blog("GOODBYE selfDestruct"); - if (!hasObjVar(self, "sentSignal")) - { - signal(self); - } - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(MEATLUMP_LOG,msg); - } - return true; - } - - - public boolean signal(obj_id mob) throws InterruptedException - { - blog("GOODBYE signal"); - - obj_id rescuer = getObjIdObjVar(mob, "rescuer"); - if (!isValidId(rescuer) || !exists(rescuer)) - { - - blog("GOODBYE rescuer invalid"); - return false; - } - - blog("GOODBYE rescuer valid: "+rescuer); - - groundquests.sendSignal(rescuer, "prisonerHasLeftTheBuilding"); - - blog("GOODBYE signal sent"); - - playClientEffectObj(mob, CLIENT_EFFECT, mob, ""); - setObjVar(mob, "sentSignal", true); - - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/imperial_empty_sign.java b/sku.0/sys.server/compiled/game/script/event/emp_day/imperial_empty_sign.java deleted file mode 100644 index 6cf0bda22..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/imperial_empty_sign.java +++ /dev/null @@ -1,258 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.pet_lib; -import script.library.static_item; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class imperial_empty_sign extends script.base_script -{ - public imperial_empty_sign() - { - } - public static final String EMPIREDAY = "event/empire_day"; - public static final String LIFEDAY = "event/life_day"; - - public static final string_id SID_WRONG_FACTION = new string_id(EMPIREDAY, "wrong_faction"); - public static final string_id SID_MNU_DRESS = new string_id(EMPIREDAY, "hang_recruitment_sign"); - public static final string_id SID_ZIP_DRESSING = new string_id(EMPIREDAY, "post_zip_bar_text"); - public static final string_id SID_PICK_PATH = new string_id(EMPIREDAY, "pick_path"); - public static final string_id SID_MOUNTED = new string_id(LIFEDAY, "mounted"); - - public static final int COUNTDOWN_TIMER = 3; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!getTemplateName(self).equals(holiday.IMPERIAL_EMPTY_KIOSK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isRebel(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_IMP) && !factions.isImperial(player)) - { - - return SCRIPT_CONTINUE; - } - - if (pet_lib.isMounted(player)) - { - sendSystemMessage(player, holiday.SID_NOT_WHILE_MOUNTED); - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT)) - { - - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT) && !buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF)) - { - - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - - menu_info_data data = mi.getMenuItemByType (menu_info_types.ITEM_USE); - mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_DRESS); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!getTemplateName(self).equals(holiday.IMPERIAL_EMPTY_KIOSK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isRebel(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_IMP) && !factions.isImperial(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT)) - { - - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT) && !buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF)) - { - - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - int startTime = 0; - int range = 3; - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - - stealth.testInvisNonCombatAction(player, self); - int countdownSui = sui.smartCountdownTimerSUI(self, player, "quest_countdown_timer", SID_ZIP_DRESSING, startTime, COUNTDOWN_TIMER, "handleObjectSwapTimer", range, flags); - doAnimationAction(player, "manipulate_high"); - return SCRIPT_CONTINUE; - } - - - public int handleObjectSwapTimer(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - obj_id player = params.getObjId("player"); - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - return SCRIPT_CONTINUE; - } - - else if (bp == sui.BP_REVERT) - { - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_locomotion")); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_incapacitated")); - } - else if (event == sui.CD_EVENT_DAMAGED) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_damaged")); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR)) - { - return SCRIPT_CONTINUE; - } - - int test_pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - if (buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF) && !factions.isDeclared(player)) - { - sendSystemMessage(player, holiday.SID_NOT_SF); - - return SCRIPT_CONTINUE; - } - - if (!holiday.replaceEventObject(self, player, holiday.IMPERIAL_PLAYER_RECRUITMENT_KIOSK)) - { - - return SCRIPT_CONTINUE; - } - else - { - - String parentBuffName = ""; - - if (buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT)) - { - parentBuffName = holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT; - } - else if (buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF)) - { - parentBuffName = holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF; - } - - if (parentBuffName == null || parentBuffName.equals("")) - { - - return SCRIPT_CONTINUE; - } - if (!holiday.rewardEmpireDayPlayer(player, holiday.IMPERIAL_PLAYER, parentBuffName, holiday.BUFF_IMPERIAL_RECRUITMENT_COUNTER, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - - } - return SCRIPT_CONTINUE; - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/imperial_recruitment_sign.java b/sku.0/sys.server/compiled/game/script/event/emp_day/imperial_recruitment_sign.java deleted file mode 100644 index 12bc7eea3..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/imperial_recruitment_sign.java +++ /dev/null @@ -1,258 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.pet_lib; -import script.library.static_item; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class imperial_recruitment_sign extends script.base_script -{ - public imperial_recruitment_sign() - { - } - public static final String EMPIREDAY = "event/empire_day"; - public static final String LIFEDAY = "event/life_day"; - - public static final string_id SID_WRONG_FACTION = new string_id(EMPIREDAY, "wrong_faction"); - public static final string_id SID_MNU_DRESS = new string_id(EMPIREDAY, "destroy_recruitment_sign"); - public static final string_id SID_ZIP_DRESSING = new string_id(EMPIREDAY, "destroy_zip_bar_text"); - public static final string_id SID_PICK_PATH = new string_id(EMPIREDAY, "pick_path"); - public static final string_id SID_MOUNTED = new string_id(LIFEDAY, "mounted"); - - public static final int COUNTDOWN_TIMER = 3; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!getTemplateName(self).equals(holiday.REBEL_NONPLAYER_RECRUITMENT_KIOSK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isImperial(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_REB) && !factions.isRebel(player)) - { - - return SCRIPT_CONTINUE; - } - - if (pet_lib.isMounted(player)) - { - sendSystemMessage(player, holiday.SID_NOT_WHILE_MOUNTED); - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, holiday.REBEL_VANDAL_COUNTER_SLOT)) - { - - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT) && !buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_SF)) - { - - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - menu_info_data data = mi.getMenuItemByType (menu_info_types.ITEM_USE); - mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_DRESS); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!getTemplateName(self).equals(holiday.REBEL_NONPLAYER_RECRUITMENT_KIOSK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isImperial(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_REB) && !factions.isRebel(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, holiday.REBEL_VANDAL_COUNTER_SLOT)) - { - - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT) && !buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_SF)) - { - - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - - int startTime = 0; - int range = 3; - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - - stealth.testInvisNonCombatAction(player, self); - int countdownSui = sui.smartCountdownTimerSUI(self, player, "quest_countdown_timer", SID_ZIP_DRESSING, startTime, COUNTDOWN_TIMER, "handleObjectSwapTimer", range, flags); - doAnimationAction(player, "manipulate_high"); - return SCRIPT_CONTINUE; - } - - - public int handleObjectSwapTimer(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - obj_id player = params.getObjId("player"); - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - return SCRIPT_CONTINUE; - } - - else if (bp == sui.BP_REVERT) - { - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_locomotion")); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_incapacitated")); - } - else if (event == sui.CD_EVENT_DAMAGED) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_damaged")); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR)) - { - return SCRIPT_CONTINUE; - } - - int test_pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - if (buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_SF) && !factions.isDeclared(player)) - { - sendSystemMessage(player, holiday.SID_NOT_SF); - - return SCRIPT_CONTINUE; - } - - if (!holiday.replaceEventObject(self, player, holiday.REBEL_PLAYER_DEFACED_KIOSK)) - { - - return SCRIPT_CONTINUE; - } - else - { - String parentBuffName = ""; - - if (buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT)) - { - parentBuffName = holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT; - } - else if (buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_VANDAL_SF)) - { - parentBuffName = holiday.BUFF_REB_EMPIREDAY_VANDAL_SF; - } - - if (parentBuffName == null || parentBuffName.equals("")) - { - - return SCRIPT_CONTINUE; - } - - if (!holiday.rewardEmpireDayPlayer(player, holiday.REBEL_PLAYER, parentBuffName, holiday.BUFF_REBEL_PLAYER_VANDAL_COUNTER, holiday.REBEL_VANDAL_COUNTER_SLOT, holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - - } - return SCRIPT_CONTINUE; - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/rebel_empty_sign.java b/sku.0/sys.server/compiled/game/script/event/emp_day/rebel_empty_sign.java deleted file mode 100644 index 2f685d894..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/rebel_empty_sign.java +++ /dev/null @@ -1,258 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.pet_lib; -import script.library.static_item; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class rebel_empty_sign extends script.base_script -{ - public rebel_empty_sign() - { - } - public static final String EMPIREDAY = "event/empire_day"; - public static final String LIFEDAY = "event/life_day"; - - public static final string_id SID_WRONG_FACTION = new string_id(EMPIREDAY, "wrong_faction"); - public static final string_id SID_MNU_DRESS = new string_id(EMPIREDAY, "hang_resistance_sign"); - public static final string_id SID_ZIP_DRESSING = new string_id(EMPIREDAY, "post_zip_bar_text"); - public static final string_id SID_PICK_PATH = new string_id(EMPIREDAY, "pick_path"); - public static final string_id SID_MOUNTED = new string_id(LIFEDAY, "mounted"); - - public static final int COUNTDOWN_TIMER = 3; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!getTemplateName(self).equals(holiday.REBEL_EMPTY_KIOSK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isImperial(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_REB) && !factions.isRebel(player)) - { - - return SCRIPT_CONTINUE; - } - - if (pet_lib.isMounted(player)) - { - sendSystemMessage(player, holiday.SID_NOT_WHILE_MOUNTED); - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, holiday.REBEL_RESISTANCE_COUNTER_SLOT)) - { - - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT) && !buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF)) - { - - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - menu_info_data data = mi.getMenuItemByType (menu_info_types.ITEM_USE); - mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_DRESS); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!getTemplateName(self).equals(holiday.REBEL_EMPTY_KIOSK)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_REB) && !factions.isRebel(player)) - { - - return SCRIPT_CONTINUE; - } - - if (pet_lib.isMounted(player)) - { - sendSystemMessage(player, holiday.SID_NOT_WHILE_MOUNTED); - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, holiday.REBEL_RESISTANCE_COUNTER_SLOT)) - { - - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT) && !buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF)) - { - - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - - int startTime = 0; - int range = 3; - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - - stealth.testInvisNonCombatAction(player, self); - int countdownSui = sui.smartCountdownTimerSUI(self, player, "quest_countdown_timer", SID_ZIP_DRESSING, startTime, COUNTDOWN_TIMER, "handleObjectSwapTimer", range, flags); - doAnimationAction(player, "manipulate_high"); - return SCRIPT_CONTINUE; - } - - - public int handleObjectSwapTimer(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - obj_id player = params.getObjId("player"); - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - return SCRIPT_CONTINUE; - } - - else if (bp == sui.BP_REVERT) - { - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_locomotion")); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_incapacitated")); - } - else if (event == sui.CD_EVENT_DAMAGED) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_damaged")); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR)) - { - return SCRIPT_CONTINUE; - } - - int test_pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - if (buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF) && !factions.isDeclared(player)) - { - sendSystemMessage(player, holiday.SID_NOT_SF); - - return SCRIPT_CONTINUE; - } - - if (!holiday.replaceEventObject(self, player, holiday.REBEL_PLAYER_RESISTANCE_KIOSK)) - { - - return SCRIPT_CONTINUE; - } - else - { - String parentBuffName = ""; - - if (buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT)) - { - parentBuffName = holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT; - } - else if (buff.hasBuff(player, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF)) - { - parentBuffName = holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF; - } - - if (parentBuffName == null || parentBuffName.equals("")) - { - - return SCRIPT_CONTINUE; - } - if (!holiday.rewardEmpireDayPlayer(player, holiday.REBEL_PLAYER, parentBuffName, holiday.BUFF_REBEL_RESISTANCE_COUNTER, holiday.REBEL_RESISTANCE_COUNTER_SLOT, holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - - } - return SCRIPT_CONTINUE; - - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/rebel_resistance_sign.java b/sku.0/sys.server/compiled/game/script/event/emp_day/rebel_resistance_sign.java deleted file mode 100644 index c19aada60..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/rebel_resistance_sign.java +++ /dev/null @@ -1,258 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.pet_lib; -import script.library.static_item; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class rebel_resistance_sign extends script.base_script -{ - public rebel_resistance_sign() - { - } - public static final String EMPIREDAY = "event/empire_day"; - public static final String LIFEDAY = "event/life_day"; - - public static final string_id SID_COLLECTION_NOT_FLAGGED = new string_id(EMPIREDAY, "imp_collection_not_flagged"); - public static final string_id SID_WRONG_FACTION = new string_id(EMPIREDAY, "wrong_faction"); - public static final string_id SID_MNU_DRESS = new string_id(EMPIREDAY, "destroy_resistance_sign"); - public static final string_id SID_ZIP_DRESSING = new string_id(EMPIREDAY, "destroy_zip_bar_text"); - public static final string_id SID_PICK_PATH = new string_id(EMPIREDAY, "pick_path"); - public static final string_id SID_MOUNTED = new string_id(LIFEDAY, "mounted"); - - public static final int COUNTDOWN_TIMER = 3; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!getTemplateName(self).equals(holiday.IMPERIAL_NONPLAYER_RESISTANCE_KIOSK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isRebel(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_IMP) && !factions.isImperial(player)) - { - - return SCRIPT_CONTINUE; - } - - if (pet_lib.isMounted(player)) - { - sendSystemMessage(player, holiday.SID_NOT_WHILE_MOUNTED); - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT)) - { - - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT) && !buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF)) - { - - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - - menu_info_data data = mi.getMenuItemByType (menu_info_types.ITEM_USE); - mi.addRootMenu(menu_info_types.ITEM_USE, SID_MNU_DRESS); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!getTemplateName(self).equals(holiday.IMPERIAL_NONPLAYER_RESISTANCE_KIOSK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isRebel(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_NEUTRAL + holiday.PLANET_VAR_PLAYER_FACTION_IMP) && !factions.isImperial(player)) - { - - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT)) - { - sendSystemMessage(player, SID_COLLECTION_NOT_FLAGGED); - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT) && !buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF)) - { - - return SCRIPT_CONTINUE; - } - if (hasObjVar(self, holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - int startTime = 0; - int range = 3; - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - - stealth.testInvisNonCombatAction(player, self); - int countdownSui = sui.smartCountdownTimerSUI(self, player, "quest_countdown_timer", SID_ZIP_DRESSING, startTime, COUNTDOWN_TIMER, "handleObjectSwapTimer", range, flags); - doAnimationAction(player, "manipulate_high"); - return SCRIPT_CONTINUE; - } - - - public int handleObjectSwapTimer(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - obj_id player = params.getObjId("player"); - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - return SCRIPT_CONTINUE; - } - - else if (bp == sui.BP_REVERT) - { - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_locomotion")); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_incapacitated")); - } - else if (event == sui.CD_EVENT_DAMAGED) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_damaged")); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR)) - { - return SCRIPT_CONTINUE; - } - - int test_pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - if (buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF) && !factions.isDeclared(player)) - { - sendSystemMessage(player, holiday.SID_NOT_SF); - - return SCRIPT_CONTINUE; - } - - if (!holiday.replaceEventObject(self, player, holiday.IMPERIAL_PLAYER_DEFACED_KIOSK)) - { - - return SCRIPT_CONTINUE; - } - else - { - - String parentBuffName = ""; - - if (buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT)) - { - parentBuffName = holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT; - } - else if (buff.hasBuff(player, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF)) - { - parentBuffName = holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF; - } - - if (parentBuffName == null || parentBuffName.equals("")) - { - - return SCRIPT_CONTINUE; - } - if (!holiday.rewardEmpireDayPlayer(player, holiday.IMPERIAL_PLAYER, parentBuffName, holiday.BUFF_IMPERIAL_ANTIPROPAGANDA_COUNTER, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT, holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT)) - { - - return SCRIPT_CONTINUE; - } - - } - return SCRIPT_CONTINUE; - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emp_day/rescue_faction_npc_trigger_volume.java b/sku.0/sys.server/compiled/game/script/event/emp_day/rescue_faction_npc_trigger_volume.java deleted file mode 100644 index 63009f4d1..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emp_day/rescue_faction_npc_trigger_volume.java +++ /dev/null @@ -1,191 +0,0 @@ -package script.event.emp_day; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.chat; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.prose; -import script.library.stealth; -import script.library.utils; - - -public class rescue_faction_npc_trigger_volume extends script.base_script -{ - public rescue_faction_npc_trigger_volume() - { - } - public static final boolean LOGGING_ON = true; - public static final String MEATLUMP_LOG = "empire_day_trigger"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - createTriggerVolume(holiday.VOL_TRIGGER_NAME_PREFIX + self, holiday.VOL_TRIGGER_RADIUS, true); - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - blog("OnTriggerVolumeEntered INIT: "+whoTriggeredMe); - - if (!isPlayer(whoTriggeredMe)) - { - return SCRIPT_CONTINUE; - } - - blog("Spawner: "+getIntObjVar(self, "spawner")); - - if (!hasObjVar(self, "spawn_creature")) - { - return SCRIPT_CONTINUE; - } - - blog("spawn_creature received!"); - - if (!hasObjVar(self, "active_quest")) - { - return SCRIPT_CONTINUE; - } - - blog("active_quest received!"); - - if (!hasObjVar(self, "active_task")) - { - return SCRIPT_CONTINUE; - } - - blog("active_task received!"); - - if (!hasObjVar(self, "signal_to_send")) - { - return SCRIPT_CONTINUE; - } - - blog("signal_to_send received!"); - - String creatureSpawn = getStringObjVar(self, "spawn_creature"); - if (creatureSpawn == null || creatureSpawn.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String activeQuest = getStringObjVar(self, "active_quest"); - if (activeQuest == null || activeQuest.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String activeTask = getStringObjVar(self, "active_task"); - if (activeTask == null || activeTask.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String sendSignal = getStringObjVar(self, "signal_to_send"); - if (sendSignal == null || sendSignal.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(whoTriggeredMe, activeQuest)) - { - return SCRIPT_CONTINUE; - } - blog("Ground Quest Found!"); - - if (!groundquests.isTaskActive(whoTriggeredMe, activeQuest, activeTask)) - { - return SCRIPT_CONTINUE; - } - blog("Ground Task Found!"); - - if (factions.isOnLeave(whoTriggeredMe) && (factions.isRebel(whoTriggeredMe) || factions.isImperial(whoTriggeredMe))) - { - if (!utils.hasScriptVar(whoTriggeredMe, "commPlayerOnLeave")) - { - String npc = "object/mobile/mara_jade_empire_day.iff"; - String sound = "sound/sys_comm_rebel_female.snd"; - - if (factions.isRebel(whoTriggeredMe)) - { - npc = "object/mobile/wedge_antilles_remembrance_day.iff"; - sound = "sound/sys_comm_rebel_male.snd"; - } - prose_package pp = new prose_package(); - prose.setStringId(pp, new string_id("event/empire_day", "rescue_onleave_notgood")); - commPlayers(whoTriggeredMe, npc, sound, 10f, whoTriggeredMe, pp); - - utils.setScriptVar(whoTriggeredMe, "commPlayerOnLeave", true); - } - return SCRIPT_CONTINUE; - } - - String invis = stealth.getInvisBuff(whoTriggeredMe); - if (invis != null) - { - stealth.checkForAndMakeVisibleNoRecourse(self); - } - - blog("Sending Signal!"); - - groundquests.sendSignal(whoTriggeredMe, sendSignal); - - blog("Signal Sent!"); - location curLoc = getLocation(self); - - blog("Creating Mob"); - obj_id mob = create.object(creatureSpawn, curLoc, 100); - if (!isValidId(mob) || !exists(mob)) - { - return SCRIPT_CONTINUE; - } - - blog("Mob created Sent!"); - - setObjVar(mob, "rescuerQuest", activeQuest); - setObjVar(mob, "rescuer", whoTriggeredMe); - blog("I set: "+whoTriggeredMe+" rescuer. Getting player location"); - - location playerLoc = getLocation(whoTriggeredMe); - if (playerLoc != null) - { - blog("player location found"); - pathTo(mob, playerLoc); - } - - blog("saying something"); - - prose_package pp = prose.getPackage(new string_id("event/empire_day", "rescue_me_breacher"), whoTriggeredMe); - chat.publicChat(mob, whoTriggeredMe, null, null, pp); - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - blog("Exited trigger volume: "+whoTriggeredMe); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(MEATLUMP_LOG,msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emperorsday/emperor_statue.java b/sku.0/sys.server/compiled/game/script/event/emperorsday/emperor_statue.java deleted file mode 100644 index 63605f3a9..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emperorsday/emperor_statue.java +++ /dev/null @@ -1,1575 +0,0 @@ -package script.event.emperorsday; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.collection; -import script.library.create; -import script.library.factions; -import script.library.firework; -import script.library.holiday; -import script.library.performance; -import script.library.prose; -import script.library.static_item; -import script.library.trial; -import script.library.utils; - - -public class emperor_statue extends script.base_script -{ - public emperor_statue() - { - } - public static final String MUSIC_IMPERIAL_MARCH = "object/soundobject/soundobject_imperial_march.iff"; - public static final String MUSIC_IMPERIAL_ATTACK = "object/soundobject/soundobject_imperial_attack.iff"; - - public static final String EMP_DAY = "event/emperors_day"; - - public static final string_id VENDOR_1 = new string_id(EMP_DAY, "imp_vendor_1"); - - public static final string_id DARTH_1 = new string_id(EMP_DAY, "imp_darth_1"); - - public static final string_id VENDOR_2 = new string_id(EMP_DAY, "imp_vendor_2"); - - public static final string_id DARTH_2 = new string_id(EMP_DAY, "imp_darth_2"); - - public static final string_id DARTH_3 = new string_id(EMP_DAY, "imp_darth_3"); - - public static final string_id DARTH_4 = new string_id(EMP_DAY, "imp_darth_4"); - - public static final string_id DARTH_5 = new string_id(EMP_DAY, "imp_darth_5"); - - public static final string_id DARTH_6 = new string_id(EMP_DAY, "imp_darth_6_string"); - - public static final string_id DARTH_6_ALT = new string_id(EMP_DAY, "imp_darth_6_alt"); - - public static final string_id VENDOR_3 = new string_id(EMP_DAY, "imp_vendor_3_string"); - - public static final string_id DARTH_7 = new string_id(EMP_DAY, "imp_darth_7"); - - public static final string_id DARTH_ANNOYED = new string_id(EMP_DAY, "imp_darth_annoyed_string"); - - public static final string_id VENDOR_REPLY_ANNOYED = new string_id(EMP_DAY, "imp_vendor_annoyed"); - - public static final string_id DARTH_ANNOYED_2_SINGULAR = new string_id(EMP_DAY, "imp_darth_annoyed_2_string_singular"); - public static final string_id DARTH_ANNOYED_2_PLURAL = new string_id(EMP_DAY, "imp_darth_annoyed_2_string_plural"); - - public static final string_id VENDOR_REPLY_ANNOYED_2 = new string_id(EMP_DAY, "imp_vendor_annoyed_2"); - - public static final string_id TREE_USE = new string_id(EMP_DAY, "emperor_statue_use"); - public static final string_id NOT_OLD_ENOUGH = new string_id(EMP_DAY, "not_old_enough"); - public static final string_id WINNER_HELP = new string_id(EMP_DAY, "winner_help_empire"); - - public static final float LAMBDA_YAW = -0.01f; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "emperor_statue.OnInitialize: Init."); - - if (!utils.hasScriptVar(self, "musicObject")) - { - location soundLoc = getLocation(self); - obj_id soundObject = createObject(MUSIC_IMPERIAL_ATTACK, soundLoc); - - utils.setScriptVar(self, "musicObject", soundObject); - } - else if (utils.hasScriptVar(self, "musicObject")) - { - obj_id oldSoundObject = utils.getObjIdScriptVar(self, "musicObject"); - - if ((isIdValid(oldSoundObject)) && exists(oldSoundObject)) - { - destroyObject(oldSoundObject); - } - - location soundLoc = getLocation(self); - obj_id soundObject = createObject(MUSIC_IMPERIAL_ATTACK, soundLoc); - - utils.setScriptVar(self, "musicObject", soundObject); - } - - CustomerServiceLog("holidayEvent", "emperor_statue.OnInitialize: Preparing Parade."); - messageTo(self, "prepareParade", null, 10.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (utils.hasScriptVar(self, "paradeRunning")) - { - names[idx] = "next_ceremony"; - attribs[idx] = "Now"; - idx++; - } - else - { - - int nextCeremony = getIntObjVar(self, "ceremonyTime"); - if (nextCeremony <= 0) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "next_ceremony"; - attribs[idx] = getCalendarTimeStringLocal(nextCeremony); - idx++; - - names[idx] = "count_down"; - attribs[idx] = utils.formatTimeVerbose(nextCeremony - getCalendarTime()); - idx++; - } - - String statusString = holiday.getEmpireDayEligibility(player, holiday.IMPERIAL_PLAYER); - if (statusString != null && !statusString.equals("")) - { - names[idx] = "empire_day_player_status"; - attribs[idx] = statusString; - idx++; - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isIdValid(player) || ai_lib.isInCombat(player) || isIncapacitated(player) || isDead(player)) - { - return SCRIPT_CONTINUE; - } - - if (!factions.isImperial(player)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.currentYearObjVar())) - { - mi.addRootMenu(menu_info_types.ITEM_USE, TREE_USE); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || ai_lib.isInCombat(player) || isIncapacitated(player) || isDead(player)) - { - return SCRIPT_CONTINUE; - } - - if (!factions.isImperial(player)) - { - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if ((getCurrentBirthDate() - getPlayerBirthDate(player)) < 10) - { - sendSystemMessage(player, NOT_OLD_ENOUGH); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.currentYearObjVar())) - { - holiday.grantEmpireDayGift(player, holiday.IMPERIAL_PLAYER); - } - - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - - obj_id oldSoundObject = utils.getObjIdScriptVar(self, "musicObject"); - - if ((isIdValid(oldSoundObject)) && exists(oldSoundObject)) - { - destroyObject(oldSoundObject); - } - - if (utils.hasScriptVar(self, "vader")) - { - Vector npc = utils.getResizeableObjIdArrayScriptVar(self, "vader"); - for (int i=0; i 1) - { - pp = prose.getPackage(DARTH_ANNOYED_2_PLURAL); - } - prose.setTO (pp, waitingOnList); - chat.chat(vader, ((obj_id)(lastestMiaList.get(0))), pp); - } - else - { - String waitingOnList = getStringObjVar(vader, "waitingOnList"); - prose_package pp = prose.getPackage(DARTH_ANNOYED_2_SINGULAR); - if (oldMiaList.length > 1) - { - pp = prose.getPackage(DARTH_ANNOYED_2_PLURAL); - } - prose.setTO (pp, waitingOnList); - chat.chat(vader, oldMiaList[0], pp); - - for (int i = 0; i < oldMiaList.length; i++) - { - testAbortScript(); - if (isIdValid(oldMiaList[i]) && exists(oldMiaList[i])) - { - utils.removeScriptVar(oldMiaList[i], "emperorsDayBadge"); - } - } - } - messageTo(self, "vendorReplyWaiting", null, 10.0f, false); - } - return SCRIPT_CONTINUE; - } - - - public int vendorReplyWaiting(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "emperor_statue.vendorReplyWaiting: messageHandler Initialized."); - - obj_id vendor = getObjIdObjVar(self, holiday.SPAWNER_PREFIX_OBJVAR+"vendor"); - if (isIdValid(vendor) || exists(vendor)) - { - doAnimationAction(vendor, "apologize"); - chat.chat(vendor, VENDOR_REPLY_ANNOYED_2); - messageTo(self, "vaderLeaving", null, 10.0f, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean playTieFighterPair(obj_id self, obj_id playOnObject) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "emperor_statue.playTieFighterPair: Function initialized."); - - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(playOnObject) || !exists(playOnObject)) - { - return false; - } - - CustomerServiceLog("holidayEvent", "emperor_statue.playTieFighterPair: playing."); - location here = getLocation(playOnObject); - playClientEffectLoc(getPlayerCreaturesInRange(here, 200.0f), holiday.IMPERIAL_FLYBY_PARTICLE_01, here, 1.0f); - return true; - } - - - public boolean playTieFighterGroup(obj_id self, obj_id playOnObject) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "emperor_statue.playTieFighterGroup: Function initialized."); - - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(playOnObject) || !exists(playOnObject)) - { - return false; - } - - CustomerServiceLog("holidayEvent", "emperor_statue.playTieFighterGroup: playing."); - location here = getLocation(playOnObject); - playClientEffectLoc(getPlayerCreaturesInRange(here, 200.0f), holiday.IMPERIAL_FLYBY_PARTICLE_02, here, 1.0f); - return true; - } - - - public boolean createLambdaDropship(obj_id self, location loc) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "emperor_statue.createLambdaDropship: Init."); - if (loc == null) - { - return false; - } - - if (!loc.area.equals(getCurrentSceneName())) - { - return false; - } - - CustomerServiceLog("holidayEvent", "emperor_statue.createLambdaDropship: Creating shuttle at location: "+loc); - obj_id lambda = create.object("object/creature/npc/theme_park/lambda_shuttle.iff", loc); - if (!isIdValid(lambda)) - { - return false; - } - - CustomerServiceLog("holidayEvent", "emperor_statue.createLambdaDropship: Lambda OID: "+lambda); - - setYaw(lambda, LAMBDA_YAW); - - CustomerServiceLog("holidayEvent", "emperor_statue.createLambdaDropship: Lambda Yaw: "+getYaw(lambda)); - - utils.setScriptVar(self, "lambdaShuttle", lambda); - utils.setScriptVar(lambda, "statue", self); - attachScript(lambda, "systems.spawning.dropship.emperorsday_lambda"); - - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/event/emperorsday/imperial_npc.java b/sku.0/sys.server/compiled/game/script/event/emperorsday/imperial_npc.java deleted file mode 100644 index 786f6f073..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emperorsday/imperial_npc.java +++ /dev/null @@ -1,257 +0,0 @@ -package script.event.emperorsday; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.anims; -import script.library.chat; -import script.library.colors; -import script.library.factions; -import script.library.holiday; -import script.library.pclib; -import script.library.prose; -import script.library.stealth; -import script.library.utils; - - -public class imperial_npc extends script.base_script -{ - public imperial_npc() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - String npcType = getStringObjVar (self, "emperorsday.npcType"); - if (npcType != null) - { - obj_id masterObject = holiday.masterObjectObjId(self); - if (isIdValid(masterObject)) - { - dictionary params = new dictionary(); - params.put("type", npcType); - params.put("npcObjId", self); - - messageTo(masterObject, "npcTypeList", params, 3.0f, false); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnMovePathComplete(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, "vader")) - { - return SCRIPT_CONTINUE; - } - - obj_id spawnPoint = holiday.getEmpireDayWaypointObjectObjId(self, "spawnVader", holiday.OBJECT_NEAR_CHECK_RANGE_10M); - obj_id pathPoint = holiday.getEmpireDayWaypointObjectObjId(self, "pathVader", holiday.OBJECT_NEAR_CHECK_RANGE_10M); - if (isIdValid(pathPoint) && exists(pathPoint)) - { - obj_id masterObject = holiday.masterObjectObjId(self); - if (isIdValid(masterObject)) - { - messageTo(masterObject, "startConversation", null, 3.0f, false); - } - } - - if (isIdValid(spawnPoint) && exists(spawnPoint)) - { - obj_id masterObject = holiday.masterObjectObjId(self); - if (isIdValid(masterObject)) - { - - obj_id oldSoundObject = utils.getObjIdScriptVar(self, "musicObject"); - - if ((isIdValid(oldSoundObject)) && (exists(oldSoundObject))) - { - destroyObject(oldSoundObject); - } - - messageTo(masterObject, "destroyParade", null, 5.0f, false); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isIdValid(player) || ai_lib.isInCombat(player) || isIncapacitated(player) || isDead(player)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "vader") && hasObjVar(self, "readyForBadge") && utils.hasScriptVar(player, "emperorsDayBadge")) - { - CustomerServiceLog("holidayEvent", "imperial_npc.OnObjectMenuSelect: The player is authorized to access Vader and receive reward badge."); - - mi.addRootMenu(menu_info_types.ITEM_USE, holiday.BOW); - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || ai_lib.isInCombat(player) || isIncapacitated(player) || isDead(player)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "vader") && hasObjVar(self, "readyForBadge") && utils.hasScriptVar(player, "emperorsDayBadge")) - { - obj_id[] listOfWinners = getObjIdArrayObjVar(self, "listOfWinners"); - if (listOfWinners == null || listOfWinners.length <= 0) - { - CustomerServiceLog("holidayEvent", "imperial_npc.OnObjectMenuSelect: THE LIST OF WINNERS WASNT FOUND ON VADER. Vader cannot give the player his badge."); - return SCRIPT_CONTINUE; - } - - boolean playerReward = false; - for (int i = 0; i < listOfWinners.length; i++) - { - testAbortScript(); - if (player != listOfWinners[i]) - { - continue; - } - - playerReward = true; - break; - } - - if (!playerReward) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("holidayEvent", "imperial_npc.OnObjectMenuSelect: The list of winners was received. Player: "+player+" has the variable to claim reward."); - if (!holiday.grantEmperorDayBadge(player, self, listOfWinners, holiday.IMPERIAL_PLAYER)) - { - CustomerServiceLog("holidayEvent", "imperial_npc.OnObjectMenuSelect: The grantEmperorDayBadge function shows that rewarding the player: "+player+" FAILED!"); - } - } - sendDirtyObjectMenuNotification(self); - return SCRIPT_CONTINUE; - } - - - public int OnSawEmote(obj_id self, obj_id emoteSayer, String emotein) throws InterruptedException - { - obj_id emotetarget = getLookAtTarget(emoteSayer); - if (!isIdValid(emotetarget) || ai_lib.isInCombat(self) || ai_lib.isInCombat(emoteSayer) || isIncapacitated(self) || isDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "vader") && factions.isRebel(emoteSayer) && emotetarget == self) - { - forceChokePlayer(self, emoteSayer); - } - - if (!hasObjVar(self, "vader") && factions.isRebel(emoteSayer) && emotetarget == self) - { - holiday.slapPlayerDownForBeingRude(self, emoteSayer); - CustomerServiceLog("holidayEvent", "imperial_npc.OnObjectMenuSelect: Player: "+emoteSayer+" was rude to an NPC at the ceremony and will now be punished."); - } - - if (hasObjVar(self, "vader") && hasObjVar(self, "readyForBadge") && utils.hasScriptVar(emoteSayer, "emperorsDayBadge")) - { - - obj_id masterObject = holiday.masterObjectObjId(self); - if (!isIdValid(masterObject) && !exists(masterObject)) - { - return SCRIPT_CONTINUE; - } - if (emotetarget != self) - { - return SCRIPT_CONTINUE; - } - - if (factions.isImperial(emoteSayer)) - { - switch ( holiday.getEmoteBeligerence(emotein) ) - { - - case 2: - break; - - case 1: - doAnimationAction(self, "shake_head_no"); - - utils.removeScriptVar(emoteSayer, "emperorsDayBadge"); - factions.addFactionStanding(emoteSayer, factions.FACTION_IMPERIAL, -250); - - prose_package pp = prose.getPackage(holiday.DARTH_BADGE_2); - prose.setTT (pp, emoteSayer); - chat.chat(self, emoteSayer, pp); - forceChokePlayer(self, emoteSayer); - - break; - - case 0: - break; - - default: - break; - } - } - } - return SCRIPT_CONTINUE; - } - - - public int playerKnockedOut(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("myTarget"); - if (!isValidId(player) && !exists(player)) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("holidayEvent", "imperial_npc.playerKnockedOut: The player: "+player+" was knocked down by an Empire Day Ceremony NPC."); - damage(player, DAMAGE_KINETIC, HIT_LOCATION_BODY, 100); - setPosture(player, POSTURE_INCAPACITATED); - if (factions.isRebel(player)) - { - holiday.giveCeremonyAreaMobsHate(player, holiday.NPC_ATTACK_RANGE); - } - - return SCRIPT_CONTINUE; - } - - - public boolean forceChokePlayer(obj_id npcObject, obj_id playerToBeIncapped) throws InterruptedException - { - stealth.testInvisNonCombatAction(playerToBeIncapped, npcObject); - doAnimationAction(npcObject, "force_choke"); - doAnimationAction(playerToBeIncapped, "heavy_cough_vomit"); - - dictionary eDict = new dictionary(); - eDict.put("myTarget", playerToBeIncapped); - messageTo(npcObject, "playerKnockedOut", eDict, 6, false); - - for (int i = 0; i < 4; i++) - { - testAbortScript(); - string_id strText = new string_id("combat_effects", "choke"); - color colTest = colors.RED; - showFlyText(playerToBeIncapped, strText, 1, colTest); - } - string_id strSpam = new string_id("combat_effects", "choke_single"); - sendSystemMessage(playerToBeIncapped, strSpam); - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/event/emperorsday/imperial_npc_corpse.java b/sku.0/sys.server/compiled/game/script/event/emperorsday/imperial_npc_corpse.java deleted file mode 100644 index 002a08383..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emperorsday/imperial_npc_corpse.java +++ /dev/null @@ -1,107 +0,0 @@ -package script.event.emperorsday; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; - - -public class imperial_npc_corpse extends script.base_script -{ - public imperial_npc_corpse() - { - } - public static final String EMPIREDAY = "event/empire_day"; - public static final string_id SID_MNU_REBEL = new string_id(EMPIREDAY, "imperial_crash_victim_rebel_menu"); - public static final string_id SID_MNU_IMPERIAL = new string_id(EMPIREDAY, "imeprial_crash_victim_imperial_menu"); - public static final string_id SID_YOU_FIND_NOTHING = new string_id(EMPIREDAY, "you_find_nothing"); - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "knockDown", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "knockDown", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01)) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01, holiday.EMPIREDAYQUEST_REB_CORPSE_TASK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isImperial(player) || !factions.isRebel(player)) - { - return SCRIPT_CONTINUE; - } - - menu_info_data data = mi.getMenuItemByType (menu_info_types.SERVER_MENU2); - mi.addRootMenu(menu_info_types.SERVER_MENU2, SID_MNU_REBEL); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01)) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, holiday.EMPIREDAYQUEST_REB_COMBAT_01, holiday.EMPIREDAYQUEST_REB_CORPSE_TASK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isImperial(player) || !factions.isRebel(player)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "hasIntel")) - { - sendSystemMessage(player, SID_YOU_FIND_NOTHING); - return SCRIPT_CONTINUE; - } - groundquests.sendSignal(player, holiday.EMPIREDAYQUEST_REB_CORPSE_SIGNAL); - return SCRIPT_CONTINUE; - } - - - public int knockDown(obj_id self, dictionary params) throws InterruptedException - { - ai_lib.aiSetPosture(self, POSTURE_KNOCKED_DOWN); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emperorsday/rebel_npc.java b/sku.0/sys.server/compiled/game/script/event/emperorsday/rebel_npc.java deleted file mode 100644 index 6eeeb6658..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emperorsday/rebel_npc.java +++ /dev/null @@ -1,322 +0,0 @@ -package script.event.emperorsday; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.anims; -import script.library.chat; -import script.library.colors; -import script.library.factions; -import script.library.holiday; -import script.library.pclib; -import script.library.prose; -import script.library.stealth; -import script.library.utils; - - -public class rebel_npc extends script.base_script -{ - public rebel_npc() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - String npcType = getStringObjVar (self, "emperorsday.npcType"); - if (npcType != null) - { - obj_id masterObject = holiday.masterObjectObjId(self); - if (isIdValid(masterObject)) - { - dictionary params = new dictionary(); - params.put("type", npcType); - params.put("npcObjId", self); - - messageTo(masterObject, "npcTypeList", params, 3.0f, false); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnMovePathComplete(obj_id self) throws InterruptedException - { - obj_id masterObject = holiday.masterObjectObjId(self); - - if (hasObjVar (self, "leia")) - { - CustomerServiceLog("holidayEvent", "imperial_npc.OnMovePathComplete: Leia has come to a stop at a location."); - - obj_id spawnPoint = holiday.getEmpireDayWaypointObjectObjId(self, "spawnCeleb", holiday.OBJECT_NEAR_CHECK_RANGE_2M); - obj_id pathPoint = holiday.getEmpireDayWaypointObjectObjId(self, "pathLeia", holiday.OBJECT_NEAR_CHECK_RANGE_2M); - - if (isIdValid(pathPoint) && exists(pathPoint)) - { - if (isIdValid(masterObject)) - { - messageTo(masterObject, "startConversation", null, 3.0f, false); - setYaw (self, -180.0f); - } - } - if (isIdValid(spawnPoint) && exists(spawnPoint)) - { - if (isIdValid(masterObject)) - { - - obj_id oldSoundObject = utils.getObjIdScriptVar(self, "musicObject"); - - if ((isIdValid(oldSoundObject)) && (exists(oldSoundObject))) - { - destroyObject(oldSoundObject); - } - - messageTo(masterObject, "destroyParade", null, 5.0f, false); - } - } - - } - - else if (hasObjVar(self, "han")) - { - CustomerServiceLog("holidayEvent", "imperial_npc.OnMovePathComplete: Han has come to a stop at a location."); - - obj_id spawnPoint = holiday.getEmpireDayWaypointObjectObjId(self, "spawnCeleb", holiday.OBJECT_NEAR_CHECK_RANGE_2M); - obj_id pathPoint = holiday.getEmpireDayWaypointObjectObjId(self, "pathHan", holiday.OBJECT_NEAR_CHECK_RANGE_2M); - - if (isIdValid(spawnPoint) && exists(spawnPoint)) - { - if (isIdValid(masterObject)) - { - if (hasObjVar(self, "han")) - { - destroyObject(self); - if (utils.hasScriptVar(masterObject, "solo")) - { - utils.removeScriptVar(masterObject, "solo"); - } - } - } - } - if (isIdValid(pathPoint) && exists(pathPoint)) - { - CustomerServiceLog("holidayEvent", "imperial_npc.OnMovePathComplete: Han has a valid pathPoint."); - setYaw (self, -140.0f); - } - } - - else if (hasObjVar(self, "chewie")) - { - CustomerServiceLog("holidayEvent", "imperial_npc.OnMovePathComplete: Chewie has come to a stop at a location."); - - obj_id spawnPoint = holiday.getEmpireDayWaypointObjectObjId(self, "spawnCeleb", holiday.OBJECT_NEAR_CHECK_RANGE_2M); - obj_id pathPoint = holiday.getEmpireDayWaypointObjectObjId(self, "pathChewie", holiday.OBJECT_NEAR_CHECK_RANGE_2M); - - if (isIdValid(spawnPoint) && exists(spawnPoint)) - { - if (isIdValid(masterObject)) - { - if (hasObjVar(self, "chewie")) - { - destroyObject(self); - if (utils.hasScriptVar(masterObject, "chewbacca")) - { - utils.removeScriptVar(masterObject, "chewbacca"); - } - } - } - } - if (isIdValid(pathPoint) && exists(pathPoint)) - { - CustomerServiceLog("holidayEvent", "imperial_npc.OnMovePathComplete: Chewie has a valid pathPoint."); - setYaw (self, -140.0f); - } - } - - else if (hasObjVar(self, "soldier")) - { - int soldierNumber = getIntObjVar(self, "soldier"); - if (soldierNumber != 0) - { - obj_id spawnPoint = holiday.getEmpireDayWaypointObjectObjId(self, "spawnsoldier"+soldierNumber, holiday.OBJECT_NEAR_CHECK_RANGE_2M); - obj_id pathPoint = holiday.getEmpireDayWaypointObjectObjId(self, "pathsoldier"+soldierNumber, holiday.OBJECT_NEAR_CHECK_RANGE_2M); - - if (isIdValid(pathPoint) && exists(pathPoint)) - { - location exactLoc = getLocation(pathPoint); - pathTo(self, exactLoc); - float pointYaw = getYaw (pathPoint); - setYaw(self, pointYaw); - ai_lib.setMood (self, "npc_imperial"); - } - if (isIdValid(spawnPoint) && exists(spawnPoint)) - { - float pointYaw = getYaw (spawnPoint); - setYaw(self, pointYaw); - - dictionary params = new dictionary(); - params.put("objvarValue", soldierNumber); - params.put("soldierObjId", self); - - messageTo(masterObject, "setOriginalMood", params, 2.0f, false); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isIdValid(player) || ai_lib.isInCombat(player) || isIncapacitated(player) || isDead(player)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "leia") && hasObjVar(self, "readyForBadge") && utils.hasScriptVar(player, "emperorsDayBadge")) - { - mi.addRootMenu(menu_info_types.ITEM_USE, holiday.BOW); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || ai_lib.isInCombat(player) || isIncapacitated(player) || isDead(player)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "leia") && hasObjVar(self, "readyForBadge") && utils.hasScriptVar(player, "emperorsDayBadge")) - { - obj_id[] listOfWinners = getObjIdArrayObjVar(self, "listOfWinners"); - if (listOfWinners == null || listOfWinners.length <= 0) - { - CustomerServiceLog("holidayEvent", "rebel_npc.OnObjectMenuSelect: THE LIST OF WINNERS WASNT FOUND ON VADER. Vader cannot give the player his badge."); - return SCRIPT_CONTINUE; - } - - boolean playerReward = false; - for (int i = 0; i < listOfWinners.length; i++) - { - testAbortScript(); - if (player != listOfWinners[i]) - { - continue; - } - - playerReward = true; - break; - } - - if (!playerReward) - { - return SCRIPT_CONTINUE; - } - - if (!holiday.grantEmperorDayBadge(player, self, listOfWinners, holiday.REBEL_PLAYER)) - { - CustomerServiceLog("holidayEvent", "rebel_npc.OnObjectMenuSelect: The grantEmperorDayBadge function shows that rewarding the player: "+player+" FAILED!"); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnSawEmote(obj_id self, obj_id emoteSayer, String emotein) throws InterruptedException - { - if (!isValidId(emoteSayer) || !exists(emoteSayer)) - { - return SCRIPT_CONTINUE; - } - - if (emotein == null || emotein.length() <= 0) - { - return SCRIPT_CONTINUE; - } - obj_id emotetarget = getLookAtTarget(emoteSayer); - if (!isIdValid(emotetarget) || ai_lib.isInCombat(self) || ai_lib.isInCombat(emoteSayer) || isIncapacitated(self) || isDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isImperial(emoteSayer) && emotetarget == self) - { - holiday.slapPlayerDownForBeingRude(self, emoteSayer); - CustomerServiceLog("holidayEvent", "imperial_npc.OnObjectMenuSelect: Player: "+emoteSayer+" was rude to an NPC at the ceremony and will now be punished."); - } - - if ((hasObjVar(self, "leia") && hasObjVar(self, "readyForBadge") && utils.hasScriptVar(emoteSayer, "emperorsDayBadge") && emotetarget == self)) - { - - obj_id masterObject = holiday.masterObjectObjId(self); - - if (!isIdValid(masterObject) && !exists(masterObject)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isRebel(emoteSayer)) - { - switch (holiday.getEmoteBeligerence(emotein)) - { - - case 2: - break; - - case 1: - doAnimationAction(self, "shake_head_no"); - utils.removeScriptVar(emoteSayer, "emperorsDayBadge"); - factions.addFactionStanding(emoteSayer, factions.FACTION_REBEL, -250); - - prose_package pp = prose.getPackage(holiday.LEIA_BADGE_2); - prose.setTT (pp, emoteSayer); - chat.chat(self, emoteSayer, pp); - - dictionary params = new dictionary(); - params.put("rudePlayer", emoteSayer); - messageTo(masterObject, "hanAngry", params, 2.0f, false); - - break; - - case 0: - break; - - default: - break; - } - } - } - return SCRIPT_CONTINUE; - } - - - public int playerKnockedOut(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("myTarget"); - if (!isValidId(player) && !exists(player)) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("holidayEvent", "rebel_npc.playerKnockedOut: The player: "+player+" was knocked down by an Empire Day Ceremony NPC."); - damage(player, DAMAGE_KINETIC, HIT_LOCATION_BODY, 100); - setPosture(player, POSTURE_INCAPACITATED); - if (factions.isImperial(player)) - { - holiday.giveCeremonyAreaMobsHate(player, holiday.NPC_ATTACK_RANGE); - } - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/event/emperorsday/rebel_npc_corpse.java b/sku.0/sys.server/compiled/game/script/event/emperorsday/rebel_npc_corpse.java deleted file mode 100644 index cbde14251..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emperorsday/rebel_npc_corpse.java +++ /dev/null @@ -1,110 +0,0 @@ -package script.event.emperorsday; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; - - -public class rebel_npc_corpse extends script.base_script -{ - public rebel_npc_corpse() - { - } - public static final String EMPIREDAY = "event/empire_day"; - public static final string_id SID_MNU_REBEL = new string_id(EMPIREDAY, "rebel_crash_victim_rebel_menu"); - public static final string_id SID_MNU_IMPERIAL = new string_id(EMPIREDAY, "rebel_crash_victim_imperial_menu"); - public static final string_id SID_YOU_FIND_NOTHING = new string_id(EMPIREDAY, "you_find_nothing"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "knockDown", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "knockDown", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_01)) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_01, holiday.EMPIREDAYQUEST_IMP_CORPSE_TASK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isRebel(player) || !factions.isImperial(player)) - { - return SCRIPT_CONTINUE; - } - - menu_info_data data = mi.getMenuItemByType (menu_info_types.SERVER_MENU2); - mi.addRootMenu(menu_info_types.SERVER_MENU2, SID_MNU_IMPERIAL); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_01)) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, holiday.EMPIREDAYQUEST_IMP_COMBAT_01, holiday.EMPIREDAYQUEST_IMP_CORPSE_TASK)) - { - return SCRIPT_CONTINUE; - } - - if (factions.isRebel(player) || !factions.isImperial(player)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "hasIntel")) - { - sendSystemMessage(player, SID_YOU_FIND_NOTHING); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, holiday.EMPIREDAYQUEST_IMP_CORPSE_SIGNAL); - - return SCRIPT_CONTINUE; - } - - - public int knockDown(obj_id self, dictionary params) throws InterruptedException - { - ai_lib.aiSetPosture(self, POSTURE_KNOCKED_DOWN); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/emperorsday/yoda_fountain.java b/sku.0/sys.server/compiled/game/script/event/emperorsday/yoda_fountain.java deleted file mode 100644 index db584986d..000000000 --- a/sku.0/sys.server/compiled/game/script/event/emperorsday/yoda_fountain.java +++ /dev/null @@ -1,1652 +0,0 @@ -package script.event.emperorsday; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.chat; -import script.library.collection; -import script.library.create; -import script.library.factions; -import script.library.firework; -import script.library.holiday; -import script.library.performance; -import script.library.prose; -import script.library.static_item; -import script.library.trial; -import script.library.utils; - - -public class yoda_fountain extends script.base_script -{ - public yoda_fountain() - { - } - public static final String MUSIC_BATTLE_HEROES = "object/soundobject/soundobject_battle_heroes.iff"; - public static final String MUSIC_HAN_LEIA = "object/soundobject/soundobject_empire_day_romance_b.iff"; - - public static final String EMP_DAY = "event/emperors_day"; - - public static final string_id VENDOR_1 = new string_id(EMP_DAY, "reb_vendor_1"); - - public static final string_id LEIA_1 = new string_id(EMP_DAY, "leia_1"); - - public static final string_id VENDOR_2 = new string_id(EMP_DAY, "reb_vendor_2"); - - public static final string_id LEIA_2 = new string_id(EMP_DAY, "leia_2"); - - public static final string_id LEIA_3 = new string_id(EMP_DAY, "leia_3"); - - public static final string_id LEIA_4 = new string_id(EMP_DAY, "leia_4"); - - public static final string_id LEIA_5 = new string_id(EMP_DAY, "leia_5"); - - public static final string_id LEIA_6 = new string_id(EMP_DAY, "leia_6_string"); - - public static final string_id LEIA_6_ALT = new string_id(EMP_DAY, "leia_6_alt"); - - public static final string_id VENDOR_3 = new string_id(EMP_DAY, "reb_vendor_3_string"); - - public static final string_id LEIA_7 = new string_id(EMP_DAY, "leia_7"); - - public static final string_id LEIA_ANNOYED = new string_id(EMP_DAY, "leia_annoyed_string"); - public static final string_id LEIA_ANNOYED_SINGULAR = new string_id(EMP_DAY, "leia_annoyed_string_singular"); - public static final string_id LEIA_ANNOYED_PLURAL = new string_id(EMP_DAY, "leia_annoyed_string_plural"); - - public static final string_id VENDOR_REPLY_ANNOYED = new string_id(EMP_DAY, "reb_vendor_annoyed"); - - public static final string_id LEIA_ANNOYED_2 = new string_id(EMP_DAY, "leia_annoyed_2"); - public static final string_id LEIA_ANNOYED_2_SINGULAR = new string_id(EMP_DAY, "leia_annoyed_2_string_singular"); - public static final string_id LEIA_ANNOYED_2_PLURAL = new string_id(EMP_DAY, "leia_annoyed_2_string_plural"); - - public static final string_id VENDOR_REPLY_ANNOYED_2 = new string_id(EMP_DAY, "reb_vendor_annoyed_2"); - - public static final string_id HAN_BYE = new string_id(EMP_DAY, "han_bye"); - - public static final string_id HAN_ANGRY = new string_id(EMP_DAY, "han_angry"); - - public static final string_id HAN_HAPPY = new string_id(EMP_DAY, "han_happy"); - - public static final string_id TREE_USE = new string_id(EMP_DAY, "yoda_fountain_use"); - public static final string_id NOT_OLD_ENOUGH = new string_id(EMP_DAY, "rebel_not_old_enough"); - public static final string_id GIFT_GRANTED = new string_id(EMP_DAY, "gift_granted_rebel"); - public static final string_id WINNER_HELP = new string_id(EMP_DAY, "winner_help_rebel"); - - - public int OnInitialize(obj_id self) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "yoda_fountain.OnInitialize: Fountain is initializing."); - - if (!utils.hasScriptVar(self, "musicObject")) - { - location soundLoc = getLocation(self); - obj_id soundObject = createObject(MUSIC_HAN_LEIA, soundLoc); - - utils.setScriptVar(self, "musicObject", soundObject); - } - else if (utils.hasScriptVar(self, "musicObject")) - { - obj_id oldSoundObject = utils.getObjIdScriptVar(self, "musicObject"); - - if ((isIdValid(oldSoundObject)) && exists(oldSoundObject)) - { - destroyObject(oldSoundObject); - } - - location soundLoc = getLocation(self); - obj_id soundObject = createObject(MUSIC_HAN_LEIA, soundLoc); - - utils.setScriptVar(self, "musicObject", soundObject); - } - - CustomerServiceLog("holidayEvent", "yoda_fountain.OnInitialize: Preparing Parade."); - messageTo(self, "prepareParade", null, 10.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (utils.hasScriptVar(self, "paradeRunning")) - { - names[idx] = "next_ceremony"; - attribs[idx] = "Now"; - idx++; - } - else - { - int nextCeremony = getIntObjVar(self, "ceremonyTime"); - if (nextCeremony <= 0) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "next_ceremony"; - attribs[idx] = getCalendarTimeStringLocal(nextCeremony); - idx++; - - names[idx] = "count_down"; - attribs[idx] = utils.formatTimeVerbose(nextCeremony - getCalendarTime()); - idx++; - } - - String statusString = holiday.getEmpireDayEligibility(player, holiday.REBEL_PLAYER); - if (statusString != null || !statusString.equals("")) - { - names[idx] = "remembrance_day_player_status"; - attribs[idx] = statusString; - idx++; - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isIdValid(player) || ai_lib.isInCombat(player) || isIncapacitated(player) || isDead(player)) - { - return SCRIPT_CONTINUE; - } - - if (!factions.isRebel(player)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.currentYearObjVar())) - { - mi.addRootMenu(menu_info_types.ITEM_USE, TREE_USE); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || ai_lib.isInCombat(player) || isIncapacitated(player) || isDead(player)) - { - return SCRIPT_CONTINUE; - } - - if (!factions.isRebel(player)) - { - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if ((getCurrentBirthDate() - getPlayerBirthDate(player)) < 10) - { - sendSystemMessage(player, NOT_OLD_ENOUGH); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, holiday.currentYearObjVar())) - { - holiday.grantEmpireDayGift(player, holiday.REBEL_PLAYER); - } - - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - - obj_id oldSoundObject = utils.getObjIdScriptVar(self, "musicObject"); - - if ((isIdValid(oldSoundObject)) && exists(oldSoundObject)) - { - destroyObject(oldSoundObject); - } - - obj_id falcon = utils.getObjIdScriptVar(self, "falcon"); - - if ((isIdValid(falcon)) && exists(falcon)) - { - messageTo(falcon, "takeOff", null, 20.0f, false); - utils.removeScriptVar(self, "falcon"); - } - - if (utils.hasScriptVar(self, "leia")) - { - Vector npc = utils.getResizeableObjIdArrayScriptVar(self, "leia"); - for (int i=0; i 1) - { - pp = prose.getPackage(LEIA_ANNOYED_PLURAL); - } - prose.setTO (pp, waitingOnList); - chat.chat(leia, ((obj_id)(miaList.get(0))), pp); - - setObjVar(leia, "miaList", miaList); - setObjVar(leia, "waitingOnList", waitingOnList); - messageTo(self, "vendorReplyAnnoyed", null, 10.0f, false); - return SCRIPT_CONTINUE; - } - - - public int vendorReplyAnnoyed(obj_id self, dictionary params) throws InterruptedException - { - obj_id vendor = getObjIdObjVar(self, holiday.SPAWNER_PREFIX_OBJVAR+"vendor"); - if (!isIdValid(vendor) || !exists(vendor)) - { - return SCRIPT_CONTINUE; - } - - doAnimationAction(vendor, "nervous"); - chat.chat(vendor, VENDOR_REPLY_ANNOYED); - return SCRIPT_CONTINUE; - } - - - public int waitingDone(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "yoda_fountain.waitingDone: messageHandler Initialized."); - if (params == null || params.equals("")) - { - CustomerServiceLog("holidayEvent", "yoda_fountain.waitingDone: There were no params passed to the vendor3 message handler."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("winnerList")) - { - CustomerServiceLog("holidayEvent", "yoda_fountain.waitingDone: There was no winnerlist key passed in the params."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("listOfWinners")) - { - CustomerServiceLog("holidayEvent", "yoda_fountain.waitingDone: There was no listOfWinners key passed in the params."); - return SCRIPT_CONTINUE; - } - - obj_id leia = getObjIdObjVar(self, holiday.SPAWNER_PREFIX_OBJVAR+"leia"); - if (!isIdValid(leia) || !exists(leia)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(leia, "alreadyLeaving")) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(leia, "readyForBadge")) - { - CustomerServiceLog("holidayEvent", "emperor_statue.waitingDone: Leia has given out the badges already. No need to continue."); - messageTo(self, "leiaLeaving", null, 1, false); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(leia, "miaList")) - { - CustomerServiceLog("holidayEvent", "emperor_statue.waitingDone: Leia did not receive the MIA list. No need to continue."); - messageTo(self, "leiaLeaving", null, 1, false); - return SCRIPT_CONTINUE; - } - - obj_id[] oldMiaList = getObjIdArrayObjVar(leia, "miaList"); - if (oldMiaList == null || oldMiaList.length <= 0) - { - CustomerServiceLog("holidayEvent", "emperor_statue.waitingDone: Leia had an old MIA player list but it was invalid or corrupt. Leia is leaving as a result."); - messageTo(self, "leiaLeaving", null, 1, false); - return SCRIPT_CONTINUE; - } - - obj_var_list allMissingPlayers = getObjVarList(leia, "readyForBadge"); - if (allMissingPlayers == null) - { - CustomerServiceLog("holidayEvent", "emperor_statue.waitingDone: Leia was about to talk smack about 1 or more players not bowing but none of the players are actually missing."); - messageTo(self, "leiaLeaving", null, 1, false); - return SCRIPT_CONTINUE; - } - - int latestMiaListLen = allMissingPlayers.getNumItems(); - if (latestMiaListLen != oldMiaList.length) - { - Vector lastestMiaList = new Vector(); - lastestMiaList.setSize(0); - for (int i = 0; i < latestMiaListLen; i++) - { - testAbortScript(); - obj_var playerPlace = allMissingPlayers.getObjVar(i); - utils.addElement(lastestMiaList, playerPlace.getObjIdData()); - } - - if (lastestMiaList.size() <= 0) - { - CustomerServiceLog("holidayEvent", "emperor_statue.waitingDone: We tried to get a list of missing players but failed. Sending Leia to Falcon."); - messageTo(self, "leiaLeaving", null, 1, false); - return SCRIPT_CONTINUE; - } - - String waitingOnList = ""; - if (lastestMiaList.size() == 1) - { - CustomerServiceLog("holidayEvent", "emperor_statue.waitingDone: The list length for MIA players is only one player: "+((obj_id)(lastestMiaList.get(0)))); - waitingOnList = getFirstName(((obj_id)(lastestMiaList.get(0)))); - } - else - { - CustomerServiceLog("holidayEvent", "emperor_statue.waitingDone: The list length for MIA players is: "+lastestMiaList.size()); - for (int i = 0; i < lastestMiaList.size(); i++) - { - testAbortScript(); - if (i == 0) - { - waitingOnList += getFirstName(((obj_id)(lastestMiaList.get(i)))); - } - else if (i == (lastestMiaList.size()-1)) - { - waitingOnList += " and "+getFirstName(((obj_id)(lastestMiaList.get(i)))); - } - else - { - waitingOnList += ", "+getFirstName(((obj_id)(lastestMiaList.get(i)))); - } - - utils.removeScriptVar(((obj_id)(lastestMiaList.get(i))), "emperorsDayBadge"); - } - } - - prose_package pp = prose.getPackage(LEIA_ANNOYED_2_SINGULAR); - if (lastestMiaList.size() > 1) - { - pp = prose.getPackage(LEIA_ANNOYED_2_PLURAL); - } - prose.setTO (pp, waitingOnList); - chat.chat(leia, ((obj_id)(lastestMiaList.get(0))), pp); - } - else - { - String waitingOnList = getStringObjVar(leia, "waitingOnList"); - prose_package pp = prose.getPackage(LEIA_ANNOYED_2_SINGULAR); - if (oldMiaList.length > 1) - { - pp = prose.getPackage(LEIA_ANNOYED_2_PLURAL); - } - prose.setTO (pp, waitingOnList); - chat.chat(leia, oldMiaList[0], pp); - - for (int i = 0; i < oldMiaList.length; i++) - { - testAbortScript(); - if (isIdValid(oldMiaList[i]) && exists(oldMiaList[i])) - { - utils.removeScriptVar(oldMiaList[i], "emperorsDayBadge"); - } - } - } - messageTo(self, "vendorReplyWaiting", null, 10.0f, false); - return SCRIPT_CONTINUE; - } - - - public int vendorReplyWaiting(obj_id self, dictionary params) throws InterruptedException - { - obj_id vendor = getObjIdObjVar(self, holiday.SPAWNER_PREFIX_OBJVAR+"vendor"); - if (!isIdValid(vendor) || !exists(vendor)) - { - return SCRIPT_CONTINUE; - } - - doAnimationAction(vendor, "apologize"); - chat.chat(vendor, VENDOR_REPLY_ANNOYED_2); - messageTo(self, "leiaLeaving", null, 10.0f, false); - return SCRIPT_CONTINUE; - } - - - public int launchRandomFirework(obj_id self, dictionary params) throws InterruptedException - { - location statue = getLocation(self); - location here = (location)statue.clone(); - here.z = statue.z-30; - - location there = utils.getRandomLocationInRing(here, 0, 10); - - int tableLength = dataTableGetNumRows(firework.TBL_FX); - int roll = rand(1, tableLength); - String template = dataTableGetString(firework.TBL_FX, roll, "template"); - - obj_id effect = create.object(template, there); - if (isIdValid(effect)) - { - attachScript(effect, firework.SCRIPT_FIREWORK_CLEANUP); - } - - return SCRIPT_CONTINUE; - } - - - public int leiaLeaving(obj_id self, dictionary params) throws InterruptedException - { - - if (utils.hasScriptVar(self, "soldier")) - { - Vector npc = utils.getResizeableObjIdArrayScriptVar(self, "soldier"); - for (int i=0; i imp_r) - { - setObjVar(self, "event.gcwraids.cheerleader_type", 1); - } - else - { - setObjVar(self, "event.gcwraids.cheerleader_type", 0); - } - - location here = getLocation(self); - String myCity = locations.getGuardSpawnerRegionName(here); - - if (myCity.equals("@tatooine_region_names:bestine")) - { - setObjVar(self, "event.gcwraids.cheerleader_type", 0); - } - - if (myCity.equals("@tatooine_region_names:anchorhead")) - { - setObjVar(self, "event.gcwraids.cheerleader_type", 1); - } - - messageTo(self, "createShuttle", null, 1, false); - removeObjVar(self, "auto_invasion.next_invasion_time"); - - return SCRIPT_CONTINUE; - } - - - public int createShuttle(obj_id self, dictionary params) throws InterruptedException - { - int type = getIntObjVar(self, "event.gcwraids.cheerleader_type"); - location here = getLocation(self); - obj_id shuttle = create.object(SHUTTLETYPE[type], here); - - setObjVar(self, "event.gcwraids.shuttle", shuttle); - - setYaw(shuttle, 178); - detachScript(shuttle, "ai.ai"); - detachScript(shuttle, "ai.creature_combat"); - detachScript(shuttle, "skeleton.humanoid"); - detachScript(shuttle, "systems.combat.combat_actions"); - detachScript(shuttle, "systems.combat.credit_for_kills"); - stop(shuttle); - - if (type == 1) - { - setPosture(shuttle, POSTURE_PRONE); - } - - messageTo(self, "landShuttle", null, 6, false); - - obj_id[] objPlayers = getPlayerCreaturesInRange(self, 256.0f); - - if (objPlayers != null && objPlayers.length > 0) - { - for (int i = 0; i < objPlayers.length; i++) - { - testAbortScript(); - sendSystemMessage(objPlayers[i], new string_id(STF_FILE, "areabroadcast_"+ type) ); - } - } - - return SCRIPT_CONTINUE; - } - - - public int landShuttle(obj_id self, dictionary params) throws InterruptedException - { - obj_id shuttle = getObjIdObjVar(self, "event.gcwraids.shuttle"); - int type = getIntObjVar(self, "event.gcwraids.cheerleader_type"); - - if (type == 1) - { - queueCommand(shuttle, (-1465754503), self, "", COMMAND_PRIORITY_FRONT); - setPosture(shuttle, POSTURE_UPRIGHT); - } - - if (type == 0) - { - queueCommand(shuttle, (-1114832209), self, "", COMMAND_PRIORITY_FRONT); - setPosture(shuttle, POSTURE_PRONE); - } - - messageTo(self, "spawnEscortsAndCeleb", null, 30, false); - - return SCRIPT_CONTINUE; - } - - - public int spawnEscortsAndCeleb(obj_id self, dictionary params) throws InterruptedException - { - int type = getIntObjVar(self, "event.gcwraids.cheerleader_type"); - location here = getLocation(self); - location celebSpot = (location)here.clone(); - celebSpot.z -= 12; - - obj_id celeb = create.object(CELEB[type], celebSpot); - setObjVar(celeb, "event.gcwraids.type", type); - ai_lib.setDefaultCalmBehavior(celeb, ai_lib.BEHAVIOR_SENTINEL ); - stop(celeb); - setInvulnerable(celeb, true); - attachScript(celeb, "event.gcwraids.celeb_respect"); - setObjVar(self, "event.gcwraids.celeb", celeb); - - if (type == 0) - { - detachScript(celeb, "npc.celebrity.darth_vader"); - detachScript(celeb, "theme_park.imperial.quest_convo"); - detachScript(celeb, "npc.converse.npc_converse_menu"); - } - - if (type == 1) - { - detachScript(celeb, "npc.celebrity.luke"); - detachScript(celeb, "theme_park.rebel.quest_convo"); - detachScript(celeb, "npc.converse.npc_converse_menu"); - } - - clearCondition(celeb, CONDITION_CONVERSABLE); - - obj_id[] objPlayers = getPlayerCreaturesInRange(self, 100.0f); - - if (objPlayers != null && objPlayers.length > 0) - { - for (int i = 0; i < objPlayers.length; i++) - { - testAbortScript(); - if (type == 0) - { - playMusic(objPlayers[i], "sound/music_emperor_theme_stereo.snd"); - } - - if (type == 1) - { - playMusic(objPlayers[i], "sound/music_ambience_desert_stereo.snd"); - } - } - } - - for (int i = 0; i < 12; i++) - { - testAbortScript(); - obj_id escort = create.object(ESCORT[type], here); - setObjVar(self, "event.gcwraids.escort"+ i, escort); - setObjVar(escort, "event.gcwraids.myId", i); - setObjVar(escort, "event.gcwraids.mom", self); - attachScript(escort, "event.gcwraids.cheerleader_escort"); - ai_lib.setDefaultCalmBehavior(celeb, ai_lib.BEHAVIOR_WANDER); - } - - messageTo(self, "walkForwardCeleb", null, 3, false); - - return SCRIPT_CONTINUE; - } - - - public int walkForwardCeleb(obj_id self, dictionary params) throws InterruptedException - { - obj_id celeb = getObjIdObjVar(self, "event.gcwraids.celeb"); - location there = getLocation(self); - there.z += -25; - - String celebType = getCreatureName(celeb); - if (celebType.equals("darth_vader")) - { - ai_lib.aiPathTo(celeb, there); - setMovementWalk(celeb); - } - else - { - ai_lib.aiPathTo(celeb, there); - setMovementRun(celeb); - } - - int dialogueSet = rand(1, NUMSPEECHES); - utils.setScriptVar(self, "dialogue_set", dialogueSet); - utils.setScriptVar(self, "dialogue_step", 0); - messageTo(self, "engageInJingoisticRhetoric", null, 8, false); - - return SCRIPT_CONTINUE; - } - - - public int engageInJingoisticRhetoric(obj_id self, dictionary params) throws InterruptedException - { - obj_id celeb = getObjIdObjVar(self, "event.gcwraids.celeb"); - int dialogueStep = utils.getIntScriptVar(self, "dialogue_step"); - int type = getIntObjVar(self, "event.gcwraids.cheerleader_type"); - int dialogueSet = utils.getIntScriptVar(self, "dialogue_set"); - - if (dialogueStep > 10) - { - messageTo(self, "celebStartGivingQuests", null, 10, false); - return SCRIPT_CONTINUE; - } - - string_id myLine = new string_id(STF_FILE, "cheerleader_"+ type + "_"+ dialogueSet + "_"+ dialogueStep); - - chat.chat(celeb, chat.CHAT_SAY, chat.MOOD_NONE, myLine); - - if (dialogueStep == 3 && type == 0) - { - doAnimationAction(celeb, "pound_fist_palm"); - } - - if (dialogueStep == 5 && type == 0) - { - doAnimationAction(celeb, "force_push"); - } - - if (dialogueStep == 7 && type == 0) - { - doAnimationAction(celeb, "force_choke"); - } - - if (dialogueStep == 10 && type == 0) - { - doAnimationAction(celeb, "point_forward"); - } - - if (dialogueStep == 3 && type == 1) - { - doAnimationAction(celeb, "point_right"); - } - - if (dialogueStep == 5 && type == 1) - { - doAnimationAction(celeb, "pound_fist_palm"); - } - - if (dialogueStep == 7 && type == 1) - { - doAnimationAction(celeb, "nod_head_once"); - } - - if (dialogueStep == 10 && type == 1) - { - doAnimationAction(celeb, "point_forward"); - } - - dialogueStep++; - utils.setScriptVar(self, "dialogue_step", dialogueStep); - - messageTo(self, "engageInJingoisticRhetoric", null, 10, false); - - return SCRIPT_CONTINUE; - } - - - public int celebStartGivingQuests(obj_id self, dictionary params) throws InterruptedException - { - int type = getIntObjVar(self, "event.gcwraids.cheerleader_type"); - obj_id celeb = getObjIdObjVar(self, "event.gcwraids.celeb"); - setCondition(celeb, CONDITION_CONVERSABLE); - - if (type == 0) - { - attachScript(celeb, "conversation.event_cheerleader_vader"); - } - - if (type == 1) - { - attachScript(celeb, "conversation.event_cheerleader_luke"); - } - - messageTo(self, "everyoneWalkBack", null, MY_VISIT_TIME, false); - - return SCRIPT_CONTINUE; - } - - - public int everyoneWalkBack(obj_id self, dictionary params) throws InterruptedException - { - location here = getLocation(self); - obj_id celeb = getObjIdObjVar(self, "event.gcwraids.celeb"); - setObjVar(self, "auto_invasion.invasion_active", 0); - - if (isIdValid(celeb)) - { - String celebType = getCreatureName(celeb); - if (celebType.equals("darth_vader")) - { - ai_lib.aiPathTo(celeb, here); - setMovementWalk(celeb); - } - else - { - ai_lib.aiPathTo(celeb, here); - setMovementRun(celeb); - } - } - - for (int i = 0; i < 12; i++) - { - testAbortScript(); - obj_id escort = getObjIdObjVar(self, "event.gcwraids.escort"+ i); - - if (isIdValid(escort)) - { - ai_lib.aiPathTo(escort, here); - } - } - - messageTo(self, "endEvent", null, 10, false); - - return SCRIPT_CONTINUE; - } - - - public int endEvent(obj_id self, dictionary params) throws InterruptedException - { - int type = getIntObjVar(self, "event.gcwraids.cheerleader_type"); - obj_id shuttle = getObjIdObjVar(self, "event.gcwraids.shuttle"); - obj_id celeb = getObjIdObjVar(self, "event.gcwraids.celeb"); - destroyObject(celeb); - - for (int i = 0; i < 12; i++) - { - testAbortScript(); - obj_id escort = getObjIdObjVar(self, "event.gcwraids.escort"+ i); - - if (isIdValid(escort)) - { - destroyObject(escort); - } - } - - if (type > 0) - { - queueCommand(shuttle, (-1114832209), self, "", COMMAND_PRIORITY_FRONT); - setPosture(shuttle, POSTURE_PRONE); - } - - if (type == 0) - { - queueCommand(shuttle, (-1465754503), self, "", COMMAND_PRIORITY_FRONT); - setPosture(shuttle, POSTURE_UPRIGHT); - } - - messageTo(self, "cleanupShuttleAndStuff", null, 20, false); - - return SCRIPT_CONTINUE; - } - - - public int cleanupShuttleAndStuff(obj_id self, dictionary params) throws InterruptedException - { - int type = getIntObjVar(self, "event.gcwraids.cheerleader_type"); - obj_id shuttle = getObjIdObjVar(self, "event.gcwraids.shuttle"); - destroyObject(shuttle); - removeObjVar(self, "event.gcwraids.celeb"); - removeObjVar(self, "event.gcwraids.shuttle"); - - for (int i = 0; i < 12; i++) - { - testAbortScript(); - removeObjVar(self, "event.gcwraids.escort"+ i); - } - - obj_id[] objPlayers = getPlayerCreaturesInRange(self, 256.0f); - - if (objPlayers != null && objPlayers.length > 0) - { - for (int i = 0; i < objPlayers.length; i++) - { - testAbortScript(); - sendSystemMessage(objPlayers[i], new string_id(STF_FILE, "closingbroadcast_"+ type) ); - } - } - - int referenceNumber = getIntObjVar(self, "auto_invasion.reference_number"); - float minInvasionTime = dataTableGetFloat(DATATABLE, referenceNumber, "MINTIME"); - float timeChunkSize = dataTableGetFloat(DATATABLE, referenceNumber, "TIMECHUNKSIZE"); - int numTimeChunk = dataTableGetInt(DATATABLE, referenceNumber, "NUMTIMECHUNK"); - float rightNow = getGameTime(); - - if (!hasObjVar(self, "auto_invasion.next_invasion_time")) - { - float nextInvasionTime = ( rand(1, numTimeChunk) * timeChunkSize ) + minInvasionTime + rightNow; - setObjVar(self, "auto_invasion.next_invasion_time", nextInvasionTime); - } - - setObjVar(self, "auto_invasion.testing_multiplier", 1); - messageTo(self, "invasionTimerPing", null, 2700, false); - - return SCRIPT_CONTINUE; - } - - - public int escortDied(obj_id self, dictionary params) throws InterruptedException - { - int invasionActive = getIntObjVar(self, "auto_invasion.invasion_active"); - - if (invasionActive != 1) - { - return SCRIPT_CONTINUE; - } - - location here = getLocation(self); - int type = getIntObjVar(self, "event.gcwraids.cheerleader_type"); - obj_id deadEscort = params.getObjId("escort"); - int myId = params.getInt("myId"); - obj_id celeb = getObjIdObjVar(self, "event.gcwraids.celeb"); - obj_id verifyEscort = getObjIdObjVar(self, "event.gcwraids.escort"+ myId); - - if (deadEscort == verifyEscort) - { - removeObjVar(self, "event.gcwraids.escort"+ myId); - obj_id escort = create.object(ESCORT[type], here); - setObjVar(self, "event.gcwraids.escort"+ myId, escort); - setObjVar(escort, "event.gcwraids.myId", myId); - setObjVar(escort, "event.gcwraids.mom", self); - attachScript(escort, "event.gcwraids.cheerleader_escort"); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/holiday_controller.java b/sku.0/sys.server/compiled/game/script/event/holiday_controller.java deleted file mode 100644 index 02142b2b4..000000000 --- a/sku.0/sys.server/compiled/game/script/event/holiday_controller.java +++ /dev/null @@ -1,471 +0,0 @@ -package script.event; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.holiday; - - -public class holiday_controller extends script.base_script -{ - public holiday_controller() - { - } - - public int OnInitialize(obj_id self) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "holiday_controller.OnInitialize planet initialized, holiday controller called."); - - messageTo(self, "halloweenServerStart", null, 600.0f, false); - - messageTo(self, "lifedayServerStart", null, 610.0f, false); - - messageTo(self, "lovedayServerStart", null, 615.0f, false); - - CustomerServiceLog("holidayEvent", "holiday_controller.OnInitialize seconds to start empireday: "+holiday.EMPIRE_DAY_EVENT_START_DELAY); - - messageTo(self, "empiredayServerStart", null, holiday.EMPIRE_DAY_EVENT_START_DELAY, false); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - messageTo(self, "halloweenServerStart", null, 720.0f, false); - - messageTo(self, "lifedayServerStart", null, 730.0f, false); - - messageTo(self, "lovedayServerStart", null, 735.0f, false); - - messageTo(self, "empiredayServerStart", null, (holiday.EMPIRE_DAY_EVENT_START_DELAY + 100), false); - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (!isGod(player)) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String halloweenRunning = getConfigSetting("GameServer", "halloween"); - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - String lovedayRunning = getConfigSetting("GameServer", "loveday"); - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - - if (halloweenRunning != null && (halloweenRunning.equals("true") || halloweenRunning.equals("1"))) - { - names[idx] = "holiday_event"; - attribs[idx] = "Halloween Event Running = True"; - idx++; - } - else - { - names[idx] = "holiday_event"; - attribs[idx] = "Halloween Event Running = False"; - idx++; - } - if (lifedayRunning != null && (lifedayRunning.equals("true") || lifedayRunning.equals("1"))) - { - names[idx] = "holiday_event"; - attribs[idx] = "Life Day Event Running = True"; - idx++; - } - else - { - names[idx] = "holiday_event"; - attribs[idx] = "Life Day Event Running = False"; - idx++; - } - if (lifedayRunning != null && (lovedayRunning.equals("true") || lovedayRunning.equals("1"))) - { - names[idx] = "holiday_event"; - attribs[idx] = "Love Day Event Running = True"; - idx++; - } - else - { - names[idx] = "holiday_event"; - attribs[idx] = "Love Day Event Running = False"; - idx++; - } - if (empiredayRunning != null && (empiredayRunning.equals("true") || empiredayRunning.equals("1"))) - { - names[idx] = "holiday_event"; - attribs[idx] = "Empire Day Event Running = True"; - idx++; - } - else - { - names[idx] = "holiday_event"; - attribs[idx] = "Empire Day Event Running = False"; - idx++; - } - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException - { - if (!isGod(speaker)) - { - return SCRIPT_CONTINUE; - } - - String halloweenString = getCurrentUniverseWideEvents(); - int halloween = halloweenString.indexOf("halloween"); - String halloweenRunning = getConfigSetting("GameServer", "halloween"); - if (text.equals("halloweenStart")) - { - startHolidayEvent(speaker, "halloween", halloweenRunning, halloween); - return SCRIPT_OVERRIDE; - } - - if (text.equals("halloweenStop")) - { - stopHolidayEvent(speaker, "halloween", halloweenRunning, halloween); - return SCRIPT_OVERRIDE; - } - - if (text.equals("halloweenStartForReals")) - { - startHolidayEventForReals(speaker, "halloween", halloweenRunning); - return SCRIPT_OVERRIDE; - } - - if (text.equals("halloweenStopForReals")) - { - stopHolidayEventForReals(speaker, "halloween"); - return SCRIPT_OVERRIDE; - } - - String lifedayString = getCurrentUniverseWideEvents(); - int lifeday = lifedayString.indexOf("lifeday"); - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - if (text.equals("lifedayStart")) - { - startHolidayEvent(speaker, "lifeday", lifedayRunning, lifeday); - return SCRIPT_OVERRIDE; - } - - if (text.equals("lifedayStop")) - { - stopHolidayEvent(speaker, "lifeday", lifedayRunning, lifeday); - return SCRIPT_OVERRIDE; - } - - if (text.equals("lifedayStartForReals")) - { - startHolidayEventForReals(speaker, "lifeday", lifedayRunning); - return SCRIPT_OVERRIDE; - } - - if (text.equals("lifedayStopForReals")) - { - stopHolidayEventForReals(speaker, "lifeday"); - return SCRIPT_OVERRIDE; - } - - String lovedayString = getCurrentUniverseWideEvents(); - int loveday = lifedayString.indexOf("loveday"); - String lovedayRunning = getConfigSetting("GameServer", "loveday"); - if (text.equals("lovedayStart")) - { - startHolidayEvent(speaker, "loveday", lovedayRunning, loveday); - return SCRIPT_OVERRIDE; - } - - if (text.equals("lovedayStop")) - { - stopHolidayEvent(speaker, "loveday", lovedayRunning, loveday); - return SCRIPT_OVERRIDE; - } - - if (text.equals("lovedayStartForReals")) - { - startHolidayEventForReals(speaker, "loveday", lovedayRunning); - return SCRIPT_OVERRIDE; - } - - if (text.equals("lovedayStopForReals")) - { - stopHolidayEventForReals(speaker, "loveday"); - return SCRIPT_OVERRIDE; - } - - String empiredayString = getCurrentUniverseWideEvents(); - int empireday = empiredayString.indexOf("empireday_ceremony"); - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (text.equals("empiredayStart")) - { - startHolidayEvent(speaker, "empireday_ceremony", empiredayRunning, empireday); - return SCRIPT_OVERRIDE; - } - - if (text.equals("empiredayStop")) - { - stopHolidayEvent(speaker, "empireday_ceremony", empiredayRunning, empireday); - return SCRIPT_OVERRIDE; - } - - if (text.equals("empiredayStartForReals")) - { - startHolidayEventForReals(speaker, "empireday_ceremony", empiredayRunning); - return SCRIPT_OVERRIDE; - } - - if (text.equals("empiredayStopForReals")) - { - stopHolidayEventForReals(speaker, "empireday_ceremony"); - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public void startHolidayEvent(obj_id speaker, String holidayName, String holidayRunning, int holidayStatus) throws InterruptedException - { - if (holidayRunning == null) - { - sendSystemMessageTestingOnly(speaker, "Server config is not marked as "+holidayName+ " running"); - return; - } - - if (holidayRunning.equals("true") || holidayRunning.equals("1")) - { - if (holidayStatus > -1) - { - sendSystemMessageTestingOnly(speaker, "Server says that "+holidayName+ " is already running. If you are sure that it's not, say "+holidayName+"StartForReals"); - } - - if (holidayStatus < 0) - { - sendSystemMessageTestingOnly(speaker, holidayName + " started."); - startUniverseWideEvent(holidayName); - } - return; - } - - return; - } - - - public void startHolidayEventForReals(obj_id speaker, String holidayName, String holidayRunning) throws InterruptedException - { - if (holidayRunning == null) - { - sendSystemMessageTestingOnly(speaker, "Server config is not marked as "+holidayName+" running"); - return; - } - - if (holidayRunning.equals("true") || holidayRunning.equals("1")) - { - sendSystemMessageTestingOnly(speaker, holidayName+" started."); - startUniverseWideEvent(holidayName); - return; - } - return; - } - - - public void stopHolidayEvent(obj_id speaker, String holidayName, String holidayRunning, int holidayStatus) throws InterruptedException - { - if (holidayRunning.equals("true") || holidayRunning.equals("1")) - { - sendSystemMessageTestingOnly(speaker, "Server config is marked as "+holidayName+" running. If you are sure that it should not be running anyway, say "+holidayName+"StopForReals"); - return; - } - - if (holidayRunning == null) - { - if (holidayStatus < 0) - { - sendSystemMessageTestingOnly(speaker, "Server says that "+holidayName+" is already stopped. If you are sure that it's not, say "+holidayName+"StartForReal"); - } - - if (holidayStatus > -1) - { - sendSystemMessageTestingOnly(speaker, holidayName+" stopped."); - stopUniverseWideEvent(holidayName); - } - return; - } - - return; - } - - - public void stopHolidayEventForReals(obj_id speaker, String holidayName) throws InterruptedException - { - sendSystemMessageTestingOnly(speaker, holidayName+" stopped."); - stopUniverseWideEvent(holidayName); - return; - } - - - public int halloweenServerStart(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "holiday_controller.halloweenServerStart Halloween event handler called."); - - String halloweenString = getCurrentUniverseWideEvents(); - int halloween = halloweenString.indexOf("halloween"); - String halloweenRunning = getConfigSetting("GameServer", "halloween"); - - CustomerServiceLog("holidayEvent", "holiday_controller.halloweenServerStart halloweenString: "+halloweenString+" halloween: "+halloween+" halloweenRunning: "+halloweenRunning); - - if (halloweenRunning == null) - { - CustomerServiceLog("holidayEvent", "holiday_controller.halloweenServerStart Halloween event is either not running or not in the server configs."); - - if (halloween > -1) - { - stopUniverseWideEvent("halloween"); - } - } - - else if (halloweenRunning.equals("true") || halloweenRunning.equals("1")) - { - if (halloween < 0) - { - if (!startUniverseWideEvent("halloween")) - { - CustomerServiceLog("holidayEvent", "holiday_controller.halloweenServerStart startUniverseWideEvent reports FAILURE to start universe wide event."); - } - else - { - CustomerServiceLog("holidayEvent", "holiday_controller.halloweenServerStart startUniverseWideEvent reports SUCCESS starting universe wide event."); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int lifedayServerStart(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "holiday_controller.lifedayServerStart Life Day event handler called."); - - String lifedayString = getCurrentUniverseWideEvents(); - int lifeday = lifedayString.indexOf("lifeday"); - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - CustomerServiceLog("holidayEvent", "holiday_controller.lifedayServerStart lifedayString: "+lifedayString+" lifeday: "+lifeday+" lifedayRunning: "+lifedayRunning); - - if (lifedayRunning == null) - { - CustomerServiceLog("holidayEvent", "holiday_controller.lifedayServerStart event is either not running or not in the server configs."); - - if (lifeday > -1) - { - stopUniverseWideEvent("lifeday"); - } - } - - else if (lifedayRunning.equals("true") || lifedayRunning.equals("1")) - { - if (lifeday < 0) - { - if (!startUniverseWideEvent("lifeday")) - { - CustomerServiceLog("holidayEvent", "holiday_controller.lifedayServerStart startUniverseWideEvent reports FAILURE to start universe wide event."); - } - else - { - CustomerServiceLog("holidayEvent", "holiday_controller.lifedayServerStart startUniverseWideEvent reports SUCCESS starting universe wide event."); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int lovedayServerStart(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "holiday_controller.lovedayServerStart Love Day event handler called."); - - String lovedayString = getCurrentUniverseWideEvents(); - int loveday = lovedayString.indexOf("loveday"); - String lovedayRunning = getConfigSetting("GameServer", "loveday"); - CustomerServiceLog("holidayEvent", "holiday_controller.lovedayServerStart lovedayString: "+lovedayString+" loveday: "+loveday+" lovedayRunning: "+lovedayRunning); - - if (lovedayRunning == null) - { - CustomerServiceLog("holidayEvent", "holiday_controller.lovedayServerStart event is either not running or not in the server configs."); - - if (loveday > -1) - { - stopUniverseWideEvent("loveday"); - } - } - - else if (lovedayRunning.equals("true") || lovedayRunning.equals("1")) - { - if (loveday < 0) - { - if (!startUniverseWideEvent("loveday")) - { - CustomerServiceLog("holidayEvent", "holiday_controller.lovedayServerStart startUniverseWideEvent reports FAILURE to start universe wide event."); - } - else - { - CustomerServiceLog("holidayEvent", "holiday_controller.lovedayServerStart startUniverseWideEvent reports SUCCESS starting universe wide event."); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int empiredayServerStart(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart Empire Day event handler called."); - String empiredayString = getCurrentUniverseWideEvents(); - int empireday = empiredayString.indexOf("empireday_ceremony"); - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart empiredayString: "+empiredayString+" empireday: "+empireday+" empiredayRunning: "+empiredayRunning); - - if (empiredayRunning == null) - { - CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart event is either not running or not in the server configs."); - if (empireday > -1) - { - stopUniverseWideEvent("empireday_ceremony"); - } - } - - else if (empiredayRunning.equals("true") || empiredayRunning.equals("1")) - { - CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart event is starting."); - - if (empireday < 0) - { - if (!startUniverseWideEvent("empireday_ceremony")) - { - CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart startUniverseWideEvent reports FAILURE to start universe wide event."); - } - else - { - CustomerServiceLog("holidayEvent", "holiday_controller.empiredayServerStart startUniverseWideEvent reports SUCCESS starting universe wide event."); - } - } - } - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/event/housepackup/sarlacc_furniture_terminal.java b/sku.0/sys.server/compiled/game/script/event/housepackup/sarlacc_furniture_terminal.java deleted file mode 100644 index d0b60ebdf..000000000 --- a/sku.0/sys.server/compiled/game/script/event/housepackup/sarlacc_furniture_terminal.java +++ /dev/null @@ -1,1234 +0,0 @@ -package script.event.housepackup; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.util.HashSet; -import script.library.collection; -import script.library.house_pet; -import script.library.prose; -import script.library.smuggler; -import script.library.static_item; -import script.library.sui; -import script.library.utils; - - -public class sarlacc_furniture_terminal extends script.base_script -{ - public sarlacc_furniture_terminal() - { - } - public static final boolean LOGGING_ON = true; - public static final String LOGGING_CATEGORY = "sarlacc"; - - public static final string_id SID_MENU_FEED = new string_id("sarlacc_minigame", "mnu_feed"); - public static final string_id SID_MENU_REWARD = new string_id("sarlacc_minigame", "mnu_reward"); - public static final string_id SID_SIFT_SARLACC_BOX = new string_id("sarlacc_minigame", "must_sift_sarlacc_box"); - public static final string_id SID_SARLACC_FED = new string_id("sarlacc_minigame", "sarlacc_fed"); - public static final string_id SID_FOUND_REWARD = new string_id("sarlacc_minigame", "sifted_reward"); - public static final string_id SID_SARLACC_NOTHING_FOUND = new string_id("sarlacc_minigame", "no_junk_inventory"); - public static final string_id SID_VERIFICATION_MSG = new string_id("sarlacc_minigame", "verify_consumption"); - public static final string_id SID_ITEM_NOT_FED = new string_id("sarlacc_minigame", "item_not_fed"); - public static final string_id SID_ITEM_NOT_BIOLINK_FED = new string_id("sarlacc_minigame", "item_not_biolink_fed"); - public static final string_id SID_ITEM_NOT_INVENTORY = new string_id("sarlacc_minigame", "item_not_inventory"); - public static final string_id SID_ITEM_EQUIPPED = new string_id("sarlacc_minigame", "item_not_equipped"); - public static final string_id SID_ITEM_NOT_VALID = new string_id("sarlacc_minigame", "item_not_valid"); - public static final string_id SID_OUT_OF_RANGE = new string_id("sarlacc_minigame", "out_of_range"); - public static final string_id SID_QUEST_ITEM = new string_id("sarlacc_minigame", "item_quest_item"); - - public static final String FEED_TITLE = "@sarlacc_minigame:edible_title"; - public static final String FEED_PROMPT = "@sarlacc_minigame:edible_prompt"; - public static final String BTN_SELL = "@sarlacc_minigame:btn_feed"; - - public static final String SOUND_BURP = "sound/sarlacc_burp.snd"; - public static final String SOUND_EAT = "sound/sarlacc_eating.snd"; - public static final String SOUND_SIFT = "sound/sarlacc_drawer_open.snd"; - public static final String SOUND_CUTE = "sound/sarlacc_cute.snd"; - public static final String SOUND_BREATHING = "sound/sarlacc_breathing.snd"; - - public static final String ANIMATON_GROWL = "vocalize"; - public static final String ANIMATON_FEED = "eat"; - - - public int OnDestroy(obj_id self) throws InterruptedException - { - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - house_pet.stopPlayingMusic(self); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - setUpFirstTime(self); - messageTo(self, "checkTriggerVolume", null, 2, false); - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (!isValidId(getOwner(self)) && utils.isNestedWithinAPlayer(self)) - { - house_pet.setObjectOwner(self); - return SCRIPT_CONTINUE; - } - - messageTo(self, "checkTriggerVolume", null, 2, false); - return SCRIPT_CONTINUE; - } - - - public int OnTransferred(obj_id self, obj_id sourceContainer, obj_id destContainer, obj_id transferer) throws InterruptedException - { - if (!isValidId(getOwner(self))) - { - house_pet.setObjectOwner(self); - } - - if (!house_pet.validateNpcPlacementInStructure(self)) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isInHouseCellSpace(self)) - { - return SCRIPT_CONTINUE; - } - if (utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (!isValidId(getOwner(self))) - { - house_pet.setObjectOwner(self); - } - - if (player != getOwner(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, house_pet.SARLACC_REWARD_AVAILABLE)) - { - mi.addRootMenu(menu_info_types.SERVER_MENU2, SID_MENU_REWARD); - return SCRIPT_CONTINUE; - } - - else if (getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE) >= house_pet.SARLACC_HUNGRY) - { - mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_MENU_FEED); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public boolean setUpFirstTime(obj_id self) throws InterruptedException - { - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return false; - } - - if (!isValidId(self) || !exists(self)) - { - return false; - } - - setObjVar(self, house_pet.SARLACC_CURRENT_PHASE, house_pet.SARLACC_STARVING); - setObjVar(self, house_pet.SARLACC_BORN, getCalendarTime()); - setObjVar(self, house_pet.SARLACC_PHASE_START, getCalendarTime()); - setObjVar(self, house_pet.SARLACC_FEEDING_ITERATION, 0); - - if (!utils.isNestedWithinAPlayer(self) && !hasObjVar(self, house_pet.CHILD_OBJ_ID)) - { - messageTo(self, "createSarlaccPet", null, 0, false); - } - - return true; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - if (utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (player != getOwner(self)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.SERVER_MENU1) - { - if (getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE) < house_pet.SARLACC_HUNGRY) - { - return SCRIPT_CONTINUE; - } - - getEdibleContents(player, self); - } - else if (item == menu_info_types.SERVER_MENU2) - { - - getPlayerReward(player, self); - } - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (hasObjVar(self, house_pet.SARLACC_CURRENT_PHASE)) - { - int currentStatus = getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE); - if (currentStatus < house_pet.SARLACC_FED || currentStatus > house_pet.SARLACC_DEATH) - { - blog("getSarlaccCollectionColumn currentStatus : "+currentStatus); - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "status"; - attribs[idx] = "@obj_attr_n:" + house_pet.SARLACC_PHASES[currentStatus]; - idx++; - - if (hasObjVar(self, house_pet.SARLACC_LAST_FED)) - { - int lastFed = getIntObjVar(self, house_pet.SARLACC_LAST_FED); - if (lastFed < 0) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "last_fed"; - attribs[idx] = getCalendarTimeStringLocal(lastFed); - idx++; - - int succesFeeds = getIntObjVar(self, house_pet.SARLACC_FEEDING_ITERATION); - if (succesFeeds > 0) - { - names[idx] = "times_fed"; - attribs[idx] = ""+succesFeeds; - idx++; - } - - names[idx] = "next_feed"; - if (currentStatus == 0) - { - attribs[idx] = getCalendarTimeStringLocal(lastFed + house_pet.getUpdateWeekly(self)); - } - else if (currentStatus == 1) - { - attribs[idx] = "Now"; - } - else - { - attribs[idx] = "Hopefully Soon"; - } - - idx++; - - names[idx] = "time_now"; - attribs[idx] = getCalendarTimeStringLocal(getCalendarTime()); - idx++; - } - else - { - - names[idx] = "last_fed"; - attribs[idx] = "Never"; - idx++; - - names[idx] = "next_feed"; - attribs[idx] = "Hopefully Soon"; - idx++; - } - } - - if (hasObjVar(self, house_pet.SARLACC_BORN)) - { - int birthDay = getIntObjVar(self, house_pet.SARLACC_BORN); - if (birthDay <= 0) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "born"; - attribs[idx] = getCalendarTimeStringLocal(birthDay); - idx++; - } - - if (isValidId(getOwner(self))) - { - obj_id owner = getOwner(self); - - names[idx] = "owner"; - attribs[idx] = getPlayerFullName(owner); - idx++; - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(breacher) || !isPlayer(breacher)) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(breacher, "breathe")) - { - if (utils.getObjIdScriptVar(breacher, "breathe") == self) - { - return SCRIPT_CONTINUE; - } - - } - if (breacher == getOwner(self)) - { - dictionary params = new dictionary(); - params.put("player", breacher); - messageTo(self, "playCute", params, 1, false); - messageTo(self, "growlAnimation", params, 0, false); - } - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(breacher) || !isPlayer(breacher)) - { - return SCRIPT_CONTINUE; - } - stopClientEffectObjByLabel(breacher, self, house_pet.PET_SOUND_LABEL); - - return SCRIPT_CONTINUE; - } - - - public int handleSarlaccEatSui(obj_id self, dictionary params) throws InterruptedException - { - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - blog("handleSarlaccEatSui - Init"); - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.hasPid(player, "confirm_sui")) - { - int pid = sui.getPid(player, "confirm_sui"); - forceCloseSUIPage(pid); - } - - int idx = sui.getListboxSelectedRow(params); - int bp = sui.getIntButtonPressed(params); - if (idx < 0) - { - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - if (bp == sui.BP_CANCEL) - { - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - else - { - - obj_id[] junkFood = utils.getObjIdBatchScriptVar(player, house_pet.EDIBLES_IDS); - - if ((junkFood == null) || (junkFood.length == 0)) - { - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - if (idx > junkFood.length - 1) - { - cleanupSui(player); - return SCRIPT_CONTINUE; - } - blog("verifySarlaccEatSui: Setting junk item script var: "+junkFood[idx]); - - utils.setScriptVar(player, "junkfood.junk_item", junkFood[idx]); - blog("verifySarlaccEatSui: ScriptVar: "+utils.getObjIdScriptVar(player, "junkfood.junk_item")); - int pid = sui.msgbox(self, player, utils.packStringId(SID_VERIFICATION_MSG), sui.YES_NO, "verifySarlaccEatSui"); - sui.setPid(player, pid, "confirm_sui"); - } - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - - public int verifySarlaccEatSui(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - blog("verifySarlaccEatSui: Init."); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - blog("verifySarlaccEatSui: Selected Cancel or No."); - return SCRIPT_CONTINUE; - } - - blog("verifySarlaccEatSui: Getting junk item from script var."); - if (!utils.hasScriptVar(player, "junkfood.junk_item")) - { - blog("verifySarlaccEatSui: No Junk item Found"); - cleanupSui(player); - return SCRIPT_CONTINUE; - } - obj_id junkFood = utils.getObjIdScriptVar(player, "junkfood.junk_item"); - blog("verifySarlaccEatSui: Junk item: "+junkFood); - - if (!isValidId(junkFood) || !exists(junkFood)) - { - blog("verifySarlaccEatSui: Junk item Invalid..bailing out"); - - sendSystemMessage(player, SID_ITEM_NOT_VALID); - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - blog("verifySarlaccEatSui: Junk Confirmed, eating."); - - if (!eatJunkItem(self, player, junkFood)) - { - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(player) + " OID: "+ player + ") FAILED TO FEED sarlacc: " +self+" item ("+ getName(junkFood) + " OID: "+ junkFood + ")."); - } - - cleanupSui(player); - return SCRIPT_CONTINUE; - } - - - public int growlAnimation(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - doAnimationAction(self, ANIMATON_GROWL); - return SCRIPT_CONTINUE; - } - - - public int playBurp(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - play2dNonLoopingSound(player, SOUND_BURP); - - return SCRIPT_CONTINUE; - } - - - public int playCute(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId("player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - play2dNonLoopingSound(player, SOUND_CUTE); - - return SCRIPT_CONTINUE; - } - - - public int checkTriggerVolume(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - if (!hasTriggerVolume(self, house_pet.PET_TRIG_VOLUME)) - { - float range = 2f; - createTriggerVolume(house_pet.PET_TRIG_VOLUME, range, true); - setObjVar(self, house_pet.MUSIC_RANGE, range); - } - - return SCRIPT_CONTINUE; - } - - - public int updateSarlaccPet(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - blog("updateSarlaccPet - RECEIVED MESSAGE TO - Current phase: "+getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE)+" time: "+ getCalendarTime()); - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, house_pet.SARLACC_CURRENT_PHASE)) - { - blog("updateSarlaccPet - no phase for sarlacc"); - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, house_pet.SARLACC_FEEDING_ITERATION)) - { - blog("updateSarlaccPet - no feeding iteration for sarlacc"); - return SCRIPT_CONTINUE; - } - - blog("updateSarlaccPet - Is in structure"); - - int currentGameTime = getCalendarTime(); - int updateWeek = house_pet.getUpdateWeekly(self); - int updateDay = house_pet.getUpdateDaily(self); - - int lastFed = getIntObjVar(self, house_pet.SARLACC_LAST_FED); - - blog("updateSarlaccPet - lastFed: "+lastFed); - if (currentGameTime < (lastFed + updateWeek)) - { - blog("updateSarlaccPet - Last Fed Timer: "+(lastFed + updateWeek)+" currentGameTime: "+currentGameTime); - - if (hasMessageTo(self, "updateSarlaccPet")) - { - return SCRIPT_CONTINUE; - } - - int later = ((lastFed + updateWeek) - currentGameTime); - blog("updateSarlaccPet - messageTo in : "+later); - if (later > 1) - { - blog("updateSarlaccPet - TOO SOOOOON messageTo in : "+later); - messageTo(self, "updateSarlaccPet", null, later, false); - } - else - { - blog("updateSarlaccPet - WRONG messageTo, Resending in : "+updateDay); - messageTo(self, "updateSarlaccPet", null, updateDay, false); - } - return SCRIPT_CONTINUE; - } - - if (hasMessageTo(self, "updateSarlaccPet")) - { - return SCRIPT_CONTINUE; - } - - blog("updateSarlaccPet - Is in structure"); - - int currentIteration = getIntObjVar(self, house_pet.SARLACC_FEEDING_ITERATION); - int currentPhase = getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE); - - if (currentPhase < house_pet.SARLACC_FED) - { - blog("updateSarlaccPet - currentPhase WAS -1"); - currentPhase = house_pet.SARLACC_FED; - } - - currentPhase++; - - if (currentPhase >= house_pet.SARLACC_DEATH) - { - setObjVar(self, house_pet.SARLACC_CURRENT_PHASE, house_pet.SARLACC_DEATH); - } - else - { - setObjVar(self, house_pet.SARLACC_CURRENT_PHASE, currentPhase); - } - - if (currentPhase == house_pet.SARLACC_DEATH) - { - blog("updateSarlaccPet - SARLACC DEAD!!!!!!!!"); - if (!hasMessageTo(self, "updateSarlaccPet")) - { - blog("updateSarlaccPet - SARLACC_DEATH messageTo"); - messageTo(self, "updateSarlaccPet", null, updateWeek, false); - } - return SCRIPT_CONTINUE; - } - else if (currentPhase == house_pet.SARLACC_STARVING) - { - blog("updateSarlaccPet - SARLACC STARVING!!!!!!!!"); - setObjVar(self, house_pet.SARLACC_FEEDING_ITERATION, 0); - removeObjVar(self, house_pet.SARLACC_FEED_ARRAY); - if (!hasMessageTo(self, "updateSarlaccPet")) - { - blog("updateSarlaccPet - SARLACC_STARVING messageTo"); - messageTo(self, "updateSarlaccPet", null, updateWeek, false); - } - return SCRIPT_CONTINUE; - } - - else if (getIntObjVar(self, house_pet.SARLACC_FEEDING_ITERATION) >= house_pet.SARLACC_PHASE_WEEKS) - { - blog("updateSarlaccPet - ITERATION DONE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); - String collectionCol = getSarlaccCollectionColumn(self); - if (collectionCol == null || collectionCol.equals("")) - { - - blog("updateSarlaccPet - getSarlaccCollectionColumn FAILED!"); - collectionCol = "generic_collectible"; - } - - blog("updateSarlaccPet - getSarlaccCollectionColumn: "+collectionCol); - - setObjVar(self, house_pet.SARLACC_FEEDING_ITERATION, 0); - - removeObjVar(self, house_pet.SARLACC_FEED_ARRAY); - - setObjVar(self, house_pet.SARLACC_REWARD_AVAILABLE, true); - - setObjVar(self, house_pet.SARLACC_REWARD_COLUMN, collectionCol); - } - - if (!hasMessageTo(self, "updateSarlaccPet")) - { - messageTo(self, "updateSarlaccPet", null, updateWeek, false); - blog("updateSarlaccPet - messageTo end in one week"); - } - - return SCRIPT_CONTINUE; - } - - - public boolean getEdibleContents(obj_id player, obj_id sarlacc) throws InterruptedException - { - blog("getEdibleContents - Init"); - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(sarlacc) || !exists(sarlacc)) - { - return false; - } - - if (getTemplateName(sarlacc).indexOf("mini_s01.iff") > 0) - { - return false; - } - - if (getIntObjVar(sarlacc, house_pet.SARLACC_CURRENT_PHASE) < house_pet.SARLACC_HUNGRY) - { - return false; - } - - if (getBooleanObjVar(sarlacc, house_pet.SARLACC_REWARD_AVAILABLE)) - { - sendSystemMessage(player, SID_SIFT_SARLACC_BOX); - return false; - } - blog("getEdibleContents - About to create array of junk"); - - if (!checkPlayerInventoryForSarlaccFood(player)) - { - sendSystemMessage(player, SID_SARLACC_NOTHING_FOUND); - return false; - } - - blog("getEdibleContents - Player has junk"); - - obj_id[] edibleItems = smuggler.getAllJunkItems(player); - if (edibleItems == null && edibleItems.length <= 0) - { - return false; - } - - String[] edibleMenu = new String[edibleItems.length]; - - for (int i = 0; i < edibleItems.length; i++) - { - testAbortScript(); - - String name = getAssignedName(edibleItems[i]); - if (name.equals("") || name == null) - { - name = getString(getNameStringId(edibleItems[i])); - } - edibleMenu[i] = name; - } - - if (edibleMenu == null && edibleMenu.length <= 0) - { - return false; - } - - int pid = sui.listbox(sarlacc, player, FEED_PROMPT, sui.YES_NO, FEED_TITLE, edibleMenu, "handleSarlaccEatSui", false, false); - - if (pid > -1) - { - - setSUIProperty(pid, sui.LISTBOX_BTN_OK, sui.PROP_TEXT, BTN_SELL); - - showSUIPage(pid); - - utils.setScriptVar(player, house_pet.EDIBLES_SUI, pid); - utils.setBatchScriptVar(player, house_pet.EDIBLES_IDS, edibleItems); - } - return true; - } - - - public boolean eatJunkItem(obj_id self, obj_id player, obj_id item) throws InterruptedException - { - blog("eatJunkItem - Init"); - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return false; - } - - if (!isIdValid(self) || !exists(self)) - { - return false; - } - if (!isIdValid(player) || !exists(player)) - { - return false; - } - if (!isIdValid(item) || !exists(item)) - { - - sendSystemMessage(player, SID_ITEM_NOT_VALID); - return false; - } - - obj_id bioLink = getBioLink(item); - if (isIdValid(bioLink) && utils.stringToLong(bioLink.toString()) != 1) - { - - sendSystemMessage(player, SID_ITEM_NOT_BIOLINK_FED); - return false; - } - - if (utils.outOfRange(self, player, 10.0f, true)) - { - - sendSystemMessage(player, SID_OUT_OF_RANGE); - return false; - } - - if (!validateItemForSarlacc(player, item)) - { - return false; - } - - String playerName = getName(player); - String itemName = getEncodedName(item); - CustomerServiceLog("sarlacc_minigame: ", "Player ("+ playerName + " OID: "+ player + ") fed sarlacc item ("+ itemName + " OID: "+ item + ")."); - - String templateName = getTemplateName(item); - if (templateName == null || templateName.equals("")) - { - return false; - } - - if (!hasObjVar(self, house_pet.SARLACC_FEED_ARRAY)) - { - blog("Received Item - Created new feed list"); - String[] feedingList = new String[1]; - feedingList[0] = templateName; - setObjVar(self, house_pet.SARLACC_FEED_ARRAY, feedingList); - } - else - { - String[] feedingList = getStringArrayObjVar(self, house_pet.SARLACC_FEED_ARRAY); - if (feedingList == null || feedingList.length <= 0) - { - blog("Received Item - ERROR -NO PREVIOUS feedingList found, making new."); - String[] newList = new String[1]; - newList[0] = templateName; - setObjVar(self, house_pet.SARLACC_FEED_ARRAY, newList); - } - else if (feedingList.length > 0 && feedingList.length < 4) - { - blog("Received Item - ARRAY COPY!!!!!!!!!!!!!!!!!!!!!!!!"); - blog("Received Item - feedingList.length "+feedingList.length); - String[] newList = new String[feedingList.length+1]; - System.arraycopy(feedingList, 0, newList, 0, feedingList.length); - newList[newList.length-1] = templateName; - blog("Received Item - newList.length "+newList.length); - setObjVar(self, house_pet.SARLACC_FEED_ARRAY, newList); - } - } - - int currentIteration = getIntObjVar(self, house_pet.SARLACC_FEEDING_ITERATION); - currentIteration++; - setObjVar(self, house_pet.SARLACC_FEEDING_ITERATION, currentIteration); - - blog("Received Item - setting phase fed and setting time fed"); - setObjVar(self, house_pet.SARLACC_CURRENT_PHASE, house_pet.SARLACC_FED); - - play2dNonLoopingSound(player, SOUND_EAT); - - doAnimationAction(self, ANIMATON_FEED); - - decrementCount(item); - sendSystemMessage(player, SID_SARLACC_FED); - - blog("Received Item - end, current phase: "+getIntObjVar(self, house_pet.SARLACC_CURRENT_PHASE)); - setObjVar(self, house_pet.SARLACC_LAST_FED, getCalendarTime()); - - if (!hasMessageTo(self, "updateSarlaccPet")) - { - blog("Received Item - first feeding kicks off the messageTo"); - messageTo(self, "updateSarlaccPet", null, house_pet.getUpdateWeekly(self), false); - } - dictionary params = new dictionary(); - params.put("player", player); - messageTo(self, "playBurp", params, 4, false); - messageTo(self, "growlAnimation", params, 2, false); - - return true; - } - - - public boolean validateItemForSarlacc(obj_id player, obj_id item) throws InterruptedException - { - if (utils.getContainingPlayer(item) != (player)) - { - - sendSystemMessage(player, SID_ITEM_NOT_INVENTORY); - return false; - } - - if (smuggler.hasItemsInContainer(item)) - { - - sendSystemMessage(player, SID_ITEM_NOT_INVENTORY); - return false; - } - - if (utils.isEquipped(item)) - { - - sendSystemMessage(player, SID_ITEM_EQUIPPED); - return false; - } - - if (hasObjVar(item, "quest_item")) - { - - sendSystemMessage(player, SID_QUEST_ITEM); - return false; - } - - return true; - } - - - public String getSarlaccCollectionColumn(obj_id self) throws InterruptedException - { - blog("getSarlaccCollectionColumn - Init"); - if (!isValidId(self) || !exists(self)) - { - return null; - } - - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return null; - } - - blog("getSarlaccCollectionColumn - initial validation ok"); - - if (!hasObjVar(self, house_pet.SARLACC_FEED_ARRAY)) - { - return null; - } - - blog("getSarlaccCollectionColumn - array of feed exists"); - - String[] foodList = getStringArrayObjVar(self, house_pet.SARLACC_FEED_ARRAY); - if (foodList == null || foodList.length < house_pet.SARLACC_PHASE_WEEKS) - { - blog("getSarlaccCollectionColumn - foodList.length: "+foodList.length); - return null; - } - blog("getSarlaccCollectionColumn - foodList[0]: "+foodList[0]); - blog("getSarlaccCollectionColumn - foodList[1]: "+foodList[1]); - blog("getSarlaccCollectionColumn - foodList[2]: "+foodList[2]); - blog("getSarlaccCollectionColumn - foodList[3]: "+foodList[3]); - - HashSet allEdibles = new HashSet(); - - for (int i = 0; i < foodList.length-1; i++) - { - testAbortScript(); - if (foodList[i] == null || foodList.equals("")) - { - continue; - } - - allEdibles.add(foodList[i]); - } - - if (allEdibles.isEmpty()) - { - blog("getSarlaccCollectionColumn - severe issue with feed array"); - return null; - } - - blog("getSarlaccCollectionColumn - allEdibles.size(): "+allEdibles.size()); - String[] templateArray = new String[allEdibles.size()]; - allEdibles.toArray(templateArray); - if (templateArray == null || templateArray.length <= 0) - { - blog("getSarlaccCollectionColumn - severe issue with hashset conversion of feed array"); - return null; - } - blog("getSarlaccCollectionColumn - templateArray.length: "+templateArray.length); - - if (templateArray.length == 1) - { - int lootRow = dataTableSearchColumnForString(templateArray[0], "item", house_pet.SARLACC_CTS_CRC_TABLE); - if (lootRow < 0) - { - blog("getSarlaccCollectionColumn - lootRow: "+lootRow); - return "generic_collectible"; - } - - String lootColumn = dataTableGetString(house_pet.SARLACC_CTS_CRC_TABLE, lootRow, "collectible_cols"); - blog("getSarlaccCollectionColumn - lootColumn: "+lootColumn); - if (lootColumn == null || lootColumn.equals("")) - { - return "generic_collectible"; - } - else - { - String[] possibleCols = split(lootColumn,','); - if (possibleCols == null || possibleCols.length <= 0) - { - return "generic_collectible"; - } - else if (possibleCols.length == 1) - { - return possibleCols[0]; - } - else - { - return possibleCols[rand(0,possibleCols.length-1)]; - } - } - } - else - { - String randTemplate = templateArray[rand(0, templateArray.length-1)]; - int lootRow = dataTableSearchColumnForString(randTemplate, "item", house_pet.SARLACC_CTS_CRC_TABLE); - - String lootColumn = dataTableGetString(house_pet.SARLACC_CTS_CRC_TABLE, lootRow, "collectible_cols"); - blog("getSarlaccCollectionColumn - lootColumn: "+lootColumn); - if (lootColumn == null || lootColumn.equals("")) - { - return "generic_collectible"; - } - else - { - String[] possibleCols = split(lootColumn,','); - if (possibleCols == null || possibleCols.length <= 0) - { - return "generic_collectible"; - } - else if (possibleCols.length == 1) - { - return possibleCols[0]; - } - else - { - return possibleCols[rand(0,possibleCols.length-1)]; - } - } - } - } - - - public boolean getPlayerReward(obj_id owner, obj_id self) throws InterruptedException - { - if (!isValidId(owner) || !exists(owner)) - { - return false; - } - if (!isValidId(self) || !exists(self)) - { - return false; - } - - if (getTemplateName(self).indexOf("mini_s01.iff") > 0) - { - return false; - } - - obj_id playerInventory = utils.getInventoryContainer(owner); - if (!isValidId(playerInventory) || !exists(playerInventory)) - { - return false; - } - - if (!hasObjVar(self,house_pet.SARLACC_REWARD_COLUMN)) - { - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(owner) + " OID: "+ owner + ") could not receive reward for properly feeding sarlacc. Sarlacc reward column objvar was not on the sarlacc item."); - - return false; - } - - String rewardCol = getStringObjVar(self, house_pet.SARLACC_REWARD_COLUMN); - if (rewardCol == null || rewardCol.equals("")) - { - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(owner) + " OID: "+ owner + ") could not receive reward for properly feeding sarlacc. Sarlacc reward column objvar was found but invalid."); - - return false; - } - - blog("rewardPlayer - getRandomCollectionItem for col: "+rewardCol); - - play2dNonLoopingSound(owner, SOUND_SIFT); - - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(owner) + " OID: "+ owner + ") is about to receive Sarlacc reward. Using collection library for reward. Check the CollectionLootChannel logs for specifics or search for the player OID to get full details."); - - if (!collection.getRandomCollectionItem(owner, playerInventory, house_pet.SARLACC_LOOT_TABLE, rewardCol)) - { - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(owner) + " OID: "+ owner + ") FAILED TO ISSUE PLAYER REWARD. Sarlacc: " +self+". This probably failed in the collection library being used to grant the player a reward item."); - - blog("rewardPlayer - severe issue with getRandomCollectionItem for col: "+rewardCol); - } - - CustomerServiceLog("sarlacc_minigame: ", - "Player ("+ getPlayerName(owner) + " OID: "+ owner + ") has received reward. Check the CollectionLootChannel logs for specifics or search for the player OID to get full details."); - - removeObjVar(self, house_pet.SARLACC_REWARD_AVAILABLE); - removeObjVar(self, house_pet.SARLACC_REWARD_COLUMN); - sendSystemMessage(owner, SID_FOUND_REWARD); - blog("rewardPlayer - REWARD GIVEN"); - - return true; - } - - - public boolean checkPlayerInventoryForSarlaccFood(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - obj_id inventory = utils.getInventoryContainer(player); - if (!isIdValid(inventory) || !exists(inventory)) - { - return false; - } - - obj_id[] contents = utils.getContents(inventory, true); - if (contents == null || contents.length <= 0) - { - return false; - } - - for (int x = 0; x < contents.length; x++) - { - testAbortScript(); - - if (!validateItemForSarlacc(player, contents[x])) - { - continue; - } - - if (hasObjVar(contents[x], "noTrade") || utils.isEquipped(contents[x])) - { - continue; - } - - if (isCrafted(contents[x])) - { - continue; - } - - if (static_item.getStaticObjectValue(getStaticItemName(contents[x])) > 0) - { - return true; - } - - String itemTemplate = getTemplateName(contents[x]); - if (dataTableSearchColumnForString(itemTemplate, "items", smuggler.TBL) > -1) - { - return true; - } - - } - return false; - } - - - public void cleanupSui(obj_id player) throws InterruptedException - { - blog("cleanupSui removing vars"); - utils.removeScriptVar(player, house_pet.EDIBLES_SUI); - utils.removeBatchScriptVar(player, house_pet.EDIBLES_IDS); - utils.removeScriptVar(player, "junkfood"); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/event/planet_event_handler.java b/sku.0/sys.server/compiled/game/script/event/planet_event_handler.java deleted file mode 100644 index 4a68cb51a..000000000 --- a/sku.0/sys.server/compiled/game/script/event/planet_event_handler.java +++ /dev/null @@ -1,336 +0,0 @@ -package script.event; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.holiday; -import script.library.utils; - - -public class planet_event_handler extends script.base_script -{ - public planet_event_handler() - { - } - public static final String EVENT_TIMESTAMP = "lifeday.time_stamp"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - - if (lifedayRunning != null && !lifedayRunning.equals("false")) - { - checkLifeDayData(self); - } - - else if (hasObjVar(self, "lifeday")) - { - removeObjVar(self, "lifeday"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "planet_event_handler.OnInitialize: trigger initialized."); - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - - if (lifedayRunning != null && !lifedayRunning.equals("false")) - { - checkLifeDayData(self); - } - - else if (hasObjVar(self, "lifeday")) - { - removeObjVar(self, "lifeday"); - } - - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (empiredayRunning != null && (empiredayRunning.equals("true") || empiredayRunning.equals("1"))) - { - CustomerServiceLog("holidayEvent", "planet_event_handler.OnInitialize: EMPIRE DAY CONFIG FOUND."); - dictionary params = new dictionary(); - params.put("eventVar", holiday.PLANET_VAR_EMPIRE_DAY); - params.put("eventConfig", "empireday_ceremony"); - messageTo (self, "setUpEventLeaderBoard", params, 3.0f, false); - } - else - { - - if (hasObjVar(self, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY)) - { - CustomerServiceLog("holidayEvent", "planet_event_handler.OnInitialize: Var: "+holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY+" removed because the event was not running."); - removeObjVar(self, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY); - } - } - return SCRIPT_CONTINUE; - } - - - public void checkLifeDayData(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, EVENT_TIMESTAMP)) - { - newTimeStamp(self); - } - - if (!hasObjVar(self, "lifeday.emptyScoreBoard")) - { - setObjVar(self, "lifeday.emptyScoreBoard", "true"); - } - - if (hasObjVar(self, "lifeday.positionOne.playerScore")) - { - if (!newDay(self)) - { - setObjVar(self, "lifeday.emptyScoreBoard", "false"); - } - } - - if (newDay(self)) - { - removeObjVar(self, "lifeday"); - setObjVar(self, "lifeday.emptyScoreBoard", "true"); - newTimeStamp(self); - createDailyAlarmClock(self, "lifeDayDailyAlarm", null, 10, 0, 0); - } - } - - - public boolean newDay(obj_id self) throws InterruptedException - { - if (hasObjVar(self, EVENT_TIMESTAMP)) - { - int now = getCalendarTime(); - int then = getIntObjVar(self, EVENT_TIMESTAMP); - - if (now > then) - { - return true; - } - else - { - return false; - } - } - return true; - } - - - public void newTimeStamp(obj_id self) throws InterruptedException - { - int now = getCalendarTime(); - int secondsUntil = secondsUntilNextDailyTime(10, 0, 0); - int then = now + secondsUntil; - setObjVar(self, EVENT_TIMESTAMP, then); - createDailyAlarmClock(self, "lifeDayDailyAlarm", null, 10, 0, 0); - } - - - public int setUpEventLeaderBoard(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "planet_event_handler.setUpEventLeaderBoard: Event Leader Board Data being initialized."); - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - String eventVar = params.getString("eventVar"); - if (eventVar == null || eventVar.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, holiday.PLANET_VAR_EVENT_PREFIX + eventVar)) - { - CustomerServiceLog("holidayEvent", "planet_event_handler.OnInitialize: Event data found: "+eventVar+", removing data so we can start new."); - removeObjVar(self, holiday.PLANET_VAR_EVENT_PREFIX + eventVar); - } - - if (eventVar.equals(holiday.PLANET_VAR_EMPIRE_DAY)) - { - CustomerServiceLog("holidayEvent", "planet_event_handler.setUpEventLeaderBoard: Setting up Empire Day data for the first time."); - if (!hasObjVar(self, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY + holiday.PLANET_VAR_SCORE_TIMESTAMP)) - { - CustomerServiceLog("holidayEvent", "planet_event_handler.setUpEventLeaderBoard: Setting up Empire Day score time stamp."); - - int now = getCalendarTime(); - int secondsUntil = holiday.getEmpireDayLockoutDelay(); - int then = now + secondsUntil; - setObjVar(self, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY + holiday.PLANET_VAR_SCORE_TIMESTAMP, then); - - messageTo(self, "resetEventDataAfterDelay", params, secondsUntil, false); - - setupInitialEventScores(self, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY + holiday.PLANET_VAR_SCORE, 5, true); - } - } - return SCRIPT_CONTINUE; - } - - - public int resetEventDataAfterDelay(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - CustomerServiceLog("holidayEvent", "planet_event_handler.resetEventDataAfterDelay: Could not find params for reset."); - return SCRIPT_CONTINUE; - } - - String eventVar = params.getString("eventVar"); - if (eventVar == null || eventVar.length() <= 0) - { - CustomerServiceLog("holidayEvent", "planet_event_handler.resetEventDataAfterDelay: Could not find eventVar params for reset."); - return SCRIPT_CONTINUE; - } - - String eventConfig = params.getString("eventConfig"); - if (eventConfig == null || eventConfig.length() <= 0) - { - CustomerServiceLog("holidayEvent", "planet_event_handler.resetEventDataAfterDelay: Could not find eventConfig params for reset."); - return SCRIPT_CONTINUE; - } - - String eventRunning = getConfigSetting("GameServer", eventConfig); - if (eventRunning != null && !eventRunning.equals("false")) - { - CustomerServiceLog("holidayEvent", "planet_event_handler.resetEventDataAfterDelay: Message received with cargo. eventVar: "+eventVar+" with eventConfig: "+eventConfig+". The data is being reset because the delay time has expired as planned."); - messageTo (self, "setUpEventLeaderBoard", params, 3.0f, false); - } - else - { - CustomerServiceLog("holidayEvent", "planet_event_handler.resetEventDataAfterDelay: Message received with cargo. eventVar: "+eventVar+" with eventConfig: "+eventConfig+". The data WAS NOT reset because the event was not running."); - - if (hasObjVar(self, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY)) - { - removeObjVar(self, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY); - } - - } - return SCRIPT_CONTINUE; - } - - - public int lifeDayDailyAlarm(obj_id self, dictionary params) throws InterruptedException - { - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - - if (lifedayRunning != null && !lifedayRunning.equals("false")) - { - checkLifeDayData(self); - } - - else if (hasObjVar(self, "lifeday")) - { - removeObjVar(self, "lifeday"); - } - - return SCRIPT_CONTINUE; - } - - - public int lifeDayScoreBoardUpdate(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId("player"); - checkLifeDayData(self); - - String scoreBoardEmpty = "true"; - int thirdPlaceScore = 0; - int secondPlaceScore = 0; - int firstPlaceScore = 0; - - if (hasObjVar(self, "lifeday.emptyScoreBoard")) - { - scoreBoardEmpty = getStringObjVar(self, "lifeday.emptyScoreBoard"); - } - if (hasObjVar(self, "lifeday.positionThree.playerScore")) - { - thirdPlaceScore = getIntObjVar (self, "lifeday.positionThree.playerScore"); - } - if (hasObjVar(self, "lifeday.positionTwo.playerScore")) - { - secondPlaceScore = getIntObjVar (self, "lifeday.positionTwo.playerScore"); - } - if (hasObjVar(self, "lifeday.positionOne.playerScore")) - { - firstPlaceScore = getIntObjVar (self, "lifeday.positionOne.playerScore"); - } - - dictionary newParams = new dictionary(); - newParams.put("scoreBoardEmpty", scoreBoardEmpty); - newParams.put("thirdPlaceScore", thirdPlaceScore); - newParams.put("secondPlaceScore", secondPlaceScore); - newParams.put("firstPlaceScore", firstPlaceScore); - messageTo (player, "scoreBoardCheck", newParams, 3.0f, false); - - return SCRIPT_CONTINUE; - } - - - public boolean setupInitialEventScores(obj_id planet, String scoreObjVar, int modifier, boolean faction) throws InterruptedException - { - if (!isValidId(planet) || !exists(planet)) - { - return false; - } - if (scoreObjVar == null || scoreObjVar.length() <= 0) - { - return false; - } - if (modifier < 0) - { - return false; - } - - if (!faction) - { - for (int i = 1, score = modifier; i <= holiday.MAX_NUMBER_OF_PLANET_HIGH_SCORES; i++) - { - testAbortScript(); - int randomPosition = rand(0,holiday.DEFAULT_HIGH_SCORE_LIST.length-1); - String name = holiday.DEFAULT_HIGH_SCORE_LIST[randomPosition]; - setObjVar(planet, scoreObjVar+".slot_"+i+holiday.PLANET_VAR_PLAYER_NAME, name); - setObjVar(planet, scoreObjVar+".slot_"+i+holiday.PLANET_VAR_PLAYER_SCORE, score); - score --; - } - } - else - { - for (int i = 1, score = modifier; i <= holiday.MAX_NUMBER_OF_PLANET_HIGH_SCORES; i++) - { - testAbortScript(); - int randomPosition = rand(0,holiday.DEFAULT_HIGH_SCORE_LIST.length-1); - String name = holiday.DEFAULT_HIGH_SCORE_LIST[randomPosition]; - setObjVar(planet, scoreObjVar+".slot_"+i+holiday.PLANET_VAR_PLAYER_FACTION_REB + holiday.PLANET_VAR_PLAYER_NAME, name); - setObjVar(planet, scoreObjVar+".slot_"+i+holiday.PLANET_VAR_PLAYER_FACTION_REB + holiday.PLANET_VAR_PLAYER_SCORE, score); - score --; - } - - for (int i = 1, score = modifier; i <= holiday.MAX_NUMBER_OF_PLANET_HIGH_SCORES; i++) - { - testAbortScript(); - int randomPosition = rand(0,holiday.DEFAULT_HIGH_SCORE_LIST.length-1); - String name = holiday.DEFAULT_HIGH_SCORE_LIST[randomPosition]; - setObjVar(planet, scoreObjVar+".slot_"+i+holiday.PLANET_VAR_PLAYER_FACTION_IMP + holiday.PLANET_VAR_PLAYER_NAME, name); - setObjVar(planet, scoreObjVar+".slot_"+i+holiday.PLANET_VAR_PLAYER_FACTION_IMP + holiday.PLANET_VAR_PLAYER_SCORE, score); - score --; - } - } - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/faction_perk/hq/loader.java b/sku.0/sys.server/compiled/game/script/faction_perk/hq/loader.java deleted file mode 100644 index 228b02e0b..000000000 --- a/sku.0/sys.server/compiled/game/script/faction_perk/hq/loader.java +++ /dev/null @@ -1,262 +0,0 @@ -package script.faction_perk.hq; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.gcw; -import script.library.hq; -import script.library.utils; -import script.library.factions; -import script.library.player_structure; - - -public class loader extends script.base_script -{ - public loader() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - if (hasObjVar(self, factions.FACTION)) - { - factions.setFaction(self, factions.getFaction(self)); - } - - String myFac = factions.getFaction(self); - int intFac = myFac.equals("Rebel") ? gcw.FACTION_REBEL : gcw.FACTION_IMPERIAL; - int lvl = getHqLevel(self); - if (lvl > 0) - { - factions.changeFactionPoints(myFac, 10 * lvl); - } - - gcw.incrementGCWScore (self); - gcw.modifyPlanetaryBaseCount(self, intFac, 1); - setObjVar(self, "lotsRefunded", 1); - setObjVar(self, "lotsRefunded2", 1); - setCWData(self); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - permissionsMakePublic(self); - setObjVar(self, "playersWithAlignedEnemyFlagsAllowed", 1); - - messageTo(self, "handleDelayedRefundChecker", null, 10f, true); - hq.removeCovertDetector(self); - setCWData(self); - return SCRIPT_CONTINUE; - } - - - public int OnReceivedItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - if (!isIdValid(srcContainer)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(item)) - { - return SCRIPT_CONTINUE; - } - - if (utils.isNestedWithin(srcContainer, self)) - { - return SCRIPT_CONTINUE; - } - - if (isPlayer(item) && factions.isDeclared(item) && factions.getFaction(item).equals(factions.getFaction(self))) - { - utils.setScriptVar(item, "inAlignedStructure", self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToReceiveItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - if (utils.isNestedWithinAPlayer(item)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnLostItem(obj_id self, obj_id destContainer, obj_id transferer, obj_id item) throws InterruptedException - { - if (!isIdValid(destContainer)) - { - utils.removeScriptVar(item, "inAlignedStructure"); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDelayedRefundChecker(obj_id self, dictionary params) throws InterruptedException - { - hq.refundFactionBaseLots(self); - return SCRIPT_CONTINUE; - } - - - public int handleHqDetonation(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = obj_id.NULL_ID; - if (utils.hasScriptVar(self, "faction_hq.detonator")) - { - player = utils.getObjIdScriptVar(self, "faction_hq.detonator"); - } - - location[] tmplocs = params.getLocationArray("locs"); - - if (tmplocs == null || tmplocs.length == 0) - { - gcw.grantBaseDestructionPoints(self); - - player_structure.destroyStructure(self, false, true); - String hqName = getName(self); - if (isIdValid(player)) - { - CustomerServiceLog( "faction_hq", "Faction HQ ("+ self + "), destroyed by normal terminal overload. Player initiating the destruction is %TU", player, null); - } - else - { - CustomerServiceLog( "faction_hq", "Faction HQ ("+ self + "), destroyed by normal terminal overload."); - } - - return SCRIPT_CONTINUE; - } - - Vector locs = new Vector(Arrays.asList(tmplocs)); - if (locs == null || locs.size() == 0) - { - String myFac = factions.getFaction(self); - int lvl = getHqLevel(self); - if (lvl > 0) - { - factions.changeFactionPoints(myFac, -10 * lvl); - } - gcw.grantBaseDestructionPoints(self); - - player_structure.destroyStructure(self, false, true); - String hqName = getName(self); - if (isIdValid(player)) - { - CustomerServiceLog( "faction_hq", "Faction HQ ("+ self + "), destroyed by normal terminal overload. Player initiating the destruction is %TU", player, null); - } - else - { - CustomerServiceLog( "faction_hq", "Faction HQ ("+ self + "), destroyed by normal terminal overload."); - } - - return SCRIPT_CONTINUE; - } - - location there = ((location)(locs.get(0))); - locs.removeElementAt(0); - if (locs == null || locs.size() == 0) - { - params.remove("locs"); - } - else - { - params.put("locs", locs); - } - - messageTo(self, "handleHqExplosions", params, rand(0.1f, 1.0f), false); - - messageTo(self, "handleHqDetonation", params, rand(0.1f, 1f), true); - return SCRIPT_CONTINUE; - } - - - public int handleHqExplosions(obj_id self, dictionary params) throws InterruptedException - { - location[] locs = params.getLocationArray("locs"); - - if (locs != null && locs.length > 0) - { - obj_id players[] = getPlayerCreaturesInRange(getLocation(self), 100.0f); - if (players != null && players.length > 0) - { - - playClientEffectLoc(players[0], "clienteffect/combat_explosion_lair_large.cef", locs[0], 0.0f); - } - } - - return SCRIPT_CONTINUE; - } - - - public int getHqLevel(obj_id self) throws InterruptedException - { - String template = getTemplateName(self); - int idx = template.indexOf("_s0"); - if (idx > -1) - { - String sLvl = template.substring(idx+3, idx+4); - int lvl = utils.stringToInt(sLvl); - return lvl; - } - - return -1; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - hq.cleanUpHackAlarms(self); - String myFac = factions.getFaction(self); - int intFac = myFac.equals("Rebel") ? gcw.FACTION_REBEL : gcw.FACTION_IMPERIAL; - int lvl = getHqLevel(self); - gcw.modifyPlanetaryBaseCount(self, intFac, -1); - gcw.decrementGCWScore(self); - hq.refundBaseUnit(self); - return SCRIPT_CONTINUE; - } - - - public void setCWData(obj_id self) throws InterruptedException - { - getClusterWideData("gcw_player_base", "base_cwdata_manager", true, self); - } - - - public int OnClusterWideDataResponse(obj_id self, String manage_name, String dungeon_name, int request_id, String[] element_name_list, dictionary[] dungeon_data, int lock_key) throws InterruptedException - { - - String name = "base_cwdata_manager"+"-"+self; - String scene = getCurrentSceneName(); - location loc = getLocation(self); - String myFac = factions.getFaction(self); - int intFac = myFac.equals("Rebel") ? gcw.FACTION_REBEL : gcw.FACTION_IMPERIAL; - - dictionary dungeon_info = new dictionary(); - dungeon_info.put("dungeon_id", self); - dungeon_info.put("faction", intFac); - dungeon_info.put("ownerId", getOwner(self)); - dungeon_info.put("scene", scene); - dungeon_info.put("position_x", loc.x); - dungeon_info.put("position_y", loc.y); - dungeon_info.put("position_z", loc.z); - - replaceClusterWideData(manage_name, name, dungeon_info, true, lock_key); - releaseClusterWideDataLock(manage_name, lock_key); - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/faction_perk/hq/terminal.java b/sku.0/sys.server/compiled/game/script/faction_perk/hq/terminal.java deleted file mode 100644 index f43c1314e..000000000 --- a/sku.0/sys.server/compiled/game/script/faction_perk/hq/terminal.java +++ /dev/null @@ -1,1499 +0,0 @@ -package script.faction_perk.hq; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.util.Calendar; -import script.library.hq; -import script.library.sui; -import script.library.utils; -import script.library.prose; -import script.library.money; -import script.library.factions; -import script.library.player_structure; -import script.library.stealth; - - - -public class terminal extends script.terminal.base.base_terminal -{ - public terminal() - { - } - public static final string_id MNU_DONATE = new string_id("hq", "mnu_donate"); - public static final string_id MNU_DONATE_MONEY = new string_id("hq", "mnu_donate_money"); - public static final string_id MNU_DONATE_RESOURCE = new string_id("hq", "mnu_donate_resource"); - public static final string_id MNU_DONATE_DEED = new string_id("hq", "mnu_donate_deed"); - public static final string_id UNDER_ATTACK = new string_id("hq", "under_attack"); - - public static final string_id MNU_OVERLOAD = new string_id("hq", "mnu_overload"); - public static final string_id MNU_SHUTDOWN = new string_id("hq", "mnu_shutdown"); - - public static final string_id MNU_DEFENSE_STATUS = new string_id("hq", "mnu_defense_status"); - - public static final string_id MNU_RESET_VULNERABILITY = new string_id("hq", "mnu_reset_vulnerability"); - - public static final String[] ACCEPTED_DEED_TYPES = - { - "turret", - "mine", - }; - - public static final String SCRIPTVAR_COUNTDOWN = "countdownInProgress"; - - public static final string_id SID_TERMINAL_MANAGEMENT = new string_id("player_structure", "management"); - public static final string_id SID_TERMINAL_MANAGEMENT_STATUS = new string_id("player_structure", "management_status"); - public static final string_id SID_TERMINAL_MANAGEMENT_PAY = new string_id("player_structure", "management_pay"); - public static final string_id SID_TERMINAL_MANAGEMENT_DESTROY = new string_id("player_structure", "permission_destroy"); - - public static final string_id SID_VULNERABILITY_RESET = new string_id("hq", "vulnerability_reset"); - - public static final string_id SID_VULNERABILITY_RESET_BLACKOUT_PERIOD = new string_id("hq", "vulnerability_reset_blackout_period"); - public static final string_id SID_VULNERABILITY_RESET_WRONG_CELL = new string_id("hq", "vulnerability_reset_wrong_cell"); - public static final string_id SID_VULNERABILITY_RESET_NO_LONGER_IN_STRUCTURE = new string_id("hq", "vulnerability_reset_no_longer_in_structure"); - public static final string_id SID_VULNERABILITY_RESET_REQUEST_RECEIVED = new string_id("hq", "vulnerability_reset_request_received"); - public static final string_id SID_VULNERABILITY_RESET_NOT_ALIVE = new string_id("hq", "vulnerability_reset_not_alive"); - - public static final String STRING_FILE_LOC = "faction/faction_hq/faction_hq_response"; - - public static final string_id SID_NO_STEALTH = new string_id("hq", "no_stealth"); - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (hasScript(self, hq.SCRIPT_TERMINAL_DISABLE)) - { - detachScript(self, hq.SCRIPT_TERMINAL_DISABLE); - } - - return super.OnInitialize(self); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return super.OnObjectMenuRequest(self, player, mi); - } - - int intState = getState(player, STATE_FEIGN_DEATH); - - if (isDead(player) || isIncapacitated(player) || intState > 0) - { - return super.OnObjectMenuRequest(self, player, mi); - } - - obj_id structure = player_structure.getStructure(player); - if (!isIdValid(structure)) - { - return super.OnObjectMenuRequest(self, player, mi); - } - - String buildingTemplate = getTemplateName(structure); - - if (pvpGetAlignedFaction(player) != pvpGetAlignedFaction(structure)) - { - if (pvpGetType(player) == PVPTYPE_NEUTRAL) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response01")); - return super.OnObjectMenuRequest(self, player, mi); - } - - if (hasObjVar(structure, hq.VAR_OBJECTIVE_TRACKING)) - { - obj_id[] objectives = getObjIdArrayObjVar(structure, hq.VAR_OBJECTIVE_ID); - if (objectives == null || objectives.length == 0) - { - return super.OnObjectMenuRequest(self, player, mi); - } - - obj_id[] disabled = getObjIdArrayObjVar(structure, hq.VAR_OBJECTIVE_DISABLED); - if (disabled == null || disabled.length != objectives.length) - { - prose_package ppDisableOther = prose.getPackage(hq.PROSE_DISABLE_OTHER, objectives[objectives.length - 1], self); - sendSystemMessageProse(player, ppDisableOther); - return super.OnObjectMenuRequest(self, player, mi); - } - - int mnuCountdown = mi.addRootMenu(menu_info_types.ITEM_USE, MNU_OVERLOAD); - } - - return super.OnObjectMenuRequest(self, player, mi); - } - - int management_root = mi.addRootMenu (menu_info_types.ITEM_USE, SID_TERMINAL_MANAGEMENT); - if (management_root > -1) - { - mi.addSubMenu(management_root, menu_info_types.SERVER_TERMINAL_MANAGEMENT_STATUS, SID_TERMINAL_MANAGEMENT_STATUS); - - if (player_structure.isAdmin(structure, player)) - { - if (!player_structure.isFactionPerkBase(buildingTemplate)) - { - mi.addSubMenu(management_root, menu_info_types.SERVER_TERMINAL_MANAGEMENT_PAY, SID_TERMINAL_MANAGEMENT_PAY); - } - - if (hasObjVar(structure,"isPvpBase" )) - { - int stamp = getIntObjVar(structure, "lastReset"); - int now = getGameTime(); - if (now > stamp + 1209600 || !hasObjVar(structure, "lastReset")) - { - mi.addSubMenu(management_root, menu_info_types.SERVER_MENU6, MNU_RESET_VULNERABILITY); - } - } - - mi.addSubMenu(management_root, menu_info_types.SERVER_MENU5, MNU_DEFENSE_STATUS); - mi.addSubMenu(management_root, menu_info_types.SERVER_TERMINAL_MANAGEMENT_DESTROY, SID_TERMINAL_MANAGEMENT_DESTROY); - } - } - - int mnuDonate = -1; - - if (!player_structure.isFactionPerkBase(buildingTemplate)) - { - mnuDonate = mi.addRootMenu(menu_info_types.SERVER_MENU1, MNU_DONATE); - int mnuDonateMoney = mi.addSubMenu(mnuDonate, menu_info_types.SERVER_MENU2, MNU_DONATE_MONEY); - } - - if (hasObjVar(structure, hq.VAR_OBJECTIVE_TRACKING) || isGod(player)) - { - if (mnuDonate <= -1) - { - mnuDonate = mi.addRootMenu(menu_info_types.SERVER_MENU1, MNU_DONATE); - } - - int mnuDonateDeed = mi.addSubMenu(mnuDonate, menu_info_types.SERVER_MENU4, MNU_DONATE_DEED); - } - - if (utils.hasScriptVar(self, SCRIPTVAR_COUNTDOWN) && pvpGetType(player) != PVPTYPE_NEUTRAL) - { - if (hasObjVar(structure,"isPvpBase" )) - { - int mnuShutdown = mi.addRootMenu(menu_info_types.SERVER_MENU9, MNU_SHUTDOWN); - } - } - - return super.OnObjectMenuRequest(self, player, mi); - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - int intState = getState(player, STATE_FEIGN_DEATH); - - if (isDead(player) || isIncapacitated(player) || intState > 0) - { - return SCRIPT_CONTINUE; - } - - obj_id structure = player_structure.getStructure(player); - if (!isIdValid(structure)) - { - return SCRIPT_CONTINUE; - } - - String buildingTemplate = getTemplateName(structure); - - if (pvpGetAlignedFaction(player) != pvpGetAlignedFaction(structure)) - { - if (pvpGetType(player) == PVPTYPE_NEUTRAL) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response01")); - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.ITEM_USE) - { - if (hasObjVar(structure, hq.VAR_OBJECTIVE_TRACKING)) - { - if (utils.hasScriptVar(self, SCRIPTVAR_COUNTDOWN)) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response02")); - return SCRIPT_CONTINUE; - } - - obj_id[] objectives = getObjIdArrayObjVar(structure, hq.VAR_OBJECTIVE_ID); - if (objectives == null || objectives.length == 0) - { - return SCRIPT_CONTINUE; - } - - obj_id[] disabled = getObjIdArrayObjVar(structure, hq.VAR_OBJECTIVE_DISABLED); - if (disabled == null || disabled.length != objectives.length) - { - prose_package ppDisableOther = prose.getPackage(hq.PROSE_DISABLE_OTHER, objectives[objectives.length - 1], self); - sendSystemMessageProse(player, ppDisableOther); - return SCRIPT_CONTINUE; - } - - if (!hasSkill(player, "class_officer_phase1_novice")) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response03")); - return SCRIPT_CONTINUE; - } - - startCountdown(self, player); - - return SCRIPT_CONTINUE; - } - } - - return SCRIPT_OVERRIDE; - } - - if (((item == menu_info_types.SERVER_TERMINAL_MANAGEMENT)||(item == menu_info_types.SERVER_TERMINAL_MANAGEMENT_STATUS)|| (item == menu_info_types.ITEM_USE))) - { - queueCommand(player, (335013253), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_TERMINAL_MANAGEMENT_PAY) - { - if (!player_structure.isFactionPerkBase(buildingTemplate)) - { - queueCommand(player, (-404530384), null, "", COMMAND_PRIORITY_DEFAULT); - } - } - else if (item == menu_info_types.SERVER_TERMINAL_MANAGEMENT_DESTROY) - { - queueCommand(player, (419174182), null, "", COMMAND_PRIORITY_DEFAULT); - } - - if (item == menu_info_types.ITEM_USE) - { - - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.SERVER_MENU1) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response04")); - return SCRIPT_CONTINUE; - } - else if (item == menu_info_types.SERVER_MENU2) - { - if (!player_structure.isFactionPerkBase(buildingTemplate)) - { - int total = getTotalMoney(player); - if (total < 1) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response05")); - return SCRIPT_CONTINUE; - } - else - { - - String title = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response18")); - String prompt = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response17")); - - sui.transfer(self, player, prompt, title, "@faction/faction_hq/faction_hq_response:terminal_response30", total, "@faction/faction_hq/faction_hq_response:terminal_response31", 0, "handleRequestDonation"); - } - } - } - else if (item == menu_info_types.SERVER_MENU4) - { - - if (hasObjVar(structure, "donateTerminalOff")) - { - - int terminalOff_time = utils.getIntObjVar(structure, "donateTerminalOff"); - int termOff_remaining = 3600 - (getGameTime() - terminalOff_time); - String timeOff_remaining = player_structure.assembleTimeRemaining(player_structure.convertSecondsTime(termOff_remaining)); - - prose_package ppTimeRemaining = prose.getPackage(UNDER_ATTACK, timeOff_remaining); - sendSystemMessageProse(player, ppTimeRemaining); - return SCRIPT_CONTINUE; - } - else - { - if (hasObjVar(structure, hq.VAR_OBJECTIVE_TRACKING) || isGod(player)) - { - if (isGod(player)) - { - sendSystemMessage(player, "Warning: You are using donation function while in Godmode.", null); - } - showDeedDonationUI(self, player); - } - } - } - else if (item == menu_info_types.SERVER_MENU5) - { - if (player_structure.isAdmin(structure, player)) - { - showDefenseStatusUI(self, player); - } - } - else if (item == menu_info_types.SERVER_MENU6) - { - if (player_structure.isAdmin(structure, player)) - { - if (hasObjVar(structure,"isPvpBase" )) - { - int hqBlackoutPeriodStart = utils.getIntConfigSetting("ScriptFlags", "hqBlackoutPeriodStart"); - if (hqBlackoutPeriodStart == 0) - { - hqBlackoutPeriodStart = 2; - } - - int hqBlackoutPeriodEnd = utils.getIntConfigSetting("ScriptFlags", "hqBlackoutPeriodEnd"); - if (hqBlackoutPeriodEnd == 0) - { - hqBlackoutPeriodEnd = 6; - } - - Calendar currentCalendar = Calendar.getInstance(); - int currentHourOfDay = currentCalendar.get(Calendar.HOUR_OF_DAY); - if ((currentHourOfDay >= hqBlackoutPeriodStart) && (currentHourOfDay <= hqBlackoutPeriodEnd)) - { - - prose_package pp1a = prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response32"), hqBlackoutPeriodStart); - prose_package pp2a = prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response37"), hqBlackoutPeriodEnd); - - String oob1 = packOutOfBandProsePackage(null, pp1a); - oob1 = packOutOfBandProsePackage(oob1, pp2a); - - sendSystemMessageOob(player, oob1); - sendSystemMessageProse(player, prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response38"), currentHourOfDay)); - - } - else - { - long now = System.currentTimeMillis(); - long curTime = ((now / 1000) - 1072224000); - int currentTime = (int) curTime; - - setObjVar(structure, hq.VAR_OBJECTIVE_STAMP, currentTime); - setObjVar(structure, "lastReset", getGameTime()); - sendSystemMessage(player, SID_VULNERABILITY_RESET); - } - } - } - } - else if (item == menu_info_types.SERVER_MENU9) - { - if (hasObjVar(structure,"isPvpBase" )) - { - if (pvpGetType(player) != PVPTYPE_NEUTRAL) - { - if (factions.isNewlyDeclared(player)) - { - int declared_time = utils.getIntScriptVar(player, factions.VAR_NEWLY_DECLARED); - int time_remaining = factions.NEWLY_DECLARED_INTERVAL - (getGameTime() - declared_time); - LOG("LOG_CHANNEL", "declared_time ->"+ declared_time + " time_remaining ->"+ time_remaining); - if (time_remaining > 0) - { - String time_str = player_structure.assembleTimeRemaining(player_structure.convertSecondsTime(time_remaining)); - sendSystemMessageProse(player, prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response41"), time_str)); - } - else - { - utils.removeScriptVar(player, factions.VAR_NEWLY_DECLARED); - facilityShutdownDelay(self, player); - } - } - else - { - - facilityShutdownDelay(self, player); - - } - } - else - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response06")); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public void shutdownFacility(obj_id self) throws InterruptedException - { - attachScript(self, hq.SCRIPT_TERMINAL_DISABLE); - - obj_id structure = player_structure.getStructure(self); - if (isIdValid(structure)) - { - hq.disableHqTerminals(structure); - } - - abortCountdown(self); - hq.activateHackAlarms(structure, false); - messageTo(self, "handleFacilityReboot", null, 30f, false); - } - - - public void startCountdown(obj_id self, obj_id player) throws InterruptedException - { - - int meleemod = getSkillStatMod(player, "group_melee_defense"); - int rangemod = getSkillStatMod(player, "group_range_defense"); - - float mod = (100f - (float)(meleemod + rangemod))/100f; - if (mod < 0f) - { - mod = 0f; - } - - float delay = 300f + 300f * mod; - - int minutes = Math.round(delay/60f); - - obj_id[] players = player_structure.getPlayersInBuilding(getTopMostContainer(self)); - if (players != null && players.length > 0) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - sendSystemMessageProse(players[i], prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response40"), minutes)); - } - } - - int stamp = getGameTime() + Math.round(delay); - utils.setScriptVar(self, SCRIPTVAR_COUNTDOWN, stamp); - - dictionary d = new dictionary(); - d.put("player", player); - d.put("cnt", minutes); - - messageTo(self, "handleCountdown", d, 10f, false); - } - - - public void abortCountdown(obj_id self) throws InterruptedException - { - obj_id structure = getTopMostContainer(self); - hq.activateDestructAlarms(structure, false); - - utils.removeScriptVar(self, SCRIPTVAR_COUNTDOWN); - - obj_id[] players = player_structure.getPlayersInBuilding(structure); - if (players != null && players.length > 0) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - sendSystemMessage(players[i], new string_id(STRING_FILE_LOC, "terminal_response07")); - } - } - } - - - public int handleFacilityReboot(obj_id self, dictionary params) throws InterruptedException - { - detachScript(self, hq.SCRIPT_TERMINAL_DISABLE); - - obj_id structure = player_structure.getStructure(self); - if (isIdValid(structure)) - { - hq.enableHqTerminals(structure); - } - - obj_id[] players = player_structure.getPlayersInBuilding(getTopMostContainer(self)); - if (players != null && players.length > 0) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - sendSystemMessage(players[i], new string_id(STRING_FILE_LOC, "terminal_response08")); - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleCountdown(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, SCRIPTVAR_COUNTDOWN)) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId("player"); - - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - abortCountdown(self); - return SCRIPT_CONTINUE; - } - - int cnt = params.getInt("cnt"); - - int stamp = utils.getIntScriptVar(self, SCRIPTVAR_COUNTDOWN); - LOG("hqObjective","stamp = "+ stamp); - int now = getGameTime(); - LOG("hqObjective","now = "+ now); - - int timeLeft = stamp - now; - int minutes = Math.round(timeLeft/60f); - - obj_id structure = player_structure.getStructure(self); - if (!isIdValid(structure)) - { - abortCountdown(self); - return SCRIPT_CONTINUE; - } - - LOG("hqObjective","timeLeft = "+ timeLeft); - if (timeLeft < 1) - { - utils.setScriptVar(structure, "faction_hq.detonator", player); - hq.detonateHq(structure); - String hqName = getName(structure); - CustomerServiceLog("faction_hq", "Initiating destroy for Faction HQ "+ hqName + " ("+ structure + "), by normal terminal overload."); - return SCRIPT_CONTINUE; - } - - prose_package msg = prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response39"), minutes); - if (minutes < 1) - { - msg = prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response39"), timeLeft); - } - else if (minutes < cnt) - { - obj_id[] players = player_structure.getPlayersInBuilding(structure); - if (players != null && players.length > 0) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - sendSystemMessageProse(players[i], msg); - } - } - - params.put("cnt", minutes); - } - - hq.activateDestructAlarms(structure, true); - messageTo(self, "handleCountdown", params, 10f, false); - - return SCRIPT_CONTINUE; - } - - - public int handleDonateDeed(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - String scriptvar_sui = player + ".deed.sui"; - String scriptvar_opt = player + ".deed.opt"; - - obj_id[] deeds = utils.getObjIdBatchScriptVar(self, scriptvar_opt); - - utils.removeScriptVar(self, scriptvar_sui); - utils.removeBatchScriptVar(self, scriptvar_opt); - - if (deeds == null || deeds.length == 0) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx == -1 || idx > deeds.length-1) - { - return SCRIPT_CONTINUE; - } - - obj_id deed = deeds[idx]; - if (!isIdValid(deed)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(deed, player)) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response09")); - return SCRIPT_CONTINUE; - } - - String deedType = getStringObjVar(deed, "perkDeedType"); - if (deedType != null && !deedType.equals("")) - { - if (utils.getElementPositionInArray(ACCEPTED_DEED_TYPES, deedType) == -1) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response10")); - return SCRIPT_CONTINUE; - } - else - { - - if (deedType.equals("turret")) - { - obj_id objBuilding = getTopMostContainer(self); - if (isIdValid(objBuilding)) - { - if (hasObjVar(objBuilding, "isPvpBase")) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response_special_forces_no_turrets")); - return SCRIPT_CONTINUE; - } - } - else - { - debugServerConsoleMsg(player, "Trying to donate turrets to a Factional HQ terminal without a topmost container"); - return SCRIPT_CONTINUE; - } - } - } - } - - String displayType = utils.packStringId(new string_id("faction_perk", deedType)); - String template = ""; - - int mineType = -1; - - obj_id structure = player_structure.getStructure(player); - if (!isIdValid(structure)) - { - return SCRIPT_CONTINUE; - } - - if (deedType.equals("mine")) - { - int numMines = hq.getTotalMines(structure); - - if (numMines >= hq.getMaxMines(structure)) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "max_number_mines")); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(deed, "mineType")) - { - mineType = getIntObjVar(deed, "mineType"); - } - } - else - { - obj_id[] defensesOfType = getObjIdArrayObjVar(structure, hq.VAR_DEFENSE_BASE + "."+ deedType); - if (defensesOfType == null || defensesOfType.length == 0) - { - sendSystemMessageProse(player, prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response43"), displayType)); - return SCRIPT_CONTINUE; - } - - int pos = utils.getFirstNonValidIdIndex(defensesOfType); - - if (pos < 0 || pos > defensesOfType.length - 1) - { - sendSystemMessageProse(player, prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response44"), displayType)); - return SCRIPT_CONTINUE; - } - - template = player_structure.getDeedTemplate(deed); - if (template == null || template.equals("")) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response11")); - return SCRIPT_CONTINUE; - } - } - - String sFacName = factions.getFaction(structure); - if (sFacName == null || sFacName.equals("")) - { - sendSystemMessageProse(player, prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response45"), displayType)); - CustomerServiceLog("faction_hq", "%TU donates a "+ displayType + " deed to Factional HQ "+ structure, player, null); - } - else - { - prose_package pp1b = prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response46"), displayType); - prose_package pp2b = prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response47"), sFacName); - - String oob2 = packOutOfBandProsePackage(null, pp1b); - oob2 = packOutOfBandProsePackage(oob2, pp2b); - CustomerServiceLog("faction_hq", "%TU donates a "+ displayType + " deed to Factional HQ "+ structure, player, null); - sendSystemMessageOob(player, oob2); - } - destroyObject(deed); - - dictionary d = new dictionary(); - d.put("template", template); - d.put("type", deedType); - d.put("mineType", mineType); - - messageTo(structure, "handleAddDefense", d, 1, true); - return SCRIPT_CONTINUE; - } - - - public int handleDonateResourceType(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - String scriptvar_sui = player + ".resource.sui"; - String scriptvar_opt = player + ".resource.opt"; - - obj_id[] crates = utils.getObjIdBatchScriptVar(self, scriptvar_opt); - - utils.removeScriptVar(self, scriptvar_sui); - utils.removeBatchScriptVar(self, scriptvar_opt); - - if (crates == null || crates.length == 0) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx == -1 || idx > crates.length-1) - { - return SCRIPT_CONTINUE; - } - - obj_id crate = crates[idx]; - if (!isIdValid(crate)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(crate, player)) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response12")); - return SCRIPT_CONTINUE; - } - - int amt = getResourceContainerQuantity(crate); - - String title = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response20")); - String prompt = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response19")); - - int pid = sui.transfer(self, player, prompt, title, "@faction/faction_hq/faction_hq_response:terminal_response36", amt, "@faction/faction_hq/faction_hq_response:terminal_response31", 0, "handleDonateResourceAmt"); - if (pid > -1) - { - utils.setScriptVar(self, scriptvar_sui, pid); - utils.setScriptVar(self, scriptvar_opt, crate); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDonateResourceAmt(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - String scriptvar_sui = player + ".resource.sui"; - String scriptvar_opt = player + ".resource.opt"; - - obj_id crate = utils.getObjIdScriptVar(self, scriptvar_opt); - - utils.removeScriptVar(self, scriptvar_sui); - utils.removeScriptVar(self, scriptvar_opt); - - if (!isIdValid(crate)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(crate, player)) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response12")); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int amt = sui.getTransferInputTo(params); - if (amt == 0) - { - return SCRIPT_CONTINUE; - } - - obj_id rtype = getResourceContainerResourceType(crate); - if (!isIdValid(rtype)) - { - return SCRIPT_CONTINUE; - } - - String res_name = getResourceName(rtype); - - if (removeResourceFromContainer(crate, rtype, amt)) - { - obj_id structure = player_structure.getStructure(player); - - String sFacName = factions.getFaction(structure); - if (sFacName == null || sFacName.equals("")) - { - sendSystemMessageProse(player, prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response48"), amt)); - CustomerServiceLog("faction_hq", "%TU donates "+ amt + " units of "+ res_name + " to Factional HQ "+ structure, player, null); - } - else - { - prose_package pp1c = prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response49"), amt); - prose_package pp2c = prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response50"), sFacName); - - String oob3 = packOutOfBandProsePackage(null, pp1c); - oob3 = packOutOfBandProsePackage(oob3, pp2c); - CustomerServiceLog("faction_hq", "%TU donates "+ amt + " units of "+ res_name + " to Factional HQ "+ structure, player, null); - sendSystemMessageOob(player, oob3); - } - - if (!isIdValid(structure)) - { - return SCRIPT_CONTINUE; - } - - int total = getIntObjVar(structure, hq.VAR_HQ_RESOURCE_CNT); - total += amt; - setObjVar(structure, hq.VAR_HQ_RESOURCE_CNT, total); - } - - return SCRIPT_CONTINUE; - } - - - public int handleRequestDonation(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int amt = sui.getTransferInputTo(params); - if (amt == 0) - { - return SCRIPT_CONTINUE; - } - - money.requestPayment(player, self, amt, "handleCreditDonation", null, true); - return SCRIPT_CONTINUE; - } - - - public int handleCreditDonation(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - int ret = params.getInt(money.DICT_CODE); - if (ret == money.RET_FAIL) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId(money.DICT_PLAYER_ID); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - obj_id structure = player_structure.getStructure(player); - - int amt = params.getInt(money.DICT_TOTAL); - - String sFacName = factions.getFaction(structure); - if (sFacName == null || sFacName.equals("")) - { - sendSystemMessageProse(player, prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response51"), amt)); - CustomerServiceLog("faction_hq", "%TU donated "+ amt + " credits to Faction HQ "+ structure, player, null); - } - else - { - prose_package pp1d = prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response52"), amt); - prose_package pp2d = prose.getPackage(new string_id (STRING_FILE_LOC, "terminal_response53"), sFacName); - String oob4 = packOutOfBandProsePackage(null, pp1d); - oob4 = packOutOfBandProsePackage(oob4, pp2d); - sendSystemMessageOob(player, oob4); - CustomerServiceLog("faction_hq", "%TU donated "+ amt + " credits to Faction HQ "+ structure, player, null); - } - - if (isIdValid(structure)) - { - money.bankTo(self, structure, amt); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDefenseSelection(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - String scriptvar_sui = player + ".defense.sui"; - String scriptvar_opt = player + ".defense.opt"; - - obj_id[] opt = utils.getObjIdBatchScriptVar(self, scriptvar_opt); - - utils.removeScriptVar(self, scriptvar_sui); - utils.removeBatchScriptVar(self, scriptvar_opt); - - if (opt == null || opt.length == 0) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx == -1 || idx > opt.length-1) - { - return SCRIPT_CONTINUE; - } - - obj_id defense = opt[idx]; - if (!isIdValid(defense)) - { - return SCRIPT_CONTINUE; - } - - if (!exists(defense) || !defense.isLoaded()) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response13")); - return SCRIPT_CONTINUE; - } - - int max_hp = getMaxHitpoints(defense); - int cur_hp = getHitpoints(defense); - - String title = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response24")); - String prompt = getString(new string_id(STRING_FILE_LOC, "terminal_response25")); - prompt += "/n/n"+ getString(new string_id(STRING_FILE_LOC, "selected_defense")) + utils.getStringName(defense) + " ["+cur_hp+"/"+max_hp+"]"; - - if (hasScript(defense, "faction_perk.minefield.advanced_minefield")) - { - prompt = getString(new string_id(STRING_FILE_LOC, "terminal_response25a")); - } - - int pid = sui.msgbox(self, player, prompt, sui.YES_NO, title, "handleDefenseRemoveConfirm"); - if (pid > -1) - { - utils.setScriptVar(self, scriptvar_sui, pid); - utils.setScriptVar(self, scriptvar_opt, defense); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDefenseRemoveConfirm(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - String scriptvar_sui = player + ".defense.sui"; - String scriptvar_opt = player + ".defense.opt"; - - obj_id defense = utils.getObjIdScriptVar(self, scriptvar_opt); - - utils.removeScriptVar(self, scriptvar_sui); - utils.removeScriptVar(self, scriptvar_opt); - - if (!isIdValid(defense) || !exists(defense) || !defense.isLoaded()) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response13")); - return SCRIPT_CONTINUE; - } - - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response58")); - utils.setScriptVar(defense, "hq.defense.remover", player); - - if (hasScript(defense, "faction_perk.minefield.advanced_minefield")) - { - hq.clearMinefield(player_structure.getStructure(player)); - } - else - { - destroyObject(defense); - } - return SCRIPT_CONTINUE; - } - - - public void showResourceDonationUI(obj_id terminal, obj_id player) throws InterruptedException - { - if (!isIdValid(terminal) || !isIdValid(player)) - { - return; - } - - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return; - } - - String scriptvar_sui = player + ".resource.sui"; - String scriptvar_opt = player + ".resource.opt"; - - if (utils.hasScriptVar(terminal, scriptvar_sui)) - { - sui.closeSUI(player, utils.getIntScriptVar(terminal, scriptvar_sui)); - utils.removeScriptVar(terminal, scriptvar_sui); - utils.removeBatchScriptVar(terminal, scriptvar_opt); - } - - obj_id[] crates = utils.getContainedGOTObjects(player, GOT_resource_container, true, true); - if (crates == null || crates.length == 0) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response14")); - return; - } - - Vector entries = new Vector(); - entries.setSize(0); - for (int i = 0; i < crates.length; i++) - { - testAbortScript(); - obj_id crate = crates[i]; - if (isIdValid(crate)) - { - int inCrate = getResourceContainerQuantity(crate); - String name = getString(getNameStringId(crate)); - - entries = utils.addElement(entries, name + " ["+ inCrate + "]"); - } - } - - String title = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response20")); - String prompt = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response29")); - - int pid = sui.listbox(terminal, player, prompt, sui.OK_CANCEL, title, entries, "handleDonateResourceType"); - if (pid > -1) - { - utils.setScriptVar(terminal, scriptvar_sui, pid); - utils.setBatchScriptVar(terminal, scriptvar_opt, crates); - } - } - - - public void showDeedDonationUI(obj_id terminal, obj_id player) throws InterruptedException - { - if (!isIdValid(terminal) || !isIdValid(player)) - { - return; - } - - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return; - } - - LOG("hq"," //***// showDeedDonationUI entered... passed in terminal:"+terminal+" and player:"+player); - - String scriptvar_sui = player + ".deed.sui"; - String scriptvar_opt = player + ".deed.opt"; - - LOG("hq"," //***// showDeedDonationUI ... string scriptvar_sui ="+scriptvar_sui+" and string scriptvar_opt ="+scriptvar_opt); - - if (utils.hasScriptVar(terminal, scriptvar_sui)) - { - LOG("hq"," //***// showDeedDonationUI ... utils.hasScriptVar(terminal, scriptvar_sui) is AFFIRM"); - - sui.closeSUI(player, utils.getIntScriptVar(terminal, scriptvar_sui)); - utils.removeScriptVar(terminal, scriptvar_sui); - utils.removeScriptVar(terminal, scriptvar_opt); - } - - obj_id[] deeds = utils.getContainedObjectsWithObjVar(player, "perkDeedType", true); - if (deeds == null || deeds.length == 0) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response15")); - return; - } - - Vector entries = new Vector(); - entries.setSize(0); - Vector opt = new Vector(); - opt.setSize(0); - for (int i = 0; i < deeds.length; i++) - { - testAbortScript(); - LOG("hq"," //***// showDeedDonationUI ... counting through GOT_deed objects in player inventory. Currently on item# "+i); - - obj_id deed = deeds[i]; - if (isIdValid(deed)) - { - String deedType = getStringObjVar(deed, "perkDeedType"); - if (deedType != null && !deedType.equals("")) - { - LOG("hq"," //***// showDeedDonationUI ... deed item# "+i+" has 'perkDeedType' objvar of: "+deedType); - if (utils.getElementPositionInArray(ACCEPTED_DEED_TYPES, deedType) > -1) - { - opt = utils.addElement(opt, deed); - entries = utils.addElement(entries, getEncodedName(deed)); - - } - } - } - } - - String title = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response26")); - String prompt = utils.packStringId (new string_id(STRING_FILE_LOC, "terminal_response23")); - - LOG("hq"," //***// showDeedDonationUI ... title= "+title+" and prompt = "+prompt+" size of 'entries' array is:"+entries.size()); - - int pid = sui.listbox(terminal, player, prompt, sui.OK_CANCEL, title, entries, "handleDonateDeed"); - if (pid > -1) - { - utils.setScriptVar(terminal, scriptvar_sui, pid); - utils.setBatchScriptVar(terminal, scriptvar_opt, opt); - } - } - - - public void showDefenseStatusUI(obj_id terminal, obj_id player) throws InterruptedException - { - if (!isIdValid(terminal) || !isIdValid(player)) - { - return; - } - - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return; - } - - String scriptvar_sui = player + ".defense.sui"; - String scriptvar_opt = player + ".defense.opt"; - - if (utils.hasScriptVar(terminal, scriptvar_sui)) - { - sui.closeSUI(player, utils.getIntScriptVar(terminal, scriptvar_sui)); - utils.removeScriptVar(terminal, scriptvar_sui); - utils.removeScriptVar(terminal, scriptvar_opt); - } - - obj_id structure = player_structure.getStructure(player); - if (!isIdValid(structure)) - { - return; - } - - Vector entries = new Vector(); - entries.setSize(0); - Vector opt = new Vector(); - opt.setSize(0); - obj_var_list ovl = getObjVarList(structure, hq.VAR_DEFENSE_BASE); - if (ovl == null) - { - sendSystemMessage(player, new string_id(STRING_FILE_LOC, "terminal_response14")); - return; - } - - int numTypes = ovl.getNumItems(); - for (int i = 0; i < numTypes; i++) - { - testAbortScript(); - obj_var ov = ovl.getObjVar(i); - String ovName = ov.getName(); - entries = utils.addElement(entries, toUpper(ovName)); - opt = utils.addElement(opt, obj_id.NULL_ID); - - obj_id[] data = ov.getObjIdArrayData(); - if (data != null && data.length > 0) - { - int validCount = 0; - for (int n = 0; n < data.length; n++) - { - testAbortScript(); - if (isIdValid(data[n])) - { - String sName = utils.getStringName(data[n]); - int max_hp = getMaxHitpoints(data[n]); - int cur_hp = getHitpoints(data[n]); - - if (hasScript(data[n], "faction_perk.minefield.advanced_minefield")) - { - entries = utils.addElement(entries, "- "+ hq.getTotalMines(structure) + "/"+ hq.getMaxMines(structure) + " mines"); - } - else - { - entries = utils.addElement(entries, "- "+ sName + " ["+cur_hp+"/"+max_hp+"]"); - } - - opt = utils.addElement(opt, data[n]); - validCount++; - } - } - - if (validCount == 0) - { - entries = utils.addElement(entries, "- none"); - opt = utils.addElement(opt, obj_id.NULL_ID); - } - - } - } - - String title = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response23")); - String prompt = utils.packStringId (new string_id(STRING_FILE_LOC, "terminal_response22")); - - int pid = sui.listbox(terminal, player, prompt, sui.REMOVE_CANCEL, title, entries, "handleDefenseSelection"); - if (pid > -1) - { - utils.setScriptVar(terminal, scriptvar_sui, pid); - utils.setBatchScriptVar(terminal, scriptvar_opt, opt); - } - } - - - public void facilityShutdownDelay(obj_id terminal, obj_id player) throws InterruptedException - { - if (!isIdValid(terminal) || !isIdValid(player)) - { - return; - } - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return; - } - - String currentCell = null; - location locTest = getLocation(player); - if (isIdValid(locTest.cell)) - { - currentCell = getCellName(locTest.cell); - } - - sendSystemMessage(player, SID_VULNERABILITY_RESET_REQUEST_RECEIVED); - - dictionary params = new dictionary(); - params.put("player", player); - - if (!currentCell.equals("null")) - { - params.put("cellName", currentCell); - } - - messageTo(terminal, "handleShutdownCountdownComplete", params, 60f, false); - - return; - } - - - public int handleShutdownCountdownComplete(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - String triggeringCell = params.getString("cellName"); - - if (!isIdValid(player) || !isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - obj_id structure = player_structure.getStructure(self); - if (!isIdValid(structure)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(structure, hq.VAR_TERMINAL_DISABLE)) - { - boolean structureState = getBooleanObjVar(structure, hq.VAR_TERMINAL_DISABLE); - if (structureState == true) - { - return SCRIPT_CONTINUE; - } - } - - String currentCell = null; - location locTest = getLocation(player); - if (isIdValid(locTest.cell)) - { - currentCell = getCellName(locTest.cell); - } - - if ((!isIdValid(locTest.cell)) || (!currentCell.equals(triggeringCell))) - { - sendSystemMessage(player, SID_VULNERABILITY_RESET_WRONG_CELL); - return SCRIPT_CONTINUE; - } - - if (isIncapacitated(player) || isDead(player)) - { - sendSystemMessage(player, SID_VULNERABILITY_RESET_NOT_ALIVE); - return SCRIPT_CONTINUE; - } - - String title = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response27")); - String prompt = utils.packStringId(new string_id(STRING_FILE_LOC, "terminal_response28")); - - int pid = sui.msgbox(self, player, title, sui.YES_NO, prompt, "handleShutdownConfirm"); - - return SCRIPT_CONTINUE; - } - - - public int handleShutdownConfirm(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (stealth.hasInvisibleBuff(player)) - { - sendSystemMessage(player, SID_NO_STEALTH); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id structure = player_structure.getStructure(self); - - if (hasObjVar(structure, hq.VAR_TERMINAL_DISABLE)) - { - boolean structureState = getBooleanObjVar(structure, hq.VAR_TERMINAL_DISABLE); - if (structureState == true) - { - return SCRIPT_CONTINUE; - } - } - - obj_id currentStructure = player_structure.getStructure(player); - - if (currentStructure != structure) - { - sendSystemMessage(player, SID_VULNERABILITY_RESET_NO_LONGER_IN_STRUCTURE); - return SCRIPT_CONTINUE; - } - - shutdownFacility(self); - - return SCRIPT_CONTINUE; - } - - - public int handleAlarmMute(obj_id self, dictionary params) throws InterruptedException - { - obj_id structure = player_structure.getStructure(self); - if (isIdValid(structure)) - { - hq.activateHackAlarms(structure, false); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/armor/biolink_item_non_faction.java b/sku.0/sys.server/compiled/game/script/item/armor/biolink_item_non_faction.java deleted file mode 100644 index 93cd4181e..000000000 --- a/sku.0/sys.server/compiled/game/script/item/armor/biolink_item_non_faction.java +++ /dev/null @@ -1,186 +0,0 @@ -package script.item.armor; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.sui; -import script.library.utils; -import script.library.combat; - - -public class biolink_item_non_faction extends script.base_script -{ - public biolink_item_non_faction() - { - } - public static final String VAR_TEMP_BASE = "biotemp"; - - public static final string_id SID_ITEM_BIO_LINKED = new string_id("base_player", "item_bio_linked"); - public static final string_id SID_MUST_EQUIP_FROM_INVENTORY = new string_id("base_player", "must_equip_from_inventory"); - public static final string_id SID_MUST_BIO_LINK_FROM_INVENTORY = new string_id("base_player", "must_bio_link_from_inventory"); - public static final string_id SID_BIO_LINK = new string_id("ui_radial", "bio_link"); - public static final string_id SID_BIO_LINK_MSG_PROMPT = new string_id("sui", "bio_link_item_prompt"); - public static final string_id SID_BIO_LINK_MSG_TITLE = new string_id("sui", "bio_link_item_title"); - public static final string_id SID_SPECIES_CANNOT_EQUIP = new string_id("base_player", "species_cannot_equip"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == null || biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - setBioLink(self, null); - } - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == null) - { - setBioLink(self, null); - } - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == null) - { - setBioLink(self, null); - biolink = utils.OBJ_ID_BIO_LINK_PENDING; - } - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING && isPlayer(destContainer)) - { - - if (utils.getContainingPlayer(self) != destContainer) - { - sendSystemMessage(destContainer, SID_MUST_EQUIP_FROM_INVENTORY); - return SCRIPT_OVERRIDE; - } - - int pid = sui.msgbox(self, destContainer, "@"+ SID_BIO_LINK_MSG_PROMPT, sui.YES_NO, "@"+ SID_BIO_LINK_MSG_TITLE, "handleEquipBioLinkSui"); - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - - if (isIdValid(player) && utils.getContainingPlayer(self) == player) - { - item.addRootMenu(menu_info_types.BIO_LINK, SID_BIO_LINK); - return SCRIPT_CONTINUE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - - LOG("fryer_log", "OnObjectMenuSelect - INSIDE"); - - if (item == menu_info_types.BIO_LINK) - { - obj_id biolink = getBioLink(self); - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - - if (isIdValid(player) && utils.getContainingPlayer(self) == player) - { - _bioLinkItem(self, player, false, true); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int handleEquipBioLinkSui(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - _bioLinkItem(self, player, true, true); - return SCRIPT_CONTINUE; - } - - - public boolean _bioLinkItem(obj_id self, obj_id player, boolean equipAfterLink, boolean queryPlayer) throws InterruptedException - { - if (!isIdValid(self) || !isIdValid(player)) - { - CustomerServiceLog("NonFaction", "WARNING: biolink_item._bioLinkItem called with invalid player (%TU) or item ("+ self + ")", player); - return false; - } - - obj_id biolink = getBioLink(self); - if (biolink != utils.OBJ_ID_BIO_LINK_PENDING) - { - CustomerServiceLog("NonFaction", "WARNING: Player %TU trying to bio-link item "+ self + " that has link id "+ biolink, player); - return false; - } - - if (utils.getContainingPlayer(self) != player) - { - sendSystemMessage(player, SID_MUST_BIO_LINK_FROM_INVENTORY); - return false; - } - - String template = getTemplateName(self); - if ((template.startsWith("object/tangible/wearables/") ) && (!canEquipWearable(player, self) )) - { - sendSystemMessage(player, SID_SPECIES_CANNOT_EQUIP); - return false; - } - - if (isWeapon(self)) - { - if (!combat.hasCertification(player, self)) - { - sendSystemMessage(player, SID_SPECIES_CANNOT_EQUIP); - return false; - } - } - - setBioLink(self, player); - prose_package pp = new prose_package(); - pp.stringId = SID_ITEM_BIO_LINKED; - sendSystemMessageProse(player, pp); - sendDirtyObjectMenuNotification(self); - - if (equipAfterLink) - { - equip(self, player); - } - - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/item/armor/new_armor.java b/sku.0/sys.server/compiled/game/script/item/armor/new_armor.java deleted file mode 100644 index b241d1137..000000000 --- a/sku.0/sys.server/compiled/game/script/item/armor/new_armor.java +++ /dev/null @@ -1,478 +0,0 @@ -package script.item.armor; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.armor; -import script.library.craftinglib; -import script.library.metrics; -import script.library.utils; -import script.library.prose; -import script.library.static_item; - - -public class new_armor extends script.base_script -{ - public new_armor() - { - } - public static final java.text.NumberFormat floatFormat = new java.text.DecimalFormat("###.#"); - public static final java.text.NumberFormat percentFormat = new java.text.DecimalFormat("###.#%"); - - public static final String[] SID_SPECIAL_TOOLTIP_PROTECTIONS = - { - "armor_eff_kinetic", - "armor_eff_energy", - "armor_eff_elemental_heat", - "armor_eff_elemental_cold", - "armor_eff_elemental_acid", - "armor_eff_elemental_electrical", - }; - - public static final String[] SPECIAL_PROTECTIONS = - { - "kinetic", - "energy", - "heat", - "cold", - "acid", - "electricity" - }; - public static final String APPEARANCE_TBL = "datatables/appearance/appearance_table.iff"; - - - public String getSpeciesName(String speciesName) throws InterruptedException - { - String species = ""; - java.util.StringTokenizer st = new java.util.StringTokenizer(speciesName); - - if (st.hasMoreTokens()) - { - String gender = st.nextToken(); - - if (gender.length() > 0 && st.hasMoreTokens()) - { - species = st.nextToken(); - } - } - - return species; - } - - - public int OnCustomizeFinished(obj_id self, obj_id object, String params) throws InterruptedException - { - LOG("armor_recolor","OnCustomizeFinished - ARMOR"); - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - int ourType = getGameObjectType( self ); - if ((!isGameObjectTypeOf(ourType, GOT_armor) && !isGameObjectTypeOf(ourType, GOT_component_armor ) && !isGameObjectTypeOf(ourType, GOT_component_new_armor) && !isGameObjectTypeOf(ourType, GOT_cybernetic_arm) && !isGameObjectTypeOf(ourType, GOT_cybernetic_legs))) - { - detachScript(self, "item.armor.new_armor"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - getProtections(self); - - { - java.util.HashSet speciesRequirementsSet = new java.util.HashSet(); - - String armorSharedObjectTemplateName = getSharedObjectTemplateName(self); - if (armorSharedObjectTemplateName != null) - { - int startingIndex = armorSharedObjectTemplateName.lastIndexOf('/') + 1; - int endingIndex = armorSharedObjectTemplateName.lastIndexOf('.'); - armorSharedObjectTemplateName = armorSharedObjectTemplateName.substring(startingIndex, endingIndex); - - dictionary appearanceRestrictions = dataTableGetRow(APPEARANCE_TBL, armorSharedObjectTemplateName); - if (appearanceRestrictions != null) - { - java.util.Enumeration speciesNames = appearanceRestrictions.keys(); - while (speciesNames.hasMoreElements()) - { - testAbortScript(); - String species = (String)(speciesNames.nextElement()); - if (!species.equals("Object Template Name")) - { - Object speciesAppearance = appearanceRestrictions.get(species); - if (speciesAppearance != null && (speciesAppearance instanceof String)) - { - String speciesAppearanceNameString = ((String)speciesAppearance); - - if (!speciesAppearanceNameString.equals(":block")) - { - speciesRequirementsSet.add(getSpeciesName(species)); - } - } - } - } - } - } - - String speciesRequirements = ""; - java.util.Iterator itSpecies = speciesRequirementsSet.iterator(); - - while (itSpecies.hasNext()) - { - testAbortScript(); - speciesRequirements += itSpecies.next(); - speciesRequirements += " "; - } - - utils.setScriptVar(self, armor.SCRIPTVAR_SPECIES_RESTRICTIONS, speciesRequirements); - } - - if (!isGameObjectTypeOf(self, GOT_armor_foot) && !isGameObjectTypeOf(self, GOT_armor_hand) && !hasObjVar(self, "armor.general_protection")) - { - messageTo(self, "checkArmorData", null, 1, false); - } - - if (isGameObjectTypeOf(self, GOT_armor_misc) && !hasObjVar(self, "armor.armorStatCleaned")) - { - armor.removeAllArmorData(self); - setObjVar (self, "armor.armorStatCleaned", 1); - } - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - if (isPlayer(destContainer) && !armor.isArmorCertified(destContainer, self)) - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "armor_no_cert")); - pp = prose.setTT(pp, self); - sendSystemMessageProse(destContainer, pp); - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnTransferred(obj_id self, obj_id sourceContainer, obj_id destContainer, obj_id transferer) throws InterruptedException - { - - obj_id player; - - if (isPlayer(destContainer)) - { - player = destContainer; - } - else if (isPlayer(sourceContainer)) - { - player = sourceContainer; - } - else - { - return SCRIPT_CONTINUE; - } - - armor.recalculateArmorForPlayer(player); - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - - if (player == null || names == null || attribs == null || names.length != attribs.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int free = getFirstFreeIndex(names); - if (free == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int armorType = getGameObjectType(self); - if (armor.isFinalArmor(armorType)) - { - armorType = GOT_armor; - } - - int armorLevel = -1; - int armorCategory = -1; - int armorRow = armor.getArmorDatatableRow(self); - if (armorRow < 0) - { - CustomerServiceLog("armor", "WARNING: could not find armor datatable row for armor "+ self); - return super.OnGetAttributes(self, player, names, attribs); - } - - if (armorType == GOT_armor || armorType == GOT_armor_core || armorType == GOT_armor_psg) - { - - armorLevel = armor.getArmorLevel(self); - armorCategory = armor.getArmorCategory(self); - if (armorLevel < 0 || armorCategory < 0) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - dictionary protections = armor.getArmorSpecialProtections(self); - float general_protection = armor.getArmorGeneralProtection(self); - float[] penalties = null; - if (general_protection > 0 && armorLevel >= 0 && armorCategory >= 0) - { - - penalties = armor.getScaledArmorPenalties(self, general_protection, armorRow, armorLevel, armorCategory); - } - - if (armorCategory >= 0) - { - Object catName = armor.ARMOR_CATEGORY_MAP.get(new Integer(armorCategory)); - if (catName != null && free < names.length) - { - names[free] = armor.SID_ARMOR_CATEGORY; - attribs[free++] = (String)catName; - - names[free] = "tooltip.armor_category"; - attribs[free++] = (String)catName; - } - } - - if (hasObjVar(self, "attribute.bonus.0")) - { - names[free] = "health_bonus"; - attribs[free++] = "+"+ getIntObjVar(self, "attribute.bonus.0");; - } - - String[][] entries = - { - { - "kinetic", "energy" - } - , - { - "heat", "cold", "acid", "electricity" - } - }; - int realArmorType = getGameObjectType(self); - if (realArmorType == GOT_armor_hand || realArmorType == GOT_armor_foot) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - for (int i = 0; i < entries.length; ++i) - { - testAbortScript(); - for (int j = 0; j < entries[i].length; ++j) - { - testAbortScript(); - if (free < names.length) - { - float value = general_protection + 0.5f; - if (protections != null) - { - value += protections.getFloat(entries[i][j]); - } - names[free] = (String)(armor.SPECIAL_PROTECTION_MAP.get(entries[i][j])); - attribs[free++] = Integer.toString((int)value); - } - } - } - - { - for (int i = 0; i < SPECIAL_PROTECTIONS.length; ++i) - { - testAbortScript(); - names[free] = "tooltip." + SID_SPECIAL_TOOLTIP_PROTECTIONS[i]; - - float value = general_protection + 0.5f; - if (protections != null) - { - value += protections.getFloat(SPECIAL_PROTECTIONS[i]); - } - - attribs[free++] = Integer.toString((int)value); - } - } - - if (armorType == GOT_armor_psg) - { - - float efficiency = utils.getFloatScriptVar(self, armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_PSG_CURRENT_EFFICIENCY); - float recharge = getFloatObjVar(self, armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_PSG_RECHARGE_RATE); - if (free < names.length) - { - names[free] = "@obj_attr_n:" + armor.OBJVAR_PSG_CURRENT_EFFICIENCY; - attribs[free++] = percentFormat.format(efficiency); - } - if (free < names.length) - { - names[free] = "@obj_attr_n:" + armor.OBJVAR_PSG_RECHARGE_RATE; - attribs[free++] = floatFormat.format(recharge); - } - } - - String speciesRequirements = utils.getStringScriptVar(self, armor.SCRIPTVAR_SPECIES_RESTRICTIONS); - if (speciesRequirements != null && speciesRequirements.length() > 0) - { - names[free] = "species_restrictions.species_name"; - attribs[free++] = speciesRequirements; - - names[free] = "tooltip.species_restrictions"; - attribs[free++] = speciesRequirements; - } - - if (static_item.isStaticItem(self)) - { - dictionary itemData = new dictionary(); - itemData = static_item.getMasterItemDictionary(self); - - int tier = itemData.getInt("tier"); - names[free] = "tier"; - attribs[free++] = "" + tier; - - names[free] = "tooltip.tier"; - attribs[free++] = "" + tier; - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int delayedEquip(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - equip(self, player); - - return SCRIPT_CONTINUE; - } - - - public int checkArmorData(obj_id self, dictionary params) throws InterruptedException - { - - String template = getTemplateName(self); - String name = null; - if (template.endsWith("armor_ubese_helmet_quest.iff")) - { - name = "object/tangible/wearables/armor/ubese/armor_ubese_helmet_quest.iff"; - } - if (template.endsWith("armor_stormtrooper_helmet_quest.iff")) - { - name = "object/tangible/wearables/armor/stormtrooper/armor_stormtrooper_helmet_quest.iff"; - } - - if (name != null) - { - utils.replaceSnowflakeItem(self, name); - return SCRIPT_CONTINUE; - } - - if (armor.getArmorGeneralProtection(self) < 0) - { - if (!isGameObjectTypeOf(self, GOT_armor_foot) && !isGameObjectTypeOf(self, GOT_armor_hand)) - { - - final String[] ARMOR_SET = - { - - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_leggings.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_helmet.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_gloves.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_chest_plate.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_bracer_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_bracer_l.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_boots.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_bicep_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_bicep_l.iff", - - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_leggings.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_helmet.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_gloves.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_chest_plate.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_bracer_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_bracer_l.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_boots.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_bicep_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_bicep_l.iff", - - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_leggings.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_helmet.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_gloves.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_chest_plate.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_bracer_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_bracer_l.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_boots.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_bicep_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_bicep_l.iff", - }; - - final String objectTemplateName = getTemplateName(self); - for (int i = 0; i < ARMOR_SET.length; i++) - { - testAbortScript(); - if (objectTemplateName.equals(ARMOR_SET[i])) - { - armor.setArmorDataPercent(self, 2, 1, 0.94f, 0.95f); - break; - } - } - } - } - - return SCRIPT_CONTINUE; - } - - - public void getProtections(obj_id self) throws InterruptedException - { - - int armorType = getGameObjectType(self); - if (armor.isFinalArmor(armorType)) - { - armorType = GOT_armor; - } - - int armorLevel = -1; - int armorCategory = -1; - int armorRow = armor.getArmorDatatableRow(self); - if (armorRow < 0) - { - CustomerServiceLog("armor", "WARNING: could not find armor datatable row for armor "+ self); - return; - } - - if (armorType == GOT_armor || armorType == GOT_armor_core || armorType == GOT_armor_psg) - { - - armorLevel = armor.getArmorLevel(self); - armorCategory = armor.getArmorCategory(self); - if (armorLevel < 0 || armorCategory < 0) - { - return; - } - } - - dictionary protections = armor.getArmorSpecialProtections(self); - float general_protection = armor.getArmorGeneralProtection(self); - - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/buff_click_biolink_item_non_faction.java b/sku.0/sys.server/compiled/game/script/item/buff_click_biolink_item_non_faction.java deleted file mode 100644 index 96b6c0c92..000000000 --- a/sku.0/sys.server/compiled/game/script/item/buff_click_biolink_item_non_faction.java +++ /dev/null @@ -1,183 +0,0 @@ -package script.item; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.sui; -import script.library.utils; -import script.library.combat; - - -public class buff_click_biolink_item_non_faction extends script.base_script -{ - public buff_click_biolink_item_non_faction() - { - } - public static final String VAR_TEMP_BASE = "biotemp"; - - public static final string_id SID_ITEM_BIO_LINKED = new string_id("base_player", "item_bio_linked"); - public static final string_id SID_MUST_EQUIP_FROM_INVENTORY = new string_id("base_player", "must_equip_from_inventory"); - public static final string_id SID_MUST_BIO_LINK_FROM_INVENTORY = new string_id("base_player", "must_bio_link_from_inventory"); - public static final string_id SID_BIO_LINK = new string_id("ui_radial", "bio_link"); - public static final string_id SID_BIO_LINK_MSG_PROMPT = new string_id("sui", "bio_link_item_prompt"); - public static final string_id SID_BIO_LINK_MSG_TITLE = new string_id("sui", "bio_link_item_title"); - public static final string_id SID_SPECIES_CANNOT_EQUIP = new string_id("base_player", "species_cannot_equip"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == null || biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - setBioLink(self, null); - } - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == null) - { - setBioLink(self, null); - } - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == null) - { - setBioLink(self, null); - biolink = utils.OBJ_ID_BIO_LINK_PENDING; - } - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING && isPlayer(destContainer)) - { - - if (utils.getContainingPlayer(self) != destContainer) - { - sendSystemMessage(destContainer, SID_MUST_EQUIP_FROM_INVENTORY); - return SCRIPT_OVERRIDE; - } - - int pid = sui.msgbox(self, destContainer, "@"+ SID_BIO_LINK_MSG_PROMPT, sui.YES_NO, "@"+ SID_BIO_LINK_MSG_TITLE, "handleEquipBioLinkSui"); - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - - if (isIdValid(player) && utils.getContainingPlayer(self) == player) - { - item.addRootMenu(menu_info_types.BIO_LINK, SID_BIO_LINK); - return SCRIPT_CONTINUE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item == menu_info_types.BIO_LINK) - { - obj_id biolink = getBioLink(self); - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - - if (isIdValid(player) && utils.getContainingPlayer(self) == player) - { - _bioLinkItem(self, player, false, true); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int handleEquipBioLinkSui(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - _bioLinkItem(self, player, true, true); - return SCRIPT_CONTINUE; - } - - - public boolean _bioLinkItem(obj_id self, obj_id player, boolean equipAfterLink, boolean queryPlayer) throws InterruptedException - { - if (!isIdValid(self) || !isIdValid(player)) - { - CustomerServiceLog("NonFaction", "WARNING: biolink_item._bioLinkItem called with invalid player (%TU) or item ("+ self + ")", player); - return false; - } - - obj_id biolink = getBioLink(self); - if (biolink != utils.OBJ_ID_BIO_LINK_PENDING) - { - CustomerServiceLog("NonFaction", "WARNING: Player %TU trying to bio-link item "+ self + " that has link id "+ biolink, player); - return false; - } - - if (utils.getContainingPlayer(self) != player) - { - sendSystemMessage(player, SID_MUST_BIO_LINK_FROM_INVENTORY); - return false; - } - - String template = getTemplateName(self); - if ((template.startsWith("object/tangible/wearables/") ) && (!canEquipWearable(player, self) )) - { - sendSystemMessage(player, SID_SPECIES_CANNOT_EQUIP); - return false; - } - - if (isWeapon(self)) - { - if (!combat.hasCertification(player, self)) - { - sendSystemMessage(player, SID_SPECIES_CANNOT_EQUIP); - return false; - } - } - - setBioLink(self, player); - prose_package pp = new prose_package(); - pp.stringId = SID_ITEM_BIO_LINKED; - sendSystemMessageProse(player, pp); - sendDirtyObjectMenuNotification(self); - - if (equipAfterLink) - { - equip(self, player); - } - - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/item/buff_click_item.java b/sku.0/sys.server/compiled/game/script/item/buff_click_item.java deleted file mode 100644 index cfbbd04a6..000000000 --- a/sku.0/sys.server/compiled/game/script/item/buff_click_item.java +++ /dev/null @@ -1,190 +0,0 @@ -package script.item; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.buff; -import script.library.static_item; -import script.library.prose; - - -public class buff_click_item extends script.base_script -{ - public buff_click_item() - { - } - public static final string_id SID_NOT_YET = new string_id("base_player", "not_yet"); - public static final string_id SID_NOT_LINKED = new string_id("base_player", "not_linked"); - public static final string_id SID_NOT_LINKED_TO_HOLDER = new string_id("base_player", "not_linked_to_holder"); - public static final string_id CANT_APPLY_BUFF = new string_id("base_player", "cant_apply_buff"); - public static final string_id BUFF_APPLIED = new string_id("base_player", "buff_applied"); - public static final string_id SID_ITEM_LEVEL_TOO_LOW = new string_id("base_player", "level_too_low"); - public static final string_id SID_ITEM_NOT_IN_INVENTORY = new string_id("base_player", "not_in_your_inventory"); - public static final string_id SID_MUST_BIO_LINK_FROM_INVENTORY = new string_id("base_player", "must_biolink_to_use_from_inventory"); - public static final string_id SID_BIOLINK_OTHER_PLAYER = new string_id("base_player", "wrong_player_per_biolink"); - public static final string_id SID_NO_USE_WHILE_DEAD = new string_id("player_structure", "while_dead"); - public static final string_id SID_BUFF_NOT_OWNER = new string_id("base_player", "food_buff_not_owner"); - - public static final String OWNER_OID = "owner"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (canManipulate(player, self, true, true, 15, true)) - { - if (utils.isNestedWithinAPlayer(self)) - { - menu_info_data mid = mi.getMenuItemByType(menu_info_types.ITEM_USE); - if (mid != null) - { - mid.setServerNotify(true); - } - else - { - mi.addRootMenu(menu_info_types.ITEM_USE, new string_id("ui_radial", "item_use")); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (utils.getContainingPlayer(self) != player) - { - return SCRIPT_CONTINUE; - } - - obj_id biolink = getBioLink(self); - if (isValidId(biolink) && biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - sendSystemMessage(player, SID_MUST_BIO_LINK_FROM_INVENTORY); - return SCRIPT_CONTINUE; - } - - if (isValidId(biolink) && biolink != player) - { - sendSystemMessage(player, SID_BIOLINK_OTHER_PLAYER); - return SCRIPT_CONTINUE; - } - else if (hasObjVar(self, OWNER_OID)) - { - - if (player != getObjIdObjVar(self, OWNER_OID)) - { - sendSystemMessage(player, SID_BUFF_NOT_OWNER); - return SCRIPT_CONTINUE; - } - } - - if (item == menu_info_types.ITEM_USE) - { - if (isIncapacitated(player) || isDead(player)) - { - sendSystemMessage(player, SID_NO_USE_WHILE_DEAD); - return SCRIPT_CONTINUE; - } - - if (hasScript(self, "item.armor.biolink_item_non_faction")) - { - - obj_id bioLinked = getBioLink(self); - if (bioLinked == null || bioLinked == utils.OBJ_ID_BIO_LINK_PENDING) - { - sendSystemMessage(player, SID_NOT_LINKED); - return SCRIPT_CONTINUE; - - } - if (bioLinked != player) - { - sendSystemMessage(player, SID_NOT_LINKED_TO_HOLDER); - return SCRIPT_CONTINUE; - } - } - String itemName = getStaticItemName(self); - if (itemName == null || itemName.equals("")) - { - LOG( "create", "Itemname bad, name is "+itemName ); - return SCRIPT_CONTINUE; - } - - dictionary itemData = new dictionary(); - itemData = dataTableGetRow(static_item.ITEM_STAT_BALANCE_TABLE, itemName); - if (itemData == null) - { - LOG( "create", itemName + "Buff Initalize could not happen because row in datatable is bad"); - return SCRIPT_CONTINUE; - } - - String buffName = itemData.getString("buff_name"); - String coolDownGroup = itemData.getString("cool_down_group"); - String clientEffect = itemData.getString("client_effect"); - String clientAnimation = itemData.getString("client_animation"); - int reuseTime = itemData.getInt("reuse_time"); - int requiredLevel = itemData.getInt("required_level_for_effect"); - - String varName = "clickItem."+ coolDownGroup; - - int buffTime = getIntObjVar(player, varName); - int playerLevel = getLevel(player); - - if (static_item.validateLevelRequired(player, requiredLevel)) - { - if (getGameTime() > buffTime || getGameTime() < buffTime && isGod(player)) - { - if (buff.canApplyBuff(player, buffName)) - { - - if (getGameTime() < buffTime && isGod(player)) - { - sendSystemMessage(player, "The Buff was applied because you were in god mode.", null); - } - - buff.applyBuff(player, buffName); - - setObjVar(player, varName, (getGameTime()+ (reuseTime))); - - sendCooldownGroupTimingOnly(player, getStringCrc(coolDownGroup.toLowerCase()), reuseTime); - sendSystemMessage(player, BUFF_APPLIED); - - doAnimationAction(player, clientAnimation); - playClientEffectObj(player, clientEffect, player, ""); - - if (getCount(self) > 0) - { - static_item.decrementStaticItem(self); - } - } - else - { - sendSystemMessage(player, CANT_APPLY_BUFF); - return SCRIPT_CONTINUE; - } - } - else - { - - int timeDiff = buffTime - getGameTime(); - prose_package pp = prose.getPackage( SID_NOT_YET, timeDiff ); - sendSystemMessageProse( player, pp ); - return SCRIPT_CONTINUE; - } - } - else - { - sendSystemMessage(player, SID_ITEM_LEVEL_TOO_LOW); - } - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/clicky_biolink_item.java b/sku.0/sys.server/compiled/game/script/item/clicky_biolink_item.java deleted file mode 100644 index 179f76b0c..000000000 --- a/sku.0/sys.server/compiled/game/script/item/clicky_biolink_item.java +++ /dev/null @@ -1,184 +0,0 @@ -package script.item; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.sui; -import script.library.utils; -import script.library.combat; - - -public class clicky_biolink_item extends script.base_script -{ - public clicky_biolink_item() - { - } - public static final String VAR_TEMP_BASE = "biotemp"; - - public static final string_id SID_ITEM_BIO_LINKED = new string_id("base_player", "item_bio_linked"); - public static final string_id SID_MUST_USE_FROM_INVENTORY = new string_id("base_player", "must_biolink_to_use_from_inventory"); - public static final string_id SID_MUST_BIO_LINK_FROM_INVENTORY = new string_id("base_player", "must_bio_link_from_inventory"); - public static final string_id SID_BIO_LINK = new string_id("ui_radial", "bio_link"); - public static final string_id SID_BIO_LINK_MSG_PROMPT = new string_id("sui", "bio_link_item_prompt"); - public static final string_id SID_BIO_LINK_MSG_TITLE = new string_id("sui", "bio_link_item_title"); - public static final string_id SID_SPECIES_CANNOT_EQUIP = new string_id("base_player", "species_cannot_equip"); - public static final string_id SID_NO_DROP_TRADE_BIOLINKED_ITEM = new string_id("base_player", "bio_link_no_drop_trade"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == null || biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - setBioLink(self, null); - } - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == null) - { - setBioLink(self, null); - } - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == null) - { - setBioLink(self, null); - biolink = utils.OBJ_ID_BIO_LINK_PENDING; - } - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING && isPlayer(destContainer)) - { - - if (utils.getContainingPlayer(self) != destContainer) - { - sendSystemMessage(destContainer, SID_MUST_USE_FROM_INVENTORY); - return SCRIPT_OVERRIDE; - } - - int pid = sui.msgbox(self, destContainer, "@"+ SID_BIO_LINK_MSG_PROMPT, sui.YES_NO, "@"+ SID_BIO_LINK_MSG_TITLE, "handleEquipBioLinkSui"); - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - - if (isIdValid(player) && utils.getContainingPlayer(self) == player) - { - item.addRootMenu(menu_info_types.BIO_LINK, SID_BIO_LINK); - return SCRIPT_CONTINUE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item == menu_info_types.BIO_LINK) - { - obj_id biolink = getBioLink(self); - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - - if (isIdValid(player) && utils.getContainingPlayer(self) == player) - { - _bioLinkItem(self, player, false, true); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int handleEquipBioLinkSui(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - _bioLinkItem(self, player, true, true); - return SCRIPT_CONTINUE; - } - - - public boolean _bioLinkItem(obj_id self, obj_id player, boolean equipAfterLink, boolean queryPlayer) throws InterruptedException - { - if (!isIdValid(self) || !isIdValid(player)) - { - CustomerServiceLog("NonFaction", "WARNING: biolink_item._bioLinkItem called with invalid player (%TU) or item ("+ self + ")", player); - return false; - } - - obj_id biolink = getBioLink(self); - if (biolink != utils.OBJ_ID_BIO_LINK_PENDING) - { - CustomerServiceLog("NonFaction", "WARNING: Player %TU trying to bio-link item "+ self + " that has link id "+ biolink, player); - return false; - } - - if (utils.getContainingPlayer(self) != player) - { - sendSystemMessage(player, SID_MUST_BIO_LINK_FROM_INVENTORY); - return false; - } - - String template = getTemplateName(self); - if ((template.startsWith("object/tangible/wearables/") ) && (!canEquipWearable(player, self) )) - { - sendSystemMessage(player, SID_SPECIES_CANNOT_EQUIP); - return false; - } - - if (isWeapon(self)) - { - if (!combat.hasCertification(player, self)) - { - sendSystemMessage(player, SID_SPECIES_CANNOT_EQUIP); - return false; - } - } - - setBioLink(self, player); - prose_package pp = new prose_package(); - pp.stringId = SID_ITEM_BIO_LINKED; - sendSystemMessageProse(player, pp); - sendDirtyObjectMenuNotification(self); - - if (equipAfterLink) - { - equip(self, player); - } - - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/item/droid/serving_droid.java b/sku.0/sys.server/compiled/game/script/item/droid/serving_droid.java deleted file mode 100644 index d8564ad88..000000000 --- a/sku.0/sys.server/compiled/game/script/item/droid/serving_droid.java +++ /dev/null @@ -1,847 +0,0 @@ -package script.item.droid; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.hue; -import script.library.sui; -import script.library.utils; -import script.library.player_structure; - - -public class serving_droid extends script.base_script -{ - public serving_droid() - { - } - public static final int MAX_WAYPOINTS = 20; - - public static final String OBJVAR_DROID_PATROL_POINTS = "droid.patrolPoints"; - public static final String OBJVAR_DROID_PATROL_LOOP = "droid.patrol_loop"; - public static final String OBJVAR_DROID_PATROL_ONCE = "droid.patrol_once"; - public static final String DROID_MOVING = "droid.moving"; - public static final String DROID_SETTING_PATROL = "droid.settingPatrol"; - public static final String SCRIPTVAR_DROID_HELP_MENU = "droid.helpmenu"; - public static final String TERMINAL_DROID_ID = "droid.id"; - - public static final String MENU_FILE = "pet/pet_menu"; - public static final string_id SYS_PATROL_ADDED = new string_id(MENU_FILE,"patrol_added"); - public static final string_id SYS_PATROL_REMOVED = new string_id(MENU_FILE,"patrol_removed"); - public static final string_id SETPATROLPOINT = new string_id(MENU_FILE,"menu_set_patrol_point"); - public static final string_id CLEARPOINTS = new string_id(MENU_FILE,"menu_clear_patrol_points"); - public static final string_id CLEAR_LAST = new string_id(MENU_FILE,"patrol_clear_last"); - public static final string_id PROGRAM = new string_id(MENU_FILE,"droid_options"); - public static final string_id HELP = new string_id(MENU_FILE,"serving_droid_menu_help"); - public static final string_id PATROL_OPTIONS = new string_id(MENU_FILE, "patrol_setting"); - public static final string_id PATROL = new string_id(MENU_FILE,"menu_patrol"); - public static final string_id ONCE = new string_id(MENU_FILE,"patrol_once"); - public static final string_id LOOP = new string_id(MENU_FILE,"patrol_loop"); - public static final string_id PCOLOR = new string_id("sui", "set_primary_color"); - public static final string_id SCOLOR = new string_id("sui", "set_secondary_color"); - public static final string_id ASTROMECH_NOT_OWNER = new string_id(MENU_FILE,"serving_droid_not_owner"); - public static final string_id ASTROMECH_NO_WAYPOINTS = new string_id(MENU_FILE,"serving_droid_no_waypoints"); - public static final string_id ASTROMECH_MAX_WAYPOINTS = new string_id(MENU_FILE,"serving_droid_max_waypoints"); - public static final string_id ASTROMECH_NOT_IN_HOUSE = new string_id(MENU_FILE,"serving_droid_not_in_house"); - public static final string_id ASTROMECH_WAYPOINTS_NOT_CLEAR = new string_id(MENU_FILE,"serving_droid_waypoints_not_cleared"); - - public static final String INFO_UI_TITLE = localize(new string_id( "sui", "serving_droid_sui_title")); - public static final String INFO_UI_TEXT = localize(new string_id( "sui", "serving_droid_sui_text")); - public static final String TEST_PATROL = localize(new string_id( "sui", "serving_droid_sui_test_button")); - public static final String CLOSE = localize(new string_id( "sui", "close")); - - - public int OnDestroy(obj_id self) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(self, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - obj_id house = getObjIdObjVar(droid, "house"); - if (isValidId(house) && exists(house)) - { - removeObjVar(house, "serving_droid.droid"); - if (hasScript(house, "structure.serving_droid_control")) - { - detachScript(house, "structure.serving_droid_control"); - } - } - removeObjVar(terminal, TERMINAL_DROID_ID); - return SCRIPT_CONTINUE; - } - - - public int OnMovePathComplete(obj_id self) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - utils.removeScriptVar(droid, DROID_MOVING); - return SCRIPT_CONTINUE; - } - - - public int OnMoveMoving(obj_id self) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - utils.setScriptVar(droid, DROID_MOVING, true); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - messageTo(droid, "initializeDroidVariables", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - obj_id droid = self; - if (!isIdValid(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal) || !exists(terminal)) - { - destroyObject(droid); - } - if (utils.isNestedWithinAPlayer(droid)) - { - messageTo(terminal, "destroyDroid", null, 1, false); - return SCRIPT_CONTINUE; - } - mi.addRootMenu(menu_info_types.ITEM_ACTIVATE, PATROL); - mi.addRootMenu(menu_info_types.SERVER_MENU1, HELP); - - int mnuColor = mi.addRootMenu(menu_info_types.SERVER_MENU2, PROGRAM); - mi.addSubMenu(mnuColor, menu_info_types.SERVER_MENU3, PCOLOR); - mi.addSubMenu(mnuColor, menu_info_types.SERVER_MENU4, SCOLOR); - - int mnuProgram = mi.addRootMenu(menu_info_types.SERVER_MENU5, PATROL_OPTIONS); - mi.addSubMenu(mnuProgram, menu_info_types.SERVER_MENU6, SETPATROLPOINT); - mi.addSubMenu(mnuProgram, menu_info_types.SERVER_MENU7, CLEARPOINTS); - mi.addSubMenu(mnuProgram, menu_info_types.SERVER_MENU10, CLEAR_LAST); - mi.addSubMenu(mnuProgram, menu_info_types.SERVER_MENU8, ONCE); - mi.addSubMenu(mnuProgram, menu_info_types.SERVER_MENU9, LOOP); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - if (utils.isNestedWithinAPlayer(droid)) - { - messageTo(terminal, "destroyDroid", null, 1, false); - return SCRIPT_CONTINUE; - } - - if (player != getObjIdObjVar(terminal, "biolink.id")) - { - - sendSystemMessage(player, ASTROMECH_NOT_OWNER); - return SCRIPT_CONTINUE; - } - - sendDirtyObjectMenuNotification(droid); - - if (item == menu_info_types.SERVER_MENU1) - { - createHelpDialog(droid, player); - } - if (item == menu_info_types.SERVER_MENU3) - { - sui.colorize(droid, player, droid, hue.INDEX_1, "handlePrimaryColorize"); - } - if (item == menu_info_types.SERVER_MENU4) - { - sui.colorize(droid, player, droid, hue.INDEX_2, "handleSecondaryColorize"); - } - if (item == menu_info_types.SERVER_MENU5) - { - - } - if (item == menu_info_types.SERVER_MENU6) - { - doSetPatrolPoint(droid, player); - } - if (item == menu_info_types.SERVER_MENU7) - { - doClearPatrolPoints(droid, player); - } - if (item == menu_info_types.SERVER_MENU8) - { - setPatrolOnce(droid, player, terminal); - } - if (item == menu_info_types.SERVER_MENU9) - { - setPatrolLoop(droid, player, terminal); - } - if (item == menu_info_types.SERVER_MENU10) - { - removeLastPatrolPoint(droid, player); - } - if (item == menu_info_types.ITEM_ACTIVATE) - { - if (utils.hasScriptVar(droid, DROID_MOVING) && !utils.hasScriptVar(droid, DROID_SETTING_PATROL)) - { - stop(droid); - utils.removeScriptVar(droid, DROID_MOVING); - } - else - { - doPatrol(droid, player); - } - } - return SCRIPT_CONTINUE; - } - - - public int handlePrimaryColorize(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getColorPickerIndex(params); - int bp = sui.getIntButtonPressed(params); - obj_id player = sui.getPlayerId(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - if (idx > -1) - { - - colorPrimary(droid, terminal, idx); - } - return SCRIPT_CONTINUE; - } - - - public int handleSecondaryColorize(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getColorPickerIndex(params); - int bp = sui.getIntButtonPressed(params); - obj_id player = sui.getPlayerId(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - if (idx > -1) - { - - colorSecondary(droid, terminal, idx); - } - return SCRIPT_CONTINUE; - } - - - public int getUserOidSetFirstPoint(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(droid, "user"); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - doSetPatrolPoint(droid, player); - return SCRIPT_CONTINUE; - } - - - public int pathDirectlyToStart(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc != null) - { - stop(droid); - pathTo(droid, patrolLoc[0]); - } - return SCRIPT_CONTINUE; - } - - - public int fromLastPointGoBackToStart(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc != null) - { - int patrolLength = patrolLoc.length; - location[] temp = new location[patrolLength]; - for (int i = 0; i < patrolLength; ++i) - { - testAbortScript(); - temp[i] = patrolLoc[(patrolLength-1)-i]; - } - - patrolOnce(droid, temp); - } - return SCRIPT_CONTINUE; - } - - - public int handleActivateDroid(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(droid, "user"); - doPatrol(droid); - return SCRIPT_CONTINUE; - } - - - public int handleDeactivateDroid(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(droid, "user"); - - stop(droid); - if (utils.hasScriptVar(droid, DROID_MOVING)) - { - utils.removeScriptVar(droid, DROID_MOVING); - } - - return SCRIPT_CONTINUE; - } - - - public int reColorDroid(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(terminal, "color.primary") && !hasObjVar(terminal, "color.secondary")) - { - setObjVar(terminal, "color.primary", 0); - setObjVar(terminal, "color.secondary",22); - } - - int primary = getIntObjVar(terminal, "color.primary"); - int secondary = getIntObjVar(terminal, "color.secondary"); - - if (primary < 0 || secondary < 0) - { - return SCRIPT_CONTINUE; - } - - hue.setColor(droid, "/private/index_color_1", primary); - hue.setColor(droid, "/private/index_color_2", secondary); - - return SCRIPT_CONTINUE; - } - - - public int initializeDroidVariables(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - obj_id house = getTopMostContainer(self); - - if (!isIdValid(droid)) - { - return SCRIPT_CONTINUE; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(house) || !player_structure.isBuilding(house) || utils.isNestedWithinAPlayer(droid)) - { - messageTo(terminal, "destroyDroid", null, 1, false); - return SCRIPT_CONTINUE; - } - setObjVar(droid, "house", house); - - if (!hasObjVar(terminal, OBJVAR_DROID_PATROL_POINTS)) - { - messageTo(droid, "getUserOidSetFirstPoint", null, 1, false); - } - - if (!hasScript(house, "structure.serving_droid_control")) - { - attachScript(house, "structure.serving_droid_control"); - } - - if (!hasObjVar(house, "serving_droid.droid")) - { - setObjVar(house, "serving_droid.droid", droid); - } - - if (hasObjVar(terminal, "color.primary")) - { - messageTo(droid, "reColorDroid", null, 0, false); - } - - listenToMessage(house, "handleActivateDroid"); - listenToMessage(house, "handleDeactivateDroid"); - return SCRIPT_CONTINUE; - } - - - public int handleDialogInput(obj_id self, dictionary params) throws InterruptedException - { - obj_id droid = self; - if (!isValidId(droid)) - { - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - utils.removeScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU); - } - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - utils.removeScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU); - } - return SCRIPT_CONTINUE; - } - int bp = sui.getIntButtonPressed(params); - switch (bp) - { - case sui.BP_OK: - doPatrol(droid, player); - return SCRIPT_CONTINUE; - - case sui.BP_CANCEL: - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - utils.removeScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU); - } - - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } - - - public boolean colorPrimary(obj_id droid, obj_id terminal, int idx) throws InterruptedException - { - setObjVar(terminal, "color.primary", idx); - hue.setColor(droid, "/private/index_color_1", idx); - return true; - } - - - public boolean colorSecondary(obj_id droid, obj_id terminal, int idx) throws InterruptedException - { - setObjVar(terminal, "color.secondary", idx); - hue.setColor(droid, "/private/index_color_2", idx); - return true; - } - - - public boolean doPatrol(obj_id droid) throws InterruptedException - { - if (!isValidId(droid)) - { - return false; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return false; - } - - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc == null) - { - return false; - } - - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_LOOP)) - { - ai_lib.setPatrolPath(droid, patrolLoc); - return true; - } - else - { - patrolOnce(droid, patrolLoc); - messageTo(droid, "fromLastPointGoBackToStart", null, 120, false); - return true; - } - } - - - public boolean doPatrol(obj_id droid, obj_id player) throws InterruptedException - { - if (!isValidId(droid) || !isValidId(player)) - { - return false; - } - - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - utils.removeScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU); - } - - if (utils.hasScriptVar(droid, DROID_SETTING_PATROL)) - { - utils.removeScriptVar(droid, DROID_SETTING_PATROL); - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return false; - } - - if (!hasObjVar(terminal, OBJVAR_DROID_PATROL_POINTS)) - { - sendSystemMessage(player, ASTROMECH_NO_WAYPOINTS); - return false; - } - - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc == null) - { - return false; - } - - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_LOOP)) - { - ai_lib.setPatrolPath(droid, patrolLoc); - return true; - } - else - { - patrolOnce(droid, patrolLoc); - messageTo(droid, "fromLastPointGoBackToStart", null, 120, false); - return true; - } - } - - - public void doSetPatrolPoint(obj_id droid, obj_id player) throws InterruptedException - { - if (!isValidId(droid) || !isValidId(player)) - { - return; - } - - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - utils.removeScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU); - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return; - } - - if (!utils.hasScriptVar(droid, DROID_SETTING_PATROL)) - { - utils.setScriptVar(droid, DROID_SETTING_PATROL, true); - } - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc == null) - { - patrolLoc = new location[1]; - } - else if (patrolLoc.length < MAX_WAYPOINTS) - { - location[] temp = new location[patrolLoc.length + 1]; - for (int i = 0; i < patrolLoc.length; ++i) - { - testAbortScript(); - temp[i] = patrolLoc[i]; - } - patrolLoc = temp; - } - else - { - sendSystemMessage(player, ASTROMECH_MAX_WAYPOINTS); - return; - } - - location playerLoc = getLocation(player); - if (!isValidId(playerLoc.cell)) - { - sendSystemMessage(player, ASTROMECH_NOT_IN_HOUSE); - return; - } - patrolLoc[patrolLoc.length - 1] = playerLoc; - - setObjVar(terminal, OBJVAR_DROID_PATROL_POINTS, patrolLoc); - - sendSystemMessage(player, SYS_PATROL_ADDED); - sendConsoleMessage(player, "Patrol points left: "+(MAX_WAYPOINTS - patrolLoc.length)); - - pathTo(droid, playerLoc); - } - - - public void doClearPatrolPoints(obj_id droid, obj_id player) throws InterruptedException - { - if (!isValidId(droid) || !isValidId(player)) - { - return; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return; - } - - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_POINTS)) - { - removeObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - sendSystemMessage(player, SYS_PATROL_REMOVED); - - ai_lib.clearPatrolPath(droid); - stop(droid); - messageTo( droid, "resumeDefaultCalmBehavior", null, 1, false ); - } - else - { - sendSystemMessage(player, ASTROMECH_WAYPOINTS_NOT_CLEAR); - } - } - - - public void removeLastPatrolPoint(obj_id droid, obj_id player) throws InterruptedException - { - if (!isValidId(droid) || !isValidId(player)) - { - return; - } - - obj_id terminal = getObjIdObjVar(droid, "terminal"); - if (!isValidId(terminal)) - { - return; - } - - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_POINTS)) - { - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc == null) - { - sendSystemMessage(player, ASTROMECH_WAYPOINTS_NOT_CLEAR); - } - else if (patrolLoc.length > 0) - { - location[] temp = new location[patrolLoc.length-1]; - for (int i = 0; i < patrolLoc.length-1; ++i) - { - testAbortScript(); - temp[i] = patrolLoc[i]; - } - patrolLoc = temp; - setObjVar(terminal, OBJVAR_DROID_PATROL_POINTS, patrolLoc); - sendSystemMessage(player, SYS_PATROL_ADDED); - sendConsoleMessage(player, "Patrol points left: "+(MAX_WAYPOINTS - patrolLoc.length)); - } - - location playerLoc = getLocation(player); - - if (isValidId(playerLoc.cell)) - { - pathTo(droid, playerLoc); - return; - } - } - } - - - public boolean setPatrolLoop(obj_id droid, obj_id player, obj_id terminal) throws InterruptedException - { - if (!isValidId(droid) || !isValidId(player)) - { - return false; - } - - if (!isValidId(terminal) || !isValidId(terminal)) - { - return false; - } - - if (!hasObjVar(terminal, OBJVAR_DROID_PATROL_LOOP)) - { - setObjVar(terminal, OBJVAR_DROID_PATROL_LOOP, true); - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_ONCE)) - { - removeObjVar(terminal, OBJVAR_DROID_PATROL_ONCE); - } - sendConsoleMessage(player, "Patrol loop setting applied."); - if (utils.hasScriptVar(droid, DROID_MOVING)) - { - stop(droid); - doPatrol(droid, player); - } - - return true; - } - return false; - } - - - public boolean setPatrolOnce(obj_id droid, obj_id player, obj_id terminal) throws InterruptedException - { - if (!hasObjVar(terminal, OBJVAR_DROID_PATROL_ONCE)) - { - setObjVar(terminal, OBJVAR_DROID_PATROL_ONCE, true); - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_LOOP)) - { - removeObjVar(terminal, OBJVAR_DROID_PATROL_LOOP); - } - sendConsoleMessage(player, "Patrol once only setting applied."); - if (utils.hasScriptVar(droid, DROID_MOVING)) - { - stop(droid); - doPatrol(droid, player); - } - return true; - } - return false; - } - - - public int createHelpDialog(obj_id droid, obj_id player) throws InterruptedException - { - if (utils.hasScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU)) - { - return -1; - } - - if (!isIdValid(player)) - { - return -1; - } - if (!isIdValid(droid)) - { - return -1; - } - - int pid = sui.createSUIPage( sui.SUI_MSGBOX, droid, player, "handleDialogInput"); - - sui.setSUIProperty( pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, INFO_UI_TEXT ); - sui.setSUIProperty (pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, INFO_UI_TITLE ); - - sui.msgboxButtonSetup( pid, sui.OK_CANCEL ); - sui.setSUIProperty( pid, sui.MSGBOX_BTN_CANCEL, sui.PROP_TEXT, CLOSE); - sui.setSUIProperty( pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, TEST_PATROL); - - sui.showSUIPage(pid); - utils.setScriptVar(droid, SCRIPTVAR_DROID_HELP_MENU, true); - return pid; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/droid/serving_droid_terminal.java b/sku.0/sys.server/compiled/game/script/item/droid/serving_droid_terminal.java deleted file mode 100644 index 4fbb4641c..000000000 --- a/sku.0/sys.server/compiled/game/script/item/droid/serving_droid_terminal.java +++ /dev/null @@ -1,449 +0,0 @@ -package script.item.droid; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.player_structure; -import script.library.utils; - - -public class serving_droid_terminal extends script.base_script -{ - public serving_droid_terminal() - { - } - public static final String DROIDTEMPLATE = "object/creature/npc/droid/serving_droid.iff"; - - public static final String MENU_FILE = "pet/pet_menu"; - public static final string_id TERMINAL_NAME = new string_id(MENU_FILE,"serving_droid_terminal_custom_name"); - public static final string_id ASTROMECH_NAME = new string_id(MENU_FILE,"serving_droid_custom_name"); - public static final string_id ASTROMECH_BIOLINK_NEEDED = new string_id(MENU_FILE,"serving_droid_biolink_needed"); - public static final string_id ASTROMECH_NOT_INVENTORY = new string_id(MENU_FILE,"serving_droid_not_inventory"); - public static final string_id ASTROMECH_NOT_OWNER = new string_id(MENU_FILE,"serving_droid_not_owner"); - public static final string_id ASTROMECH_NOT_IN_HOUSE = new string_id(MENU_FILE,"serving_droid_not_in_house"); - - public static final string_id SUMMON = new string_id("sui", "summon_droid"); - public static final string_id DESTROY = new string_id("sui", "destroy_droid"); - - public static final String OBJVAR_DROID_PATROL_POINTS = "droid.patrolPoints"; - public static final String OBJVAR_DROID_PATROL_LOOP = "droid.patrol_loop"; - public static final String OBJVAR_DROID_PATROL_ONCE = "droid.patrol_once"; - public static final String DROID_ID = "droid.id"; - public static final String DROID_NAMED = "droid.named"; - public static final String PLAYER = "droid.user"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - obj_id terminal = self; - obj_id droid = getObjIdObjVar(terminal, DROID_ID); - - if (!isValidId(droid)) - { - removeObjVar(terminal, DROID_ID); - } - else if (!exists(droid)) - { - boolean created = recreateDroid(terminal); - if (!created) - { - removeObjVar(terminal, DROID_ID); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - obj_id terminal = self; - obj_id droid = getObjIdObjVar(terminal, DROID_ID); - if (!isValidId(droid)) - { - return SCRIPT_CONTINUE; - } - - destroyObject(droid); - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - obj_id terminal = self; - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(terminal, DROID_ID) && exists(terminal)) - { - messageTo(terminal, "destroyDroid", null, 1, false); - } - - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_POINTS) && exists(terminal)) - { - removeObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - } - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_LOOP) && exists(terminal)) - { - removeObjVar(terminal, OBJVAR_DROID_PATROL_LOOP); - } - if (hasObjVar(terminal, OBJVAR_DROID_PATROL_ONCE) && exists(terminal)) - { - removeObjVar(terminal, OBJVAR_DROID_PATROL_ONCE); - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - obj_id terminal = self; - if (!exists(terminal)) - { - return SCRIPT_CONTINUE; - } - - if (utils.isInVendor(terminal) || utils.isInBazaar(terminal)) - { - return SCRIPT_CONTINUE; - } - - obj_id ownerContainer = getTopMostContainer(terminal); - if (!isValidId(ownerContainer) || !exists(ownerContainer)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isBuilding(ownerContainer) && !isPlayer(ownerContainer)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(terminal, DROID_ID)) - { - mi.addRootMenu(menu_info_types.ITEM_USE, DESTROY); - } - else - { - mi.addRootMenu(menu_info_types.ITEM_USE, SUMMON); - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - obj_id terminal = self; - obj_id biolink = getBioLink(terminal); - - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - sendDirtyObjectMenuNotification(terminal); - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!isValidId(biolink) || biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - sendSystemMessage(player, ASTROMECH_BIOLINK_NEEDED); - return SCRIPT_CONTINUE; - } - - if (utils.isNestedWithinAPlayer(terminal)) - { - sendSystemMessage(player, ASTROMECH_NOT_INVENTORY); - return SCRIPT_CONTINUE; - } - - if (player != getObjIdObjVar(terminal, "biolink.id")) - { - sendSystemMessage(player, ASTROMECH_NOT_OWNER); - return SCRIPT_CONTINUE; - } - if (!utils.isInHouseCellSpace(terminal)) - { - sendSystemMessage(player, ASTROMECH_NOT_IN_HOUSE); - return SCRIPT_CONTINUE; - } - if (!hasObjVar(terminal, DROID_ID)) - { - utils.setScriptVar(terminal, "terminal.summon", true); - boolean droidCreated = createDroid(terminal, player); - if (!droidCreated) - { - removeObjVar(terminal, DROID_ID); - } - } - else - { - messageTo(terminal, "destroyDroid", null, 1, false); - } - - return SCRIPT_CONTINUE; - } - - - public int destroyDroid(obj_id self, dictionary params) throws InterruptedException - { - obj_id terminal = self; - if (!isValidId(terminal)) - { - return SCRIPT_CONTINUE; - } - - obj_id player = getObjIdObjVar(terminal, "biolink.id"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id droid = getObjIdObjVar(terminal, DROID_ID); - if (isValidId(droid) && exists(droid)) - { - obj_id house = getObjIdObjVar(droid, "house"); - if (!isValidId(house) || !exists(house)) - { - return SCRIPT_CONTINUE; - } - - removeObjVar(house, "serving_droid.droid"); - if (hasScript(house, "structure.serving_droid_control")) - { - detachScript(house, "structure.serving_droid_control"); - } - - destroyObject(droid); - } - removeObjVar(terminal, DROID_ID); - sendConsoleMessage(player, "Droid retired."); - - return SCRIPT_CONTINUE; - } - - - public boolean nameTerminal(obj_id terminal) throws InterruptedException - { - if (!isValidId(terminal)) - { - return false; - } - obj_id user = getObjIdObjVar(terminal, "biolink.id"); - String text = getName(user) + localize(TERMINAL_NAME); - setName(terminal, text); - setObjVar(terminal, DROID_NAMED, true); - return true; - } - - - public boolean setDroidVars(obj_id terminal, obj_id droid) throws InterruptedException - { - if (!isValidId(terminal) || !exists(terminal)) - { - return false; - } - - if (!isValidId(droid) || !exists(droid)) - { - return false; - } - - obj_id user = getObjIdObjVar(terminal, "biolink.id"); - setInvulnerable(droid, true); - - setObjVar(terminal, DROID_ID, droid); - setObjVar(droid, "terminal", terminal); - setObjVar(droid, PLAYER, user); - messageTo(droid, "reColorDroid", null, 0, false); - setName(droid, getName(user) + localize(ASTROMECH_NAME)); - return true; - } - - - public boolean createDroid(obj_id terminal, obj_id player) throws InterruptedException - { - - if (!isValidId(terminal) || !exists(terminal)) - { - return false; - } - - obj_id anotherDroid = getObjIdObjVar(terminal, DROID_ID); - - if (isValidId(anotherDroid) && exists(anotherDroid)) - { - return false; - } - - obj_id house = getTopMostContainer(terminal); - if (!isIdValid(house) && !exists(house)) - { - return false; - } - - if (!player_structure.isBuilding(house)) - { - return false; - } - - if (!hasScript(house, "structure.serving_droid_control")) - { - attachScript(house, "structure.serving_droid_control"); - listenToMessage(house, "handleActivateDroid"); - } - - location startLocation = new location(); - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc == null) - { - - location playerLoc = getLocation(player); - if (!isValidId(playerLoc.cell)) - { - startLocation = getLocation(terminal); - } - else - { - startLocation = getLocation(player); - } - } - else - { - - boolean validList = validLocationList(terminal, patrolLoc); - if (!validList) - { - return false; - } - - startLocation = patrolLoc[0]; - } - - obj_id droid = createObject(DROIDTEMPLATE, startLocation); - if (patrolLoc != null) - { - messageTo(droid, "handleActivateDroid", null, 1, false); - } - - if (!isIdValid(droid) && !exists(droid)) - { - return false; - } - - setDroidVars(terminal, droid); - - if (utils.hasScriptVar(terminal, "terminal.summon")) - { - sendConsoleMessage(player, "Droid summoned."); - utils.removeScriptVar(terminal, "terminal.summon"); - } - if (!hasObjVar(terminal, DROID_NAMED)) - { - nameTerminal(terminal); - } - - return true; - } - - - public boolean recreateDroid(obj_id terminal) throws InterruptedException - { - obj_id anotherDroid = getObjIdObjVar(terminal, DROID_ID); - - if (isValidId(anotherDroid) && exists(anotherDroid)) - { - return false; - } - - obj_id house = getTopMostContainer(terminal); - if (!isIdValid(house) && !exists(house)) - { - return false; - } - - if (!player_structure.isBuilding(house)) - { - return false; - } - - if (!hasScript(house, "structure.serving_droid_control")) - { - attachScript(house, "structure.serving_droid_control"); - listenToMessage(house, "handleActivateDroid"); - } - - location startLocation = new location(); - location[] patrolLoc = getLocationArrayObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - if (patrolLoc == null) - { - return false; - } - - boolean validList = validLocationList(terminal, patrolLoc); - if (!validList) - { - return false; - } - - startLocation = patrolLoc[0]; - - obj_id droid = createObject(DROIDTEMPLATE, startLocation); - messageTo(droid, "handleActivateDroid", null, 1, false); - - if (!isIdValid(droid) && !exists(droid)) - { - return false; - } - - setDroidVars(terminal, droid); - - if (utils.hasScriptVar(terminal, "terminal.summon")) - { - utils.removeScriptVar(terminal, "terminal.summon"); - } - if (!hasObjVar(terminal, DROID_NAMED)) - { - nameTerminal(terminal); - } - - return true; - } - - - public boolean validLocationList(obj_id terminal, location[] patrolLocations) throws InterruptedException - { - if (patrolLocations == null) - { - return false; - } - - for (int i = 0; i < patrolLocations.length; ++i) - { - testAbortScript(); - if (!isValidId(patrolLocations[i].cell)) - { - removeObjVar(terminal, OBJVAR_DROID_PATROL_POINTS); - return false; - } - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/fryer.java b/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/fryer.java deleted file mode 100644 index 203b9b4c1..000000000 --- a/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/fryer.java +++ /dev/null @@ -1,641 +0,0 @@ -package script.item.ice_cream_fryer; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.util.HashSet; -import script.library.collection; -import script.library.create; -import script.library.prose; -import script.library.static_item; -import script.library.sui; -import script.library.utils; - - -public class fryer extends script.base_script -{ - public fryer() - { - } - public static final int NO_DECAY = 100; - public static final int MAX_DECAY = 6; - public static final int BASIC_BUFF_ROWS = 3; - - public static final String ITEM_COMBINATION_TABLE = "datatables/item/ice_cream_fryer/fryer_components.iff"; - - public static final String STRING_FILE = "dispenser"; - public static final string_id SID_BIOLINK_NEEDED = new string_id(STRING_FILE,"biolink_needed"); - public static final string_id SID_ACTIVATE = new string_id(STRING_FILE, "fry"); - public static final string_id SID_NOT_OWNER = new string_id(STRING_FILE,"not_owner"); - public static final string_id SID_FRYER_FAILURE = new string_id(STRING_FILE,"fryer_failure"); - public static final string_id SID_FRYER_SUCCESS = new string_id(STRING_FILE,"fryer_successful"); - public static final string_id SID_FRYER_BROKEN = new string_id(STRING_FILE,"fryer_broken"); - public static final string_id SID_FRYER_REPAIRED = new string_id(STRING_FILE,"fryer_repaired"); - public static final string_id SID_NO_TOOL_FRYER = new string_id(STRING_FILE,"no_tool_fryer"); - - public static final String OWNER_OID = "owner"; - public static final String DECAY = "decay"; - public static final String FORAGE_BUFF = "item_ice_cream_buff_forage_buff_01_01"; - public static final String PID_NAME = "fryer_repair"; - public static final int DOMESTICS_ONLY_BUFF = 7; - - - public int OnReceivedItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - - if (getTemplateName(item).startsWith("object/tangible/component/food/component_fryer_repair_tool.iff")) - { - CustomerServiceLog("ice_cream_fryer", "Ice Cream Fryer Container "+srcContainer+" has received a repair tool from "+ transferer); - - repairFryerPopup(self, item, transferer); - return SCRIPT_CONTINUE; - } - - double ingredientCRC = 0; - if (utils.hasScriptVar(self,"ingredientCRC")) - {; - } - { - ingredientCRC = utils.getDoubleScriptVar(self, "ingredientCRC"); - blog("OnReceivedItem - found a pre-existing CRC. It was: "+ ingredientCRC); - } - - ingredientCRC = ingredientCRC + getStringCrc(getTemplateName(item)); - - blog("OnReceivedItem - calculating a new CRC. New item was: "+getStringCrc(getTemplateName(item))+" and new total is: "+ingredientCRC); - - utils.setScriptVar(self, "ingredientCRC", ingredientCRC); - - return SCRIPT_CONTINUE; - } - - - public int OnLostItem(obj_id self, obj_id destContainer, obj_id transferer, obj_id item) throws InterruptedException - { - - blog("OnLostItem - entered"); - CustomerServiceLog("ice_cream_fryer", "Ice Cream Fryer has lost item "+item+" as it was transferred to container: "+destContainer+ " by "+transferer); - - double ingredientCRC = utils.getDoubleScriptVar(self, "ingredientCRC"); - ingredientCRC = ingredientCRC - getStringCrc(getTemplateName(item)); - - if (ingredientCRC < 0) - { - utils.setScriptVar(self, "ingredientCRC", 0); - } - else - { - utils.setScriptVar(self, "ingredientCRC", ingredientCRC); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - obj_id fryer = self; - - if (!hasObjVar(fryer, collection.ICE_CREAM_BUFF_ARRAY[2])) - { - if (!burnRandomRecipes(fryer)) - { - CustomerServiceLog("ice_cream_fryer", "Ice Cream Fryer has failed to receive recipes when player "+player+ " attempted to interact with it for the first time."); - blog("burnRandomRecipes - FAILED"); - return SCRIPT_CONTINUE; - } - - } - if (utils.isNestedWithin(fryer, player)) - { - return SCRIPT_CONTINUE; - } - - if (utils.isInHouseCellSpace(fryer)) - { - mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_ACTIVATE); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - - blog("OnObjectMenuSelect - entered"); - obj_id fryer = self; - - obj_id biolink = getBioLink(fryer); - - if (!isValidId(biolink) || biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - blog("activateFryer - FRYER BIOLINK PENDING"); - sendSystemMessage(player, SID_BIOLINK_NEEDED); - return SCRIPT_CONTINUE; - } - else if (biolink != player) - { - sendSystemMessage(player, SID_NOT_OWNER); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(fryer, collection.ICE_CREAM_BUFF_ARRAY[2])) - { - if (!burnRandomRecipes(fryer)) - { - blog("burnRandomRecipes - FAILED"); - return SCRIPT_CONTINUE; - } - - } - if (utils.isNestedWithin(fryer, player)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.SERVER_MENU1) - { - obj_id clients[] = new obj_id[1]; - clients[0] = player; - - blog("OnObjectMenuSelect - chose menu option 1"); - - blog("OnObjectMenuSelect - activating the assembly tool"); - obj_id newItem = activateFryer(self, player); - if (isIdValid(newItem)) - { - playClientEffectObj(clients, "sound/item_som_jenha_tar_cube_combine.snd", player, ""); - sendSystemMessage(player,SID_FRYER_SUCCESS); - decayFryer(fryer, player); - return SCRIPT_CONTINUE; - } - else - { - blog("OnObjectMenuSelect - obj_id we got back was invalid: "+newItem); - playClientEffectObj(clients, "sound/item_electronics_break.snd", player, ""); - sendSystemMessage(player, SID_FRYER_FAILURE); - decayFryer(fryer, player); - return SCRIPT_CONTINUE; - } - } - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int currentStatus = getIntObjVar(self, DECAY); - - names[idx] = "fryer_status"; - attribs[idx] = ""+currentStatus+"%"; - idx++; - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public obj_id activateFryer(obj_id fryer, obj_id objPlayer) throws InterruptedException - { - blog("activateFryer - entered"); - obj_id biolink = getBioLink(fryer); - - if (!isValidId(biolink) || biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - blog("activateFryer - FRYER BIOLINK PENDING"); - sendSystemMessage(objPlayer, SID_BIOLINK_NEEDED); - return null; - } - - else if (biolink != objPlayer) - { - sendSystemMessage(objPlayer, SID_NOT_OWNER); - return null; - } - - int currentStatus = getIntObjVar(fryer, DECAY); - if (currentStatus <= 0) - { - sendSystemMessage(objPlayer, SID_FRYER_BROKEN); - blog("activateFryer - FRYER BROKEN"); - return null; - } - - double ingredientCRC = calcCurrentContentsCRC(fryer); - if (ingredientCRC == 0) - { - blog("activateFryer - no ingredientCRC. Returning null"); - decayFryer(fryer, objPlayer); - return null; - } - - if (!utils.hasScriptVar(fryer, "itemCRCs")) - { - blog("activateFryer - made the crc table and stored it"); - utils.setScriptVar(fryer, "itemCRCs", makeItemCRCArray()); - } - - double[] itemCRCs = utils.getDoubleArrayScriptVar(fryer, "itemCRCs"); - - for (int i = 0; i < itemCRCs.length; i++) - { - testAbortScript(); - blog("activateFryer - looping through stored CRC array. This is loop number: "+i+" and there will be a total of around: "+itemCRCs.length); - - if (itemCRCs[i] != ingredientCRC) - { - continue; - } - - blog("activateFryer - Found a match in loop # "+i); - blog("activateFryer - CRC FOUND # "+itemCRCs[i]); - blog("activateFryer - CRC LOOKING FOR "+ingredientCRC); - - dictionary correctRow = dataTableGetRow(ITEM_COMBINATION_TABLE, i); - obj_id contents[] = getContents(fryer); - - obj_id generatedItem = createEdible(fryer, objPlayer, i); - if (!isIdValid(generatedItem)) - { - return null; - } - - CustomerServiceLog("ice_cream_fryer", "%TU has created an ice cream buff (id: "+ generatedItem + ")", objPlayer); - - for (int j = 0; j< contents.length; j++) - { - testAbortScript(); - blog("activateFryer - Going through each thing in the assembly tool. this is loop #: ->: "+j); - - if (contents[j] != generatedItem) - { - blog("activateFryer - found something that doesn't match the obj_id of the new item. Destroying it"); - destroyObject(contents[j]); - - } - } - - putInOverloaded(generatedItem, fryer); - - if (!hasObjVar(generatedItem, collection.FRYER_BUFF_TYPE) && getIntObjVar(generatedItem, collection.FRYER_BUFF_TYPE) != collection.ICE_CREAM_DOMESTICS_ONLY) - { - setObjVar(generatedItem, OWNER_OID, objPlayer); - } - return generatedItem; - } - return obj_id.NULL_ID; - } - - - public double[] makeItemCRCArray() throws InterruptedException - { - blog("makeItemCRCArray - entered"); - int numRows = dataTableGetNumRows(ITEM_COMBINATION_TABLE); - blog("makeItemCRCArray - there are this many rows in the table -> "+numRows); - - double[] crcs = new double[numRows]; - - for (int i = 0; i: "+contents.length); - for (int i = 0; i< contents.length; i++) - { - testAbortScript(); - ingredientCRC += getStringCrc(getTemplateName(contents[i])); - blog("calcCurrentContentsCRC - Loop Number: "+i+" and current ingredient CRC total is: "+ingredientCRC); - } - return ingredientCRC; - } - - - public boolean decayFryer(obj_id fryer, obj_id user) throws InterruptedException - { - if (!isValidId(fryer)) - { - return false; - } - - obj_id biolink = getBioLink(fryer); - - if (!isValidId(biolink) || biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - return false; - } - - if (biolink != user) - { - return false; - } - - int newDecay = 0; - int currentStatus = getIntObjVar(fryer, DECAY); - if (currentStatus > 0) - { - int decayAmount = rand(0, MAX_DECAY); - if (decayAmount == 0) - { - return true; - } - - if (decayAmount > currentStatus) - { - setObjVar(fryer, DECAY, 0); - blog("decayFryer - DECAY SET TO ZERO"); - return true; - } - - newDecay = currentStatus - decayAmount; - if (newDecay > 0) - { - setObjVar(fryer, DECAY, newDecay); - blog("decayFryer - DECAY SET TO: "+newDecay); - return true; - } - } - if (currentStatus < 0) - { - setObjVar(fryer, DECAY, 0); - } - - return false; - } - - - public boolean repairFryerPopup(obj_id fryer, obj_id repairTool, obj_id player) throws InterruptedException - { - if (!isValidId(fryer) || !isValidId(repairTool) || !isValidId(player)) - { - return false; - } - - if (sui.hasPid(player, PID_NAME)) - { - int pid = sui.getPid(player, PID_NAME); - forceCloseSUIPage(pid); - } - - utils.setScriptVar(fryer, "repairTool", repairTool); - int pid = sui.msgbox(fryer, player, "Selecting YES will repair the fryer. Selecting NO will cancel the operation.", sui.YES_NO, "Repair?", "repairFryer"); - sui.setPid(player, pid, PID_NAME); - - return true; - } - - - public int repairFryer(obj_id self, dictionary params) throws InterruptedException - { - - obj_id fryer = self; - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (!sui.hasPid(player, PID_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(fryer, "repairTool")) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - sui.removePid(player, PID_NAME); - utils.removeScriptVar(fryer, "repairTool"); - return SCRIPT_CONTINUE; - } - - obj_id repairTool = utils.getObjIdScriptVar(fryer, "repairTool"); - if (!isIdValid(repairTool)) - { - return SCRIPT_CONTINUE; - } - - obj_id toolContainer = getContainedBy(repairTool); - if (toolContainer != fryer) - { - sendSystemMessage(player, SID_NO_TOOL_FRYER); - return SCRIPT_CONTINUE; - } - - setObjVar(fryer, DECAY, NO_DECAY); - sendSystemMessage(player, SID_FRYER_REPAIRED); - destroyObject(repairTool); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String message) throws InterruptedException - { - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_buff.java b/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_buff.java deleted file mode 100644 index f8c70c78c..000000000 --- a/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_buff.java +++ /dev/null @@ -1,89 +0,0 @@ -package script.item.ice_cream_fryer; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.utils; - - -public class ice_cream_buff extends script.base_script -{ - public ice_cream_buff() - { - } - public static final String ALREADY_SETUP = "itemFoodScriptRemoved"; - public static final String ITEM_FOOD_SCRIPT = "item.food"; - public static final String OWNER_OID = "owner"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - - if (!hasObjVar(self, ALREADY_SETUP)) - { - blog("OnAttach - NO OBJVAR FOUND"); - - messageTo(self, "removeItemFoodScript", null, 2, false); - setObjVar(self, "ALREADY_SETUP", true); - } - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int iceCreamCategory = collection.ICE_CREAM_ALL_PLAYERS; - if (hasObjVar(self, collection.FRYER_BUFF_TYPE)) - { - iceCreamCategory = utils.getIntObjVar(self, collection.FRYER_BUFF_TYPE); - } - - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (iceCreamCategory != collection.ICE_CREAM_DOMESTICS_ONLY) - { - - names[idx] = "proc_name"; - attribs[idx] = ""; - idx++; - } - - names[idx] = "nonspecial_ingredient"; - attribs[idx] = "Cereal Flakes, Exceptional Milk, Exceptional Egg"; - idx++; - if (hasObjVar(self, "special_ingredient")) - { - String specialIngredient = getStringObjVar(self, "special_ingredient"); - string_id templateName = getNameFromTemplate(specialIngredient); - names[idx] = "special_ingredient"; - attribs[idx] = "@"+templateName; - idx++; - } - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int removeItemFoodScript(obj_id self, dictionary params) throws InterruptedException - { - detachScript(self, ITEM_FOOD_SCRIPT); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String message) throws InterruptedException - { - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_fail.java b/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_fail.java deleted file mode 100644 index 34f012cf0..000000000 --- a/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_fail.java +++ /dev/null @@ -1,269 +0,0 @@ -package script.item.ice_cream_fryer; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.utils; - - -public class ice_cream_fail extends script.base_script -{ - public ice_cream_fail() - { - } - public static final string_id SID_ALREADY_HAVE_BUFF = new string_id("base_player", "food_already_have_buff"); - public static final string_id SID_BUFF_WONT_STACK = new string_id("base_player", "food_buff_wont_stack"); - - public static final String ALREADY_SETUP = "itemFoodScriptRemoved"; - public static final String ITEM_FOOD_SCRIPT = "item.food"; - public static final String BUFF_NAME = "ice_cream_debuff"; - - public static final String OWNER_OID = "owner"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, ALREADY_SETUP)) - { - blog("OnAttach - NO OBJVAR FOUND"); - - messageTo(self, "setUpBuff", null, 3, false); - messageTo(self, "removeItemFoodScript", null, 3, false); - } - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "manf_attribs"; - attribs[idx] = ""; - idx++; - - return super.OnGetAttributes(self, player, names, attribs); - - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - menu_info_data mid = mi.getMenuItemByType(menu_info_types.ITEM_USE); - if (mid != null) - { - mid.setServerNotify(true); - } - - mid = mi.getMenuItemByType(menu_info_types.EXAMINE); - if (mid != null) - { - mid.setServerNotify(true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.ITEM_USE) - { - eat(self, player); - } - - return SCRIPT_CONTINUE; - } - - - public void eat(obj_id self, obj_id player) throws InterruptedException - { - if (!isIdValid(self) || !isIdValid(player)) - { - return; - } - - if (buff.hasBuff(player, "spice_downer")) - { - return; - } - - obj_id owner = getObjIdObjVar(self, OWNER_OID); - if (player != owner) - { - sendSystemMessageTestingOnly(player, "temp message: you cannot eat this item. "); - return; - } - - String buff_name = getStringObjVar(self, "buff_name"); - int[] filling = new int[2]; - - if (hasObjVar(self, "filling")) - { - filling = getIntArrayObjVar(self, "filling"); - } - else if (hasObjVar(self, "filling_type") && hasObjVar(self, "filling_amount")) - { - filling[0] = 0; - filling[1] = 0; - } - else - { - filling[0] = 0; - filling[1] = 0; - } - - if (buff_name == null || buff_name.equals("")) - { - return; - } - - if (hasObjVar(self, "pet_only")) - { - - return; - } - - float eff = 1f; - float dur = 1f; - - if (hasObjVar(self, "effectiveness")) - { - eff = getFloatObjVar(self, "effectiveness"); - } - - if (hasObjVar(self, "duration")) - { - dur = getFloatObjVar(self, "duration"); - } - - boolean success = true; - - if (!buff.canApplyBuff(player, buff_name)) - { - sendSystemMessage(player, SID_BUFF_WONT_STACK); - return; - } - - float value = buff.getEffectValue(buff_name, 1); - float duration = buff.getDuration(buff_name); - - value *= eff; - duration *= dur; - - success = buff.applyBuff(player, buff_name, duration, value); - - if (success) - { - - String snd = "clienteffect/"; - switch(getSpecies(player)) - { - case SPECIES_MON_CALAMARI: - case SPECIES_RODIAN: - case SPECIES_TRANDOSHAN: snd += "reptile_"; - break; - case SPECIES_WOOKIEE: snd += "wookiee_"; - break; - default: snd += "human_"; - } - - switch(getGender(player)) - { - case GENDER_FEMALE: snd += "female_eat.cef"; - break; - default: snd += "male_eat.cef"; - } - - playClientEffectLoc(player, snd, getLocation(player), getScale(player)); - - int count = getCount(self); - count--; - - if (count <= 0) - { - destroyObject(self); - } - else - { - setCount(self, count); - } - } - } - - - public String formatTime(int seconds) throws InterruptedException - { - String result = ""; - - int hours = (seconds / 3600); - seconds -= (hours * 3600); - - int minutes = (seconds / 60); - seconds -= (minutes * 60); - - if (hours > 0) - { - result += ""+ hours + ":"; - } - - if (minutes > 0 || hours > 0) - { - if (hours > 0 && minutes < 10) - { - result += "0"; - } - - result += ""+ minutes + ":"; - } - - if (minutes > 0 && seconds < 10) - { - result += "0"; - } - - result += ""+ seconds; - - return result; - } - - - public int removeItemFoodScript(obj_id self, dictionary params) throws InterruptedException - { - detachScript(self, ITEM_FOOD_SCRIPT); - return SCRIPT_CONTINUE; - } - - - public int setUpBuff(obj_id self, dictionary params) throws InterruptedException - { - setObjVar(self, "buff_name", BUFF_NAME); - setObjVar(self, "noTrade", true); - setObjVar(self, ALREADY_SETUP, true); - - return SCRIPT_CONTINUE; - } - - - public boolean blog(String message) throws InterruptedException - { - LOG("fryer_log", message); - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_nobuff.java b/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_nobuff.java deleted file mode 100644 index 6ed3e9b92..000000000 --- a/sku.0/sys.server/compiled/game/script/item/ice_cream_fryer/ice_cream_nobuff.java +++ /dev/null @@ -1,268 +0,0 @@ -package script.item.ice_cream_fryer; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.utils; - - -public class ice_cream_nobuff extends script.base_script -{ - public ice_cream_nobuff() - { - } - public static final string_id SID_ALREADY_HAVE_BUFF = new string_id("base_player", "food_already_have_buff"); - public static final string_id SID_BUFF_WONT_STACK = new string_id("base_player", "food_buff_wont_stack"); - - public static final String ALREADY_SETUP = "itemFoodScriptRemoved"; - public static final String ITEM_FOOD_SCRIPT = "item.food"; - public static final String BUFF_NAME = "loot_buff"; - - public static final String OWNER_OID = "owner"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, ALREADY_SETUP)) - { - blog("OnAttach - NO OBJVAR FOUND"); - - messageTo(self, "setUpBuff", null, 3, false); - messageTo(self, "removeItemFoodScript", null, 3, false); - } - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "manf_attribs"; - attribs[idx] = ""; - idx++; - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - menu_info_data mid = mi.getMenuItemByType(menu_info_types.ITEM_USE); - if (mid != null) - { - mid.setServerNotify(true); - } - - mid = mi.getMenuItemByType(menu_info_types.EXAMINE); - if (mid != null) - { - mid.setServerNotify(true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.ITEM_USE) - { - eat(self, player); - } - - return SCRIPT_CONTINUE; - } - - - public void eat(obj_id self, obj_id player) throws InterruptedException - { - if (!isIdValid(self) || !isIdValid(player)) - { - return; - } - - if (buff.hasBuff(player, "spice_downer")) - { - return; - } - - obj_id owner = getObjIdObjVar(self, OWNER_OID); - if (player != owner) - { - sendSystemMessageTestingOnly(player, "temp message: you cannot eat this item. "); - return; - } - - String buff_name = getStringObjVar(self, "buff_name"); - int[] filling = new int[2]; - - if (hasObjVar(self, "filling")) - { - filling = getIntArrayObjVar(self, "filling"); - } - else if (hasObjVar(self, "filling_type") && hasObjVar(self, "filling_amount")) - { - filling[0] = 0; - filling[1] = 0; - } - else - { - filling[0] = 0; - filling[1] = 0; - } - - if (buff_name == null || buff_name.equals("")) - { - return; - } - - if (hasObjVar(self, "pet_only")) - { - - return; - } - - float eff = 1f; - float dur = 1f; - - if (hasObjVar(self, "effectiveness")) - { - eff = getFloatObjVar(self, "effectiveness"); - } - - if (hasObjVar(self, "duration")) - { - dur = getFloatObjVar(self, "duration"); - } - - boolean success = true; - - if (!buff.canApplyBuff(player, buff_name)) - { - sendSystemMessage(player, SID_BUFF_WONT_STACK); - return; - } - - float value = buff.getEffectValue(buff_name, 1); - float duration = buff.getDuration(buff_name); - - value *= eff; - duration *= dur; - - success = buff.applyBuff(player, buff_name, duration, value); - - if (success) - { - - String snd = "clienteffect/"; - switch(getSpecies(player)) - { - case SPECIES_MON_CALAMARI: - case SPECIES_RODIAN: - case SPECIES_TRANDOSHAN: snd += "reptile_"; - break; - case SPECIES_WOOKIEE: snd += "wookiee_"; - break; - default: snd += "human_"; - } - - switch(getGender(player)) - { - case GENDER_FEMALE: snd += "female_eat.cef"; - break; - default: snd += "male_eat.cef"; - } - - playClientEffectLoc(player, snd, getLocation(player), getScale(player)); - - int count = getCount(self); - count--; - - if (count <= 0) - { - destroyObject(self); - } - else - { - setCount(self, count); - } - } - } - - - public String formatTime(int seconds) throws InterruptedException - { - String result = ""; - - int hours = (seconds / 3600); - seconds -= (hours * 3600); - - int minutes = (seconds / 60); - seconds -= (minutes * 60); - - if (hours > 0) - { - result += ""+ hours + ":"; - } - - if (minutes > 0 || hours > 0) - { - if (hours > 0 && minutes < 10) - { - result += "0"; - } - - result += ""+ minutes + ":"; - } - - if (minutes > 0 && seconds < 10) - { - result += "0"; - } - - result += ""+ seconds; - - return result; - } - - - public int removeItemFoodScript(obj_id self, dictionary params) throws InterruptedException - { - detachScript(self, ITEM_FOOD_SCRIPT); - return SCRIPT_CONTINUE; - } - - - public int setUpBuff(obj_id self, dictionary params) throws InterruptedException - { - setObjVar(self, "buff_name", BUFF_NAME); - setObjVar(self, "noTrade", true); - setObjVar(self, ALREADY_SETUP, true); - - return SCRIPT_CONTINUE; - } - - - public boolean blog(String message) throws InterruptedException - { - LOG("fryer_log", message); - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/item/loot_kits/loot_kit_base.java b/sku.0/sys.server/compiled/game/script/item/loot_kits/loot_kit_base.java deleted file mode 100644 index 38ef1b9ed..000000000 --- a/sku.0/sys.server/compiled/game/script/item/loot_kits/loot_kit_base.java +++ /dev/null @@ -1,567 +0,0 @@ -package script.item.loot_kits; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.sui; -import script.library.utils; - - -public class loot_kit_base extends script.base_script -{ - public loot_kit_base() - { - } - public static final String STF = "loot_kit"; - - public static final string_id INCORRECT_ITEM = new string_id(STF, "incorrect_item"); - public static final string_id ALREADY_CONTAINS = new string_id(STF, "already_contains"); - public static final string_id NEW_ITEM_CREATED = new string_id(STF, "new_item_created"); - public static final string_id ITEM_USED = new string_id(STF, "item_used"); - public static final string_id AUTOSTACK_ATTACHED_EJECTED = new string_id(STF, "austostack_attached_ejected"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - String datatable = getStringObjVar (self, "loot_kit"); - - String[] objvarToSet = dataTableGetStringColumnNoDefaults (datatable, "objvar_name"); - int numObjVars = objvarToSet.length; - - if (numObjVars == 0) - { - return SCRIPT_CONTINUE; - } - - int passThrough = 0; - - while (passThrough < numObjVars) - { - testAbortScript(); - String kitObjVar = dataTableGetString (datatable, passThrough, "objvar_name"); - String kitObjVarValue = dataTableGetString (datatable, passThrough, "objvar_value"); - - setObjVar(self, kitObjVar, kitObjVarValue); - - passThrough = passThrough + 1; - } - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String datatable = getStringObjVar (self, "loot_kit"); - - if (hasObjVar(self, "collectible")) - { - int one = getIntObjVar(self, "collectible.item_contained_01"); - int two = getIntObjVar(self, "collectible.item_contained_02"); - int three = getIntObjVar(self, "collectible.item_contained_03"); - int four = getIntObjVar(self, "collectible.item_contained_04"); - int five = getIntObjVar(self, "collectible.item_contained_05"); - int six = getIntObjVar(self, "collectible.item_contained_06"); - int seven = getIntObjVar(self, "collectible.item_contained_07"); - int eight = getIntObjVar(self, "collectible.item_contained_08"); - int nine = getIntObjVar(self, "collectible.item_contained_09"); - int ten = getIntObjVar(self, "collectible.item_contained_10"); - - String itemNameOne = dataTableGetString (datatable, 0, "examine_item_name"); - names[idx] = itemNameOne; - if (one == 0) - { - String hasItem = "No"; - attribs[idx] = hasItem; - } - else if (one == 1) - { - String hasItem = "Yes"; - attribs[idx] = hasItem; - } - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String itemNameTwo = dataTableGetString (datatable, 1, "examine_item_name"); - names[idx] = itemNameTwo; - if (two == 0) - { - String hasItem = "No"; - attribs[idx] = hasItem; - } - else if (two == 1) - { - String hasItem = "Yes"; - attribs[idx] = hasItem; - } - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String itemNameThree = dataTableGetString (datatable, 2, "examine_item_name"); - names[idx] = itemNameThree; - if (three == 0) - { - String hasItem = "No"; - attribs[idx] = hasItem; - } - else if (three == 1) - { - String hasItem = "Yes"; - attribs[idx] = hasItem; - } - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String itemNameFour = dataTableGetString (datatable, 3, "examine_item_name"); - names[idx] = itemNameFour; - if (four == 0) - { - String hasItem = "No"; - attribs[idx] = hasItem; - } - else if (four == 1) - { - String hasItem = "Yes"; - attribs[idx] = hasItem; - } - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String itemNameFive = dataTableGetString (datatable, 4, "examine_item_name"); - names[idx] = itemNameFive; - if (five == 0) - { - String hasItem = "No"; - attribs[idx] = hasItem; - } - else if (five == 1) - { - String hasItem = "Yes"; - attribs[idx] = hasItem; - } - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String itemNameSix = dataTableGetString (datatable, 5, "examine_item_name"); - names[idx] = itemNameSix; - if (six == 0) - { - String hasItem = "No"; - attribs[idx] = hasItem; - } - else if (six == 1) - { - String hasItem = "Yes"; - attribs[idx] = hasItem; - } - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String itemNameSeven = dataTableGetString (datatable, 6, "examine_item_name"); - names[idx] = itemNameSeven; - if (seven == 0) - { - String hasItem = "No"; - attribs[idx] = hasItem; - } - else if (seven == 1) - { - String hasItem = "Yes"; - attribs[idx] = hasItem; - } - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String itemNameEight = dataTableGetString (datatable, 7, "examine_item_name"); - names[idx] = itemNameEight; - if (eight == 0) - { - String hasItem = "No"; - attribs[idx] = hasItem; - } - else if (eight == 1) - { - String hasItem = "Yes"; - attribs[idx] = hasItem; - } - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String itemNameNine = dataTableGetString (datatable, 8, "examine_item_name"); - names[idx] = itemNameNine; - if (nine == 0) - { - String hasItem = "No"; - attribs[idx] = hasItem; - } - else if (nine == 1) - { - String hasItem = "Yes"; - attribs[idx] = hasItem; - } - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String itemNameTen = dataTableGetString (datatable, 9, "examine_item_name"); - names[idx] = itemNameTen; - if (ten == 0) - { - String hasItem = "No"; - attribs[idx] = hasItem; - } - else if (ten == 1) - { - String hasItem = "Yes"; - attribs[idx] = hasItem; - } - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnAboutToReceiveItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - if (!utils.isNestedWithin(self, transferer)) - { - return SCRIPT_OVERRIDE; - } - - String datatable = getStringObjVar (self, "loot_kit"); - - String itemObjVar = dataTableGetString(datatable, 0, "item_objvar_name"); - - int kitPartTemplateRowNum = -1; - if (dataTableHasColumn (datatable, "useKitPartTemplate")) - { - String itemTemplate = getTemplateName(item); - if (!itemTemplate.equals("")) - { - kitPartTemplateRowNum = dataTableSearchColumnForString(itemTemplate, "useKitPartTemplate", datatable); - } - } - if (kitPartTemplateRowNum > -1) - { - String kitPartObjVar = dataTableGetString(datatable, kitPartTemplateRowNum, "objvar_name"); - if (getIntObjVar(self, kitPartObjVar) == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - else if (hasObjVar(item, itemObjVar)) - { - - if (!hasScript(item, "object.autostack")) - { - - attachScript(item, "object.autostack"); - - sendSystemMessage(transferer, AUTOSTACK_ATTACHED_EJECTED); - return SCRIPT_OVERRIDE; - } - - int itemNumber = getIntObjVar(item, itemObjVar); - - if (itemNumber == 1) - { - if (getIntObjVar(self, "collectible.item_contained_01") == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - else if (itemNumber == 2) - { - if (getIntObjVar(self, "collectible.item_contained_02") == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - else if (itemNumber == 3) - { - if (getIntObjVar(self, "collectible.item_contained_03") == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - else if (itemNumber == 4) - { - if (getIntObjVar(self, "collectible.item_contained_04") == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - else if (itemNumber == 5) - { - if (getIntObjVar(self, "collectible.item_contained_05") == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - else if (itemNumber == 6) - { - if (getIntObjVar(self, "collectible.item_contained_06") == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - else if (itemNumber == 7) - { - if (getIntObjVar(self, "collectible.item_contained_07") == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - else if (itemNumber == 8) - { - if (getIntObjVar(self, "collectible.item_contained_08") == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - else if (itemNumber == 9) - { - if (getIntObjVar(self, "collectible.item_contained_09") == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - else if (itemNumber == 10) - { - if (getIntObjVar(self, "collectible.item_contained_10") == 1) - { - sendSystemMessage(transferer, ALREADY_CONTAINS); - return SCRIPT_OVERRIDE; - } - } - } - else - { - sendSystemMessage(transferer, INCORRECT_ITEM); - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnReceivedItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - String datatable = getStringObjVar (self, "loot_kit"); - - String itemObjVar = dataTableGetString(datatable, 0, "item_objvar_name"); - - int itemNumber = getIntObjVar(item, itemObjVar); - - int kitPartTemplateRowNum = -1; - if (dataTableHasColumn (datatable, "useKitPartTemplate")) - { - String itemTemplate = getTemplateName(item); - if (!itemTemplate.equals("")) - { - kitPartTemplateRowNum = dataTableSearchColumnForString(itemTemplate, "useKitPartTemplate", datatable); - } - } - - if (kitPartTemplateRowNum > -1) - { - String kitPartObjVar = dataTableGetString(datatable, kitPartTemplateRowNum, "objvar_name"); - setObjVar(self, kitPartObjVar, 1); - } - else if (itemNumber == 1) - { - setObjVar(self, "collectible.item_contained_01", 1); - } - else if (itemNumber == 2) - { - setObjVar(self, "collectible.item_contained_02", 1); - } - else if (itemNumber == 3) - { - setObjVar(self, "collectible.item_contained_03", 1); - } - else if (itemNumber == 4) - { - setObjVar(self, "collectible.item_contained_04", 1); - } - else if (itemNumber == 5) - { - setObjVar(self, "collectible.item_contained_05", 1); - } - else if (itemNumber == 6) - { - setObjVar(self, "collectible.item_contained_06", 1); - } - else if (itemNumber == 7) - { - setObjVar(self, "collectible.item_contained_07", 1); - } - else if (itemNumber == 8) - { - setObjVar(self, "collectible.item_contained_08", 1); - } - else if (itemNumber == 9) - { - setObjVar(self, "collectible.item_contained_09", 1); - } - else if (itemNumber == 10) - { - setObjVar(self, "collectible.item_contained_10", 1); - } - - sendSystemMessage(transferer, ITEM_USED); - - decrementCount(item); - - obj_id[] contents = getContents(self); - if (contents != null && contents.length > 0) - { - obj_id playerInv = utils.getInventoryContainer(transferer); - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - putInOverloaded(contents[i], playerInv); - } - } - - checkForCompletion(self, transferer); - return SCRIPT_CONTINUE; - } - - - public void checkForCompletion(obj_id self, obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return; - } - - if (getIntObjVar(self, "collectible.item_contained_01") == 0) - { - return; - } - - if (getIntObjVar(self, "collectible.item_contained_02") == 0) - { - return; - } - - if (getIntObjVar(self, "collectible.item_contained_03") == 0) - { - return; - } - - if (getIntObjVar(self, "collectible.item_contained_04") == 0) - { - return; - } - - if (getIntObjVar(self, "collectible.item_contained_05") == 0) - { - return; - } - - if (getIntObjVar(self, "collectible.item_contained_06") == 0) - { - return; - } - - if (getIntObjVar(self, "collectible.item_contained_07") == 0) - { - return; - } - - if (getIntObjVar(self, "collectible.item_contained_08") == 0) - { - return; - } - - if (getIntObjVar(self, "collectible.item_contained_09") == 0) - { - return; - } - - if (getIntObjVar(self, "collectible.item_contained_10") == 0) - { - return; - } - - obj_id playerInv = getObjectInSlot( player, "inventory"); - if (isIdValid(playerInv)) - { - String datatable = getStringObjVar (self, "loot_kit"); - String rewardItem = dataTableGetString(datatable, 0, "item_reward_name"); - obj_id item = createObject( rewardItem, playerInv, ""); - if (isIdValid(item)) - { - sendSystemMessage(player, NEW_ITEM_CREATED); - utils.setScriptVar(self, "cleaningUp", true); - destroyObject(self); - } - } - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/loot_schematic/loot_schematic.java b/sku.0/sys.server/compiled/game/script/item/loot_schematic/loot_schematic.java deleted file mode 100644 index eafa15fe7..000000000 --- a/sku.0/sys.server/compiled/game/script/item/loot_schematic/loot_schematic.java +++ /dev/null @@ -1,432 +0,0 @@ -package script.item.loot_schematic; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.prose; -import script.library.utils; -import script.library.temp_schematic; -import script.library.skill; -import script.library.static_item; -import script.library.beast_lib; - - -public class loot_schematic extends script.base_script -{ - public loot_schematic() - { - } - public static final String VAR_SCHEMATIC = "loot_schematic.schematic"; - public static final String VAR_SKILL = "loot_schematic.skill"; - public static final String VAR_ABILITY = "loot_schematic.ability"; - public static final String VAR_BEAST_ABILITY = "loot_schematic.beast"; - public static final String VAR_WAYPOINT_NAME = "loot_schematic.waypoint.name"; - public static final String VAR_WAYPOINT_LOC_X = "loot_schematic.waypoint.loc_x"; - public static final String VAR_WAYPOINT_LOC_Y = "loot_schematic.waypoint.loc_y"; - public static final String VAR_WAYPOINT_LOC_Z = "loot_schematic.waypoint.loc_z"; - public static final String VAR_WAYPOINT_LOC_PLANET = "loot_schematic.waypoint.planet"; - public static final String VAR_PET = "loot_schematic.pet"; - public static final String VAR_VEHICLE = "loot_schematic.vehicle"; - public static final String VAR_USES = "loot_schematic.uses"; - public static final String VAR_SKILL_REQ = "loot_schematic.skill_req"; - public static final String VAR_TYPE = "loot_schematic.type"; - - public static final int TYPE_SCHEMATIC = 1; - public static final int TYPE_SKILL = 2; - public static final int TYPE_ABILITY = 3; - public static final int TYPE_WAYPOINT = 4; - public static final int TYPE_BEAST_ABILITY = 5; - - public static final string_id SID_SCHEMATIC = new string_id("loot_schematic", "schematic"); - public static final string_id SID_SKILL = new string_id("loot_schematic", "skill"); - public static final string_id SID_ABILITY = new string_id("loot_schematic", "ability"); - public static final string_id SID_WAYPOINT = new string_id("loot_schematic", "waypoint"); - public static final string_id SID_BEAST_ABILITY = new string_id("loot_schematic", "beast_ability"); - public static final string_id SID_NOTHING_TO_LEARN = new string_id("loot_schematic", "nothing_to_learn"); - public static final string_id SID_NOT_LEARNABLE_ABILITY = new string_id("loot_schematic", "not_learnable"); - public static final string_id SID_NOT_ENOUGH_SKILL = new string_id("loot_schematic", "not_enough_skill"); - public static final string_id SID_ALREADY_HAVE_SCHEMATIC = new string_id("loot_schematic", "already_have_schematic"); - public static final string_id SID_SCHEMATIC_LEARNED = new string_id("loot_schematic", "schematic_learned"); - public static final string_id SID_USE_SCHEMATIC = new string_id("loot_schematic", "use_schematic"); - public static final string_id SID_MUST_BE_HOLDING = new string_id("loot_schematic", "must_be_holding"); - public static final string_id SID_USE_SKILL = new string_id("loot_schematic", "use_skill"); - public static final string_id SID_USE_ABILITY = new string_id("loot_schematic", "use_ability"); - public static final string_id SID_USE_BEAST_ABILITY = new string_id("loot_schematic", "use_beast_ability"); - public static final string_id SID_USE_WAYPOINT = new string_id("loot_schematic", "use_waypoint"); - public static final string_id SID_USE_PET = new string_id("loot_schematic", "use_pet"); - public static final string_id SID_USE_VEHICLE = new string_id("loot_schematic", "use_vehicle"); - public static final string_id SID_ALREADY_HAVE_SKILL = new string_id("loot_schematic", "already_have_skill"); - public static final string_id SID_UNABLE_TO_LEARN_SKILL = new string_id("loot_schematic", "unable_to_learn_skill"); - public static final string_id SID_ALREADY_HAVE_ABILITY = new string_id("loot_schematic", "already_have_ability"); - public static final string_id SID_UNABLE_TO_ADD_WAYPOINT = new string_id("loot_schematic", "unable_to_add_waypoint"); - public static final string_id SID_WAYPOINT_GRANTED = new string_id("loot_schematic", "waypoint_granted"); - public static final string_id SID_SKILL_GRANTED = new string_id("loot_schematic", "skill_granted"); - public static final string_id SID_SCHEMATIC_ERROR = new string_id("loot_schematic", "schematic_error"); - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - if (hasObjVar(self, VAR_SKILL_REQ) && !static_item.isStaticItem(self)) - { - String skill_req = getStringObjVar(self, VAR_SKILL_REQ); - - if (skill_req.startsWith("crafting")) - { - String template = getTemplateName(self); - - if (template.length() > 0) - { - utils.replaceSnowflakeItem(self, template); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - if (!utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - int type = getLootItemType(self); - switch (type) - { - case TYPE_SCHEMATIC: - mi.addRootMenu (menu_info_types.ITEM_USE, SID_USE_SCHEMATIC); - break; - - case TYPE_SKILL: - mi.addRootMenu (menu_info_types.ITEM_USE, SID_USE_SKILL); - break; - - case TYPE_ABILITY: - mi.addRootMenu (menu_info_types.ITEM_USE, SID_USE_ABILITY); - break; - - case TYPE_WAYPOINT: - mi.addRootMenu (menu_info_types.ITEM_USE, SID_USE_WAYPOINT); - break; - - case TYPE_BEAST_ABILITY: - mi.addRootMenu (menu_info_types.ITEM_USE, SID_USE_BEAST_ABILITY); - break; - - default: - break; - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id container = getContainedBy(self); - if (!isIdValid(container)) - { - sendSystemMessage(player, SID_MUST_BE_HOLDING); - return SCRIPT_CONTINUE; - } - else if (container != getObjectInSlot(player, "inventory")) - { - sendSystemMessage(player, SID_MUST_BE_HOLDING); - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.ITEM_USE) - { - int type = getLootItemType(self); - if (type == -1) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, VAR_SKILL_REQ)) - { - String skill_req = getStringObjVar(self, VAR_SKILL_REQ); - if (!hasSkill(player, skill_req)) - { - - String classTemplate = getSkillTemplate(player); - if (!classTemplate.startsWith(skill_req)) - { - string_id skill_id = utils.unpackString("@skl_n:"+ skill_req); - prose_package pp = prose.getPackage(SID_NOT_ENOUGH_SKILL, skill_id); - sendSystemMessageProse(player, pp); - return SCRIPT_CONTINUE; - } - } - } - - switch (type) - { - case TYPE_SCHEMATIC: - if (!hasObjVar(self, VAR_SCHEMATIC)) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - String schematic = getStringObjVar(self, VAR_SCHEMATIC); - int uses = getIntObjVar(self, VAR_USES); - - if (schematic == null || uses == -1) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - if (hasSchematic(player, schematic)) - { - sendSystemMessage(player, SID_ALREADY_HAVE_SCHEMATIC); - return SCRIPT_CONTINUE; - } - - if (uses > 0) - { - temp_schematic.grant(player, schematic, uses); - sendSystemMessage(player, SID_SCHEMATIC_LEARNED); - } - else - { - if (grantSchematic(player, schematic)) - { - sendSystemMessage(player, SID_SCHEMATIC_LEARNED); - } - else - { - sendSystemMessage(player, SID_SCHEMATIC_ERROR); - return SCRIPT_CONTINUE; - } - } - - break; - - case TYPE_SKILL: - if (!hasObjVar(self, VAR_SKILL)) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - String item_skill = getStringObjVar(self, VAR_SKILL); - if (item_skill == null) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - if (hasSkill(player, item_skill)) - { - sendSystemMessage(player, SID_ALREADY_HAVE_SKILL); - return SCRIPT_CONTINUE; - } - - LOG("LOG_CHANNEL", "skill ->"+ item_skill); - - if (!skill.grantSkillToPlayer(player, item_skill)) - { - sendSystemMessage(player, SID_UNABLE_TO_LEARN_SKILL); - return SCRIPT_CONTINUE; - } - - string_id skill_id = utils.unpackString("@skl_n:"+ item_skill); - prose_package pp2 = prose.getPackage(SID_SKILL_GRANTED, skill_id); - sendSystemMessageProse(player, pp2); - - break; - - case TYPE_ABILITY: - if (!hasObjVar(self, VAR_ABILITY)) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - String ability = getStringObjVar(self, VAR_ABILITY); - if (ability == null) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - if (hasCommand(player, ability)) - { - sendSystemMessage(player, SID_ALREADY_HAVE_ABILITY); - return SCRIPT_CONTINUE; - } - - grantCommand(player, ability); - - break; - - case TYPE_WAYPOINT: - if (!hasObjVar(self, VAR_WAYPOINT_NAME) || !hasObjVar(self, VAR_WAYPOINT_LOC_X)) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - String name = getStringObjVar(self, VAR_WAYPOINT_NAME); - int loc_x = getIntObjVar(self, VAR_WAYPOINT_LOC_X); - int loc_y = getIntObjVar(self, VAR_WAYPOINT_LOC_Y); - int loc_z = getIntObjVar(self, VAR_WAYPOINT_LOC_Z); - String planet = getStringObjVar(self, VAR_WAYPOINT_LOC_PLANET); - - String loc_str = getStringObjVar(self, VAR_WAYPOINT_LOC_X); - - if (name == null || planet == null) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - location loc = new location(loc_x, loc_y, loc_z, planet); - - obj_id waypoint = createWaypointInDatapad(player, loc); - if (!isIdValid(waypoint)) - { - sendSystemMessage(player, SID_UNABLE_TO_ADD_WAYPOINT); - return SCRIPT_CONTINUE; - } - - setWaypointVisible(waypoint, true); - setWaypointActive(waypoint, true); - setWaypointName(waypoint, name); - - prose_package pp = prose.getPackage(SID_WAYPOINT_GRANTED, name); - sendSystemMessageProse(player, pp); - - break; - - case TYPE_BEAST_ABILITY: - if (!hasObjVar(self, VAR_BEAST_ABILITY)) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - String beastAbility = getStringObjVar(self, VAR_BEAST_ABILITY); - if (beastAbility == null) - { - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - } - - if (!beast_lib.isLearnableBeastMasterSkill(beastAbility)) - { - sendSystemMessage(player, SID_NOT_LEARNABLE_ABILITY); - return SCRIPT_CONTINUE; - } - - if (beast_lib.hasBeastMasterSkill(player, beastAbility)) - { - sendSystemMessage(player, SID_ALREADY_HAVE_ABILITY); - return SCRIPT_CONTINUE; - } - - beast_lib.playerLearnBeastMasterSkill(player, beastAbility); - - break; - - default: - sendSystemMessage(player, SID_NOTHING_TO_LEARN); - return SCRIPT_CONTINUE; - - } - - destroyObject(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int type = getLootItemType(self); - if (type < 1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String[] type_str = - { - localize(SID_SCHEMATIC), localize(SID_SKILL), localize(SID_ABILITY), localize(SID_WAYPOINT), localize(SID_ABILITY) - }; - - names[idx] = "knowlege_type"; - attribs[idx] = type_str[type - 1]; - idx++; - - if (hasObjVar(self, VAR_SKILL_REQ)) - { - String skill_req = getStringObjVar(self, VAR_SKILL_REQ); - string_id skill_id = utils.unpackString("@skl_n:"+ skill_req); - names[idx] = "loot_schematic_skill_required"; - attribs[idx] = localize(skill_id); - idx++; - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int handlerReInitialize(obj_id self, dictionary params) throws InterruptedException - { - Object[] newParams = new Object[1]; - newParams[0] = self; - utils.callTrigger("OnInitialize", newParams); - return SCRIPT_CONTINUE; - } - - - public int getLootItemType(obj_id item) throws InterruptedException - { - if (!isIdValid(item)) - { - return -1; - } - - if (hasObjVar(item, VAR_TYPE)) - { - return getIntObjVar(item, VAR_TYPE); - } - else - { - - return 1; - } - } - - - public void test(obj_id player) throws InterruptedException - { - String selected_skill = utils.getStringScriptVar(player, VAR_SKILL); - skill.purchaseSkill(player, selected_skill); - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/publish_gift/holopet_emitter.java b/sku.0/sys.server/compiled/game/script/item/publish_gift/holopet_emitter.java deleted file mode 100644 index dfaec68af..000000000 --- a/sku.0/sys.server/compiled/game/script/item/publish_gift/holopet_emitter.java +++ /dev/null @@ -1,822 +0,0 @@ -package script.item.publish_gift; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.player_structure; -import script.library.prose; -import script.library.static_item; -import script.library.sui; -import script.library.utils; - - -public class holopet_emitter extends script.base_script -{ - public holopet_emitter() - { - } - public static final float HEARTBEAT = 600f; - - - public int OnAttach(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (!utils.isNestedWithinAPlayer(self)) - { - obj_id house = getTopMostContainer(self); - - if (isIdValid(house) && player_structure.isBuilding(house)) - { - if (!hasScript(house, "structure.hologram_control")) - { - attachScript(house, "structure.hologram_control"); - } - - listenToMessage(house, "handleActivateHolograms"); - - obj_id[] players = player_structure.getPlayersInBuilding(house); - - if (players != null && players.length > 0) - { - if (hasObjVar(self, "holopet_active") && !isTurnedOn(self)) - { - turnOn(self, null, ""); - } - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (utils.isNestedWithinAPlayer(self)) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "cannot_activate_in_inv")); - return SCRIPT_CONTINUE; - } - - obj_id owner = getOwner(self); - if (!isValidId(owner)) - { - return SCRIPT_CONTINUE; - } - - obj_id structure = getTopMostContainer(self); - if (!isValidId(structure) || !exists(structure)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isBuilding(structure) && !isPlayer(structure)) - { - return SCRIPT_CONTINUE; - } - - if (player != owner && !player_structure.isAdmin(structure, player)) - { - return SCRIPT_CONTINUE; - } - - if ((getTopMostContainer(player) != getTopMostContainer(self)) || (getDistance(player, self) > 7f)) - { - return SCRIPT_CONTINUE; - } - - menu_info_data mid = mi.getMenuItemByType(menu_info_types.ITEM_USE); - if (mid != null) - { - if (isTurnedOn(self)) - { - mid.setLabel(new string_id("publish_gift/holopet", "menu_turn_off")); - } - else - { - mid.setLabel(new string_id("publish_gift/holopet", "menu_turn_on")); - } - - mid.setServerNotify(true); - } - - mi.addRootMenu(menu_info_types.SERVER_MENU1, new string_id("publish_gift/holopet", "menu_load_disk")); - - if (hasObjVar(self, "holopet_loaded")) - { - mi.addRootMenu(menu_info_types.SERVER_MENU2, new string_id("publish_gift/holopet", "menu_unload_disk")); - } - - mi.addRootMenu(menu_info_types.SERVER_MENU3, new string_id("publish_gift/holopet", "menu_name_pet")); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - obj_id structure = getTopMostContainer(self); - if (!isValidId(structure) || !exists(structure)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(self, player) && getDistance(player, self) > 7f) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "too_far")); - return SCRIPT_CONTINUE; - } - - if (getTopMostContainer(player) != getTopMostContainer(self)) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "must_be_inside")); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isBuilding(structure) && !isPlayer(structure)) - { - return SCRIPT_CONTINUE; - } - - obj_id owner = getOwner(self); - if (!isValidId(owner)) - { - return SCRIPT_CONTINUE; - } - - if (player != owner && !player_structure.isAdmin(structure, player)) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "cannot_activate_not_owner")); - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.ITEM_USE) - { - - if (utils.isNestedWithin(self, player)) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "cannot_activate_in_inv")); - return SCRIPT_CONTINUE; - } - - if (isTurnedOn(self)) - { - turnOff(self); - } - else - { - turnOn(self, player, ""); - } - - sendDirtyObjectMenuNotification(self); - - } - - else if (item == menu_info_types.SERVER_MENU1) - { - displayLoadDataCubeSui(self, player); - } - - else if (item == menu_info_types.SERVER_MENU2) - { - unloadDataCube(self, player, true); - } - - else if (item == menu_info_types.SERVER_MENU3) - { - showNamePetSui(self, player); - } - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - if (isTurnedOn(self)) - { - turnOff(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnTransferred(obj_id self, obj_id sourceContainer, obj_id destContainer, obj_id transferer) throws InterruptedException - { - obj_id owner = getOwner(self); - if (!isValidId(owner)) - { - return SCRIPT_CONTINUE; - } - - if (utils.isNestedWithinAPlayer(destContainer)) - { - obj_id house = getTopMostContainer(sourceContainer); - - if (isIdValid(house) && player_structure.isBuilding(house)) - { - stopListeningToMessage(house, "handleActivateHolograms"); - } - if (transferer != owner) - { - CustomerServiceLog ("publish_gift", "Player: "+ getName(transferer) + " OID: "+ transferer + " has picked up "+ getName(self) + " OID: "+ self + " from house:"+ house); - } - - } - else - { - obj_id house = getTopMostContainer(destContainer); - - if (isIdValid(house) && player_structure.isBuilding(house)) - { - if (!hasScript(house, "structure.hologram_control")) - { - attachScript(house, "structure.hologram_control"); - } - - listenToMessage(house, "handleActivateHolograms"); - } - if (transferer != owner) - { - CustomerServiceLog ("publish_gift", "Player: "+ getName(transferer) + " OID: "+ transferer + " has dropped "+ getName(self) + " OID: "+ self + " in house:"+ house); - } - - } - - return SCRIPT_CONTINUE; - } - - - public void turnOn(obj_id self, obj_id player, String type) throws InterruptedException - { - if (type.equals("")) - { - if (!hasObjVar(self, "holopet_loaded")) - { - if (isIdValid(player)) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "no_cube_loaded")); - } - - return; - } - else - { - type = getStringObjVar(self, "holopet_loaded"); - } - } - - if (type == null || type.equals("")) - { - return; - } - - String template = ""; - string_id name = new string_id("publish_gift/holopet", "default_name"); - float scale = 1.0f; - float speed = 1.01f; - - if (type.equals("rancor")) - { - template = "object/mobile/hologram/rancor.iff"; - name = new string_id("publish_gift/holopet", "rancor_name"); - scale = 0.1f; - } - else if (type.equals("quenker")) - { - template = "object/mobile/hologram/quenker.iff"; - name = new string_id("publish_gift/holopet", "quenker_name"); - scale = 0.5f; - } - else if (type.equals("veermok")) - { - template = "object/mobile/hologram/veermok.iff"; - name = new string_id("publish_gift/holopet", "veermok_name"); - scale = 0.4f; - } - else if (type.equals("slicehound")) - { - template = "object/mobile/hologram/corellian_slice_hound.iff"; - name = new string_id("publish_gift/holopet", "slice_hound_name"); - scale = 0.5f; - } - else if (type.equals("pekopeko")) - { - template = "object/mobile/hologram/peko_peko.iff"; - name = new string_id("publish_gift/holopet", "peko_peko_name"); - scale = 0.2f; - speed = 7f; - } - else if (type.equals("squall")) - { - template = "object/mobile/hologram/squall.iff"; - name = new string_id("publish_gift/holopet", "squall_name"); - scale = 1.0f; - } - else if (type.equals("jax")) - { - template = "object/mobile/hologram/bearded_jax.iff"; - name = new string_id("publish_gift/holopet", "jax_name"); - scale = 1.0f; - } - else if (type.equals("ewok")) - { - template = "object/mobile/hologram/ewok.iff"; - name = new string_id("publish_gift/holopet", "ewok_name"); - scale = 0.5f; - } - else if (type.equals("jawa")) - { - template = "object/mobile/hologram/jawa.iff"; - name = new string_id("publish_gift/holopet", "jawa_name"); - scale = 0.8f; - } - else if (type.equals("atat")) - { - template = "object/mobile/hologram/atat.iff"; - name = new string_id("publish_gift/holopet", "atat_name"); - scale = 0.04f; - } - else if (type.equals("cle004")) - { - template = "object/mobile/hologram/cle004.iff"; - name = new string_id("publish_gift/holopet", "cle004_name"); - scale = 0.4f; - } - else if (type.equals("ins444")) - { - template = "object/mobile/hologram/ins444.iff"; - name = new string_id("publish_gift/holopet", "ins444_name"); - scale = 0.6f; - } - - location myLoc = getLocation(self); - location newLoc = new location(); - - for (int i = 0; i < 50; i++) - { - testAbortScript(); - newLoc = (location)myLoc.clone(); - - newLoc = utils.getRandomAwayLocation(newLoc, 1f, 1.5f); - - if (isValidInteriorLocation(newLoc)) - { - break; - } - else if (i == 49) - { - newLoc = (location)myLoc.clone(); - } - } - - obj_id pet = createObject(template, newLoc); - - if (isIdValid(pet)) - { - setYaw(pet, rand(0, 359)); - setScale(pet, scale); - setHologramType(pet, HOLOGRAM_TYPE1_QUALITY3); - setInvulnerable(pet, true); - setBaseWalkSpeed(pet, speed); - - if (hasObjVar(self, "holopet_name")) - { - String custom_name = getStringObjVar(self, "holopet_name"); - - if (custom_name != null && !custom_name.equals("")) - { - setName(pet, custom_name); - } - else - { - setName(pet, name); - } - } - else - { - setName(pet, name); - } - - setDescriptionStringId(pet, new string_id("publish_gift/holopet", "default_description")); - - attachScript(pet, "item.special.block_open"); - - final float collisionRadius = getObjectCollisionRadius(pet); - final float minDelay = Math.min(Math.max(8.0f, collisionRadius * 2.0f), 16.0f); - final float maxDelay = Math.min(Math.max(8.0f, collisionRadius * 4.0f), 16.0f); - - loiterLocation(pet, getLocation(self), 1f, 6.0f, minDelay, maxDelay); - setObjVar(pet, "ai.defaultCalmBehavior", ai_lib.BEHAVIOR_LOITER); - - setObjVar(self, "holopet_active", pet); - setObjVar(self, "unmoveable", 1); - - setCondition(self, CONDITION_ON); - - int msgId = getGameTime(); - - setObjVar(self, "holopet_msgId", msgId); - - dictionary d = new dictionary(); - d.put("msgId", msgId); - - messageTo(self, "handleHologramHeartbeat", d, HEARTBEAT, false); - } - } - - - public void turnOff(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, "holopet_active")) - { - return; - } - - obj_id pet = getObjIdObjVar(self, "holopet_active"); - - if (isIdValid(pet) && exists(pet)) - { - destroyObject(pet); - } - - removeObjVar(self, "holopet_active"); - removeObjVar(self, "unmoveable"); - - clearCondition(self, CONDITION_ON); - } - - - public void showNamePetSui(obj_id self, obj_id player) throws InterruptedException - { - String title = "@publish_gift/holopet:sui_name_pet_title"; - String prompt = "@publish_gift/holopet:sui_name_pet_prompt"; - - int pid = sui.inputbox(self, player, prompt, title, "handleNamePet", 20, false, ""); - } - - - public boolean isTurnedOn(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, "holopet_active")) - { - return false; - } - - obj_id pet = getObjIdObjVar(self, "holopet_active"); - - if (!isIdValid(pet) || !exists(pet)) - { - return false; - } - - return true; - } - - - public boolean unloadDataCube(obj_id self, obj_id player, boolean verbose) throws InterruptedException - { - obj_id owner = getOwner(self); - if (!isValidId(owner)) - { - return false; - } - - if (!hasObjVar(self, "holopet_loaded")) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "no_cube_loaded")); - return false; - } - - String loaded_cube = "item_holopet_"; - loaded_cube += getStringObjVar(self, "holopet_loaded"); - loaded_cube += "_data_cube_01_01"; - - if (!isIdValid(player)) - { - return false; - } - - obj_id inv = utils.getInventoryContainer(player); - - if (!isIdValid(inv)) - { - return false; - } - - obj_id cube = static_item.createNewItemFunction(loaded_cube, inv); - - if (isIdValid(cube)) - { - if (verbose) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "data_cube_unloaded")); - } - - if (isTurnedOn(self)) - { - turnOff(self); - } - - removeObjVar(self, "holopet_loaded"); - - if (player != owner) - { - CustomerServiceLog ("publish_gift", "Player: "+ getName(player) + " OID: "+ player + " has Unloaded a pet (OID: "+ cube + ") from "+ getName(self) + " OID: "+ self + "."); - } - - return true; - } - - return false; - } - - - public void displayLoadDataCubeSui(obj_id self, obj_id player) throws InterruptedException - { - obj_id inv = utils.getInventoryContainer(player); - - obj_id[] data_cubes = utils.getContainedObjectsWithObjVar(inv, "holopet_type", true); - - if (data_cubes == null || data_cubes.length == 0) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "no_data_cubes")); - return; - } - - String[] cube_names = new String[data_cubes.length]; - - for (int i = 0; i < data_cubes.length; i++) - { - testAbortScript(); - cube_names[i] = "@" + getName(data_cubes[i]); - } - - String title = "@publish_gift/holopet:sui_cube_list_title"; - String prompt = ""; - - if (hasObjVar(self, "holopet_loaded")) - { - String loaded_cube = "item_holopet_"; - loaded_cube += getStringObjVar(self, "holopet_loaded"); - loaded_cube += "_data_cube_01_01"; - - prompt = "@publish_gift/holopet:sui_cube_list_prompt1 "; - prompt += "@static_item_n:"+ loaded_cube; - prompt += " \n\n"; - } - - prompt += "@publish_gift/holopet:sui_cube_list_prompt2"; - - int pid = sui.listbox(self, player, prompt, sui.OK_CANCEL, title, cube_names, "handleLoadDataCube", false, false); - - if (pid > 0) - { - sui.setAssociateRange(player, pid, self, 10f); - showSUIPage(pid); - - utils.setScriptVar(player, "data_cubes", data_cubes); - } - } - - - public int handleNamePet(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - obj_id owner = getOwner(self); - if (!isValidId(owner)) - { - return SCRIPT_CONTINUE; - } - - int btn = sui.getIntButtonPressed(params); - String name = sui.getInputBoxText(params); - - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - if (name == null || name.equals("")) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "invalid_name")); - return SCRIPT_CONTINUE; - } - - if (!utils.isAppropriateName(name)) - { - sendSystemMessage(player, new string_id("publish_gift/holopet", "invalid_name")); - return SCRIPT_CONTINUE; - } - - setObjVar(self, "holopet_name", name); - - if (hasObjVar(self, "holopet_active")) - { - obj_id pet = getObjIdObjVar(self, "holopet_active"); - - if (isIdValid(pet) && exists(pet)) - { - setName(pet, name); - } - if (player != owner) - { - CustomerServiceLog ("publish_gift", "Player: "+ getName(player) + " OID: "+ player + " has renamed a pet on "+ getName(self) + " OID: "+ self + "."); - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleLoadDataCube(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - obj_id owner = getOwner(self); - if (!isValidId(owner)) - { - return SCRIPT_CONTINUE; - } - - obj_id[] data_cubes = utils.getObjIdArrayScriptVar(player, "data_cubes"); - - if (data_cubes == null || data_cubes.length == 0) - { - return SCRIPT_CONTINUE; - } - - utils.removeScriptVar(player, "data_cubes"); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > data_cubes.length) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(data_cubes[idx])) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(data_cubes[idx], "holopet_type")) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "holopet_loaded")) - { - if (!unloadDataCube(self, player, false)) - { - return SCRIPT_CONTINUE; - } - } - - String type = getStringObjVar(data_cubes[idx], "holopet_type"); - setObjVar(self, "holopet_loaded", type); - - prose_package pp = new prose_package(); - - if (type.equals("atat") || type.equals("ewok")) - { - pp = prose.setStringId(pp, new string_id("publish_gift/holopet", "data_cube_loaded_an")); - } - else - { - pp = prose.setStringId(pp, new string_id("publish_gift/holopet", "data_cube_loaded")); - } - - pp = prose.setTT(pp, "@"+ getName(data_cubes[idx])); - sendSystemMessageProse(player, pp); - - destroyObject(data_cubes[idx]); - - turnOn(self, player, type); - if (player != owner) - { - CustomerServiceLog ("publish_gift", "Player: "+ getName(player) + " OID: "+ player + " has Loaded a new pet onto "+ getName(self) + " OID: "+ self + "."); - } - - return SCRIPT_CONTINUE; - } - - - public int handleActivateHolograms(obj_id self, dictionary params) throws InterruptedException - { - if (hasObjVar(self, "holopet_active") && !isTurnedOn(self)) - { - turnOn(self, null, ""); - } - - return SCRIPT_CONTINUE; - } - - - public int handleHologramHeartbeat(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, "holopet_msgId")) - { - return SCRIPT_CONTINUE; - } - - int id = getIntObjVar(self, "holopet_msgId"); - int msgId = params.getInt("msgId"); - - if (id != msgId) - { - return SCRIPT_CONTINUE; - } - - if (utils.isNestedWithinAPlayer(self)) - { - return SCRIPT_CONTINUE; - } - - if (!isTurnedOn(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id house = getTopMostContainer(self); - - if (isIdValid(house) && player_structure.isBuilding(house)) - { - obj_id[] players = player_structure.getPlayersInBuilding(house); - - if (players == null || players.length == 0) - { - if (hasObjVar(self, "holopet_active")) - { - obj_id pet = getObjIdObjVar(self, "holopet_active"); - - if (isIdValid(pet) && exists(pet)) - { - destroyObject(pet); - } - - return SCRIPT_CONTINUE; - } - } - } - - if (hasObjVar(self, "holopet_active")) - { - obj_id pet = getObjIdObjVar(self, "holopet_active"); - - if (isIdValid(pet) && exists(pet)) - { - if (rand(0,1) == 0) - { - doAnimationAction(pet, "trick_1"); - } - else - { - doAnimationAction(pet, "trick_2"); - } - } - } - - dictionary d = new dictionary(); - d.put("msgId", msgId); - - messageTo(self, "handleHologramHeartbeat", d, HEARTBEAT, false); - - return SCRIPT_CONTINUE; - } - - - public int OnPack(obj_id self, dictionary params) throws InterruptedException - { - if (isTurnedOn(self)) - { - turnOff(self); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/static_item_base.java b/sku.0/sys.server/compiled/game/script/item/static_item_base.java deleted file mode 100644 index 2cf98ed34..000000000 --- a/sku.0/sys.server/compiled/game/script/item/static_item_base.java +++ /dev/null @@ -1,496 +0,0 @@ -package script.item; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.static_item; -import script.library.utils; -import script.library.beast_lib; -import script.library.buff; -import script.library.armor; -import script.library.proc; - - -public class static_item_base extends script.base_script -{ - public static_item_base() - { - } - public static final boolean LOGGING_ON = true; - public static final String LOGGING_CATEGORY = "junk"; - - public static final String STATIC_ITEM_TABLE = "datatables/item/master_item/master_item.iff"; - - public static final string_id SID_ITEM_LEVEL_TOO_LOW = new string_id("base_player", "level_too_low"); - public static final string_id SID_ITEM_NOT_ENOUGH_SKILL = new string_id("base_player", "not_correct_skill"); - public static final string_id SID_ITEM_MUST_NOT_BE_EQUIP = new string_id("base_player", "not_while_equipped"); - public static final string_id SID_ITEM_NO_UNIQUE_TRANSFER = new string_id("base_player", "unique_no_transfer"); - public static final string_id SID_MENU_NO_SELL = new string_id("base_player", "no_sell"); - public static final string_id SID_MENU_REMOVE_NO_SELL = new string_id("base_player", "remove_no_sell"); - - public static final String NO_SELL = "static_item.no_sell"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - dictionary itemData = static_item.getMasterItemDictionary(self); - if (itemData == null || itemData.equals("")) - { - return SCRIPT_CONTINUE; - } - - int masterVersion = itemData.getInt("version"); - int currentVersion = getStaticItemVersion(self); - - if (currentVersion != masterVersion) - { - - messageTo(self, "handlerVersionUpdate", itemData, 0.1f, true); - return SCRIPT_CONTINUE; - } - else - { - static_item.initializeObject(self, itemData); - } - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - boolean canTransfer = true; - - if (isPlayer(destContainer) || isAPlayerAppearanceInventoryContainer(destContainer)) - { - dictionary itemData = static_item.getMasterItemDictionary(self); - - if (!isIdValid(transferer)) - { - obj_id owner = getOwner(self); - if (destContainer == owner) - { - transferer = owner; - } - else if (isAPlayerAppearanceInventoryContainer(destContainer)) - { - transferer = getContainedBy(destContainer); - } - } - - int requiredLevel = itemData.getInt("required_level"); - String requiredSkill = itemData.getString("required_skill"); - - if (!static_item.validateLevelRequired(transferer,requiredLevel)) - { - sendSystemMessage(transferer, SID_ITEM_LEVEL_TOO_LOW); - canTransfer = false; - } - if (requiredSkill != null && !requiredSkill.equals("")) - { - String classTemplate = getSkillTemplate(transferer); - if (classTemplate != null && !classTemplate.equals("")) - { - if (!classTemplate.startsWith(requiredSkill)) - { - sendSystemMessage(transferer, SID_ITEM_NOT_ENOUGH_SKILL); - canTransfer = false; - } - } - } - - if (hasObjVar(self, "armor.fake_armor")) - { - int ohMyGOT = getGameObjectType(self); - - if (!hasCommand(transferer, "wear_all_armor") && isGameObjectTypeOf(ohMyGOT, GOT_armor)) - { - sendSystemMessage(transferer, SID_ITEM_NOT_ENOUGH_SKILL); - canTransfer = false; - } - } - } - else - { - - if (static_item.isUniqueStaticItem(self)) - { - obj_id owner = getOwner(self); - obj_id inv = utils.getInventoryContainer(owner); - obj_id bank = utils.getPlayerBank(owner); - - if (!isIdValid(inv) || ((destContainer != inv) && (destContainer != bank))) - { - sendSystemMessage(transferer, SID_ITEM_NO_UNIQUE_TRANSFER); - canTransfer = false; - } - } - } - - if (static_item.isUniqueStaticItem(self)) - { - obj_id[] destContents = getContents(destContainer); - - if (destContents != null && destContents.length > 0) - { - for (int i=0; i 30 && buffIdentity == 0) - { - names[free] = utils.packStringId( new string_id ( "spam", "reuse_time_counted" )); - - String coolDownGroup = typeData.getString("cool_down_group"); - String varName = "clickItem."+ coolDownGroup; - int current_time = getGameTime(); - int timestamp = -1; - - if (hasObjVar(player,varName)) - { - timestamp = getIntObjVar(player,varName); - } - else if (beast_lib.hasActiveBeast(player)) - { - obj_id activeBeast = beast_lib.getBeastOnPlayer(player); - if (hasObjVar(activeBeast, varName)) - { - timestamp = getIntObjVar(activeBeast,varName); - } - } - - int time_remaining = timestamp - current_time; - - if (timestamp == -1 || time_remaining <= 0) - { - attribs[free] = "0"; - } - else - { - - attribs[free] = utils.assembleTimeRemainToUse(time_remaining); - } - free++; - if (free >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - } - - int requiredLevelForEffect = typeData.getInt( "required_level_for_effect"); - - if (requiredLevelForEffect != 0) - { - names[free] = utils.packStringId( new string_id ( "proc/proc", "effect_level" )); - attribs[free++] = "" +requiredLevelForEffect; - - } - - String buffName = typeData.getString( "buff_name"); - - if (buffName != null && !buffName.equals("") && buffIdentity == 0) - { - names[free] = utils.packStringId( new string_id ( "proc/proc", "proc_name" )); - attribs[free++] = utils.packStringId( new string_id ( "ui_buff", buffName)); - } - - if (hasObjVar(self, "armor.general_protection_clothing")) - { - int pseudoLevel = getIntObjVar(self, "armor.general_protection_clothing"); - String forceLevel = armor.getPseudoArmorLevel(pseudoLevel); - names[free] = utils.packStringId( new string_id ( "obj_attr_n", "protection_level" )); - attribs[free++] = utils.packStringId( new string_id ( "obj_attr_n", forceLevel)); - - } - - if (hasObjVar(self, "armor.fake_armor")) - { - names[free] = "armor_category"; - attribs[free++] = utils.packStringId(new string_id("obj_attr_n", "special") ); - - String[][] entries = - { - { - "kinetic", "energy" - } - , - { - "heat", "cold", "acid", "electricity" - } - }; - String[] protections = - { - "kinetic", "energy", "heat", "cold", "acid", "electricity" - }; - String[] tooltipProtections = - { - "armor_eff_kinetic", "armor_eff_energy", "armor_eff_elemental_heat", - "armor_eff_elemental_cold", "armor_eff_elemental_acid", "armor_eff_elemental_electrical" - }; - - for (int i = 0; i < entries.length; ++i) - { - testAbortScript(); - for (int j = 0; j < entries[i].length; ++j) - { - testAbortScript(); - if (free < names.length) - { - if (hasObjVar(self, "armor.fake_armor." + entries[i][j])) - { - int displayedProtections = getIntObjVar(self, "armor.fake_armor."+ entries[i][j]); - names[free] = (String)(armor.SPECIAL_PROTECTION_MAP.get(entries[i][j])); - attribs[free++] = Integer.toString(displayedProtections); - } - } - } - } - - for (int i = 0; i < protections.length; i++) - { - testAbortScript(); - if (hasObjVar(self, "armor.fake_armor." + protections[i])) - { - int displayedProtections = getIntObjVar(self, "armor.fake_armor."+ protections[i]); - names[free] = "tooltip." + tooltipProtections[i]; - attribs[free++] = Integer.toString(displayedProtections); - } - } - - if (utils.hasScriptVar(self, armor.SCRIPTVAR_SPECIES_RESTRICTIONS)) - { - String speciesRequirements = utils.getStringScriptVar(self, armor.SCRIPTVAR_SPECIES_RESTRICTIONS); - if (speciesRequirements != null && speciesRequirements.length() > 0) - { - names[free] = "species_restrictions.species_name"; - attribs[free++] = speciesRequirements; - - names[free] = "tooltip.species_restrictions"; - attribs[free++] = speciesRequirements; - } - } - } - - int tier = itemData.getInt("tier"); - names[free] = "tier"; - attribs[free++] = "" + tier; - - names[free] = "tooltip.tier"; - attribs[free++] = "" + tier; - - if (static_item.isUniqueStaticItem(self)) - { - names[free] = "unique"; - attribs[free++] = "1"; - } - - if (static_item.isSetBonusItem(self)) - { - int setBonusIndex = static_item.getSetBonusIndex(self); - - if (setBonusIndex == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int numTableRows = dataTableGetNumRows(static_item.SET_BONUS_TABLE); - - for (int i = 0; i < numTableRows; i++) - { - testAbortScript(); - int thisRowSetBonusIndex = dataTableGetInt(static_item.SET_BONUS_TABLE, i, "SETID"); - int numberOfSetItems = dataTableGetInt(static_item.SET_BONUS_TABLE, i, "NUM_ITEMS"); - - if (setBonusIndex == thisRowSetBonusIndex) - { - String setBonusBuffName = dataTableGetString(static_item.SET_BONUS_TABLE, i, "EFFECT"); - names[free] = utils.packStringId( new string_id ( "set_bonus", "piece_bonus_count_" + numberOfSetItems)); - attribs[free++] = utils.packStringId( new string_id ( "set_bonus", setBonusBuffName)); - } - - } - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - - if (!utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.SERVER_MENU47) - { - setObjVar(self, NO_SELL, true); - } - else if (item == menu_info_types.SERVER_MENU48) - { - removeObjVar(self, NO_SELL); - } - return SCRIPT_CONTINUE; - } - - - public int handlerVersionUpdate(obj_id self, dictionary params) throws InterruptedException - { - static_item.versionUpdate(self, params); - return SCRIPT_CONTINUE; - } - - - public int handleStaticReEquipItem(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId("player"); - - equip(self, player); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/structure_deed/city_hall_deed.java b/sku.0/sys.server/compiled/game/script/item/structure_deed/city_hall_deed.java deleted file mode 100644 index 3c6fcd5c3..000000000 --- a/sku.0/sys.server/compiled/game/script/item/structure_deed/city_hall_deed.java +++ /dev/null @@ -1,115 +0,0 @@ -package script.item.structure_deed; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.player_structure; -import script.library.utils; -import script.library.sui; -import script.library.city; - - - -public class city_hall_deed extends script.item.structure_deed.player_structure_deed -{ - public city_hall_deed() - { - } - public static final string_id SID_OBSCENE = new string_id("player_structure", "obscene"); - public static final string_id SID_NOT_UNIQUE = new string_id("player_structure", "cityname_not_unique"); - public static final string_id SID_ALREADY_MAYOR = new string_id("city/city", "already_mayor"); - - - public int handleNoReclaimConfirm(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVarTree(self, "noreclaim"); - - if (params == null || params.isEmpty()) - { - return SCRIPT_OVERRIDE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_OVERRIDE; - } - - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_OVERRIDE; - } - - if (!utils.isNestedWithin(self, player)) - { - return SCRIPT_OVERRIDE; - } - - location here = getLocation(player); - String template = player_structure.getDeedTemplate(self); - - if (!player_structure.canPlaceStructure(player, template, here, self)) - { - return SCRIPT_OVERRIDE; - } - - LOG("structure","city_hall_deed"); - - if (city.isAMayor( player )) - { - sendSystemMessage( player, SID_ALREADY_MAYOR ); - return SCRIPT_OVERRIDE; - } - - sui.inputbox( self, player, "@city/city:city_name_d", sui.OK_CANCEL, "@city/city:city_name_t", sui.INPUT_NORMAL, null, "handleSetCityName", null ); - - return SCRIPT_OVERRIDE; - } - - - public int handleSetCityName(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = sui.getPlayerId(params); - String cityName = sui.getInputBoxText( params ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - if ((cityName.equals("")) || isNameReserved(cityName)) - { - - sendSystemMessage( player, SID_OBSCENE ); - sui.inputbox( self, player, "@city/city:city_name_d", sui.OK_CANCEL, "@city/city:city_name_t", sui.INPUT_NORMAL, null, "handleSetCityName", null ); - return SCRIPT_CONTINUE; - } - - if (cityName.length() > 24) - { - cityName = cityName.substring( 0, 23 ); - } - - if (!city.isUniqueCityName( cityName )) - { - - sendSystemMessage( player, SID_NOT_UNIQUE ); - sui.inputbox( self, player, "@city/city:city_name_d", sui.OK_CANCEL, "@city/city:city_name_t", sui.INPUT_NORMAL, null, "handleSetCityName", null ); - return SCRIPT_CONTINUE; - } - - setObjVar( self, "cityName", cityName ); - - queueCommand( player, (123886506), self, "", COMMAND_PRIORITY_DEFAULT ); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/tool/crafted_armor_customization_kit.java b/sku.0/sys.server/compiled/game/script/item/tool/crafted_armor_customization_kit.java deleted file mode 100644 index fc6b85fe2..000000000 --- a/sku.0/sys.server/compiled/game/script/item/tool/crafted_armor_customization_kit.java +++ /dev/null @@ -1,392 +0,0 @@ -package script.item.tool; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.hue; -import script.library.metrics; -import script.library.sui; -import script.library.static_item; -import script.library.utils; - - -public class crafted_armor_customization_kit extends script.base_script -{ - public crafted_armor_customization_kit() - { - } - public static final boolean BLOGGING_ON = false; - public static final String BLOGGING_CATEGORY = "armor_recolor"; - - public static final String VAR_PREFIX = "armor_colorize"; - public static final String PID_NAME = VAR_PREFIX + ".pid"; - public static final String ARMOR_OBJ_LIST = VAR_PREFIX + ".armor_obj_list"; - public static final String ARMOR_NAME_LIST = VAR_PREFIX + ".armor_name_list"; - public static final String PLAYER_ID = VAR_PREFIX + ".player_oid"; - public static final String TOOL_ID = VAR_PREFIX + ".tool_oid"; - - public static final string_id NO_ARMOR = new string_id("tool/customizer", "no_armor"); - public static final String TITLE = "@tool/customizer:armor_customize_title"; - public static final String PROMPT = "@tool/customizer:armor_customize_prompt"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - blog("OnObjectMenuRequest - functions"); - - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - menu_info_data mid = mi.getMenuItemByType (menu_info_types.ITEM_USE); - if (mid != null) - { - mid.setServerNotify (true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.ITEM_USE) - { - beginArmorColorization(self, player); - } - - return SCRIPT_CONTINUE; - } - - - public boolean beginArmorColorization(obj_id self, obj_id player) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - else if (!isValidId(player) || !exists(player)) - { - return false; - } - - closeOldWindow(player); - - blog("beginArmorColorizationh: init"); - - Vector wornItems = new Vector(); - Vector items = new Vector(); - - obj_id[] equippedItems = metrics.getWornItems(player); - blog("equippedItems.length: "+equippedItems.length); - if (equippedItems != null && equippedItems.length > 0) - { - for (int i = 0; i < equippedItems.length; i++) - { - testAbortScript(); - if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/")) - { - if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/assault_trooper")) - { - continue; - } - else if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/mandalorian_imperial")) - { - continue; - } - else if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/mandalorian_rebel")) - { - continue; - } - else if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/rebel_")) - { - continue; - } - else if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/scout_")) - { - continue; - } - else if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/stormtrooper")) - { - continue; - } - wornItems.addElement(equippedItems[i]); - } - } - } - - obj_id[] invItems = utils.getContents(utils.getInventoryContainer(player), true); - blog("invItems.length: "+invItems.length); - - if (invItems != null && invItems.length > 0) - { - for (int i = 0; i < invItems.length; i++) - { - testAbortScript(); - if (getTemplateName(invItems[i]).startsWith("object/tangible/wearables/armor/")) - { - if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/assault_trooper")) - { - continue; - } - else if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/mandalorian_imperial")) - { - continue; - } - else if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/mandalorian_rebel")) - { - continue; - } - else if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/rebel_")) - { - continue; - } - else if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/scout_")) - { - continue; - } - else if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/stormtrooper")) - { - continue; - } - - items.addElement(invItems[i]); - } - } - } - - if (wornItems.isEmpty() && items.isEmpty()) - { - sendSystemMessage(player, NO_ARMOR); - return false; - } - - Vector armor = new Vector(); - Vector armorNames = new Vector(); - - if (!wornItems.isEmpty()) - { - for (int i = 0; i < wornItems.size(); i++) - { - testAbortScript(); - obj_id piece = (obj_id)wornItems.get(i); - if (isIdNull(getCrafter(piece))) - { - continue; - } - else if (static_item.isStaticItem(piece)) - { - continue; - } - - armor.addElement(piece); - String name = getName(piece); - armorNames.addElement(name + " (worn)"); - } - } - - if (!items.isEmpty()) - { - for (int i = 0; i < items.size(); i++) - { - testAbortScript(); - obj_id piece = (obj_id)items.get(i); - if (isIdNull(getCrafter(piece))) - { - continue; - } - else if (static_item.isStaticItem(piece)) - { - continue; - } - - armor.addElement(piece); - String name = getName(piece); - armorNames.addElement(name); - } - } - - utils.setScriptVar(player, ARMOR_OBJ_LIST, armor); - - int pid = sui.listbox(self, player, PROMPT, sui.OK_CANCEL, TITLE, armorNames, "handleArmorSelection", true, false); - dictionary params = new dictionary(); - - setSUIAssociatedLocation(pid, self); - setSUIMaxRangeToObject(pid, 8); - params.put("callingPid", pid); - sui.setPid(player, pid, PID_NAME); - - if (pid < 0) - { - removePlayerVars(player); - return false; - } - - return true; - } - - - public int handleArmorSelection(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - - if (idx < 0) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, PLAYER_ID, player); - utils.setScriptVar(player, TOOL_ID, self); - - obj_id[] armor = utils.getObjIdArrayScriptVar(player, ARMOR_OBJ_LIST); - - if (armor == null || armor.length == 0) - { - return SCRIPT_CONTINUE; - } - - if (idx >= armor.length) - { - return SCRIPT_CONTINUE; - } - - ranged_int_custom_var[] palColors = hue.getPalcolorVars(armor[idx]); - if ((palColors == null) || (palColors.length == 0)) - { - return SCRIPT_CONTINUE; - } - - String[] indexName = - { - "","","" - }; - for (int i = 0; i < palColors.length; i++) - { - testAbortScript(); - ranged_int_custom_var ri = palColors[i]; - String customizationVar = ri.getVarName(); - - if (customizationVar.startsWith("/")) - { - customizationVar = customizationVar.substring(1); - } - indexName[i] = customizationVar; - } - if (indexName[0].equals("")) - { - return SCRIPT_CONTINUE; - } - - openCustomizationWindow(player, armor[idx], indexName[0], -1, -1, indexName[1], -1, -1, indexName[2], -1, -1); - - return SCRIPT_CONTINUE; - } - - - public int decrementTool(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = utils.getObjIdScriptVar(self, PLAYER_ID); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - static_item.decrementStaticItem(self); - - removePlayerVars(player); - return SCRIPT_CONTINUE; - } - - - public int cancelTool(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = utils.getObjIdScriptVar(self, PLAYER_ID); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - removePlayerVars(player); - return SCRIPT_CONTINUE; - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - blog("closeOldWindow - init"); - - int pid = sui.getPid(player, PID_NAME); - blog("closeOldWindow - pid: "+pid); - if (pid > -1) - { - blog("closeOldWindow - force closing: "+pid); - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } - - - public void removePlayerVars(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - if (!isValidId(self) || !exists(self) || !isValidId(player) || !exists(player)) - { - return; - } - - utils.removeScriptVarTree(player, VAR_PREFIX); - utils.removeScriptVarTree(self, VAR_PREFIX); - utils.removeObjVar(player, VAR_PREFIX); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (!BLOGGING_ON) - { - return false; - } - else if (msg == null || msg.equals("")) - { - return false; - } - - LOG(BLOGGING_CATEGORY, msg); - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/tool/crafted_armor_recolor_kit.java b/sku.0/sys.server/compiled/game/script/item/tool/crafted_armor_recolor_kit.java deleted file mode 100644 index 117b1ea50..000000000 --- a/sku.0/sys.server/compiled/game/script/item/tool/crafted_armor_recolor_kit.java +++ /dev/null @@ -1,464 +0,0 @@ -package script.item.tool; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.hue; -import script.library.metrics; -import script.library.static_item; -import script.library.sui; -import script.library.utils; - - -public class crafted_armor_recolor_kit extends script.base_script -{ - public crafted_armor_recolor_kit() - { - } - public static final boolean BLOGGING_ON = true; - public static final String BLOGGING_CATEGORY = "armor_recolor"; - - public static final String PROP_SELECTEDINDEX = "SelectedIndex"; - public static final String PROP_TARGETRANGEMAX = "TargetRangeMax"; - public static final String PROP_TARGETVAR = "TargetVariable"; - public static final String PROP_TARGETID = "TargetNetworkId"; - public static final String PROP_TEXT = "Text"; - public static final String DEFAULT_TITLE = "Jaskell's Color Picker"; - public static final String SUI_COLORPICKER = "Script.ColorPicker"; - public static final String COLORPICKER_COLORPICKER = "ColorPicker"; - public static final String COLORPICKER_PAGE_CAPTION = "bg.caption"; - public static final String COLORPICKER_TITLE = COLORPICKER_PAGE_CAPTION + ".lblTitle"; - - public static final String FALSE = "false"; - public static final String TRUE = "true"; - - public static final String VAR_PREFIX = "armor_colorize"; - public static final String PID_NAME = VAR_PREFIX + ".pid"; - public static final String COLOR_INDEX_LIST = VAR_PREFIX + ".color_index_list"; - public static final String COLOR_INDEX_NUMBER = VAR_PREFIX + ".color_index_number"; - public static final String COLOR_OBJECT = VAR_PREFIX + ".color_object"; - public static final String PREVIOUS_BUTTON_VISIBILITIY = VAR_PREFIX + ".previous_button"; - public static final String NEXT_BUTTON_VISIBILITIY = VAR_PREFIX + ".next_button"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - setCount(self, 10); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - blog("OnObjectMenuRequest - functions"); - - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - menu_info_data mid = mi.getMenuItemByType (menu_info_types.ITEM_USE); - if (mid != null) - { - mid.setServerNotify (true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - blog("OnObjectMenuSelect - functions"); - - if (item == menu_info_types.ITEM_USE) - { - beginArmorColorization(self, player); - } - - return SCRIPT_CONTINUE; - } - - - public void beginArmorColorization(obj_id self, obj_id player) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return; - } - else if (!isValidId(player) || !exists(player)) - { - return; - } - - Vector wornItems = new Vector(); - - Vector items = new Vector(); - - obj_id[] equippedItems = metrics.getWornItems(player); - blog("equippedItems.length: "+equippedItems.length); - - if (equippedItems != null && equippedItems.length > 0) - { - for (int i = 0; i < equippedItems.length; i++) - { - testAbortScript(); - if (getTemplateName(equippedItems[i]).startsWith("object/tangible/wearables/armor/")) - { - wornItems.addElement(equippedItems[i]); - } - } - } - - obj_id[] invItems = utils.getContents(utils.getInventoryContainer(player), true); - blog("invItems.length: "+invItems.length); - - if (invItems != null && invItems.length > 0) - { - for (int i = 0; i < invItems.length; i++) - { - testAbortScript(); - if (getTemplateName(invItems[i]).startsWith("object/tangible/wearables/armor/")) - { - items.addElement(invItems[i]); - } - } - } - - blog("wornItems.size: "+wornItems.size()); - blog("items.size: "+items.size()); - - if (wornItems.isEmpty() && items.isEmpty()) - { - sendSystemMessage(player, new string_id("tool/customizer", "cadk_no_crusader_armor")); - return; - } - - String title = "@tool/customizer:cadk_sui_title"; - String prompt = "@tool/customizer:cadk_prompt1"; - - Vector armor = new Vector(); - Vector armorNames = new Vector(); - - if (!wornItems.isEmpty()) - { - for (int i = 0; i < wornItems.size(); i++) - { - testAbortScript(); - obj_id piece = (obj_id)wornItems.get(i); - - armor.addElement(piece); - - String name = getName(piece) + " ( currently worn )"; - armorNames.addElement(name); - } - } - - if (!items.isEmpty()) - { - for (int i = 0; i < items.size(); i++) - { - testAbortScript(); - obj_id piece = (obj_id)items.get(i); - armor.addElement(piece); - String name = getName(piece); - armorNames.addElement(name); - } - } - - int pid = sui.listbox(self, player, prompt, sui.OK_CANCEL, title, armorNames, "handleArmorSelection", true, false); - - if (pid < 0) - { - cleanup(self, player); - } - else - { - utils.setScriptVar(self, "cadk_armor", armor); - } - } - - - public int handleArmorSelection(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - - if (idx < 0) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id[] armor = utils.getObjIdArrayScriptVar(self, "cadk_armor"); - - if (armor == null || armor.length == 0) - { - return SCRIPT_CONTINUE; - } - - if (idx >= armor.length) - { - return SCRIPT_CONTINUE; - } - - ranged_int_custom_var[] palColors = hue.getPalcolorVars(armor[idx]); - if ((palColors == null) || (palColors.length == 0)) - { - return SCRIPT_CONTINUE; - } - - Vector indexName = new Vector(); - indexName.setSize(0); - for (int i = 0; i < palColors.length; i++) - { - testAbortScript(); - ranged_int_custom_var ri = palColors[i]; - String customizationVar = ri.getVarName(); - - if (customizationVar.startsWith("/")) - { - customizationVar = customizationVar.substring(1); - } - utils.addElement(indexName, customizationVar); - } - if (indexName == null || indexName.size() < 0) - { - return SCRIPT_CONTINUE; - } - - blog("color index length: "+indexName.size()); - utils.setScriptVar(player, COLOR_INDEX_LIST, indexName); - utils.setScriptVar(player, COLOR_INDEX_NUMBER, 0); - utils.setScriptVar(player, COLOR_OBJECT, armor[idx]); - - if (indexName.size() > 1) - { - utils.setScriptVar(player, NEXT_BUTTON_VISIBILITIY, TRUE); - } - - utils.setScriptVar(player, PREVIOUS_BUTTON_VISIBILITIY, FALSE); - createColorSui(self, player); - openCustomizationWindow(player, armor[idx], ((String)(indexName.get(0))), -1, -1, ((String)(indexName.get(1))), -1, -1, ((String)(indexName.get(2))), -1, -1); - - return SCRIPT_CONTINUE; - } - - - public boolean createColorSui(obj_id self, obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - closeOldWindow(player); - - obj_id armorObj = utils.getObjIdScriptVar(player, COLOR_OBJECT); - if (!isValidId(armorObj) || !exists(armorObj)) - { - return false; - } - - String[] indexName = utils.getStringArrayScriptVar(player, COLOR_INDEX_LIST); - if (indexName == null && indexName.length < 0) - { - return false; - } - - int indexNumber = utils.getIntScriptVar(player, COLOR_INDEX_NUMBER); - if (indexNumber < 0) - { - return false; - } - - int pid = createSUIPage("/Script.colorPicker", self, player); - if (pid < 0) - { - return false; - } - - dictionary params = new dictionary(); - - setSUIAssociatedLocation(pid, armorObj); - setSUIMaxRangeToObject(pid, 8); - params.put("callingPid", pid); - sui.setPid(player, pid, PID_NAME); - - setSUIProperty(pid, "ViewerPage.viewer", "SetObject", armorObj.toString()); - - setSUIProperty(pid, COLORPICKER_COLORPICKER, PROP_TARGETID, armorObj.toString()); - setSUIProperty(pid, COLORPICKER_COLORPICKER, PROP_TARGETVAR, indexName[indexNumber]); - setSUIProperty(pid, COLORPICKER_COLORPICKER, PROP_TARGETRANGEMAX, "500"); - setSUIProperty(pid, COLORPICKER_TITLE, PROP_TEXT, DEFAULT_TITLE); - subscribeToSUIProperty(pid, COLORPICKER_COLORPICKER, PROP_SELECTEDINDEX); - - setSUIProperty(pid, "previous_color", "Visible", utils.getStringScriptVar(player, PREVIOUS_BUTTON_VISIBILITIY)); - setSUIProperty(pid, "next_color", "Visible", utils.getStringScriptVar(player, NEXT_BUTTON_VISIBILITIY)); - - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "next_color", "next_color", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "next_color", "handlePaletteUpdate"); - - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "previous_color", "previous_color", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "previous_color", "handlePaletteUpdate"); - - showSUIPage(pid); - flushSUIPage(pid); - - return true; - } - - - public void cleanup(obj_id self, obj_id player) throws InterruptedException - { - utils.removeScriptVar(self, "cadk_armor"); - utils.removeScriptVar(self, "cadk_piece"); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (!BLOGGING_ON) - { - return false; - } - else if (msg == null || msg.equals("")) - { - return false; - } - - LOG(BLOGGING_CATEGORY, msg); - - return true; - } - - - public int handleCommit(obj_id self, dictionary params) throws InterruptedException - { - blog("handleCommit - init"); - - return SCRIPT_CONTINUE; - } - - - public int handlePaletteUpdate(obj_id self, dictionary params) throws InterruptedException - { - blog("handlePaletteUpdate - init"); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - blog("handlePaletteUpdate - player id: "+player); - - if (!sui.hasPid(player, PID_NAME)) - { - blog("handlePaletteUpdate - no PID"); - return SCRIPT_CONTINUE; - } - blog("handlePaletteUpdate - player has a pid scriptvar"); - int currentPid = sui.getPid(player, PID_NAME); - blog("handlePaletteUpdate - currentPid: "+ currentPid); - - String[] indexName = utils.getStringArrayScriptVar(player, COLOR_INDEX_LIST); - if (indexName == null && indexName.length < 0) - { - return SCRIPT_CONTINUE; - } - - blog("handlePaletteUpdate - indexName.length: "+ indexName.length); - - int indexNumber = utils.getIntScriptVar(player, COLOR_INDEX_NUMBER); - if (indexNumber < 0) - { - return SCRIPT_CONTINUE; - } - - blog("handlePaletteUpdate - indexNumber: "+ indexNumber); - - if (params.getString("previous_color.LocalText") != null && indexNumber > 0) - { - blog("handlePaletteUpdate - previous_color button pressed."); - blog("handlePaletteUpdate - indexNumber: "+ indexNumber); - indexNumber--; - blog("handlePaletteUpdate - indexNumber decrement: "+ indexNumber); - utils.setScriptVar(player, COLOR_INDEX_NUMBER, indexNumber); - if (indexNumber == 0) - { - utils.setScriptVar(player, PREVIOUS_BUTTON_VISIBILITIY, FALSE); - } - - utils.setScriptVar(player, NEXT_BUTTON_VISIBILITIY, TRUE); - createColorSui(self, player); - } - else if (params.getString("next_color.LocalText") != null && indexNumber < indexName.length) - { - blog("handlePaletteUpdate - next_color button pressed."); - blog("handlePaletteUpdate - indexNumber: "+ indexNumber); - indexNumber++; - blog("handlePaletteUpdate - indexNumber increment: "+ indexNumber); - blog("handlePaletteUpdate - indexName.length: "+ indexName.length); - utils.setScriptVar(player, COLOR_INDEX_NUMBER, indexNumber); - - if (indexNumber == indexName.length-1) - { - utils.setScriptVar(player, NEXT_BUTTON_VISIBILITIY, FALSE); - } - - utils.setScriptVar(player, PREVIOUS_BUTTON_VISIBILITIY, TRUE); - createColorSui(self, player); - } - - return SCRIPT_CONTINUE; - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - blog("closeOldWindow - init"); - - int pid = sui.getPid(player, PID_NAME); - blog("closeOldWindow - pid: "+pid); - if (pid > -1) - { - blog("closeOldWindow - force closing: "+pid); - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/tool/structure_customization_kit.java b/sku.0/sys.server/compiled/game/script/item/tool/structure_customization_kit.java deleted file mode 100644 index 244ea965f..000000000 --- a/sku.0/sys.server/compiled/game/script/item/tool/structure_customization_kit.java +++ /dev/null @@ -1,360 +0,0 @@ -package script.item.tool; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.hue; -import script.library.player_structure; -import script.library.sui; -import script.library.static_item; -import script.library.utils; - - -public class structure_customization_kit extends script.base_script -{ - public structure_customization_kit() - { - } - public static final boolean BLOGGING_ON = true; - public static final String BLOGGING_CATEGORY = "structure_recolor"; - - public static final int OBJECT_COLOR_MAX = 4; - - public static final String VAR_PREFIX = "structure_colorize"; - public static final String PID_NAME = VAR_PREFIX + ".pid"; - public static final String PLAYER_ID = VAR_PREFIX + ".player_oid"; - public static final String TOOL_ID = VAR_PREFIX + ".tool_oid"; - - public static final String CUSTOMER_SVC_CATEGORY = "playerStructure"; - public static final string_id SID_MUST_BE_INSIDE_STRUCTURE = new string_id("tool/customizer", "inside_structure_that_you_own"); - public static final string_id SID_MUST_BE_INSIDE_INVENTORY = new string_id("tool/customizer", "must_be_in_inventory"); - public static final string_id SID_STRUCTURE_PAINTING_FAILED = new string_id("tool/customizer", "there_was_a_problem_with_structure_kit"); - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (exists(self) && hasObjVar(self, "crafting_components.charges")) - { - names[idx] = "count"; - int attrib = getIntObjVar(self, "crafting_components.charges"); - attribs[idx] = Integer.toString(attrib); - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - blog("OnObjectMenuRequest - functions"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(self, player)) - { - sendSystemMessage(player, SID_MUST_BE_INSIDE_INVENTORY); - return SCRIPT_CONTINUE; - } - - menu_info_data mid = mi.getMenuItemByType (menu_info_types.ITEM_USE); - if (mid != null) - { - mid.setServerNotify (true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - blog("OnObjectMenuSelect - functions too"); - - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(self, player)) - { - sendSystemMessage(player, SID_MUST_BE_INSIDE_INVENTORY); - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog(CUSTOMER_SVC_CATEGORY, "A player "+ player + " is using crafted structure customization kit "+self+". [ OnObjectMenuSelect() ]"); - blog("OnObjectMenuSelect - player attempting to use kit not in inventory"); - if (!validateStructureOrCell(player)) - { - - sendSystemMessage(player, SID_MUST_BE_INSIDE_STRUCTURE); - return SCRIPT_CONTINUE; - } - if (!beginStructureColorization(self, player)) - { - sendSystemMessage(player, SID_STRUCTURE_PAINTING_FAILED); - CustomerServiceLog(CUSTOMER_SVC_CATEGORY, "A player "+ player + " used the crafted structure customization kit "+self+" and it failed to color or find a building. [ OnObjectMenuSelect() ]"); - blog("OnObjectMenuSelect - player failed trying to use beginStructureColorization"); - } - return SCRIPT_CONTINUE; - } - - - public boolean validateStructureOrCell(obj_id player) throws InterruptedException - { - blog("validateStructureOrCell - init"); - if (!isValidId(player) || !exists(player)) - { - return false; - } - - blog("validateStructureOrCell - initial validation done"); - - if (isInWorldCell(player)) - { - return false; - } - - obj_id house = getTopMostContainer(player); - if (!isIdValid(house) || !player_structure.isBuilding(house)) - { - return false; - } - - if (!player_structure.isOwner(house, player)) - { - return false; - } - - blog("validateStructureOrCell - looks good, returning"); - - return true; - } - - - public boolean beginStructureColorization(obj_id tool, obj_id player) throws InterruptedException - { - blog("beginStructureColorization - init"); - if (!isValidId(tool) || !exists(tool)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - - blog("beginStructureColorization - validation completed"); - - if (!utils.isNestedWithin(tool, player)) - { - sendSystemMessage(player, SID_MUST_BE_INSIDE_INVENTORY); - return false; - } - - blog("beginStructureColorization - about to validate structure."); - - if (!validateStructureOrCell(player)) - { - - CustomerServiceLog(CUSTOMER_SVC_CATEGORY, "ERROR: Player somehow got outside or in some invalid building while using the structure customization kit: "+tool+". [ beginStructureColorization() ]"); - sendSystemMessage(player, SID_MUST_BE_INSIDE_STRUCTURE); - return false; - } - - closeOldWindow(player); - blog("beginStructureColorization: validateStructureOrCell was ok"); - - obj_id house = getTopMostContainer(player); - if (!isIdValid(house) || !player_structure.isBuilding(house)) - { - - CustomerServiceLog(CUSTOMER_SVC_CATEGORY, "ERROR: Structure Customization Tool failed to find a valid structure to color. Kit: "+tool+". [ beginStructureColorization() ]"); - sendSystemMessage(player, SID_MUST_BE_INSIDE_STRUCTURE); - blog("beginStructureColorization: not in house"); - return false; - } - - String houseTemplate = getTemplateName(house); - if (houseTemplate == null || houseTemplate.equals("")) - { - - CustomerServiceLog(CUSTOMER_SVC_CATEGORY, "ERROR: Structure Customization Tool failed because kit could not get the structure template. Kit: "+tool+". [ beginStructureColorization() ]"); - blog("beginStructureColorization: no house template"); - return false; - } - - blog("beginStructureColorization - getting house pallete"); - ranged_int_custom_var[] palColors = hue.getPalcolorVars(house); - if ((palColors == null) || (palColors.length == 0)) - { - return false; - } - - blog("beginStructureColorization - palColors.length: "+palColors.length); - - int palColorsLength = palColors.length; - blog("beginStructureColorization - palColors.length: "+palColorsLength); - - String[] indexName = new String[OBJECT_COLOR_MAX]; - - blog("beginStructureColorization - indexName: "+indexName.length); - - int loop = OBJECT_COLOR_MAX; - if (palColorsLength < OBJECT_COLOR_MAX) - { - for (int i = 0; i < OBJECT_COLOR_MAX; i++) - { - testAbortScript(); - indexName[i] = ""; - } - - loop = palColorsLength; - } - - for (int i = 0; i < loop; i++) - { - testAbortScript(); - ranged_int_custom_var ri = palColors[i]; - if (ri != null) - { - blog("beginStructureColorization - indexName["+i+"]: "+indexName[i]); - String customizationVar = ri.getVarName(); - if (customizationVar.startsWith("/")) - { - customizationVar = customizationVar.substring(1); - } - indexName[i] = customizationVar; - } - } - if (indexName[0].equals("")) - { - CustomerServiceLog(CUSTOMER_SVC_CATEGORY, "Coloring Instantiating Color Customization UI on Object: "+ house +" for player "+player+ " has failed because the 1st color was null. Kit OID: "+tool+". [ beginStructureColorization() ]"); - return false; - } - CustomerServiceLog(CUSTOMER_SVC_CATEGORY, "Coloring Instantiating Color Customization UI on Object: "+ house +" for player "+player+ " using colorization using crafted armor customization kit "+tool+". [ beginStructureColorization() ]"); - blog("beginStructureColorization - Armor Piece getting color UI: "+ house); - - utils.setScriptVar(player, TOOL_ID, tool); - utils.setScriptVar(tool, PLAYER_ID, player); - openCustomizationWindow(player, house, indexName[0], -1, -1, indexName[1], -1, -1, indexName[2], -1, -1, indexName[3], -1, -1); - - return true; - } - - - public int decrementTool(obj_id self, dictionary params) throws InterruptedException - { - blog("decrementTool - init"); - - obj_id player = utils.getObjIdScriptVar(self, PLAYER_ID); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - blog("decrementTool - validation completed"); - - static_item.decrementStaticItem(self); - int count = getIntObjVar(self, "crafting_components.charges"); - - if (!exists(self)) - { - return SCRIPT_CONTINUE; - } - - count--; - if (count > 0) - { - setObjVar(self, "crafting_components.charges", count); - } - else - { - destroyObject(self); - } - - removePlayerVars(player); - return SCRIPT_CONTINUE; - } - - - public int cancelTool(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = utils.getObjIdScriptVar(self, PLAYER_ID); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - removePlayerVars(player); - return SCRIPT_CONTINUE; - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - blog("closeOldWindow - init"); - - int pid = sui.getPid(player, PID_NAME); - blog("closeOldWindow - pid: "+pid); - if (pid > -1) - { - blog("closeOldWindow - force closing: "+pid); - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } - - - public void removePlayerVars(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - if (!isValidId(self) || !exists(self) || !isValidId(player) || !exists(player)) - { - return; - } - - utils.removeScriptVarTree(player, VAR_PREFIX); - utils.removeScriptVarTree(self, VAR_PREFIX); - utils.removeObjVar(player, VAR_PREFIX); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (!BLOGGING_ON) - { - return false; - } - else if (msg == null || msg.equals("")) - { - return false; - } - - LOG(BLOGGING_CATEGORY, msg); - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/trigger_breach_music.java b/sku.0/sys.server/compiled/game/script/item/trigger_breach_music.java deleted file mode 100644 index 308b29f13..000000000 --- a/sku.0/sys.server/compiled/game/script/item/trigger_breach_music.java +++ /dev/null @@ -1,201 +0,0 @@ -package script.item; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.space_utils; - - -public class trigger_breach_music extends script.base_script -{ - public trigger_breach_music() - { - } - public static final string_id SID_TURN_ON = new string_id("spam", "turn_on_sound_object"); - public static final string_id SID_TURN_OFF = new string_id("spam", "turn_off_sound_object"); - - public static final String OBJVAR_SOUND_FILE = "soundFile"; - public static final String OBJVAR_IS_TURNED_ON = "itemIsOn"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (!utils.isInHouseCellSpace(self)) - { - return SCRIPT_CONTINUE; - } - - if (!hasTriggerVolume(self, "itemBreach")) - { - createTriggerVolume("itemBreach", 5.f, true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - if (!hasObjVar(self, OBJVAR_IS_TURNED_ON)) - { - return SCRIPT_CONTINUE; - } - - if (getIntObjVar(self, OBJVAR_IS_TURNED_ON) == 0) - { - return SCRIPT_CONTINUE; - } - - if (volumeName.equals("itemBreach")) - { - - if (!isPlayer(whoTriggeredMe)) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, OBJVAR_SOUND_FILE)) - { - return SCRIPT_CONTINUE; - } - String soundFile = getStringObjVar(self, OBJVAR_SOUND_FILE); - - playMusic(whoTriggeredMe, soundFile); - } - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - if (!hasObjVar(self, OBJVAR_IS_TURNED_ON)) - { - return SCRIPT_CONTINUE; - } - - if (getIntObjVar(self, OBJVAR_IS_TURNED_ON) == 0) - { - return SCRIPT_CONTINUE; - } - - if (volumeName.equals("itemBreach")) - { - - if (!isPlayer(whoTriggeredMe)) - { - return SCRIPT_CONTINUE; - } - - playMusic(whoTriggeredMe, "sound/music_silence.snd"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!utils.isInHouseCellSpace(self) && !space_utils.isNestedWithinPobShip(self)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, OBJVAR_IS_TURNED_ON) || getIntObjVar(self, OBJVAR_IS_TURNED_ON) == 0) - { - mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_TURN_ON); - } - else - { - mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_TURN_OFF); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - sendDirtyObjectMenuNotification(self); - - if (!utils.isInHouseCellSpace(self) && !space_utils.isNestedWithinPobShip(self)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.SERVER_MENU1) - { - - if (!hasObjVar(self, OBJVAR_IS_TURNED_ON) || getIntObjVar(self, OBJVAR_IS_TURNED_ON) == 0) - { - toggleSound(self, true); - } - else - { - toggleSound(self, false); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnTransferred(obj_id self, obj_id sourceContainer, obj_id destContainer, obj_id transferer) throws InterruptedException - { - messageTo(self, "handleTriggerBreachMusicItemTransferred", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public int handleTriggerBreachMusicItemTransferred(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.isInHouseCellSpace(self)) - { - toggleSound(self, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean toggleSound(obj_id item, boolean turnOn) throws InterruptedException - { - if (turnOn) - { - - setObjVar(item, OBJVAR_IS_TURNED_ON, true); - - if (!hasTriggerVolume(item, "itemBreach")) - { - createTriggerVolume("itemBreach", 5.f, true); - } - } - else - { - - setObjVar(item, OBJVAR_IS_TURNED_ON, false); - - if (hasTriggerVolume(item, "itemBreach")) - { - removeTriggerVolume("itemBreach"); - } - } - - obj_id[] players = getPlayerCreaturesInRange(getLocation(item), 25.0f); - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - obj_id temp = players[i]; - if (isIdValid(temp)) - { - playMusic(temp, "sound/music_silence.snd"); - } - } - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/wearable/allow_player_custom_color.java b/sku.0/sys.server/compiled/game/script/item/wearable/allow_player_custom_color.java deleted file mode 100644 index 8ed5b4333..000000000 --- a/sku.0/sys.server/compiled/game/script/item/wearable/allow_player_custom_color.java +++ /dev/null @@ -1,112 +0,0 @@ -package script.item.wearable; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.hue; -import script.library.sui; -import script.library.utils; - - -public class allow_player_custom_color extends script.base_script -{ - public allow_player_custom_color() - { - } - public static final string_id PCOLOR = new string_id("sui", "set_primary_color"); - public static final string_id SCOLOR = new string_id("sui", "set_secondary_color"); - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isGod(player)) - { - return SCRIPT_CONTINUE; - } - obj_id hueObject = self; - if (!utils.isNestedWithin(hueObject, player)) - { - return SCRIPT_CONTINUE; - } - - int mnuPrimaryColor = mi.addRootMenu(menu_info_types.SERVER_MENU9, PCOLOR); - int mnuSecondaryColor = mi.addRootMenu(menu_info_types.SERVER_MENU10, SCOLOR); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isGod(player)) - { - return SCRIPT_CONTINUE; - } - obj_id hueObject = self; - if (!utils.isNestedWithin(hueObject, player)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.SERVER_MENU9) - { - sui.colorize(hueObject, player, hueObject, hue.INDEX_1, "handlePrimaryColorize"); - } - if (item == menu_info_types.SERVER_MENU10) - { - sui.colorize(hueObject, player, hueObject, hue.INDEX_2, "handleSecondaryColorize"); - } - - return SCRIPT_CONTINUE; - } - - - public int handlePrimaryColorize(obj_id self, dictionary params) throws InterruptedException - { - obj_id hueObject = self; - int idx = sui.getColorPickerIndex(params); - int bp = sui.getIntButtonPressed(params); - obj_id player = sui.getPlayerId(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - if (idx > -1) - { - custom_var myVar = getCustomVarByName(hueObject, hue.INDEX_1); - if (myVar != null && myVar.isPalColor()) - { - palcolor_custom_var pcVar = (palcolor_custom_var)myVar; - pcVar.setValue(idx); - } - } - return SCRIPT_CONTINUE; - } - - - public int handleSecondaryColorize(obj_id self, dictionary params) throws InterruptedException - { - obj_id hueObject = self; - int idx = sui.getColorPickerIndex(params); - int bp = sui.getIntButtonPressed(params); - obj_id player = sui.getPlayerId(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - if (idx > -1) - { - custom_var myVar = getCustomVarByName(hueObject, hue.INDEX_2); - if (myVar != null && myVar.isPalColor()) - { - palcolor_custom_var pcVar = (palcolor_custom_var)myVar; - pcVar.setValue(idx); - } - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/item/wearable/set_non_armor_wearable_socket.java b/sku.0/sys.server/compiled/game/script/item/wearable/set_non_armor_wearable_socket.java deleted file mode 100644 index abb736905..000000000 --- a/sku.0/sys.server/compiled/game/script/item/wearable/set_non_armor_wearable_socket.java +++ /dev/null @@ -1,48 +0,0 @@ -package script.item.wearable; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - - -public class set_non_armor_wearable_socket extends script.base_script -{ - public set_non_armor_wearable_socket() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "setSocket", null, 1, false); - - return SCRIPT_CONTINUE; - } - - - public int setSocket(obj_id self, dictionary params) throws InterruptedException - { - int socketCount = 0; - - if (hasObjVar(self,"socket_count")) - { - socketCount = getIntObjVar(self,"socket_count"); - } - - if (socketCount > 0) - { - setSkillModSockets(self, socketCount); - } - - if (getSkillModSockets(self) > 0) - { - detachScript(self, "item.wearable.set_non_armor_wearable_socket"); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/advanced_turret.java b/sku.0/sys.server/compiled/game/script/library/advanced_turret.java deleted file mode 100644 index 6a7b1b8ad..000000000 --- a/sku.0/sys.server/compiled/game/script/library/advanced_turret.java +++ /dev/null @@ -1,690 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.factions; -import script.library.trace; -import script.library.pclib; -import script.library.weapons; -import script.library.vehicle; -import script.library.stealth; - - -public class advanced_turret extends script.base_script -{ - public advanced_turret() - { - } - public static final String ALERT_VOLUME_NAME = "turretAggroVolume"; - public static final float DEFAULT_TURRET_RANGE = 80.0f; - public static final float RANGE_TOO_CLOSE = 10f; - public static final String VAR_TURRET_BASE = "turret"; - public static final String IS_ACTIVE = VAR_TURRET_BASE + ".isActive"; - public static final String TARGETS = VAR_TURRET_BASE + ".targetList"; - public static final String TURRET_FRIEND = VAR_TURRET_BASE + ".isFriend"; - public static final String IS_ENGAGED = VAR_TURRET_BASE + ".isTrackingTarget"; - public static final String IS_OUTDOORS = VAR_TURRET_BASE + ".isOutdoors"; - public static final String FACTION = VAR_TURRET_BASE + ".faction"; - public static final String RANGE = VAR_TURRET_BASE + ".range"; - public static final String MY_WEAPON = VAR_TURRET_BASE + ".myWeapon"; - - public static final int TYPE_BLOCK = 1; - public static final int TYPE_DISH = 2; - public static final int TYPE_TOWER = 3; - - public static final int SIZE_SMALL = 1; - public static final int SIZE_MEDIUM = 2; - public static final int SIZE_LARGE = 3; - - - public static obj_id createTurret(location loc, float yaw, int minDamage, int maxDamage, float attackSpeed, float range) throws InterruptedException - { - return createTurret(loc, yaw, TYPE_BLOCK, SIZE_SMALL, DAMAGE_ENERGY, minDamage, maxDamage, range, attackSpeed, ""); - } - - - public static obj_id createTurret(location loc, float yaw, int type, int size, int damageType, int minDamage, int maxDamage, float range, float attackSpeed, String faction) throws InterruptedException - { - return createTurret(loc, yaw, TYPE_BLOCK, SIZE_SMALL, DAMAGE_ENERGY, minDamage, maxDamage, 10000, range, attackSpeed, ""); - } - - - public static obj_id createTurret(location loc, float yaw, int type, int size, int damageType, int minDamage, int maxDamage, int hitpoints, float range, float attackSpeed, String faction) throws InterruptedException - { - String template = "object/installation/turret/gcw/adv_turret"; - switch(type) - { - case TYPE_BLOCK: - template += "_block"; - break; - case TYPE_DISH: - template += "_dish"; - break; - case TYPE_TOWER: - template += "_tower"; - break; - } - - switch(size) - { - case SIZE_SMALL: - template += "_sm"; - break; - case SIZE_MEDIUM: - if (type == TYPE_DISH) - { - template += "_sm"; - } - else - { - template += "_med"; - } - break; - case SIZE_LARGE: - template += "_large"; - break; - } - - switch(damageType) - { - - case DAMAGE_ELEMENTAL_HEAT: - template += "_heat"; - break; - case DAMAGE_ELEMENTAL_COLD: - template += "_cold"; - break; - case DAMAGE_ELEMENTAL_ACID: - template += "_acid"; - break; - case DAMAGE_ELEMENTAL_ELECTRICAL: - template += "_electricity"; - break; - case DAMAGE_KINETIC: - template += "_kinetic"; - break; - default: - template += "_energy"; - break; - } - - template += ".iff"; - - obj_id turret = createObject(template, loc); - if (!isIdValid(turret)) - { - return null; - } - - setYaw(turret, yaw); - initTurret(turret, faction, damageType, range, minDamage, maxDamage, hitpoints, attackSpeed); - - return turret; - } - - - public static void activateTurret(obj_id turret) throws InterruptedException - { - LOG("TURRET", "activateTurret "+ turret); - if (!isIdValid(turret)) - { - return; - } - - obj_id turretWeapon = getTurretWeapon(turret); - if (!isIdValid(turretWeapon)) - { - return; - } - - utils.setScriptVar(turret, IS_ACTIVE, true); - setInvulnerable(turret, false); - pvpSetAttackableOverride(turret, true); - - weapons.setWeaponData(turretWeapon); - float range = getFloatObjVar(turret, RANGE); - dictionary dict = new dictionary(); - dict.put("range", range); - messageTo(turret, "createTriggerVolume", dict, 0.0f, false); - return; - } - - - public static void deactivateTurret(obj_id turret) throws InterruptedException - { - LOG("TURRET", "deactivateTurret "+ turret); - if (!isIdValid(turret)) - { - return; - } - - stopTrackingTarget(turret); - utils.removeScriptVar(turret, IS_ACTIVE); - setInvulnerable(turret, true); - - return; - } - - - public static boolean isActive(obj_id turret) throws InterruptedException - { - if (!isIdValid(turret)) - { - return false; - } - - if (utils.hasScriptVar(turret, IS_ACTIVE)) - { - LOG("TURRET", "Turret "+ turret + " is active."); - return true; - } - - LOG("TURRET", "Turret "+ turret + " is not active."); - return false; - } - - - public static void startTrackingTarget(obj_id turret, obj_id target) throws InterruptedException - { - LOG("TURRET", "Turret "+ turret + " start tracking target "+ target); - if (!isIdValid(turret) || !isIdValid(target)) - { - return; - } - - if (!isActive(turret)) - { - LOG("TURRET", "Turret "+ turret + " can't track target - turret inactive."); - return; - } - - utils.setScriptVar(turret, IS_ENGAGED, target); - - return; - } - - - public static void stopTrackingTarget(obj_id turret) throws InterruptedException - { - LOG("TURRET", "Turret "+ turret + " stop tracking target."); - if (!isIdValid(turret)) - { - return; - } - - utils.removeScriptVar(turret, IS_ENGAGED); - - return; - } - - - public static boolean isEngaged(obj_id turret) throws InterruptedException - { - if (!isIdValid(turret)) - { - return false; - } - - if (utils.hasScriptVar(turret, IS_ENGAGED)) - { - return true; - } - - return false; - } - - - public static obj_id getCurrentTarget(obj_id turret) throws InterruptedException - { - if (!isEngaged(turret)) - { - return null; - } - - return utils.getObjIdScriptVar(turret, IS_ENGAGED); - } - - - public static obj_id getTurretWeapon(obj_id turret) throws InterruptedException - { - if (!hasObjVar(turret, MY_WEAPON)) - { - return null; - } - - return getObjIdObjVar(turret, MY_WEAPON); - } - - - public static void initTurret(obj_id turret, String faction, int damageType, float range, int minDamage, int maxDamage, int hitpoints, float attackSpeed) throws InterruptedException - { - detachScript(turret, "systems.turret.turret_ai"); - attachScript(turret, "systems.turret.advanced_turret_ai"); - - boolean isOutdoors = getTopMostContainer(turret) == turret; - setObjVar(turret, IS_OUTDOORS, isOutdoors); - setObjVar(turret, FACTION, faction.equals("")? "renegade":faction); - setObjVar(turret, RANGE, range == -1f? DEFAULT_TURRET_RANGE : range); - factions.setFaction(turret, faction); - - setMaxHitpoints(turret, hitpoints); - setHitpoints(turret, hitpoints); - setObjVar(turret, "pvpCanAttack", 1); - setInvulnerable(turret, false); - - String weaponTemplate = "object/weapon/ranged/turret/turret_block_large.iff"; - obj_id objWeapon = createObject(weaponTemplate, turret, ""); - if (!isIdValid(objWeapon)) - { - explodeTurret(turret, turret); - return; - } - - setObjVar(turret, MY_WEAPON, objWeapon); - setWeaponAttackSpeed(objWeapon, attackSpeed < 1f? 1f : attackSpeed); - - int primaryType = DAMAGE_ENERGY; - int secondaryType = DAMAGE_ELEMENTAL_HEAT; - int primaryMinDamage = 0; - int primaryMaxDamage = 0; - int secondaryDamage = 0; - - switch(damageType) - { - case DAMAGE_ELEMENTAL_COLD: - case DAMAGE_ELEMENTAL_ACID: - case DAMAGE_ELEMENTAL_ELECTRICAL: - case DAMAGE_ELEMENTAL_HEAT: - primaryType = DAMAGE_ENERGY; - secondaryType = damageType; - primaryMinDamage = 1; - primaryMaxDamage = 1; - secondaryDamage = (int)((float)minDamage + (float)maxDamage / 2.0f); - break; - case DAMAGE_KINETIC: - case DAMAGE_ENERGY: - primaryType = damageType; - secondaryType = DAMAGE_ELEMENTAL_HEAT; - primaryMinDamage = minDamage; - primaryMaxDamage = maxDamage; - secondaryDamage = 0; - break; - } - - setWeaponDamageType(objWeapon, primaryType); - setWeaponElementalType(objWeapon, secondaryType); - - setWeaponMinDamage(objWeapon, minDamage); - setWeaponMaxDamage(objWeapon, maxDamage); - setWeaponElementalValue(objWeapon, secondaryDamage); - - range_info ri = new range_info(); - ri.maxRange = range; - setWeaponRangeInfo(objWeapon, ri); - - activateTurret(turret); - return; - } - - - public static boolean isValidTarget(obj_id turret, obj_id target) throws InterruptedException - { - - if (!isIdValid(turret) || !isIdValid(target) || !exists(turret) || !exists(target)) - { - doLogging("isValidTarget", "I or "+target+" is not valid or does not exist: "+isIdValid(turret)+"/"+isIdValid(target)+"/"+exists(turret)+"/"+exists(target)); - return false; - } - - if (vehicle.isVehicle(target)) - { - doLogging("isValidTarget", "Target "+getName(target)+" is a vehicle"); - return false; - } - - if (stealth.hasInvisibleBuff(target)) - { - doLogging("isValidTarget", "Target "+getName(target)+" has a stealth buff"); - return false; - } - - if (target == turret) - { - doLogging("isValidTarget", "I'm attempting to attack myself"); - return false; - } - - location there = getLocation(target); - location here = getLocation(turret); - - float range = hasObjVar(turret, RANGE) ? getFloatObjVar(turret, RANGE) : DEFAULT_TURRET_RANGE; - - float dist = getDistance(here, there); - if (dist > range + 1) - { - doLogging("isValidTarget", "Target out of range."); - return false; - } - - if (utils.hasScriptVar(target, TURRET_FRIEND)) - { - doLogging("isValidTarget", "Target is a friend."); - return false; - } - - if (isDead(target) || isIncapacitated(target)) - { - doLogging("isValidTarget", "Target is dead or incapped"); - return false; - } - - String turretFaction = hasObjVar(turret, FACTION) ? getStringObjVar(turret, FACTION) : getBaseFaction(turret); - if (!turretFaction.equals("renegade")) - { - String targetFaction = factions.getFaction(target); - if (!factions.areFactionsOpposed(turretFaction, targetFaction)) - { - doLogging("isValidTarget", "Our factions are not opposed: Self/Target: "+factions.getFaction(turret)+"/"+factions.getFaction(target)); - return false; - } - } - - return true; - } - - - public static String getBaseFaction(obj_id turret) throws InterruptedException - { - obj_id parentBase = getObjIdObjVar(turret, "hq.defense.parent"); - - if (!isIdValid(parentBase)) - { - return "renegade"; - } - - return getStringObjVar(parentBase, "faction"); - - } - - - public static void addTarget(obj_id turret, obj_id target) throws InterruptedException - { - if (!isValidTarget(turret, target)) - { - doLogging("addTarget", ""+getName(target)+"/"+target+" was invalid"); - return; - } - - Vector targets = null; - if (!utils.hasScriptVar(turret, TARGETS)) - { - targets = new Vector(); - } - else - { - targets = utils.getResizeableObjIdBatchScriptVar(turret, TARGETS); - } - - if (targets != null && targets.indexOf(target) == -1) - { - targets.add(target); - } - - if (targets.size() > 0) - { - utils.setBatchScriptVar(turret, TARGETS, targets); - if (!isEngaged(turret)) - { - attackPulse(turret); - } - } - - return; - } - - - public static void addTargets(obj_id turret, obj_id[] newTargets) throws InterruptedException - { - Vector targets = null; - if (!utils.hasScriptVar(turret, TARGETS)) - { - targets = new Vector(); - } - else - { - targets = utils.getResizeableObjIdBatchScriptVar(turret, TARGETS); - } - - for (int i = 0; i < newTargets.length; i++) - { - testAbortScript(); - if (!isValidTarget(turret, newTargets[i]) || targets.indexOf(newTargets[i]) != -1) - { - doLogging("addTargets", ""+getName(newTargets[i])+"/"+newTargets[i]+" was invalid or already in my target array"); - continue; - } - - targets.add(newTargets[i]); - } - - if (targets.size() > 0) - { - utils.setBatchScriptVar(turret, TARGETS, targets); - if (!isEngaged(turret)) - { - messageTo(turret, "handleTurretAttack", null, 1, false); - } - } - - return; - } - - - public static void removeTarget(obj_id turret, obj_id target) throws InterruptedException - { - if (!isIdValid(turret) || !isIdValid(target)) - { - doLogging("removeTarget", "Removed "+target); - return; - } - - if (!utils.hasScriptVar(turret, TARGETS)) - { - return; - } - - Vector targets = utils.getResizeableObjIdBatchScriptVar(turret, TARGETS); - obj_id engageTarget = utils.getObjIdScriptVar(turret, IS_ENGAGED); - - int idx = targets.indexOf(target); - if (idx > -1) - { - if (isIdValid(engageTarget) && target == engageTarget) - { - stopTrackingTarget(turret); - } - - targets.remove(idx); - if (targets.size() == 0) - { - utils.removeBatchScriptVar(turret, TARGETS); - - } - else - { - utils.setBatchScriptVar(turret, TARGETS, targets); - } - } - - return; - } - - - public static boolean handleTurretDamage(obj_id turret, obj_id attacker, obj_id weapon, int dmgAmount) throws InterruptedException - { - if (!validateAttacker(turret, attacker)) - { - doLogging("handleTurretDamage", getName(attacker)+"/"+attacker+" was not a valid attacker."); - return false; - } - int curHP = getHitpoints(turret); - if (curHP < 1) - { - explodeTurret(turret, attacker); - return true; - } - - addTarget(turret, attacker); - - if (!utils.hasScriptVar(turret, "playingEffect")) - { - int smolder = 2000; - int fire = 1000; - - if (curHP < smolder) - { - location death = getLocation(turret); - utils.setScriptVar(turret, "playingEffect", 1); - String effect = ""; - if (curHP < fire) - { - effect = "clienteffect/lair_hvy_damage_fire.cef"; - } - else - { - effect = "clienteffect/lair_med_damage_smoke.cef"; - } - - playClientEffectLoc(attacker, effect , death, 0); - messageTo(turret, "effectManager", null, 15, true); - } - } - - return true; - } - - - public static boolean validateAttacker(obj_id turret, obj_id attacker) throws InterruptedException - { - return pvpIsEnemy(turret, attacker); - } - - - public static void explodeTurret(obj_id turret, obj_id killer) throws InterruptedException - { - location death = getLocation(turret); - deactivateTurret(turret); - playClientEffectLoc(turret, "clienteffect/combat_explosion_lair_large.cef", death, 0); - messageTo(turret, "handleDestroyTurret", null, 2, false); - - return; - } - - - public static obj_id getGoodTurretTarget(obj_id turret) throws InterruptedException - { - - obj_id target = getCurrentTarget(turret); - if (!isValidTarget(turret, target) || isIncapacitated(target) || isDead(target) || !canSee(turret, target)) - { - if (isIncapacitated(target) && !isDead(target)) - { - pclib.coupDeGrace(target, turret, false); - } - target = null; - } - else - { - return target; - } - - if (!utils.hasScriptVar(turret, TARGETS)) - { - return null; - } - - Vector targets = utils.getResizeableObjIdBatchScriptVar(turret, TARGETS); - if ((targets == null) || (targets.size() == 0)) - { - doLogging("getGoodTurretTarget", "I had no target batchvar so I am returning null"); - return null; - } - - target = null; - while (!isIdValid(target)) - { - testAbortScript(); - if (targets.size() < 1) - { - break; - } - - target = (obj_id)targets.get(rand(0, targets.size() - 1)); - if ((!isValidTarget(turret, target) || isDead(target) || isIncapacitated(target) || !canSee(turret, target)|| vehicle.isVehicle(target) || stealth.hasInvisibleBuff(target))) - { - targets.removeElement(target); - target = null; - continue; - } - } - - if (targets.size() < 1) - { - stopTrackingTarget(turret); - utils.removeBatchScriptVar(turret, TARGETS); - } - else - { - utils.setBatchScriptVar(turret, TARGETS, targets); - } - return target; - } - - - public static void attackPulse(obj_id turret) throws InterruptedException - { - if (!isActive(turret)) - { - return; - } - - obj_id target = getGoodTurretTarget(turret); - if (!isIdValid(target)) - { - stopTrackingTarget(turret); - return; - } - - startTrackingTarget(turret, target); - executeAttackAction(turret, target); - } - - - public static void executeAttackAction(obj_id turret, obj_id target) throws InterruptedException - { - obj_id weapon = getTurretWeapon(turret); - if (!isIdValid(weapon)) - { - stopTrackingTarget(turret); - } - - dictionary params = new dictionary(); - params.put("target", target); - messageTo(turret, "turretShot", params, getWeaponAttackSpeed(weapon), false); - - return; - } - - - public static void doLogging(String section, String message) throws InterruptedException - { - LOG("doLogging/advanced_turret.scriptlib/"+section, message); - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/ai_lib.java b/sku.0/sys.server/compiled/game/script/library/ai_lib.java deleted file mode 100644 index 4129b1045..000000000 --- a/sku.0/sys.server/compiled/game/script/library/ai_lib.java +++ /dev/null @@ -1,2372 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.beast_lib; -import script.library.buff; -import script.library.chat; -import script.library.combat_consts; -import script.library.dot; -import script.library.locations; -import script.library.pet_lib; -import script.library.skill; -import script.library.movement; - - -public class ai_lib extends script.base_script -{ - public ai_lib() - { - } - public static final float PLAYER_RUN_SPEED = 8f; - public static final float AI_MAX_MOVEMENT_SPEED = PLAYER_RUN_SPEED; - - public static final String ALERT_VOLUME_NAME = "alertTriggerVolume"; - public static final String AGGRO_VOLUME_NAME = "aggroTriggerVolume"; - - public static final String MOOD_CALM = "calm"; - public static final String MOOD_NERVOUS = "nervous"; - public static final String MOOD_THREATEN = "threaten"; - - public static final int BEHAVIOR_WANDER = 0; - public static final int BEHAVIOR_SENTINEL = 1; - public static final int BEHAVIOR_LOITER = 2; - public static final int BEHAVIOR_STOP = 3; - - public static final String DIF_VERY_EASY = "veryEasy"; - public static final String DIF_EASY = "easy"; - public static final String DIF_MEDIUM = "medium"; - public static final String DIF_HARD = "hard"; - public static final String DIF_VERY_HARD = "veryHard"; - - public static final String ALLY_LIST = "allyList"; - - public static final String CREATURE_TABLE = "datatables/mob/creatures.iff"; - public static final String CREATURE_NAME_FILE = "mob/creature_names"; - - public static final String ACTION_ALERT = "alert"; - public static final String ACTION_THREATEN = "threaten"; - - public static final string_id SMUGGLER_SCAN_SUCCESS = new string_id("base_player","smuggler_scan_success"); - public static final string_id SMUGGLER_SCAN_FAIL = new string_id("base_player","smuggler_scan_fail"); - - public static final float DEFAULT_FOLLOW_MIN = 4f; - public static final float DEFAULT_FOLLOW_MAX = 8f; - - public static final String OBJVAR_ATTACKABLE_OVERRIDE = "ai_combat.attackable"; - - public static final String SCRIPTVAR_CACHED_PATROL_PATH = "ai.patrolPath"; - public static final String SCRIPTVAR_CACHED_PATROL_NAMED_PATH = "ai.patrolNamedPath"; - public static final String SCRIPTVAR_CACHED_PATROL_TYPE = "ai.patrolType"; - - public static final int PATROL_FLAG_RANDOM = 0x0001; - public static final int PATROL_FLAG_FLIP = 0x0002; - public static final int PATROL_FLAG_REPEAT = 0x0004; - - public static final int FORMATION_COLUMN = 0; - public static final int FORMATION_WEDGE = 1; - public static final int FORMATION_LINE = 2; - public static final int FORMATION_BOX = 3; - - public static final int DIFFICULTY_NORMAL = 0; - public static final int DIFFICULTY_ELITE = 1; - public static final int DIFFICULTY_BOSS = 2; - - public static final String SHARED_HEALTH_LIST = "shared_health_list"; - - - public static boolean isWithinLeash(obj_id ai) throws InterruptedException - { - final float distanceToHome = getDistance(getLocation(ai), aiGetLeashAnchorLocation(ai)); - final float leashRadius = aiGetLeashRadius(); - - return (distanceToHome <= leashRadius); - } - - - public static void resetAi() throws InterruptedException - { - final obj_id self = getSelf(); - - LOGC(aiLoggingEnabled(self), "debug_ai", ("ai_lib::resetAi() --- BEGIN RESET AI --- self("+ self + ") getName("+ getName(self) + ")")); - - setMovementWalk(self); - movement.refresh(self); - - resetCombatTriggerVolumes(); - - messageTo(self, "resumeDefaultCalmBehavior", null, 1, false); - - LOGC(aiLoggingEnabled(self), "debug_ai", ("ai_lib::resetAi() --- END RESET AI --- self("+ self + ") getName("+ getName(self) + ")")); - } - - - public static void resetCombatTriggerVolumes() throws InterruptedException - { - final obj_id self = getSelf(); - - LOGC(aiLoggingEnabled(self), "debug_ai", ("ai_lib::resetCombatTriggerVolumes() self("+ self + ") getName("+ getName(self) + ")")); - - boolean needsCombatTriggerVolumes = true; - - if (isInvulnerable(self)) - { - needsCombatTriggerVolumes = false; - } - else if (isAnimal(self) && !aiIsAggressive(self)) - { - needsCombatTriggerVolumes = false; - } - else if (isVehicleMine(self)) - { - needsCombatTriggerVolumes = false; - } - else if (beast_lib.isBeast(self)) - { - needsCombatTriggerVolumes = false; - } - - if (needsCombatTriggerVolumes) - { - - { - final boolean promiscuous = true; - final float alertRadius = 64.0f; - createTriggerVolume(ai_lib.ALERT_VOLUME_NAME, alertRadius, promiscuous); - } - - { - final boolean promiscuous = false; - final float aggroRadius = aiGetAggroRadius(self); - createTriggerVolume(ai_lib.AGGRO_VOLUME_NAME, aggroRadius, promiscuous); - } - } - } - - - public static void clearCombatData() throws InterruptedException - { - LOG("get_participants", "clearCombatData init"); - - final obj_id self = getSelf(); - obj_id[] hateList = getHateList(self); - LOG("get_participants", "clearCombatData hateList.length: "+hateList.length); - - } - - - public static boolean isInCombat(obj_id ai) throws InterruptedException - { - return (getState(ai, STATE_COMBAT) == 1); - } - - - public static void setAttackable(obj_id npc, boolean val) throws InterruptedException - { - if (val) - { - setObjVar(npc, OBJVAR_ATTACKABLE_OVERRIDE, 1); - } - else if (hasObjVar(npc, OBJVAR_ATTACKABLE_OVERRIDE)) - { - removeObjVar(npc, OBJVAR_ATTACKABLE_OVERRIDE); - } - } - - - public static boolean isAttackable(obj_id npc) throws InterruptedException - { - return hasObjVar(npc, OBJVAR_ATTACKABLE_OVERRIDE); - } - - - public static void setMood(obj_id npc, String mood) throws InterruptedException - { - - obj_id thisNpc = getSelf(); - if (thisNpc != npc) - { - - dictionary parms = new dictionary(); - parms.put( "animMood", mood ); - messageTo( npc, "handleAnimationAction", parms, 1, false ); - return; - } - - if (ai_lib.isAiDead( npc )) - { - - return; - } - - if (mood.equals(MOOD_CALM)) - { - - removeObjVar( npc, "ai.mood"); - } - else - { - - setObjVar( npc, "ai.mood", mood ); - } - - if (mood.equals(MOOD_THREATEN)) - { - - chat.setAngryMood( npc ); - ai_lib.barkString( npc, "threat"); - } - else if (mood.equals(MOOD_NERVOUS)) - { - - chat.setBadMood( npc ); - ai_lib.barkString( npc, "alert"); - } - - if (mood.equals(MOOD_CALM) && hasObjVar( npc, "ai.defaultCalmMood" )) - { - - mood = getStringObjVar( npc, "ai.defaultCalmMood"); - - } - else - { - - } - - setAnimationMood( npc, mood ); - } - - - public static void doAction(obj_id npc, String anim) throws InterruptedException - { - obj_id thisNpc = getSelf(); - if (thisNpc != npc) - { - dictionary parms = new dictionary(); - parms.put( "anim", anim ); - messageTo( npc, "handleAnimationAction", parms, 1, false ); - return; - } - - if (ai_lib.isAiDead( npc )) - { - return; - } - - int npcPosture = getPosture( npc ); - if (npcPosture != POSTURE_UPRIGHT) - { - if (npcPosture != POSTURE_KNOCKED_DOWN) - { - posture.stand(npc); - } - - removeObjVar( npc, "ai.combat.moveMode"); - } - else - { - doAnimationAction( npc, anim ); - } - } - - - public static void setPatrolPath(obj_id npc, String[] waypoints) throws InterruptedException - { - setPatrolPath(npc, waypoints, 0); - } - - - public static void setPatrolPath(obj_id npc, String[] waypoints, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && waypoints != null) - { - location[] patrolLocs = parseWaypoints( npc, waypoints ); - if (patrolLocs != null) - { - setPatrolPath(npc, patrolLocs, startPoint); - } - } - } - - - public static void setPatrolOncePath(obj_id npc, String[] waypoints) throws InterruptedException - { - setPatrolOncePath(npc, waypoints, 0); - } - - - public static void setPatrolOncePath(obj_id npc, String[] waypoints, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && waypoints != null) - { - location[] patrolLocs = parseWaypoints( npc, waypoints ); - if (patrolLocs != null) - { - setPatrolOncePath(npc, patrolLocs, startPoint); - } - } - } - - - public static void setPatrolRandomPath(obj_id npc, String[] waypoints) throws InterruptedException - { - if (isIdValid(npc) && waypoints != null) - { - location[] patrolLocs = parseWaypoints( npc, waypoints ); - if (patrolLocs != null) - { - setPatrolRandomPath(npc, patrolLocs); - } - } - } - - - public static void setPatrolRandomOncePath(obj_id npc, String[] waypoints) throws InterruptedException - { - if (isIdValid(npc) && waypoints != null) - { - location[] patrolLocs = parseWaypoints( npc, waypoints ); - if (patrolLocs != null) - { - setPatrolRandomOncePath(npc, patrolLocs); - } - } - } - - - public static void setPatrolFlipPath(obj_id npc, String[] waypoints) throws InterruptedException - { - setPatrolFlipPath(npc, waypoints, 0); - } - - - public static void setPatrolFlipPath(obj_id npc, String[] waypoints, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && waypoints != null) - { - location[] patrolLocs = parseWaypoints( npc, waypoints ); - if (patrolLocs != null) - { - setPatrolFlipPath(npc, patrolLocs, startPoint); - } - } - } - - - public static void setPatrolFlipOncePath(obj_id npc, String[] waypoints) throws InterruptedException - { - setPatrolFlipOncePath(npc, waypoints, 0); - } - - - public static void setPatrolFlipOncePath(obj_id npc, String[] waypoints, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && waypoints != null) - { - location[] patrolLocs = parseWaypoints( npc, waypoints ); - if (patrolLocs != null) - { - setPatrolFlipOncePath(npc, patrolLocs, startPoint); - } - } - } - - - public static void setPatrolPath(obj_id npc, location[] patrolLoc) throws InterruptedException - { - setPatrolPath(npc, patrolLoc, 0); - } - - - public static void setPatrolPath(obj_id npc, location[] patrolLoc, int startPoint) throws InterruptedException - { - LOGC(aiLoggingEnabled(npc), "debug_ai", ("ai_lib::setPatrolPath() self("+ npc + ") getName("+ getName(npc) + ") patrolLength("+ patrolLoc + ")")); - - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, PATROL_FLAG_REPEAT); - patrol(npc, patrolLoc, startPoint); - } - } - - - public static void setPatrolOncePath(obj_id npc, location[] patrolLoc) throws InterruptedException - { - setPatrolOncePath(npc, patrolLoc, 0); - } - - - public static void setPatrolOncePath(obj_id npc, location[] patrolLoc, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(npc, patrolLoc, startPoint); - } - } - - - public static void setPatrolRandomPath(obj_id npc, location[] patrolLoc) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, PATROL_FLAG_RANDOM | PATROL_FLAG_REPEAT); - patrolRandom(npc, patrolLoc); - } - } - - - public static void setPatrolRandomOncePath(obj_id npc, location[] patrolLoc) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, PATROL_FLAG_RANDOM); - patrolRandomOnce(npc, patrolLoc); - } - } - - - public static void setPatrolFlipPath(obj_id npc, location[] patrolLoc) throws InterruptedException - { - setPatrolFlipPath(npc, patrolLoc, 0); - } - - - public static void setPatrolFlipPath(obj_id npc, location[] patrolLoc, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, PATROL_FLAG_FLIP | PATROL_FLAG_REPEAT); - patrolFlip(npc, patrolLoc, startPoint); - } - } - - - public static void setPatrolFlipOncePath(obj_id npc, location[] patrolLoc) throws InterruptedException - { - setPatrolFlipOncePath(npc, patrolLoc, 0); - } - - - public static void setPatrolFlipOncePath(obj_id npc, location[] patrolLoc, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, PATROL_FLAG_FLIP); - patrolFlipOnce(npc, patrolLoc, startPoint); - } - } - - - public static void setPatrolNamedPath(obj_id npc, String[] patrolLoc) throws InterruptedException - { - setPatrolNamedPath(npc, patrolLoc, 0); - } - - - public static void setPatrolNamedPath(obj_id npc, String[] patrolLoc, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_NAMED_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, PATROL_FLAG_REPEAT); - patrol(npc, patrolLoc, startPoint); - } - } - - - public static void setPatrolOnceNamedPath(obj_id npc, String[] patrolLoc) throws InterruptedException - { - setPatrolOnceNamedPath(npc, patrolLoc, 0); - } - - - public static void setPatrolOnceNamedPath(obj_id npc, String[] patrolLoc, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_NAMED_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(npc, patrolLoc, startPoint); - } - } - - - public static void setPatrolRandomNamedPath(obj_id npc, String[] patrolLoc) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - if (!exists(npc)) - { - LOG("debug_ai", "WARNING: ai_lib.setPatrolRandomNamedPath passed npc id "+ npc + " that doesn't exist"); - return; - } - else if (!isGameObjectTypeOf(npc, GOT_creature)) - { - LOG("debug_ai", "WARNING: ai_lib.setPatrolRandomNamedPath passed npc id "+ npc + " that is not a creature. "+ - "Object template = "+ getTemplateName(npc)); - } - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_NAMED_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, PATROL_FLAG_RANDOM | PATROL_FLAG_REPEAT); - patrolRandom(npc, patrolLoc); - } - } - - - public static void setPatrolRandomOnceNamedPath(obj_id npc, String[] patrolLoc) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_NAMED_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, PATROL_FLAG_RANDOM); - patrolRandomOnce(npc, patrolLoc); - } - } - - - public static void setPatrolFlipNamedPath(obj_id npc, String[] patrolLoc) throws InterruptedException - { - setPatrolFlipNamedPath(npc, patrolLoc, 0); - } - - - public static void setPatrolFlipNamedPath(obj_id npc, String[] patrolLoc, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_NAMED_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, PATROL_FLAG_FLIP | PATROL_FLAG_REPEAT); - patrolFlip(npc, patrolLoc, startPoint); - } - } - - - public static void setPatrolFlipOnceNamedPath(obj_id npc, String[] patrolLoc) throws InterruptedException - { - setPatrolFlipOnceNamedPath(npc, patrolLoc, 0); - } - - - public static void setPatrolFlipOnceNamedPath(obj_id npc, String[] patrolLoc, int startPoint) throws InterruptedException - { - if (isIdValid(npc) && patrolLoc != null) - { - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_NAMED_PATH, patrolLoc); - utils.setScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE, PATROL_FLAG_FLIP); - patrolFlipOnce(npc, patrolLoc, startPoint); - } - } - - - public static void clearPatrolPath(obj_id npc) throws InterruptedException - { - if (isIdValid(npc)) - { - utils.removeScriptVar(npc, SCRIPTVAR_CACHED_PATROL_PATH); - utils.removeScriptVar(npc, SCRIPTVAR_CACHED_PATROL_NAMED_PATH); - utils.removeScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE); - } - } - - - public static void resumePatrol(obj_id npc) throws InterruptedException - { - LOGC(aiLoggingEnabled(npc), "debug_ai", ("ai_lib::resumePatrol() self("+ npc + ") getName("+ getName(npc) + ")")); - - if (isIdValid(npc) && aiGetMovementState(npc) != MOVEMENT_PATROL && hasSuspendedMovement(npc)) - { - resumeMovement(npc); - } - } - - - public static boolean canPatrol(obj_id npc) throws InterruptedException - { - if (isIdValid(npc)) - { - return utils.hasScriptVar(npc, SCRIPTVAR_CACHED_PATROL_TYPE); - } - return false; - } - - - public static location[] parseWaypoints(obj_id npc, String[] waypoints) throws InterruptedException - { - if (!isIdValid(npc) || waypoints != null) - { - return null; - } - - location baseLoc = aiGetHomeLocation( npc ); - if ((baseLoc.x == 0.0f) && (baseLoc.z == 0.0f)) - { - baseLoc = getLocation( npc ); - if ((baseLoc.x == 0.0f) && (baseLoc.z == 0.0f)) - { - debugServerConsoleMsg( npc, "* ERROR: TRYING TO GET LOCATION ON AN NPC NOT INSTANTIATED! *"); - return null; - } - } - - location[] patrolLocs = new location[waypoints.length]; - - location patrolLoc = new location( baseLoc ); - for (int i = 0; i < waypoints.length; i++) - { - testAbortScript(); - float[] coords = parseWaypoints( waypoints[i] ); - if (coords != null && coords.length == 2) - { - patrolLoc.x = baseLoc.x + coords[0]; - patrolLoc.z = baseLoc.z + coords[1]; - } - else - { - debugServerConsoleMsg( npc, "* ERROR: COULD NOT PARSE WAYPOINT STRING <"+ waypoints[i] + "> *"); - } - patrolLocs[i] = patrolLoc; - } - return patrolLocs; - } - - - public static float[] parseWaypoints(String text) throws InterruptedException - { - int intIndex = 0; - int intI = 0; - intIndex = text.indexOf(","); - String strText1 = ""; - String strText2 = ""; - if (intIndex < 0) - { - return null; - } - else - { - while (intI < text.length()) - { - testAbortScript(); - if (intI < intIndex) - { - strText1 = strText1+text.charAt(intI); - } - else if (intI > intIndex) - { - strText2 = strText2+text.charAt(intI); - } - - intI = intI+1; - } - } - float[] returnCoords = new float[2]; - returnCoords[0] = Float.parseFloat(strText1); - returnCoords[1] = Float.parseFloat(strText2); - return returnCoords; - } - - - public static void setIgnoreCombat(obj_id npc) throws InterruptedException - { - setWantSawAttackTriggers( npc, false ); - } - - - public static void barkString(obj_id npc, String text) throws InterruptedException - { - - if (!text.equals("death")) - { - if (ai_lib.isAiDead( npc )) - { - return; - } - } - - if (!hasObjVar( npc, "ai.diction")) - { - return; - } - - if (utils.hasScriptVar( npc, "ai.recentlyBarked")) - { - if (getGameTime() < utils.getIntScriptVar( npc, "ai.recentlyBarked")) - { - return; - } - } - - if (!ai_lib.isNpc( npc ) && !pet_lib.isDroidPet( npc )) - { - removeObjVar( npc, "ai.diction"); - return; - } - - if (getSpecies (npc)==SPECIES_WOOKIEE) - { - removeObjVar( npc, "ai.diction"); - return; - } - - utils.setScriptVar( npc, "ai.recentlyBarked", getGameTime()+rand(20,45) ); - - location loc = getLocation( npc ); - if (locations.isInCity( loc )) - { - if (rand(1,100) != 1) - { - return; - } - } - else - { - if (rand( 1,10) != 1) - { - return; - } - } - - String diction = getStringObjVar( npc, "ai.diction"); - String stringFile = "npc_reaction/"+ diction; - - String textString = text + "_"+ rand( 1, 16 ); - string_id speakString = new string_id( stringFile, textString ); - if (getString(speakString) == null) - { - debugServerConsoleMsg( npc, "WARNING: Npc_reaction "+ speakString + " - does it exist?"); - return; - } - - chat.chat( npc, speakString ); - } - - - public static boolean isAnimal(obj_id npc) throws InterruptedException - { - return isMonster(npc); - } - - - public static boolean isMonster(obj_id npc) throws InterruptedException - { - int myNiche = aiGetNiche( npc ); - if ((myNiche == NICHE_MONSTER || myNiche == NICHE_HERBIVORE || myNiche == NICHE_CARNIVORE || myNiche == NICHE_PREDATOR)) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isDroid(obj_id npc) throws InterruptedException - { - int niche = aiGetNiche(npc); - if (niche == NICHE_DROID) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isPredator(obj_id npc) throws InterruptedException - { - int niche = aiGetNiche(npc); - if (niche == NICHE_PREDATOR) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isCarnivore(obj_id npc) throws InterruptedException - { - int niche = aiGetNiche(npc); - if (niche == NICHE_CARNIVORE) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isHerbivore(obj_id npc) throws InterruptedException - { - int niche = aiGetNiche(npc); - if (niche == NICHE_HERBIVORE) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isVehicle(obj_id npc) throws InterruptedException - { - int niche = aiGetNiche(npc); - if (niche == NICHE_VEHICLE) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isAndroid(obj_id npc) throws InterruptedException - { - int niche = aiGetNiche(npc); - if (niche == NICHE_ANDROID) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isHumanoid(obj_id target) throws InterruptedException - { - if (isPlayer(target)) - { - return true; - } - else - { - int niche = aiGetNiche(target); - if (niche == NICHE_NPC || niche == NICHE_ANDROID) - { - return true; - } - } - - return false; - } - - - public static boolean isNpc(obj_id npc) throws InterruptedException - { - int myNiche = aiGetNiche( npc ); - return (myNiche == NICHE_NPC); - } - - - public static boolean isTurret(obj_id npc) throws InterruptedException - { - int got = getGameObjectType(npc); - if (isGameObjectTypeOf(got, GOT_installation_turret)) - { - return true; - } - else - { - return false; - } - } - - - public static void setIgnoreCombat(obj_id npc, boolean b) throws InterruptedException - { - setWantSawAttackTriggers( npc, b); - } - - - public static void setDefaultCalmBehavior(obj_id npc, int behavior) throws InterruptedException - { - LOGC(aiLoggingEnabled(npc), "debug_ai", "ai_lib::setDefaultCalmBehavior() self("+ npc + getName(npc) + ") behavior("+ behavior + ")"); - - if (!isIdValid(npc)) - { - return; - } - - if (behavior == BEHAVIOR_WANDER) - { - behavior = BEHAVIOR_LOITER; - } - - setObjVar(npc, "ai.defaultCalmBehavior", behavior); - messageTo(npc, "handleSetDefaultBehavior", null, 1, false); - } - - - public static void greet(obj_id ai, obj_id player) throws InterruptedException - { - LOGC(aiLoggingEnabled(ai), "debug_ai", "ai_lib::greet() ai("+ ai + ":"+ getName(ai) + ") player("+ player + ":"+ getName(player) + ")"); - - if (isInCombat(ai)) - { - return; - } - - final int reaction = factions.getFactionReaction(ai, player); - - if (reaction < factions.REACTION_NEUTRAL) - { - chat.setAngryMood(ai ); - ai_lib.barkString(ai, "hi_mean"); - } - else if (reaction > factions.REACTION_NEUTRAL) - { - chat.setGoodMood(ai); - ai_lib.barkString(ai, "hi_nice"); - } - else - { - chat.setNeutralMood(ai); - ai_lib.barkString(ai, "hi_mid"); - } - } - - - public static void dismiss(obj_id ai, obj_id player) throws InterruptedException - { - LOGC(aiLoggingEnabled(ai), "debug_ai", "ai_lib::dismiss() ai("+ ai + ":"+ getName(ai) + ") player("+ player + ":"+ getName(player) + ")"); - - if (isInCombat(ai)) - { - return; - } - - final int reaction = factions.getFactionReaction(ai, player); - - if (reaction < factions.REACTION_NEUTRAL) - { - chat.setBadMood(ai); - ai_lib.barkString(ai, "bye_mean"); - } - else if (reaction > factions.REACTION_NEUTRAL) - { - chat.setGoodMood(ai); - ai_lib.barkString(ai, "bye_nice"); - } - else - { - chat.setNeutralMood(ai); - ai_lib.barkString(ai, "bye_mid"); - } - } - - - public static boolean aiIsDead(obj_id npc) throws InterruptedException - { - return isAiDead( npc ); - } - - - public static boolean isAiDead(obj_id npc) throws InterruptedException - { - if (!isMob(npc)) - { - return (isDisabled(npc)); - } - - if (isIncapacitated( npc )) - { - - return true; - } - - if (isDead(npc)) - { - - return true; - } - - return false; - } - - - public static void aiFollow(obj_id npc, obj_id target) throws InterruptedException - { - aiFollow(npc, target, DEFAULT_FOLLOW_MIN, DEFAULT_FOLLOW_MAX); - } - - - public static void aiFollow(obj_id npc, obj_id target, float min_dist, float max_dist) throws InterruptedException - { - if (target == npc) - { - debugServerConsoleMsg( npc, npc + " was told to follow itself"); - return; - } - - if (getPosture( npc ) != POSTURE_UPRIGHT) - { - posture.stand(npc); - } - - setObjVar(npc, "ai.persistantFollowing.target", target); - - if (min_dist < 1f) - { - min_dist = 1f; - } - - if (max_dist < 1f) - { - max_dist = 1f; - } - - if (max_dist <= min_dist) - { - max_dist = min_dist + 1f; - } - - setObjVar(npc, "ai.persistantFollowing.min_dist", min_dist); - setObjVar(npc, "ai.persistantFollowing.max_dist", max_dist); - - follow(npc, target, min_dist, max_dist); - } - - - public static boolean isFollowing(obj_id npc) throws InterruptedException - { - if (!isIdValid(npc)) - { - return false; - } - - return hasObjVar(npc, "ai.persistantFollowing"); - } - - - public static obj_id getFollowTarget(obj_id npc) throws InterruptedException - { - if (!isIdValid(npc)) - { - return null; - } - - return getObjIdObjVar(npc, "ai.persistantFollowing.target"); - } - - - public static void resumeFollow(obj_id npc) throws InterruptedException - { - if (!isIdValid(npc)) - { - return; - } - - obj_id target = getObjIdObjVar(npc, "ai.persistantFollowing.target"); - - if (isIdValid(target)) - { - float min_dist = DEFAULT_FOLLOW_MIN; - - if (hasObjVar(npc, "ai.persistantFollowing.min_dist")) - { - min_dist = getFloatObjVar(npc, "ai.persistantFollowing.min_dist"); - } - - float max_dist = DEFAULT_FOLLOW_MAX; - - if (hasObjVar(npc, "ai.persistantFollowing.max_dist")) - { - max_dist = getFloatObjVar(npc, "ai.persistantFollowing.max_dist"); - } - - aiFollow(npc, target, min_dist, max_dist); - - return; - } - - aiStopFollowing(npc); - } - - - public static void aiStopFollowing(obj_id npc) throws InterruptedException - { - stop(npc); - removeObjVar(npc, "ai.persistantFollowing"); - - if (getBehavior(npc) <= BEHAVIOR_CALM) - { - messageTo(npc, "resumeDefaultCalmBehavior", null, 5, false); - } - } - - - public static String getMood(obj_id npc) throws InterruptedException - { - if (!hasObjVar( npc, "ai.mood" )) - { - return ai_lib.MOOD_CALM; - } - else - { - return getStringObjVar( npc, "ai.mood" ); - } - } - - - public static void pathNear(obj_id npc, location dest, float range) throws InterruptedException - { - location startLoc = getLocation( npc ); - if (dest.x < startLoc.x) - { - dest.x += range; - } - else - { - dest.x -= range; - } - if (dest.z < startLoc.z) - { - dest.z += range; - } - else - { - dest.z -= range; - } - pathTo( npc, dest ); - - } - - - public static void followInFormation(obj_id npc, obj_id leader, int formationType, int position) throws InterruptedException - { - - if (npc == leader) - { - debugServerConsoleMsg( npc, npc + " was told to followInFormation itself"); - return; - } - - setObjVar( npc, "ai.inFormation", leader ); - setObjVar( npc, "ai.formationType", formationType ); - setObjVar( npc, "ai.formationPosition", position ); - if (!isInCombat( npc )) - { - stop( npc ); - resumeFormationFollowing( npc ); - } - } - - - public static void resumeFormationFollowing(obj_id npc) throws InterruptedException - { - - if (isInCombat( npc )) - { - return; - } - - obj_id leader = getObjIdObjVar( npc, "ai.inFormation"); - if (!exists( leader ) || !isInWorld( leader ) || isAiDead( leader )) - { - removeObjVar( npc, "ai.inFormation"); - return; - } - - int formationType = getIntObjVar( npc, "ai.formationType"); - int position = getIntObjVar( npc, "ai.formationPosition"); - switch ( formationType ) - { - case FORMATION_WEDGE : - followInWedgeFormation( npc, leader, position ); - break; - case FORMATION_LINE : - followInLineFormation( npc, leader, position ); - break; - case FORMATION_BOX : - followInBoxFormation( npc, leader, position ); - break; - default: - followInColumnFormation( npc, leader, position ); - break; - } - } - - - public static void followInWedgeFormation(obj_id npc, obj_id leader, int position) throws InterruptedException - { - if (npc == leader) - { - debugServerConsoleMsg( npc, npc + " was told to followInWedgeFormation itself"); - return; - } - - position = Math.max(1, position); - - location offset = new location(); - final float spacing = getObjectCollisionRadius(leader) * 2.25f; - final float x = (spacing * (float)Math.ceil(position / 2.0f)); - offset.x = (position % 2 == 0) ? -x : x; - offset.z = -x; - - follow(npc, leader, offset); - } - - - public static void followInBoxFormation(obj_id npc, obj_id leader, int position) throws InterruptedException - { - - if (npc == leader) - { - debugServerConsoleMsg( npc, npc + " was told to followInLineFormation itself"); - return; - } - - location offset = new location(0,0,0,""); - - if (position < 3) - { - offset.x += ( position * 3 ); - } - else if (position == 4) - { - offset.x = 6; - } - else if (position != 3) - { - offset.x += ((position-5)*3); - } - - if (position == 3 || position == 4) - { - offset.z += 3; - } - else if (position > 4) - { - offset.z += 6; - } - - if (position < 1 || position > 7) - { - follow( npc, leader, rand(15,20), rand(10,18)); - } - else - { - follow( npc, leader, offset ); - } - - } - - - public static void followInLineFormation(obj_id npc, obj_id leader, int position) throws InterruptedException - { - if (npc == leader) - { - debugServerConsoleMsg( npc, npc + " was told to followInLineFormation itself"); - return; - } - - position = Math.max(1, position); - - location offset = new location(); - final float spacing = getObjectCollisionRadius(leader) * 2.25f; - final float x = (spacing * (float)Math.ceil(position / 2.0f)); - offset.x = (position % 2 == 0) ? -x : x; - - follow(npc, leader, offset); - } - - - public static void followInColumnFormation(obj_id npc, obj_id leader, int position) throws InterruptedException - { - - if (npc == leader) - { - debugServerConsoleMsg( npc, npc + " was told to followInColumnFormation itself"); - return; - } - - position = Math.max(1, position); - - location offset = new location(); - final float spacing = getObjectCollisionRadius(leader) * 2.25f; - offset.x = (position % 2 == 0) ? 0.0f : spacing; - offset.z = -(spacing * (float)Math.ceil((position - 1) / 2.0f)); - - follow(npc, leader, offset); - } - - - public static void pathAwayFrom(obj_id npc, obj_id target) throws InterruptedException - { - - if (!isIdValid( npc ) || !isIdValid( target )) - { - return; - } - if (npc == target) - { - return; - } - - if (hasObjVar( npc, "ai.pathingAwayFrom")) - { - obj_id oldTarget = getObjIdObjVar( npc, "ai.pathingAwayFrom"); - if (oldTarget == target) - { - return; - } - - if (getDistance( npc, target ) > getDistance( npc, oldTarget )) - { - return; - } - } - - location myLoc = new location( getLocation( npc ) ); - location targetLoc = new location( getLocation( target ) ); - if (myLoc.x < targetLoc.x) - { - myLoc.x -= rand( 20f, 40f ); - } - else - { - myLoc.x += rand( 20f, 40f ); - } - - if (myLoc.z < targetLoc.z) - { - myLoc.z -= rand( 20f, 40f ); - } - else - { - myLoc.z += rand( 20f, 40f ); - } - - setObjVar( npc, "ai.pathingAwayFrom", target ); - pathTo( npc, myLoc ); - messageTo( npc, "handleClearPathingFlag", null, 30f, isObjectPersisted( npc ) ); - } - - - public static void setLoiterRanges(obj_id npc, float minRange, float maxRange) throws InterruptedException - { - setObjVar( npc, "ai.loiterMinRange", minRange ); - setObjVar( npc, "ai.loiterMaxRange", maxRange ); - } - - - public static int aiGetSpecies(obj_id npc) throws InterruptedException - { - return getSpecies( npc ); - } - - - public static void setCustomIdleAnimation(obj_id npc, String animationString) throws InterruptedException - { - setDefaultCalmMood( npc, animationString ); - } - - - public static void setDefaultCalmMood(obj_id npc, String mood) throws InterruptedException - { - - setObjVar( npc, "ai.defaultCalmMood", mood ); - - if (getBehavior(npc) <= BEHAVIOR_CALM) - { - - setMood( npc, MOOD_CALM ); - } - } - - - public static int getDefaultCalmBehavior(obj_id ai) throws InterruptedException - { - int behavior = BEHAVIOR_LOITER; - if (hasObjVar(ai, "ai.defaultCalmBehavior")) - { - behavior = getIntObjVar(ai, "ai.defaultCalmBehavior"); - } - - return behavior; - } - - - public static void aiPathTo(obj_id npc, location pathLoc) throws InterruptedException - { - if ((pathLoc.x == 0.0f) && (pathLoc.z == 0.0f)) - { - - return; - } - - setObjVar( npc, "ai.persistentPathing", pathLoc ); - stop( npc ); - pathTo( npc, pathLoc ); - } - - - public static int aiGetNiche(obj_id npc) throws InterruptedException - { - if (isPlayer( npc )) - { - return NICHE_PC; - } - - String creatureName = getCreatureName( npc ); - if (creatureName != null) - { - return ( dataTableGetInt( CREATURE_TABLE, creatureName, "niche" ) ); - } - else - { - return NICHE_NONE; - } - } - - - public static int aiGetNiche(String creatureName) throws InterruptedException - { - if (creatureName == null || creatureName.equals("")) - { - return NICHE_NONE; - } - - return dataTableGetInt( CREATURE_TABLE, creatureName, "niche" ); - } - - - public static String getSocialGroup(obj_id npc) throws InterruptedException - { - String creatureName = getCreatureName(npc); - - if (creatureName != null || !beast_lib.isBeast(npc)) - { - String socialGroup = dataTableGetString( CREATURE_TABLE, creatureName, "socialGroup"); - return socialGroup; - } - - return null; - } - - - public static boolean isSameSocialGroup(obj_id npc, obj_id target) throws InterruptedException - { - boolean result = false; - - if (!pet_lib.isPet(npc) && !pet_lib.isPet(target) && !beast_lib.isBeast(npc) && !beast_lib.isBeast(target)) - { - final String npcCreatureName = getCreatureName(npc); - final String targetCreatureName = getCreatureName(target); - - if (npcCreatureName != null && targetCreatureName != null) - { - String mySocialGroup = getSocialGroup(npc); - String yourSocialGroup = getSocialGroup(target); - - if (( (mySocialGroup != null) && (yourSocialGroup != null) && mySocialGroup.equals(yourSocialGroup))) - { - result = true; - } - } - else if ((factions.getFaction(npc) != null) && (factions.getFaction(target) != null)) - { - String mySocialGroup = factions.getFaction(npc); - String yourSocialGroup = factions.getFaction(target); - - if (( (mySocialGroup != null) && (yourSocialGroup != null) && mySocialGroup.equals(yourSocialGroup))) - { - result = true; - } - } - } - - return result; - } - - - public static boolean isHerdingCreature(obj_id npc) throws InterruptedException - { - - if (isNpc( npc ) || isPlayer( npc ) || isAndroid(npc)) - { - return false; - } - - String creatureName = getCreatureName( npc ); - if (creatureName != null) - { - boolean isHerding = (dataTableGetInt( CREATURE_TABLE, creatureName, "herd")==1); - return isHerding; - } - return false; - } - - - public static boolean isStalkingCreature(obj_id ai) throws InterruptedException - { - - if (isPlayer(ai) || (aiGetNiche(ai) == NICHE_NPC) || isAndroid(ai)) - { - return false; - } - if (hasScript(ai, "ai.pet_advance")) - { - return false; - } - - return aiIsStalker(ai); - } - - - public static boolean isAggroToward(obj_id npc, obj_id threat) throws InterruptedException - { - if (hasScript( npc, "ai.pet_advance" )) - { - return false; - } - - if (pvpIsEnemy( npc, threat )) - { - - return true; - } - - if (ai_lib.isSameSocialGroup( npc, threat )) - { - return false; - } - - int reaction = factions.getFactionReaction( npc, threat ); - - if (reaction == factions.REACTION_NEGATIVE) - { - - return true; - } - - if (!ai_lib.isMonster( npc )) - { - if (ai_lib.isAggro( npc )) - { - - if (reaction <= factions.REACTION_NEUTRAL) - { - - return true; - } - } - return false; - } - - if (isPlayer( threat ) && ai_lib.isAggro( npc )) - { - - return true; - } - - int npcNiche = ai_lib.aiGetNiche( npc ); - int threatNiche = ai_lib.aiGetNiche( threat ); - - if (npcNiche == NICHE_CARNIVORE) - { - if (threatNiche == NICHE_HERBIVORE) - { - return true; - } - } - - return false; - } - - - public static boolean isAggro(obj_id ai) throws InterruptedException - { - if (isPlayer(ai)) - { - return false; - } - if (hasScript( ai, "ai.pet_advance" )) - { - return false; - } - - if (hasScript( ai, "systems.missions.dynamic.mission_bounty_target")) - { - return false; - } - - return aiIsAggressive(ai); - } - - - public static boolean isHealingNpc(obj_id npc) throws InterruptedException - { - if (isPlayer( npc )) - { - return false; - } - - int niche = aiGetNiche( npc ); - if (niche != NICHE_NPC || niche != NICHE_ANDROID) - { - return false; - } - - String creatureName = getCreatureName( npc ); - if (creatureName != null) - { - boolean isHealer = (dataTableGetInt( CREATURE_TABLE, creatureName, "healer")!=0); - return isHealer; - } - return false; - } - - - public static boolean incapacitateMob(obj_id target) throws InterruptedException - { - if (target == null || !isMob(target)) - { - return false; - } - - boolean result = true; - - result &= setHealth(target, -50); - result &= setAction(target, -50); - result &= setMind(target, -50); - - return result; - } - - - public static boolean isHumanSkeleton(obj_id npc) throws InterruptedException - { - if (isPlayer(npc)) - { - return true; - } - - int speciesNum = ai_lib.aiGetSpecies( npc ); - if (speciesNum == -1) - { - return false; - } - - String skeleton = dataTableGetString("datatables/ai/species.iff", speciesNum, "Skeleton"); - if (skeleton.equals("human")) - { - return true; - } - return false; - } - - - public static String getSkeleton(int speciesNum) throws InterruptedException - { - if (speciesNum == -1) - { - return null; - } - - String skeleton = dataTableGetString("datatables/ai/species.iff", speciesNum, "Skeleton"); - - return skeleton; - } - - - public static String getSkeleton(obj_id npc) throws InterruptedException - { - int speciesNum = ai_lib.aiGetSpecies( npc ); - LOG("mount", "speciesnum is "+speciesNum); - if (speciesNum == -1) - { - return null; - } - String skeleton = dataTableGetString("datatables/ai/species.iff", speciesNum, "Skeleton"); - LOG("mount", "skeleton is "+skeleton); - return skeleton; - } - - - public static void doThreatenAnimation(obj_id npc) throws InterruptedException - { - if (ai_lib.aiGetNiche( npc )!=NICHE_NPC || !isAndroid(npc)) - { - doAction( npc, ACTION_THREATEN ); - return; - } - String anim = ai_lib.ACTION_THREATEN; - switch ( rand(0,13)) - { - case 0 : - anim = ai_lib.ACTION_THREATEN; - break; - case 1 : - anim = "alert"; - break; - case 2 : - anim = "angry"; - break; - case 3 : - anim = "gesticulate_wildly"; - break; - case 4 : - anim = "greet"; - break; - case 5 : - anim = "look_casual"; - break; - case 6 : - anim = "look_left"; - break; - case 7 : - anim = "look_right"; - break; - case 8 : - anim = "point_accusingly"; - break; - case 9 : - anim = "pound_fist_chest"; - break; - case 10 : - anim = "pound_fist_palm"; - break; - case 11 : - anim = "taunt1"; - break; - case 12 : - anim = "taunt2"; - break; - case 13 : - anim = "taunt3"; - break; - } - ai_lib.doAction( npc, anim ); - } - - - public static void doVictoryDance(obj_id npc) throws InterruptedException - { - if (ai_lib.isMonster( npc )) - { - if (rand(1,500)==1) - { - if (rand(1,2)==1) - { - doAnimationAction( npc, "trick_1"); - } - else - { - doAnimationAction( npc, "trick_2"); - } - } - else - { - doAction( npc, "vocalize"); - } - return; - } - - String anim = "celebrate"; - switch ( rand(0,23)) - { - case 0 : - anim = "celebrate"; - break; - case 1 : - anim = "applause_excited"; - break; - case 2 : - anim = "belly_laugh"; - break; - case 3 : - anim = "celebrate1"; - break; - case 4 : - anim = "coup_de_grace"; - break; - case 5 : - anim = "dismiss"; - break; - case 6 : - anim = "flex_biceps"; - break; - case 7 : - anim = "laugh_pointing"; - break; - case 8 : - anim = "point_accusingly"; - break; - case 9 : - anim = "pound_fist_chest"; - break; - case 10 : - anim = "pound_fist_palm"; - break; - case 11 : - anim = "salute1"; - break; - case 12 : - anim = "salute2"; - break; - case 13 : - anim = "shrug_hands"; - break; - case 14 : - anim = "shrug_shoulders"; - break; - case 15 : - anim = "smack_self"; - break; - case 16 : - anim = "shake_head_disgust"; - break; - case 17 : - anim = "snap_finger1"; - break; - case 18 : - anim = "snap_finger2"; - break; - case 19 : - anim = "tap_head"; - break; - case 20 : - anim = "taunt1"; - break; - case 21 : - anim = "taunt2"; - break; - case 22 : - anim = "taunt3"; - break; - case 23 : - anim = "yawn"; - break; - case 24 : - anim = "check_wrist_device"; - break; - - } - doAction( npc, anim ); - } - - - public static obj_id getLair(obj_id npc) throws InterruptedException - { - if (isPlayer(npc)) - { - return null; - } - - if (utils.hasScriptVar(npc, "ai.hasLair" )) - { - return utils.getObjIdScriptVar(npc, "ai.hasLair" ); - } - - obj_id myPOI = getObjIdObjVar( npc, "poi.baseObject"); - if (myPOI == null) - { - utils.setScriptVar( npc, "ai.noLiar", true ); - return null; - } - String buildingType = getStringObjVar( myPOI, "spawning.buildingType"); - if ((buildingType == null || buildingType.equals( "none" )) && !hasObjVar( myPOI, "spawning.target" )) - { - utils.setScriptVar( npc, "ai.noLair", true ); - return null; - } - - utils.setScriptVar( npc, "ai.hasLair", myPOI ); - return myPOI; - } - - - public static int aiGetApproachTriggerRange(obj_id npc) throws InterruptedException - { - return (int)aiGetAggroRadius(npc); - } - - - public static void aiSetPosture(obj_id npc, int newPosture) throws InterruptedException - { - if (( getState( npc, STATE_COMBAT ) != 1 )) - { - setPostureClientImmediate(npc, newPosture); - } - else - { - attacker_results cbtAnimationResults = new attacker_results(); - cbtAnimationResults.endPosture = newPosture; - cbtAnimationResults.id = npc; - doCombatResults("change_posture", cbtAnimationResults, null); - } - } - - - public static boolean canSit(obj_id npc) throws InterruptedException - { - int speciesNum = ai_lib.aiGetSpecies( npc ); - if (speciesNum == -1) - { - return false; - } - boolean hasSitAnims = ( dataTableGetInt("datatables/ai/species.iff", speciesNum, "CanSit") == 1 ); - return hasSitAnims; - } - - - public static boolean canLieDown(obj_id npc) throws InterruptedException - { - int speciesNum = ai_lib.aiGetSpecies( npc ); - if (speciesNum == -1) - { - return false; - } - - boolean hasLayAnims = ( dataTableGetInt("datatables/ai/species.iff", speciesNum, "CanLieDown") == 1 ); - return hasLayAnims; - } - - - public static boolean isInSameBuilding(obj_id npc, obj_id target) throws InterruptedException - { - if (!isIdValid(npc)) - { - return false; - } - - if (!isIdValid(target)) - { - return false; - } - - obj_id npcCell = getLocation( npc ).cell; - obj_id targetCell = getLocation( target ).cell; - if (isIdValid( npcCell ) == false && isIdValid( targetCell ) == false) - { - return true; - } - else if (isIdValid( npcCell ) == false || isIdValid( targetCell ) == false) - { - return false; - } - - obj_id npcBldg = getTopMostContainer( npc ); - obj_id targetBldg = getTopMostContainer( target ); - if (npcBldg == targetBldg) - { - return (canSee( npc, target )); - } - else - { - return false; - } - } - - - public static String getAttackString(int hash) throws InterruptedException - { - String outstring = "@combat_effects:"; - - if (hash == 0) - { - return "@combat_effects:none"; - } - - int[] attacks = dataTableGetIntColumn( "datatables/ai/special_attack.iff", "ATTACK_HASH"); - String[] attackstrings = dataTableGetStringColumn( "datatables/ai/special_attack.iff", "ATTACK_STRING"); - for (int i=0; i evadeScan) - { - - sendSystemMessage(player, SMUGGLER_SCAN_FAIL); - return false; - } - } - - sendSystemMessage(player, SMUGGLER_SCAN_SUCCESS); - - return true; - - } - - - public static boolean checkForJedi(obj_id player) throws InterruptedException - { - if (!isJedi(player) || isJediState( player, JEDI_STATE_FORCE_SENSITIVE )) - { - return false; - } - - int mindTrick = 0; - - if (isJediState( player, JEDI_STATE_JEDI )) - { - mindTrick += 40; - } - if (isJediState( player, JEDI_STATE_FORCE_RANKED_LIGHT ) || isJediState( player, JEDI_STATE_FORCE_RANKED_DARK )) - { - mindTrick += 20; - } - - int roll = rand( 1, 100 ); - if (roll > mindTrick) - { - return false; - } - - return true; - } - - - public static boolean setupNpc(obj_id npc, boolean conversable, boolean invulnerable) throws InterruptedException - { - return setupNpc(npc, null, conversable, invulnerable); - } - - - public static boolean setupNpc(obj_id npc, String name, boolean conversable, boolean invulnerable) throws InterruptedException - { - if (name != null && !name.equals("")) - { - setName(npc, name); - } - - if (conversable) - { - setCondition(npc, CONDITION_CONVERSABLE); - } - - setInvulnerable (npc, invulnerable); - - return true; - } - - - public static void establishAgroLink(obj_id subject, float range) throws InterruptedException - { - String socialGroup = getSocialGroup(subject); - obj_id[] creatures = getCreaturesInRange(subject, range); - if (creatures == null || creatures.length == 0) - { - return; - } - - Vector linkedCreatures = new Vector(); - linkedCreatures.setSize(0); - - for (int i=0; i= 100) - { - showFlyTextPrivate(target, player, new string_id("cbt_spam", "immune"), 1.5f, colors.WHITE); - return false; - } - - if (rand(1, 100) > mt_resist) - { - playClientEffectObj(target, "appearance/pt_mind_trick.prt", target, "root"); - - return true; - } - else - { - showFlyTextPrivate(target, player, new string_id("cbt_spam", "resist"), 1.5f, colors.WHITE); - return false; - } - } - - return false; - } - - - public static boolean isTauntable(obj_id creature) throws InterruptedException - { - return !utils.hasScriptVar(creature, "combat.immune.taunt"); - } - - - public static void establishSharedHealth(Vector allies) throws InterruptedException - { - for (int i=0; i 0)) - { - if ((slotInfo[COLLECTION_INFO_INDEX_PAGE] != null) && (slotInfo[COLLECTION_INFO_INDEX_PAGE].equals("bdg_accumulation"))) - { - isAccumulationBadge = true; - } - } - - if (!isAccumulationBadge) - { - checkBadgeCount(player); - } - - return true; - } - - - public static boolean[] grantBadge(obj_id[] players, String badge) throws InterruptedException - { - if (players == null || players.length == 0) - { - boolean[] emptyReturnList = new boolean[1]; - emptyReturnList[0] = false; - return emptyReturnList; - } - - boolean[] returnList = new boolean[players.length]; - - for (int i=0; i 0)) - { - if ((slotInfo[COLLECTION_INFO_INDEX_PAGE] != null) && (slotInfo[COLLECTION_INFO_INDEX_PAGE].equals("bdg_accumulation"))) - { - isAccumulationBadge = true; - } - } - - if (!isAccumulationBadge) - { - checkBadgeCount(player); - } - - return true; - } - - - public static boolean hasBadge(obj_id player, String badge) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if ((badge == null) || (badge.equals(""))) - { - return false; - } - - String[] info = getCollectionSlotInfo(badge); - if ((info == null) || (info.length != COLLECTION_INFO_ARRAY_SIZE) || (info[COLLECTION_INFO_INDEX_BOOK] == null) || (!info[COLLECTION_INFO_INDEX_BOOK].equals(BADGE_BOOK))) - { - return false; - } - - return hasCompletedCollectionSlot(player, badge); - } - - - public static boolean notifyHasBadge(obj_id player, String badge) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if ((badge == null) || (badge.equals(""))) - { - return false; - } - - String[] info = getCollectionSlotInfo(badge); - if ((info == null) || (info.length != COLLECTION_INFO_ARRAY_SIZE) || (info[COLLECTION_INFO_INDEX_BOOK] == null) || (!info[COLLECTION_INFO_INDEX_BOOK].equals(BADGE_BOOK))) - { - return false; - } - - if (hasCompletedCollectionSlot(player, badge)) - { - prose_package pp = new prose_package(); - pp.stringId = SID_PROSE_HASBADGE; - pp.other.set(new string_id(STF_COLLECTION_N, badge)); - sendSystemMessageProse(player, pp); - return true; - } - - return false; - } - - - public static boolean checkBadgeCount(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - String[] badges = getCompletedCollectionSlotsInBook(player, BADGE_BOOK); - if (badges != null) - { - if (badges.length >= 500) - { - grantBadge(player, "count_500"); - } - else - { - revokeBadge(player, "count_500", true); - } - - if (badges.length >= 475) - { - grantBadge(player, "count_475"); - } - else - { - revokeBadge(player, "count_475", true); - } - - if (badges.length >= 450) - { - grantBadge(player, "count_450"); - } - else - { - revokeBadge(player, "count_450", true); - } - - if (badges.length >= 425) - { - grantBadge(player, "count_425"); - } - else - { - revokeBadge(player, "count_425", true); - } - - if (badges.length >= 400) - { - grantBadge(player, "count_400"); - } - else - { - revokeBadge(player, "count_400", true); - } - - if (badges.length >= 375) - { - grantBadge(player, "count_375"); - } - else - { - revokeBadge(player, "count_375", true); - } - - if (badges.length >= 350) - { - grantBadge(player, "count_350"); - } - else - { - revokeBadge(player, "count_350", true); - } - - if (badges.length >= 325) - { - grantBadge(player, "count_325"); - } - else - { - revokeBadge(player, "count_325", true); - } - - if (badges.length >= 300) - { - grantBadge(player, "count_300"); - } - else - { - revokeBadge(player, "count_300", true); - } - - if (badges.length >= 275) - { - grantBadge(player, "count_275"); - } - else - { - revokeBadge(player, "count_275", true); - } - - if (badges.length >= 250) - { - grantBadge(player, "count_250"); - } - else - { - revokeBadge(player, "count_250", true); - } - - if (badges.length >= 225) - { - grantBadge(player, "count_225"); - } - else - { - revokeBadge(player, "count_225", true); - } - - if (badges.length >= 200) - { - grantBadge(player, "count_200"); - } - else - { - revokeBadge(player, "count_200", true); - } - - if (badges.length >= 175) - { - grantBadge(player, "count_175"); - } - else - { - revokeBadge(player, "count_175", true); - } - - if (badges.length >= 150) - { - grantBadge(player, "count_150"); - } - else - { - revokeBadge(player, "count_150", true); - } - - if (badges.length >= 125) - { - grantBadge(player, "count_125"); - } - else - { - revokeBadge(player, "count_125", true); - } - - if (badges.length >= 100) - { - grantBadge(player, "count_100"); - } - else - { - revokeBadge(player, "count_100", true); - } - - if (badges.length >= 75) - { - grantBadge(player, "count_75"); - } - else - { - revokeBadge(player, "count_75", true); - } - - if (badges.length >= 50) - { - grantBadge(player, "count_50"); - } - else - { - revokeBadge(player, "count_50", true); - } - - if (badges.length >= 25) - { - grantBadge(player, "count_25"); - } - else - { - revokeBadge(player, "count_25", true); - } - - if (badges.length >= 10) - { - grantBadge(player, "count_10"); - } - else - { - revokeBadge(player, "count_10", true); - } - - if (badges.length >= 5) - { - grantBadge(player, "count_5"); - } - else - { - revokeBadge(player, "count_5", true); - } - } - - return true; - } - - - public static void grantMasterSkillBadge(obj_id player, String skill) throws InterruptedException - { - if (!isIdValid( player ) || !isPlayer( player )) - { - return; - } - - if (hasObjVar( player, respec.OBJVAR_RESPEC_ROOT)) - { - return; - } - - if (!skill.endsWith("_master")) - { - return; - } - - String badgeId = ""; - if (skill.equals("class_forcesensitive_phase4_master")) - { - badgeId = "new_prof_jedi_master"; - } - else if (skill.equals("class_smuggler_phase4_master")) - { - badgeId = "new_prof_smuggler_master"; - } - else if (skill.equals("class_bountyhunter_phase4_master")) - { - badgeId = "new_prof_bountyhunter_master"; - } - else if (skill.equals("class_commando_phase4_master")) - { - badgeId = "new_prof_commando_master"; - } - else if (skill.equals("class_officer_phase4_master")) - { - badgeId = "new_prof_officer_master"; - } - else if (skill.equals("class_medic_phase4_master")) - { - badgeId = "new_prof_medic_master"; - } - else if (skill.equals("class_spy_phase4_master")) - { - badgeId = "new_prof_spy_master"; - } - else if (skill.equals("class_entertainer_phase4_master")) - { - badgeId = "new_prof_entertainer_master"; - } - else if (skill.equals("class_trader_phase4_master")) - { - badgeId = "new_prof_trader_master"; - } - else if (skill.equals("combat_1hsword_master")) - { - badgeId = "combat_1hsword_master"; - } - else if (skill.equals("combat_2hsword_master")) - { - badgeId = "combat_2hsword_master"; - } - else if (skill.equals("combat_bountyhunter_master")) - { - badgeId = "combat_bountyhunter_master"; - } - else if (skill.equals("combat_brawler_master")) - { - badgeId = "combat_brawler_master"; - } - else if (skill.equals("combat_carbine_master")) - { - badgeId = "combat_carbine_master"; - } - else if (skill.equals("combat_commando_master")) - { - badgeId = "combat_commando_master"; - } - else if (skill.equals("combat_marksman_master")) - { - badgeId = "combat_marksman_master"; - } - else if (skill.equals("combat_pistol_master")) - { - badgeId = "combat_pistol_master"; - } - else if (skill.equals("combat_polearm_master")) - { - badgeId = "combat_polearm_master"; - } - else if (skill.equals("combat_rifleman_master")) - { - badgeId = "combat_rifleman_master"; - } - else if (skill.equals("combat_smuggler_master")) - { - badgeId = "combat_smuggler_master"; - } - else if (skill.equals("combat_unarmed_master")) - { - badgeId = "combat_unarmed_master"; - } - - else if (skill.equals("class_structures_phase4_master")) - { - badgeId = "new_prof_crafting_architect_master"; - - if (!hasBadge(player, badgeId)) - { - grantBadge( player, badgeId ); - } - - badgeId = "new_prof_crafting_merchant_master"; - - if (!hasBadge(player, badgeId)) - { - grantBadge( player, badgeId ); - } - - badgeId = "new_prof_crafting_shipwright"; - } - - else if (skill.equals("class_munitions_phase4_master")) - { - badgeId = "new_prof_crafting_armorsmith_master"; - - if (!hasBadge(player, badgeId)) - { - grantBadge( player, badgeId ); - } - - badgeId = "new_prof_crafting_merchant_master"; - - if (!hasBadge(player, badgeId)) - { - grantBadge( player, badgeId ); - } - - badgeId = "new_prof_crafting_weaponsmith_master"; - } - - else if (skill.equals("class_domestics_phase4_master")) - { - badgeId = "new_prof_crafting_chef_master"; - - if (!hasBadge(player, badgeId)) - { - grantBadge( player, badgeId ); - } - - badgeId = "new_prof_crafting_merchant_master"; - - if (!hasBadge(player, badgeId)) - { - grantBadge( player, badgeId ); - } - - badgeId = "new_prof_crafting_tailor_master"; - } - - else if (skill.equals("class_engineering_phase4_master")) - { - badgeId = "new_prof_crafting_droidengineer_master"; - - if (!hasBadge(player, badgeId)) - { - grantBadge( player, badgeId ); - } - - badgeId = "new_prof_crafting_merchant_master"; - } - - else if (skill.equals("class_engineering_phase1_master")) - { - badgeId = "new_prof_crafting_artisan_master"; - } - else if (skill.equals("outdoors_bio_engineer_master")) - { - badgeId = "new_prof_outdoors_bio_engineer_master"; - } - else if (skill.equals("outdoors_creaturehandler_master")) - { - badgeId = "outdoors_creaturehandler_master"; - } - else if (skill.equals("outdoors_ranger_master")) - { - badgeId = "outdoors_ranger_master"; - } - else if (skill.equals("outdoors_scout_master")) - { - badgeId = "outdoors_scout_master"; - } - else if (skill.equals("outdoors_squadleader_master")) - { - badgeId = "outdoors_squadleader_master"; - } - else if (skill.equals("science_combatmedic_master")) - { - badgeId = "science_combatmedic_master"; - } - else if (skill.equals("science_doctor_master")) - { - badgeId = "science_doctor_master"; - } - else if (skill.equals("science_medic_master")) - { - badgeId = "science_medic_master"; - } - else if (skill.equals("social_dancer_master")) - { - badgeId = "new_prof_social_dancer_master"; - } - else if (skill.equals("social_entertainer_master")) - { - badgeId = "new_prof_social_entertainer_master"; - } - else if (skill.equals("social_imagedesigner_master")) - { - badgeId = "new_prof_social_imagedesigner_master"; - } - else if (skill.equals("social_musician_master")) - { - badgeId = "new_prof_social_musician_master"; - } - - else if (skill.equals("pilot_neutral_master")) - { - if (space_flags.isSpaceTrack(player, space_flags.PRIVATEER_TATOOINE)) - { - badgeId = "pilot_neutral_tatooine"; - } - else if (space_flags.isSpaceTrack(player, space_flags.PRIVATEER_NABOO)) - { - badgeId = "pilot_neutral_naboo"; - } - else if (space_flags.isSpaceTrack(player, space_flags.PRIVATEER_CORELLIA)) - { - badgeId = "pilot_neutral_corellia"; - } - } - else if (skill.equals("pilot_rebel_navy_master")) - { - if (space_flags.isSpaceTrack(player, space_flags.REBEL_NABOO)) - { - badgeId = "pilot_rebel_navy_naboo"; - } - else if (space_flags.isSpaceTrack(player, space_flags.REBEL_TATOOINE)) - { - badgeId = "pilot_rebel_navy_tatooine"; - } - else if (space_flags.isSpaceTrack(player, space_flags.REBEL_CORELLIA)) - { - badgeId = "pilot_rebel_navy_corellia"; - } - } - else if (skill.equals("pilot_imperial_navy_master")) - { - if (space_flags.isSpaceTrack(player, space_flags.IMPERIAL_NABOO)) - { - badgeId = "pilot_imperial_navy_naboo"; - } - else if (space_flags.isSpaceTrack(player, space_flags.IMPERIAL_TATOOINE)) - { - badgeId = "pilot_imperial_navy_tatooine"; - } - else if (space_flags.isSpaceTrack(player, space_flags.IMPERIAL_CORELLIA)) - { - badgeId = "pilot_imperial_navy_corellia"; - } - } - else - { - return; - } - - if (!hasBadge(player, badgeId)) - { - grantBadge( player, badgeId ); - } - - } - - - public static void grantThemeParkBadges(obj_id player) throws InterruptedException - { - - if (getIntObjVar(player, "theme_park_imperial") >= 39) - { - - if (!hasBadge(player, "bdg_thm_park_imperial_badge")) - { - - grantBadge(player, "bdg_thm_park_imperial_badge"); - } - } - - if (getIntObjVar(player, "theme_park_rebel") >= 49) - { - - if (!hasBadge(player, "bdg_thm_park_rebel_badge")) - { - - grantBadge(player, "bdg_thm_park_rebel_badge"); - } - } - - if (getIntObjVar(player, "theme_park_jabba") >= 28) - { - - if (!hasBadge(player, "bdg_thm_park_jabba_badge")) - { - - grantBadge(player, "bdg_thm_park_jabba_badge"); - } - } - - return; - } - - - public static void checkForCombatTargetBadge(obj_id player, String creatureType) throws InterruptedException - { - String datatable = "datatables/badge/combat_target_badges.iff"; - int row = dataTableSearchColumnForString(creatureType, "creatureName", datatable); - - if (row > -1) - { - int badgeNumber = dataTableGetInt(datatable, row, "badgeNumber"); - String badgeName = getCollectionSlotName(badgeNumber); - - if ((badgeName != null) && (badgeName.length() > 0) && !hasBadge(player, badgeName)) - { - grantBadge(player, badgeName); - } - } - - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/beast_lib.java b/sku.0/sys.server/compiled/game/script/library/beast_lib.java deleted file mode 100644 index 9a965b47b..000000000 --- a/sku.0/sys.server/compiled/game/script/library/beast_lib.java +++ /dev/null @@ -1,6351 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.ai.ai_combat; -import java.util.Arrays; -import java.util.Vector; -import script.library.ai_lib; -import script.library.armor; -import script.library.buff; -import script.library.callable; -import script.library.colors; -import script.library.corpse; -import script.library.group; -import script.library.hue; -import script.library.incubator; -import script.library.instance; -import script.library.pet_lib; -import script.library.prose; -import script.library.storyteller; -import script.library.utils; -import script.library.xp; - - -public class beast_lib extends script.base_script -{ - public beast_lib() - { - } - public static final String BEASTS_TABLE = "datatables/beast/beasts.iff"; - public static final String BEASTS_STATS = "datatables/beast/beast_stats.iff"; - public static final String BEASTS_SPECIALS = "datatables/beast/beast_specials.iff"; - public static final String BEASTS_SPECIES_BONUS_TABLE = "datatables/beast/beast_class_attribute_grouping.iff"; - public static final String MOBILE_TEMPLATE_PREFIX = "object/mobile/beast_master/"; - public static final String INTANGIBLE_TEMPLATE_PREFIX = "object/intangible/beast/"; - public static final String BEAST_DISPLAY_TEMPLATE = "object/tangible/furniture/decorative/beast_stuffed.iff"; - - public static final String OBJVAR_BEAST_NAME = "beast.name"; - public static final String OBJVAR_BEAST_TYPE = "beast.type"; - public static final String OBJVAR_BEAST_ENGINEER = "beast.creator"; - public static final String OBJVAR_SKILL_AGGRESSION = "beast.aggression"; - public static final String OBJVAR_SKILL_BEASTIAL_RESILIENCE = "beast.beastialResilience"; - public static final String OBJVAR_SKILL_CUNNING = "beast.cunning"; - public static final String OBJVAR_SKILL_HUNTERS_INSTINCT = "beast.huntersInstinct"; - public static final String OBJVAR_SKILL_INTELLIGENCE = "beast.intelligence"; - public static final String OBJVAR_SKILL_SURVIVAL = "beast.survival"; - public static final String OBJVAR_INCREASE_ARMOR = "beast.armor_increase"; - public static final String OBJVAR_INCREASE_DPS = "beast.dps_increase"; - - public static final String OBJVAR_INCREASE_HIT_CHANCE = "beast.hit_chance_increase"; - public static final String OBJVAR_INCREASE_DODGE = "beast.dodge_increase"; - public static final String OBJVAR_INCREASE_HEALTH = "beast.health_increase"; - public static final String OBJVAR_INCREASE_PARRY = "beast.parry_increase"; - public static final String OBJVAR_INCREASE_GLANCING_BLOW = "beast.glancing_blow_increase"; - public static final String OBJVAR_INCREASE_BLOCK_CHANCE = "beast.block_chance_increase"; - public static final String OBJVAR_INCREASE_BLOCK_VALUE = "beast.block_value_increase"; - public static final String OBJVAR_INCREASE_CRITICAL_HIT = "beast.critical_hit_increase"; - public static final String OBJVAR_INCREASE_EVASION = "beast.evasion_increase"; - public static final String OBJVAR_INCREASE_EVASION_RATING = "beast.evasion_rating_increase"; - public static final String OBJVAR_INCREASE_STRIKETHROUGH = "beast.strikethrough_increase"; - public static final String OBJVAR_INCREASE_STRIKETHROUGH_RATING = "beast.strikethrough_rating_increase"; - - public static final String OBJVAR_BEAST_BCD_OWNER = "beast.bcdOwner"; - - public static final String OBJVAR_BEAST_APPEARANCE = "beast.appearance_template"; - public static final String OBJVAR_BEAST_PARENT = "beast.parent_creature_template"; - public static final String OBJVAR_BEAST_INCUBATION_BONUSES = "beast.incubation_bonuses"; - public static final String OBJVAR_OLD_PET_IDENTIFIER = "beast.converted_pet"; - public static final String OBJVAR_OLD_PET_RENAMED = "beast.old_pet_renamed"; - public static final String OBJVAR_OLD_PET_REHUED = "beast.old_pet_rehued"; - public static final String OBJVAR_BEAST_HUE = "beast.hue"; - public static final String OBJVAR_BEAST_HUE2 = "beast.hue2"; - public static final String OBJVAR_BEAST_HUE3 = "beast.hue3"; - public static final String OBJVAR_BEAST_PALETTE = "beast.palette"; - public static final String OBJVAR_BEAST_PALETTE2 = "beast.palette2"; - public static final String OBJVAR_BEAST_PALETTE3 = "beast.palette3"; - public static final String OBJVAR_BEAST_MOUNT_FLAG = "beast.isMount"; - public static final String OBJVAR_INJECTOR_MARK = "beast.injectorMark"; - - public static final String[] DISPLAY_NAMES = - { - "aggression_skill", - "beastial_resilience_skill", - "cunning_skill", - "hunters_instinct_skill", - "intelligence_skill", - "survival_skill", - "armor_bonus", - "dps_bonus", - "health_bonus", - "hit_chance_bonus", - "dodge_bonus", - "parry_bonus", - "glancing_blow_bonus", - "block_chance_bonus", - "block_value_bonus", - "critical_hit_bonus", - "evasion_bonus", - "evasion_rating_bonus", - "strikethrough_bonus", - "strikethrough_rating_bonus" - - }; - - public static final float[] DISPLAY_CONVERSION_RATES = - { - 1.0f, - 1.0f, - 1.0f, - 1.0f, - 1.0f, - 1.0f, - 0.1f, - 0.1f, - 0.2f, - 0.1f, - 1.0f, - 1.0f, - 0.1f, - 1.0f, - 1.0f, - 1.0f, - 1.0f, - 1.0f, - 1.0f, - 1.0f - }; - - public static final float[] DISPLAY_OBJVAR_CONVERSION_RATES = - { - 1.0f, - 1.0f, - 1.0f, - 1.0f, - 1.0f, - 1.0f, - 0.1f, - 0.1f, - 0.2f, - 0.1f, - 0.1f, - 0.1f, - 0.1f, - 0.1f, - 1.0f, - 0.1f, - 0.1f, - 1.0f, - 0.1f, - 1.0f - }; - - public static final String[] ARRAY_BEAST_INCUBATION_STATS = - { - OBJVAR_SKILL_AGGRESSION, - OBJVAR_SKILL_BEASTIAL_RESILIENCE, - OBJVAR_SKILL_CUNNING, - OBJVAR_SKILL_HUNTERS_INSTINCT, - OBJVAR_SKILL_INTELLIGENCE, - OBJVAR_SKILL_SURVIVAL, - OBJVAR_INCREASE_ARMOR, - OBJVAR_INCREASE_DPS, - OBJVAR_INCREASE_HEALTH, - OBJVAR_INCREASE_HIT_CHANCE, - OBJVAR_INCREASE_DODGE, - OBJVAR_INCREASE_PARRY, - OBJVAR_INCREASE_GLANCING_BLOW, - OBJVAR_INCREASE_BLOCK_CHANCE, - OBJVAR_INCREASE_BLOCK_VALUE, - OBJVAR_INCREASE_CRITICAL_HIT, - OBJVAR_INCREASE_EVASION, - OBJVAR_INCREASE_EVASION_RATING, - OBJVAR_INCREASE_STRIKETHROUGH, - OBJVAR_INCREASE_STRIKETHROUGH_RATING - }; - - public static final int MOD_HUNTERS_INSTINCT = 0; - public static final int MOD_AGGRESSION = 1; - public static final int MOD_INTELLIGENCE = 2; - public static final int MOD_CUNNING = 3; - public static final int MOD_RESILIENCE = 4; - public static final int MOD_SURVIVAL = 5; - - public static final float BEAST_WEAPON_SPEED = 1.5f; - public static final int BASE_ATTENTION_PENALTY = -25; - public static final int BEASTS_STORED_MAXIMUM = 10; - public static final int BEAST_LEVEL_MAX_DIFFERENCE = 10; - public static final int STEROID_BUFF_LEVEL_CAP = 74; - - public static final boolean BEAST_DEBUG = true; - - public static final string_id SID_BEAST_TOO_HIGH_LEVEL = new string_id("beast", "cant_call_level"); - public static final string_id SID_MAXIMUM_BEASTS = new string_id("beast", "cant_call_maximum"); - public static final string_id SID_STORED = new string_id("beast", "stored"); - public static final string_id SID_NOT_BEAST_MASTER = new string_id("beast", "not_beast_master"); - public static final string_id SID_NO_BEAST_OUT = new string_id("beast", "no_beast"); - public static final string_id SID_MAXIMUM_COMBAT_CONTROL_DEVICES = new string_id("beast", "maximum_combat_control_devices"); - public static final string_id SID_BEAST_CANT_WHEN_DEAD = new string_id("beast", "beast_cant_when_dead"); - public static final string_id SID_BEAST_LEVEL_TOO_HIGH = new string_id("beast", "beast_buff_level_too_high"); - public static final string_id SID_BEAST_LEVEL_TOO_LOW = new string_id("beast", "beast_buff_level_too_low"); - - public static final string_id SID_NO_TRICKS_WHILE_SWIMMING = new string_id("beast", "no_tricks_while_swimming"); - - public static final String PET_TRAINED_SKILLS_LIST = "abilities.trained_skills"; - public static final String PET_AUTO_REPEAT_LIST = "abilities.auto_repeat"; - public static final String PLAYER_KNOWN_SKILLS_LIST = "beast_master.known_skills"; - public static final String ATTENTION_PENALTY_DEBUFF = "bm_attention_penalty_"; - - public static final string_id SID_BEAST_WILD = new string_id("beast", "beast_wild"); - public static final int LOYALTY_LVL_TWO = 2001; - public static final string_id SID_BEAST_DISOBEDIENT = new string_id("beast", "beast_disobedient"); - public static final int LOYALTY_LVL_THREE = 10001; - public static final string_id SID_BEAST_TRAINED = new string_id("beast", "beast_trained"); - public static final int LOYALTY_LVL_FOUR = 50001; - public static final string_id SID_BEAST_LOYAL = new string_id("beast", "beast_loyal"); - public static final int LOYALTY_LVL_FIVE = 250001; - public static final string_id SID_BEAST_BFF = new string_id("beast", "beast_bff"); - public static final int LOYALTY_MAX = 500000; - public static final String BEAST_LOYALTY_TITLE = "beast_loyalty_title"; - - public static final String PET_LOYALTY_OBJVAR = "beastmood.beastLoyalty"; - public static final String PET_LOYALTY_LEVEL_OBJVAR = "beastmood.beastLoyaltyLevel"; - public static final float LOYALTY_DEATH_LOSS = 100; - public static final float LOYALTY_FOOD_LOSS = 50; - - public static final string_id SID_LOYALTY_LEVEL_GAIN = new string_id("beast", "loyalty_gained"); - public static final string_id SID_LOYALTY_LEVEL_LOSS = new string_id("beast", "loyalty_lost"); - - public static final String PET_HAPPINESS_SCRIPTVAR = "beastmood.beastHappiness"; - public static final String OBJVAR_BEAST_HAPPINESS = "beastmood.beastHappiness"; - public static final int PET_HAPPINESS_DEFAULT = 0; - public static final int PET_HAPPINESS_LOYALTY_BONUS = 5; - public static final int BEAST_HAPPINESS_MAX = 50; - public static final int BEAST_HAPPINESS_MIN = -25; - - public static final String PET_LOYALTY_BONUS_SCRIPTVAR = "beastmood.beastLoyaltyBonus"; - - public static final String BEAST_MOOD_TITLE = "beast_mood_title"; - public static final string_id SID_BEAST_FURIOUS = new string_id("beast", "beast_furious"); - public static final string_id SID_BEAST_ANGRY = new string_id("beast", "beast_angry"); - public static final string_id SID_BEAST_MISERABLE = new string_id("beast", "beast_miserable"); - public static final string_id SID_BEAST_UNHAPPY = new string_id("beast", "beast_unhappy"); - public static final string_id SID_BEAST_ANNOYED = new string_id("beast", "beast_annoyed"); - public static final string_id SID_BEAST_NORMAL = new string_id("beast", "beast_content"); - public static final string_id SID_BEAST_JOYOUS = new string_id("beast", "beast_joyous"); - public static final string_id SID_BEAST_HAPPY = new string_id("beast", "beast_happy"); - public static final string_id SID_BEAST_VERY_HAPPY = new string_id("beast", "beast_very_happy"); - public static final string_id SID_BEAST_ECSTATIC = new string_id("beast", "beast_ecstatic"); - public static final String DATATABLE_BEAST_FAVORITES = "datatables/beast/favorites.iff"; - public static final String DATATABLE_FOOD_COL = "beastFoodName"; - public static final String DATATABLE_LOCATION_COL = "beastLocationName"; - public static final String DATATABLE_ACTIVITY_COL = "beastActivityName"; - public static final int FOOD_FAVORITE = 0; - public static final int FOOD_DISLIKE = 1; - public static final int ACTIVITY_FAVORITE = 2; - public static final int ACTIVITY_DISLIKE = 3; - public static final int LOCATION_FAVORITE = 4; - public static final int LOCATION_DISLIKE = 5; - public static final int LIKE_DISLIKE_MAX = 6; - public static final String PET_FAVORITES_OBJVAR = "beastmood.beastHappinessFactors"; - - public static final string_id SID_NO_BEAST = new string_id("beast", "no_beast_to_feed"); - public static final string_id SID_NORMAL_FOOD = new string_id("beast", "fed_normal"); - public static final string_id SID_FAVORITE_FOOD = new string_id("beast", "fed_favorite"); - public static final string_id SID_DISLIKE_FOOD = new string_id("beast", "fed_dislike"); - public static final string_id SID_PET_HUNGRY = new string_id("beast", "pet_hungry"); - public static final String PET_HUNGRY_MESSAGE_SCRIPTVAR = "beastmood.ownerReceivedHungryMessage"; - public static final int PET_WHICH_FOOD = 0; - public static final int PET_TIME_SINCE_FEEDING = 1; - public static final int PET_FOOD_MAX_ARRAYS = 2; - public static final int PET_NORMAL_FOOD = 5; - public static final int PET_FAVORITE_FOOD = 10; - public static final int PET_DISLIKE_FOOD = -5; - public static final int PET_NO_FOOD = -10; - public static final String PET_FED_SCRIPTVAR = "beastmood.beastLastFed"; - public static final String OBJVAR_BEAST_FOOD = "beastmood.beastLastFed"; - - public static final string_id SID_FAVORITE_LOCATION = new string_id("beast", "location_favorite"); - public static final string_id SID_DISLIKE_LOCATION = new string_id("beast", "location_dislike"); - public static final int PET_NORMAL_LOCATION = 5; - public static final int PET_FAVORITE_LOCATION = 10; - public static final int PET_DISLIKE_LOCATION = -5; - public static final String PET_LOCATION_SCRIPTVAR = "beastmood.beastLastLocation"; - - public static final string_id SID_FAVORITE_ACTIVITY = new string_id("beast", "activity_favorite"); - public static final string_id SID_DISLIKE_ACTIVITY = new string_id("beast", "activity_dislike"); - public static final String PET_ACTIVITY_MESSAGE_SCRIPTVAR = "beastmood.ownerReceivedActivityMessage"; - public static final int PET_NORMAL_ACTIVITY = 0; - public static final int PET_FAVORITE_ACTIVITY = 10; - public static final int PET_DISLIKE_ACTIVITY = -10; - public static final String PET_ACTIVITY_SCRIPTVAR = "beastmood.beastLastActivity"; - public static final String PET_KILL_MESSAGE_SCRIPTVAR = "beastmood.ownerReceivedKillMessage"; - - public static final int EXTRACTION_LIMIT = 1; - public static final String EXTRACTION_LIST = "enzyme.extraction_list"; - - public static final string_id[] ENZYME_EXTRACTION_ERRORS = - { - new string_id("beast", "enzyme_fail_invalid_target"), - new string_id("beast", "enzyme_fail_too_many_extractions"), - new string_id("beast", "enzyme_fail_beast_not_dead"), - new string_id("beast", "enzyme_fail_target_is_pet"), - new string_id("beast", "enzyme_fail_target_not_monster"), - new string_id("beast", "enzyme_fail_no_loot_permission"), - new string_id("beast", "enzyme_fail_already_harvested"), - new string_id("beast", "beast_master_use_only") - }; - - public static final int ENZ_ERROR_INVALID_TARGET = 0; - public static final int ENZ_ERROR_TOO_MANY_EXTRACTIONS = 1; - public static final int ENZ_ERROR_NOT_DEAD = 2; - public static final int ENZ_ERROR_TARGET_IS_PET = 3; - public static final int ENZ_ERROR_TARGET_NOT_MONSTER = 4; - public static final int ENZ_ERROR_NO_LOOT_PERMISSION = 5; - public static final int ENZ_ERROR_ALREADY_HARVEST = 6; - public static final int ENZ_ERROR_NOT_BEAST_MASTER = 7; - - public static final String BM_COMMAND_ATTACK = "bm_pet_attack_1"; - public static final String BM_COMMAND_FOLLOW = "bm_follow_1"; - public static final String BM_COMMAND_STAY = "bm_stay_1"; - public static final String BM_COMMAND_DISABLED = "disabled"; - public static final String BM_DISPOSITION_DEFENSIVE = "toggleBeastDefensive"; - public static final String BM_DISPOSITION_PASSIVE = "toggleBeastPassive"; - - public static final String[] PET_BAR_DEFAULT_ARRAY = - { - BM_COMMAND_DISABLED, - BM_COMMAND_FOLLOW, - BM_COMMAND_STAY, - BM_COMMAND_DISABLED, - BM_COMMAND_DISABLED, - BM_COMMAND_DISABLED, - BM_COMMAND_DISABLED, - BM_DISPOSITION_DEFENSIVE, - BM_DISPOSITION_PASSIVE - }; - public static final string_id SID_TOGGLE_DEFENSIVE = new string_id("beast", "defensive_message"); - - public static final int SKILL_CANNOT_COMPARE = -1; - public static final int SKILL_DIFFERENT_LINE = 0; - public static final int SKILL_SAME = 1; - public static final int SKILL_HIGHER = 2; - public static final int SKILL_LOWER = 3; - - public static final int ABILITY_INVALID = -1; - public static final int ABILITY_TYPE_COMBAT = 0; - public static final int ABILITY_TYPE_NONCOMBAT = 1; - public static final int ABILITY_TYPE_INNATE = 2; - - public static final int TRAINING_VALID = 0; - public static final int TRAINING_INVALID_PETTYPE = 1; - public static final int TRAINING_SKILL_TOO_HIGH = 2; - public static final int TRAINING_INSUFFICIENT_POINTS = 3; - public static final int TRAINING_NON_IMPROVED_SKILL = 4; - public static final int TRAINING_NO_AVAILABLE_SLOTS = 5; - - public static final int INJECTOR_RETURN_BAD_DATA = 0; - public static final int INJECTOR_RETURN_WRONG_LEVEL = 1; - public static final int INJECTOR_RETURN_HAS_BUFF = 2; - public static final int INJECTOR_RETURN_WRONG_FAMILY = 3; - public static final int INJECTOR_RETURN_SUCESS = 4; - - public static final String PET_HAPPINESS_BLOCK_SCRIPTVAR = "beastmood.beastHappinessBlock"; - - public static final int HOLO_BEAST_TYPE2_QUALITY3 = 6; - - public static final int HOLO_BEAST_TYPE3_QUALITY3 = 10; - - public static final int HOLOGRAM_MAX_SETTING = 11; - - public static final String HOLO_BEAST_RARE_COLOR_OBJVAR = "rareHoloBeastColor"; - - - public static void blog(String text) throws InterruptedException - { - if (BEAST_DEBUG) - { - LOG("beast_lib", text); - } - } - - - public static boolean isBeast(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (hasScript(beast, "ai.beast")) - { - return true; - } - - return false; - } - - - public static boolean isBeastMaster(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - int skill = getSkillStatisticModifier(player, "expertise_bm_base_mod"); - - if (skill > 0) - { - return true; - } - - return false; - } - - - public static boolean isValidBeast(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (!callable.hasCallableCD(beast)) - { - return false; - } - - return true; - } - - - public static boolean isValidBCD(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd) || !exists(bcd)) - { - return false; - } - - if (!hasObjVar(bcd, OBJVAR_BEAST_TYPE)) - { - return false; - } - - return true; - } - - - public static boolean isValidPlayer(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - return true; - } - - - public static float getBeastScaleByLevel(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast)) - { - return 1.0f; - } - - String beastType = getBeastType(beast); - dictionary beastDict = utils.dataTableGetRow(BEASTS_TABLE, beastType); - - float minScale = beastDict.getFloat("minScale"); - float maxScale = beastDict.getFloat("maxScale"); - - int level = getLevel(beast); - - float scaleDifference = maxScale - minScale; - - if (scaleDifference <= 0) - { - return minScale; - } - - return (float)(minScale + (scaleDifference * ((float)level / 90.0f))); - } - - - public static obj_id getBCDPlayer(obj_id bcd) throws InterruptedException - { - obj_id datapad = getContainedBy(bcd); - obj_id player = getContainedBy(datapad); - - if (!isIdValid(player) || !isPlayer(player)) - { - if (hasObjVar(bcd, OBJVAR_BEAST_BCD_OWNER)) - { - obj_id owner = getObjIdObjVar(bcd, OBJVAR_BEAST_BCD_OWNER); - if (isIdValid(owner)) - { - return owner; - } - else - { - return null; - } - } - else - { - return null; - } - } - - return player; - } - - - public static void setBCDBeastCalled(obj_id bcd, obj_id beast) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - setBCDBeastCalledTime(bcd, getGameTime()); - - callable.setCDCallable(bcd, beast); - } - - - public static obj_id getBCDBeastCalled(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return null; - } - - return callable.getCDCallable(bcd); - } - - - public static void setBeastOnPlayer(obj_id player, obj_id beast) throws InterruptedException - { - if (!isIdValid(player)) - { - return; - } - - callable.setCallable(player, beast, callable.CALLABLE_TYPE_COMBAT_PET); - } - - - public static obj_id getBeastOnPlayer(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return null; - } - - obj_id beast = callable.getCallable(player, callable.CALLABLE_TYPE_COMBAT_PET); - - if (!isValidBeast(beast) || !beast_lib.isBeast(beast)) - { - beast = null; - } - - return beast; - } - - - public static void setBCDBeastTimeStored(obj_id bcd, int time) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return; - } - - setObjVar(bcd, "beast.timeStored", time); - } - - - public static int getBCDBeastTimeStored(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return 0; - } - - int time = 0; - - if (hasObjVar(bcd, "beast.timeStored")) - { - time = getIntObjVar(bcd, "beast.timeStored"); - } - - return time; - } - - - public static void setBCDBeastCalledTime(obj_id bcd, int time) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return; - } - - setObjVar(bcd, "beast.timeCalled", time); - } - - - public static int getBCDBeastCalledTime(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return 0; - } - - int time = 0; - - if (hasObjVar(bcd, "beast.timeStored")) - { - time = getIntObjVar(bcd, "beast.timeCalled"); - } - - return time; - } - - - public static String getBeastLocalizedName(obj_id bcd) throws InterruptedException - { - String beastType = getBCDBeastType(bcd); - String beastDisplayType = stripBmFromType(beastType); - string_id beastTypeSid = new string_id("monster_name", beastDisplayType); - - return localize(beastTypeSid); - } - - - public static void setBCDBeastName(obj_id bcd, String beastName) throws InterruptedException - { - if (!isIdValid(bcd) || beastName == null) - { - return; - } - - setName(bcd, beastName); - - setObjVar(bcd, "beast.beastName", beastName); - } - - - public static boolean hasBCDBeastName(obj_id bcd) throws InterruptedException - { - if (hasObjVar(bcd, "beast.beastName")) - { - return true; - } - - return false; - } - - - public static String getBCDBeastName(obj_id bcd) throws InterruptedException - { - String beastName = getBeastLocalizedName(bcd); - - if (hasBCDBeastName(bcd)) - { - beastName = getStringObjVar(bcd, "beast.beastName"); - } - - return beastName; - } - - - public static void setBeastName(obj_id beast, String beastName) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return; - } - - setName(beast, beastName); - } - - - public static boolean hasBeastName(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return false; - } - - return hasBCDBeastName(getBeastBCD(beast)); - } - - - public static String getBeastName(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return null; - } - - return getBCDBeastName(getBeastBCD(beast)); - } - - - public static void setBCDBeastType(obj_id bcd, String beastType) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return; - } - - int hashBeastType = incubator.getHashType(beastType); - setObjVar(bcd, OBJVAR_BEAST_TYPE, hashBeastType); - } - - - public static String getBCDBeastType(obj_id bcd) throws InterruptedException - { - String beastType = ""; - - if (hasObjVar(bcd, OBJVAR_BEAST_TYPE)) - { - int hashBeastType = getIntObjVar(bcd, OBJVAR_BEAST_TYPE); - beastType = incubator.convertHashTypeToString(hashBeastType); - } - - return beastType; - } - - - public static void setBeastType(obj_id beast, String template) throws InterruptedException - { - if (!isIdValid(beast) || template == null || template.length() <= 0) - { - return; - } - - int row = dataTableSearchColumnForString(template, "template", BEASTS_TABLE); - - if (row < 0) - { - return; - } - - dictionary dict = dataTableGetRow(BEASTS_TABLE, row); - - if (dict == null) - { - return; - } - - String type = dict.getString("beastType"); - - obj_id bcd = getBeastBCD(beast); - - if (!isValidBCD(bcd)) - { - return; - } - - obj_id player = getBCDPlayer(bcd); - - if (!isValidPlayer(player)) - { - return; - } - - storeBeast(bcd); - - setBCDBeastType(bcd, type); - - createBeastFromBCD(player, bcd); - } - - - public static String getBeastType(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast)) - { - return ""; - } - - String template = getTemplateName(beast); - String[] templateSplit = split(template, '/'); - template = templateSplit[templateSplit.length - 1]; - int row = dataTableSearchColumnForString(template, "template", BEASTS_TABLE); - - dictionary dict = dataTableGetRow(BEASTS_TABLE, row); - - if (dict == null) - { - return ""; - } - - String type = dict.getString("beastType"); - - return type; - } - - - public static void setBeastBCD(obj_id beast, obj_id bcd) throws InterruptedException - { - if (!isIdValid(beast)) - { - return; - } - - callable.setCallableCD(beast, bcd); - } - - - public static obj_id getBeastBCD(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast)) - { - return null; - } - - obj_id bcd = callable.getCallableCD(beast); - - if (!isValidBCD(bcd)) - { - bcd = null; - } - - return bcd; - } - - - public static void setBCDBeastLevel(obj_id bcd, int level) throws InterruptedException - { - if (!isIdValid(bcd) || level < 1 || level > 90) - { - return; - } - - setObjVar(bcd, "beast.level", level); - } - - - public static int getBCDBeastLevel(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return -1; - } - - int level = 0; - - if (hasObjVar(bcd, "beast.level")) - { - level = getIntObjVar(bcd, "beast.level"); - } - - return level; - } - - - public static void setBeastLevel(obj_id beast, int level) throws InterruptedException - { - if (!isIdValid(beast) || level < 1 || level > 90) - { - return; - } - - setLevel(beast, level); - } - - - public static int getBeastLevel(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast)) - { - return -1; - } - - return getLevel(beast); - } - - - public static void setBCDBeastExperience(obj_id bcd, int exp) throws InterruptedException - { - if (!isIdValid(bcd) || exp < 0) - { - return; - } - - setObjVar(bcd, "beast.experience", exp); - } - - - public static int getBCDBeastExperience(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return -1; - } - - int exp = 0; - - if (hasObjVar(bcd, "beast.experience")) - { - exp = getIntObjVar(bcd, "beast.experience"); - } - - return exp; - } - - - public static void setBeastExperience(obj_id beast, int exp) throws InterruptedException - { - if (!isIdValid(beast) || exp < 0) - { - return; - } - - setObjVar(beast, "beast.experience", exp); - } - - - public static int getBeastExperience(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast)) - { - return -1; - } - - int exp = 0; - - if (hasObjVar(beast, "beast.experience")) - { - exp = getIntObjVar(beast, "beast.experience"); - } - - return exp; - } - - - public static void setBCDBeastHealth(obj_id bcd, int health) throws InterruptedException - { - if (!isIdValid(bcd) || health < 0) - { - return; - } - - setObjVar(bcd, "beast.health", health); - } - - - public static int getBCDBeastHealth(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return -1; - } - - int health = 0; - - if (hasObjVar(bcd, "beast.health")) - { - health = getIntObjVar(bcd, "beast.health"); - } - else - { - return -1; - } - - return health; - } - - - public static void setBCDBeastCanLevel(obj_id bcd, boolean canLevel) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return; - } - - setObjVar(bcd, "beast.canLevel", canLevel); - } - - - public static boolean getBCDBeastCanLevel(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return false; - } - - boolean canLevel = false; - - if (hasObjVar(bcd, "beast.canLevel")) - { - canLevel = getBooleanObjVar(bcd, "beast.canLevel"); - } - - return canLevel; - } - - - public static void setBeastCanLevel(obj_id beast, boolean canLevel) throws InterruptedException - { - if (!isIdValid(beast)) - { - return; - } - - setObjVar(beast, "beast.canLevel", canLevel); - } - - - public static boolean getBeastCanLevel(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return false; - } - - boolean canLevel = false; - - if (hasObjVar(beast, "beast.canLevel")) - { - canLevel = getBooleanObjVar(beast, "beast.canLevel"); - } - - return canLevel; - } - - - public static void setBCDBeastIsDead(obj_id bcd, boolean beastIsDead) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - setObjVar(bcd, "beast.isDead", beastIsDead); - } - - - public static boolean getBCDBeastIsDead(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return true; - } - - boolean beastIsDead = false; - - if (hasObjVar(bcd, "beast.isDead")) - { - beastIsDead = getBooleanObjVar(bcd, "beast.isDead"); - } - - return beastIsDead; - } - - - public static void setBCDBeastDefensive(obj_id bcd, obj_id player, boolean beastIsDefensive) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - obj_id beast = getBCDBeastCalled(bcd); - - if (!isValidBeast(beast)) - { - return; - } - - prose_package pp = new prose_package(); - - if (beastIsDefensive) - { - utils.removeScriptVar(beast, "petIgnoreAttacks"); - pp = prose.setTT(pp, "DEFENSIVE"); - } - else - { - utils.setScriptVar(beast, "petIgnoreAttacks", getGameTime()); - pp = prose.setTT(pp, "PASSIVE"); - } - - pp = prose.setStringId(pp, SID_TOGGLE_DEFENSIVE); - sendSystemMessageProse(player, pp); - - setObjVar(bcd, "beast.isDefensive", beastIsDefensive); - - setToggledCommands(player, bcd); - } - - - public static boolean getBCDBeastDefensive(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return false; - } - - if (hasObjVar(bcd, "beast.isDefensive")) - { - return getBooleanObjVar(bcd, "beast.isDefensive"); - } - - return false; - } - - - public static void setBeastDefensive(obj_id beast, obj_id player, boolean beastIsDefensive) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return; - } - - setBCDBeastDefensive(getBeastBCD(beast), player, beastIsDefensive); - } - - - public static boolean getBeastDefensive(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return false; - } - - return getBCDBeastDefensive(getBeastBCD(beast)); - } - - - public static obj_id[] getDatapadBCDs(obj_id player) throws InterruptedException - { - Vector datapadBCDs = new Vector(); - datapadBCDs.setSize(0); - - if (!isIdValid(player) || !exists(player)) - { - return null; - } - - obj_id datapad = utils.getPlayerDatapad(player); - - if (!isIdValid(datapad)) - { - return null; - } - - obj_id[] dataItems = getContents(datapad); - - for (int i = 0; i < dataItems.length; i++) - { - testAbortScript(); - if (beast_lib.isValidBCD(dataItems[i])) - { - datapadBCDs = utils.addElement(datapadBCDs, dataItems[i]); - } - } - - obj_id[] _datapadBCDs = new obj_id[0]; - if (datapadBCDs != null) - { - _datapadBCDs = new obj_id[datapadBCDs.size()]; - datapadBCDs.toArray(_datapadBCDs); - } - return _datapadBCDs; - } - - - public static int getTotalBeastControlDevices(obj_id player) throws InterruptedException - { - Vector datapadBCDs = new Vector(); - datapadBCDs.setSize(0); - - if (!isIdValid(player) || !exists(player)) - { - return 0; - } - - obj_id datapad = utils.getPlayerDatapad(player); - - if (!isIdValid(datapad)) - { - return 0; - } - - obj_id[] dataItems = getContents(datapad); - if (dataItems == null || dataItems.length < 1) - { - return 0; - } - - int numStored = 0; - for (int i = 0; i < dataItems.length; i++) - { - testAbortScript(); - if (beast_lib.isValidBCD(dataItems[i])) - { - numStored++; - } - } - return numStored; - } - - - public static int getTotalBeastsCalled(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return 0; - } - - obj_id datapad = utils.getPlayerDatapad(player); - - if (!isIdValid(datapad)) - { - return 0; - } - - obj_id[] datapadContents = getContents(datapad); - - if (datapadContents == null) - { - return 0; - } - - int beastTotal = 0; - - for (int i = 0; i < datapadContents.length; i++) - { - testAbortScript(); - if (hasObjVar(datapadContents[i], "beast.called") && isValidBeast(getBCDBeastCalled(datapadContents[i]))) - { - beastTotal++; - } - } - - return beastTotal; - } - - - public static int getBCDBeastHappiness(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return 0; - } - - if (!hasBCDBeastHappiness(bcd)) - { - setBCDBeastHappiness(bcd, 0); - - return 0; - } - - return getIntObjVar(bcd, OBJVAR_BEAST_HAPPINESS); - } - - - public static void setBCDBeastHappiness(obj_id bcd, int happiness) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - setObjVar(bcd, OBJVAR_BEAST_HAPPINESS, happiness); - } - - - public static boolean hasBCDBeastHappiness(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return false; - } - - if (hasObjVar(bcd, OBJVAR_BEAST_HAPPINESS)) - { - return true; - } - - return false; - } - - - public static int getBeastHappiness(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return 0; - } - - return getBCDBeastHappiness(getBeastBCD(beast)); - } - - - public static void setBeastHappiness(obj_id beast, int happiness) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return; - } - - setBCDBeastHappiness(getBeastBCD(beast), happiness); - } - - - public static float getBCDBeastLoyalty(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return 0; - } - - if (!hasBCDBeastLoyalty(bcd)) - { - setBCDBeastLoyalty(bcd, 1.0f); - - return 0; - } - - return getFloatObjVar(bcd, PET_LOYALTY_OBJVAR); - } - - - public static void setBCDBeastLoyalty(obj_id bcd, float newLoyalty) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - setObjVar(bcd, PET_LOYALTY_OBJVAR, newLoyalty); - } - - - public static boolean hasBCDBeastLoyalty(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return false; - } - - if (hasObjVar(bcd, PET_LOYALTY_OBJVAR)) - { - return true; - } - - return false; - } - - - public static float getBeastLoyalty(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return 0; - } - - return getBCDBeastLoyalty(getBeastBCD(beast)); - } - - - public static void setBeastLoyalty(obj_id beast, float newLoyalty) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return; - } - - if (newLoyalty < 1.0f) - { - newLoyalty = 1.0f; - } - else if (newLoyalty > LOYALTY_MAX) - { - newLoyalty = LOYALTY_MAX; - } - - setBCDBeastLoyalty(getBeastBCD(beast), newLoyalty); - } - - - public static void incrementBeastLoyalty(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - float loyalty = getBCDBeastLoyalty(bcd); - - if (loyalty >= LOYALTY_MAX) - { - return; - } - - int happiness = getBCDBeastHappiness(bcd); - - if (happiness < 0) - { - happiness = 0; - } - - float modifiedHappiness = 10 * (1.0f + ((float)happiness / 50.0f)); - - float newLoyalty = loyalty + modifiedHappiness; - - if (loyalty < LOYALTY_LVL_TWO && newLoyalty >= LOYALTY_LVL_TWO) - { - incrementBeastLoyaltyLevel(bcd); - } - - if (loyalty < LOYALTY_LVL_THREE && newLoyalty >= LOYALTY_LVL_THREE) - { - incrementBeastLoyaltyLevel(bcd); - } - - if (loyalty < LOYALTY_LVL_FOUR && newLoyalty >= LOYALTY_LVL_FOUR) - { - incrementBeastLoyaltyLevel (bcd); - } - - if (loyalty < LOYALTY_LVL_FIVE && newLoyalty >= LOYALTY_LVL_FIVE) - { - incrementBeastLoyaltyLevel(bcd); - } - - setBCDBeastLoyalty(bcd, newLoyalty); - } - - - public static void decrementBeastLoyalty(obj_id bcd, float loyaltyDecrement) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - if (!hasObjVar(bcd, PET_LOYALTY_OBJVAR)) - { - setObjVar(bcd, PET_LOYALTY_OBJVAR, 1.0f); - return; - } - - float loyalty = getBCDBeastLoyalty(bcd); - - if (loyalty <= 101) - { - return; - } - - float newLoyalty = loyalty - loyaltyDecrement; - - if (loyalty >= LOYALTY_LVL_TWO && newLoyalty < LOYALTY_LVL_TWO) - { - decrementBeastLoyaltyLevel(bcd); - } - - if (loyalty >= LOYALTY_LVL_THREE && newLoyalty < LOYALTY_LVL_THREE) - { - decrementBeastLoyaltyLevel (bcd); - } - - if (loyalty >= LOYALTY_LVL_FOUR && newLoyalty < LOYALTY_LVL_FOUR) - { - decrementBeastLoyaltyLevel(bcd); - } - - if (loyalty >= LOYALTY_LVL_FIVE && newLoyalty < LOYALTY_LVL_FIVE) - { - decrementBeastLoyaltyLevel(bcd); - } - - setBCDBeastLoyalty(bcd, newLoyalty); - } - - - public static int getBCDBeastLoyaltyLevel(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return 0; - } - - if (!hasBCDBeastLoyalty(bcd)) - { - setBCDBeastLoyaltyLevel(bcd, 1); - - return 0; - } - - return getIntObjVar(bcd, PET_LOYALTY_LEVEL_OBJVAR); - } - - - public static void setBCDBeastLoyaltyLevel(obj_id bcd, int newLevel) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - if (newLevel < 1) - { - newLevel = 1; - } - else if (newLevel > 5) - { - newLevel = 5; - } - - setObjVar(bcd, PET_LOYALTY_LEVEL_OBJVAR, newLevel); - } - - - public static boolean hasBCDBeastLoyaltyLevel(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return false; - } - - if (hasObjVar(bcd, PET_LOYALTY_LEVEL_OBJVAR)) - { - return true; - } - - return false; - } - - - public static int getBeastLoyaltyLevel(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return 0; - } - - return getBCDBeastLoyaltyLevel(getBeastBCD(beast)); - } - - - public static void setBeastLoyaltyLevel(obj_id beast, int newLevel) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return; - } - - setBCDBeastLoyalty(getBeastBCD(beast), newLevel); - } - - - public static void incrementBeastLoyaltyLevel(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - obj_id beast = getBCDBeastCalled(bcd); - obj_id player = getBCDPlayer(bcd); - - if (!isValidBeast(beast) || !isValidPlayer(player)) - { - return; - } - - int level = 1; - - if (hasBCDBeastLoyaltyLevel(bcd)) - { - level = getBCDBeastLoyaltyLevel(bcd) + 1; - } - - setBCDBeastLoyaltyLevel(bcd, level); - - playClientEffectObj(beast, "clienteffect/level_granted.cef", beast, null); - sendSystemMessage(player, SID_LOYALTY_LEVEL_GAIN); - - updateBeastStats(bcd, beast); - } - - - public static void decrementBeastLoyaltyLevel(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - obj_id beast = getBCDBeastCalled(bcd); - obj_id player = getBCDPlayer(bcd); - - if (!isValidBeast(beast) || !isValidPlayer(player)) - { - return; - } - - int level = 1; - - if (hasBCDBeastLoyaltyLevel(bcd)) - { - level = getBCDBeastLoyaltyLevel(bcd) - 1; - } - - setBCDBeastLoyaltyLevel(bcd, level); - - playClientEffectObj(beast, "clienteffect/medic_traumatize.cef", beast, null); - sendSystemMessage(player, SID_LOYALTY_LEVEL_LOSS); - - updateBeastStats(bcd, beast); - } - - - public static int[] getBCDBeastFood(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return null; - } - - if (!hasBCDBeastFood(bcd)) - { - - int[] newFood = new int[PET_FOOD_MAX_ARRAYS]; - - newFood[PET_WHICH_FOOD] = PET_NORMAL_FOOD; - newFood[PET_TIME_SINCE_FEEDING] = getGameTime(); - - setBCDBeastFood(bcd, newFood); - - return newFood; - } - - return getIntArrayObjVar(bcd, OBJVAR_BEAST_FOOD); - } - - - public static void setBCDBeastFood(obj_id bcd, int[] newFood) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return; - } - - if (newFood == null || newFood.length < PET_FOOD_MAX_ARRAYS) - { - newFood = new int[PET_FOOD_MAX_ARRAYS]; - - newFood[PET_WHICH_FOOD] = PET_NORMAL_FOOD; - newFood[PET_TIME_SINCE_FEEDING] = getGameTime(); - } - - setObjVar(bcd, OBJVAR_BEAST_FOOD, newFood); - } - - - public static boolean hasBCDBeastFood(obj_id bcd) throws InterruptedException - { - if (!isValidBCD(bcd)) - { - return false; - } - - if (hasObjVar(bcd, OBJVAR_BEAST_FOOD)) - { - return true; - } - - return false; - } - - - public static int[] getBeastFood(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return null; - } - - return getBCDBeastFood(getBeastBCD(beast)); - } - - - public static void setBeastFood(obj_id beast, int[] newFood) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return; - } - - setBCDBeastFood(getBeastBCD(beast), newFood); - } - - - public static int getBCDBeastLastFedTime(obj_id bcd) throws InterruptedException - { - - int storedTime = getBCDBeastTimeStored(bcd); - int calledTime = getBCDBeastCalledTime(bcd); - int currentTime = getGameTime(); - int fedTimeDelta = 0; - - int[] beastFood = getBCDBeastFood(bcd); - - if (calledTime > beastFood[PET_TIME_SINCE_FEEDING]) - { - - fedTimeDelta = (storedTime - beastFood[PET_TIME_SINCE_FEEDING]) + (currentTime - calledTime); - } - else - { - - if (storedTime > beastFood[PET_TIME_SINCE_FEEDING]) - { - fedTimeDelta = currentTime - storedTime; - } - else - { - - fedTimeDelta = currentTime - beastFood[PET_TIME_SINCE_FEEDING]; - } - } - - return fedTimeDelta; - } - - - public static void updateBeastHappiness(obj_id bcd, obj_id beast) throws InterruptedException - { - if (!isValidBCD(bcd) || !isValidBeast(beast)) - { - return; - } - - obj_id player = getBCDPlayer(bcd); - - if (!isValidPlayer(player)) - { - return; - } - - int happiness = 0; - float loyalty = getBCDBeastLoyalty(bcd); - int loyaltyLevel = getBCDBeastLoyaltyLevel(bcd); - - int[] beastFood = getBCDBeastFood(bcd); - - if (getBCDBeastLastFedTime(bcd) > 3600) - { - dictionary params = new dictionary(); - params.put("beastId", beast); - - messageTo(bcd, "beastHungry", params, 1, false); - } - - happiness += beastFood[PET_WHICH_FOOD]; - - if (loyaltyLevel >= 3) - { - - happiness += PET_HAPPINESS_LOYALTY_BONUS; - } - - if (utils.hasScriptVar(bcd, PET_LOCATION_SCRIPTVAR)) - { - - happiness += utils.getIntScriptVar(bcd, PET_LOCATION_SCRIPTVAR); - } - - if (utils.hasScriptVar(bcd, PET_ACTIVITY_SCRIPTVAR)) - { - - happiness += utils.getIntScriptVar(bcd, PET_ACTIVITY_SCRIPTVAR); - } - - happiness += (int)getSkillStatisticModifier(player, "expertise_bm_pet_happiness"); - - setBCDBeastHappiness(bcd, happiness); - - applyHappinessBuffIcon(beast); - } - - - public static void setBeastLinks(obj_id player, obj_id bcd, obj_id beast) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(bcd) || !isIdValid(beast)) - { - return; - } - - setBCDBeastCalled(bcd, beast); - setBeastBCD(beast, bcd); - setBeastOnPlayer(player, beast); - - setMaster(beast, player); - } - - - public static void removeBeastLinks(obj_id player, obj_id bcd, obj_id beast) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(bcd) || !isIdValid(beast)) - { - return; - } - - setBCDBeastCalled(bcd, null); - setBeastBCD(beast, null); - setBeastOnPlayer(player, null); - setMaster(beast, null); - - } - - - public static obj_id createBCDFromEgg(obj_id player, obj_id egg) throws InterruptedException - { - if (!isIdValid(player)) - { - blog("BCD could not be made because the player is invalid."); - return null; - } - - if (callable.hasMaxStoredCombatPets(player)) - { - sendSystemMessage(player, SID_MAXIMUM_COMBAT_CONTROL_DEVICES); - return null; - } - - if (!isIdValid(egg)) - { - blog("BCD could not be made because its egg is invalid."); - return null; - } - - int hashType = getIntObjVar(egg, OBJVAR_BEAST_TYPE); - String beastType = incubator.convertHashTypeToString(hashType); - - if (beastType.equals("") || beastType == null) - { - blog("BCD could not be made because beastType is null."); - return null; - } - - dictionary beastDict = utils.dataTableGetRow(BEASTS_TABLE, beastType); - - if (beastDict == null) - { - blog("BCD could not be created because no dictionary exists in beast/beasts.tab. for the beastType: "+ beastType); - return null; - } - - String intangibleTemplateName = beastDict.getString("template"); - - if (intangibleTemplateName.equals("") || intangibleTemplateName == null) - { - blog("BCD could not be made because intangibleTemplateName is null."); - return null; - } - - obj_id datapad = utils.getPlayerDatapad(player); - - if (!isIdValid(datapad)) - { - blog("BCD could not be made because datapad is null."); - return null; - } - - blog("BCD attempting to create object for template: "+ INTANGIBLE_TEMPLATE_PREFIX + intangibleTemplateName + " in datapad: "+ datapad); - - obj_id beastControlDevice = createObject(INTANGIBLE_TEMPLATE_PREFIX + intangibleTemplateName, datapad, ""); - - if (!isIdValid(beastControlDevice)) - { - beastControlDevice = createObject(pet_lib.PET_CTRL_DEVICE_TEMPLATE, datapad, ""); - - if (!isIdValid(beastControlDevice)) - { - sendSystemMessage(player, pet_lib.SID_SYS_TOO_MANY_STORED_PETS); - return null; - } - } - - if (!isIdValid(beastControlDevice)) - { - blog("Beast control device not created for "+ beastType); - return null; - } - - setBCDBeastType(beastControlDevice, beastType); - - if (hasObjVar(egg, OBJVAR_OLD_PET_IDENTIFIER)) - { - String oldName = getAssignedName(egg); - if (oldName != null && !oldName.equals("")) - { - setBCDBeastName(beastControlDevice, oldName); - } - else - { - setName(beastControlDevice, getBeastLocalizedName(beastControlDevice)); - } - setObjVar(beastControlDevice, OBJVAR_OLD_PET_IDENTIFIER, 1); - if (hasObjVar(egg, OBJVAR_OLD_PET_REHUED)) - { - setObjVar(beastControlDevice, OBJVAR_OLD_PET_REHUED, 1); - } - } - else - { - setName(beastControlDevice, getBeastLocalizedName(beastControlDevice)); - } - - setBCDIncubationStats(beastControlDevice, egg); - - setBCDBeastHueFromEgg(beastControlDevice, egg); - - setBCDBeastLevel(beastControlDevice, 1); - - setBCDBeastExperience(beastControlDevice, 0); - - setBCDBeastCanLevel(beastControlDevice, true); - - setBCDBeastCalled(beastControlDevice, null); - - attachScript(beastControlDevice, "ai.beast_control_device"); - - setupHappinessLoyalty(beastControlDevice); - - return beastControlDevice; - } - - - public static String stripBmFromType(String beastType) throws InterruptedException - { - if (beastType.indexOf("bm_") > -1) - { - String[] splitType = split(beastType, '_'); - beastType = splitType[1]; - - for (int i = 2; i < splitType.length; ++i) - { - testAbortScript(); - beastType += "_"+ splitType[i]; - } - } - return beastType; - } - - - public static obj_id createBasicBeastFromObject(obj_id source) throws InterruptedException - { - location spawnLocation = getLocation(source); - return createBasicBeastFromObject(source, spawnLocation); - } - - - public static obj_id createBasicBeastFromObject(obj_id source, location spawnLocation) throws InterruptedException - { - if (!isIdValid(source)) - { - blog("createBeastFromBCD: Beast Statue could not be made because the source is invalid."); - return null; - } - - String beastType = getBCDBeastType(source); - - if (beastType.equals("") || beastType == null) - { - blog("createBeastFromBCD: Beast Statue could not be made because beastType is null."); - return null; - } - - dictionary beastDict = utils.dataTableGetRow(BEASTS_TABLE, beastType); - - if (beastDict == null) - { - blog("createBeastFromBCD: Beast could not be created because no dictionary exists in beast/beasts.tab."); - return null; - } - - String mobileTemplateName = beastDict.getString("template"); - - if (mobileTemplateName.equals("") || mobileTemplateName == null) - { - blog("createBeastFromBCD: Beast could not be made because mobileTemplateName is null."); - return null; - } - - obj_id beast = createObject(MOBILE_TEMPLATE_PREFIX + mobileTemplateName, spawnLocation); - - setBeastBCD(beast, source); - - initializeBeastColor(beast); - - return beast; - } - - - public static obj_id createBasicBeastFromPlayer(obj_id player, obj_id bcd) throws InterruptedException - { - if (!isIdValid(player)) - { - blog("createBeastFromBCD: Beast could not be made because the player is invalid."); - return null; - } - - if (!isBeastMaster(player)) - { - sendSystemMessage(player, SID_NOT_BEAST_MASTER); - return null; - } - - String beastType = getBCDBeastType(bcd); - - if (beastType.equals("") || beastType == null) - { - blog("createBeastFromBCD: Beast could not be made because beastType is null."); - return null; - } - - dictionary beastDict = utils.dataTableGetRow(BEASTS_TABLE, beastType); - - if (beastDict == null) - { - blog("createBeastFromBCD: Beast could not be created because no dictionary exists in beast/beasts.tab."); - return null; - } - - String mobileTemplateName = beastDict.getString("template"); - - if (mobileTemplateName.equals("") || mobileTemplateName == null) - { - blog("createBeastFromBCD: Beast could not be made because mobileTemplateName is null."); - return null; - } - - location spawnLocation = getLocation(player); - - obj_id beast = createObject(MOBILE_TEMPLATE_PREFIX + mobileTemplateName, spawnLocation); - - setBeastLinks(player, bcd, beast); - - initializeBeastColor(beast); - - return beast; - } - - - public static obj_id createBeastFromBCD(obj_id player, obj_id bcd) throws InterruptedException - { - obj_id beast = createBasicBeastFromPlayer(player, bcd); - - if (!isIdValid(beast)) - { - String beastType = getBCDBeastType(bcd); - dictionary beastDict = utils.dataTableGetRow(BEASTS_TABLE, beastType); - String mobileTemplateName = beastDict.getString("template"); - - blog("createBeastFromBCD: Beast failed to be created by createObject: "+ (MOBILE_TEMPLATE_PREFIX + mobileTemplateName)); - return null; - } - - utils.setScriptVar(beast, "beast.creationInProgress", true); - - initializeBeastScripts(beast); - - initializeBeastStats(bcd, beast); - - setYaw(beast, rand(0.0f, 360.0f)); - - updatePetAbilityList(bcd, beast); - - setBeastmasterPet(player, beast); - - utils.removeScriptVar(beast, "beast.creationInProgress"); - - if (BEAST_DEBUG) - { - String beastType = getBCDBeastType(bcd); - location spawnLocation = getLocation(player); - blog(getName(getSelf()) + " creating beastType: "+ beastType + " at "+ spawnLocation); - } - - setAttributeAttained(beast, attrib.BEAST); - - return beast; - } - - - public static void initializeBeastScripts(obj_id beast) throws InterruptedException - { - attachScript(beast, "ai.ai"); - attachScript(beast, "ai.creature_combat"); - attachScript(beast, "systems.combat.combat_actions"); - attachScript(beast, "ai.beast"); - } - - - public static void initializeBeastStats(obj_id bcd, obj_id beast) throws InterruptedException - { - if (!isValidBCD(bcd) || !isValidBeast(beast)) - { - return; - } - - int level = getBCDBeastLevel(bcd); - - setBeastLevel(beast, level); - - String beastType = getBCDBeastType(bcd); - - if (beastType == null || beastType.length() <= 0) - { - blog("initializeBeastStats() bad beast type."); - return; - } - - String beastName = getBCDBeastName(bcd); - - beastName = beastName.trim(); - - if (beastName.length() >= 3) - { - setBeastName(beast, getBCDBeastName(bcd)); - } - else - { - removeObjVar(bcd, "beast.beastName"); - } - - dictionary beastDict = utils.dataTableGetRow(BEASTS_TABLE, beastType); - - if (beastDict == null || beastDict.size() <= 0) - { - blog("initializeBeastStats() missing entry in the "+ BEASTS_TABLE + " table for beastType: "+ beastType + "."); - return; - } - - dictionary beastStatsDict = utils.dataTableGetRow(BEASTS_STATS, level - 1); - - if (beastStatsDict == null || beastStatsDict.size() <= 0) - { - blog("initializeBeastStats() missing entry in the "+ BEASTS_STATS + " table for beastType: "+ beastType + "."); - return; - } - - int[] incubationBonuses = new int[ARRAY_BEAST_INCUBATION_STATS.length]; - - if (hasObjVar(bcd, OBJVAR_BEAST_INCUBATION_BONUSES)) - { - incubationBonuses = getIntArrayObjVar(bcd, OBJVAR_BEAST_INCUBATION_BONUSES); - } - else - { - for (int i = 0; i < ARRAY_BEAST_INCUBATION_STATS.length; ++i) - { - testAbortScript(); - incubationBonuses[i] = 0; - } - } - - for (int i = 0; i < ARRAY_BEAST_INCUBATION_STATS.length; ++i) - { - testAbortScript(); - utils.setScriptVar(beast, ARRAY_BEAST_INCUBATION_STATS[i], (float)incubationBonuses[i]); - } - - addInnateBeastBonuses(beast, beastType); - - setBeastSkillBonuses(beast); - - setScale(beast, getBeastScaleByLevel(beast)); - - addSkillModModifier(beast, "slope_move", "slope_move", 50, -1, false, false); - - updateBeastHappiness(bcd, beast); - - int expertiseRegen = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_regen"); - int expertiseHealth = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_health"); - int expertiseAttackSpeed = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_attack_speed"); - int expertiseArmor = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_armor"); - int expertiseDamage = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_damage"); - - float incubationArmorBonus = utils.getFloatScriptVar(beast, OBJVAR_INCREASE_ARMOR); - float incubationDamageBonus = utils.getFloatScriptVar(beast, OBJVAR_INCREASE_DPS); - float incubationHealthBonus = utils.getFloatScriptVar(beast, OBJVAR_INCREASE_HEALTH); - - int intMinDamage = (int)beastStatsDict.getInt("MinDmg"); - int intMaxDamage = (int)beastStatsDict.getInt("MaxDmg"); - intMinDamage = getExpertiseStat(intMinDamage, expertiseDamage, .5f); - intMaxDamage = getExpertiseStat(intMaxDamage, expertiseDamage, .5f); - - float floatMinDamage = (float)intMinDamage * (1.0f + incubationDamageBonus / 100.0f); - float floatMaxDamage = (float)intMaxDamage * (1.0f + incubationDamageBonus / 100.0f); - intMinDamage = (int)floatMinDamage; - intMaxDamage = (int)floatMaxDamage; - - int specialDamagePercent = getExpertiseStat(100, expertiseDamage, .5f) - 100; - - if (!hasSkillModModifier (beast, "expertise_damage_line_beast_only")) - { - addSkillModModifier(beast, "expertise_damage_line_beast_only", "expertise_damage_line_beast_only", specialDamagePercent, -1, false, false); - } - - float primarySpeed = getExpertiseSpeed(BEAST_WEAPON_SPEED, expertiseAttackSpeed); - - obj_id beastWeapon = getCurrentWeapon(beast); - - if (isIdValid(beastWeapon)) - { - setWeaponAttackSpeed(beastWeapon, primarySpeed); - setWeaponMaxDamage(beastWeapon, intMaxDamage); - setWeaponMinDamage(beastWeapon, intMinDamage); - weapons.setWeaponData(beastWeapon); - - utils.setScriptVar(beastWeapon, "isCreatureWeapon", 1); - } - - obj_id defaultWeapon = getDefaultWeapon(beast); - - if (isIdValid(defaultWeapon)) - { - setWeaponAttackSpeed(defaultWeapon, primarySpeed); - setWeaponMaxDamage(defaultWeapon, intMaxDamage); - setWeaponMinDamage(defaultWeapon, intMinDamage); - weapons.setWeaponData(defaultWeapon); - - utils.setScriptVar(defaultWeapon, "isCreatureWeapon", 1); - } - - int beastHealth = (int)(getExpertiseStat(beastStatsDict.getInt("HP"), expertiseHealth, .5f) * (1.0f + (incubationHealthBonus * 0.2f) / 100.0f)); - - int constitutionBonus = getEnhancedSkillStatisticModifierUncapped(beast, "constitution_modified"); - int staminaBonus = getEnhancedSkillStatisticModifierUncapped(beast, "stamina_modified"); - - beastHealth += (constitutionBonus * 8) + (staminaBonus * 2); - - setMaxAttrib(beast, HEALTH, beastHealth); - - beastHealth = getBCDBeastHealth(bcd); - - if (beastHealth <= 0) - { - setAttrib(beast, HEALTH, getMaxAttrib(beast, HEALTH)); - } - else - { - if (utils.hasScriptVar(beast, "beast.creationInProgress")) - { - setAttrib(beast, HEALTH, beastHealth); - setAttrib(beast, ACTION, 100); - } - - if (getBCDBeastIsDead(bcd)) - { - kill(beast); - } - } - - setMaxAttrib(beast, ACTION, 100); - - if (!combat.isInCombat(beast)) - { - int healthRegen = getExpertiseStat(beastStatsDict.getInt("HealthRegen"), expertiseRegen, .5f); - int actionRegen = getExpertiseStat(beastStatsDict.getInt("ActionRegen"), expertiseRegen, .5f); - - setRegenRate(beast, HEALTH, healthRegen); - setRegenRate(beast, ACTION, actionRegen); - } - - float runSpeed = 12; - - setBaseRunSpeed(beast, runSpeed); - - if (getBaseWalkSpeed(beast) > runSpeed) - { - setBaseWalkSpeed(beast, runSpeed); - } - - armor.removeAllArmorData(beast); - - int intArmor = (int)(getExpertiseStat(beastStatsDict.getInt("Armor"), expertiseArmor, .5f) * (1.0f + incubationArmorBonus / 100.0f)); - - intArmor += (int)getSkillStatisticModifier(beast, "expertise_innate_protection_all"); - - utils.setScriptVar(beast, "beast.display.armor", intArmor); - - if (intArmor >= 0) - { - - String armorCategoryObjVar = armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_ARMOR_CATEGORY; - setObjVar(beast, armorCategoryObjVar, AC_battle); - - String armorLevelObjVar = armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_ARMOR_LEVEL; - setObjVar(beast, armorLevelObjVar, AL_standard); - - String genProtectionObjVar = armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_GENERAL_PROTECTION; - setObjVar(beast, genProtectionObjVar, (float)intArmor); - utils.setScriptVar(beast, armor.SCRIPTVAR_CACHED_GENERAL_PROTECTION, intArmor); - } - - setBeastExperience(beast, getBCDBeastExperience(bcd)); - - setBeastCanLevel(beast, getBCDBeastCanLevel(bcd)); - - int attentionPenaltyReduction = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_self_debuff_reduction"); - int attentionPenalty = BASE_ATTENTION_PENALTY + attentionPenaltyReduction; - int hackeyWorkAroundValue = (attentionPenalty / 5) * -1; - - if (hackeyWorkAroundValue > 5) - { - hackeyWorkAroundValue = 5; - } - - if (attentionPenalty < 0 || hackeyWorkAroundValue > 0) - { - buff.applyBuff(getMaster(beast), ATTENTION_PENALTY_DEBUFF + hackeyWorkAroundValue); - } - else - { - removeAttentionPenaltyDebuff(getMaster(beast)); - } - } - - - public static void storeBeast(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd)) - { - return; - } - - obj_id datapad = getContainedBy(bcd); - obj_id player = getContainedBy(datapad); - obj_id currentBeast = getBCDBeastCalled(bcd); - - if (!isIdValid(datapad) || !isIdValid(player) || !isIdValid(currentBeast)) - { - return; - } - - storeBeastStats(bcd, currentBeast); - - removeBeastLinks(player, bcd, currentBeast); - - if (currentBeast.isLoaded() && exists(currentBeast)) - { - if (!destroyObject(currentBeast)) - { - return; - } - } - else - { - messageTo(currentBeast, "handlePackRequest", null, 1, false); - } - - setBCDBeastTimeStored(bcd, getGameTime()); - - setCount(bcd, 0); - - setBeastmasterPet(player, null); - - if (!utils.hasScriptVar(player, "beast.no_store_message")) - { - sendSystemMessage(player, beast_lib.SID_STORED); - } - else - { - utils.removeScriptVar(player, "beast.no_store_message"); - } - - removeAttentionPenaltyDebuff(player); - - int petBuff = buff.getBuffOnTargetFromGroup(player, "bm_player_buff"); - - if (petBuff != 0) - { - buff.removeBuff(player, petBuff); - } - } - - - public static void storeBeastStats(obj_id bcd, obj_id beast) throws InterruptedException - { - int health = getAttrib(beast, HEALTH); - - setBCDBeastHealth(bcd, health); - - boolean beastIsDead = isDead(beast); - - setBCDBeastIsDead(bcd, beastIsDead); - } - - - public static void storeBeasts(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return; - } - - obj_id beast = getBeastOnPlayer(player); - - if (!isIdValid(beast)) - { - return; - } - - obj_id bcd = getBeastBCD(beast); - - if (!isIdValid(bcd)) - { - destroyObject(beast); - setBeastmasterPet(player, null); - return; - } - - storeBeast(bcd); - } - - - public static void killBeast(obj_id beast, obj_id killer) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return; - } - - obj_id bcd = getBeastBCD(beast); - - if (!isValidBCD(bcd)) - { - destroyObject(beast); - } - - utils.setScriptVar(beast, "recapTimer", getGameTime()); - - if (isIdValid(killer) && exists(killer)) - { - if (pet_lib.isPet(killer) || beast_lib.isBeast(killer)) - { - killer = getMaster(killer); - } - - utils.setScriptVar(beast, "killer", killer); - } - - blog("killBeast beast: "+ beast + " killer "+ killer); - - xp.cleanupCreditForKills(); - - dictionary dictIncap = new dictionary(); - int incapTimer = getGameTime(); - - utils.setScriptVar(beast, "incapTimer", incapTimer); - dictIncap.put("incapTimer", incapTimer); - - messageTo(beast, "handleBeastIncappedDecay", dictIncap, 120, false); - - deltadictionary dict = beast.getScriptVars(); - dict.put("pet.regenMultiplier", 0); - - if (isIdValid(killer) && !isPlayer(killer)) - { - obj_id master = getMaster(killer); - - if (!isIdValid(master) || !isPlayer(master)) - { - decrementBeastLoyalty(bcd, LOYALTY_DEATH_LOSS); - } - } - - stop(beast); - kill(beast); - - setBCDBeastHealth(bcd, 0); - setBCDBeastIsDead(bcd, true); - } - - - public static void incrementBeastExperience(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return; - } - - int experience = getBeastExperience(beast); - int previousExperience = experience; - obj_id bcd = getBeastBCD(beast); - - if (!isValidBCD(bcd)) - { - return; - } - - float happinessAdjustment = ((float)getBCDBeastHappiness(bcd) / 100.0f) + 1.0f; - - if (happinessAdjustment > 1.5f) - { - happinessAdjustment = 1.5f; - } - else if (happinessAdjustment < 0.5f) - { - happinessAdjustment = 0.5f; - } - - float percentageBonuses = happinessAdjustment; - - if (buff.hasBuff(beast, "bm_beast_steroid")) - { - percentageBonuses += 0.01f * utils.getIntScriptVar(beast, "beastBuff.beastXpBonusPercent"); - } - - obj_id master = getMaster(beast); - - if (isValidPlayer(master)) - { - int experienceGain = Math.round(100 * percentageBonuses); - - experienceGain += experienceGain * 0.01f * getEnhancedSkillStatisticModifierUncapped(master, "bm_xp_mod_boost"); - - experience += experienceGain; - - prose_package pp = prose.getPackage(xp.SID_FLYTEXT_XP, experience - previousExperience); - - showFlyTextPrivate(beast, master, pp, 2.5f, new color(180, 60, 240, 255)); - } - - setBeastExperience(beast, experience); - setBCDBeastExperience(bcd, experience); - } - - - public static void incrementBeastLevel(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return; - } - - int level = getLevel(beast) + 1; - - if (level == 75 && buff.hasBuff(beast, "bm_beast_steroid")) - { - buff.removeBuff(beast, "bm_beast_steroid"); - obj_id master = getMaster(beast); - sendSystemMessage(master, SID_BEAST_LEVEL_TOO_HIGH); - } - - if (level > 90) - { - return; - } - - obj_id bcd = getBeastBCD(beast); - - if (!isValidBCD(bcd)) - { - return; - } - - setBeastLevel(beast, level); - setBCDBeastLevel(bcd, level); - - playClientEffectObj(beast, "clienteffect/level_granted.cef", beast, null); - - initializeBeastStats(bcd, beast); - } - - - public static boolean canBeastLevelUp(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast)) - { - return false; - } - - int level = getBeastLevel(beast); - - obj_id master = getMaster(beast); - - if (!isValidPlayer(master) || level >= getLevel(master)) - { - return false; - } - - dictionary beastStatsDict = utils.dataTableGetRow(BEASTS_STATS, level - 1); - - if (beastStatsDict == null || beastStatsDict.size() <= 0) - { - blog("initializeBeastStats() missing entry in the "+ BEASTS_STATS + " table for level: "+ level + "."); - return false; - } - - int experience = (int)beastStatsDict.getInt("XP"); - - if (experience > 0 && getBeastExperience(beast) >= experience) - { - return true; - } - - return false; - } - - - public static void grantBeastExperience(obj_id beast) throws InterruptedException - { - if (!isValidBeast(beast) || isDead(beast)) - { - return; - } - - if (!getBeastCanLevel(beast)) - { - return; - } - - obj_id bcd = getBeastBCD(beast); - - incrementBeastLoyalty(bcd); - - int level = getBeastLevel(beast); - - if (level < 90) - { - incrementBeastExperience(beast); - } - - if (canBeastLevelUp(beast)) - { - incrementBeastLevel(beast); - } - } - - - public static float scaleDistanceByLevel(obj_id beast, float distance) throws InterruptedException - { - int level = getLevel(beast); - - distance += (level / 45); - - return distance; - } - - - public static void validateFollowTarget(obj_id beast, obj_id target) throws InterruptedException - { - if (!isIdValid(beast) || !isIdValid(target)) - { - return; - } - - obj_id master = getMaster(beast); - - if (!isValidPlayer(master)) - { - return; - } - - dictionary params = new dictionary(); - - if (utils.getBooleanScriptVar(beast, "ai.pet.staying")) - { - return; - } - - if (target != master && (stealth.hasServerCoverState(target) || stealth.hasInvisibleBuff(target))) - { - doStayCommand(beast, master); - doConfusedEmote(beast); - return; - } - - if (target != master && !ai_lib.isInCombat(beast)) - { - doFollowCommand(beast, master); - return; - } - - if (ai_lib.isInCombat(beast) && getBeastDefensive(beast)) - { - if (getLocomotion(beast) != LOCOMOTION_RUNNING) - {; - } - { - setMovementRun(beast); - } - - return; - } - - if (ai_lib.isInCombat(beast) && !getBeastDefensive(beast) && !utils.hasScriptVar(beast, "petIgnoreAttacks")) - { - if (getLocomotion(beast) != LOCOMOTION_RUNNING) - {; - } - { - setMovementRun(beast); - } - - return; - } - - int currentTime = getGameTime(); - int lastFollowTest = utils.getIntScriptVar(beast, "beast.lastFollowTest"); - - if (currentTime <= lastFollowTest) - { - return; - } - - utils.setScriptVar(beast, "beast.lastFollowTest", currentTime); - - if (target == master) - { - - params.put("target", master); - - if (getDistance(beast, master) >= 1.5f && getDistance(beast, master) < 5.0f) - { - if (getLocomotion(beast) == LOCOMOTION_RUNNING) - { - setMovementWalk(beast); - } - } - - else if (getDistance(beast, master) < 1.5f) - { - if (getLocomotion(beast) == LOCOMOTION_RUNNING) - { - setMovementWalk(beast); - } - - follow(beast, target, scaleDistanceByLevel(beast, 0.1f), scaleDistanceByLevel(beast, 0.5f)); - } - else - { - location offset = new location(); - - offset.x = -1.5f; - offset.z = -1; - - if (getLocomotion(beast) != LOCOMOTION_RUNNING && getDistance(beast, master) >= 5.0f) - {; - } - { - setMovementRun(beast); - } - - if (getDistance(beast, master) >= 5.0f && !canSee(beast, master)) - { - setLocation(beast, getLocation(master)); - } - - follow(beast, target, offset); - } - - messageTo(beast, "checkMovementSpeed", params, 1, false); - - return; - } - - return; - } - - - public static void doConfusedEmote(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast)) - { - return; - } - - showFlyText(beast, new string_id("npc_reaction/flytext", "alert"), 3.0f, colors.COPPER); - doAnimationAction(beast, "emt_stand_confused"); - } - - - public static void doStayCommand(obj_id beast, obj_id master) throws InterruptedException - { - if (!isIdValid(beast) || !isIdValid(master)) - { - return; - } - - setMovementWalk(beast); - - if (ai_lib.isInCombat(beast)) - { - utils.removeScriptVar(beast, "ai.combat.target"); - utils.setScriptVar(beast, "petIgnoreAttacks", getGameTime()); - stopCombat(beast); - } - - utils.setScriptVar(beast, "ai.pet.staying", true); - ai_lib.aiStopFollowing(beast); - - location myLocation = getLocation(beast); - - setHomeLocation(beast, myLocation); - - setMovementWalk(beast); - - doAnimationAction(beast, "vocalize"); - - ai_lib.setDefaultCalmBehavior(beast, ai_lib.BEHAVIOR_STOP); - } - - - public static void doFollowCommand(obj_id beast, obj_id master) throws InterruptedException - { - if (!isIdValid(beast) || !isIdValid(master)) - { - return; - } - - if (ai_lib.isInCombat(beast)) - { - utils.removeScriptVar(beast, "ai.combat.target"); - utils.setScriptVar(beast, "petIgnoreAttacks", getGameTime()); - stopCombat(beast); - } - - utils.removeScriptVar(beast, "ai.pet.staying"); - - if (hasObjVar(beast, "ai.wounded")) - { - removeObjVar(beast, "ai.wounded"); - } - - int myPosture = getPosture(beast); - - if (myPosture != POSTURE_UPRIGHT && myPosture != POSTURE_SITTING) - { - stop(beast); - removeObjVar(beast, "ai.combat.moveMode"); - queueCommand(beast, (-1465754503), beast, "", COMMAND_PRIORITY_FRONT); - } - - beastFollowTarget(beast, master); - } - - - public static void beastFollowTarget(obj_id beast, obj_id target) throws InterruptedException - { - - follow(beast, target, scaleDistanceByLevel(beast, 0.1f), scaleDistanceByLevel(beast, 0.2f)); - setMovementRun(beast); - } - - - public static void doAttackCommand(obj_id beast, obj_id master) throws InterruptedException - { - if (!isIdValid(master)) - { - return; - } - - utils.removeScriptVar(beast, "petIgnoreAttacks"); - - obj_id target = getIntendedTarget(master); - - if (isIdValid(target) == false || target == beast) - { - doConfusedEmote(beast); - return; - } - - if (!pvpCanAttack(beast, target)) - { - doConfusedEmote(beast); - return; - } - - if (!pvpCanAttack(master, target)) - { - doConfusedEmote(beast); - return; - } - - if (master.isLoaded()) - { - setHomeLocation(beast, getLocation(master)); - } - else if (beast.isLoaded()) - { - setHomeLocation(beast, getLocation(beast)); - } - - utils.removeScriptVar(beast, "ai.pet.staying"); - - chat.setBadMood(beast); - - if (!ai_lib.isInCombat(beast)) - { - startCombat(beast, target); - - setHate(beast, target, 0); - - utils.setScriptVar(beast, "ai.combat.target", target); - } - else - { - utils.setScriptVar(beast, "ai.combat.target", target); - - float maxHate = getMaxHate(beast); - - setHate(beast, target, maxHate + 5000); - } - } - - - public static void doTrickCommand(obj_id beast, int trickNumber) throws InterruptedException - { - int myPosture = getPosture(beast); - obj_id beastBCD = getBeastBCD (beast); - - obj_id master = getMaster(beast); - int state = getState(beast, STATE_SWIMMING); - - if (state == 1) - { - sendSystemMessage(master, SID_NO_TRICKS_WHILE_SWIMMING); - return; - } - - if (isIdValid (beastBCD)) - { - messageTo(beastBCD, "petDoingTrick", null, 1, false); - } - - if (myPosture == POSTURE_SITTING) - { - doAnimationAction(beast, "sit_trick_"+ trickNumber); - } - else - { - doAnimationAction(beast, "trick_"+ + trickNumber); - } - - return; - } - - - public static void setupHappinessLoyalty(obj_id beastBCD) throws InterruptedException - { - if (!isIdValid(beastBCD)) - { - return; - } - - if (!hasBCDBeastHappiness(beastBCD)) - { - setBCDBeastHappiness(beastBCD, 0); - - obj_id beast = getBCDBeastCalled(beastBCD); - - updateBeastStats(beastBCD, beast); - } - - if (!hasBCDBeastLoyalty(beastBCD)) - { - setBCDBeastLoyalty(beastBCD, 1.0f); - } - - if (!hasBCDBeastLoyaltyLevel(beastBCD)) - { - setBCDBeastLoyaltyLevel(beastBCD, 1); - } - - if (hasObjVar(beastBCD, PET_FAVORITES_OBJVAR)) - { - return; - } - - int[] beastHappiness = new int[LIKE_DISLIKE_MAX]; - - String[] favoriteFood = dataTableGetStringColumnNoDefaults(DATATABLE_BEAST_FAVORITES, DATATABLE_FOOD_COL); - String[] favoriteLocation = dataTableGetStringColumnNoDefaults(DATATABLE_BEAST_FAVORITES, DATATABLE_LOCATION_COL); - String[] favoriteActivity = dataTableGetStringColumnNoDefaults(DATATABLE_BEAST_FAVORITES, DATATABLE_ACTIVITY_COL); - - int foodNumberGood = rand(1, favoriteFood.length); - beastHappiness[0] = foodNumberGood; - - boolean goodNumberFood = false; - - while (!goodNumberFood) - { - testAbortScript(); - int foodNumberBad = rand(1, favoriteFood.length); - - if (beastHappiness[0] != foodNumberBad) - { - beastHappiness[1] = foodNumberBad; - goodNumberFood = true; - } - } - - int activityNumberGood = rand(1, favoriteActivity.length); - beastHappiness[2] = activityNumberGood; - - boolean goodNumberAct = false; - - while (!goodNumberAct) - { - testAbortScript(); - int activityNumberBad = rand(1, favoriteActivity.length); - - obj_id player = getBCDPlayer(beastBCD); - - if (hasObjVar(player, "qa_beast_hate")) - { - if (activityNumberGood == 1) - { - beastHappiness[2] = 2; - } - - activityNumberBad = 1; - } - - if (beastHappiness[2] != activityNumberBad) - { - beastHappiness[3] = activityNumberBad; - goodNumberAct = true; - } - } - - int locationNumberGood = rand(1, favoriteLocation.length); - beastHappiness[4] = locationNumberGood; - - boolean goodNumberLoc = false; - - while (!goodNumberLoc) - { - testAbortScript(); - int locationNumberBad = rand(1, favoriteLocation.length); - - if (beastHappiness[4] != locationNumberBad) - { - beastHappiness[5] = locationNumberBad; - goodNumberLoc = true; - } - } - - setObjVar(beastBCD, PET_FAVORITES_OBJVAR, beastHappiness); - } - - - public static void applyFoodEffect(obj_id food, obj_id beast, obj_id player) throws InterruptedException - { - obj_id beastBCD = getBeastBCD(beast); - String foodTemplate = utils.getTemplateFilenameNoPath(food); - int currentTime = getGameTime(); - int[] petFood = getBCDBeastFood(beastBCD); - - if (!hasObjVar(beastBCD, PET_FAVORITES_OBJVAR)) - { - LOG("beast", "Somehow this beast was created without having his favorites decided. Setting them now to avoid exceptions"); - setupHappinessLoyalty(beastBCD); - } - - int[] beastHappiness = getIntArrayObjVar(beastBCD, PET_FAVORITES_OBJVAR); - - int oldFood = petFood[PET_WHICH_FOOD]; - - dictionary params = new dictionary(); - params.put("beastId", beast); - int foodType = PET_NORMAL_FOOD; - - String datatableFavorite = dataTableGetString(DATATABLE_BEAST_FAVORITES, (beastHappiness[0] - 1), DATATABLE_FOOD_COL); - String datatableDislike = dataTableGetString(DATATABLE_BEAST_FAVORITES, (beastHappiness[1] - 1), DATATABLE_FOOD_COL); - - if (datatableFavorite.equals(foodTemplate)) - { - foodType = PET_FAVORITE_FOOD; - petFood[PET_WHICH_FOOD] = PET_FAVORITE_FOOD; - petFood[PET_TIME_SINCE_FEEDING] = currentTime; - sendSystemMessage(player, SID_FAVORITE_FOOD); - } - - else if (datatableDislike.equals(foodTemplate)) - { - foodType = PET_DISLIKE_FOOD; - petFood[PET_WHICH_FOOD] = PET_DISLIKE_FOOD; - petFood[PET_TIME_SINCE_FEEDING] = currentTime; - sendSystemMessage(player, SID_DISLIKE_FOOD); - } - - else - { - foodType = PET_NORMAL_FOOD; - petFood[PET_WHICH_FOOD] = PET_NORMAL_FOOD; - petFood[PET_TIME_SINCE_FEEDING] = currentTime; - sendSystemMessage(player, SID_NORMAL_FOOD); - } - - setBCDBeastFood(beastBCD, petFood); - - updateBeastHappiness(beastBCD, beast); - - updateBeastStats(beastBCD, beast); - - ai_lib.doAction(beast, "eat"); - - messageTo(beastBCD, "beastHungry", params, 3600, false); - } - - - public static void checkForFavoriteLocation(obj_id beastBCD) throws InterruptedException - { - if (!isValidBCD(beastBCD)) - { - return; - } - - if (!hasObjVar(beastBCD, PET_FAVORITES_OBJVAR)) - { - LOG("beast", "Somehow this beast was created without having his favorites decided. Setting them now to avoid exceptions"); - setupHappinessLoyalty(beastBCD); - } - - obj_id player = getBCDPlayer(beastBCD); - obj_id beast = getBCDBeastCalled (beastBCD); - - int[] beastHappiness = getIntArrayObjVar(beastBCD, PET_FAVORITES_OBJVAR); - String favoriteLocation = dataTableGetString(DATATABLE_BEAST_FAVORITES, (beastHappiness[4] -1), DATATABLE_LOCATION_COL); - String dislikeLocation = dataTableGetString(DATATABLE_BEAST_FAVORITES, (beastHappiness[5] -1), DATATABLE_LOCATION_COL); - String currentLocation = getCurrentSceneName(); - int locationType = PET_NORMAL_LOCATION; - - if (isDead(beast)) - { - return; - } - - if (currentLocation.indexOf(favoriteLocation) > -1 || favoriteLocation.equals(currentLocation)) - { - locationType = PET_FAVORITE_LOCATION; - sendSystemMessage(player, SID_FAVORITE_LOCATION); - } - - else if (instance.isInInstanceArea(player)) - { - String alternatesColumn = favoriteLocation + "Alternates"; - - if (dataTableHasColumn(DATATABLE_BEAST_FAVORITES, alternatesColumn)) - { - String areaName = locations.getBuildoutAreaName(player); - - if (areaName != null && areaName.length() > 0) - { - String[] alternateLocs = dataTableGetStringColumn(DATATABLE_BEAST_FAVORITES, alternatesColumn); - - if (alternateLocs != null && alternateLocs.length > 0) - { - for (int i = 0; i < alternateLocs.length; i++) - { - testAbortScript(); - String alternateLocation = alternateLocs[i]; - - if (alternateLocation.equals(areaName)) - { - locationType = PET_FAVORITE_LOCATION; - sendSystemMessage(player, SID_FAVORITE_LOCATION); - } - } - } - } - } - } - - else if (currentLocation.indexOf (dislikeLocation) > -1 || dislikeLocation.equals(currentLocation)) - { - locationType = PET_DISLIKE_LOCATION; - sendSystemMessage(player, SID_DISLIKE_LOCATION); - } - - else - { - locationType = PET_NORMAL_LOCATION; - } - - if (!utils.hasScriptVar(beastBCD, PET_LOCATION_SCRIPTVAR)) - { - utils.setScriptVar(beastBCD, PET_LOCATION_SCRIPTVAR, locationType); - } - - int currentTime = getGameTime(); - - if (!utils.hasScriptVar(beastBCD, PET_HAPPINESS_BLOCK_SCRIPTVAR)) - { - utils.setScriptVar(beastBCD, PET_HAPPINESS_BLOCK_SCRIPTVAR, currentTime); - } - - int timeStamp = utils.getIntScriptVar(beastBCD, PET_HAPPINESS_BLOCK_SCRIPTVAR); - - if ((currentTime - timeStamp) > 5) - { - int oldLocation = utils.getIntScriptVar(beastBCD, PET_LOCATION_SCRIPTVAR); - - utils.setScriptVar(beastBCD, PET_HAPPINESS_BLOCK_SCRIPTVAR, currentTime); - utils.setScriptVar(beastBCD, PET_LOCATION_SCRIPTVAR, locationType); - - updateBeastStats(beastBCD, beast); - } - - updateBeastHappiness(beastBCD, beast); - } - - - public static int getSingleSkillMaxTrainingPoints(obj_id pet) throws InterruptedException - { - int loyaltyLevel = getBeastLoyaltyLevel(pet); - int level = 0; - - if (isBeast(pet)) - { - level = getBeastLevel(pet); - } - else - { - level = getBCDBeastLevel(pet); - } - - return loyaltyLevel * level; - } - - - public static int getSingleSkillMaxTrainingPoints(obj_id bcd, int level) throws InterruptedException - { - int loyaltyLevel = getBCDBeastLoyaltyLevel(bcd); - - return loyaltyLevel * level; - } - - - public static int getMaxTrainingPoints(obj_id pet) throws InterruptedException - { - return getSingleSkillMaxTrainingPoints(pet) * 4; - } - - - public static int getAvailableTrainingPoints(obj_id pet) throws InterruptedException - { - return getAvailableTrainingPoints(pet, null); - } - - - public static int getAvailableTrainingPoints(obj_id pet, String passedAbility) throws InterruptedException - { - int spent = calculateTrainingPointsSpent(pet, passedAbility); - int maximum = getMaxTrainingPoints(pet); - - return maximum - spent; - } - - - public static boolean hasSufficientTrainingPoints(obj_id pet, String ability) throws InterruptedException - { - int available = getAvailableTrainingPoints(pet, ability); - return (getAbilityCost(ability) <= available); - } - - - public static boolean isValidForSingleSkillMaxCost(obj_id pet, String ability) throws InterruptedException - { - int singleSkillMax = getSingleSkillMaxTrainingPoints(pet); - return getAbilityCost(ability) <=singleSkillMax; - } - - - public static int getAbilityCost(String ability) throws InterruptedException - { - return dataTableGetInt(BEASTS_SPECIALS, ability, "training_cost"); - } - - - public static String[] getTrainedSkills(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd) || !exists(bcd)) - { - return null; - } - - if (isBeast(bcd)) - { - return getTrainedSkills(getBeastBCD(bcd)); - } - - String[] trainedSkills = - { - "empty","empty","empty","empty" - }; - - if (!hasObjVar(bcd, PET_TRAINED_SKILLS_LIST)) - { - return trainedSkills; - } - else - { - trainedSkills = getStringArrayObjVar(bcd, PET_TRAINED_SKILLS_LIST); - } - - trainedSkills = correctNullSkills(trainedSkills); - - return trainedSkills; - } - - - public static String[] getAutoRepeatAbilityList(obj_id bcd) throws InterruptedException - { - if (isBeast(bcd)) - { - return getAutoRepeatAbilityList(getBeastBCD(bcd)); - } - - String[] barData = getBeastmasterPetBarData(getBCDBeastCalled(bcd)); - - String[] abilityList = - { - barData[3], barData[4], barData[5], barData[6] - }; - - String[] repeatList = - { - "","","","" - }; - - if (hasObjVar(bcd, PET_AUTO_REPEAT_LIST)) - { - repeatList = getStringArrayObjVar(bcd, PET_AUTO_REPEAT_LIST); - } - - for (int i=0; i 0.0f) - { - continue; - } - - if (combat.canDrainCombatActionAttributes(beast, (int)abilityData.vigorCost) && abilityData.vigorCost > highestCost) - { - highestCost = abilityData.vigorCost; - bestAction = abilityList[i]; - } - - } - - return bestAction; - } - - - public static void setTrainedPetSkills(obj_id pet, String[] abilityList) throws InterruptedException - { - obj_id bcd = getBeastBCD(pet); - abilityList = correctNullSkills(abilityList); - setObjVar(bcd, PET_TRAINED_SKILLS_LIST, abilityList); - obj_id player = getMaster(pet); - setBeastmasterToggledPetCommands(player, abilityList); - updatePetAbilityList(bcd); - } - - - public static String[] correctNullSkills(String[] abilityList) throws InterruptedException - { - for (int i=0; i -1) - { - - } - else - { - - utils.addElement(abilityCrcList, newSkillCrc); - - if (notify) - { - sendCreatureAbilitySkillLearnSpam(player, newSkill); - } - } - - if (abilityCrcList != null) - { - castToIntArray = new int[abilityCrcList.size()]; - for (int _i = 0; _i < abilityCrcList.size(); ++_i) - { - castToIntArray[_i] = ((Integer)abilityCrcList.get(_i)).intValue(); - } - } - utils.setBatchObjVar(player, PLAYER_KNOWN_SKILLS_LIST, castToIntArray); - - return getKnownSkills(player); - } - - - public static boolean isLearnableBeastMasterSkill(String skillName) throws InterruptedException - { - int row = dataTableSearchColumnForString(skillName, "ability_name", BEASTS_SPECIALS); - - if (row == -1) - { - return false; - } - - int specialType = getBeastMasterSpecialType(skillName); - - return (specialType != ABILITY_INVALID && specialType != ABILITY_TYPE_INNATE); - } - - - public static int getBeastMasterSpecialType(String skillName) throws InterruptedException - { - int row = dataTableSearchColumnForString(skillName, "ability_name", BEASTS_SPECIALS); - - if (row == -1) - { - return ABILITY_INVALID; - } - - return dataTableGetInt(BEASTS_SPECIALS, row, "specialType"); - } - - - public static boolean hasBeastMasterSkill(obj_id player, String beastAbility) throws InterruptedException - { - if (isIdValid(player)) - { - if (beastAbility != null && !beastAbility.equals("")) - { - Vector abilityCrcList = getKnownSkillsCrc(player); - int newSkillCrc = getSkillCrcByName(beastAbility); - int[] castToIntArray = new int[0]; - if (abilityCrcList != null) - { - castToIntArray = new int[abilityCrcList.size()]; - for (int _i = 0; _i < abilityCrcList.size(); ++_i) - { - castToIntArray[_i] = ((Integer)abilityCrcList.get(_i)).intValue(); - } - } - - if (utils.getElementPositionInArray(castToIntArray, newSkillCrc) > -1) - { - return true; - } - } - } - return false; - } - - - public static void sendCreatureAbilitySkillLearnSpam(obj_id player, String newSkill) throws InterruptedException - { - sendSystemMessage(player, new string_id("beast", "ability_learn_new_skill")); - sendSystemMessage(player, new string_id("cmd_n", newSkill)); - } - - - public static String[] getKnownSkills(obj_id player) throws InterruptedException - { - Vector abilityCrc = getKnownSkillsCrc(player); - - if (abilityCrc == null || abilityCrc.size() == 0) - { - return null; - } - - String[] abilityString = new String[abilityCrc.size()]; - - for (int i = 0; i < abilityCrc.size(); i++) - { - testAbortScript(); - int row = dataTableSearchColumnForInt(((Integer)(abilityCrc.get(i))).intValue(), "abilityCrc", BEASTS_SPECIALS); - abilityString[i] = dataTableGetString(BEASTS_SPECIALS, row, "ability_name"); - } - - if (abilityString == null || abilityString.length == 0) - { - return null; - } - - Arrays.sort(abilityString); - - return abilityString; - } - - - public static Vector getKnownSkillsCrc(obj_id player) throws InterruptedException - { - if (!utils.hasIntBatchObjVar(player, PLAYER_KNOWN_SKILLS_LIST)) - { - return null; - } - - return utils.getResizeableIntBatchObjVar(player, PLAYER_KNOWN_SKILLS_LIST); - } - - - public static void trainPetAbility(obj_id pet, String abilityName) throws InterruptedException - { - if (!canLearnSkill(pet, abilityName)) - { - return; - } - - String[] trainedSkills = getTrainedSkills(pet); - - for (int i = 0; i < trainedSkills.length; i++) - { - testAbortScript(); - if (getSkillBeastmasterSkillComparison(abilityName, trainedSkills[i]) == SKILL_HIGHER || trainedSkills[i].equals("empty")) - { - trainedSkills[i] = abilityName; - break; - } - } - - setTrainedPetSkills(pet, trainedSkills); - sendPetTrainNotification(pet, abilityName); - } - - - public static void sendPetTrainNotification(obj_id pet, String abilityName) throws InterruptedException - { - obj_id master = getMaster(pet); - - prose_package pp = new prose_package(); - pp.stringId = new string_id("beast", "train_success_new_ability"); - pp.actor.set(new string_id("cmd_n", abilityName)); - sendSystemMessageProse(master, pp); - } - - - public static int getExpertiseStat(int baseStat, int expertiseMod, float nerfPercent) throws InterruptedException - { - float expertisePercent = (float)expertiseMod/100; - float baseStatFloat = (float)baseStat; - float expertiseStatFloat = baseStatFloat - (baseStatFloat * (nerfPercent - (nerfPercent * expertisePercent) ) ); - int expertiseStat = (int)expertiseStatFloat; - - return expertiseStat; - } - - - public static float getExpertiseSpeed(float baseStat, int expertiseMod) throws InterruptedException - { - float expertisePercent = (float)expertiseMod/100; - float expertiseSpeed = baseStat + (baseStat * (1.0f - expertisePercent) ); - - return expertiseSpeed; - } - - - public static boolean isPreparedToLearnCreatureAbility(obj_id player) throws InterruptedException - { - return buff.hasBuff(player, "bm_creature_knowledge"); - } - - - public static float getCreatureKnowledgeLevel(obj_id player) throws InterruptedException - { - int ck_skill = getEnhancedSkillStatisticModifier(player, "bm_creature_knowledge"); - int level = getLevel(player); - - float learningPotential = (((float)ck_skill + (float)level) / 10.0f); - - return learningPotential; - } - - - public static boolean makeAbilityLearnSkillCheck(obj_id player, String ability) throws InterruptedException - { - float learningPotential = getCreatureKnowledgeLevel(player); - int challengeRating = getDifficultyToLearnAbility(ability); - float beastLearnBonus = getBeastLearnBonus(player); - - boolean watchRoll = isGod(player) && hasObjVar(player, "viewLearnCreatureAbilityRoll"); - - if (challengeRating < 1) - { - return false; - } - - if (learningPotential < challengeRating) - { - if (watchRoll) - { - sendSystemMessageTestingOnly(player, "Ability("+ability+") challenge rating too high for user"); - } - - return false; - } - - if (learningPotential > challengeRating) - { - learningPotential += ((1.0f + (learningPotential - (float)challengeRating)) * 100.0f) + (beastLearnBonus * 10.0f); - } - - float roll_mod = (float)challengeRating * 1000.0f; - float skillGoal = roll_mod - learningPotential; - float learnRoll = rand(learningPotential, roll_mod) ; - boolean skillLearnResult = learnRoll > skillGoal; - - if (watchRoll) - { - sendSystemMessageTestingOnly(player, "Abiltiy: "+ability+", Random("+learningPotential+", "+roll_mod+") > ("+skillGoal+")"+ " = "+learnRoll+"("+skillLearnResult+")"+", "+beastLearnBonus*10.0f+" chance gained from pet."); - } - - return skillLearnResult; - } - - - public static int getDifficultyToLearnAbility(String ability) throws InterruptedException - { - return dataTableGetInt(BEASTS_SPECIALS, ability, "level_to_learn"); - } - - - public static boolean checkForSkillAcquisition(obj_id attacker, obj_id defender, String actionName) throws InterruptedException - { - - if (isBeast(defender)) - { - defender = getMaster(defender); - } - - if (!isIdValid(attacker) || !exists(attacker) || isPlayer(attacker) || isBeast(attacker) || pet_lib.isPet(attacker)) - { - return false; - } - - if (!isIdValid(defender) || !exists(defender) || !isPlayer(defender) || !isPreparedToLearnCreatureAbility(defender)) - { - return false; - } - - if (!isIdValid(getBeastOnPlayer(defender))) - { - return false; - } - - if (!isLearnableCreatureAbility(defender, actionName)) - { - return false; - } - - if (makeAbilityLearnSkillCheck(defender, actionName)) - { - playerLearnBeastMasterSkill(defender, actionName); - return true; - } - - return false; - } - - - public static boolean isLearnableCreatureAbility(obj_id player, String actionName) throws InterruptedException - { - dictionary actionData = dataTableGetRow(BEASTS_SPECIALS, actionName); - - if (actionData == null) - { - return false; - } - - if (actionData.getInt("level_to_learn") < 0) - { - return false; - } - - if (!isValidBeastSkillForCreature(getBeastOnPlayer(player), actionName)) - { - return false; - } - - return true; - } - - - public static void doBmProvokeCommand(obj_id self, obj_id target, int provokeLevel) throws InterruptedException - { - if (!isIdValid(target) || !exists(target) || isPlayer(target) || isBeast(target)) - { - return; - } - - obj_id[] enemies = getHateList(target); - - if (enemies == null || enemies.length == 0) - { - return; - } - - obj_id topHateTarget = getHateTarget(target); - - if (topHateTarget == self) - { - return; - } - - final int SKILL_LEVEL_CONST = 18; - final float HATE_RANGE = 0.4f; - final float HATE_FLOOR = 0.8f; - - float provokeResistance = getLevel(target) / SKILL_LEVEL_CONST; - float provokeRating = provokeLevel / provokeResistance; - - float hateThreashold = getHate(target, topHateTarget) * HATE_RANGE; - float hateFloor = hateThreashold * HATE_FLOOR; - - float distanceToFloor = hateFloor - getMaxHate(self); - - float modifiedHateRange = hateThreashold * provokeRating; - - float finalHateAdd = distanceToFloor + modifiedHateRange; - - finalHateAdd = finalHateAdd < 1 ? 1 : finalHateAdd; - - addHate(target, self, finalHateAdd); - } - - - public static void performingActivity(obj_id beastBCD, int activity) throws InterruptedException - { - obj_id player = getBCDPlayer(beastBCD); - - utils.setScriptVar(beastBCD, PET_ACTIVITY_SCRIPTVAR, activity); - - obj_id beast = getBCDBeastCalled(beastBCD); - - updateBeastHappiness(beastBCD, beast); - updateBeastStats(beastBCD, beast); - } - - - public static void verifyAndUpdateCalledBeastStats(obj_id player) throws InterruptedException - { - obj_id beast = getBeastOnPlayer(player); - - if (!isIdValid(beast) || !exists(beast)) - { - removeAttentionPenaltyDebuff(player); - return; - } - - obj_id BCD = getBeastBCD(beast); - - if (!isIdValid(BCD) || !exists(BCD)) - { - removeAttentionPenaltyDebuff(player); - return; - } - - initializeBeastStats(BCD, beast); - - return; - } - - - public static void removeAttentionPenaltyDebuff(obj_id player) throws InterruptedException - { - for (int i = 1; i < 6; i++) - { - testAbortScript(); - if (buff.hasBuff(player, ATTENTION_PENALTY_DEBUFF + i)) - { - buff.removeBuff(player, ATTENTION_PENALTY_DEBUFF + i); - } - } - - return; - } - - - public static int[] fillIncubationArray(obj_id egg, obj_id beastControlDevice) throws InterruptedException - { - int[] incubationBonuses = new int[ARRAY_BEAST_INCUBATION_STATS.length]; - - for (int i = 0; i < ARRAY_BEAST_INCUBATION_STATS.length; ++i) - { - testAbortScript(); - if (hasObjVar(egg, ARRAY_BEAST_INCUBATION_STATS[i])) - { - incubationBonuses[i] = getIntObjVar(egg, ARRAY_BEAST_INCUBATION_STATS[i]); - } - else - { - incubationBonuses[i] = 0; - } - } - - return incubationBonuses; - } - - - public static string_id convertHappinessString(obj_id beastBCD) throws InterruptedException - { - int currentHappiness = getBCDBeastHappiness(beastBCD); - string_id happiness = convertHappinessString (currentHappiness); - if (happiness == null) - { - LOG("beast", "This beast control device ("+ beastBCD + ") is somehow missing a happiness value. This should not be possible. Ask customer to relog"); - } - - return happiness; - } - - - public static string_id convertHappinessString(int currentHappiness) throws InterruptedException - { - if (currentHappiness < -20) - { - return SID_BEAST_FURIOUS; - } - - if (currentHappiness < -15) - { - return SID_BEAST_ANGRY; - } - - if (currentHappiness < -10) - { - return SID_BEAST_MISERABLE; - } - - if (currentHappiness < -5) - { - return SID_BEAST_UNHAPPY; - } - - if (currentHappiness < 0) - { - return SID_BEAST_ANNOYED; - } - - if (currentHappiness >= 20) - { - return SID_BEAST_ECSTATIC; - } - - if (currentHappiness >= 15) - { - return SID_BEAST_VERY_HAPPY; - } - - if (currentHappiness >= 10) - { - return SID_BEAST_HAPPY; - } - - if (currentHappiness >= 5) - { - return SID_BEAST_JOYOUS; - } - - if (currentHappiness >= 0) - { - return SID_BEAST_NORMAL; - } - else - { - return null; - } - } - - - public static void applyHappinessBuffIcon(obj_id beast) throws InterruptedException - { - obj_id beastBCD = getBeastBCD(beast); - - if (!isValidBCD(beastBCD)) - { - return; - } - - int currentHappiness = getBCDBeastHappiness(beastBCD); - - int oldBuff = buff.getBuffOnTargetFromGroup(beast, "bm_happiness_icon"); - - if (oldBuff != 0) - { - buff.removeBuff(beast, oldBuff); - } - - if (currentHappiness <= -20) - { - buff.applyBuff(beast, "bm_happiness_furious"); - return; - } - - if (currentHappiness <= -15) - { - buff.applyBuff(beast, "bm_happiness_angry"); - return; - } - - if (currentHappiness <= -10) - { - buff.applyBuff(beast, "bm_happiness_miserable"); - return; - } - - if (currentHappiness <= -5) - { - buff.applyBuff(beast, "bm_happiness_unhappy"); - return; - } - - if (currentHappiness < 0) - { - buff.applyBuff(beast, "bm_happiness_annoyed"); - return; - } - - if (currentHappiness >= 20) - { - buff.applyBuff(beast, "bm_happiness_ecstatic"); - return; - } - - if (currentHappiness >= 15) - { - buff.applyBuff(beast, "bm_happiness_very_happy"); - return; - } - - if (currentHappiness >= 10) - { - buff.applyBuff(beast, "bm_happiness_happy"); - return; - } - - if (currentHappiness >= 5) - { - buff.applyBuff(beast, "bm_happiness_joyous"); - return; - } - - if (currentHappiness >= 0) - { - buff.applyBuff(beast, "bm_happiness_content"); - return; - } - } - - - public static string_id convertLoyaltyString(obj_id beastBCD) throws InterruptedException - { - int currentLoyalty = getBCDBeastLoyaltyLevel(beastBCD); - string_id loyalty = convertLoyaltyString(currentLoyalty); - if (loyalty == null) - { - LOG("beast", "This beast control device ("+ beastBCD + ") is somehow missing its Loyalty level or it's a different number than 1 to 5. This should not be possible. Check value in obj var beastmood.beastLoyaltyLevel on the Beast Control Device"); - } - return loyalty; - } - - - public static string_id convertLoyaltyString(int currentLoyalty) throws InterruptedException - { - switch(currentLoyalty) - { - case 1: - return SID_BEAST_WILD; - case 2: - return SID_BEAST_DISOBEDIENT; - case 3: - return SID_BEAST_TRAINED; - case 4: - return SID_BEAST_LOYAL; - case 5: - return SID_BEAST_BFF; - default: - return null; - } - } - - - public static obj_id generateTypeThreeEnzyme(obj_id player, float enzymeValue) throws InterruptedException - { - return generateTypeThreeEnzyme(player, null, enzymeValue, enzymeValue, "none"); - } - - - public static obj_id generateTypeThreeEnzyme(obj_id player, float enzymePurity, float enzymeMutagen) throws InterruptedException - { - return generateTypeThreeEnzyme(player, null, enzymePurity, enzymeMutagen, "none"); - } - - - public static obj_id generateTypeThreeEnzyme(obj_id player, obj_id target, float enzymePurity, float enzymeMutagen, String trait) throws InterruptedException - { - if (!isIdValid(target)) - { - obj_id newEnzyme = createObjectInInventoryAllowOverload("object/tangible/loot/beast/enzyme_3.iff", player); - setObjVar(newEnzyme, "enzyme.enzyme_purity", enzymePurity); - setObjVar(newEnzyme, "enzyme.enzyme_mutagen", enzymeMutagen); - setObjVar(newEnzyme, "enzyme.trait", trait); - return newEnzyme; - } - - int skillMod = getEnhancedSkillStatisticModifierUncapped(player, "expertise_bm_genetic_engineering"); - float ge_mod = 1.0f + (skillMod / 1000.0f); - - float levelDifference = (float)getLevel(target) / (float)getLevel(player); - levelDifference = levelDifference > 1.0f ? 1.0f : levelDifference; - - float valuePerLevel = 0.02f; - - float levelAddedValue = (float)getLevel(target) * valuePerLevel; - - float randomFloor = levelAddedValue / 2.0f; - float randomCeiling = levelAddedValue * 2.1f; - - float eliteValueAdd = levelAddedValue * 0.7f; - float bossValueAdd = levelAddedValue * 1.3f; - - int difficultyClass = getIntObjVar(target, "difficultyClass"); - int seed = 0; - - switch (difficultyClass) - { - case 0: - seed = 1; - break; - case 1: - seed = 3; - randomCeiling += eliteValueAdd; - break; - case 2: - seed = 5; - randomCeiling += bossValueAdd; - break; - } - - float basePurity = distributedRand(randomFloor, randomCeiling, seed); - float baseMutagen = distributedRand(randomFloor, randomCeiling, seed); - - enzymePurity += basePurity; - enzymeMutagen += baseMutagen; - - enzymePurity *= ge_mod; - enzymeMutagen *= ge_mod; - - enzymePurity *= levelDifference; - enzymeMutagen *= levelDifference; - - addToExtractionList(player, target); - - obj_id newEnzyme = createObjectInInventoryAllowOverload("object/tangible/loot/beast/enzyme_3.iff", player); - setObjVar(newEnzyme, "enzyme.enzyme_purity", enzymePurity); - setObjVar(newEnzyme, "enzyme.enzyme_mutagen", enzymeMutagen); - setObjVar(newEnzyme, "enzyme.trait", trait); - - return newEnzyme; - } - - - public static int getEnzymeExtractionReturnCode(obj_id player, obj_id creatureCorpse) throws InterruptedException - { - if (!isBeastMaster(player)) - { - return ENZ_ERROR_NOT_BEAST_MASTER; - } - if (!isIdValid(creatureCorpse)) - { - return ENZ_ERROR_INVALID_TARGET; - } - - if (!ai_lib.isAiDead(creatureCorpse)) - { - return ENZ_ERROR_NOT_DEAD; - } - - if (!ai_lib.isMonster(creatureCorpse) || storyteller.isAnyNpc(creatureCorpse)) - { - return ENZ_ERROR_TARGET_NOT_MONSTER; - } - - if (beast_lib.isBeast(creatureCorpse) || pet_lib.isPet(creatureCorpse)) - { - return ENZ_ERROR_TARGET_IS_PET; - } - - Vector extractions = getExtractionList(creatureCorpse); - - int numExtractions = 0; - - if (extractions != null && extractions.size() > 0) - { - numExtractions = extractions.size(); - } - - if (numExtractions > 0 && extractions.contains(player)) - { - return ENZ_ERROR_ALREADY_HARVEST; - } - - if (numExtractions >= EXTRACTION_LIMIT) - { - return ENZ_ERROR_TOO_MANY_EXTRACTIONS; - } - - if (!corpse.hasLootPermissions(creatureCorpse, player)) - { - return ENZ_ERROR_NO_LOOT_PERMISSION; - } - - return -1; - } - - - public static Vector getExtractionList(obj_id corpse) throws InterruptedException - { - if (hasObjVar(corpse, EXTRACTION_LIST)) - { - return getResizeableObjIdArrayObjVar(corpse, EXTRACTION_LIST); - } - - Vector extractionList = new Vector(); - extractionList.setSize(0); - - return extractionList; - } - - - public static void addToExtractionList(obj_id player, obj_id corpse) throws InterruptedException - { - Vector extractionList = getExtractionList(corpse); - utils.addElement(extractionList, player); - - setObjVar(corpse, EXTRACTION_LIST, extractionList, resizeableArrayTypeobj_id); - } - - - public static float distributedRand(float min, float max, int level) throws InterruptedException - { - final int levelMin = 0; - final int levelMax = 10; - - boolean inverted = false; - float _min = min; - float _max = max; - - if (min > max) - { - inverted = true; - min = _max; - max = _min; - } - - float rank = (float)(level - levelMin) / (float)(levelMax - levelMin); - - float mid = min + ((max - min) * rank); - - if (mid < min) - { - max += (mid-min); - mid = min; - } - if (mid > max) - { - min += (mid-max); - mid = max; - } - - float minRand = rand(min, mid); - float maxRand = rand(mid, max); - - float randNum = rand(minRand, maxRand); - - if (inverted) - { - randNum = _min + (_max - randNum); - } - - return randNum; - } - - - public static String[] getBeastmasterPetBarData(obj_id pet) throws InterruptedException - { - return getBeastmasterPetBarData(getMaster(pet), pet); - } - - - public static String[] getBeastmasterPetBarData(obj_id player, obj_id pet) throws InterruptedException - { - - String[] barData = (String[])PET_BAR_DEFAULT_ARRAY.clone(); - - String[] knownSkills = getTrainedSkills(pet); - - int additionalAbilitySlot = 0; - additionalAbilitySlot = getSkillStatisticModifier(player, "expertise_bm_add_pet_bar"); - - if (hasCommand(player, BM_COMMAND_ATTACK)) - { - barData[0] = BM_COMMAND_ATTACK; - } - - if (hasCommand(player, BM_COMMAND_ATTACK) || getBeastMasterSpecialType(knownSkills[0]) == ABILITY_TYPE_NONCOMBAT) - { - barData[3] = knownSkills[0]; - } - - if (additionalAbilitySlot == 0) - { - return barData; - } - - for (int i=0; i < additionalAbilitySlot; i++) - { - testAbortScript(); - - if (additionalAbilitySlot > 3) - { - break; - } - barData[i + 4] = knownSkills[i + 1]; - } - return barData; - } - - - public static boolean isChargeAttack(String actionName) throws InterruptedException - { - if (actionName.startsWith("bm_charge") || actionName.startsWith("bm_trample")) - { - return true; - } - else - { - return false; - } - } - - - public static boolean setBCDBeastHueFromEgg(obj_id bcd, obj_id egg) throws InterruptedException - { - if (!isIdValid(bcd) || !exists(bcd) || !isIdValid(egg) || !exists(egg)) - { - return false; - } - - if (hasObjVar(egg, OBJVAR_BEAST_HUE)) - { - int beastHue = getIntObjVar(egg, OBJVAR_BEAST_HUE); - - setBCDBeastHuePrimary(bcd, "/private/index_color_1", beastHue); - return true; - } - - return false; - } - - - public static void setBCDBeastHuePrimary(obj_id bcd, String palette, int hueIndex) throws InterruptedException - { - LOG("barnStorage", "1 bcd: "+ bcd + " palette: "+ palette + " hueIndex: "+ hueIndex); - - if (!isIdValid(bcd) || !exists(bcd) || palette == null || palette.length() <= 0 || hueIndex < 0) - { - return; - } - - LOG("barnStorage", "2 bcd: "+ bcd + " palette: "+ palette + " hueIndex: "+ hueIndex); - - hue.setColor(bcd, palette, hueIndex); - setObjVar(bcd, OBJVAR_BEAST_HUE, hueIndex); - setObjVar(bcd, OBJVAR_BEAST_PALETTE, palette); - } - - - public static void setBeastHuePrimary(obj_id beast, String palette, int hueIndex) throws InterruptedException - { - obj_id bcd = getBeastBCD(beast); - - LOG("barnStorage", " setBeastHuePrimary bcd: "+ bcd + "beast: "+ beast + " palette: "+ palette + " hueIndex: "+ hueIndex); - - if (!isIdValid(bcd) || !exists(bcd) || palette == null || palette.length() <= 0 || hueIndex < 0) - { - return; - } - - LOG("barnStorage", "setBeastHuePrimary bcd: "+ bcd + " palette: "+ palette + " hueIndex: "+ hueIndex); - - setBCDBeastHuePrimary(bcd, palette, hueIndex); - - hue.setColor(beast, palette, hueIndex); - } - - - public static String getBCDPalettePrimary(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd) || !exists(bcd) || !hasObjVar(bcd, OBJVAR_BEAST_PALETTE)) - { - return ""; - } - - return getStringObjVar(bcd, OBJVAR_BEAST_PALETTE); - } - - - public static int getBCDHuePrimary(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd) || !exists(bcd) || !hasObjVar(bcd, OBJVAR_BEAST_HUE)) - { - return -1; - } - - return getIntObjVar(bcd, OBJVAR_BEAST_HUE); - } - - - public static String getBeastPalettePrimary(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return ""; - } - - obj_id bcd = getBeastBCD(beast); - - if (!isIdValid(bcd) || !exists(bcd)) - { - return ""; - } - - return getBCDPalettePrimary(bcd); - } - - - public static int getBeastHuePrimary(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return -1; - } - - obj_id bcd = getBeastBCD(beast); - - if (!isIdValid(bcd) || !exists(bcd)) - { - return -1; - } - - return getBCDHuePrimary(bcd); - } - - - public static void setBCDBeastHueSecondary(obj_id bcd, String palette, int hueIndex) throws InterruptedException - { - - if (!isIdValid(bcd) || !exists(bcd) || palette == null || palette.length() <= 0 || hueIndex < 0) - { - return; - } - - hue.setColor(bcd, palette, hueIndex); - setObjVar(bcd, OBJVAR_BEAST_HUE2, hueIndex); - setObjVar(bcd, OBJVAR_BEAST_PALETTE2, palette); - } - - - public static void setBeastHueSecondary(obj_id beast, String palette, int hueIndex) throws InterruptedException - { - obj_id bcd = getBeastBCD(beast); - - LOG("barnStorage", "setBeastHueSecondary bcd: "+ bcd + "beast: "+ beast + " palette: "+ palette + " hueIndex: "+ hueIndex); - - if (!isIdValid(bcd) || !exists(bcd) || palette == null || palette.length() <= 0 || hueIndex < 0) - { - return; - } - - LOG("barnStorage", "setBeastHueSecondary bcd: "+ bcd + " palette: "+ palette + " hueIndex: "+ hueIndex); - - setBCDBeastHueSecondary(bcd, palette, hueIndex); - - hue.setColor(beast, palette, hueIndex); - } - - - public static String getBCDPaletteSecondary(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd) || !exists(bcd) || !hasObjVar(bcd, OBJVAR_BEAST_PALETTE2)) - { - return ""; - } - - return getStringObjVar(bcd, OBJVAR_BEAST_PALETTE2); - } - - - public static int getBCDHueSecondary(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd) || !exists(bcd) || !hasObjVar(bcd, OBJVAR_BEAST_HUE2)) - { - return -1; - } - - return getIntObjVar(bcd, OBJVAR_BEAST_HUE2); - } - - - public static String getBeastPaletteSecondary(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return ""; - } - - obj_id bcd = getBeastBCD(beast); - - if (!isIdValid(bcd) || !exists(bcd)) - { - return ""; - } - - return getBCDPaletteSecondary(bcd); - } - - - public static int getBeastHueSecondary(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return -1; - } - - obj_id bcd = getBeastBCD(beast); - - if (!isIdValid(bcd) || !exists(bcd)) - { - return -1; - } - - return getBCDHueSecondary(bcd); - } - - - public static void setBCDBeastHueThird(obj_id bcd, String palette, int hueIndex) throws InterruptedException - { - - if (!isIdValid(bcd) || !exists(bcd) || palette == null || palette.length() <= 0 || hueIndex < 0) - { - return; - } - - hue.setColor(bcd, palette, hueIndex); - setObjVar(bcd, OBJVAR_BEAST_HUE3, hueIndex); - setObjVar(bcd, OBJVAR_BEAST_PALETTE3, palette); - } - - - public static void setBeastHueThird(obj_id beast, String palette, int hueIndex) throws InterruptedException - { - obj_id bcd = getBeastBCD(beast); - - if (!isIdValid(bcd) || !exists(bcd) || palette == null || palette.length() <= 0 || hueIndex < 0) - { - return; - } - - setBCDBeastHueThird(bcd, palette, hueIndex); - - hue.setColor(beast, palette, hueIndex); - } - - - public static String getBCDPaletteThird(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd) || !exists(bcd) || !hasObjVar(bcd, OBJVAR_BEAST_PALETTE3)) - { - return ""; - } - - return getStringObjVar(bcd, OBJVAR_BEAST_PALETTE3); - } - - - public static int getBCDHueThird(obj_id bcd) throws InterruptedException - { - if (!isIdValid(bcd) || !exists(bcd) || !hasObjVar(bcd, OBJVAR_BEAST_HUE3)) - { - return -1; - } - - return getIntObjVar(bcd, OBJVAR_BEAST_HUE3); - } - - - public static String getBeastPaletteThird(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return ""; - } - - obj_id bcd = getBeastBCD(beast); - - if (!isIdValid(bcd) || !exists(bcd)) - { - return ""; - } - - return getBCDPaletteThird(bcd); - } - - - public static int getBeastHueThird(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return -1; - } - - obj_id bcd = getBeastBCD(beast); - - if (!isIdValid(bcd) || !exists(bcd)) - { - return -1; - } - - return getBCDHueThird(bcd); - } - - - public static void clearBeastColor(obj_id beast) throws InterruptedException - { - obj_id bcd = getBeastBCD(beast); - - if (!isIdValid(bcd) || !exists(bcd)) - { - return; - } - - removeObjVar(bcd, OBJVAR_BEAST_HUE); - removeObjVar(bcd, OBJVAR_BEAST_HUE2); - removeObjVar(bcd, OBJVAR_BEAST_HUE3); - - removeObjVar(bcd, OBJVAR_BEAST_PALETTE); - removeObjVar(bcd, OBJVAR_BEAST_PALETTE2); - removeObjVar(bcd, OBJVAR_BEAST_PALETTE3); - - } - - - public static void initializeBeastColor(obj_id beast) throws InterruptedException - { - obj_id bcd = getBeastBCD(beast); - - if (!isIdValid(bcd) || !exists(bcd)) - { - return; - } - - int primaryHue = getBCDHuePrimary(bcd); - int secondaryHue = getBCDHueSecondary(bcd); - int thirdHue = getBCDHueThird(bcd); - - String primaryPalette = getBCDPalettePrimary(bcd); - String secondaryPalette = getBCDPaletteSecondary(bcd); - String thirdPalette = getBCDPaletteThird(bcd); - - if (primaryHue >= 0 && (primaryPalette == null || primaryPalette.length() <= 0)) - { - setBeastHuePrimary(beast, "/private/index_color_1", primaryHue); - return; - } - - setBeastHuePrimary(beast, primaryPalette, primaryHue); - setBeastHueSecondary(beast, secondaryPalette, secondaryHue); - setBeastHueThird(beast, thirdPalette, thirdHue); - } - - - public static boolean addInnateBeastBonuses(obj_id beast, String beastType) throws InterruptedException - { - int row = dataTableSearchColumnForString(beastType, "beastType", BEASTS_TABLE); - - if (row < 0) - { - return false; - } - - int intBonusGroup = dataTableGetInt(BEASTS_TABLE, row, "attribute_bonus_class"); - - row = dataTableSearchColumnForInt(intBonusGroup, "intNameClass", BEASTS_SPECIES_BONUS_TABLE); - - String strBonusGroup = dataTableGetString(BEASTS_SPECIES_BONUS_TABLE, row, "stringNameClass"); - - int columnNumber = dataTableFindColumnNumber(BEASTS_SPECIES_BONUS_TABLE, strBonusGroup); - - int incrementColumnNumber = columnNumber + 1; - - String[] attributesAffected = dataTableGetStringColumnNoDefaults(BEASTS_SPECIES_BONUS_TABLE, strBonusGroup); - - int[] incrementAmounts = dataTableGetIntColumnNoDefaults(BEASTS_SPECIES_BONUS_TABLE, incrementColumnNumber); - - if (attributesAffected.length != incrementAmounts.length) - { - return false; - } - - for (int i = 0; i < attributesAffected.length; ++i) - { - testAbortScript(); - String fullName = "beast."+attributesAffected[i]; - - for (int j = 0; j < ARRAY_BEAST_INCUBATION_STATS.length; ++j) - { - testAbortScript(); - - if (fullName.equals(ARRAY_BEAST_INCUBATION_STATS[j])) - { - float currentBonus = 0.0f; - - if (utils.hasScriptVar(beast, ARRAY_BEAST_INCUBATION_STATS[j])) - { - - currentBonus = utils.getFloatScriptVar(beast, ARRAY_BEAST_INCUBATION_STATS[j]); - } - - float newBonus = currentBonus + (float)incrementAmounts[i]; - utils.setScriptVar(beast, ARRAY_BEAST_INCUBATION_STATS[j], newBonus); - break; - } - } - } - - return true; - } - - - public static dictionary getBeastMasterExamineInfo(obj_id player, obj_id creature, String[] names, String[] attribs, int idx) throws InterruptedException - { - dictionary dict = new dictionary(); - dict.put("names", names); - dict.put("attribs", attribs); - dict.put("idx", idx); - - if (!buff.hasBuff(player, "bm_creature_knowledge") || !ai_lib.isMonster(creature) || !utils.hasScriptVar(player, "creature_knowledge.species")) - { - return dict; - } - - if (hasObjVar(creature, "bm_doNotShowExamineInfo")) - { - return dict; - } - - int species = utils.getIntScriptVar(player, "creature_knowledge.species"); - - if (species != getSpecies(creature)) - { - return dict; - } - - int ck_skill = getEnhancedSkillStatisticModifierUncapped(player, "bm_creature_knowledge"); - - String creatureName = getCreatureName(creature); - dictionary creatureDict = dataTableGetRow("datatables/mob/creatures.iff", creatureName); - - if (ck_skill > -1) - { - if (creatureDict.getString("hideType") != "none") - { - names[idx] = "creature_resource_hide"; - attribs[idx] = utils.packStringId(new string_id("obj_attr_n", creatureDict.getString("hideType"))); - idx++; - } - if (creatureDict.getString("meatType") != "none") - { - names[idx] = "creature_resource_meat"; - attribs[idx] = utils.packStringId(new string_id("obj_attr_n", creatureDict.getString("meatType"))); - idx++; - } - if (creatureDict.getString("boneType") != "none") - { - names[idx] = "creature_resource_bone"; - attribs[idx] = utils.packStringId(new string_id("obj_attr_n", creatureDict.getString("boneType"))); - idx++; - } - - } - - if (ck_skill > 0) - { - names[idx] = "aggro"; - attribs[idx] = ""+creatureDict.getFloat("aggressive"); - idx++; - - names[idx] = "assist_range"; - attribs[idx] = ""+creatureDict.getFloat("assist"); - idx++; - - names[idx] = "deathblow"; - boolean deathBlow = (creatureDict.getInt("death_blow") > 0); - attribs[idx] = deathBlow ? "True" : "False"; - idx++; - - } - - dictionary statDict = dataTableGetRow("datatables/mob/stat_balance.iff", creatureDict.getInt("BaseLevel")); - int difficultyClass = getIntObjVar(creature, "difficultyClass"); - String prefix = ""; - - switch(difficultyClass) - { - case 1: - prefix = "Elite_"; - break; - case 2: - prefix = "Boss_"; - break; - default: - break; - } - - if (ck_skill > 3) - { - float dps = statDict.getFloat(prefix+"damagePerSecond"); - float attackSpeed = creatureDict.getFloat("primary_weapon_speed"); - int minDamage = Math.round((dps * attackSpeed) *0.5f); - int maxDamage = Math.round((dps * attackSpeed) *1.5f); - - names[idx] = "damage_min"; - attribs[idx] = ""+minDamage; - idx++; - - names[idx] = "damage_max"; - attribs[idx] = ""+maxDamage; - idx++; - - names[idx] = "attackspeed"; - attribs[idx] = ""+attackSpeed; - idx++; - - names[idx] = "damage_dps"; - attribs[idx] = ""+dps; - idx++; - - } - - if (ck_skill > 5) - { - names[idx] = "armor_rating"; - attribs[idx] = ""+statDict.getInt(prefix+"Armor"); - idx++; - } - - if (ck_skill > 7) - { - String special_list = creatureDict.getString("primary_weapon_specials"); - - if (special_list != null && !special_list.equals("")) - { - Vector actionList = new Vector(); - actionList.setSize(0); - - for (int i = 1; i < 15; i++) - { - testAbortScript(); - String ability = dataTableGetString("datatables/ai/ai_combat_profiles.iff", special_list, "action"+i); - - if (ability != null && !ability.equals("") && actionList.indexOf(ability) == -1) - { - utils.addElement(actionList, ability); - } - - } - - if (actionList.size() > 0) - { - for (int k = 0; k < actionList.size(); k++) - { - testAbortScript(); - names[idx] = "special_attack"; - attribs[idx] = utils.packStringId(new string_id("cmd_n", ((String)(actionList.get(k))))); - idx++; - } - } - } - - } - - dict.put("names", names); - dict.put("attribs", attribs); - dict.put("idx", idx); - - return dict; - } - - - public static String getBestBeastMasterSkill(obj_id player, String skillName) throws InterruptedException - { - String[] knownSkills = getKnownSkills(player); - - if (knownSkills == null || knownSkills.length == 0) - { - return skillName; - } - - String passedSkillLine = getSkillLine(skillName); - int passedSkillRank = getSkillRank(skillName); - - String bestSkill = skillName; - - for (int i=0; i compareRank) - { - return SKILL_HIGHER; - } - - return SKILL_CANNOT_COMPARE; - } - - - public static String getSkillLine(String skillName) throws InterruptedException - { - return dataTableGetString(BEASTS_SPECIALS, skillName, "skill_line"); - } - - - public static int getSkillRank(String skillName) throws InterruptedException - { - return dataTableGetInt(BEASTS_SPECIALS, skillName, "skill_rank"); - } - - - public static void updateBeastStats(obj_id bcd, obj_id beast) throws InterruptedException - { - if (!isValidBCD(bcd) || !isValidBeast(beast)) - { - return; - } - - int level = getBCDBeastLevel(bcd); - - String beastType = getBCDBeastType(bcd); - - if (beastType == null || beastType.length() <= 0) - { - blog("updateBeastStats() bad beast type."); - return; - } - - dictionary beastDict = utils.dataTableGetRow(BEASTS_TABLE, beastType); - - if (beastDict == null || beastDict.size() <= 0) - { - blog("updateBeastStats() missing entry in the "+ BEASTS_TABLE + " table for beastType: "+ beastType + "."); - return; - } - - dictionary beastStatsDict = utils.dataTableGetRow(BEASTS_STATS, level - 1); - - if (beastStatsDict == null || beastStatsDict.size() <= 0) - { - blog("updateBeastStats() missing entry in the "+ BEASTS_STATS + " table for beastType: "+ beastType + "."); - return; - } - - int expertiseDamage = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_damage"); - - float incubationDamageBonus = utils.getFloatScriptVar(beast, OBJVAR_INCREASE_DPS); - - int intMinDamage = (int)beastStatsDict.getInt("MinDmg"); - int intMaxDamage = (int)beastStatsDict.getInt("MaxDmg"); - intMinDamage = getExpertiseStat(intMinDamage, expertiseDamage, .5f); - intMaxDamage = getExpertiseStat(intMaxDamage, expertiseDamage, .5f); - - float floatMinDamage = (float)intMinDamage * (1.0f + incubationDamageBonus / 100.0f); - float floatMaxDamage = (float)intMaxDamage * (1.0f + incubationDamageBonus / 100.0f); - intMinDamage = (int)floatMinDamage; - intMaxDamage = (int)floatMaxDamage; - - obj_id beastWeapon = getCurrentWeapon(beast); - - if (isIdValid(beastWeapon)) - { - setWeaponMaxDamage(beastWeapon, intMaxDamage); - setWeaponMinDamage(beastWeapon, intMinDamage); - weapons.setWeaponData(beastWeapon); - } - - obj_id defaultWeapon = getDefaultWeapon(beast); - - if (isIdValid(defaultWeapon)) - { - setWeaponMaxDamage(defaultWeapon, intMaxDamage); - setWeaponMinDamage(defaultWeapon, intMinDamage); - weapons.setWeaponData(defaultWeapon); - } - - updateBeastHappiness(bcd, beast); - } - - - public static void setBCDIncubationStats(obj_id bcd, obj_id egg) throws InterruptedException - { - int[] incubationBonuses = fillIncubationArray(egg, bcd); - setObjVar(bcd, OBJVAR_BEAST_INCUBATION_BONUSES, incubationBonuses); - - String parentTemplate = getStringObjVar(egg, OBJVAR_BEAST_PARENT); - setObjVar(bcd, OBJVAR_BEAST_PARENT, parentTemplate); - - String creatorName = getStringObjVar(egg, OBJVAR_BEAST_ENGINEER); - setObjVar(bcd, OBJVAR_BEAST_ENGINEER, creatorName); - } - - - public static void setBeastSkillBonuses(obj_id beast) throws InterruptedException - { - setBeastCritChance(beast); - setBeastStrikethroughChance(beast); - setBeastStrikethroughValue(beast); - setBeastBlockChance(beast); - setBeastBlockValue(beast); - setBeastDodgeChance(beast); - setBeastParryChance(beast); - setBeastEvadeChance(beast); - setBeastEvadeValue(beast); - } - - - public static boolean setBeastCritChance(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (!isBeast(beast)) - { - return false; - } - - float hi_mod = getBeastCustomMod(beast, MOD_HUNTERS_INSTINCT); - - float critChance = hi_mod * 0.8f; - - critChance += (utils.getFloatScriptVar(beast, OBJVAR_INCREASE_CRITICAL_HIT) / 10.0f); - - utils.setScriptVar(beast, OBJVAR_INCREASE_CRITICAL_HIT, critChance); - return true; - } - - - public static float getBeastCritChance(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float crit_mod = getBeastCritChance(beast); - - cun_mod = (cun_mod / 100.0f); - - return crit_mod * cun_mod; - } - - return utils.getFloatScriptVar(attacker, OBJVAR_INCREASE_CRITICAL_HIT); - } - - - public static boolean setBeastStrikethroughChance(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (!isBeast(beast)) - { - return false; - } - - float hi_mod = getBeastCustomMod(beast, MOD_HUNTERS_INSTINCT); - - float strikeChance = hi_mod * 0.8f; - - strikeChance += (utils.getFloatScriptVar(beast, OBJVAR_INCREASE_STRIKETHROUGH) / 10.0f); - - utils.setScriptVar(beast, OBJVAR_INCREASE_STRIKETHROUGH, strikeChance); - - return true; - } - - - public static float getBeastStrikethroughChance(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float strike_mod = getBeastStrikethroughChance(beast); - - cun_mod = (cun_mod / 100.0f); - - return strike_mod * cun_mod; - } - - return utils.getFloatScriptVar(attacker, OBJVAR_INCREASE_STRIKETHROUGH); - } - - - public static boolean setBeastStrikethroughValue(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (!isBeast(beast)) - { - return false; - } - - float int_mod = getBeastCustomMod(beast, MOD_INTELLIGENCE); - - float strikeValue = int_mod * 2.0f; - - strikeValue += utils.getFloatScriptVar(beast, OBJVAR_INCREASE_STRIKETHROUGH_RATING); - - utils.setScriptVar(beast, OBJVAR_INCREASE_STRIKETHROUGH_RATING, strikeValue); - return true; - } - - - public static float getBeastStrikethroughValue(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float strike_value = getBeastStrikethroughValue(beast); - - cun_mod = (cun_mod / 100.0f); - - return strike_value * cun_mod; - } - - return utils.getFloatScriptVar(attacker, OBJVAR_INCREASE_STRIKETHROUGH_RATING); - } - - - public static float getBeastHitChance(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float hit_mod = getBeastHitChance(beast); - - cun_mod = (cun_mod / 100.0f); - - return hit_mod * cun_mod; - } - - return (utils.getFloatScriptVar(attacker, OBJVAR_INCREASE_HIT_CHANCE) / 10.0f); - } - - - public static boolean setBeastBlockChance(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (!isBeast(beast)) - { - return false; - } - - float svl_mod = getBeastCustomMod(beast, MOD_SURVIVAL); - - float blockChance = svl_mod * 0.65f; - - blockChance += (utils.getFloatScriptVar(beast, OBJVAR_INCREASE_BLOCK_CHANCE) / 10.0f); - - utils.setScriptVar(beast, OBJVAR_INCREASE_BLOCK_CHANCE, blockChance); - return true; - } - - - public static float getBeastBlockChance(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float block_mod = getBeastBlockChance(beast); - - cun_mod = (cun_mod / 100.0f); - - return block_mod * cun_mod; - } - - return utils.getFloatScriptVar(attacker, OBJVAR_INCREASE_BLOCK_CHANCE); - } - - - public static boolean setBeastBlockValue(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (!isBeast(beast)) - { - return false; - } - - float int_mod = getBeastCustomMod(beast, MOD_INTELLIGENCE); - - float blockValue = int_mod * 25; - - blockValue += utils.getFloatScriptVar(beast, OBJVAR_INCREASE_BLOCK_VALUE); - - utils.setScriptVar(beast, OBJVAR_INCREASE_BLOCK_VALUE, blockValue); - return true; - } - - - public static int getBeastBlockValue(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0; - } - - float cun_mod = getBeastCunningRating(beast); - float block_value = (float)getBeastBlockValue(beast); - - cun_mod = (cun_mod / 100.0f); - - return Math.round(block_value * cun_mod); - } - - return (int)utils.getFloatScriptVar(attacker, OBJVAR_INCREASE_BLOCK_VALUE); - } - - - public static boolean setBeastDodgeChance(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (!isBeast(beast)) - { - return false; - } - - float svl_mod = getBeastCustomMod(beast, MOD_SURVIVAL); - - float dodgeChance = svl_mod * 0.65f; - - dodgeChance += (utils.getFloatScriptVar(beast, OBJVAR_INCREASE_DODGE) / 10.0f); - - utils.setScriptVar(beast, OBJVAR_INCREASE_DODGE, dodgeChance); - return true; - } - - - public static float getBeastDodgeChance(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float dodge_mod = getBeastDodgeChance(beast); - - cun_mod = (cun_mod / 100.0f); - - return dodge_mod * cun_mod; - } - - return utils.getFloatScriptVar(attacker, OBJVAR_INCREASE_DODGE); - } - - - public static boolean setBeastParryChance(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (!isBeast(beast)) - { - return false; - } - - float svl_mod = getBeastCustomMod(beast, MOD_SURVIVAL); - - float parryChance = svl_mod * 0.65f; - - parryChance += (utils.getFloatScriptVar(beast, OBJVAR_INCREASE_PARRY) / 10.0f); - - utils.setScriptVar(beast, OBJVAR_INCREASE_PARRY, parryChance); - return true; - } - - - public static float getBeastParryChance(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float parry_mod = getBeastParryChance(beast); - - cun_mod = (cun_mod / 100.0f); - - return parry_mod * cun_mod; - } - - return utils.getFloatScriptVar(attacker, OBJVAR_INCREASE_PARRY); - } - - - public static boolean setBeastEvadeChance(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (!isBeast(beast)) - { - return false; - } - - float svl_mod = getBeastCustomMod(beast, MOD_SURVIVAL); - float evadeChance = svl_mod * 0.65f; - evadeChance += (utils.getFloatScriptVar(beast, OBJVAR_INCREASE_EVASION) / 10.0f); - utils.setScriptVar(beast, OBJVAR_INCREASE_EVASION, evadeChance); - return true; - } - - - public static float getBeastEvadeChance(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float evade_mod = getBeastEvadeChance(beast); - - cun_mod = (cun_mod / 100.0f); - - return evade_mod * cun_mod; - } - - return utils.getFloatScriptVar(attacker, OBJVAR_INCREASE_EVASION); - } - - - public static boolean setBeastEvadeValue(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return false; - } - - if (!isBeast(beast)) - { - return false; - } - - float int_mod = getBeastCustomMod(beast, MOD_INTELLIGENCE); - - float evadeValue = int_mod * 2.0f; - - evadeValue += utils.getFloatScriptVar(beast, OBJVAR_INCREASE_EVASION_RATING); - - utils.setScriptVar(beast, OBJVAR_INCREASE_EVASION_RATING, evadeValue); - return true; - } - - - public static float getBeastEvadeValue(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float evade_mod = getBeastEvadeValue(beast); - - cun_mod = (cun_mod / 100.0f); - - return evade_mod * cun_mod; - } - - return utils.getFloatScriptVar(attacker, OBJVAR_INCREASE_EVASION_RATING); - } - - - public static float getBeastLearnBonus(obj_id beast) throws InterruptedException - { - if (isPlayer(beast)) - { - beast = getBeastOnPlayer(beast); - } - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float int_mod = getBeastCustomMod(beast, MOD_INTELLIGENCE); - - return (int_mod * 1.5f); - } - - - public static float getBeastCunningRating(obj_id beast) throws InterruptedException - { - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCustomMod(beast, MOD_CUNNING); - return (cun_mod * 3.0f); - } - - - public static float getBeastModDamageBonus(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float dam_mod = getBeastModDamageBonus(beast); - - cun_mod = (cun_mod / 100.0f); - - return dam_mod * cun_mod; - } - - float agg_mod = getBeastCustomMod(attacker, MOD_AGGRESSION); - return (float)agg_mod * 2.0f; - } - - - public static float getBeastModGlancingReduction(obj_id attacker) throws InterruptedException - { - if (isPlayer(attacker)) - { - obj_id beast = getBeastOnPlayer(attacker); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float dam_mod = getBeastModGlancingReduction(beast); - - cun_mod = (cun_mod / 100.0f); - - return dam_mod * cun_mod; - } - - float agg_mod = getBeastCustomMod(attacker, MOD_AGGRESSION); - return agg_mod * 1.0f; - } - - - public static float getBeastModDamageReduction(obj_id defender) throws InterruptedException - { - if (isPlayer(defender)) - { - obj_id beast = getBeastOnPlayer(defender); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float dam_mod = getBeastModDamageReduction(beast); - - cun_mod = (cun_mod / 100.0f); - - return dam_mod * cun_mod; - } - - float res_mod = getBeastCustomMod(defender, MOD_RESILIENCE); - return res_mod * 1.25f; - } - - - public static float getBeastModPunishingReduction(obj_id defender) throws InterruptedException - { - if (isPlayer(defender)) - { - obj_id beast = getBeastOnPlayer(defender); - - if (!isIdValid(beast) || !exists(beast)) - { - return 0.0f; - } - - float cun_mod = getBeastCunningRating(beast); - float dam_mod = getBeastModPunishingReduction(beast); - - cun_mod = (cun_mod / 100.0f); - - return dam_mod * cun_mod; - } - - float res_mod = getBeastCustomMod(defender, MOD_RESILIENCE); - - return res_mod * 1.0f; - } - - - public static float getBeastCustomMod(obj_id beast, int type) throws InterruptedException - { - if (isPlayer(beast)) - { - beast = getBeastOnPlayer(beast); - } - - if (!isIdValid(beast) || !exists(beast) || !isBeast(beast)) - { - return 0; - } - - switch(type) - { - case MOD_HUNTERS_INSTINCT: - return utils.getFloatScriptVar(beast, OBJVAR_SKILL_HUNTERS_INSTINCT); - - case MOD_AGGRESSION: - return utils.getFloatScriptVar(beast, OBJVAR_SKILL_AGGRESSION); - - case MOD_INTELLIGENCE: - return utils.getFloatScriptVar(beast, OBJVAR_SKILL_INTELLIGENCE); - - case MOD_CUNNING: - return utils.getFloatScriptVar(beast, OBJVAR_SKILL_CUNNING); - - case MOD_RESILIENCE: - return utils.getFloatScriptVar(beast, OBJVAR_SKILL_BEASTIAL_RESILIENCE); - - case MOD_SURVIVAL: - return utils.getFloatScriptVar(beast, OBJVAR_SKILL_SURVIVAL); - } - - return 0; - } - - - public static boolean setToggledCommands(obj_id player, obj_id bcd) throws InterruptedException - { - if (!isIdValid(player)) - { - - return false; - } - - if (!isIdValid(bcd)) - { - - return false; - } - String[] toggledAbilities = - { - "","","","","" - }; - String[] toggledAutoRepeats = getAutoRepeatAbilityList(bcd); - - for (int i = 0; i < toggledAutoRepeats.length; ++i) - { - testAbortScript(); - - toggledAbilities[i] = toggledAutoRepeats[i]; - - } - - if (getBCDBeastDefensive(bcd)) - { - toggledAbilities[4] = "toggleBeastDefensive"; - } - else - { - toggledAbilities[4] = "toggleBeastPassive"; - } - - setBeastmasterToggledPetCommands(player, toggledAbilities); - return true; - } - - - public static String getBeastTrait(obj_id player, obj_id target) throws InterruptedException - { - return "none"; - } - - - public static boolean canBeastGetLevelBasedXP(obj_id beast, obj_id npc) throws InterruptedException - { - int beastLevel = getBeastLevel(beast); - int mobLevel = getLevel(npc); - int levelDiff = mobLevel - beastLevel; - - if (levelDiff > 0) - { - beastLevel += levelDiff; - } - - int exp = xp.getLevelBasedXP(beastLevel); - - if (levelDiff < 0) - { - - float maxLevelDiff = 10f; - - if (beastLevel > 20) - { - maxLevelDiff += (int) ((beastLevel - 20) / 6); - } - - exp += (int) (exp * (levelDiff / maxLevelDiff)); - - if (exp < 1) - { - exp = 1; - } - } - - if (exp > 1) - { - return true; - } - else - { - return false; - } - } - - - public static int useBeastInjector(obj_id player, obj_id injector, obj_id beast, String beastFamily, String[] injectorFamilies, int mark) throws InterruptedException - { - if (!exists(player) || !exists(injector) || !exists(beast)) - { - return INJECTOR_RETURN_BAD_DATA; - } - - if (!isIdValid(player) || !isIdValid(injector) || !isIdValid(beast)) - { - return INJECTOR_RETURN_BAD_DATA; - } - - if (beastFamily == null || beastFamily.equals("")) - { - return INJECTOR_RETURN_BAD_DATA; - } - - if (injectorFamilies == null || injectorFamilies.length <= 0) - { - return INJECTOR_RETURN_BAD_DATA; - } - - int level = getBeastLevel(beast); - - if (level > STEROID_BUFF_LEVEL_CAP && mark <= 1) - { - sendSystemMessage(player, SID_BEAST_LEVEL_TOO_HIGH); - return INJECTOR_RETURN_WRONG_LEVEL; - } - - if (level <= STEROID_BUFF_LEVEL_CAP && mark == 2) - { - sendSystemMessage(player, SID_BEAST_LEVEL_TOO_LOW); - return INJECTOR_RETURN_WRONG_LEVEL; - } - - if (buff.hasBuff(beast, "bm_beast_steroid")) - { - return INJECTOR_RETURN_HAS_BUFF; - } - - if (injectorFamilies.length > 0) - { - for (int i = 0; i < injectorFamilies.length; ++i) - { - testAbortScript(); - - if (beastFamily.equals(injectorFamilies[i])) - { - - return INJECTOR_RETURN_SUCESS; - } - } - - return INJECTOR_RETURN_WRONG_FAMILY; - } - - return INJECTOR_RETURN_BAD_DATA; - } - - - public static boolean convertBcdIntoBeastItem(obj_id player, obj_id bcd) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - - obj_id beastDisplayBase = createObjectOverloaded(BEAST_DISPLAY_TEMPLATE, pInv); - - if (!isIdValid(beastDisplayBase)) - { - debugSpeakMsg(player, "Stuffed beast base is null."); - return false; - } - - setObjVar(beastDisplayBase, "no_dna_core", 1); - - String allObjVars = getPackedObjvars(bcd); - - setPackedObjvars(beastDisplayBase, allObjVars); - - setName(beastDisplayBase, getBCDBeastName(bcd)); - - attachScript(beastDisplayBase, "systems.beast.beast_display"); - - destroyObject(bcd); - - if (isIdValid(bcd)) - { - destroyObject(beastDisplayBase); - } - - return true; - } - - - public static obj_id createHolopetCubeFromEgg(obj_id player, obj_id egg) throws InterruptedException - { - int beastHashType = getIntObjVar(egg, beast_lib.OBJVAR_BEAST_TYPE); - String beastType = incubator.convertHashTypeToString(beastHashType); - if (beastType != null && beastType.length() > 0) - { - obj_id holepetCube = createBeastHolopet(player, egg, beastType); - if (isIdValid(holepetCube)) - { - if (rand(0,99) == 10) - { - setObjVar(holepetCube, HOLO_BEAST_RARE_COLOR_OBJVAR, HOLO_BEAST_TYPE3_QUALITY3); - } - return holepetCube; - } - } - - return obj_id.NULL_ID; - } - - - public static obj_id createBeastHolopet(obj_id player, obj_id source, String beastType) throws InterruptedException - { - obj_id playerInv = utils.getInventoryContainer(player); - if (isIdValid(playerInv)) - { - String cubeTemplate = "object/tangible/item/data_cube_holobeast.iff"; - obj_id holepetCube = createObjectOverloaded(cubeTemplate, playerInv); - if (isIdValid(holepetCube)) - { - - setObjVar(holepetCube, "holopet_type", beastType); - - if (hasObjVar(source, beast_lib.OBJVAR_BEAST_ENGINEER)) - { - String creatorName = getStringObjVar(source, beast_lib.OBJVAR_BEAST_ENGINEER); - if (creatorName != null && creatorName.length() > 0) - { - setObjVar(holepetCube, beast_lib.OBJVAR_BEAST_ENGINEER, creatorName); - } - } - - String holoBeastName = localizedHoloBeastBaseName( beastType); - - setName(holepetCube, holoBeastName + "Holo-beast Data Cube"); - attachScript(holepetCube, "item.publish_gift.holopet_data_cube"); - return holepetCube; - } - } - - return obj_id.NULL_ID; - } - - - public static String localizedHoloBeastBaseName(String beastType) throws InterruptedException - { - if (beastType.startsWith("bm_")) - { - beastType = beast_lib.stripBmFromType(beastType); - } - - String finalName = ""; - - string_id beastTypeSid = new string_id("monster_name", beastType); - String lowercaseName = localize(beastTypeSid); - if (lowercaseName != null && lowercaseName.length() > 0) - { - String[] splitName = split(lowercaseName, ' '); - for (int i = 0; i < splitName.length; i++) - { - testAbortScript(); - finalName += toUpper(splitName[i], 0) + " "; - } - } - return finalName; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/bounty_hunter.java b/sku.0/sys.server/compiled/game/script/library/bounty_hunter.java deleted file mode 100644 index 2c514b476..000000000 --- a/sku.0/sys.server/compiled/game/script/library/bounty_hunter.java +++ /dev/null @@ -1,782 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.ai.ai_combat; -import script.library.ai_lib; -import script.library.anims; -import script.library.chat; -import script.library.money; -import script.library.prose; -import script.library.utils; - - -public class bounty_hunter extends script.base_script -{ - public bounty_hunter() - { - } - public static final String[] LOW_PAYOUT_COMMS = - { - "pp_small_1", - "pp_small_2", - "pp_small_3", - "pp_small_4", - "pp_small_5" - }; - - public static final String[] MEDIUM_PAYOUT_COMMS = - { - "pp_normal_1", - "pp_normal_2", - "pp_normal_3", - "pp_normal_4", - "pp_normal_5", - }; - - public static final String[] HIGH_PAYOUT_COMMS = - { - "pp_big_1", - "pp_big_2", - "pp_big_3", - "pp_big_4", - "pp_big_5" - }; - - public static final String[] TALKING_COMM_CHARACTER = - { - "object/mobile/dressed_tatooine_jabba_thug.iff", - "object/mobile/dressed_tatooine_jabba_thief.iff", - "object/mobile/dressed_tatooine_jabba_henchman.iff", - "object/mobile/dressed_tatooine_jabba_enforcer.iff", - "object/mobile/ephant_mon.iff", - "object/mobile/dressed_tatooine_jabba_assassin.iff" - }; - - public static final int BOUNTY_PAYOUT_AMOUNT_MINIMUM = 50; - - public static final int BOUNTY_PAYOUT_AMOUNT_MAXIMUM = 2000; - - public static final boolean BOUNTY_DO_FREQUENCY_ADJUSTER = false; - - public static final int BOUNTY_FREQUENCY = 60; - - public static final float BOUNTY_PAYOUT_ADJUSTER = 0f; - - public static final float BOUNTY_COLLECT_TIME_LIMIT = 600.0f; - - public static final boolean BOUNTY_DO_LEVEL_ADJUSTER = true; - - public static final int BOUNTY_FLOOD_CONTROL_DELAY = 60; - - public static final int BOUNTY_MISSION_TIME_LIMIT = 259200; - public static final int MAX_BOUNTY = 2000000000; - public static final int MAX_BOUNTY_SET = 1000000; - public static final int MIN_BOUNTY_SET = 20000; - - public static final String STF = "bounty_hunter"; - public static final string_id PROSE_NO_BOUNTY_MINUTE = new string_id(STF, "no_bounties_while"); - public static final string_id PROSE_NO_BOUNTY_SECONDS = new string_id(STF, "no_bounties_soon"); - public static final string_id PROSE_NO_BOUNTY = new string_id(STF, "prose_no_bounty"); - public static final string_id NO_BOUNTY_TARGET = new string_id(STF, "no_bounty_target"); - public static final string_id NO_BOUNTY_TARGET_ALREADY = new string_id(STF, "no_bounty_target_already"); - public static final string_id NO_BOUNTY_PLAYER = new string_id(STF, "no_bounty_player"); - public static final string_id BOUNTY_ALREADY = new string_id(STF, "bounty_already_issued"); - public static final string_id STF_NO_BOUNTIES = new string_id(STF, "flood_control"); - public static final string_id ALREADY_HAVE_TARGET = new string_id(STF, "already_have_target"); - public static final string_id ALREADY_BEING_HUNTED = new string_id(STF, "already_being_hunted"); - public static final string_id TARGET_COLLECTING_BOUNTY = new string_id(STF, "target_collecting_bounty"); - public static final string_id BOUNTY_FAILED_HUNTER = new string_id(STF, "bounty_failed_hunter"); - public static final string_id BOUNTY_FAILED_TARGET = new string_id(STF, "bounty_failed_target"); - public static final string_id BOUNTY_SUCCESS_HUNTER = new string_id(STF, "bounty_success_hunter"); - public static final string_id BOUNTY_SUCCESS_TARGET = new string_id(STF, "bounty_success_target"); - - public static final boolean CONST_FLAG_DO_LOGGING = true; - public static final int DROID_PROBOT = 1; - public static final int DROID_SEEKER = 2; - public static final int DROID_TRACK_TARGET = 1; - public static final int DROID_FIND_TARGET = 2; - - - public static void debugLogging(String section, String message) throws InterruptedException - { - if (CONST_FLAG_DO_LOGGING) - { - LOG("debug/bounty_hunter.scriptlib/"+section, message); - } - } - - - public static boolean isSpammingBountyCheck(obj_id player, boolean sayProse) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (utils.hasScriptVar(player,"bountyCheckFloodControl")) - { - int storedTime = utils.getIntScriptVar(player,"bountyCheckFloodControl"); - int currentTime = getGameTime(); - - if (storedTime > currentTime) - { - int timeDelta = storedTime - currentTime; - String timeScale = "seconds"; - - if (sayProse) - { - if (timeDelta/60>1) - { - timeDelta = (int)timeDelta/60; - timeScale = "minutes"; - String talkingCharacter = TALKING_COMM_CHARACTER[(rand(0,TALKING_COMM_CHARACTER.length-1))]; - prose_package pp = new prose_package (); - pp.stringId = PROSE_NO_BOUNTY_MINUTE; - pp.digitInteger = timeDelta; - commPlayer(player, player, pp, talkingCharacter); - } - else - { - sendSystemMessage(player, PROSE_NO_BOUNTY_SECONDS); - } - } - - return true; - } - } - - return false; - } - - - public static boolean canCheckForBounty(obj_id player, obj_id target) throws InterruptedException - { - if (isSpammingBountyCheck(player, true)) - { - return false; - } - - if (!isIdValid(target)) - { - - debugLogging("//// canCheckForBounty: ", "////>>>> target invalid"); - return false; - } - - if (target == player) - { - - debugLogging("//// canCheckForBounty: ", "////>>>> target is yourself"); - return false; - } - - if (isDead(target) || isIncapacitated(target)) - { - - debugLogging("//// canCheckForBounty: ", "////>>>> target is is dead, or incapped, or not an npc"); - return false; - } - - obj_id container = getContainedBy(target); - if (isPlayer(container)) - { - - debugLogging("//// canCheckForBounty: ", "////>>>> target is is in a container"); - return false; - } - - if (utils.hasScriptVar(target,"noBountyCheck")) - { - sendSystemMessage(player, NO_BOUNTY_TARGET); - - debugLogging("//// canCheckForBounty: ", "////>>>> target has already been checked for bounty"); - return false; - } - - if (isPlayer(target)) - { - - sendSystemMessage(player, NO_BOUNTY_PLAYER); - debugLogging("//// canCheckForBounty: ", "////>>>> not an npc... !isNpc"); - return false; - } - else - { - if (!ai_lib.isNpc(target)) - { - sendSystemMessage(player, NO_BOUNTY_TARGET); - debugLogging("//// canCheckForBounty: ", "////>>>> not an npc... !isNpc"); - return false; - } - - if (!pvpCanAttack(player, target)) - { - sendSystemMessage(player, NO_BOUNTY_TARGET); - debugLogging("//// canCheckForBounty: ", "////>>>> ou can't attack that... !pvpCanAttack"); - - return false; - } - - if (utils.hasScriptVar(target,"bountyCheck")) - { - sendSystemMessage(player, BOUNTY_ALREADY); - - debugLogging("//// canCheckForBounty: ", "////>>>> target already has a bounty"); - return false; - } - - int playerLevel = getLevel(player); - if (playerLevel - 10 > 0) - { - if (playerLevel-10>getLevel(target)) - { - - debugLogging("//// canCheckForBounty: ", "////>>>> target is too easy to give you a bounty on"); - return false; - } - } - } - - return true; - } - - - public static boolean checkForPresenceOfBounty(obj_id player) throws InterruptedException - { - return checkForPresenceOfBounty(player, obj_id.NULL_ID); - } - - - public static boolean checkForPresenceOfBounty(obj_id player, obj_id target) throws InterruptedException - { - debugLogging("//// checkForPresenceOfBounty: ", "////>>>> entered"); - - if (isIdValid(target) && isPlayer(target)) - { - - } - else - { - float likelyhoodMod = 0f; - if (BOUNTY_DO_FREQUENCY_ADJUSTER) - { - debugLogging("//// checkForPresenceOfBounty: ", "////>>>> doing frequency adjuster"); - - if (!utils.hasScriptVar(player,"bountyCheckFloodControl")) - { - likelyhoodMod = 50.0f; - } - else - { - int lastBountyDelay = utils.getIntScriptVar(player,"bountyCheckFloodControl"); - likelyhoodMod = (lastBountyDelay -getGameTime()) / BOUNTY_FLOOD_CONTROL_DELAY; - if (likelyhoodMod > 100.0f) - { - likelyhoodMod = 100.0f; - } - } - likelyhoodMod /= 100f; - debugLogging("//// checkForPresenceOfBounty: ", "////>>>> likelyhoodMod ="+likelyhoodMod); - } - int bountyTargetNumber = (int)((BOUNTY_FREQUENCY*likelyhoodMod)+BOUNTY_FREQUENCY); - if (bountyTargetNumber > 99) - { - bountyTargetNumber = 99; - } - - if (bountyTargetNumber > rand(1,100)) - { - return true; - } - - } - - sendSystemMessage(player, NO_BOUNTY_TARGET); - - return false; - } - - - public static int figureOutBountyAmount(obj_id player, obj_id target) throws InterruptedException - { - - int amount = BOUNTY_PAYOUT_AMOUNT_MINIMUM; - - amount = (int) (rand(BOUNTY_PAYOUT_AMOUNT_MINIMUM,BOUNTY_PAYOUT_AMOUNT_MAXIMUM/2)); - - float bountyMod = 1.0f; - if (BOUNTY_DO_LEVEL_ADJUSTER) - { - int playerLevel = getLevel(player); - int bountyLevel = getLevel(target); - if (bountyLevel == playerLevel) - { - bountyMod = 0.0f; - } - else if (bountyLevel > playerLevel+10) - { - bountyMod = 0.50f; - } - else if (bountyLevel > playerLevel+5) - { - bountyMod = 0.25f; - } - else if (bountyLevel > playerLevel) - { - bountyMod = 0.15f; - } - else if (bountyLevel < playerLevel-6) - { - bountyMod = -0.75f; - } - else if (bountyLevel < playerLevel-2) - { - bountyMod = -0.5f; - } - else if (bountyLevel < playerLevel) - { - bountyMod = -0.25f; - } - } - - amount = (int)((amount*bountyMod)+amount); - - if (BOUNTY_PAYOUT_ADJUSTER > 0f) - { - amount = (int)((amount*BOUNTY_PAYOUT_ADJUSTER)+amount); - } - - if (amount < BOUNTY_PAYOUT_AMOUNT_MINIMUM) - { - amount = BOUNTY_PAYOUT_AMOUNT_MINIMUM; - } - else if (amount > BOUNTY_PAYOUT_AMOUNT_MAXIMUM) - { - amount = BOUNTY_PAYOUT_AMOUNT_MAXIMUM; - } - - return amount; - } - - - public static boolean initiatePlayerBountyCollection(obj_id player, obj_id target, int amount) throws InterruptedException - { - - return true; - } - - - public static boolean offerCommandCheckBounty(obj_id player, obj_id target, int amount) throws InterruptedException - { - String prosePackage = "pp_normal_1"; - String talkingCharacter = TALKING_COMM_CHARACTER[(rand(0,TALKING_COMM_CHARACTER.length-1))]; - - int currentPayoutRange = BOUNTY_PAYOUT_AMOUNT_MAXIMUM - BOUNTY_PAYOUT_AMOUNT_MINIMUM; - int lowPayout = (currentPayoutRange/3)+BOUNTY_PAYOUT_AMOUNT_MINIMUM; - int medPayout = ((currentPayoutRange/3)*2)+BOUNTY_PAYOUT_AMOUNT_MINIMUM; - - if (amount < lowPayout) - { - prosePackage = LOW_PAYOUT_COMMS[(rand(0,LOW_PAYOUT_COMMS.length-1))]; - - } - else if (amount < medPayout) - { - prosePackage = MEDIUM_PAYOUT_COMMS[(rand(0,MEDIUM_PAYOUT_COMMS.length-1))]; - talkingCharacter = "object/mobile/bib_fortuna.iff"; - - } - else - { - prosePackage = HIGH_PAYOUT_COMMS[(rand(0,HIGH_PAYOUT_COMMS.length-1))]; - talkingCharacter = "object/mobile/jabba_the_hutt.iff"; - - } - - prose_package pp = new prose_package (); - pp.stringId = new string_id ("bounty_hunter", prosePackage); - pp.target.set (target); - pp.digitInteger = amount; - - commPlayer(player, player, pp, talkingCharacter); - - utils.setScriptVar(player,"bountyCheckFloodControl",getGameTime()+BOUNTY_FLOOD_CONTROL_DELAY); - - utils.setScriptVar(target,"bountyCheck",1); - utils.setScriptVar(player,"currentBounty",target); - utils.setScriptVar(player,"currentBountyValue",amount); - - return true; - } - - - public static void awardBounty(obj_id player, String creatureName, int amount) throws InterruptedException - { - obj_id storedTarget = utils.getObjIdScriptVar(player,"currentBounty"); - - dictionary params = new dictionary(); - params.put("amount",amount); - params.put("creatureName", getEncodedName(storedTarget)); - money.systemPayout(money.ACCT_BOUNTY_CHECK, player, amount, "handleAwardedBountyCheck", params); - - } - - - public static void showSetBountySUI(obj_id player, obj_id killer) throws InterruptedException - { - String prompt = "@bounty_hunter:setbounty_prompt1 "; - prompt += getName(killer) + "? "; - prompt += "@bounty_hunter:setbounty_prompt2"; - prompt += " "+ getTotalMoney(player); - - String title = "@bounty_hunter:setbounty_title"; - - int pid = createSUIPage(sui.SUI_INPUTBOX, player, player, "handleSetBounty"); - - sui.setAutosaveProperty(pid, false); - sui.setSizeProperty(pid, 300, 325); - sui.setLocationProperty(pid, 400, 200); - - setSUIProperty(pid, sui.INPUTBOX_PROMPT, sui.PROP_TEXT, prompt); - setSUIProperty(pid, sui.INPUTBOX_TITLE, sui.PROP_TEXT, title); - - sui.inputboxButtonSetup(pid, sui.OK_CANCEL); - sui.inputboxStyleSetup(pid, sui.INPUT_NORMAL); - - setSUIProperty(pid, sui.INPUTBOX_INPUT, "MaxLength", "20"); - setSUIProperty(pid, sui.INPUTBOX_COMBO, "MaxLength", "20"); - - subscribeToSUIProperty(pid, sui.INPUTBOX_INPUT, sui.PROP_LOCALTEXT); - subscribeToSUIProperty(pid, sui.INPUTBOX_COMBO, sui.PROP_SELECTEDTEXT); - - showSUIPage(pid); - - utils.setScriptVar(player, "setbounty.killer", killer); - } - - - public static void endBountySession(obj_id hunter, obj_id target, boolean hunterWon) throws InterruptedException - { - - } - - - public static void winBountyMission(obj_id hunter, obj_id target) throws InterruptedException - { - int bountyValue = 0; - - if (hasObjVar(target, "bounty.amount")) - { - bountyValue = getIntObjVar(target, "bounty.amount"); - } - - dictionary d = new dictionary(); - d.put("target", target); - d.put("bounty", bountyValue); - - money.systemPayout(money.ACCT_BOUNTY, hunter, bountyValue, "handleAwardedPlayerBounty", d); - - float factionAdj = getBountyFactionPointAdjustment(hunter, target); - if (factionAdj != 0.0f) - { - factions.addFactionStanding(hunter, factions.getFactionNameByHashCode(pvpGetAlignedFaction(hunter)), factionAdj); - } - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("bounty_hunter", "bounty_success_hunter")); - pp = prose.setTT(pp, target); - pp = prose.setDI(pp, bountyValue); - - sendSystemMessageProse(hunter, pp); - - pp = prose.setStringId(pp, new string_id("bounty_hunter", "bounty_success_target")); - pp = prose.setTT(pp, hunter); - - sendSystemMessageProse(target, pp); - - obj_id[] hunters = getJediBounties(target); - - if (hunters != null && hunters.length > 0) - { - for (int i = 0; i < hunters.length; i++) - { - testAbortScript(); - if (hunters[i] != hunter) - { - messageTo(hunters[i], "handleBountyMissionIncomplete", d, 0.0f, true); - } - } - } - - obj_id mission = getBountyMission(hunter); - - if (isIdValid(mission)) - { - endMission(mission); - } - - removeObjVar(target, "bounty"); - setJediBountyValue(target, 0); - - removeAllJediBounties(target); - } - - - public static void loseBountyMission(obj_id hunter, obj_id target) throws InterruptedException - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("bounty_hunter", "bounty_failed_hunter")); - pp = prose.setTT(pp, target); - - sendSystemMessageProse(hunter, pp); - - pp = prose.setStringId(pp, new string_id("bounty_hunter", "bounty_failed_target")); - pp = prose.setTT(pp, hunter); - - sendSystemMessageProse(target, pp); - - obj_id mission = getBountyMission(hunter); - - if (isIdValid(mission)) - { - endMission(mission); - } - - removeJediBounty(target, hunter); - - CustomerServiceLog("bounty", "%TU was defeated by %TT and failed to collect the bounty on %PT head", hunter, target); - } - - - public static obj_id getBountyMission(obj_id player) throws InterruptedException - { - return getBountyMission(player, obj_id.NULL_ID); - } - - - public static obj_id getBountyMission(obj_id player, obj_id target) throws InterruptedException - { - obj_id lastMissionId = null; - - if (isIdValid(player)) - { - obj_id[] missionList = getMissionObjects(player); - - if (missionList != null) - { - for (int i = 0; i < missionList.length; i++) - { - testAbortScript(); - String type = getMissionType(missionList[i]); - - if (type.equals("bounty")) - { - if (isIdValid(target)) - { - if (hasObjVar(missionList[i], "objTarget")) - { - obj_id missionTarget = getObjIdObjVar(missionList[i], "objTarget"); - - if (missionTarget == target) - { - return missionList[i]; - } - } - } - else - { - lastMissionId = missionList[i]; - } - } - } - } - } - - return lastMissionId; - } - - - public static boolean hasMaxBountyMissionsOnTarget(obj_id target) throws InterruptedException - { - obj_id[] hunters = getJediBounties(target); - - if (hunters == null || hunters.length == 0) - { - return false; - } - - int numHunters = hunters.length; - - String Smax = getConfigSetting("GameServer", "maxJediBounties"); - int maxHunters = 3; - - if (Smax != null && !Smax.equals("")) - { - Integer Imax= Integer.getInteger(Smax); - if (Imax != null) - { - maxHunters = Imax.intValue(); - } - } - - if (numHunters >= maxHunters) - { - return true; - } - - return false; - } - - - public static float getBountyFactionPointAdjustment(obj_id hunter, obj_id target) throws InterruptedException - { - float pvpRating = (float)pvp.getCurrentPvPRating(target); - float points = 0.0f; - - if ((pvpGetAlignedFaction(hunter) != 0) && (pvpGetAlignedFaction(hunter) == pvpGetAlignedFaction(target))) - { - points = pvpRating / 4.0f; - points *= -1.0f; - } - else if (factions.pvpAreFactionsOpposed(pvpGetAlignedFaction(hunter), pvpGetAlignedFaction(target))) - { - points = pvpRating / 10.0f; - } - - return points; - } - - - public static void probeDroidTrackTarget(obj_id player, obj_id droid) throws InterruptedException - { - int intDroidType = getIntObjVar(droid, "intDroidType"); - obj_id objBountyMission = getBountyMission(player); - obj_id objMission = getBountyMission(player); - dictionary dctParams = new dictionary(); - dctParams.put("objPlayer", player); - - if (!hasCommand(player, "droid_track")) - { - return; - } - - int intState = getIntObjVar(objMission, "intState"); - - if (intState != 1) - { - string_id strSpam = new string_id("mission/mission_generic", "bounty_no_signature"); - sendSystemMessage(player, strSpam); - return; - } - - if (hasObjVar(objMission, "intTracking")) - { - string_id strSpam = new string_id("mission/mission_generic", "bounty_already_tracking"); - sendSystemMessage(player, strSpam); - return; - } - - if (hasObjVar(objMission, "objTarget")) - { - - obj_id objTarget = getObjIdObjVar(objMission, "objTarget"); - - if (isIdValid(objTarget)) - { - dictionary dctJediInfo = requestJedi(objTarget); - - if (dctJediInfo == null) - { - - string_id strSpam = new string_id("mission/mission_generic", "jedi_not_online"); - sendSystemMessage(player, strSpam); - return; - } - else - { - boolean boolOnline = dctJediInfo.getBoolean("online"); - if (!boolOnline) - { - - string_id strSpam = new string_id("mission/mission_generic", "jedi_not_online"); - sendSystemMessage(player, strSpam); - return; - } - } - } - } - - setObjVar(droid, "objPlayer", player); - - if (intDroidType == DROID_PROBOT) - { - debugServerConsoleMsg(droid, "PROBOT, STARTING FIND"); - dctParams.put("intDroidType", intDroidType); - dctParams.put("objDroid", droid); - dctParams.put("intTrackType", DROID_TRACK_TARGET); - - if (!hasObjVar(objMission, "intMissionDynamic")) - { - dctParams.put("playerBounty", 1); - } - - messageTo(droid, "droid_Probot_Start", dctParams, 0, true); - } - if (intDroidType == DROID_SEEKER) - { - location locSpawnLocation = getLocation(player); - - if (toLower(locSpawnLocation.area).startsWith("kashyyyk") || toLower(locSpawnLocation.area).startsWith("mustafar")) - { - sendSystemMessage(player, new string_id("mission/mission_generic", "no_seek")); - return; - } - - debugServerConsoleMsg(droid, "seeker"); - dctParams.put("intDroidType", intDroidType); - dctParams.put("objDroid", droid); - dctParams.put("intTrackType", DROID_TRACK_TARGET); - - if (!hasObjVar(objMission, "intMissionDynamic")) - { - dctParams.put("playerBounty", 1); - } - - location locHeading = getHeading(player); - - locSpawnLocation.x = locSpawnLocation.x + locHeading.x; - locSpawnLocation.z = locSpawnLocation.z + locHeading.z; - - obj_id objSeeker = createObject("object/creature/npc/droid/bounty_seeker.iff", locSpawnLocation); - messageTo(objSeeker, "takeOff", null, 5, true); - - string_id strSpam = new string_id("mission/mission_generic", "seeker_droid_launched"); - sendSystemMessage(player, strSpam); - messageTo(objMission, "halfwayNotification", dctParams, 40, true); - messageTo(objMission, "halfwayNotification", dctParams, 60, true); - messageTo(objMission, "findTarget", dctParams, 20, true); - - int intCount = getCount(droid); - intCount = intCount - 1; - - if (intCount < 0) - { - destroyObject(droid); - } - else - { - setCount(droid, intCount); - } - } - - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/buff.java b/sku.0/sys.server/compiled/game/script/library/buff.java deleted file mode 100644 index a4594e6d3..000000000 --- a/sku.0/sys.server/compiled/game/script/library/buff.java +++ /dev/null @@ -1,2250 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.beast_lib; - - -public class buff extends script.base_script -{ - public buff() - { - } - public static final int MAX_EFFECTS = 5; - public static final int GROUP_BUFF_DISTANCE = 100; - - public static final String BUFF_TABLE = "datatables/buff/buff.iff"; - public static final String DEBUFF_STATE_PARALYZED = "buff.state.paralyzed"; - public static final String AGGRO_TRANSFER_TO = "aggroBuffTransfer"; - - public static final String DOT_BLEEDING = "dot_bleeding"; - public static final String DOT_POISON = "dot_poison"; - public static final String DOT_DISEASE = "dot_disease"; - public static final String DOT_FIRE = "dot_fire"; - public static final String DOT_ACID = "dot_acid"; - public static final String DOT_ENERGY = "dot_energy"; - public static final String DOT_COLD = "dot_cold"; - public static final String DOT_ELECTRICITY = "dot_electricity"; - public static final String DOT_KINETIC = "dot_kinetic"; - - public static final String ON_ATTACK_REMOVE = "onAttackRemoveBuffList"; - - public static final int STATE_NONE = -1; - public static final int STATE_COVER = 0; - public static final int STATE_ALERT = 4; - public static final int STATE_BERSERK = 5; - public static final int STATE_FEIGN_DEATH = 6; - public static final int STATE_TUMBLING = 10; - public static final int STATE_RALLIED = 11; - public static final int STATE_STUNNED = 12; - public static final int STATE_BLINDED = 13; - public static final int STATE_DIZZY = 14; - public static final int STATE_INTIMIDATED = 15; - public static final int STATE_IMMOBILIZED = 16; - public static final int STATE_FROZEN = 17; - - public static final int BUFF_DOT_TICK = 2; - - - public static boolean isParalyzed(obj_id target) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - java.util.Enumeration keys = dd.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)(keys.nextElement()); - if (key.startsWith(DEBUFF_STATE_PARALYZED)) - { - return true; - } - } - return false; - } - - - public static boolean canApplyBuff(obj_id target, String name) throws InterruptedException - { - return canApplyBuff(target, null, getStringCrc(name.toLowerCase())); - } - - - public static boolean canApplyBuff(obj_id target, obj_id owner, String name) throws InterruptedException - { - return canApplyBuff(target, owner, getStringCrc(name.toLowerCase())); - } - - - public static boolean canApplyBuff(obj_id target, int nameCrc) throws InterruptedException - { - return canApplyBuff(target, null, nameCrc); - } - - - public static boolean canApplyBuff(obj_id target, obj_id owner, int nameCrc) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if (!isPlayer(target) && !isMob(target)) - { - return false; - } - - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return false; - } - - if (hasBuff(target, nameCrc)) - { - return true; - } - - if (checkForStateImmunity(target, bdata)) - { - return false; - } - - int buffCRCs[] = _getAllBuffs(target); - - if (buffCRCs == null || buffCRCs.length == 0) - { - return true; - } - - int[] groups = getGroups(bdata); - - if (groups == null || groups.length != 3) - { - return false; - } - - int groupOne = groups[0]; - int groupTwo = groups[1]; - - if (groupOne != 0 || groupTwo != 0) - { - int priority = bdata.priority; - - for (int i = 0; i < buffCRCs.length; i++) - { - testAbortScript(); - buff_data oldBuffData = combat_engine.getBuffData(buffCRCs[i]); - - if (oldBuffData == null) - { - continue; - } - - obj_id effectOwner = getBuffOwner(target, buffCRCs[i]); - - int oldPriority = oldBuffData.priority; - - if (priority < oldPriority) - { - int[] oldGroups = getGroups(oldBuffData); - - if (oldGroups == null || oldGroups.length != 3) - { - continue; - } - - int oldGroupOne = oldGroups[0]; - int oldGroupTwo = oldGroups[1]; - int oldBlockGroup = oldGroups[2]; - - if (((groupOne != 0 && (groupOne == oldGroupOne || groupOne == oldGroupTwo)) || (groupTwo != 0 && (groupTwo == oldGroupOne || groupTwo == oldGroupTwo)) || (oldBlockGroup != 0 && (groupOne == oldBlockGroup || groupTwo == oldBlockGroup)))) - { - return false; - } - } - } - } - - return true; - } - - - public static boolean applyBuff(obj_id target, String name) throws InterruptedException - { - return applyBuff(target, null, getStringCrc(name.toLowerCase()), 0.0f, 0.0f); - } - - - public static boolean applyBuff(obj_id target, obj_id owner, String name) throws InterruptedException - { - return applyBuff(target, owner, getStringCrc(name.toLowerCase()), 0.0f, 0.0f); - } - - - public static boolean[] applyBuff(obj_id[] targets, String name) throws InterruptedException - { - if (targets == null || targets.length == 0) - { - return null; - } - - boolean[] returnList = new boolean[targets.length]; - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - if (isIdValid(targets[i])) - { - returnList[i] = applyBuff(targets[i], name); - } - else - { - returnList[i] = false; - } - } - - return returnList; - } - - - public static boolean[] applyBuff(obj_id target, String[] buffList) throws InterruptedException - { - boolean[] results = new boolean[buffList.length]; - - for (int i = 0; i < buffList.length; i++) - { - testAbortScript(); - results[i] = applyBuff(target, buffList[i]); - } - - return results; - } - - - public static boolean[][] applyBuff(obj_id[] targets, String[] buffList) throws InterruptedException - { - boolean[][] results = new boolean[targets.length][]; - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - results[i] = applyBuff(targets[i], buffList); - } - - return results; - } - - - public static boolean[] applyBuff(obj_id[] targets, obj_id caster, String buffName) throws InterruptedException - { - boolean[] results = new boolean[targets.length]; - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - results[i] = applyBuff(targets[i], caster, buffName); - } - - return results; - } - - - public static boolean applyBuff(obj_id target, int nameCrc) throws InterruptedException - { - return applyBuff(target, null, nameCrc, 0.0f, 0.0f); - } - - - public static boolean applyBuff(obj_id target, obj_id owner, int nameCrc) throws InterruptedException - { - return applyBuff(target, owner, nameCrc, 0.0f, 0.0f); - } - - - public static boolean applyBuffWithStackCount(obj_id target, String name, int stack) throws InterruptedException - { - return applyBuff(target, null, getStringCrc(name.toLowerCase()), 0.0f, 0.0f, stack); - } - - - public static boolean applyBuffWithStackCount(obj_id target, obj_id owner, String name, int stack) throws InterruptedException - { - return applyBuff(target, owner, getStringCrc(name.toLowerCase()), 0.0f, 0.0f, stack); - } - - - public static boolean applyBuff(obj_id target, String name, float duration) throws InterruptedException - { - return applyBuff(target, null, getStringCrc(name.toLowerCase()), duration, 0.0f); - } - - - public static boolean applyBuff(obj_id target, obj_id owner, String name, float duration) throws InterruptedException - { - return applyBuff(target, owner, getStringCrc(name.toLowerCase()), duration, 0.0f); - } - - - public static boolean applyBuff(obj_id target, int nameCrc, float duration) throws InterruptedException - { - return applyBuff(target, null, nameCrc, duration, 0.0f); - } - - - public static boolean applyBuff(obj_id target, obj_id owner, int nameCrc, float duration) throws InterruptedException - { - return applyBuff(target, owner, nameCrc, duration, 0.0f); - } - - - public static boolean applyBuff(obj_id target, String name, float duration, float customValue) throws InterruptedException - { - return applyBuff(target, null, getStringCrc(name.toLowerCase()), duration, customValue); - } - - - public static boolean applyBuff(obj_id target, obj_id owner, String name, float duration, float customValue) throws InterruptedException - { - return applyBuff(target, owner, getStringCrc(name.toLowerCase()), duration, customValue); - } - - - public static boolean applyBuff(obj_id target, int nameCrc, float duration, float customValue) throws InterruptedException - { - return applyBuff(target, null, nameCrc, duration, customValue); - } - - - public static boolean applyBuff(obj_id target, obj_id owner, int nameCrc, float duration, float customValue) throws InterruptedException - { - return applyBuff(target, owner, nameCrc, duration, customValue, 1); - } - - - public static boolean applyBuff(obj_id target, obj_id owner, int nameCrc, float duration, float customValue, int stack) throws InterruptedException - { - if (!canApplyBuff(target, owner, nameCrc)) - { - return false; - } - - int[] discarded = _getDiscardedBuffs(target, owner, nameCrc); - - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - LOG("buff.scriptlib", "Buff CRC failed ("+ nameCrc + ")"); - return false; - } - - boolean isStackable = bdata.maxStacks > 1; - - if (discarded != null && discarded.length > 0) - { - for (int i = 0; i < discarded.length; i++) - { - testAbortScript(); - obj_id caster = getBuffCaster(target, discarded[i]); - - if (nameCrc == discarded[i]) - { - - float oldBuffTime = getBuffTimeRemaining(target, discarded[i]); - - if (!isStackable) - { - if (oldBuffTime <= duration) - { - _removeBuff(target, discarded[i]); - } - } - - } - else - { - if (owner != caster && isStackable) - { - continue; - } - else - { - _removeBuff(target, discarded[i]); - } - } - } - } - - String particle = bdata.particle; - String hardpoint = bdata.particleHardpoint; - String buffName = bdata.buffName; - - if (particle != null && particle.length() > 0 && buffName != null && buffName.length() > 0) - { - String particles[] = split(particle, ','); - String hardpoints[] = split(hardpoint, ','); - - if (particles.length > 1) - { - for (int i = 0; i < particles.length; i++) - { - testAbortScript(); - if (hardpoints.length <= i || hardpoints[i].length() <= 0 || hardpoints[i].equals("")) - { - hardpoint = ""; - } - else - { - hardpoint = hardpoints[i]; - } - - playClientEffectObj(target, particles[i], target, hardpoint, null, buffName); - } - } - else - { - if (hardpoint.length() <= 0 || hardpoint.equals("")) - { - hardpoint = ""; - } - - playClientEffectObj(target, particle, target, hardpoint, null, buffName); - } - } - - if (isIdValid(owner)) - { - utils.setScriptVar(target, "buffOwner."+ nameCrc, owner); - } - - if (isGroupBuff(nameCrc)) - { - if (!isIdValid(owner)) - { - utils.setScriptVar(target, "groupBuff."+nameCrc, target); - } - else - { - utils.setScriptVar(target, "groupBuff."+nameCrc, owner); - } - } - - if (stack < 1) - { - stack = 1; - } - - return _addBuff(target, owner, nameCrc, duration, customValue, stack); - } - - - public static boolean removeBuff(obj_id target, String name) throws InterruptedException - { - return removeBuff(target, getStringCrc(name.toLowerCase())); - } - - - public static boolean removeBuffs(obj_id target, Vector names) throws InterruptedException - { - boolean success = true; - - for (int i = 0; i < names.size(); i++) - { - testAbortScript(); - if (!removeBuff(target, ((String)(names.get(i))))) - { - success = false; - } - } - - return success; - } - - - public static boolean removeBuffs(obj_id target, String[] names) throws InterruptedException - { - boolean success = true; - - for (int i = 0; i < names.length; i++) - { - testAbortScript(); - if (!removeBuff(target, names[i])) - { - success = false; - } - } - - return success; - } - - - public static boolean removeBuff(obj_id target, int nameCrc) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if (!isPlayer(target) && !isMob(target)) - { - return false; - } - - if (!isValidBuff(nameCrc)) - { - return false; - } - - utils.removeScriptVar(target, "buffOwner."+ nameCrc); - - return _removeBuff(target, nameCrc); - } - - - public static boolean removeAllBuffs(obj_id target) throws InterruptedException - { - return removeAllBuffs(target, false); - } - - - public static boolean removeAllBuffs(obj_id target, boolean fromDeath) throws InterruptedException - { - return removeAllBuffs(target, fromDeath, false); - } - - - public static boolean removeAllBuffs(obj_id target, boolean fromDeath, boolean fromRespec) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if (!isPlayer(target) && !isMob(target)) - { - return false; - } - - if (isPlayer(target)) - { - player_stomach.resetStomachs(target); - } - - int[] buffs = getAllBuffs(target); - - if (buffs == null || buffs.length == 0) - { - return true; - } - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - buff_data bdata = combat_engine.getBuffData(buffs[i]); - - if (bdata == null) - { - LOG("buff.scriptlib", "removeAllBuffs bdata is null"); - continue; - } - - int removeOnDeath = bdata.removeOnDeath; - int removeOnRespec = bdata.removeOnRespec; - - if (removeOnDeath == 0 && fromDeath) - { - continue; - } - - if (removeOnRespec == 0 && fromRespec) - { - continue; - } - - if (isMob(target)) - { - - int removeOnCombatEnd = bdata.aiRemoveOnCombatEnd; - - if (removeOnCombatEnd == 0 && !isDead(target) && !isIncapacitated(target)) - { - - continue; - } - } - - _removeBuff(target, buffs[i]); - } - - return true; - } - - - public static boolean removeAllDebuffsByOwner(obj_id target, obj_id owner) throws InterruptedException - { - if (!isIdValid(target) || !exists(target) || !isIdValid(owner) || !exists(owner)) - { - return false; - } - - if (target == owner) - { - return false; - } - - int[] buffs = getAllBuffs(target); - - if (buffs == null || buffs.length == 0) - { - return true; - } - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - buff_data bdata = combat_engine.getBuffData(buffs[i]); - - String curBuff = bdata.buffName; - - if (bdata.debuff == 1 && getBuffOwner(target, buffs[i]) == owner) - { - removeBuff(target, buffs[i]); - } - } - - return true; - } - - - public static int[] getAllBuffsByEffect(obj_id target, String effect) throws InterruptedException - { - if (!isIdValid(target) || !exists(target)) - { - return null; - } - - int[] buffs = getAllBuffs(target); - - if (buffs == null || buffs.length == 0) - { - return null; - } - - Vector matchedBuffs = new Vector(); - matchedBuffs.setSize(0); - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - int j = 1; - buff_data bdata = combat_engine.getBuffData(buffs[i]); - - String tempEffect = getEffectParam(bdata, 1); - boolean matched = false; - - while (!matched && j < 6 && tempEffect != null && tempEffect.length() > 0) - { - testAbortScript(); - if (tempEffect.equals(effect)) - { - utils.addElement(matchedBuffs, buffs[i]); - matched = true; - } - - j++; - tempEffect = getEffectParam(bdata, j); - } - } - - if (matchedBuffs.size() < 1) - { - return null; - } - - int[] _matchedBuffs = new int[0]; - if (matchedBuffs != null) - { - _matchedBuffs = new int[matchedBuffs.size()]; - for (int _i = 0; _i < matchedBuffs.size(); ++_i) - { - _matchedBuffs[_i] = ((Integer)matchedBuffs.get(_i)).intValue(); - } - } - return _matchedBuffs; - } - - - public static int[] getAllBuffs(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if (!isPlayer(target) && !isMob(target)) - { - return null; - } - - return _getAllBuffs(target); - } - - - public static boolean hasBuff(obj_id target) throws InterruptedException - { - int[] buffCRCs = _getAllBuffs(target); - - if (buffCRCs == null || buffCRCs.length == 0) - { - return false; - } - - return true; - } - - - public static boolean hasBuff(obj_id target, String name) throws InterruptedException - { - return _hasBuff(target, getStringCrc(name.toLowerCase())); - } - - - public static boolean hasBuff(obj_id target, int nameCrc) throws InterruptedException - { - return _hasBuff(target, nameCrc); - } - - - public static boolean hasAnyBuffInList(obj_id target, String buffList) throws InterruptedException - { - String[] buffs = split(buffList, ','); - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - if (hasBuff(target, buffs[i])) - { - return true; - } - } - - return false; - } - - - public static boolean hasAnyBuffInList(obj_id target, String[] buffList) throws InterruptedException - { - for (int i = 0; i < buffList.length; i++) - { - testAbortScript(); - if (hasBuff(target, buffList[i])) - { - return true; - } - } - - return false; - } - - - public static boolean refreshAllBuffs(obj_id target) throws InterruptedException - { - int[] buffs = _getAllBuffs(target); - - if (buffs == null || buffs.length == 0) - { - return true; - } - - float[] buffs_d = new float[buffs.length]; - float[] buffs_v = new float[buffs.length]; - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - buffs_d[i] = _getBuffTimeRemaining(target, buffs[i]); - buffs_v[i] = _getBuffCustomValue(target, buffs[i]); - } - - removeAllBuffs(target, true); - - boolean success = true; - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - if (buffs_d[i] <= 0.0f) - { - continue; - } - - obj_id owner = getBuffOwner(target, buffs[i]); - if (isIdValid(owner) && owner != target) - { - continue; - } - - success &= applyBuff(target, buffs[i], buffs_d[i], buffs_v[i]); - } - - return success; - } - - - public static String getBuffNameFromCrc(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return null; - } - - return bdata.buffName; - } - - - public static int getGroupOne(String name) throws InterruptedException - { - return getGroupOne(getStringCrc(name.toLowerCase())); - } - - - public static int getGroupOne(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return 0; - } - - if (bdata.buffGroup1 == null || bdata.buffGroup1.length() <= 0) - { - return 0; - } - else - { - return bdata.buffGroup1Crc; - } - } - - - public static int getGroupTwo(String name) throws InterruptedException - { - return getGroupTwo(getStringCrc(name.toLowerCase())); - } - - - public static int getGroupTwo(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return 0; - } - - if (bdata.buffGroup2 == null || bdata.buffGroup2.length() <= 0) - { - return 0; - } - else - { - return bdata.buffGroup2Crc; - } - } - - - public static String getStringGroupTwo(String name) throws InterruptedException - { - return getStringGroupTwo(getStringCrc(name.toLowerCase())); - } - - - public static String getStringGroupTwo(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return ""; - } - - if (bdata.buffGroup2 == null || bdata.buffGroup2.length() <= 0) - { - return ""; - } - else - { - return bdata.buffGroup2; - } - } - - - public static int getBlockGroup(String name) throws InterruptedException - { - return getBlockGroup(getStringCrc(name.toLowerCase())); - } - - - public static int getBlockGroup(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return 0; - } - - if (bdata.blockGroup == null || bdata.blockGroup.length() <= 0) - { - return 0; - } - else - { - return bdata.blockGroupCrc; - } - } - - - public static int[] getGroups(buff_data bdata) throws InterruptedException - { - if (bdata == null) - { - return null; - } - - int[] groups = new int[3]; - - if (bdata.buffGroup1 == null || bdata.buffGroup1.length() <= 0) - { - groups[0] = 0; - } - else - { - groups[0] = bdata.buffGroup1Crc; - } - - if (bdata.buffGroup2 == null || bdata.buffGroup2.length() <= 0) - { - groups[1] = 0; - } - else - { - groups[1] = bdata.buffGroup2Crc; - } - - if (bdata.blockGroup == null || bdata.blockGroup.length() <= 0) - { - groups[2] = 0; - } - else - { - groups[2] = bdata.blockGroupCrc; - } - - return groups; - } - - - public static int[] getGroups(String name) throws InterruptedException - { - return getGroups(getStringCrc(name.toLowerCase())); - } - - - public static int[] getGroups(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - return getGroups(bdata); - } - - - public static int getBuffOnTargetFromGroup(obj_id target, String group) throws InterruptedException - { - return getBuffOnTargetFromGroup(target, getStringCrc(group)); - } - - - public static int getBuffOnTargetFromGroup(obj_id target, int groupCrc) throws InterruptedException - { - int[] buffs = getAllBuffs(target); - - if (buffs == null || buffs.length == 0) - { - return 0; - } - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - int[] groups = getGroups(buffs[i]); - - if (groups == null || groups.length == 0) - { - continue; - } - - for (int j = 0; j < groups.length; j++) - { - testAbortScript(); - if (groups[j] == groupCrc) - { - return buffs[i]; - } - } - } - - return 0; - } - - - public static int[] getGroup2BuffsOnTarget(obj_id target, String groupName) throws InterruptedException - { - int[] buffs = getAllBuffs(target); - - if (buffs == null || buffs.length == 0) - { - return null; - } - - Vector allGroupBuffs = new Vector(); - allGroupBuffs.setSize(0); - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - String tempGroupName = getStringGroupTwo(buffs[i]); - - if (tempGroupName.startsWith(groupName)) - { - utils.addElement(allGroupBuffs, buffs[i]); - } - } - - int[] _allGroupBuffs = new int[0]; - if (allGroupBuffs != null) - { - _allGroupBuffs = new int[allGroupBuffs.size()]; - for (int _i = 0; _i < allGroupBuffs.size(); ++_i) - { - _allGroupBuffs[_i] = ((Integer)allGroupBuffs.get(_i)).intValue(); - } - } - return _allGroupBuffs; - } - - - public static int getPriority(String name) throws InterruptedException - { - return getPriority(getStringCrc(name.toLowerCase())); - } - - - public static int getPriority(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return 0; - } - - return bdata.priority; - } - - - public static float getDuration(String name) throws InterruptedException - { - return getDuration(getStringCrc(name.toLowerCase())); - } - - - public static float getDuration(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return 0f; - } - - return bdata.duration; - } - - - public static int getState(String name) throws InterruptedException - { - return getState(getStringCrc(name.toLowerCase())); - } - - - public static int getState(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return STATE_NONE; - } - - return bdata.buffState; - } - - - public static String getCallback(String name) throws InterruptedException - { - return getCallback(getStringCrc(name.toLowerCase())); - } - - - public static String getCallback(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return ""; - } - - return bdata.callback; - } - - - public static String getParticle(String name) throws InterruptedException - { - return getParticle(getStringCrc(name.toLowerCase())); - } - - - public static String getParticle(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return ""; - } - - return bdata.particle; - } - - - public static String getParticleHardpoint(String name) throws InterruptedException - { - return getParticle(getStringCrc(name.toLowerCase())); - } - - - public static String getParticleHardpoint(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return ""; - } - - return bdata.particleHardpoint; - } - - - public static String getEffectParam(String name, int effNum) throws InterruptedException - { - return getEffectParam(getStringCrc(name.toLowerCase()), effNum); - } - - - public static String getEffectParam(int nameCrc, int effNum) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return null; - } - - return getEffectParam(bdata, effNum); - } - - - public static String getEffectParam(buff_data bdata, int effNum) throws InterruptedException - { - if (effNum <= 0 || effNum > MAX_EFFECTS) - { - return null; - } - - if (bdata == null) - { - return null; - } - - switch(effNum) - { - case 1: - return bdata.effect1Param; - case 2: - return bdata.effect2Param; - case 3: - return bdata.effect3Param; - case 4: - return bdata.effect4Param; - case 5: - return bdata.effect5Param; - } - - return null; - } - - - public static float getEffectValue(String name, int effNum) throws InterruptedException - { - return getEffectValue(getStringCrc(name.toLowerCase()), effNum); - } - - - public static float getEffectValue(int nameCrc, int effNum) throws InterruptedException - { - if (effNum <= 0 || effNum > MAX_EFFECTS) - { - return Float.NEGATIVE_INFINITY; - } - - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return 0; - } - - switch(effNum) - { - case 1: - return bdata.effect1Value; - case 2: - return bdata.effect2Value; - case 3: - return bdata.effect3Value; - case 4: - return bdata.effect4Value; - case 5: - return bdata.effect5Value; - } - - return 0; - } - - - public static boolean isDebuff(String name) throws InterruptedException - { - return isDebuff(getStringCrc(name.toLowerCase())); - } - - - public static boolean isDebuff(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return false; - } - - int debuff = bdata.debuff; - - return debuff == 1; - } - - - public static boolean canBeDispelled(String name) throws InterruptedException - { - return canBeDispelled(getStringCrc(name.toLowerCase())); - } - - - public static boolean canBeDispelled(int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return false; - } - - return bdata.dispellPlayer == 1; - } - - - public static boolean isGroupBuff(String name) throws InterruptedException - { - return isGroupBuff(getStringCrc(name.toLowerCase())); - } - - - public static boolean isGroupBuff(int nameCrc) throws InterruptedException - { - for (int i = 1; i <= MAX_EFFECTS; i++) - { - testAbortScript(); - String effect = getEffectParam(nameCrc, i); - - if (effect != null && effect.equals("group")) - { - return true; - } - } - - return false; - } - - - public static boolean isAuraBuff(String name) throws InterruptedException - { - return isAuraBuff(getStringCrc(name.toLowerCase())); - } - - - public static boolean isAuraBuff(int nameCrc) throws InterruptedException - { - String groupTwo = getStringGroupTwo(nameCrc); - - return groupTwo.indexOf( "aura" ) > -1; - } - - - public static boolean isOwnedBuff(String name) throws InterruptedException - { - return isOwnedBuff(getStringCrc(name.toLowerCase())); - } - - - public static boolean isOwnedBuff(int nameCrc) throws InterruptedException - { - obj_id self = getSelf(); - if (!utils.hasScriptVar(self, "groupBuff."+nameCrc)) - { - return true; - } - - obj_id owner = utils.getObjIdScriptVar(self, "groupBuff."+nameCrc); - - if (isIdValid(owner) && owner == self) - { - return true; - } - - return false; - } - - - public static boolean isValidBuff(String name) throws InterruptedException - { - return isValidBuff(getStringCrc(name.toLowerCase())); - } - - - public static boolean isValidBuff(int nameCrc) throws InterruptedException - { - return (combat_engine.getBuffData(nameCrc) != null); - } - - - public static int[] _getDiscardedBuffs(obj_id target, int nameCrc) throws InterruptedException - { - return _getDiscardedBuffs(target, null, nameCrc); - } - - - public static int[] _getDiscardedBuffs(obj_id target, obj_id owner, int nameCrc) throws InterruptedException - { - buff_data bdata = combat_engine.getBuffData(nameCrc); - - if (bdata == null) - { - return null; - } - - return _getDiscardedBuffs(target, owner, bdata); - } - - - public static int[] _getDiscardedBuffs(obj_id target, obj_id owner, buff_data bdata) throws InterruptedException - { - if (bdata == null) - { - return null; - } - - int[] buffs = _getAllBuffs(target); - - if (buffs == null || buffs.length == 0) - { - return null; - } - - int discardCount = 0; - int[] discarded = new int[buffs.length]; - int[] groups = getGroups(bdata); - - if (groups == null || groups.length != 3) - { - return null; - } - - int groupOne = groups[0]; - int groupTwo = groups[1]; - - if (groupOne != 0 || groupTwo != 0) - { - int priority = bdata.priority; - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - buff_data oldBuffData = combat_engine.getBuffData(buffs[i]); - - if (oldBuffData == null) - { - continue; - } - - obj_id effectOwner = getBuffOwner(target, buffs[i]); - - if (isIdValid(effectOwner) && effectOwner != target) - { - continue; - } - - int oldPriority = oldBuffData.priority; - - if (priority >= oldPriority) - { - int[] oldGroups = getGroups(oldBuffData); - - if (oldGroups == null || oldGroups.length != 3) - { - return null; - } - - int oldGroupOne = oldGroups[0]; - int oldGroupTwo = oldGroups[1]; - - if (((groupOne != 0 && (groupOne == oldGroupOne || groupOne == oldGroupTwo)) || (groupTwo != 0 && (groupTwo == oldGroupOne || groupTwo == oldGroupTwo)))) - { - discarded[discardCount++] = buffs[i]; - } - } - } - } - - int[] returnArray = new int[discardCount]; - for (int i = 0; i < discardCount; ++i) - { - testAbortScript(); - returnArray[i] = discarded[i]; - } - - return returnArray; - } - - - public static obj_id getBuffOwner(obj_id target, String name) throws InterruptedException - { - return getBuffOwner(target, getStringCrc(name.toLowerCase())); - } - - - public static obj_id getBuffOwner(obj_id target, int nameCrc) throws InterruptedException - { - if (!isGroupBuff(nameCrc)) - { - return target; - } - - if (!utils.hasScriptVar(target, "groupBuff."+nameCrc)) - { - return null; - } - - obj_id owner = utils.getObjIdScriptVar(target, "groupBuff."+nameCrc); - - return owner; - } - - - public static void addGroupBuffEffect(obj_id target, obj_id owner, int[] buffList, float[] strList, float[] durList) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(owner)) - { - return; - } - - if (buffList == null || buffList.length < 1) - { - return; - } - - for (int i = 0; i < buffList.length; i++) - { - testAbortScript(); - utils.setScriptVar(target, "groupBuff."+buffList[i], owner); - - applyBuff(target, owner, buffList[i], durList[i], strList[i]); - - if (beast_lib.isBeastMaster(target)) - { - obj_id beast = beast_lib.getBeastOnPlayer(target); - - if (isIdValid(beast) && !isIdNull(beast)) - { - applyBuff(beast, owner, buffList[i], durList[i], strList[i]); - } - } - } - } - - - public static void removeGroupBuffEffect(obj_id target, int[] buffList) throws InterruptedException - { - if (!isIdValid(target)) - { - return; - } - - if (buffList == null || buffList.length < 1) - { - return; - } - - for (int i = 0; i < buffList.length; i++) - { - testAbortScript(); - obj_id owner = utils.getObjIdScriptVar(target, "groupBuff."+buffList[i]); - - if (owner != target) - { - - _removeBuff(target, buffList[i]); - - utils.removeScriptVar(target, "groupBuff."+buffList[i]); - - if (beast_lib.isBeastMaster(target)) - { - obj_id beast = beast_lib.getBeastOnPlayer(target); - - if (isIdValid(beast) && !isIdNull(beast)) - { - _removeBuff(beast, buffList[i]); - } - } - } - } - } - - - public static int[] getOwnedGroupBuffs(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - int[] buffCrcList = getAllBuffs(target); - - if (buffCrcList == null || buffCrcList.length < 1) - { - return null; - } - - Vector buffList = new Vector(); - buffList.setSize(0); - for (int i = 0; i < buffCrcList.length; i++) - { - testAbortScript(); - obj_id owner = utils.getObjIdScriptVar(target, "groupBuff."+buffCrcList[i]); - - if (isIdValid(owner) && owner == target && isGroupBuff(buffCrcList[i])) - { - buffList = utils.addElement(buffList, buffCrcList[i]); - } - } - - int[] _buffList = new int[0]; - if (buffList != null) - { - _buffList = new int[buffList.size()]; - for (int _i = 0; _i < buffList.size(); ++_i) - { - _buffList[_i] = ((Integer)buffList.get(_i)).intValue(); - } - } - return _buffList; - } - - - public static int[] getGroupBuffEffects(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - int[] buffCrcList = getAllBuffs(target); - - if (buffCrcList == null || buffCrcList.length < 1) - { - return null; - } - - Vector buffList = new Vector(); - buffList.setSize(0); - for (int i = 0; i < buffCrcList.length; i++) - { - testAbortScript(); - obj_id owner = utils.getObjIdScriptVar(target, "groupBuff."+buffCrcList[i]); - - if (isIdValid(owner) && owner != target && isGroupBuff(buffCrcList[i])) - { - buffList = utils.addElement(buffList, buffCrcList[i]); - } - } - - int[] _buffList = new int[0]; - if (buffList != null) - { - _buffList = new int[buffList.size()]; - for (int _i = 0; _i < buffList.size(); ++_i) - { - _buffList[_i] = ((Integer)buffList.get(_i)).intValue(); - } - } - return _buffList; - } - - - public static float[] getGroupBuffDuration(obj_id player, int[] buffList) throws InterruptedException - { - if (buffList == null || buffList.length == 0) - { - return null; - } - - float[] durationList = new float[buffList.length]; - - for (int i = 0; i < buffList.length; i++) - { - testAbortScript(); - durationList[i] = _getBuffTimeRemaining(player, buffList[i]); - } - - return durationList; - } - - - public static float[] getGroupBuffStrength(obj_id player, int[] buffList) throws InterruptedException - { - if (buffList == null || buffList.length == 0) - { - return null; - } - - float modifier = squad_leader.getLeadershipMod(player); - - float[] strengthList = new float[buffList.length]; - - for (int i = 0; i < buffList.length; i++) - { - testAbortScript(); - strengthList[i] = _getBuffCustomValue(player, buffList[i]); - } - - return strengthList; - } - - - public static boolean checkForStateImmunity(obj_id target, buff_data bdata) throws InterruptedException - { - - if (bdata.buffState == STATE_NONE) - { - return false; - } - else if (bdata.buffState == STATE_STUNNED && utils.hasScriptVar(target, "immunity.state.stun")) - { - LOG("Immunity//STATE:", "Block a STUN state from being applied on ---"+getPlayerName(target)); - return true; - } - else - { - return false; - } - } - - - public static boolean removeAllBuffsOfStateType(obj_id target, int stateType) throws InterruptedException - { - boolean removed = false; - - int[] buffs = getAllBuffs(target); - - if (buffs == null || buffs.length == 0) - { - return true; - } - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - if (isDebuff(buffs[i]) && getState(buffs[i]) == stateType) - { - _removeBuff(target, buffs[i]); - removed = true; - } - } - - if (removed) - { - return true; - } - else - { - return false; - } - } - - - public static boolean toggleStance(obj_id player, String attemptedBuff) throws InterruptedException - { - int[] buffs = getAllBuffs(player); - - if (buffs == null) - { - return false; - } - - buff_data attemptedBuffData = combat_engine.getBuffData(getStringCrc(attemptedBuff.toLowerCase())); - - if (attemptedBuffData == null) - { - return false; - } - - String groupAtt = attemptedBuffData.buffGroup1; - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - buff_data bdata = combat_engine.getBuffData(buffs[i]); - - if (bdata == null) - { - continue; - } - - String curBuff = bdata.buffName; - - String groupCur = bdata.buffGroup1; - - if (groupCur.equals(groupAtt)) - { - - removeBuff(player, curBuff); - - if (!curBuff.equals(attemptedBuff.toLowerCase())) - { - applyBuff(player, player, attemptedBuff); - return false; - } - - return true; - } - } - - return false; - } - - - public static boolean isInStance(obj_id player) throws InterruptedException - { - if (!isPlayer(player)) - { - return true; - } - - if (hasBuff(player, "fs_buff_def_1_1")) - { - return true; - } - - return false; - } - - - public static boolean isInFocus(obj_id player) throws InterruptedException - { - if (!isPlayer(player)) - { - return true; - } - - if (hasBuff(player, "fs_buff_ca_1")) - { - return true; - } - - return false; - } - - - public static boolean playStanceVisual(obj_id target, String effectName) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - buff_data bdata = combat_engine.getBuffData(getStringCrc(effectName.toLowerCase())); - - if (bdata == null) - { - return false; - } - - String effectPlayed = bdata.stanceParticle; - - if (effectPlayed != null && effectPlayed.length() > 0) - { - playClientEffectObj(target, effectPlayed, target, ""); - return true; - } - else - { - return false; - } - } - - - public static boolean isDotIconOnlyBuff(String name) throws InterruptedException - { - boolean isDotIconOnly = false; - - if (name.equals("bleeding") || name.equals("poisoned") || name.equals("diseased") || name.equals("onfire")) - { - isDotIconOnly = true; - } - - return isDotIconOnly; - } - - - public static long getBuffStackCount(obj_id target, int nameCrc) throws InterruptedException - { - return _getBuffStackCount(target, nameCrc); - } - - - public static long getBuffStackCount(obj_id target, String nameCrc) throws InterruptedException - { - return _getBuffStackCount(target, getStringCrc(nameCrc.toLowerCase())); - } - - - public static boolean decrementBuffStack(obj_id target, int nameCrc, int stacksToRemove) throws InterruptedException - { - return _decrementBuffStack(target, nameCrc, stacksToRemove); - } - - - public static boolean decrementBuffStack(obj_id target, String nameCrc, int stacksToRemove) throws InterruptedException - { - return _decrementBuffStack(target, getStringCrc(nameCrc.toLowerCase()), stacksToRemove); - } - - - public static boolean decrementBuffStack(obj_id target, int nameCrc) throws InterruptedException - { - return _decrementBuffStack(target, nameCrc, 1); - } - - - public static boolean decrementBuffStack(obj_id target, String nameCrc) throws InterruptedException - { - return _decrementBuffStack(target, getStringCrc(nameCrc.toLowerCase()), 1); - } - - - public static obj_id getBuffCaster(obj_id target, int nameCrc) throws InterruptedException - { - obj_id caster = obj_id.NULL_ID; - caster = caster.getObjId(_getBuffCaster(target, nameCrc)); - - return caster; - } - - - public static obj_id getBuffCaster(obj_id target, String nameCrc) throws InterruptedException - { - obj_id caster = obj_id.NULL_ID; - caster = caster.getObjId(_getBuffCaster(target, getStringCrc(nameCrc.toLowerCase()))); - - return caster; - } - - - public static float getBuffTimeRemaining(obj_id target, int nameCrc) throws InterruptedException - { - return _getBuffTimeRemaining(target, nameCrc); - } - - - public static float getBuffTimeRemaining(obj_id target, String nameCrc) throws InterruptedException - { - return _getBuffTimeRemaining(target, getStringCrc(nameCrc.toLowerCase())); - } - - - public static int[] getAllDotBuffsOfType(obj_id target, String type) throws InterruptedException - { - int[] allDotBuffs = getAllBuffsByEffect(target, "dot"); - - Vector allDotBuffsOfType = new Vector(); - allDotBuffsOfType.setSize(0); - - if (allDotBuffs == null || allDotBuffs.length <= 0) - { - return null; - } - - for (int i = 0; i < allDotBuffs.length; ++i) - { - testAbortScript(); - String param1 = getEffectParam(allDotBuffs[i], 1); - - if (param1.equals(type)) - { - utils.addElement(allDotBuffsOfType, allDotBuffs[i]); - } - } - - int[] _allDotBuffsOfType = new int[0]; - if (allDotBuffsOfType != null) - { - _allDotBuffsOfType = new int[allDotBuffsOfType.size()]; - for (int _i = 0; _i < allDotBuffsOfType.size(); ++_i) - { - _allDotBuffsOfType[_i] = ((Integer)allDotBuffsOfType.get(_i)).intValue(); - } - } - return _allDotBuffsOfType; - } - - - public static boolean performBuffDotImmunity(obj_id target, String dotType) throws InterruptedException - { - - if (dotType.equals("all")) - { - int[] allDotBuffs = getAllBuffsByEffect(target, "dot"); - - if (allDotBuffs == null || allDotBuffs.length <= 0) - { - return false; - } - - for (int i = 0; i < allDotBuffs.length; ++i) - { - testAbortScript(); - removeBuff(target, allDotBuffs[i]); - } - return true; - } - - int[] allBuffDotsOfType = buff.getAllDotBuffsOfType(target, dotType); - - if (allBuffDotsOfType == null || allBuffDotsOfType.length <= 0) - { - return false; - } - - for (int i = 0; i < allBuffDotsOfType.length; ++i) - { - testAbortScript(); - removeBuff(target, allBuffDotsOfType[i]); - } - - return true; - } - - - public static boolean isBuffDot(String buffName) throws InterruptedException - { - String effectName = buff.getEffectParam(buffName, 2); - if (effectName.equals("dot")) - { - return true; - } - - return false; - } - - - public static void reduceBuffDotStackCount(obj_id target, String dotType, int count) throws InterruptedException - { - int[] allBuffsOfType = buff.getAllDotBuffsOfType(target, dotType); - - if (allBuffsOfType == null || allBuffsOfType.length == 0) - { - return; - } - - for (int i=0; i 0) - { - for (int i = 0; i < allBuffs.length; ++i) - { - testAbortScript(); - if (buff.isAuraBuff(allBuffs[i])) - { - buff.removeBuff(player, allBuffs[i]); - } - } - } - - return true; - } - - - public static int getBuffWithEffect(obj_id player, String effect) throws InterruptedException - { - - if (!isIdValid(player) || !exists(player)) - { - return -1; - } - if (effect == null || effect.equals("")) - { - return -1; - } - - int[] allBuffs = getAllBuffs(player); - - if (allBuffs != null && allBuffs.length > 0) - { - - for (int i = 0; i < allBuffs.length; ++i) - { - testAbortScript(); - String tempEffect = getEffectParam(allBuffs[i], 1); - if (effect.equals(tempEffect)) - { - return allBuffs[i]; - } - } - } - - return -1; - } - - - public static void partyBuff(obj_id caster, String buffName) throws InterruptedException - { - Vector toBuff = new Vector(); - toBuff.setSize(0); - obj_id myBeast = beast_lib.getBeastOnPlayer(caster); - obj_id groupId = getGroupObject(caster); - - if (isIdValid(myBeast) && exists(myBeast)) - { - toBuff.add(myBeast); - } - - if (isIdValid(groupId)) - { - obj_id[] groupPlayers = getGroupMemberIds(groupId); - - for (int i=0; i 1.0f) - { - return false; - } - - return _decayBuff(target, buffCrc, percent); - } - - - public static boolean decayAllBuffsFromPvpDeath(obj_id target) throws InterruptedException - { - return decayAllBuffsFromPvpDeath(target, 0.10f); - } - - - public static boolean decayAllBuffsFromPvpDeath(obj_id target, float percent) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if (!isPlayer(target)) - { - return false; - } - - int[] buffs = getAllBuffs(target); - - if (buffs == null || buffs.length == 0) - { - return true; - } - - for (int i = 0; i < buffs.length; ++i) - { - testAbortScript(); - buff_data bdata = combat_engine.getBuffData(buffs[i]); - - if (bdata == null) - { - LOG("buff.scriptlib", "decayAllBuffsFromPvpDeath bdata is null"); - continue; - } - - int decayOnPvpDeath = bdata.decayOnPvpDeath; - int removalOnDeath = bdata.removeOnDeath; - - if (decayOnPvpDeath == 0 && removalOnDeath == 0) - { - continue; - } - else if (decayOnPvpDeath == 0 && removalOnDeath == 1) - { - _removeBuff(target, buffs[i]); - continue; - } - else if (removalOnDeath == 0) - { - continue; - } - - _decayBuff(target, buffs[i], percent); - } - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/camping.java b/sku.0/sys.server/compiled/game/script/library/camping.java deleted file mode 100644 index b19ac1951..000000000 --- a/sku.0/sys.server/compiled/game/script/library/camping.java +++ /dev/null @@ -1,970 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.factions; -import script.library.battlefield; -import script.library.locations; -import script.library.pclib; -import script.library.xp; -import script.library.player_structure; -import script.library.structure; - - -public class camping extends script.base_script -{ - public camping() - { - } - public static final float CAMP_SIZE[] = - { - 6.f, 8.f, 10.f, 13.f, 15.f, 20.f - }; - public static final float MAX_SIZE = 14.f; - - public static final int NUM_MARKER = 6; - - public static final float HEARTBEAT_CREATION = 1.0f; - public static final float HEARTBEAT_MAINTAIN = 30.0f; - public static final float HEARTBEAT_RESTORE = 120.0f; - - public static final String MOD_CAMP = "camp"; - public static final String MOD_CAMP_ADVANCED = "camp_advanced"; - - public static final String VAR_CAMP_BASE = "camp"; - - public static final String VAR_OWNER = VAR_CAMP_BASE + ".owner"; - public static final String VAR_OWNER_NEAR = VAR_CAMP_BASE + ".owner_near"; - - public static final String VAR_STATUS = VAR_CAMP_BASE + ".status"; - - public static final String VAR_SIZE = VAR_CAMP_BASE + ".size"; - public static final String VAR_LIFETIME = VAR_CAMP_BASE + ".lifetime"; - public static final String VAR_CREATION_TIME = VAR_CAMP_BASE + ".creation_time"; - public static final String VAR_DESTRUCT_TIME = VAR_CAMP_BASE + ".destruction_time"; - - public static final String VAR_BEEN_INITIALIZED = VAR_CAMP_BASE + ".beenInitialized"; - - public static final String VAR_CAMP_XP = VAR_CAMP_BASE + ".xp"; - public static final String VAR_CAMP_REPEL = VAR_CAMP_BASE + ".repel"; - public static final String VAR_CAMP_POWER = VAR_CAMP_BASE + ".power"; - - public static final String VAR_TRIGGER_VOLUME = VAR_CAMP_BASE + ".triggerVolume"; - - public static final String VAR_CAMP_ITEM_BASE = VAR_CAMP_BASE + ".items"; - - public static final String VAR_ITEM_IDX = VAR_CAMP_BASE + ".item_idx"; - public static final String VAR_ITEM_MAX = VAR_CAMP_BASE + ".item_max"; - - public static final String VAR_MARKERS = VAR_CAMP_ITEM_BASE + ".markers"; - public static final String VAR_GENERAL_ITEMS = VAR_CAMP_ITEM_BASE + ".general"; - public static final String VAR_ADVANCED_ITEMS = VAR_CAMP_ITEM_BASE + ".advanced"; - - public static final String VAR_PLAYER_CAMP = VAR_CAMP_BASE + ".id"; - - public static final String VAR_CURRENT_CAMP = VAR_CAMP_BASE + ".current"; - - public static final int STATUS_UNKNOWN = -1; - public static final int STATUS_NEW = 0; - public static final int STATUS_CREATION = 1; - public static final int STATUS_MAINTAIN = 2; - public static final int STATUS_ABANDONED = 3; - - public static final String SCRIPT_MASTER_OBJECT = "systems.camping.camp_master"; - - public static final String COL_MASTER = "MASTER"; - public static final String COL_MARKER = "MARKER"; - public static final String COL_OTHER = "OTHER"; - - public static final String COL_TEMPLATE = "TEMPLATE"; - public static final String COL_MIN_MOD = "MIN_MOD"; - - public static final String HANDLER_SET_STATUS = "handleSetStatus"; - - public static final String HANDLER_CAMP_CREATE = "handleCampCreationHeartbeat"; - public static final String HANDLER_CAMP_MAINTAIN = "handleCampMaintenanceHeartbeat"; - public static final String HANDLER_CAMP_RESTORE = "handleCampRestoreHeartbeat"; - - public static final String HANDLER_CAMP_COMPLETE = "handleCampComplete"; - - public static final String DICT_NEW_STATUS = "newStatus"; - - public static final string_id SID_ABANDONED_CAMP = new string_id("camp", "abandoned_camp"); - public static final string_id SID_STARTING_CAMP = new string_id("camp", "starting_camp"); - public static final string_id SID_CAMP_COMPLETE = new string_id("camp", "camp_complete"); - public static final string_id SID_ASSUMING_OWNERSHIP = new string_id("camp", "assuming_ownership"); - - public static final string_id SID_ERROR_CAMP_DISBAND = new string_id("camp", "error_camp_disband"); - - public static final string_id SID_ERROR_DEFAULT = new string_id("camp", "error_default"); - public static final string_id SID_ERROR_INSIDE = new string_id("camp", "error_inside"); - public static final string_id SID_ERROR_CAMP_EXISTS = new string_id("camp", "error_camp_exists"); - public static final string_id SID_ERROR_CAMP_TOO_CLOSE = new string_id("camp", "error_camp_too_close"); - public static final string_id SID_ERROR_BUILDING_TOO_CLOSE = new string_id("camp", "error_building_too_close"); - public static final string_id SID_ERROR_LAIR_TOO_CLOSE = new string_id("camp", "error_lair_too_close"); - public static final string_id SID_ERROR_MUNI_TRUE = new string_id("camp", "error_muni_true"); - public static final string_id SID_ERROR_NOBUILD = new string_id("camp", "error_nobuild"); - public static final string_id SID_ERROR_BATTLEFIELD = new string_id("camp", "error_battlefield"); - public static final string_id SID_ERROR_IN_WATER = new string_id("camp", "error_in_water"); - public static final string_id SID_ERROR_TOO_CLOSE_TO_WATER = new string_id("camp", "error_too_close_to_water"); - - public static final string_id SID_ERROR_CAMP_TOO_BIG = new string_id("camp", "error_too_big"); - public static final string_id SID_CAMP_MASTER_NAME = new string_id("camp", "camp_master"); - - public static final string_id SID_GENERAL_ITEM_ADDED = new string_id("camp", "general_item_added"); - public static final string_id SID_ADVANCED_ITEMS_ADDED = new string_id("camp", "advanced_items_added"); - - public static final string_id SID_CAMP_ENTER = new string_id("camp", "camp_enter"); - public static final string_id SID_CAMP_EXIT = new string_id("camp", "camp_exit"); - - public static final string_id PROSE_CAMP_ENTER = new string_id("camp", "prose_camp_enter"); - public static final string_id PROSE_CAMP_EXIT = new string_id("camp", "prose_camp_exit"); - public static final string_id SID_RECRUITER_MODULE_ABORTED = new string_id("camp", "recruiter_aborted"); - - public static final String CAMP_THEATERS[] = - { - "object/building/poi/scout_camp_s0.iff", - "object/building/poi/scout_camp_s1.iff", - "object/building/poi/scout_camp_s2.iff", - "object/building/poi/scout_camp_s3.iff", - "object/building/poi/scout_camp_s4.iff", - "object/building/poi/scout_camp_s5.iff" - }; - - public static final String CAMP_DATATABLE = "datatables/item/camp.iff"; - - - public static obj_id createCamp(obj_id creator) throws InterruptedException - { - return createCamp( creator, 1 ); - } - - - public static obj_id createCamp(obj_id creator, int campPower) throws InterruptedException - { - if (!isIdValid(creator)) - { - return null; - } - - location here = utils.findLocInFrontOfTarget(creator, 1.0f); - if (here == null) - { - sendSystemMessage(creator, new string_id("camp", "bad_location")); - return null; - } - - if (campPower == 0) - { - campPower = 1; - } - - if (canPlaceCampHere( creator, here, campPower )) - { - obj_id master = createCampTheater( here, campPower ); - if (!isIdValid(master)) - { - sendSystemMessage(creator, new string_id("camp", "bad_creation")); - return null; - } - else - { - setCampOwner( master, creator ); - - setCampMasterName(master); - - if (campPower > 4 && factions.isDeclared(creator)) - { - String creatorFac = factions.getFaction(creator); - if (creatorFac != null) - { - factions.setFaction(master, creatorFac); - attachScript(master, "planet_map.map_loc_attach"); - } - } - - int mod_camp = getSkillStatMod( creator, MOD_CAMP ); - int repel = campPower; - if (campPower == 1) - { - repel = 0; - } - setObjVar(master, VAR_CAMP_REPEL, repel); - setObjVar(master, VAR_CAMP_POWER, campPower); - attachScript( master, SCRIPT_MASTER_OBJECT ); - setStatus( master, STATUS_NEW ); - setObjVar(master, VAR_ITEM_IDX, 0); - int maxItem = (int)(mod_camp / 20) + 2; - setObjVar(master, VAR_ITEM_MAX, maxItem); - sendCampCreationHeartbeat( master ); - - int createTime = getGameTime(); - setObjVar( master, "camp.createTime", createTime ); - - return master; - } - } - else - { - LOG("camping", "Cannot place camp here..."); - } - - return null; - } - - - public static obj_id createCampTheater(location here, int campPower) throws InterruptedException - { - if (here == null) - { - return null; - } - return createObject( CAMP_THEATERS[campPower-1], here ); - } - - - public static boolean canPlaceCampHere(obj_id creator, location here, int campPower) throws InterruptedException - { - if (!isIdValid(creator) || (here == null)) - { - return false; - } - - if (isIdValid(here.cell) || here.area.startsWith("space_")) - { - sendSystemMessage(creator, SID_ERROR_INSIDE); - return false; - } - - obj_id currentCamp = getCurrentCamp(creator); - if (currentCamp != null) - { - - sendSystemMessage(creator, SID_ERROR_CAMP_EXISTS); - - return false; - } - - if (isTooCloseToAnotherCamp(here,creator)) - { - sendSystemMessage(creator, new string_id("camp", "camp_too_close")); - return false; - } - - if (here.area.equals("mustafar")) - { - if (here.x > 1120 || here.z < -1024) - { - return false; - } - } - - if (instance.isInInstanceArea(creator)) - { - return false; - } - - region bf = battlefield.getBattlefield(here); - if (bf != null) - { - sendSystemMessage(creator, SID_ERROR_BATTLEFIELD); - return false; - } - - if (locations.isInMissionCity( here )) - { - sendSystemMessage(creator, SID_ERROR_MUNI_TRUE); - return false; - } - - if (isBelowWater( here )) - { - sendSystemMessage(creator, SID_ERROR_IN_WATER); - return false; - } - - float size = CAMP_SIZE[campPower] + 1.0f; - if (isWaterInRect (here.x - size, here.z - size, here.x + size, here.z + size)) - { - sendSystemMessage(creator, SID_ERROR_TOO_CLOSE_TO_WATER); - return false; - } - - return true; - } - - - public static boolean nukeCamp(obj_id master) throws InterruptedException - { - if (!isIdValid(master) || !exists( master )) - { - return false; - } - - removeTriggerVolume("camp_"+ master); - - obj_id[] players = getPlayerCreaturesInRange(getLocation(master), getCampSize(master)); - if ((players == null) || (players.length == 0)) - { - - } - else - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - clearCurrentCamp(players[i]); - } - } - - int xpGranted = getIntObjVar(master, VAR_CAMP_XP); - obj_id owner = getObjIdObjVar(master, VAR_OWNER); - if ((owner != null) && (owner != obj_id.NULL_ID)) - { - pclib.msgRemoveObjVar(owner, VAR_CAMP_BASE); - if ((owner.isLoaded()) && (isInWorld(owner))) - { - - sendSystemMessage(owner, SID_ERROR_CAMP_DISBAND); - } - } - - if (!destroyObject(master)) - { - return false; - } - - return true; - } - - - public static obj_id getCurrentCamp(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - deltadictionary dd = target.getScriptVars(); - obj_id camp = dd.getObjId(VAR_CURRENT_CAMP); - - if (!isIdValid( camp ) || !exists( camp ) || (getStatus( camp ) == STATUS_ABANDONED)) - { - - clearCurrentCamp( target ); - return null; - } - - return camp; - } - - - public static boolean setCurrentCamp(obj_id target, obj_id master) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(master)) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(VAR_CURRENT_CAMP, master); - return true; - } - - - public static boolean clearCurrentCamp(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.remove(VAR_CURRENT_CAMP); - return true; - } - - - public static float getCampSize(obj_id master) throws InterruptedException - { - int campPower = getIntObjVar( master, VAR_CAMP_POWER ) - 1; - if (campPower < 0) - { - campPower = 0; - } - return CAMP_SIZE[campPower]; - } - - - public static boolean isTooCloseToAnotherCamp(location here, obj_id creator) throws InterruptedException - { - if (here == null || !isIdValid(creator)) - { - return true; - } - - float range = 2 * MAX_SIZE + 1; - obj_id[] objs = getNonCreaturesInRange(here, range); - if ((objs == null) || (objs.length == 0)) - { - return false; - } - else - { - for (int i = 0; i < objs.length; i++) - { - testAbortScript(); - obj_id item = objs[i]; - - if (hasObjVar(item, VAR_OWNER)) - { - sendSystemMessage(creator, SID_ERROR_CAMP_TOO_CLOSE); - return true; - } - - if (player_structure.isBuilding( item )) - { - sendSystemMessage(creator, SID_ERROR_BUILDING_TOO_CLOSE); - return true; - } - } - } - - return false; - } - - - public static obj_id getCampOwner(obj_id master) throws InterruptedException - { - if (!isIdValid(master)) - { - return null; - } - - return getObjIdObjVar(master, VAR_OWNER); - } - - - public static boolean setCampOwner(obj_id master, obj_id newOwner) throws InterruptedException - { - if (!isIdValid(master) || !isIdValid(newOwner)) - { - return false; - } - - setObjVar(master, VAR_OWNER, newOwner); - setObjVar(newOwner, VAR_PLAYER_CAMP, master); - return true; - } - - - public static boolean clearCampOwner(obj_id master) throws InterruptedException - { - if (!isIdValid(master)) - { - return false; - } - - obj_id owner = getCampOwner(master); - if (isIdValid(owner)) - { - pclib.msgRemoveObjVar(owner, VAR_PLAYER_CAMP); - } - - setObjVar(master, VAR_OWNER, obj_id.NULL_ID); - return true; - } - - - public static boolean updateCampOwner(obj_id master, obj_id newOwner) throws InterruptedException - { - setCampOwner(master, newOwner); - - return setStatus(master, STATUS_MAINTAIN); - } - - - public static boolean campAbandoned(obj_id master) throws InterruptedException - { - - obj_id owner = getCampOwner( master ); - if (isIdValid( owner )) - { - - setObjVar(master, camping.VAR_CAMP_XP, 0); - } - - setName (master, SID_ABANDONED_CAMP); - - obj_id[] children = getObjIdArrayObjVar (master, "theater.children"); - if (children == null) - { - return true; - } - - int numKids = children.length; - - for (int x = 0; x < numKids; x ++) - { - testAbortScript(); - obj_id thisChild = children[x]; - if (hasScript (thisChild, "systems.camping.camp_controlpanel")) - { - setName (thisChild, SID_ABANDONED_CAMP); - } - } - clearCampOwner(master); - - messageTo(master, "handleNuke", null, 300f, false); - - return setStatus(master, STATUS_ABANDONED); - } - - - public static int getStatus(obj_id master) throws InterruptedException - { - if (!isIdValid(master)) - { - return STATUS_UNKNOWN; - } - - return getIntObjVar(master, VAR_STATUS); - } - - - public static boolean setStatus(obj_id master, int newStatus) throws InterruptedException - { - if (!isIdValid(master)) - { - return false; - } - - dictionary d = new dictionary(); - d.put(DICT_NEW_STATUS, newStatus); - messageTo(master, HANDLER_SET_STATUS, d, 0, false); - - return setObjVar(master, VAR_STATUS, newStatus); - } - - - public static boolean isOwnerInVicinity(obj_id master) throws InterruptedException - { - return getBooleanObjVar( master, VAR_OWNER_NEAR ); - } - - - public static void sendCampCreationHeartbeat(obj_id master) throws InterruptedException - { - messageTo(master, HANDLER_CAMP_CREATE, null, HEARTBEAT_CREATION, false); - } - - - public static void sendCampCreationComplete(obj_id master) throws InterruptedException - { - messageTo(master, HANDLER_CAMP_COMPLETE, null, HEARTBEAT_CREATION, false); - } - - - public static void sendCampMaintenanceHeartbeat(obj_id master) throws InterruptedException - { - messageTo(master, HANDLER_CAMP_MAINTAIN, null, HEARTBEAT_MAINTAIN, false); - } - - - public static void sendCampRestoreHeartbeat(obj_id master) throws InterruptedException - { - messageTo(master, HANDLER_CAMP_RESTORE, null, HEARTBEAT_RESTORE, false); - } - - - public static int campingSkillCheck(obj_id owner) throws InterruptedException - { - int roll = rand(0, 100); - - int chanceSuccess = getSkillStatMod(owner, MOD_CAMP); - int delta = chanceSuccess - roll; - - return delta; - } - - - public static void setCampMasterName(obj_id master) throws InterruptedException - { - if (isIdValid(master)) - { - setName( master, ""); - setName(master, SID_CAMP_MASTER_NAME); - } - } - - - public static int getCampRepelValue(obj_id target) throws InterruptedException - { - if (isIdValid(target)) - { - return -1; - } - - obj_id master = getCurrentCamp(target); - if (!isIdValid(master)) - { - return 0; - } - else - { - int val = getIntObjVar(master, VAR_CAMP_REPEL); - return val; - } - } - - - public static boolean repelledByCamp(obj_id npc, obj_id player) throws InterruptedException - { - - if (!isIdValid(npc)) - { - return false; - } - if (!isIdValid(player)) - { - return false; - } - - obj_id camp = getCurrentCamp( player ); - if (!isIdValid(camp)) - { - return false; - } - - int repel = getIntObjVar( camp, VAR_CAMP_REPEL ); - int maxlevel = (repel-2)*15 + 20; - if (ai_lib.getLevel( npc ) <= maxlevel) - { - return true; - } - else - { - return false; - } - } - - - public static float getCampHealModifier(obj_id master) throws InterruptedException - { - int campPower = getIntObjVar( master, VAR_CAMP_POWER ); - - switch ( campPower ) - { - case 1: - return 0.65f; - case 2: - return 0.65f; - case 3: - return 0.75f; - case 4: - return 0.85f; - case 5: - return 0.95f; - case 6: - return 1.0f; - default: - return 0.65f; - } - } - - - public static boolean isRecruiterModule(String module_template) throws InterruptedException - { - if (( (module_template.equals("object/building/poi/player_camp_imperial_recruiter.iff")) || (module_template.equals("object/building/poi/player_camp_rebel_recruiter.iff")) )) - { - return true; - } - return false; - } - - - public static boolean validateRecruiter(obj_id player, String module_template, int recruitersPlaced) throws InterruptedException - { - if (!isRecruiterModule(module_template)) - { - return true; - } - - String playerFaction = factions.getFaction(player); - if (playerFaction == null || playerFaction.equals("")) - { - if (recruitersPlaced == 0) - { - return true; - } - return false; - - } - - if (playerFaction.equals(factions.FACTION_IMPERIAL)) - { - if (module_template.equals("object/building/poi/player_camp_imperial_recruiter.iff")) - { - if (recruitersPlaced == 0) - { - return true; - } - } - } - - if (playerFaction.equals(factions.FACTION_REBEL)) - { - if (module_template.equals("object/building/poi/player_camp_rebel_recruiter.iff")) - { - if (recruitersPlaced == 0) - { - return true; - } - } - } - - return false; - } - - - public static void initializeAdvancedCamp(obj_id deed, obj_id camp, obj_id player, location loc) throws InterruptedException - { - setObjVar(camp, VAR_OWNER, player); - attachScript(camp, "item.camp.camp_advanced"); - - String name = getFirstName(player); - name += "'s Camp"; - - setName(camp, name); - - int numNodes = getAdvancedCampNumberOfNodes(camp); - if (numNodes > 6) - { - numNodes = 6; - } - - obj_id[] nodeObjects = new obj_id[numNodes]; - int arrayIdx = 0; - - obj_var_list ovl = getObjVarList(deed, "modules"); - - float lifetime = 0f; - lifetime += ovl.getFloatObjVar("lifetime"); - - int recruitersPlaced = 0; - if (ovl != null) - { - String[] modules = ovl.getAllObjVarNames(); - - if (modules != null && modules.length > 0) - { - int nodeCount = 1; - int i = 0; - - while (nodeCount <= numNodes && i < modules.length) - { - testAbortScript(); - if (modules[i] != null && !modules[i].equals("")) - { - if (ovl.getFloatObjVar(modules[i]) != 0.0f) - { - location tempLoc = (location)loc.clone(); - location nodeLoc = getAdvancedCampNodeLocation(camp, tempLoc, nodeCount); - int nodeYaw = getAdvancedCampNodeYaw(camp, nodeCount); - - String module_template = ""; - - if (modules[i].equals("shuttle_beacon")) - { - module_template = "object/building/poi/player_camp_shuttle_beacon.iff"; - } - else if (modules[i].equals("cloning_tube")) - { - module_template = "object/building/poi/player_camp_clone_tube.iff"; - } - else if (modules[i].equals("entertainer")) - { - module_template = "object/building/poi/player_camp_entertainment_area.iff"; - } - else if (modules[i].equals("junk_dealer")) - { - module_template = "object/building/poi/player_camp_junk_dealer.iff"; - } - else if (modules[i].equals("clothing_station")) - { - module_template = "object/building/poi/player_camp_crafting_clothing.iff"; - } - else if (modules[i].equals("food_station")) - { - module_template = "object/building/poi/player_camp_crafting_food.iff"; - } - else if (modules[i].equals("ship_station")) - { - module_template = "object/building/poi/player_camp_crafting_space.iff"; - } - else if (modules[i].equals("structure_station")) - { - module_template = "object/building/poi/player_camp_crafting_structure.iff"; - } - else if (modules[i].equals("weapon_station")) - { - module_template = "object/building/poi/player_camp_crafting_weapon.iff"; - } - else if (modules[i].equals("imperial")) - { - module_template = "object/building/poi/player_camp_imperial_recruiter.iff"; - } - else if (modules[i].equals("rebel")) - { - module_template = "object/building/poi/player_camp_rebel_recruiter.iff"; - } - else if (modules[i].equals("extra_life")) - { - module_template = "object/static/structure/corellia/corl_power_transformer_s01.iff"; - lifetime += ovl.getFloatObjVar("extra_life"); - - } - - if (!module_template.equals("")) - { - if (validateRecruiter(player, module_template, recruitersPlaced)) - { - obj_id module_id = create.object(module_template, nodeLoc); - if (isRecruiterModule(module_template)) - { - recruitersPlaced = recruitersPlaced +1; - } - if (isIdValid(module_id)) - { - setYaw(module_id, nodeYaw); - setName(module_id, name); - copyObjVar(deed, module_id, "modules."+ modules[i]); - - nodeObjects[arrayIdx] = module_id; - arrayIdx++; - - nodeCount++; - } - } - else - { - sendSystemMessage(player, SID_RECRUITER_MODULE_ABORTED); - } - } - } - } - - i++; - } - - copyObjVar(deed, camp, "modules"); - } - } - setObjVar(camp, "modules.ids", nodeObjects); - setObjVar(camp, VAR_LIFETIME, lifetime); - setObjVar(camp, VAR_CREATION_TIME, getCalendarTime()); - - messageTo(camp, "handleControlTerminalLocation", null, 10f, false); - messageTo(camp, "handleCampDecay", null, lifetime, false); - } - - - public static float getAdvancedCampRadius(obj_id camp) throws InterruptedException - { - String filename = utils.getTemplateFilenameNoPath(camp); - return dataTableGetFloat(CAMP_DATATABLE, filename, "radius"); - } - - - public static int getAdvancedCampNumberOfNodes(obj_id camp) throws InterruptedException - { - String filename = utils.getTemplateFilenameNoPath(camp); - return dataTableGetInt(CAMP_DATATABLE, filename, "nodes"); - } - - - public static int getAdvancedCampNodeYaw(obj_id camp, int node) throws InterruptedException - { - String filename = utils.getTemplateFilenameNoPath(camp); - String yawCol = "yaw"+ node; - - return dataTableGetInt(CAMP_DATATABLE, filename, yawCol); - } - - - public static location getAdvancedCampNodeLocation(obj_id camp, location loc, int node) throws InterruptedException - { - String filename = utils.getTemplateFilenameNoPath(camp); - - String xCol = "x"+ node; - String zCol = "z"+ node; - - float x = dataTableGetFloat(CAMP_DATATABLE, filename, xCol); - float z = dataTableGetFloat(CAMP_DATATABLE, filename, zCol); - - loc.x += x; - loc.z += z; - - return loc; - } - - - public static obj_id getCurrentAdvancedCamp(obj_id player) throws InterruptedException - { - obj_id[] objects = getNonCreaturesInRange(player, 25.0f); - - if (objects == null || objects.length == 0) - { - return null; - } - - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (hasScript(objects[i], "item.camp.camp_advanced")) - { - if (isInTriggerVolume(objects[i], "campsite", player)) - { - return objects[i]; - } - } - } - - return null; - } - - - public static boolean isInEntertainmentCamp(obj_id player) throws InterruptedException - { - return isInEntertainmentCamp(player, obj_id.NULL_ID); - } - - - public static boolean isInEntertainmentCamp(obj_id player, obj_id camp) throws InterruptedException - { - if (!isIdValid(camp)) - { - camp = getCurrentAdvancedCamp(player); - } - - if (!isIdValid(camp)) - { - return false; - } - - if (hasObjVar(camp, "modules.entertainer")) - { - return true; - } - - return false; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/collection.java b/sku.0/sys.server/compiled/game/script/library/collection.java deleted file mode 100644 index ae6ae37c8..000000000 --- a/sku.0/sys.server/compiled/game/script/library/collection.java +++ /dev/null @@ -1,1946 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.util.HashSet; -import script.library.badge; -import script.library.buff; -import script.library.gcw; -import script.library.groundquests; -import script.library.prose; -import script.library.skill; -import script.library.static_item; -import script.library.stealth; -import script.library.sui; -import script.library.utils; -import script.library.xp; - - -public class collection extends script.base_script -{ - public collection() - { - } - public static final String COLLECTION_REWARD_TABLE = "datatables/collection/rewards.iff"; - public static final String COLLECTION_TABLE = "datatables/collection/collection.iff"; - public static final String COLLECTION_NPC_TABLE = "datatables/collection/collection_npc.iff"; - public static final String QUEST__COMPLETED_COLLECTIONS = "datatables/collection/quest_completion_collections.iff"; - public static final String COL_NPC_PID = "collection_npc"; - public static final String CONSUME_PID_NAME = "collectionConsume"; - public static final String REWARD_ON_UPDATE_CATEGORY = "rewardOnUpdate"; - public static final String REWARD_ON_COMPLETE_CATEGORY = "rewardOnComplete"; - public static final String CLEAR_ON_COMPLETE = "clearOnComplete"; - public static final String CATEGORY_PREREQ_MET = "grantIfPreReqMet"; - public static final String CATEGORY_UPDATE_ON_COUNT = "updateOnCount"; - public static final String NO_MESSAGE_CATEGORY = "noMessage"; - public static final String CRAFTING_TEMPLATE = "crafting_template"; - public static final String OBJVAR_SLOT_NAME = "collection.slotName"; - public static final String OBJVAR_PAGE_NAME = "collection.pageName"; - public static final String ENT_BUFF_COLLECTION_01 = "col_entertainer_01"; - public static final String COL_BUFF_TRACKER = "collection.buffTracker"; - public static final String COL_HEROIC_SD_TAXI_SERVICE = "heroic_sd_taxi_service_01"; - public static final String COL_HEROIC_SD_SMUGGLE_OBJVAR = "collection.heroic_sd_smuggle_timer"; - public static final String COL_SLOT_SMUGGLE_GROUPS = "smuggled_groups"; - public static final String COL_BUFF_ARRAY = "collection.buffTracker"; - public static final String AUTO_STACK_SCRIPT = "object.autostack"; - public static final String CATEGORY_NUM_ALT_TITLES = "numAltTitles"; - - public static final boolean LOGGING_ENABLED = true; - - public static final float MAX_HATE_RADIUS_ON_CLICK_COL = 15.0f; - - public static final int MAXLOOP = 7; - public static final int REQUIRED_TIME_LAPSE = 21600; - - public static final int CONST_ROLL_CHANCE = 50; - - public static final int CONST_RESOURCE_ROLL = 4; - public static final String PRISTINE_MEAT = "col_pristine_meat_02_01"; - public static final String PRISTINE_HIDE = "col_pristine_hide_02_01"; - public static final String PRISTINE_BONE = "col_pristine_bone_02_01"; - public static final String PRISTINE_EGG = "col_pristine_egg_02_01"; - public static final String PRISTINE_MILK = "col_pristine_milk_02_01"; - - public static final string_id SID_REWARD_XP = new string_id("collection","reward_xp_amount"); - public static final string_id SID_REWARD_ITEM = new string_id("collection","reward_item"); - public static final string_id SID_REWARD_SKILL_MOD = new string_id("collection","reward_skill_mod"); - public static final string_id SID_SLOT_INCREMENT = new string_id("collection","player_slot_increment"); - public static final string_id SID_SYS_NO_COMBAT = new string_id("collection","click_not_combat"); - public static final string_id SID_SYS_NO_MOUNT = new string_id("collection","click_not_mounted"); - public static final string_id SID_SYS_NO_DEAD_INCAP = new string_id("collection","click_not_dead_incap"); - public static final string_id SID_NEED_TO_ACTIVATE_COLLECTION = new string_id("collection", "need_to_activate_collection"); - public static final string_id SID_MAX_ACTIVE = new string_id("collection", "max_active_collections"); - public static final string_id COMPLETE_COLLECTION_CAN_NOT_CLEAR = new string_id("collection", "collection_complete_can_not_clear"); - public static final string_id COLLECTION_CLEARED = new string_id("collection", "collection_cleared"); - public static final string_id SID_SYS_QUEST_INCORRECT = new string_id("collection", "collection_quest_wrong"); - public static final String SUI_DELETE_TITLE = "@collection:collection_sui_delete_title"; - public static final String SUI_DELETE_PROMPT = "@collection:collection_sui_delete_prompt"; - public static final String COL_NPC_PROMPT = "@collection:col_npc_prompt"; - public static final String COL_NPC_TITLE = "@collection:col_npc_title"; - public static final string_id SID_COLLECTION_RESET = new string_id("collection","player_collection_reset"); - public static final string_id UPDATED_ENTERTAINER_COLLECTION = new string_id("collection", "update_entertainer"); - public static final string_id SUCCESSFUL_SMUGGLE_ATTEMPT = new string_id("collection", "successful_smuggle_attempt"); - public static final string_id SMUGGLE_ATTEMPT_TIME_ISSUE = new string_id("collection", "smuggle_attempt_time_issue"); - public static final string_id DRIVING_SOROSUUB = new string_id("collection", "driving_sorosuub"); - public static final string_id STILL_HAS_TAXI_BUFF = new string_id("collection", "still_has_taxi_buff"); - public static final string_id SID_ALREADY_FINISHED_COLLECTION = new string_id("collection", "already_finished_collection"); - public static final string_id SID_NOT_CLOSE_ENOUGH = new string_id("collection", "not_close_enough"); - public static final string_id SID_ALREADY_HAVE_SLOT = new string_id("collection", "already_have_slot"); - public static final string_id SID_REPORT_CONSUME_ITEM_FAIL = new string_id("collection", "report_consume_item_fail"); - - public static final String[] ICE_CREAM_BUFF_ARRAY = - { - "item_ice_cream_buff_debuff_01_01", - "item_ice_cream_buff_forage_buff_01_01", - "item_ice_cream_buff_health_01_01", - "item_ice_cream_buff_action_01_01", - "item_ice_cream_buff_xp_bonus_01_01", - "item_ice_cream_buff_remove_weakened_01_01", - "item_ice_cream_buff_remove_debuff_01_01", - "item_ice_cream_buff_action_reduction_01_01" - }; - - public static final String FRYER_BUFF_TYPE = "ice_cream_category"; - public static final int ICE_CREAM_ALL_PLAYERS = 0; - public static final int ICE_CREAM_DOMESTICS_ONLY = 1; - public static final int MAX_RANGE_TO_COLLECT = 5; - - - public static void blog(String identifier, String text) throws InterruptedException - { - if (LOGGING_ENABLED) - { - LOG(identifier, text); - } - } - - - public static boolean grantCollectionReward(obj_id player, String collectionName, boolean canResetCollection) throws InterruptedException - { - LOG("debug_collection","grantCollectionReward for player: "+player+" collectionName: "+collectionName); - if (!isIdValid(player) || !exists(player)) - { - return false; - } - if (collectionName == null || collectionName.equals("")) - { - return false; - } - - int row = dataTableSearchColumnForString(collectionName, "collection_name", COLLECTION_REWARD_TABLE); - - if (row < 0) - { - - blog("COLLECTIONS", "collection with no entry in rewards table. Collection name is "+ collectionName); - - return false; - } - - dictionary dict = dataTableGetRow(COLLECTION_REWARD_TABLE, row); - - if (dict == null || dict.isEmpty()) - { - return false; - } - - LOG("debug_collection","grantCollectionReward for dict: "+dict); - - String slotName = dict.getString("slot_name"); - String quest = dict.getString("quest"); - String item = dict.getString("item"); - String command = dict.getString("command"); - String skillMod = dict.getString("skill_mod"); - String questSignal = dict.getString("quest_signal"); - int grantRandom = dict.getInt("grantRandomItem"); - int grantWeightedRandom = dict.getInt("grantWeightedRandom"); - int itemIncrement = dict.getInt("stackAmount"); - - prose_package pp = new prose_package(); - - LOG("debug_collection","grantCollectionReward for player: "+player+" collectionName: "+collectionName+" THE ITEM: "+item); - - if (slotName != null && !slotName.equals("")) - { - - String[] badges = split(slotName, ','); - blog("COLLECTIONS", "badges.length: "+ badges.length + " badges[0]: "+ badges[0]); - for (int i = 0; i < badges.length; ++i) - { - testAbortScript(); - String[] info = getCollectionSlotInfo(badges[i]); - if ((info != null) || (info.length == COLLECTION_INFO_ARRAY_SIZE) || (info[COLLECTION_INFO_INDEX_BOOK] != null)) - { - if (info[COLLECTION_INFO_INDEX_BOOK].equals("badge_book")) - { - badge.grantBadge(player, badges[i]); - } - else - { - modifyCollectionSlotValue(player, badges[i], 1); - } - } - else - { - - } - } - CustomerServiceLog("CollectionComplete: ", "Player "+ getFirstName(player) + "("+ player + ") has completed "+ collectionName + " and was granted Slot"+ slotName + "."); - } - - LOG("debug_collection","grantCollectionReward for player: "+player+" collectionName: "+collectionName+" made it to xp"); - - int xpAmount = 0; - boolean spaceType = false; - - int isSpaceXP = dataTableGetInt(collection.COLLECTION_REWARD_TABLE, collectionName, "is_space_xp"); - - if (isSpaceXP == 1) - { - spaceType = true; - xpAmount = xp.grantCollectionSpaceXP(player, collectionName); - } - else - { - - xpAmount = xp.grantCollectionXP(player, collectionName); - } - - if (xpAmount > 0) - { - - prose.setStringId(pp, SID_REWARD_XP); - prose.setDI(pp, xpAmount); - sendSystemMessageProse(player, pp); - - if (spaceType) - { - xp.grant(player, xp.SPACE_COMBAT_GENERAL, xpAmount, true); - } - else - { - xp.grantXpByTemplate(player, xpAmount); - } - CustomerServiceLog("CollectionComplete: ", "Player "+ getFirstName(player) + "("+ player + ") has completed "+ collectionName + " and was granted XP: "+ xpAmount + "."); - } - - if (quest != null && !quest.equals("")) - { - - String[] quests = split(quest, ','); - for (int i = 0; i < quests.length; ++i) - { - testAbortScript(); - int result = groundquests.grantQuestNoAcceptUI(player, quests[i], false); - if (result > 0) - { - logQuestError(player, quest, result); - } - } - } - LOG("debug_collection","grantCollectionReward for player: "+player+" collectionName: "+collectionName+" made it to item"); - - if (item != null && !item.equals("")) - { - LOG("debug_collection","grantCollectionReward collectionName: "+collectionName+" item: "+item); - - Vector allNewObjectsResizable = new Vector(); - allNewObjectsResizable.setSize(0); - obj_id itemId = null; - String[] items = split(item, ','); - - if (grantRandom == 1) - { - itemId = getRandomItem(player, items, collectionName, pp); - if (!isValidId(itemId)) - { - return false; - } - utils.addElement(allNewObjectsResizable, itemId); - if (itemIncrement > 1 && hasScript(itemId, AUTO_STACK_SCRIPT)) - { - setCount(itemId, itemIncrement); - } - } - else if (grantWeightedRandom == 1) - { - itemId = getWeightedRandomItem(player, items, collectionName, pp); - if (!isValidId(itemId)) - { - return false; - } - - utils.addElement(allNewObjectsResizable, itemId); - if (itemIncrement > 1 && hasScript(itemId, AUTO_STACK_SCRIPT)) - { - setCount(itemId, itemIncrement); - } - } - else - { - LOG("debug_collection","grantCollectionReward collectionName reward item not random or weighted: "+item); - - for (int i = 0; i < items.length; ++i) - { - testAbortScript(); - if (static_item.isStaticItem(items[i])) - { - LOG("debug_collection","grantCollectionReward collectionName reward item is static item: "+item); - - itemId = createStaticItemWithMessage(player, items[i], collectionName, pp); - if (!isValidId(itemId)) - { - return false; - } - - LOG("debug_collection","grantCollectionReward collectionName reward item awarded to player"); - - utils.addElement(allNewObjectsResizable, itemId); - } - else - { - itemId = createTemplateItemWithMessage(player, items[i], collectionName, pp); - if (!isValidId(itemId)) - { - return false; - } - - utils.addElement(allNewObjectsResizable, itemId); - } - if (itemIncrement > 1 && hasScript(itemId, AUTO_STACK_SCRIPT)) - { - setCount(itemId, itemIncrement); - } - } - } - obj_id[] finalLootList = new obj_id[allNewObjectsResizable.size()]; - allNewObjectsResizable.toArray(finalLootList); - showLootBox(player, finalLootList); - } - - if (command != null && !command.equals("")) - { - String[] commands = split(command, ','); - for (int i = 0; i < commands.length; ++i) - { - testAbortScript(); - grantCommand(player, commands[i]); - CustomerServiceLog("CollectionComplete: ", "Player "+ getFirstName(player) + "("+ player + ") has completed "+ collectionName + " and was granted Command: "+ command + "."); - } - } - - if (skillMod != null && !skillMod.equals("")) - { - int skillModAmount = dict.getInt("skill_mod_amount"); - int skillModMax = dict.getInt("skill_mod_max"); - - String[] skillMods = split(skillMod, ','); - for (int i = 0; i < skillMods.length; ++i) - { - testAbortScript(); - int currentSkillModAmount = getSkillStatMod(player, skillMods[i]); - - if (currentSkillModAmount < skillModMax || skillModMax == -1) - { - prose.setStringId(pp, SID_REWARD_SKILL_MOD); - prose.setDI(pp, skillModAmount); - prose.setTT(pp, new string_id("stat_n", skillMods[i])); - applySkillStatisticModifier(player, skillMods[i], skillModAmount); - sendSystemMessageProse(player, pp); - CustomerServiceLog("CollectionComplete: ", "Player "+ getFirstName(player) + "("+ player + ") has completed "+ collectionName + " and was granted SkillMod: "+ skillMods[i] + "."); - } - } - } - - if (questSignal != null && !questSignal.equals("")) - { - groundquests.sendSignal(player, questSignal); - CustomerServiceLog("CollectionComplete: ", "Player "+ getFirstName(player) + "("+ player + ") has completed "+ collectionName + " and was granted QuestSignal "+ questSignal + "."); - } - - if (canResetCollection == true) - { - removeCompletedCollection(player, collectionName); - } - - return true; - } - - - public static boolean updateCraftingSlot(obj_id player, String template) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - if (template == null || template.equals("")) - { - return false; - } - - String[] collectionTemplateCol = dataTableGetStringColumn(COLLECTION_REWARD_TABLE, CRAFTING_TEMPLATE ); - - if (collectionTemplateCol == null || collectionTemplateCol.equals("")) - { - return false; - } - - int row = dataTableSearchColumnForString(template, CRAFTING_TEMPLATE, COLLECTION_REWARD_TABLE); - - if (row < 0) - { - blog("COLLECTIONS", "Collection Reward Table did not have template data to increment slot for crafting collection for "+ template + "."); - return false; - } - - String category = dataTableGetString(COLLECTION_REWARD_TABLE, row, "category"); - if (category == null || category.equals("")) - { - blog("COLLECTIONS", "Collection Reward Table had a template but no category for "+ template + "."); - return false; - } - - String[] slotNames = getAllCollectionSlotsInCategory(category); - - if (slotNames == null || slotNames.length <= 0) - { - return false; - } - - for (int i = 0; i < slotNames.length; ++i) - { - testAbortScript(); - if (hasCompletedCollectionSlot(player, slotNames[i])) - { - continue; - } - - String[] collectionInfo = getCollectionSlotInfo(slotNames[i]); - String collectionName = collectionInfo[COLLECTION_INFO_INDEX_COLLECTION]; - - modifyCollectionSlotValue(player, slotNames[i], 1); - - blog("COLLECTIONS", "Updating allslotName "+ slotNames[i]); - - if (hasCompletedCollectionSlot(player, slotNames[i])) - { - continue; - } - - prose_package pp = new prose_package(); - prose.setStringId(pp, SID_SLOT_INCREMENT); - prose.setTU(pp, new string_id("collection_n", slotNames[i])); - prose.setTO(pp, new string_id("collection_n", collectionName)); - sendSystemMessageProse(player, pp); - } - return true; - } - - - public static boolean checkState(obj_id player) throws InterruptedException - { - if (getState(player, STATE_COMBAT) == 1) - { - sendSystemMessage(player, SID_SYS_NO_COMBAT); - return false; - } - if (getState(player, STATE_RIDING_MOUNT) == 1) - { - sendSystemMessage(player, SID_SYS_NO_MOUNT); - return false; - } - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, SID_SYS_NO_DEAD_INCAP); - return false; - } - return true; - } - - - public static boolean checkDistance(obj_id clickObj, obj_id player, int maxDist) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - location objLoc = getLocation(clickObj); - if (objLoc == null || objLoc.equals("")) - { - return false; - } - - location playerLoc = getLocation(player); - if (playerLoc == null || playerLoc.equals("")) - { - return false; - } - - float dist = utils.getDistance2D(objLoc, playerLoc); - if (dist > maxDist || dist < 0) - { - return false; - } - - return true; - } - - - public static boolean giveAreaMobsHate(obj_id collectible, obj_id player) throws InterruptedException - { - if (hasObjVar(collectible, "collection.aggro")) - { - boolean hasAggro = getBooleanObjVar(collectible, "collection.aggro"); - if (!hasAggro) - { - return false; - } - } - - if (!isIdValid(collectible) || !exists(collectible)) - { - return false; - } - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - location collectibleLoc = getLocation(collectible); - if (collectibleLoc == null) - { - return false; - } - - obj_id[] allMobsCombat = getAllNpcs(collectibleLoc, MAX_HATE_RADIUS_ON_CLICK_COL); - if (allMobsCombat == null || allMobsCombat.length < 1) - { - return false; - } - - blog("collection","length of mobs: "+allMobsCombat.length); - - for (int i = 0; i < allMobsCombat.length; i++) - { - testAbortScript(); - - if (allMobsCombat[i] == player) - { - continue; - } - if (hasObjVar(allMobsCombat[i], "ignoreCollector")) - { - continue; - } - if (isInvulnerable(allMobsCombat[i])) - { - continue; - } - if (pvpCanAttack(allMobsCombat[i], player)) - { - startCombat(allMobsCombat[i], player); - } - - } - return true; - } - - - public static void showNpcCollections(obj_id player, obj_id npc, String columnName) throws InterruptedException - { - if (sui.hasPid(player, COL_NPC_PID)) - { - int pid = sui.getPid(player, COL_NPC_PID); - forceCloseSUIPage(pid); - } - - HashSet availableCollections = new HashSet(); - HashSet active_collection = new HashSet(); - - String[] allCollections = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, columnName); - int columnNumber = dataTableFindColumnNumber(COLLECTION_NPC_TABLE, columnName); - String[] prereqColumn = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, (columnNumber + 1)); - - for (int i = 0; i < allCollections.length; i++) - { - testAbortScript(); - if (!hasCompletedCollectionSlot(player, prereqColumn[i])) - { - availableCollections.add(allCollections[i]); - } - else if (hasCompletedCollectionSlot(player, prereqColumn[i]) && !hasCompletedCollection(player, allCollections[i])) - { - active_collection.add(allCollections[i]); - } - } - - String[] strArrayAvailableCollections = new String[availableCollections.size()]; - availableCollections.toArray(strArrayAvailableCollections); - - String[] activeCollections = new String[active_collection.size()]; - active_collection.toArray(activeCollections); - - if (activeCollections.length >= 2) - { - sendSystemMessage(player, SID_MAX_ACTIVE); - return; - } - - String[] SUIcollectionNames = new String[strArrayAvailableCollections.length]; - - for (int q = 0; q < strArrayAvailableCollections.length; q++) - { - testAbortScript(); - SUIcollectionNames[q] = "@collection_n:" + strArrayAvailableCollections[q]; - } - - utils.setScriptVar(player, "collection.allCollections", strArrayAvailableCollections); - int pid = sui.listbox( npc, player, COL_NPC_PROMPT, sui.OK_CANCEL, COL_NPC_TITLE, SUIcollectionNames, "handleCollectionNpc", true ); - sui.setPid(player, pid, COL_NPC_PID); - } - - - public static void findAndGrantSlot(obj_id player, obj_id npc, String selectedCollection) throws InterruptedException - { - String collectionColumn = ""; - String slotToGrant = ""; - - if (utils.hasObjVar(npc, "collection.columnName")) - { - collectionColumn = getStringObjVar(npc, "collection.columnName"); - } - else - { - return; - } - - int columnNumber = dataTableFindColumnNumber(COLLECTION_NPC_TABLE, collectionColumn); - - String[] allCollections = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, collectionColumn); - String[] grantColumn = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, (columnNumber + 1)); - - for (int r = 0; r < allCollections.length; r++) - { - testAbortScript(); - if (allCollections[r].equals(selectedCollection)) - { - modifyCollectionSlotValue(player, grantColumn[r], 1); - } - } - } - - - public static boolean checkMaxActive(obj_id player, obj_id npc, String columnName) throws InterruptedException - { - HashSet active_collection = new HashSet(); - - if (!hasObjVar(npc, "collection.columnName")) - { - return true; - } - String[] allCollections = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, columnName); - int columnNumber = dataTableFindColumnNumber(COLLECTION_NPC_TABLE, columnName); - String[] prereqColumn = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, (columnNumber + 1)); - - if (allCollections == null || allCollections.length <= 0) - { - return false; - } - if (prereqColumn == null || prereqColumn.length <= 0) - { - return false; - } - - for (int i = 0; i < allCollections.length; i++) - { - testAbortScript(); - if (hasCompletedCollectionSlot(player, prereqColumn[i]) && !hasCompletedCollection(player, allCollections[i])) - { - active_collection.add(allCollections[i]); - } - } - - String[] activeCollections = new String[active_collection.size()]; - active_collection.toArray(activeCollections); - - if (activeCollections.length >= 2) - { - return true; - } - return false; - } - - - public static boolean npcHasMoreCollections(obj_id player, obj_id npc, String columnName) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - if (!isIdValid(npc) || !exists(npc)) - { - return false; - } - if (columnName == null || columnName.equals("")) - { - return false; - } - - HashSet playerCollections = new HashSet(); - - if (!hasObjVar(npc, "collection.columnName")) - { - return false; - } - - String[] allCollections = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, columnName); - int columnNumber = dataTableFindColumnNumber(COLLECTION_NPC_TABLE, columnName); - String[] prereqColumn = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, (columnNumber + 1)); - - if (allCollections == null || allCollections.length <= 0) - { - return false; - } - - if (prereqColumn == null || prereqColumn.length <= 0) - { - return false; - } - - for (int i = 0; i < allCollections.length; i++) - { - testAbortScript(); - if (hasCompletedCollectionSlot(player, prereqColumn[i])) - { - playerCollections.add(allCollections[i]); - - } - } - - String[] activeOrComplete = new String[playerCollections.size()]; - playerCollections.toArray(activeOrComplete); - - if (activeOrComplete.length == allCollections.length) - { - return false; - } - return true; - } - - - public static String[] getAllCollectionsForItem(obj_id collectible) throws InterruptedException - { - if (!isIdValid(collectible) || !exists(collectible)) - { - return null; - } - - String[] baseSlotNames = split(getStringObjVar(collectible, OBJVAR_SLOT_NAME), '|'); - - Vector collectionNames = new Vector(); - - for (int i = 0; i < baseSlotNames.length; ++i) - { - testAbortScript(); - - String[] splitSlotNames = split(baseSlotNames[i], ':'); - collection.blog("COLLECTIONS", "splitSlotNames.length "+ splitSlotNames.length); - - for (int j = 0; j < splitSlotNames.length; j += 2) - { - testAbortScript(); - collectionNames.add(splitSlotNames[j]); - } - - } - - String[] availableCollections = new String[collectionNames.size()]; - collectionNames.toArray(availableCollections); - return availableCollections; - } - - - public static String[] getAllSlotsForItem(obj_id collectible) throws InterruptedException - { - if (!isIdValid(collectible) || !exists(collectible)) - { - return null; - } - - String[] baseSlotNames = split(getStringObjVar(collectible, OBJVAR_SLOT_NAME), '|'); - - Vector slotNames = new Vector(); - - for (int i = 0; i < baseSlotNames.length; ++i) - { - testAbortScript(); - - String[] splitSlotNames = split(baseSlotNames[i], ':'); - - collection.blog("COLLECTIONS", "splitSlotNames.length "+ splitSlotNames.length); - - for (int j = 0; j < splitSlotNames.length; j += 2) - { - testAbortScript(); - slotNames.add(splitSlotNames[j + 1]); - } - - } - - String[] availableSlots = new String[slotNames.size()]; - slotNames.toArray(availableSlots); - return availableSlots; - } - - - public static String[] getAllAvailableCollectionsForItem(obj_id player, obj_id collectible) throws InterruptedException - { - if (!isIdValid(collectible) || !exists(collectible)) - { - return null; - } - - String[] baseSlotNames = split(getStringObjVar(collectible, OBJVAR_SLOT_NAME), '|'); - - Vector collectionNames = new Vector(); - - for (int i = 0; i < baseSlotNames.length; ++i) - { - testAbortScript(); - - String[] splitSlotNames = split(baseSlotNames[i], ':'); - collection.blog("COLLECTIONS", "splitSlotNames.length "+ splitSlotNames.length); - - for (int j = 0; j < splitSlotNames.length; j += 2) - { - testAbortScript(); - collection.blog("COLLECTIONS", "splitSlotNames["+ j + "] "+ splitSlotNames[j]); - - if (!hasCompletedCollection(player, splitSlotNames[j])) - { - - if (!hasCompletedCollectionSlot(player, splitSlotNames[j + 1])) - { - - if (hasCompletedCollectionSlotPrereq(player, splitSlotNames[j + 1])) - { - - collectionNames.add(splitSlotNames[j]); - } - } - } - } - - } - - String[] availableCollections = new String[collectionNames.size()]; - collectionNames.toArray(availableCollections); - return availableCollections; - } - - - public static String[] getAllAvailableSlotsForItem(obj_id player, obj_id collectible) throws InterruptedException - { - if (!isIdValid(collectible) || !exists(collectible)) - { - return null; - } - - String[] baseSlotNames = split(getStringObjVar(collectible, OBJVAR_SLOT_NAME), '|'); - - Vector slotNames = new Vector(); - - for (int i = 0; i < baseSlotNames.length; ++i) - { - testAbortScript(); - - String[] splitSlotNames = split(baseSlotNames[i], ':'); - collection.blog("COLLECTIONS", "splitSlotNames.length "+ splitSlotNames.length); - - for (int j = 0; j < splitSlotNames.length; j += 2) - { - testAbortScript(); - collection.blog("COLLECTIONS", "splitSlotNames["+ j + "] "+ splitSlotNames[j]); - - if (!hasCompletedCollection(player, splitSlotNames[j])) - { - - if (!hasCompletedCollectionSlot(player, splitSlotNames[j + 1])) - { - - if (hasCompletedCollectionSlotPrereq(player, splitSlotNames[j + 1])) - { - - slotNames.add(splitSlotNames[j + 1]); - } - } - } - } - - } - - String[] availableSlots = new String[slotNames.size()]; - slotNames.toArray(availableSlots); - return availableSlots; - } - - - public static boolean removeCollectionForRealsies(obj_id player, String collectionName) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - if (collectionName == null || collectionName.equals("")) - { - return false; - } - - String[] slotsInCollection = getAllCollectionSlotsInCollection(collectionName); - - for (int i = 0; i < slotsInCollection.length; i++) - { - testAbortScript(); - - long collectionSlotValue = getCollectionSlotValue(player, slotsInCollection[i]) * -1; - - modifyCollectionSlotValue(player, slotsInCollection[i], collectionSlotValue); - } - sendSystemMessage(player, COLLECTION_CLEARED); - return true; - } - - - public static boolean revokeThenGrantCollection(obj_id player, String collectionName) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - if (collectionName == null || collectionName.equals("")) - { - return false; - } - - String[] slotsInCollection = getAllCollectionSlotsInCollection(collectionName); - - for (int i = 0; i < slotsInCollection.length; i++) - { - testAbortScript(); - - long collectionSlotNegativeValue = getCollectionSlotValue(player, slotsInCollection[i]) * -1; - long collectionSlotPostiveValue = getCollectionSlotValue(player, slotsInCollection[i]); - - modifyCollectionSlotValue(player, slotsInCollection[i], collectionSlotNegativeValue); - modifyCollectionSlotValue(player, slotsInCollection[i], collectionSlotPostiveValue); - } - sendSystemMessageTestingOnly(player, "Collection Revoked and Regranted."); - return true; - } - - - public static boolean removeCollection(obj_id player, String collectionName) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - if (collectionName == null || collectionName.equals("")) - { - return false; - } - - if (hasCompletedCollection(player, collectionName)) - { - sendSystemMessage(player, COMPLETE_COLLECTION_CAN_NOT_CLEAR); - return false; - } - - String[] slotsInCollection = getAllCollectionSlotsInCollection(collectionName); - - for (int i = 0; i < slotsInCollection.length; i++) - { - testAbortScript(); - - long collectionSlotValue = getCollectionSlotValue(player, slotsInCollection[i]) * -1; - - modifyCollectionSlotValue(player, slotsInCollection[i], collectionSlotValue); - } - sendSystemMessage(player, COLLECTION_CLEARED); - CustomerServiceLog("Collection: ", "Player "+ getFirstName(player) + "("+ player + ") has voluntarily reset their collection: "+ collectionName); - return true; - } - - - public static boolean removeCompletedCollection(obj_id player, String collectionName) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - if (collectionName == null || collectionName.equals("")) - { - return false; - } - - if (!hasCompletedCollection(player, collectionName)) - { - return false; - } - - String[] slotsInCollection = getAllCollectionSlotsInCollection(collectionName); - - for (int i = 0; i < slotsInCollection.length; i++) - { - testAbortScript(); - - long collectionSlotValue = getCollectionSlotValue(player, slotsInCollection[i]) * -1; - - modifyCollectionSlotValue(player, slotsInCollection[i], collectionSlotValue); - } - - prose_package pp = new prose_package(); - prose.setTO(pp, new string_id("collection_n", collectionName)); - prose.setStringId(pp, SID_COLLECTION_RESET); - sendSystemMessageProse(player, pp); - CustomerServiceLog("Collection: ", "Player "+ getFirstName(player) + "("+ player + ") has voluntarily reset their collection: "+ collectionName); - return true; - } - - - public static void showNpcCollectionsRemoval(obj_id player, obj_id npc, String columnName) throws InterruptedException - { - if (sui.hasPid(player, COL_NPC_PID)) - { - int pid = sui.getPid(player, COL_NPC_PID); - forceCloseSUIPage(pid); - } - - HashSet active_collection = new HashSet(); - - String[] allCollections = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, columnName); - int columnNumber = dataTableFindColumnNumber(COLLECTION_NPC_TABLE, columnName); - String[] prereqColumn = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, (columnNumber + 1)); - - for (int i = 0; i < allCollections.length; i++) - { - testAbortScript(); - if (hasCompletedCollectionSlot(player, prereqColumn[i]) && !hasCompletedCollection(player, allCollections[i])) - { - active_collection.add(allCollections[i]); - } - } - - String[] activeCollections = new String[active_collection.size()]; - active_collection.toArray(activeCollections); - - String[] SUIcollectionNames = new String[activeCollections.length]; - - for (int q = 0; q < activeCollections.length; q++) - { - testAbortScript(); - SUIcollectionNames[q] = "@collection_n:" + activeCollections[q] + "_finished"; - } - - utils.setScriptVar(player, "collection.allCollections", activeCollections); - int pid = sui.listbox( npc, player, SUI_DELETE_PROMPT, sui.OK_CANCEL, SUI_DELETE_TITLE, SUIcollectionNames, "handleCollectionRemoval", true ); - sui.setPid(player, pid, COL_NPC_PID); - } - - - public static boolean npcHasCollectionsToRemove(obj_id player, obj_id npc, String columnName) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - if (!isIdValid(npc) || !exists(npc)) - { - return false; - } - if (columnName == null || columnName.equals("")) - { - return false; - } - - HashSet active_collection = new HashSet(); - - String[] allCollections = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, columnName); - int columnNumber = dataTableFindColumnNumber(COLLECTION_NPC_TABLE, columnName); - String[] prereqColumn = dataTableGetStringColumnNoDefaults(COLLECTION_NPC_TABLE, (columnNumber + 1)); - - if (allCollections == null || allCollections.length <= 0) - { - return false; - } - if (prereqColumn == null || prereqColumn.length <= 0) - { - return false; - } - - for (int i = 0; i < allCollections.length; i++) - { - testAbortScript(); - if (hasCompletedCollectionSlot(player, prereqColumn[i]) && !hasCompletedCollection(player, allCollections[i])) - { - active_collection.add(allCollections[i]); - } - } - - String[] activeCollections = new String[active_collection.size()]; - active_collection.toArray(activeCollections); - - if (activeCollections.length > 0) - { - return true; - } - return false; - } - - - public static boolean spaceGetCreditForKills(obj_id player, String[] slotNames) throws InterruptedException - { - if (slotNames == null || slotNames.length <= 0) - { - return false; - } - - for (int i = 0; i < slotNames.length; ++i) - { - testAbortScript(); - if (!hasCompletedCollectionSlot(player, slotNames[i])) - { - modifyCollectionSlotValue(player, slotNames[i], 1); - } - } - return true; - } - - - public static boolean logQuestError(obj_id player, String quest, int result) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - String s = ""; - - if (result == 1) - { - s = "Error: Quest already active."; - } - else if (result == 2) - { - s = "Error: No such quest."; - } - else if (result == 3) - { - s = "Error: No such task."; - } - else if (result == 4) - { - s = "Error: Quest already completed, and not repeatable."; - } - else if (result == 5) - { - s = "Error: Failed prerequisites."; - } - else if (result == 6) - { - s = "Error: Failed exclusions."; - } - else if (result == 7) - { - s = "Error: Quest Not active."; - } - else if (result == 8) - { - s = "Error: Task not active."; - } - else if (result == 9) - { - s = "Error: No such player."; - } - - if (s.equals("") || s.equals("")) - { - return false; - } - - CustomerServiceLog("CollectionComplete: ", "Player "+ getFirstName(player) + "("+ player + ") has failed to receive quest: "+ quest + " becasue of the errror: "+ s); - blog("collection","Quest Error: "+ s); - - return true; - } - - - public static boolean entertainerBuffCollection(obj_id buffedPlayerId, obj_id bufferId, float duration) throws InterruptedException - { - - if (!isIdValid(buffedPlayerId) || !isIdValid(bufferId)) - { - return false; - } - - if (hasCompletedCollection(bufferId, ENT_BUFF_COLLECTION_01)) - { - return false; - } - - String buffedPlayerTemplate = getSkillTemplate(buffedPlayerId); - - if (buffedPlayerTemplate.startsWith("trader")) - { - buffedPlayerTemplate = "prof_trader"; - } - - if (buffedPlayerTemplate.startsWith("entertainer")) - { - return false; - } - - if (hasCompletedCollectionSlot(bufferId, buffedPlayerTemplate)) - { - - return false; - } - - int collectionRollChance = rand(1, 100); - if (collectionRollChance > CONST_ROLL_CHANCE) - { - - buff.applyBuff(buffedPlayerId, "col_ent_invis_buff_tracker"); - return false; - } - - if (duration >= 7200.00) - { - - buff.applyBuff(buffedPlayerId, "col_ent_invis_buff_tracker"); - - modifyCollectionSlotValue(bufferId, buffedPlayerTemplate, 1); - - sendSystemMessage(bufferId, new string_id("collection", "update_entertainer")); - - return true; - } - else - { - sendSystemMessage(bufferId, new string_id("collection", "time_too_short")); - return false; - } - } - - - public static boolean pilotSmuggleTimeCheck(obj_id pilot, obj_id groupMember, obj_id ship, String strChassisType) throws InterruptedException - { - - if (buff.hasBuff(groupMember, "col_sd_invis_buff_tracker")) - { - buff.removeBuff(groupMember, "col_sd_invis_buff_tracker"); - CustomerServiceLog("Collection: ", "DePalma: Buff was removed from player: ("+ groupMember + ") we are now tracking by objvar"); - } - - if (!isIdValid(pilot) || !isIdValid(groupMember) || !isIdValid(ship)) - { - CustomerServiceLog("Collection: ", "DePalma: validation of pilot/groupMember/ship null value: Pilot: "+ pilot + "groupMember: "+ groupMember + "Ship: "+ ship); - return false; - } - - if (hasCompletedCollection(groupMember, COL_HEROIC_SD_TAXI_SERVICE)) - { - if (hasObjVar(groupMember, COL_HEROIC_SD_SMUGGLE_OBJVAR)) - { - - removeObjVar(groupMember, COL_HEROIC_SD_SMUGGLE_OBJVAR); - CustomerServiceLog("Collection: ", "DePalma: Player completed collection - objvar removed: "+ groupMember + "."); - } - return false; - } - if (strChassisType == null || strChassisType.equals("")) - { - CustomerServiceLog("Collection: ", "DePalma: invalid Chassis(checks everyone): blank or null: ShipId: "+ ship + "("+ strChassisType + ")"); - - return false; - } - if (strChassisType.equals("player_sorosuub_space_yacht") && groupMember == pilot && utils.isOwner(ship, groupMember)) - { - CustomerServiceLog("Collection: ", "DePalma: Sorosuub Chassis (Pilot check): Chassis "+ strChassisType + "Pilot Id ("+ pilot + ")"+ "groupMember(should be same as pilot)"+ groupMember); - - sendSystemMessage(pilot, DRIVING_SOROSUUB); - return false; - } - - int currentTime = getCalendarTime(); - int nextTimeEligible = 0; - - if (hasObjVar(groupMember, COL_HEROIC_SD_SMUGGLE_OBJVAR)) - { - - int timeStampCheck = getIntObjVar(groupMember, COL_HEROIC_SD_SMUGGLE_OBJVAR); - - if (currentTime < timeStampCheck) - { - if (groupMember.equals(pilot) && utils.isOwner(ship, groupMember)) - { - CustomerServiceLog("Collection: ", "DePalma: Timer not expired - currentTime: "+ currentTime + ". from Player: "+ groupMember + "."); - - sendSystemMessage(pilot, SMUGGLE_ATTEMPT_TIME_ISSUE); - } - return false; - } - else - { - - nextTimeEligible = currentTime + REQUIRED_TIME_LAPSE; - - setObjVar(groupMember, COL_HEROIC_SD_SMUGGLE_OBJVAR, nextTimeEligible); - - if (groupMember.equals(pilot) && utils.isOwner(ship, groupMember)) - { - CustomerServiceLog("Collection: ", "DePalma: Successful Run: Pilot ("+ groupMember + ") received update. This was his first run - did not have objvar...Must wait until "+ nextTimeEligible + " for an update."); - - modifyCollectionSlotValue(groupMember, COL_SLOT_SMUGGLE_GROUPS, 1); - - sendSystemMessage(pilot, SUCCESSFUL_SMUGGLE_ATTEMPT); - return true; - } - } - } - - else - { - nextTimeEligible = currentTime + REQUIRED_TIME_LAPSE; - - setObjVar(groupMember, COL_HEROIC_SD_SMUGGLE_OBJVAR, nextTimeEligible); - - if (groupMember.equals(pilot) && utils.isOwner(ship, groupMember)) - { - CustomerServiceLog("Collection: ", "DePalma: Successful Run: Pilot ("+ groupMember + ") received update. Must wait until "+ nextTimeEligible + " for an update."); - - modifyCollectionSlotValue(groupMember, COL_SLOT_SMUGGLE_GROUPS, 1); - - sendSystemMessage(pilot, SUCCESSFUL_SMUGGLE_ATTEMPT); - return true; - } - } - return false; - } - - - public static boolean collectionResource(obj_id player, String restype) throws InterruptedException - { - return collectionResource(player, restype, 0); - } - - - public static boolean collectionResource(obj_id player, String restype, int modifier) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (restype == null || restype.equals("")) - { - return false; - } - if (modifier < 0) - { - CustomerServiceLog("Collection: ", "DESIGNER BUG "+modifier+" is invalid. Int should be higher than zero."); - modifier = 0; - } - - CustomerServiceLog("Collection: ", "Player "+ getFirstName(player) + "("+ player + ") is rolling for resource: "+restype+" with a modifier of "+modifier+"."); - int randomChoice = rand(1, 100); - CustomerServiceLog("Collection: ", "Player "+ getFirstName(player) + "("+ player + ") is rolling for resource: "+restype+" and has received a roll of "+randomChoice+"."); - - if (modifier > 0) - { - CustomerServiceLog("Collection: ", "Player "+ getFirstName(player) + "("+ player + ") is rolling for resource: "+restype+" has a modifier of "+modifier+" so this will be SUBTRACTED FROM: "+randomChoice+"."); - randomChoice -= modifier; - if (randomChoice < 0) - { - randomChoice = 0; - } - - CustomerServiceLog("Collection: ", "Player "+ getFirstName(player) + "("+ player + ") is rolling for resource: "+restype+" the roll has been modified to be: "+randomChoice+"."); - } - - if (utils.hasScriptVar(player, "qa.resource_roll_bypass")) - { - randomChoice = 1; - sendSystemMessageTestingOnly(player, "Collection Harvest Percentage bypassed for testing(100% success)."); - } - - if (randomChoice > CONST_RESOURCE_ROLL) - { - CustomerServiceLog("Collection: ", "Player "+ getFirstName(player) + "("+ player + ") was rolling for resource: "+restype+" but rolled "+randomChoice+" which was higher than the cap of "+CONST_RESOURCE_ROLL+"."); - return false; - } - - String staticItem = ""; - String resourceMessage = ""; - if (restype.startsWith("meat")) - { - staticItem = PRISTINE_MEAT; - resourceMessage = "resource_meat"; - } - else if (restype.startsWith("hide")) - { - staticItem = PRISTINE_HIDE; - resourceMessage = "resource_hide"; - } - else if (restype.startsWith("bone")) - { - staticItem = PRISTINE_BONE; - resourceMessage = "resource_bone"; - } - else if (restype.startsWith("egg")) - { - staticItem = PRISTINE_EGG; - resourceMessage = "resource_egg"; - } - else if (restype.startsWith("milk")) - { - staticItem = PRISTINE_MILK; - resourceMessage = "resource_milk"; - } - if (staticItem == null || staticItem.equals("")) - { - CustomerServiceLog("Collection: ", "DESIGNER BUG - static item reward came back invalid for Player "+ getFirstName(player) + "("+ player + ")."); - return false; - } - if (resourceMessage == null || resourceMessage.equals("")) - { - CustomerServiceLog("Collection: ", "DESIGNER BUG - reward message came back invalid for Player "+ getFirstName(player) + "("+ player + ")."); - return false; - } - - obj_id newResourceItem = static_item.createNewItemFunction(staticItem, player); - if (!isValidId(newResourceItem) || !exists(newResourceItem)) - { - - CustomerServiceLog("CollectionLootChannel: ", "collectionResource - BrokenLoot: inValid resource failed to be rewarded to Player: "+ player + " Name: "+getName(player)); - return false; - } - CustomerServiceLog("CollectionLootChannel", "collectionResource - Player: "+player+" Name: "+getName(player)+ " Has triggered the creation of a static item object within the collection system. The object: "+newResourceItem+" Name: "+getName(newResourceItem)); - - sendSystemMessage(player, new string_id("collection", resourceMessage)); - return true; - } - - - public static boolean getRandomCollectionItemShowLootBox(obj_id player, obj_id container, String loot_table, String loot_column) throws InterruptedException - { - - if (!isIdValid(container) || !isIdValid(player)) - { - return false; - } - - String[] collectionLootArray = dataTableGetStringColumnNoDefaults(loot_table, loot_column); - - if (collectionLootArray == null || collectionLootArray.length <= 0) - { - return false; - } - int random = rand(0, collectionLootArray.length-1); - - obj_id collectionItem = static_item.createNewItemFunction(collectionLootArray[random], container); - - if (!isValidId(collectionItem) || !exists(collectionItem)) - { - - CustomerServiceLog("CollectionLootChannel: ", "getRandomCollectionItem - BrokenLoot: inValid object was created for player "+ player + " Name: "+getName(player)+" for container: "+ container); - return false; - } - CustomerServiceLog("CollectionLootChannel", "getRandomCollectionItem - Player: "+player+" Name: "+getName(player)+ " Has triggered the creation of a collection object from the collection system. The object: "+collectionItem+" Name: "+getName(collectionItem)+" has been placed in the container: "+container); - obj_id objArrray[] = new obj_id[1]; - objArrray[0] = collectionItem; - showLootBox(player, objArrray); - return true; - } - - - public static boolean getRandomCollectionItem(obj_id player, obj_id container, String loot_table, String loot_column) throws InterruptedException - { - - if (!isIdValid(container) || !isIdValid(player)) - { - return false; - } - - String[] collectionLootArray = dataTableGetStringColumnNoDefaults(loot_table, loot_column); - - if (collectionLootArray == null || collectionLootArray.length <= 0) - { - return false; - } - int random = rand(0, collectionLootArray.length-1); - - obj_id collectionItem = static_item.createNewItemFunction(collectionLootArray[random], container); - - if (!isValidId(collectionItem) || !exists(collectionItem)) - { - - CustomerServiceLog("CollectionLootChannel: ", "getRandomCollectionItem - BrokenLoot: inValid object was created for player "+ player + " Name: "+getName(player)+" for container: "+ container); - return false; - } - CustomerServiceLog("CollectionLootChannel", "getRandomCollectionItem - Player: "+player+" Name: "+getName(player)+ " Has triggered the creation of a collection object from the collection system. The object: "+collectionItem+" Name: "+getName(collectionItem)+" has been placed in the container: "+container); - - return true; - } - - - public static obj_id grantRandomCollectionItem(obj_id player, String loot_table, String loot_column) throws InterruptedException - { - if (!isIdValid(player) || !isPlayer(player)) - { - return obj_id.NULL_ID; - } - obj_id playerInv = getObjectInSlot(player, "inventory"); - if (!isIdValid(playerInv)) - { - return obj_id.NULL_ID; - } - - String[] collectionLootArray = dataTableGetStringColumnNoDefaults(loot_table, loot_column); - if (collectionLootArray == null || collectionLootArray.length <= 0) - { - return obj_id.NULL_ID; - } - - int random = rand(0, collectionLootArray.length-1); - obj_id collectionItem = static_item.createNewItemFunction(collectionLootArray[random], playerInv); - if (!isValidId(collectionItem) || !exists(collectionItem)) - { - - CustomerServiceLog("CollectionLootChannel: ", "grantRandomCollectionItem - BrokenLoot: inValid object was created for player "+ player + " Name: "+getName(player)); - return obj_id.NULL_ID; - } - else - { - CustomerServiceLog("CollectionLootChannel", "grantRandomCollectionItem - Player: "+player+" Name: "+getName(player)+ " Has received a random collection object from the collection system. The object: "+collectionItem+" Name: "+getName(collectionItem)+" has been placed in the player inventory: "+playerInv); - prose_package pp = new prose_package(); - prose.setStringId(pp, new string_id("collection","reward_item")); - prose.setTT(pp, new string_id("static_item_n", getStaticItemName(collectionItem))); - sendSystemMessageProse(player, pp); - } - - return collectionItem; - } - - - public static boolean gcwBaseControlCheck(obj_id factionObject, obj_id player) throws InterruptedException - { - - String playerFaction = factions.getFaction(player); - - obj_id subject = gcw.getPub30StaticBaseControllerId(factionObject); - int baseFaction = gcw.getPub30StaticBaseControllingFaction(subject); - - if (baseFaction == gcw.NO_CONTROL) - { - return false; - } - - String planet = getCurrentSceneName(); - - if (baseFaction == gcw.REBEL_CONTROL) - { - - if (toLower(playerFaction).equals("imperial")) - { - - utils.setScriptVar(factionObject, "collection.gcwSlotName", "col_gcw_insurgency_"+ planet + "_imperial"); - return true; - } - else - { - return false; - } - } - - else if (baseFaction == gcw.IMPERIAL_CONTROL) - { - if (toLower(playerFaction).equals("rebel")) - { - - utils.setScriptVar(factionObject, "collection.gcwSlotName", "col_gcw_insurgency_"+ planet + "_rebel"); - return true; - } - else - { - return false; - } - } - else - { - return false; - } - } - - - public static boolean canCollectCollectible(obj_id player, obj_id collectible) throws InterruptedException - { - if (!isValidId(collectible) || !isValidId(player)) - { - return false; - } - else if (!exists(collectible) || !exists(player)) - { - return false; - } - - if (!checkState(player)) - { - return false; - } - - String baseSlotName = getStringObjVar(collectible, OBJVAR_SLOT_NAME); - if (baseSlotName == null || baseSlotName.equals("")) - { - return false; - } - - String[] splitSlotNames = split(baseSlotName, ':'); - if (splitSlotNames == null || splitSlotNames.length < 0) - { - return false; - } - - String slotName = splitSlotNames[1]; - String collectionName = splitSlotNames[0]; - - if (collectionName == null || collectionName.equals("")) - { - return false; - } - - boolean isCloseEnough = checkDistance(collectible, player, MAX_RANGE_TO_COLLECT); - if (!isCloseEnough) - { - sendSystemMessage(player, SID_NOT_CLOSE_ENOUGH); - return false; - } - - else if (!hasCompletedCollectionSlotPrereq(player, slotName)) - { - - sendSystemMessage(player, SID_NEED_TO_ACTIVATE_COLLECTION); - return false; - } - - else if (hasCompletedCollection(player, collectionName)) - { - - sendSystemMessage(player, SID_ALREADY_FINISHED_COLLECTION); - return false; - } - - else if ((slotName == null || slotName.equals("")) || hasCompletedCollectionSlot(player, slotName)) - { - - sendSystemMessage(player, SID_ALREADY_HAVE_SLOT); - return false; - } - - return true; - } - - - public static boolean rewardPlayerCollectionSlot(obj_id player, obj_id collectible) throws InterruptedException - { - if (!isValidId(collectible) || !isValidId(player)) - { - return false; - } - else if (!exists(collectible) || !exists(player)) - { - return false; - } - - String baseSlotName = getStringObjVar(collectible, OBJVAR_SLOT_NAME); - if (baseSlotName == null || baseSlotName.equals("")) - { - return false; - } - - String[] splitSlotNames = split(baseSlotName, ':'); - if (splitSlotNames == null || splitSlotNames.length < 0) - { - return false; - } - - String slotName = splitSlotNames[1]; - String collectionName = splitSlotNames[0]; - if (collectionName == null || collectionName.equals("")) - { - return false; - } - - if (!hasCompletedCollectionSlotPrereq(player, slotName)) - { - - sendSystemMessage(player, SID_NEED_TO_ACTIVATE_COLLECTION); - return false; - } - - else if (hasCompletedCollection(player, collectionName)) - { - - sendSystemMessage(player, SID_ALREADY_FINISHED_COLLECTION); - return false; - } - - else if ((slotName == null || slotName.equals("")) || hasCompletedCollectionSlot(player, slotName)) - { - - sendSystemMessage(player, SID_ALREADY_HAVE_SLOT); - return false; - } - - if (!checkState(player)) - { - return false; - } - - boolean isCloseEnough = collection.checkDistance(collectible, player, MAX_RANGE_TO_COLLECT); - if (!isCloseEnough) - { - sendSystemMessage(player, SID_NOT_CLOSE_ENOUGH); - return false; - } - - stealth.testInvisNonCombatAction(player, collectible); - - giveAreaMobsHate(collectible, player); - - if (modifyCollectionSlotValue(player, slotName, 1)) - { - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectible + ")"+ " was consumed into a collection, for player "+ getFirstName(player) + "("+ player + ")."); - } - else - { - - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectible + ")"+ " was NOT consumed into a collection, for player "+ getFirstName(player) + "("+ player + ")."); - - sendSystemMessage(player, SID_REPORT_CONSUME_ITEM_FAIL); - return false; - } - - return true; - } - - - public static obj_id getRandomItem(obj_id player, String[] items, String collectionName, prose_package pp) throws InterruptedException - { - int randomChoice = rand(0, items.length -1); - String itemToGrant = items[randomChoice]; - - if (static_item.isStaticItem(itemToGrant)) - { - return createStaticItemWithMessage(player, itemToGrant, collectionName, pp); - } - - return createTemplateItemWithMessage(player, itemToGrant, collectionName, pp); - } - - - public static obj_id getWeightedRandomItem(obj_id player, String[] items, String collectionName, prose_package pp) throws InterruptedException - { - - int randomChoice = 0; - - for (int k = 0; k < MAXLOOP; k++) - { - testAbortScript(); - - randomChoice = rand(0, items.length -1); - - dictionary itemDict = dataTableGetRow(static_item.ITEM_STAT_BALANCE_TABLE, items[randomChoice]); - - String slotObjvar = itemDict.getString("objvars"); - String[] objvarArray = split(slotObjvar, ':'); - slotObjvar = objvarArray[objvarArray.length -1]; - - if (hasCompletedCollectionSlot(player, slotObjvar)) - { - - continue; - } - else - { - - break; - } - } - if (static_item.isStaticItem(items[randomChoice])) - { - return createStaticItemWithMessage(player, items[randomChoice], collectionName, pp); - } - - return createTemplateItemWithMessage(player, items[randomChoice], collectionName, pp); - } - - - public static obj_id createStaticItemWithMessage(obj_id player, String staticItem, String collectionName, prose_package pp) throws InterruptedException - { - if (!isValidId(player) || !exists(player) || staticItem == null || staticItem.equals("")) - { - return null; - } - - obj_id itemId = static_item.createNewItemFunction(staticItem, player); - if (!isValidId(itemId) || !exists(itemId)) - { - CustomerServiceLog("CollectionComplete: ", "createStaticItemWithMessage - Player "+ getFirstName(player) + "("+ player + ") has completed "+ collectionName + " Item: "+ staticItem + " was not created due to invalid itemID. Attempted to create as static item."); - return null; - } - CustomerServiceLog("CollectionComplete: ", "createStaticItemWithMessage - Player "+ getFirstName(player) + "("+ player + ") has completed "+ collectionName + " Item: "+ staticItem + " OID: "+itemId+" was rewarded."); - - prose.setStringId(pp, SID_REWARD_ITEM); - prose.setTT(pp, new string_id("static_item_n", getStaticItemName(itemId))); - sendSystemMessageProse(player, pp); - CustomerServiceLog("CollectionComplete: ", "Player "+ getFirstName(player) + "("+ player + ") has completed "+ collectionName + " and was granted Item: "+ staticItem + "("+ itemId + ")"+ "."); - return itemId; - } - - - public static obj_id createTemplateItemWithMessage(obj_id player, String templateItem, String collectionName, prose_package pp) throws InterruptedException - { - if (!isValidId(player) || !exists(player) || templateItem == null || templateItem.equals("")) - { - return null; - } - - obj_id pInv = utils.getInventoryContainer(player); - if (!isValidId(pInv) || !exists(pInv)) - { - CustomerServiceLog("CollectionComplete: ", "Player "+ getFirstName(player) + "("+ player + ") has completed "+ collectionName + " Item: "+ templateItem + "was not created due to invalid Player Inventory."); - return null; - } - obj_id itemId = createObjectOverloaded(templateItem, pInv); - if (!isValidId(itemId) || !exists(itemId)) - { - CustomerServiceLog("CollectionComplete: ", "Player "+ getFirstName(player) + "("+ player + ") has completed "+ collectionName + " Item: "+ templateItem + "was not created due to invalid itemID. Attempted to create as object template."); - return null; - } - prose.setStringId(pp, SID_REWARD_ITEM); - prose.setTT(pp, "@"+ getName(itemId)); - sendSystemMessageProse(player, pp); - return itemId; - } - - - public static void giveNewbieCommWindow(obj_id player, obj_id object) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(object)) - { - return; - } - - if (getLevel(player) >= 10) - { - return; - } - - if (utils.hasScriptVar(player, "newbie_comm_series")) - { - int number = utils.getIntScriptVar(player, "newbie_comm_series"); - if (number > 3) - { - - return; - } - prose_package pp = new prose_package(); - - switch(number) - { - case 1: - prose.setStringId(pp, new string_id("collection", "newbie_comm_message_2")); - commPlayers(object, "object/mobile/r2.iff", "sound/dro_r2_3_danger.snd", 10f, player, pp); - number++; - utils.setScriptVar(player, "newbie_comm_series", number); - break; - case 2: - prose.setStringId(pp, new string_id("collection", "newbie_comm_message_3")); - commPlayers(object, "object/mobile/r2.iff", "sound/dro_r2_3_danger.snd", 15f, player, pp); - number++; - utils.setScriptVar(player, "newbie_comm_series", number); - break; - case 3: - prose.setStringId(pp, new string_id("collection", "newbie_comm_message_4")); - commPlayers(object, "object/mobile/r2.iff", "sound/dro_r2_3_danger.snd", 12f, player, pp); - number++; - utils.setScriptVar(player, "newbie_comm_series", number); - break; - default: - break; - } - } - else - { - prose_package pp = new prose_package(); - prose.setStringId(pp, new string_id("collection", "newbie_comm_message")); - commPlayers(object, "object/mobile/r2.iff", "sound/dro_r2_3_danger.snd", 10f, player, pp); - utils.setScriptVar(player, "newbie_comm_series", 1); - } - return; - } - - - public static void grantQuestBasedCollections(String questString, obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player) || !isPlayer(player)) - { - return; - } - - String collectionFaction = null; - String collectionName = null; - - if (factions.isRebelorRebelHelper(player)) - { - collectionFaction = "rebelCollection"; - } - - else if (factions.isImperialorImperialHelper(player)) - { - collectionFaction = "imperialCollection"; - } - - else - { - collectionFaction = "neutralCollection"; - } - - int tableRow = dataTableSearchColumnForString(questString, "questName", QUEST__COMPLETED_COLLECTIONS); - - if (tableRow > -1) - { - collectionName = dataTableGetString(QUEST__COMPLETED_COLLECTIONS, tableRow, collectionFaction); - } - - if (collectionName == null) - { - return; - } - - if (!hasCompletedCollectionSlot(player, collectionName)) - { - modifyCollectionSlotValue(player, collectionName, 1); - } - - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/consumable.java b/sku.0/sys.server/compiled/game/script/library/consumable.java deleted file mode 100644 index 813019f0b..000000000 --- a/sku.0/sys.server/compiled/game/script/library/consumable.java +++ /dev/null @@ -1,1110 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.healing; -import script.library.player_stomach; -import script.library.prose; -import script.library.food; -import script.library.metrics; -import script.library.doctor_bag; - - -public class consumable extends script.base_script -{ - public consumable() - { - } - public static final float MAX_AFFECT_DISTANCE = 6.0f; - - public static final String[] STAT_NAME = - { - "HEALTH", - "CONSTITUTION", - "ACTION", - "STAMINA", - "MIND", - "WILLPOWER", - "POISON", - "DISEASE" - }; - - public static final String VAR_CONSUMABLE_BASE = "consumable"; - public static final String VAR_CONSUMABLE_TARGET = "consumable.target"; - public static final String VAR_CONSUMABLE_MODS = "consumable.mods"; - public static final String VAR_CONSUMABLE_MEDICINE = "consumable.medicine"; - public static final String VAR_CONSUMABLE_PET_MED = "consumable.pet_med"; - public static final String VAR_CONSUMABLE_DROID_MED = "consumable.droid_med"; - - public static final String VAR_CONSUMABLE_MED_TYPE = "consumable.med_type"; - - public static final String VAR_CONSUMABLE_CHARGES = "consumable.charges"; - public static final String VAR_CONSUMABLE_STOMACH_VALUES = "consumable.stomachValues"; - - public static final String VAR_BEEN_CONSUMED = "beenConsumed"; - - public static final String VAR_SKILL_MOD_REQUIRED = "consumable.skillModRequired"; - public static final String VAR_SKILL_MOD_MIN = "consumable.skillModMin"; - - public static final String MSG_INSUFFICIENT_SKILL = "@error_message:insufficient_skill"; - public static final String MSG_TARGET_OUT_OF_RANGE = "@error_message:target_out_of_range"; - public static final String MSG_CANNOT_TARGET = "@error_message:cannot_target"; - - public static final string_id SID_ATTRIBMOD_APPLY = new string_id("base_player","attribmod_apply"); - - public static final string_id SID_INSUFFICIENT_SKILL = new string_id("error_message","insufficient_skill"); - public static final string_id SID_TARGET_OUT_OF_RANGE = new string_id("error_message","target_out_of_range"); - public static final string_id SID_CANNOT_TARGET = new string_id("error_message","cannot_target"); - public static final string_id SID_TOO_MUCH_SHOCK = new string_id("error_message","too_much_shock"); - public static final string_id SID_YOU_HAVE_GREATER_ENHANCEMENT = new string_id("error_message","you_have_greater_enchancement"); - public static final string_id SID_THEY_HAVE_GREATER_ENHANCEMENT = new string_id("error_message","they_have_greater_enchancement"); - - public static final string_id SID_SHOCK_EFFECT_LOW = new string_id("healing","shock_effect_low"); - public static final string_id SID_SHOCK_EFFECT_MEDIUM = new string_id("healing","shock_effect_medium"); - public static final string_id SID_SHOCK_EFFECT_HIGH = new string_id("healing","shock_effect_high"); - public static final string_id SID_SHOCK_EFFECT_LOW_TARGET = new string_id("healing","shock_effect_low_target"); - public static final string_id SID_SHOCK_EFFECT_MEDIUM_TARGET = new string_id("healing","shock_effect_medium_target"); - public static final string_id SID_SHOCK_EFFECT_HIGH_TARGET = new string_id("healing","shock_effect_high_target"); - public static final string_id SID_INSUFFICIENT_SKILL_HEAL = new string_id("healing","insufficient_skill_heal"); - - public static final string_id PROSE_CONSUME_ITEM = new string_id("base_player", "prose_consume_item"); - - public static final int MT_NONE = 0; - public static final int MT_HEAL_DAMAGE = 1; - public static final int MT_HEAL_WOUND = 2; - public static final int MT_HEAL_STATE = 3; - public static final int MT_HEAL_ENHANCE = 4; - public static final int MT_REVIVE_PLAYER = 5; - - public static final String FORAGED_DATA = "datatables/foraging/forage_global.iff"; - - - public static boolean consumeItem(obj_id player, obj_id target, obj_id item) throws InterruptedException - { - return consumeItem (player, target, item, true); - } - - public static boolean consumeItem(obj_id player, obj_id target, obj_id item, boolean checkPvpStatus) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(target) || !isIdValid(item)) - { - return false; - } - - if (!isMob(player) || !isMob(target)) - { - return false; - } - - if (!player.isLoaded() || !target.isLoaded() || !item.isLoaded()) - { - sendSystemMessage(player, SID_TARGET_OUT_OF_RANGE); - return false; - } - - obj_id owner = utils.getContainingPlayer(item); - - if (player == owner) - { - - } - else - { - - if (isIdValid(owner)) - { - - CustomerServiceLog("VendorCreditDupeExploit", "%TU tried to consume an item ("+ item + "), but is no longer in possession of it! %TT currently has the item.", player, owner); - - } - else - { - - CustomerServiceLog("VendorCreditDupeExploit", "%TU tried to consume an item ("+ item + "), but is no longer in possession of it!", player); - } - - return false; - } - - String medicinebuff = healing.SCRIPT_VAR_MEDICINE_BUFF; - String medicinerebuff = healing.SCRIPT_VAR_MEDICINE_REBUFF; - - if (healing.isRangedMedicine(item)) - { - - float healing_range = (float)healing.getHealingRange(item); - float healing_range_mod = (float)getSkillStatMod(player, "healing_range"); - healing_range = healing_range + ((16 * healing_range_mod) / 100.0f); - - if (getDistance(player, target) > healing_range) - { - sendSystemMessage(player, SID_TARGET_OUT_OF_RANGE); - return false; - } - } - else - { - if (getDistance(player, target) > MAX_AFFECT_DISTANCE) - { - sendSystemMessage(player, SID_TARGET_OUT_OF_RANGE); - return false; - } - } - - boolean isConsumable = false; - int[] vol = - { - 60, 0 - }; - attrib_mod[] am = null; - String[] skillReq = null; - int[] skillMin = null; - - if (hasScript( item, "item.comestible.foraged" )) - { - isConsumable = true; - am = getForagedFoodMods( item ); - if (am == null) - { - isConsumable = false; - } - else - { - isConsumable = true; - } - } - else - { - - isConsumable = hasObjVar( item, VAR_CONSUMABLE_BASE ); - if (isConsumable) - { - vol = getIntArrayObjVar( item, VAR_CONSUMABLE_STOMACH_VALUES ); - am = getAttribModArrayObjVar( item, VAR_CONSUMABLE_MODS ); - skillReq = getStringArrayObjVar(item, VAR_SKILL_MOD_REQUIRED); - skillMin = getIntArrayObjVar(item, VAR_SKILL_MOD_MIN); - } - else - { - - if (hasScript( item, "item.comestible.crafted" )) - { - isConsumable = true; - } - } - } - - if (!canEatFood( target, item )) - { - return false; - } - - if (isConsumable) - { - boolean canTarget = false; - if (player == target) - { - canTarget = true; - } - else - { - if (checkPvpStatus) - { - if (factions.pvpDoAllowedHelpCheck(player, target)) - { - canTarget = true; - } - } - else - { - canTarget = true; - } - } - - if (!canTarget) - { - sendSystemMessage(player, SID_CANNOT_TARGET); - return false; - } - - if (hasObjVar( item, "race_restriction" )) - { - int race = getIntObjVar( item, "race_restriction"); - int target_species = getSpecies( target ); - if (target_species == -2) - { - sendSystemMessage( target, new string_id( "error_message", "pets_only") ); - return false; - } - else if (race != target_species) - { - sendSystemMessage( target, new string_id( "error_message", "race_restriction") ); - return false; - } - } - - if ((vol == null) || (vol.length == 0)) - { - return false; - } - - float dcy = am[0].getDecay(); - if (am[0].getDuration() > 0) - { - attrib_mod[] modifyBuffValue = modifyBuffMods(player, target, item, am); - if (modifyBuffValue != null && modifyBuffValue.length > 0) - { - am = modifyBuffValue; - } - } - else if ((am.length == 2) && ( (int)dcy == (int)MOD_POOL )) - { - - LOG("buffs", "Roger Dodger"); - am = utils.addMindAttribToStim(am[0].getValue()); - setObjVar(getSelf(), consumable.VAR_CONSUMABLE_MODS, am); - } - - if ((skillReq != null) && (skillReq.length != 0) && (skillMin != null) && (skillMin.length != 0)) - { - if (skillReq.length == skillMin.length) - { - boolean canUse = true; - for (int i = 0; i < skillReq.length; i++) - { - testAbortScript(); - int skillMod = getSkillStatMod(player, skillReq[i]); - if (skillMod < skillMin[i]) - { - canUse = false; - } - } - - if (!canUse) - { - String[] reqs = new String[skillReq.length]; - - for (int n = 0; n < skillReq.length; n++) - { - testAbortScript(); - reqs[n] = skillReq[n] + "[" + getSkillStatMod(player, skillReq[n]) + "/" + skillMin[n] + "]"; - } - - if (skillReq.length > 1) - { - sui.listbox(player, player, MSG_INSUFFICIENT_SKILL, reqs); - sendSystemMessage(player, SID_INSUFFICIENT_SKILL); - } - else - { - String skill_mod_name = "@stat_n:"+ skillReq[0]; - prose_package pp = prose.getPackage(SID_INSUFFICIENT_SKILL_HEAL, skill_mod_name, skillMin[0]); - sendSystemMessageProse(player, pp); - } - return false; - } - - if (healing.isMedicine(item)) - { - - float multiplier = healing.getHealingMultiplier(player, item); - float final_multiplier = healing.applyShockWoundModifier(multiplier, target); - - if (final_multiplier <= 0.0f) - { - sendSystemMessage(player, SID_TOO_MUCH_SHOCK); - return false; - } - - float shock_effect = final_multiplier / multiplier; - if (shock_effect < .3f) - { - sendSystemMessage(player, SID_SHOCK_EFFECT_HIGH); - if (player != target) - { - sendSystemMessage(target, SID_SHOCK_EFFECT_HIGH_TARGET); - } - } - else if (shock_effect < .5f) - { - sendSystemMessage(player, SID_SHOCK_EFFECT_MEDIUM); - if (player != target) - { - sendSystemMessage(target, SID_SHOCK_EFFECT_MEDIUM_TARGET); - } - } - else if (shock_effect < .8f) - { - sendSystemMessage(player, SID_SHOCK_EFFECT_LOW); - if (player != target) - { - sendSystemMessage(target, SID_SHOCK_EFFECT_LOW_TARGET); - } - } - - if (am[0].getAttribute() > 8) - { - final_multiplier = 1f; - } - - attrib_mod[] am_new = healing.modifyMedicineAttributes(am, final_multiplier); - am = (attrib_mod[]) am_new.clone(); - - if (healing.isBuffMedicine(item)) - { - String buff_name = ""; - int current_value = 0; - int failed = 0; - for (int x = 0; x < am.length; x++) - { - testAbortScript(); - if (healing.hasEnhancement(target, am[x].getAttribute())) - { - - buff_name = "medical_enhance_"+ healing.attributeToString(am[x].getAttribute()).toLowerCase(); - current_value = healing.getHealEnhanceValue(target, am[x].getAttribute()); - if (am[x].getValue() >= current_value) - { - - removeAttribOrSkillModModifier(target, buff_name); - - utils.setScriptVar(target, medicinerebuff +"."+x, current_value); - } - else - { - failed ++; - if (player == target) - { - sendSystemMessage(player, SID_YOU_HAVE_GREATER_ENHANCEMENT); - } - else - { - prose_package ppGreaterEnhancement = prose.getPackage(SID_THEY_HAVE_GREATER_ENHANCEMENT, target); - sendSystemMessageProse(player, ppGreaterEnhancement); - } - } - - } - } - if (failed == am.length) - { - return false; - } - } - } - } - else - { - debugSpeakMsg(player, "consumable::consumeItem(): skill mod arrays are not synchronized"); - } - } - else if ((skillReq == null) && (skillMin == null)) - { - - if (hasObjVar(item, consumable.VAR_CONSUMABLE_DROID_MED)) - { - - if (hasObjVar(item, "consumable.energy")) - { - - int totalEnergy = getIntObjVar(item, "consumable.energy"); - - int toHeal[] = healing.distributeHAMDamageHealingPoints(target, totalEnergy); - attrib_mod[] tempAm = new attrib_mod[3]; - - if (toHeal.length != 3) - { - return false; - } - - for (int y = 0; y < 3; y++) - { - testAbortScript(); - - tempAm[y] = new attrib_mod(y*3, toHeal[y], 0.0f, 0.0f, MOD_POOL); - } - - am = tempAm; - - } - else - { - - int totalPower = am[0].getValue(); - - int toHeal[] = healing.distributeHAMWoundHealingPoints(target, totalPower); - attrib_mod[] tempAm = new attrib_mod[3]; - - if (toHeal.length != 3) - { - return false; - } - - for (int z = 0; z < 3; z++) - { - testAbortScript(); - - tempAm[z] = new attrib_mod(z*3, toHeal[z], 0.0f, healing.AM_HEAL_WOUND, 0.0f); - } - - am = tempAm; - } - } - } - else - { - debugSpeakMsg(player, "consumable::consumeItem(): skill mod arrays are fubar!"); - } - - boolean wasConsumed = player_stomach.addToStomach( player, target, vol ); - - if (wasConsumed) - { - if (checkPvpStatus) - { - if (target != player) - { - pvpHelpPerformed( player, target ); - } - } - - if (healing.isRevivePack(item)) - { - pclib.clearEffectsForDeath(target); - - setAttrib(target, HEALTH, 1); - } - - attrib_mod[] modifiedAm = modifyConsumableMods(player, target, item, am); - if (modifiedAm != null && modifiedAm.length > 0) - { - am = modifiedAm; - } - - if (healing.isBuffMedicine(item) && (am != null)) - { - for (int x = 0; x < am.length; x++) - { - testAbortScript(); - String buff_name = "medical_enhance_"+ healing.attributeToString(am[x].getAttribute()).toLowerCase(); - utils.setScriptVar( target, medicinebuff +"."+x, am[x].getValue() ); - utils.setScriptVar( target, "healing."+ buff_name, am[x].getValue() ); - int buff_type = am[x].getAttribute(); - if (buff_type <= 5) - { - addAttribModifier(target, buff_name, buff_type, am[x].getValue(), am[x].getDuration(), am[x].getAttack(), am[x].getDecay(), true, false, true); - - } - else if (buff_type == 6) - { - addSkillModModifier(target, buff_name, "resistance_poison", am[x].getValue(), am[x].getDuration(), false, true); - - if (hasObjVar(item, healing.VAR_HEALING_ABSORPTION)) - { - addSkillModModifier(target, buff_name+".absorption", "absorption_poison", getIntObjVar(item, healing.VAR_HEALING_ABSORPTION), am[x].getDuration(), false, false); - } - } - else if (buff_type == 7) - { - addSkillModModifier(target, buff_name, "resistance_disease", am[x].getValue(), am[x].getDuration(), false, true); - - if (hasObjVar(item, healing.VAR_HEALING_ABSORPTION)) - { - addSkillModModifier(target, buff_name+".absorption", "absorption_disease", getIntObjVar(item, healing.VAR_HEALING_ABSORPTION), am[x].getDuration(), false, false); - } - } - } - - metrics.logBuffStatus(target); - } - else - { - - if (am != null) - { - - boolean isBuff = false; - for (int i = 0; i < am.length; i++) - { - testAbortScript(); - debugServerConsoleMsg(target, ">>>>>>>>>>>> PREPARING TO APPLY MOD TO ATTRIBUTE: "+ am[i].getAttribute()); - - if (am[i].getAttribute() == HEALTH) - { - debugServerConsoleMsg(target, ">>>>>>>>>>>> ATTEMPTING TO APPLY MOD -- "+ am[i].getAttribute() + " LOOKS LIKE HEALTH TO ME!"); - utils.addAttribMod(target, am[i]); - } - - if (am[i].getDuration() > 0) - { - isBuff = true; - } - } - - if (isBuff) - { - metrics.logBuffStatus(target); - } - } - } - - applyFoodEffects( target, item, am ); - - if (!healing.isMedicine(item)) - { - - String snd = "clienteffect/"; - switch ( getSpecies(player) ) - { - case SPECIES_HUMAN: - case SPECIES_BOTHAN: - case SPECIES_TWILEK: - case SPECIES_ZABRAK: - snd += "human_"; - break; - - case SPECIES_MON_CALAMARI: - case SPECIES_RODIAN: - case SPECIES_TRANDOSHAN: - snd += "reptile_"; - break; - - case SPECIES_WOOKIEE: - snd += "wookiee_"; - break; - } - - int gender = getGender(player); - switch ( gender ) - { - case GENDER_FEMALE: - snd += "female_eat.cef"; - break; - - case GENDER_MALE: - default: - snd += "male_eat.cef"; - break; - } - - if (!snd.equals("")) - { - playClientEffectLoc( player, snd, getLocation(player), getScale(player) ); - } - - prose_package pp = prose.getPackage(PROSE_CONSUME_ITEM, player, item); - sendSystemMessageProse(target, pp); - } - - removeObjVar( item, VAR_BEEN_CONSUMED ); - return decrementCharges(item, player); - } - else - { - removeObjVar( item, VAR_BEEN_CONSUMED ); - } - return false; - } - - return false; - } - - - public static boolean consumeItem(obj_id player, obj_id item) throws InterruptedException - { - return consumeItem(player, player, item); - } - - - public static attrib_mod[] modifyConsumableMods(obj_id player, obj_id target, obj_id item, attrib_mod[] am) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(target) || !isIdValid(item)) - { - return null; - } - - if (am == null || am.length == 0) - { - return null; - } - - float modval = 1f; - float moddur = 1f; - - int species = getSpecies(target); - if ((species == SPECIES_TWILEK) && (am != null)) - { - moddur *= 1.1f; - } - - if (utils.hasScriptVar(player, "registerWithLocation") && factions.isDeclared(player) && healing.isMedicine(item)) - { - obj_id regLoc = utils.getObjIdScriptVar(player, "registerWithLocation"); - if (isIdValid(regLoc)) - { - String lFac = factions.getFaction(regLoc); - String pFac = factions.getFaction(player); - if (lFac != null && pFac != null && lFac.equals(pFac)) - { - modval *= 1.25f; - } - } - } - - if (modval != 1f || moddur != 1f) - { - for (int x = 0; x < am.length; x++) - { - testAbortScript(); - float atk = am[x].getAttack(); - float decay = am[x].getDecay(); - if (moddur != 1f && atk >= 0f && decay >= 0f) - { - attrib_mod tmp = new attrib_mod(am[x].getAttribute(), am[x].getValue(), am[x].getDuration() * moddur, atk, decay); - if (tmp != null) - { - am[x] = tmp; - } - } - - if (modval != 1f && (atk == healing.AM_HEAL_WOUND || atk == healing.AM_HEAL_SHOCK || decay == MOD_ANTIDOTE)) - { - - attrib_mod tmp = new attrib_mod(am[x].getAttribute(), (int)(am[x].getValue() * modval), am[x].getDuration(), atk, decay); - if (tmp != null) - { - am[x] = tmp; - } - } - } - } - - return am; - } - - - public static attrib_mod[] modifyBuffMods(obj_id player, obj_id target, obj_id item, attrib_mod[] am) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(target) || !isIdValid(item)) - { - return null; - } - if (am == null || am.length == 0) - { - return null; - } - - for (int x = 0; x < am.length; x++) - { - testAbortScript(); - float atk = am[x].getAttack(); - float decay = am[x].getDecay(); - int buffValue = 0; - - attrib_mod tmp = new attrib_mod(am[x].getAttribute(), buffValue, am[x].getDuration(), atk, decay); - if (tmp != null) - { - am[x] = tmp; - } - } - - return am; - } - - - public static boolean createConsumable(obj_id item, attrib_mod[] am, int[] stomach, dictionary skillReq) throws InterruptedException - { - if ((item == null) || (am == null) || (stomach == null) || (stomach.length != player_stomach.STOMACH_MAX)) - { - return false; - } - - boolean litmus = true; - - if (am.length == 0) - { - - return false; - } - - litmus &= setObjVar(item, VAR_CONSUMABLE_MODS, am); - litmus &= setObjVar(item, VAR_CONSUMABLE_STOMACH_VALUES, stomach); - - if ((skillReq != null) && (!skillReq.isEmpty())) - { - java.util.Enumeration keys = skillReq.keys(); - - String[] skillModReq = new String[skillReq.size()]; - int[] skillModMin = new int[skillReq.size()]; - - for (int i = 0; i < skillReq.size(); i++) - { - testAbortScript(); - skillModReq[i] = (String)keys.nextElement(); - skillModMin[i] = skillReq.getInt(skillModReq[i]); - } - - if (skillModReq.length == 0 || skillModMin.length == 0) - { - - return false; - } - - litmus &= setObjVar(item, VAR_SKILL_MOD_REQUIRED, skillModReq); - litmus &= setObjVar(item, VAR_SKILL_MOD_MIN, skillModMin); - } - return litmus; - } - - - public static boolean decrementCharges(obj_id item, obj_id player) throws InterruptedException - { - if (item == null) - { - return false; - } - - if (doctor_bag.isDoctorBag( item )) - { - doctor_bag.decrementSurrogateCharge( item ); - } - - int charges = getCount(item); - if (charges > 1000) - { - setCount( item, 1000 ); - } - else if (charges > 1) - { - incrementCount(item, -1); - } - else - { - if (!doctor_bag.isDoctorBag( item )) - { - destroyObject(item); - } - } - - return true; - } - - - public static boolean decrementSpecificObjectRecursive(obj_id player, String template, String objvar) throws InterruptedException - { - obj_id inventory = utils.getInventoryContainer(player); - obj_id[] device = utils.getAllItemsInContainerByTemplate(inventory, template, true); - if (device == null) - { - return false; - } - for (int i = 0; i < device.length; i++) - { - testAbortScript(); - if (getTemplateName(device[i]).equals(template) && hasObjVar(device[i], objvar)) - { - decrementCount(device[i]); - return true; - } - } - return false; - } - - - public static boolean decrementObjectInventoryOrEquipped(obj_id player, String template, String objvar) throws InterruptedException - { - obj_id inventory = utils.getInventoryContainer(player); - obj_id[] inventoryContents = getInventoryAndEquipment(player); - - if (inventoryContents == null) - { - return false; - } - - for (int i = 0; i < inventoryContents.length; i++) - { - testAbortScript(); - if (getTemplateName(inventoryContents[i]).equals(template) && hasObjVar(inventoryContents[i], objvar)) - { - decrementCount(inventoryContents[i]); - return true; - } - } - return false; - } - - - public static boolean decrementSpecificObject(obj_id player, String template, String objvar) throws InterruptedException - { - obj_id inventory = utils.getInventoryContainer(player); - obj_id[] device = utils.getContainedObjectsWithObjVar(inventory, objvar); - - if (device == null) - { - return false; - } - for (int i = 0; i < device.length; i++) - { - testAbortScript(); - if (getTemplateName(device[i]).equals(template)) - { - decrementCount(device[i]); - return true; - } - } - return false; - } - - - public static attrib_mod[] getForagedFoodMods(obj_id item) throws InterruptedException - { - int mod_time = 0; - int health_mod = 0; - int action_mod = 0; - int mind_mod = 0; - - if (item == null || !isIdValid(item)) - { - return null; - } - - String mytemplate = getTemplateName(item); - String prefix = "object/tangible/"; - mytemplate = mytemplate.substring( prefix.length() ); - - if (mytemplate == null || mytemplate.equals("")) - { - - detachScript( item, "item.comestible.foraged"); - return null; - } - - int index = -1; - String tangibles[] = dataTableGetStringColumn(FORAGED_DATA, "ITEM_TANGIBLE"); - - if (tangibles == null || tangibles.length == 0) - { - - detachScript( item, "item.comestible.foraged"); - return null; - } - - for (int i = 0; i < tangibles.length; i++) - { - testAbortScript(); - if (mytemplate.equals(tangibles[i])) - { - - index = i; - } - } - - if (index == -1) - { - - detachScript( item, "item.comestible.foraged"); - return null; - } - - mod_time = dataTableGetInt(FORAGED_DATA, index, "MOD_TIME"); - health_mod = dataTableGetInt(FORAGED_DATA, index, "MOD_HEALTH"); - action_mod = dataTableGetInt(FORAGED_DATA, index, "MOD_ACTION"); - mind_mod = dataTableGetInt(FORAGED_DATA, index, "MOD_MIND"); - - int numItems = 0; - - if (health_mod > 0) - { - numItems++; - } - - if (action_mod > 0) - { - numItems++; - } - - if (mind_mod > 0) - { - numItems++; - } - - attrib_mod[] am = new attrib_mod[numItems]; - - numItems = 0; - - if (health_mod > 0) - { - am[numItems++] = new attrib_mod( HEALTH, health_mod, mod_time, 0.0f, 0.0f ); - } - - if (action_mod > 0) - { - am[numItems++] = new attrib_mod( ACTION, action_mod, mod_time, 0.0f, 0.0f ); - } - - if (mind_mod > 0) - { - am[numItems++] = new attrib_mod( MIND, mind_mod, mod_time, 0.0f, 0.0f ); - } - - return am; - } - - - public static boolean canEatFood(obj_id target, obj_id item) throws InterruptedException - { - - if (hasObjVar( item, "duration" )) - { - String type = getStringObjVar( item, "duration.type"); - - if (utils.hasScriptVar( target, "food."+type+".dur" )) - { - sendSystemMessage( target, new string_id( "combat_effects", "already_affected") ); - return false; - } - } - - if (hasObjVar( item, "delayed" )) - { - String type = getStringObjVar( item, "delayed.type"); - - if (utils.hasScriptVar( target, "food."+type+".dur" )) - { - sendSystemMessage( target, new string_id( "combat_effects", "already_affected") ); - return false; - } - } - - if (hasObjVar( item, "skill_mod" )) - { - - String mod_name = getStringObjVar( item, "skill_mod.name"); - String mod_id = "food_"+ mod_name; - - if (utils.hasScriptVar( target, mod_id )) - { - sendSystemMessage( target, new string_id( "combat_effects", "already_affected") ); - return false; - } - } - - return true; - } - - - public static void applyFoodEffects(obj_id target, obj_id item, attrib_mod[] am) throws InterruptedException - { - - String templateName = getTemplateName(item); - int lastslash = templateName.lastIndexOf( '/'); - int lastdot = templateName.lastIndexOf( '.'); - templateName = templateName.substring( lastslash+1, lastdot ); - - if (hasObjVar( item, "stat_mod" )) - { - if (am == null) - { - return; - } - - float dur = am[0].getDuration(); - addBuffIcon( target, "food."+templateName, dur ); - } - - else if (hasObjVar( item, "delayed" )) - { - - String type = getStringObjVar( item, "delayed.type"); - utils.setScriptVar( target, "food."+type+".dur", getIntObjVar( item, "delayed.dur") ); - utils.setScriptVar( target, "food."+type+".eff", getIntObjVar( item, "delayed.eff") ); - utils.setScriptVar( target, "food."+type+".time", getGameTime() ); - - addBuffIcon( target, "food."+type, 3600 ); - - dictionary outparams = new dictionary(); - outparams.put( "type", type ); - messageTo( target, "removeDelayedFoodEffect", outparams, 3600f, false ); - } - - else if (hasObjVar( item, "duration" )) - { - String type = getStringObjVar( item, "duration.type"); - - if (utils.hasScriptVar( target, "food."+type+".dur" )) - { - sendSystemMessage( target, new string_id( "combat_effects", "no_additional_effect") ); - return; - } - - int duration = getIntObjVar( item, "duration.dur"); - utils.setScriptVar( target, "food."+type+".dur", duration ); - utils.setScriptVar( target, "food."+type+".eff", getIntObjVar( item, "duration.eff") ); - - addBuffIcon( target, "food."+type, duration ); - - dictionary outparams = new dictionary(); - outparams.put( "type", type ); - messageTo( target, "removeDurationFoodEffect", outparams, duration, false ); - } - - else if (hasObjVar( item, "instant" )) - { - - food.applyInstantEffect( target, item ); - } - - else if (hasObjVar( item, "skill_mod" )) - { - - String mod_name = getStringObjVar( item, "skill_mod.name"); - int amount = (int) getFloatObjVar( item, "skill_mod.amount"); - int duration = (int) getFloatObjVar( item, "skill_mod.dur"); - String mod_id = "food_"+ mod_name; - - if (utils.hasScriptVar( target, mod_id )) - { - - prose_package pp = prose.getPackage( new string_id( "combat_effects", "dupe_skill_mod"), localize( new string_id( "stat_n", mod_name ) ) ); - sendSystemMessageProse( target, pp ); - return; - } - - utils.setScriptVar( target, mod_id, getGameTime() ); - addSkillModModifier( target, mod_id, mod_name, amount, duration, true, true ); - - addBuffIcon( target, "food."+templateName, duration ); - - prose_package pp = prose.getPackage( new string_id( "combat_effects", "skill_mod_buffed"), localize( new string_id( "stat_n", mod_name ) ) ); - sendSystemMessageProse( target, pp ); - } - - else if (hasObjVar( item, "mind_heal" )) - { - - int mind_heal = getIntObjVar( item, "mind_heal"); - int mind = getAttrib( target, MIND ); - int wounds = getAttribWound( target, MIND ); - int max_mind = getMaxAttrib( target, MIND ) - wounds; - - int damage = max_mind - mind; - if (mind_heal > damage) - { - mind_heal = damage; - } - - setAttrib( target, MIND, getUnmodifiedAttrib( target, MIND ) + mind_heal ); - - prose_package pp = prose.getPackage( new string_id( "combat_effects", "food_mind_heal"), mind_heal ); - sendSystemMessageProse( target, pp ); - } - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/corpse.java b/sku.0/sys.server/compiled/game/script/library/corpse.java deleted file mode 100644 index 8272b829f..000000000 --- a/sku.0/sys.server/compiled/game/script/library/corpse.java +++ /dev/null @@ -1,1438 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.collection; -import script.library.group; -import script.library.npe; -import script.library.prose; -import script.library.static_item; -import script.library.utils; - - -public class corpse extends script.base_script -{ - public corpse() - { - } - public static final String SCRIPT_PLAYER_CORPSE = "corpse.player_corpse"; - public static final String SCRIPT_AI_CORPSE = "corpse.ai_corpse"; - public static final String SCRIPT_AI_CORPSE_INVENTORY = "corpse.ai_corpse_inventory"; - - public static final String TEMPLATE_PLAYER_CORPSE = "object/tangible/container/corpse/player_corpse.iff"; - - public static final String VAR_CORPSE_WAYPOINT = "waypoint"; - public static final String VAR_TIME_CREATED = "create_time"; - - public static final String VAR_HAS_RESOURCE = "hasResource"; - public static final String VAR_BEEN_HARVESTED = "beenHarvested"; - - public static final String GROUP_CONSENTED = "consented"; - - public static final String DICT_PLAYER_ID = "playerId"; - public static final String DICT_CORPSE_ID = "corpseId"; - public static final String DICT_CORPSE_LOC = "corpseLoc"; - public static final String DICT_CORPSE_WAYPOINT = "waypoint"; - - public static final String DICT_PLAYER_NAME = "playerName"; - - public static final String DICT_COINS = "coins"; - - public static final String DICT_LOOTERS = "looters"; - - public static final int AI_CORPSE_EXPIRATION_TIME = 120; - public static final int AI_CORPSE_EMPTY_TIME = 5; - - public static final int PLAYER_CORPSE_EXPIRATION_TIME = 604800; - - public static final String HANDLER_CORPSE_EXPIRE = "handleCorpseExpire"; - public static final String HANDLER_ADD_CONSENTED = "handleAddConsentedUser"; - public static final String HANDLER_REMOVE_CONSENTED = "handleRemoveConsentedUser"; - - public static final String HANDLER_CORPSE_CLEANUP = "handleCorpseCleanup"; - - public static final String HANDLER_CORPSE_WAYPOINT_UPDATE = "handleCorpseWaypointUpdate"; - - public static final String HANDLER_REQUEST_COIN_LOOT = "handleRequestCoinLoot"; - - public static final String HANDLER_COINS_LOOTED = "handleCorpseCoinLoot"; - public static final String HANDLER_COINLOOT_FAILED = "handleCorpseCoinLootFailed"; - - public static final String HANDLER_CORPSE_EMPTY = "handleCorpseEmpty"; - - public static final String HANDLER_PERMISSIONS_INITIALIZED = "handleCorpsePermInit"; - - public static final String HANDLER_CORPSE_DEPOSIT_SUCCESS = "handleCorpseDepositSuccess"; - public static final String HANDLER_CORPSE_DEPOSIT_FAIL = "handleCorpseDepositFail"; - - public static final String HANDLER_DESTROY_SELF = "handleDestroySelf"; - - public static final string_id SID_LOOT_ALL = new string_id("sui", "loot_all"); - public static final string_id SID_HARVEST_CORPSE = new string_id("sui", "harvest_corpse"); - public static final string_id SID_HARVEST_MEAT = new string_id("sui", "harvest_meat"); - public static final string_id SID_HARVEST_BONE = new string_id("sui", "harvest_bone"); - public static final string_id SID_HARVEST_HIDE = new string_id("sui", "harvest_hide"); - - public static final string_id SID_CORPSE_LOOTED = new string_id("base_player", "corpse_looted"); - - public static final string_id PROSE_ITEM_LOOTED_SELF = new string_id("base_player", "prose_item_looted_self"); - public static final string_id PROSE_ITEM_LOOTED_OTHER = new string_id("base_player", "prose_item_looted_other"); - - public static final string_id SID_CORPSE_EMPTY = new string_id("error_message","corpse_empty"); - - public static final string_id SID_REMOVE_ONLY_CONTAINER = new string_id("error_message","remove_only"); - public static final string_id SID_REMOVE_ONLY_CORPSE = new string_id("error_message","remove_only_corpse"); - - public static final string_id SID_CORPSE_DRAG_INTO = new string_id("error_message","corpse_drag_into"); - public static final string_id SID_CORPSE_DRAG_INSIDE = new string_id("error_message","corpse_drag_inside"); - public static final string_id SID_CORPSE_DRAG_RANGE = new string_id("error_message","corpse_drag_range"); - - public static final string_id SID_CANNOT_LOOT_ALL = new string_id("error_message","cannot_loot_all"); - - public static final string_id PROSE_INCOMPLETE_LOOT = new string_id("error_message","prose_incomplete_loot"); - public static final string_id SID_INV_FULL = new string_id("error_message","inv_full"); - - public static final string_id SID_CLEANUP_AFTER_TRANSACTION = new string_id("base_player","corpse_transaction_pending"); - - public static final string_id PROSE_HARVESTED_ON_CORPSE = new string_id("error_message","harvested_on_corpse"); - public static final string_id PROSE_RARE_HARVEST_ON_CORPSE = new string_id("error_message","rare_harvest_on_corpse"); - - public static final string_id SID_CORPSE_HARVEST_SUCCESS = new string_id("skl_use","corpse_harvest_success"); - - public static final string_id SID_CREATURE_QUALITY_FAT = new string_id("skl_use","creature_quality_fat"); - public static final string_id SID_CREATURE_QUALITY_MEDIUM = new string_id("skl_use","creature_quality_medium"); - public static final string_id SID_CREATURE_QUALITY_SKINNY = new string_id("skl_use","creature_quality_skinny"); - public static final string_id SID_CREATURE_QUALITY_SCRAWNY = new string_id("skl_use","creature_quality_scrawny"); - public static final string_id SID_GROUP_CONSERVE = new string_id("skl_use","group_conserve"); - public static final string_id SID_GROUP_HARVEST_BONUS = new string_id("skl_use","group_harvest_bonus"); - public static final string_id SID_GROUP_HARVEST_BONUS_SCOUT = new string_id("skl_use","group_harvest_bonus_scout"); - public static final string_id SID_GROUP_HARVEST_BONUS_MASTERSCOUT = new string_id("skl_use","group_harvest_bonus_masterscout"); - - public static final string_id SID_NOTHING_TO_HARVEST = new string_id("skl_use","nothing_to_harvest"); - - public static final String DATATABLE_SPECIES = "datatables/mob/creatures.iff"; - - public static final String DATATABLE_COL_HAS_RESOURCE = "hasResources"; - - public static final String DATATABLE_COL_MEAT_AMT = "meat"; - public static final String DATATABLE_COL_MEAT_TYPE = "meatType"; - - public static final String DATATABLE_COL_HIDE_AMT = "hide"; - public static final String DATATABLE_COL_HIDE_TYPE = "hideType"; - - public static final String DATATABLE_COL_BONE_AMT = "bone"; - public static final String DATATABLE_COL_BONE_TYPE = "boneType"; - - public static final String DATATABLE_COL_RARE_AMT = "rare"; - public static final String DATATABLE_COL_RARE_TYPE = "rareType"; - - public static final String[] DATATABLE_COL = - { - DATATABLE_COL_MEAT_AMT, - DATATABLE_COL_HIDE_AMT, - DATATABLE_COL_BONE_AMT, - DATATABLE_COL_RARE_AMT - }; - - public static final int CCR_MEAT = 0; - public static final int CCR_HIDE = 1; - public static final int CCR_BONE = 2; - public static final int CCR_RARE = 3; - - public static final int CCR_MAX = 4; - - public static final float GROUP_BONUS_NONE = 1.0f; - public static final float GROUP_BONUS = 1.2f; - public static final float GROUP_BONUS_SCOUT = 1.3f; - public static final float GROUP_BONUS_MASTERSCOUT = 1.4f; - - - public static obj_id spawnPlayerCorpse(obj_id player) throws InterruptedException - { - if ((player == null) || (!isPlayer(player))) - { - return null; - } - - location loc = getLocation(player); - obj_id corpse = createObject(TEMPLATE_PLAYER_CORPSE, loc); - if ((corpse == null) || (corpse == obj_id.NULL_ID)) - { - sendSystemMessageTestingOnly(player, "spawnPlayerCorpse: unable to spawn a corpse at your location"); - sendSystemMessageTestingOnly(player, "spawnPlayerCorpse: loc = "+ loc.toString()); - return null; - } - else - { - persistObject(corpse); - setYaw(corpse, getYaw(player)); - - String pname = getAssignedName(player); - if (pname == null || pname.equals("")) - { - setName(corpse, "Corpse of Unknown Player"); - } - else - { - setName(corpse, "Corpse of "+ pname); - } - - setOwner(corpse, player); - setObjVar(corpse, utils.VAR_OWNER, player); - setObjVar(corpse, VAR_TIME_CREATED, getGameTime()); - initializeCorpsePermissions(corpse, null); - attachScript(corpse, SCRIPT_PLAYER_CORPSE); - grantCorpseConsent(corpse, player); - - if (hasObjVar(player, pclib.VAR_CONSENT_TO_ID)) - { - obj_id[] consented = getObjIdArrayObjVar(player, pclib.VAR_CONSENT_TO_ID); - if ((consented != null) && (consented.length > 0)) - { - for (int i = 0; i < consented.length; i++) - { - testAbortScript(); - - if (!grantCorpseConsent(corpse, consented[i])) - { - - } - } - } - } - - messageTo(corpse, HANDLER_CORPSE_EXPIRE, null, PLAYER_CORPSE_EXPIRATION_TIME, true); - } - - return corpse; - } - - - public static boolean initializeCorpsePermissions(obj_id corpse, dictionary params) throws InterruptedException - { - if (!isIdValid(corpse)) - { - return false; - } - - boolean litmus = true; - litmus &= permissions.initializePermissions(corpse); - litmus &= permissions.createPermissionsGroup(corpse, GROUP_CONSENTED); - litmus &= permissions.grantGroupPermission(corpse, GROUP_CONSENTED, permissions.canOpen); - - messageTo(corpse, HANDLER_PERMISSIONS_INITIALIZED, params, 1f, isObjectPersisted(corpse)); - - return litmus; - } - - - public static boolean grantCorpseConsent(obj_id corpse, obj_id player) throws InterruptedException - { - - if (!isIdValid(corpse) || !isIdValid(player)) - { - return false; - } - - dictionary d = new dictionary(); - d.put(DICT_PLAYER_ID, player); - - return messageTo(corpse, HANDLER_ADD_CONSENTED, d, 1f, isObjectPersisted(corpse)); - } - - - public static boolean grantCorpseConsent(obj_id[] corpses, obj_id player) throws InterruptedException - { - if ((corpses == null) || (corpses.length == 0) || !isIdValid(player)) - { - return false; - } - - boolean litmus = true; - for (int i =0; i < corpses.length; i++) - { - testAbortScript(); - litmus &= grantCorpseConsent(corpses[i], player); - } - return litmus; - } - - - public static boolean revokeCorpseConsent(obj_id corpse, obj_id player) throws InterruptedException - { - if (!isIdValid(corpse) || !isIdValid(player)) - { - return false; - } - - dictionary d = new dictionary(); - d.put(DICT_PLAYER_ID, player); - - return messageTo(corpse, HANDLER_REMOVE_CONSENTED, d, 1f, isObjectPersisted(corpse)); - } - - - public static boolean revokeCorpseConsent(obj_id[] corpses, obj_id player) throws InterruptedException - { - if ((corpses == null) || (corpses.length == 0) || !isIdValid(player)) - { - return false; - } - - boolean litmus = true; - for (int i =0; i < corpses.length; i++) - { - testAbortScript(); - litmus &= revokeCorpseConsent(corpses[i], player); - } - return litmus; - } - - - public static boolean revokeAllCorpseConsent(obj_id owner) throws InterruptedException - { - if (!isIdValid(owner)) - { - return false; - } - - obj_id[] corpses = utils.getObjIdBatchObjVar(owner, pclib.VAR_CORPSE_ID); - obj_id[] consented = getObjIdArrayObjVar(owner, pclib.VAR_CONSENT_TO_ID); - if ((corpses == null) || (consented == null)) - { - return false; - } - - boolean litmus = true; - for (int i = 0; i < corpses.length; i++) - { - testAbortScript(); - for (int n = 0; n < consented.length; n++) - { - testAbortScript(); - litmus &= revokeCorpseConsent(corpses[i], consented[n]); - } - } - return litmus; - } - - - public static boolean cleanUpPlayerCorpse(obj_id corpse) throws InterruptedException - { - return cleanUpPlayerCorpse( corpse, true ); - } - - - public static boolean cleanUpPlayerCorpse(obj_id corpse, boolean withDestroyMessage) throws InterruptedException - { - obj_id owner = getObjIdObjVar(corpse, utils.VAR_OWNER); - - obj_id waypoint = getObjIdObjVar(corpse, VAR_CORPSE_WAYPOINT); - - dictionary d = new dictionary(); - d.put(DICT_CORPSE_ID, corpse); - d.put(DICT_CORPSE_WAYPOINT, waypoint); - - messageTo(owner, HANDLER_CORPSE_CLEANUP, d, 1, true); - - int cash = getCashBalance(corpse); - if (cash > 0) - { - dictionary dictCoin = new dictionary(); - dictCoin.put(DICT_COINS, cash); - - depositCashToBank(corpse, cash, HANDLER_CORPSE_DEPOSIT_SUCCESS, HANDLER_CORPSE_DEPOSIT_FAIL, dictCoin); - return true; - } - - if (withDestroyMessage) - { - destroyObject( corpse ); - } - return true; - } - - - public static boolean dragPlayerCorpse(obj_id player, obj_id corpse, boolean giveFeedback) throws InterruptedException - { - if ((player == null) || (corpse == null)) - { - return false; - } - - if (canDragPlayerCorpse(player, corpse, giveFeedback)) - { - location playerLoc = getLocation(player); - obj_id[] stuff = getObjectsInRange(playerLoc, 20.0f); - - for (int i = 0; i < stuff.length; i++) - { - testAbortScript(); - if (isPlayer(stuff[i])) - { - playClientEffectLoc(stuff[i], "clienteffect/medic_drag.cef", getLocation(corpse), 0.0f); - } - } - - setLocation(corpse, getLocation(player)); - updateCorpseOwnerWaypoint(player, corpse); - return true; - } - - return false; - } - - - public static boolean dragPlayerCorpse(obj_id player, obj_id corpse) throws InterruptedException - { - return dragPlayerCorpse(player, corpse, true); - } - - - public static obj_id[] dragPlayerCorpse(obj_id player, obj_id[] corpses) throws InterruptedException - { - if (!isIdValid(player) || (corpses == null) || (corpses.length == 0)) - { - return null; - } - - Vector moved = new Vector(); - moved.setSize(0); - - for (int i = 0; i < corpses.length; i++) - { - testAbortScript(); - if (dragPlayerCorpse(player, corpses[i], false)) - { - moved = utils.addElement(moved, corpses[i]); - } - } - - if ((moved == null) || (moved.size() == 0)) - { - return null; - } - - obj_id[] _moved = new obj_id[0]; - if (moved != null) - { - _moved = new obj_id[moved.size()]; - moved.toArray(_moved); - } - return _moved; - } - - - public static boolean isPlayerCorpse(obj_id objectInQuestion) throws InterruptedException - { - if (isPlayer(objectInQuestion) && getPosture(objectInQuestion) == POSTURE_DEAD) - { - return true; - } - - return false; - } - - - public static obj_id[] getDraggableCorpsesInRange(obj_id player, boolean feedback) throws InterruptedException - { - Vector corpses = new Vector(); - corpses.setSize(0); - obj_id[] stuff = getObjectsInRange(player, 100.0f); - - for (int i = 0; i < stuff.length; i++) - { - testAbortScript(); - if (isPlayerCorpse(stuff[i])) - { - if (canDragPlayerCorpse(player, stuff[i], true)) - { - corpses = utils.addElement(corpses, stuff[i]); - } - } - } - - if (corpses == null || corpses.size() == 0) - { - sendSystemMessage(player, new string_id("spam", "drag_none_in_range") ); - } - - obj_id[] _corpses = new obj_id[0]; - if (corpses != null) - { - _corpses = new obj_id[corpses.size()]; - corpses.toArray(_corpses); - } - return _corpses; - } - - - public static boolean canDragPlayerCorpse(obj_id player, obj_id corpse, boolean giveFeedback) throws InterruptedException - { - if ((player == null) || (corpse == null)) - { - return false; - } - - location pLoc = getLocation(player); - location cLoc = getLocation(corpse); - if (cLoc == null) - { - return false; - } - - obj_id owner = getOwner(corpse); - if (!isIdValid(owner)) - { - return false; - } - - if (player != owner && !group.inSameGroup(player, owner) && !isGod(player)) - { - sendSystemMessage(player, permissions.SID_NO_CORPSE_PERMISSION); - return false; - } - - if (cLoc.area.equals(pLoc.area)) - { - if (cLoc.cell == pLoc.cell) - { - float dist = utils.getDistance2D(pLoc, cLoc); - - if (dist <= pclib.RANGE_CORPSE_DRAG_NORMAL) - { - return true; - } - else - { - if (giveFeedback) - { - sendSystemMessage(player, SID_CORPSE_DRAG_RANGE); - } - - return false; - } - } - else - { - - obj_id corpseContainer = structure.getContainingBuilding(corpse); - if (corpseContainer == null) - { - - if (giveFeedback) - { - sendSystemMessage(player, SID_CORPSE_DRAG_INTO); - } - - return false; - } - else - { - - obj_id playerContainer = structure.getContainingBuilding(player); - if (playerContainer == null) - { - - location bLoc = getLocation(corpseContainer); - if (utils.getDistance2D(pLoc, bLoc) <= pclib.RANGE_CORPSE_DRAG_INTERIOR) - { - return true; - } - } - else - { - - if (corpseContainer == playerContainer) - { - if (giveFeedback) - { - sendSystemMessage(player, SID_CORPSE_DRAG_INSIDE); - } - - return false; - } - } - } - } - } - - return false; - } - - - public static boolean updateCorpseOwnerWaypoint(obj_id player, obj_id corpse) throws InterruptedException - { - if ((player == null) || (corpse == null)) - { - return false; - } - - obj_id waypoint = getObjIdObjVar(corpse, VAR_CORPSE_WAYPOINT); - obj_id owner = getObjIdObjVar(corpse, utils.VAR_OWNER); - - if ((waypoint == null) || (owner == null)) - { - return false; - } - - location corpseLoc = getLocation(corpse); - if (corpseLoc == null) - { - return false; - } - - dictionary d = new dictionary(); - d.put(DICT_CORPSE_LOC,corpseLoc); - d.put(DICT_CORPSE_WAYPOINT, waypoint); - - return messageTo(owner, HANDLER_CORPSE_WAYPOINT_UPDATE, d, 0, false); - } - - - public static boolean lootCorpseCoins(obj_id player, obj_id corpse) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(corpse)) - { - return false; - } - - int cash = getCashBalance(corpse); - LOG("grouping","lootCorpseCoins: corpse cash = "+ cash); - if (cash > 0) - { - dictionary d = new dictionary(); - d.put(DICT_CORPSE_ID, corpse); - d.put(DICT_PLAYER_ID, player); - d.put(DICT_COINS, cash); - - messageTo(player, HANDLER_REQUEST_COIN_LOOT, d, 1f, isObjectPersisted(corpse)); - return true; - } - - return false; - } - - - public static boolean openPlayerCorpse(obj_id player, obj_id corpse) throws InterruptedException - { - boolean lootedCoins = lootCorpseCoins(player, corpse); - - boolean canLootItems = true; - obj_id[] corpseContents = getContents(corpse); - if ((corpseContents == null) || (corpseContents.length == 0)) - { - canLootItems = false; - } - - if (!lootedCoins && !canLootItems) - { - sendSystemMessage(player, SID_CORPSE_EMPTY); - return false; - } - - return true; - } - - - public static boolean lootPlayerCorpse(obj_id player, obj_id corpse) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(corpse)) - { - return false; - } - - if (getOwner(corpse) != player && !isGod(player)) - { - return false; - } - - if (openPlayerCorpse(player, corpse)) - { - obj_id[] corpseContents = getContents(corpse); - if ((corpseContents == null) || (corpseContents.length == 0)) - { - return false; - } - - obj_id pInv = utils.getInventoryContainer(player); - if (!isIdValid(pInv)) - { - return false; - } - - int moved = moveObjects(corpseContents, pInv); - if (moved < corpseContents.length) - { - obj_id[] leftContents = getContents(corpse); - if ((leftContents == null) || (leftContents.length == 0)) - { - } - else - { - int itemSize = getVolume(leftContents[0]); - int freeVol = getVolumeFree(pInv); - - if (itemSize > freeVol) - { - sendSystemMessage(player, SID_INV_FULL); - } - } - - int itemsLeft = corpseContents.length - moved; - prose_package pp = prose.getPackage(PROSE_INCOMPLETE_LOOT, null, corpse, itemsLeft); - sendSystemMessageProse(player, pp); - return false; - } - - sendSystemMessage(player, SID_CORPSE_LOOTED); - - if (getCashBalance(corpse) == 0) - { - cleanUpPlayerCorpse(corpse); - } - else - { - - if (!hasObjVar(corpse, "cleanupStamp")) - { - messageTo(corpse, "handleAttemptCorpseCleanup", null, 300, isObjectPersisted(corpse)); - } - } - - return true; - } - - return false; - } - - - public static boolean openAICorpse(obj_id player, obj_id corpse) throws InterruptedException - { - obj_id[] corpseContents = getContents(utils.getInventoryContainer(corpse)); - if ((corpseContents == null) || (corpseContents.length == 0)) - { - LOG("grouping","openAICorpse: no corpse contents!"); - - sendSystemMessage(player, SID_CORPSE_EMPTY); - return false; - } - - return true; - } - - - public static boolean lootAICorpse(obj_id player, obj_id corpse) throws InterruptedException - { - - if (!isIdValid(player) || !isIdValid(corpse)) - { - return false; - } - - LOG("loot","lootAICorpse: entered..."); - if (openAICorpse(player, corpse)) - { - LOG("loot","lootAICorpse: successfully opened corpse!!!!!!!!!!!!!!!!!!!!!"); - if (lootAICorpseContents(player, corpse)) - { - LOG("loot","lootAICorpse: successfully looted contents"); - messageTo(corpse, HANDLER_CORPSE_EMPTY, null, 1f, isObjectPersisted(corpse)); - } - else - { - LOG("loot","lootAICorpse: FAILED TO LOOT ALL CONTENTS...hahaha"); - } - - } - - LOG("loot","lootAICorpse: returning false"); - return false; - } - - - public static boolean lootAICorpseContents(obj_id player, obj_id corpse) throws InterruptedException - { - boolean grouped = false; - boolean movedAll = true; - - if (group.isGrouped (player)) - { - grouped = true; - } - - if (!isIdValid(player) || !isIdValid(corpse)) - { - return false; - } - - obj_id cInv = utils.getInventoryContainer(corpse); - if (!isIdValid(cInv)) - { - return false; - } - - obj_id[] corpseContents = getValidLootContents(getContents(cInv)); - LOG("loot", "corpseContents.length: "+corpseContents.length); - - if ((corpseContents == null) || (corpseContents.length == 0)) - { - LOG("loot", "I AM DESTOYING CORPSE because corpseContents.length = "+corpseContents.length); - messageTo(corpse, "handleCorpseExpire", null, 5, true); - return false; - } - - obj_id pInv = utils.getInventoryContainer(player); - if (!isIdValid(pInv)) - { - return false; - } - - LOG("loot", "Inventory received: "+pInv); - - int moved = moveObjects(corpseContents, pInv); - LOG("loot", "moved: "+moved); - - obj_id[] leftContents = getContents(cInv); - LOG("loot", "leftContents: "+leftContents.length); - if (grouped) - { - obj_id gid = getGroupObject(player); - if (isIdValid(gid)) - { - Vector movedContents = utils.removeElements(corpseContents, leftContents); - if (movedContents != null && movedContents.size() > 0) - { - for (int z = 0; z < movedContents.size(); z ++) - { - testAbortScript(); - group.notifyItemLoot(gid, player, corpse, ((obj_id)(movedContents.get(z)))); - } - } - } - } - - if (leftContents.length > 0) - { - if (grouped) - { - loot.sendGroupLootSystemMessage (leftContents[0], player, group.GROUP_STF, "full_inventory"); - - } - - prose_package pp = prose.getPackage(PROSE_INCOMPLETE_LOOT, null, corpse, leftContents.length); - sendSystemMessageProse(player, pp); - - return false; - } - - sendSystemMessage(player, SID_CORPSE_LOOTED); - return true; - } - - - public static obj_id[] getValidLootContents(obj_id[] corpseContents) throws InterruptedException - { - if (corpseContents == null || corpseContents.length == 0) - { - return null; - } - - Vector validContents = new Vector(); - validContents.setSize(0); - - for (int i=0; i 0)) - { - return null; - } - - return ret; - } - - return null; - } - - - public static boolean hasResource(obj_id corpse) throws InterruptedException - { - if (corpse == null) - { - return false; - } - - return ( hasResource(ai_lib.getCreatureName(corpse)) != null ); - } - - - public static boolean harvestCreatureCorpse(obj_id player, obj_id corpse, String restype) throws InterruptedException - { - - obj_id pInv = utils.getInventoryContainer(player); - obj_id cInv = utils.getInventoryContainer(corpse); - if ((pInv == null) || (cInv == null)) - { - return false; - } - - int freeVol = getVolumeFree(pInv); - - if (1 > freeVol) - { - sendSystemMessage(player, SID_INV_FULL); - return false; - } - - float inGroupBonusMultiplier = GROUP_BONUS_NONE; - - if ((player == null) || (corpse == null)) - { - return false; - } - - if (!hasObjVar(corpse, VAR_HAS_RESOURCE)) - { - return false; - } - - if (utils.hasScriptVar( corpse, "harvestedBy." + player )) - { - return false; - } - - if (getDistance(getLocation(player), getLocation(corpse)) > 15.0f) - { - return false; - } - utils.setScriptVar( corpse, "harvestedBy."+ player, 1 ); - - String mobType = ai_lib.getCreatureName(corpse); - dictionary params = null; - if (restype.equals("")) - { - params = getRandomHarvestCorpseResources( player, corpse, 1 ); - } - else - { - params = getHarvestCorpseResources( player, corpse, restype ); - } - if ((params == null) || (params.isEmpty())) - { - return false; - } - - int sklMod = getSkillStatMod( player, "creature_harvesting"); - - float bonusHarvest = sklMod / 100.0f; - float skillEfficiency = ((sklMod * 10f) + 500f) / 2000f; - - boolean litmus = true; - int harvestXP = 0; - int successCount = 0; - java.util.Enumeration keys = params.keys(); - int amt = 0; - String type = null; - int actualAmount = 0; - - while (keys.hasMoreElements()) - { - testAbortScript(); - - String resourceType = (String)(keys.nextElement()); - amt = params.getInt(resourceType); - amt += amt * bonusHarvest; - - amt = (int)(amt * skillEfficiency); - - if (group.isGrouped(player)) - { - obj_id[] groupMembers = getGroupMemberIds(getGroupObject(player)); - for (int i=0; i < groupMembers.length; i++) - { - testAbortScript(); - - if (isIdValid(groupMembers[i]) && exists(groupMembers[i]) && isPlayer(groupMembers[i]) && groupMembers[i] != player) - { - - float dist = getDistance(player, groupMembers[i]); - if (dist != -1 && dist <= 64) - { - - if (inGroupBonusMultiplier == GROUP_BONUS_NONE) - { - inGroupBonusMultiplier = GROUP_BONUS; - } - - if (hasSkill(groupMembers[i], "outdoors_scout_novice") && inGroupBonusMultiplier < GROUP_BONUS_SCOUT) - { - inGroupBonusMultiplier = GROUP_BONUS_SCOUT; - } - - if (hasSkill(groupMembers[i], "outdoors_scout_master")) - { - inGroupBonusMultiplier = GROUP_BONUS_MASTERSCOUT; - } - } - } - } - - amt *= inGroupBonusMultiplier; - } - - if (amt <= 0) - { - amt = 1; - } - - String sceneName = getCurrentSceneName(); - String rsrcMapTable = "datatables/creature_resource/resource_scene_map.iff"; - String correctedPlanetName = dataTableGetString(rsrcMapTable, sceneName, 1); - - if (correctedPlanetName == null || correctedPlanetName.equals("")) - { - correctedPlanetName = "tatooine"; - } - - type = resourceType + "_"+ correctedPlanetName; - - if (amt > 0) - { - - if (hasObjVar(corpse, "npe.harvestable")) - { - - actualAmount = npe.harvestNpeResourceStack(player, type, amt); - - } - - else - { - - actualAmount = extractCorpseResource( type, amt, getLocation(getTopMostContainer(corpse)), pInv, cInv, 1 ); - } - - if ((actualAmount <= 0) && hasObjVar(player, "newbie_handoff.mission.harvest")) - { - actualAmount = 1; - } - - if (actualAmount > 0) - { - params.put( resourceType, actualAmount ); - - successCount++; - - if (hasScript(player, "theme_park.new_player.new_player")) - { - dictionary webster = new dictionary(); - webster.put("resourceType", resourceType); - webster.put("amount", actualAmount); - messageTo(player, "handleNewPlayerScoutAction", webster, 1, false); - } - } - else - { - litmus &= false; - } - } - else - { - litmus &= false; - } - } - - obj_id groupId = getGroupObject(player); - - if (litmus && actualAmount > 0) - { - - type = resource.getResourceName( type ); - prose_package pp = null; - pp = prose.getPackage( new string_id("skl_use", "harvest_success"), null, type, null, null, null, null, null, null, null, actualAmount, 0.f ); - sendSystemMessageProse( player, pp ); - - if (inGroupBonusMultiplier == GROUP_BONUS_MASTERSCOUT) - { - sendSystemMessage(player, SID_GROUP_HARVEST_BONUS_MASTERSCOUT); - } - if (inGroupBonusMultiplier == GROUP_BONUS_SCOUT) - { - sendSystemMessage(player, SID_GROUP_HARVEST_BONUS_SCOUT); - } - if (inGroupBonusMultiplier == GROUP_BONUS) - { - sendSystemMessage(player, SID_GROUP_HARVEST_BONUS); - } - - if (isIdValid(groupId)) - { - group.notifyHarvest( groupId, player, corpse, type, actualAmount ); - } - } - - if (successCount == 0) - { - sendSystemMessage( player, SID_NOTHING_TO_HARVEST ); - } - else - { - if (hasObjVar(player, "newbie_handoff.mission.harvest")) - { - messageTo( player, "missionHarvestComplete", null, 0, true ); - } - } - - messageTo(corpse, HANDLER_CORPSE_EMPTY, null, 1f, isObjectPersisted(corpse)); - return litmus; - } - - - public static void setCreatureHarvestXp(obj_id corpse, obj_id player) throws InterruptedException - { - - } - - - public static dictionary getHarvestCorpseResources(obj_id player, obj_id corpse, String restype) throws InterruptedException - { - if ((player == null) || (corpse == null)) - { - return null; - } - - dictionary d = new dictionary(); - String mobType = ai_lib.getCreatureName( corpse ); - if (mobType == null) - { - return null; - } - - int amt = (int) (Math.pow( ai_lib.getLevel( corpse ), 1.65f ) * 0.4f + 2.f); - amt += 25; - if (amt < 1) - { - amt = 1; - } - if (amt > 700) - { - amt = 700; - } - if (!restype.equals("")) - { - String typeName = utils.dataTableGetString( DATATABLE_SPECIES, mobType, restype + "Type"); - if ((typeName == null) || (typeName.equals("")) || (typeName.equals("none"))) - { - } - else - { - d.put( typeName, amt ); - } - } - else - { - for (int i = 0; i <= CCR_BONE; i++) - { - testAbortScript(); - String typeName = utils.dataTableGetString( DATATABLE_SPECIES, mobType, DATATABLE_COL[i] + "Type"); - if ((typeName == null) || (typeName.equals("")) || (typeName.equals("none"))) - { - } - else - { - d.put( typeName, amt ); - - } - } - } - - return d; - } - - - public static dictionary getRandomHarvestCorpseResources(obj_id player, obj_id corpse, int maxTypes) throws InterruptedException - { - if ((player == null) || (corpse == null) || (maxTypes < 1)) - { - return null; - } - - dictionary params = getHarvestCorpseResources(player, corpse, ""); - if ((params == null) || (params.isEmpty())) - { - LOG("harvestCorpse","getRandomHarvestCorpseResources -> no corpse resources!"); - return null; - } - - dictionary ret = new dictionary(); - - for (int n = 0; n < maxTypes; n++) - { - testAbortScript(); - if (!params.isEmpty()) - { - java.util.Enumeration keys = params.keys(); - - int size = params.size(); - int idx = rand(0, size - 1); - - for (int i = 0; i < idx; i++) - { - testAbortScript(); - String temp = (String)keys.nextElement(); - } - - String type = (String)keys.nextElement(); - int amt = params.getInt(type); - - ret.put(type, amt); - - params.remove(type); - } - } - - if ((ret == null) || (ret.isEmpty())) - { - LOG("harvestCorpse","getRandomHarvestCorpseResources -> no returnable resources!"); - return null; - } - - return ret; - } - - - public static dictionary getRandomHarvestCorpseResources(obj_id player, obj_id corpse) throws InterruptedException - { - return getRandomHarvestCorpseResources(player, corpse, 1); - } - - - public static int extractCorpseResource(String resourceClass, int amt, location loc, obj_id pInv, obj_id cInv, int min) throws InterruptedException - { - - if ((resourceClass.equals("")) || (amt < 1) || (loc == null) || (pInv == null) || (cInv == null)) - { - LOG("harvestCorpse","ERROR: extractCorpseResource -> invalid parameters!!"); - return -1; - } - - obj_id playerId = obj_id.NULL_ID; - obj_id corpseId = getContainedBy( cInv ); - - obj_id[] crates = resource.createRandom( resourceClass, amt, loc, cInv, playerId, min); - - obj_id player = utils.getContainingPlayer(pInv); - collection.collectionResource(player, resourceClass); - - if ((crates == null) || (crates.length == 0)) - { - LOG("harvestCorpse","ERROR: extractCorpseResource -> unable to create random resources!! "+ resourceClass); - return -1; - } - - int total = 0; - for (int i = 0; i < crates.length; i++) - { - testAbortScript(); - total += getResourceContainerQuantity( crates[i] ); - } - - boolean movefail = false; - for (int i = 0; i < crates.length; i++) - { - testAbortScript(); - if (!putIn( crates[i], pInv, playerId )) - { - movefail = true; - } - } - - if (movefail) - { - prose_package pp = prose.getPackage( PROSE_HARVESTED_ON_CORPSE, corpseId ); - sendSystemMessageProse( playerId, pp ); - } - - return total; - } - - - public static boolean isCorpseEmpty(obj_id objCorpse) throws InterruptedException - { - - obj_id inv = utils.getInventoryContainer(objCorpse); - if (isIdValid(objCorpse)) - { - obj_id[] contents = getContents(inv); - LOG("corpse_debug", "contents are "+ contents); - if ((contents == null) || (contents.length == 0)) - { - int cash = getCashBalance(objCorpse); - if (cash == 0) - { - LOG("corpse_debug", "cash is 0"); - if (hasObjVar(objCorpse, "hasResource")) - { - LOG("corpse_debug", "resources is very yes"); - return false; - } - else - { - LOG("corpse_debug", "no resources here"); - return true; - } - } - } - } - return false; - } - - - public static boolean hasLootPermissions(obj_id corpse, obj_id player) throws InterruptedException - { - obj_id killCredit = getObjIdObjVar(corpse, xp.VAR_TOP_GROUP); - - if (exists(corpse) && hasObjVar(corpse, "storytellerid")) - { - obj_id playerstorytellerId = utils.getObjIdScriptVar(player, "storytellerid"); - obj_id corpsestorytellerId = getObjIdObjVar(corpse, "storytellerid"); - if (isIdValid(playerstorytellerId) && playerstorytellerId == corpsestorytellerId) - { - return true; - } - else if (isGod(player)) - { - sendSystemMessageTestingOnly(player, "GOD MODE: Granting access to storyteller loot container that you do not have permission for."); - return true; - } - return false; - } - - if (player == killCredit) - { - return true; - } - - if (group.isGroupObject(killCredit)) - { - obj_id[] killList = getGroupMemberIds(killCredit); - for (int i = 0; i < killList.length; i++) - { - testAbortScript(); - if (player == killList[i]) - { - return true; - } - } - } - - if (isGod(player)) - { - sendSystemMessageTestingOnly(player, "GOD MODE: Granting access to loot container that you do not have permission for."); - return true; - } - - return false; - } - - - public static void showLootMeParticle(obj_id corpse) throws InterruptedException - { - obj_id killCredit = getObjIdObjVar(corpse, xp.VAR_TOP_GROUP); - obj_id[] killList; - if (group.isGroupObject(killCredit)) - { - killList = getGroupMemberIds(killCredit); - } - else - { - killList = new obj_id[1]; - killList[0] = killCredit; - } - - transform offset = transform.identity.setPosition_p(0f, getObjectCollisionRadius(corpse), 0); - playClientEffectObj(killList, "appearance/pt_loot_disc.prt", corpse, "", offset, "lootMe"); - - } - - - public static void clearLootMeParticle(obj_id corpse) throws InterruptedException - { - obj_id killCredit = getObjIdObjVar(corpse, xp.VAR_TOP_GROUP); - obj_id[] killList; - if (group.isGroupObject(killCredit)) - { - killList = getGroupMemberIds(killCredit); - } - else - { - killList = new obj_id[1]; - killList[0] = killCredit; - } - - stopClientEffectObjByLabel(killList, corpse, "lootMe", false); - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/create.java b/sku.0/sys.server/compiled/game/script/library/create.java deleted file mode 100644 index c89df1caa..000000000 --- a/sku.0/sys.server/compiled/game/script/library/create.java +++ /dev/null @@ -1,1539 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.hue; -import script.library.ai_lib; -import script.ai.ai_combat; -import script.library.factions; -import script.library.dressup; -import script.library.attrib; -import script.library.weapons; -import script.library.stealth; - - -public class create extends script.base_script -{ - public create() - { - } - public static final String CREATURE_TABLE = "datatables/mob/creatures.iff"; - public static final String STAT_BALANCE_TABLE = "datatables/mob/stat_balance.iff"; - public static final String VEHICLE_TABLE = "datatables/vehicle/vehicle_template.iff"; - public static final String TEMPLATE_PREFIX = "object/mobile/"; - public static final String CREATURE_NAME_FILE = "mob/creature_names"; - public static final String NPC_CUSTOMIZATION_PREFIX = "datatables/npc_customization/"; - public static final String DRESSED_NPC_TABLE = "datatables/npc_customization/dressed_species.iff"; - public static final String DRESSED_NPC_TABLE_ROOT = "datatables/npc_customization/dressed_species_"; - public static final String BIOLINK_SCRIPT = "item.armor.biolink_item_non_faction"; - - public static final float MELEE_SPEED_MOD = 1.25f; - public static final float MELEE_HP_MOD = 1.15f; - - public static final String INITIALIZE_CREATURE_DO_NOT_SCALE_OBJVAR = "create_doNotRescale"; - - public static final String[] MINATTRIBNAMES = - { - "minHealth", - "minConstitution", - "minAction", - "minStamina", - "minMind", - "minWillpower" - }; - - public static final String[] MAXATTRIBNAMES = - { - "maxHealth", - "maxConstitution", - "maxAction", - "maxStamina", - "maxMind", - "maxWillpower" - }; - - - public static obj_id staticObject(String objectName, location spawnLocation) throws InterruptedException - { - - if (objectName == null) - { - LOG("create", "create.staticObject called with NULL objectName!"); - return null; - } - - obj_id creature = create.object( objectName, spawnLocation, false); - if (creature != null) - { - setCreatureStatic(creature, true); - setWantSawAttackTriggers( creature, false ); - setInvulnerable( creature, true ); - } - return creature; - } - - - public static obj_id object(String objectName, location spawnLocation) throws InterruptedException - { - return object( objectName, spawnLocation, -1 ); - } - - - public static obj_id object(String objectName, location spawnLocation, int level) throws InterruptedException - { - if (objectName == null) - { - LOG("create", "create.object called with NULL objectName!"); - return null; - } - - return create.object( objectName, spawnLocation, level, true); - } - - - public static obj_id object(String objectName, location spawnLocation, boolean withAi) throws InterruptedException - { - return object( objectName, spawnLocation, -1, withAi ); - } - - - public static obj_id object(String objectName, location spawnLocation, int level, boolean withAi) throws InterruptedException - { - return create.object( objectName, spawnLocation, level, withAi, false ); - } - - - public static obj_id object(String objectName, location spawnLocation, boolean withAi, boolean isPet) throws InterruptedException - { - return object( objectName, spawnLocation, -1, withAi, isPet ); - } - - - public static obj_id object(String objectName, location spawnLocation, int level, boolean withAi, boolean isPet) throws InterruptedException - { - if (objectName == null) - { - LOG( "create", "create.object called with NULL objectName!"); - return null; - } - if (objectName.endsWith(".iff")) - { - LOG( "create", getName( getSelf() ) + " creating: "+ objectName + " at "+ spawnLocation ); - obj_id creature = createObject( objectName, spawnLocation ); - if (isIdValid(creature)) - { - utils.setScriptVar( creature, "spawnedBy", getSelf() ); - } - - return creature; - } - else - { - obj_id creature = createCreature( objectName, spawnLocation, level, withAi, isPet ); - if (isIdValid(creature)) - { - utils.setScriptVar( creature, "spawnedBy", getSelf() ); - } - - return creature; - } - } - - - public static obj_id object(String objectName, obj_id objContainer, boolean withAi, boolean isPet) throws InterruptedException - { - obj_id creature = object( objectName, objContainer, -1, withAi, isPet ); - if (isIdValid(creature)) - { - utils.setScriptVar( creature, "spawnedBy", getSelf() ); - } - - return creature; - } - - - public static obj_id object(String objectName, obj_id objContainer, int level, boolean withAi, boolean isPet) throws InterruptedException - { - if (objectName == null) - { - LOG( "create", "create.object called with NULL objectName!"); - return null; - } - if (objectName.endsWith(".iff")) - { - LOG( "create", getName( getSelf() ) + " creating: "+ objectName + " at "+ objContainer); - obj_id creature = createObject( objectName, objContainer, ""); - if (isIdValid(creature)) - { - utils.setScriptVar( creature, "spawnedBy", getSelf() ); - } - - return creature; - } - else - { - obj_id creature = createCreature( objectName, objContainer, level, withAi, isPet ); - if (isIdValid(creature)) - { - utils.setScriptVar( creature, "spawnedBy", getSelf() ); - } - - return creature; - } - } - - - public static obj_id object(String objectName, float xOffset, float zOffset) throws InterruptedException - { - return object( objectName, xOffset, zOffset, -1 ); - } - - - public static obj_id object(String objectName, float xOffset, float zOffset, int level) throws InterruptedException - { - if (objectName == null) - { - LOG("create", "create.object called with NULL objectName!"); - return null; - } - - location spawnLoc = new location( getLocation( getSelf() ) ); - spawnLoc.x += xOffset; - spawnLoc.z += zOffset; - return create.object( objectName, spawnLoc, level ); - } - - - public static obj_id themeParkObject(String objectName, float xOffset, float zOffset, String destroyHandlerName, float destroyMessageDelay) throws InterruptedException - { - if (objectName == null) - { - LOG("create", "create.themeParkObject called with NULL objectName!"); - return null; - } - - obj_id newObject = create.themeParkObject( objectName, xOffset, zOffset ); - addDestroyMessage( newObject, destroyHandlerName, destroyMessageDelay, getSelf() ); - return newObject; - } - - - public static obj_id themeParkObject(String objectName, float xOffset, float zOffset) throws InterruptedException - { - if (objectName == null) - { - LOG("create", "create.themeParkObject called with NULL objectName!"); - return null; - } - - location spawnLoc = new location( getLocation( getSelf() ) ); - spawnLoc.x += xOffset; - spawnLoc.z += zOffset; - obj_id newObject = create.object( objectName, spawnLoc ); - setInvulnerable( newObject, true ); - ai_lib.setDefaultCalmBehavior( newObject, ai_lib.BEHAVIOR_SENTINEL ); - return newObject; - } - - - public static obj_id createNpc(String creatureName, String templateName, location spawnLocation) throws InterruptedException - { - return createNpc( creatureName, templateName, spawnLocation, -1 ); - } - - - public static obj_id createNpc(String creatureName, String templateName, location spawnLocation, int level) throws InterruptedException - { - if (creatureName == null) - { - LOG("create", "create.createNpc called with NULL creatureName!"); - return null; - } - - if (templateName == null) - { - LOG("create", "create.createNpc called with NULL templateName!"); - return null; - } - - dictionary creatureDict = utils.dataTableGetRow( CREATURE_TABLE, creatureName ); - if (creatureDict == null) - { - return null; - } - - if (!templateName.endsWith(".iff" )) - { - - String tableName = DRESSED_NPC_TABLE_ROOT + templateName.charAt(0) + ".iff"; - if (dataTableHasColumn( tableName, templateName )) - { - String[] templateList = dataTableGetStringColumnNoDefaults( tableName, templateName ); - if (templateList.length < 1 || templateList == null) - { - LOG( "create", templateName + " column in dressed_species is empty!"); - return null; - } - templateName = templateList[rand(0, templateList.length-1 ) ]; - } - else - { - - String[] templateList = dataTableGetStringColumnNoDefaults( NPC_CUSTOMIZATION_PREFIX + templateName + ".iff", rand(0,1)); - if (templateList.length < 1 || templateList == null) - { - LOG( "create", templateName + " datatable does not exist!"); - return null; - } - templateName = templateList[rand(0, templateList.length-1 ) ]; - } - } - return createCreature( creatureName, templateName, spawnLocation, creatureDict, level, true ); - } - - - public static obj_id createNpc(String creatureName, String templateName, float xOffset, float zOffset) throws InterruptedException - { - return createNpc( creatureName, templateName, xOffset, zOffset, -1 ); - } - - - public static obj_id createNpc(String creatureName, String templateName, float xOffset, float zOffset, int level) throws InterruptedException - { - - if (creatureName == null) - { - LOG("create", "create.createNpc called with NULL creatureName!"); - return null; - } - - if (templateName == null) - { - LOG("create", "create.createNpc called with NULL templateName!"); - return null; - } - - location spawnLoc = new location( getLocation( getSelf() ) ); - spawnLoc.x += xOffset; - spawnLoc.z += zOffset; - return create.createNpc( creatureName, templateName, spawnLoc, level ); - } - - - public static obj_id createCreature(String creatureName, location spawnLocation, boolean withAi) throws InterruptedException - { - return createCreature( creatureName, spawnLocation, -1, withAi ); - } - - - public static obj_id createCreature(String creatureName, location spawnLocation, int level, boolean withAi) throws InterruptedException - { - return create.createCreature( creatureName, spawnLocation, level, withAi, false ); - } - - - public static obj_id createCreature(String creatureName, location spawnLocation, boolean withAi, boolean isPet) throws InterruptedException - { - return createCreature( creatureName, spawnLocation, -1, withAi, isPet ); - } - - - public static obj_id createCreature(String creatureName, location spawnLocation, int level, boolean withAi, boolean isPet) throws InterruptedException - { - if (creatureName == null) - { - LOG("create", "create.createCreature called with NULL creatureName!"); - return null; - } - - dictionary creatureDict = utils.dataTableGetRow( CREATURE_TABLE, creatureName ); - if (creatureDict == null) - { - debugServerConsoleMsg( null, "WARNING: Unable to spawn invalid creatureType: "+ creatureName ); - return null; - } - - String templateName = creatureDict.getString("template"); - if (templateName.equals("") || templateName == null) - { - debugServerConsoleMsg( null, "WARNING: Unable to spawn invalid creatureType: "+ creatureName + " - bad templateName?"); - return null; - } - - if (!templateName.endsWith(".iff" )) - { - - String tableName = DRESSED_NPC_TABLE_ROOT + templateName.charAt(0) + ".iff"; - if (dataTableHasColumn( tableName, templateName )) - { - String[] templateList = dataTableGetStringColumnNoDefaults( tableName, templateName ); - if (templateList.length < 1 || templateList == null) - { - LOG( "create", templateName + " column in dressed_species is empty!"); - return null; - } - templateName = templateList[rand(0, templateList.length-1 ) ]; - } - else - { - String[] templateList = dataTableGetStringColumnNoDefaults( NPC_CUSTOMIZATION_PREFIX + templateName + ".iff", rand(0,1)); - if (templateList == null) - { - debugServerConsoleMsg( null, "WARNING: Unable to spawn "+ creatureName + " - bad templateName? "+ templateName ); - LOG( "create", templateName + " does not exist!"); - return null; - } - if (templateList.length == 0) - { - debugServerConsoleMsg( null, "WARNING: Unable to spawn "+ creatureName + " - bad templateName? "+ templateName ); - LOG( "create", templateName + " File was Empty!"); - return null; - } - templateName = templateList[rand(0, templateList.length-1 ) ] + ".iff"; - } - } - return createCreature( creatureName, templateName, spawnLocation, creatureDict, level, withAi, isPet ); - } - - - public static obj_id createCreature(String creatureName, obj_id objContainer, boolean withAi, boolean isPet) throws InterruptedException - { - return createCreature( creatureName, objContainer, -1, withAi, isPet ); - } - - - public static obj_id createCreature(String creatureName, obj_id objContainer, int level, boolean withAi, boolean isPet) throws InterruptedException - { - if (creatureName == null) - { - LOG("create", "create.createCreature called with NULL creatureName!"); - return null; - } - - dictionary creatureDict = utils.dataTableGetRow( CREATURE_TABLE, creatureName ); - if (creatureDict == null) - { - debugServerConsoleMsg( null, "WARNING: Unable to spawn invalid creatureType: "+ creatureName ); - return null; - } - - String templateName = creatureDict.getString("template"); - if (templateName.equals("") || templateName == null) - { - debugServerConsoleMsg( null, "WARNING: Unable to spawn invalid creatureType: "+ creatureName + " - bad templateName?"); - return null; - } - - if (!templateName.endsWith(".iff" )) - { - - String tableName = DRESSED_NPC_TABLE_ROOT + templateName.charAt(0) + ".iff"; - if (dataTableHasColumn( tableName, templateName )) - { - String[] templateList = dataTableGetStringColumnNoDefaults( tableName, templateName ); - if (templateList.length < 1 || templateList == null) - { - LOG( "create", templateName + " column in dressed_species is empty!"); - return null; - } - templateName = templateList[rand(0, templateList.length-1 ) ]; - } - else - { - String[] templateList = dataTableGetStringColumnNoDefaults( NPC_CUSTOMIZATION_PREFIX + templateName + ".iff", rand(0,1)); - if (templateList == null) - { - debugServerConsoleMsg( null, "WARNING: Unable to spawn "+ creatureName + " - bad templateName? "+ templateName ); - LOG( "create", templateName + " does not exist!"); - return null; - } - if (templateList.length == 0) - { - debugServerConsoleMsg( null, "WARNING: Unable to spawn "+ creatureName + " - bad templateName? "+ templateName ); - LOG( "create", templateName + " File was Empty!"); - return null; - } - templateName = templateList[rand(0, templateList.length-1 ) ] + ".iff"; - } - } - return createCreature( creatureName, templateName, objContainer, creatureDict, level, withAi, isPet ); - } - - - public static obj_id createCreature(String creatureName, String templateName, location spawnLocation, dictionary creatureDict, boolean withAi) throws InterruptedException - { - return createCreature( creatureName, templateName, spawnLocation, creatureDict, -1, withAi ); - } - - - public static obj_id createCreature(String creatureName, String templateName, location spawnLocation, dictionary creatureDict, int level, boolean withAi) throws InterruptedException - { - return createCreature( creatureName, templateName, spawnLocation, creatureDict, level, withAi, false ); - } - - - public static obj_id createCreature(String creatureName, String templateName, location spawnLocation, dictionary creatureDict, boolean withAi, boolean isPet) throws InterruptedException - { - return createCreature( creatureName, templateName, spawnLocation, creatureDict, -1, withAi, isPet ); - } - - - public static obj_id createCreature(String creatureName, String templateName, location spawnLocation, dictionary creatureDict, int level, boolean withAi, boolean isPet) throws InterruptedException - { - if (templateName.equals("") || templateName == null) - { - LOG( "create", creatureName + " could not be made because templateName is null"); - return null; - } - if (creatureName.equals("") || creatureName == null) - { - LOG( "create", "creatureName is null - can't spawn whatever this was supposed to be"); - return null; - } - - templateName = TEMPLATE_PREFIX + templateName; - - LOG( "create", getName( getSelf() ) + " creating: "+ creatureName + " at "+ spawnLocation ); - obj_id creature = createObject( templateName, spawnLocation ); - if (!isIdValid(creature)) - { - return null; - } - else - { - utils.setScriptVar( creature, "spawnedBy", getSelf() ); - } - - if (isPet) - { - utils.setScriptVar( creature, "petBeingInitialized", true ); - } - - String finalCreatureName = getStringObjVar( creature, "ai.creatureBaseName"); - if (finalCreatureName == null || finalCreatureName.equals("")) - { - finalCreatureName = creatureName; - } - - randomlyNameCreature( creature, finalCreatureName ); - - initializeCreature ( creature, creatureName, creatureDict, level ); - - attachCreatureScripts( creature, creatureDict.getString( "scripts"), withAi ); - - return creature; - } - - - public static obj_id createCreature(String creatureName, String templateName, obj_id objContainer, dictionary creatureDict, boolean withAi, boolean isPet) throws InterruptedException - { - return createCreature( creatureName, templateName, objContainer, creatureDict, -1, withAi, isPet ); - } - - - public static obj_id createCreature(String creatureName, String templateName, obj_id objContainer, dictionary creatureDict, int level, boolean withAi, boolean isPet) throws InterruptedException - { - if (templateName.equals("") || templateName == null) - { - LOG( "create", creatureName + " could not be made because templateName is null"); - return null; - } - if (creatureName.equals("") || creatureName == null) - { - LOG( "create", "creatureName is null - can't spawn whatever this was supposed to be"); - return null; - } - - templateName = TEMPLATE_PREFIX + templateName; - - LOG( "create", getName( getSelf() ) + " creating: "+ creatureName + " at "+ objContainer ); - obj_id creature = createObject( templateName, objContainer, ""); - if (!isIdValid(creature)) - { - return null; - } - else - { - utils.setScriptVar( creature, "spawnedBy", getSelf() ); - } - - if (isPet) - { - utils.setScriptVar( creature, "petBeingInitialized", true ); - } - - String finalCreatureName = getStringObjVar( creature, "ai.creatureBaseName"); - if (finalCreatureName == null || finalCreatureName.equals("")) - { - finalCreatureName = creatureName; - } - - randomlyNameCreature( creature, finalCreatureName ); - - initializeCreature ( creature, creatureName, creatureDict, level ); - - attachCreatureScripts( creature, creatureDict.getString( "scripts"), withAi ); - - return creature; - } - - - public static void initializeCreature(obj_id creature, String creatureName, dictionary creatureDict) throws InterruptedException - { - initializeCreature( creature, creatureName, creatureDict, -1); - } - - - public static void initializeCreature(obj_id creature, String creatureName, dictionary creatureDict, int level) throws InterruptedException - { - LOGC(aiLoggingEnabled(creature), "debug_ai", ("########## create::initializeCreature() BEGIN ai("+ creature + ") creatureName("+ creatureName + ") ##########")); - - setCreatureName(creature, creatureName); - - float minScale = creatureDict.getFloat( "minScale"); - float maxScale = creatureDict.getFloat( "maxScale"); - float baseScale = getScale( creature ); - if (baseScale != 1.0f) - { - utils.setScriptVar( creature, "ai.baseScale", baseScale ); - } - - if (!hasObjVar(creature, "storytellerid") && !hasObjVar(creature, INITIALIZE_CREATURE_DO_NOT_SCALE_OBJVAR)) - { - float newScale = baseScale * rand( minScale, maxScale ); - setScale( creature, newScale ); - - setYaw( creature, rand(0.0f, 360.0f ) ); - } - - setObjVar(creature, "creature_type", creatureName); - setObjVar(creature, "socialGroup", creatureDict.getString("socialGroup")); - - int huevar = creatureDict.getInt( "hue"); - if (huevar != 0) - { - int highhuevar = (huevar*8)-1; - int lowhuevar = highhuevar-7; - huevar = rand(lowhuevar, highhuevar); - ranged_int_custom_var[] c = hue.getPalcolorVars(creature); - if (c != null) - { - for (int i = 0; i < c.length; i++) - { - testAbortScript(); - c[i].setValue(huevar); - } - } - } - - int baseLevel = creatureDict.getInt("BaseLevel"); - int dmgLevel = baseLevel + creatureDict.getInt("Damagelevelmodifier"); - int statLevel = baseLevel + creatureDict.getInt("StatLevelModifier"); - int toHitLevel = baseLevel + creatureDict.getInt("ToHitLevelModifier"); - int armorLevel = baseLevel + creatureDict.getInt("ArmorLevelModifier"); - - if (dmgLevel <= 0) - { - dmgLevel = 1; - } - if (statLevel <= 0) - { - statLevel = 1; - } - if (toHitLevel <= 0) - { - toHitLevel = 1; - } - if (armorLevel <= 0) - { - armorLevel = 1; - } - - if (level > 0) - { - dmgLevel = level; - statLevel = level; - toHitLevel = level; - armorLevel = level; - } - else - { - - level = calcCreatureLevel(statLevel, dmgLevel, toHitLevel, armorLevel); - } - - setObjVar(creature, "intCombatDifficulty", level); - setLevel(creature, level); - - int stealType = creatureDict.getInt("stealingFlags"); - utils.setScriptVar(creature, stealth.STEAL_TYPE, stealType); - - int difficultyClass = creatureDict.getInt("difficultyClass"); - if (difficultyClass < 0) - { - difficultyClass = 0; - } - - setObjVar(creature, "difficultyClass", difficultyClass); - - String diffClassName = ""; - if (difficultyClass == 1) - { - diffClassName = "Elite_"; - } - if (difficultyClass == 2) - { - diffClassName = "Boss_"; - } - - float damagePerSecond = dataTableGetFloat(STAT_BALANCE_TABLE, dmgLevel - 1, diffClassName+"damagePerSecond"); - - int toHitChance = dataTableGetInt(STAT_BALANCE_TABLE, toHitLevel - 1, diffClassName + "ToHit"); - int defenseValue = dataTableGetInt(STAT_BALANCE_TABLE, toHitLevel - 1, diffClassName + "Def"); - boolean hasRanged = false; - obj_id creatureWeapon = getCurrentWeapon( creature ); - float primarySpeed = creatureDict.getFloat("primary_weapon_speed"); - float secondarySpeed = creatureDict.getFloat("secondary_weapon_speed"); - - int priMinDamage = Math.round((damagePerSecond * primarySpeed) * 0.5f); - int priMaxDamage = Math.round((damagePerSecond * primarySpeed) * 1.5f); - - int secMinDamage = Math.round((damagePerSecond * secondarySpeed) * 0.5f); - int secMaxDamage = Math.round((damagePerSecond * secondarySpeed) * 1.5f); - - if (isIdValid(creatureWeapon)) - { - setWeaponAttackSpeed(creatureWeapon, primarySpeed); - setWeaponMaxDamage(creatureWeapon, priMaxDamage); - setWeaponMinDamage(creatureWeapon, priMinDamage); - weapons.setWeaponData(creatureWeapon); - - utils.setScriptVar(creatureWeapon, "isCreatureWeapon", 1); - setObjVar(creatureWeapon, "isCreatureWeapon", 1); - } - - obj_id defaultWeapon = getDefaultWeapon( creature ); - if (isIdValid(defaultWeapon)) - { - setWeaponAttackSpeed(defaultWeapon, primarySpeed); - setWeaponMaxDamage(defaultWeapon, secMaxDamage); - setWeaponMinDamage(defaultWeapon, secMinDamage); - weapons.setWeaponData(defaultWeapon); - - utils.setScriptVar(defaultWeapon, "isCreatureWeapon", 1); - setObjVar(defaultWeapon, "isCreatureWeapon", 1); - } - - { - if (aiHasPrimaryWeapon(creature)) - { - final obj_id primaryWeapon = aiGetPrimaryWeapon(creature); - dictionary primDat = weapons.getWeaponDat(primaryWeapon); - - if (primDat != null) - { - - weapons.setWeaponAttributes(primaryWeapon, primDat, 1f); - } - - setWeaponAttackSpeed(primaryWeapon, primarySpeed); - setWeaponMaxDamage(primaryWeapon, priMaxDamage); - setWeaponMinDamage(primaryWeapon, priMinDamage); - weapons.setWeaponData(primaryWeapon); - hasRanged = hasRanged || combat.isRangedWeapon(primaryWeapon); - if (hasScript(primaryWeapon, BIOLINK_SCRIPT)) - { - cleanOffBioLink(primaryWeapon); - } - - utils.setScriptVar(primaryWeapon, "isCreatureWeapon", 1); - setObjVar(primaryWeapon, "isCreatureWeapon", 1); - } - } - - { - if (aiHasSecondaryWeapon(creature)) - { - final obj_id secondaryWeapon = aiGetSecondaryWeapon(creature); - dictionary secDat = weapons.getWeaponDat(secondaryWeapon); - - if (secDat != null) - { - weapons.setWeaponAttributes(secondaryWeapon, secDat, 1f); - } - - setWeaponAttackSpeed(secondaryWeapon, secondarySpeed); - setWeaponMaxDamage(secondaryWeapon, secMaxDamage); - setWeaponMinDamage(secondaryWeapon, secMinDamage); - weapons.setWeaponData(secondaryWeapon); - hasRanged = hasRanged || combat.isRangedWeapon(secondaryWeapon); - if (hasScript(secondaryWeapon, BIOLINK_SCRIPT)) - { - cleanOffBioLink(secondaryWeapon); - } - - utils.setScriptVar(secondaryWeapon, "isCreatureWeapon", 1); - setObjVar(secondaryWeapon, "isCreatureWeapon", 1); - } - } - - float speedMod = 1; - float hpMod = 1; - if (hasRanged) - { - speedMod = MELEE_SPEED_MOD; - hpMod = MELEE_HP_MOD; - } - - int avgAttribHealth = dataTableGetInt(STAT_BALANCE_TABLE, statLevel - 1, diffClassName + "HP"); - int minAttribHealth = minAttribHealth = (int)(avgAttribHealth * 0.9f); - int maxAttribHealth = maxAttribHealth = (int)(avgAttribHealth * 1.1f); - float newAttribValueHealth = rand( minAttribHealth, maxAttribHealth ); - newAttribValueHealth *= hpMod; - - setMaxAttrib(creature, HEALTH, (int)newAttribValueHealth ); - setAttrib( creature, HEALTH, (int)newAttribValueHealth ); - - int avgAttribAction = dataTableGetInt(STAT_BALANCE_TABLE, statLevel - 1, diffClassName + "Action"); - int minAttribAction = minAttribAction = (int)(avgAttribAction * 0.9f); - int maxAttribAction = maxAttribAction = (int)(avgAttribAction * 1.1f); - int newAttribValueAction = rand( minAttribAction, maxAttribAction); - setMaxAttrib(creature, ACTION, newAttribValueAction ); - setAttrib( creature, ACTION, newAttribValueAction ); - - setMaxAttrib(creature, MIND, 1000 ); - setAttrib( creature, MIND, 1000 ); - - int healthRegen = dataTableGetInt(STAT_BALANCE_TABLE, statLevel - 1, "HealthRegen"); - int actionRegen = dataTableGetInt(STAT_BALANCE_TABLE, statLevel - 1, "ActionRegen"); - int mindRegen = dataTableGetInt(STAT_BALANCE_TABLE, statLevel - 1, "MindRegen"); - - setRegenRate(creature, CONSTITUTION, healthRegen); - - setRegenRate(creature, STAMINA, healthRegen); - - setRegenRate(creature, WILLPOWER, healthRegen); - - float normalRegen = dataTableGetFloat(STAT_BALANCE_TABLE, statLevel - 1, diffClassName + "Regen"); - float combatRegen = dataTableGetFloat(STAT_BALANCE_TABLE, statLevel - 1, diffClassName + "CombatRegen"); - - int xpValue = xp.getLevelBasedXP(level); - setObjVar( creature, "combat.intCombatXP", xpValue ); - - { - float runSpeed = ai_lib.AI_MAX_MOVEMENT_SPEED * aiGetMovementSpeedPercent(creature); - runSpeed *= speedMod; - setBaseRunSpeed(creature, runSpeed); - - { - if (getBaseWalkSpeed(creature) > runSpeed) - { - setBaseWalkSpeed(creature, runSpeed); - } - } - - LOGC(aiLoggingEnabled(creature), "debug_ai", ("create::initializeCreature() ai("+ creature + ") runSpeed("+ runSpeed + ")")); - } - - applySkillStatisticModifiers( creature, toHitChance, defenseValue ); - - applyCreatureImmunities(creature, creatureDict); - - setCreatureObjVars( creature, creatureDict.getString( "objvars") ); - - int pvpOnly = creatureDict.getInt("isSpecialForces"); - - String faction = creatureDict.getString( "pvpFaction"); - if ((faction != null) && (!faction.equals(""))) - { - factions.setFaction( creature, faction, pvpOnly); - } - - int invulnerable = creatureDict.getInt( "invulnerable"); - if (invulnerable != 0) - { - setInvulnerable( creature, true ); - } - - String diction = creatureDict.getString( "diction"); - if (!diction.equals("none")) - { - setObjVar( creature, "ai.diction", diction ); - } - - int niche = creatureDict.getInt( "niche"); - - if (getTopMostContainer(creature) != creature) - { - ai_lib.setDefaultCalmBehavior(creature, ai_lib.BEHAVIOR_SENTINEL); - } - - randomlyNameCreature( creature, creatureName ); - - setAttributeAttained( creature, attrib.ALL); - switch ( niche ) - { - case NICHE_HERBIVORE : - setAttributeAttained( creature, attrib.HERBIVORE ); - setAttributeInterested( creature, attrib.CARNIVORE ); - break; - case NICHE_CARNIVORE : - case NICHE_PREDATOR : - setAttributeAttained( creature, attrib.CARNIVORE ); - setAttributeInterested( creature, attrib.HERBIVORE ); - setAttributeInterested( creature, attrib.NPC ); - break; - case NICHE_NPC : - setAttributeAttained( creature, attrib.NPC ); - setAttributeInterested( creature, attrib.CARNIVORE ); - setUpFactionalEnemyAttribs( creature, faction ); - break; - case NICHE_ANDROID : - setAttributeAttained( creature, attrib.NPC ); - setAttributeInterested( creature, attrib.CARNIVORE ); - setUpFactionalEnemyAttribs( creature, faction ); - break; - } - - String strLootTable = creatureDict.getString("lootTable"); - int intRolls = creatureDict.getInt("intLootRolls"); - int intPercentage = creatureDict.getInt("intRollPercent"); - if (!strLootTable.equals("")) - { - LOG("npe", "table is "+strLootTable); - int intItems = 0; - for (int intI =0; intI < intRolls; intI++) - { - testAbortScript(); - int intRand = rand(1, 99); - LOG("npe", "roll is "+intRand+" and +% is "+intPercentage); - if (intRand < intPercentage) - { - - intItems++; - } - } - LOG("npe", "items is "+intItems); - - setObjVar(creature, "loot.lootTable", strLootTable); - setObjVar(creature, "loot.numItems", intItems); - } - - if (!initializeArmor(creature, creatureDict, dataTableGetInt(STAT_BALANCE_TABLE, armorLevel - 1, diffClassName + "Armor"))) - { - LOG( "create", "Unable to initialize armor on "+ creatureName + "("+ creature + ")"); - } - - int stringCheck = creatureName.indexOf("recruiter"); - if (stringCheck > -1) - { - String pvpFaction = creatureDict.getString( "pvpFaction"); - setFactionRecruiter(creature, pvpFaction); - } - - if (hasObjVar(creature, "detect_hidden")) - { - int detectInt = getIntObjVar(creature, "detect_hidden"); - if (detectInt > 0) - { - applySkillStatisticModifier(creature, "detect_hidden", detectInt); - } - } - - LOGC(aiLoggingEnabled(creature), "debug_ai", ("########## create::initializeCreature() END ai("+ creature + ") creatureName("+ creatureName + ") ##########")); - } - - - public static int calcCreatureLevel(String creatureName) throws InterruptedException - { - dictionary creatureDict = utils.dataTableGetRow( CREATURE_TABLE, creatureName ); - if (creatureDict == null) - { - debugServerConsoleMsg( null, "WARNING: Unable to find invalid creatureType: "+ creatureName ); - return -1; - } - - return calcCreatureLevel(creatureDict); - } - - - public static int calcCreatureLevel(dictionary creatureDict) throws InterruptedException - { - - int baseLevel = creatureDict.getInt("BaseLevel"); - int dmgLevel = baseLevel + creatureDict.getInt("Damagelevelmodifier"); - int statLevel = baseLevel + creatureDict.getInt("StatLevelModifier"); - int toHitLevel = baseLevel + creatureDict.getInt("ToHitLevelModifier"); - int armorLevel = baseLevel + creatureDict.getInt("ArmorLevelModifier"); - - if (statLevel <= 0) - { - statLevel = 1; - } - if (dmgLevel <= 0) - { - dmgLevel = 1; - } - if (toHitLevel <= 0) - { - toHitLevel = 1; - } - if (armorLevel <= 0) - { - armorLevel = 1; - } - - return calcCreatureLevel(statLevel, dmgLevel, toHitLevel, armorLevel); - } - - - public static int calcCreatureLevel(int statLevel, int dmgLevel, int toHitLevel, int armorLevel) throws InterruptedException - { - int level = 0; - - { - - level = (int)(((statLevel*6) + (dmgLevel*6) + (toHitLevel*2) + (armorLevel*4))/18f); - } - - return level; - } - - - public static void attachCreatureScripts(obj_id creature, String scriptList, boolean withAi) throws InterruptedException - { - if (getConfigSetting("GameServer", "disableAI")!=null) - { - return; - } - - if (withAi) - { - - attachScript( creature, "ai.ai"); - attachCombatScripts( creature ); - attachScript(creature, "systems.skills.stealth.player_stealth"); - - } - - if (scriptList == null || scriptList.equals("")) - { - return; - } - - String[] scriptArray = split(scriptList, ','); - for (int i = 0; i < scriptArray.length; i++) - { - testAbortScript(); - attachScript( creature, scriptArray[i] ); - } - } - - - public static boolean initializeArmor(obj_id creature, dictionary creatureDict) throws InterruptedException - { - int armorLevel = creatureDict.getInt("BaseLevel") + creatureDict.getInt("ArmorLevelModifier"); - - int difficultyClass = creatureDict.getInt("difficultyClass"); - if (difficultyClass < 0) - { - difficultyClass = 0; - } - - String diffClassName = ""; - if (difficultyClass == 1) - { - diffClassName = "Elite_"; - } - if (difficultyClass == 2) - { - diffClassName = "Boss_"; - } - - int armorRating = dataTableGetInt(STAT_BALANCE_TABLE, armorLevel - 1, diffClassName + "Armor"); - - return initializeArmor(creature, creatureDict, armorRating); - } - - - public static boolean initializeArmor(obj_id creature, dictionary creatureDict, int armorRating) throws InterruptedException - { - int[] armorData = new int[10]; - - armorData[0] = 0; - armorData[1] = armorRating; - armorData[2] = creatureDict.getInt("armorKinetic"); - armorData[3] = creatureDict.getInt("armorEnergy"); - armorData[4] = creatureDict.getInt("armorBlast"); - armorData[5] = creatureDict.getInt("armorHeat"); - armorData[6] = creatureDict.getInt("armorCold"); - armorData[7] = creatureDict.getInt("armorElectric"); - armorData[8] = creatureDict.getInt("armorAcid"); - armorData[9] = creatureDict.getInt("armorStun"); - - return initializeArmor(creature, armorData); - } - - - public static boolean initializeArmor(obj_id creature, int[] armorData) throws InterruptedException - { - int armorRating = armorData[0]; - int armorEffectiveness = armorData[1]; - int armorKinetic = armorData[2]; - int armorEnergy = armorData[3]; - int armorBlast = armorData[4]; - int armorHeat = armorData[5]; - int armorCold = armorData[6]; - int armorElectric = armorData[7]; - int armorAcid = armorData[8]; - int armorStun = armorData[9]; - - boolean success = true; - int vulnerability = DAMAGE_RESTRAINT; - - armor.removeAllArmorData(creature); - - String armorCategoryObjVar = armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_ARMOR_CATEGORY; - setObjVar(creature, armorCategoryObjVar, AC_battle); - - String armorLevelObjVar = armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_ARMOR_LEVEL; - setObjVar(creature, armorLevelObjVar, AL_standard); - - String genProtectionObjVar = armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_GENERAL_PROTECTION; - setObjVar(creature, genProtectionObjVar, (float)armorEffectiveness); - utils.setScriptVar(creature, armor.SCRIPTVAR_CACHED_GENERAL_PROTECTION, armorEffectiveness); - - return success; - } - - - public static void setCreatureObjVars(obj_id creature, String objVarList) throws InterruptedException - { - - utils.setObjVarsList(creature, objVarList); - } - - - public static String getLairDifficulty(int intMinDifficulty, int intMaxDifficulty, int intPlayerDifficulty) throws InterruptedException - { - - final String[] LAIR_DIFFICULTIES = - { - "veryEasy", "easy", "medium", "hard", "veryHard" - }; - - int intDifference = intMaxDifficulty - intMinDifficulty; - intPlayerDifficulty = intPlayerDifficulty - intMinDifficulty; - - if (intDifference == 0) - { - intDifference = 1; - } - float fltPercent = (float)(intPlayerDifficulty / intDifference); - fltPercent = fltPercent * 100; - int intIndex = (int)(fltPercent / 20); - - intIndex = intIndex - 1; - if (intIndex < 0) - { - intIndex = 0; - } - if (intIndex >= LAIR_DIFFICULTIES.length) - { - intIndex = LAIR_DIFFICULTIES.length - 1; - } - - return LAIR_DIFFICULTIES[intIndex]; - } - - - public static void grantAllAbilities(obj_id npc) throws InterruptedException - { - return; - - } - - - public static void attachCombatScripts(obj_id npc) throws InterruptedException - { - if (!hasScript( npc, "ai.creature_combat")) - { - attachScript( npc, "ai.creature_combat"); - } - - if (!hasScript(npc, "systems.combat.combat_actions")) - { - attachScript(npc, "systems.combat.combat_actions"); - } - - obj_id primaryWeapon = aiGetPrimaryWeapon(npc); - obj_id secondaryWeapon = aiGetSecondaryWeapon(npc); - boolean hasJediWeapon = false; - - if (isIdValid(primaryWeapon)) - { - if (jedi.isLightsaber(primaryWeapon)) - { - hasJediWeapon = true; - } - } - - if (isIdValid(secondaryWeapon)) - { - if (jedi.isLightsaber(secondaryWeapon)) - { - hasJediWeapon = true; - } - } - - } - - - public static void applySkillStatisticModifiers(obj_id creature, int toHitChance, int defenseValue) throws InterruptedException - { - applySkillStatisticModifier(creature, "rifle_accuracy", toHitChance); - applySkillStatisticModifier(creature, "toHitChance", toHitChance); - applySkillStatisticModifier(creature, "carbine_accuracy", toHitChance); - applySkillStatisticModifier(creature, "pistol_accuracy", toHitChance); - applySkillStatisticModifier(creature, "heavyweapon_accuracy", toHitChance); - applySkillStatisticModifier(creature, "onehandmelee_accuracy", toHitChance); - applySkillStatisticModifier(creature, "twohandmelee_accuracy", toHitChance); - applySkillStatisticModifier(creature, "unarmed_accuracy", toHitChance); - applySkillStatisticModifier(creature, "polearm_accuracy", toHitChance); - applySkillStatisticModifier(creature, "thrown_accuracy", toHitChance); - applySkillStatisticModifier(creature, "onehandlightsaber_accuracy", toHitChance); - applySkillStatisticModifier(creature, "twohandlightsaber_accuracy", toHitChance); - applySkillStatisticModifier(creature, "polearmlightsaber_accuracy", toHitChance); - applySkillStatisticModifier(creature, "force_accuracy", toHitChance); - applySkillStatisticModifier(creature, "ranged_defense", defenseValue); - applySkillStatisticModifier(creature, "melee_defense", defenseValue); - } - - - public static void applyCreatureImmunities(obj_id creature, dictionary creatureDict) throws InterruptedException - { - int rootImmune = creatureDict.getInt("rootImmune"); - if (rootImmune > 0) - { - applySkillStatisticModifier(creature, "movement_resist_root", rootImmune); - } - - int snareImmune = creatureDict.getInt("snareImmune"); - if (snareImmune > 0) - { - applySkillStatisticModifier(creature, "movement_resist_snare", snareImmune); - } - - int stunImmune = creatureDict.getInt("stunImmune"); - if (stunImmune > 0) - { - applySkillStatisticModifier(creature, "movement_resist_stun", stunImmune); - } - - int mezImmune = creatureDict.getInt("mezImmune"); - if (mezImmune > 0) - { - applySkillStatisticModifier(creature, "movement_resist_mez", mezImmune); - } - - int armorBreakImmune = creatureDict.getInt("canNotPunish"); - if (armorBreakImmune > 0) - { - utils.setScriptVar(creature, "combat.immune.no_punish", 1); - } - int tauntImmune = creatureDict.getInt("tauntImmune"); - if (tauntImmune > 0) - { - utils.setScriptVar(creature, "combat.immune.taunt", 1); - } - - int ignorePlayer = creatureDict.getInt("ignorePlayer"); - if (ignorePlayer > 0) - { - utils.setScriptVar(creature, "combat.immune.taunt", 1); - factions.setIgnorePlayer(creature); - } - } - - - public static void addDestroyMessage(obj_id creature, String handlerName, float delay, obj_id recipient) throws InterruptedException - { - if (!isIdValid(creature)) - { - return; - } - - if (!hasScript( creature, "object.destroy_message" )) - { - attachScript( creature, "object.destroy_message"); - } - - Vector destroyMessageNames = new Vector(); - destroyMessageNames.setSize(0); - Vector destroyMessageDelays = new Vector(); - destroyMessageDelays.setSize(0); - Vector destroyMessageRecipients = new Vector(); - destroyMessageRecipients.setSize(0); - - if (hasObjVar( creature, "destroyMessageList" )) - { - destroyMessageNames = getResizeableStringArrayObjVar( creature, "destroyMessageList.handlerNames"); - destroyMessageDelays = getResizeableFloatArrayObjVar( creature, "destroyMessageList.delays"); - destroyMessageRecipients = getResizeableObjIdArrayObjVar( creature, "destroyMessageList.recipients"); - } - - destroyMessageNames = utils.addElement( destroyMessageNames, handlerName ); - destroyMessageDelays = utils.addElement( destroyMessageDelays, delay ); - destroyMessageRecipients = utils.addElement( destroyMessageRecipients, recipient ); - - if ((((destroyMessageNames != null) && (destroyMessageNames.size() > 0)) && ((destroyMessageDelays != null) && (destroyMessageDelays.size() > 0)) && ((destroyMessageRecipients != null) && (destroyMessageRecipients.size() > 0)))) - { - - setObjVar(creature, "destroyMessageList.handlerNames", destroyMessageNames ); - setObjVar(creature, "destroyMessageList.delays", destroyMessageDelays ); - setObjVar(creature, "destroyMessageList.recipients", destroyMessageRecipients ); - } - } - - - public static void randomlyNameCreature(obj_id npc, String creatureName) throws InterruptedException - { - - String templateName = getTemplateName( npc ); - if (templateName.indexOf("stormtrooper") != -1) - { - nameStormTrooper( npc ); - - } - - if (templateName.indexOf("swamp_trooper") != -1) - { - nameSwampTrooper( npc ); - - } - - if (templateName.indexOf("scout_trooper") != -1) - { - nameScoutTrooper( npc ); - - } - if (templateName.indexOf("tie_fighter") != -1) - { - nameImperialPilot( npc ); - - } - if (templateName.indexOf("dark_trooper") != -1) - { - nameDarkTrooper( npc ); - - } - - String oldName = getAssignedName( npc ); - string_id nameId = new string_id( CREATURE_NAME_FILE, creatureName ); - - String actualName = getString(nameId); - if (actualName == null || actualName.equals("")) - { - setTitle( npc, creatureName ); - return; - } - - setName( npc, ""); - setName( npc, nameId ); - } - - - public static void setTitle(obj_id npc, String creatureName) throws InterruptedException - { - string_id nameId = new string_id( CREATURE_NAME_FILE, creatureName ); - if (nameId == null) - { - return; - } - - String newName = getString( nameId ); - if (newName == null || newName.equals("")) - { - return; - } - - String oldName = getAssignedName( npc ); - String oldNameId = getString( getNameStringId( npc )); - if (oldName.equals(oldNameId)) - { - setName( npc, ""); - setName( npc, nameId ); - } - else if (oldName == null || oldName.equals("")) - { - setName( npc, ""); - setName( npc, nameId ); - } - else - { - setName( npc, oldName + " ("+ getString(nameId) + ")"); - } - } - - - public static void nameStormTrooper(obj_id npc) throws InterruptedException - { - int designation = rand (1,5); - String StName = "TK-"; - switch (designation) - { - case 1: - StName = "TK-"; - break; - case 2: - StName = "GK-"; - break; - case 3: - StName = "RK-"; - break; - case 4: - StName = "LK-"; - break; - case 5: - StName = "VK-"; - break; - } - setName (npc, StName + rand(1,820)); - } - - - public static void nameImperialPilot(obj_id npc) throws InterruptedException - { - setName (npc, "DS-"+ rand(1,820)); - } - - - public static void nameScoutTrooper(obj_id npc) throws InterruptedException - { - int designation = rand (1,5); - String StName = "TK-"; - switch (designation) - { - case 1: - StName = "SX-"; - break; - case 2: - StName = "GX-"; - break; - case 3: - StName = "VX-"; - break; - case 4: - StName = "CX-"; - break; - case 5: - StName = "NX-"; - break; - } - setName (npc, StName + rand(1,820)); - } - - - public static void nameDarkTrooper(obj_id npc) throws InterruptedException - { - int designation = rand (1,5); - String StName = "DLX-"; - switch (designation) - { - case 1: - StName = "JLB-"; - break; - case 2: - StName = "RAR-"; - break; - case 3: - StName = "KNP-"; - break; - case 4: - StName = "BCP-"; - break; - case 5: - StName = "RTZ-"; - break; - } - setName (npc, StName + rand(10,99)); - } - - - public static void nameSwampTrooper(obj_id npc) throws InterruptedException - { - int designation = rand (1,5); - String StName = "TK-"; - switch (designation) - { - case 1: - StName = "GL-"; - break; - case 2: - StName = "TL-"; - break; - case 3: - StName = "RL-"; - break; - case 4: - StName = "NL-"; - break; - case 5: - StName = "CL-"; - break; - } - setName (npc, StName + rand(1,820)); - } - - - public static boolean setFactionRecruiter(obj_id npc, String faction) throws InterruptedException - { - - if (npc == null || npc == obj_id.NULL_ID) - { - return false; - } - - if (faction == null) - { - return false; - } - - setObjVar(npc, "faction_recruiter.faction", faction); - attachScript(npc, "npc.faction_recruiter.faction_recruiter"); - return true; - - } - - - public static void setUpFactionalEnemyAttribs(obj_id npc, String pvpFaction) throws InterruptedException - { - if (pvpFaction == null) - { - return; - } - - if (pvpFaction.equals("")) - { - return; - } - - setAttributeAttained( npc, attrib.NPC ); - setAttributeInterested( npc, attrib.NPC ); - } - - - public static void cleanOffBioLink(obj_id weapon) throws InterruptedException - { - detachScript(weapon, BIOLINK_SCRIPT); - removeObjVar(weapon, "biolink"); - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/factions.java b/sku.0/sys.server/compiled/game/script/library/factions.java deleted file mode 100644 index cf62eed7a..000000000 --- a/sku.0/sys.server/compiled/game/script/library/factions.java +++ /dev/null @@ -1,3159 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.callable; -import script.library.pet_lib; -import script.library.utils; -import script.library.attrib; -import script.library.skill; -import script.library.ai_lib; -import script.library.space_flags; -import script.library.performance; -import script.library.combat; -import script.library.luck; -import script.library.skill; - - -public class factions extends script.base_script -{ - public factions() - { - } - public static final int RESIGN_TIME = 0; - public static final int COVERT_TIME = 300; - - public static final String VAR_RESIGNING = "faction_recruiter.resigning"; - - public static final float BOTHAN_NEGATIVE_MOD = 0.90f; - - public static final String FACTION = "faction"; - public static final float FACTION_RATING_MIN = -5000.0f; - public static final float FACTION_RATING_MAX = +5000.0f; - public static final float NON_ALIGNED_FACTION_MAX = +1000.0f; - public static final float FACTION_RATING_DECLARABLE_MIN = 200.0f; - public static final float FACTION_RATING_SYMPATHIZER_MIN = 750.0f; - public static final float FACTION_RATING_INVALID = 0.0f; - public static final float MAX_FACTION_KILL_REWARD = 30.0f; - public static final int NEWLY_DECLARED_INTERVAL = 300; - - public static final int AD_HOC_FACTION = -1; - public static final int NPC_FACTION_START_INDEX = 2; - - public static final int REACTION_LIKE = 2; - public static final int REACTION_POSITIVE = 1; - public static final int REACTION_NEUTRAL = 0; - public static final int REACTION_NEGATIVE = -1; - public static final int REACTION_DISLIKE = -2; - - public static final int STATUS_FRIEND = 0; - public static final int STATUS_NEUTRAL = 1; - public static final int STATUS_ENEMY = 2; - - public static final String FACTION_IMPERIAL = "Imperial"; - public static final String FACTION_REBEL = "Rebel"; - public static final String FACTION_HUTT = "Hutt"; - public static final String FACTION_NEUTRAL = "Neutral"; - - public static final int FACTION_FLAG_UNKNOWN = 0; - public static final int FACTION_FLAG_REBEL = 1; - public static final int FACTION_FLAG_IMPERIAL = 2; - public static final int FACTION_FLAG_NEUTRAL = 3; - - public static final String IN_ADHOC_PVP_AREA = "pvp_faction.in_adhoc_pvp_area"; - - public static final String FACTION_TABLE = "datatables/faction/faction.iff"; - - public static final string_id PROSE_AWARD_FACTION = new string_id("base_player","prose_award_faction"); - public static final string_id PROSE_LOSE_FACTION = new string_id("base_player","prose_lose_faction"); - public static final string_id PROSE_MAX_FACTION = new string_id("base_player","prose_max_faction"); - public static final string_id PROSE_MIN_FACTION = new string_id("base_player","prose_min_faction"); - - public static final string_id PROSE_TEF = new string_id("base_player","prose_tef"); - - public static final String KASHYYYK = "Kashyyyk"; - public static final String HSSKOR = "Hsskor"; - - public static final String TBL_RANK = "datatables/faction/rank.iff"; - public static final String GCW_RANK_TABLE = "datatables/gcw/gcw_rank.iff"; - - public static final String COL_INDEX = "INDEX"; - public static final String COL_NAME = "NAME"; - public static final String COL_COST = "COST"; - public static final String COL_DELEGATE_MULTIPLIER = "DELEGATE_MULTIPLIER"; - - public static final int MAXIMUM_RANK = 15; - - public static final String DATATABLE_ALLOWED_XP_TYPES = "datatables/npc/faction_recruiter/allowed_xp_types.iff"; - - public static final String SCRIPT_PLAYER_RECRUITER = "npc.faction_recruiter.player_recruiter"; - public static final String SCRIPT_FACTION_ITEM = "npc.faction_recruiter.faction_item"; - - public static final String VAR_TRAINING_SELECTION = "faction_recruiter.training_selection"; - public static final String VAR_TRAINING_COST = "faction_recruiter.cost"; - public static final String VAR_TRAINING_XP = "faction_recruiter.xp"; - public static final String VAR_AVAILABLE_ITEMS = "faction_recruiter.available_items"; - public static final String VAR_FACTION = "faction_recruiter.faction"; - public static final String VAR_DECLARED = "faction_recruiter.declared"; - public static final String VAR_FACTION_HIRELING = "faction_recruiter.faction_hireling"; - public static final String VAR_PLAYER = "faction_recruiter.player"; - public static final String VAR_NEWLY_DECLARED = "faction_recruiter.newly_declared"; - - public static final string_id SID_RESIGN_COMPLETE = new string_id("faction_recruiter", "resign_complete"); - public static final string_id SID_COVERT_COMPLETE = new string_id("faction_recruiter", "covert_complete"); - public static final string_id SID_INVALID_AMOUNT_ENTERED = new string_id("faction_recruiter", "invalid_amount_entered"); - public static final string_id SID_NOT_ENOUGH_STANDING_SPEND = new string_id("faction_recruiter", "not_enough_standing_spend"); - public static final string_id SID_AMOUNT_TOO_SMALL = new string_id("faction_recruiter", "amount_to_spend_too_small"); - public static final string_id SID_EXPERIENCE_GRANTED = new string_id("faction_recruiter", "training_experience_granted"); - public static final string_id SID_ITEM_PURCHASED = new string_id("faction_recruiter", "item_purchase_complete"); - public static final string_id SID_ACQUIRE_HIRELING = new string_id("faction_recruiter", "hireling_purchase_complete"); - public static final string_id SID_TOO_MANY_HIRELINGS = new string_id("faction_recruiter", "too_many_hirelings"); - public static final string_id SID_HIRELING_RELEASED = new string_id("faction_recruiter", "hireling_released"); - public static final string_id SID_INVENTORY_FULL = new string_id("faction_recruiter", "inventory_full"); - public static final string_id SID_DATAPAD_FULL = new string_id("faction_recruiter", "datapad_full"); - public static final string_id SID_ORDER_PURCHASED = new string_id("faction_recruiter", "order_purchase_complete"); - public static final string_id SID_SCHEMATIC_PURCHASED = new string_id("faction_recruiter", "schematic_purchase_complete"); - public static final string_id SID_SCHEMATIC_DUPLICATE = new string_id("faction_recruiter", "schematic_duplicate"); - public static final string_id SID_MUST_BE_DECLARED = new string_id("faction_recruiter", "must_be_declared"); - public static final string_id SID_MUST_BE_FACTION_MEMBER = new string_id("faction_recruiter", "must_be_faction_member"); - public static final string_id SID_MUST_BE_DECLARED_USE = new string_id("faction_recruiter", "must_be_declared_use"); - public static final string_id SID_MUST_BE_FACTION_MEMBER_USE = new string_id("faction_recruiter", "must_be_faction_member_use"); - public static final string_id SID_MUST_BE_NOTONLEAVE = new string_id("faction_recruiter", "must_be_not_onleave"); - public static final string_id SID_ACHIEVED_RANK = new string_id("faction_recruiter", "achieved_rank"); - public static final string_id SID_DEMOTED_RANK = new string_id("faction_recruiter", "demoted_rank"); - public static final string_id SID_SUI_DELEGATE_FACTION = new string_id("faction_recruiter", "sui_delegate_faction"); - public static final string_id SID_SUI_DELEGATE_FACTION_TEXT = new string_id("faction_recruiter", "sui_delegate_faction_text"); - public static final string_id SID_SUI_DELEGATE_FACTION_TITLE = new string_id("faction_recruiter", "sui_delegate_faction_title"); - public static final string_id SID_SUI_DELEGATE_FACTION_CAT = new string_id("faction_recruiter", "sui_faction_delegate_cat"); - public static final string_id SID_SUI_FACTION_RESIG_TITLE = new string_id("faction_recruiter", "sui_faction_resig_title"); - public static final string_id SID_SUI_FACTION_RESIG_TEXT = new string_id("faction_recruiter", "sui_faction_resig_text"); - - public static final string_id SID_INVALID_TRAINING_TYPE = new string_id("faction_recruiter", "invalid_training_type"); - public static final string_id SID_NO_RANK_NAME = new string_id("faction_recruiter", "no_rank_name"); - - public static final string_id SID_INSPIRE_BONUS = new string_id("performance", "perform_inspire_faction_bonus"); - - public static final string_id SID_FACTION_ADJUSTED_LOWER = new string_id("error_message", "faction_adjusted_lower"); - public static final string_id SID_FACTION_INVALID_LOOKAT = new string_id("error_message", "faction_invalid_lookat"); - public static final string_id SID_FACTION_CANT_GIVE_YOURSELF = new string_id("error_message", "faction_cant_give_yourself"); - public static final string_id SID_FACTION_ONLY_OTHER_PLAYERS = new string_id("error_message", "faction_only_other_players"); - public static final string_id SID_FACTION_NONE_TO_GIVE = new string_id("error_message", "faction_none_to_give"); - public static final string_id SID_FACTION_LACK_POINTS_TO_GIVE = new string_id("error_message", "faction_lack_points_to_give"); - public static final string_id SID_FACTION_TARGET_AT_CAP = new string_id("error_message", "faction_target_at_cap"); - public static final string_id SID_FACTION_ONLY_DELEGATE_N_POINTS = new string_id("error_message", "faction_only_delegate_n_points"); - public static final string_id SID_FACTION_DELEGATE_X_TO_TARGET = new string_id("error_message", "faction_delegate_x_to_target"); - public static final string_id SID_FACTION_DELEGATE_SYNTAX = new string_id("error_message", "faction_delegate_syntax"); - - public static final String SCRIPTVAR_FACTIONAL_HELPER_SUI_ID = "factionalHelperSuiId"; - public static final String SCRIPTVAR_FACTIONAL_HELPER_SUI_CHOICES = "factionalHelperSuiChoices"; - - public static final String MERC_END_COVERT_IMPERIAL = "covert_imperial_mercenary_end"; - public static final String MERC_END_OVERT_IMPERIAL = "overt_imperial_mercenary_end"; - public static final String MERC_END_COVERT_REBEL = "covert_rebel_mercenary_end"; - public static final String MERC_END_OVERT_REBEL = "overt_rebel_mercenary_end"; - public static final String MERC_BEGIN_COVERT_IMPERIAL = "covert_imperial_mercenary_begin"; - public static final String MERC_BEGIN_OVERT_IMPERIAL = "overt_imperial_mercenary_begin"; - public static final String MERC_BEGIN_COVERT_REBEL = "covert_rebel_mercenary_begin"; - public static final String MERC_BEGIN_OVERT_REBEL = "overt_rebel_mercenary_begin"; - - public static final string_id SID_MERC_IMPERIAL_SF_BEGIN = new string_id("gcw", "merc_imperial_special_forces_begin"); - public static final string_id SID_MERC_IMPERIAL_SF_END = new string_id("gcw", "merc_imperial_special_forces_end"); - public static final string_id SID_MERC_IMPERIAL_COMBATANT_BEGIN = new string_id("gcw", "merc_imperial_combatant_begin"); - public static final string_id SID_MERC_IMPERIAL_COMBATANT_END = new string_id("gcw", "merc_imperial_combatant_end"); - public static final string_id SID_MERC_REBEL_SF_BEGIN = new string_id("gcw", "merc_rebel_special_forces_begin"); - public static final string_id SID_MERC_REBEL_SF_END = new string_id("gcw", "merc_rebel_special_forces_end"); - public static final string_id SID_MERC_REBEL_COMBATANT_BEGIN = new string_id("gcw", "merc_rebel_combatant_begin"); - public static final string_id SID_MERC_REBEL_COMBATANT_END = new string_id("gcw", "merc_rebel_combatant_end"); - - public static final string_id SID_MERC_IMPERIAL_SF_GRANTED = new string_id("gcw", "merc_imperial_sf_status_granted"); - public static final string_id SID_MERC_IMPERIAL_SF_TERMINATED = new string_id("gcw", "merc_imperial_sf_status_terminated"); - public static final string_id SID_MERC_IMPERIAL_COMBATANT_GRANTED = new string_id("gcw", "merc_imperial_combatant_status_granted"); - public static final string_id SID_MERC_IMPERIAL_COMBATANT_TERMINATED = new string_id("gcw", "merc_imperial_combatant_status_terminated"); - public static final string_id SID_MERC_REBEL_SF_GRANTED = new string_id("gcw", "merc_rebel_sf_status_granted"); - public static final string_id SID_MERC_REBEL_SF_TERMINATED = new string_id("gcw", "merc_rebel_sf_status_terminated"); - public static final string_id SID_MERC_REBEL_COMBATANT_GRANTED = new string_id("gcw", "merc_rebel_combatant_status_granted"); - public static final string_id SID_MERC_REBEL_COMBATANT_TERMINATED = new string_id("gcw", "merc_rebel_combatant_status_terminated"); - - - public static void goCovertWithDelay(obj_id objPlayer, float fltDelay) throws InterruptedException - { - - if (!canGoCovert(objPlayer)) - { - return; - } - setObjVar(objPlayer, "intChangingFactionStatus", 1); - pvpPrepareToBeCovert(objPlayer); - messageTo(objPlayer, "msgGoCovert", null, fltDelay, true); - return; - } - - public static void goCovert(obj_id objPlayer) throws InterruptedException - { - if (!hasObjVar(objPlayer, "intChangingFactionStatus")) - { - return; - } - removeObjVar(objPlayer, "intChangingFactionStatus"); - - if (!canGoCovert(objPlayer)) - { - return; - } - string_id strSpam = new string_id("faction_recruiter", "covert_complete"); - sendSystemMessage(objPlayer, strSpam); - - buff.removeAllAuraBuffs(objPlayer); - - pvpMakeCovert(objPlayer); - CustomerServiceLog( "player_faction", "PLAYER-FACTION ALTERED|TIME:"+getGameTime()+"|PLAYER:"+objPlayer+"|PLAYER NAME:"+getName(objPlayer)+"|ZONE:"+getCurrentSceneName()+"|Player has been set to covert"); - return; - } - - public static void goOvertWithDelay(obj_id objPlayer, float fltDelay) throws InterruptedException - { - setObjVar(objPlayer, "intChangingFactionStatus", 1); - pvpPrepareToBeDeclared(objPlayer); - messageTo(objPlayer, "msgGoOvert", null, fltDelay, true); - return; - } - - - public static void goOvert(obj_id objPlayer) throws InterruptedException - { - if (!hasObjVar(objPlayer, "intChangingFactionStatus")) - { - return; - } - - removeObjVar(objPlayer, "intChangingFactionStatus"); - string_id strSpam = new string_id("faction_recruiter", "overt_complete"); - sendSystemMessage(objPlayer, strSpam); - - buff.removeAllAuraBuffs(objPlayer); - pvpMakeDeclared(objPlayer); - CustomerServiceLog( "player_faction", "PLAYER-FACTION ALTERED|TIME:"+getGameTime()+"|PLAYER:"+objPlayer+"|PLAYER NAME:"+getName(objPlayer)+"|ZONE:"+getCurrentSceneName()+"|Player has been set to overt"); - return; - } - - public static void goOnLeaveWithDelay(obj_id objPlayer, float fltDelay) throws InterruptedException - { - - if (!canGoOnLeave(objPlayer)) - { - return; - - } - setObjVar(objPlayer, "intChangingFactionStatus", 1); - pvpPrepareToBeNeutral(objPlayer); - messageTo(objPlayer, "msgGoOnLeave", null, fltDelay, true); - return; - } - - - public static void goOnLeave(obj_id objPlayer) throws InterruptedException - { - - if (!hasObjVar(objPlayer, "intChangingFactionStatus")) - { - return; - } - removeObjVar(objPlayer, "intChangingFactionStatus"); - if (!canGoOnLeave(objPlayer)) - { - return; - } - - string_id strSpam = new string_id("faction_recruiter", "on_leave_complete"); - sendSystemMessage(objPlayer, strSpam); - - buff.removeAllAuraBuffs(objPlayer); - - pvpMakeOnLeave(objPlayer); - CustomerServiceLog( "player_faction", "PLAYER-FACTION ALTERED|TIME:"+getGameTime()+"|PLAYER:"+objPlayer+"|PLAYER NAME:"+getName(objPlayer)+"|ZONE:"+getCurrentSceneName()+"|Player has been set to On Leave"); - } - - public static void unequipFactionEquipment(obj_id self, boolean checkForDeclaredObjVar) throws InterruptedException - { - obj_id[] items = getContents(self); - if (items == null) - { - LOG("LOG_CHANNEL", "player_recruiter::msgGoCovert -- "+ self + "'s contents are null."); - return; - } - - obj_id inv = getObjectInSlot(self, "inventory"); - for (int i = 0; i < items.length; i++) - { - testAbortScript(); - if (hasScript(items[i], factions.SCRIPT_FACTION_ITEM)) - { - if (!checkForDeclaredObjVar || hasObjVar(items[i], factions.VAR_DECLARED)) - { - - String strTemplate = getTemplateName(items[i]); - if (!strTemplate.endsWith("marine/armor_marine_backpack.iff")) - { - putInOverloaded(items[i], inv); - } - } - } - } - - obj_id appearanceInv = getAppearanceInventory(self); - if (!isIdValid(appearanceInv)) - { - LOG("LOG_CHANNEL", "Player "+ self + " has no valid appearance inventory. Skipping unequip faction appearance items..."); - return; - } - obj_id[] appInvItems = getContents(appearanceInv); - if (appInvItems == null) - { - LOG("LOG_CHANNEL", "Player "+ self + " has an appearance inventory, but the contents were null. Skipping appearance inventory faction unequip..."); - return; - } - for (int i = 0; i < appInvItems.length; i++) - { - testAbortScript(); - if (hasScript(appInvItems[i], factions.SCRIPT_FACTION_ITEM)) - { - if (!checkForDeclaredObjVar || hasObjVar(appInvItems[i], factions.VAR_DECLARED)) - { - putInOverloaded(appInvItems[i], inv); - } - } - } - return; - } - - - public static boolean isDeclared(obj_id target) throws InterruptedException - { - if (pvpGetType( target ) == PVPTYPE_DECLARED) - { - int myFactionHash = pvpGetAlignedFaction( target ); - if (myFactionHash == (221551254) || myFactionHash == (221551254)) - { - return false; - } - else - { - return true; - } - } - return false; - } - - - public static boolean isCovert(obj_id target) throws InterruptedException - { - int pvpType = pvpGetType( target ); - if (pvpType == PVPTYPE_COVERT || pvpType == PVPTYPE_DECLARED) - { - return true; - } - - return false; - } - - - public static String getFaction(obj_id target) throws InterruptedException - { - if (isPlayer(target)) - { - if (pvpGetType(target)==PVPTYPE_NEUTRAL) - { - return null; - } - return getFactionNameByHashCode( pvpGetAlignedFaction( target ) ); - } - else - { - return getStringObjVar( target, FACTION ); - } - } - - - public static int getFactionFlag(obj_id target) throws InterruptedException - { - if (isRebel(target)) - { - return FACTION_FLAG_REBEL; - } - else if (isImperial(target)) - { - return FACTION_FLAG_IMPERIAL; - } - else - { - return FACTION_FLAG_NEUTRAL; - } - } - - - public static boolean isRebelHelper(obj_id target) throws InterruptedException - { - if (!isIdValid(target) || !exists(target)) - { - return false; - } - - int currentMercenaryFaction = pvpNeutralGetMercenaryFaction(target); - - if (0 == currentMercenaryFaction) - { - return false; - } - - if ((370444368) == currentMercenaryFaction) - { - return true; - } - - return false; - } - - - public static boolean isImperialHelper(obj_id target) throws InterruptedException - { - if (!isIdValid(target) || !exists(target)) - { - return false; - } - - int currentMercenaryFaction = pvpNeutralGetMercenaryFaction(target); - - if (0 == currentMercenaryFaction) - { - return false; - } - - if ((-615855020) == currentMercenaryFaction) - { - return true; - } - - return false; - } - - - public static boolean isRebelorRebelHelper(obj_id target) throws InterruptedException - { - if (!isIdValid(target) || !exists(target)) - { - return false; - } - - if (isRebelHelper(target) || getFactionFlag(target) == FACTION_FLAG_REBEL) - { - return true; - } - - return false; - } - - - public static boolean isImperialorImperialHelper(obj_id target) throws InterruptedException - { - if (!isIdValid(target) || !exists(target)) - { - return false; - } - - if (isImperialHelper(target) || getFactionFlag(target) == FACTION_FLAG_IMPERIAL) - { - return true; - } - - return false; - } - - - public static boolean isSameFactionorFactionHelper(obj_id target, obj_id target2) throws InterruptedException - { - if (!isIdValid(target) || !exists(target) || !isIdValid(target2) || !exists(target2)) - { - return false; - } - - if ((isImperialorImperialHelper(target) && isImperialorImperialHelper(target2)) || isRebelorRebelHelper(target) && isRebelorRebelHelper(target2)) - { - return true; - } - - return false; - } - - - public static float getFactionStanding(obj_id target, int intFaction) throws InterruptedException - { - return getFactionStanding(target, getFactionNameByHashCode(intFaction)); - } - - public static float getFactionStanding(obj_id target, String factionName) throws InterruptedException - { - if (!exists(target)) - { - return 0.0f; - } - - if (!isPlayer( target )) - { - if (getFaction( target) == factionName) - { - return FACTION_RATING_MAX; - } - else - { - return 0.0f; - } - } - - if (!hasObjVar( target, FACTION + "." + factionName )) - { - return 0.0f; - } - else - { - return getFloatObjVar( target, FACTION + "." + factionName ); - } - - } - - - public static float getFactionMax(obj_id target, int intFactionId) throws InterruptedException - { - return getFactionMax(target, getFactionNameByHashCode(intFactionId)); - } - - - public static float getFactionMax(obj_id target, String factionName) throws InterruptedException - { - return FACTION_RATING_MAX; - } - - - public static void validateFactionStanding(obj_id player, String factionName) throws InterruptedException - { - float currentStanding = getFactionStanding(player, factionName); - float maxStanding = getFactionMax(player, factionName); - if (currentStanding > maxStanding) - { - setFactionStanding(player, factionName, maxStanding); - prose_package ppFactionLower = prose.getPackage(SID_FACTION_ADJUSTED_LOWER); - prose.setTO(ppFactionLower, new string_id("faction/faction_names", factionName)); - prose.setDI(ppFactionLower, (int)maxStanding); - sendSystemMessageProse(player, ppFactionLower); - } - } - - - public static String getRankName(int rank, String faction) throws InterruptedException - { - return utils.packStringId(getRankNameStringId(rank, faction)); - } - - - public static string_id getRankNameStringId(int rank, String faction) throws InterruptedException - { - String rankName = constructRankName(rank, faction); - if (rankName != null && rankName.length() > 0) - { - return new string_id("gcw_rank",rankName); - } - - CustomerServiceLog("faction", "WARNING: factions.getRankNameStringId() called with rank "+ rank + - " that has no rank name associated with it"); - return SID_NO_RANK_NAME; - } - - - public static String constructRankName(int rank, String faction) throws InterruptedException - { - return toLower(faction)+"_rank"+rank; - } - - - public static int getRankCost(int rank) throws InterruptedException - { - return dataTableGetInt(TBL_RANK, rank, COL_COST); - } - - - public static int getAvailableFactionPoints(obj_id target, String factionName) throws InterruptedException - { - if (isIdValid(target) && isPlayer(target) && factionName != null && !factionName.equals("")) - { - int standing = (int)getFactionStanding(target, factionName); - if (standing > 0) - { - int available = standing - (int)FACTION_RATING_DECLARABLE_MIN; - if (available > 0) - { - return available; - } - } - } - - return 0; - } - - - public static int getAvailableFactionPoints(obj_id target, int faction) throws InterruptedException - { - if (isIdValid(target) && isPlayer(target)) - { - String factionName = getFactionNameByHashCode(faction); - return getAvailableFactionPoints(target, factionName); - } - - return 0; - } - - - public static void delegateFactionPoints(obj_id self, obj_id target, String params) throws InterruptedException - { - if (!isIdValid(target)) - { - sendSystemMessage(self, SID_FACTION_INVALID_LOOKAT); - return; - } - - if (target == self) - { - sendSystemMessage(self, SID_FACTION_CANT_GIVE_YOURSELF); - return; - } - - if (!isPlayer(target)) - { - sendSystemMessage(self, SID_FACTION_ONLY_OTHER_PLAYERS); - return; - } - - if (!isDeclared(self)) - { - sendSystemMessage(self, new string_id("base_player", "must_be_declared")); - return; - } - - int fac = pvpGetAlignedFaction(self); - String sFac = getFaction(self); - - int available = getAvailableFactionPoints(self, fac); - if (available <= 0) - { - sendSystemMessage(self, SID_FACTION_NONE_TO_GIVE); - return; - } - - if (utils.hasScriptVar(self, "delegate.pid")) - { - int oldpid = utils.getIntScriptVar(self, "delegate.pid"); - sui.closeSUI(self, oldpid); - utils.removeScriptVarTree(self, "delegate"); - } - - int rank = pvpGetCurrentGcwRank(self); - String faction = getFaction(self); - - int ratioFrom = dataTableGetInt(TBL_RANK, rank, "DELEGATE_RATIO_FROM"); - int ratioTo = dataTableGetInt(TBL_RANK, rank, "DELEGATE_RATIO_TO"); - if (ratioFrom <= 0 || ratioTo <= 0) - { - return; - } - - float multiplier = (float)ratioTo/(float)ratioFrom; - - if (params == null || params.equals("")) - { - - String title = utils.packStringId(SID_SUI_DELEGATE_FACTION); - prose_package ppSuiTitle = prose.getPackage(SID_SUI_DELEGATE_FACTION_TEXT); - prose.setTT(ppSuiTitle, getRankNameStringId(rank, faction)); - prose.setTO(ppSuiTitle, ""+ ratioFrom + ":"+ ratioTo); - prose.setDI(ppSuiTitle, available); - String prompt = " \0"+ packOutOfBandProsePackage(null, ppSuiTitle); - - int pid = sui.transfer(self, self, prompt, title, utils.packStringId(SID_SUI_DELEGATE_FACTION_TITLE), Math.round(available), utils.packStringId(SID_SUI_DELEGATE_FACTION_CAT), 0, "handleDelegateSui", ratioFrom, ratioTo); - if (pid > -1) - { - utils.setScriptVar(self, "delegate.pid", pid); - utils.setScriptVar(self, "delegate.target", target); - } - - return; - } - else - { - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - String sAmt = st.nextToken(); - int amt = utils.stringToInt(sAmt); - if (amt > 0) - { - int required = (int)Math.ceil(amt/multiplier); - if (required > available) - { - prose_package ppLackPointsToGive = prose.getPackage(SID_FACTION_LACK_POINTS_TO_GIVE); - prose.setTT(ppLackPointsToGive, target); - prose.setTO(ppLackPointsToGive, ""+ amt); - prose.setDI(ppLackPointsToGive, required); - sendSystemMessageProse(self, ppLackPointsToGive); - } - else - { - int targetMax = (int)getFactionMax(target, sFac); - int targetCur = (int)getFactionStanding(target, sFac); - int targetDelta = targetMax - targetCur; - if (targetDelta == 0) - { - prose_package ppAtCap = prose.getPackage(SID_FACTION_TARGET_AT_CAP); - prose.setTT(ppAtCap, target); - sendSystemMessageProse(self, ppAtCap); - return; - } - - if (amt > targetDelta) - { - prose_package ppOnlyDelegate = prose.getPackage(SID_FACTION_ONLY_DELEGATE_N_POINTS); - prose.setTT(ppOnlyDelegate, target); - prose.setDI(ppOnlyDelegate, targetDelta); - sendSystemMessageProse(self, ppOnlyDelegate); - return; - } - - if (addUnmodifiedFactionStanding(self, sFac, -required)) - { - addUnmodifiedFactionStanding(target, sFac, amt); - prose_package ppDelegate = prose.getPackage(SID_FACTION_DELEGATE_X_TO_TARGET); - prose.setTT(ppDelegate, target); - prose.setDI(ppDelegate, amt); - prose.setTO(ppDelegate, ""+ required); - sendSystemMessageProse(self, ppDelegate); - CustomerServiceLog("faction_perk", getFirstName(self) + "("+ self + ") delegated "+ amt + " points to "+ getFirstName(target) + " for a cost of "+ required + " points."); - } - } - - return; - } - } - - sendSystemMessage(self, SID_FACTION_DELEGATE_SYNTAX); - } - - - public static void resignFromFaction(obj_id player, int intFaction) throws InterruptedException - { - resignFromFaction(player, getFactionNameByHashCode(intFaction)); - } - - public static void resignFromFaction(obj_id player, String resign_faction) throws InterruptedException - { - if (isInAdhocPvpArea(player)) - { - return; - } - - if (isOnLeave(player)) - { - string_id strSpam = new string_id("faction_recruiter", "resign_on_leave"); - sendSystemMessage(player, strSpam); - removeObjVar(player, "intChangingFactionStatus"); - return; - } - - if (!hasObjVar(player, "intChangingFactionStatus")) - { - return; - } - - removeObjVar(player, "intChangingFactionStatus"); - if (!isIdValid(player) || !isPlayer(player) || resign_faction == null || resign_faction.equals("")) - { - return; - } - - buff.removeAllAuraBuffs(player); - - if (space_flags.isRebelPilot(player)) - { - space_skill.retire(player, space_skill.REBEL); - } - else if (space_flags.isImperialPilot(player)) - { - space_skill.retire(player, space_skill.IMPERIAL); - } - - CustomerServiceLog("player_faction", "|PLAYER:"+player+" |PLAYER NAME:"+getName(player)+" |PLAYER LEFT FACTION: "+resign_faction+" |OLD RANK WAS: "+pvpGetCurrentGcwRank(player)); - - pvpMakeNeutral(player); - pvpSetAlignedFaction(player, 0); - - String factionNormalized = toLower(resign_faction); - if (factionNormalized.equals("imperial") || factionNormalized.equals("rebel")) - { - setObjVar(player, "lastFactionResignedFrom", resign_faction); - setObjVar(player, "lastFactionResignedTime", getGameTime()); - } - - float factionStanding = getFactionStanding(player, resign_faction); - - if (factionStanding > -2500) - { - setFactionStanding(player, resign_faction, -2500); - } - - unequipFactionEquipment(player, false); - - releaseFactionHirelings(player); - - prose_package pp = prose.getPackage(SID_RESIGN_COMPLETE, resign_faction); - sendSystemMessageProse(player, pp); - } - - - public static void resignFromFaction(obj_id player) throws InterruptedException - { - resignFromFaction(player, getFaction(player)); - } - - - public static boolean addFactionStanding(obj_id target, int intFaction, float value) throws InterruptedException - { - return addFactionStanding(target, getFactionNameByHashCode(intFaction), value); - - } - - public static boolean addFactionStanding(obj_id target, String factionName, float value) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - return addUnmodifiedFactionStanding(target, factionName, value) && grantFactionBonus(target, factionName, value); - } - - - public static boolean addUnmodifiedFactionStanding(obj_id target, String factionName, float value, boolean verbose) throws InterruptedException - { - if (!isIdValid(target) || factionName == null || factionName.equals("") || value == 0.0f) - { - return false; - } - - if (!isPlayer( target )) - { - setFaction( target, factionName ); - return false; - } - - int factionNum = getFactionNumber(factionName); - if (factionNum == AD_HOC_FACTION) - { - return false; - } - - int playerAllowed = dataTableGetInt(FACTION_TABLE, factionNum, "playerAllowed"); - if (playerAllowed != 1) - { - return false; - } - - if (utils.hasScriptVar(target, "buff.general_inspiration.value")) - { - float factionBonus = utils.getFloatScriptVar(target, "buff.general_inspiration.value"); - factionBonus /= 100.0f; - factionBonus += 1.0f; - - value *= factionBonus; - } - - float oldRating = getFactionStanding( target, factionName ); - float newRating = oldRating + value; - - float factionMax = getFactionMax( target, factionName ); - if (newRating < FACTION_RATING_MIN) - { - newRating = FACTION_RATING_MIN; - } - else if (newRating >= factionMax) - { - newRating = factionMax; - } - - float actual_value = value; - if (oldRating + value > newRating) - { - actual_value = newRating-oldRating; - } - - if (newRating == oldRating) - { - return false; - } - - if (newRating != 0.0f) - { - setObjVar(target, FACTION + "."+ factionName, newRating ); - if (verbose) - { - if ((int)value > 0) - { - prose_package pp = prose.getPackage(PROSE_AWARD_FACTION, getLocalizedFactionName( factionName ), (int)actual_value); - sendSystemMessageProse(target, pp); - } - else - { - actual_value = actual_value * -1; - prose_package pp = prose.getPackage( PROSE_LOSE_FACTION, getLocalizedFactionName( factionName ), (int)actual_value ); - sendSystemMessageProse( target, pp ); - } - } - } - else - { - removeObjVar(target, FACTION + "."+ factionName ); - } - - if (verbose && oldRating != newRating) - { - if (newRating == factionMax) - { - prose_package pp = prose.getPackage(PROSE_MAX_FACTION, getLocalizedFactionName( factionName )); - sendSystemMessageProse(target, pp); - } - else if (newRating == FACTION_RATING_MIN) - { - prose_package pp = prose.getPackage(PROSE_MIN_FACTION, getLocalizedFactionName( factionName )); - sendSystemMessageProse(target, pp); - } - } - - return true; - } - - - public static boolean addUnmodifiedFactionStanding(obj_id target, String factionName, float value) throws InterruptedException - { - return addUnmodifiedFactionStanding(target, factionName, value, true); - } - - - public static boolean grantFactionBonus(obj_id target, String factionName, float value) throws InterruptedException - { - if (!isIdValid(target) || factionName == null || factionName.equals("") || value == 0.0f) - { - return false; - } - - return true; - } - - - public static float getFactionStoryReward(obj_id target, String factionName, float value) throws InterruptedException - { - float bonus = 0; - int myFac = pvpGetAlignedFaction(target); - - if (value > 0 && myFac == (370444368) && getFactionNameByHashCode(myFac).equals(factionName)) - { - if (pvpGetType( target ) != PVPTYPE_NEUTRAL) - { - bonus = (value * 0.10f); - } - } - - return bonus; - } - - - public static void setFactionStanding(obj_id target, String factionName, float value) throws InterruptedException - { - if (factionName == null || factionName.equals("")) - { - return; - } - - if (!isPlayer( target )) - { - setFaction( target, factionName ); - return; - } - - int factionNum = getFactionNumber(factionName); - if (factionNum == AD_HOC_FACTION || factionNum < 0) - { - return; - } - - int playerAllowed = dataTableGetInt(FACTION_TABLE, factionNum, "playerAllowed"); - if (playerAllowed != 1) - { - return; - } - - float factionMax = getFactionMax( target, factionName ); - if (value < FACTION_RATING_MIN) - { - value = FACTION_RATING_MIN; - } - else if (value >= factionMax) - { - value = factionMax; - } - - if (value != 0.0f) - { - if ((utils.getPlayerProfession(target) == utils.SMUGGLER) && (factionName.equals("underworld"))) - { - smuggler.checkSmugglerTitleGrants(target, value); - smuggler.checkRewardQuestGrants(target, value); - - messageTo(target, "applySmugglingBonuses", null, 1.0f, false); - } - - if ((utils.getPlayerProfession(target) == utils.BOUNTY_HUNTER) && (factionName.equals("underworld"))) - { - smuggler.checkBountyTitleGrants(target, value); - } - - setObjVar(target, FACTION + "."+ factionName, value ); - } - else - { - removeObjVar(target, FACTION + "."+ factionName ); - messageTo(target, "removeSmugglingBonuses", null, 1.0f, false); - } - - armor.recalculateArmorForPlayer(target); - obj_id tempWeapon = getObjectInSlot(target, "hold_r"); - - if (isIdValid(tempWeapon)) - { - weapons.adjustWeaponRangeForExpertise(target, tempWeapon, true); - } - - } - - - public static void setFaction(obj_id target, String factionName) throws InterruptedException - { - if (factionName == null || factionName.equals("")) - { - return; - } - - setFaction( target, factionName, true ); - } - - - public static void setFaction(obj_id target, String factionName, int pvpOnly) throws InterruptedException - { - setFaction(target, factionName, true, pvpOnly); - } - - - public static void setFaction(obj_id target, String factionName, boolean isAggro) throws InterruptedException - { - setFaction(target, factionName, isAggro, 0); - } - - - public static void setFaction(obj_id target, String factionName, boolean isAggro, int pvpOnly) throws InterruptedException - { - if (factionName == null || factionName.equals("")) - { - return; - } - - if (isPlayer( target )) - { - return; - } - - boolean pvp_only = pvpOnly == 1 ? true : false; - - if (factionName.equals( FACTION_IMPERIAL )) - { - setAttributeAttained( target, attrib.IMPERIAL ); - setAttributeInterested( target, attrib.REBEL ); - ai_lib.setDefaultCalmMood( target, "npc_imperial"); - if (pvp_only) - { - setObjVar(target, "huysMagicSpecialForcesOnlyObjvar", true); - } - } - else if (factionName.equals( FACTION_REBEL )) - { - setAttributeAttained( target, attrib.REBEL ); - setAttributeInterested( target, attrib.IMPERIAL ); - if (pvp_only) - { - setObjVar(target, "huysMagicSpecialForcesOnlyObjvar", true); - } - } - - setObjVar(target, FACTION, factionName); - pvpMakeNeutral(target); - removeObjVar( target, "ai.faction.nonAggro"); - - int factionNum = getFactionNumber(factionName); - if (factionNum == AD_HOC_FACTION) - { - if (!isAggro) - { - LOG("gcw", "1"); - pvpSetAlignedFaction(target, (221551254)); - pvpMakeDeclared(target); - setObjVar( target, "ai.faction.nonAggro", true ); - } - LOG("gcw", "2"); - return; - } - LOG("gcw", "10"); - - int factionHashCode = dataTableGetInt(FACTION_TABLE, factionNum, "pvpFaction"); - if (factionHashCode == 0) - { - return; - } - LOG("gcw", "setting aligned faction to "+factionHashCode); - LOG("gcw", "making "+target+" covert"); - pvpSetAlignedFaction(target, factionHashCode); - pvpMakeDeclared(target); - } - - - public static boolean isNeutral(obj_id target) throws InterruptedException - { - - int intPlayerFaction = pvpGetAlignedFaction(target); - if (intPlayerFaction == 0) - { - return true; - } - if (pvpGetType(target)==PVPTYPE_NEUTRAL) - { - return true; - } - return false; - } - - - public static String getFactionNameByHashCode(int hashCode) throws InterruptedException - { - - if (hashCode == 0) - { - return null; - } - - int[] columns = dataTableGetIntColumn(FACTION_TABLE, "pvpFaction"); - for (int i = 0; i < columns.length; i++) - { - testAbortScript(); - if (hashCode == columns[i]) - { - return dataTableGetString(FACTION_TABLE, i, "factionName"); - } - } - return null; - } - - - public static int getFactionNumber(String factionName) throws InterruptedException - { - if (factionName == null) - { - return AD_HOC_FACTION; - } - return dataTableSearchColumnForString(factionName, "factionName", FACTION_TABLE); - } - - - public static int getFactionStatus(obj_id ai, obj_id target) throws InterruptedException - { - int result = STATUS_NEUTRAL; - final int factionReaction = getFactionReaction(ai, target); - - if (factionReaction < REACTION_NEUTRAL) - { - result = STATUS_ENEMY; - } - else if (factionReaction > REACTION_NEUTRAL) - { - result = STATUS_FRIEND; - } - - return result; - } - - - public static int getFactionReaction(obj_id npc, obj_id target) throws InterruptedException - { - PROFILER_START("library.faction.getFactionReaction"); - - int result = REACTION_NEUTRAL; - - String npcFaction = getFaction(npc); - if (npcFaction != null) - { - - if (isPlayer(target)) - { - if (!isNeutral(npc) && (!isNeutral(target))) - { - - String yourFaction = getDeclaredFaction( target ); - String myFaction = getDeclaredFaction( npc ); - if (yourFaction == null) - { - LOG("DESIGNER_FATAL", "In faction.getFactionReaction, getDeclaredFaction returned null for yourFaction. obj_id, "+target ); - PROFILER_STOP("library.faction.getFactionReaction"); - return REACTION_NEUTRAL; - } - - if (myFaction == null) - { - LOG("DESIGNER_FATAL", "In faction.getFactionReaction, getDeclaredFaction returned null for myFaction. obj_id, "+npc ); - PROFILER_STOP("library.faction.getFactionReaction"); - return REACTION_NEUTRAL; - } - - if (yourFaction.equals( myFaction )) - { - PROFILER_STOP("library.faction.getFactionReaction"); - return REACTION_POSITIVE; - } - else - { - PROFILER_STOP("library.faction.getFactionReaction"); - return REACTION_NEGATIVE; - } - } - - int npcFactionNum = getFactionNumber(npcFaction); - if (npcFactionNum != AD_HOC_FACTION) - { - boolean playerAllowed = (dataTableGetInt(FACTION_TABLE, npcFactionNum, "playerAllowed") == 1); - if (playerAllowed) - { - float playerFaction = getFactionStanding(target, npcFaction); - if (playerFaction > (FACTION_RATING_MAX * .75f)) - { - result = REACTION_POSITIVE; - } - else if (playerFaction > (FACTION_RATING_MAX * .5f)) - { - result = REACTION_LIKE; - } - else if (playerFaction < (FACTION_RATING_MIN * .75f)) - { - result = REACTION_NEGATIVE; - } - else if (playerFaction < (FACTION_RATING_MIN * .5f)) - { - result = REACTION_DISLIKE; - } - } - } - } - else - { - String targetFaction = getFaction( target ); - if (targetFaction != null) - { - - int npcFactionNum = getFactionNumber(npcFaction); - if (npcFactionNum == AD_HOC_FACTION) - { - if (npcFaction.equals(targetFaction) && !hasObjVar(npc, "ai.faction.nonAggro")) - { - result = REACTION_POSITIVE; - } - } - else - { - int targetFactionNum = getFactionNumber(targetFaction); - if (targetFactionNum == AD_HOC_FACTION) - { - result = REACTION_NEUTRAL; - } - else - { - String enemies = dataTableGetString( FACTION_TABLE, npcFaction, "enemies"); - if (enemies == null) - { - result = REACTION_NEUTRAL; - } - else - { - String[] enemiesList = split( enemies, ','); - if (utils.getElementPositionInArray(enemiesList, targetFaction )!=-1) - { - result = REACTION_NEGATIVE; - } - else - { - result = REACTION_NEUTRAL; - } - } - } - } - } - } - } - - PROFILER_STOP("library.faction.getFactionReaction"); - return result; - } - - - public static String getDeclaredFaction(obj_id target) throws InterruptedException - { - if (!isDeclared( target)) - { - return null; - } - - if (!isPlayer(target)) - { - return getStringObjVar( target, FACTION ); - } - - int factionHashCode = pvpGetAlignedFaction(target); - return getFactionNameByHashCode( factionHashCode ); - } - - - public static boolean isAggro(obj_id npc) throws InterruptedException - { - String factionName = getFaction( npc ); - if (factionName == null) - { - return false; - } - - int factionNum = getFactionNumber( factionName ); - if (factionNum == AD_HOC_FACTION) - { - return (!hasObjVar( npc, "ai.faction.nonAggro" )); - } - - return (dataTableGetInt(FACTION_TABLE, factionNum, "isAggro") == 1); - } - - - public static void clearFaction(obj_id npc) throws InterruptedException - { - if (isPlayer(npc)) - { - return; - } - - removeObjVar( npc, FACTION ); - pvpMakeNeutral(npc); - } - - - public static boolean awardFactionStanding(obj_id player, String factionName, int value) throws InterruptedException - { - if ((player == null) || (!isPlayer(player))) - { - return false; - } - - if (value > 0) - { - if (luck.isLucky(player, 0.01f)) - { - float bonus = value * 0.2f; - if (bonus < 1) - { - bonus = 1; - } - - value += bonus; - } - } - - if (addFactionStanding(player, factionName, value)) - { - return true; - } - - return false; - } - - - public static void grantCombatFaction(obj_id killer, obj_id target, double percentDamage) throws InterruptedException - { - - if (!isIdValid(target) || !isIdValid(killer) || percentDamage < 0.f || percentDamage > 1.f) - { - return; - } - - if (target == killer) - { - return; - } - - if (!isPlayer( killer )) - { - return; - } - - String killerFaction = getFaction( killer ); - String targetFaction = getFaction( target ); - - if ((killerFaction == null) || (targetFaction == null)) - { - return; - } - - float killerStanding = getFactionStanding( killer, killerFaction ); - float targetStanding = getFactionStanding( target, targetFaction ); - - if (isPlayer( killer) && pvpGetType( killer ) == PVPTYPE_NEUTRAL) - { - return; - } - - if (isPlayer( target ) && pvpGetType( target ) == PVPTYPE_NEUTRAL) - { - return; - } - - if (!pvpAreFactionsOpposed(pvpGetAlignedFaction(killer), pvpGetAlignedFaction(target))) - { - return; - } - - int killerDiff = getLevel( killer ); - int targetDiff = getLevel( target ); - - gcw.incrementGCWStanding(killer, target); - - if (isPlayer( target )) - { - - if (targetStanding <= 0) - { - return; - } - - int kRank = pvpGetCurrentGcwRank(killer); - int tRank = pvpGetCurrentGcwRank(target); - - float diffFactor = 1f + (tRank - kRank)/(2*MAXIMUM_RANK); - - int actualReward = (int) (MAX_FACTION_KILL_REWARD * percentDamage * diffFactor); - int factionLoss = (int) (-1.5f * actualReward); - - if (hasSkill( target, "class_smuggler_phase2_novice" )) - { - actualReward /= 2; - factionLoss /= 2; - } - - if (pvpGetType(killer)==PVPTYPE_DECLARED) - { - actualReward = actualReward * 2; - } - awardFactionStanding( killer, killerFaction, actualReward ); - addFactionStanding( killer, targetFaction, factionLoss ); - - addFactionStanding( target, targetFaction, factionLoss ); - - } - else - { - - if (targetDiff > 25) - { - targetDiff = 25; - } - - if (killerDiff > 25) - { - killerDiff = 25; - } - - int diffDelta = (targetDiff - killerDiff) + 25; - float diffFactor = diffDelta / 50.f; - - int actualReward = (int) (MAX_FACTION_KILL_REWARD * percentDamage * diffFactor); - int factionLoss = (int) (-1.5f * actualReward); - - awardFactionStanding( killer, killerFaction, actualReward ); - addFactionStanding( killer, targetFaction, factionLoss ); - - } - - } - - - public static void adjustSocialStanding(obj_id target, String faction, int amount) throws InterruptedException - { - if (!isPlayer( target )) - { - return; - } - - if (faction == null || faction.equals("")) - { - return; - } - - if (!isIdValid(target)) - { - return; - } - - if (amount == 0) - { - return; - } - - if (faction.equals(FACTION_IMPERIAL) || faction.equals(FACTION_REBEL)) - { - return; - } - - int factionNum = getFactionNumber(faction); - float combatFactor = 1.0f; - if (factionNum != AD_HOC_FACTION) - { - combatFactor = dataTableGetFloat(FACTION_TABLE, factionNum, "combatFactor"); - } - amount *= combatFactor; - - addFactionStanding( target, faction, amount ); - - String allies = dataTableGetString( FACTION_TABLE, faction, "allies"); - if (allies != null) - { - String[] alliesList = split( allies, ','); - for (int i = 0; i < alliesList.length; i++) - { - testAbortScript(); - - if (!alliesList[i].equals(FACTION_IMPERIAL) && !alliesList[i].equals(FACTION_REBEL)) - { - addFactionStanding( target, alliesList[i], amount ); - } - } - } - - amount = amount/2; - if (amount >= -1 && amount <= 1) - { - return; - } - - String enemies = dataTableGetString( FACTION_TABLE, faction, "enemies"); - if (enemies == null) - { - return; - } - String[] enemiesList = split( enemies, ','); - for (int i = 0; i < enemiesList.length; i++) - { - testAbortScript(); - - if (!enemiesList[i].equals(FACTION_IMPERIAL) && !enemiesList[i].equals(FACTION_REBEL)) - { - addFactionStanding( target, enemiesList[i], -amount ); - } - } - } - - - public static string_id getLocalizedFactionName(String factionName) throws InterruptedException - { - return ( new string_id( "faction/faction_names", toLower(factionName) ) ); - } - - - public static boolean setTemporaryEnemyFlag(obj_id player, obj_id target) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(target)) - { - return false; - } - - String sTargetFaction = getFactionNameByHashCode(pvpGetAlignedFaction(target)); - if ((sTargetFaction == null) || (sTargetFaction.equals(""))) - { - return false; - } - - if (!pvpIsEnemy(target, player)) - { - if (pvpCanAttack(target, player)) - { - pvpAttackPerformed(player, target); - - string_id sidFaction = getLocalizedFactionName(sTargetFaction); - prose_package ppTEF = prose.getPackage(PROSE_TEF, sidFaction); - sendSystemMessageProse(player, ppTEF); - } - } - - return true; - } - - - public static boolean areFactionsOpposed(String faction1, String faction2) throws InterruptedException - { - int facNum1 = getFactionNumber(faction1); - int facNum2 = getFactionNumber(faction2); - if (facNum1 == AD_HOC_FACTION || facNum2 == AD_HOC_FACTION) - { - return false; - } - - int hc1 = dataTableGetInt(FACTION_TABLE, facNum1, "pvpFaction"); - int hc2 = dataTableGetInt(FACTION_TABLE, facNum2, "pvpFaction"); - if (hc1 == 0 || hc2 == 0) - { - return false; - } - - return pvpAreFactionsOpposed(hc1, hc2); - } - - - public static obj_id getFactionParentObject() throws InterruptedException - { - obj_id objParent = getPlanetByName("tatooine"); - return objParent; - } - - - public static void changeFactionPoints(String strFaction, int intPoints) throws InterruptedException - { - obj_id objParent = getFactionParentObject(); - int intOldPoints = getIntObjVar(objParent, "gcw."+strFaction); - intPoints = intPoints + intOldPoints; - setObjVar(objParent, "gcw."+strFaction, intPoints); - } - - - public static int getFactionPointStanding(String strFaction) throws InterruptedException - { - obj_id objParent = getFactionParentObject(); - int intPoints = getIntObjVar(objParent, strFaction); - return intPoints; - } - - - public static void shiftPointsTo(String strFaction, int intPoints) throws InterruptedException - { - String strRebel = FACTION_REBEL; - String strImperial = FACTION_IMPERIAL; - if (strFaction.equals(strRebel)) - { - changeFactionPoints(factions.FACTION_REBEL, intPoints); - changeFactionPoints(factions.FACTION_IMPERIAL, intPoints*-1); - - } - if (strFaction.equals(strImperial)) - { - changeFactionPoints(factions.FACTION_REBEL, intPoints); - changeFactionPoints(factions.FACTION_IMPERIAL, intPoints*-1); - } - return; - - } - - - public static boolean isFactionWinning(String strFaction) throws InterruptedException - { - obj_id objParent = getFactionParentObject(); - - String strRebel = FACTION_REBEL; - String strImperial = FACTION_IMPERIAL; - int intRebel = getIntObjVar(objParent, "gcw."+strRebel); - int intImperial = getIntObjVar(objParent, "gcw."+strImperial); - if (strFaction.equals(strRebel)) - { - if (intRebel > intImperial) - { - return true; - - } - return false; - - } - if (strFaction.equals(strImperial)) - { - if (intImperial > intRebel) - { - return true; - - } - return false; - - } - return false; - - } - - - public static boolean setRank(obj_id player, int rank) throws InterruptedException - { - return false; - } - - - public static boolean releaseFactionHirelings(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - obj_id hireling = callable.getCallable(player, callable.CALLABLE_TYPE_COMBAT_OTHER); - - if (hasObjVar(hireling, VAR_FACTION_HIRELING)) - { - pet_lib.releasePet(hireling); - - prose_package pp = prose.getPackage(SID_HIRELING_RELEASED, player, hireling); - sendSystemMessageProse(player, pp); - - return true; - } - else - { - return false; - } - } - - - public static boolean isNewlyDeclared(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (utils.hasScriptVar(player, VAR_NEWLY_DECLARED)) - { - return true; - } - else - { - return false; - } - } - - - public static boolean canUseFactionItem(obj_id player, obj_id item) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(item)) - { - CustomerServiceLog("Faction", "WARNING: factions.canUseFactionItem called with invalid player (%TU) or item ("+ item + ")", player); - return false; - } - - String faction; - if (hasObjVar(item, VAR_FACTION)) - { - faction = getStringObjVar(item, VAR_FACTION); - } - else - { - CustomerServiceLog("Faction", "WARNING: factions::canUseFactionItem -- "+ item + " is a faction item with no faction objvar."); - return false; - } - - int player_faction_id = pvpGetAlignedFaction(player); - if (player_faction_id == 0 || pvpGetType(player) == PVPTYPE_NEUTRAL) - { - prose_package pp = prose.getPackage(SID_MUST_BE_FACTION_MEMBER, faction); - sendSystemMessageProse(player, pp); - return false; - } - - String player_faction = factions.getFactionNameByHashCode(player_faction_id); - if (player_faction == null) - { - return false; - } - if (!player_faction.equals(faction)) - { - prose_package pp = prose.getPackage(SID_MUST_BE_FACTION_MEMBER, faction); - sendSystemMessageProse(player, pp); - return false; - } - return true; - } - - - public static void awardKashyyykFaction(obj_id player, int ammount) throws InterruptedException - { - if (!isPlayer(player)) - { - return; - } - - if (ammount == 0) - { - return; - } - - validateBalance(player, KASHYYYK); - - float hsskorAmmount = getFactionStanding(player, HSSKOR); - float kashyyykAmmount = getFactionStanding(player, KASHYYYK); - - if (kashyyykAmmount < 0) - { - return; - } - - float gain = kashyyykAmmount + (float)ammount; - float lose = hsskorAmmount - (float)ammount; - - setObjVar(player, FACTION + "."+ KASHYYYK, gain ); - setObjVar(player, FACTION + "."+ HSSKOR, lose); - - prose_package pp = prose.getPackage(PROSE_AWARD_FACTION, getLocalizedFactionName( KASHYYYK ), (int)ammount); - sendSystemMessageProse(player, pp); - - ammount *= -1; - pp = prose.getPackage( PROSE_LOSE_FACTION, getLocalizedFactionName( HSSKOR ), (int)ammount ); - sendSystemMessageProse(player, pp ); - - return; - } - - - public static void awardHsskorFaction(obj_id player, int ammount) throws InterruptedException - { - if (!isPlayer(player)) - { - return; - } - - if (ammount == 0) - { - return; - } - - validateBalance(player, HSSKOR); - - float hsskorAmmount = getFactionStanding(player, HSSKOR); - float kashyyykAmmount = getFactionStanding(player, KASHYYYK); - - if (hsskorAmmount < 0) - { - return; - } - - float gain = hsskorAmmount + (float)ammount; - float lose = kashyyykAmmount - (float)ammount; - - setObjVar(player, FACTION + "."+ HSSKOR, gain ); - setObjVar(player, FACTION + "."+ KASHYYYK, lose); - - prose_package pp = prose.getPackage(PROSE_AWARD_FACTION, getLocalizedFactionName( HSSKOR ), (int)ammount); - sendSystemMessageProse(player, pp); - - ammount *= -1; - pp = prose.getPackage( PROSE_LOSE_FACTION, getLocalizedFactionName( KASHYYYK ), (int)ammount ); - sendSystemMessageProse(player, pp ); - - return; - } - - - public static void validateBalance(obj_id player, String faction) throws InterruptedException - { - String checkHsskor = FACTION + "."+ HSSKOR; - String checkKashyyyk = FACTION + "."+ KASHYYYK; - float hsskorBalance = 0f; - float kashyyykBalance = 0f; - - if (hasObjVar(player, checkHsskor)) - { - if (!hasObjVar(player, checkKashyyyk)) - { - setObjVar(player, checkKashyyyk, -1*getFactionStanding(player, HSSKOR)); - } - } - - if (hasObjVar(player, checkKashyyyk)) - { - if (!hasObjVar(player, checkHsskor)) - { - setObjVar(player, checkHsskor, -1*getFactionStanding(player, KASHYYYK)); - } - } - - hsskorBalance = getFloatObjVar(player, checkHsskor); - kashyyykBalance = getFloatObjVar(player, checkKashyyyk); - - if (hsskorBalance != -1*kashyyykBalance) - { - if (faction.equals(HSSKOR)) - { - setObjVar(player, checkKashyyyk, -1*getFactionStanding(player, HSSKOR)); - } - else - { - setObjVar(player, checkHsskor, -1*getFactionStanding(player, KASHYYYK)); - } - } - - return; - } - - - public static boolean isUnaligned(obj_id player) throws InterruptedException - { - String hsskor = FACTION + "."+ HSSKOR; - String kashyyyk = FACTION + "."+ KASHYYYK; - - validateBalance(player, HSSKOR); - - if (!hasObjVar(player, hsskor ) && !hasObjVar(player, kashyyyk)) - { - return true; - } - - if (getFloatObjVar(player, hsskor) != 0) - { - return false; - } - - return true; - } - - - public static boolean isAlignedKashyyyk(obj_id player) throws InterruptedException - { - if (isUnaligned(player)) - { - return false; - } - - return (getFactionStanding(player, KASHYYYK) > 0); - } - - - public static boolean isAlignedHsskor(obj_id player) throws InterruptedException - { - if (isUnaligned(player)) - { - return false; - } - - return (getFactionStanding(player, HSSKOR) > 0); - } - - - public static boolean isImperial(obj_id objPlayer) throws InterruptedException - { - int intPlayerFaction = pvpGetAlignedFaction(objPlayer); - if (intPlayerFaction==(-615855020)) - { - return true; - } - return false; - - } - - public static boolean isRebel(obj_id objPlayer) throws InterruptedException - { - int intPlayerFaction = pvpGetAlignedFaction(objPlayer); - if (intPlayerFaction==(370444368)) - { - return true; - } - return false; - } - - public static boolean isOnLeave(obj_id objPlayer) throws InterruptedException - { - int intFaction = pvpGetAlignedFaction(objPlayer); - if ((intFaction != 0) && pvpGetType(objPlayer) == PVPTYPE_NEUTRAL) - { - return true; - } - return false; - } - - public static boolean isActiveImperial(obj_id objPlayer) throws InterruptedException - { - return (isImperial(objPlayer) && !isOnLeave(objPlayer)); - } - - public static boolean isActiveRebel(obj_id objPlayer) throws InterruptedException - { - return (isRebel(objPlayer) && !isOnLeave(objPlayer)); - } - - - public static boolean isGatedByJoinTimer(obj_id player, String factionJoining) throws InterruptedException - { - factionJoining = toLower(factionJoining); - - if (!factionJoining.equals("imperial") && !factionJoining.equals("rebel")) - { - return false; - } - - if (hasObjVar(player, "lastFactionResignedFrom") && hasObjVar(player, "lastFactionResignedTime")) - { - - String lastFactionResignedFrom = getStringObjVar(player, "lastFactionResignedFrom"); - - if (!toLower(lastFactionResignedFrom).equals(factionJoining)) - { - - int now = getGameTime(); - int lastFactionResignedTime = getIntObjVar(player, "lastFactionResignedTime"); - int interval = now - lastFactionResignedTime; - - int minIntervalToJoin = 60 * 60 * 24 * 5; - - if (interval < minIntervalToJoin) - { - return true; - } - } - } - - return false; - - } - - - public static boolean canJoinFaction(obj_id player, int faction_id) throws InterruptedException - { - if (!isIdValid(player)) - { - LOG("LOG_CHANNEL", "faction_recruiter::canJoinFaction -- player is null"); - return false; - } - if (faction_id == 0) - { - LOG("LOG_CHANNEL", "faction_recruiter::canJoinFaction -- faction is 0"); - return false; - } - String faction = factions.getFactionNameByHashCode(faction_id); - if (faction == null) - { - LOG("LOG_CHANNEL", "faction_recruiter::canJoinFaction -- can not find "+ faction_id + " in the faction datatable"); - return false; - } - - if (isGatedByJoinTimer(player, faction)) - { - return false; - } - - int player_faction_id = pvpGetAlignedFaction(player); - if (player_faction_id != 0) - { - - if (player_faction_id == faction_id && pvpGetType(player) == PVPTYPE_NEUTRAL) - { - player_faction_id = 0; - } - else - { - return false; - } - } - - return true; - } - - public static boolean isFactionMember(obj_id player, obj_id npc) throws InterruptedException - { - if (!isIdValid(player)) - { - LOG("LOG_CHANNEL", "faction_recruiter::isFactionMember -- player is null"); - return false; - } - if (npc == null || npc == obj_id.NULL_ID) - { - LOG("LOG_CHANNEL", "faction_recruiter::isFactionMember -- npc is null"); - return false; - } - - int player_faction_id = pvpGetAlignedFaction(player); - int npc_faction_id = pvpGetAlignedFaction(npc); - if (player_faction_id == 0) - { - return false; - } - - if (player_faction_id == npc_faction_id) - { - return true; - } - else - { - return false; - } - } - - - public static boolean joinFaction(obj_id player, int faction_id, boolean returnFromReserves) throws InterruptedException - { - if (!isIdValid(player)) - { - LOG("LOG_CHANNEL", "faction_recruiter::joinFaction -- player is null"); - return false; - } - - if (faction_id == 0) - { - LOG("LOG_CHANNEL", "faction_recruiter::joinFaction -- faction is 0"); - return false; - } - int intFaction = pvpGetAlignedFaction(player); - if (intFaction != 0) - { - - return false; - } - CustomerServiceLog("factions", player+" named "+getName(player)+" joined "+getFactionNameByHashCode(faction_id)); - if (!canJoinFaction(player, faction_id)) - { - return false; - } - - buff.removeAllAuraBuffs(player); - - pvpSetAlignedFaction(player, faction_id); - pvpMakeCovert(player); - LOG("LOG_CHANNEL", "faction_recruiter::joinFaction -- "+ player + " has joined faction "+ faction_id); - return true; - } - - - public static boolean joinFaction(obj_id player, int faction_id) throws InterruptedException - { - return joinFaction(player, faction_id, false); - } - - - public static boolean isOnLeaveFromFriendlyFaction(obj_id objPlayer, obj_id objNPC) throws InterruptedException - { - if (pvpGetAlignedFaction(objPlayer)== pvpGetAlignedFaction(objNPC)&&(pvpGetType(objPlayer)==PVPTYPE_NEUTRAL)) - { - return true; - } - return false; - } - - public static boolean isInEnemyFaction(obj_id objPlayer, obj_id objNPC) throws InterruptedException - { - int intFaction = pvpGetAlignedFaction(objPlayer); - if ((intFaction != 0)&&(intFaction!= pvpGetAlignedFaction(objNPC))) - { - return true; - } - return false; - } - - public static boolean isInFriendlyFaction(obj_id objPlayer, obj_id objNPC) throws InterruptedException - { - if (pvpGetAlignedFaction(objPlayer)== pvpGetAlignedFaction(objNPC)) - { - return true; - } - return false; - } - - public static boolean isOnLeaveFromEnemyFaction(obj_id objPlayer, obj_id objNPC) throws InterruptedException - { - int intFaction = pvpGetAlignedFaction(objPlayer); - if ((intFaction != 0)&&(intFaction!= pvpGetAlignedFaction(objNPC)&&(pvpGetType(objPlayer)==PVPTYPE_NEUTRAL))) - { - return true; - } - return false; - } - - - public static boolean qualifiesForPromotion(obj_id objPlayer, int intFaction) throws InterruptedException - { - - int intPlayerFaction = pvpGetAlignedFaction(objPlayer); - if (intPlayerFaction != intFaction) - { - return false; - } - - int current_rank = pvpGetCurrentGcwRank(objPlayer); - if (current_rank >= factions.MAXIMUM_RANK) - { - return false; - } - int cost = factions.getRankCost(current_rank + 1); - int faction_standing = (int)factions.getFactionStanding(objPlayer, intFaction); - if (faction_standing >= cost) - { - return true; - } - return false; - } - - - public static void applyPromotion(obj_id objPlayer, int intFaction) throws InterruptedException - { - if (qualifiesForPromotion(objPlayer, intFaction)) - { - int current_rank = pvpGetCurrentGcwRank(objPlayer); - int cost = factions.getRankCost(current_rank + 1); - int faction_standing = (int)factions.getFactionStanding(objPlayer, intFaction); - if (factions.addFactionStanding(objPlayer, intFaction, -cost)) - { - CustomerServiceLog( "player_faction", "PLAYER-FACTION ALTERED|TIME:"+getGameTime()+"|PLAYER:"+objPlayer+"|PLAYER NAME:"+getName(objPlayer)+"|ZONE:"+getCurrentSceneName()+"|Player has purchased rank for "+cost); - factions.setRank(objPlayer, current_rank + 1); - } - - } - return; - } - - - public static boolean isSmuggler(obj_id player) throws InterruptedException - { - if (hasSkill( player, "class_smuggler_phase3_novice" )) - { - return true; - } - else if (hasSkill( player, "class_smuggler_phase4_novice" )) - { - return true; - } - - return false; - } - - - public static boolean canBuyFaction(obj_id objPlayer, obj_id objNPC) throws InterruptedException - { - int intNPCFaction = pvpGetAlignedFaction(objNPC); - - String rec_faction = getFactionNameByHashCode(intNPCFaction); - int intPlayerFaction = pvpGetAlignedFaction(objPlayer); - - String oppfaction = ""; - if (rec_faction.equals("Imperial")) - { - oppfaction = "Rebel"; - } - else - { - oppfaction = "Imperial"; - } - float oppstanding = factions.getFactionStanding( objPlayer, oppfaction ); - float ourstanding = factions.getFactionStanding( objPlayer, intPlayerFaction); - - float fltFactionMax = factions.getFactionMax(objPlayer, intNPCFaction); - if (oppstanding > 200) - { - return false; - } - else if (ourstanding >= fltFactionMax) - { - return false; - } - return true; - } - - - public static void buyFaction(obj_id objPlayer, obj_id objNPC, int intAmount) throws InterruptedException - { - - dictionary outp = new dictionary(); - money.requestPayment( objPlayer, objNPC, intAmount, "payBribe", outp, true ); - return; - } - - - public static boolean leaveFaction(obj_id player, int faction_id) throws InterruptedException - { - if (!isIdValid(player)) - { - LOG("LOG_CHANNEL", "faction_recruiter::joinFaction -- player is null"); - return false; - } - - if (faction_id == 0) - { - LOG("LOG_CHANNEL", "faction_recruiter::joinFaction -- faction is 0"); - return false; - } - - String title = utils.packStringId(SID_SUI_FACTION_RESIG_TITLE); - String prompt = utils.packStringId(SID_SUI_FACTION_RESIG_TEXT); - int pid = sui.inputbox(player, player, prompt, title, "handleLeaveFactionSui", ""); - return (pid > -1); - } - - - public static boolean isPVPStatusChanging(obj_id objPlayer) throws InterruptedException - { - if (hasObjVar(objPlayer, "intChangingFactionStatus")) - { - return true; - } - return false; - - } - - - public static boolean pvpDoAllowedAttackCheck(obj_id objPlayer, obj_id objTarget) throws InterruptedException - { - if (!isPlayer(objPlayer)) - { - LOG("combat", "return 1"); - return pvpCanAttack(objPlayer, objTarget); - } - if (!pvpCanAttack(objPlayer, objTarget)) - { - if (hasObjVar(objPlayer, "intChangingFactionStatus")) - { - LOG("combat", "return 2"); - return false; - } - - int intMyFaction = pvpGetAlignedFaction(objPlayer); - int intYourFaction = pvpGetAlignedFaction(objTarget); - if (intMyFaction == intYourFaction) - { - LOG("combat", "return 3"); - return false; - } - else - { - int intMyPVPType = pvpGetType(objPlayer); - int intYourPVPType = pvpGetType(objTarget); - if (!isPlayer(objTarget)&&(!pet_lib.isPet(objTarget))) - { - - if (intMyPVPType == PVPTYPE_NEUTRAL) - { - - if (intYourPVPType == PVPTYPE_NEUTRAL) - { - return false; - } - if (intYourPVPType == PVPTYPE_COVERT) - { - LOG("combat", "return 5"); - doTransitionSui(objPlayer, objTarget, 30f); - return false; - - } - if (intYourPVPType == PVPTYPE_DECLARED) - { - LOG("combat", "return 6"); - - return false; - - } - } - else if (intMyPVPType == PVPTYPE_COVERT) - { - if (intYourPVPType == PVPTYPE_NEUTRAL) - { - LOG("combat", "return 7"); - return false; - } - if (intYourPVPType == PVPTYPE_COVERT) - { - LOG("combat", "return 8"); - return true; - } - if (intYourPVPType == PVPTYPE_DECLARED) - { - LOG("combat", "return 9"); - - return false; - } - } - else if (intMyPVPType == PVPTYPE_DECLARED) - { - if (intYourPVPType == PVPTYPE_NEUTRAL) - { - LOG("combat", "return 10"); - return false; - } - if (intYourPVPType == PVPTYPE_COVERT) - { - LOG("combat", "return 11"); - return true; - } - if (intYourPVPType == PVPTYPE_DECLARED) - { - LOG("combat", "return 12"); - return true; - } - } - - } - LOG("combat", "return 13"); - return false; - - } - } - else - { - LOG("combat", "return 14"); - return true; - } - - } - - - public static void doTransitionSui(obj_id objPlayer, obj_id objTarget, float fltDelay) throws InterruptedException - { - - if (hasObjVar(objPlayer, "intChangingFactionStatus")) - { - return; - } - int intFaction = pvpGetAlignedFaction(objPlayer); - if (intFaction == 0) - { - return; - } - - int intMyPVPType = pvpGetType(objPlayer); - int intYourPVPType = pvpGetType(objTarget); - string_id strTitleId = new string_id("gcw", "gcw_status_change"); - String strTitle = utils.packStringId(strTitleId); - - if (intMyPVPType == PVPTYPE_NEUTRAL) - { - if (intYourPVPType == PVPTYPE_COVERT) - { - - string_id strSpam = new string_id("gcw", "gcw_status_change_covert"); - String strPrompt = utils.packStringId(strSpam); - int pid = sui.inputbox(objPlayer, objPlayer, strPrompt, strTitle, "handleGoCovert", ""); - return; - } - else if (intYourPVPType == PVPTYPE_DECLARED) - { - string_id strSpam = new string_id("gcw", "gcw_status_change_overt"); - String strPrompt = utils.packStringId(strSpam); - int pid = sui.inputbox(objPlayer, objPlayer, strPrompt, strTitle, "handleGoOvert", ""); - return; - - } - else - { - sendSystemMessageTestingOnly(objPlayer, "Error # 4 : You got a PVP error message. Your PVP Type is "+intMyPVPType+". Your faction is"+pvpGetAlignedFaction(objPlayer)+". Your target is "+objTarget+" their pvp type is "+pvpGetType(objTarget)+" and their faction is "+pvpGetAlignedFaction(objTarget)); - } - - } - else if (intMyPVPType == PVPTYPE_COVERT) - { - if (intYourPVPType == PVPTYPE_COVERT) - { - sendSystemMessageTestingOnly(objPlayer, "Error # 1 : You got a PVP error message. Your PVP Type is "+intMyPVPType+". Your faction is"+pvpGetAlignedFaction(objPlayer)+". Your target is "+objTarget+" their pvp type is "+pvpGetType(objTarget)+" and their faction is "+pvpGetAlignedFaction(objTarget)); - } - else if (intYourPVPType == PVPTYPE_DECLARED) - { - - string_id strSpam = new string_id("gcw", "gcw_status_change_overt"); - String strPrompt = utils.packStringId(strSpam); - int pid = sui.inputbox(objPlayer, objPlayer, strPrompt, strTitle, "handleGoOvert", ""); - return; - } - else - { - sendSystemMessageTestingOnly(objPlayer, "Error # 3 : You got a PVP error message. Your PVP Type is "+intMyPVPType+". Your faction is"+pvpGetAlignedFaction(objPlayer)+". Your target is "+objTarget+" their pvp type is "+pvpGetType(objTarget)+" and their faction is "+pvpGetAlignedFaction(objTarget)); - } - - } - else - { - - sendSystemMessageTestingOnly(objPlayer, "Error # 2 : You got a PVP error message. Your PVP Type is "+intMyPVPType+". Your faction is"+pvpGetAlignedFaction(objPlayer)+". Your target is "+objTarget+" their pvp type is "+pvpGetType(objTarget)+" and their faction is "+pvpGetAlignedFaction(objTarget)); - } - - } - - - public static boolean pvpDoAllowedHelpCheck(obj_id objPlayer, obj_id objTarget) throws InterruptedException - { - - if (!isPlayer(objPlayer)) - { - LOG("combat", "return 1"); - return pvpCanHelp(objPlayer, objTarget); - } - - if (!pvpCanHelp(objPlayer, objTarget)) - { - if (hasObjVar(objPlayer, "intChangingFactionStatus")) - { - LOG("combat", "return 2"); - return false; - } - - int intMyFaction = pvpGetAlignedFaction(objPlayer); - int intYourFaction = pvpGetAlignedFaction(objTarget); - if (intMyFaction != intYourFaction) - { - LOG("combat", "return 3"); - return false; - } - else - { - int intMyPVPType = pvpGetType(objPlayer); - int intYourPVPType = pvpGetType(objTarget); - - if (intMyPVPType == PVPTYPE_NEUTRAL) - { - if (intYourPVPType == PVPTYPE_COVERT) - { - LOG("combat", "return 5"); - doTransitionSui(objPlayer, objTarget, 30f); - return false; - - } - } - - } - return false; - } - else - { - LOG("combat", "return 14"); - return true; - } - - } - - - public static boolean canGoOnLeave(obj_id objPlayer) throws InterruptedException - { - - if (isInAdhocPvpArea(objPlayer)) - { - return false; - } - - return true; - } - - - public static boolean canGoCovert(obj_id objPlayer) throws InterruptedException - { - if (isInAdhocPvpArea(objPlayer)) - { - return false; - } - - return true; - } - - - public static prose_package getFactionProsePackage(String factionName, int actualValue) throws InterruptedException - { - prose_package pp = null; - - if (actualValue > 0) - { - pp = prose.getPackage(PROSE_AWARD_FACTION, getLocalizedFactionName(factionName), actualValue); - } - else - { - pp = prose.getPackage(PROSE_LOSE_FACTION, getLocalizedFactionName(factionName), -actualValue); - } - - return pp; - } - - public static final String IGNORE_PLAYER = "ignorePlayer"; - - public static boolean ignorePlayer(obj_id attacker, obj_id target) throws InterruptedException - { - if (isPlayer(attacker) || (isMob(attacker) && isIdValid(getMaster(attacker)) && isPlayer(getMaster(attacker)))) - { - if (utils.hasScriptVar(target, IGNORE_PLAYER)) - { - return true; - } - } - else - { - if (isPlayer(target) || (isMob(target) && isIdValid(getMaster(target)) && isPlayer(getMaster(target)))) - { - if (utils.hasScriptVar(attacker, IGNORE_PLAYER)) - { - return true; - } - } - } - - if (utils.hasScriptVar(target, IGNORE_PLAYER)) - { - if (isPlayer(attacker) || (isIdValid(getMaster(attacker)) && isPlayer(getMaster(attacker)))) - { - return true; - } - } - - return false; - } - - - public static void setIgnorePlayer(obj_id npc) throws InterruptedException - { - utils.setScriptVar(npc, IGNORE_PLAYER, true); - } - - - public static boolean isInAdhocPvpArea(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (utils.hasScriptVar(player, IN_ADHOC_PVP_AREA)) - { - return utils.getBooleanScriptVar(player, IN_ADHOC_PVP_AREA); - } - - return false; - } - - - public static void removeAllPvpSkills(obj_id player) throws InterruptedException - { - skill.revokeSkill (player, "pvp_imperial_retaliation_ability"); - skill.revokeSkill (player, "pvp_imperial_adrenaline_ability"); - skill.revokeSkill (player, "pvp_imperial_unstoppable_ability"); - skill.revokeSkill (player, "pvp_imperial_last_man_ability"); - skill.revokeSkill (player, "pvp_imperial_aura_buff_self"); - skill.revokeSkill (player, "pvp_imperial_airstrike_ability"); - skill.revokeSkill (player, "pvp_rebel_retaliation_ability"); - skill.revokeSkill (player, "pvp_rebel_adrenaline_ability"); - skill.revokeSkill (player, "pvp_rebel_unstoppable_ability"); - skill.revokeSkill (player, "pvp_rebel_last_man_ability"); - skill.revokeSkill (player, "pvp_rebel_aura_buff_self"); - skill.revokeSkill (player, "pvp_rebel_airstrike_ability"); - return; - } - - - public static boolean shareSocialGroup(obj_id creatureOne, obj_id creatureTwo) throws InterruptedException - { - String socialOne = getStringObjVar(creatureOne, "socialGroup"); - String socialTwo = getStringObjVar(creatureTwo, "socialGroup"); - - if (socialOne.equals(socialTwo)) - { - return true; - } - - return false; - } - - - public static boolean areCreaturesAllied(obj_id creatureOne, obj_id creatureTwo) throws InterruptedException - { - String factionOne = getStringObjVar(creatureOne, "faction"); - String factionTwo = getStringObjVar(creatureTwo, "faction"); - - if (factionOne == null || factionOne.equals("") || factionTwo == null || factionTwo.equals("")) - { - return false; - } - - if (factionOne.equals(factionTwo)) - { - return true; - } - - int row = dataTableSearchColumnForString(factionOne, "factionName", "datatables/faction/faction.iff"); - - if (row == -1) - { - return false; - } - - String allies = dataTableGetString("datatables/faction/faction.iff", row, "allies"); - - if (allies == null || allies.equals("")) - { - return false; - } - - String[] alliesParse = split(allies, ','); - - for (int i=0; i 0) && !configSetting.toLowerCase().equals("false") && !configSetting.equals("0")) - { - choicesDisplay.addElement("I want to help the Imperials as a Combatant."); - choicesInternal.addElement("covert_imperial_mercenary_begin"); - } - - choicesDisplay.addElement("I want to stop being a Special Forces Imperial helper."); - choicesInternal.addElement("overt_imperial_mercenary_end"); - } - else - { - choicesDisplay.addElement("I want to stop being a Combatant Imperial helper."); - choicesInternal.addElement("covert_imperial_mercenary_end"); - - String configSetting = getConfigSetting("GameServer", "enableOvertImperialMercenary"); - if ((configSetting != null) && (configSetting.length() > 0) && !configSetting.toLowerCase().equals("false") && !configSetting.equals("0")) - { - choicesDisplay.addElement("I want to help the Imperials as a Special Forces."); - choicesInternal.addElement("overt_imperial_mercenary_begin"); - } - } - - int pid = sui.listbox(player, player, "What would you like to do?", sui.OK_CANCEL, "Factional Helper", choicesDisplay, "handleFactionalHelperChoice", true, false); - utils.setScriptVar(player, SCRIPTVAR_FACTIONAL_HELPER_SUI_CHOICES, choicesInternal); - utils.setScriptVar(player, SCRIPTVAR_FACTIONAL_HELPER_SUI_ID, pid); - - return true; - } - else if ((370444368) == currentMercenaryFaction) - { - Vector choicesDisplay = new Vector(); - Vector choicesInternal = new Vector(); - if (isDeclared) - { - String configSetting = getConfigSetting("GameServer", "enableCovertRebelMercenary"); - if ((configSetting != null) && (configSetting.length() > 0) && !configSetting.toLowerCase().equals("false") && !configSetting.equals("0")) - { - choicesDisplay.addElement("I want to help the Rebels as a Combatant."); - choicesInternal.addElement("covert_rebel_mercenary_begin"); - } - - choicesDisplay.addElement("I want to stop being a Special Forces Rebel helper."); - choicesInternal.addElement("overt_rebel_mercenary_end"); - } - else - { - choicesDisplay.addElement("I want to stop being a Combatant Rebel helper."); - choicesInternal.addElement("covert_rebel_mercenary_end"); - - String configSetting = getConfigSetting("GameServer", "enableOvertRebelMercenary"); - if ((configSetting != null) && (configSetting.length() > 0) && !configSetting.toLowerCase().equals("false") && !configSetting.equals("0")) - { - choicesDisplay.addElement("I want to help the Rebels as a Special Forces."); - choicesInternal.addElement("overt_rebel_mercenary_begin"); - } - } - - int pid = sui.listbox(player, player, "What would you like to do?", sui.OK_CANCEL, "Factional Helper", choicesDisplay, "handleFactionalHelperChoice", true, false); - utils.setScriptVar(player, SCRIPTVAR_FACTIONAL_HELPER_SUI_CHOICES, choicesInternal); - utils.setScriptVar(player, SCRIPTVAR_FACTIONAL_HELPER_SUI_ID, pid); - - return true; - } - } - - final int timeNow = getCalendarTime(); - final int timeCooldown = (isGod(player) ? 10 : 1800); - int secondsUntilCanHelpRebel = 0; - int secondsUntilCanHelpImperial = 0; - - if (hasObjVar(player, "factionalHelper.timeStopHelpingRebel")) - { - int time = getIntObjVar(player, "factionalHelper.timeStopHelpingRebel"); - if ((time > 0) && ((time + timeCooldown) > timeNow)) - { - secondsUntilCanHelpImperial = time + timeCooldown - timeNow; - } - } - - else if (hasObjVar(player, "factionalHelper.timeStopHelpingImperial")) - { - int time = getIntObjVar(player, "factionalHelper.timeStopHelpingImperial"); - if ((time > 0) && ((time + timeCooldown) > timeNow)) - { - secondsUntilCanHelpRebel = time + timeCooldown - timeNow; - } - } - - Vector choicesDisplay = new Vector(); - Vector choicesInternal = new Vector(); - - if (secondsUntilCanHelpImperial <= 0) - { - String configSetting = getConfigSetting("GameServer", "enableCovertImperialMercenary"); - if ((configSetting != null) && (configSetting.length() > 0) && !configSetting.toLowerCase().equals("false") && !configSetting.equals("0")) - { - choicesDisplay.addElement("I want to help the Imperials as a Combatant."); - choicesInternal.addElement("covert_imperial_mercenary_begin"); - } - - configSetting = getConfigSetting("GameServer", "enableOvertImperialMercenary"); - if ((configSetting != null) && (configSetting.length() > 0) && !configSetting.toLowerCase().equals("false") && !configSetting.equals("0")) - { - choicesDisplay.addElement("I want to help the Imperials as a Special Forces."); - choicesInternal.addElement("overt_imperial_mercenary_begin"); - } - } - - if (secondsUntilCanHelpRebel <= 0) - { - String configSetting = getConfigSetting("GameServer", "enableCovertRebelMercenary"); - if ((configSetting != null) && (configSetting.length() > 0) && !configSetting.toLowerCase().equals("false") && !configSetting.equals("0")) - { - choicesDisplay.addElement("I want to help the Rebels as a Combatant."); - choicesInternal.addElement("covert_rebel_mercenary_begin"); - } - - configSetting = getConfigSetting("GameServer", "enableOvertRebelMercenary"); - if ((configSetting != null) && (configSetting.length() > 0) && !configSetting.toLowerCase().equals("false") && !configSetting.equals("0")) - { - choicesDisplay.addElement("I want to help the Rebels as a Special Forces."); - choicesInternal.addElement("overt_rebel_mercenary_begin"); - } - } - - if (choicesDisplay.size() <= 0) - { - sendSystemMessage(player, "The factional helper functionality is currently disabled.", ""); - return false; - } - - String prompt = "What would you like to do?"; - if (secondsUntilCanHelpImperial > 0) - { - prompt += "\n\n"; - prompt += "(You must wait "+ (secondsUntilCanHelpImperial / 60) + "m:"+ (secondsUntilCanHelpImperial % 60) + "s before you can become an Imperial factional helper.)"; - } - else if (secondsUntilCanHelpRebel > 0) - { - prompt += "\n\n"; - prompt += "(You must wait "+ (secondsUntilCanHelpRebel / 60) + "m:"+ (secondsUntilCanHelpRebel % 60) + "s before you can become a Rebel factional helper.)"; - } - - int pid = sui.listbox(player, player, prompt, sui.OK_CANCEL, "Factional Helper", choicesDisplay, "handleFactionalHelperChoice", true, false); - utils.setScriptVar(player, SCRIPTVAR_FACTIONAL_HELPER_SUI_CHOICES, choicesInternal); - utils.setScriptVar(player, SCRIPTVAR_FACTIONAL_HELPER_SUI_ID, pid); - return true; - } - - - public static boolean setNeturalMercenaryCovert(obj_id player, int factionFlag) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (factionFlag < FACTION_FLAG_REBEL || factionFlag > FACTION_FLAG_IMPERIAL) - { - return false; - } - - String covertType = ""; - - if (factionFlag == FACTION_FLAG_REBEL) - { - sendSystemMessage(player, SID_MERC_REBEL_COMBATANT_BEGIN); - covertType = MERC_BEGIN_COVERT_REBEL; - } - else if (factionFlag == FACTION_FLAG_IMPERIAL) - { - sendSystemMessage(player, SID_MERC_IMPERIAL_COMBATANT_BEGIN); - covertType = MERC_BEGIN_COVERT_IMPERIAL; - } - - if (covertType == null || covertType.length() <= 0) - { - return false; - } - - dictionary messageToParams = new dictionary(); - messageToParams.put("mercenary_type", covertType); - - if (isGod(player)) - { - sendSystemMessage(player, "Reducing wait to 5 seconds ***BECAUSE YOU ARE IN GOD MODE***.", ""); - messageTo(player, "executeFactionalHelperChoice", messageToParams, 5.0f, false); - } - else - { - messageTo(player, "executeFactionalHelperChoice", messageToParams, 60.0f, false); - } - - return true; - } - - - public static boolean setNeturalMercenaryOvert(obj_id player, int factionFlag) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (factionFlag < FACTION_FLAG_REBEL || factionFlag > FACTION_FLAG_IMPERIAL) - { - return false; - } - - String overtType = ""; - - if (factionFlag == FACTION_FLAG_REBEL) - { - sendSystemMessage(player, SID_MERC_REBEL_SF_BEGIN); - overtType = MERC_BEGIN_OVERT_REBEL; - } - else if (factionFlag == FACTION_FLAG_IMPERIAL) - { - sendSystemMessage(player, SID_MERC_IMPERIAL_SF_BEGIN); - overtType = MERC_BEGIN_OVERT_IMPERIAL; - } - - if (overtType == null || overtType.length() <= 0) - { - return false; - } - - dictionary messageToParams = new dictionary(); - messageToParams.put("mercenary_type", overtType); - - if (isGod(player)) - { - sendSystemMessage(player, "Reducing wait to 5 seconds ***BECAUSE YOU ARE IN GOD MODE***.", ""); - messageTo(player, "executeFactionalHelperChoice", messageToParams, 5.0f, false); - } - else - { - messageTo(player, "executeFactionalHelperChoice", messageToParams, 60.0f, false); - } - - return true; - } - - - public static boolean removeNeturalMercenary(obj_id player, int factionFlag) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (factionFlag < FACTION_FLAG_REBEL || factionFlag > FACTION_FLAG_IMPERIAL) - { - return false; - } - - boolean isDeclared = pvpNeutralIsMercenaryDeclared(player); - String type = ""; - - if (factionFlag == FACTION_FLAG_REBEL) - { - if (isDeclared) - { - sendSystemMessage(player, SID_MERC_REBEL_SF_END); - type = MERC_END_OVERT_REBEL; - } - else - { - sendSystemMessage(player, SID_MERC_REBEL_COMBATANT_END); - type = MERC_END_COVERT_REBEL; - } - } - else if (factionFlag == FACTION_FLAG_IMPERIAL) - { - if (isDeclared) - { - sendSystemMessage(player, SID_MERC_IMPERIAL_SF_END); - type = MERC_END_OVERT_IMPERIAL; - } - else - { - sendSystemMessage(player, SID_MERC_IMPERIAL_COMBATANT_END); - type = MERC_END_COVERT_IMPERIAL; - } - } - - if (type == null || type.length() <= 0) - { - return false; - } - - dictionary messageToParams = new dictionary(); - messageToParams.put("mercenary_type", type); - - if (isGod(player)) - { - sendSystemMessage(player, "Reducing wait to 5 seconds ***BECAUSE YOU ARE IN GOD MODE***.", ""); - messageTo(player, "executeFactionalHelperChoice", messageToParams, 5.0f, false); - } - else - { - messageTo(player, "executeFactionalHelperChoice", messageToParams, 60.0f, false); - } - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/gcw.java b/sku.0/sys.server/compiled/game/script/library/gcw.java deleted file mode 100644 index 4f261f6f7..000000000 --- a/sku.0/sys.server/compiled/game/script/library/gcw.java +++ /dev/null @@ -1,3677 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.ai.ai_combat; -import script.library.buff; -import script.library.colors_hex; -import script.library.factions; -import script.library.faction_perk; -import script.library.loot; -import script.library.pet_lib; -import script.library.prose; -import script.library.regions; -import script.library.space_flags; -import script.library.trial; -import script.library.utils; - - -public class gcw extends script.base_script -{ - public gcw() - { - } - public static final int GCW_UPDATE_PULSE = 1800; - public static final float DECAY_PER_UPDATE = .02f; - - public static final String SCRIPTVAR_SCAN_INTEREST = "scan.interest"; - - public static final String REGION_SPAWN_WEIGHT_PATH = "datatables/spawning/imperial_presence/presence_weight/"; - public static final String TABLE_PLAYER_BASE_CAP = "datatables/faction_perk/hq/hq_planetary_placement_cap.iff"; - - public static final int INTEREST_FACTION = 0; - public static final int INTEREST_SOMETHING = 1; - public static final int INTEREST_SPICE = 2; - public static final int INTEREST_SLICED_ITEMS = 3; - public static final int INTEREST_FACTION_ITEMS = 4; - public static final int INTEREST_CONTRABAND = 28; - - public static final String TEMPLATE_LAMBDA_SHUTTLE = "object/creature/npc/theme_park/lambda_shuttle.iff"; - public static final int AC_NONE = 0; - public static final int AC_ATTACK = 1; - public static final int AC_SCAN = 2; - - public static final String GCW_BASE_MANAGER = "gcw.base_manager.master_object"; - public static final String GCW_BASE_COUNT_REBEL = "gcw.player_base_count.rebel"; - public static final String GCW_BASE_COUNT_IMPERIAL = "gcw.player_base_count.imperial"; - public static final String VAR_BASE_HACK_DICTIONARY = "gcw.player_base_hack.dictionary"; - - public static final String GCW_SEQUENCER_KEREN = "-292452502778781373"; - public static final String GCW_SEQUENCER_DEARIC = "-348184546868074204"; - public static final String GCW_SEQUENCER_BESTINE = "-233342756915162113"; - - public static final int NO_CONTROL = 0; - public static final int IMPERIAL_CONTROL = 1; - public static final int REBEL_CONTROL = 2; - - public static final int FACTION_NEUTRAL = 0; - public static final int FACTION_REBEL = 1; - public static final int FACTION_IMPERIAL = 2; - - public static final String LIST_CREDIT_FOR_KILLS = "gcw_tracking.credit_for_kills"; - public static final String LIST_DAILY_KILL_VALUES = "gcw_tracking.daily_kill_credit"; - - public static final int NORMAL_GCW_VALUE = 5; - public static final int ELITE_GCW_VALUE = 10; - public static final int BOSS_GCW_VALUE = 25; - - public static final double SPACE_GCW_VALUE = 4.0; - - public static final int GCW_PLAYER_BASE_DESTRUCTION = 100; - public static final String GCW_PLAYER_BASE_POINT_VALUE = "datatables/faction_perk/hq/hq_point_values.iff"; - - public static final int GCW_PLAYER_PVP_MODIFIER = 100; - - public static final int BATTLEFIELD_VICTORY_POINT_VALUE = 500; - public static final int BATTLEFIELD_DEFEAT_POINT_VALUE = 100; - public static final int BATTLEFIELD_TIE_POINT_VALUE = 200; - - public static final int BATTLEFIELD_TERMINAL_CAPTURE_MULTIPLIER = 100; - - public static final int ACTIVITY_CONSTANT = 100; - public static final int MAX_DEATH_BY_PLAYER = 15; - - public static final double MIN_PVP_LEVEL_RATIO_LIMIT = 0.7; - public static final double MIN_NPC_LEVEL_RATIO_LIMIT = 0.86; - - public static final string_id SID_GENERIC_POINT_GRANT = new string_id("gcw", "gcw_rank_generic_point_grant"); - public static final string_id SID_PVP_KILL_POINT_GRANT = new string_id("gcw", "gcw_rank_pvp_kill_point_grant"); - - public static final String REGION_CONTROLLER = "gcw_pvp_region_controller"; - public static final String PVP_REGION_ACTIVITY_PERFORMED = "gcw_pvp_region.attack_performed"; - - public static final int GCW_POINT_TYPE_GROUND_PVE = 0; - public static final int GCW_POINT_TYPE_GROUND_PVP = 1; - public static final int GCW_POINT_TYPE_GROUND_PVP_REGION = 2; - public static final int GCW_POINT_TYPE_BASE_BUSTING = 3; - public static final int GCW_POINT_TYPE_SPACE_PVE = 4; - public static final int GCW_POINT_TYPE_SPACE_PVP = 5; - public static final int GCW_POINT_TYPE_GROUND_QUEST = 6; - public static final int GCW_POINT_TYPE_TRADING = 7; - public static final int GCW_POINT_TYPE_ENTERTAINING = 8; - public static final int GCW_POINT_TYPE_MAX = 9; - - public static final String validScenes[] = - { - "tatooine", - "corellia", - "dantooine", - "dathomir", - "endor", - "lok", - "naboo", - "rori", - "talus", - "yavin4", - "space_tatooine", - "space_corellia", - "space_dantooine", - "space_dathomir", - "space_endor", - "space_lok", - "space_naboo", - "space_yavin4" - }; - - public static final int maxRegions[] = - { - 14, - 14, - 17, - 14, - 16, - 14, - 14, - 13, - 13, - 18 - }; - - public static final String defaultRegions[] = - { - - "gcw_region_tatooine_13", - "gcw_region_corellia_13", - "gcw_region_dantooine_16", - "gcw_region_dathomir_13", - "gcw_region_endor_15", - "gcw_region_lok_13", - "gcw_region_naboo_13", - "gcw_region_rori_13", - "gcw_region_talus_13", - "gcw_region_yavin4_17", - - "gcw_region_tatooine_14", - "gcw_region_corellia_14", - "gcw_region_dantooine_17", - "gcw_region_dathomir_14", - "gcw_region_endor_16", - "gcw_region_lok_14", - "gcw_region_naboo_14", - "gcw_region_yavin4_18" - - }; - - public static final String pointTypes[] = - { - "pve", - "pvp", - "pvp_battlefield", - "pvp", - "space_pve", - "space_pvp", - "pve", - "trading", - "entertaining" - }; - - public static final float COLLECTION_DAMAGE_RATIO_MIN = .41f; - - public static final String PVP_PUSHBACK_REGION = "pvp_pushback"; - public static final String PVP_BATTLEFIELD_REGION = "pvp_battlefield"; - - public static final int GCW_ENTERTAINMENT_TIME = 30; - public static final String GCW_SCRIPTVAR_PARENT = "gcw_entertainment"; - public static final String GCW_ENTERTAINMENT_FLAG = "gcw_entertain_npc"; - public static final String GCW_NPC_SCRIPTVAR_FLAG = "entertainment_npc"; - public static final String GCW_PATROL_OBJ = "patrol_point_object"; - public static final String GCW_NPC_CLEANUP_FLAG = "entertainment_npc_cleanup"; - public static final String GCW_NPC_BEING_ENTERTAINED = "entertainment_npc"; - public static final String ENTERTAIN_GCW_TROOPS_PID = GCW_SCRIPTVAR_PARENT + ".gcw_entertainment_pid"; - public static final String GCW_STOPPED_ENTERTAINING = GCW_SCRIPTVAR_PARENT + ".gcw_player_stopped_entertaining"; - public static final String GCW_ENTERTAINER_PATROL_QUEST = "gcw_entertain_patrol"; - public static final String GCW_REPAIR_PATROL_QUEST = "gcw_repair_patrol"; - public static final String GCW_REPAIR_TURRET_QUEST = "gcw_repair_turret"; - public static final String GCW_REPAIR_BARRICADE_QUEST = "gcw_repair_barricade"; - public static final String GCW_SPY_PATROL_DESTROY_QUEST = "gcw_spy_destroy_patrol"; - public static final String GCW_SPY_PATROL_SCOUT_QUEST = "gcw_spy_scout_patrol"; - public static final String GCW_REPAIR_VEHICLE_PATROL_QUEST = "gcw_repair_vehicle"; - public static final String GCW_REPAIR_DAMAGED_VEHICLE_QUEST = "gcw_repair_vehicle"; - public static final String GCW_MEDIC_HEAL_QUEST = "gcw_medic_heal"; - public static final String GCW_DEFEND_BARRICADE_REBEL = "gcw_defend_rebel_barricade"; - public static final String GCW_DEFEND_BARRICADE_IMPERIAL = "gcw_defend_imperial_barricade"; - public static final String GCW_DEFEND_TURRET_REBEL = "gcw_defend_rebel_turret"; - public static final String GCW_DEFEND_TURRET_IMPERIAL = "gcw_defend_imperial_turret"; - public static final String GCW_DEFEND_TOWER_REBEL = "gcw_defend_rebel_tower"; - public static final String GCW_DEFEND_TOWER_IMPERIAL = "gcw_defend_imperial_tower"; - public static final String GCW_DESTROY_BARRICADE = "gcw_destroy_barricade"; - public static final String GCW_DESTROY_TURRET = "gcw_destroy_turret"; - public static final String GCW_ENTERTAIN_RALLY = "gcw_entertain_rallying"; - public static final String GCW_ENTERTAIN_FATIGUE = "gcw_entertain_fatigue"; - public static final String GCW_SMUGGLER_SLICING = "gcw_smuggler_slicing"; - public static final String GCW_ELIMINATE_REBELS = "gcw_eliminate_rebels"; - public static final String GCW_ELIMINATE_IMPERIALS = "gcw_eliminate_imperials"; - - public static final String BUFF_SPY_EXPLOSIVES = "gcw_spy_destroy_patrol_explosive_stack"; - public static final String BUFF_GENERAL_RESIST_STACK_IMP = "gcw_general_resistance_stack_imperial"; - public static final String BUFF_GENERAL_RESIST_STACK_REB = "gcw_general_resistance_stack_rebel"; - public static final String BUFF_PLAYER_FATIGUE = "gcw_fatigue"; - - public static final String SPY_DESTROY_PID = "spyDestroyPid"; - public static final String SPY_SCOUT_PID = "spyScoutPid"; - public static final String TRADER_REPAIR_PID = "traderRepairPid"; - public static final String OBJECT_TO_REPAIR = "objectToRepair"; - public static final String GCW_REPAIR_QUEST = "gcwRepairQuest"; - public static final String GCW_REPAIR_RESOURCE_COUNT = "gcwRepairResourceCount"; - public static final String GCW_OBJECT_REPAIR_COUNT = "gcwObjectRepairCount"; - - public static final string_id SID_COUNTDOWN_LOCOMOTION = new string_id("gcw", "locomotion_stopped_countdown"); - public static final string_id SID_INTERRUPTED_INCAPACITATED = new string_id("gcw", "incap_stopped_countdown"); - public static final string_id SID_INTERRUPTED_DAMAGED = new string_id("gcw", "combat_stopped_countdown"); - public static final string_id SID_YOU_NEED_TO_BE_COMBATANT = new string_id("gcw", "you_need_to_be_combatant_to_entertain"); - public static final string_id SID_YOU_NEED_ENTERTAINMENT_QUEST = new string_id("gcw", "you_need_entertainment_quest_to_entertain"); - public static final string_id SID_ENTERTAIN_TROOPS_TIMER = new string_id("gcw", "entertain_troops_timer"); - public static final string_id SID_DOESNT_NEED_REPAIR = new string_id("gcw", "gcw_object_doesnt_need_repair"); - public static final string_id SID_DOESNT_NEED_HEALING = new string_id("gcw", "gcw_object_doesnt_need_healing"); - public static final string_id SID_YOU_NEED_RESOURCES_REPAIR = new string_id("gcw", "you_need_resources_to_repair"); - public static final string_id SID_YOU_NEED_TOOL_REPAIR = new string_id("gcw", "gcw_asset_repair_resource_needed"); - public static final string_id SID_RESOURCES_NEEDED = new string_id("gcw", "pylon_resources_needed"); - public static final string_id SID_SCOUT_PP_TIMER = new string_id("gcw", "reporting_patrol_point_position"); - public static final string_id SID_REPAIR_PP_TIMER = new string_id("gcw", "reparing_gcw_object"); - public static final string_id SID_HEAL_PP_TIMER = new string_id("gcw", "healing_gcw_object"); - public static final string_id SID_DESTROY_PP_TIMER = new string_id("gcw", "placing_patrol_point_explosives"); - - public static final String GCW_RESOURCE_TYPE_BARRICADE = "ore"; - public static final String GCW_RESOURCE_TYPE_TURRET = "metal"; - public static final String GCW_RESOURCE_TYPE_PATROL = "metal"; - public static final String GCW_RESOURCE_TYPE_VEHICLE = "metal"; - public static final String GCW_RESOURCE_TYPE_DAMAGED_VEHICLE = "metal"; - - public static final String GCW_SPAWN_ID_OBJVAR = "spawn_id"; - public static final String GCW_DEFENSE_PATROL_OBJVAR = "defense_patrol"; - public static final String GCW_OFFENSE_PATROL_OBJVAR = "offense_patrol"; - public static final String GCW_TOOL_TEMPLATE_OBJVAR = "tool_template"; - public static final String GCW_DEF_TOOL_TEMPLATE_OBJVAR = "defense_tool_template"; - public static final String GCW_OFF_TOOL_TEMPLATE_OBJVAR = "offense_tool_template"; - - public static final String GCW_CONSTRUCTION_TASK = "resourcesUsed"; - public static final String GCW_CONSTRUCTION_SIGNAL = "resourcesUsed"; - public static final String GCW_IMP_DESTROY_BARRICADE_TASK = "destroyBarricadeImperial"; - public static final String GCW_IMP_DESTROY_BARRICADE_SIGNAL = "destroyBarricadeImperial"; - public static final String GCW_REB_DESTROY_BARRICADE_TASK = "destroyBarricadeRebel"; - public static final String GCW_REB_DESTROY_BARRICADE_SIGNAL = "destroyBarricadeRebel"; - public static final String GCW_IMP_DESTROY_TURRET_TASK = "destroyTurretImperial"; - public static final String GCW_IMP_DESTROY_TURRET_SIGNAL = "destroyTurretImperial"; - public static final String GCW_REB_DESTROY_TURRET_TASK = "destroyTurretRebel"; - public static final String GCW_REB_DESTROY_TURRET_SIGNAL = "destroyTurretRebel"; - public static final String GCW_REB_ENTERTAIN_PATROL_TASK = "entertainedPostRebel"; - public static final String GCW_REB_ENTERTAIN_PATROL_SIGNAL = "entertainedPostRebel"; - public static final String GCW_IMP_ENTERTAIN_PATROL_TASK = "entertainedPostImperial"; - public static final String GCW_IMP_ENTERTAIN_PATROL_SIGNAL = "entertainedPostImperial"; - public static final String GCW_REB_DESTROY_PATROL_SIGNAL = "destroyedPatrolPointRebel"; - public static final String GCW_IMP_DESTROY_PATROL_SIGNAL = "destroyedPatrolPointImperial"; - public static final String GCW_REB_FIND_PATROL_SIGNAL = "findPatrolPointRebel"; - public static final String GCW_IMP_FIND_PATROL_SIGNAL = "findPatrolPointImperial"; - public static final String GCW_PARTICIPATION_FLAG = "gcw_participation_flag"; - - public static final String GCW_POINT_OVERRIDE = "gcw_point_override"; - public static final String GCW_REBEL_TOKEN = "item_gcw_rebel_token"; - public static final String GCW_IMPERIAL_TOKEN = "item_gcw_imperial_token"; - public static final String GCW_NPC_ENTERTAINED_BUFF = "gcw_entertained_patrol_npc"; - - public static final int REPAIR_COUNT_MAX = 100; - public static final int QUEST_COUNT_MAX = 100; - public static final int GCW_REPAIR_AMOUNT = 50000; - public static final int GCW_RESOURCE_COUNT_BARRICADE = 50000; - public static final int GCW_RESOURCE_COUNT_TURRET = 50000; - public static final int GCW_RESOURCE_COUNT_PATROL = 50000; - public static final int GCW_RESOURCE_COUNT_VEHICLE = 50000; - public static final int GCW_RESOURCE_COUNT_DAMAGED_VEHICLE = 50000; - - public static final int GCW_CITY_PHASE_UNKNOWN = 0; - public static final int GCW_CITY_PHASE_CONSTRUCTION = 1; - public static final int GCW_CITY_PHASE_COMBAT = 2; - - public static final int GCW_CONSTRUCTION_MAXIMUM = 100; - public static final int GCW_FATIGUE_DIVISOR = 10; - public static final int GCW_FATIGUE_TIMER_MAX = 100; - - public static final int GCW_PULSE_TIMER = 10800; - public static final int GCW_CONSTRUCTION_END_TIMER = 1800; - public static final int GCW_COMBAT_END_TIMER = 1800; - public static final int GCW_GENERAL_GCW_BONUS_MULTIPLIER = 5; - public static final int GCW_GENERAL_GCW_BASE_AMOUNT = 1000; - public static final int GCW_GENERAL_TOKEN_BONUS_DIVISOR = 1000; - public static final int GCW_POINTS_WINNER_PARTICIPANTS = 1000; - public static final int GCW_POINTS_LOSER_PARTICIPANTS = 100; - public static final int GCW_TOKENS_WINNER_PARTICIPANTS = 40; - public static final int GCW_TOKENS_LOSER_PARTICIPANTS = 10; - - public static final int GCW_POINTS_CONSTRUCTION_PHASE = 100; - public static final int GCW_TOKENS_CONSTRUCTION_PHASE = 20; - - public static final String DEARIC_CITY_TABLE = "datatables/gcw/gcw_city_dearic.iff"; - public static final String KEREN_CITY_TABLE = "datatables/gcw/gcw_city_keren.iff"; - public static final String BESTINE_CITY_TABLE = "datatables/gcw/gcw_city_bestine.iff"; - - public static final String CITY_DEARIC = "dearic"; - public static final String CITY_BESTINE = "bestine"; - public static final String CITY_KEREN = "keren"; - - public static final String COLOR_REBELS = "\\"+ colors_hex.COLOR_REBELS; - public static final String COLOR_IMPERIALS = "\\"+ colors_hex.COLOR_IMPERIALS; - - - public static void assignScanInterests(obj_id npc) throws InterruptedException - { - if (!isIdValid(npc) || isPlayer(npc) || pet_lib.isPet(npc)) - { - return; - } - - int interests = 0; - - location here = getLocation(npc); - - if (here == null) - { - return; - } - - int spawnWeight = Integer.MIN_VALUE; - - String tbl = REGION_SPAWN_WEIGHT_PATH + here.area + ".iff"; - - String[] regionNames = dataTableGetStringColumn(tbl, "REGION_NAME"); - - if (regionNames != null && regionNames.length > 0) - { - region[] r = getRegionsWithSpawnableAtPoint(here, regions.SPAWN_TRUE); - if (r != null && r.length > 0) - { - for (int i = 0; i < r.length; i++) - { - testAbortScript(); - String rName = r[i].getName(); - int idx = utils.getElementPositionInArray(regionNames, rName); - - if (idx > -1) - { - spawnWeight = dataTableGetInt(tbl, idx, "WEIGHT"); - break; - } - } - } - } - - if (spawnWeight == Integer.MIN_VALUE) - { - spawnWeight = rand(-10, 10); - - } - - if (rand(0, 10) <= rand(1, 10) - spawnWeight) - { - interests = utils.setBit(interests, INTEREST_FACTION); - } - - if (rand(1, 100) <= 10) - { - interests |= INTEREST_CONTRABAND; - } - else - { - if (rand(0, 10) <= rand(1, 10) + spawnWeight) - { - interests = utils.setBit(interests, INTEREST_SPICE); - } - - if (rand(-5, 5) <= rand(-3, 3) + spawnWeight) - { - interests = utils.setBit(interests, INTEREST_SLICED_ITEMS); - } - - if (rand(0, 10) <= rand(1, 10) - spawnWeight) - { - interests = utils.setBit(interests, INTEREST_FACTION_ITEMS); - } - } - - if (interests == 0) - { - interests = utils.setBit(interests, rand(INTEREST_FACTION, INTEREST_FACTION_ITEMS)); - } - - utils.setScriptVar(npc, SCRIPTVAR_SCAN_INTEREST, interests); - } - - - public static float scan(obj_id scanner, obj_id target) throws InterruptedException - { - if (!isIdValid(scanner) || !isIdValid(target)) - { - return -1f; - } - - int interests = utils.getIntScriptVar(scanner, SCRIPTVAR_SCAN_INTEREST); - - if (interests == 0) - { - return -1f; - } - - return getContrabandRating(target, interests); - } - - - public static boolean isContrabandItem(obj_id item) throws InterruptedException - { - if (!isIdValid(item)) - { - return false; - } - - return (getContrabandRating(item, INTEREST_CONTRABAND) > 0f); - } - - - public static float getContrabandRating(obj_id target, int interests) throws InterruptedException - { - if (!isIdValid(target) || interests == 0) - { - return 0f; - } - - int got = getGameObjectType(target); - - if (isGameObjectTypeOf(got, GOT_creature) || isPlayer(target)) - { - obj_id self = getSelf(); - - if (isIdValid(self)) - { - int total = 0; - - obj_id[] items = getInventoryAndEquipment(target); - - if (items != null && items.length > 0) - { - int min_check = 1; - float dist = getDistance(self, target); - - if (dist < 64f) - { - min_check -= Math.round(dist / 15f); - } - - if (min_check < 1) - { - min_check = 1; - } - - int i = 0; - - while (i < items.length) - { - testAbortScript(); - total += getContrabandRating(items[i], interests); - i += rand(1, min_check); - } - } - - int myFac = pvpGetAlignedFaction(self); - int tFac = pvpGetAlignedFaction(target); - - if (tFac == myFac) - { - total -= pvpGetCurrentGcwRank(target); - if (total < 0) - { - total = 0; - } - } - else - { - if (utils.checkBit(interests, INTEREST_FACTION)) - { - if (pvpAreFactionsOpposed(myFac, tFac)) - { - if (isPlayer(target)) - { - - total += pvpGetCurrentGcwRank(target); - - } - else - { - total += 5; - } - } - } - } - - return total; - } - } - else - { - if (isSpice(target) && utils.checkBit(interests, INTEREST_SPICE)) - { - int cnt = getCount(target); - - if (cnt > 0) - { - return (float) cnt; - } - - return 6f; - } - - if (isSlicedEquipment(target) && utils.checkBit(interests, INTEREST_SLICED_ITEMS)) - { - if (utils.isEquipped(target)) - { - return 4f; - } - - return 2f; - } - - if (isNonImperialFactionItem(target) && utils.checkBit(interests, INTEREST_FACTION_ITEMS)) - { - if (utils.isEquipped(target)) - { - return 6f; - } - - return 3f; - } - } - - return 0f; - } - - - public static float getContrabandRating(obj_id target) throws InterruptedException - { - obj_id self = getSelf(); - int interests = utils.getIntScriptVar(self, SCRIPTVAR_SCAN_INTEREST); - - return getContrabandRating(target, interests); - } - - - public static boolean isSpice(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - return (getGameObjectType(target) == GOT_misc_food && hasScript(target, "item.comestible.spice")); - } - - - public static boolean isSlicedEquipment(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - int got = getGameObjectType(target); - - return (hasObjVar(target, "slicing.hack") && (isGameObjectTypeOf(got, GOT_weapon) || isGameObjectTypeOf(got, GOT_armor))); - } - - - public static boolean isNonImperialFactionItem(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if (hasScript(target, faction_perk.SCRIPT_FACTION_ITEM)) - { - if (hasObjVar(target, faction_perk.VAR_FACTION)) - { - String iFac = getStringObjVar(target, faction_perk.VAR_FACTION); - - if (!iFac.equals("imperial")) - { - return true; - } - } - } - - return false; - } - - - public static void harass(obj_id npc, obj_id target) throws InterruptedException - { - if (!isIdValid(npc)) - { - return; - } - - if (hasScript(npc, "ai.imperial_presence.harass")) - { - return; - } - - attachScript(npc, "ai.imperial_presence.harass"); - if (isIdValid(target) && target.isLoaded()) - { - dictionary d = new dictionary(); - - d.put("harassTarget", target); - - messageTo(npc, "handleNewHarassTarget", d, 1f, false); - } - else - { - messageTo(npc, "handleCheckpointMode", null, 1f, false); - } - } - - - public static boolean spawnViaLambda(location loc, String tbl, String column, dictionary params) throws InterruptedException - { - if (loc == null || tbl == null || tbl.equals("") || column == null || column.equals("")) - { - return false; - } - - String[] spawnNames = dataTableGetStringColumn(tbl, column); - return createLambdaDropship(loc, spawnNames, params); - } - - - public static boolean spawnViaLambda(location loc, String tbl, int col, dictionary params) throws InterruptedException - { - if (loc == null || tbl == null || tbl.equals("") || col < 0) - { - return false; - } - - String[] spawnNames = dataTableGetStringColumn(tbl, col); - return createLambdaDropship(loc, spawnNames, params); - } - - - public static boolean createLambdaDropship(location loc, String[] spawnNames, dictionary params) throws InterruptedException - { - if (loc == null || spawnNames == null || spawnNames.length == 0) - { - return false; - } - - if (!loc.area.equals(getCurrentSceneName())) - { - return false; - } - - obj_id lambda = create.object("object/creature/npc/theme_park/lambda_shuttle.iff", loc); - - if (!isIdValid(lambda)) - { - return false; - } - - setYaw(lambda, rand(-180f, 180f)); - - attachScript(lambda, "systems.spawning.dropship.lambda"); - - utils.setScriptVar(lambda, "spawnNames", spawnNames); - - if (params != null && !params.isEmpty()) - { - utils.setScriptVar(lambda, "spawnParameters", params); - } - - return true; - } - - - public static boolean spawnViaLambdaPerGeo(location loc, dictionary params) throws InterruptedException - { - if (loc == null) - { - return false; - } - - String[] spawnNames = getGeoSpawnNames(loc); - return createLambdaDropship(loc, spawnNames, params); - } - - - public static String[] getGeoSpawnNames(location loc, boolean allowHeavy) throws InterruptedException - { - - if (loc == null) - { - return null; - } - - region[] r = getRegionsAtPoint(loc); - if (r == null || r.length == 0) - { - return null; - } - - String tbl = "datatables/imperial_presence/geo/general.iff"; - - if (allowHeavy && rand(0, 10) < 2) - { - tbl = "datatables/imperial_presence/geo/general_heavy.iff"; - } - - for (int i = 0; i < r.length; i++) - { - testAbortScript(); - int geoType = r[i].getGeographicalType(); - - if (geoType == regions.GEO_DESERT || geoType == regions.GEO_OASIS || geoType == regions.GEO_WASTELAND) - { - tbl = "datatables/imperial_presence/geo/desert.iff"; - } - else if (geoType == regions.GEO_FOREST || geoType == regions.GEO_JUNGLE || geoType == regions.GEO_WASTELAND) - { - tbl = "datatables/imperial_presence/geo/forest.iff"; - } - else if (geoType == regions.GEO_SWAMP) - { - tbl = "datatables/imperial_presence/geo/swamp.iff"; - } - } - - int numCol = dataTableGetNumColumns(tbl); - - if (numCol <= 0) - { - return null; - } - - return dataTableGetStringColumn(tbl, rand(0, numCol - 1)); - } - - - public static String[] getGeoSpawnNames(location loc) throws InterruptedException - { - return getGeoSpawnNames(loc, false); - } - - - public static obj_id getGCWMasterObject(obj_id objObject) throws InterruptedException - { - return getGCWMasterObject(getLocation(objObject)); - } - - - public static obj_id getGCWMasterObject(location locTest) throws InterruptedException - { - String strPlanet = locTest.area; - dictionary dctObjectInfo = dataTableGetRow("datatables/gcw/gcw_master_objects.iff", strPlanet); - - if (dctObjectInfo == null) - { - LOG("gcw", "No object for "+ strPlanet); - return null; - } - - String strObjId = dctObjectInfo.getString("strObjId"); - Long lngId; - - try - { - lngId = new Long(strObjId); - } - catch(NumberFormatException err) - { - LOG("gcw", "Bad object id format for "+ strPlanet); - return null; - } - - obj_id objMaster = obj_id.getObjId(lngId.longValue()); - - return objMaster; - } - - - public static void changeGCWScore(location locTest, int intValue, String strFaction) throws InterruptedException - { - dictionary dctParams = new dictionary(); - - dctParams.put("intScoreChange", intValue); - dctParams.put("strFaction", strFaction); - obj_id objParent = getGCWMasterObject(locTest); - - messageTo(objParent, "updateGCWScore", dctParams, 0, true); - } - - - public static void incrementGCWScore(obj_id objObject) throws InterruptedException - { - location locTest = getLocation(objObject); - int intScoreChange = faction_perk.grabFactionBasePointValue(objObject); - String strFaction = getStringObjVar(objObject, "faction"); - - changeGCWScore(locTest, intScoreChange, strFaction); - } - - - public static void decrementGCWScore(obj_id objObject) throws InterruptedException - { - location locTest = getLocation(objObject); - int intScoreChange = faction_perk.grabFactionBasePointValue(objObject); - - intScoreChange = intScoreChange * -1; - String strFaction = getStringObjVar(objObject, "faction"); - - changeGCWScore(locTest, intScoreChange, strFaction); - return; - - } - - - public static boolean canPlaceFactionBaseByPlanet(obj_id player, obj_id deed, String planet) throws InterruptedException - { - if (isGcwRestrictedSceneName(planet)) - { - return false; - } - - if (!canPlaceFactionBaseByScore(player, deed, planet)) - { - return false; - } - - return true; - } - - - public static boolean canPlaceFactionBaseByScore(obj_id player, obj_id deed, String planet) throws InterruptedException - { - return (getCurrentPlanetaryFactionBaseCountPlanet(planet) < getCurrentPlanetaryFactionBaseMaxPlanet(planet)); - } - - - public static int getCurrentPlanetaryFactionBaseCountPlanet(String planet) throws InterruptedException - { - obj_id planetId = getPlanetByName(planet); - - if (!isIdValid(planetId)) - { - return Integer.MAX_VALUE; - } - - return getRebelBaseCount(planetId) + getImperialBaseCount(planetId); - } - - - public static int getCurrentPlanetaryFactionBaseMaxPlanet(String planet) throws InterruptedException - { - obj_id planetId = getPlanetByName(planet); - - if (!isIdValid(planetId)) - { - return -1; - } - - if (!dataTableOpen(TABLE_PLAYER_BASE_CAP)) - { - return -1; - } - - int row = dataTableSearchColumnForString(planet, "planet", TABLE_PLAYER_BASE_CAP); - - return (row == -1 ? -1 : dataTableGetInt(TABLE_PLAYER_BASE_CAP, planet, "base_max")); - } - - - public static int getImperialBaseCount(obj_id planet) throws InterruptedException - { - return (utils.hasScriptVar(planet, GCW_BASE_COUNT_IMPERIAL) ? utils.getIntScriptVar(planet, GCW_BASE_COUNT_IMPERIAL) : 0); - } - - - public static int getRebelBaseCount(obj_id planet) throws InterruptedException - { - return (utils.hasScriptVar(planet, GCW_BASE_COUNT_REBEL) ? utils.getIntScriptVar(planet, GCW_BASE_COUNT_REBEL) : 0); - } - - - public static void modifyPlanetaryBaseCount(obj_id base, int faction, int delta) throws InterruptedException - { - obj_id planetId = getPlanetByName(getLocation(base).area); - obj_id planetRegister = utils.getObjIdScriptVar(planetId, GCW_BASE_MANAGER); - - if (!isIdValid(planetRegister)) - { - return; - } - - dictionary dict = new dictionary(); - - dict.put("faction", faction); - dict.put("delta", delta); - messageTo(planetRegister, "alterBaseCount", dict, 0, false); - } - - - public static boolean isGcwRestrictedSceneName(String scene) throws InterruptedException - { - String[] restrictedScene = - { - "kashyyyk_main", - "kashyyyk_north_dungeons", - "kashyyyk_pob_dungeons", - "kashyyyk_south_dungeons", - "kashyyyk_rryatt_trail", - "kashyyyk_hunting", - "space_light1", - "space_heavy1", - "dathomir", - "yavin4", - "endor", - "mustafar" - }; - - for (int i = 0; i < restrictedScene.length; i++) - { - testAbortScript(); - if (restrictedScene[i].equals(scene)) - { - return true; - } - } - - return false; - } - - - public static dictionary getGCWDictionary(obj_id self) throws InterruptedException - { - int intImperialControlScore = getIntObjVar(self, "Imperial.controlScore"); - int intRebelControlScore = getIntObjVar(self, "Rebel.controlScore"); - dictionary dctParams = new dictionary(); - - LOG("gcw", "Putting Imperial "+ intImperialControlScore); - LOG("gcw", "Putting Rebel "+ intRebelControlScore); - dctParams.put("intImperialControlScore", intImperialControlScore); - dctParams.put("intRebelControlScore", intRebelControlScore); - return dctParams; - } - - - public static float getImperialRatio(obj_id objNPC) throws InterruptedException - { - float fltImperialControlScore = (float) getIntObjVar(objNPC, "Imperial.controlScore"); - float fltRebelControlScore = (float) getIntObjVar(objNPC, "Rebel.controlScore"); - - if ((fltImperialControlScore == 0) && (fltRebelControlScore == 0)) - { - return 1.0f; - } - - if (fltImperialControlScore == 0) - { - return .0f; - } - - float fltScore = fltImperialControlScore / fltRebelControlScore; - - return fltScore; - } - - - public static float getRebelRatio(obj_id objNPC) throws InterruptedException - { - float fltImperialControlScore = (float) getIntObjVar(objNPC, "Imperial.controlScore"); - float fltRebelControlScore = (float) getIntObjVar(objNPC, "Rebel.controlScore"); - - if ((fltImperialControlScore == 0) && (fltRebelControlScore == 0)) - { - return 1.0f; - } - - if (fltRebelControlScore == 0) - { - return .0f; - } - - LOG("gcw", "Rebel score is "+ fltRebelControlScore); - LOG("gcw", "Imperial score is "+ fltImperialControlScore); - - float fltScore = fltRebelControlScore / fltImperialControlScore; - - return fltScore; - - } - - - public static void incrementGCWStanding(obj_id killer, obj_id target) throws InterruptedException - { - obj_id self = killer; - final int MINIMUM_TIME_BETWEEN_KILLS = 900; - - if (!factions.isDeclared(killer)) - { - return; - } - - int intScore = 1; - - if (isPlayer(target)) - { - intScore = 25; - } - - int intTime = getGameTime(); - int intLastKill = utils.getIntScriptVar(target, "intLastGCWDeath"); - - if ((intTime - intLastKill < MINIMUM_TIME_BETWEEN_KILLS)) - { - - } - - obj_id objStructure = getTopMostContainer(killer); - - if (!isPlayer(objStructure)) - { - if (!permissionsIsPublic(objStructure)) - { - return; - } - } - - utils.setScriptVar(target, "intLastGCWDeath", intTime); - - dictionary dctParams = new dictionary(); - - dctParams.put("intScore", intScore); - messageTo(killer, "updateGCWStanding", dctParams, 0, false); - - } - - - public static void checkAndUpdateGCWStanding(obj_id self, int intAddedPoints) throws InterruptedException - { - String area = getLocation(self).area; - - if (area.equals("dungeon1") || area.equals("adventure1") || area.equals("adventure2")) - { - return; - } - - final int SCORE_THRESHOLD = 25; - final int POINT_EXCHANGE_RATE = 25; - int intCurrentScore = getIntObjVar(self, "gcw.intKillScore"); - - intCurrentScore = intCurrentScore + intAddedPoints; - - if (intCurrentScore >= SCORE_THRESHOLD) - { - int intPlanetPoints = intCurrentScore / POINT_EXCHANGE_RATE; - - intCurrentScore = intCurrentScore - (intPlanetPoints * POINT_EXCHANGE_RATE); - - prose_package ppTest = new prose_package(); - string_id strSpam = new string_id("faction_perk", "earned_gcw_points"); - - ppTest = prose.setStringId(ppTest, strSpam); - ppTest = prose.setDI(ppTest, intPlanetPoints); - sendSystemMessageProse(self, ppTest); - String strFaction = ""; - - if (factions.isRebel(self)) - { - playClientEffectObj(self, "clienteffect/holoemote_rebel.cef", self, "head"); - play2dNonLoopingSound(self, "sound/music_themequest_victory_rebel.snd"); - strFaction = "Rebel"; - - } - else - { - playClientEffectObj(self, "clienteffect/holoemote_imperial.cef", self, "head"); - play2dNonLoopingSound(self, "sound/music_themequest_victory_imperial.snd"); - strFaction = "Imperial"; - } - - changeGCWScore(getLocation(self), intPlanetPoints, strFaction); - } - - setObjVar(self, "gcw.intKillScore", intCurrentScore); - } - - - public static obj_id getPub30StaticBaseControllerId(obj_id subject) throws InterruptedException - { - return getFirstObjectWithScript(getLocation(trial.getTop(subject)), 500.0f, "systems.gcw.static_base.master"); - } - - - public static int getPub30StaticBaseControllingFaction(obj_id subject) throws InterruptedException - { - obj_id controller = getPub30StaticBaseControllerId(subject); - - return getIntObjVar(controller, "gcw.static_base.base_status"); - } - - - public static int getPub30StaticBaseTimeSinceLastCapture(obj_id subject) throws InterruptedException - { - obj_id controller = getPub30StaticBaseControllerId(subject); - - if (!hasObjVar(controller, "gcw.static_base.last_capture")) - { - return -1; - } - else - { - return getIntObjVar(controller, "gcw.static_base.last_capture"); - } - } - - - public static void setPub30StaticBaseTimeSinceLastCapture(obj_id subject, int time) throws InterruptedException - { - obj_id controller = getPub30StaticBaseControllerId(subject); - - setObjVar(controller, "gcw.static_base.last_capture", time); - } - - public static final int PHASE_5 = 259200; - public static final int PHASE_4 = 86400; - public static final int PHASE_3 = 28800; - public static final int PHASE_2 = 14400; - - - public static int getPub30StaticBaseCapturePhase(obj_id subject) throws InterruptedException - { - int lastCapture = getPub30StaticBaseTimeSinceLastCapture(subject); - - if (lastCapture == -1) - { - return 0; - } - - int difference = getGameTime() - lastCapture; - - if (difference >= 259200) - { - return 5; - } - - if (difference >= 86400) - { - return 4; - } - - if (difference >= 28800) - { - return 3; - } - - if (difference >= 14400) - { - return 2; - } - - return 1; - } - - - public static int getPub30TimeToNextPhaseInt(obj_id subject) throws InterruptedException - { - int lastCapture = getPub30StaticBaseTimeSinceLastCapture(subject); - int inPhase = getPub30StaticBaseCapturePhase(subject); - - switch(inPhase) - { - case 1: - return (PHASE_2 + lastCapture) - getGameTime(); - case 2: - return (PHASE_3 + lastCapture) - getGameTime(); - case 3: - return (PHASE_4 + lastCapture) - getGameTime(); - case 4: - return (PHASE_5 + lastCapture) - getGameTime(); - default: - return -1; - } - } - - - public static String getPub30TimeToNextPhaseString(obj_id subject) throws InterruptedException - { - int timeToNext = getPub30TimeToNextPhaseInt(subject); - - return utils.formatTimeVerbose(timeToNext); - } - - - public static int advancePub30StaticBaseCapturePhase(obj_id subject) throws InterruptedException - { - int currentPhase = getPub30StaticBaseCapturePhase(subject); - - if (currentPhase == 5) - { - return 5; - } - - int newTime = 0; - - switch(currentPhase) - { - case 1: - newTime = getGameTime() - PHASE_2; - setPub30StaticBaseTimeSinceLastCapture(subject, newTime); - return 2; - case 2: - newTime = getGameTime() - PHASE_3; - setPub30StaticBaseTimeSinceLastCapture(subject, newTime); - return 3; - case 3: - newTime = getGameTime() - PHASE_4; - setPub30StaticBaseTimeSinceLastCapture(subject, newTime); - return 4; - case 4: - newTime = getGameTime() - PHASE_5; - setPub30StaticBaseTimeSinceLastCapture(subject, newTime); - return 5; - default: - return -1; - } - } - - - public static int regressPub30StaticBaseCapturePhase(obj_id subject) throws InterruptedException - { - int currentPhase = getPub30StaticBaseCapturePhase(subject); - - if (currentPhase == 1) - { - return 1; - } - - int newTime = 0; - - switch(currentPhase) - { - case 2: - newTime = getGameTime(); - setPub30StaticBaseTimeSinceLastCapture(subject, newTime); - return 1; - case 3: - newTime = getGameTime() - PHASE_2; - setPub30StaticBaseTimeSinceLastCapture(subject, newTime); - return 2; - case 4: - newTime = getGameTime() - PHASE_3; - setPub30StaticBaseTimeSinceLastCapture(subject, newTime); - return 3; - case 5: - newTime = getGameTime() - PHASE_4; - setPub30StaticBaseTimeSinceLastCapture(subject, newTime); - return 4; - default: - return -1; - } - - } - - - public static void clearCreditForKills(obj_id player) throws InterruptedException - { - utils.removeBatchScriptVar(player, LIST_CREDIT_FOR_KILLS); - } - - - public static int findAttackerInArray(Vector attackList, obj_id attacker) throws InterruptedException - { - if (attackList == null || attackList.size() == 0) - { - return -1; - } - - for (int i = 0; i < attackList.size(); i++) - { - testAbortScript(); - String[] splitEntry = split(((String)(attackList.get(i))), '-'); - obj_id idAtPoint = utils.stringToObjId(splitEntry[0]); - - if (idAtPoint == attacker) - { - return i; - } - } - - return -1; - } - - - public static int getDamageFromAttacker(Vector attackList, obj_id attacker) throws InterruptedException - { - if (attackList == null || attackList.size() == 0) - { - return 0; - } - - for (int i = 0; i < attackList.size(); i++) - { - testAbortScript(); - String[] splitEntry = split(((String)(attackList.get(i))), '-'); - obj_id idAtPoint = utils.stringToObjId(splitEntry[0]); - - if (idAtPoint == attacker) - { - return utils.stringToInt(splitEntry[1]); - } - } - - return 0; - } - - - public static String packAttackerDamage(obj_id attacker, int damage) throws InterruptedException - { - return ("" + attacker + "-" + damage); - } - - - public static boolean releaseGcwPointCredit(obj_id player) throws InterruptedException - { - obj_id[] gcwEnemiesList = new obj_id[0]; - - if (verifyPvpRegionStatus(player)) - { - gcwEnemiesList = getPlayerCreaturesInRange(getLocation(player), 80.0f); - } - - boolean isImperialPlayer = factions.isImperial(player); - boolean isRebelPlayer = factions.isRebel(player); - - obj_id landedDeathBlow = getObjIdObjVar(player, pclib.VAR_DEATHBLOW_KILLER); - - if (beast_lib.isBeast(landedDeathBlow) || pet_lib.isPet(landedDeathBlow)) - { - landedDeathBlow = getMaster(landedDeathBlow);; - } - - if (gcwEnemiesList != null && gcwEnemiesList.length > 0) - { - removeDayOldEntries(player); - - for (int i = 0; i < gcwEnemiesList.length; i++) - { - testAbortScript(); - if (!isIdValid(gcwEnemiesList[i]) || !exists(gcwEnemiesList[i]) || !verifyPvpRegionStatus(gcwEnemiesList[i])) - { - continue; - } - - if (((float)getLevel(player) / (float)getLevel(gcwEnemiesList[i]) >= MIN_PVP_LEVEL_RATIO_LIMIT && ((isImperialPlayer && factions.isRebel(gcwEnemiesList[i])) || (factions.isImperial(gcwEnemiesList[i]) && isRebelPlayer)))) - { - int points = distributeIndividualContribution(player, gcwEnemiesList[i], 0, GCW_POINT_TYPE_GROUND_PVP); - pvpModifyCurrentPvpKills(gcwEnemiesList[i], 1); - incrementKillMeter(gcwEnemiesList[i], 1); - } - - } - - Vector attackerList = utils.getResizeableStringBatchScriptVar(player, gcw.LIST_CREDIT_FOR_KILLS); - - if (attackerList == null || attackerList.size() == 0) - { - return false; - } - - for (int j = 0; j < attackerList.size(); j++) - { - testAbortScript(); - String[] parseKiller = split(((String)(attackerList.get(j))), '-'); - obj_id killer = utils.stringToObjId(parseKiller[0]); - - if (beast_lib.isBeast(killer) || pet_lib.isPet(killer)) - { - killer = getMaster(killer); - } - - double vLev = (double)getLevel(player); - double kLev = (double)getLevel(killer); - boolean isOfLevel = (vLev / kLev) >= MIN_PVP_LEVEL_RATIO_LIMIT; - - if (isOfLevel && killer != landedDeathBlow) - { - pvp.bfCreditForAssist(killer); - gcwInvasionCreditForAssist(killer); - } - } - - utils.removeBatchScriptVar(player, gcw.LIST_CREDIT_FOR_KILLS); - - return true; - } - - Vector attackerList = utils.getResizeableStringBatchScriptVar(player, gcw.LIST_CREDIT_FOR_KILLS); - - if (attackerList == null || attackerList.size() == 0) - { - return false; - } - - int totalDamage = 0; - - for (int q = 0; q < attackerList.size(); q++) - { - testAbortScript(); - - String[] damageSplit = split(((String)(attackerList.get(q))), '-'); - totalDamage += utils.stringToInt(damageSplit[1]); - } - - removeDayOldEntries(player); - - for (int j = 0; j < attackerList.size(); j++) - { - testAbortScript(); - String[] parseKiller = split(((String)(attackerList.get(j))), '-'); - obj_id killer = utils.stringToObjId(parseKiller[0]); - double vLev = (double)getLevel(player); - double kLev = (double)getLevel(killer); - boolean isOfLevel = (vLev/kLev) >= MIN_PVP_LEVEL_RATIO_LIMIT; - - if (isOfLevel) - { - int points = distributeIndividualContribution(player, ((String)(attackerList.get(j))), totalDamage, GCW_POINT_TYPE_GROUND_PVP); - - if (isIdValid(killer) && exists(killer)) - { - pvpModifyCurrentPvpKills(killer, 1); - incrementKillMeter(killer, 1); - } - } - } - - utils.removeBatchScriptVar(player, gcw.LIST_CREDIT_FOR_KILLS); - - return true; - } - - - public static void notifyPvpRegionWatcherOfDeath(obj_id player) throws InterruptedException - { - obj_id pvpRegionController = gcw.getPvpRegionControllerIdByPlayer(player); - dictionary dict = new dictionary(); - dict.put("player", player); - - if (isIdValid(pvpRegionController)) - { - messageTo(pvpRegionController, "diedInPvpRegion", dict, 1, false); - } - - } - - public static boolean isAlreadyInArray(String[] orderedList, String attackerEntry) throws InterruptedException - { - for (int i = 0; i < orderedList.length; i++) - { - testAbortScript(); - if (orderedList[i].equals(attackerEntry)) - { - return true; - } - } - - return false; - } - - - public static int distributeIndividualContribution(obj_id victim, String playerString, int totalDamage, int point_type) throws InterruptedException - { - String[] parse = split(playerString, '-'); - obj_id killer = utils.stringToObjId(parse[0]); - - if (!isIdValid(killer) || !exists(killer)) - { - return 0; - } - - return distributeIndividualContribution(victim, killer, totalDamage, point_type); - } - - - public static int distributeIndividualContribution(obj_id victim, obj_id enemy, int totalDamage, int point_type) throws InterruptedException - { - if (!isIdValid(victim) || !exists(victim) || !isIdValid(enemy) || !exists(enemy)) - { - return 0; - } - - int targetRank = pvpGetCurrentGcwRank(enemy); - int selfRank = pvpGetCurrentGcwRank(victim); - int finalReward = (int) ((targetRank + selfRank) * (GCW_PLAYER_PVP_MODIFIER) / 10); - - if (finalReward < 0) - { - return 0; - } - - boolean inRegion = verifyPvpRegionStatus(enemy); - - if (inRegion) - { - finalReward += (int) (finalReward * 0.5f); - } - - loot.rollRandomFactionalCollectible(victim, enemy, selfRank); - - obj_id relic = loot.chroniclesPvpLootDrop(enemy); - - finalReward = addToDailyGcwPointAllotment(victim, enemy, finalReward); - String information = getName(victim); - - grantModifiedGcwPoints(victim, enemy, finalReward, true, point_type, information); - - dictionary webster = new dictionary(); - webster.put("victim", victim); - webster.put("victimRank", selfRank); - messageTo(enemy, "recivedGcwCreditForKill", webster, 0.0f, false); - - return finalReward; - } - - - public static int addToDailyGcwPointAllotment(obj_id victim, obj_id killer, int gcwPoint) throws InterruptedException - { - Vector dailyKills = new Vector(); - dailyKills.setSize(0); - - if (utils.hasResizeableStringBatchObjVar(victim, LIST_DAILY_KILL_VALUES)) - { - dailyKills = utils.getResizeableStringBatchObjVar(victim, LIST_DAILY_KILL_VALUES); - utils.removeBatchObjVar(victim, LIST_DAILY_KILL_VALUES); - } - - int targetRank = pvpGetCurrentGcwRank(killer); - int selfRank = pvpGetCurrentGcwRank(victim); - int maxInterval = (int) (targetRank + selfRank) * GCW_PLAYER_PVP_MODIFIER; - int positionInArray = findAttackerInArray(dailyKills, killer); - - if (positionInArray == -1) - { - if (gcwPoint > maxInterval) - { - gcwPoint = maxInterval; - } - - String newEntry = packKillerDailyPoints(killer, 1, getGameTime()); - - utils.addElement(dailyKills, newEntry); - } - else - { - int accruedPoints = getAccruedPoints(((String)(dailyKills.get(positionInArray)))); - int timeAtFirstAward = getTimeOfFirstAward(((String)(dailyKills.get(positionInArray)))); - gcwPoint = gcwPoint > maxInterval ? maxInterval : gcwPoint; - - if (getGameTime() > timeAtFirstAward + 86400) - { - timeAtFirstAward = getGameTime(); - accruedPoints = 1; - } - else - { - accruedPoints++; - - if (accruedPoints > 4) - { - gcwPoint = (int)(gcwPoint * 0.5f); - } - else - { - gcwPoint = (int)(gcwPoint * (float)((10.0f - ((float)accruedPoints - 1.0f)) / 10.0f)); - } - } - - String newEntry = packKillerDailyPoints(killer, accruedPoints, timeAtFirstAward); - - dailyKills.set(positionInArray, newEntry); - } - - utils.setResizeableBatchObjVar(victim, LIST_DAILY_KILL_VALUES, dailyKills); - return gcwPoint; - } - - - public static void removeDayOldEntries(obj_id player) throws InterruptedException - { - if (!utils.hasResizeableStringBatchObjVar(player, LIST_DAILY_KILL_VALUES)) - { - return; - } - - Vector dailyList = utils.getResizeableStringBatchObjVar(player, LIST_DAILY_KILL_VALUES); - - utils.removeBatchObjVar(player, LIST_DAILY_KILL_VALUES); - int dayPast = getGameTime() - 86400; - - for (int i = 0; i < dailyList.size(); i++) - { - testAbortScript(); - String[] parse = split(((String)(dailyList.get(i))), '-'); - int timeHack = utils.stringToInt(parse[2]); - - if (dayPast > timeHack) - { - utils.removeElementAt(dailyList, i); - } - } - - utils.setResizeableBatchObjVar(player, LIST_DAILY_KILL_VALUES, dailyList); - } - - - public static String packKillerDailyPoints(obj_id player, int gcwPoint, int time) throws InterruptedException - { - return ("" + player + "-" + gcwPoint + "-" + time); - } - - - public static int getTimeOfFirstAward(String killRecord) throws InterruptedException - { - String[] parse = split(killRecord, '-'); - - return utils.stringToInt(parse[2]); - } - - - public static int getAccruedPoints(Vector attackList, obj_id attacker) throws InterruptedException - { - if (attackList == null || attackList.size() == 0) - { - return 0; - } - - for (int i = 0; i < attackList.size(); i++) - { - testAbortScript(); - String[] splitEntry = split(((String)(attackList.get(i))), '-'); - obj_id idAtPoint = utils.stringToObjId(splitEntry[0]); - - if (idAtPoint == attacker) - { - return utils.stringToInt(splitEntry[1]); - } - } - - return 0; - } - - - public static int getAccruedPoints(String killRecord) throws InterruptedException - { - String[] parse = split(killRecord, '-'); - - return utils.stringToInt(parse[1]); - } - - - public static void grantModifiedGcwPoints(obj_id victim, obj_id[] attackers, boolean pvpKill, int point_type, String information) throws InterruptedException - { - if (!isIdValid(victim)) - { - return; - } - - if (attackers == null || attackers.length == 0) - { - return; - } - - for (int i = 0; i < attackers.length; i++) - { - testAbortScript(); - if (isIdValid(attackers[i]) && exists(attackers[i]) && getDistance(victim, attackers[i]) < 120.0f) - { - grantModifiedGcwPoints(victim, attackers[i], pvpKill, point_type, information); - } - } - } - - - public static void grantModifiedGcwPoints(obj_id attacker, int pointValue, int point_type, String information) throws InterruptedException - { - pointValue = getModifiedGcwPointValue(attacker, pointValue); - _grantGcwPoints(null, attacker, pointValue, false, point_type, information); - } - - - public static void grantModifiedGcwPoints(obj_id victim, obj_id attacker, boolean pvpKill, int point_type, String information) throws InterruptedException - { - int pointValue = getNpcKillCredit(victim, attacker); - - grantModifiedGcwPoints(victim, attacker, pointValue, pvpKill, point_type, information); - } - - - public static void grantModifiedGcwPoints(obj_id victim, obj_id attacker, int pointValue, boolean pvpKill, int point_type, String information) throws InterruptedException - { - pointValue = getModifiedGcwPointValue(attacker, pointValue); - _grantGcwPoints(victim, attacker, pointValue, pvpKill, point_type, information); - } - - - public static void grantUnmodifiedGcwPoints(obj_id attacker, int pointValue) throws InterruptedException - { - _grantGcwPoints(null, attacker, pointValue, false, -1, ""); - } - - - public static void _grantGcwPoints(obj_id victim, obj_id attacker, int pointValue, boolean pvpKill, int pointType, String information) throws InterruptedException - { - if (!isIdValid(attacker) || !exists(attacker) || pointValue < 1 || pet_lib.isPet(victim)) - { - return; - } - - pvpModifyCurrentGcwPoints(attacker, pointValue); - - prose_package pp = new prose_package(); - - pp.target.set(getName(victim)); - pp.digitInteger = pointValue; - - if (pvpKill) - { - pp.stringId = SID_PVP_KILL_POINT_GRANT; - sendSystemMessageProse(attacker, pp); - } - else - { - pp.stringId = SID_GENERIC_POINT_GRANT; - sendSystemMessageProse(attacker, pp); - } - - doGcwPointCsLogging(attacker, pointValue, pointType, information); - gcwInvasionCreditForGCW(attacker, pointValue); - grantGcwPointsToRegion(attacker, pointValue, pointType); - - testGcwPointCheating(attacker, pointType); - } - - - public static void testGcwPointCheating(obj_id player, int pointType) throws InterruptedException - { - int testTime = utils.getIntScriptVar(player, "gcw.lastCheatingTestTime"); - location loc = utils.getLocationScriptVar(player, "gcw.lastCheatingLocation"); - - if (testTime <= 0 || loc == null) - { - loc = getLocation(player); - - utils.setScriptVar(player, "gcw.lastCheatingTestTime", getGameTime()); - utils.setScriptVar(player, "gcw.lastCheatingLocation", loc); - - return; - } - - float distance = getDistance(loc, getLocation(player)); - - if (distance > 5.0f) - { - loc = getLocation(player); - - utils.setScriptVar(player, "gcw.lastCheatingTestTime", getGameTime()); - utils.setScriptVar(player, "gcw.lastCheatingLocation", loc); - - return; - } - - int timeDelta = getGameTime() - testTime; - - if (timeDelta >= 30) - { - String pointTypeTitle = ""; - - switch(pointType) - { - case GCW_POINT_TYPE_GROUND_PVE: - pointTypeTitle = "GCW_points_ground_pve"; - break; - case GCW_POINT_TYPE_GROUND_PVP: - pointTypeTitle = "GCW_points_ground_pvp"; - break; - case GCW_POINT_TYPE_GROUND_PVP_REGION: - pointTypeTitle = "GCW_points_ground_pvp_region"; - break; - case GCW_POINT_TYPE_BASE_BUSTING: - pointTypeTitle = "GCW_points_player_base_busting"; - break; - case GCW_POINT_TYPE_SPACE_PVE: - pointTypeTitle = "GCW_points_space_pve"; - break; - case GCW_POINT_TYPE_SPACE_PVP: - pointTypeTitle = "GCW_points_space_pvp"; - break; - case GCW_POINT_TYPE_GROUND_QUEST: - pointTypeTitle = "GCW_points_ground_quest"; - default: - pointTypeTitle = "GCW_unknown"; - break; - } - - utils.setScriptVar(player, "gcw.lastCheatingTestTime", getGameTime()); - - boolean stealthed = stealth.getInvisBuff(player) != null; - - CustomerServiceLog("GCW_cheating", ",Player,"+ player + ",Name,"+ getName(player) + ",GCW Type,"+ pointTypeTitle + ",Location,"+ loc + ",Stealthed,"+ stealthed); - } - } - - - public static void doGcwPointCsLogging(obj_id player, int pointValue, int pointType, String information) throws InterruptedException - { - switch(pointType) - { - case GCW_POINT_TYPE_GROUND_PVE: - CustomerServiceLog("GCW_points_ground_pve", "%TU has acquired "+ pointValue + " points for defeating "+ information + " in pve action", player); - break; - case GCW_POINT_TYPE_GROUND_PVP: - CustomerServiceLog("GCW_points_ground_pvp", "%TU has acquired "+ pointValue + " points for defeating "+ information + " in combat", player); - break; - case GCW_POINT_TYPE_GROUND_PVP_REGION: - CustomerServiceLog("GCW_points_ground_pvp_region", "%TU has acquired "+ pointValue + " points in the "+ information + " battlefield region.", player); - break; - case GCW_POINT_TYPE_BASE_BUSTING: - CustomerServiceLog("GCW_points_player_base_busting", "%TU has acquired "+ pointValue + " points for destroying "+ information, player); - break; - case GCW_POINT_TYPE_SPACE_PVE: - CustomerServiceLog("GCW_points_space_pve", "%TU has acquired "+ pointValue + " points for destroying "+ information, player); - break; - case GCW_POINT_TYPE_SPACE_PVP: - CustomerServiceLog("GCW_points_space_pvp", "%TU has acquired "+ pointValue + " points for defeating "+ information + " in space combat", player); - break; - case GCW_POINT_TYPE_GROUND_QUEST: - CustomerServiceLog("GCW_points_ground_quest", "%TU has acquired "+ pointValue + " points for completing the "+ information + " groundquest", player); - default: - break; - } - } - - - public static String getGcwCategory(int pointType) throws InterruptedException - { - if (pointType < 0 || pointType >= GCW_POINT_TYPE_MAX) - { - return null; - } - - String pointCategory = pointTypes[pointType]; - String scene = getCurrentSceneName(); - - int sceneIndex = utils.getElementPositionInArray(validScenes, scene); - - if (sceneIndex < 0) - { - return null; - } - - return scene + "_" + pointCategory; - } - - - public static String getGcwRegion(obj_id target) throws InterruptedException - { - if (!isIdValid(target) || !exists(target)) - { - return null; - } - - region[] regionList = getRegionsAtPoint(getLocation(target)); - String regionName = ""; - - for (int i = 0, j = regionList.length; i < j; i++) - { - testAbortScript(); - region currentRegion = regionList[i]; - - if (currentRegion == null) - { - continue; - } - - String currentRegionName = currentRegion.getName(); - - if (currentRegionName != null && currentRegionName.length() > 0 && currentRegionName.startsWith("gcw_region")) - { - regionName = currentRegionName; - break; - } - } - - if (regionName.length() <= 0) - { - String scene = getCurrentSceneName(); - - int sceneIndex = utils.getElementPositionInArray(validScenes, scene); - - regionName = defaultRegions[sceneIndex]; - } - - return regionName; - } - - - public static void grantGcwPointsToRegion(obj_id player, int pointValue, int pointType) throws InterruptedException - { - if (!isIdValid(player) || pointValue < 0 || pointType < 0 || pointType >= GCW_POINT_TYPE_MAX) - { - return; - } - - String category = getGcwCategory(pointType); - - String regionName = getGcwRegion(player); - - if (category == null || category.length() <= 0 || regionName == null || regionName.length() <= 0) - { - return; - } - - if (factions.isImperial(player)) - { - - adjustGcwImperialScore("grantGcwPointsToRegion", category, pointValue); - - adjustGcwImperialScore("grantGcwPointsToRegion", regionName, pointValue); - - LOG("gcw_region_points", "Imperial gain. regionName: "+ regionName + " category: "+ category + " pointValue: "+ pointValue); - } - else if (factions.isRebel(player)) - { - - adjustGcwRebelScore("grantGcwPointsToRegion", category, pointValue); - - adjustGcwRebelScore("grantGcwPointsToRegion", regionName, pointValue); - - LOG("gcw_region_points", "Rebel gain. regionName: "+ regionName + " category: "+ category + " pointValue: "+ pointValue); - } - } - - - public static int getImperialPercentileByRegion(obj_id target) throws InterruptedException - { - if (!isIdValid(target) || !exists(target)) - { - return 50; - } - - String category = getGcwRegion(target); - - if (category == null || category.length() <= 0) - { - return 50; - } - - return getGcwImperialScorePercentile(category); - } - - - public static int getRebelPercentileByRegion(obj_id target) throws InterruptedException - { - return 100 - getImperialPercentileByRegion(target); - } - - - public static String getRegionFactionOwner(obj_id target) throws InterruptedException - { - String category = getGcwRegion(target); - - if (category == null || category.length() <= 0) - { - return null; - } - - int imperial = getImperialPercentileByRegion(target); - - if (imperial > 50) - { - return "imperial"; - } - - if (imperial < 50) - { - return "rebel"; - } - - return null; - } - - - public static int getImperialPlanetaryPercentage(String planet) throws InterruptedException - { - if (planet == null || planet.length() <= 0) - { - return 50; - } - - int sceneIndex = utils.getElementPositionInArray(validScenes, planet); - - if (sceneIndex < 0 || sceneIndex >= maxRegions.length) - { - return 50; - } - - int categories = maxRegions[sceneIndex]; - - float imperialPercentages = 0; - - for (int i = 1; i <= categories; i++) - { - testAbortScript(); - String category = "gcw_region_"+ planet + "_"+ i; - - imperialPercentages += getGcwImperialScorePercentile(category); - } - - return Math.round(imperialPercentages / categories); - } - - - public static int getRebelPlanetaryPercentage(String planet) throws InterruptedException - { - return 100 - getImperialPlanetaryPercentage(planet); - } - - - public static boolean verifyPvpRegionStatus(obj_id player) throws InterruptedException - { - obj_id region_controller = getPvpRegionControllerIdByPlayer(player); - - if (!isIdValid(region_controller)) - { - return false; - } - - utils.setScriptVar(player, PVP_REGION_ACTIVITY_PERFORMED, true); - - return true; - } - - - public static int getNpcKillCredit(obj_id npc, obj_id player) throws InterruptedException - { - if (isPlayer(npc) || pet_lib.isPet(npc)) - { - return 0; - } - - String faction = factions.getFaction(npc); - - if (faction == null || faction.equals("")) - { - return 0; - } - - if (!faction.equals("Rebel") && !faction.equals("Imperial")) - { - return 0; - } - - if (faction.equals("Rebel") && !factions.isImperial(player)) - { - return 0; - } - - if (faction.equals("Imperial") && !factions.isRebel(player)) - { - return 0; - } - - double npcLev = (double) getLevel(npc); - double playLev = (double) getLevel(player); - - if ((npcLev / playLev) < MIN_NPC_LEVEL_RATIO_LIMIT) - { - return 0; - } - - int difficultyClass = getIntObjVar(npc, "difficultyClass"); - - switch(difficultyClass) - { - case 0: - return NORMAL_GCW_VALUE; - case 1: - return ELITE_GCW_VALUE; - case 2: - return BOSS_GCW_VALUE; - default: - return 0; - } - } - - - public static int getModifiedGcwPointValue(obj_id player, int passedValue) throws InterruptedException - { - float mod = 1.0f; - - if (utils.hasScriptVar(player, "buff.xpBonus.value")) - { - mod += utils.getFloatScriptVar(player, "buff.xpBonus.value"); - } - - if (utils.hasScriptVar(player, "buff.xpBonusGeneral.value")) - { - mod += utils.getFloatScriptVar(player, "buff.xpBonusGeneral.value"); - } - - if (utils.hasScriptVar(player, "buff.gcwBonusGeneral.value")) - { - mod += utils.getFloatScriptVar(player, "buff.gcwBonusGeneral.value"); - } - - if (isSpaceBattlefieldZone()) - { - mod += .1f; - } - - return (int) (mod * passedValue); - } - - - public static void registerPvpRegionControllerWithPlanet(obj_id controlObject, String regionName) throws InterruptedException - { - obj_id planetId = getPlanetByName(getLocation(controlObject).area); - - utils.setScriptVar(planetId, REGION_CONTROLLER + "."+ regionName, controlObject); - } - - - public static obj_id getPvpRegionControllerIdByName(obj_id player, String regionName) throws InterruptedException - { - obj_id planetId = getPlanetByName(getLocation(player).area); - String packedRegion = REGION_CONTROLLER + "."+ regionName; - - return utils.hasScriptVar(planetId, packedRegion) ? utils.getObjIdScriptVar(planetId, packedRegion) : null; - } - - - public static obj_id getPvpRegionControllerIdByPlayer(obj_id player) throws InterruptedException - { - region[] regionList = getRegionsAtPoint(getLocation(player)); - obj_id planetId = getPlanetByName(getLocation(player).area); - obj_id regionController = null; - - if (regionList == null || regionList.length == 0) - { - return null; - } - - for (int i = 0; i < regionList.length; i++) - { - testAbortScript(); - String regionName = regionList[i].getName(); - String packedRegion = REGION_CONTROLLER + "."+ regionName; - - if (utils.hasScriptVar(planetId, packedRegion)) - { - regionController = utils.getObjIdScriptVar(planetId, packedRegion); - } - } - - return regionController; - } - - - public static void notifyPvpRegionControllerOfPlayerEnter(obj_id controllerId, obj_id player) throws InterruptedException - { - dictionary dict = new dictionary(); - - dict.put("player", player); - messageTo(controllerId, "newPlayerNotify", dict, 0, false); - - doLogging("GCW_points_ground_pvp", "notifyPvpRegionControllerOfPlayerEnter"+ getName(player) + "/"+ player + " has entered the region. Notifying controller object "+ controllerId); - } - - - public static void makeBattlefieldRegion(obj_id controller) throws InterruptedException - { - if (!isIdValid(controller)) - { - doLogging("GCW_points_ground_pvp", "makeBattlefieldRegion controller not valid"); - return; - } - - String regionName = getBattlefieldRegionName(controller); - - if (regionName == null || regionName.length() < 1) - { - doLogging("GCW_points_ground_pvp", "makeBattlefieldRegion regionName invalid"); - return; - } - - location whereIam = getLocation(controller); - - region battlefieldRegion = getRegion(whereIam.area, regionName); - - if (battlefieldRegion != null) - { - doLogging("GCW_points_ground_pvp", "makeBattlefieldRegion registerPvpRegionControllerWithPlanet battlefieldRegion exists"); - registerPvpRegionControllerWithPlanet(controller, regionName); - return; - } - - doLogging("GCW_points_ground_pvp", "makeBattlefieldRegion registerPvpRegionControllerWithPlanet failed"); - } - - - public static void makePushbackRegion(obj_id controller) throws InterruptedException - { - if (!isIdValid(controller)) - { - doLogging("GCW_points_ground_pvp", "makePushbackRegion controller not valid"); - return; - } - - String regionName = getPushbackRegionName(controller); - - if (regionName == null || regionName.length() < 1) - { - doLogging("GCW_points_ground_pvp", "makePushbackRegion regionName invalid"); - return; - } - - location whereIam = getLocation(controller); - - region pushbackRegion = getRegion(whereIam.area, regionName); - - if (pushbackRegion != null) - { - doLogging("GCW_points_ground_pvp", "makePushbackRegion registerPvpRegionControllerWithPlanet pushbackRegion exists"); - registerPvpRegionControllerWithPlanet(controller, regionName); - return; - } - - doLogging("GCW_points_ground_pvp", "makePushbackRegion registerPvpRegionControllerWithPlanet failed"); - } - - - public static obj_id getPushbackControllerByPlayer(obj_id player) throws InterruptedException - { - return getPvpRegionControllerIdByPlayer(player); - } - - - public static void grantSpacePvpKillCredit(obj_id defender, obj_id[] attackers) throws InterruptedException - { - Vector validAttackers = new Vector(); - validAttackers.setSize(0); - - for (int i = 0; i < attackers.length; i++) - { - testAbortScript(); - if (factions.isImperial(defender)) - { - if (factions.isRebel(attackers[i]) && validateSpaceTier(defender, attackers[i])) - { - utils.addElement(validAttackers, attackers[i]); - } - else - { - LOG("doLogging", "Faction or tier error"); - } - } - if (factions.isRebel(defender)) - { - if (factions.isImperial(attackers[i]) && validateSpaceTier(defender, attackers[i])) - { - utils.addElement(validAttackers, attackers[i]); - } - else - { - LOG("doLogging", "Faction or tier error"); - } - } - } - - if (validAttackers == null || validAttackers.size() < 1) - { - return; - } - - for (int k = 0; k < validAttackers.size(); k++) - { - testAbortScript(); - String packedAttacker = ""+ ((obj_id)(validAttackers.get(k))) + "-"+ 1; - int reward = distributeIndividualContribution(defender, packedAttacker, validAttackers.size(), GCW_POINT_TYPE_SPACE_PVP); - - pvpModifyCurrentPvpKills(((obj_id)(validAttackers.get(k))), 1); - } - } - - - public static boolean validateSpaceTier(obj_id defender, obj_id attacker) throws InterruptedException - { - int defLevel = space_flags.getPilotTier(defender); - int atkLevel = space_flags.getPilotTier(attacker); - - switch(defLevel) - { - case 0: - return false; - case 1: - if (atkLevel > 2) - { - return false; - } - case 2: - if (atkLevel > 3) - { - return false; - } - case 3: - break; - case 4: - break; - case 5: - break; - } - - return true; - } - - - public static int getSpaceKillCredit(int player_level, String targetTier) throws InterruptedException - { - double pointGrant = 0.0; - double pointIncriment = SPACE_GCW_VALUE; - - switch(player_level) - { - case 1: - if (targetTier.equals("tier1")) - { - pointGrant = pointIncriment; - } - if (targetTier.equals("tier2") || targetTier.equals("tier3") || targetTier.equals("tier4") || targetTier.equals("tier5")) - { - pointGrant = pointIncriment * 1.5; - } - break; - case 2: - if (targetTier.equals("tier1")) - { - pointGrant = (pointIncriment * 2) / 2; - } - - if (targetTier.equals("tier2")) - { - pointGrant = pointIncriment * 2; - } - - if (targetTier.equals("tier3") || targetTier.equals("tier4") || targetTier.equals("tier5")) - { - pointGrant = pointIncriment * 2.5; - } - break; - case 3: - if (targetTier.equals("tier2")) - { - pointGrant = (pointIncriment * 3) / 2; - } - - if (targetTier.equals("tier3")) - { - pointGrant = pointIncriment * 3; - } - - if (targetTier.equals("tier4") || targetTier.equals("tier5")) - { - pointGrant = pointIncriment * 3.5; - } - break; - case 4: - if (targetTier.equals("tier3")) - { - pointGrant = (pointIncriment * 4) / 2; - } - - if (targetTier.equals("tier4")) - { - pointGrant = pointIncriment * 4; - } - - if (targetTier.equals("tier5")) - { - pointGrant = pointIncriment * 4.5; - } - break; - case 5: - if (targetTier.equals("tier4")) - { - pointGrant = (pointIncriment * 5) / 2; - } - - if (targetTier.equals("tier5")) - { - pointGrant = pointIncriment * 5; - } - - break; - - default: - break; - } - - return (int) pointGrant; - } - - - public static void grantBaseDestructionPoints(obj_id base) throws InterruptedException - { - obj_id[] interiorPlayers = trial.getPlayersInDungeon(base); - obj_id[] exteriorPlayers = getPlayerCreaturesInRange(getLocation(base), 120.0f); - - String baseFac = factions.getFaction(base); - - if (baseFac == null || (!baseFac.equals("Rebel") && !baseFac.equals("Imperial"))) - { - CustomerServiceLog("GCW_points_player_base_busting", "Base("+ getName(base) + "/"+ base + "/"+ baseFac + ") did not have a Rebel or Imperial faction"); - return; - } - - Vector filteredList = new Vector(); - filteredList.setSize(0); - - if (interiorPlayers != null && interiorPlayers.length > 0) - { - for (int i = 0; i < interiorPlayers.length; i++) - { - testAbortScript(); - if (isIdValid(interiorPlayers[i]) && exists(interiorPlayers[i])) - { - String playerFac = factions.getFaction(interiorPlayers[i]); - - if (playerFac == null) - { - continue; - } - - if (baseFac.equals("Rebel") && playerFac.equals("Imperial")) - { - utils.addElement(filteredList, interiorPlayers[i]); - } - - if (baseFac.equals("Imperial") && playerFac.equals("Rebel")) - { - utils.addElement(filteredList, interiorPlayers[i]); - } - } - } - } - - if (exteriorPlayers != null && exteriorPlayers.length > 0) - { - for (int k = 0; k < exteriorPlayers.length; k++) - { - testAbortScript(); - if (isIdValid(exteriorPlayers[k]) && exists(exteriorPlayers[k])) - { - String playerFac = factions.getFaction(exteriorPlayers[k]); - - if (playerFac == null) - { - continue; - } - - if (baseFac.equals("Rebel") && playerFac.equals("Imperial")) - { - if (filteredList.size() > 0) - { - if (utils.getElementPositionInArray(filteredList, exteriorPlayers[k]) == -1) - { - utils.addElement(filteredList, exteriorPlayers[k]); - } - - } - else - { - utils.addElement(filteredList, exteriorPlayers[k]); - } - } - - if (baseFac.equals("Imperial") && playerFac.equals("Rebel")) - { - if (filteredList.size() > 0) - { - if (utils.getElementPositionInArray(filteredList, exteriorPlayers[k]) == -1) - { - utils.addElement(filteredList, exteriorPlayers[k]); - } - } - else - { - utils.addElement(filteredList, exteriorPlayers[k]); - } - } - } - } - } - - String table = GCW_PLAYER_BASE_POINT_VALUE; - - if (!dataTableOpen(table)) - { - CustomerServiceLog("GCW_points_player_base_busting", "Could not open the "+ GCW_PLAYER_BASE_POINT_VALUE + " data table"); - return; - } - - String template = getTemplateName(base); - int value = dataTableGetInt(table, template, "point_value"); - - if (value < -1) - { - CustomerServiceLog("GCW_points_player_base_busting", "template "+ template + " could not be found in the dataTable "+ GCW_PLAYER_BASE_POINT_VALUE); - return; - } - value *= GCW_PLAYER_BASE_DESTRUCTION; - - if (filteredList == null || filteredList.size() == 0) - { - CustomerServiceLog("GCW_points_player_base_busting", "There are no valid players in the filtered list"); - return; - } - for (int j = 0; j < filteredList.size(); j++) - { - testAbortScript(); - grantModifiedGcwPoints(((obj_id)(filteredList.get(j))), value, gcw.GCW_POINT_TYPE_BASE_BUSTING, template); - } - } - - - public static int getGcwGroundQuestAward(obj_id player, int quest_tier) throws InterruptedException - { - if (!factions.isImperial(player) && !factions.isRebel(player)) - { - return 0; - } - - float tierValue = getGroundQuestTierBonus(quest_tier); - - int rank = pvpGetCurrentGcwRank(player); - String gcwRankTable = "datatables/gcw/gcw_rank.iff"; - - int rankCapBase = dataTableGetInt(gcwRankTable, 0, "RatingEarningCap"); - int rankCap = dataTableGetInt(gcwRankTable, rank - 1, "RatingEarningCap"); - - float groundQuestGcwValue = tierValue * 5000; - float capDeltaBonus = rankCapBase / rankCap; - - groundQuestGcwValue *= capDeltaBonus; - - return (int) groundQuestGcwValue; - } - - - public static float getGroundQuestTierBonus(int quest_tier) throws InterruptedException - { - float tierValue = 0.0f; - - switch(quest_tier) - { - case 1: - tierValue = 0.03f; - break; - case 2: - tierValue = 0.039f; - break; - case 3: - tierValue = 0.047f; - break; - case 4: - tierValue = 0.054f; - break; - case 5: - tierValue = 0.06f; - break; - default: - break; - } - - return tierValue; - } - - - public static void doLogging(String section, String message) throws InterruptedException - { - CustomerServiceLog(section, message); - } - - - public static region getPvPRegion(obj_id controller) throws InterruptedException - { - region[] regions = getRegionsAtPoint(getLocation(controller)); - - if (regions == null || regions.length == 0) - { - return null; - } - - region pvpRegion = null; - - for (int i = 0; i < regions.length; i++) - { - testAbortScript(); - if (isNotifyRegion(regions[i])) - { - pvpRegion = regions[i]; - } - } - - return pvpRegion; - } - - - public static void getRegionToRegister(obj_id controller) throws InterruptedException - { - if (!isIdValid(controller)) - { - return; - } - - region pvpRegion = getPvPRegion(controller); - - if (pvpRegion == null) - { - return; - } - - String regionName = pvpRegion.getName(); - - if (regionName != null) - { - utils.setScriptVar(controller, "pvp_region", regionName); - - registerPvpRegionControllerWithPlanet(controller, regionName); - } - - return; - } - - - public static boolean isPlayerValidOnBattlefield(obj_id player, obj_id controller) throws InterruptedException - { - return true; - } - - - public static String getBattlefieldRegionName(obj_id controller) throws InterruptedException - { - if (!isIdValid(controller)) - { - return null; - } - - location loc = getLocation(controller); - - if (loc == null) - { - return null; - } - - return PVP_BATTLEFIELD_REGION + "_" + loc.x + "_" + loc.z; - } - - - public static String getPushbackRegionName(obj_id controller) throws InterruptedException - { - if (!isIdValid(controller)) - { - return null; - } - - location loc = getLocation(controller); - - if (loc == null) - { - return null; - } - - return PVP_PUSHBACK_REGION + "_" + loc.x + "_" + loc.z; - } - - - public static boolean canEntertainGcwNonPlayingCharacter(obj_id player, obj_id npc) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(npc) || !exists(npc)) - { - return false; - } - - if (!factions.isSameFactionorFactionHelper(player, npc)) - { - return false; - } - - String entertainerFaction = factions.getFaction(player); - if ((!factions.isImperialHelper(player) && !factions.isRebelHelper(player) && (entertainerFaction == null || entertainerFaction.length() <= 0))) - { - - sendSystemMessage(player, SID_YOU_NEED_TO_BE_COMBATANT); - doAnimationAction (npc, "shake_head_no"); - return false; - } - - if (!groundquests.isQuestActive(player, GCW_ENTERTAINER_PATROL_QUEST)) - { - sendSystemMessage(player, SID_YOU_NEED_ENTERTAINMENT_QUEST); - return false; - } - - if (buff.hasBuff(npc, GCW_NPC_ENTERTAINED_BUFF)) - { - return false; - } - - return true; - } - - - public static boolean setEntertainGcwNonPlayerCharacter(obj_id player, obj_id npc) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(npc) || !exists(npc)) - { - return false; - } - if (!canEntertainGcwNonPlayingCharacter(player, npc)) - { - return false; - } - - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - flags |= sui.CD_EVENT_COMBAT; - flags |= sui.CD_EVENT_LOCOMOTION; - flags |= sui.CD_EVENT_STEALTHED; - - stealth.testInvisNonCombatAction(player, npc); - - utils.setScriptVar(player, GCW_SCRIPTVAR_PARENT + ".playerEntertainmentStart", getGameTime()); - utils.setScriptVar(player, GCW_SCRIPTVAR_PARENT + ".gcwNpc", npc); - utils.setScriptVar(npc, GCW_SCRIPTVAR_PARENT + ".isGcwEntertained", 1); - LOG("gcw_entertainer","gcwNpc: "+npc); - - int pid = sui.smartCountdownTimerSUI(player, player, "quest_countdown_timer", SID_ENTERTAIN_TROOPS_TIMER, 0, GCW_ENTERTAINMENT_TIME, "handleEntertainingGcwTroops", 0, flags); - sui.setPid(player, pid, ENTERTAIN_GCW_TROOPS_PID); - - return true; - } - - - public static boolean canGcwObjectBeRepaired(obj_id object) throws InterruptedException - { - LOG("gcw_patrol_point","canGcwObjectBeRepaired"); - - if (!isValidId(object) || !exists(object)) - { - return false; - } - - if (hasObjVar(object, "repairCount") && getIntObjVar(object, "repairCount") >= REPAIR_COUNT_MAX) - { - return false; - } - - int currentHp = getHitpoints(object); - if (currentHp <= 0) - { - return false; - } - - int maxHp = getMaxHitpoints(object); - if (maxHp <= 0) - { - return false; - } - - if (currentHp == maxHp) - { - return false; - } - - int threshold = maxHp - currentHp >= GCW_REPAIR_AMOUNT ? GCW_REPAIR_AMOUNT : 0; - - if (threshold <= 0) - { - return false; - } - - LOG("gcw_patrol_point","canGcwObjectBeRepaired passed all validation"); - - return true; - } - - - public static boolean useGcwObjectForQuest(obj_id player, obj_id gcwObject, String questName) throws InterruptedException - { - LOG("gcw_patrol_point","useGcwObjectForQuest init"); - - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(gcwObject) || !exists(gcwObject)) - { - return false; - } - - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_LOCOMOTION; - flags |= sui.CD_EVENT_STEALTHED; - - stealth.testInvisNonCombatAction(player, gcwObject); - - int timeToRepair = 10 + getFatigueTimerMod(player); - - if (timeToRepair > GCW_FATIGUE_TIMER_MAX) - { - timeToRepair = GCW_FATIGUE_TIMER_MAX; - } - - if (questName.equals(GCW_SPY_PATROL_DESTROY_QUEST)) - { - timeToRepair = 5; - - if (isGod(player)) - { - timeToRepair = 3; - } - - LOG("gcw_patrol_point","useGcwObjectForQuest sending to messageHandler handleOpposingFactionDestroyQuest"); - - utils.setScriptVar(player, "spyPatrolPoint", gcwObject); - int pid = sui.smartCountdownTimerSUI(player, player, "quest_countdown_timer", SID_DESTROY_PP_TIMER, 0, timeToRepair, "handleOpposingFactionDestroyQuest", 0, flags); - sui.setPid(player, pid, gcw.SPY_DESTROY_PID); - } - else if (questName.equals(GCW_SPY_PATROL_SCOUT_QUEST)) - { - timeToRepair = 5; - - if (isGod(player)) - { - timeToRepair = 3; - } - - LOG("gcw_patrol_point","useGcwObjectForQuest sending to messageHandler handleOpposingFactionScoutQuest"); - utils.setScriptVar(player, "spyPatrolPoint", gcwObject); - - int pid = sui.smartCountdownTimerSUI(player, player, "quest_countdown_timer", SID_SCOUT_PP_TIMER, 0, timeToRepair, "handleOpposingFactionScoutQuest", 0, flags); - sui.setPid(player, pid, gcw.SPY_SCOUT_PID); - } - else if (questName.equals(GCW_REPAIR_PATROL_QUEST)) - { - if (isGod(player)) - { - timeToRepair = 3; - } - - LOG("gcw_patrol_point","useGcwObjectForQuest sending to messageHandler handleTraderRepairQuest"); - utils.setScriptVar(player, gcw.OBJECT_TO_REPAIR, gcwObject); - utils.setScriptVar(player, gcw.GCW_REPAIR_QUEST, gcw.GCW_REPAIR_PATROL_QUEST); - utils.setScriptVar(player, gcw.GCW_REPAIR_RESOURCE_COUNT, gcw.GCW_RESOURCE_COUNT_PATROL); - int pid = sui.smartCountdownTimerSUI(player, player, "quest_countdown_timer", SID_REPAIR_PP_TIMER, 0, timeToRepair, "handleTraderRepairQuest", 0, flags); - sui.setPid(player, pid, gcw.TRADER_REPAIR_PID); - } - else if (questName.equals(GCW_REPAIR_TURRET_QUEST)) - { - if (isGod(player)) - { - timeToRepair = 3; - } - - LOG("gcw_patrol_point","useGcwObjectForQuest sending to messageHandler handleTraderRepairQuest"); - utils.setScriptVar(player, gcw.OBJECT_TO_REPAIR, gcwObject); - utils.setScriptVar(player, gcw.GCW_REPAIR_QUEST, gcw.GCW_REPAIR_TURRET_QUEST); - utils.setScriptVar(player, gcw.GCW_REPAIR_RESOURCE_COUNT, gcw.GCW_RESOURCE_COUNT_TURRET); - int pid = sui.smartCountdownTimerSUI(player, player, "quest_countdown_timer", SID_REPAIR_PP_TIMER, 0, timeToRepair, "handleTraderRepairQuest", 0, flags); - sui.setPid(player, pid, gcw.TRADER_REPAIR_PID); - } - else if (questName.equals(GCW_REPAIR_BARRICADE_QUEST)) - { - if (isGod(player)) - { - timeToRepair = 3; - } - - LOG("gcw_patrol_point","useGcwObjectForQuest sending to messageHandler handleTraderRepairQuest"); - utils.setScriptVar(player, gcw.OBJECT_TO_REPAIR, gcwObject); - utils.setScriptVar(player, gcw.GCW_REPAIR_QUEST, gcw.GCW_REPAIR_BARRICADE_QUEST); - utils.setScriptVar(player, gcw.GCW_REPAIR_RESOURCE_COUNT, gcw.GCW_RESOURCE_COUNT_BARRICADE); - int pid = sui.smartCountdownTimerSUI(player, player, "quest_countdown_timer", SID_REPAIR_PP_TIMER, 0, timeToRepair, "handleTraderRepairQuest", 0, flags); - sui.setPid(player, pid, gcw.TRADER_REPAIR_PID); - } - else if (questName.equals(GCW_REPAIR_VEHICLE_PATROL_QUEST)) - { - if (isGod(player)) - { - timeToRepair = 3; - } - - LOG("gcw_patrol_point","useGcwObjectForQuest sending to messageHandler handleTraderRepairQuest"); - utils.setScriptVar(player, gcw.OBJECT_TO_REPAIR, gcwObject); - utils.setScriptVar(player, gcw.GCW_REPAIR_QUEST, gcw.GCW_REPAIR_VEHICLE_PATROL_QUEST); - utils.setScriptVar(player, gcw.GCW_REPAIR_RESOURCE_COUNT, gcw.GCW_RESOURCE_COUNT_VEHICLE); - int pid = sui.smartCountdownTimerSUI(player, player, "quest_countdown_timer", SID_REPAIR_PP_TIMER, 0, timeToRepair, "handleTraderRepairQuest", 0, flags); - sui.setPid(player, pid, gcw.TRADER_REPAIR_PID); - } - else if (questName.equals(GCW_REPAIR_DAMAGED_VEHICLE_QUEST)) - { - if (isGod(player)) - { - timeToRepair = 3; - } - - LOG("gcw_patrol_point","useGcwObjectForQuest sending to messageHandler handleTraderRepairQuest"); - utils.setScriptVar(player, gcw.OBJECT_TO_REPAIR, gcwObject); - utils.setScriptVar(player, gcw.GCW_REPAIR_QUEST, gcw.GCW_REPAIR_DAMAGED_VEHICLE_QUEST); - utils.setScriptVar(player, gcw.GCW_REPAIR_RESOURCE_COUNT, gcw.GCW_RESOURCE_COUNT_DAMAGED_VEHICLE); - int pid = sui.smartCountdownTimerSUI(player, player, "quest_countdown_timer", SID_REPAIR_PP_TIMER, 0, timeToRepair, "handleTraderRepairQuest", 0, flags); - sui.setPid(player, pid, gcw.TRADER_REPAIR_PID); - } - else if (questName.equals(GCW_MEDIC_HEAL_QUEST)) - { - if (isGod(player)) - { - timeToRepair = 3; - } - - LOG("gcw_patrol_point","useGcwObjectForQuest sending to messageHandler handleTraderRepairQuest"); - utils.setScriptVar(player, OBJECT_TO_REPAIR, gcwObject); - utils.setScriptVar(player, GCW_REPAIR_QUEST, GCW_MEDIC_HEAL_QUEST); - utils.setScriptVar(player, GCW_REPAIR_RESOURCE_COUNT, GCW_RESOURCE_COUNT_DAMAGED_VEHICLE); - int pid = sui.smartCountdownTimerSUI(player, player, "quest_countdown_timer", SID_HEAL_PP_TIMER, 0, timeToRepair, "handleTraderRepairQuest", 0, flags); - sui.setPid(player, pid, gcw.TRADER_REPAIR_PID); - } - - return true; - } - - - public static boolean repairGcwObject(obj_id object, obj_id player, int resourceCount) throws InterruptedException - { - if (!isValidId(object) || !exists(object)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (resourceCount <= 0) - { - return false; - } - - if (hasObjVar(object, GCW_OBJECT_REPAIR_COUNT) && getIntObjVar(object, GCW_OBJECT_REPAIR_COUNT) >= REPAIR_COUNT_MAX) - { - return false; - } - - if (!isMob(object)) - { - int currentHp = getHitpoints(object); - - if (currentHp <= 0) - { - return false; - } - - int maxHp = getMaxHitpoints(object); - - if (maxHp <= 0) - { - return false; - } - - int threshold = maxHp - currentHp > resourceCount ? resourceCount : 0; - - if (threshold <= 0) - { - sendSystemMessage(player, SID_DOESNT_NEED_REPAIR); - return false; - } - - double subtract = resourceCount * .2f; - - if ((int)subtract <= 0) - { - return false; - } - - setMaxHitpoints(object, maxHp - (int)subtract); - setHitpoints(object, currentHp + (int)(resourceCount * .8f)); - } - - int repairCount = getIntObjVar(object, GCW_OBJECT_REPAIR_COUNT); - - setObjVar(object, GCW_OBJECT_REPAIR_COUNT, repairCount + 1); - - messageTo(object, "repairComplete", null, 1.0f, false); - - return true; - } - - - public static void playQuestIconParticle(obj_id self) throws InterruptedException - { - dictionary params = new dictionary(); - - location loc = getLocation(self); - - params.put("particleLoc", loc); - - int playIconTime = getGameTime(); - - params.put("iconMessageTime", playIconTime); - - utils.setScriptVar(self, "iconMessageTime", playIconTime); - - messageTo(self, "playQuestIcon", params, 1.0f, false); - } - - - public static void playQuestIconHandler(obj_id self, dictionary params) throws InterruptedException - { - int playIconTime = utils.getIntScriptVar(self, "iconMessageTime"); - - int messageTime = params.getInt("iconMessageTime"); - - if (playIconTime != messageTime) - { - return; - } - - location loc = params.getLocation("particleLoc"); - - float offset = params.getFloat("offset"); - - if (loc != null) - { - String particleName = utils.getStringScriptVar(self, "gcwQuestIcon"); - - if (particleName != null && particleName.length() > 0) - { - playClientEffectLoc(self, "appearance/"+ particleName, loc, offset); - } - else - { - playClientEffectLoc(self, "appearance/pt_icon_quest_red.prt", loc, offset); - } - - playIconTime = getGameTime(); - - params.put("iconMessageTime", playIconTime); - - utils.setScriptVar(self, "iconMessageTime", playIconTime); - - messageTo(self, "playQuestIcon", params, 6.0f, false); - } - } - - - public static boolean signalAllParticipantsForDamage(obj_id victimObject, String questName, String signalHasName, String signalSendName) throws InterruptedException - { - LOG("signalAllParticipantsForDamage","signalAllParticipantsForDamage init"); - if (!isValidId(victimObject) || !exists(victimObject)) - { - return false; - } - if (questName == null || questName.length() <= 0) - { - return false; - } - if (signalHasName == null || signalHasName.length() <= 0) - { - return false; - } - if (signalSendName == null || signalSendName.length() <= 0) - { - return false; - } - - obj_id[] attackerList = utils.getObjIdBatchScriptVar(victimObject, "creditForKills.attackerList.attackers"); - if (attackerList == null || attackerList.length <= 0) - { - LOG("signalAllParticipantsForDamage","signalAllParticipantsForDamage attackerList NULL"); - - return false; - } - - LOG("signalAllParticipantsForDamage","signalAllParticipantsForDamage attackerList.length: "+attackerList.length); - - for (int i = 0; i < attackerList.length; ++i) - { - testAbortScript(); - LOG("signalAllParticipantsForDamage","signalAllParticipantsForDamage attackerList[i]: "+attackerList[i]); - - if (!isValidId(attackerList[i])) - { - continue; - } - - trial.addNonInstanceFactionParticipant(attackerList[i], victimObject); - LOG("signalAllParticipantsForDamage","signalAllParticipantsForDamage attackerList[i]: "+attackerList[i]+" is a valid OID"); - - if (!groundquests.isQuestActive(attackerList[i], questName)) - { - continue; - } - LOG("signalAllParticipantsForDamage","signalAllParticipantsForDamage attackerList[i]: "+attackerList[i]+" has quest active!"); - - if (!groundquests.isTaskActive(attackerList[i], questName, signalHasName)) - { - continue; - } - - LOG("signalAllParticipantsForDamage","signalAllParticipantsForDamage signal being sent to: "+attackerList[i]); - groundquests.sendSignal(attackerList[i], signalSendName); - - gcw.gcwInvasionCreditForDestroy(attackerList[i]); - } - - return true; - } - - - public static boolean hasConstructionOrRepairTool(obj_id player, obj_id object) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(object) || !exists(object)) - { - return false; - } - - obj_id playerInventory = utils.getInventoryContainer(player); - if (!isValidId(playerInventory) || !exists(playerInventory)) - { - return false; - } - - if (!hasObjVar(object, GCW_SPAWN_ID_OBJVAR)) - { - return false; - } - - String spawnId = getStringObjVar(object, GCW_SPAWN_ID_OBJVAR); - if (spawnId == null || spawnId.length() <= 0) - { - return false; - } - - String desiredTemplate = ""; - - if (spawnId.equals(GCW_DEFENSE_PATROL_OBJVAR) || spawnId.equals(GCW_OFFENSE_PATROL_OBJVAR)) - { - if (!hasObjVar(object, GCW_DEF_TOOL_TEMPLATE_OBJVAR) || !hasObjVar(object, GCW_OFF_TOOL_TEMPLATE_OBJVAR)) - { - return false; - } - - if (spawnId.equals(GCW_DEFENSE_PATROL_OBJVAR)) - { - desiredTemplate = getStringObjVar(object, GCW_DEF_TOOL_TEMPLATE_OBJVAR); - } - - if (spawnId.equals(GCW_OFFENSE_PATROL_OBJVAR)) - { - desiredTemplate = getStringObjVar(object, GCW_OFF_TOOL_TEMPLATE_OBJVAR); - } - } - else - { - if (!hasObjVar(object, GCW_TOOL_TEMPLATE_OBJVAR)) - { - return false; - } - - desiredTemplate = getStringObjVar(object, GCW_TOOL_TEMPLATE_OBJVAR); - } - - if (desiredTemplate == null || desiredTemplate.length() <= 0) - { - return false; - } - - return utils.playerHasItemByTemplateInInventoryOrEquipped(player, desiredTemplate); - } - - - public static boolean useConstructionOrRepairTool(obj_id player, obj_id object) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (!isValidId(object) || !exists(object)) - { - return false; - } - - if (!hasObjVar(object, GCW_SPAWN_ID_OBJVAR)) - { - return false; - } - - String spawnId = getStringObjVar(object, GCW_SPAWN_ID_OBJVAR); - if (spawnId == null || spawnId.length() <= 0) - { - return false; - } - - String desiredTemplate = ""; - - if (spawnId.equals(GCW_DEFENSE_PATROL_OBJVAR) || spawnId.equals(GCW_OFFENSE_PATROL_OBJVAR)) - { - if (!hasObjVar(object, GCW_DEF_TOOL_TEMPLATE_OBJVAR) || !hasObjVar(object, GCW_OFF_TOOL_TEMPLATE_OBJVAR)) - { - return false; - } - - if (spawnId.equals(GCW_DEFENSE_PATROL_OBJVAR)) - { - desiredTemplate = getStringObjVar(object, GCW_DEF_TOOL_TEMPLATE_OBJVAR); - } - - if (spawnId.equals(GCW_OFFENSE_PATROL_OBJVAR)) - { - desiredTemplate = getStringObjVar(object, GCW_OFF_TOOL_TEMPLATE_OBJVAR); - } - } - else - { - if (!hasObjVar(object, GCW_TOOL_TEMPLATE_OBJVAR)) - { - return false; - } - - desiredTemplate = getStringObjVar(object, GCW_TOOL_TEMPLATE_OBJVAR); - } - - obj_id toolObject = utils.getItemByTemplateInInventoryOrEquipped(player, desiredTemplate); - if (!isValidId(toolObject) || !exists(toolObject)) - { - return false; - } - - gcwInvasionCreditForCrafting(player); - - return decrementCount(toolObject); - } - - - public static int getGcwCityInvasionPhase(obj_id childObject) throws InterruptedException - { - if (!isValidId(childObject) || !exists(childObject)) - { - return GCW_CITY_PHASE_UNKNOWN; - } - - obj_id parent = trial.getParent(childObject); - if (!isValidId(parent)) - { - return GCW_CITY_PHASE_UNKNOWN; - } - - if (utils.hasScriptVar(parent, "gcw.constructionEnded")) - { - return GCW_CITY_PHASE_COMBAT; - } - - if (utils.hasScriptVar(parent, "gcw.invasionRunning")) - { - return GCW_CITY_PHASE_CONSTRUCTION; - } - - return GCW_CITY_PHASE_UNKNOWN; - } - - - public static boolean playerSystemMessageResourceNeeded(obj_id player, obj_id object, boolean construction) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(object) || !exists(object)) - { - return false; - } - - if ((!hasObjVar(object, gcw.GCW_TOOL_TEMPLATE_OBJVAR) && !hasObjVar(object, gcw.GCW_DEF_TOOL_TEMPLATE_OBJVAR) && !hasObjVar(object, gcw.GCW_OFF_TOOL_TEMPLATE_OBJVAR))) - { - return false; - } - - String toolTemplate = ""; - - if (hasObjVar(object, GCW_DEF_TOOL_TEMPLATE_OBJVAR) && hasObjVar(object, GCW_OFF_TOOL_TEMPLATE_OBJVAR)) - { - - if (hasObjVar(object, GCW_SPAWN_ID_OBJVAR) && getStringObjVar(object, GCW_SPAWN_ID_OBJVAR).equals(GCW_DEFENSE_PATROL_OBJVAR)) - { - toolTemplate = getStringObjVar(object, gcw.GCW_DEF_TOOL_TEMPLATE_OBJVAR); - } - else if (hasObjVar(object, GCW_SPAWN_ID_OBJVAR) && getStringObjVar(object, GCW_SPAWN_ID_OBJVAR).equals(GCW_OFFENSE_PATROL_OBJVAR)) - { - toolTemplate = getStringObjVar(object, gcw.GCW_OFF_TOOL_TEMPLATE_OBJVAR); - } - } - else - { - toolTemplate = getStringObjVar(object, gcw.GCW_TOOL_TEMPLATE_OBJVAR); - } - - if (toolTemplate == null || toolTemplate.length() <= 0) - { - return false; - } - - string_id objName = getNameFromTemplate(toolTemplate); - if (objName == null) - { - return false; - } - - prose_package pp = new prose_package(); - string_id msg = new string_id(); - if (construction) - { - msg = SID_RESOURCES_NEEDED; - } - else - { - msg = SID_YOU_NEED_TOOL_REPAIR; - } - - pp = prose.setStringId(pp, msg); - pp = prose.setTO(pp, objName); - sendSystemMessageProse(player, pp); - return true; - } - - - public static int getFatigueTimerMod(obj_id player) throws InterruptedException - { - int fatigueStack = (int)buff.getBuffStackCount(player, BUFF_PLAYER_FATIGUE); - - int fatigueMod = 0; - - if (fatigueStack > 0) - { - fatigueMod = fatigueStack / GCW_FATIGUE_DIVISOR; - } - - return fatigueMod; - } - - - public static obj_id getInvasionSequencerNearby(obj_id target) throws InterruptedException - { - if (!isIdValid(target) || !exists(target)) - { - return null; - } - - obj_id keren = utils.stringToObjId(GCW_SEQUENCER_KEREN); - obj_id bestine = utils.stringToObjId(GCW_SEQUENCER_BESTINE); - obj_id dearic = utils.stringToObjId(GCW_SEQUENCER_DEARIC); - - if (isIdValid(keren) && exists(keren)) - { - return keren; - } - - if (isIdValid(bestine) && exists(bestine)) - { - return bestine; - } - - if (isIdValid(dearic) && exists(dearic)) - { - return dearic; - } - - return null; - } - - - public static String getCityFromTable(obj_id self) throws InterruptedException - { - String cityName = ""; - - String datatable = getStringObjVar(self, "instance.data_table"); - - if (datatable == null || datatable.length() < 1) - { - return null; - } - - if (datatable.equals(DEARIC_CITY_TABLE)) - { - return CITY_DEARIC; - } - else if (datatable.equals(KEREN_CITY_TABLE)) - { - return CITY_KEREN; - } - else if (datatable.equals(BESTINE_CITY_TABLE)) - { - return CITY_BESTINE; - } - - return null; - } - - - public static boolean awardGcwInvasionParticipants(Vector participantList, int factionFlag, int gcwTokenAmt, int gcwPointAmt) throws InterruptedException - { - if (participantList == null || participantList.size() <= 0) - { - CustomerServiceLog("gcw_city_invasion", "gcw.awardInvasionParticipants: participantList array invalid. Returning False."); - return false; - } - - if (factionFlag != factions.FACTION_FLAG_REBEL && factionFlag != factions.FACTION_FLAG_IMPERIAL) - { - CustomerServiceLog("gcw_city_invasion", "gcw.awardInvasionParticipants: Faction Flag invalid. Returning False."); - return false; - } - - if (gcwTokenAmt <= 0 && gcwPointAmt <= 0) - { - CustomerServiceLog("gcw_city_invasion", "gcw.awardInvasionParticipants: participantList awards were equal to or less than 0. Returning False."); - return false; - } - - String tokenStaticName = ""; - obj_id[] lootList = new obj_id[1]; - - if (factionFlag == factions.FACTION_FLAG_IMPERIAL) - { - tokenStaticName = "item_gcw_imperial_token"; - } - else if (factionFlag == factions.FACTION_FLAG_REBEL) - { - tokenStaticName = "item_gcw_rebel_token"; - } - - for (int i = 0; i < participantList.size(); i++) - { - testAbortScript(); - if (!isValidId(((obj_id)(participantList.get(i)))) || !exists(((obj_id)(participantList.get(i))))) - { - continue; - } - if (!isPlayerConnected(((obj_id)(participantList.get(i))))) - { - continue; - } - - grantUnmodifiedGcwPoints(((obj_id)(participantList.get(i))), gcwPointAmt); - - if (tokenStaticName == null || tokenStaticName.length() <= 0) - { - continue; - } - - obj_id playerInv = getObjectInSlot(((obj_id)(participantList.get(i))), utils.SLOT_INVENTORY); - if (isValidId(playerInv)) - { - obj_id lootCreated = static_item.createNewItemFunction(tokenStaticName, playerInv, gcwTokenAmt); - lootList[0] = lootCreated; - showLootBox(((obj_id)(participantList.get(i))), lootList); - } - } - return true; - } - - - public static boolean invasionIsValidAndEngaged() throws InterruptedException - { - obj_id self = getSelf(); - - if (!isIdValid(self) || !exists(self)) - { - return false; - } - - obj_id sequencer = getInvasionSequencerNearby(self); - - if (!isIdValid(sequencer) || !exists(sequencer)) - { - return false; - } - - if (!utils.hasScriptVar(sequencer, "gcw.invasionRunning")) - { - return false; - } - - return true; - } - - - public static void gcwSetCredits(obj_id who, int playerGCW, int playerPvpKills, int playerKills, int playerAssists, int playerCraftedItems, int playerDestroyedItems) throws InterruptedException - { - if (!isIdValid(who) || !exists(who) || !isPlayer(who)) - { - return; - } - - gcw_score.gcw_data currentData = gcw_score.getPlayerGcwData(who); - - String playerName = getName(who); - String playerFaction = factions.getFaction(who); - - String factionColor = ""; - - if (factions.getFactionFlag(who) == factions.FACTION_FLAG_REBEL) - { - factionColor = COLOR_REBELS; - } - else if (factions.getFactionFlag(who) == factions.FACTION_FLAG_IMPERIAL) - { - factionColor = COLOR_IMPERIALS; - } - - if (playerFaction == null || playerFaction.length() <= 0) - { - if (factions.isRebelHelper(who)) - { - factionColor = COLOR_REBELS; - playerFaction = "Rebel Helper"; - } - else if (factions.isImperialHelper(who)) - { - factionColor = COLOR_IMPERIALS; - playerFaction = "Imperial Helper"; - } - else - { - return; - } - } - - playerFaction = factionColor + playerFaction; - - String playerProfession = "@ui_roadmap:"+ skill.getProfessionName(getSkillTemplate(who)); - - int playerLevel = getLevel(who); - - if (currentData != null) - { - playerGCW = currentData.playerGCW + playerGCW; - playerPvpKills = currentData.playerPvpKills + playerPvpKills; - playerKills = currentData.playerKills + playerKills; - playerAssists = currentData.playerAssists + playerAssists; - playerCraftedItems = currentData.playerCraftedItems + playerCraftedItems; - playerDestroyedItems = currentData.playerDestroyedItems + playerDestroyedItems; - } - - gcw_score.setPlayerGcwData(who, playerName, playerFaction, playerProfession, playerLevel, playerGCW, playerPvpKills, playerKills, playerAssists, playerCraftedItems, playerDestroyedItems); - } - - - public static void gcwInvasionCreditForGCW(obj_id who, int gcw) throws InterruptedException - { - if (!invasionIsValidAndEngaged()) - { - return; - } - - gcwSetCredits(who, gcw, 0, 0, 0, 0, 0); - } - - - public static void gcwInvasionCreditForPVPKill(obj_id who) throws InterruptedException - { - if (!invasionIsValidAndEngaged()) - { - return; - } - - gcwSetCredits(who, 0, 1, 0, 0, 0, 0); - } - - - public static void gcwInvasionCreditForKill(obj_id who) throws InterruptedException - { - if (!invasionIsValidAndEngaged()) - { - return; - } - gcwSetCredits(who, 0, 0, 1, 0, 0, 0); - } - - - public static void gcwInvasionCreditForAssist(obj_id who) throws InterruptedException - { - if (!invasionIsValidAndEngaged()) - { - return; - } - - gcwSetCredits(who, 0, 0, 0, 1, 0, 0); - } - - - public static void gcwInvasionCreditForCrafting(obj_id who) throws InterruptedException - { - if (!invasionIsValidAndEngaged()) - { - return; - } - - gcwSetCredits(who, 0, 0, 0, 0, 1, 0); - } - - - public static void gcwInvasionCreditForDestroy(obj_id who) throws InterruptedException - { - if (!invasionIsValidAndEngaged()) - { - return; - } - - gcwSetCredits(who, 0, 0, 0, 0, 0, 1); - } - -} diff --git a/sku.0/sys.server/compiled/game/script/library/groundquests.java b/sku.0/sys.server/compiled/game/script/library/groundquests.java deleted file mode 100644 index 1d02a1a39..000000000 --- a/sku.0/sys.server/compiled/game/script/library/groundquests.java +++ /dev/null @@ -1,2269 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.badge; -import script.library.factions; -import script.library.loot; -import script.library.money; -import script.library.prose; -import script.library.utils; -import script.library.weapons; -import script.library.xp; -import script.library.gcw; - - -public class groundquests extends script.base_script -{ - public groundquests() - { - } - public static final String DISABLED_QUEST_TABLE = "datatables/quest/ground/disabled.iff"; - public static final String DISABLED_QUEST_COLUMN = "disabled_quests"; - - public static final String questBaseObjVar = "quest"; - public static final String questAllObjVar = "all"; - public static final String questStaticEscortTargetObjVar = "staticEscortTarget"; - public static final String dot = "."; - - public static final String datatableColumnjournalEntryTitle = "JOURNAL_ENTRY_TITLE"; - public static final String datatableColumnShowSystemMessages = "SHOW_SYSTEM_MESSAGES"; - public static final String datatableColumnCategory = "CATEGORY"; - public static final String dataTableColumnTaskName = "TASK_NAME"; - public static final String dataTableColumnVisible = "IS_VISIBLE"; - public static final String dataTableColumnActionName = "ACTION_NAME"; - public static final String dataTableColumnQuestVisible = "VISIBLE"; - - public static final int maxTasksPerQuest = 16; - - public static final String MUSIC_QUEST_ACTIVATED = "sound/ui_npe2_quest_received.snd"; - public static final String MUSIC_QUEST_COMPLETED = "sound/ui_npe2_quest_completed.snd"; - public static final String MUSIC_QUEST_RECEIVED_CREDITS = "sound/ui_npe2_quest_credits.snd"; - public static final String MUSIC_QUEST_RECEIVED_ITEM = "sound/ui_npe2_quest_reward.snd"; - public static final String MUSIC_QUEST_INCREMENT_COUNTER = "sound/ui_npe2_quest_step_completed.snd"; - - public static final string_id SID_TASK_COMPLETED = new string_id( "quest/ground/system_message", "quest_task_completed"); - public static final string_id SID_TASK_FAILED = new string_id( "quest/ground/system_message", "quest_task_failed"); - public static final string_id SID_QUEST_RECEIVED = new string_id( "quest/ground/system_message", "quest_received"); - public static final string_id SID_PLACED_IN_INVENTORY = new string_id( "quest/ground/system_message", "placed_in_inventory"); - public static final string_id SID_MORE_THAN_ONE_PLACED_IN_INVENTORY = new string_id( "quest/ground/system_message", "placed_in_inventory_number"); - public static final string_id SID_REMOVED_FROM_INVENTORY = new string_id( "quest/ground/system_message", "removed_from_inventory"); - public static final string_id SID_TIME_REMAINING_BEFORE_COMPLETION = new string_id("quest/ground/system_message", "time_remaining_before_completion"); - public static final string_id SID_NO_XP_TRADER_ENTERTAINER = new string_id("quest/ground/system_message", "entertainer_trader_no_xp_combat"); - - public static final String objvarGoingHome = "quest.static_escort.goingHome"; - public static final String objvarOnEscort = "quest.static_escort.onEscort"; - - public static final String objvarGuaranteedSuccess_Count = "guaranteedSuccess.count"; - public static final String objvarGuaranteedSuccess_Target = "guaranteedSuccess.target"; - - public static final String JOURNAL_UPDATED_MUSIC = "sound/ui_journal_updated.snd"; - - public static final int INVALID_QUEST = 0; - - public static final int PERFORM_ANY = 0; - public static final int PERFORM_DANCE = 1; - public static final int PERFORM_MUSIC = 2; - public static final int PERFORM_JUGGLE = 3; - - public static final String PERFORM_TYPE = "performType"; - - public static final String QUEST_EXPERIENCE_TABLE = "datatables/quest/quest_experience.iff"; - - public static final String BASE_NAME = "quest."; - public static final String QUEST_CRC = BASE_NAME + "questCrc"; - public static final String QUEST_NAME = BASE_NAME + "questName"; - public static final String TASK_ID = BASE_NAME + "taskId"; - public static final String TASK_NAME = BASE_NAME + "taskName"; - - public static final String dataTableColumnExperienceType = "EXPERIENCE_TYPE"; - public static final String dataTableColumnExperienceAmount = "EXPERIENCE_AMOUNT"; - public static final String dataTableColumnFactionName = "FACTION_NAME"; - public static final String dataTableColumnFactionAmount = "FACTION_AMOUNT"; - public static final String dataTableColumnGcwGrant = "GRANT_GCW"; - public static final String dataTableColumnGcwOverwriteAmt = "QUEST_GCW_REWARD_OVERWRITE_AMOUNT"; - public static final String dataTableColumnGcwOvrwrtSFMod = "QUEST_GCW_REWARD_OVERWRITE_SF_MODIFIER"; - public static final String dataTableColumnGcwRebReward = "QUEST_GCW_REBEL_REWARD_LOOT_NAME"; - public static final String dataTableColumnGcwRebRewardCnt = "QUEST_REWARD_REBEL_LOOT_COUNT"; - public static final String dataTableColumnGcwImpReward = "QUEST_GCW_IMPERIAL_REWARD_LOOT_NAME"; - public static final String dataTableColumnGcwImpRewardCnt = "QUEST_REWARD_IMPERIAL_LOOT_COUNT"; - public static final String dataTableColumnGcwRewardMultip = "QUEST_GCW_REWARD_COUNT_SF_MULTIPLIER"; - public static final String dataTableColumnBankCredits = "BANK_CREDITS"; - public static final String dataTableColumnItem = "ITEM"; - public static final String dataTableColumnCount = "COUNT"; - public static final String dataTableColumnWeapon = "WEAPON"; - public static final String dataTableColumnCountWeapon = "COUNT_WEAPON"; - public static final String dataTableColumnSpeed = "SPEED"; - public static final String dataTableColumnDamage = "DAMAGE"; - public static final String dataTableColumnEfficiency = "EFFICIENCY"; - public static final String dataTableColumnElementalValue = "ELEMENTAL_VALUE"; - public static final String dataTableColumnArmor = "ARMOR"; - public static final String dataTableColumnCountArmor = "COUNT_ARMOR"; - public static final String dataTableColumnQuality = "QUALITY"; - public static final String dataTableColumnLootName = "LOOT_NAME"; - public static final String dataTableColumnLootCount = "LOOT_COUNT"; - public static final String dataTableColumnLevel = "LEVEL"; - public static final String dataTableColumnTier = "TIER"; - - public static final String dataTableColumnQuestRewardExperienceTeir1 = "TIER_1_EXPERIENCE"; - public static final String dataTableColumnQuestRewardExperienceTeir2 = "TIER_2_EXPERIENCE"; - public static final String dataTableColumnQuestRewardExperienceTeir3 = "TIER_3_EXPERIENCE"; - public static final String dataTableColumnQuestRewardExperienceTeir4 = "TIER_4_EXPERIENCE"; - public static final String dataTableColumnQuestRewardExperienceTeir5 = "TIER_5_EXPERIENCE"; - public static final String dataTableColumnQuestRewardExperienceTeir6 = "TIER_6_EXPERIENCE"; - public static final String dataTableColumnQuestRewardExperienceType = "QUEST_REWARD_EXPERIENCE_TYPE"; - public static final String dataTableColumnQuestRewardExperienceAmount = "QUEST_REWARD_EXPERIENCE_AMOUNT"; - public static final String dataTableColumnQuestRewardFactionName = "QUEST_REWARD_FACTION_NAME"; - public static final String dataTableColumnQuestRewardFactionAmount = "QUEST_REWARD_FACTION_AMOUNT"; - public static final String dataTableColumnQuestRewardBankCredits = "QUEST_REWARD_BANK_CREDITS"; - public static final String dataTableColumnQuestRewardItem = "QUEST_REWARD_ITEM"; - public static final String dataTableColumnQuestRewardCount = "QUEST_REWARD_COUNT"; - public static final String dataTableColumnQuestRewardWeapon = "QUEST_REWARD_WEAPON"; - public static final String dataTableColumnQuestRewardCountWeapon = "QUEST_REWARD_COUNT_WEAPON"; - public static final String dataTableColumnQuestRewardSpeed = "QUEST_REWARD_SPEED"; - public static final String dataTableColumnQuestRewardDamage = "QUEST_REWARD_DAMAGE"; - public static final String dataTableColumnQuestRewardEfficiency = "QUEST_REWARD_EFFICIENCY"; - public static final String dataTableColumnQuestRewardElementalValue = "QUEST_REWARD_ELEMENTAL_VALUE"; - public static final String dataTableColumnQuestRewardArmor = "QUEST_REWARD_ARMOR"; - public static final String dataTableColumnQuestRewardCountArmor = "QUEST_REWARD_COUNT_ARMOR"; - public static final String dataTableColumnQuestRewardQuality = "QUEST_REWARD_QUALITY"; - public static final String dataTableColumnQuestRewardLootName = "QUEST_REWARD_LOOT_NAME"; - public static final String dataTableColumnQuestRewardLootCount = "QUEST_REWARD_LOOT_COUNT"; - public static final String dataTableColumnQuestRewardLootName2 = "QUEST_REWARD_LOOT_NAME_2"; - public static final String dataTableColumnQuestRewardLootCount2 = "QUEST_REWARD_LOOT_COUNT_2"; - public static final String dataTableColumnQuestRewardLootName3 = "QUEST_REWARD_LOOT_NAME_3"; - public static final String dataTableColumnQuestRewardLootCount3 = "QUEST_REWARD_LOOT_COUNT_3"; - public static final String dataTableColumnQuestRewardExclusiveLootName = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME"; - public static final String dataTableColumnQuestRewardExclusiveLootCount = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT"; - public static final String dataTableColumnQuestRewardExclusiveLootName2 = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME_2"; - public static final String dataTableColumnQuestRewardExclusiveLootCount2 = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT_2"; - public static final String dataTableColumnQuestRewardExclusiveLootName3 = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME_3"; - public static final String dataTableColumnQuestRewardExclusiveLootCount3 = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT_3"; - public static final String dataTableColumnQuestRewardExclusiveLootName4 = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME_4"; - public static final String dataTableColumnQuestRewardExclusiveLootCount4 = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT_4"; - public static final String dataTableColumnQuestRewardExclusiveLootName5 = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME_5"; - public static final String dataTableColumnQuestRewardExclusiveLootCount5 = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT_5"; - public static final String dataTableColumnQuestRewardExclusiveLootName6 = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME_6"; - public static final String dataTableColumnQuestRewardExclusiveLootCount6 = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT_6"; - public static final String dataTableColumnQuestRewardExclusiveLootName7 = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME_7"; - public static final String dataTableColumnQuestRewardExclusiveLootCount7 = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT_7"; - public static final String dataTableColumnQuestRewardExclusiveLootName8 = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME_8"; - public static final String dataTableColumnQuestRewardExclusiveLootCount8 = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT_8"; - public static final String dataTableColumnQuestRewardExclusiveLootName9 = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME_9"; - public static final String dataTableColumnQuestRewardExclusiveLootCount9 = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT_9"; - public static final String dataTableColumnQuestRewardExclusiveLootName10 = "QUEST_REWARD_EXCLUSIVE_LOOT_NAME_10"; - public static final String dataTableColumnQuestRewardExclusiveLootCount10 = "QUEST_REWARD_EXCLUSIVE_LOOT_COUNT_10"; - - public static final String dataTableColumnQuestPenaltyFactionName = "QUEST_PENALTY_FACTION_NAME"; - public static final String dataTableColumnQuestPenaltyFactionAmount = "QUEST_PENALTY_FACTION_AMOUNT"; - - public static final String dataTableColumnConditionQuestGrantQuest = "CONDITIONAL_QUEST_GRANT_QUEST"; - public static final String dataTableColumnConditionQuestGrantListOfCompletedQuests = "CONDITIONAL_QUEST_GRANT_QUEST_LIST_OF_COMPLETED_QUESTS"; - public static final String dataTableColumnBadge = "REWARD_BADGE"; - - public static final String dataTableColumnGuaranteedSuccessMin = "GUARANTEED_SUCCESS_MIN"; - public static final String dataTableColumnGuaranteedSuccessMax = "GUARANTEED_SUCCESS_MAX"; - - public static final String dataTableColumnRemainingTime = "REMAINING_TIME"; - - public static final String dataTableColumnCreateWaypoint = "CREATE_WAYPOINT"; - public static final String dataTableColumnPlanetName = "PLANET_NAME"; - public static final String dataTableColumnLocationX = "LOCATION_X"; - public static final String dataTableColumnLocationY = "LOCATION_Y"; - public static final String dataTableColumnLocationZ = "LOCATION_Z"; - public static final String dataTableColumnWaypointName = "WAYPOINT_NAME"; - public static final String dataTableColumnInteriorWaypointAppearance = "INTERIOR_WAYPOINT_APPEARANCE"; - public static final String dataTableColumnWaypointBuildingCellName = "WAYPOINT_BUILDING_CELL_NAME"; - public static final String dataTableColumnEntranceCreateWaypoint = "CREATE_ENTRANCE_WAYPOINT"; - public static final String dataTableColumnEntranceLocationX = "ENTRANCE_LOCATION_X"; - public static final String dataTableColumnEntranceLocationY = "ENTRANCE_LOCATION_Y"; - public static final String dataTableColumnEntranceLocationZ = "ENTRANCE_LOCATION_Z"; - public static final String dataTableColumnEntranceWaypointName = "ENTRANCE_WAYPOINT_NAME"; - public static final String taskType = "base_task"; - public static final String objvarWaypoint = "waypoint"; - public static final String objvarEntranceWaypoint = "entranceWaypoint"; - public static final String objvarWaypointInActive = "waypointInactive"; - public static final String timeObjVar = "playedTimeEnd"; - - - public static String getStringDataEntry(String datatableName, int questId, int taskId, String columnName) throws InterruptedException - { - String result = null; - String questName = questGetQuestName(questId); - if (questName == null || questName.equals("")) - { - String errText = "QUEST NAME IS NULL: datatableName: "+ datatableName + - " - questId:"+ questId + - " - taskId: "+ taskId + - " - columnName: "+ columnName; - - logScriptDataError(errText); - } - else - { - String datatable = "datatables/"+ datatableName + "/"+ questName + ".iff"; - if (isValidTaskId(taskId)) - { - if (dataTableHasColumn(datatable, columnName)) - { - result = dataTableGetString(datatable, taskId, columnName); - } - } - } - return result; - } - - - public static int getIntDataEntry(String datatableName, int questId, int taskId, String columnName) throws InterruptedException - { - int result = -1; - String questName = questGetQuestName(questId); - String datatable = "datatables/"+ datatableName + "/"+ questName + ".iff"; - if (isValidTaskId(taskId)) - { - if (dataTableHasColumn(datatable, columnName)) - { - result = dataTableGetInt(datatable, taskId, columnName); - } - } - return result; - } - - - public static float getFloatDataEntry(String datatableName, int questId, int taskId, String columnName) throws InterruptedException - { - float result = 0.0f; - String questName = questGetQuestName(questId); - String datatable = "datatables/"+ datatableName + "/"+ questName + ".iff"; - if (isValidTaskId(taskId)) - { - if (dataTableHasColumn(datatable, columnName)) - { - result = dataTableGetFloat(datatable, taskId, columnName); - } - } - return result; - } - - - public static boolean getBoolDataEntry(String datatableName, int questId, int taskId, String columnName, boolean defaultValue) throws InterruptedException - { - int result = -1; - String questName = questGetQuestName(questId); - String datatable = "datatables/"+ datatableName + "/"+ questName + ".iff"; - if (isValidTaskId(taskId)) - { - if (dataTableHasColumn(datatable, columnName)) - { - result = dataTableGetInt(datatable, taskId, columnName); - } - } - - if (result == -1) - { - return defaultValue; - } - - return result != 0; - } - - - public static String setBaseObjVar(obj_id player, String taskType, String questName, int taskId) throws InterruptedException - { - String objvar = questBaseObjVar + dot + taskType + dot + questName + dot + taskId; - setObjVar(player, objvar + dot + "inProgress", "true"); - return objvar; - } - - - public static void clearBaseObjVar(obj_id player, String taskType, String questName, int taskId) throws InterruptedException - { - String objvarTask = questBaseObjVar + dot + taskType + dot + questName + dot + taskId; - removeObjVar(player, objvarTask); - } - - - public static String getBaseObjVar(obj_id player, String taskType, String questName, int taskId) throws InterruptedException - { - return questBaseObjVar + dot + taskType + dot + questName + dot + taskId; - } - - - public static String getTaskTypeObjVar(obj_id player, String taskType) throws InterruptedException - { - String objvar = questBaseObjVar + dot + taskType; - if (hasObjVar(player, objvar)) - { - return objvar; - } - else - { - return null; - } - } - - - public static String getTaskTypeObjVar(String taskType) throws InterruptedException - { - return questBaseObjVar + dot + taskType; - } - - - public static void questOutputDebugInfo(obj_id player, int questCrc, int taskId, String taskType, String method, String message) throws InterruptedException - { - if (isGod(player) && questGetDebugging()) - { - debugSpeakMsg (player, "Quest: player["+ player + "], "+ taskType + dot + method + ", "+ questGetQuestName(questCrc) + ":task"+ taskId + " - "+ message); - } - } - - - public static void questOutputDebugInfo(obj_id player, String questName, int taskId, String taskType, String method, String message) throws InterruptedException - { - questOutputDebugInfo(player, questGetQuestId(questName), taskId, taskType, method, message); - } - - - public static void questOutputDebugInfo(obj_id player, String taskType, String method, String message) throws InterruptedException - { - if (isGod(player) && questGetDebugging()) - { - debugSpeakMsg (player, "Quest: player["+ player + "], "+ taskType + dot + method + " - "+ message); - } - } - - - public static void questOutputDebugLog(String taskType, String method, String message) throws InterruptedException - { - if (questGetDebugging()) - { - LOG("QUEST_DEBUG", taskType + dot + method + " - "+ message); - } - } - - - public static void addDestroyNotification(obj_id target, obj_id player) throws InterruptedException - { - attachScript(target, "quest.utility.destroy_notification"); - dictionary params = new dictionary(); - params.put("target", player); - params.put("parameter", ""); - messageTo(target, "addNotification", params, 0.0f, false); - } - - - public static void failAllActiveTasksOfType(obj_id player, String taskType) throws InterruptedException - { - dictionary tasks = getActiveTasksForTaskType(player, taskType); - if ((tasks != null) && !tasks.isEmpty()) - { - java.util.Enumeration keys = tasks.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String questCrcString = (String)keys.nextElement(); - int questCrc = utils.stringToInt(questCrcString); - int[] tasksForCurrentQuest = tasks.getIntArray(questCrcString); - - for (int i = 0; i < tasksForCurrentQuest.length; ++i) - { - testAbortScript(); - int taskId = tasksForCurrentQuest[i]; - - if (isValidTaskId(taskId)) - { - questFailTask(questCrc, taskId, player); - } - } - } - } - } - - - public static String getTaskStringDataEntry(int questId, int taskId, String columnName) throws InterruptedException - { - return getStringDataEntry("questtask", questId, taskId, columnName); - } - - - public static int getTaskIntDataEntry(int questId, int taskId, String columnName) throws InterruptedException - { - return getIntDataEntry("questtask", questId, taskId, columnName); - } - - - public static float getTaskFloatDataEntry(int questId, int taskId, String columnName) throws InterruptedException - { - return getFloatDataEntry("questtask", questId, taskId, columnName); - } - - - public static boolean getTaskBoolDataEntry(int questId, int taskId, String columnName, boolean defaultValue) throws InterruptedException - { - return getBoolDataEntry("questtask", questId, taskId, columnName, defaultValue); - } - - - public static String getQuestStringDataEntry(int questId, String columnName) throws InterruptedException - { - return getStringDataEntry("questlist", questId, 0, columnName); - } - - - public static int getQuestIntDataEntry(int questId, String columnName) throws InterruptedException - { - return getIntDataEntry("questlist", questId, 0, columnName); - } - - - public static float getQuestFloatDataEntry(int questId, String columnName) throws InterruptedException - { - return getFloatDataEntry("questlist", questId, 0, columnName); - } - - - public static boolean getQuestBoolDataEntry(int questId, String columnName, boolean defaultValue) throws InterruptedException - { - return getBoolDataEntry("questlist", questId, 0, columnName, defaultValue); - } - - - public static boolean getShowSystemMessages(int questCrc, int taskId) throws InterruptedException - { - return getTaskIntDataEntry(questCrc, taskId, datatableColumnShowSystemMessages) > 0; - } - - - public static void sendGroundQuestSystemMessage(string_id message, int questCrc, int taskId, obj_id player) throws InterruptedException - { - String taskTitle = getTaskStringDataEntry(questCrc, taskId, datatableColumnjournalEntryTitle); - - prose_package pp = prose.getPackage(message); - prose.setTO(pp, taskTitle); - sendQuestSystemMessage(player, pp); - } - - - public static void sendTaskCompletedSystemMessage(int questCrc, int taskId, obj_id player) throws InterruptedException - { - if (getShowSystemMessages(questCrc, taskId)) - { - sendGroundQuestSystemMessage(SID_TASK_COMPLETED, questCrc, taskId, player); - } - } - - - public static void sendTaskFailedSystemMessage(int questCrc, int taskId, obj_id player) throws InterruptedException - { - if (getShowSystemMessages(questCrc, taskId)) - { - sendGroundQuestSystemMessage(SID_TASK_FAILED, questCrc, taskId, player); - } - } - - - public static void requestGrantQuest(obj_id player, String questName) throws InterruptedException - { - int questNum = getQuestIdFromString(questName); - requestGrantQuest(questNum, player, player, true); - } - - - public static void requestGrantQuest(obj_id[] players, String questName) throws InterruptedException - { - if (players == null || players.length == 0) - { - return; - } - - for (int i=0; i 0) - { - sendSystemMessage(player, SID_NO_XP_TRADER_ENTERTAINER); - } - - return; - } - - - public static int grantQuestNoAcceptUI(obj_id player, String questName, boolean showSystemMessage) throws InterruptedException - { - int questCrc = getQuestIdFromString(questName); - return questActivateQuest(questCrc, player, player); - } - - - public static boolean isInNamedRegion(obj_id player, String requiredRegion) throws InterruptedException - { - if (requiredRegion == null || requiredRegion.length() == 0) - { - return true; - } - - location here = getLocation (player); - region[] regions = getRegionsAtPoint(here); - if (regions != null) - { - for (int k = 0; k < regions.length; k++) - { - testAbortScript(); - String regionWeAreIn = regions[k].getName(); - - if (regionWeAreIn.equals(requiredRegion)) - { - return true; - } - } - } - return false; - } - - - public static void sendSignal(obj_id player, String signalName) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("signal", signalName); - messageTo(player, "questSignal", params, 0, false); - } - - - public static void sendSignal(obj_id[] players, String signalName) throws InterruptedException - { - if (players == null || players.length == 0) - { - return; - } - - for (int i=0; i 0) - { - sendSignal(player, signalNames[i]); - } - } - } - - - public static boolean isQuestDisabled(String questName) throws InterruptedException - { - if (questName.startsWith("quest/")) - { - questName = questName.substring(6); - } - - int disabled = dataTableSearchColumnForString(questName, DISABLED_QUEST_COLUMN, DISABLED_QUEST_TABLE); - - if (disabled >= 0) - { - return true; - } - return false; - } - - - public static int getQuestIdFromString(String questName) throws InterruptedException - { - - if (questName.startsWith("quest/")) - { - return questGetQuestId(questName); - } - else - { - String fullPathQuestName = "quest/"+ questName; - return questGetQuestId(fullPathQuestName); - } - } - - - public static boolean hasCompletedQuest(obj_id player, String questName) throws InterruptedException - { - int questNum = getQuestIdFromString(questName); - return questIsQuestComplete(questNum, player); - } - - - public static int canActivateQuest(obj_id player, String questName) throws InterruptedException - { - int questNum = getQuestIdFromString(questName); - return questCanActivateQuest(questNum, player); - } - - - public static void completeQuest(obj_id player, String questName) throws InterruptedException - { - int questNum = getQuestIdFromString(questName); - requestCompleteQuest(questNum, player); - } - - - public static void clearQuest(obj_id player, String questName) throws InterruptedException - { - int questNum = getQuestIdFromString(questName); - questClearQuest(questNum, player); - } - - - public static void clearQuest(obj_id[] players, String questName) throws InterruptedException - { - if (players == null || players.length == 0) - { - return; - } - - for (int i=0; i= 0) && (taskId < maxTasksPerQuest); - } - - - public static void questStartPerforming(obj_id player, int performType) throws InterruptedException - { - dictionary params = new dictionary(); - params.put(PERFORM_TYPE, performType); - messageTo(player, "startPerform", params, 1, false); - } - - - public static void questStopPerforming(obj_id player) throws InterruptedException - { - messageTo(player, "stopPerform", null, 1, false); - } - - - public static void questStartDance(obj_id player) throws InterruptedException - { - questStartPerforming(player, PERFORM_DANCE); - } - - - public static void questStartMusic(obj_id player) throws InterruptedException - { - questStartPerforming(player, PERFORM_MUSIC); - } - - - public static void questStartJuggle(obj_id player) throws InterruptedException - { - questStartPerforming(player, PERFORM_JUGGLE); - } - - - public static void sendPlacedMoreThanOneInInventorySystemMessage(obj_id player, obj_id objectPlaced, int count) throws InterruptedException - { - if (isValidId(objectPlaced)) - { - string_id name = getNameStringId(objectPlaced); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_MORE_THAN_ONE_PLACED_IN_INVENTORY); - pp = prose.setDI(pp, count); - pp = prose.setTO(pp, name); - sendQuestSystemMessage(player, pp); - } - } - - - public static void sendPlacedInInventorySystemMessage(obj_id player, obj_id objectPlaced, String objectTemplate) throws InterruptedException - { - if (isValidId(objectPlaced)) - { - prose_package pp = null; - string_id name = getNameStringId(objectPlaced); - - pp = prose.getPackage(SID_PLACED_IN_INVENTORY, name); - sendQuestSystemMessage(player, pp); - } - else - { - if (objectTemplate != null && objectTemplate.length() > 0) - { - LOG("quest", "WARNING: Failed to place ["+ objectTemplate + "] in player's inventory."); - } - } - } - - - public static void sendPlacedInInventorySystemMessage(obj_id player, obj_id objectPlaced) throws InterruptedException - { - sendPlacedInInventorySystemMessage(player, objectPlaced, null); - } - - - public static void sendRemovedFromInventorySystemMessage(obj_id player, obj_id objectPlaced, String objectTemplate) throws InterruptedException - { - if (isValidId(objectPlaced)) - { - prose_package pp = null; - string_id name = getNameStringId(objectPlaced); - - pp = prose.getPackage(SID_REMOVED_FROM_INVENTORY, name); - sendQuestSystemMessage(player, pp); - } - else - { - if (objectTemplate != null && objectTemplate.length() > 0) - { - LOG("quest", "WARNING: Failed to remove ["+ objectTemplate + "] from player's inventory."); - } - } - } - - - public static void sendRemovedFromInventorySystemMessage(obj_id player, obj_id objectPlaced) throws InterruptedException - { - sendRemovedFromInventorySystemMessage(player, objectPlaced, null); - } - - - public static boolean isActionAllowedForQuest(obj_id player, obj_id npc, String actionName) throws InterruptedException - { - - if (!hasObjVar(npc, QUEST_NAME)) - { - return false; - } - - if (!hasObjVar(npc, TASK_NAME)) - { - return false; - } - - int questCrc = getQuestIdFromString(getStringObjVar(npc, QUEST_NAME)); - int taskId = getTaskId(questCrc, getStringObjVar(npc, TASK_NAME)); - - if (!questIsTaskActive(questCrc, taskId, player)) - { - return false; - } - - String questActionName = getTaskStringDataEntry(questCrc, taskId, dataTableColumnActionName); - - if (questActionName == null) - { - return false; - } - - String baseQuest, baseAction; - int versionQuest, versionAction; - - int indexQuest = questActionName.lastIndexOf('_'); - int indexAction = actionName.lastIndexOf('_'); - - if (indexQuest < 0) - { - baseQuest = questActionName; - versionQuest = 0; - } - else - { - baseQuest = questActionName.substring(0, indexQuest); - versionQuest = utils.stringToInt(questActionName.substring(indexQuest+1)); - } - - if (indexAction < 0) - { - baseAction = actionName; - versionAction = 0; - } - else - { - baseAction = actionName.substring(0, indexAction); - versionAction = utils.stringToInt(actionName.substring(indexAction+1)); - } - - questOutputDebugInfo(player, "groundquests", "isActionAllowedForQuest", - questActionName + ": "+ baseQuest + " - "+ versionQuest + ", "+ baseAction + " - "+ versionAction); - - boolean result = baseAction.equals(baseQuest) && versionAction >= versionQuest; - - questOutputDebugInfo(player, "groundquests", "isActionAllowedForQuest", - "result = "+ (result ? "true": "false")); - - return result; - } - - - public static boolean questActionCompleted(obj_id player, obj_id npc, String actionName) throws InterruptedException - { - if (isActionAllowedForQuest(player, npc, actionName)) - { - int questCrc = getQuestIdFromString(getStringObjVar(npc, QUEST_NAME)); - int taskId = getTaskId(questCrc, getStringObjVar(npc, TASK_NAME)); - - dictionary params = new dictionary(); - params.put(QUEST_CRC, questCrc); - params.put(TASK_ID, taskId); - - questOutputDebugInfo(player, "groundquests", "questActionCompleted", - "sending questActionCompleted"); - - messageTo(player, "questActionCompleted", params, 0, false); - - return true; - } - - return false; - } - - - public static void applyQuestPenalty(obj_id player, String factionName, int factionAmount) throws InterruptedException - { - - if (factionName != null && factionName.length() > 0 && factionAmount > 0) - { - float currentFactionStanding = factions.getFactionStanding(player, factionName); - factions.setFactionStanding(player, factionName, currentFactionStanding - factionAmount); - prose_package pp = factions.getFactionProsePackage(factionName, -factionAmount); - sendQuestSystemMessage(player, pp); - } - } - - - public static void grantQuestReward(obj_id player, int questCrc, int questLevel, int questTier, String experienceType, int experienceAmount, String factionName, int factionAmount, boolean grantGcwReward, int bankCredits, String item, int itemCount, String weapon, int weaponCount, float weaponSpeed, float weaponDamage, float weaponEfficiency, float weaponElementalValue, String armor, int armorCount, int armorQuality, String[] inclusiveLootNames, int[] inclusiveLootCounts, String exclusiveLootChoiceName, int exclusiveLootChoiceCount, String badgeName, boolean useShowLootBox) throws InterruptedException - { - grantQuestReward(player, questCrc, questLevel, questTier, experienceType, experienceAmount, factionName, factionAmount, grantGcwReward, bankCredits, item, itemCount, weapon, weaponCount, weaponSpeed, weaponDamage, weaponEfficiency, weaponElementalValue, armor, armorCount, armorQuality, inclusiveLootNames, inclusiveLootCounts, exclusiveLootChoiceName, exclusiveLootChoiceCount, badgeName, useShowLootBox, 0, 0, null, 0, null, 0, 0); - } - - - public static void grantQuestReward(obj_id player, int questCrc, int questLevel, int questTier, String experienceType, int experienceAmount, String factionName, int factionAmount, boolean grantGcwReward, int bankCredits, String item, int itemCount, String weapon, int weaponCount, float weaponSpeed, float weaponDamage, float weaponEfficiency, float weaponElementalValue, String armor, int armorCount, int armorQuality, String[] inclusiveLootNames, int[] inclusiveLootCounts, String exclusiveLootChoiceName, int exclusiveLootChoiceCount, String badgeName, boolean useShowLootBox, int grantGcwOverwriteAmt, int grantGcwSFModifier, String grantGcwRebReward, int grantGcwRebRewardCount, String grantGcwImpReward, int grantGcwImpRewardCount, int grantGcwSFRewardMultip) throws InterruptedException - { - - if (itemCount == -1) - { - itemCount = 1; - } - if (weaponCount == -1) - { - weaponCount = 1; - } - if (armorCount == -1) - { - armorCount = 1; - } - - experienceAmount = getQuestExperienceReward(player, questLevel, questTier, experienceAmount); - obj_id playerInv = utils.getInventoryContainer(player); - Vector lootItemsResizeable = new Vector(); - lootItemsResizeable.setSize(0); - - if ((experienceType != null) && (experienceType.length() > 0) && (experienceAmount > 0)) - { - if (xp.isCombatXpType(experienceType)) - { - xp.grantCombatStyleXp(player, experienceType, experienceAmount); - } - else if (xp.isCraftingXpType(experienceType)) - { - - xp.grantCraftingQuestXp(player, experienceAmount); - } - else if (xp.isSocialXpType(experienceType)) - { - xp.grantSocialStyleXp(player, experienceType, experienceAmount); - } - else - { - xp.grantUnmodifiedExperience(player, experienceType, experienceAmount, false); - } - xp.displayXpFlyText(player, player, experienceAmount); - xp.displayXpMsg(player, experienceType, experienceAmount); - } - - if (bankCredits > 0) - { - money.bankTo(money.ACCT_NEW_PLAYER_QUESTS, player, bankCredits); - play2dNonLoopingSound(player, groundquests.MUSIC_QUEST_RECEIVED_CREDITS); - } - - if ((factionName != null) && (factionName.length() > 0) && (factionAmount != 0)) - { - float currentFactionStanding = factions.getFactionStanding(player, factionName); - factions.setFactionStanding(player, factionName, currentFactionStanding + factionAmount); - prose_package pp = factions.getFactionProsePackage(factionName, factionAmount); - sendQuestSystemMessage(player, pp); - } - - if (grantGcwReward) - { - int intFaction = pvpGetAlignedFaction(player); - if (intFaction == 0 && !factions.isRebelHelper(player) && !factions.isImperialHelper(player)) - { - return; - } - - int playerPvpType = pvpGetType(player); - - if (!factions.isRebelHelper(player) && !factions.isImperialHelper(player)) - { - if (grantGcwOverwriteAmt == 0) - { - int gcwGroundQuestValue = gcw.getGcwGroundQuestAward(player, questTier); - gcw._grantGcwPoints(null, player, gcwGroundQuestValue, false, gcw.GCW_POINT_TYPE_GROUND_QUEST, questGetQuestName(questCrc)); - } - else if (grantGcwOverwriteAmt > 0) - { - if (playerPvpType == PVPTYPE_DECLARED && grantGcwSFModifier != 0) - { - grantGcwOverwriteAmt *= grantGcwSFModifier; - } - - gcw._grantGcwPoints(null, player, grantGcwOverwriteAmt, false, gcw.GCW_POINT_TYPE_GROUND_QUEST, questGetQuestName(questCrc)); - } - } - - if (factions.isRebelorRebelHelper(player) && grantGcwRebReward != null && grantGcwRebReward.length() > 0 && grantGcwRebRewardCount != 0) - { - boolean declared = false; - if (playerPvpType == PVPTYPE_DECLARED) - { - declared = true; - } - else if (factions.isRebelHelper(player) && pvpNeutralIsMercenaryDeclared(player)) - { - declared = true; - } - - if (declared && grantGcwSFRewardMultip != 0) - { - grantGcwRebRewardCount *= grantGcwSFRewardMultip; - } - - for (int i = 0; i < grantGcwRebRewardCount; i++) - { - testAbortScript(); - obj_id lootItem = static_item.createNewItemFunction(grantGcwRebReward, playerInv); - if (i == 0) - { - utils.addElement(lootItemsResizeable, lootItem); - if (grantGcwRebRewardCount == 1) - { - sendPlacedInInventorySystemMessage(player, lootItem); - } - else if (grantGcwRebRewardCount > 1) - { - sendPlacedMoreThanOneInInventorySystemMessage(player, lootItem, grantGcwRebRewardCount); - } - } - - CustomerServiceLog("QUEST_REWARD", player +" received reward "+ grantGcwRebReward + " ("+lootItem+")"); - } - } - else if (factions.isImperialorImperialHelper(player) && grantGcwImpReward != null && grantGcwImpReward.length() > 0 & grantGcwImpRewardCount != 0) - { - boolean declared = false; - - if (playerPvpType == PVPTYPE_DECLARED) - { - declared = true; - } - else if (factions.isImperialHelper(player) && pvpNeutralIsMercenaryDeclared(player)) - { - declared = true; - } - - if (declared && grantGcwSFRewardMultip != 0) - { - grantGcwImpRewardCount *= grantGcwSFRewardMultip; - } - - for (int i = 0; i < grantGcwImpRewardCount; i++) - { - testAbortScript(); - obj_id lootItem = static_item.createNewItemFunction(grantGcwImpReward, playerInv); - if (i == 0) - { - utils.addElement(lootItemsResizeable, lootItem); - if (grantGcwImpRewardCount == 1) - { - sendPlacedInInventorySystemMessage(player, lootItem); - } - else if (grantGcwImpRewardCount > 1) - { - sendPlacedMoreThanOneInInventorySystemMessage(player, lootItem, grantGcwImpRewardCount); - } - } - - CustomerServiceLog("QUEST_REWARD", player +" received reward "+ grantGcwImpReward+ " ("+lootItem+")"); - } - } - } - - if ((badgeName != null) && (!badgeName.equals("")) && (badgeName.length() > 0)) - { - if (!badge.hasBadge (player, badgeName)) - { - badge.grantBadge (player, badgeName); - } - } - - if ((item != null) && (item.length() > 0)) - { - for (int i = 0; i < itemCount; ++i) - { - testAbortScript(); - obj_id newItem = createObjectInInventoryAllowOverload(item, player); - sendPlacedInInventorySystemMessage(player, newItem, item); - CustomerServiceLog("QUEST_REWARD", player +" received reward "+ item +" ("+newItem+")"); - } - play2dNonLoopingSound(player, groundquests.MUSIC_QUEST_RECEIVED_ITEM); - } - - if ((weapon != null) && (weapon.length() > 0)) - { - for (int i = 0; i < weaponCount; ++i) - { - testAbortScript(); - obj_id newWeapon = weapons.createWeaponOverloaded(weapon, playerInv, weaponSpeed, weaponDamage, weaponEfficiency, weaponElementalValue); - sendPlacedInInventorySystemMessage(player, newWeapon, weapon); - CustomerServiceLog("QUEST_REWARD", player +" received reward "+ weapon +" ("+newWeapon+")"); - } - } - - if ((armor != null) && (armor.length() > 0)) - { - for (int i = 0; i < armorCount; ++i) - { - testAbortScript(); - obj_id armorItem = createObjectInInventoryAllowOverload (armor, player); - loot.randomizeArmor(armorItem, armorQuality); - sendPlacedInInventorySystemMessage(player, armorItem, armor); - CustomerServiceLog("QUEST_REWARD", player +" received reward "+ armor +" ("+armorItem+")"); - } - } - - for (int j = 0; j < inclusiveLootNames.length; ++j) - { - testAbortScript(); - if ((inclusiveLootNames[j] != null) && (inclusiveLootNames[j].length() > 0)) - { - dictionary inclusiveItemData = static_item.getMasterItemDictionary(inclusiveLootNames[j]); - boolean giveInclusiveItemInventoryMessage = true; - if (inclusiveItemData != null) - { - for (int i = 0; i < inclusiveLootCounts[j]; ++i) - { - testAbortScript(); - obj_id lootItem = static_item.createNewItemFunction(inclusiveLootNames[j], player); - - if (i == 0) - { - utils.addElement(lootItemsResizeable, lootItem); - } - - CustomerServiceLog("QUEST_REWARD", player +" received reward "+ inclusiveLootNames[j]+ " ("+lootItem+")"); - - if (giveInclusiveItemInventoryMessage) - { - sendPlacedInInventorySystemMessage(player, lootItem, inclusiveLootNames[j]); - } - if (inclusiveItemData.containsKey("scripts")) - { - String inclusiveItemScriptList = inclusiveItemData.getString("scripts"); - if (inclusiveItemScriptList != null && inclusiveItemScriptList.length() > 0 && inclusiveItemScriptList.indexOf("autostack") > -1) - { - giveInclusiveItemInventoryMessage = false; - } - } - } - } - } - } - - if ((exclusiveLootChoiceName != null) && (exclusiveLootChoiceName.length() > 0)) - { - dictionary exclusiveItemData = static_item.getMasterItemDictionary(exclusiveLootChoiceName); - boolean giveExclusiveItemInventoryMessage = true; - if (exclusiveItemData != null) - { - for (int i = 0; i < exclusiveLootChoiceCount; ++i) - { - testAbortScript(); - obj_id lootItem = static_item.createNewItemFunction(exclusiveLootChoiceName, player); - - if (i == 0) - { - utils.addElement(lootItemsResizeable, lootItem); - } - - CustomerServiceLog("QUEST_REWARD", player +" received reward "+ exclusiveLootChoiceName+ " ("+lootItem+")"); - - if (giveExclusiveItemInventoryMessage) - { - sendPlacedInInventorySystemMessage(player, lootItem, exclusiveLootChoiceName); - } - if (exclusiveItemData.containsKey("scripts")) - { - String exclusiveItemScriptList = exclusiveItemData.getString("scripts"); - if (exclusiveItemScriptList != null && exclusiveItemScriptList.length() > 0 && exclusiveItemScriptList.indexOf("autostack") > -1) - { - giveExclusiveItemInventoryMessage = false; - } - } - } - } - } - - if (useShowLootBox) - { - if (lootItemsResizeable.size() > 0) - { - obj_id[] lootItems = new obj_id[0]; - if (lootItemsResizeable != null) - { - lootItems = new obj_id[lootItemsResizeable.size()]; - lootItemsResizeable.toArray(lootItems); - } - showLootBox(player, lootItems); - } - } - - return; - } - - - public static boolean playerNeedsToRetrieveThisItem(obj_id player, obj_id item) throws InterruptedException - { - - return playerNeedsToRetrieveThisItem(player, item, "retrieve_item"); - } - - - public static boolean playerNeedsToRetrieveThisItem(obj_id player, obj_id item, String taskType) throws InterruptedException - { - if (isMob(item) && isIncapacitated(item)) - { - return false; - } - - boolean needed = false; - - String itemTemplateName = getTemplateName(item); - - dictionary tasks = groundquests.getActiveTasksForTaskType(player, taskType); - if ((tasks != null) && !tasks.isEmpty()) - { - java.util.Enumeration keys = tasks.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String questCrcString = (String)keys.nextElement(); - int questCrc = utils.stringToInt(questCrcString); - int[] tasksForCurrentQuest = tasks.getIntArray(questCrcString); - - for (int i = 0; i < tasksForCurrentQuest.length; ++i) - { - testAbortScript(); - int taskId = tasksForCurrentQuest[i]; - String baseObjVar = groundquests.getBaseObjVar(player, taskType, questGetQuestName(questCrc), taskId); - String retrieveTemplateName = groundquests.getTaskStringDataEntry(questCrc, taskId, "SERVER_TEMPLATE"); - if (retrieveTemplateName != null && itemTemplateName.equals(retrieveTemplateName)) - { - needed = true; - - String objvarRetrievedFull = baseObjVar + dot + "retrieved_items"; - if (hasObjVar(player, objvarRetrievedFull)) - { - obj_id[] itemsAlreadyRetrieved = getObjIdArrayObjVar(player, objvarRetrievedFull); - for (int j = 0; j < itemsAlreadyRetrieved.length; ++j) - { - testAbortScript(); - obj_id itemAlredyRetrieved = itemsAlreadyRetrieved[j]; - if (item == itemAlredyRetrieved) - { - needed = false; - } - } - } - } - } - } - } - - return needed; - } - - - public static String getRetrieveMenuText(obj_id player, obj_id item) throws InterruptedException - { - - return getRetrieveMenuText(player, item, "retrieve_item"); - } - - - public static String getRetrieveMenuText(obj_id player, obj_id item, String taskType) throws InterruptedException - { - String menuText = null; - String itemTemplateName = getTemplateName(item); - boolean menuTextSet = false; - - dictionary tasks = groundquests.getActiveTasksForTaskType(player, taskType); - if ((tasks != null) && !tasks.isEmpty()) - { - java.util.Enumeration keys = tasks.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String questCrcString = (String)keys.nextElement(); - int questCrc = utils.stringToInt(questCrcString); - int[] tasksForCurrentQuest = tasks.getIntArray(questCrcString); - - for (int i = 0; i < tasksForCurrentQuest.length; ++i) - { - testAbortScript(); - int taskId = tasksForCurrentQuest[i]; - String baseObjVar = groundquests.getBaseObjVar(player, taskType, questGetQuestName(questCrc), taskId); - String retrieveTemplateName = groundquests.getTaskStringDataEntry(questCrc, taskId, "SERVER_TEMPLATE"); - - if (retrieveTemplateName != null && itemTemplateName.equals(retrieveTemplateName)) - { - - String tempMenuText = groundquests.getTaskStringDataEntry(questCrc, taskId, "RETRIEVE_MENU_TEXT"); - - if (tempMenuText != null && tempMenuText.length() > 0) - { - if (!menuTextSet) - { - menuText = tempMenuText; - groundquests.questOutputDebugInfo(player, questCrc, taskId, taskType, "getRetrieveMenuText", - "Menu text is ["+ menuText + "]"); - - menuTextSet = true; - } - else - { - - groundquests.questOutputDebugInfo(player, questCrc, taskId, taskType, "getRetrieveMenuText", - "Item used for multiple quests! Resetting menu to default. ["+ itemTemplateName + "]"); - - menuText = null; - } - } - } - } - } - } - - return menuText; - } - - - public static int getQuestCountdownTime(obj_id player, obj_id item) throws InterruptedException - { - - return getQuestCountdownTime(player, item, "retrieve_item"); - } - - - public static int getQuestCountdownTime(obj_id player, obj_id item, String taskType) throws InterruptedException - { - int countdownTime = 0; - String itemTemplateName = getTemplateName(item); - - dictionary tasks = groundquests.getActiveTasksForTaskType(player, taskType); - if ((tasks != null) && !tasks.isEmpty()) - { - java.util.Enumeration keys = tasks.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String questCrcString = (String)keys.nextElement(); - int questCrc = utils.stringToInt(questCrcString); - int[] tasksForCurrentQuest = tasks.getIntArray(questCrcString); - - for (int i = 0; i < tasksForCurrentQuest.length; ++i) - { - testAbortScript(); - int taskId = tasksForCurrentQuest[i]; - String baseObjVar = groundquests.getBaseObjVar(player, taskType, questGetQuestName(questCrc), taskId); - String retrieveTemplateName = groundquests.getTaskStringDataEntry(questCrc, taskId, "SERVER_TEMPLATE"); - - if (retrieveTemplateName != null && itemTemplateName.equals(retrieveTemplateName)) - { - countdownTime = groundquests.getTaskIntDataEntry(questCrc, taskId, "COUNTDOWN_TIMER"); - - if (countdownTime < 0) - { - countdownTime = 0; - } - } - } - } - } - - return countdownTime; - } - - - public static int getQuestExperienceReward(obj_id player, int questLevel, int questTier, int experienceAmount) throws InterruptedException - { - - if (questLevel < 1 || questTier < 0) - { - return experienceAmount; - } - - if (questTier == 0) - { - return 0; - } - - if (questTier > 6) - { - questTier = 6; - } - - final String[] tierColumns = - { - dataTableColumnQuestRewardExperienceTeir1, - dataTableColumnQuestRewardExperienceTeir2, - dataTableColumnQuestRewardExperienceTeir3, - dataTableColumnQuestRewardExperienceTeir4, - dataTableColumnQuestRewardExperienceTeir5, - dataTableColumnQuestRewardExperienceTeir6 - }; - - int questXp = dataTableGetInt(QUEST_EXPERIENCE_TABLE, ""+questLevel, tierColumns[questTier-1]); - int xpCap = getQuestXpCap(player); - - if (questXp > xpCap) - { - questXp = xpCap; - } - - return questXp; - } - - - public static int getQuestXpCap(obj_id player) throws InterruptedException - { - int level = getLevel(player); - - int xpCurrentLevel = dataTableGetInt("datatables/player/player_level.iff", level, "xp_required"); - int xpPreviousLevel = dataTableGetInt("datatables/player/player_level.iff", level-1, "xp_required"); - - int xpRequired = xpCurrentLevel - xpPreviousLevel; - int xpCap = xpRequired / 2; - - if (xpCap < 0) - { - xpCap = 0; - } - - return xpCap; - } - - - public static void createQuestWaypoints(int questCrc, int taskId, obj_id self) throws InterruptedException - { - boolean createWaypoint = groundquests.getTaskIntDataEntry(questCrc, taskId, dataTableColumnCreateWaypoint) > 0; - - boolean createEntranceWaypoint = groundquests.getTaskIntDataEntry(questCrc, taskId, dataTableColumnEntranceCreateWaypoint) > 0; - - if (createWaypoint && createEntranceWaypoint) - { - String entranceWaypointName = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnEntranceWaypointName); - float entranceWorldLocationX = utils.stringToFloat(groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnEntranceLocationX)); - float entranceWorldLocationY = utils.stringToFloat(groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnEntranceLocationY)); - float entranceWorldLocationZ = utils.stringToFloat(groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnEntranceLocationZ)); - String planetName = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnPlanetName); - - location loc = new location(entranceWorldLocationX, entranceWorldLocationY, entranceWorldLocationZ, planetName); - - obj_id entranceWaypoint = createWaypointInDatapad(self, loc); - - setWaypointColor(entranceWaypoint, "entrance"); - - String baseObjVar = groundquests.getBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - setObjVar(self, baseObjVar + dot + objvarEntranceWaypoint, entranceWaypoint); - - setWaypointName(entranceWaypoint, entranceWaypointName); - - setQuestWaypointActive(entranceWaypoint, self, baseObjVar); - } - - if (createWaypoint) - { - String planetName = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnPlanetName); - String waypointName = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnWaypointName); - float worldLocationX = utils.stringToFloat(groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnLocationX)); - float worldLocationY = utils.stringToFloat(groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnLocationY)); - float worldLocationZ = utils.stringToFloat(groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnLocationZ)); - String interiorWaypointAppearance = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnInteriorWaypointAppearance); - String waypointBuildingCellName = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnWaypointBuildingCellName); - - groundquests.questOutputDebugInfo(self, questCrc, taskId, taskType, "OnTaskActivated", - taskType + " creating waypoint: "+ planetName + ": "+ worldLocationX + ", "+ worldLocationY + ", "+ worldLocationZ); - - location loc = new location(worldLocationX, worldLocationY, worldLocationZ, planetName); - obj_id waypoint = null; - - if (interiorWaypointAppearance != null && waypointBuildingCellName != null && interiorWaypointAppearance.length() > 0 && waypointBuildingCellName.length() > 0) - { - waypoint = createWaypointInDatapadInternal(self, loc, interiorWaypointAppearance, waypointBuildingCellName); - } - else - { - waypoint = createWaypointInDatapad(self, loc); - } - - if (createEntranceWaypoint) - { - setWaypointColor(waypoint, "small"); - } - - String baseObjVar = groundquests.getBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - setObjVar(self, baseObjVar + dot + objvarWaypoint, waypoint); - - setWaypointName(waypoint, waypointName); - - setQuestWaypointActive(waypoint, self, baseObjVar); - } - } - - - public static void setQuestWaypointActive(obj_id waypoint, obj_id player, String baseObjVar) throws InterruptedException - { - String objvarFullName = baseObjVar + dot + groundquests.objvarWaypointInActive; - - if (utils.waypointExists(player, waypoint)) - { - location waypointLoc = getWaypointLocation(waypoint); - String waypointPlanet = waypointLoc.area; - - location playerLoc = getLocation(player); - String playerPlanet = playerLoc.area; - - if (waypointPlanet.equals(playerPlanet)) - { - if (hasObjVar(player, objvarFullName)) - { - removeObjVar(player, objvarFullName); - } - - setWaypointActive(waypoint, true); - } - else - { - if (!hasObjVar(player, objvarFullName)) - { - setObjVar(player, objvarFullName, true); - } - } - } - else - { - if (hasObjVar(player, objvarFullName)) - { - removeObjVar(player, objvarFullName); - } - } - return; - } - - - public static obj_id getObjIdForWaypoint(int questCrc, int taskId, obj_id self) throws InterruptedException - { - String baseObjVar = groundquests.getBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - String baseWaypoint = baseObjVar + dot + objvarWaypoint; - return getObjIdObjVar(self, baseWaypoint); - } - - - public static obj_id getObjIdForEntranceWaypoint(int questCrc, int taskId, obj_id self) throws InterruptedException - { - String baseObjVar = groundquests.getBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - String doorWaypoint = baseObjVar + dot + objvarEntranceWaypoint; - return getObjIdObjVar(self, doorWaypoint); - } - - - public static void deleteQuestWaypoints(int questCrc, int taskId, boolean isForCTS, obj_id self) throws InterruptedException - { - String baseObjVar = groundquests.getBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - String baseWaypoint = baseObjVar + dot + objvarWaypoint; - String doorWaypoint = baseObjVar + dot + objvarEntranceWaypoint; - obj_id waypoint = getObjIdObjVar(self, baseWaypoint); - - if (isIdValid(waypoint)) - { - removeObjVar(self, baseWaypoint); - - if (isForCTS == false) - { - destroyWaypointInDatapad(waypoint, self); - } - } - - obj_id entranceWaypoint = getObjIdObjVar(self, doorWaypoint); - - if (isIdValid(entranceWaypoint)) - { - removeObjVar(self, doorWaypoint); - - if (isForCTS == false) - { - destroyWaypointInDatapad(entranceWaypoint, self); - } - } - } - - - public static void reattachQuestScripts(obj_id self) throws InterruptedException - { - - obj_var_list scriptList = getObjVarList(self, questBaseObjVar + dot + "script"); - - if (scriptList != null) - { - String[] scriptNames = scriptList.getAllObjVarNames(); - int numScripts = scriptNames.length; - for (int i = 0; i < numScripts; ++i) - { - testAbortScript(); - - obj_var oneScript = scriptList.getObjVar(scriptNames[i]); - if (oneScript.getIntData() > 0) - { - - if (!self.hasScript(scriptNames[i])) - { - attachScript(self, scriptNames[i]); - } - } - } - - } - } - - - public static void refreshQuestWaypoints(int questCrc, int taskId, boolean isForCTS, obj_id self) throws InterruptedException - { - deleteQuestWaypoints (questCrc, taskId, isForCTS, self); - - createQuestWaypoints( questCrc, taskId, self); - } - - - public static void setGuaranteedSuccessTarget(obj_id player, int questCrc, int taskId, String baseObjVar) throws InterruptedException - { - String guaranteedSuccessTargetObjVar = baseObjVar + dot + objvarGuaranteedSuccess_Target; - String guaranteedSuccessCountObjVar = baseObjVar + dot + objvarGuaranteedSuccess_Count; - - if (hasObjVar(player, guaranteedSuccessTargetObjVar)) - { - removeObjVar(player, guaranteedSuccessTargetObjVar); - } - if (hasObjVar(player, guaranteedSuccessCountObjVar)) - { - removeObjVar(player, guaranteedSuccessCountObjVar); - } - - int minNumAttempts = groundquests.getTaskIntDataEntry(questCrc, taskId, dataTableColumnGuaranteedSuccessMin); - int maxNumAttempts = groundquests.getTaskIntDataEntry(questCrc, taskId, dataTableColumnGuaranteedSuccessMax); - - if (minNumAttempts > 0 && maxNumAttempts > 0) - { - int target = 0; - - if (minNumAttempts >= maxNumAttempts) - { - target = minNumAttempts; - } - else - { - target = rand(minNumAttempts,maxNumAttempts); - } - - if (target > 0) - { - setObjVar(player, guaranteedSuccessCountObjVar, 0); - setObjVar(player, guaranteedSuccessTargetObjVar, target); - } - } - - return; - } - - - public static boolean checkForGuaranteedSuccess(obj_id player, String baseObjVar) throws InterruptedException - { - String guaranteedSuccessTargetObjVar = baseObjVar + dot + objvarGuaranteedSuccess_Target; - String guaranteedSuccessCountObjVar = baseObjVar + dot + objvarGuaranteedSuccess_Count; - - boolean passed = false; - - if (hasObjVar(player, guaranteedSuccessTargetObjVar)) - { - int guaranteedSuccessTarget = getIntObjVar(player, guaranteedSuccessTargetObjVar); - - int guaranteedSuccessCount = 1; - if (hasObjVar(player, guaranteedSuccessCountObjVar)) - { - guaranteedSuccessCount = getIntObjVar(player, guaranteedSuccessCountObjVar) + 1; - } - - setObjVar(player, guaranteedSuccessCountObjVar, guaranteedSuccessCount); - - if (guaranteedSuccessCount >= guaranteedSuccessTarget) - { - passed = true; - } - } - - return passed; - } - - - public static boolean isDoingSmugglerMission(obj_id player) throws InterruptedException - { - if ((isQuestActive (player, "smuggle_generic_1") || isQuestActive (player, "smuggle_generic_2") || isQuestActive (player, "smuggle_generic_3") || isQuestActive (player, "smuggle_generic_4") || isQuestActive (player, "smuggle_generic_5"))) - { - return true; - } - - if ((isQuestActive (player, "smuggle_illicit_1") || isQuestActive (player, "smuggle_illicit_2") || isQuestActive (player, "smuggle_illicit_3") || isQuestActive (player, "smuggle_illicit_4") || isQuestActive (player, "smuggle_illicit_5"))) - { - return true; - } - - if (isQuestActive (player, "smuggle_pvp_4") || isQuestActive (player, "smuggle_pvp_5")) - { - return true; - } - - return false; - } - - - public static float getPlayerPlayedTimeWhenTimerEnds(obj_id player, int questCrc, int taskId) throws InterruptedException - { - String baseObjVar = groundquests.getBaseObjVar(player, "base_task", questGetQuestName(questCrc), taskId); - - if (hasObjVar(player, baseObjVar + dot + timeObjVar)) - { - return getFloatObjVar(player, baseObjVar + dot + timeObjVar); - } - - return -1.f; - } - - - public static boolean isTimeRemainingBeforeCompletion(obj_id player, int questCrc, int taskId) throws InterruptedException - { - final int remainingTime = getTaskIntDataEntry(questCrc, taskId, dataTableColumnRemainingTime); - - if (remainingTime > 0) - { - final int endTime = (int)getPlayerPlayedTimeWhenTimerEnds(player, questCrc, taskId); - - if (endTime > 0) - { - final int timeLeft = endTime - getPlayerPlayedTime(player) - remainingTime; - - if (timeLeft > 0) - { - prose_package pp = prose.getPackage(SID_TIME_REMAINING_BEFORE_COMPLETION, player, player); - prose.setDI(pp, timeLeft); - sendSystemMessageProse(player, pp); - - return true; - } - } - } - - return false; - } - - - public static boolean gcwActiveDutyCheck(obj_id self, obj_id player) throws InterruptedException - { - if (hasObjVar(self, "questRequireActiveDuty")) - { - if (factions.isOnLeave(player)) - { - return false; - } - } - - return true; - } - - - public static boolean completeTaskForGroupMembersInRange(obj_id questObj, obj_id player, int questCrc, int taskId) throws InterruptedException - { - return completeTaskForGroupMembersInRange(questObj, player, questCrc, taskId, 200.0f); - } - - - public static boolean completeTaskForGroupMembersInRange(obj_id questObj, obj_id player, int questCrc, int taskId, float range) throws InterruptedException - { - boolean result = false; - - if (!isIdValid(player) || !exists(player) || !player.isLoaded()) - { - return result; - } - - obj_id[] groupies = getGroupMembersInRange(questObj, player, range); - if (groupies != null && groupies.length > 0) - { - for (int i = 0; i < groupies.length; i++) - { - testAbortScript(); - obj_id groupMember = groupies[i]; - if (isIdValid(groupMember)) - { - if (questIsTaskActive(questCrc, taskId, groupMember)) - { - questCompleteTask(questCrc, taskId, groupMember); - result = true; - } - } - } - } - - return result; - } - - - public static obj_id[] getGroupMembersInRange(obj_id questObj, obj_id player) throws InterruptedException - { - return getGroupMembersInRange(questObj, player, 200.0f); - } - - - public static obj_id[] getGroupMembersInRange(obj_id questObj, obj_id player, float range) throws InterruptedException - { - Vector groupMembersInRange = new Vector(); - groupMembersInRange.setSize(0); - - obj_id gid = getGroupObject(player); - if (!isIdValid(gid)) - { - return null; - } - - obj_id[] groupies = getGroupMemberIds(gid); - if (groupies != null && groupies.length > 0) - { - location controllerLoc = getWorldLocation(questObj); - for (int i = 0; i < groupies.length; i++) - { - testAbortScript(); - obj_id groupMember = groupies[i]; - if (isIdValid(groupMember) && groupMember.isLoaded() && isPlayer(groupMember)) - { - location groupieLoc = getWorldLocation(groupMember); - if (getDistance(controllerLoc, groupieLoc) <= range) - { - utils.addElement(groupMembersInRange, groupMember); - } - } - } - } - - obj_id[] staticGroupMembersInRange = utils.toStaticObjIdArray(groupMembersInRange); - if (staticGroupMembersInRange != null && staticGroupMembersInRange.length > 0) - { - return staticGroupMembersInRange; - } - - return null; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/library/guild.java b/sku.0/sys.server/compiled/game/script/library/guild.java deleted file mode 100644 index 9ffc8b7b6..000000000 --- a/sku.0/sys.server/compiled/game/script/library/guild.java +++ /dev/null @@ -1,1163 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - - -public class guild extends script.base_script -{ - public guild() - { - } - public static final int GUILD_PERMISSION_MEMBER = (1<<0); - public static final int GUILD_PERMISSION_SPONSOR = (1<<1); - public static final int GUILD_PERMISSION_DISBAND = (1<<2); - public static final int GUILD_PERMISSION_ACCEPT = (1<<3); - public static final int GUILD_PERMISSION_KICK = (1<<4); - public static final int GUILD_PERMISSION_MAIL = (1<<5); - public static final int GUILD_PERMISSION_TITLE = (1<<6); - public static final int GUILD_PERMISSION_NAMECHANGE = (1<<7); - public static final int GUILD_PERMISSION_WAR = (1<<8); - - public static final int GUILD_PERMISSIONS_NONE = 0; - public static final int GUILD_PERMISSIONS_ALL = -1; - - public static final String GUILD_MAIL_DISBAND_SUBJECT = "@guildmail:disband_subject"; - public static final string_id GUILD_MAIL_DISBAND_TEXT = new string_id("guildmail", "disband_text"); - public static final string_id GUILD_MAIL_DISBAND_NOT_ENOUGH_MEMBERS_TEXT = new string_id("guildmail", "disband_not_enough_members_text"); - public static final String GUILD_MAIL_SPONSOR_SUBJECT = "@guildmail:sponsor_subject"; - public static final string_id GUILD_MAIL_SPONSOR_TEXT = new string_id("guildmail", "sponsor_text"); - public static final String GUILD_MAIL_ACCEPT_SUBJECT = "@guildmail:accept_subject"; - public static final string_id GUILD_MAIL_ACCEPT_TEXT = new string_id("guildmail", "accept_text"); - public static final String GUILD_MAIL_ACCEPT_TARGET_SUBJECT = "@guildmail:accept_target_subject"; - public static final string_id GUILD_MAIL_ACCEPT_TARGET_TEXT = new string_id("guildmail", "accept_target_text"); - public static final String GUILD_MAIL_KICK_SUBJECT = "@guildmail:kick_subject"; - public static final string_id GUILD_MAIL_KICK_TEXT = new string_id("guildmail", "kick_text"); - public static final String GUILD_MAIL_DECLINE_SUBJECT = "@guildmail:decline_subject"; - public static final string_id GUILD_MAIL_DECLINE_TEXT = new string_id("guildmail", "decline_text"); - public static final String GUILD_MAIL_DECLINE_TARGET_SUBJECT = "@guildmail:decline_target_subject"; - public static final string_id GUILD_MAIL_DECLINE_TARGET_TEXT = new string_id("guildmail", "decline_target_text"); - public static final String GUILD_MAIL_NAMECHANGE_SUBJECT = "@guildmail:namechange_subject"; - public static final string_id GUILD_MAIL_NAMECHANGE_TEXT = new string_id("guildmail", "namechange_text"); - public static final String GUILD_MAIL_LEADERCHANGE_SUBJECT = "@guildmail:leaderchange_subject"; - public static final string_id GUILD_MAIL_LEADERCHANGE_TEXT = new string_id("guildmail", "leaderchange_text"); - public static final String GUILD_MAIL_LEAVE_SUBJECT = "@guildmail:leave_subject"; - public static final string_id GUILD_MAIL_LEAVE_TEXT = new string_id("guildmail", "leave_text"); - - public static final string_id SID_GUILD_CREATE_FAIL_IN_GUILD = new string_id ("guild", "create_fail_in_guild"); - public static final string_id SID_GUILD_CREATE_FAIL_NAME_BAD_LENGTH = new string_id ("guild", "create_fail_name_bad_length"); - public static final string_id SID_GUILD_CREATE_FAIL_ABBREV_BAD_LENGTH = new string_id ("guild", "create_fail_abbrev_bad_length"); - public static final string_id SID_GUILD_CREATE_FAIL_NAME_IN_USE = new string_id ("guild", "create_fail_name_in_use"); - public static final string_id SID_GUILD_CREATE_FAIL_ABBREV_IN_USE = new string_id ("guild", "create_fail_abbrev_in_use"); - public static final string_id SID_GUILD_CREATE_FAIL_NAME_NOT_ALLOWED = new string_id ("guild", "create_fail_name_not_allowed"); - public static final string_id SID_GUILD_CREATE_FAIL_ABBREV_NOT_ALLOWED = new string_id ("guild", "create_fail_abbrev_not_allowed"); - public static final string_id SID_GUILD_SPONSOR_FAIL_FULL = new string_id ("guild", "sponsor_fail_full"); - public static final string_id SID_GUILD_SPONSOR_ALREADY_IN_GUILD = new string_id ("guild", "sponsor_already_in_guild"); - public static final string_id SID_GUILD_TITLE_FAIL_BAD_LENGTH = new string_id ("guild", "title_fail_bad_length"); - public static final string_id SID_GUILD_TITLE_FAIL_NOT_ALLOWED = new string_id ("guild", "title_fail_not_allowed"); - public static final string_id SID_GUILD_GENERIC_FAIL_NO_PERMISSION = new string_id ("guild", "generic_fail_no_permission"); - public static final string_id SID_GUILD_LEAVE_FAIL_LEADER_TRIED_TO_LEAVE = new string_id ("guild", "leave_fail_leader_tried_to_leave"); - public static final string_id SID_GUILD_WAR_FAIL_NO_SUCH_GUILD = new string_id ("guild", "war_fail_no_such_guild"); - public static final string_id SID_GUILD_KICK_SELF = new string_id ("guild", "kick_self"); - public static final string_id SID_GUILD_KICK_TARGET = new string_id ("guild", "kick_target"); - public static final string_id SID_GUILD_DECLINE_SELF = new string_id ("guild", "decline_self"); - public static final string_id SID_GUILD_DECLINE_TARGET = new string_id ("guild", "decline_target"); - public static final string_id SID_GUILD_SPONSOR_SELF = new string_id ("guild", "sponsor_self"); - public static final string_id SID_GUILD_SPONSOR_TARGET = new string_id ("guild", "sponsor_target"); - public static final string_id SID_GUILD_ACCEPT_SELF = new string_id ("guild", "accept_self"); - public static final string_id SID_GUILD_ACCEPT_TARGET = new string_id ("guild", "accept_target"); - public static final string_id SID_GUILD_LEAVE_SELF = new string_id ("guild", "leave_self"); - public static final string_id SID_GUILD_TITLE_SELF = new string_id ("guild", "title_self"); - public static final string_id SID_GUILD_TITLE_TARGET = new string_id ("guild", "title_target"); - public static final string_id SID_GUILD_NAMECHANGE_FAIL_ABBREV_BAD_LENGTH = new string_id ("guild", "namechange_fail_abbrev_bad_length"); - public static final string_id SID_GUILD_NAMECHANGE_FAIL_NAME_BAD_LENGTH = new string_id ("guild", "namechange_fail_name_bad_length"); - public static final string_id SID_GUILD_NAMECHANGE_FAIL_ABBREV_NOT_ALLOWED = new string_id ("guild", "namechange_fail_abbrev_not_allowed"); - public static final string_id SID_GUILD_NAMECHANGE_FAIL_NAME_NOT_ALLOWED = new string_id ("guild", "namechange_fail_name_not_allowed"); - public static final string_id SID_GUILD_NAMECHANGE_SELF = new string_id ("guild", "namechange_self"); - public static final string_id SID_GUILD_ALLEGIANCE_SELF = new string_id ("guild", "allegiance_self"); - public static final string_id SID_GUILD_ALLEGIANCE_UNCHANGED_SELF = new string_id ("guild", "allegiance_unchanged_self"); - - public static final int MAX_MEMBERS_PER_GUILD = 500; - - - public static String resolveGuildName(int guildId) throws InterruptedException - { - if (guildId != 0) - { - String guildName = guildGetName(guildId); - if (guildName != null && !guildName.equals("")) - { - return guildName; - } - return "unknown"; - } - return "none"; - } - - - public static String resolveMemberName(int guildId, obj_id who) throws InterruptedException - { - if (isIdValid(who)) - { - - { - String s = getName(who); - if (s != null && !s.equals("")) - { - return s; - } - } - - { - String s = guildGetMemberName(guildId, who); - if (s != null && !s.equals("")) - { - return s; - } - } - return "unknown"; - } - return "none"; - } - - - public static void GuildLog(int guildId, String command, obj_id actor, obj_id target, String description) throws InterruptedException - { - String guildDesc = resolveGuildName(guildId); - String actorDesc = resolveMemberName(guildId, actor); - - CustomerServiceLog("Guild", "[command="+command+"] [guild="+guildId+"("+guildDesc+")] [actor="+actor+"("+resolveMemberName(guildId, actor)+")] [target="+target+"("+resolveMemberName(guildId, target)+")] - "+ description); - } - - - public static String buildFakeLocalizedProse(String rawText, String substitute1, String substitute2) throws InterruptedException - { - if (rawText.startsWith("@")) - { - String cookedText = new String(rawText); - - string_id id = new string_id(rawText.substring(1, rawText.indexOf(":")), rawText.substring(rawText.indexOf(":")+1, rawText.length())); - cookedText = localize(id); - - int pos1 = cookedText.indexOf("%TU"); - if (pos1 != -1) - { - cookedText = cookedText.substring(0, pos1) + substitute1 + cookedText.substring(pos1+3, cookedText.length()); - } - - int pos2 = cookedText.indexOf("%TT"); - if (pos2 != -1) - { - cookedText = cookedText.substring(0, pos2) + substitute2 + cookedText.substring(pos2+3, cookedText.length()); - } - return cookedText; - } - else - { - return rawText; - } - } - - - public static boolean hasGuildPermission(int guildId, obj_id who, int permission) throws InterruptedException - { - if (guildId == 0) - { - return false; - } - if (isGod(who)) - { - return true; - } - if ((guildGetMemberPermissions(guildId, who) & permission) == permission) - { - return true; - } - return false; - } - - - public static boolean hasDeclaredWarAgainst(int guildId, int enemyId) throws InterruptedException - { - int[] enemies = guildGetEnemies(guildId); - if (enemies != null) - { - for (int i = 0; i < enemies.length; ++i) - { - testAbortScript(); - if (enemies[i] == enemyId) - { - return true; - } - } - } - return false; - } - - - public static void create(obj_id actor, String guildName, String guildAbbrev) throws InterruptedException - { - if (getGuildId(actor) != 0) - { - sendSystemMessage(actor, SID_GUILD_CREATE_FAIL_IN_GUILD); - } - else if (guildAbbrev.length() < 1 || guildAbbrev.length() > 5) - { - sendSystemMessage(actor, SID_GUILD_CREATE_FAIL_ABBREV_BAD_LENGTH); - } - else if (guildName.length() < 1 || guildName.length() > 25) - { - sendSystemMessage(actor, SID_GUILD_CREATE_FAIL_NAME_BAD_LENGTH); - } - else if (findGuild(guildAbbrev) != 0) - { - sendSystemMessage(actor, SID_GUILD_CREATE_FAIL_ABBREV_IN_USE); - } - else if (findGuild(guildName) != 0) - { - sendSystemMessage(actor, SID_GUILD_CREATE_FAIL_NAME_IN_USE); - } - else if (isNameReserved(guildAbbrev)) - { - sendSystemMessage(actor, SID_GUILD_CREATE_FAIL_ABBREV_NOT_ALLOWED); - } - else if (isNameReserved(guildName)) - { - sendSystemMessage(actor, SID_GUILD_CREATE_FAIL_NAME_NOT_ALLOWED); - } - else - { - int guildId = createGuild(guildName, guildAbbrev); - if (guildId != 0) - { - GuildLog(guildId, "create", actor, null, "guildName='"+guildName+"' guildAbbrev='"+guildAbbrev+"'"); - guildSetMemberInfo(guildId, actor, GUILD_PERMISSIONS_ALL, "", actor); - guildSetLeader(guildId, actor); - } - } - } - - - public static void changeLeader(int guildId, obj_id newLeader) throws InterruptedException - { - obj_id oldLeader = guildGetLeader(guildId); - if (oldLeader != newLeader && isIdValid(newLeader)) - { - GuildLog(guildId, "changeLeader", null, newLeader, ""); - mailToGuild(guildId, GUILD_MAIL_LEADERCHANGE_SUBJECT, GUILD_MAIL_LEADERCHANGE_TEXT, guildGetMemberName(guildId, newLeader)); - obj_id[] memberIds = getMemberIds(guildId, false, true); - - if (findObjIdTableOffset(memberIds, oldLeader) != -1) - { - guildSetMemberInfo( - guildId, - oldLeader, - GUILD_PERMISSION_MEMBER, - guildGetMemberTitle(guildId, oldLeader), - guildGetMemberAllegiance(guildId, oldLeader)); - } - - guildSetLeader(guildId, newLeader); - - if (findObjIdTableOffset(memberIds, newLeader) != -1) - { - guildSetMemberInfo( - guildId, - newLeader, - GUILD_PERMISSIONS_ALL, - guildGetMemberTitle(guildId, newLeader), - guildGetMemberAllegiance(guildId, newLeader)); - } - } - } - - - public static void disbandForNotEnoughMembers(int guildId) throws InterruptedException - { - GuildLog(guildId, "disbandForNotEnoughMembers", null, null, ""); - mailToGuild(guildId, GUILD_MAIL_DISBAND_SUBJECT, GUILD_MAIL_DISBAND_NOT_ENOUGH_MEMBERS_TEXT); - disbandGuild(guildId); - } - - - public static void disband(int guildId, obj_id actor) throws InterruptedException - { - if (!hasGuildPermission(guildId, actor, GUILD_PERMISSION_DISBAND)) - { - sendSystemMessage(actor, SID_GUILD_GENERIC_FAIL_NO_PERMISSION); - } - else - { - GuildLog(guildId, "disband", actor, null, ""); - mailToGuild(guildId, GUILD_MAIL_DISBAND_SUBJECT, GUILD_MAIL_DISBAND_TEXT, getName(actor)); - disbandGuild(guildId); - } - } - - - public static void sponsor(int guildId, obj_id actor, obj_id who) throws InterruptedException - { - if (isIdValid(who)) - { - if (getGuildId(who) != 0) - { - prose_package pp = new prose_package(); - pp.actor.set(getName(who)); - pp.stringId = SID_GUILD_SPONSOR_ALREADY_IN_GUILD; - sendSystemMessageProse(getChatName(actor), pp); - } - else if (!hasGuildPermission(guildId, actor, GUILD_PERMISSION_SPONSOR)) - { - sendSystemMessage(actor, SID_GUILD_GENERIC_FAIL_NO_PERMISSION); - } - else - { - obj_id[] members = guildGetMemberIds(guildId); - if (members.length >= MAX_MEMBERS_PER_GUILD) - { - sendSystemMessage(actor, SID_GUILD_SPONSOR_FAIL_FULL); - } - else - { - GuildLog(guildId, "sponsor", actor, who, ""); - prose_package pp = new prose_package(); - pp.target.set(guildGetName(guildId)); - pp.actor.set(getName(who)); - pp.stringId = SID_GUILD_SPONSOR_SELF; - sendSystemMessageProse(getChatName(actor), pp); - pp.actor.set(getName(actor)); - pp.stringId = SID_GUILD_SPONSOR_TARGET; - sendSystemMessageProse(getChatName(who), pp); - obj_id leader = guildGetLeader(guildId); - if (isIdValid(leader)) - { - mailToGuildMember(guildId, leader, GUILD_MAIL_SPONSOR_SUBJECT, GUILD_MAIL_SPONSOR_TEXT, getName(actor), getName(who)); - } - guildSetMemberInfo(guildId, who, GUILD_PERMISSIONS_NONE, "", obj_id.NULL_ID); - } - } - } - } - - - public static void accept(int guildId, obj_id actor, String who) throws InterruptedException - { - if (!hasGuildPermission(guildId, actor, GUILD_PERMISSION_ACCEPT)) - { - sendSystemMessage(actor, SID_GUILD_GENERIC_FAIL_NO_PERMISSION); - } - else - { - obj_id memberId = findMemberIdByName(guildId, who, true, false); - if (isIdValid(memberId)) - { - GuildLog(guildId, "accept", actor, memberId, ""); - String memberName = guildGetMemberName(guildId, memberId); - prose_package pp = new prose_package(); - pp.target.set(guildGetName(guildId)); - pp.actor.set(memberName); - pp.stringId = SID_GUILD_ACCEPT_SELF; - sendSystemMessageProse(getChatName(actor), pp); - pp.actor.set(getName(actor)); - pp.stringId = SID_GUILD_ACCEPT_TARGET; - sendSystemMessageProse(memberName, pp); - - mailToGuild(guildId, GUILD_MAIL_ACCEPT_SUBJECT, GUILD_MAIL_ACCEPT_TEXT, getName(actor), memberName); - - guildSetMemberInfo(guildId, memberId, GUILD_PERMISSION_MEMBER, "", guildGetLeader(guildId)); - - mailToPerson(guildId, memberName, GUILD_MAIL_ACCEPT_TARGET_SUBJECT, GUILD_MAIL_ACCEPT_TARGET_TEXT, getName(actor), guildGetName(guildId)); - } - } - } - - - public static void leave(obj_id actor) throws InterruptedException - { - int guildId = getGuildId(actor); - if (guildId != 0) - { - - if (actor == guildGetLeader(guildId)) - { - sendSystemMessage(actor, SID_GUILD_LEAVE_FAIL_LEADER_TRIED_TO_LEAVE); - } - else - { - GuildLog(guildId, "leave", actor, null, ""); - prose_package pp = new prose_package(); - pp.actor.set(guildGetName(guildId)); - pp.stringId = SID_GUILD_LEAVE_SELF; - sendSystemMessageProse(getChatName(actor), pp); - mailToGuild(guildId, GUILD_MAIL_LEAVE_SUBJECT, GUILD_MAIL_LEAVE_TEXT, getName(actor)); - guildRemoveMember(guildId, actor); - } - } - } - - - public static void kick(int guildId, obj_id actor, String who) throws InterruptedException - { - if (guildId == 0) - { - return; - } - - obj_id memberId = findMemberIdByName(guildId, who, false, true); - if (isIdValid(memberId)) - { - - if (memberId == actor) - { - leave(actor); - } - - else if (!hasGuildPermission(guildId, actor, GUILD_PERMISSION_KICK) || (!isGod(actor) && memberId == guildGetLeader(guildId))) - { - sendSystemMessage(actor, SID_GUILD_GENERIC_FAIL_NO_PERMISSION); - } - else - { - GuildLog(guildId, "kick", actor, memberId, "removing member"); - String memberName = guildGetMemberName(guildId, memberId); - prose_package pp = new prose_package(); - pp.target.set(guildGetName(guildId)); - pp.actor.set(memberName); - pp.stringId = SID_GUILD_KICK_SELF; - sendSystemMessageProse(getChatName(actor), pp); - pp.actor.set(getName(actor)); - pp.stringId = SID_GUILD_KICK_TARGET; - sendSystemMessageProse(memberName, pp); - mailToGuild(guildId, GUILD_MAIL_KICK_SUBJECT, GUILD_MAIL_KICK_TEXT, getName(actor), memberName); - guildRemoveMember(guildId, memberId); - } - } - - else - { - obj_id sponsoredId = findMemberIdByName(guildId, who, true, false); - if (isIdValid(sponsoredId)) - { - if (!hasGuildPermission(guildId, actor, GUILD_PERMISSION_ACCEPT)) - { - sendSystemMessage(actor, SID_GUILD_GENERIC_FAIL_NO_PERMISSION); - } - else - { - GuildLog(guildId, "kick", actor, memberId, "removing sponsored"); - String memberName = guildGetMemberName(guildId, sponsoredId); - prose_package pp = new prose_package(); - pp.target.set(guildGetName(guildId)); - pp.actor.set(memberName); - pp.stringId = SID_GUILD_DECLINE_SELF; - sendSystemMessageProse(getChatName(actor), pp); - pp.actor.set(getName(actor)); - pp.stringId = SID_GUILD_DECLINE_TARGET; - sendSystemMessageProse(memberName, pp); - - mailToGuild(guildId, GUILD_MAIL_DECLINE_SUBJECT, GUILD_MAIL_DECLINE_TEXT, getName(actor), memberName); - - guildRemoveMember(guildId, sponsoredId); - - mailToPerson(guildId, memberName, GUILD_MAIL_DECLINE_TARGET_SUBJECT, GUILD_MAIL_DECLINE_TARGET_TEXT, getName(actor), guildGetName(guildId)); - } - } - } - } - - - public static void title(int guildId, obj_id actor, String who, String title) throws InterruptedException - { - if (!hasGuildPermission(guildId, actor, GUILD_PERMISSION_TITLE)) - { - sendSystemMessage(actor, SID_GUILD_GENERIC_FAIL_NO_PERMISSION); - } - else - { - obj_id memberId = findMemberIdByName(guildId, who, false, true); - if (isIdValid(memberId)) - { - if (isNameReserved(title)) - { - sendSystemMessage(actor, SID_GUILD_TITLE_FAIL_NOT_ALLOWED); - } - else if (title.length() > 25) - { - sendSystemMessage(actor, SID_GUILD_TITLE_FAIL_BAD_LENGTH); - } - else - { - GuildLog(guildId, "title", actor, memberId, "setting title to '"+title+"'"); - String memberName = guildGetMemberName(guildId, memberId); - prose_package pp = new prose_package(); - pp.target.set(title); - pp.actor.set(memberName); - pp.stringId = SID_GUILD_TITLE_SELF; - sendSystemMessageProse(getChatName(actor), pp); - pp.actor.set(getName(actor)); - pp.stringId = SID_GUILD_TITLE_TARGET; - sendSystemMessageProse(memberName, pp); - guildSetMemberInfo( - guildId, - memberId, - guildGetMemberPermissions(guildId, memberId), - title, - guildGetMemberAllegiance(guildId, memberId)); - } - } - } - } - - - public static void handleGuildNameChange(int guildId, String newName, String newAbbrev, obj_id changerId) throws InterruptedException - { - - if (isIdValid(changerId) && !hasGuildPermission(guildId, changerId, GUILD_PERMISSION_NAMECHANGE)) - { - return; - } - - if (findGuild(newName) != 0 || findGuild(newAbbrev) != 0) - { - return; - } - - GuildLog(guildId, "handleGuildNameChange", changerId, null, "name='"+newName+"' abbrev='"+newAbbrev+"'"); - - guildSetName(guildId, newName); - guildSetAbbrev(guildId, newAbbrev); - - String memberName = null; - - if (isIdValid(changerId)) - { - memberName = guildGetMemberName(guildId, changerId); - } - if (memberName != null) - { - mailToGuild(guildId, GUILD_MAIL_NAMECHANGE_SUBJECT, GUILD_MAIL_NAMECHANGE_TEXT, newName, newAbbrev, memberName); - } - else - { - mailToGuild(guildId, GUILD_MAIL_NAMECHANGE_SUBJECT, GUILD_MAIL_NAMECHANGE_TEXT, newName, newAbbrev, "System"); - } - } - - - public static void nameChange(int guildId, obj_id actor, String newName, String newAbbrev) throws InterruptedException - { - if (!hasGuildPermission(guildId, actor, GUILD_PERMISSION_NAMECHANGE)) - { - sendSystemMessage(actor, SID_GUILD_GENERIC_FAIL_NO_PERMISSION); - } - else - { - if (newAbbrev.length() < 1 || newAbbrev.length() > 5) - { - sendSystemMessage(actor, SID_GUILD_NAMECHANGE_FAIL_ABBREV_BAD_LENGTH); - } - else if (newName.length() < 1 || newName.length() > 25) - { - sendSystemMessage(actor, SID_GUILD_NAMECHANGE_FAIL_NAME_BAD_LENGTH); - } - else if (isNameReserved(newAbbrev)) - { - sendSystemMessage(actor, SID_GUILD_NAMECHANGE_FAIL_ABBREV_NOT_ALLOWED); - } - else if (isNameReserved(newName)) - { - sendSystemMessage(actor, SID_GUILD_NAMECHANGE_FAIL_NAME_NOT_ALLOWED); - } - else - { - GuildLog(guildId, "nameChange", actor, null, "queueing change to name='"+newName+"' abbrev='"+newAbbrev+"'"); - prose_package pp = new prose_package(); - pp.actor.set(newName); - pp.target.set(newAbbrev); - pp.stringId = SID_GUILD_NAMECHANGE_SELF; - sendSystemMessageProse(getChatName(actor), pp); - obj_id masterGuildObj = getMasterGuildObject(); - dictionary params = new dictionary(); - params.put("guildId", guildId); - params.put("newName", newName); - params.put("newAbbrev", newAbbrev); - if (getGuildId(actor) == guildId) - { - params.put("changerId", actor); - } - else - { - params.put("changerId", obj_id.NULL_ID); - } - messageTo(masterGuildObj, "initiateGuildNameChange", params, 0, false); - } - } - } - - - public static void allegiance(obj_id actor, String who) throws InterruptedException - { - int guildId = getGuildId(actor); - if (guildId != 0) - { - obj_id allegianceId = findMemberIdByName(guildId, who, false, true); - if (isIdValid(allegianceId)) - { - GuildLog(guildId, "allegiance", actor, allegianceId, ""); - prose_package pp = new prose_package(); - pp.actor.set(guildGetMemberName(guildId, allegianceId)); - pp.target.set(guildGetName(guildId)); - pp.stringId = SID_GUILD_ALLEGIANCE_SELF; - sendSystemMessageProse(getChatName(actor), pp); - guildSetMemberInfo( - guildId, - actor, - guildGetMemberPermissions(guildId, actor), - guildGetMemberTitle(guildId, actor), - allegianceId); - } - else - { - sendSystemMessage(actor, SID_GUILD_ALLEGIANCE_UNCHANGED_SELF); - } - } - } - - - public static void war(int guildId, obj_id actor, String who) throws InterruptedException - { - int enemyId = findGuild(who); - if (enemyId == 0) - { - sendSystemMessage(actor, SID_GUILD_WAR_FAIL_NO_SUCH_GUILD); - } - else - { - war(guildId, actor, enemyId); - } - } - - - public static void war(int guildId, obj_id actor, int enemyId) throws InterruptedException - { - if (enemyId != 0 && enemyId != guildId) - { - if (!hasGuildPermission(guildId, actor, GUILD_PERMISSION_WAR)) - { - sendSystemMessage(actor, SID_GUILD_GENERIC_FAIL_NO_PERMISSION); - } - else - { - GuildLog(guildId, "war", actor, null, "Declaring war with "+enemyId+"("+guildGetName(enemyId)+")"); - guildSetEnemy(guildId, enemyId); - } - } - } - - - public static void peace(int guildId, obj_id actor, String who) throws InterruptedException - { - peace(guildId, actor, findGuild(who)); - } - - - public static void peace(int guildId, obj_id actor, int enemyId) throws InterruptedException - { - if (enemyId != 0 && enemyId != guildId) - { - if (!hasGuildPermission(guildId, actor, GUILD_PERMISSION_WAR)) - { - sendSystemMessage(actor, SID_GUILD_GENERIC_FAIL_NO_PERMISSION); - } - else - { - GuildLog(guildId, "war", actor, null, "Declaring peace with "+enemyId+"("+guildGetName(enemyId)+")"); - guildRemoveEnemy(guildId, enemyId); - } - } - } - - - public static void togglePermission(int guildId, obj_id actor, String who, int permBit) throws InterruptedException - { - if (guildGetLeader(guildId) == actor || isGod(actor)) - { - obj_id memberId = findMemberIdByName(guildId, who, false, true); - if (isIdValid(memberId)) - { - GuildLog(guildId, "togglePermission", actor, memberId, "bit "+permBit); - guildSetMemberInfo( - guildId, - memberId, - guildGetMemberPermissions(guildId, memberId) ^ permBit, - guildGetMemberTitle(guildId, memberId), - guildGetMemberAllegiance(guildId, memberId)); - } - } - } - - - public static void dumpInfo(int guildId, obj_id actor) throws InterruptedException - { - debugConsoleMsg(actor, "Guild Id: "+ guildId); - if (guildId == 0) - { - return; - } - - debugConsoleMsg(actor, "Guild Name: "+ guildGetName(guildId)); - debugConsoleMsg(actor, "Guild Abbrev: "+ guildGetAbbrev(guildId)); - debugConsoleMsg(actor, "Guild Leader: "+ guildGetLeader(guildId)); - - obj_id[] members = guildGetMemberIds(guildId); - int memberCount = 0; - if (members != null) - { - memberCount = members.length; - } - debugConsoleMsg(actor, "Guild members ("+ memberCount + "):"); - for (int i = 0; i < memberCount; ++i) - { - testAbortScript(); - debugConsoleMsg(actor, (i+1) + ")" + " id = "+ members[i] - + " name = "+ guildGetMemberName(guildId, members[i]) - + " perms = "+ guildGetMemberPermissions(guildId, members[i]) - + " title = "+ guildGetMemberTitle(guildId, members[i]) - + " allegiance = "+ guildGetMemberAllegiance(guildId, members[i])); - } - - int[] enemies = guildGetEnemies(guildId); - int enemyCount = 0; - if (enemies != null) - { - enemyCount = enemies.length; - } - debugConsoleMsg(actor, "Guild enemies ("+ enemyCount + "):"); - for (int i = 0; i < enemyCount; ++i) - { - testAbortScript(); - debugConsoleMsg(actor, (i+1) + ") "+ enemies[i]); - } - } - - - public static obj_id findMemberIdByName(int guildId, String name, boolean fromSponsored, boolean fromMembers) throws InterruptedException - { - obj_id[] members = getMemberIds(guildId, fromSponsored, fromMembers); - if (members != null) - { - - java.util.StringTokenizer st = new java.util.StringTokenizer(name); - String compareName = toLower(st.nextToken()); - - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - - java.util.StringTokenizer st2 = new java.util.StringTokenizer(guildGetMemberName(guildId, members[i])); - String memberName = toLower(st2.nextToken()); - if (compareName.equals(memberName)) - { - return members[i]; - } - } - } - return obj_id.NULL_ID; - } - - - public static boolean hasSponsoredMembers(int guildId) throws InterruptedException - { - obj_id[] members = guildGetMemberIds(guildId); - if (members != null) - { - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - if (guildGetMemberPermissions(guildId, members[i]) == GUILD_PERMISSIONS_NONE) - { - return true; - } - } - } - return false; - } - - - public static obj_id[] getMemberIds(int guildId, boolean fromSponsored, boolean fromMembers) throws InterruptedException - { - obj_id[] members = guildGetMemberIds(guildId); - int count = 0; - if (members != null) - { - if (fromSponsored && fromMembers) - { - count = members.length; - } - else - { - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - if (guildGetMemberPermissions(guildId, members[i]) == GUILD_PERMISSIONS_NONE) - { - if (fromSponsored) - { - ++count; - } - } - else if (fromMembers) - { - ++count; - } - } - } - } - obj_id[] ret = new obj_id[count]; - int index = 0; - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - if (guildGetMemberPermissions(guildId, members[i]) == GUILD_PERMISSIONS_NONE) - { - if (fromSponsored) - { - ret[index++] = members[i]; - } - } - else if (fromMembers) - { - ret[index++] = members[i]; - } - } - return ret; - } - - - public static String[] getMemberNames(int guildId, boolean fromSponsored, boolean fromMembers) throws InterruptedException - { - obj_id[] members = getMemberIds(guildId, fromSponsored, fromMembers); - int count = 0; - if (members != null) - { - count = members.length; - } - String[] ret = new String[count]; - for (int i = 0; i < count; ++i) - { - testAbortScript(); - ret[i] = guildGetMemberName(guildId, members[i]); - } - - Arrays.sort(ret); - return ret; - } - - - public static String[] getMemberNamesAndTitles(int guildId) throws InterruptedException - { - obj_id[] members = getMemberIds(guildId, false, true); - int count = 0; - if (members != null) - { - count = members.length; - } - String[] ret = new String[count]; - for (int i = 0; i < count; ++i) - { - testAbortScript(); - String name = guildGetMemberName(guildId, members[i]); - String title = guildGetMemberTitle(guildId, members[i]); - if (title.equals("")) - { - ret[i] = name; - } - else - { - ret[i] = name + " [" + title + "]"; - } - } - Arrays.sort(ret); - return ret; - } - - - public static String[] getEnemyNamesAndAbbrevs(int guildId) throws InterruptedException - { - int[] enemies_A_to_B = guildGetEnemies(guildId); - int[] enemies_B_to_A = getGuildsAtWarWith(guildId); - int count = 0; - if (enemies_A_to_B != null) - { - count = enemies_A_to_B.length; - } - if (enemies_B_to_A != null) - { - for (int i = 0; i < enemies_B_to_A.length; ++i) - { - testAbortScript(); - if (findIntTableOffset(enemies_A_to_B, enemies_B_to_A[i]) == -1) - { - ++count; - } - } - } - String[] ret = new String[count]; - int pos = 0; - if (enemies_A_to_B != null) - { - for (int i = 0; i < enemies_A_to_B.length; ++i) - { - testAbortScript(); - StringBuffer sb = new StringBuffer(); - if (findIntTableOffset(enemies_B_to_A, enemies_A_to_B[i]) == -1) - { - sb.append("> "); - } - else - { - sb.append("= "); - } - sb.append(guildGetName(enemies_A_to_B[i])); - sb.append(" <"); - sb.append(guildGetAbbrev(enemies_A_to_B[i])); - sb.append(">"); - ret[pos] = sb.toString(); - ++pos; - } - } - if (enemies_B_to_A != null) - { - for (int i = 0; i < enemies_B_to_A.length; ++i) - { - testAbortScript(); - if (findIntTableOffset(enemies_A_to_B, enemies_B_to_A[i]) == -1) - { - StringBuffer sb = new StringBuffer(); - sb.append("< "); - sb.append(guildGetName(enemies_B_to_A[i])); - sb.append(" <"); - sb.append(guildGetAbbrev(enemies_B_to_A[i])); - sb.append(">"); - ret[pos] = sb.toString(); - ++pos; - } - } - } - Arrays.sort(ret); - return ret; - } - - - public static int[] getEnemyIds(int guildId) throws InterruptedException - { - int[] enemies_A_to_B = guildGetEnemies(guildId); - int[] enemies_B_to_A = getGuildsAtWarWith(guildId); - int count = 0; - if (enemies_A_to_B != null) - { - count = enemies_A_to_B.length; - } - if (enemies_B_to_A != null) - { - for (int i = 0; i < enemies_B_to_A.length; ++i) - { - testAbortScript(); - if (findIntTableOffset(enemies_A_to_B, enemies_B_to_A[i]) == -1) - { - ++count; - } - } - } - int[] ret = new int[count]; - int pos = 0; - if (enemies_A_to_B != null) - { - for (int i = 0; i < enemies_A_to_B.length; ++i) - { - testAbortScript(); - ret[pos++] = enemies_A_to_B[i]; - } - } - if (enemies_B_to_A != null) - { - for (int i = 0; i < enemies_B_to_A.length; ++i) - { - testAbortScript(); - if (findIntTableOffset(enemies_A_to_B, enemies_B_to_A[i]) == -1) - { - ret[pos++] = enemies_B_to_A[i]; - } - } - } - return ret; - } - - - public static void mailToGuild(int guildId, String subject, string_id textId, String substitute1, String substitute2, String substitute3) throws InterruptedException - { - obj_id[] members = getMemberIds(guildId, false, true); - if (members != null) - { - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - mailToGuildMember(guildId, members[i], subject, textId, substitute1, substitute2, substitute3); - } - } - } - - - public static void mailToGuild(int guildId, String subject, string_id textId, String substitute1, String substitute2) throws InterruptedException - { - mailToGuild(guildId, subject, textId, substitute1, substitute2, ""); - } - - - public static void mailToGuild(int guildId, String subject, string_id textId, String substitute1) throws InterruptedException - { - mailToGuild(guildId, subject, textId, substitute1, "", ""); - } - - - public static void mailToGuild(int guildId, String subject, string_id textId) throws InterruptedException - { - mailToGuild(guildId, subject, textId, "", "", ""); - } - - - public static void mailToPerson(int guildId, String toName, String subject, string_id textId, String substitute1, String substitute2, String substitute3) throws InterruptedException - { - prose_package pp = new prose_package(); - pp.stringId = textId; - pp.actor.set(substitute1); - pp.target.set(substitute2); - pp.other.set(substitute3); - chatSendPersistentMessage( - guildGetName(guildId), - toName, - subject, - null, - chatMakePersistentMessageOutOfBandBody(null, pp)); - } - - - public static void mailToPerson(int guildId, String toName, String subject, string_id textId, String substitute1, String substitute2) throws InterruptedException - { - mailToPerson(guildId, toName, subject, textId, substitute1, substitute2, ""); - } - - - public static void mailToPerson(int guildId, String toName, String subject, string_id textId, String substitute1) throws InterruptedException - { - mailToPerson(guildId, toName, subject, textId, substitute1, "", ""); - } - - - public static void mailToPerson(int guildId, String toName, String subject, string_id textId) throws InterruptedException - { - mailToPerson(guildId, toName, subject, textId, "", "", ""); - } - - - public static void mailToGuildMember(int guildId, obj_id memberId, String subject, string_id textId, String substitute1, String substitute2, String substitute3) throws InterruptedException - { - mailToPerson(guildId, guildGetMemberName(guildId, memberId), subject, textId, substitute1, substitute2, substitute3); - } - - - public static void mailToGuildMember(int guildId, obj_id memberId, String subject, string_id textId, String substitute1, String substitute2) throws InterruptedException - { - mailToGuildMember(guildId, memberId, subject, textId, substitute1, substitute2, ""); - } - - - public static void mailToGuildMember(int guildId, obj_id memberId, String subject, string_id textId, String substitute1) throws InterruptedException - { - mailToGuildMember(guildId, memberId, subject, textId, substitute1, "", ""); - } - - - public static void mailToGuildMember(int guildId, obj_id memberId, String subject, string_id textId) throws InterruptedException - { - mailToGuildMember(guildId, memberId, subject, textId, "", "", ""); - } - - - public static int findIntTableOffset(int[] from, int find) throws InterruptedException - { - if (from != null) - { - for (int i = 0; i < from.length; ++i) - { - testAbortScript(); - if (from[i] == find) - { - return i; - } - } - } - return -1; - } - - - public static int findObjIdTableOffset(obj_id[] from, obj_id find) throws InterruptedException - { - if (from != null) - { - for (int i = 0; i < from.length; ++i) - { - testAbortScript(); - if (from[i] == find) - { - return i; - } - } - } - return -1; - } - - - public static obj_id determineLeaderByAllegiance(int guildId) throws InterruptedException - { - - obj_id[] memberIds = getMemberIds(guildId, false, true); - if (memberIds.length > 0) - { - int[] allegianceCounts = new int[memberIds.length]; - - for (int i = 0; i < memberIds.length; ++i) - { - testAbortScript(); - int offset = findObjIdTableOffset(memberIds, guildGetMemberAllegiance(guildId, memberIds[i])); - if (offset != -1) - { - allegianceCounts[offset]++; - } - } - - obj_id oldLeader = guildGetLeader(guildId); - obj_id newLeader = memberIds[0]; - int newLeaderAllegianceCount = allegianceCounts[0]; - for (int i = 1; i < memberIds.length; ++i) - { - testAbortScript(); - if ((allegianceCounts[i] > newLeaderAllegianceCount || (allegianceCounts[i] == newLeaderAllegianceCount && memberIds[i] == oldLeader))) - { - newLeader = memberIds[i]; - newLeaderAllegianceCount = allegianceCounts[i]; - } - } - return newLeader; - } - - return obj_id.NULL_ID; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/library/healing.java b/sku.0/sys.server/compiled/game/script/library/healing.java deleted file mode 100644 index 4c768ec69..000000000 --- a/sku.0/sys.server/compiled/game/script/library/healing.java +++ /dev/null @@ -1,6827 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.ai.ai_combat; -import script.library.ai_lib; -import script.library.buff; -import script.library.camping; -import script.library.combat; -import script.library.combat; -import script.library.consumable; -import script.library.cybernetic; -import script.library.dot; -import script.library.factions; -import script.library.group; -import script.library.luck; -import script.library.metrics; -import script.library.pet_lib; -import script.library.player_structure; -import script.library.prose; -import script.library.pvp; -import script.library.stealth; -import script.library.sui; -import script.library.utils; -import script.library.vehicle; -import script.library.xp; -import script.library.beast_lib; - - -public class healing extends script.base_script -{ - public healing() - { - } - public static final int VAR_ITEM_REUSE_TIME = 20; - public static final int ITEM_CHANNEL_HEAL_TICKS = 5; - - public static final String VAR_ENHANCER_EFFICIENCY = "healing.enhancement"; - public static final String VAR_ITEM_POWER = "healing.power"; - public static final String VAR_ITEM_TIMER = "healing.item.timer"; - public static final String VAR_PLAYER_HOT_ID = "healing.hot_id"; - - public static final String MSG_HEAL_OVER_TIME = "handleHealOverTimeTick"; - - public static final string_id SID_ITEM_TOO_SOON = new string_id("healing", "item_too_soon"); - public static final string_id SID_ITEM_NOT_A_PET = new string_id("healing", "item_not_a_pet"); - public static final string_id SID_ITEM_NOT_YOUR_PET = new string_id("healing", "item_not_your_pet"); - public static final string_id SID_ITEM_NO_DAMAGE = new string_id("healing", "item_no_damage"); - public static final string_id SID_ITEM_PLAYER_HEAL = new string_id("healing", "item_player_heal"); - public static final string_id SID_ITEM_PET_HEAL = new string_id("healing", "item_pet_heal"); - public static final string_id SID_BEAST_MASTER_HEAL = new string_id("healing", "beast_master_heal"); - - public static final string_id SID_PERFORM_HEAL_DAMAGE_SUCCESS = new string_id("healing", "perform_heal_damage_success"); - public static final string_id SID_PERFORM_HEAL_WOUND_SUCCESS = new string_id("healing", "perform_heal_wound_success"); - public static final string_id SID_PERFORM_REVIVE_SUCCESS = new string_id("healing", "perform_revive_success"); - public static final string_id SID_PERFORM_REVIVE_GROGGINESS = new string_id("healing", "perform_revive_grogginess"); - - public static final string_id SID_PERFORM_REVIVE_TOO_LONG = new string_id("healing", "perform_revive_too_long"); - public static final string_id SID_PERFORM_REVIVE_JEDI_CONSENT = new string_id("healing", "perform_revive_jedi_consent"); - public static final string_id SID_PERFORM_REVIVE_CONSENT = new string_id("healing", "perform_revive_consent"); - - public static final string_id SID_PERFORM_CURE_STATE_FAIL = new string_id("healing", "perform_cure_state_fail"); - public static final string_id SID_PERFORM_BUFF_FAIL = new string_id("healing", "perform_buff_fail"); - public static final string_id SID_PERFORM_DEBUFF_FAIL = new string_id("healing", "perform_debuff_fail"); - public static final string_id SID_PERFORM_HOT_FAIL = new string_id("healing", "perform_hot_fail"); - - public static final float AM_HEAL_WOUND = -1.0f; - public static final float AM_HEAL_SHOCK = -2.0f; - public static final float AM_ADD_SHOCK = -3.0f; - - public static final float HEARTBEAT_PERFORMANCE = 6.0f; - - public static final int OBSERVERS_MAX = 20; - - public static final int VAR_HEALDAMAGE_ROUNDTIME = 10; - public static final float VAR_HEALDAMAGE_ROUNDTIME_CAP = 3.0f; - - public static final int VAR_HEALWOUND_ROUNDTIME = 10; - public static final int VAR_HEALENHANCE_ROUNDTIME = 30; - - public static final float VAR_SURGICAL_DROID_RANGE = 20.0f; - public static final int VAR_MAX_BUFF_TIME = 7200; - public static final float VAR_BUFF_MOD_ATTACK = 10.0f; - public static final float VAR_BUFF_MOD_DECAY = 10.0f; - public static final int VAR_HEALDAMAGE_COST = 100; - public static final int VAR_HEALWOUND_COST = 250; - public static final int VAR_HEALSTATE_COST = 150; - public static final int VAR_HEALENHANCE_COST = 250; - public static final int VAR_FIRSTAID_COST = 125; - public static final int VAR_CURE_POISON_COST = 200; - public static final int VAR_CURE_FIRE_COST = 350; - public static final int VAR_CURE_DISEASE_COST = 200; - public static final int VAR_APPLY_POISON_COST = 150; - public static final int VAR_APPLY_DISEASE_COST = 150; - public static final int VAR_QUICK_HEAL_COST = 500; - public static final int VAR_TEND_WOUND_COST = 500; - public static final int VAR_TEND_DAMAGE_COST = 250; - public static final int VAR_QUICK_HEAL_WOUND_COST = 10; - public static final int VAR_QUICK_HEAL_BASE_POWER = 400; - public static final int VAR_TEND_WOUND_WOUND_COST = 7; - public static final int VAR_TEND_WOUND_BASE_POWER = 15; - public static final int VAR_TEND_DAMAGE_WOUND_COST = 5; - public static final int VAR_TEND_DAMAGE_BASE_POWER = 75; - public static final int VAR_HEAL_MIND_COST = 100; - public static final int VAR_HEAL_MIND_WOUND_COST = 40; - public static final int VAR_HEAL_MIND_BASE_POWER = 500; - public static final float VAR_EFFECT_DISPLAY_RADIUS = 45.0f; - public static final float VAR_STIMPACK_DROID_RADIUS = 30.0f; - public static final int VAR_AUTO_REPAIR_PULSE_INTERVAL = 10; - public static final int VAR_AUTO_REPAIR_MIN_INTERVAL = 2; - - public static final int COST_MIND_REVIVE = 500; - public static final int REVIVE_TIMER = 1800; - - public static final float HEALING_KILL_CREDIT_MULTIPLIER = 0.1f; - public static final float HEALING_AGGRO_REDUCER = 10.0f; - public static final float HEAL_OVER_TIME_AGGRO_REDUCER = 0.5f; - - public static final String VAR_OBSERVER_BASE = "performance"; - public static final String VAR_OBSERVER_LIST = "performance.observer_ids"; - public static final String VAR_OBSERVER_BOX = "performance.observer_listbox_pId"; - public static final String VAR_OBSERVER_SKILLCHECK = "performance.skill_check"; - public static final String VAR_PERFORMANCE_HAS_DANCE_BUFF = "performance.has_dance_buff"; - public static final String VAR_PERFORMANCE_HAS_MUSIC_BUFF = "performance.has_music_buff"; - - public static final String VAR_HEALING_CAN_HEALDAMAGE = "healing.can_heal_damage"; - public static final String VAR_HEALING_CAN_HEALWOUND = "healing.can_heal_wound"; - - public static final String VAR_HEALING_RANGE = "healing.range"; - public static final String VAR_HEALING_AREA = "healing.area"; - public static final String VAR_HEALING_STATE = "healing.state"; - public static final String VAR_HEALING_CURE_DOT = "healing.cure_dot"; - public static final String VAR_HEALING_APPLY_DOT = "healing.apply_dot"; - public static final String VAR_HEALING_DOT_POWER = "healing.dot_power"; - public static final String VAR_HEALING_DOT_POTENCY = "healing.dot_potency"; - public static final String VAR_HEALING_DOT_ID = "healing.dot_id"; - public static final String VAR_HEALING_DOT_ATTRIBUTE = "healing.dot_attribute"; - public static final String VAR_HEALING_DOT_DURATION = "healing.dot_duration"; - public static final String VAR_HEALING_ABSORPTION = "healing.absorption"; - - public static final String SCRIPT_VAR_MEDICINE_BUFF = "healing.medicine_buff"; - public static final String SCRIPT_VAR_MEDICINE_REBUFF = "healing.medicine_rebuff"; - public static final String SCRIPT_VAR_DANCE_MIND_BUFF = "healing.dance_mind_buff"; - public static final String SCRIPT_VAR_DANCE_MIND_BUFF_TIME = "healing.dance_mind_buff_time"; - public static final String SCRIPT_VAR_MUSIC_MIND_BUFF = "healing.music_mind_buff"; - public static final String SCRIPT_VAR_MUSIC_MIND_BUFF_TIME = "healing.music_mind_buff_time"; - public static final String SCRIPT_VAR_RANGED_MED = "healing.ranged_med"; - public static final String SCRIPT_VAR_DAMAGE_MED = "healing.damage_med"; - - public static final String LISTBOX_LIST = "lstList"; - public static final String LISTBOX_DATA = "dataList"; - - public static final string_id UI_OBSERVE = new string_id("ui","observe"); - public static final string_id UI_STOP_OBSERVING = new string_id("ui","stop_observing"); - - public static final String HEAL_TYPE_MEDICAL_DAMAGE = "medical_damage"; - public static final String HEAL_TYPE_MEDICAL_WOUND = "medical_wound"; - public static final String HEAL_TYPE_MEDICAL_STATE = "medical_state"; - public static final String HEAL_TYPE_MEDICAL_BUFF = "medical_buff"; - public static final String HEAL_TYPE_MEDICAL_REVIVE = "medical_revive"; - public static final String HEAL_TYPE_MEDICAL_FIRSTAID = "medical_firstaid"; - public static final String HEAL_TYPE_MEDICAL_CURE_POISON = "medical_cure_poison"; - public static final String HEAL_TYPE_MEDICAL_CURE_DISEASE = "medical_cure_disease"; - public static final String HEAL_TYPE_MEDICAL_CURE_FIRE = "medical_cure_fire"; - public static final String HEAL_TYPE_MEDICAL_APPLY_POISON = "medical_apply_poison"; - public static final String HEAL_TYPE_MEDICAL_APPLY_DISEASE = "medical_apply_disease"; - public static final String HEAL_TYPE_MEDICAL_QUICK_HEAL = "medical_quick_heal"; - public static final String HEAL_TYPE_MEDICAL_TEND_WOUND = "medical_tend_wound"; - public static final String HEAL_TYPE_MEDICAL_TEND_DAMAGE = "medical_tend_damage"; - public static final String HEAL_TYPE_MEDICAL_HEAL_MIND = "medical_heal_mind"; - public static final String HEAL_TYPE_DANCE_WOUND = "dance_wound"; - public static final String HEAL_TYPE_DANCE_SHOCK = "dance_shock"; - public static final String HEAL_TYPE_DANCE_MIND_BUFF = "dance_mind_buff"; - public static final String HEAL_TYPE_MUSIC_WOUND = "music_wound"; - public static final String HEAL_TYPE_MUSIC_SHOCK = "music_shock"; - public static final String HEAL_TYPE_MUSIC_MIND_BUFF = "music_mind_buff"; - - public static final String HEAL_TYPE_JUGGLE_WOUND = "juggle_wound"; - public static final String HEAL_TYPE_JUGGLE_SHOCK = "juggle_shock"; - public static final String HEAL_TYPE_JUGGLE_MIND_BUFF = "juggle_mind_buff"; - - public static final String SCRIPT_DANCE = "systems.healing.healing_dance"; - public static final String SCRIPT_MUSIC = "systems.healing.healing_music"; - public static final String SCRIPT_JUGGLE = "systems.healing.healing_juggle"; - public static final String SCRIPT_MEDIC = "systems.healing.healing_medic"; - public static final String SCRIPT_XENOBIOLOGY = "systems.healing.healing_xenobiology"; - - public static final string_id SID_NOT_ENOUGH_MIND = new string_id("healing", "not_enough_mind"); - public static final string_id SID_APPLY_POISON_SELF = new string_id("healing", "apply_poison_self"); - public static final string_id SID_APPLY_POISON_OTHER = new string_id("healing", "apply_poison_other"); - public static final string_id SID_APPLY_DISEASE_SELF = new string_id("healing", "apply_disease_self"); - public static final string_id SID_APPLY_DISEASE_OTHER = new string_id("healing", "apply_disease_other"); - public static final string_id SID_RESIST_DOT_OTHER = new string_id("healing", "dot_resist_other"); - public static final string_id SID_MIND_TOO_DRAINED = new string_id("healing", "mind_too_drained"); - public static final string_id SID_YOU_APPLY_FIRST_AID = new string_id("healing", "you_apply_first_aid"); - public static final string_id SID_APPLIES_FIRST_AID = new string_id("healing", "applies_first_aid"); - public static final string_id SID_APPLY_FIRST_AID_SELF = new string_id("healing", "apply_first_aid_self"); - public static final string_id SID_APPLY_POISON_ANTIDOTE = new string_id("healing", "apply_poison_antidote"); - public static final string_id SID_APPLIES_POISON_ANTIDOTE = new string_id("healing", "applies_poison_antidote"); - public static final string_id SID_APPLY_POISON_ANTIDOTE_SELF = new string_id("healing", "apply_poison_antidote_self"); - public static final string_id SID_ATTEMPT_SUPPRESS_FLAMES = new string_id("healing", "attempt_suppress_flames"); - public static final string_id SID_COVERS_YOU_BLANKET = new string_id("healing", "covers_you_blanket"); - public static final string_id SID_COVERS_BLANKET_SELF = new string_id("healing", "cover_blanket_self"); - public static final string_id SID_APPLY_DISEASE_ANTIDOTE = new string_id("healing", "apply_disease_antidote"); - public static final string_id SID_APPLIES_DISEASE_ANTIDOTE = new string_id("healing", "applies_disease_antidote"); - public static final string_id SID_APPLY_DISEASE_ANTIDOTE_SELF = new string_id("healing", "apply_disease_antidote_self"); - public static final string_id SID_CANNOT_RESUS_WITHOUT_KIT = new string_id("healing", "cannot_resus_without_kit"); - public static final string_id SID_CANNOT_RESUS_WITHOUT_TARGET = new string_id("healing", "cannot_resus_without_target"); - public static final string_id SID_CANNOT_RESUS_WITHOUT_PACK = new string_id("healing", "cannot_resus_without_pack"); - public static final string_id SID_TARGET_DEAD_TOO_LONG = new string_id("healing", "target_dead_too_long"); - public static final string_id SID_MUST_HAVE_JEDI_CONSENT = new string_id("healing", "must_have_jedi_consent"); - public static final string_id SID_GROUP_OR_CONSENT_FROM_TARGET = new string_id("healing", "group_or_consent_from_target"); - public static final string_id SID_TEND_WOUNDS_INVALID_TARGET = new string_id("healing", "tend_wounds_invalid_target"); - public static final string_id SID_CANNOT_DO_THAT_TIME = new string_id("healing", "cannot_do_that_time"); - public static final string_id SID_YOU_MUST_WAIT = new string_id("healing", "you_must_wait"); - public static final string_id SID_CANT_HEAL_DAMAGE_OR_STATES = new string_id("healing", "cant_heal_damage_or_states"); - public static final string_id SID_MUST_BE_IN_HOSPITAL_OR_CS = new string_id("healing", "must_be_in_hospital_or_cs"); - public static final string_id SID_MUST_BE_IN_HOSP_OR_CS_OR_DROID = new string_id("healing", "must_be_in_hosp_or_cs_or_droid"); - public static final string_id SID_MUST_WAIT_TO_HEAL_OR_ENHANCE = new string_id("healing", "must_wait_to_heal_or_enhance"); - public static final string_id SID_NO_HEAL_OR_ENHANCE_ABILITY = new string_id("healing", "no_heal_or_enchance_ability"); - public static final string_id SID_NO_WOUNDS_OF_TYPE_SELF = new string_id("healing", "no_wounds_of_type_self"); - public static final string_id SID_NO_WOUNDS_OF_TYPE_TARGET = new string_id("healing", "no_wounds_of_type_target"); - public static final string_id SID_REMOVE_STATE_FROM_TARGET = new string_id("healing", "remove_state_from_target"); - public static final string_id SID_REMOVE_STATE_FROM_YOU = new string_id("healing", "remove_state_from_you"); - public static final string_id SID_REMOVE_STATE_SELF = new string_id("healing", "remove_state_self"); - public static final string_id SID_YOU_ENHANCE_YOUR_ATT = new string_id("healing", "you_enhance_your_att"); - public static final string_id SID_YOU_ENHANCE_TARGETS_ATTRIBUTE = new string_id("healing", "you_enchance_targets_attribute"); - public static final string_id SID_MEDIC_ENHANCES_YOUR_ATTRIBUTE = new string_id("healing", "medic_enchances_your_attribute"); - public static final string_id SID_REAPPLY_ENHANCEMENT_TARGET = new string_id("healing", "reapply_enhancement_target"); - public static final string_id SID_REAPPLIES_ENHANCEMENT_YOU = new string_id("healing", "reapplies_enhancement_you"); - public static final string_id SID_REAPPLY_ENHANCEMENT_SELF = new string_id("healing", "reapply_enhancement_self"); - public static final string_id SID_ENHANCE_ATTRIBUTE_BY_SELF = new string_id("healing", "enhance_attribute_by_self"); - public static final string_id SID_PVP_NO_HELP = new string_id("healing", "pvp_no_help"); - public static final string_id SID_HEAL_ATTRIBUTE_TARGET = new string_id("healing", "heal_attribute_target"); - public static final string_id SID_ATTRIBUTE_HEALED = new string_id("healing", "attribute_healed"); - public static final string_id SID_HEAL_ATTRIB_SELF = new string_id("healing", "heal_attrib_self"); - - public static final string_id SID_DROID_REPAIR_WOUND_SELF = new string_id("healing", "droid_repair_wound_self"); - public static final string_id SID_DROID_REPAIR_WOUND_OTHER = new string_id("healing", "droid_repair_wound_other"); - public static final string_id SID_DROID_REPAIR_DAMAGE_SELF = new string_id("healing", "droid_repair_damage_self"); - public static final string_id SID_DROID_REPAIR_DAMAGE_OTHER = new string_id("healing", "droid_repair_damage_other"); - - public static final String RESPONSE_TEXT = "datatables/healing/healing_response.iff"; - public static final String PP_FILE_LOC = "healing_response"; - - public static final int[] COMBAT_STATES = - { - STATE_DIZZY, - STATE_BLINDED, - STATE_STUNNED, - STATE_INTIMIDATED - }; - - public static final string_id[] SID_PERFORM_CURE_STATE_SUCCESS = - { - new string_id("healing", "perform_cure_state_dizzy_success"), - new string_id("healing", "perform_cure_state_blinded_success"), - new string_id("healing", "perform_cure_state_stunned_success"), - new string_id("healing", "perform_cure_state_intimidated_success") - }; - public static final String[] ATTRIBUTES = - { - "HEALTH", - "CONSTITUTION", - "ACTION", - "STAMINA", - "MIND", - "WILLPOWER" - }; - - - public static boolean performHealDamage(attacker_data attackerData, defender_data[] defenderData, combat_data action_data) throws InterruptedException - { - - LOG("healing_hate","performHealDamage init"); - - if ((action_data.dotIntensity > 0) && (action_data.dotDuration > 0)) - { - return performHealOverTime(attackerData, defenderData, action_data); - } - - obj_id medic = attackerData.id; - int toHeal = action_data.addedDamage; - int totalDelta = 0; - - boolean total_success = false; - - toHeal = getExpertiseModifiedHealing(medic, toHeal, action_data); - - String actionName = action_data.actionName; - boolean useTempParticle = false; - boolean playParticleOnMedic = false; - - if (actionName.startsWith("me_bacta_bomb") || actionName.startsWith("me_bacta_grenade")) - { - useTempParticle = true; - } - - if (actionName.startsWith("sp_cloaked_recovery")) - { - playParticleOnMedic = true; - } - - for (int i = 0; i < defenderData.length; i++) - { - testAbortScript(); - if ((!isIdValid(defenderData[i].id) || !exists(defenderData[i].id) || !isMob(defenderData[i].id) || isDead(defenderData[i].id))) - { - continue; - } - - if (!isValidHealTarget(medic, defenderData[i].id)) - { - continue; - } - - toHeal = getHealingAfterReductions(medic, defenderData[i].id, toHeal); - toHeal = getTargetHealingBonus(medic, defenderData[i].id, toHeal); - - if (luck.isLucky(defenderData[i].id, 0.005f)) - { - float bonus = toHeal * 0.2f; - if (bonus < 1) - { - bonus = 1; - } - - toHeal += bonus; - } - - int hBefore = getAttrib(defenderData[i].id, action_data.attribute); - boolean success = healDamage(defenderData[i].id, action_data.attribute, toHeal); - - if (success) - { - int delta = getAttrib(defenderData[i].id, action_data.attribute) - hBefore; - - if (delta <= 0) - { - continue; - } - - totalDelta += delta; - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_PERFORM_HEAL_DAMAGE_SUCCESS); - pp = prose.setTT(pp, medic); - pp = prose.setTO(pp, defenderData[i].id); - pp = prose.setDI(pp, delta); - sendMedicalSpam(medic, defenderData[i].id, pp, true, true, true, COMBAT_RESULT_MEDICAL); - - pp = prose.setStringId(pp, new string_id("healing", "heal_fly")); - pp = prose.setDI(pp, delta); - pp = prose.setTO(pp, ATTRIBUTES[action_data.attribute]); - showFlyTextPrivateProseWithFlags(defenderData[i].id, defenderData[i].id, pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - - if (medic != defenderData[i].id) - { - showFlyTextPrivateProseWithFlags(defenderData[i].id, medic, pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - } - - float hateMod = action_data.hateDamageModifier; - - int healingAgroMod = getEnhancedSkillStatisticModifierUncapped(medic, "expertise_agro_healing"); - float agroReductionFact = 1.0f - ((float)healingAgroMod/100.0f); - float modifiedHate = (delta * agroReductionFact) /HEALING_AGGRO_REDUCER; - - if (isPlayer(medic)) - { - _addMedicalHate(medic, defenderData[i].id, (int)modifiedHate, hateMod); - } - - pvpHelpPerformed(medic, defenderData[i].id); - - applyDefenderHealBuffs(medic, defenderData[i].id, action_data); - applyMedicHealBuffs(medic, action_data); - location loc = getLocation(defenderData[i].id); - - if (useTempParticle) - { - obj_id[] players = getAllPlayers(loc, 64); - if (players != null) - { - for (int j = 0; j < players.length; j++) - { - testAbortScript(); - if (stealth.hasInvisibleBuff(players[j])) - { - continue; - } - - if (actionName.startsWith("me_bacta_bomb")) - { - playClientEffectLoc(players[j], "clienteffect/bacta_bomb.cef", loc, 0); - } - - if (actionName.startsWith("me_bacta_grenade")) - { - playClientEffectLoc(players[j], "clienteffect/bacta_grenade.cef", loc, 0); - } - } - } - } - else if (playParticleOnMedic) - { - if (!stealth.hasInvisibleBuff(medic)) - { - playClientEffectObj(medic, "appearance/pt_heal.prt", medic, ""); - } - } - else - { - if (!stealth.hasInvisibleBuff(defenderData[i].id)) - { - playHealDamageEffect(loc); - } - } - - if (delta == 0 && actionName.indexOf("_sh_") > -1) - { - CustomerServiceLog("Heal-Fail", "%TU received a success from heal damage but healed for a delta of 0 on heal: "+actionName, medic); - } - } - - total_success |= success; - } - - if (totalDelta <= 0) - { - return false; - } - - pvp.bfCreditForHealing(medic, totalDelta); - - return total_success; - } - - - public static boolean applyDefenderHealBuffs(obj_id medic, obj_id defender, combat_data actionData) throws InterruptedException - { - String actionName = actionData.actionName; - String buffName = actionData.buffNameTarget; - float buffStrength = actionData.buffStrengthTarget; - float buffDuration = actionData.buffDurationTarget; - - if (buffName == null || buffName.equals("")) - { - return false; - } - - if (!combat.expertiseRandomBuffChance(medic, actionData)) - { - return false; - } - - if (!isValidHealTarget(defender)) - { - return false; - } - - buffDuration = combat.getExpertiseBuffDurationMods(medic, actionData, buffName, buffDuration); - - combat.combatLog(medic, defender, "applyDefenderHealBuffs", "Applying defender buff - "+ buffName); - - return buff.applyBuff(defender, buffName, buffDuration, buffStrength); - } - - - public static boolean applyMedicHealBuffs(obj_id medic, combat_data actionData) throws InterruptedException - { - String actionName = actionData.actionName; - String buffName = actionData.buffNameSelf; - float buffStrength = actionData.buffStrengthSelf; - float buffDuration = actionData.buffDurationSelf; - - if (buffName == null || buffName.equals("")) - { - return false; - } - - if (!combat.expertiseRandomBuffChance(medic, actionData)) - { - return false; - } - - buffDuration = combat.getExpertiseBuffDurationMods(medic, actionData, buffName, buffDuration); - - combat.combatLog(medic, null, "applyMedicHealBuffs", "Applying medic buff - "+ buffName); - - return buff.applyBuff(medic, buffName, buffDuration, buffStrength); - } - - - public static boolean performHealOverTime(attacker_data attackerData, defender_data[] defenderData, combat_data action_data) throws InterruptedException - { - obj_id medic = attackerData.id; - int maxHeal = action_data.addedDamage; - int duration = action_data.dotDuration; - int perTick = action_data.dotIntensity; - - String specialLine = action_data.specialLine; - duration += getEnhancedSkillStatisticModifierUncapped(medic, "expertise_hot_duration_"+ specialLine); - - perTick = getExpertiseModifiedHealing(medic, perTick, action_data); - maxHeal = getExpertiseModifiedHealing(medic, maxHeal, action_data); - - int tickLength = (int)(((float)duration) / (((float)maxHeal) / ((float)perTick))); - - for (int i = 0; i < defenderData.length; i++) - { - testAbortScript(); - if (isDead(defenderData[i].id) || !isValidHealTarget(defenderData[i].id)) - { - continue; - } - - perTick = getHealingAfterReductions(medic, defenderData[i].id, perTick); - perTick = getTargetHealingBonus(medic, defenderData[i].id, perTick); - - startHealOverTime(medic, defenderData[i].id, action_data.actionName, duration, tickLength, perTick, true); - - pvpHelpPerformed(medic, defenderData[i].id); - location loc = getLocation(defenderData[i].id); - playHealDamageEffect(loc); - } - - return true; - } - - - public static int getExpertiseModifiedHealing(obj_id medic, int toHeal, combat_data action_data) throws InterruptedException - { - String specialLine = action_data.specialLine; - float expertiseHealingBonus = 0.0f; - expertiseHealingBonus += getEnhancedSkillStatisticModifierUncapped(medic, "expertise_healing_all"); - - if (specialLine != null && !specialLine.equals("")) - { - expertiseHealingBonus += getEnhancedSkillStatisticModifierUncapped(medic, "expertise_healing_line_"+ specialLine); - } - - float toHealFloat = toHeal; - toHealFloat = toHealFloat * (1 + (expertiseHealingBonus/100) ); - toHeal = (int)toHealFloat; - - return toHeal; - } - - - public static int getHealingAfterReductions(obj_id medic, obj_id target, int toHeal) throws InterruptedException - { - int healingReduction = getEnhancedSkillStatisticModifierUncapped(target, "expertise_healing_reduction"); - float redux = (float)healingReduction / ((float)healingReduction + 50.0f); - toHeal = (int)((float)toHeal - ((float)toHeal * redux)); - - return toHeal; - } - - - public static int getTargetHealingBonus(obj_id medic, obj_id target, int toHeal) throws InterruptedException - { - int healingBonus = getEnhancedSkillStatisticModifierUncapped(target, "expertise_target_healing_bonus"); - toHeal = (int)((float)toHeal * (1.0f + ((float)healingBonus / 100.0f))); - - return toHeal; - } - - - public static boolean canUseAbility(obj_id medic, combat_data actionData) throws InterruptedException - { - return true; - } - - - public static boolean useHealDamageItem(obj_id user, obj_id item) throws InterruptedException - { - return useHealDamageItem(user, user, item); - } - - - public static boolean useHealDamageItem(obj_id user, obj_id item, int attrib) throws InterruptedException - { - return useHealDamageItem(user, user, item, attrib); - } - - - public static boolean useHealDamageItem(obj_id user, obj_id target, obj_id item) throws InterruptedException - { - return useHealDamageItem(user, target, item, HEALTH); - } - - - public static boolean useHealDamageItem(obj_id user, obj_id target, obj_id item, int attrib) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(user)) - { - return false; - } - - if (!isIdValid(item)) - { - return false; - } - - if (!isDamaged(target, attrib)) - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("healing", "no_damage_fly")); - - showFlyTextPrivateProseWithFlags(user, user, pp, 1.5f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - sendMedicalSpam(user, SID_ITEM_NO_DAMAGE, COMBAT_RESULT_MEDICAL); - - return false; - } - - if (!isValidHealTarget(target)) - { - return false; - } - - if (utils.hasScriptVar(target, VAR_ITEM_TIMER)) - { - int reuseTime = utils.getIntScriptVar(target, VAR_ITEM_TIMER); - - if (reuseTime > getGameTime()) - { - int time_left = reuseTime - getGameTime(); - - prose_package ppFly = new prose_package(); - ppFly = prose.setStringId(ppFly, new string_id("healing", "no_damage_fly")); - - showFlyTextPrivateProseWithFlags(user, user, ppFly, 1.5f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_ITEM_TOO_SOON); - pp = prose.setDI(pp, time_left); - sendMedicalSpam(user, pp, COMBAT_RESULT_MEDICAL); - - return false; - - } - - utils.removeScriptVar(target, VAR_ITEM_TIMER); - } - - if (!hasObjVar(item, VAR_ITEM_POWER)) - { - return false; - } - - int toHeal = getIntObjVar(item, VAR_ITEM_POWER); - - if (luck.isLucky(target, 0.005f)) - { - float bonus = toHeal * 0.2f; - if (bonus < 1) - { - bonus = 1; - } - - toHeal += bonus; - } - - int delta = healDamage(user, target, attrib, toHeal); - - if (delta > 0) - { - decrementCount(item); - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("healing", "heal_fly")); - pp = prose.setDI(pp, delta); - pp = prose.setTO(pp, ATTRIBUTES[attrib]); - showFlyTextPrivateProseWithFlags(user, user, pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - - pp = prose.setStringId(pp, SID_ITEM_PLAYER_HEAL); - pp = prose.setDI(pp, delta); - pp = prose.setTT(pp, target); - sendMedicalSpam(user, pp, COMBAT_RESULT_MEDICAL); - - int reuseTime = VAR_ITEM_REUSE_TIME; - utils.setScriptVar(target, VAR_ITEM_TIMER, (getGameTime() + (reuseTime))); - - sendCooldownGroupTimingOnly(user, (1824933302), reuseTime); - - doHealingAnimationAndEffect(user, target); - } - - return (delta > 0); - } - - - public static boolean useChannelHealItem(obj_id user, obj_id item) throws InterruptedException - { - return useChannelHealItem(user, item, HEALTH); - } - - - public static boolean useChannelHealItem(obj_id user, obj_id item, int attrib) throws InterruptedException - { - if (!isIdValid(user)) - { - return false; - } - - if (!isIdValid(item)) - { - return false; - } - - if (!isDamaged(user, attrib)) - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("healing", "no_damage_fly")); - - showFlyTextPrivateProseWithFlags(user, user, pp, 1.5f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - sendMedicalSpam(user, SID_ITEM_NO_DAMAGE, COMBAT_RESULT_MEDICAL); - - return false; - } - - if (!hasObjVar(item, VAR_ITEM_POWER)) - { - return false; - } - - int toHeal = getIntObjVar(item, VAR_ITEM_POWER); - - int healPerTick = toHeal / ITEM_CHANNEL_HEAL_TICKS; - - int tick = 0; - - location currentLoc = getLocation(user); - - dictionary dict = new dictionary(); - dict.put("user", user); - dict.put("tick", tick); - dict.put("item", item); - dict.put("healPerTick", healPerTick); - dict.put("healLoc", currentLoc); - dict.put("attrib", attrib); - - messageTo( user, "channelHeal", dict, 0, false); - - buff.applyBuff(user, "recent_heal"); - - decrementCount(item); - return true; - } - - - public static boolean useHealPetItem(obj_id user, obj_id pet, obj_id item) throws InterruptedException - { - if (!isIdValid(user)) - { - return false; - } - - if (!isIdValid(pet)) - { - return false; - } - - if (!isIdValid(item)) - { - return false; - } - - if (!pet_lib.isCreaturePet(pet)) - { - sendMedicalSpam(user, SID_ITEM_NOT_A_PET, COMBAT_RESULT_MEDICAL); - return false; - } - - obj_id master = getMaster(pet); - if (user != master) - { - sendMedicalSpam(user, SID_ITEM_NOT_YOUR_PET, COMBAT_RESULT_MEDICAL); - return false; - } - - if (!isDamaged(pet)) - { - sendMedicalSpam(user, SID_ITEM_NO_DAMAGE, COMBAT_RESULT_MEDICAL); - return false; - } - - if (!isValidHealTarget(pet)) - { - return false; - } - - if (utils.hasScriptVar(user, VAR_ITEM_TIMER)) - { - int reuseTime = utils.getIntScriptVar(user, VAR_ITEM_TIMER); - - if (reuseTime > getGameTime()) - { - - int time_left = reuseTime - getGameTime(); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_ITEM_TOO_SOON); - pp = prose.setDI(pp, time_left); - sendMedicalSpam(user, pp, COMBAT_RESULT_MEDICAL); - return false; - - } - - utils.removeScriptVar(user, VAR_ITEM_TIMER); - } - - if (!hasObjVar(item, VAR_ITEM_POWER)) - { - return false; - } - - int power = getIntObjVar(item, VAR_ITEM_POWER); - - int delta = healDamage(user, pet, HEALTH, power); - - if (delta > 0) - { - decrementCount(item); - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_ITEM_PET_HEAL); - pp = prose.setTT(pp, getEncodedName(pet)); - pp = prose.setDI(pp, delta); - sendMedicalSpam(user, pp, COMBAT_RESULT_MEDICAL); - - float reuseTime = VAR_ITEM_REUSE_TIME; - utils.setScriptVar(user, VAR_ITEM_TIMER, (getGameTime() + (reuseTime))); - - sendCooldownGroupTimingOnly(user, (-360620575), reuseTime); - - doHealingAnimationAndEffect(user, pet); - } - - return (delta > 0); - } - - - public static boolean canDoBeastHeal(obj_id user, obj_id pet) throws InterruptedException - { - obj_id beast = beast_lib.getBeastOnPlayer(user); - - if (!isIdValid(user) || !exists(user) || isIdNull(user)) - { - return false; - } - - if (!isIdValid(pet) || !exists(pet) || isIdNull(pet)) - { - return false; - } - - if (!isIdValid(beast) || !exists(beast) || isIdNull(beast)) - { - return false; - } - - if (beast != pet) - { - sendSystemMessage(user, new string_id("spam", "not_your_beast") ); - return false; - } - - obj_id master = getMaster(pet); - - if (user != master) - { - sendSystemMessage(user, new string_id("spam", "not_your_beast") ); - return false; - } - - if (!isDamaged(pet)) - { - sendMedicalSpam(user, SID_ITEM_NO_DAMAGE, COMBAT_RESULT_MEDICAL); - return false; - } - - if (!isValidHealTarget(pet)) - { - return false; - } - - return true; - } - - - public static boolean doBeastHeal(obj_id user, obj_id pet, int toHeal) throws InterruptedException - { - if (!canDoBeastHeal(user, pet)) - { - return false; - } - - int delta = healDamage(user, pet, HEALTH, toHeal); - - _addMedicalHate(user, pet, toHeal / 10); - - if (delta > 0) - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_BEAST_MASTER_HEAL); - pp = prose.setTT(pp, getEncodedName(pet)); - pp = prose.setDI(pp, delta); - sendMedicalSpam(user, pp, COMBAT_RESULT_MEDICAL); - doHealingAnimationAndEffect(user, pet); - } - - return (delta > 0); - } - - - public static boolean performRevivePlayer(attacker_data attackerData, defender_data[] defenderData, combat_data actionData, boolean weak) throws InterruptedException - { - obj_id medic = attackerData.id; - obj_id[] targets = new obj_id[defenderData.length]; - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - targets[i] = defenderData[i].id; - } - - return _performRevivePlayer(medic, targets, null, actionData, weak); - } - - - public static boolean _performRevivePlayer(obj_id medic, obj_id[] targets, obj_id enhancer, combat_data action_data, boolean weak) throws InterruptedException - { - boolean hasRevivedPlayer = false; - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - if (!isPlayer(targets[i])) - { - continue; - } - - if (!hasObjVar(targets[i], pclib.VAR_BEEN_COUPDEGRACED)) - { - continue; - } - - if (!utils.hasScriptVar(targets[i], "pvp_death") && action_data.actionName.equals("me_rv_pvp_area")) - { - continue; - } - - int stamp = getIntObjVar(targets[i], pclib.VAR_DEATHBLOW_STAMP); - if (getGameTime() > (stamp + REVIVE_TIMER)) - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_PERFORM_REVIVE_TOO_LONG); - pp = prose.setTT(pp, medic); - pp = prose.setTO(pp, targets[i]); - sendMedicalSpam(medic, targets[i], pp, true, true, false, COMBAT_RESULT_MEDICAL); - continue; - } - - if (!pvpCanHelp(medic, targets[i])) - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "revive_no_help_pvp") ); - pp = prose.setTO(pp, targets[i]); - sendSystemMessageProse(medic, pp); - continue; - } - - dictionary params = new dictionary(); - params.put("medic", medic); - if (weak) - { - params.put("weak", 1); - } - else - { - params.put("weak", 0); - } - - pvpHelpPerformed(medic, targets[i]); - hasRevivedPlayer = true; - messageTo(targets[i], "showReviveSUI", params, 0, false); - - prose_package reviveAttemptPP = new prose_package(); - reviveAttemptPP = prose.setStringId(reviveAttemptPP, new string_id("spam", "revive_attempt") ); - reviveAttemptPP = prose.setTO(reviveAttemptPP, targets[i]); - sendSystemMessageProse(medic, reviveAttemptPP); - } - - return hasRevivedPlayer; - } - - - public static void _addMedicalHate(obj_id medic, obj_id target, int hate) throws InterruptedException - { - _addMedicalHate(medic, target, hate, 1.0f); - } - - - public static void _addMedicalHate(obj_id medic, obj_id target, int hate, float hateMod) throws InterruptedException - { - LOG("healing_hate","_addMedicalHate init. Target: "+target); - obj_id[] hateList = getHateList(target); - - LOG("healing_hate","_addMedicalHate hateList.length: "+hateList.length); - LOG("healing_hate","_addMedicalHate hateList[0]: "+hateList[0]); - - obj_id[] objHateList = getHateList(hateList[0]); - LOG("healing_hate","_addMedicalHate obj 0 hateList.length: "+objHateList.length); - - if (hateList == null || hateList.length == 0) - { - return; - } - - if (hateMod < 0.0f) - { - hateMod = 0.0f; - } - - float hateValue = (float)hate; - hateValue *= hateMod; - - LOG("healing_hate","_addMedicalHate hateValue: "+hateValue); - - for (int i = 0; i < hateList.length; i++) - { - testAbortScript(); - if (!isIdValid(hateList[i])) - { - continue; - } - - if (medic == hateList[i]) - { - continue; - } - - addHate(hateList[i], medic, hateValue); - addHate(medic, hateList[i], 0.0f); - } - } - - - public static float _getEnhancerModifier(obj_id enhancer, float cap) throws InterruptedException - { - if (!isIdValid(enhancer)) - { - return 0.0f; - } - - if (cap <= 0.0f) - { - cap = 1.0f; - } - - float enhancement = 0.0f; - - if (hasObjVar(enhancer, VAR_ENHANCER_EFFICIENCY)) - { - enhancement = getFloatObjVar(enhancer, VAR_ENHANCER_EFFICIENCY); - } - else - { - return 0.0f; - } - - float mod = ((enhancement / 1000.0f) * cap); - - return mod; - } - - - public static float _getSkillModModifier(obj_id medic, String skill_mod, float coeff) throws InterruptedException - { - if (coeff <= 0.0f) - { - coeff = 1.0f; - } - - float skill = (float)getEnhancedSkillStatisticModifier(medic, skill_mod); - - if (skill <= 0) - { - return 0.0f; - } - - float mod = 1.0f - (1.0f * (1.0f / ((skill + (1.0f / coeff)) * coeff))); - - return mod; - } - - - public static float _getMedicalDroidModifier(obj_id medic) throws InterruptedException - { - float droidMod = 0.0f; - - if (pet_lib.isNearMedicalDroid(medic, VAR_SURGICAL_DROID_RANGE)) - { - droidMod = 0.2f; - droidMod *= pet_lib.getMedicalDroidMod(medic, VAR_SURGICAL_DROID_RANGE); - } - - return droidMod; - } - - - public static float _getShockWoundModifier(obj_id target) throws InterruptedException - { - - return 1.0f; - } - - - public static void _healingActionFollowUp(obj_id medic, obj_id target, int delta, int type) throws InterruptedException - { - int[] dArray = new int[1]; - dArray[0] = delta; - - if (isPlayer(target)) - { - if (type == 1) - { - grantHealingExperience(dArray, medic, target, HEAL_TYPE_MEDICAL_DAMAGE); - } - else - { - grantHealingExperience(dArray, medic, target, HEAL_TYPE_MEDICAL_WOUND); - } - - if (medic != target) - { - addHealingKillCredit(medic, target, dArray); - } - } - } - - - public static Vector getCombatStates(obj_id target) throws InterruptedException - { - Vector vStates = new Vector(); - - return vStates; - } - - - public static boolean isDotted(obj_id target, String dot_type) throws InterruptedException - { - if (dot_type.equals(dot.DOT_BLEEDING)) - { - return dot.isBleeding(target); - } - else if (dot_type.equals(dot.DOT_POISON)) - { - return dot.isPoisoned(target); - } - else if (dot_type.equals(dot.DOT_DISEASE)) - { - return dot.isDiseased(target); - } - else if (dot_type.equals(dot.DOT_FIRE)) - { - return dot.isOnFire(target); - } - else if (dot_type.equals(dot.DOT_ACID)) - { - return dot.isAcid(target); - } - else if (dot_type.equals(dot.DOT_ENERGY)) - { - return dot.isEnergy(target); - } - - return false; - } - - - public static void startHealOverTime(obj_id target, float duration, float tick, int healPerTick) throws InterruptedException - { - startHealOverTime(obj_id.NULL_ID, target, "", duration,tick, healPerTick, false); - } - - - public static void startHealOverTime(obj_id medic, obj_id target, String actionName, float duration, float tick, int healPerTick, boolean combatFollowUp) throws InterruptedException - { - if (!isIdValid(target)) - { - return; - } - - if (tick < 1.0f) - { - tick = 1.0f; - } - - int hot_id = rand(-99999, 99999); - utils.setScriptVar(target, VAR_PLAYER_HOT_ID, hot_id); - - int delta = healDamage(medic, target, HEALTH, healPerTick); - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("healing", "heal_fly")); - pp = prose.setDI(pp, delta); - pp = prose.setTO(pp, ATTRIBUTES[HEALTH]); - showFlyTextPrivateProseWithFlags(target, target, pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - - if (medic != target) - { - showFlyTextPrivateProseWithFlags(target, medic, pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - } - - if (!actionName.equals("")) - { - String ascii_id = "perform_"+ actionName + "_success"; - pp = prose.setStringId(pp, new string_id("healing", ascii_id)); - pp = prose.setTT(pp, medic); - pp = prose.setTO(pp, target); - sendMedicalSpam(medic, target, pp, true, true, true, COMBAT_RESULT_MEDICAL); - } - - pp = prose.setStringId(pp, SID_PERFORM_HEAL_DAMAGE_SUCCESS); - pp = prose.setTT(pp, medic); - pp = prose.setTO(pp, target); - pp = prose.setDI(pp, delta); - healing.sendMedicalSpam(medic, target, pp, true, true, true, COMBAT_RESULT_MEDICAL); - - dictionary d = new dictionary(); - d.put("duration", duration); - d.put("tick", tick); - d.put("heal", healPerTick); - d.put("id", hot_id); - d.put("medic", medic); - if (combatFollowUp) - { - d.put("combat", 1); - } - else - { - d.put("combat", 0); - } - - messageTo(target, MSG_HEAL_OVER_TIME, d, tick, false); - - if (actionName.equals("trandoshan_ability_1")) - { - buff.applyBuff(target, "trandoshan_ability_1"); - } - else - { - buff.applyBuff(target, "healOverTime"); - } - - } - - - public static boolean isAwake(obj_id target) throws InterruptedException - { - if (isIncapacitated(target)) - { - return false; - } - - if (isDead(target)) - { - return false; - } - - return true; - } - - - public static boolean validateTarget(obj_id target, int targetCheck) throws InterruptedException - { - final int NONE = -1; - final int STANDARD = 0; - final int MOB = 1; - final int CREATURE = 2; - final int NPC = 3; - final int DROID = 4; - final int PVP = 5; - final int JEDI = 6; - final int DEAD = 7; - - if (targetCheck != DEAD) - { - if (isDead(target)) - { - return false; - } - } - - switch (targetCheck) - { - case MOB: - return isMob(target) && !vehicle.isVehicle(target); - - case CREATURE: - return ai_lib.isMonster(target); - - case NPC: - return ai_lib.isNpc(target); - - case DROID: - return ai_lib.isDroid(target); - - case PVP: - return pvpCanAttack(getSelf(), target); - - case JEDI: - if (isPlayer(target)) - { - return isJedi(target); - } - else - { - return jedi.isLightsaber(getCurrentWeapon(target)); - } - - case DEAD: - return isDead(target); - } - - return true; - } - - - public static boolean fullHeal(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || (!isPlayer(player))) - { - return false; - } - - healShockWound(player, getShockWound(player)); - - attribute[] maxAttribs = getUnmodifiedMaxAttribs(player); - addAttribModifier(player, maxAttribs[HEALTH].getType(), maxAttribs[HEALTH].getValue(), 0, 0, MOD_POOL); - - return true; - } - - - public static boolean fullHealEveryone(obj_id creature) throws InterruptedException - { - if (!isIdValid(creature)) - { - return false; - } - - healShockWound(creature, getShockWound(creature)); - - attribute[] maxAttribs = getUnmodifiedMaxAttribs(creature); - addAttribModifier(creature, maxAttribs[HEALTH].getType(), maxAttribs[HEALTH].getValue(), 0, 0, MOD_POOL); - - return true; - - } - - - public static boolean healDamage(obj_id player, int amt) throws InterruptedException - { - return healDamage(player, HEALTH, amt); - } - - public static boolean healDamage(obj_id player, int attrib, int amt) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - return addAttribModifier(player, attrib, amt, 0, 0, MOD_POOL); - } - - - public static int healDamage(obj_id source, obj_id target, int attrib, int amount) throws InterruptedException - { - if (!isIdValid(source) || !isIdValid(target) || amount <= 0) - { - return 0; - } - - int hBefore = getAttrib(target, attrib); - - addAttribModifier(target, attrib, amount, 0, 0, MOD_POOL); - - int delta = getAttrib(target, attrib) - hBefore; - - if (delta > 0) - { - pvp.bfCreditForHealing(source, delta); - } - - return delta; - } - - - public static boolean healClone(obj_id player, boolean woundPlayer) throws InterruptedException - { - if (!isIdValid(player) || (!isPlayer(player))) - { - return false; - } - - location loc = getLocation(player); - boolean adventurePlanet = false; - int sceneCRC = getStringCrc(loc.area); - switch ( sceneCRC ) - { - case (1462210849): - case (1664678725): - case (1666541635): - case (1464468007): - case (-1344817832): - case (-108111930): - case (1372916281): - case (-1240008136): - case (659093975) : - case (-15432037) : - case (1676106477) : - case (1475883145) : - case (-1029289085) : - case (-111856842) : - case (1468960591) : - case (1410580269) : - case (-1454454247) : - case (-15259513) : - case (-1186872851) : - case (2130374697) : - adventurePlanet = false; - break; - default: - adventurePlanet = true; - break; - } - - float woundReduction = 0f; - - if (woundPlayer && !adventurePlanet) - { - if (utils.hasScriptVar( player, "buff.dessert_gorrnar.value" )) - { - - float eff = utils.getFloatScriptVar(player, "buff.dessert_gorrnar.value"); - buff.removeBuff(player, "dessert_gorrnar"); - - woundReduction = 1f - (eff / 100f); - } - } - - float fltThreshold = .70f; - - attribute[] maxAttribs = getUnmodifiedMaxAttribs(player); - - int attribValue = maxAttribs[HEALTH].getValue(); - float fltTest = (float)attribValue; - fltTest *= fltThreshold; - int intMaxWounds = (int)fltTest; - - if (intMaxWounds > 0) - { - setAttrib(player, HEALTH, attribValue); - } - - if (woundPlayer) - { - if (getConfigSetting("GameServer", "enableCybernetics")!=null) - { - cybernetic.applyDeathCybernetic( player ); - } - - } - - return true; - } - - - public static boolean healClone(obj_id player) throws InterruptedException - { - return healClone(player, true); - } - - - public static void sendMedicalSpam(obj_id medic, string_id message, int spam_type) throws InterruptedException - { - sendCombatSpamMessage(medic, message, spam_type); - } - - - public static void sendMedicalSpam(obj_id medic, obj_id target, string_id message, boolean to_attacker, boolean to_defender, boolean to_others, int spam_type) throws InterruptedException - { - if (medic == target) - { - sendCombatSpamMessage(medic, target, message, to_attacker, false, to_others, spam_type); - } - else - { - sendCombatSpamMessage(medic, target, message, to_attacker, to_defender, to_others, spam_type); - } - } - - - public static void sendMedicalSpam(obj_id medic, prose_package pp, int spam_type) throws InterruptedException - { - sendCombatSpamMessageProse(medic, pp, spam_type); - } - - - public static void sendMedicalSpam(obj_id medic, obj_id target, prose_package pp, boolean to_attacker, boolean to_defender, boolean to_others, int spam_type) throws InterruptedException - { - if (medic == target) - { - sendCombatSpamMessageProse(medic, target, pp, to_attacker, false, to_others, spam_type); - } - else - { - sendCombatSpamMessageProse(medic, target, pp, to_attacker, to_defender, to_others, spam_type); - } - } - - - public static String[] assembleHealingMessage(int attrib, int delta, obj_id doctor, obj_id target, int heal_type) throws InterruptedException - { - int[] attribsArray = new int[1]; - int[] deltaArray = new int[1]; - - attribsArray[0] = attrib; - deltaArray[0] = delta; - - return assembleHealingMessage(attribsArray, deltaArray, doctor, target, null, heal_type); - } - - - public static String[] assembleHealingMessage(int[] attribsArray, int[] deltaArray, obj_id doctor, obj_id target, obj_id medicine) throws InterruptedException - { - return assembleHealingMessage(attribsArray, deltaArray, doctor, target, medicine, 1); - } - - - public static String[] assembleHealingMessage(int[] attribsArray, int[] deltaArray, obj_id doctor, obj_id target, obj_id medicine, int heal_type) throws InterruptedException - { - Vector attribs = new Vector(); - if (attribs != null) - { - attribs.setSize(attribsArray.length); - for (int _i = 0; _i < attribsArray.length; ++_i) - { - attribs.set(_i, new Integer(attribsArray[_i])); - } - } - Vector delta = new Vector(); - if (delta != null) - { - delta.setSize(deltaArray.length); - for (int _i = 0; _i < deltaArray.length; ++_i) - { - delta.set(_i, new Integer(deltaArray[_i])); - } - } - - if (attribs.size() != delta.size()) - { - return null; - } - - for (int i = 0; i < delta.size(); i++) - { - testAbortScript(); - if (((Integer)(delta.get(i))).intValue() < 1) - { - attribs = utils.removeElementAt(attribs, i); - delta = utils.removeElementAt(delta, i); - i--; - } - } - - if (attribs.size() < 1) - { - return null; - } - - if (target == doctor) - { - target = null; - } - - int responseType = 0; - int attribDecWise; - - if (isIdValid(medicine)) - { - if (!isHealDamageMedicine(medicine)) - { - heal_type = 2; - } - } - - if (heal_type == 1) - { - if (attribs.size() == 1) - { - if (((Integer)(attribs.get(0))).intValue() == HEALTH) - { - if (target == null) - { - responseType = 1; - } - else - { - responseType = 2; - } - } - else if (((Integer)(attribs.get(0))).intValue() == ACTION) - { - if (target == null) - { - responseType = 3; - } - else - { - responseType = 4; - } - } - else if (((Integer)(attribs.get(0))).intValue() == MIND) - { - if (target == null) - { - responseType = 5; - } - else - { - responseType = 6; - } - } - else - { - return null; - } - } - else if (attribs.size() == 2) - { - attribDecWise = 0; - attribDecWise = (((Integer)(attribs.get(0))).intValue() + ((Integer)(attribs.get(1))).intValue()); - - if (attribDecWise == HEALTH+ACTION) - { - if (target == null) - { - responseType = 7; - } - else - { - responseType = 8; - } - } - else if (attribDecWise == HEALTH+MIND) - { - if (target == null) - { - responseType = 9; - } - else - { - responseType = 10; - } - } - else if (attribDecWise == HEALTH+ACTION+MIND) - { - if (target == null) - { - responseType = 11; - } - else - { - responseType = 12; - } - } - else - { - return null; - } - } - else if (attribs.size() == 3) - { - attribDecWise = 0; - attribDecWise = (((Integer)(attribs.get(0))).intValue() + ((Integer)(attribs.get(1))).intValue() + ((Integer)(attribs.get(2))).intValue()); - - if (attribDecWise == HEALTH+ACTION+MIND) - { - if (target == null) - { - responseType = 13; - } - else - { - responseType = 14; - } - } - else - { - return null; - } - } - } - else if (heal_type == 2) - { - if (attribs.size() == 1) - { - if (((Integer)(attribs.get(0))).intValue() == HEALTH) - { - if (target == null) - { - responseType = 15; - } - else - { - responseType = 16; - } - } - else if (((Integer)(attribs.get(0))).intValue() == CONSTITUTION) - { - if (target == null) - { - responseType = 19; - } - else - { - responseType = 20; - } - } - else if (((Integer)(attribs.get(0))).intValue() == ACTION) - { - if (target == null) - { - responseType = 21; - } - else - { - responseType = 22; - } - } - else if (((Integer)(attribs.get(0))).intValue() == STAMINA) - { - if (target == null) - { - responseType = 25; - } - else - { - responseType = 26; - } - } - else if (((Integer)(attribs.get(0))).intValue() == MIND) - { - if (target == null) - { - responseType = 27; - } - else - { - responseType = 28; - } - } - else if (((Integer)(attribs.get(0))).intValue() == WILLPOWER) - { - if (target == null) - { - responseType = 31; - } - else - { - responseType = 32; - } - } - } - } - - int damage1 = 0; - int damage2 = 0; - int damage3 = 0; - - string_id response1; - string_id response2; - string_id response3; - string_id otherResponse1; - string_id otherResponse2; - string_id otherResponse3; - - prose_package pp1 = null; - prose_package pp2 = null; - prose_package pp3 = null; - prose_package otherpp1 = null; - prose_package otherpp2 = null; - prose_package otherpp3 = null; - - String oob; - String otherOob; - String[] message = - { - null, null - }; - - switch(responseType) - { - case 1: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == HEALTH) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 9, 1)); - pp1 = prose.getPackage(response1, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - - message[0] = oob; - message[1] = null; - - break; - } - case 2: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == HEALTH) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 12, 1)); - pp1 = prose.getPackage(response1, target, damage1); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 15, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - otherOob = packOutOfBandProsePackage(null, otherpp1); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 3: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == ACTION) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 10, 1)); - pp1 = prose.getPackage(response1, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - - message[0] = oob; - message[1] = null; - - break; - } - case 4: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == ACTION) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 13, 1)); - pp1 = prose.getPackage(response1, target, damage1); - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 16, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - otherOob = packOutOfBandProsePackage(null, otherpp1); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 5: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == MIND) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 11, 1)); - pp1 = prose.getPackage(response1, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - - message[0] = oob; - message[1] = null; - - break; - } - case 6: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == MIND) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 14, 1)); - pp1 = prose.getPackage(response1, target, damage1); - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 17, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - otherOob = packOutOfBandProsePackage(null, otherpp1); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 7: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == HEALTH) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - else if (((Integer)(attribs.get(i))).intValue() == ACTION) - { - damage2 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 0, 1)); - pp1 = prose.getPackage(response1, damage1); - - response2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 3, 1)); - pp2 = prose.getPackage(response2, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - oob = packOutOfBandProsePackage(oob, pp2); - - message[0] = oob; - message[1] = null; - - break; - } - case 8: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == HEALTH) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - else if (((Integer)(attribs.get(i))).intValue() == ACTION) - { - damage2 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 5, 1)); - pp1 = prose.getPackage(response1, target, damage1); - response2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 3, 1)); - pp2 = prose.getPackage(response2, damage2); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 7, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - otherResponse2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 3, 1)); - otherpp2 = prose.getPackage(otherResponse2, damage2); - - oob = packOutOfBandProsePackage(null, pp1); - oob = packOutOfBandProsePackage(oob, pp2); - - otherOob = packOutOfBandProsePackage(null, otherpp1); - otherOob = packOutOfBandProsePackage(otherOob, otherpp2); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 9: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == HEALTH) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - else if (((Integer)(attribs.get(i))).intValue() == MIND) - { - damage2 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 0, 1)); - pp1 = prose.getPackage(response1, damage1); - - response2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 2, 1)); - pp2 = prose.getPackage(response2, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - oob = packOutOfBandProsePackage(oob, pp2); - - message[0] = oob; - message[1] = null; - - break; - } - case 10: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == HEALTH) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - else if (((Integer)(attribs.get(i))).intValue() == MIND) - { - damage2 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 4, 1)); - pp1 = prose.getPackage(response1, target, damage1); - response2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 2, 1)); - pp2 = prose.getPackage(response2, damage2); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 7, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - otherResponse2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 2, 1)); - otherpp2 = prose.getPackage(otherResponse2, damage2); - - oob = packOutOfBandProsePackage(null, pp1); - oob = packOutOfBandProsePackage(oob, pp2); - - otherOob = packOutOfBandProsePackage(null, otherpp1); - otherOob = packOutOfBandProsePackage(otherOob, otherpp2); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 11: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == ACTION) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - else if (((Integer)(attribs.get(i))).intValue() == MIND) - { - damage2 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 4, 1)); - pp1 = prose.getPackage(response1, damage1); - - response2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 2, 1)); - pp2 = prose.getPackage(response2, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - oob = packOutOfBandProsePackage(oob, pp2); - - message[0] = oob; - message[1] = null; - - break; - } - case 12: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == ACTION) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - else if (((Integer)(attribs.get(i))).intValue() == MIND) - { - damage2 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 6, 1)); - pp1 = prose.getPackage(response1, target, damage1); - response2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 2, 1)); - pp2 = prose.getPackage(response2, damage2); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 8, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - otherResponse2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 2, 1)); - otherpp2 = prose.getPackage(otherResponse2, damage2); - - oob = packOutOfBandProsePackage(null, pp1); - oob = packOutOfBandProsePackage(oob, pp2); - - otherOob = packOutOfBandProsePackage(null, otherpp1); - otherOob = packOutOfBandProsePackage(otherOob, otherpp2); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 13: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == HEALTH) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - else if (((Integer)(attribs.get(i))).intValue() == ACTION) - { - damage2 = ((Integer)(delta.get(i))).intValue(); - } - else if (((Integer)(attribs.get(i))).intValue() == MIND) - { - damage3 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 0, 1)); - pp1 = prose.getPackage(response1, damage1); - response2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 1, 1)); - pp2 = prose.getPackage(response2, damage2); - response3 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 2, 1)); - pp3 = prose.getPackage(response3, damage3); - - oob = packOutOfBandProsePackage(null, pp1); - oob = packOutOfBandProsePackage(oob, pp2); - oob = packOutOfBandProsePackage(oob, pp3); - - message[1] = oob; - message[2] = null; - - break; - } - case 14: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == HEALTH) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - else if (((Integer)(attribs.get(i))).intValue() == ACTION) - { - damage2 = ((Integer)(delta.get(i))).intValue(); - } - else if (((Integer)(attribs.get(i))).intValue() == MIND) - { - damage3 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 5, 1)); - pp1 = prose.getPackage(response1, target, damage1); - response2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 1, 1)); - pp2 = prose.getPackage(response2, damage2); - response3 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 2, 1)); - pp3 = prose.getPackage(response3, damage3); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 7, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - otherResponse2 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 1, 1)); - otherpp2 = prose.getPackage(otherResponse2, damage2); - otherResponse3 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 2, 1)); - otherpp3 = prose.getPackage(otherResponse3, damage3); - - oob = packOutOfBandProsePackage(null, pp1); - oob = packOutOfBandProsePackage(oob, pp2); - oob = packOutOfBandProsePackage(oob, pp3); - - otherOob = packOutOfBandProsePackage(null, otherpp1); - otherOob = packOutOfBandProsePackage(otherOob, otherpp2); - otherOob = packOutOfBandProsePackage(otherOob, otherpp3); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 15: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == HEALTH) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 48, 1)); - pp1 = prose.getPackage(response1, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - - message[0] = oob; - message[1] = null; - - break; - } - case 16: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == HEALTH) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 51, 1)); - pp1 = prose.getPackage(response1, target, damage1); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 54, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - otherOob = packOutOfBandProsePackage(null, otherpp1); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 19: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == CONSTITUTION) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 19, 1)); - pp1 = prose.getPackage(response1, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - - message[0] = oob; - message[1] = null; - - break; - } - case 20: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == CONSTITUTION) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 31, 1)); - pp1 = prose.getPackage(response1, target, damage1); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 40, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - otherOob = packOutOfBandProsePackage(null, otherpp1); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 21: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == ACTION) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 49, 1)); - pp1 = prose.getPackage(response1, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - - message[0] = oob; - message[1] = null; - - break; - } - case 22: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == ACTION) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 52, 1)); - pp1 = prose.getPackage(response1, target, damage1); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 55, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - otherOob = packOutOfBandProsePackage(null, otherpp1); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 25: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == STAMINA) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 21, 1)); - pp1 = prose.getPackage(response1, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - - message[0] = oob; - message[1] = null; - - break; - } - case 26: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == STAMINA) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 33, 1)); - pp1 = prose.getPackage(response1, target, damage1); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 42, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - otherOob = packOutOfBandProsePackage(null, otherpp1); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 27: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == MIND) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 49, 1)); - pp1 = prose.getPackage(response1, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - - message[0] = oob; - message[1] = null; - - break; - } - case 28: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == MIND) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 53, 1)); - pp1 = prose.getPackage(response1, target, damage1); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 56, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - otherOob = packOutOfBandProsePackage(null, otherpp1); - - message[0] = oob; - message[1] = otherOob; - - break; - } - case 31: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == WILLPOWER) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 23, 1)); - pp1 = prose.getPackage(response1, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - - message[0] = oob; - message[1] = null; - - break; - } - case 32: - { - for (int i = 0; i < attribs.size(); i++) - { - testAbortScript(); - if (((Integer)(attribs.get(i))).intValue() == WILLPOWER) - { - damage1 = ((Integer)(delta.get(i))).intValue(); - } - } - - response1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 35, 1)); - pp1 = prose.getPackage(response1, target, damage1); - - otherResponse1 = new string_id(PP_FILE_LOC, utils.dataTableGetString(RESPONSE_TEXT, 44, 1)); - otherpp1 = prose.getPackage(otherResponse1, null, null, doctor, damage1); - - oob = packOutOfBandProsePackage(null, pp1); - otherOob = packOutOfBandProsePackage(null, otherpp1); - - message[0] = oob; - message[1] = otherOob; - - break; - } - } - - return message; - } - - - public static boolean grantHealingExperience(int[] healed_damage, obj_id player, String heal_type) throws InterruptedException - { - return grantHealingExperience(healed_damage, player, null, heal_type); - } - - - public static boolean grantHealingExperience(int[] healed_damage, obj_id player, obj_id target, String heal_type) throws InterruptedException - { - if (healed_damage == null || !isIdValid(player) || heal_type == null) - { - return false; - } - - int experience = 0; - int total_healed = 0; - String exp_type; - boolean directGrant = false; - - for (int i = 0; i < healed_damage.length; i++) - { - testAbortScript(); - total_healed = total_healed + healed_damage[i]; - } - - if (heal_type.equals(HEAL_TYPE_MEDICAL_DAMAGE)) - { - experience = total_healed; - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_WOUND)) - { - experience = (int)(total_healed * 5f); - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_BUFF)) - { - experience = total_healed * 2; - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_STATE)) - { - experience = total_healed * 50; - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_FIRSTAID)) - { - experience = total_healed; - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_POISON)) - { - experience = total_healed; - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_FIRE)) - { - experience = total_healed; - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_DISEASE)) - { - experience = total_healed; - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_APPLY_POISON)) - { - experience = total_healed; - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_APPLY_DISEASE)) - { - experience = total_healed; - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_QUICK_HEAL)) - { - return true; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_HEAL_MIND)) - { - return true; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_TEND_WOUND)) - { - experience = (int)(total_healed * 2.5f); - exp_type = xp.MEDICAL; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_TEND_DAMAGE)) - { - return true; - } - - else if (heal_type.equals(HEAL_TYPE_MEDICAL_REVIVE)) - { - experience = 500; - exp_type = xp.MEDICAL; - directGrant = true; - } - else - { - return false; - } - - if (experience < 1) - { - return false; - } - - if (directGrant) - { - xp.grantCombatStyleXp(player, exp_type, experience); - } - else - { - assignHealingCombatCredit(player, target, exp_type, experience); - } - - return true; - } - - - public static boolean grantHealingExperience(int healed_damage, obj_id player, String heal_type) throws InterruptedException - { - return grantHealingExperience(healed_damage, player, null, heal_type); - } - - - public static boolean grantHealingExperience(int healed_damage, obj_id player, obj_id target, String heal_type) throws InterruptedException - { - int[] damage_array = - { - healed_damage - }; - return grantHealingExperience(damage_array, player, target, heal_type); - } - - - public static boolean assignHealingCombatCredit(obj_id player, obj_id target, String xp_type, int amount) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(player)) - { - return false; - } - - obj_id[] hateList = getHateList(target); - - if (hateList == null || hateList.length == 0) - { - return false; - } - - for (int i= 0; i < hateList.length; i++) - { - testAbortScript(); - xp.updateCombatXpList(hateList[i], player, xp_type, amount); - } - - return true; - } - - - public static boolean isDamaged(obj_id player) throws InterruptedException - { - return isDamaged(player, HEALTH); - } - - - public static boolean isDamaged(obj_id player, int attrib) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (getAttrib(player, attrib) != getWoundedMaxAttrib(player, attrib)) - { - return true; - } - - return false; - } - - - public static boolean isWounded(obj_id player, int wound_type) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (getMaxAttrib(player, HEALTH) == getWoundedMaxAttrib(player, HEALTH)) - { - return false; - } - else - { - return true; - } - } - - - public static boolean performDotRemoval(obj_id medic, obj_id target, String heal_type, obj_id med_obj) throws InterruptedException - { - if (!isIdValid(medic)) - { - return false; - } - - if (!isIdValid(target)) - { - return false; - } - - if (heal_type == null) - { - return false; - } - - if (isIdValid(med_obj)) - { - String[] skillReq = getStringArrayObjVar(med_obj, consumable.VAR_SKILL_MOD_REQUIRED); - int[] skillMin = getIntArrayObjVar(med_obj, consumable.VAR_SKILL_MOD_MIN); - - for (int i = 0; i < skillReq.length; i++) - { - testAbortScript(); - int skillMod = getSkillStatMod(medic, skillReq[i]); - if (skillMod < skillMin[i]) - { - String[] reqs = new String[skillReq.length]; - for (int n = 0; n < skillReq.length; n++) - { - testAbortScript(); - reqs[n] = skillReq[n] + "[" + getSkillStatMod(medic, skillReq[n]) + "/" + skillMin[n] + "]"; - } - - sui.listbox(medic, medic, consumable.MSG_INSUFFICIENT_SKILL, reqs); - sendMedicalSpam(medic, consumable.SID_INSUFFICIENT_SKILL, COMBAT_RESULT_MEDICAL); - - return false; - } - } - } - - if (!canPayHealingCost(medic, heal_type, 1.0f)) - { - sendMedicalSpam(medic, SID_MIND_TOO_DRAINED, COMBAT_RESULT_MEDICAL); - return false; - } - - if (medic != target) - { - if (getDistance(medic, target) > consumable.MAX_AFFECT_DISTANCE) - { - sendMedicalSpam(medic, consumable.SID_TARGET_OUT_OF_RANGE, COMBAT_RESULT_OUT_OF_RANGE); - return false; - } - } - - int area = 0; - if (isIdValid(med_obj)) - { - area = getHealingArea(med_obj); - } - - obj_id[] valid_targets; - if (area > 0) - { - valid_targets = getHealableTargetsInArea(medic, getLocation(target), area); - if (valid_targets == null) - { - return false; - } - } - else - { - valid_targets = new obj_id[1]; - valid_targets[0] = target; - } - - applyHealingCost(medic, heal_type, 1.0f); - - if (isIdValid(med_obj) && !consumable.decrementCharges(med_obj,medic)) - { - return false; - } - - boolean cure_success = false; - float removal_skill; - String dot_type; - - for (int i = 0; i < valid_targets.length; i++) - { - testAbortScript(); - if (heal_type.equals(HEAL_TYPE_MEDICAL_FIRSTAID)) - { - removal_skill = getEnhancedSkillStatisticModifier(medic, "healing_injury_treatment") * 3.0f; - dot_type = dot.DOT_BLEEDING; - - if (dot.isBleeding(valid_targets[i])) - { - if (medic != valid_targets[i]) - { - prose_package ppApplyFirstAid = prose.getPackage(SID_YOU_APPLY_FIRST_AID); - prose.setTT(ppApplyFirstAid, valid_targets[i]); - sendMedicalSpam(medic, ppApplyFirstAid, COMBAT_RESULT_MEDICAL); - - prose_package ppAppliesFirstAid = prose.getPackage(SID_APPLIES_FIRST_AID); - prose.setTT(ppAppliesFirstAid, medic); - sendMedicalSpam(medic, ppAppliesFirstAid, COMBAT_RESULT_MEDICAL); - } - else - { - sendMedicalSpam(medic, SID_APPLY_FIRST_AID_SELF, COMBAT_RESULT_MEDICAL); - } - } - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_POISON)) - { - if (!isIdValid(med_obj)) - { - return false; - } - - int cure_power = getDotPower(med_obj); - - if (isAreaMedicine(med_obj)) - { - removal_skill = cure_power; - } - else - { - removal_skill = cure_power * (1.0f + getEnhancedSkillStatisticModifier(medic, "healing_wound_treatment") / 100.0f); - } - - dot_type = dot.DOT_POISON; - - if (dot.isPoisoned(valid_targets[i])) - { - if (medic != valid_targets[i]) - { - prose_package ppApplyPoisonAntidote = prose.getPackage(SID_APPLY_POISON_ANTIDOTE); - prose.setTT(ppApplyPoisonAntidote, valid_targets[i]); - sendMedicalSpam(medic, ppApplyPoisonAntidote, COMBAT_RESULT_MEDICAL); - prose_package ppAppliesPoisonAntidote = prose.getPackage(SID_APPLIES_POISON_ANTIDOTE); - prose.setTT(ppAppliesPoisonAntidote, medic); - sendMedicalSpam(valid_targets[i], ppAppliesPoisonAntidote, COMBAT_RESULT_MEDICAL); - } - else - { - sendMedicalSpam(medic, SID_APPLY_POISON_ANTIDOTE_SELF, COMBAT_RESULT_MEDICAL); - } - } - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_FIRE)) - { - if (!isIdValid(med_obj)) - { - return false; - } - - int cure_power = getDotPower(med_obj); - - if (isAreaMedicine(med_obj)) - { - removal_skill = cure_power; - } - else - { - removal_skill = cure_power * (1.0f + getEnhancedSkillStatisticModifier(medic, "healing_wound_treatment") / 100.0f); - } - - dot_type = dot.DOT_FIRE; - - if (dot.isOnFire(valid_targets[i])) - { - if (medic != valid_targets[i]) - { - prose_package ppAttemptSuppress = prose.getPackage(SID_ATTEMPT_SUPPRESS_FLAMES); - prose.setTT(ppAttemptSuppress, valid_targets[i]); - sendMedicalSpam(medic, ppAttemptSuppress, COMBAT_RESULT_MEDICAL); - prose_package ppCoversBlanket = prose.getPackage(SID_COVERS_YOU_BLANKET); - prose.setTT(ppCoversBlanket, medic); - sendMedicalSpam(valid_targets[i], ppCoversBlanket, COMBAT_RESULT_MEDICAL); - } - else - { - sendMedicalSpam(medic, SID_COVERS_BLANKET_SELF, COMBAT_RESULT_MEDICAL); - } - } - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_DISEASE)) - { - if (!isIdValid(med_obj)) - { - return false; - } - - int cure_power = getDotPower(med_obj); - - if (isAreaMedicine(med_obj)) - { - removal_skill = cure_power; - } - else - { - removal_skill = cure_power * (1.0f + getEnhancedSkillStatisticModifier(medic, "healing_wound_treatment") / 100.0f); - } - - dot_type = dot.DOT_DISEASE; - - if (dot.isDiseased(valid_targets[i])) - { - if (medic != valid_targets[i]) - { - prose_package ppApplyDiseaseAntidote = prose.getPackage(SID_APPLY_DISEASE_ANTIDOTE); - prose.setTT(ppApplyDiseaseAntidote, valid_targets[i]); - sendMedicalSpam(medic, ppApplyDiseaseAntidote, COMBAT_RESULT_MEDICAL); - prose_package ppAppliesDiseaseAntidote = prose.getPackage(SID_APPLIES_DISEASE_ANTIDOTE); - prose.setTT(ppAppliesDiseaseAntidote, medic); - sendMedicalSpam(valid_targets[i], ppAppliesDiseaseAntidote, COMBAT_RESULT_MEDICAL); - } - else - { - sendMedicalSpam(medic, SID_APPLY_DISEASE_ANTIDOTE_SELF, COMBAT_RESULT_MEDICAL); - } - } - } - else - { - return false; - } - - int poison_reduced = dot.reduceDotTypeStrength(valid_targets[i], dot_type, (int)removal_skill); - - if (poison_reduced != -1) - { - if (isPlayer(valid_targets[i])) - { - if (isIdValid(med_obj) && isAreaMedicine(med_obj)) - { - poison_reduced *= 0.3f; - } - - grantHealingExperience(poison_reduced, medic, valid_targets[i], heal_type); - } - - if (medic != valid_targets[i]) - { - pvpHelpPerformed(medic, valid_targets[i]); - } - - cure_success = true; - } - } - - return cure_success; - } - - - public static boolean performDotApplication(obj_id medic, obj_id target, String heal_type, obj_id med_obj) throws InterruptedException - { - if (!isIdValid(medic)) - { - return false; - } - - if (!isIdValid(target)) - { - return false; - } - - if (!isIdValid(med_obj)) - { - return false; - } - - if (heal_type == null) - { - return false; - } - - String[] skillReq = getStringArrayObjVar(med_obj, consumable.VAR_SKILL_MOD_REQUIRED); - int[] skillMin = getIntArrayObjVar(med_obj, consumable.VAR_SKILL_MOD_MIN); - - for (int i = 0; i < skillReq.length; i++) - { - testAbortScript(); - int skillMod = getSkillStatMod(medic, skillReq[i]); - if (skillMod < skillMin[i]) - { - String[] reqs = new String[skillReq.length]; - for (int n = 0; n < skillReq.length; n++) - { - testAbortScript(); - reqs[n] = skillReq[n] + "[" + getSkillStatMod(medic, skillReq[n]) + "/" + skillMin[n] + "]"; - } - - sui.listbox(medic, medic, consumable.MSG_INSUFFICIENT_SKILL, reqs); - sendMedicalSpam(medic, consumable.SID_INSUFFICIENT_SKILL, COMBAT_RESULT_MEDICAL); - return false; - } - } - - if (!canPayHealingCost(medic, heal_type, 1.0f)) - { - sendMedicalSpam(medic, SID_MIND_TOO_DRAINED, COMBAT_RESULT_MEDICAL); - return false; - } - - float healing_range = (float)getHealingRange(med_obj); - float healing_range_mod = (float)getSkillStatMod(medic, "dot_efficiency"); - healing_range = healing_range + ((100.0f + healing_range_mod) / 15.0f); - float strength_mod = (float)getSkillStatMod(medic, "dot_efficiency"); - - if (getDistance(medic, target) > healing_range) - { - sendMedicalSpam(medic, consumable.SID_TARGET_OUT_OF_RANGE, COMBAT_RESULT_OUT_OF_RANGE); - return false; - } - - int area = getHealingArea(med_obj); - - obj_id[] valid_targets; - if (area > 0) - { - valid_targets = getAttackableTargetsInArea(medic, getLocation(target), area); - if (valid_targets == null) - { - return false; - } - } - else - { - valid_targets = new obj_id[1]; - valid_targets[0] = target; - } - - applyHealingCost(medic, heal_type, 1.0f); - - float strength = (float)getDotPower(med_obj) * (1.0f + strength_mod / 100.0f); - int dot_potency = getDotPotency(med_obj); - String dot_id = getDotId(med_obj); - int attribute = getDotAttribute(med_obj); - int duration = getDotDuration(med_obj); - String dot_type; - - if (heal_type.equals(HEAL_TYPE_MEDICAL_APPLY_POISON)) - { - dot_type = dot.DOT_POISON; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_APPLY_DISEASE)) - { - dot_type = dot_type = dot.DOT_DISEASE; - } - else - { - return false; - } - - if (!consumable.decrementCharges(med_obj,medic)) - { - return false; - } - - for (int i = 0; i < valid_targets.length; i++) - { - testAbortScript(); - if (heal_type.equals(HEAL_TYPE_MEDICAL_APPLY_POISON)) - { - prose_package pp_self = prose.getPackage(SID_APPLY_POISON_SELF, valid_targets[i]); - prose_package pp_other = prose.getPackage(SID_APPLY_POISON_OTHER, medic, valid_targets[i]); - sendMedicalSpam(medic, pp_self, COMBAT_RESULT_DEBUFF); - sendMedicalSpam(valid_targets[i], pp_other, COMBAT_RESULT_DEBUFF); - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_APPLY_DISEASE)) - { - prose_package pp_self = prose.getPackage(SID_APPLY_DISEASE_SELF, valid_targets[i]); - prose_package pp_other = prose.getPackage(SID_APPLY_DISEASE_OTHER, medic, valid_targets[i]); - sendMedicalSpam(medic, pp_self, COMBAT_RESULT_DEBUFF); - sendMedicalSpam(valid_targets[i], pp_other, COMBAT_RESULT_DEBUFF); - } - - if (isPlayer(valid_targets[i])) - { - if (factions.pvpDoAllowedAttackCheck(medic, valid_targets[i])) - { - pvpAttackPerformed(medic, valid_targets[i]); - } - } - - if (dot.applyDotEffect(valid_targets[i], medic, dot_type, dot_id, attribute, dot_potency, (int)strength, duration)) - { - if (!isPlayer(valid_targets[i])) - { - grantHealingExperience((int)strength, medic, valid_targets[i], heal_type); - - if (!ai_lib.isInCombat(valid_targets[i])) - { - dictionary d = new dictionary(); - d.put("attacker", medic); - messageTo(target, "handleDefenderCombatAction", d, 0.0f, true); - } - } - else - { - obj_id[] defenders = new obj_id[1]; - defenders[0] = valid_targets[i]; - int[] results = new int[1]; - results[0] = 1; - - callDefenderCombatAction(defenders, results, medic, getCurrentWeapon(medic)); - - if (factions.pvpDoAllowedAttackCheck(medic, valid_targets[i])) - { - pvpAttackPerformed(medic, valid_targets[i]); - } - } - } - else - { - prose_package pp = prose.getPackage(dot.SID_DOT_RESISTED, valid_targets[i]); - sendMedicalSpam(medic, pp, COMBAT_RESULT_GENERIC); - sendMedicalSpam(valid_targets[i], SID_RESIST_DOT_OTHER, COMBAT_RESULT_GENERIC); - } - } - - return true; - } - - - public static boolean performFirstAid(obj_id medic, obj_id target) throws InterruptedException - { - return performDotRemoval(medic, target, HEAL_TYPE_MEDICAL_FIRSTAID, null); - } - - - public static boolean performCurePoison(obj_id medic, obj_id target, obj_id med_obj) throws InterruptedException - { - return performDotRemoval(medic, target, HEAL_TYPE_MEDICAL_CURE_POISON, med_obj); - } - - - public static boolean performCureFire(obj_id medic, obj_id target, obj_id med_obj) throws InterruptedException - { - return performDotRemoval(medic, target, HEAL_TYPE_MEDICAL_CURE_FIRE, med_obj); - } - - - public static boolean performCureDisease(obj_id medic, obj_id target, obj_id med_obj) throws InterruptedException - { - return performDotRemoval(medic, target, HEAL_TYPE_MEDICAL_CURE_DISEASE, med_obj); - } - - - public static boolean performApplyPosion(obj_id medic, obj_id target, obj_id med_obj) throws InterruptedException - { - return performDotApplication(medic, target, HEAL_TYPE_MEDICAL_APPLY_POISON, med_obj); - } - - - public static boolean performApplyDisease(obj_id medic, obj_id target, obj_id med_obj) throws InterruptedException - { - return performDotApplication(medic, target, HEAL_TYPE_MEDICAL_APPLY_DISEASE, med_obj); - } - - - public static obj_id getRevivePack(obj_id medic) throws InterruptedException - { - if (!isIdValid(medic)) - { - return null; - } - - obj_id[] contents = utils.getFilteredPlayerContents(medic); - if ((contents != null) && (contents.length > 0)) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - obj_id item = contents[i]; - if (isIdValid(item)) - { - if (isRevivePack(item)) - { - return item; - } - } - } - } - - return null; - } - - - public static boolean isRevivePack(obj_id pack) throws InterruptedException - { - return isRevivePack(pack, ""); - } - - - public static boolean isRevivePack(obj_id pack, String prefix) throws InterruptedException - { - if (!isIdValid(pack)) - { - return false; - } - - if (getIntObjVar(pack, prefix + consumable.VAR_CONSUMABLE_MED_TYPE) == consumable.MT_REVIVE_PLAYER) - { - return true; - } - - return false; - } - - - public static boolean resuscitatePlayer(obj_id medic, obj_id target, obj_id pack) throws InterruptedException - { - if (!isIdValid(medic) || !isIdValid(target)) - { - return false; - } - - if (!isIdValid(pack)) - { - pack = getRevivePack(medic); - if (!isIdValid(pack)) - { - sendMedicalSpam(medic, SID_CANNOT_RESUS_WITHOUT_KIT, COMBAT_RESULT_MEDICAL); - return false; - } - } - - if (medic == target) - { - sendMedicalSpam(medic, SID_CANNOT_RESUS_WITHOUT_TARGET, COMBAT_RESULT_MEDICAL); - return false; - } - - if (!isRevivePack(pack)) - { - pack = getRevivePack(medic); - if (!isIdValid(pack)) - { - sendMedicalSpam(medic, SID_CANNOT_RESUS_WITHOUT_PACK, COMBAT_RESULT_MEDICAL); - return false; - } - } - - if (!hasObjVar(target, pclib.VAR_BEEN_COUPDEGRACED)) - { - return false; - } - - int stamp = getIntObjVar(target, pclib.VAR_DEATHBLOW_STAMP); - if (getGameTime() > (stamp + REVIVE_TIMER)) - { - sendMedicalSpam(medic, SID_TARGET_DEAD_TOO_LONG, COMBAT_RESULT_MEDICAL); - return false; - } - - if (isJedi(target) && !pclib.hasConsent(medic, target)) - { - sendMedicalSpam(medic, SID_MUST_HAVE_JEDI_CONSENT, COMBAT_RESULT_MEDICAL); - return false; - } - - if (!group.inSameGroup(medic, target) && !pclib.hasConsent(medic, target)) - { - sendMedicalSpam(medic, SID_GROUP_OR_CONSENT_FROM_TARGET, COMBAT_RESULT_MEDICAL); - return false; - } - - if (!canPayHealingCost(medic, HEAL_TYPE_MEDICAL_BUFF, 1.0f)) - { - sendMedicalSpam(medic, SID_MIND_TOO_DRAINED, COMBAT_RESULT_MEDICAL); - return false; - } - - attrib_mod[] am = getAttribModArrayObjVar(pack, consumable.VAR_CONSUMABLE_MODS); - if ((am == null) || (am.length == 0)) - { - return false; - } - - if (consumable.consumeItem(medic, target, pack)) - { - applyHealingCost(medic, HEAL_TYPE_MEDICAL_REVIVE, 1.0f); - - int[] att = new int[WILLPOWER + 1]; - for (int i = 0; i < am.length; i++) - { - testAbortScript(); - int attrib = am[i].getAttribute(); - float attack = am[i].getAttack(); - float decay = am[i].getDecay(); - int val = am[i].getValue(); - - if (attack == AM_HEAL_WOUND) - { - val *= 2.5; - } - else if (decay == MOD_POOL) - { - val /= 4; - } - - if (val > 0) - { - att[attrib] += val; - } - } - - grantHealingExperience(att, medic, target, HEAL_TYPE_MEDICAL_REVIVE); - - pvpHelpPerformed(medic, target); - - messageTo(target, "handlePlayerResuscitated", null, 0, true); - return true; - } - - return false; - } - - - public static boolean resuscitatePlayer(obj_id medic, obj_id target) throws InterruptedException - { - return resuscitatePlayer(medic, target, null); - } - - - public static float getDragPlayerRange(obj_id medic) throws InterruptedException - { - if (!isIdValid(medic)) - { - return -1f; - } - - int mod = getSkillStatMod(medic, "healing_ability"); - - if (mod > 0f) - { - float range = 8f + (22f * ((float)mod/100f)); - if (range > 0f) - { - return range; - } - } - - return -1f; - } - - - public static boolean playRangedAnimation(obj_id medic, obj_id target, obj_id med_obj, String[] animation) throws InterruptedException - { - if (!isIdValid(medic)) - { - return false; - } - - if (!isIdValid(target)) - { - return false; - } - - if (!isIdValid(med_obj)) - { - return false; - } - - if (animation == null) - { - return false; - } - else if (animation.length != 2) - { - return false; - } - - if (getPosture(medic) != POSTURE_UPRIGHT) - { - setPosture(medic, POSTURE_UPRIGHT); - } - - String strPlaybackName = "throw_grenade"; - float fltDistance = getDistance(medic, target); - - if (fltDistance < 10) - { - strPlaybackName += "_near"; - } - else if (fltDistance < 20) - { - strPlaybackName += "_medium"; - } - else - { - strPlaybackName += "_far"; - } - - if (getHealingArea(med_obj) > 0) - { - strPlaybackName += "_"+ animation[0]; - } - else - { - strPlaybackName += "_"+ animation[1]; - } - - defender_results[] cbtDefenderResults = new defender_results[1]; - cbtDefenderResults[0] = new defender_results(); - attacker_results cbtAttackerResults = new attacker_results(); - - cbtDefenderResults[0].id = target; - cbtDefenderResults[0].endPosture = getPosture(target); - cbtDefenderResults[0].result = COMBAT_RESULT_HIT; - - cbtAttackerResults.id = medic; - cbtAttackerResults.weapon = null; - doCombatResults(strPlaybackName, cbtAttackerResults, cbtDefenderResults); - - return true; - } - - - public static void playHealDamageEffect(location loc) throws InterruptedException - { - if (loc == null) - { - return; - } - - obj_id[] players = getAllPlayers(loc, VAR_EFFECT_DISPLAY_RADIUS); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - if (isIdValid(players[i]) && exists(players[i]) && !stealth.hasInvisibleBuff(players[i])) - { - playClientEffectLoc(players[i], "appearance/pt_heal_2.prt", loc, 0); - } - } - } - - return; - } - - - public static void playHealWoundEffect(location loc) throws InterruptedException - { - if (loc == null) - { - return; - } - - obj_id[] players = getAllPlayers(loc, VAR_EFFECT_DISPLAY_RADIUS); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - playClientEffectLoc(players[i], "clienteffect/healing_healwound.cef", loc, 0); - } - } - - return; - } - - - public static void playHealStateEffect(location loc) throws InterruptedException - { - if (loc == null) - { - return; - } - - obj_id[] players = getAllPlayers(loc, VAR_EFFECT_DISPLAY_RADIUS); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - playClientEffectLoc(players[i], "clienteffect/healing_healstate.cef", loc, 0); - } - } - - return; - } - - - public static void playHealEnhanceEffect(location loc) throws InterruptedException - { - if (loc == null) - { - return; - } - - obj_id[] players = getAllPlayers(loc, VAR_EFFECT_DISPLAY_RADIUS); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - playClientEffectLoc(players[i], "clienteffect/healing_healenhance.cef", loc, 0); - } - } - - return; - } - - - public static void playApplyPoisonEffect(location loc) throws InterruptedException - { - if (loc == null) - { - return; - } - - obj_id[] players = getAllPlayers(loc, VAR_EFFECT_DISPLAY_RADIUS); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - playClientEffectLoc(players[i], "clienteffect/dot_apply_poison.cef", loc, 0); - } - } - - return; - } - - - public static void playApplyAreaPoisonEffect(location loc) throws InterruptedException - { - if (loc == null) - { - return; - } - - obj_id[] players = getAllPlayers(loc, VAR_EFFECT_DISPLAY_RADIUS); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - playClientEffectLoc(players[i], "clienteffect/dot_apply_area_poison.cef", loc, 0); - } - } - - return; - } - - - public static void playApplyDiseaseEffect(location loc) throws InterruptedException - { - if (loc == null) - { - return; - } - - obj_id[] players = getAllPlayers(loc, VAR_EFFECT_DISPLAY_RADIUS); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - playClientEffectLoc(players[i], "clienteffect/dot_apply_disease.cef", loc, 0); - } - } - - return; - } - - - public static void playApplyAreaDiseaseEffect(location loc) throws InterruptedException - { - if (loc == null) - { - return; - } - - obj_id[] players = getAllPlayers(loc, VAR_EFFECT_DISPLAY_RADIUS); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - playClientEffectLoc(players[i], "clienteffect/dot_apply_area_disease.cef", loc, 0); - } - } - - return; - } - - - public static boolean canDiagnose(obj_id medic, obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if (medic == target) - { - return false; - } - - if (getDistance(medic, target) > consumable.MAX_AFFECT_DISTANCE) - { - sendMedicalSpam(medic, consumable.SID_TARGET_OUT_OF_RANGE, COMBAT_RESULT_OUT_OF_RANGE); - return false; - } - - if (!pvpCanHelp(medic, target)) - { - sendMedicalSpam(medic, SID_PVP_NO_HELP, COMBAT_RESULT_MEDICAL); - return false; - } - - if (!isPlayer(target)) - { - if (!pet_lib.isCreaturePet(target) && !pet_lib.isNpcPet(target) || ai_lib.isAndroid(target)) - { - sendMedicalSpam(medic, SID_TEND_WOUNDS_INVALID_TARGET, COMBAT_RESULT_MEDICAL); - return false; - } - else - { - if (!factions.pvpDoAllowedHelpCheck(medic, target)) - { - LOG("HEALING_MESSAGE_ERROR", medic + " ->It would be unwise to help such a patient."); - sendMedicalSpam(medic, SID_PVP_NO_HELP, COMBAT_RESULT_MEDICAL); - return false; - } - else - { - if (!isPlayer(target)) - { - - if (!pet_lib.isCreaturePet(target) && !pet_lib.isNpcPet(target) || ai_lib.isAndroid(target)) - { - LOG("HEALING_MESSAGE_ERROR", "Target must be a player or a creature pet in order to tend wounds."); - sendMedicalSpam(medic, SID_TEND_WOUNDS_INVALID_TARGET, COMBAT_RESULT_MEDICAL); - return false; - } - else - { - return true; - } - } - else - { - return true; - } - } - } - } - else - { - return true; - } - } - - - public static void addHealingKillCredit(obj_id medic, obj_id target, int[] delta) throws InterruptedException - { - if (!isIdValid(medic)) - { - return; - } - - if (!isIdValid(target)) - { - return; - } - - if (delta == null || delta.length == 0) - { - return; - } - - if (group.inSameGroup(medic, target) && getState(target, STATE_COMBAT) == 1) - { - int total = 0; - for (int i = 0; i < delta.length; i++) - { - testAbortScript(); - total += delta[i]; - } - - if (total > 0) - { - obj_id combatTarget = getCombatTarget(target); - - if (isIdValid(combatTarget)) - { - int trackedPermissions = Math.round(total * HEALING_KILL_CREDIT_MULTIPLIER); - - if (target != medic) - { - dictionary params = new dictionary(); - params.put("healer", medic); - messageTo(combatTarget, "addEnemyHealer", params, 0.0f, false); - } - } - } - } - } - - - public static obj_id findDroidWoundMed(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (!isIdValid(inventory)) - { - return null; - } - - obj_id[] inv_contents = utils.getContents(inventory, false); - if (inv_contents == null || inv_contents.length == 0) - { - return null; - } - - for (int i = 0; i < inv_contents.length; i++) - { - testAbortScript(); - if (hasObjVar(inv_contents[i],consumable.VAR_CONSUMABLE_MODS)) - { - if (hasObjVar(inv_contents[i], consumable.VAR_CONSUMABLE_DROID_MED)) - { - attrib_mod[] mod_array = getAttribModArrayObjVar(inv_contents[i], consumable.VAR_CONSUMABLE_MODS); - - if (mod_array != null) - { - for (int j = 0; j < mod_array.length; j++) - { - testAbortScript(); - float attack = mod_array[j].getAttack(); - - if (attack == AM_HEAL_WOUND) - { - return inv_contents[i]; - } - } - } - } - } - } - - return null; - } - - - public static obj_id findDroidDamageMed(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (!isIdValid(inventory)) - { - return null; - } - - obj_id[] inv_contents = utils.getContents(inventory, false); - if (inv_contents == null || inv_contents.length == 0) - { - return null; - } - - for (int i = 0; i < inv_contents.length; i++) - { - testAbortScript(); - if (hasObjVar(inv_contents[i],consumable.VAR_CONSUMABLE_BASE)) - { - if (hasObjVar(inv_contents[i], consumable.VAR_CONSUMABLE_DROID_MED)) - { - if (hasObjVar(inv_contents[i], "consumable.energy")) - { - return inv_contents[i]; - } - } - } - } - - return null; - } - - - public static int[] distributeHAMWoundHealingPoints(obj_id patient, int total) throws InterruptedException - { - - int[] toHeal = new int[3]; - toHeal[0] = total; - toHeal[1] = 0; - toHeal[2] = 0; - - return toHeal; - } - - - public static int[] distributeHAMDamageHealingPoints(obj_id patient, int total) throws InterruptedException - { - - int[] toHeal = new int[3]; - toHeal[0] = total; - toHeal[1] = 0; - toHeal[2] = 0; - - return toHeal; - } - - - public static boolean isDroidWounded(obj_id patient) throws InterruptedException - { - - int hWound = (getMaxAttrib(patient, HEALTH) - getWoundedMaxAttrib(patient, HEALTH)); - - if (hWound > 0) - { - return true; - } - - return false; - } - - - public static boolean isDroidDamaged(obj_id patient) throws InterruptedException - { - - int hDamage = (getWoundedMaxAttrib(patient, HEALTH) - getAttrib(patient, HEALTH)); - - if (hDamage > 0) - { - return true; - } - - return false; - } - - - public static boolean performDroidRepair(obj_id medic, obj_id target, obj_id med_obj, boolean pay_cost) throws InterruptedException - { - - if (!isIdValid(medic)) - { - return false; - } - - if (!isIdValid(target)) - { - return false; - } - - if (!isIdValid(med_obj)) - { - return false; - } - - boolean isDroidPetMed = hasObjVar(med_obj, consumable.VAR_CONSUMABLE_DROID_MED); - boolean isDamageMed = hasObjVar(med_obj, "consumable.energy"); - - if (!isDroidPetMed) - { - return false; - } - - String costType = HEAL_TYPE_MEDICAL_WOUND; - - if (isDamageMed) - { - costType = HEAL_TYPE_MEDICAL_DAMAGE; - } - - if (pay_cost) - { - if (!canPayHealingCost(medic, costType, 1.0f)) - { - sendMedicalSpam(medic, SID_NOT_ENOUGH_MIND, COMBAT_RESULT_MEDICAL); - return false; - } - } - - int health_before = getAttrib(target,HEALTH); - - if (consumable.consumeItem(medic, target, med_obj)) - { - if (pay_cost) - { - applyHealingCost(medic, costType, 1.0f); - } - - int health_after = getAttrib(target,HEALTH); - int totalHealed = health_after - health_before; - - int[] delta = - { - totalHealed - }; - - obj_id target_master = getMaster(target); - - prose_package pp_self; - prose_package pp_other; - - if (isDamageMed) - { - pp_self = prose.getPackage(SID_DROID_REPAIR_DAMAGE_SELF, getEncodedName(target), totalHealed); - pp_other = prose.getPackage(SID_DROID_REPAIR_DAMAGE_OTHER, getFirstName(medic), getEncodedName(target), totalHealed); - } - else - { - pp_self = prose.getPackage(SID_DROID_REPAIR_WOUND_SELF, getEncodedName(target), totalHealed); - pp_other = prose.getPackage(SID_DROID_REPAIR_WOUND_OTHER, getFirstName(medic), getEncodedName(target), totalHealed); - } - - sendMedicalSpam(medic, pp_self, COMBAT_RESULT_MEDICAL); - - if ((target_master != null) && (medic != target_master)) - { - if (isIdValid(target_master)) - { - sendMedicalSpam(target_master, pp_other, COMBAT_RESULT_MEDICAL); - } - - pvpHelpPerformed(medic, target); - - if (isDamageMed) - { - addHealingKillCredit(medic, target, delta); - } - } - - return true; - } - - return false; - } - - - public static obj_id findStimpackDispensorDroid(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return null; - } - - obj_id[] creatures = getCreaturesInRange(getLocation(player), VAR_STIMPACK_DROID_RADIUS); - if (creatures != null) - { - for (int i = 0; i < creatures.length; i++) - { - testAbortScript(); - if (pet_lib.isDroidPet(creatures[i])) - { - if (hasObjVar(creatures[i], "module_data.stimpack_capacity")) - { - if (getIntObjVar(creatures[i], "module_data.stimpack_supply") > 0) - { - if (!utils.hasScriptVar(creatures[i], "module_data.stimpack_recharging")) - { - obj_id master = getMaster(creatures[i]); - if (isIdValid(master)) - { - if ((master == player) || group.inSameGroup(master, player)) - { - return creatures[i]; - } - } - } - } - } - } - } - } - - return null; - } - - - public static boolean isMedicine(obj_id object) throws InterruptedException - { - return isMedicine(object, ""); - } - - - public static boolean isMedicine(obj_id object, String prefix) throws InterruptedException - { - if (!isIdValid(object)) - { - return false; - } - - if (hasObjVar(object, prefix + consumable.VAR_CONSUMABLE_MEDICINE)) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isRangedMedicine(obj_id object) throws InterruptedException - { - return isRangedMedicine(object, "", false); - } - - - public static boolean isRangedMedicine(obj_id object, String prefix, boolean inDocBag) throws InterruptedException - { - if (!isIdValid(object)) - { - return false; - } - - if (inDocBag) - { - if (hasObjVar(object, prefix + "healing.dot_info")) - { - int[] healingInfo = getIntArrayObjVar(object, prefix + "healing.dot_info"); - if (healingInfo[0] > 0) - { - return true; - } - } - - return false; - } - else - { - if (hasObjVar(object, VAR_HEALING_RANGE)) - { - return true; - } - else - { - return false; - } - } - } - - - public static boolean isAreaMedicine(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return false; - } - - if (hasObjVar(object, VAR_HEALING_AREA)) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isHealDamageMedicine(obj_id medicine) throws InterruptedException - { - return isHealDamageMedicine(medicine, ""); - } - - - public static boolean isHealDamageMedicine(obj_id medicine, String prefix) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return false; - } - - attrib_mod[] mod_array = getAttribModArrayObjVar(medicine, prefix + consumable.VAR_CONSUMABLE_MODS); - - if (mod_array == null) - { - return false; - } - - for (int i = 0; i < mod_array.length; i++) - { - testAbortScript(); - int attribute = mod_array[i].getAttribute(); - float decay = mod_array[i].getDecay(); - - if ((attribute != HEALTH) && (attribute != ACTION) && (attribute != MIND)) - { - } - - if (decay != MOD_POOL) - { - return false; - } - } - return true; - } - - - public static boolean isHealStateMedicine(obj_id medicine) throws InterruptedException - { - return isHealStateMedicine(medicine, ""); - } - - - public static boolean isHealStateMedicine(obj_id medicine, String prefix) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return false; - } - - if (hasObjVar(medicine, prefix + VAR_HEALING_STATE)) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isBuffMedicine(obj_id medicine) throws InterruptedException - { - return isBuffMedicine(medicine, ""); - } - - - public static boolean isBuffMedicine(obj_id medicine, String prefix) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return false; - } - - if (!isMedicine(medicine, prefix)) - { - return false; - } - - attrib_mod[] mod_array = getAttribModArrayObjVar(medicine, prefix + consumable.VAR_CONSUMABLE_MODS); - - if (mod_array == null) - { - return false; - } - - for (int i = 0; i < mod_array.length; i++) - { - testAbortScript(); - float duration = mod_array[i].getDuration(); - if (duration < 1.0f) - { - return false; - } - } - - return true; - } - - - public static boolean isCureDotMedicine(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return false; - } - - if (hasObjVar(medicine, VAR_HEALING_CURE_DOT)) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isApplyDotMedicine(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return false; - } - - if (hasObjVar(medicine, VAR_HEALING_APPLY_DOT)) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isCurePoisonMedicine(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return false; - } - - if (hasObjVar(medicine, VAR_HEALING_CURE_DOT)) - { - String type = getStringObjVar(medicine, VAR_HEALING_CURE_DOT); - if (type.equals(dot.DOT_POISON)) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } - } - - - public static boolean isCureFireMedicine(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return false; - } - - if (hasObjVar(medicine, VAR_HEALING_CURE_DOT)) - { - String type = getStringObjVar(medicine, VAR_HEALING_CURE_DOT); - if (type.equals(dot.DOT_FIRE)) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } - } - - - public static boolean isCureDiseaseMedicine(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return false; - } - - if (hasObjVar(medicine, VAR_HEALING_CURE_DOT)) - { - String type = getStringObjVar(medicine, VAR_HEALING_CURE_DOT); - if (type.equals(dot.DOT_DISEASE)) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } - } - - - public static boolean isApplyPoisonMedicine(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return false; - } - - if (hasObjVar(medicine, VAR_HEALING_APPLY_DOT)) - { - String type = getStringObjVar(medicine, VAR_HEALING_APPLY_DOT); - if (type.equals(dot.DOT_POISON)) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } - } - - - public static boolean isApplyDiseaseMedicine(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return false; - } - - if (hasObjVar(medicine, VAR_HEALING_APPLY_DOT)) - { - String type = getStringObjVar(medicine, VAR_HEALING_APPLY_DOT); - if (type.equals(dot.DOT_DISEASE)) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } - } - - - public static int getHealingRange(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return 0; - } - - if (isRangedMedicine(medicine)) - { - return getIntObjVar(medicine, VAR_HEALING_RANGE); - } - else - { - return 0; - } - } - - - public static int getHealingArea(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return 0; - } - - if (hasObjVar(medicine, VAR_HEALING_AREA)) - { - return getIntObjVar(medicine, VAR_HEALING_AREA); - } - else - { - return 0; - } - } - - - public static String getHealingState(obj_id medicine) throws InterruptedException - { - return getHealingState(medicine, ""); - } - - - public static String getHealingState(obj_id medicine, String prefix) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return null; - } - - if (isHealStateMedicine(medicine, prefix)) - { - return getStringObjVar(medicine, prefix + VAR_HEALING_STATE); - } - else - { - return null; - } - } - - - public static String getCureDot(obj_id medicine) throws InterruptedException - { - return getCureDot(medicine, ""); - } - - - public static String getCureDot(obj_id medicine, String prefix) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return null; - } - - if (hasObjVar(medicine, prefix + VAR_HEALING_CURE_DOT)) - { - return getStringObjVar(medicine, prefix + VAR_HEALING_CURE_DOT); - } - else - { - return null; - } - } - - - public static String getApplyDot(obj_id medicine) throws InterruptedException - { - return getApplyDot(medicine, ""); - } - - - public static String getApplyDot(obj_id medicine, String prefix) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return null; - } - - if (hasObjVar(medicine, prefix + VAR_HEALING_APPLY_DOT)) - { - return getStringObjVar(medicine, prefix + VAR_HEALING_APPLY_DOT); - } - else - { - return null; - } - } - - - public static int getDotPower(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return -1; - } - - if (hasObjVar(medicine, VAR_HEALING_DOT_POWER)) - { - return getIntObjVar(medicine, VAR_HEALING_DOT_POWER); - } - else - { - return -1; - } - } - - - public static int getDotPotency(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return -1; - } - - if (hasObjVar(medicine, VAR_HEALING_DOT_POTENCY)) - { - return getIntObjVar(medicine, VAR_HEALING_DOT_POTENCY); - } - else - { - return -1; - } - } - - - public static String getDotId(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return null; - } - - if (hasObjVar(medicine, VAR_HEALING_DOT_ID)) - { - return getStringObjVar(medicine, VAR_HEALING_DOT_ID); - } - else - { - return null; - } - } - - - public static int getDotAttribute(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return -1; - } - - if (hasObjVar(medicine, VAR_HEALING_DOT_ATTRIBUTE)) - { - return getIntObjVar(medicine, VAR_HEALING_DOT_ATTRIBUTE); - } - else - { - return -1; - } - } - - - public static int getDotDuration(obj_id medicine) throws InterruptedException - { - if (!isIdValid(medicine)) - { - return -1; - } - - if (hasObjVar(medicine, VAR_HEALING_DOT_DURATION)) - { - return getIntObjVar(medicine, VAR_HEALING_DOT_DURATION); - } - else - { - return -1; - } - } - - - public static float getHealingMultiplier(obj_id player, obj_id item, String type) throws InterruptedException - { - float healing_skill = 0.0f; - - boolean medical_type = false; - boolean entertainer_type = false; - - float random_factor = rand(50, 150); - - if (type.equals(HEAL_TYPE_MEDICAL_DAMAGE) || type.equals(HEAL_TYPE_MEDICAL_QUICK_HEAL) || type.equals(HEAL_TYPE_MEDICAL_TEND_DAMAGE)) - { - medical_type = true; - healing_skill = (float)getEnhancedSkillStatisticModifier(player, "healing_efficiency"); - } - else if (type.equals(HEAL_TYPE_MEDICAL_WOUND) || type.equals(HEAL_TYPE_MEDICAL_TEND_WOUND)) - { - medical_type = true; - healing_skill = (float)getEnhancedSkillStatisticModifier(player, "healing_efficiency"); - } - else if (type.equals(HEAL_TYPE_MEDICAL_HEAL_MIND)) - { - medical_type = true; - healing_skill = (float)getEnhancedSkillStatisticModifier(player, "dot_efficiency"); - } - else if (type.equals(HEAL_TYPE_MEDICAL_BUFF)) - { - medical_type = true; - healing_skill = (float)getEnhancedSkillStatisticModifier(player, "healing_efficiency"); - - random_factor = 100; - } - else if (type.equals(HEAL_TYPE_DANCE_WOUND)) - { - entertainer_type = true; - healing_skill = (float)getEnhancedSkillStatisticModifier(player, "healing_dance_wound"); - } - else if (type.equals(HEAL_TYPE_DANCE_SHOCK)) - { - entertainer_type = true; - healing_skill = (float)getEnhancedSkillStatisticModifier(player, "healing_dance_shock"); - } - else if (type.equals(HEAL_TYPE_MUSIC_WOUND)) - { - entertainer_type = true; - healing_skill = (float)getEnhancedSkillStatisticModifier(player, "healing_music_wound"); - } - else if (type.equals(HEAL_TYPE_MUSIC_SHOCK)) - { - entertainer_type = true; - healing_skill = (float)getEnhancedSkillStatisticModifier(player, "healing_music_shock"); - } - - float complexity = 0.0f; - - if (item != null || item != obj_id.NULL_ID) - { - complexity = getComplexity(item); - } - - float medicalDroidModifier = 0.0f; - float multiplier = 0.0f; - - if (pet_lib.isNearMedicalDroid(player, VAR_SURGICAL_DROID_RANGE)) - { - medicalDroidModifier = pet_lib.getMedicalDroidMod(player, VAR_SURGICAL_DROID_RANGE); - } - - if (medicalDroidModifier > 0.0f) - { - multiplier = (1 + healing_skill / 100) * (random_factor / 100) * medicalDroidModifier; - } - else - { - multiplier = (1 + healing_skill / 100) * (random_factor / 100); - } - - if (entertainer_type) - { - int city_id = city.checkCity(player, false); - if (city_id > 0 && (city.cityHasSpec(city_id, city.SF_SPEC_ENTERTAINER) || city.cityHasSpec(city_id, city.SF_SPEC_MASTER_HEALING))) - { - multiplier *= 1.1f; - } - } - - if (medical_type) - { - int city_id = city.checkCity(player, false); - if (city_id > 0 && (city.cityHasSpec(city_id, city.SF_SPEC_DOCTOR) || city.cityHasSpec(city_id, city.SF_SPEC_MASTER_HEALING))) - { - multiplier *= 1.1f; - } - } - - return multiplier; - } - - - public static float getHealingMultiplier(obj_id player, obj_id item) throws InterruptedException - { - if (isHealDamageMedicine(item)) - { - return getHealingMultiplier(player, item, HEAL_TYPE_MEDICAL_DAMAGE); - } - else if (isBuffMedicine(item)) - { - return getHealingMultiplier(player, item, HEAL_TYPE_MEDICAL_BUFF); - } - else - { - return getHealingMultiplier(player, item, HEAL_TYPE_MEDICAL_WOUND); - } - } - - - public static boolean hasEnhancement(obj_id player, int attribute) throws InterruptedException - { - if (!isIdValid(player)) - { - return true; - } - - String buff_name = "medical_enhance_"+ attributeToString(attribute).toLowerCase(); - - if (hasAttribModifier(player, buff_name) || hasSkillModModifier(player, buff_name)) - { - return true; - } - else - { - return false; - } - } - - - public static int getHealEnhanceValue(obj_id player, int attribute) throws InterruptedException - { - if (!isIdValid(player)) - { - return -1; - } - - String buff_name = "medical_enhance_"+ attributeToString(attribute).toLowerCase(); - attrib_mod[] all_am = getAttribModifiers(player, attribute); - - if (all_am != null && all_am.length > 0) - { - for (int i = 0; i < all_am.length; i++) - { - testAbortScript(); - if (all_am[i].getName().equals(buff_name)) - { - return all_am[i].getValue(); - } - } - } - - if (utils.hasScriptVar(player, "healing." + buff_name)) - { - return utils.getIntScriptVar(player, "healing." + buff_name); - } - - return 0; - } - - - public static float applyShockWoundModifier(float multiplier, obj_id player) throws InterruptedException - { - float shock = (float)getShockWound(player); - - if (shock < 1) - { - return multiplier; - } - else - { - float shock_mult = (1250.0f - shock) / 1000.0f; - - if (shock_mult > 1.0f) - { - shock_mult = 1.0f; - } - else if (shock_mult < 0.25f) - { - shock_mult = 0.25f; - } - - multiplier *= shock_mult; - if (multiplier < 0) - { - multiplier = 0; - } - - return multiplier; - } - } - - - public static attrib_mod[] modifyMedicineAttributes(attrib_mod[] am, float multiplier) throws InterruptedException - { - Vector am_new = new Vector(); - am_new.setSize(0); - - for (int i = 0; i < am.length; i++) - { - testAbortScript(); - attrib_mod tmp; - int mod_value; - - if (am[i].getAttack() == AM_HEAL_WOUND) - { - mod_value = (int)(am[i].getValue() * multiplier); - - tmp = utils.createHealWoundAttribMod(am[i].getAttribute(), mod_value); - am_new = utils.addElement(am_new, tmp); - } - else - { - if (am[i].getDecay() == MOD_POOL) - { - mod_value = (int)(am[i].getValue() * multiplier); - - tmp = utils.createHealDamageAttribMod(am[i].getAttribute(), mod_value); - am_new = utils.addElement(am_new, tmp); - } - else - { - mod_value = (int)(am[i].getValue() * multiplier); - - tmp = new attrib_mod(am[i].getAttribute(), mod_value, am[i].getDuration(), VAR_BUFF_MOD_ATTACK, VAR_BUFF_MOD_DECAY); - am_new = utils.addElement(am_new, tmp); - } - } - } - - return (attrib_mod[])am_new.toArray(new attrib_mod[0]); - } - - - public static boolean canHealDamage(obj_id player, boolean verbose) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (!hasObjVar(player, VAR_HEALING_CAN_HEALDAMAGE)) - { - setObjVar(player, VAR_HEALING_CAN_HEALDAMAGE, 0); - } - - int healing_roundtime = getIntObjVar(player, VAR_HEALING_CAN_HEALDAMAGE); - if (healing_roundtime != 0) - { - if (verbose) - { - int time_remaining = (healing_roundtime - getGameTime()); - if (time_remaining > 0) - { - int[] conv_time = player_structure.convertSecondsTime(time_remaining); - String time_str = player_structure.assembleTimeRemaining(conv_time); - prose_package ppNoTime = prose.getPackage(SID_CANNOT_DO_THAT_TIME); - prose.setTO(ppNoTime, time_str); - sendMedicalSpam(player, ppNoTime, COMBAT_RESULT_MEDICAL); - } - else - { - sendMedicalSpam(player, SID_YOU_MUST_WAIT, COMBAT_RESULT_MEDICAL); - } - } - - return false; - } - - int injury_skill = getSkillStatMod(player, "healing_injury_treatment"); - - if (injury_skill == 0) - { - if (verbose) - { - sendMedicalSpam(player, SID_CANT_HEAL_DAMAGE_OR_STATES, COMBAT_RESULT_MEDICAL); - } - - return false; - } - - return true; - } - - - public static boolean canHealDamage(obj_id player) throws InterruptedException - { - return canHealDamage(player, true); - } - - - public static boolean canHealWound(obj_id player, boolean verbose) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - location loc = getLocation(player); - if (isIdValid(loc.cell)) - { - obj_id building = getTopMostContainer(loc.cell); - if (building != null && building != obj_id.NULL_ID) - { - if (!hasObjVar(building, "healing.canhealwound")) - { - if (verbose) - { - sendMedicalSpam(player, SID_MUST_BE_IN_HOSPITAL_OR_CS, COMBAT_RESULT_MEDICAL); - } - - return false; - } - } - } - else - { - obj_id camp = camping.getCurrentCamp(player); - - if (!isIdValid(camp)) - { - if (!pet_lib.isNearMedicalDroid(player, VAR_SURGICAL_DROID_RANGE)) - { - if (verbose) - { - sendMedicalSpam(player, SID_MUST_BE_IN_HOSP_OR_CS_OR_DROID, COMBAT_RESULT_MEDICAL); - } - - return false; - } - } - } - - if (!hasObjVar(player, VAR_HEALING_CAN_HEALWOUND)) - { - setObjVar(player, VAR_HEALING_CAN_HEALWOUND, 0); - } - - int healing_roundtime = getIntObjVar(player, VAR_HEALING_CAN_HEALWOUND); - if (healing_roundtime != 0) - { - if (verbose) - { - int time_remaining = (healing_roundtime - getGameTime()); - if (time_remaining > 0) - { - int[] conv_time = player_structure.convertSecondsTime(time_remaining); - String time_str = player_structure.assembleTimeRemaining(conv_time); - prose_package ppNoTime = prose.getPackage(SID_CANNOT_DO_THAT_TIME); - prose.setTO(ppNoTime, time_str); - sendMedicalSpam(player, ppNoTime, COMBAT_RESULT_MEDICAL); - } - else - { - sendMedicalSpam(player, SID_MUST_WAIT_TO_HEAL_OR_ENHANCE, COMBAT_RESULT_MEDICAL); - } - } - - return false; - } - - int injury_skill = getSkillStatMod(player, "healing_wound_treatment"); - - if (injury_skill == 0) - { - if (verbose) - { - sendMedicalSpam(player, SID_NO_HEAL_OR_ENHANCE_ABILITY, COMBAT_RESULT_MEDICAL); - } - - return false; - } - - return true; - } - - - public static boolean canHealWound(obj_id player) throws InterruptedException - { - return canHealWound(player, true); - } - - - public static boolean canPayHealingCost(obj_id player, String heal_type, float modifier) throws InterruptedException - { - if (!isIdValid(player) || heal_type == null || heal_type.equals("")) - { - return false; - } - - if (modifier <= 0) - { - return false; - } - - int mind = getAttrib(player, MIND); - int cost = 0; - - if (heal_type.equals(HEAL_TYPE_MEDICAL_DAMAGE)) - { - cost = VAR_HEALDAMAGE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_WOUND)) - { - cost = VAR_HEALWOUND_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_STATE)) - { - cost = VAR_HEALSTATE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_BUFF)) - { - cost = VAR_HEALENHANCE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_REVIVE)) - { - cost = COST_MIND_REVIVE; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_FIRSTAID)) - { - cost = VAR_FIRSTAID_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_POISON)) - { - cost = VAR_CURE_POISON_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_FIRE)) - { - cost = VAR_CURE_FIRE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_DISEASE)) - { - cost = VAR_CURE_DISEASE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_APPLY_POISON)) - { - cost = VAR_APPLY_POISON_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_APPLY_DISEASE)) - { - cost = VAR_APPLY_DISEASE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_QUICK_HEAL)) - { - cost = VAR_QUICK_HEAL_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_TEND_WOUND)) - { - cost = VAR_TEND_WOUND_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_TEND_DAMAGE)) - { - cost = VAR_TEND_DAMAGE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_HEAL_MIND)) - { - cost = VAR_HEAL_MIND_COST; - } - else - { - return false; - } - - cost = (int)(cost * modifier); - - if (mind < cost) - { - return false; - } - else - { - return true; - } - } - - - public static float setCanHealDamage(obj_id player, int roundtime) throws InterruptedException - { - if (!isIdValid(player)) - { - return -1f; - } - - float newroundtime = 0.0f; - - if (!hasObjVar(player, VAR_HEALING_CAN_HEALDAMAGE)) - { - setObjVar(player, VAR_HEALING_CAN_HEALDAMAGE, 0); - } - - if (roundtime == 0) - { - setObjVar(player, VAR_HEALING_CAN_HEALDAMAGE, 0); - } - else - { - setObjVar(player, VAR_HEALING_CAN_HEALDAMAGE, getGameTime()+ (int)newroundtime); - } - - return newroundtime; - } - - - public static boolean setCanHealWound(obj_id player, int roundtime) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (!hasObjVar(player, VAR_HEALING_CAN_HEALWOUND)) - { - setObjVar(player, VAR_HEALING_CAN_HEALWOUND, 0); - } - - if (roundtime == 0) - { - setObjVar(player, VAR_HEALING_CAN_HEALWOUND, 0); - } - else - { - setObjVar(player, VAR_HEALING_CAN_HEALWOUND, getGameTime()+ roundtime); - } - - return true; - } - - - public static obj_id findHealDamageMedicine(obj_id player, obj_id target) throws InterruptedException - { - obj_id med_obj = null; - - if (!isIdValid(player)) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (!isIdValid(inventory)) - { - return null; - } - - if (utils.hasScriptVar(player, SCRIPT_VAR_RANGED_MED)) - { - utils.removeScriptVar(player, SCRIPT_VAR_RANGED_MED); - } - - if (utils.hasScriptVar(player, SCRIPT_VAR_DAMAGE_MED)) - { - utils.removeScriptVar(player, SCRIPT_VAR_DAMAGE_MED); - } - - String prefix = ""; - - obj_id[] inv_contents = utils.getContents(inventory, false); - for (int i = 0; (i < inv_contents.length) && (med_obj == null); i++) - { - testAbortScript(); - prefix = ""; - int loop_count = 1; - boolean set_prefix = false; - - if (doctor_bag.isDoctorBag( inv_contents[i])) - { - set_prefix = true; - loop_count = doctor_bag.MAX_MEDS; - } - - for (int k=0; (k < loop_count) && (med_obj == null); k++) - { - testAbortScript(); - if (set_prefix) - { - prefix = "meds."+ k + "."; - - if (!hasObjVar(inv_contents[i], "meds." + k)) - { - continue; - } - } - - if (hasObjVar(inv_contents[i],prefix+consumable.VAR_CONSUMABLE_MODS)) - { - if (isMedicine(inv_contents[i], prefix)) - { - if (isHealDamageMedicine(inv_contents[i], prefix)) - { - if ((!hasObjVar(inv_contents[i], prefix + consumable.VAR_CONSUMABLE_PET_MED)) && (!hasObjVar(inv_contents[i], prefix + consumable.VAR_CONSUMABLE_DROID_MED))) - { - if (isIdValid(target) && getDistance(player, target) >= consumable.MAX_AFFECT_DISTANCE) - { - if (isRangedMedicine(inv_contents[i],prefix,set_prefix)) - { - med_obj = inv_contents[i]; - } - else - { - utils.setScriptVar(player, SCRIPT_VAR_DAMAGE_MED, inv_contents[i]); - utils.removeScriptVar(player, "healing.prefix"); - - if (set_prefix) - { - utils.setScriptVar(player, "healing.prefix", prefix); - } - } - } - else - { - if (!isRangedMedicine(inv_contents[i], prefix, set_prefix)) - { - med_obj = inv_contents[i]; - } - else - { - utils.setScriptVar(player, SCRIPT_VAR_RANGED_MED, inv_contents[i]); - utils.removeScriptVar(player, "healing.prefix"); - - if (set_prefix) - { - utils.setScriptVar(player, "healing.prefix", prefix); - } - } - } - } - } - } - } - } - } - - if (med_obj == null) - { - if (utils.hasScriptVar(player, SCRIPT_VAR_RANGED_MED)) - { - med_obj = utils.getObjIdScriptVar(player, SCRIPT_VAR_RANGED_MED); - } - else - { - if (utils.hasScriptVar(player, SCRIPT_VAR_DAMAGE_MED)) - { - med_obj = utils.getObjIdScriptVar(player, SCRIPT_VAR_DAMAGE_MED); - } - } - if (utils.hasScriptVar(player, "healing.prefix")) - { - prefix = utils.getStringScriptVar(player, "healing.prefix"); - } - } - - if (med_obj != null) - { - if (doctor_bag.isDoctorBag(med_obj)) - { - doctor_bag.setSurrogateState(med_obj, prefix); - } - } - - return med_obj; - } - - - public static obj_id findHealDamageMedicine(obj_id player) throws InterruptedException - { - return findHealDamageMedicine(player, null); - } - - - public static obj_id findHealWoundMedicine(obj_id player, int wound_type) throws InterruptedException - { - obj_id med_obj = null; - - if (!isIdValid(player)) - { - return null; - } - - if ((wound_type < 0) || (wound_type >= NUM_ATTRIBUTES)) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (inventory == null) - { - return null; - } - - String prefix = ""; - - obj_id[] inv_contents = utils.getContents(inventory, false); - for (int i = 0; (i < inv_contents.length) && (med_obj == null); i++) - { - testAbortScript(); - prefix = ""; - int loop_count = 1; - boolean set_prefix = false; - - if (doctor_bag.isDoctorBag(inv_contents[i])) - { - set_prefix = true; - loop_count = doctor_bag.MAX_MEDS; - } - - for (int k=0; (k < loop_count) && (med_obj == null); k++) - { - testAbortScript(); - if (set_prefix) - { - prefix = "meds."+ k + "."; - - if (!hasObjVar(inv_contents[i], "meds." + k)) - { - continue; - } - } - - if (hasObjVar(inv_contents[i], prefix + consumable.VAR_CONSUMABLE_MODS)) - { - if (isMedicine(inv_contents[i], prefix)) - { - if (!isRevivePack(inv_contents[i], prefix)) - { - attrib_mod[] mod_array = getAttribModArrayObjVar(inv_contents[i], prefix+consumable.VAR_CONSUMABLE_MODS); - if (mod_array != null) - { - for (int j = 0; j < mod_array.length; j++) - { - testAbortScript(); - int attribute = mod_array[j].getAttribute(); - float attack = mod_array[j].getAttack(); - - if ((attribute == wound_type)&&(attack == AM_HEAL_WOUND)) - { - med_obj = inv_contents[i]; - } - } - } - } - } - } - } - } - - if (med_obj != null) - { - if (doctor_bag.isDoctorBag(med_obj)) - { - doctor_bag.setSurrogateState(med_obj, prefix); - } - } - - return med_obj; - } - - - public static obj_id findHealStateMedicine(obj_id player, int state_type) throws InterruptedException - { - obj_id med_obj = null; - - if (player == null || player == obj_id.NULL_ID) - { - return null; - } - - if (state_type < 12 || state_type > 15) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (inventory == null) - { - return null; - } - - String prefix = ""; - - obj_id[] inv_contents = utils.getContents(inventory, false); - for (int i = 0; (i < inv_contents.length) && (med_obj == null); i++) - { - testAbortScript(); - prefix = ""; - int loop_count = 1; - boolean set_prefix = false; - - if (doctor_bag.isDoctorBag(inv_contents[i])) - { - set_prefix = true; - loop_count = doctor_bag.MAX_MEDS; - } - - for (int k=0; (k < loop_count) && (med_obj == null); k++) - { - testAbortScript(); - if (set_prefix) - { - prefix = "meds."+ k + "."; - - if (!hasObjVar(inv_contents[i], "meds."+k)) - { - continue; - } - } - - if (isMedicine(inv_contents[i], prefix)) - { - if (isHealStateMedicine(inv_contents[i],prefix)) - { - String med_state = getHealingState(inv_contents[i],prefix); - int med_state_type = stringToState(med_state); - - if (state_type == med_state_type) - { - med_obj = inv_contents[i]; - } - } - } - } - } - - if (med_obj != null) - { - if (doctor_bag.isDoctorBag(med_obj)) - { - doctor_bag.setSurrogateState(med_obj, prefix); - } - } - - return med_obj; - } - - - public static obj_id findBuffMedicine(obj_id player, int buff_type) throws InterruptedException - { - if (player == null || player == obj_id.NULL_ID) - { - return null; - } - - obj_id med_obj = null; - - if (!isIdValid(player)) - { - return null; - } - - if ((buff_type < 0)||(buff_type > 10)) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (inventory == null) - { - return null; - } - - String prefix = ""; - obj_id[] inv_contents = utils.getContents(inventory, false); - - for (int i = 0; (i < inv_contents.length) && (med_obj == null); i++) - { - testAbortScript(); - prefix = ""; - int loop_count = 1; - boolean set_prefix = false; - - if (doctor_bag.isDoctorBag(inv_contents[i])) - { - set_prefix = true; - loop_count = doctor_bag.MAX_MEDS; - } - - for (int k=0; (k < loop_count) && (med_obj == null); k++) - { - testAbortScript(); - if (set_prefix) - { - prefix = "meds."+ k + "."; - - if (!hasObjVar(inv_contents[i], "meds." + k)) - { - continue; - } - } - - if (hasObjVar(inv_contents[i],prefix+consumable.VAR_CONSUMABLE_MODS)) - { - if (isBuffMedicine(inv_contents[i],prefix)) - { - attrib_mod[] mod_array = getAttribModArrayObjVar(inv_contents[i], prefix+consumable.VAR_CONSUMABLE_MODS); - if (mod_array != null) - { - for (int j = 0; j < mod_array.length; j++) - { - testAbortScript(); - int attribute = mod_array[j].getAttribute(); - if (attribute == buff_type) - { - med_obj = inv_contents[i]; - } - } - } - } - } - } - } - - if (med_obj != null) - { - if (doctor_bag.isDoctorBag(med_obj)) - { - doctor_bag.setSurrogateState(med_obj, prefix); - } - } - - return med_obj; - } - - - public static obj_id findCureDotMedicine(obj_id player, String dot_type) throws InterruptedException - { - obj_id med_obj = null; - - if (!isIdValid(player)) - { - return null; - } - - if (dot_type == null) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (inventory == null) - { - return null; - } - - String prefix = ""; - - obj_id[] inv_contents = utils.getContents(inventory, false); - for (int i = 0; (i < inv_contents.length) && (med_obj == null); i++) - { - testAbortScript(); - prefix = ""; - int loop_count = 1; - boolean set_prefix = false; - - if (doctor_bag.isDoctorBag(inv_contents[i])) - { - set_prefix = true; - loop_count = doctor_bag.MAX_MEDS; - } - - for (int k=0; (k < loop_count) && (med_obj == null); k++) - { - testAbortScript(); - if (set_prefix) - { - prefix = "meds."+ k + "."; - - if (!hasObjVar(inv_contents[i], "meds."+k)) - { - continue; - } - } - - if (hasObjVar(inv_contents[i], prefix+VAR_HEALING_CURE_DOT)) - { - String med_dot_type = getCureDot(inv_contents[i],prefix); - if (dot_type.equals(med_dot_type)) - { - med_obj = inv_contents[i]; - } - } - } - } - - if (med_obj != null) - { - if (doctor_bag.isDoctorBag(med_obj)) - { - doctor_bag.setSurrogateState(med_obj, prefix); - } - - } - - return med_obj; - } - - - public static obj_id findApplyDotMedicine(obj_id player, String dot_type) throws InterruptedException - { - obj_id med_obj = null; - - if (!isIdValid(player)) - { - return null; - } - - if (dot_type == null) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (inventory == null) - { - return null; - } - - String prefix = ""; - obj_id[] inv_contents = utils.getContents(inventory, false); - - for (int i = 0; (i < inv_contents.length) && (med_obj == null); i++) - { - testAbortScript(); - prefix = ""; - int loop_count = 1; - boolean set_prefix = false; - - if (doctor_bag.isDoctorBag(inv_contents[i])) - { - set_prefix = true; - loop_count = doctor_bag.MAX_MEDS; - } - - for (int k=0; (k < loop_count) && (med_obj == null); k++) - { - testAbortScript(); - if (set_prefix) - { - prefix = "meds."+ k + "."; - - if (!hasObjVar(inv_contents[i], "meds."+k)) - { - continue; - } - } - - if (hasObjVar(inv_contents[i], prefix+VAR_HEALING_APPLY_DOT)) - { - String med_dot_type = getApplyDot(inv_contents[i],prefix); - if (dot_type.equals(med_dot_type)) - { - med_obj = inv_contents[i]; - } - } - } - } - - if (med_obj != null) - { - if (doctor_bag.isDoctorBag(med_obj)) - { - doctor_bag.setSurrogateState(med_obj, prefix); - } - } - - return med_obj; - } - - - public static boolean hasCombatState(obj_id player, int state_type) throws InterruptedException - { - - return false; - - } - - - public static int findLargestWoundHeal(obj_id patient, obj_id doctor) throws InterruptedException - { - return -1; - } - - - public static int findLargestTendWound(obj_id patient) throws InterruptedException - { - return -1; - } - - - public static int findWorstState(obj_id patient, obj_id doctor) throws InterruptedException - { - return -1; - } - - - public static int stringToAttribute(String attribute_str) throws InterruptedException - { - int attribute_int = -1; - - if (attribute_str.equals("HEALTH")) - { - attribute_int = HEALTH; - } - if (attribute_str.equals("CONSTITUTION")) - { - attribute_int = CONSTITUTION; - } - if (attribute_str.equals("ACTION")) - { - attribute_int = ACTION; - } - if (attribute_str.equals("STAMINA")) - { - attribute_int = STAMINA; - } - if (attribute_str.equals("MIND")) - { - attribute_int = MIND; - } - if (attribute_str.equals("WILLPOWER")) - { - attribute_int = WILLPOWER; - } - if (attribute_str.equals("POISON")) - { - attribute_int = 6; - } - if (attribute_str.equals("DISEASE")) - { - attribute_int = 7; - } - - return attribute_int; - } - - - public static String attributeToString(int attribute_int) throws InterruptedException - { - if ((attribute_int < 0) || (attribute_int >= NUM_ATTRIBUTES + 2)) - { - return null; - } - - String[] names = - { - "HEALTH", "CONSTITUTION", "ACTION", "STAMINA", "MIND", "WILLPOWER", "POISON", "DISEASE" - }; - - return names[attribute_int]; - } - - - public static int stringToState(String state_str) throws InterruptedException - { - state_str = state_str.toUpperCase(); - int state_int = -1; - - if (state_str.equals("STUNNED")) - { - state_int = STATE_STUNNED; - } - if (state_str.equals("BLINDED")) - { - state_int = STATE_BLINDED; - } - if (state_str.equals("DIZZY")) - { - state_int = STATE_DIZZY; - } - if (state_str.equals("INTIMIDATED")) - { - state_int = STATE_INTIMIDATED; - } - - return state_int; - } - - - public static String stateTypeToString(int state_type) throws InterruptedException - { - if ((state_type < 12)||(state_type > 15)) - { - return null; - } - - String[] names = - { - "STUNNED", "BLINDED", "DIZZY", "INTIMIDATED" - }; - - return names[state_type - 12]; - } - - - public static boolean performMedicalHealDamage(obj_id medic, obj_id target, obj_id med_obj, boolean pay_cost) throws InterruptedException - { - if (!isIdValid(medic)) - { - return false; - } - - if (!isIdValid(target)) - { - return false; - } - - if (!isIdValid(med_obj)) - { - return false; - } - - boolean isRanged = isRangedMedicine(med_obj); - boolean isPetMed = hasObjVar(med_obj, consumable.VAR_CONSUMABLE_PET_MED); - boolean isDroidPetMed = hasObjVar(med_obj, consumable.VAR_CONSUMABLE_DROID_MED); - - if (pay_cost) - { - if (!canPayHealingCost(medic, HEAL_TYPE_MEDICAL_DAMAGE, 1.0f)) - { - sendMedicalSpam(medic, SID_MIND_TOO_DRAINED, COMBAT_RESULT_MEDICAL); - return false; - } - } - - int health_before = getAttrib(target,HEALTH); - - if (consumable.consumeItem(medic, target, med_obj)) - { - if (pay_cost) - { - applyHealingCost(medic, HEAL_TYPE_MEDICAL_DAMAGE, 1.0f); - } - - int health_after = getAttrib(target,HEALTH); - int health_delta = health_after - health_before; - - int[] attribs = - { - HEALTH - }; - int[] delta = - { - health_delta - }; - - String[] heal_message = assembleHealingMessage(attribs, delta, medic, target, med_obj); - if (heal_message != null) - { - sendCombatSpamMessageOob(medic, target, heal_message[0], true, false, false, COMBAT_RESULT_MEDICAL); - } - - if ((!isPetMed) && (!isDroidPetMed)) - { - grantHealingExperience(delta, medic, target, HEAL_TYPE_MEDICAL_DAMAGE); - } - - if (medic != target) - { - if (heal_message != null) - { - sendCombatSpamMessageOob(medic, target, heal_message[1], false, true, false, COMBAT_RESULT_MEDICAL); - } - - pvpHelpPerformed(medic, target); - - addHealingKillCredit(medic, target, delta); - } - - return true; - } - - return false; - } - - - public static boolean performMedicalHealDamage(obj_id medic, obj_id target, obj_id med_obj) throws InterruptedException - { - return performMedicalHealDamage(medic, target, med_obj, true); - } - - - public static obj_id[] getHealableTargetsInArea(obj_id medic, location loc, int radius) throws InterruptedException - { - if (loc == null) - { - return null; - } - - obj_id[] objects = getCreaturesInRange(loc, radius); - Vector healable_targets = new Vector(); - healable_targets.setSize(0); - - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (!isPlayer(objects[i])) - { - if (pet_lib.isCreaturePet(objects[i])) - { - healable_targets = utils.addElement(healable_targets, objects[i]); - } - } - else - { - if (factions.pvpDoAllowedHelpCheck(medic, objects[i])) - { - healable_targets = utils.addElement(healable_targets, objects[i]); - } - } - } - - if (healable_targets.size() < 1) - { - return null; - } - else - { - obj_id[] _healable_targets = new obj_id[0]; - if (healable_targets != null) - { - _healable_targets = new obj_id[healable_targets.size()]; - healable_targets.toArray(_healable_targets); - } - return _healable_targets; - } - } - - - public static obj_id[] getAttackableTargetsInArea(obj_id medic, location loc, int radius) throws InterruptedException - { - if (loc == null) - { - return null; - } - - obj_id[] objects = getCreaturesInRange(loc, radius); - Vector attackable_targets = new Vector(); - attackable_targets.setSize(0); - - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (isMob(objects[i])) - { - if (factions.pvpDoAllowedAttackCheck(medic, objects[i])) - { - if (!isIncapacitated(objects[i]) && !isDead(objects[i])) - { - if (!pet_lib.isVehiclePet(objects[i]) && !ai_lib.isAndroid(objects[i]) && ai_lib.aiGetNiche(objects[i])!=NICHE_DROID && ai_lib.aiGetNiche(objects[i])!=NICHE_VEHICLE && !vehicle.isDriveableVehicle(objects[i])) - { - attackable_targets = utils.addElement(attackable_targets, objects[i]); - } - } - } - } - } - - if (attackable_targets.size() < 1) - { - return null; - } - else - { - obj_id[] _attackable_targets = new obj_id[0]; - if (attackable_targets != null) - { - _attackable_targets = new obj_id[attackable_targets.size()]; - attackable_targets.toArray(_attackable_targets); - } - return _attackable_targets; - } - } - - - public static boolean applyHealingCost(obj_id player, String heal_type, float modifier) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (modifier <= 0) - { - return false; - } - - int mind = getAttrib(player, MIND); - int cost = 0; - - if (heal_type.equals(HEAL_TYPE_MEDICAL_DAMAGE)) - { - cost = VAR_HEALDAMAGE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_WOUND)) - { - cost = VAR_HEALWOUND_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_STATE)) - { - cost = VAR_HEALSTATE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_BUFF)) - { - cost = VAR_HEALENHANCE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_REVIVE)) - { - cost = COST_MIND_REVIVE; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_FIRSTAID)) - { - cost = VAR_FIRSTAID_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_POISON)) - { - cost = VAR_CURE_POISON_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_FIRE)) - { - cost = VAR_CURE_FIRE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_CURE_DISEASE)) - { - cost = VAR_CURE_DISEASE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_APPLY_POISON)) - { - cost = VAR_APPLY_POISON_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_APPLY_DISEASE)) - { - cost = VAR_APPLY_DISEASE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_QUICK_HEAL)) - { - cost = VAR_QUICK_HEAL_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_TEND_WOUND)) - { - cost = VAR_TEND_WOUND_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_TEND_DAMAGE)) - { - cost = VAR_TEND_DAMAGE_COST; - } - else if (heal_type.equals(HEAL_TYPE_MEDICAL_HEAL_MIND)) - { - cost = VAR_HEAL_MIND_COST; - } - else - { - return false; - } - - cost = (int)(cost * modifier); - if (mind < cost) - { - return false; - } - - return drainAttributes(player, 0, cost); - } - - - public static boolean performHealState(obj_id medic, obj_id target, obj_id med_obj) throws InterruptedException - { - - return false; - } - - - public static boolean performHealEnhance(obj_id medic, obj_id target, obj_id med_obj) throws InterruptedException - { - if (medic == null || medic == obj_id.NULL_ID) - { - return false; - } - if (target == null || target == obj_id.NULL_ID) - { - return false; - } - if (med_obj == null || med_obj == obj_id.NULL_ID) - { - return false; - } - - if (!canPayHealingCost(medic, HEAL_TYPE_MEDICAL_BUFF, 1.0f)) - { - LOG("HEALING_MESSAGE_ERROR", medic + " ->Your mind is too drained to do that."); - sendMedicalSpam(medic, SID_MIND_TOO_DRAINED, COMBAT_RESULT_MEDICAL); - return false; - } - - if (consumable.consumeItem(medic, target, med_obj)) - { - applyHealingCost(medic, HEAL_TYPE_MEDICAL_BUFF, 1.0f); - - int[] attribute = - { - HEALTH - }; - int duration = 0; - String attribute_string = ""; - String objvar_name = ""; - int buff_amount = 0; - int old_buff_amount = 0; - String medicinebuff = SCRIPT_VAR_MEDICINE_BUFF; - String medicinerebuff = SCRIPT_VAR_MEDICINE_REBUFF; - int net_buff_amount = 0; - - for (int x = 0; x < attribute.length; x++) - { - testAbortScript(); - buff_amount = 0; - old_buff_amount = 0; - net_buff_amount = 0; - - attribute_string = attributeToString(attribute[x]); - attribute_string = attribute_string.substring(0,1).toUpperCase() + attribute_string.substring(1).toLowerCase(); - objvar_name = "healing."+ attribute_string.toLowerCase() + "_enhance"; - if (utils.hasScriptVar(target, medicinebuff + "."+x)) - { - - buff_amount = utils.getIntScriptVar(target, medicinebuff + "."+x); - utils.removeScriptVar(target, medicinebuff + "."+x); - } - - if (utils.hasScriptVar(target, medicinerebuff + "."+x)) - { - - old_buff_amount = utils.getIntScriptVar(target, medicinerebuff + "."+x); - utils.removeScriptVar(target, medicinerebuff + "."+x); - } - - net_buff_amount = buff_amount - old_buff_amount; - - if (attribute[x] == 9 || attribute[x] == 10) - { - attribute_string += " Resistance"; - } - - if (net_buff_amount > 0) - { - if (x == 0) - { - grantHealingExperience(buff_amount, medic, target, HEAL_TYPE_MEDICAL_BUFF); - } - } - - string_id attribute_string_id = new string_id("att_n", attribute_string.toLowerCase()); - if (medic != target) - { - prose_package ppYouEnhanceYour = prose.getPackage(SID_YOU_ENHANCE_YOUR_ATT); - prose.setTO(ppYouEnhanceYour, attribute_string_id); - prose.setDI(ppYouEnhanceYour, net_buff_amount); - sendMedicalSpam(medic, ppYouEnhanceYour, COMBAT_RESULT_BUFF); - LOG("HEALING_MESSAGE_ERROR", medic + " ->You enhance your "+ attribute_string + " by "+ net_buff_amount + "."); - if (net_buff_amount > 0) - { - prose_package ppYouEnhanceTargetAtt = prose.getPackage(SID_YOU_ENHANCE_TARGETS_ATTRIBUTE); - prose.setTT(ppYouEnhanceTargetAtt, target); - prose.setTO(ppYouEnhanceTargetAtt, attribute_string_id); - prose.setDI(ppYouEnhanceTargetAtt, net_buff_amount); - sendMedicalSpam(medic, ppYouEnhanceTargetAtt, COMBAT_RESULT_BUFF); - prose_package ppMedicEnhancesYourAtt = prose.getPackage(SID_MEDIC_ENHANCES_YOUR_ATTRIBUTE); - prose.setTT(ppMedicEnhancesYourAtt, medic); - prose.setTO(ppMedicEnhancesYourAtt, attribute_string_id); - prose.setDI(ppMedicEnhancesYourAtt, net_buff_amount); - sendMedicalSpam(target, ppMedicEnhancesYourAtt, COMBAT_RESULT_BUFF); - LOG("LOG_CHANNEL", medic + " ->You enhance "+ getFirstName(target) + "'s "+ attribute_string + " by "+ net_buff_amount + "."); - LOG("LOG_CHANNEL", target + " ->"+ getFirstName(medic) + " enhances your "+ attribute_string + " by "+ net_buff_amount + "."); - } - else - { - prose_package ppReapplyTarget = prose.getPackage(SID_REAPPLY_ENHANCEMENT_TARGET); - prose.setTT(ppReapplyTarget, target); - prose.setTO(ppReapplyTarget, attribute_string_id); - sendMedicalSpam(medic, ppReapplyTarget, COMBAT_RESULT_BUFF); - prose_package ppReappliesYou = prose.getPackage(SID_REAPPLIES_ENHANCEMENT_YOU); - prose.setTT(ppReappliesYou, medic); - prose.setTO(ppReappliesYou, attribute_string_id); - sendMedicalSpam(target, ppReappliesYou, COMBAT_RESULT_BUFF); - LOG("LOG_CHANNEL", medic + " ->You re-apply "+ getFirstName(target) + "'s "+ attribute_string + " enhancement."); - LOG("LOG_CHANNEL", target + " ->"+ getFirstName(medic) + " re-applies your "+ attribute_string + " enhancement."); - } - - pvpHelpPerformed(medic, target); - } - else - { - prose_package ppReapplySelf = prose.getPackage(SID_REAPPLY_ENHANCEMENT_SELF); - prose.setTO(ppReapplySelf, attribute_string_id); - sendMedicalSpam(medic, ppReapplySelf, COMBAT_RESULT_BUFF); - LOG("HEALING_MESSAGE_ERROR", medic + " ->You re-apply your "+ attribute_string + " enhancement."); - if (net_buff_amount > 0) - { - prose_package ppEnhanceBySelf = prose.getPackage(SID_ENHANCE_ATTRIBUTE_BY_SELF); - prose.setTO(ppEnhanceBySelf, attribute_string_id); - prose.setDI(ppEnhanceBySelf, net_buff_amount); - sendMedicalSpam(medic, ppEnhanceBySelf, COMBAT_RESULT_BUFF); - LOG("LOG_CHANNEL", medic + " ->You enhance your "+ attribute_string + " by "+ net_buff_amount + "."); - } - } - } - return true; - } - - return false; - } - - - public static boolean addHealingBuffIcon(obj_id target, int attribute, float duration) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - switch(attribute) - { - case HEALTH: - addBuffIcon(target, "medical_enhance_health", duration); - break; - - case CONSTITUTION: - addBuffIcon(target, "medical_enhance_constitution", duration); - break; - - case ACTION: - addBuffIcon(target, "medical_enhance_action", duration); - break; - - case STAMINA: - addBuffIcon(target, "medical_enhance_stamina", duration); - break; - - case MIND: - addBuffIcon(target, "performance_enhance_dance_mind", duration); - break; - - case WILLPOWER: - addBuffIcon(target, "performance_enhance_music_willpower", duration); - break; - - default: - return false; - } - - return true; - } - - - public static obj_id findPetDamageMed(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (!isIdValid(inventory)) - { - return null; - } - - obj_id[] inv_contents = utils.getContents(inventory, false); - if (inv_contents == null || inv_contents.length == 0) - { - return null; - } - - for (int i = 0; i < inv_contents.length; i++) - { - testAbortScript(); - if (hasObjVar(inv_contents[i],consumable.VAR_CONSUMABLE_MODS)) - { - if (hasObjVar(inv_contents[i], consumable.VAR_CONSUMABLE_PET_MED)) - { - if (healing.isHealDamageMedicine(inv_contents[i])) - { - return inv_contents[i]; - } - } - } - } - - return null; - } - - - public static obj_id findPetVitalityMed(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (!isIdValid(inventory)) - { - return null; - } - - obj_id[] inv_contents = utils.getContents(inventory, false); - if (inv_contents == null || inv_contents.length == 0) - { - return null; - } - - for (int i = 0; i < inv_contents.length; i++) - { - testAbortScript(); - if (hasObjVar(inv_contents[i],consumable.VAR_CONSUMABLE_BASE)) - { - if (hasObjVar(inv_contents[i], consumable.VAR_CONSUMABLE_PET_MED)) - { - if (hasObjVar(inv_contents[i], "consumable.strength")) - { - return inv_contents[i]; - } - } - } - } - - return null; - } - - - public static boolean performTendWoundsFromTool(obj_id medic, obj_id target, int attribute, obj_id medikit) throws InterruptedException - { - if (!isIdValid(medic)) - { - return false; - } - - if (!isIdValid(target)) - { - return false; - } - - if (!isIdValid(medikit)) - { - return false; - } - - if (medic != target) - { - if (getDistance(medic, target) > consumable.MAX_AFFECT_DISTANCE) - { - sendMedicalSpam(medic, consumable.SID_TARGET_OUT_OF_RANGE, COMBAT_RESULT_OUT_OF_RANGE); - return false; - } - } - - if (!isWounded(target, HEALTH)) - { - if (medic == target) - { - sendMedicalSpam(medic, SID_NO_WOUNDS_OF_TYPE_SELF, COMBAT_RESULT_MEDICAL); - } - else - { - prose_package ppNoWounds = prose.getPackage(SID_NO_WOUNDS_OF_TYPE_TARGET); - prose.setTT(ppNoWounds, target); - sendMedicalSpam(medic, ppNoWounds, COMBAT_RESULT_MEDICAL); - } - - return false; - } - - float healingCostMod = 0f; - if (hasObjVar(medikit, "medikit.quality")) - { - int medikitQuality = getIntObjVar(medikit, "medikit.quality"); - int medikitQualModScratch = (int) (((100-medikitQuality)/2)+50.5); - float medikitQualMod = ((float) (medikitQualModScratch))/100.0f; - healingCostMod = medikitQualMod; - } - else - { - healingCostMod = 0.9f; - } - - if (!hasCertification(medic, medikit)) - { - string_id strSpam = new string_id("medicine_name", "no_proficiency"); - sendMedicalSpam(medic, strSpam, COMBAT_RESULT_MEDICAL); - - healingCostMod = healingCostMod * 2.0f; - } - - if (!applyHealingCost(medic, HEAL_TYPE_MEDICAL_TEND_WOUND, healingCostMod)) - { - sendMedicalSpam(medic, SID_NOT_ENOUGH_MIND, COMBAT_RESULT_MEDICAL); - return false; - } - - int attrib_before = getWoundedMaxAttrib(target, HEALTH); - - float mult = getHealingMultiplier(medic, null, HEAL_TYPE_MEDICAL_TEND_WOUND); - int heal_power = (int)(VAR_TEND_WOUND_BASE_POWER * mult); - - int attrib_after = getWoundedMaxAttrib(target, HEALTH); - int attrib_delta = attrib_after - attrib_before; - - String attribute_string = attributeToString(HEALTH).toLowerCase(); - string_id attribute_string_id = new string_id("att_n", attribute_string.toLowerCase()); - - if (medic != target) - { - prose_package ppHealAttTarget = prose.getPackage(SID_HEAL_ATTRIBUTE_TARGET); - prose.setTT(ppHealAttTarget, target); - prose.setTO(ppHealAttTarget, attribute_string_id); - prose.setDI(ppHealAttTarget, attrib_delta); - sendMedicalSpam(medic, ppHealAttTarget, COMBAT_RESULT_MEDICAL); - prose_package ppAttHealed = prose.getPackage(SID_ATTRIBUTE_HEALED); - prose.setTT(ppAttHealed, medic); - prose.setTO(ppAttHealed, attribute_string_id); - prose.setDI(ppAttHealed, attrib_delta); - sendMedicalSpam(target, ppAttHealed, COMBAT_RESULT_MEDICAL); - - incrementCount(medikit, -1); - - grantHealingExperience(attrib_delta, medic, target, HEAL_TYPE_MEDICAL_TEND_WOUND); - - pvpHelpPerformed(medic, target); - } - else - { - prose_package ppHealAttribSelf = prose.getPackage(SID_HEAL_ATTRIB_SELF); - prose.setTO(ppHealAttribSelf, attribute_string_id); - prose.setDI(ppHealAttribSelf, attrib_delta); - sendMedicalSpam(medic, ppHealAttribSelf, COMBAT_RESULT_MEDICAL); - - incrementCount(medikit, -1); - } - - return true; - } - - - public static boolean performQuickHealTool(obj_id medic, obj_id target, boolean tend_damage, obj_id medikit) throws InterruptedException - { - if (!isIdValid(medic)) - { - return false; - } - - if (!isIdValid(target)) - { - return false; - } - - if (medic != target) - { - if (getDistance(medic, target) > consumable.MAX_AFFECT_DISTANCE) - { - sendMedicalSpam(medic, consumable.SID_TARGET_OUT_OF_RANGE, COMBAT_RESULT_OUT_OF_RANGE); - return false; - } - } - - float healingCostMod = 0f; - if (hasObjVar(medikit, "medikit.quality")) - { - int medikitQuality = getIntObjVar(medikit, "medikit.quality"); - int medikitQualModScratch = (int) (((100-medikitQuality)/2)+50.5); - float medikitQualMod = ((float) (medikitQualModScratch))/100.0f; - healingCostMod = medikitQualMod; - } - else - { - healingCostMod = 0.9f; - } - - if (!hasCertification(medic, medikit)) - { - string_id strSpam = new string_id("medicine_name", "no_proficiency"); - sendMedicalSpam(medic, strSpam, COMBAT_RESULT_MEDICAL); - - healingCostMod = healingCostMod * 2.0f; - } - - if (tend_damage) - { - if (!applyHealingCost(medic, HEAL_TYPE_MEDICAL_TEND_DAMAGE, healingCostMod)) - { - sendMedicalSpam(medic, SID_NOT_ENOUGH_MIND, COMBAT_RESULT_MEDICAL); - return false; - } - } - else - { - if (!applyHealingCost(medic, HEAL_TYPE_MEDICAL_QUICK_HEAL, healingCostMod)) - { - sendMedicalSpam(medic, SID_NOT_ENOUGH_MIND, COMBAT_RESULT_MEDICAL); - return false; - } - } - - if (tend_damage) - { - - } - else - { - - } - - int health_before = getAttrib(target,HEALTH); - - float mult; - if (tend_damage) - { - mult = getHealingMultiplier(medic, null, HEAL_TYPE_MEDICAL_TEND_DAMAGE); - } - else - { - mult = getHealingMultiplier(medic, null, HEAL_TYPE_MEDICAL_QUICK_HEAL); - } - - int heal_power; - if (tend_damage) - { - heal_power = (int)(VAR_TEND_DAMAGE_BASE_POWER * mult); - } - else - { - heal_power = (int)(VAR_QUICK_HEAL_BASE_POWER * mult); - } - - attrib_mod am = utils.createHealDamageAttribMod(HEALTH, heal_power); - utils.addAttribMod(target, am); - - int health_after = getAttrib(target,HEALTH); - int health_delta = health_after - health_before; - - int[] attribs = - { - HEALTH - }; - int[] delta = - { - health_delta - }; - - String[] heal_message = assembleHealingMessage(attribs, delta, medic, target, null); - - if (heal_message != null) - { - sendCombatSpamMessageOob(medic, target, heal_message[0], true, false, false, COMBAT_RESULT_MEDICAL); - } - - if (medic != target) - { - if (heal_message != null) - { - sendCombatSpamMessageOob(medic, target, heal_message[1], false, true, false, COMBAT_RESULT_MEDICAL); - } - - if (tend_damage) - { - grantHealingExperience(delta, medic, target, HEAL_TYPE_MEDICAL_TEND_DAMAGE); - } - else - { - grantHealingExperience(delta, medic, target, HEAL_TYPE_MEDICAL_QUICK_HEAL); - } - - incrementCount(medikit, -1); - - pvpHelpPerformed(medic, target); - - addHealingKillCredit(medic, target, delta); - } - - return true; - } - - - public static boolean isAdvancedTool(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - String fullPath = getTemplateName(target); - if (fullPath == null || fullPath.equals("")) - { - return false; - } - - if (fullPath.indexOf("medikit_tool_advanced") > -1) - { - return true; - } - - return false; - } - - - public static boolean hasCertification(obj_id objPlayer, obj_id objMedikit) throws InterruptedException - { - if (isAdvancedTool(objMedikit)) - { - if (hasObjVar(objMedikit, "medikit.strCertUsed")) - { - String strCommand = getStringObjVar(objMedikit, "medikit.strCertUsed"); - - if (!hasCommand(objPlayer, strCommand)) - { - return false; - } - } - else - { - string_id strName = getNameStringId(objMedikit); - if (strName != null) - { - String strAscii = strName.getAsciiId(); - String strCert = "cert_"+ strAscii; - - if (!hasCommand(objPlayer, strCert)) - { - return false; - } - } - } - } - - return true; - } - - - public static boolean isMedikit(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return false; - } - - if (hasObjVar(object,"medikit.isMedikit")) - { - return true; - } - - return false; - } - - - public static obj_id findMedikit(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return null; - } - - obj_id inventory = getObjectInSlot(player, "inventory"); - if (inventory == null) - { - return null; - } - - obj_id[] inv_contents = utils.getContents(inventory, false); - - if (inv_contents == null || inv_contents.length == 0) - { - return null; - } - - for (int i = 0; i < inv_contents.length; i++) - { - testAbortScript(); - if (isMedikit(inv_contents[i])) - { - return inv_contents[i]; - } - } - - return null; - } - - - public static void doHealingAnimationAndEffect(obj_id user, obj_id target) throws InterruptedException - { - if (user == target) - { - doAnimationAction(user, "heal_self"); - } - else - { - doAnimationAction(user, "heal_other"); - } - - playClientEffectObj(user, "appearance/pt_heal.prt", target, ""); - } - - - public static boolean isValidHealTarget(obj_id target) throws InterruptedException - { - if ((!isIdValid(target) || !exists(target) || isInvulnerable(target) || ai_lib.isDroid(target) || ai_lib.isAndroid(target) || pet_lib.getPetType(target) == pet_lib.PET_TYPE_FAMILIAR)) - { - return false; - } - - return true; - } - - - public static boolean isValidHealTarget(obj_id healer, obj_id target) throws InterruptedException - { - if (!isIdValid(target) || !exists(target) || isInvulnerable(target) || pet_lib.getPetType(target) == pet_lib.PET_TYPE_FAMILIAR) - { - return false; - } - - if (ai_lib.isDroid(healer) || ai_lib.isAndroid(healer)) - { - return true; - } - - if (ai_lib.isDroid(target) || ai_lib.isAndroid(target)) - { - return false; - } - - return true; - } - - - public static void applyLifeSiphonHeal(obj_id attacker, obj_id defender, int damage, float percentToHeal, String actionName) throws InterruptedException - { - applyLifeSiphonHeal(attacker, defender, damage, percentToHeal, actionName, false); - } - - - public static void applyLifeSiphonHeal(obj_id attacker, obj_id defender, int damage, float percentToHeal, String actionName, boolean healMaster) throws InterruptedException - { - if (percentToHeal > 0) - { - int damageToHeal = Math.round(damage * percentToHeal); - - damageToHeal = getHealingAfterReductions(attacker, attacker, damageToHeal); - damageToHeal = getTargetHealingBonus(attacker, attacker, damageToHeal); - - healDamage(attacker, attacker, HEALTH, damageToHeal); - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("healing", "siphon_fly")); - pp = prose.setDI(pp, damageToHeal); - pp = prose.setTO(pp, "Health Leech"); - - if (actionName.endsWith("master")) - { - healMaster = true; - } - - if (isPlayer(attacker)) - { - prose.setTO(pp, "Drain"); - } - - if (isPlayer(attacker)) - { - showFlyTextPrivateProseWithFlags(attacker, attacker , pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - - string_id actionStringId = new string_id("cmd_n", actionName); - prose_package cp = new prose_package(); - cp = prose.setStringId(cp, new string_id("cbt_spam", "drain_hit")); - cp = prose.setTU(cp, attacker); - cp = prose.setTT(cp, defender); - cp = prose.setDI(cp, damageToHeal); - - sendCombatSpamMessageProse(attacker, defender, cp, true, true, true, COMBAT_RESULT_MEDICAL); - } - else if (beast_lib.isBeast(attacker)) - { - showFlyTextPrivateProseWithFlags(attacker, getMaster(attacker) , pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - } - - if (isPlayer(defender)) - { - showFlyTextPrivateProseWithFlags(attacker, defender , pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - } - - if (isIdValid(getMaster(attacker))) - { - attacker = getMaster(attacker); - - if (healMaster && exists(attacker) && !isDead(attacker)) - { - damageToHeal = getHealingAfterReductions(attacker, attacker, damageToHeal); - damageToHeal = getTargetHealingBonus(attacker, attacker, damageToHeal); - pp = prose.setDI(pp, damageToHeal); - - healDamage(attacker, attacker, HEALTH, damageToHeal); - - if (isPlayer(attacker)) - { - showFlyTextPrivateProseWithFlags(attacker, attacker , pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - } - - if (isPlayer(defender)) - { - showFlyTextPrivateProseWithFlags(attacker, defender , pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - } - } - } - - } - } - - - public static int doDiminishingReturns(int toHeal, obj_id medic) throws InterruptedException - { - float rightNow = getGameTime(); - - if (!utils.hasScriptVar(medic, "healing.diminishing_returns.last_heal_time")) - { - utils.setScriptVar(medic, "healing.diminishing_returns.last_heal_time", rightNow); - utils.setScriptVar(medic, "healing.diminishing_returns.heal_total", toHeal); - buff.applyBuff(medic, "heal_diminishing_returns_1"); - return toHeal; - } - - float lastHealTime = utils.getFloatScriptVar(medic, "healing.diminishing_returns.last_heal_time"); - - if (rightNow - lastHealTime > 30f) - { - utils.setScriptVar(medic, "healing.diminishing_returns.last_heal_time", rightNow); - utils.setScriptVar(medic, "healing.diminishing_returns.heal_total", toHeal); - buff.applyBuff(medic, "heal_diminishing_returns_1"); - return toHeal; - } - - int healTotal = utils.getIntScriptVar(medic, "healing.diminishing_returns.heal_total"); - int reductionThreshold = 25000; - - if (healTotal <= reductionThreshold) - { - utils.setScriptVar(medic, "healing.diminishing_returns.last_heal_time", rightNow); - utils.setScriptVar(medic, "healing.diminishing_returns.heal_total", toHeal + healTotal); - buff.applyBuff(medic, "heal_diminishing_returns_1"); - return toHeal; - } - - float healTotalFloat = (float)healTotal; - float toHealFloat = (float)toHeal; - float originalHeal = toHeal; - float diminishedAmount = 1.0f; - - healTotalFloat -= reductionThreshold; - diminishedAmount = healTotalFloat / (100f + (healTotalFloat / 45f)) / 100.0f; - toHealFloat = toHealFloat * (1.0f - diminishedAmount); - - toHeal = (int)toHealFloat; - - utils.setScriptVar(medic, "healing.diminishing_returns.last_heal_time", rightNow); - utils.setScriptVar(medic, "healing.diminishing_returns.heal_total", toHeal + healTotal); - - float healNerfRatio = toHealFloat/originalHeal; - - if (healNerfRatio > .70f) - { - buff.applyBuff(medic, "heal_diminishing_returns_2"); - } - else if (healNerfRatio > .35f) - { - buff.applyBuff(medic, "heal_diminishing_returns_3"); - } - else - { - buff.applyBuff(medic, "heal_diminishing_returns_4"); - } - - return toHeal; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/holiday.java b/sku.0/sys.server/compiled/game/script/library/holiday.java deleted file mode 100644 index ac3623031..000000000 --- a/sku.0/sys.server/compiled/game/script/library/holiday.java +++ /dev/null @@ -1,1755 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.gcw; -import script.library.groundquests; -import script.library.utils; - - -public class holiday extends script.base_script -{ - public holiday() - { - } - public static final String PLANET_VAR_EVENT_PREFIX = "event"; - public static final String PLANET_VAR_SCORE = ".score"; - public static final String PLANET_VAR_EMPIRE_DAY = ".empire_day"; - public static final String PLANET_VAR_SCORE_TIMESTAMP = PLANET_VAR_SCORE + ".timestamp"; - public static final String PLANET_VAR_PLAYER_NAME = ".player_name"; - public static final String PLANET_VAR_PLAYER_SCORE = ".player_score"; - public static final String PLANET_VAR_PLAYER_FACTION_IMP = ".imperial"; - public static final String PLANET_VAR_PLAYER_FACTION_REB = ".rebel"; - - public static final String EMPIRE_DAY_RECEIVED_VI = "gift.empire08"; - public static final String EMPIRE_DAY_RECEIVED_VII = "gift.empire09"; - public static final String EMPIRE_DAY_CHAMPION_BADGE = "empire_day_champion_badge_2009"; - public static final String REMEMBRANCE_DAY_CHAMPION_BADGE = "remembrance_day_champion_badge_2009"; - public static final String SPAWNER_PREFIX_OBJVAR = "spawned."; - - public static final String LEADER_BOARD_TITLE = "Leader Boards Empire & Remembrance Day"; - public static final String LEADERSUI_PID_NAME = "leaderBoardPid"; - - public static final String PLAYER_EMPIRE_DAY_PREFIX = PLANET_VAR_EVENT_PREFIX + PLANET_VAR_EMPIRE_DAY; - public static final String PLAYER_EMPIRE_DAY_SCORE = PLAYER_EMPIRE_DAY_PREFIX + PLANET_VAR_SCORE; - public static final String PLAYER_EMPIRE_DAY_NEUTRAL = PLAYER_EMPIRE_DAY_PREFIX + ".neutral"; - - public static final String IMPERIAL_AND_REBEL_EVENT_GIFT = "item_empire_day_6yr_painting"; - public static final String IMPERIAL_EMPIRE_DAY_GIFT = "item_empire_day_6yr_greeter_tie_pilot"; - public static final String REBEL_REMEMBRANCE_DAY_GIFT = "item_empire_day_6yr_greeter_xwing_pilot"; - - public static final String EMOTE_DATATABLE = "datatables/npc/emperors_day/badge_emotes.iff"; - - public static final String LIFEDAY = "event/life_day"; - public static final String EMP_DAY = "event/emperors_day"; - public static final String EMPIRE_DAY = "event/empire_day"; - - public static final string_id GIFT_GRANTED = new string_id(EMP_DAY, "gift_granted_empire"); - - public static final string_id SID_REM_EMP_DAY_BADGE = new string_id(EMP_DAY, "empire_day_badge_removed"); - public static final string_id SID_REM_REM_DAY_BADGE = new string_id(EMP_DAY, "remembrance_day_badge_removed"); - public static final string_id SID_REMOVED_REWARD_FLAG = new string_id(EMP_DAY, "reward_flag_removed"); - public static final string_id SID_MOUNTED = new string_id(LIFEDAY, "mounted"); - public static final string_id SID_REACHED_LIMIT = new string_id(LIFEDAY, "reached_limit"); - public static final string_id SID_COMPLETED_QUOTA = new string_id(EMPIRE_DAY, "completed_collection"); - public static final string_id SID_IMPERIAL_COMPETITIVE_START = new string_id(EMPIRE_DAY, "imperial_competitive_start"); - public static final string_id SID_REBEL_COMPETITIVE_START = new string_id(EMPIRE_DAY, "rebel_competitive_start"); - public static final string_id SID_LOCKED_OUT = new string_id(LIFEDAY, "locked_out"); - public static final string_id SID_IMPERIAL_START = new string_id(EMPIRE_DAY, "imperial_start"); - public static final string_id SID_REBEL_START = new string_id(EMPIRE_DAY, "rebel_start"); - public static final string_id SID_GCW_POINTS = new string_id(EMPIRE_DAY, "you_received_gcw_points"); - public static final string_id SID_CONGRATS_QUOTA_IMPERIAL = new string_id(EMPIRE_DAY, "congratz_quota_accomplished_imp"); - public static final string_id SID_OOPS_QUOTA_FAILED_IMPERIAL = new string_id(EMPIRE_DAY, "oops_quota_failed_imp"); - public static final string_id SID_CONGRATS_QUOTA_REBEL = new string_id(EMPIRE_DAY, "congratz_quota_accomplished_reb"); - public static final string_id SID_OOPS_QUOTA_FAILED_REBEL = new string_id(EMPIRE_DAY, "oops_quota_failed_reb"); - public static final string_id SID_NOT_SF = new string_id(EMPIRE_DAY, "no_longer_sf_redeclare"); - public static final string_id SID_NOT_WHILE_MOUNTED = new string_id(EMPIRE_DAY, "not_while_monted"); - public static final string_id SID_TOKEN_REWARDED = new string_id(EMPIRE_DAY, "token_rewarded"); - public static final string_id SID_TOKENS_REWARDED = new string_id(EMPIRE_DAY, "tokens_rewarded"); - - public static final String EVENT_TRACKER_SCRIPT = "systems.spawning.spawned_tracker"; - public static final String SMOKE_CLIENT_EFFECT = "appearance/pt_smoke_puff.prt"; - - public static final String REBEL_RESISTANCE_COLLECTION = "remembrance_day_resistance_event"; - public static final String REBEL_VANDAL_COLLECTION = "remembrance_day_vandal_event"; - public static final String REBEL_ENGINEERING_COLLECTION = "remembrance_day_engineering_quest"; - public static final String REBEL_ENTERTAINER_COLLECTION = "remembrance_day_performance_quest"; - public static final String REBEL_RESCUE_COLLECTION = "remembrance_day_rescue_quest"; - - public static final String IMPERIAL_RECRUITING_COLLECTION = "empire_day_recruiting_event"; - public static final String IMPERIAL_ANTIPROP_COLLECTION = "empire_day_anti_propaganda_event"; - public static final String IMPERIAL_ENGINEERING_COLLECTION = "empire_day_engineering_quest"; - public static final String IMPERIAL_ENTERTAINER_COLLECTION = "empire_day_performance_quest"; - public static final String IMPERIAL_RESCUE_COLLECTION = "empire_day_rescue_quest"; - - public static final String REBEL_RESISTANCE_START_SLOT = "remembrance_day_resistance_starter"; - public static final String REBEL_VANDAL_START_SLOT = "remembrance_day_vandal_starter"; - public static final String REBEL_ENGINEERING_START_SLOT = "remembrance_day_engineering_starter"; - public static final String REBEL_ENTERTAINER_START_SLOT = "remembrance_day_performance_starter"; - public static final String REBEL_RESCUE_START_SLOT = "remembrance_day_rescue_starter"; - - public static final String IMPERIAL_RECRUITING_START_SLOT = "empire_day_recruitment_starter"; - public static final String IMPERIAL_ANTIPROP_START_SLOT = "empire_day_anti_propaganda_starter"; - public static final String IMPERIAL_ENGINEERING_START_SLOT = "empire_day_engineering_starter"; - public static final String IMPERIAL_ENTERTAINER_START_SLOT = "empire_day_performance_starter"; - public static final String IMPERIAL_RESCUE_START_SLOT = "empire_day_rescue_starter"; - - public static final String REBEL_RESISTANCE_COUNTER_SLOT = "remembrance_day_resistance_counter"; - public static final String REBEL_VANDAL_COUNTER_SLOT = "remembrance_day_vandal_counter"; - public static final String REBEL_ENGINEERING_COUNTER_SLOT = "remembrance_day_engineering_counter"; - public static final String REBEL_ENTERTAINER_COUNTER_SLOT = "remembrance_day_performance_counter"; - public static final String REBEL_RESCUE_COUNTER_SLOT = "remembrance_day_rescue_counter"; - - public static final String IMPERIAL_RECRUITING_COUNTER_SLOT = "empire_day_recruitment_counter"; - public static final String IMPERIAL_ANTIPROP_COUNTER_SLOT = "empire_day_anti_propaganda_counter"; - public static final String IMPERIAL_ENGINEERING_COUNTER_SLOT = "empire_day_engineering_counter"; - public static final String IMPERIAL_ENTERTAINER_COUNTER_SLOT = "empire_day_performance_counter"; - public static final String IMPERIAL_RESCUE_COUNTER_SLOT = "empire_day_rescue_counter"; - - public static final String IMPERIAL_EMPTY_KIOSK = "object/tangible/event_perk/empire_day_missing_sign.iff"; - public static final String REBEL_EMPTY_KIOSK = "object/tangible/event_perk/remembrance_day_missing_sign.iff"; - - public static final String IMPERIAL_NONPLAYER_RESISTANCE_KIOSK = "object/tangible/event_perk/remembrance_day_resistance_sign.iff"; - public static final String IMPERIAL_PLAYER_RECRUITMENT_KIOSK = "object/tangible/event_perk/empire_day_player_placed_recruitment_sign.iff"; - public static final String IMPERIAL_PLAYER_DEFACED_KIOSK = "object/tangible/event_perk/remembrance_day_player_defaced_sign.iff"; - public static final String REBEL_NONPLAYER_RECRUITMENT_KIOSK = "object/tangible/event_perk/empire_day_recruitment_sign.iff"; - public static final String REBEL_PLAYER_RESISTANCE_KIOSK = "object/tangible/event_perk/remembrance_day_player_resistance_sign.iff"; - public static final String REBEL_PLAYER_DEFACED_KIOSK = "object/tangible/event_perk/empire_day_player_defaced_recruitment_sign.iff"; - - public static final String BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT = "event_empireday_imperial_recruitment_combatant"; - public static final String BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT = "event_empireday_rebel_resistance_combatant"; - public static final String BUFF_IMP_EMPIREDAY_RECRUITMENT_SF = "event_empireday_imperial_recruitment_special_forces"; - public static final String BUFF_REB_EMPIREDAY_RESISTANCE_SF = "event_empireday_rebel_resistance_special_forces"; - public static final String BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT = "event_empireday_imperial_antipropaganda_combatant"; - public static final String BUFF_REB_EMPIREDAY_VANDAL_COMBATANT = "event_empireday_rebel_vandal_combatant"; - public static final String BUFF_IMP_EMPIREDAY_ANTIPROP_SF = "event_empireday_imperial_antipropaganda_special_forces"; - public static final String BUFF_REB_EMPIREDAY_VANDAL_SF = "event_empireday_rebel_vandal_special_forces"; - - public static final String BUFF_IMPERIAL_RECRUITMENT_COUNTER = "event_empireday_imperial_recruitment_counter"; - public static final String BUFF_REBEL_RESISTANCE_COUNTER = "event_empireday_rebel_resistance_counter"; - public static final String BUFF_IMPERIAL_ANTIPROPAGANDA_COUNTER = "event_empireday_imperial_propaganda_counter"; - public static final String BUFF_REBEL_PLAYER_VANDAL_COUNTER = "event_empireday_rebel_vandal_counter"; - - public static final String EMPIRE_DAY_BUFF_TRACKER = "event_empireday_first_buff_ended"; - - public static final String BUFF_COMBATANT_GROUP = "combatant"; - public static final String BUFF_SF_GROUP = "special_forces"; - public static final String BUFF_COUNTER_GROUP = "counter"; - public static final String TOKEN_IMPERIAL_EMPIRE_DAY = "item_empire_day_imperial_token"; - public static final String TOKEN_REBEL_EMPIRE_DAY = "item_empire_day_rebel_token"; - - public static final String EVENT_PREFIX = "empire_day_event."; - public static final String EMPIRE_DAY_RECRUITMENT_LOCKED_OUT = EVENT_PREFIX + "recruitment_locked_out"; - public static final String EMPIRE_DAY_RESISTANCE_LOCKED_OUT = EVENT_PREFIX + "resistance_locked_out"; - public static final String EMPIRE_DAY_PROPAGANDA_LOCKED_OUT = EVENT_PREFIX + "propaganda_locked_out"; - public static final String EMPIRE_DAY_VANDAL_LOCKED_OUT = EVENT_PREFIX + "vandal_locked_out"; - public static final String EMPIRE_DAY_RECRUITMENT_TIMESTAMP = EVENT_PREFIX + "event_recruitment_time_stamp"; - public static final String EMPIRE_DAY_PROPAGANDA_TIMESTAMP = EVENT_PREFIX + "event_propaganda_time_stamp"; - public static final String EMPIRE_DAY_RESISTANCE_TIMESTAMP = EVENT_PREFIX + "event_resistance_time_stamp"; - public static final String EMPIRE_DAY_VANDAL_TIMESTAMP = EVENT_PREFIX + "event_vandal_time_stamp"; - - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_01_DOMESTICS = "crash_site_01_imp_domestics"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_02_DOMESTICS = "crash_site_02_imp_domestics"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_03_DOMESTICS = "crash_site_03_imp_domestics"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_04_DOMESTICS = "crash_site_04_imp_domestics"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_05_DOMESTICS = "crash_site_05_imp_domestics"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_06_DOMESTICS = "crash_site_06_imp_domestics"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_01_ENG = "crash_site_01_imp_engineering"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_02_ENG = "crash_site_02_imp_engineering"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_03_ENG = "crash_site_03_imp_engineering"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_04_ENG = "crash_site_04_imp_engineering"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_05_ENG = "crash_site_05_imp_engineering"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_06_ENG = "crash_site_06_imp_engineering"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_01_MUNITIONS = "crash_site_01_imp_munitions"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_02_MUNITIONS = "crash_site_02_imp_munitions"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_03_MUNITIONS = "crash_site_03_imp_munitions"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_04_MUNITIONS = "crash_site_04_imp_munitions"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_05_MUNITIONS = "crash_site_05_imp_munitions"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_06_MUNITIONS = "crash_site_06_imp_munitions"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_01_STRUC = "crash_site_01_imp_structures"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_02_STRUC = "crash_site_02_imp_structures"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_03_STRUC = "crash_site_03_imp_structures"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_04_STRUC = "crash_site_04_imp_structures"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_05_STRUC = "crash_site_05_imp_structures"; - public static final String EMPIREDAYQUEST_IMP_CRASHSITE_06_STRUC = "crash_site_06_imp_structures"; - - public static final String EMPIREDAYQUEST_REB_CRASHSITE_01_DOMESTICS = "crash_site_01_reb_domestics"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_02_DOMESTICS = "crash_site_02_reb_domestics"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_03_DOMESTICS = "crash_site_03_reb_domestics"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_04_DOMESTICS = "crash_site_04_reb_domestics"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_05_DOMESTICS = "crash_site_05_reb_domestics"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_06_DOMESTICS = "crash_site_06_reb_domestics"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_01_ENG = "crash_site_01_reb_engineering"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_02_ENG = "crash_site_02_reb_engineering"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_03_ENG = "crash_site_03_reb_engineering"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_04_ENG = "crash_site_04_reb_engineering"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_05_ENG = "crash_site_05_reb_engineering"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_06_ENG = "crash_site_06_reb_engineering"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_01_MUNITIONS = "crash_site_01_reb_munitions"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_02_MUNITIONS = "crash_site_02_reb_munitions"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_03_MUNITIONS = "crash_site_03_reb_munitions"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_04_MUNITIONS = "crash_site_04_reb_munitions"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_05_MUNITIONS = "crash_site_05_reb_munitions"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_06_MUNITIONS = "crash_site_06_reb_munitions"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_01_STRUC = "crash_site_01_reb_structures"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_02_STRUC = "crash_site_02_reb_structures"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_03_STRUC = "crash_site_03_reb_structures"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_04_STRUC = "crash_site_04_reb_structures"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_05_STRUC = "crash_site_05_reb_structures"; - public static final String EMPIREDAYQUEST_REB_CRASHSITE_06_STRUC = "crash_site_06_reb_structures"; - - public static final String EMPIREDAYQUEST_REB_ENTERTAINER_01 = "entertainer_rebel_01"; - public static final String EMPIREDAYQUEST_REB_ENTERTAINER_02 = "entertainer_rebel_02"; - public static final String EMPIREDAYQUEST_REB_ENTERTAINER_03 = "entertainer_rebel_03"; - public static final String EMPIREDAYQUEST_REB_ENTERTAINER_04 = "entertainer_rebel_04"; - public static final String EMPIREDAYQUEST_REB_ENTERTAINER_05 = "entertainer_rebel_05"; - public static final String EMPIREDAYQUEST_REB_ENTERTAINER_06 = "entertainer_rebel_06"; - - public static final String EMPIREDAYQUEST_IMP_ENTERTAINER_01 = "entertainer_imperial_01"; - public static final String EMPIREDAYQUEST_IMP_ENTERTAINER_02 = "entertainer_imperial_02"; - public static final String EMPIREDAYQUEST_IMP_ENTERTAINER_03 = "entertainer_imperial_03"; - public static final String EMPIREDAYQUEST_IMP_ENTERTAINER_04 = "entertainer_imperial_04"; - public static final String EMPIREDAYQUEST_IMP_ENTERTAINER_05 = "entertainer_imperial_05"; - public static final String EMPIREDAYQUEST_IMP_ENTERTAINER_06 = "entertainer_imperial_06"; - - public static final String EMPIREDAYQUEST_REB_COMBAT_01 = "recovery_quest_rebel_01"; - public static final String EMPIREDAYQUEST_REB_COMBAT_02 = "recovery_quest_rebel_02"; - public static final String EMPIREDAYQUEST_REB_COMBAT_03 = "recovery_quest_rebel_03"; - public static final String EMPIREDAYQUEST_REB_COMBAT_04 = "recovery_quest_rebel_04"; - public static final String EMPIREDAYQUEST_REB_COMBAT_05 = "recovery_quest_rebel_05"; - public static final String EMPIREDAYQUEST_REB_COMBAT_06 = "recovery_quest_rebel_06"; - public static final String EMPIREDAYQUEST_REB_COMBAT_07 = "recovery_quest_rebel_07"; - public static final String EMPIREDAYQUEST_REB_COMBAT_AUTOGRAPH = "recovery_quest_rebel_autograph"; - - public static final String EMPIREDAYQUEST_REB_CORPSE_SIGNAL = "foundIntelRebelEmpireDay"; - public static final String EMPIREDAYQUEST_REB_CORPSE_TASK = "waitForIntelRebelEmpireDay"; - - public static final String EMPIREDAYQUEST_IMP_COMBAT_01 = "recovery_quest_imperial_01"; - public static final String EMPIREDAYQUEST_IMP_COMBAT_02 = "recovery_quest_imperial_02"; - public static final String EMPIREDAYQUEST_IMP_COMBAT_03 = "recovery_quest_imperial_03"; - public static final String EMPIREDAYQUEST_IMP_COMBAT_04 = "recovery_quest_imperial_04"; - public static final String EMPIREDAYQUEST_IMP_COMBAT_05 = "recovery_quest_imperial_05"; - public static final String EMPIREDAYQUEST_IMP_COMBAT_06 = "recovery_quest_imperial_06"; - public static final String EMPIREDAYQUEST_IMP_COMBAT_07 = "recovery_quest_imperial_07"; - public static final String EMPIREDAYQUEST_IMP_COMBAT_NUMBER = "recovery_quest_imperial_number"; - - public static final String EMPIREDAYQUEST_IMP_CORPSE_SIGNAL = "foundIntelImperialEmpireDay"; - public static final String EMPIREDAYQUEST_IMP_CORPSE_TASK = "waitForIntelImperialEmpireDay"; - - public static final String VOL_TRIGGER_NAME_PREFIX = "empire_day_detainment_"; - - public static final String IMPERIAL_FLYBY_PARTICLE_01 = "appearance/pt_trailing_distant_tie_fighters_slower_s01.prt"; - public static final String IMPERIAL_FLYBY_PARTICLE_02 = "appearance/pt_trailing_distant_tie_fighters_slower_s02.prt"; - public static final String REBEL_FLYBY_PARTICLE_01 = "appearance/pt_trailing_distant_rebel_ships_slow_s01.prt"; - public static final String REBEL_FLYBY_PARTICLE_02 = "appearance/pt_trailing_distant_rebel_ships_slow_s02.prt"; - public static final String REBEL_FLYBY_PARTICLE_03 = "appearance/pt_trailing_distant_rebel_ships_slow_s03.prt"; - public static final String REBEL_FLYBY_PARTICLE_04 = "appearance/pt_trailing_distant_rebel_ships_slow_s04.prt"; - - public static final string_id DARTH_BADGE_1 = new string_id(EMP_DAY, "imp_darth_badge_1"); - - public static final string_id DARTH_BADGE_2 = new string_id(EMP_DAY, "imp_darth_badge_2"); - - public static final string_id LEIA_BADGE_1 = new string_id(EMP_DAY, "leia_badge_1"); - - public static final string_id LEIA_BADGE_2 = new string_id(EMP_DAY, "leia_badge_2"); - - public static final string_id BOW = new string_id(EMP_DAY, "bow"); - - public static final int MAXIMUM_EMPIRE_DAY_WINNERS = 3; - - public static final int EMPIRE_DAY_SECONDS_TO_START = 900; - public static final float OBJECT_NEAR_CHECK_RANGE_100M = 100.0f; - public static final float OBJECT_NEAR_CHECK_RANGE_2M = 2.0f; - public static final float OBJECT_NEAR_CHECK_RANGE_10M = 10.0f; - public static final float NPC_ATTACK_RANGE = 30.0f; - - public static final int IMPERIAL_PLAYER = 1; - public static final int REBEL_PLAYER = 2; - public static final int NEUTRAL_PLAYER = 3; - - public static final int MIN_DESTROY_TIME = 60; - public static final int MAX_DESTROY_TIME = 180; - public static final int DAILY_COUNTER_LIMIT = 9; - public static final int TOKEN_AMOUNT_COMBATANT = 1; - public static final int TOKEN_AMOUNT_SF = 2; - public static final int GCW_AMOUNT_SF = 10; - public static final int GCW_AMOUNT_COMBATANT = 5; - public static final int DAILY_TIME = 10; - - public static final int MAX_NUMBER_OF_PLANET_HIGH_SCORES = 5; - public static final float VOL_TRIGGER_RADIUS = 10f; - - public static final float EMPIRE_DAY_EVENT_START_DELAY = 700.f; - - public static final String LOVEDAY_CUPID_MANAGER_NAME = "loveday_cupid_manager"; - public static final String LOVEDAY_CUPID_ELEMENT_NAME = "loveday_cupid_spawner_"; - - public static final String LOVEDAY_CUPID_SPAWNER_CITY_VAR = "loveday_city"; - - public static final String GETTING_CUPID_SPAWNER_IDS = "manager_gettingCupidSpawnerIds"; - - public static final String[] LOVEDAY_LOCATIONS = - { - "endor", "kaadara", "tyrena" - }; - - public static final String ROMANCE_TRAITS_TABLE = "datatables/event/loveday/playing_cupid.iff"; - - public static final String[] MATCHMAKING_COMPANIONS = - { - "loveday_romance_seeker_familiar_male_01", - "loveday_romance_seeker_familiar_male_02", - "loveday_romance_seeker_familiar_male_03", - "loveday_romance_seeker_familiar_male_04", - "loveday_romance_seeker_familiar_female_01", - "loveday_romance_seeker_familiar_female_02", - "loveday_romance_seeker_familiar_female_03", - "loveday_romance_seeker_familiar_female_04" - }; - - public static final String[] MATCHMAKING_COMPANIONS_SLOTS = - { - "loveday_2009_matched_bob", - "loveday_2009_matched_jim", - "loveday_2009_matched_gary", - "loveday_2009_matched_harvey", - "loveday_2009_matched_jane", - "loveday_2009_matched_betty", - "loveday_2009_matched_margaret", - "loveday_2009_matched_karen" - }; - - public static final String[] ALL_IMPERIAL_CRATE_TEMPLATES = - { - "object/tangible/holiday/empire_day/e11_gas_cartridge_crate.iff", - "object/tangible/holiday/empire_day/imperial_second_lieutenant_rank_crate.iff", - "object/tangible/holiday/empire_day/improved_mouse_droid_arm_crate.iff", - "object/tangible/holiday/empire_day/command_console_comscan_subcomponent_crate.iff" - }; - - public static final String[] ALL_REBEL_CRATE_TEMPLATES = - { - "object/tangible/holiday/empire_day/aa1n_vebrobrain_protocol_droid_component_crate.iff", - "object/tangible/holiday/empire_day/rebel_trooper_field_rations_crate.iff", - "object/tangible/holiday/empire_day/crew_carrier_steering_mechanism_crate.iff", - "object/tangible/holiday/empire_day/dh17_gas_cartridge_crate.iff" - }; - - public static final String[] ALL_IMPERIAL_QUESTS = - { - EMPIREDAYQUEST_IMP_CRASHSITE_01_DOMESTICS, - EMPIREDAYQUEST_IMP_CRASHSITE_02_DOMESTICS, - EMPIREDAYQUEST_IMP_CRASHSITE_03_DOMESTICS, - EMPIREDAYQUEST_IMP_CRASHSITE_04_DOMESTICS, - EMPIREDAYQUEST_IMP_CRASHSITE_05_DOMESTICS, - EMPIREDAYQUEST_IMP_CRASHSITE_06_DOMESTICS, - EMPIREDAYQUEST_IMP_CRASHSITE_01_ENG, - EMPIREDAYQUEST_IMP_CRASHSITE_02_ENG, - EMPIREDAYQUEST_IMP_CRASHSITE_03_ENG, - EMPIREDAYQUEST_IMP_CRASHSITE_04_ENG, - EMPIREDAYQUEST_IMP_CRASHSITE_05_ENG, - EMPIREDAYQUEST_IMP_CRASHSITE_06_ENG, - EMPIREDAYQUEST_IMP_CRASHSITE_01_MUNITIONS, - EMPIREDAYQUEST_IMP_CRASHSITE_02_MUNITIONS, - EMPIREDAYQUEST_IMP_CRASHSITE_03_MUNITIONS, - EMPIREDAYQUEST_IMP_CRASHSITE_04_MUNITIONS, - EMPIREDAYQUEST_IMP_CRASHSITE_05_MUNITIONS, - EMPIREDAYQUEST_IMP_CRASHSITE_06_MUNITIONS, - EMPIREDAYQUEST_IMP_CRASHSITE_01_STRUC, - EMPIREDAYQUEST_IMP_CRASHSITE_02_STRUC, - EMPIREDAYQUEST_IMP_CRASHSITE_03_STRUC, - EMPIREDAYQUEST_IMP_CRASHSITE_04_STRUC, - EMPIREDAYQUEST_IMP_CRASHSITE_05_STRUC, - EMPIREDAYQUEST_IMP_CRASHSITE_06_STRUC - }; - public static final String[] ALL_REBEL_QUESTS = - { - EMPIREDAYQUEST_REB_CRASHSITE_01_DOMESTICS, - EMPIREDAYQUEST_REB_CRASHSITE_02_DOMESTICS, - EMPIREDAYQUEST_REB_CRASHSITE_03_DOMESTICS, - EMPIREDAYQUEST_REB_CRASHSITE_04_DOMESTICS, - EMPIREDAYQUEST_REB_CRASHSITE_05_DOMESTICS, - EMPIREDAYQUEST_REB_CRASHSITE_06_DOMESTICS, - EMPIREDAYQUEST_REB_CRASHSITE_01_ENG, - EMPIREDAYQUEST_REB_CRASHSITE_02_ENG, - EMPIREDAYQUEST_REB_CRASHSITE_03_ENG, - EMPIREDAYQUEST_REB_CRASHSITE_04_ENG, - EMPIREDAYQUEST_REB_CRASHSITE_05_ENG, - EMPIREDAYQUEST_REB_CRASHSITE_06_ENG, - EMPIREDAYQUEST_REB_CRASHSITE_01_MUNITIONS, - EMPIREDAYQUEST_REB_CRASHSITE_02_MUNITIONS, - EMPIREDAYQUEST_REB_CRASHSITE_03_MUNITIONS, - EMPIREDAYQUEST_REB_CRASHSITE_04_MUNITIONS, - EMPIREDAYQUEST_REB_CRASHSITE_05_MUNITIONS, - EMPIREDAYQUEST_REB_CRASHSITE_06_MUNITIONS, - EMPIREDAYQUEST_REB_CRASHSITE_01_STRUC, - EMPIREDAYQUEST_REB_CRASHSITE_02_STRUC, - EMPIREDAYQUEST_REB_CRASHSITE_03_STRUC, - EMPIREDAYQUEST_REB_CRASHSITE_04_STRUC, - EMPIREDAYQUEST_REB_CRASHSITE_05_STRUC, - EMPIREDAYQUEST_REB_CRASHSITE_06_STRUC - }; - - public static final String[] ALL_IMPERIAL_QUEST_TEMPLATES = - { - ALL_IMPERIAL_CRATE_TEMPLATES[1], - ALL_IMPERIAL_CRATE_TEMPLATES[1], - ALL_IMPERIAL_CRATE_TEMPLATES[1], - ALL_IMPERIAL_CRATE_TEMPLATES[1], - ALL_IMPERIAL_CRATE_TEMPLATES[1], - ALL_IMPERIAL_CRATE_TEMPLATES[1], - ALL_IMPERIAL_CRATE_TEMPLATES[2], - ALL_IMPERIAL_CRATE_TEMPLATES[2], - ALL_IMPERIAL_CRATE_TEMPLATES[2], - ALL_IMPERIAL_CRATE_TEMPLATES[2], - ALL_IMPERIAL_CRATE_TEMPLATES[2], - ALL_IMPERIAL_CRATE_TEMPLATES[2], - ALL_IMPERIAL_CRATE_TEMPLATES[0], - ALL_IMPERIAL_CRATE_TEMPLATES[0], - ALL_IMPERIAL_CRATE_TEMPLATES[0], - ALL_IMPERIAL_CRATE_TEMPLATES[0], - ALL_IMPERIAL_CRATE_TEMPLATES[0], - ALL_IMPERIAL_CRATE_TEMPLATES[0], - ALL_IMPERIAL_CRATE_TEMPLATES[3], - ALL_IMPERIAL_CRATE_TEMPLATES[3], - ALL_IMPERIAL_CRATE_TEMPLATES[3], - ALL_IMPERIAL_CRATE_TEMPLATES[3], - ALL_IMPERIAL_CRATE_TEMPLATES[3], - ALL_IMPERIAL_CRATE_TEMPLATES[3] - }; - public static final String[] ALL_REBEL_QUEST_TEMPLATES = - { - ALL_REBEL_CRATE_TEMPLATES[1], - ALL_REBEL_CRATE_TEMPLATES[1], - ALL_REBEL_CRATE_TEMPLATES[1], - ALL_REBEL_CRATE_TEMPLATES[1], - ALL_REBEL_CRATE_TEMPLATES[1], - ALL_REBEL_CRATE_TEMPLATES[1], - ALL_REBEL_CRATE_TEMPLATES[0], - ALL_REBEL_CRATE_TEMPLATES[0], - ALL_REBEL_CRATE_TEMPLATES[0], - ALL_REBEL_CRATE_TEMPLATES[0], - ALL_REBEL_CRATE_TEMPLATES[0], - ALL_REBEL_CRATE_TEMPLATES[0], - ALL_REBEL_CRATE_TEMPLATES[3], - ALL_REBEL_CRATE_TEMPLATES[3], - ALL_REBEL_CRATE_TEMPLATES[3], - ALL_REBEL_CRATE_TEMPLATES[3], - ALL_REBEL_CRATE_TEMPLATES[3], - ALL_REBEL_CRATE_TEMPLATES[3], - ALL_REBEL_CRATE_TEMPLATES[2], - ALL_REBEL_CRATE_TEMPLATES[2], - ALL_REBEL_CRATE_TEMPLATES[2], - ALL_REBEL_CRATE_TEMPLATES[2], - ALL_REBEL_CRATE_TEMPLATES[2], - ALL_REBEL_CRATE_TEMPLATES[2] - }; - - public static final String[] ALL_REBEL_ENTERTAINER_QUESTS = - { - EMPIREDAYQUEST_REB_ENTERTAINER_01, - EMPIREDAYQUEST_REB_ENTERTAINER_02, - EMPIREDAYQUEST_REB_ENTERTAINER_03, - EMPIREDAYQUEST_REB_ENTERTAINER_04, - EMPIREDAYQUEST_REB_ENTERTAINER_05, - EMPIREDAYQUEST_REB_ENTERTAINER_06 - }; - - public static final String[] ALL_IMPERIAL_ENTERTAINER_QUESTS = - { - EMPIREDAYQUEST_IMP_ENTERTAINER_01, - EMPIREDAYQUEST_IMP_ENTERTAINER_02, - EMPIREDAYQUEST_IMP_ENTERTAINER_03, - EMPIREDAYQUEST_IMP_ENTERTAINER_04, - EMPIREDAYQUEST_IMP_ENTERTAINER_05, - EMPIREDAYQUEST_IMP_ENTERTAINER_06 - }; - - public static final String[] DEFAULT_HIGH_SCORE_LIST = - { - "DevH", - "Loche", - "Milbarge", - "Jaskell", - "AdeptStrain", - "DeadMeat", - "CancelAutoRun", - "Dotanuki", - "Tereb", - "Hanse", - "Teesquared", - "DevH", - "Loche", - "Milbarge", - "Jaskell", - "AdeptStrain", - "Swede", - "Blixtev", - "DeadMeat", - "CancelAutoRun", - "Dotanuki", - "Tereb", - "Hanse", - "Teesquared" - }; - - - public static boolean hasLovedayRomanceSeekerCompanion(obj_id player) throws InterruptedException - { - return isIdValid(getLovedayRomanceSeekerCompanionControlDevice(player)); - } - - - public static obj_id getLovedayRomanceSeekerCompanionControlDevice(obj_id player) throws InterruptedException - { - obj_id datapad = utils.getPlayerDatapad(player); - - if (isIdValid(datapad)) - { - obj_id[] dataItems = getContents(datapad); - if (dataItems != null || dataItems.length > 0) - { - for (int i = 0; i < dataItems.length; i++) - { - testAbortScript(); - obj_id dataItem = dataItems[i]; - if (hasObjVar(dataItem, "pet.creatureName")) - { - if (getStringObjVar(dataItem, "pet.creatureName").startsWith("loveday_romance_seeker_familiar")) - { - return dataItem; - } - } - } - } - } - - return obj_id.NULL_ID; - } - - - public static boolean grantLovedayRomanceSeekerCompanion(obj_id player) throws InterruptedException - { - if (!hasLovedayRomanceSeekerCompanion(player)) - { - String controlTemplate = "object/intangible/pet/loveday_romance_seeker.iff"; - obj_id datapad = utils.getPlayerDatapad(player); - obj_id controlDevice = createObject(controlTemplate, datapad, ""); - - String seekerChoice = MATCHMAKING_COMPANIONS[rand(0, MATCHMAKING_COMPANIONS.length-1)]; - if (utils.hasScriptVar(player, "loveday.todaysCompanion")) - { - seekerChoice = utils.getStringScriptVar(player, "loveday.todaysCompanion"); - } - - setObjVar(controlDevice, "pet.creatureName", seekerChoice); - - attachScript( controlDevice, "ai.pet_control_device"); - setName( controlDevice, getString(new string_id("mob/creature_names", seekerChoice)) ); - int petType = pet_lib.PET_TYPE_FAMILIAR; - setObjVar( controlDevice, "ai.pet.type", petType ); - - setObjVar(controlDevice, "item.lifespan", 86400); - attachScript(controlDevice, "item.special.temporary_item"); - - int chosenSet = getRomanticTraitsSet(); - if (utils.hasScriptVar(player, "loveday.todaysCompanionTraits")) - { - chosenSet = utils.getIntScriptVar(player, "loveday.todaysCompanionTraits"); - } - - setRomanticTraits(controlDevice, chosenSet); - - utils.setScriptVar(player, "loveday.todaysCompanionTraits", chosenSet); - return true; - } - - return false; - } - - - public static void checkForAndGrantLovedayMatchmakingSlot(obj_id player, String companionType) throws InterruptedException - { - if (!isIdValid(player)) - { - return; - } - if (companionType == null || companionType.length() < 1) - { - return; - } - - int index = utils.getElementPositionInArray(MATCHMAKING_COMPANIONS, companionType); - if (index > -1) - { - String companionSlotName = MATCHMAKING_COMPANIONS_SLOTS[index]; - if (!hasCompletedCollectionSlot(player, companionSlotName)) - { - modifyCollectionSlotValue(player, companionSlotName, 1); - } - } - - return; - } - - - public static int getNumRomanticTraitsSets() throws InterruptedException - { - int numRows = dataTableGetNumRows(ROMANCE_TRAITS_TABLE); - return numRows; - } - - - public static int getRomanticTraitsSet() throws InterruptedException - { - int numSets = getNumRomanticTraitsSets(); - int chosenSet = rand(0, numSets - 1); - return chosenSet; - } - - - public static void setRomanticTraits(obj_id npc, int chosenSet) throws InterruptedException - { - dictionary traits = dataTableGetRow(ROMANCE_TRAITS_TABLE, chosenSet); - - setObjVar(npc, "playingCupid.traitSet", chosenSet); - setObjVar(npc, "playingCupid.trait_01", traits.getString("trait_01")); - setObjVar(npc, "playingCupid.trait_02", traits.getString("trait_02")); - setObjVar(npc, "playingCupid.trait_03", traits.getString("trait_03")); - setObjVar(npc, "playingCupid.trait_04", traits.getString("trait_04")); - setObjVar(npc, "playingCupid.trait_05", traits.getString("trait_05")); - return; - } - - - public static boolean playEmpireDayFireWorksAndFlyBys(obj_id masterObject, int faction) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "emperor_statue.playFireWorksAndFlyBys: Function initialized."); - - if (!isValidId(masterObject) || !exists(masterObject)) - { - return false; - } - if (faction <= 0) - { - return false; - } - - messageTo(masterObject, "launchRandomFirework", null, 3.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 5.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 6.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 10.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 5.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 7.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 9.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 11.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 13.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 15.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 16.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 17.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 18.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 18.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 18.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 18.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 19.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 19.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 19.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 19.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 20.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 20.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 20.0f, false); - messageTo(masterObject, "launchRandomFirework", null, 20.0f, false); - - if (faction == IMPERIAL_PLAYER) - { - messageTo(masterObject, "launchRandomTieFighterFlyBy", null, 4, false); - messageTo(masterObject, "launchRandomTieFighterFlyBy", null, 8, false); - messageTo(masterObject, "launchRandomTieFighterFlyBy", null, 12, false); - messageTo(masterObject, "launchRandomTieFighterFlyBy", null, 2, false); - messageTo(masterObject, "launchRandomTieFighterFlyBy", null, 6, false); - messageTo(masterObject, "launchRandomTieFighterFlyBy", null, 10, false); - } - else - { - messageTo(masterObject, "launchRandomRebelShipFlyBy", null, 4, false); - messageTo(masterObject, "launchRandomRebelShipFlyBy", null, 8, false); - messageTo(masterObject, "launchRandomRebelShipFlyBy", null, 12, false); - messageTo(masterObject, "launchRandomRebelShipFlyBy", null, 2, false); - messageTo(masterObject, "launchRandomRebelShipFlyBy", null, 6, false); - messageTo(masterObject, "launchRandomRebelShipFlyBy", null, 10, false); - - } - return true; - - } - - - public static String getEmpireDayEligibility(obj_id player, int faction) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return null; - } - if (faction <= 0) - { - return null; - } - - if (holiday.isEmpireDayPlayerEligible(player, faction)) - { - if (faction == IMPERIAL_PLAYER) - { - return "You are eligible for the Champion of Empire Day badge from Darth Vader."; - } - else - { - return "You are eligible for the Champion of Remembrance Day badge from Princess Leia."; - } - } - if (faction == IMPERIAL_PLAYER) - { - - return "You are NOT eligible for the Champion of Empire Day badge from Darth Vader."; - } - else - { - return "You are NOT eligible for the Champion of Remembrance Day badge from Princess Leia."; - } - - } - - - public static boolean isEmpireDayPlayerEligible(obj_id player, int faction) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (faction == IMPERIAL_PLAYER && !factions.isImperial(player)) - { - return false; - } - - if (faction == REBEL_PLAYER && !factions.isRebel(player)) - { - return false; - } - - int tooYoung = getCurrentBirthDate() - getPlayerBirthDate(player); - if (tooYoung < 10) - { - return false; - } - - if (( isPlayerConnected(player) && !isAwayFromKeyBoard(player) && !hasCompletedCollectionSlot(player, holiday.EMPIRE_DAY_CHAMPION_BADGE) && !hasCompletedCollectionSlot(player, holiday.REMEMBRANCE_DAY_CHAMPION_BADGE) && !isGod(player) && !isDead(player) && !ai_lib.isInCombat(player) && !isIncapacitated(player) && !utils.isFreeTrial(player) && isInWorldCell(player) )) - { - return true; - } - return false; - } - - - public static obj_id[] getEmpireDayWinningPlayers(obj_id holidayObject, Vector eligiblePlayers) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: init"); - - if (!isIdValid(holidayObject) || !exists(holidayObject)) - { - return null; - } - - if (eligiblePlayers == null || eligiblePlayers.size() <= 0) - { - return null; - } - - int maxEmpireDayWinners = MAXIMUM_EMPIRE_DAY_WINNERS; - - String empiredayWinnerConfig = getConfigSetting("GameServer", "empireday_ceremony_winners"); - if (empiredayWinnerConfig != null && utils.stringToInt(empiredayWinnerConfig) > -1) - { - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: The max badge winners was: "+maxEmpireDayWinners+" but there is a server config that might overwrite this amount."); - int configWinners = utils.stringToInt(empiredayWinnerConfig); - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: The server config shows the max badge winners should be: "+configWinners+" checking to see if that is less or more than the current amount."); - if (configWinners != maxEmpireDayWinners) - { - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: The server config if a different amount than the current max so we are using the server config."); - maxEmpireDayWinners = configWinners; - } - } - - int originalListSize = eligiblePlayers.size(); - - if (originalListSize <= maxEmpireDayWinners) - { - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: There is less than "+maxEmpireDayWinners+" or exactly "+maxEmpireDayWinners+" winning players"); - obj_id[] _eligiblePlayers = new obj_id[0]; - if (eligiblePlayers != null) - { - _eligiblePlayers = new obj_id[eligiblePlayers.size()]; - eligiblePlayers.toArray(_eligiblePlayers); - } - return _eligiblePlayers; - } - - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: creating lists of players and winners."); - Vector winningPlayers = new Vector(); - winningPlayers.setSize(0); - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: originalListSize: "+originalListSize); - - for (int i = 0; i < maxEmpireDayWinners; i++) - { - testAbortScript(); - int randomWinner = rand(0, (eligiblePlayers.size()-1)); - - winningPlayers.add(((obj_id)(eligiblePlayers.get(randomWinner)))); - - eligiblePlayers.remove(((obj_id)(eligiblePlayers.get(randomWinner)))); - - if (eligiblePlayers.size() >= (originalListSize - i)) - { - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: Error with eligiblePlayers list. It did not remove a player on iteration: "+i); - break; - } - else if (winningPlayers.size() <= (0 + i)) - { - CustomerServiceLog("holidayEvent", "holiday.getEmpireDayWinningPlayers: Error with winningPlayers list. Did not add a player properly on iteration: "+i); - break; - } - } - obj_id[] _winningPlayers = new obj_id[0]; - if (winningPlayers != null) - { - _winningPlayers = new obj_id[winningPlayers.size()]; - winningPlayers.toArray(_winningPlayers); - } - return _winningPlayers; - } - - - public static String currentYearObjVar() throws InterruptedException - { - - return EMPIRE_DAY_RECEIVED_VII; - } - - - public static boolean grantEmpireDayGift(obj_id player, int faction) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (faction <= 0) - { - return false; - } - - CustomerServiceLog("grantGift", getFirstName(player) + "("+ player + ") is about to receive event gifts"); - - String eventGiftOne = IMPERIAL_AND_REBEL_EVENT_GIFT; - String eventGiftTwo = ""; - if (faction == REBEL_PLAYER) - { - CustomerServiceLog("grantGift", getFirstName(player) + "("+ player + ") has been identified as faction: "+faction+" so the player will receive appropriate factional gifts"); - eventGiftTwo = REBEL_REMEMBRANCE_DAY_GIFT; - } - else - { - CustomerServiceLog("grantGift", getFirstName(player) + "("+ player + ") has been identified as faction: "+faction+" so the player will receive appropriate factional gifts"); - eventGiftTwo = IMPERIAL_EMPIRE_DAY_GIFT; - } - - obj_id inv = utils.getInventoryContainer(player); - if (!isValidId(inv) || !exists(inv)) - { - CustomerServiceLog("grantGift", getFirstName(player) + "("+ player + ") did not have a valid inventory. exiting without giving gifts."); - return false; - } - - obj_id giftOne = static_item.createNewItemFunction(eventGiftOne, inv); - if (!isValidId(giftOne) || !exists(giftOne)) - { - CustomerServiceLog("grantGift", getFirstName(player) + "("+ player + ") failed to receive gift one: "+eventGiftOne+" this may be due to having a full inventory or the item being corrupted."); - return false; - } - - obj_id giftTwo = static_item.createNewItemFunction(eventGiftTwo, inv); - if (!isValidId(giftTwo) || !exists(giftTwo)) - { - CustomerServiceLog("grantGift", getFirstName(player) + "("+ player + ") failed to receive gift one: "+eventGiftTwo+" this may be due to having a full inventory or the item being corrupted."); - return false; - } - - setObjVar(player, holiday.currentYearObjVar(), 1); - sendSystemMessage(player, GIFT_GRANTED); - CustomerServiceLog("grantGift", getFirstName(player) + "("+ player + ") has received "+faction+" gifts: "+eventGiftOne+" and "+eventGiftTwo); - - return true; - } - - - public static int getEmoteBeligerence(String emote) throws InterruptedException - { - int emote_row = dataTableSearchColumnForString(emote, 0, EMOTE_DATATABLE); - int st_emote_type = dataTableGetInt(EMOTE_DATATABLE, emote_row, 1); - - if (st_emote_type == 2) - { - return 2; - } - else if (st_emote_type == 1) - { - return 1; - } - else if (st_emote_type == 0) - { - return 0; - } - else - { - return -1; - } - } - - - public static obj_id getEmpireDayWaypointObjectObjId(obj_id object, String waypoint, float range) throws InterruptedException - { - if (!isIdValid(object) || !exists(object)) - { - return null; - } - if (waypoint == null || waypoint.equals("")) - { - return null; - } - if (range <= 0) - { - return null; - } - - location loc = getLocation(object); - if (loc == null) - { - return null; - } - - obj_id[] objects = getObjectsInRange(loc, range); - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (isIdValid(objects[i])) - { - if (hasObjVar(objects[i], waypoint)) - { - obj_id waypointObjId = objects[i]; - return waypointObjId; - } - } - } - - return null; - } - - - public static obj_id masterObjectObjId(obj_id self) throws InterruptedException - { - location loc = getLocation(self); - obj_id[] objects = getObjectsInRange(loc, OBJECT_NEAR_CHECK_RANGE_100M); - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (isIdValid(objects[i])) - { - if (hasObjVar(objects[i], "emperorsday.master")) - { - obj_id masterObjId = objects[i]; - return masterObjId; - } - } - } - return null; - } - - - public static boolean giveCeremonyAreaMobsHate(obj_id player, float range) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - if (range <= 0) - { - range = 10.0f; - } - if (range > 100) - { - range = 100.0f; - } - - location playerLoc = getLocation(player); - if (playerLoc == null) - { - return false; - } - - obj_id[] allMobsCombat = getAllNpcs(playerLoc, range); - if (allMobsCombat == null || allMobsCombat.length <= 0) - { - return false; - } - - for (int i = 0; i < allMobsCombat.length; i++) - { - testAbortScript(); - - if (allMobsCombat[i] == player) - { - continue; - } - if (isInvulnerable(allMobsCombat[i])) - { - continue; - } - if (!pvpCanAttack(allMobsCombat[i], player)) - { - continue; - } - - startCombat(allMobsCombat[i], player); - } - return true; - } - - - public static boolean grantEmperorDayBadge(obj_id player, obj_id celeb, obj_id[] listOfWinners, int faction) throws InterruptedException - { - - obj_id masterObject = holiday.masterObjectObjId(celeb); - if (!isIdValid(masterObject) && !exists(masterObject)) - { - CustomerServiceLog("holidayEvent", "imperial_npc.grantEmperorDayBadge: No Emperor Statue Found! Player: "+player+" cannot receive rewards from Vader!"); - return false; - } - - if (listOfWinners == null || listOfWinners.length <= 0) - { - CustomerServiceLog("holidayEvent", "imperial_npc.grantEmperorDayBadge: The list of winners was not found. Vader cannot give the player his badge."); - return false; - } - - boolean foundPlayerObjVar = false; - for (int i = 0; i < listOfWinners.length; i++) - { - testAbortScript(); - obj_id playerOid = getObjIdObjVar(celeb, "readyForBadge.winner_"+(i+1)); - if (playerOid != player) - { - continue; - } - CustomerServiceLog("holidayEvent", "imperial_npc.grantEmperorDayBadge: The player: "+player+" OID was found on Vader, removing it and awarding player badge."); - - foundPlayerObjVar = true; - removeObjVar(celeb, "readyForBadge.winner_"+(i+1)); - } - - if (!foundPlayerObjVar) - { - CustomerServiceLog("holidayEvent", "imperial_npc.grantEmperorDayBadge: The player's objvar was not found. Vader cannot give the player his badge."); - return false; - } - - doAnimationAction(celeb, "nod_head_once"); - doAnimationAction(player, "bow2"); - utils.removeScriptVar(player, "emperorsDayBadge"); - if (faction == IMPERIAL_PLAYER) - { - if (!modifyCollectionSlotValue(player, holiday.EMPIRE_DAY_CHAMPION_BADGE, 1)) - { - CustomerServiceLog("holidayEvent", "imperial_npc.grantEmperorDayBadge: Could not modify badge slot: "+holiday.EMPIRE_DAY_CHAMPION_BADGE+" for Player: "+player+". Player cannot receive rewards from Vader!"); - return false; - } - - factions.addFactionStanding(player, factions.FACTION_IMPERIAL, 250); - prose_package pp2 = prose.getPackage(DARTH_BADGE_1); - prose.setTT (pp2, player); - chat.chat(celeb, player, pp2); - CustomerServiceLog("holidayEvent", "imperial_npc.grantEmperorDayBadge: Player: "+player+" has received their badge."); - return true; - } - - if (!modifyCollectionSlotValue(player, holiday.REMEMBRANCE_DAY_CHAMPION_BADGE, 1)) - { - CustomerServiceLog("holidayEvent", "imperial_npc.grantEmperorDayBadge: Could not modify badge slot: "+holiday.EMPIRE_DAY_CHAMPION_BADGE+" for Player: "+player+". Player cannot receive rewards from Vader!"); - return false; - } - - factions.addFactionStanding(player, factions.FACTION_REBEL, 250); - prose_package pp2 = prose.getPackage(LEIA_BADGE_1); - prose.setTT (pp2, player); - chat.chat(celeb, player, pp2); - doAnimationAction(celeb, "clap_rousing"); - - messageTo(masterObject, "hanHappy", null, 2.0f, false); - return true; - } - - - public static boolean slapPlayerDownForBeingRude(obj_id npcObject, obj_id playerToBeIncapped) throws InterruptedException - { - if (!isValidId(npcObject) && !exists(npcObject)) - { - return false; - } - if (!isValidId(playerToBeIncapped) && !exists(playerToBeIncapped)) - { - return false; - } - - stealth.testInvisNonCombatAction(playerToBeIncapped, npcObject); - doAnimationAction(npcObject, "stop"); - - dictionary eDict = new dictionary(); - eDict.put("myTarget", playerToBeIncapped); - messageTo(npcObject, "playerKnockedOut", eDict, 0, false); - return true; - } - - - public static boolean replaceEventObject(obj_id eventObject, obj_id player, String objectTemplate) throws InterruptedException - { - if (!isValidId(eventObject) || !exists(eventObject)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (objectTemplate == null || objectTemplate.equals("")) - { - return false; - } - - if (!hasObjVar(eventObject, "objParent")) - { - CustomerServiceLog("holidayEvent", "holiday.replaceEventObject: object "+ eventObject + " doesn't have the object parent objvar so it will be destroyed and the player receives no credit."); - trial.cleanupObject(eventObject); - return false; - } - - obj_id objParent = getObjIdObjVar(eventObject, "objParent"); - if (!isValidId(objParent) || !exists(objParent)) - { - CustomerServiceLog("holidayEvent", "holiday.replaceEventObject: object "+ eventObject + " could not find parent object: "+objParent+" so it will be destroyed and the player receives no credit."); - trial.cleanupObject(eventObject); - return false; - } - - if (!utils.hasScriptVar(eventObject, "deathTracker")) - { - CustomerServiceLog("holidayEvent", "holiday.replaceEventObject: object "+ eventObject + " did not have the deathTracker scriptvar so it will be destroyed and the player receives no credit."); - trial.cleanupObject(eventObject); - return false; - } - - float respawnTime = 20.f; - if (hasObjVar(eventObject, "fltRespawnTime")) - { - respawnTime = getFloatObjVar(eventObject, "fltRespawnTime"); - } - - location loc = utils.getLocationScriptVar(eventObject, "deathTracker"); - if (loc == null) - { - CustomerServiceLog("holidayEvent", "holiday.replaceEventObject: object "+ eventObject + " had a corrupt location so it will be destroyed and the player receives no credit."); - trial.cleanupObject(eventObject); - return false; - } - - obj_id replacementEventObject = createObject(objectTemplate, loc); - if (!isValidId(objParent) || !exists(objParent)) - { - CustomerServiceLog("holidayEvent", "holiday.replaceEventObject: object "+ eventObject + " could not spawn a replacement object. This is likely due to an incorrect replacement template string. The event object will be destroyed and the player receives no credit."); - trial.cleanupObject(eventObject); - return false; - } - - float yaw = getYaw(eventObject); - - CustomerServiceLog("holidayEvent", "holiday.replaceEventObject: object "+ eventObject + " did not have the deathTracker scriptvar so it will be destroyed and the plaeyr receives no credit."); - - setObjVar(eventObject, "dontCountDeath", 1); - setObjVar(replacementEventObject, "objParent", objParent); - setObjVar(replacementEventObject, "fltRespawnTime", respawnTime); - utils.setScriptVar(replacementEventObject, "deathTracker", loc); - setYaw(replacementEventObject, yaw); - attachScript(replacementEventObject, "systems.spawning.spawned_tracker"); - playClientEffectLoc(player, SMOKE_CLIENT_EFFECT, loc, 0); - trial.cleanupObject(eventObject); - return true; - } - - - public static boolean rewardEmpireDayPlayer(obj_id player, int playerFaction, String parentBuffName, String childBuffName, String collectionSlot, String eventName) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "holiday.rewardEmpireDayPlayer: Player "+ player + " is attempting to increment the childcounter buff: "+childBuffName+"."); - - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (playerFaction < 0 || (playerFaction != IMPERIAL_PLAYER && playerFaction != REBEL_PLAYER)) - { - return false; - } - if (parentBuffName == null || parentBuffName.equals("")) - { - return false; - } - if (childBuffName == null || childBuffName.equals("")) - { - return false; - } - if (eventName == null || eventName.equals("")) - { - return false; - } - if (collectionSlot == null || collectionSlot.equals("")) - { - return false; - } - if (!hasCompletedCollectionSlotPrereq(player, collectionSlot)) - { - return false; - } - - if (!buff.hasBuff(player, parentBuffName)) - { - CustomerServiceLog("holidayEvent", "holiday.rewardEmpireDayPlayer: Player "+ player + " no longer has required parent buff: "+parentBuffName+" so they cannot receive the counter buff: "+childBuffName+"."); - return false; - } - - CustomerServiceLog("holidayEvent", "holiday.rewardEmpireDayPlayer: Player "+ player + " has passed validation."); - - String eventType = buff.getStringGroupTwo(parentBuffName); - if (eventType == null || eventType.equals("")) - { - CustomerServiceLog("holidayEvent", "holiday.rewardEmpireDayPlayer: Player "+ player + " tried to apply childbuff: "+childBuffName+" but it had no group2 data so it failed. exiting without giving player credit."); - return false; - } - - if (!buff.hasBuff(player, childBuffName)) - { - if (!eventType.startsWith(BUFF_COMBATANT_GROUP) && !eventType.startsWith(BUFF_SF_GROUP)) - { - CustomerServiceLog("holidayEvent", "holiday.rewardEmpireDayPlayer: Player "+ player + " tried to apply childbuff: "+childBuffName+" but the group2 is invalid. exiting without giving player credit."); - return false; - } - - if (playerFaction == IMPERIAL_PLAYER) - { - if (eventType.startsWith(BUFF_COMBATANT_GROUP)) - { - if (!getEventTokens(player, TOKEN_IMPERIAL_EMPIRE_DAY, TOKEN_AMOUNT_COMBATANT)) - { - - } - pvpModifyCurrentGcwPoints(player, GCW_AMOUNT_COMBATANT); - sendSystemMessage(player, SID_GCW_POINTS); - } - else if (eventType.startsWith(BUFF_SF_GROUP)) - { - if (!factions.isDeclared(player)) - { - sendSystemMessage(player, SID_NOT_SF); - return false; - } - - if (!getEventTokens(player, TOKEN_IMPERIAL_EMPIRE_DAY, TOKEN_AMOUNT_SF)) - { - - } - pvpModifyCurrentGcwPoints(player, GCW_AMOUNT_SF); - sendSystemMessage(player, SID_GCW_POINTS); - } - buff.applyBuff(player, childBuffName); - } - else if (playerFaction == REBEL_PLAYER) - { - if (eventType.startsWith(BUFF_COMBATANT_GROUP)) - { - if (!getEventTokens(player, TOKEN_REBEL_EMPIRE_DAY, TOKEN_AMOUNT_COMBATANT)) - { - - } - pvpModifyCurrentGcwPoints(player, GCW_AMOUNT_COMBATANT); - sendSystemMessage(player, SID_GCW_POINTS); - } - else if (eventType.startsWith(BUFF_SF_GROUP)) - { - if (!factions.isDeclared(player)) - { - sendSystemMessage(player, SID_NOT_SF); - return false; - } - - if (!getEventTokens(player, TOKEN_REBEL_EMPIRE_DAY, TOKEN_AMOUNT_SF)) - { - - } - pvpModifyCurrentGcwPoints(player, GCW_AMOUNT_SF); - sendSystemMessage(player, SID_GCW_POINTS); - } - buff.applyBuff(player, childBuffName); - } - play2dNonLoopingSound(player, groundquests.MUSIC_QUEST_COMPLETED); - CustomerServiceLog("holidayEvent", "holiday.rewardEmpireDayPlayer: Player "+ player + " no longer has required parent buff: "+parentBuffName+" so they cannot receive the counter buff: "+childBuffName+"."); - } - - else - { - if (eventType.startsWith(BUFF_COMBATANT_GROUP)) - { - String tokenReward = TOKEN_REBEL_EMPIRE_DAY; - if (playerFaction == IMPERIAL_PLAYER) - { - tokenReward = TOKEN_IMPERIAL_EMPIRE_DAY; - } - - if (!getEventTokens(player, tokenReward, TOKEN_AMOUNT_COMBATANT)) - { - - } - pvpModifyCurrentGcwPoints(player, GCW_AMOUNT_COMBATANT); - sendSystemMessage(player, SID_GCW_POINTS); - } - else if (eventType.startsWith(BUFF_SF_GROUP)) - { - if (!factions.isDeclared(player)) - { - - sendSystemMessage(player, SID_NOT_SF); - return false; - } - - String tokenReward = TOKEN_REBEL_EMPIRE_DAY; - if (playerFaction == IMPERIAL_PLAYER) - { - tokenReward = TOKEN_IMPERIAL_EMPIRE_DAY; - } - - if (!getEventTokens(player, tokenReward, TOKEN_AMOUNT_SF)) - { - - } - - pvpModifyCurrentGcwPoints(player, GCW_AMOUNT_SF); - sendSystemMessage(player, SID_GCW_POINTS); - } - - play2dNonLoopingSound(player, groundquests.MUSIC_QUEST_INCREMENT_COUNTER); - buff.applyBuff(player, childBuffName); - } - return true; - } - - - public static boolean setEventLockOutTimeStamp(obj_id player, String eventLockOut) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (eventLockOut == null || eventLockOut.equals("")) - { - return false; - } - if (hasObjVar(player, eventLockOut)) - { - return false; - } - - int now = getCalendarTime(); - int secondsUntil = getEmpireDayLockoutDelay(); - int then = now + secondsUntil; - CustomerServiceLog("holidayEvent", "holiday.setEventLockOutTimeStamp: Setting lockout for player: "+player+" to expire on: "+then); - setObjVar(player, eventLockOut, then); - return true; - } - - - public static boolean checkEventLockOutRemoval(obj_id player, String eventLockTimer, String eventLockFlag) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (eventLockTimer == null || eventLockTimer.length() <= 0) - { - return false; - } - if (eventLockFlag == null || eventLockFlag.length() <= 0) - { - return false; - } - if (!hasObjVar(player, eventLockTimer) && !hasObjVar(player, eventLockFlag)) - { - return true; - } - if (!hasObjVar(player, eventLockTimer) && hasObjVar(player, eventLockFlag)) - { - CustomerServiceLog("holidayEvent", "holiday.checkEventLockOutRemoval: Player: "+player+" had lockout flag: "+eventLockFlag+" but not timer: "+eventLockTimer+". Removing flag."); - removeObjVar(player, eventLockFlag); - return true; - } - - int now = getCalendarTime(); - int then = getIntObjVar(player, eventLockTimer); - if (then <= 0) - { - CustomerServiceLog("holidayEvent", "holiday.checkEventLockOutRemoval: Player: "+player+" had invalid lockout timer: "+eventLockTimer+" for flag: "+eventLockFlag+". POSSIBLE EXPLOIT. Removing both objvars."); - removeObjVar(player, eventLockTimer); - removeObjVar(player, eventLockFlag); - removeObjVar(player, PLAYER_EMPIRE_DAY_SCORE); - removeObjVar(player, EMPIRE_DAY_BUFF_TRACKER); - return true; - } - - if (now > then) - { - CustomerServiceLog("holidayEvent", "holiday.checkEventLockOutRemoval: Player: "+player+" has lockout timer that has expired: "+eventLockTimer+" for flag: "+eventLockFlag+". Removing both objvars to allow participation in event."); - removeObjVar(player, eventLockTimer); - removeObjVar(player, eventLockFlag); - removeObjVar(player, PLAYER_EMPIRE_DAY_SCORE); - removeObjVar(player, EMPIRE_DAY_BUFF_TRACKER); - return true; - } - - return false; - } - - - public static String getTimeRemainingBeforeLockoutRemoved(obj_id player, String eventLockOut) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return null; - } - if (eventLockOut == null || eventLockOut.equals("")) - { - return null; - } - if (!hasObjVar(player, eventLockOut)) - { - return null; - } - - int now = getCalendarTime(); - int then = getIntObjVar(player, eventLockOut); - if (then <= 0) - { - - return null; - } - - if (now > then) - { - return "can start another task now"; - } - - int timeLeft = (then - now); - return "you have "+utils.formatTimeVerbose(timeLeft)+" left before you are available for that task"; - } - - - public static boolean getEventTokens(obj_id player, String tokenStaticItem, int amount) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (tokenStaticItem == null || tokenStaticItem.equals("")) - { - return false; - } - if (amount <= 0) - { - return false; - } - - obj_id pInv = utils.getInventoryContainer(player); - if (!isValidId(pInv) || !exists(pInv)) - { - return false; - } - - if (!isValidId(static_item.createNewItemFunction(tokenStaticItem, pInv, amount))) - { - - return false; - } - - if (!hasObjVar(player, PLAYER_EMPIRE_DAY_SCORE)) - { - setObjVar(player, PLAYER_EMPIRE_DAY_SCORE, getIntObjVar(player, PLAYER_EMPIRE_DAY_SCORE)+ amount); - CustomerServiceLog("holidayEvent", "holiday.getEventTokens Player: "+player+" received their very first event points of "+amount+". Now the player has a score of: "+getIntObjVar(player, PLAYER_EMPIRE_DAY_SCORE)); - } - else - { - setObjVar(player, PLAYER_EMPIRE_DAY_SCORE, getIntObjVar(player, PLAYER_EMPIRE_DAY_SCORE)+ amount); - CustomerServiceLog("holidayEvent", "holiday.getEventTokens Player: "+player+" received "+amount+" points and now has a score of: "+getIntObjVar(player, PLAYER_EMPIRE_DAY_SCORE)); - } - - if (amount == 1) - { - sendSystemMessage(player, SID_TOKEN_REWARDED); - } - else - { - sendSystemMessage(player, SID_TOKENS_REWARDED); - } - return true; - } - - - public static int getEmpireDayLockoutDelay() throws InterruptedException - { - - return secondsUntilNextDailyTime(DAILY_TIME, 0, 0); - - } - - - public static boolean createEventLeaderBoardUI(obj_id player, String title, String combinedString) throws InterruptedException - { - if (!isValidId(player) || !isValidId(player)) - { - return false; - } - if (title == null || title.length() <= 0) - { - return false; - } - if (combinedString == null || combinedString.length() <= 0) - { - return false; - } - - dictionary params = new dictionary(); - params.put("player", player); - - closeOldWindow(player); - - int pid = createSUIPage("/Script.messageBox", player, player); - setSUIAssociatedLocation(pid, player); - setSUIMaxRangeToObject(pid, 8); - params.put("callingPid", pid); - sui.setPid(player, pid, LEADERSUI_PID_NAME); - - setSUIProperty(pid, "Prompt.lblPrompt", "LocalText", combinedString); - setSUIProperty(pid, "bg.caption.lblTitle", "Text", title); - setSUIProperty(pid, "Prompt.lblPrompt", "Editable", "false"); - setSUIProperty(pid, "Prompt.lblPrompt", "GetsInput", "true"); - setSUIProperty(pid, "btnCancel", "Visible", "false"); - setSUIProperty(pid, "btnRevert", "Visible", "false"); - setSUIProperty(pid, "btnOk", sui.PROP_TEXT, "Close"); - - subscribeToSUIEvent(pid, sui_event_type.SET_onClosedOk, "%button0%", "closeLeaderSui"); - subscribeToSUIEvent(pid, sui_event_type.SET_onClosedCancel, "%button0%", "closeLeaderSui"); - - showSUIPage(pid); - flushSUIPage(pid); - return true; - } - - - public static void closeOldWindow(obj_id player) throws InterruptedException - { - int pid = sui.getPid(player, LEADERSUI_PID_NAME); - if (pid > -1) - { - forceCloseSUIPage(pid); - sui.removePid(player, LEADERSUI_PID_NAME); - } - } - - - public static String getEventHighScores(obj_id planet, String scoreObjVar, boolean faction) throws InterruptedException - { - if (!isValidId(planet) || !exists(planet)) - { - return null; - } - if (scoreObjVar == null || scoreObjVar.length() <= 0) - { - return null; - } - - String data = ""; - if (!faction) - { - for (int i = 1; i <= MAX_NUMBER_OF_PLANET_HIGH_SCORES; i++) - { - testAbortScript(); - String name = getStringObjVar(planet, scoreObjVar+".slot_"+ i + holiday.PLANET_VAR_PLAYER_NAME); - int score = getIntObjVar(planet, scoreObjVar+".slot_"+ i + holiday.PLANET_VAR_PLAYER_SCORE); - data += "\\^005"+ i + ". \\%015"+ name + " \\%015"+ score + "\n"; - } - } - else - { - data += sui.colorBlue()+"IMPERIAL\n"+sui.colorWhite(); - for (int i = 1; i <= MAX_NUMBER_OF_PLANET_HIGH_SCORES; i++) - { - testAbortScript(); - String name = getStringObjVar(planet, scoreObjVar+".slot_"+ i + holiday.PLANET_VAR_PLAYER_FACTION_IMP + holiday.PLANET_VAR_PLAYER_NAME); - int score = getIntObjVar(planet, scoreObjVar+".slot_"+ i + holiday.PLANET_VAR_PLAYER_FACTION_IMP + holiday.PLANET_VAR_PLAYER_SCORE); - data += i + "\t"+ name + "\t"+ score + "\n"; - CustomerServiceLog("holidayEventScore", "getEventHighScores: name: "+name+" score: "+score); - } - - data += sui.colorRed()+"\nREBEL\n"+sui.colorWhite(); - for (int i = 1; i <= MAX_NUMBER_OF_PLANET_HIGH_SCORES; i++) - { - testAbortScript(); - String name = getStringObjVar(planet, scoreObjVar+".slot_"+ i + holiday.PLANET_VAR_PLAYER_FACTION_REB + holiday.PLANET_VAR_PLAYER_NAME); - int score = getIntObjVar(planet, scoreObjVar+".slot_"+ i + holiday.PLANET_VAR_PLAYER_FACTION_REB + holiday.PLANET_VAR_PLAYER_SCORE); - data += i + "\t"+ name + "\t"+ score + "\n"; - } - - } - return data; - } - - - public static boolean setEmpireDayLeaderScores(obj_id planet, obj_id player, String scoreObjVar, int newScore, String playerName, int faction) throws InterruptedException - { - CustomerServiceLog("holidayEventScore", "setEmpireDayLeaderScores: scoreObjVar: "+scoreObjVar+" score: "+newScore); - - if (!isValidId(planet) || !exists(planet)) - { - return false; - } - if (newScore <= 0) - { - return false; - } - if (scoreObjVar == null || scoreObjVar.length() <= 0) - { - return false; - } - if (playerName == null || playerName.length() <= 0) - { - return false; - } - - CustomerServiceLog("holidayEventScore", "setEmpireDayLeaderScores: passed validation"); - - String postAppendName = ""; - String postAppendScore = ""; - - if (faction == holiday.IMPERIAL_PLAYER) - { - CustomerServiceLog("holidayEventScore", "setEmpireDayLeaderScores: Is Imp Player"); - - postAppendName = holiday.PLANET_VAR_PLAYER_FACTION_IMP + holiday.PLANET_VAR_PLAYER_NAME; - postAppendScore = holiday.PLANET_VAR_PLAYER_FACTION_IMP + holiday.PLANET_VAR_PLAYER_SCORE; - } - else if (faction == holiday.REBEL_PLAYER) - { - CustomerServiceLog("holidayEventScore", "setEmpireDayLeaderScores: Is Reb Player"); - - postAppendName = holiday.PLANET_VAR_PLAYER_FACTION_REB + holiday.PLANET_VAR_PLAYER_NAME; - postAppendScore = holiday.PLANET_VAR_PLAYER_FACTION_REB + holiday.PLANET_VAR_PLAYER_SCORE; - } - - if (postAppendName == null || postAppendName.length() <= 0) - { - return false; - } - if (postAppendScore == null || postAppendScore.length() <= 0) - { - return false; - } - - if (newScore <= getIntObjVar(planet, scoreObjVar + ".slot_5" + postAppendScore)) - { - CustomerServiceLog("holidayEventScore", "setEmpireDayLeaderScores: Player doesn't have a high enough score"); - CustomerServiceLog("holidayEventScore", "setEmpireDayLeaderScores: Lowest score: "+getIntObjVar(planet, scoreObjVar + ".slot_5"+ postAppendScore)); - return true; - } - - for (int i = 1; i <= MAX_NUMBER_OF_PLANET_HIGH_SCORES; i++) - { - testAbortScript(); - String name = getStringObjVar(planet, scoreObjVar+".slot_"+ i + postAppendName); - if (name == null || name.length() <= 0) - { - continue; - } - - if (!playerName.equals(name)) - { - CustomerServiceLog("holidayEventScore", "setEmpireDayLeaderScores: NO match. Name: "+name+ " and player name: "+playerName ); - CustomerServiceLog("holidayEventScore", "Name length: "+name.length()+ " and player name: "+playerName.length()); - continue; - } - - CustomerServiceLog("holidayEventScore", "setEmpireDayLeaderScores: found name match"); - int score = getIntObjVar(planet, scoreObjVar+".slot_"+ i + postAppendScore); - if (newScore == score) - { - CustomerServiceLog("holidayEventScore", "setEmpireDayLeaderScores: Player already has a score on leader board."); - return true; - } - } - - int newHsSlot = -1; - - for (int i = MAX_NUMBER_OF_PLANET_HIGH_SCORES - 1; i >= 1; i--) - { - testAbortScript(); - int existingScore = getIntObjVar(planet, scoreObjVar + ".slot_"+ i + holiday.PLANET_VAR_PLAYER_FACTION_IMP + holiday.PLANET_VAR_PLAYER_SCORE); - if (newScore >= existingScore) - { - CustomerServiceLog("holidayEventScore", newScore+ " is greater than "+existingScore); - newHsSlot = i; - } - else - { - break; - } - } - - if (newHsSlot < 0) - { - return true; - } - - for (int i = MAX_NUMBER_OF_PLANET_HIGH_SCORES; i >= newHsSlot; i--) - { - testAbortScript(); - if (i < MAX_NUMBER_OF_PLANET_HIGH_SCORES && i > 0) - { - String moveName = getStringObjVar(planet, scoreObjVar + ".slot_"+ i + postAppendName); - int moveScore = getIntObjVar(planet, scoreObjVar + ".slot_"+ i + postAppendScore); - setObjVar(planet, scoreObjVar + ".slot_"+ (i+1) + postAppendName, moveName); - setObjVar(planet, scoreObjVar + ".slot_"+ (i+1) + postAppendScore, moveScore); - } - } - setObjVar(planet, scoreObjVar + ".slot_"+ newHsSlot + postAppendScore, newScore); - setObjVar(planet, scoreObjVar + ".slot_"+ newHsSlot + postAppendName, playerName); - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/hq.java b/sku.0/sys.server/compiled/game/script/library/hq.java deleted file mode 100644 index 4718719e8..000000000 --- a/sku.0/sys.server/compiled/game/script/library/hq.java +++ /dev/null @@ -1,1871 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.theater; -import script.library.structure; -import script.library.player_structure; -import script.library.planetary_map; -import script.library.trial; - - -public class hq extends script.base_script -{ - public hq() - { - } - public static final float VULNERABILITY_CYCLE = 172800f; - - public static final float VULNERABILITY_LENGTH = 10800f; - - public static final String SCRIPT_CLONING_OVERRIDE = "faction_perk.hq.terminal_cloning_override"; - public static final String SCRIPT_INSURANCE_OVERRIDE = "faction_perk.hq.terminal_insurance_override"; - - public static final String SCRIPT_TERMINAL_DISABLE = "faction_perk.hq.terminal_disable"; - - public static final String SCRIPT_DEFENSE_OBJECT = "faction_perk.hq.defense_object"; - - public static final String VAR_HQ_BASE = "hq"; - - public static final String SCRIPTVAR_FLATTENER = "hq.flattener"; - - public static final String SCRIPTVAR_THEATER_OBJECTS = "hq.theaterObjects"; - public static final String SCRIPTVAR_TERMINALS = "hq.terminals"; - public static final String VAR_DEFENSE_TURTERMINALS = "hq.turterminals.terminals"; - - public static final String VAR_SPAWN_BASE = VAR_HQ_BASE + ".spawn"; - public static final String SCRIPTVAR_SPAWN_INTERIOR = VAR_SPAWN_BASE + ".interior"; - public static final String SCRIPTVAR_SPAWN_EXTERIOR = VAR_SPAWN_BASE + ".exterior"; - - public static final String SCRIPTVAR_SPAWN_REINFORCEMENT = VAR_SPAWN_BASE + ".reinforcement"; - - public static final String VAR_HQ_RESOURCE_CNT = VAR_HQ_BASE + ".resource.cnt"; - - public static final String VAR_DEFENSE_BASE = VAR_HQ_BASE + ".defense"; - - public static final String VAR_DEFENSE_PARENT = VAR_DEFENSE_BASE + ".parent"; - - public static final String VAR_OBJECTIVE_BASE = VAR_HQ_BASE + ".objective"; - public static final String VAR_OBJECTIVE_STAMP = VAR_OBJECTIVE_BASE + ".stamp"; - - public static final String VAR_OBJECTIVE_TRACKING = VAR_OBJECTIVE_BASE + ".tracking"; - public static final String VAR_OBJECTIVE_ID = VAR_OBJECTIVE_TRACKING + ".id"; - public static final String VAR_OBJECTIVE_DISABLED = VAR_OBJECTIVE_TRACKING + ".disabled"; - - public static final String VAR_VULNERABILITY_RESET = VAR_HQ_BASE + ".vulnerabilityReset"; - public static final int RESET_MAX = 1; - - public static final String VAR_IS_DISABLED = VAR_OBJECTIVE_BASE + ".isDisabled"; - - public static final String[] OBJECTIVE_TEMPLATE = - { - "object/tangible/hq_destructible/uplink_terminal.iff", - "object/tangible/hq_destructible/security_terminal.iff", - "object/tangible/hq_destructible/override_terminal.iff", - "object/tangible/hq_destructible/power_regulator.iff" - }; - - public static final String VAR_TERMINAL_DISABLE = VAR_HQ_BASE + ".terminal.disable"; - - public static final String TBL_TERMINAL_PATH = "datatables/faction_perk/hq/terminal/"; - public static final String TBL_TURRET_TERMINAL_PATH = "datatables/faction_perk/hq/turret_terminal/"; - - public static final String TBL_SPAWN_PATH = "datatables/faction_perk/hq/spawn/"; - public static final String TBL_SPAWN_INTERIOR_PATH = TBL_SPAWN_PATH + "interior/"; - public static final String TBL_SPAWN_EXTERIOR_PATH = TBL_SPAWN_PATH + "exterior/"; - public static final String TBL_SPAWN_EGG_PATH = TBL_SPAWN_PATH + "egg/"; - public static final String TBL_SPAWN_FORMATION_PATH = TBL_SPAWN_PATH + "formation/"; - - public static final String TBL_DEFENSE_PATH = "datatables/faction_perk/hq/defense/"; - - public static final String TBL_OBJECTIVE_PATH = "datatables/faction_perk/hq/objective/"; - - public static final string_id PROSE_DISABLE_OTHER = new string_id("hq", "prose_disable_other"); - - public static final String HANDLER_LOAD_VULNERABILITY = "handleLoadVulnerability"; - public static final String HANDLER_UNLOAD_VULNERABILITY = "handleUnloadVulnerability"; - - public static final String TEMPLATE_SPAWN_EGG = "object/tangible/hq_egg/hq_spawner.iff"; - - public static final String VAR_SPAWN_TYPE = VAR_HQ_BASE + ".spawnType"; - - public static final int ST_NONE = 0; - public static final int ST_SMALL = 1; - public static final int ST_MEDIUM = 2; - public static final int ST_LARGE = 3; - - public static final String VAR_SPAWN_CHILDREN = VAR_SPAWN_BASE + ".children"; - public static final String VAR_SPAWN_PARENT = VAR_SPAWN_BASE + ".parent"; - - public static final String VAR_SPAWN_TEMPLATE = VAR_SPAWN_BASE + ".template"; - public static final String VAR_SPAWN_YAW = VAR_SPAWN_BASE + ".yaw"; - public static final String VAR_SPAWN_COUNT = VAR_SPAWN_BASE + ".cnt"; - - public static final String SCRIPT_SPAWN_CHILD = "faction_perk.hq.spawn_child"; - - public static final String VAR_SPAWN_LEADER = VAR_SPAWN_BASE + ".leader"; - - public static final float FACTION_BASE_REFUND_AMOUNT = 60000f; - - public static final int MAX_MINE_TYPES = 3; - - - public static void loadHqTheater(obj_id hq) throws InterruptedException - { - LOG("hq","loadHqTheater entered..."); - LOG("hq","loadHqTheater: hq yaw = "+ getYaw(hq)); - obj_id[] children = theater.spawnDatatableOffset(hq); - utils.removeBatchScriptVar(hq, SCRIPTVAR_THEATER_OBJECTS); - if (children != null && children.length > 0) - { - utils.setBatchScriptVar(hq, SCRIPTVAR_THEATER_OBJECTS, children); - messageTo(hq, "handleTheaterComplete", null, 5f, false); - } - - } - - - public static void cleanupHqTheater(obj_id hq) throws InterruptedException - { - LOG("hq","cleanupHqTheater entered..."); - obj_id[] children = utils.getObjIdBatchScriptVar(hq, SCRIPTVAR_THEATER_OBJECTS); - if (children != null && children.length > 0) - { - utils.destroyObjects(children); - } - } - - - public static void loadHqTerminals(obj_id hq) throws InterruptedException - { - LOG("hq","loadHqTerminals entered..."); - String faction = factions.getFaction(hq); - if (faction != null && !faction.equals("")) - { - obj_id[] terminals = structure.createStructureTerminals(hq, TBL_TERMINAL_PATH + toLower(faction) + ".iff"); - if (terminals != null && terminals.length > 0) - { - utils.setBatchScriptVar(hq, SCRIPTVAR_TERMINALS, terminals); - - for (int i = 0; i < terminals.length; i++) - { - testAbortScript(); - int tGot = getGameObjectType(terminals[i]); - if (tGot == GOT_terminal_cloning) - { - attachScript(terminals[i], SCRIPT_CLONING_OVERRIDE); - } - else if (tGot == GOT_terminal_insurance) - { - attachScript(terminals[i], SCRIPT_INSURANCE_OVERRIDE); - } - } - } - - } - else - { - destroyObject(hq); - } - } - - - public static void loadTurretTerminals(obj_id hq) throws InterruptedException - { - LOG("***hq***", "loadTurretTerminals entered..."); - String faction = factions.getFaction(hq); - if (faction != null && !faction.equals("")) - { - obj_id[] turTerminals = structure.createStructureTerminals(hq, TBL_TURRET_TERMINAL_PATH + toLower(faction) + ".iff"); - if (turTerminals != null && turTerminals.length > 0) - { - utils.setBatchObjVar(hq, VAR_DEFENSE_TURTERMINALS, turTerminals); - } - } - } - - - public static void loadHqSpawns(obj_id hq) throws InterruptedException - { - LOG("hq","loadHqSpawns entered..."); - loadInteriorHqSpawns(hq); - loadExteriorHqSpawns(hq); - } - - - public static void loadInteriorHqSpawns(obj_id hq) throws InterruptedException - { - LOG("hq","loadInteriorHqSpawns entered..."); - - String filename = utils.getTemplateFilenameNoPath(hq); - if (filename != null && !filename.equals("")) - { - obj_id[] interiorSpawns = spawnInterior(hq, TBL_SPAWN_INTERIOR_PATH + filename); - if (interiorSpawns != null && interiorSpawns.length > 0) - { - utils.setBatchScriptVar(hq, SCRIPTVAR_SPAWN_INTERIOR, interiorSpawns); - } - } - } - - - public static obj_id[] spawnInterior(obj_id hq, String tbl) throws InterruptedException - { - LOG("hq","spawnInterior entered..."); - if (!isIdValid(hq) || tbl == null || tbl.equals("")) - { - return null; - } - - int numRow = dataTableGetNumRows(tbl); - if (numRow > 0) - { - Vector spawns = new Vector(); - spawns.setSize(0); - - location here = getLocation(hq); - - String myFac = factions.getFaction(hq); - if (myFac == null || myFac.equals("")) - { - return null; - } - - LOG("hq","spawnInterior: numRows = "+ numRow); - for (int i = 0; i < numRow; i++) - { - testAbortScript(); - dictionary params = dataTableGetRow(tbl, i); - - String spawnType = params.getString("SPAWN"); - LOG("hq","spawnInterior: ("+ i + ") spawnType = "+ spawnType); - if (spawnType != null && !spawnType.equals("")) - { - float x = params.getFloat("X"); - float y = params.getFloat("Y"); - float z = params.getFloat("Z"); - - float yaw = params.getFloat("YAW"); - String cellname = params.getString("CELL"); - - location there = null; - if (cellname != null && !cellname.equals("")) - { - if (cellname.equals("WORLD_DELTA")) - { - there = new location(here.x + x, here.y + y, here.z + z); - } - else - { - obj_id cellId = getCellId(hq, cellname); - if (isIdValid(cellId)) - { - there = new location(x, y, z, here.area, cellId); - } - else - { - LOG("hq","spawnInterior: unable to determine id for hq = "+ hq + " cell = "+ cellname); - } - } - } - - if (there != null) - { - obj_id spawn = null; - LOG("hq","spawnInterior: attempting to load interior spawn with type: "+ spawnType); - if (spawnType.startsWith("egg")) - { - spawn = createInteriorEgg(hq, there, myFac, yaw); - - if (spawnType.indexOf(":") > -1) - { - String[] tmpSplit = split(spawnType, ':'); - if (tmpSplit.length > 1) - { - setObjVar(spawn, VAR_SPAWN_TEMPLATE, tmpSplit[1]); - } - } - } - else - { - spawn = create.object(spawnType, there); - if (isIdValid(spawn)) - { - setYaw(spawn, yaw); - } - } - - if (isIdValid(spawn)) - { - spawns = utils.addElement(spawns, spawn); - } - } - else - { - LOG("hq","spawnInterior: unable to load valid location for #"+ i + " -> spawnType = "+ spawnType); - } - } - } - - if (spawns != null && spawns.size() > 0) - { - obj_id[] _spawns = new obj_id[0]; - if (spawns != null) - { - _spawns = new obj_id[spawns.size()]; - spawns.toArray(_spawns); - } - return _spawns; - } - } - - return null; - } - - - public static obj_id createInteriorEgg(obj_id hq, location there, String myFac, float yaw) throws InterruptedException - { - LOG("hq","spawnInterior: loading interior spawn egg..."); - obj_id spawn = create.object(TEMPLATE_SPAWN_EGG, there); - if (isIdValid(spawn)) - { - LOG("hq","spawnInterior: spawn egg loaded..."); - setObjVar(spawn, VAR_SPAWN_TYPE, ST_SMALL); - setObjVar(spawn, VAR_SPAWN_PARENT, hq); - - setObjVar(spawn, VAR_SPAWN_YAW, yaw); - - factions.setFaction(spawn, myFac); - - messageTo(spawn, "handleSpawnRequest", null, rand(1,5), false); - return spawn; - } - else - { - LOG("hq","spawnInterior: UNABLE TO LOAD interior spawn egg..."); - } - - return null; - } - - - public static void loadExteriorHqSpawns(obj_id hq) throws InterruptedException - { - LOG("hq","loadExteriorHqSpawns entered..."); - - String filename = utils.getTemplateFilenameNoPath(hq); - if (filename != null && !filename.equals("")) - { - if (filename.indexOf( "_pvp" ) == -1) - { - obj_id[] exteriorSpawns = spawnExterior(hq, TBL_SPAWN_EXTERIOR_PATH + filename); - if (exteriorSpawns != null && exteriorSpawns.length > 0) - { - utils.setBatchScriptVar(hq, SCRIPTVAR_SPAWN_EXTERIOR, exteriorSpawns); - } - } - } - } - - - public static obj_id[] spawnExterior(obj_id hq, String tbl) throws InterruptedException - { - LOG("hq","spawnExterior entered..."); - if (!isIdValid(hq) || tbl == null || tbl.equals("")) - { - return null; - } - - Vector spawns = new Vector(); - spawns.setSize(0); - - location here = getLocation(hq); - float yaw = getYaw(hq); - - String myFac = factions.getFaction(hq); - if (myFac == null || myFac.equals("")) - { - return null; - } - - int numCols = dataTableGetNumColumns(tbl); - for (int i = 0; i < numCols; i++) - { - testAbortScript(); - String colName = dataTableGetColumnName(tbl, i); - - String[] locs = dataTableGetStringColumnNoDefaults(tbl, i); - if (locs != null && !locs.equals("")) - { - for (int n = 0; n < locs.length; n++) - { - testAbortScript(); - - java.util.StringTokenizer st = new java.util.StringTokenizer(locs[n], ","); - if (st.countTokens() == 2) - { - float dx = utils.stringToFloat(st.nextToken()); - float dz = utils.stringToFloat(st.nextToken()); - if (dx != Float.NEGATIVE_INFINITY && dz != Float.NEGATIVE_INFINITY) - { - location spawnLoc = player_structure.transformDeltaWorldCoord(here, dx, dz, yaw); - if (spawnLoc != null) - { - obj_id spawn = create.object(TEMPLATE_SPAWN_EGG, spawnLoc); - LOG("hq","spawnExterior: spawn egg id = "+ spawn); - if (isIdValid(spawn)) - { - if (colName.equalsIgnoreCase("small")) - { - setObjVar(spawn, VAR_SPAWN_TYPE, ST_SMALL); - } - else if (colName.equalsIgnoreCase("med")) - { - setObjVar(spawn, VAR_SPAWN_TYPE, ST_MEDIUM); - } - else if (colName.equalsIgnoreCase("large")) - { - setObjVar(spawn, VAR_SPAWN_TYPE, ST_LARGE); - } - - setObjVar(spawn, VAR_SPAWN_PARENT, hq); - - factions.setFaction(spawn, myFac); - - messageTo(spawn, "handleSpawnRequest", null, rand(1,5), false); - - spawns = utils.addElement(spawns, spawn); - } - } - } - } - } - } - } - - if (spawns != null && spawns.size() > 0) - { - obj_id[] _spawns = new obj_id[0]; - if (spawns != null) - { - _spawns = new obj_id[spawns.size()]; - spawns.toArray(_spawns); - } - return _spawns; - } - - return null; - } - - - public static location parseExteriorLocation(location home, String delta) throws InterruptedException - { - if (home == null || delta == null || delta.equals("")) - { - return null; - } - - java.util.StringTokenizer st = new java.util.StringTokenizer(delta, ","); - if (st.countTokens() != 2) - { - return null; - } - - float dx = utils.stringToFloat(st.nextToken()); - float dz = utils.stringToFloat(st.nextToken()); - if (dx == Float.NEGATIVE_INFINITY || dz == Float.NEGATIVE_INFINITY) - { - return null; - } - - return new location(home.x+dx, home.y, home.z+dz, home.area); - } - - - public static void cleanupHqSpawns(obj_id hq) throws InterruptedException - { - LOG("hq","cleanupHqSpawns entered..."); - obj_id[] intSpawn = utils.getObjIdBatchScriptVar(hq, SCRIPTVAR_SPAWN_INTERIOR); - if (intSpawn != null && intSpawn.length > 0) - { - utils.destroyObjects(intSpawn); - } - - obj_id[] extSpawn = utils.getObjIdBatchScriptVar(hq, SCRIPTVAR_SPAWN_EXTERIOR); - if (extSpawn != null && extSpawn.length > 0) - { - utils.destroyObjects(extSpawn); - } - - if (utils.hasScriptVar(hq, SCRIPTVAR_SPAWN_REINFORCEMENT)) - { - obj_id reinforcementSpawner = utils.getObjIdScriptVar(hq, SCRIPTVAR_SPAWN_REINFORCEMENT); - messageTo(reinforcementSpawner, "handleParentCleanup", null, 300, false); - } - } - - - public static void prepareHqDefenses(obj_id hq) throws InterruptedException - { - if (hasObjVar(hq, VAR_DEFENSE_BASE)) - { - return; - } - - String filename = utils.getTemplateFilenameNoPath(hq); - if (filename != null && !filename.equals("")) - { - String tbl = TBL_DEFENSE_PATH + filename; - int numCol = dataTableGetNumColumns(tbl); - for (int i = 0; i < numCol; i++) - { - testAbortScript(); - String colName = toLower(dataTableGetColumnName(tbl, i)); - String[] data = dataTableGetStringColumnNoDefaults(tbl, i); - if (data != null && data.length > 0) - { - obj_id[] tmp = new obj_id[data.length]; - for (int j = 0; j < tmp.length; ++j) - { - testAbortScript(); - tmp[j] = obj_id.NULL_ID; - } - setObjVar(hq, VAR_DEFENSE_BASE + "."+ colName, tmp); - } - } - - messageTo(hq, "handleCreateMinefield", null, 5f, false); - - int[] mines = new int[MAX_MINE_TYPES]; - setObjVar(hq, "mines", mines); - } - } - - - public static void cleanupHqDefenses(obj_id hq) throws InterruptedException - { - if (!hasObjVar(hq, VAR_DEFENSE_BASE)) - { - return; - } - - obj_var_list ovl = getObjVarList(hq, VAR_DEFENSE_BASE); - if (ovl == null) - { - return; - } - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - obj_var ov = ovl.getObjVar(i); - if (ov != null) - { - obj_id[] defenses = ov.getObjIdArrayData(); - if (defenses != null && defenses.length > 0) - { - for (int x = 0; x < defenses.length; x++) - { - testAbortScript(); - if (isIdValid(defenses[x])) - { - destroyObject(defenses[x]); - } - } - } - } - } - } - - - public static void disableHqTerminals(obj_id hq) throws InterruptedException - { - setObjVar(hq, VAR_TERMINAL_DISABLE, true); - - obj_id[] terminals = utils.getObjIdBatchScriptVar(hq, SCRIPTVAR_TERMINALS); - if (terminals != null && terminals.length > 0) - { - for (int i = 0; i < terminals.length; i++) - { - testAbortScript(); - if (!hasScript(terminals[i], SCRIPT_TERMINAL_DISABLE)) - { - attachScript(terminals[i], SCRIPT_TERMINAL_DISABLE); - } - } - } - } - - - public static void enableHqTerminals(obj_id hq) throws InterruptedException - { - setObjVar(hq, VAR_TERMINAL_DISABLE, false); - removeObjVar(hq, VAR_OBJECTIVE_DISABLED); - obj_id[] objects = trial.getAllObjectsInDungeon(hq); - if (objects == null || objects.length == 0) - { - return; - } - - for (int i=0; i= checkpastclose) - { - - obj_id[] objectives = loadObjectives(hq); - if (objectives != null && objectives.length > 0) - { - LOG("hq", "loadVulnerability ********* OBJECTIVES LOADED..."); - setObjVar(hq, VAR_OBJECTIVE_ID, objectives); - - int stampNew = stamp + ((int)VULNERABILITY_CYCLE); - - if (stampNew < 0) - { - stampNew = overdueStampReplacer (stamp, currentTime); - - } - - dictionary mapParams = new dictionary(); - int newStatus = 1; - mapParams.put( "status", newStatus ); - messageTo(hq, "handleFlagVulnerabilityChange", mapParams, 10, false); - LOG("hq", "loadVulnerability \\\\\\\\\\\\\\\\\\\\\\\\ fired message to 'handleFlagVulnerabilityChange' with status of : "+newStatus); - - setObjVar(hq, VAR_OBJECTIVE_STAMP, stampNew); - - messageTo(hq, HANDLER_UNLOAD_VULNERABILITY, null, VULNERABILITY_LENGTH, false); - - return; - } - else - { - - } - - messageTo(hq, HANDLER_LOAD_VULNERABILITY, null, VULNERABILITY_CYCLE + diff, false); - return; - } - else if (diff <= checkpastclose) - { - int stampNew = overdueStampReplacer (stamp, currentTime); - - setObjVar(hq, VAR_OBJECTIVE_STAMP, stampNew); - int vulnerabilityDelay = stampNew-currentTime; - messageTo(hq, HANDLER_LOAD_VULNERABILITY, null, vulnerabilityDelay, false); - - return; - } - else if (diff > checkfutureclose && diff < checkfuturefar) - { - - messageTo(hq, HANDLER_LOAD_VULNERABILITY, null, diff, false); - return; - } - else if (diff >= checkfuturefar) - { - int stampNew = farFutureStampReplacer (stamp, currentTime); - setObjVar(hq, VAR_OBJECTIVE_STAMP, stampNew); - int vulnerabilityDelay = stampNew-currentTime; - - messageTo(hq, HANDLER_LOAD_VULNERABILITY, null, vulnerabilityDelay, false); - } - } - - - public static obj_id[] loadObjectives(obj_id hq) throws InterruptedException - { - String filename = utils.getTemplateFilenameNoPath(hq); - if (filename == null || filename.equals("")) - { - return null; - } - - String tbl = TBL_OBJECTIVE_PATH + filename; - - int numRows = dataTableGetNumRows(tbl); - Vector opt = new Vector(); - opt.setSize(0); - - for (int i = 0; i < numRows; i++) - { - testAbortScript(); - opt = utils.addElement(opt, i); - } - - location here = getLocation(hq); - float yaw = getYaw(hq); - - Vector objectives = new Vector(); - objectives.setSize(0); - for (int i = 0; i < OBJECTIVE_TEMPLATE.length; i++) - { - testAbortScript(); - int idx = rand(0, opt.size() - 1); - int rowIdx = ((Integer)(opt.get(idx))).intValue(); - - opt = utils.removeElementAt(opt, idx); - - dictionary row = dataTableGetRow(tbl, rowIdx); - - String cellName = row.getString("CELL"); - float dx = row.getFloat("X"); - float dy = row.getFloat("Y"); - float dz = row.getFloat("Z"); - float dyaw = row.getFloat("YAW"); - - obj_id objective = null; - if (cellName == null || cellName.equals("") || cellName.equals("WORLD_DELTA")) - { - location there = player_structure.transformDeltaWorldCoord(here, dx, dz, yaw); - objective = createObject(OBJECTIVE_TEMPLATE[i], there); - if (isIdValid(objective)) - { - setYaw(objective, yaw+dyaw); - utils.addElement(objectives, objective); - } - } - else - { - obj_id cellId = getCellId(hq, cellName); - if (isIdValid(cellId)) - { - location iSpot = new location(dx, dy, dz, here.area, cellId); - objective = createObjectInCell(OBJECTIVE_TEMPLATE[i], hq, cellName, iSpot); - if (isIdValid(objective)) - { - setYaw(objective, dyaw); - utils.addElement(objectives, objective); - } - } - } - } - - obj_id[] _objectives = new obj_id[0]; - if (objectives != null) - { - _objectives = new obj_id[objectives.size()]; - objectives.toArray(_objectives); - } - return _objectives; - } - - - public static int overdueStampReplacer(int stamp, int currentTime) throws InterruptedException - { - int timeOverdue = currentTime - stamp; - int timeOverdueMagnitude = timeOverdue / (int)(VULNERABILITY_CYCLE); - int stampNew = ((timeOverdueMagnitude+1)*(int)(VULNERABILITY_CYCLE)) + stamp; - return stampNew; - } - - - public static int farFutureStampReplacer(int stamp, int currentTime) throws InterruptedException - { - int futureDiff = stamp - currentTime; - int futureMagnitude = futureDiff / (int)(VULNERABILITY_CYCLE); - int stampNew = stamp - (futureMagnitude+(int)(VULNERABILITY_CYCLE)); - return stampNew; - } - - - public static void unloadVulnerabilityForObjectReInit(obj_id hq) throws InterruptedException - { - obj_id[] objectives = getObjIdArrayObjVar(hq, VAR_OBJECTIVE_ID); - - setObjVar(hq, "planetMap.flags", MLF_INACTIVE); - - dictionary mapParams = new dictionary(); - int newStatus = 0; - mapParams.put( "status", newStatus ); - messageTo(hq, "handleFlagVulnerabilityChange", mapParams, 10, false); - LOG("hq", "unloadVulnerabilityForObjectReInit \\\\\\\\\\\\\\\\\\\\\\\\ fired message to 'handleFlagVulnerabilityChange' with status of : "+newStatus); - - removeObjVar(hq, VAR_OBJECTIVE_TRACKING); - - if (objectives != null && objectives.length > 0) - { - for (int i = 0; i < objectives.length; i++) - { - testAbortScript(); - destroyObject(objectives[i]); - } - } - activateHackAlarms(hq, false); - cleanupHqSecurityTeam(hq); - } - - - public static void unloadVulnerability(obj_id hq) throws InterruptedException - { - - obj_id[] objectives = getObjIdArrayObjVar(hq, VAR_OBJECTIVE_ID); - - dictionary mapParams = new dictionary(); - int newStatus = 0; - mapParams.put( "status", newStatus ); - messageTo(hq, "handleFlagVulnerabilityChange", mapParams, 10, false); - LOG("hq", "unloadVulnerability \\\\\\\\\\\\\\\\\\\\\\\\ fired message to 'handleFlagVulnerabilityChange' with status of : "+newStatus); - - removeObjVar(hq, VAR_OBJECTIVE_TRACKING); - - if (objectives != null && objectives.length > 0) - { - for (int i = 0; i < objectives.length; i++) - { - testAbortScript(); - destroyObject(objectives[i]); - } - } - - int currentTime = getCurrentTimeInSecsNormalized(); - - int reVulnerableDelay = (int) (VULNERABILITY_CYCLE - VULNERABILITY_LENGTH); - - if (hasObjVar(hq, VAR_OBJECTIVE_STAMP)) - { - int stamp = getIntObjVar(hq, VAR_OBJECTIVE_STAMP); - - if (stamp < 0) - { - stamp = overdueStampReplacer (stamp, currentTime); - - } - else if (stamp > (stamp + (int)(VULNERABILITY_CYCLE*2))) - { - stamp = farFutureStampReplacer (stamp, currentTime); - - } - - reVulnerableDelay = stamp - currentTime; - - setObjVar(hq, VAR_OBJECTIVE_STAMP, stamp); - } - - messageTo(hq, "handleDefenderRespawn", null, 5, false); - activateHackAlarms(hq, false); - cleanupHqSecurityTeam(hq); - messageTo(hq, HANDLER_LOAD_VULNERABILITY, null, reVulnerableDelay, false); - } - - - public static int getCurrentTimeInSecsNormalized() throws InterruptedException - { - long now = System.currentTimeMillis(); - long curTime = ((now / 1000) - 1072224000); - int currentTime = (int) curTime; - return currentTime; - } - - - public static boolean canDisableObjective(obj_id hq, obj_id objective) throws InterruptedException - { - - LOG("gcw", "checking canDisable Objective for "+hq+" and "+objective); - if (!isIdValid(hq) || !isIdValid(objective)) - { - return false; - } - - if (hasObjVar(objective, VAR_IS_DISABLED)) - { - return false; - } - LOG("gcw", "getNextObjective is "+getNextObjective(hq)); - if (objective == getNextObjective(hq)) - { - return true; - } - - return false; - } - - - public static obj_id getNextObjective(obj_id hq) throws InterruptedException - { - - obj_id[] objectives = getObjIdArrayObjVar(hq, VAR_OBJECTIVE_ID); - if (objectives == null || objectives.length == 0) - { - return null; - } - - obj_id[] disabled = getObjIdArrayObjVar(hq, VAR_OBJECTIVE_DISABLED); - if (disabled == null || disabled.length == 0) - { - return objectives[0]; - } - else - { - if (disabled.length < objectives.length) - { - return objectives[disabled.length]; - } - } - - return null; - } - - - public static obj_id getPriorObjective(obj_id hq, obj_id objective) throws InterruptedException - { - - obj_id[] objectives = getObjIdArrayObjVar(hq, VAR_OBJECTIVE_ID); - if (objectives == null || objectives.length == 0) - { - return null; - } - - int idx = utils.getElementPositionInArray(objectives, objective); - if (idx > 0 && idx < objectives.length) - { - return objectives[idx - 1]; - } - - return null; - } - - - public static void disableObjective(obj_id hq, obj_id objective) throws InterruptedException - { - - if (canDisableObjective(hq, objective)) - { - - Vector disabled = getResizeableObjIdArrayObjVar(hq, VAR_OBJECTIVE_DISABLED); - disabled = utils.addElement(disabled, objective); - setObjVar(hq, VAR_OBJECTIVE_DISABLED, disabled, resizeableArrayTypeobj_id); - - setObjVar(objective, VAR_IS_DISABLED, true); - - messageTo(objective, "handleObjectiveDisabled", null, 1, false); - activateHackAlarms(hq, true); - - } - } - - - public static void disableObjective(obj_id objective) throws InterruptedException - { - - obj_id hq = null; - if (hasObjVar(objective, "objParent")) - { - hq = getObjIdObjVar(objective, "objParent"); - - } - else - { - hq = getTopMostContainer(objective); - } - if (isIdValid(hq)) - { - disableObjective(hq, objective); - } - else - { - LOG("hq", "library.hq::disableObjective(obj_id objective) ********* hq obj_id came in as invalid"); - } - } - - - public static void detonateHq(obj_id hq) throws InterruptedException - { - float maxDist = getFloatObjVar(hq, "poi.fltSize") - 20f; - - location here = getLocation(hq); - - obj_id[] players = player_structure.getPlayersInBuilding(hq); - if (players != null && players.length > 0) - { - location ejectLoc = getBuildingEjectLocation(hq); - location worldLoc = getWorldLocation(hq); - - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - pclib.sendToAnyLocation(players[i], ejectLoc, worldLoc); - } - } - - location[] locs = new location[rand(5,9)]; - for (int i = 0; i < locs.length; i++) - { - testAbortScript(); - location tmpLoc = utils.getRandomLocationInRing(here, 5f, maxDist); - if (tmpLoc != null) - { - tmpLoc.y = getHeightAtLocation(tmpLoc.x, tmpLoc.z) + rand(0f, 5f); - locs[i] = tmpLoc; - } - } - - dictionary d = new dictionary(); - d.put("locs", locs); - - messageTo(hq, "handleHqDetonation", d, rand(0.1f, 1f), true); - } - - - public static void validateDefenseTracking(obj_id hq) throws InterruptedException - { - if (!isIdValid(hq)) - { - return; - } - - if (!hasObjVar(hq, VAR_DEFENSE_BASE)) - { - return; - } - - obj_var_list ovl = getObjVarList(hq, VAR_DEFENSE_BASE); - if (ovl == null) - { - return; - } - - String filename = utils.getTemplateFilenameNoPath(hq); - if (filename != null && !filename.equals("")) - { - String tbl = TBL_DEFENSE_PATH + filename; - String[] data = dataTableGetStringColumnNoDefaults(tbl, "TURRET"); - - obj_id[] properTurretData = new obj_id[data.length]; - obj_id[] currentTurretData = getObjIdArrayObjVar(hq, VAR_DEFENSE_BASE + ".turret"); - - if ((currentTurretData != null && properTurretData != null) && currentTurretData.length != properTurretData.length) - { - for (int i = 0; i < properTurretData.length; i++) - { - testAbortScript(); - if (i < currentTurretData.length) - { - properTurretData[i] = currentTurretData[i]; - } - else - { - properTurretData[i] = obj_id.NULL_ID; - } - } - - setObjVar(hq, VAR_DEFENSE_BASE + ".turret", properTurretData); - } - } - - int numType = ovl.getNumItems(); - for (int i = 0; i < numType; i++) - { - testAbortScript(); - obj_var ov = ovl.getObjVar(i); - obj_id[] defenses = ov.getObjIdArrayData(); - if (defenses != null && defenses.length > 0) - { - for (int x = 0; x < defenses.length; x++) - { - testAbortScript(); - if (isIdValid(defenses[x])) - { - if (!exists(defenses[x]) || (getHitpoints(defenses[x]) < 1)) - { - dictionary d = new dictionary(); - d.put("sender", defenses[x]); - messageTo(hq, "handleRemoveDefense", d, 1f, false); - } - else if (hasScript(defenses[x], "systems.turret.turret_ai")) - { - dictionary d = new dictionary(); - d.put("sender", defenses[x]); - messageTo(hq, "handleResetTurretControl", d, 1f, false); - } - } - } - } - } - obj_id[] numTur = getObjIdArrayObjVar(hq, "hq.defense.turret"); - if (numTur == null || numTur.length == 0) - { - detachScript(hq, "faction_perk.hq.base_block"); - } - int pos = utils.getFirstValidIdIndex(numTur); - if (pos > -1) - { - attachScript(hq, "faction_perk.hq.base_block"); - } - - if (hasObjVar(hq, "mines")) - { - int[] mines = getIntArrayObjVar(hq, "mines"); - - if (mines.length < MAX_MINE_TYPES) - { - messageTo(hq, "handleMinefieldValidation", null, 10f, false); - } - } - else - { - messageTo(hq, "handleMinefieldValidation", null, 10f, false); - } - } - - - public static void sealEntrance(obj_id hq) throws InterruptedException - { - if (!isIdValid(hq)) - { - return; - } - - if (!hasObjVar(hq, VAR_DEFENSE_BASE)) - { - return; - } - - attachScript(hq, "faction_perk.hq.base_block"); - } - - - public static void ejectEnemyFactionOnLogin(obj_id player) throws InterruptedException - { - obj_id structure = getTopMostContainer( player ); - if (!isIdValid(structure)) - { - return; - } - - int myFac = pvpGetAlignedFaction(structure); - int tFac = pvpGetAlignedFaction(player); - if (isPlayer( player) && pvpGetType( player ) == PVPTYPE_NEUTRAL) - { - tFac = 0; - } - - if (pvpAreFactionsOpposed(myFac, tFac)) - { - - if (isIdValid(structure)) - { - string_id warning = new string_id ("faction_perk","destroy_turrets"); - sendSystemMessage (player, warning); - { - location there = getBuildingEjectLocation(structure); - - if (there == null) - { - return; - } - - dictionary params = new dictionary(); - params.put("player", player); - params.put("loc", there); - messageTo(structure, "ejectPlayer", params, 1f, false); - } - } - return; - } - } - - - public static void loadFullTimeVulnerability(obj_id hq) throws InterruptedException - { - if (hasObjVar(hq,VAR_OBJECTIVE_ID)) - { - obj_id[] oldObjectives = getObjIdArrayObjVar(hq, VAR_OBJECTIVE_ID); - removeObjVar(hq, VAR_OBJECTIVE_TRACKING); - if (oldObjectives != null && oldObjectives.length > 0) - { - for (int i = 0; i < oldObjectives.length; i++) - { - testAbortScript(); - if (isIdValid(oldObjectives[i])) - { - destroyObject(oldObjectives[i]); - } - } - } - } - - obj_id[] objectives = loadObjectives(hq); - if (objectives != null && objectives.length > 0) - { - setObjVar(hq, VAR_OBJECTIVE_ID, objectives); - - } - - return; - } - - - public static void planetMapVulnerabilityStatusChange(obj_id hq, int newStatus) throws InterruptedException - { - - map_location maploc = getPlanetaryMapLocation(hq); - - byte statusFlag = MLF_INACTIVE; - if (newStatus == 1) - { - statusFlag = MLF_ACTIVE; - } - - addPlanetaryMapLocation(hq, maploc.getLocationName(), (int)maploc.getX(), (int)maploc.getY(), maploc.getCategory(), maploc.getSubCategory(), MLT_STATIC, statusFlag); - - return; - } - - - public static void refundFactionBaseLots(obj_id base) throws InterruptedException - { - if (hasObjVar(base, "lotsRefunded2" )) - { - return; - } - - obj_id baseOwner = getOwner(base); - - String base_template = getTemplateName(base); - String base_fp_template = player_structure.getFootprintTemplate( base_template ); - if (base_fp_template == null || base_fp_template.equals("")) - { - return; - } - - int base_lot_cost = (getNumberOfLots(base_fp_template) / 4); - if (base_lot_cost < 1) - { - base_lot_cost = 1; - } - - int base_lot_refund = base_lot_cost; - - dictionary outparams = new dictionary(); - outparams.put( "baseLotRefund", base_lot_refund ); - - float faction_point_refund = 60000f; - if (hasObjVar(base, "lotsRefunded" )) - { - faction_point_refund = 0f; - } - outparams.put( "baseFactionRefund", faction_point_refund ); - int baseFaction = pvpGetAlignedFaction(base); - outparams.put( "baseFaction", baseFaction ); - - gcw.incrementGCWScore (base); - setObjVar(base, "lotsRefunded2", 1); - - messageTo(baseOwner, "factionBaseLotRefund", outparams, 1f, true); - - return; - } - - - public static void refundBaseUnit(obj_id base) throws InterruptedException - { - - obj_id baseOwner = getOwner(base); - messageTo(baseOwner, "factionBaseUnitRefund", null, 1f, true); - return; - } - - - public static boolean isPvpFactionBase(obj_id base) throws InterruptedException - { - if (hasObjVar(base,"isPvpBase" )) - { - return true; - } - return false; - } - - - public static void removeCovertDetector(obj_id base) throws InterruptedException - { - if (hasObjVar(base,"hq.defense.covert_detector" )) - { - removeObjVar(base,"hq.defense.covert_detector"); - } - return; - } - - - public static void loadAlarmUnits(obj_id hq) throws InterruptedException - { - LOG("hq","loadAlarmUnits entered..."); - - String filename = utils.getTemplateFilenameNoPath(hq); - if (filename != null && !filename.equals("")) - { - spawnAlarmUnits(hq); - } - } - - - public static void spawnAlarmUnits(obj_id hq) throws InterruptedException - { - - cleanupBaseAlarmUnits(hq); - - String filename = utils.getTemplateFilenameNoPath(hq); - if (filename == null || filename.equals("")) - { - return; - } - - if (filename.indexOf ("hq_s01") != -1) - { - filename = "hq_s01.iff"; - } - else if (filename.indexOf ("hq_s02") != -1) - { - filename = "hq_s02.iff"; - } - else if (filename.indexOf ("hq_s03") != -1) - { - filename = "hq_s03.iff"; - } - else if (filename.indexOf ("hq_s04") != -1) - { - filename = "hq_s04.iff"; - } - - String tbl = "datatables/faction_perk/hq/alarm/"+filename; - - int numRows = dataTableGetNumRows(tbl); - - location here = getLocation(hq); - - Vector hackAlarms = new Vector(); - hackAlarms.setSize(0); - Vector destructAlarms = new Vector(); - destructAlarms.setSize(0); - for (int i = 0; i < numRows; i++) - { - testAbortScript(); - dictionary row = dataTableGetRow(tbl, i); - - String alarmType = row.getString("ALARM"); - LOG("hq","hq::spawnAlarmUnits: ("+ i + ") alarmType = "+ alarmType); - - if (alarmType != null && !alarmType.equals("")) - { - float x = row.getFloat("X"); - float y = row.getFloat("Y"); - float z = row.getFloat("Z"); - float yaw = row.getFloat("YAW"); - String cellName = row.getString("CELL"); - - obj_id alarmUnit = null; - if (cellName != null && !cellName.equals("")) - { - obj_id cellId = getCellId(hq, cellName); - if (isIdValid(cellId)) - { - location loc = new location(x, y, z, here.area, cellId); - alarmUnit = createObjectInCell(alarmType, hq, cellName, loc); - - setLocation(alarmUnit, loc); - setYaw(alarmUnit, yaw); - - transform alarmTransform = getTransform_o2p(alarmUnit); - if (alarmType.indexOf ("alarm_hack") != -1) - { - alarmTransform = alarmTransform.pitch_l((float)((Math.PI)/2)); - } - else - { - alarmTransform = alarmTransform.pitch_l((float)Math.PI); - } - setTransform_o2p(alarmUnit, alarmTransform); - - if (isIdValid(alarmUnit)) - { - if (alarmType.indexOf ("hack") != -1) - { - utils.addElement(hackAlarms, alarmUnit); - } - else if (alarmType.indexOf ("destruct") != -1) - { - utils.addElement(destructAlarms, alarmUnit); - } - else - { - destroyObject(alarmUnit); - } - } - } - } - } - } - if (hackAlarms.size() > 0) - { - setObjVar(hq, "hq.alarm.hack", hackAlarms); - } - if (destructAlarms.size() > 0) - { - setObjVar(hq, "hq.alarm.destruct", destructAlarms); - } - - return; - } - - - public static void activateHackAlarms(obj_id hq, boolean activate) throws InterruptedException - { - if (hasObjVar(hq, "hq.alarm.hack" )) - { - Vector hackAlarmList = getResizeableObjIdArrayObjVar(hq, "hq.alarm.hack"); - for (int i = 0; i< hackAlarmList.size(); i++) - { - testAbortScript(); - if (activate == true) - { - setCondition(((obj_id)(hackAlarmList.get(i))), CONDITION_ON); - messageTo(hq, "handleAlarmMute", null, 600, false); - } - else - { - clearCondition(((obj_id)(hackAlarmList.get(i))), CONDITION_ON); - } - } - } - return; - } - - - public static void activateDestructAlarms(obj_id hq, boolean activate) throws InterruptedException - { - if (hasObjVar(hq, "hq.alarm.destruct" )) - { - Vector destructAlarmList = getResizeableObjIdArrayObjVar(hq, "hq.alarm.destruct"); - for (int i = 0; i< destructAlarmList.size(); i++) - { - testAbortScript(); - if (activate == true) - { - setCondition(((obj_id)(destructAlarmList.get(i))), CONDITION_ON); - } - else - { - clearCondition(((obj_id)(destructAlarmList.get(i))), CONDITION_ON); - } - } - } - return; - } - - - public static void cleanupBaseAlarmUnits(obj_id hq) throws InterruptedException - { - if (hasObjVar(hq, "hq.alarm.hack" )) - { - Vector hackAlarms = getResizeableObjIdArrayObjVar(hq, "hq.alarm.hack"); - if (hackAlarms.size () > 0) - { - obj_id[] hackAlarmList = new obj_id[hackAlarms.size()]; - hackAlarms.toArray (hackAlarmList); - utils.destroyObjects(hackAlarmList); - removeObjVar(hq, "hq.alarm.hack"); - } - } - if (hasObjVar(hq, "hq.alarm.destruct" )) - { - Vector destructAlarms = getResizeableObjIdArrayObjVar(hq, "hq.alarm.destruct"); - if (destructAlarms.size () > 0) - { - obj_id[] destructAlarmList = new obj_id[destructAlarms.size()]; - destructAlarms.toArray (destructAlarmList); - utils.destroyObjects(destructAlarmList); - removeObjVar(hq, "hq.alarm.destruct"); - } - } - } - - - public static void spawnRovingSecurityTeam(obj_id hq) throws InterruptedException - { - String hqTemplate = utils.getTemplateFilenameNoPath(hq); - int sizeOfBase = 1; - - if (hqTemplate.indexOf ("hq_s02") != -1) - { - sizeOfBase = 2; - } - else if (hqTemplate.indexOf ("hq_s03") != -1) - { - sizeOfBase = 3; - } - else if (hqTemplate.indexOf ("hq_s04") != -1) - { - sizeOfBase = 4; - } - - location start = getGoodLocation(hq, "entry"); - String[] base_cells = getCellNames(hq); - location[] locs = new location[base_cells.length]; - for (int i = 0; i< base_cells.length; i++) - { - testAbortScript(); - locs[i] = getGoodLocation(hq, base_cells[i]); - } - - int numRespondersCheck = rand(0,5); - int numResponders = 0; - switch (numRespondersCheck) - { - case 5: - numResponders = 3*sizeOfBase; - break; - - case 4: - numResponders = 2*sizeOfBase; - break; - - case 3: - numResponders = sizeOfBase; - break; - } - - if (numResponders == 0) - { - return; - } - - loadReinforcementSpawn(hq); - - dictionary params = new dictionary(); - params.put( "locs", locs ); - params.put( "start", start ); - - for (int i = 0; i < numResponders; i++) - { - testAbortScript(); - String guard = guardKeyPicker(hq); - params.put( "guard", guard ); - messageTo(hq, "handleSpawnSecurityRover", params, rand(i,i+5), false); - } - - return; - } - - - public static String guardKeyPicker(obj_id hq) throws InterruptedException - { - int spawnType = ST_SMALL; - - String template = utils.getTemplateFilenameNoPath(hq); - LOG("hq","hq::guardKeyPicker -- parent template = "+ template); - if (template == null || template.equals("")) - { - return null; - } - - String tbl = TBL_SPAWN_EGG_PATH + template; - LOG("hq","hq::guardKeyPicker -- tbl = "+ tbl); - - String[] spawnList = null; - spawnList = dataTableGetStringColumnNoDefaults(tbl, "small"); - - if (spawnList == null || spawnList.length == 0) - { - LOG("hq","hq::guardKeyPicker -- spawnList returned from datatable with invalid data..."); - return null; - } - - String spawnKey = spawnList[rand(0,spawnList.length - 1)]; - LOG("hq","hq::guardKeyPicker -- spawnKey = "+ spawnKey); - if (spawnKey == null || spawnKey.equals("")) - { - return null; - } - - return spawnKey; - } - - - public static void cleanupHqSecurityTeam(obj_id hq) throws InterruptedException - { - if (utils.hasScriptVar(hq, "hq.spawn.security" )) - { - Vector securityTeam = utils.getResizeableObjIdArrayScriptVar(hq, "hq.spawn.security"); - if (securityTeam.size () > 0) - { - obj_id[] securityDetail = new obj_id[securityTeam.size()]; - securityTeam.toArray (securityDetail); - utils.destroyObjects(securityDetail); - } - } - } - - - public static void loadReinforcementSpawn(obj_id hq) throws InterruptedException - { - - if (utils.hasScriptVar(hq, SCRIPTVAR_SPAWN_REINFORCEMENT)) - { - return; - } - - String filename = utils.getTemplateFilenameNoPath(hq); - if (filename != null && !filename.equals("")) - { - if (filename.indexOf( "_pvp" ) != -1) - { - - int idx = filename.indexOf("_pvp"); - if (idx >= 0) - { - filename = filename.substring(idx-1); - } - } - obj_id reinforcementSpawner = spawnReinforcements(hq, TBL_SPAWN_EXTERIOR_PATH + filename); - if (isIdValid(reinforcementSpawner)) - { - utils.setScriptVar(hq, SCRIPTVAR_SPAWN_REINFORCEMENT, reinforcementSpawner); - } - } - } - - - public static obj_id spawnReinforcements(obj_id hq, String tbl) throws InterruptedException - { - - if (!isIdValid(hq) || tbl == null || tbl.equals("")) - { - return null; - } - - String myFac = factions.getFaction(hq); - if (myFac == null || myFac.equals("")) - { - return null; - } - - location reinforcementSpawnLoc = utils.findLocInFrontOfTarget(hq, (float)(rand(30.0f,50.0f))); - - if (reinforcementSpawnLoc != null) - { - obj_id spawn = create.object(TEMPLATE_SPAWN_EGG, reinforcementSpawnLoc); - - if (isIdValid(spawn)) - { - setObjVar(spawn, VAR_SPAWN_TYPE, ST_LARGE); - setObjVar(spawn, VAR_SPAWN_PARENT, hq); - setObjVar(spawn, "hq.spawn.reinforcements", 1); - factions.setFaction(spawn, myFac); - messageTo(spawn, "handleSpawnRequest", null, rand(1,5), false); - return spawn; - } - } - - return null; - } - - - public static void createMinefield(obj_id hq) throws InterruptedException - { - String filename = utils.getTemplateFilenameNoPath(hq); - String table = TBL_DEFENSE_PATH + "minefield.iff"; - - float dx = dataTableGetFloat(table, filename, "x"); - float dz = dataTableGetFloat(table, filename, "z"); - float radius = dataTableGetFloat(table, filename, "radius"); - - location here = getLocation(hq); - float yaw = getYaw(hq); - - location there = player_structure.transformDeltaWorldCoord(here, dx, dz, yaw); - there.y = here.y; - - obj_id minefield = createObject("object/tangible/faction_perk/faction_base_item/minefield.iff", there); - - if (isIdValid(minefield)) - { - attachScript(minefield, "faction_perk.minefield.advanced_minefield"); - attachScript(minefield, SCRIPT_DEFENSE_OBJECT); - - factions.setFaction(minefield, factions.getFaction(hq)); - - setObjVar(minefield, "pvpCanAttack", 1); - setInvulnerable(minefield, false); - persistObject(minefield); - - setObjVar(minefield, VAR_DEFENSE_PARENT, hq); - setOwner(minefield, hq); - - obj_id[] data = new obj_id[1]; - data[0] = minefield; - setObjVar(hq, VAR_DEFENSE_BASE + ".minefield", data); - } - } - - - public static int getTotalMines(obj_id hq) throws InterruptedException - { - if (!hasObjVar(hq, "mines")) - { - return 0; - } - - int[] mines = getIntArrayObjVar(hq, "mines"); - int total = 0; - - if (mines == null || mines.length == 0) - { - return 0; - } - - for (int i = 0; i < mines.length; i++) - { - testAbortScript(); - total += mines[i]; - } - - return total; - } - - - public static float getMinefieldRadius(obj_id hq) throws InterruptedException - { - String filename = utils.getTemplateFilenameNoPath(hq); - String table = TBL_DEFENSE_PATH + "minefield.iff"; - - return dataTableGetFloat(table, filename, "radius"); - } - - - public static int getMaxMines(obj_id hq) throws InterruptedException - { - String filename = utils.getTemplateFilenameNoPath(hq); - String table = TBL_DEFENSE_PATH + "minefield.iff"; - - return dataTableGetInt(table, filename, "max"); - } - - - public static int getRandomMineType(obj_id hq) throws InterruptedException - { - if (!hasObjVar(hq, "mines")) - { - return -1; - } - - int[] mines = getIntArrayObjVar(hq, "mines"); - if (mines == null || mines.length == 0) - { - return -1; - } - - int max = getTotalMines(hq); - if (max == 0) - { - return -1; - } - - int roll = rand(1, 100); - int base_chance = 0; - int type_counter = 0; - int type = -1; - - while (type < 0 && type_counter < mines.length) - { - testAbortScript(); - if (type_counter == (mines.length - 1)) - { - type = (mines.length - 1); - } - else - { - int chance = (int)(((float)mines[type_counter] / (float)max) * 100f); - base_chance += chance; - - if (roll <= base_chance) - { - type = type_counter; - } - } - - type_counter++; - } - - mines[type]--; - if (mines[type] < 0) - { - mines[type] = 0; - } - - setObjVar(hq, "mines", mines); - - return type; - } - - - public static void clearMinefield(obj_id hq) throws InterruptedException - { - if (!hasObjVar(hq, "mines")) - { - return; - } - - int[] mines = getIntArrayObjVar(hq, "mines"); - if (mines == null || mines.length == 0) - { - return; - } - - for (int i = 0; i < mines.length; i++) - { - testAbortScript(); - mines[i] = 0; - } - - setObjVar(hq, "mines", mines); - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/loot.java b/sku.0/sys.server/compiled/game/script/library/loot.java deleted file mode 100644 index 64515575f..000000000 --- a/sku.0/sys.server/compiled/game/script/library/loot.java +++ /dev/null @@ -1,3051 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.buff; -import script.library.corpse; -import script.library.consumable; -import script.library.craftinglib; -import script.library.factions; -import script.library.healing; -import script.library.hue; -import script.library.money; -import script.library.pet_lib; -import script.library.resource; -import script.library.slots; -import script.library.static_item; -import script.library.storyteller; -import script.library.trace; -import script.library.utils; -import script.library.weapons; -import java.util.Arrays; -import java.util.Enumeration; -import java.util.Vector; - - -public class loot extends script.base_script -{ - public loot() - { - } - public static final int COL_LOOT_MULTIPLIER_ON = 1; - - public static final String TBL_CREATURES = "datatables/mob/creatures.iff"; - public static final String TBL_COMPONENT_DATA = "datatables/loot/component_data.iff"; - - public static final String VAR_DENY_LOOT = "denyLoot"; - public static final String VAR_LOOT_QUALITY = "loot.loot_quality"; - - public static final String TBL_EXCLUSION = "datatables/loot/exclusion.iff"; - public static final String COL_TEMPLATE = "TEMPLATE"; - public static final String COL_EXCLUDE = "EXCLUDE"; - - public static final String DATA_ITEM = "dataItem"; - - public static final String DATA_ITEM_FACTION = DATA_ITEM + ".faction"; - public static final String DATA_ITEM_VALUE = DATA_ITEM + ".value"; - - public static final String TBL_DATA_ITEM_VALUE = "datatables/data_item/redeem_value.iff"; - - public static final String ENCODED_DISK = "object/tangible/encoded_disk/encoded_disk_base.iff"; - - public static final String SPECIAL_LOOT = "datatables/loot/npc_special_loot.iff"; - - public static final String COLLECTIBLE_LOOT = "datatables/loot/npc_collectible_loot.iff"; - - public static final String CASH_ITEM_TEMPLATE = "object/tangible/item/loot_cash.iff"; - - public static final String MEATLUMP_LUMP = "item_meatlump_lump_01_01"; - public static final String MEATLUMP_LOOT_TABLE = "datatables/loot/dungeon/meatlump_dungeon_container_loot.iff"; - - public static final String CREATURES_TABLE = "datatables/mob/creatures.iff"; - - public static final String COLLECTIONS_LOOT_TABLE = "datatables/loot/loot_items/collectible/collection_loot.iff"; - public static final String COLLECTIONS_PVP_RANK_TABLE = "datatables/loot/loot_items/collectible/collection_pvp_rank.iff"; - public static final String COLLECTIONS_PVP_LOOT_TABLE = "datatables/loot/loot_items/collectible/collection_pvp_loot.iff"; - - public static final int MIN_CREATURE_LEVEL = 1; - public static final int MAX_CREATURE_LEVEL = 85; - - public static final float MAX_ALLOWED_WEAPON_INTENSITY = 0.90f; - public static final float MIN_ALLOWED_WEAPON_INTENSITY = 0.35f; - - public static final int BASE_CHANCE_FOR_CASH = 40; - public static final int BASE_CHANCE_FOR_RESOURCES = 40; - - public static final int BASE_CHANCE_FOR_ENZYME = 25; - - public static final string_id SID_REWARD_ITEM = new string_id("collection","reward_item"); - public static final int COLLECTION_PVP_ROLL = 80; - - public static final String FORAGE_LOGGING_CATEGORY = "foraging"; - public static final boolean FORAGE_LOGGING_ON = false; - - public static final int RARE_COMPONENT_DIVISOR = 10; - public static final int SUPER_RARE_COMPONENT_DIVISOR = 5; - public static final int WORM_ROLL_INT = 80; - - public static final int ENZYME = 0; - public static final int WORM = 1; - public static final int COMPONENT = 2; - public static final int TREASURE = 3; - public static final int BAIT = 99; - public static final int NOTHING = 98; - - public static final int FORAGE_BASE_ONE = 14; - public static final int FORAGE_BASE_TWO = 28; - public static final int PLAYER_DEFAULT_FORAGE_CHANCE = 0; - - public static final int DEFAULT_ENZYME_CHANCE = 40; - public static final int DEFAULT_WORM_CHANCE = 40; - public static final int DEFAULT_TREASURE_CHANCE = 0; - public static final int DEFAULT_COMPONENT_CHANCE = 40; - - public static final float ENZYME_MODIFIER = 0.f; - public static final float TREASURE_MODIFIER = 0.f; - public static final float PLAYER_DEFAULT_FIND_MODIFIER = 0.f; - public static final float LUCKY_FIND_MODIFIER = 6.f; - - public static final String FORAGING_RARE_TABLE = "datatables/foraging/forage_global_rare.iff"; - public static final String FORAGING_ENEMY_TABLE = "datatables/foraging/forage_enemy.iff"; - public static final String FORAGING_LOOT_ROLL_TABLE = "datatables/foraging/foraging_loot_roll.iff"; - - public static final String LOOT_LOW_COL = "low"; - public static final String LOOT_HIGH_COL = "high"; - - public static final String LOOT_ENZYME = "enzyme"; - public static final String LOOT_COMPONENT = "component"; - public static final String LOOT_WORM = "worm"; - public static final String LOOT_BAIT = "bait"; - public static final String LOOT_TREASURE = "treasure"; - - public static final String FORAGE_ENEMY_SCRIPT = "creature.foraging_enemy"; - - public static final String FORAGING_STF = "player/player_utility"; - - public static final string_id FOUND_TREASURE = new string_id("player/player_utility", "forage_found_treasure"); - public static final string_id TREASURE_BONUS_ROLL = new string_id("player/player_utility", "treasure_buff_extra_roll"); - public static final string_id TREASURE_BONUS = new string_id("player/player_utility", "treasure_map_buff_bonus"); - - public static final string_id SID_FULL_INVENTORY = new string_id("player/player_utility", "forage_full_inventory"); - public static final string_id FOUND_NOTHING = new string_id("player/player_utility", "forage_found_nothing"); - public static final string_id FOUND_SOMETHING = new string_id("player/player_utility", "forage_found_something"); - public static final string_id FOUND_WORM = new string_id("player/player_utility", "forage_found_worm"); - public static final string_id FOUND_COMPONENT = new string_id("player/player_utility", "forage_found_component"); - - public static final string_id FOUND_ENZYME = new string_id("player/player_utility", "forage_found_enzyme"); - public static final string_id ENZYME_BONUS_ROLL = new string_id("player/player_utility", "enzyme_buff_extra_roll"); - public static final string_id ENZYME_BONUS = new string_id("player/player_utility", "truffle_pig_buff_bonus"); - - public static final string_id FORAGE_BONUS = new string_id("player/player_utility", "ice_cream_buff_bonus"); - public static final string_id LUCK_BONUS = new string_id("player/player_utility", "luck_buff_bonus"); - - public static final String[] COMPONENT_PLANETS = - { - "corellia", - "dantooine", - "dathomir", - "endor", - "naboo", - "tatooine", - "yavin4" - }; - - - public static boolean addLoot(obj_id target) throws InterruptedException - { - - if (!isIdValid(target)) - { - return false; - } - - if (hasObjVar(target, VAR_DENY_LOOT)) - { - return false; - } - - boolean hasLoot = false; - - obj_id inv = utils.getInventoryContainer(target); - if (inv == null) - { - return false; - } - - String mobType = ai_lib.getCreatureName(target); - if (mobType == null || mobType.length() < 1) - { - String err = "WARNING: loot::addLoot("+ target + ") returning false because getCreatureName failed. Template="+ getTemplateName(target) + ", IsAuthoritative="+ target.isAuthoritative() + ". Stack Trace as follows:"; - CustomerServiceLog("creatureNameErrors", err); - debugServerConsoleMsg(target, err); - Thread.dumpStack(); - - return false; - } - - if (!hasObjVar(target, "storytellerid")) - { - int cash = getNpcMoney(target); - if (addCashAsLoot(target, cash)) - { - hasLoot = true; - } - } - - hasLoot |= setupLootItems(target); - - hasLoot |= addCollectionLoot(target); - - int niche = ai_lib.aiGetNiche(mobType); - - if ((niche == NICHE_MONSTER || niche == NICHE_HERBIVORE || niche == NICHE_CARNIVORE || niche == NICHE_PREDATOR)) - { - - int[] hasResource = corpse.hasResource(mobType); - if (hasResource != null && hasResource.length > 0) - { - setObjVar(target, corpse.VAR_HAS_RESOURCE, hasResource); - } - - if (isInTutorialArea(target)) - { - return false; - } - - hasLoot |= addBeastEnzymes(target); - } - - return hasLoot; - } - - - public static int getCashForLevel(String mobType, int level) throws InterruptedException - { - if (mobType == null || mobType.equals("") || level < 1) - { - return 0; - } - - int lbound = dataTableGetInt(TBL_CREATURES, mobType, "minCash"); - int ubound = dataTableGetInt(TBL_CREATURES, mobType, "maxCash"); - if (ubound == 0) - { - return 0; - } - - if (lbound > 0 && ubound > 0) - { - return rand(lbound, ubound); - } - - int minCash = level; - if (lbound > 0 && minCash < lbound) - { - minCash = lbound; - } - - int maxCash = level*17; - if (ubound > 0 && maxCash > ubound) - { - maxCash = ubound; - } - - return rand(minCash, maxCash); - } - - - public static boolean addResourceLoot(obj_id target) throws InterruptedException - { - if (rand(1,100) > BASE_CHANCE_FOR_RESOURCES) - { - return false; - } - - String mobType = ai_lib.getCreatureName(target); - int niche = ai_lib.aiGetNiche(mobType); - if (niche != NICHE_MONSTER && niche != NICHE_HERBIVORE && niche != NICHE_CARNIVORE && niche != NICHE_PREDATOR) - { - return false; - } - - int[] hasResource = corpse.hasResource(mobType); - if (hasResource == null || hasResource.length == 0) - { - return false; - } - - obj_id inv = utils.getInventoryContainer(target); - - dictionary resourceData = corpse.getRandomHarvestCorpseResources(obj_id.NULL_ID, target); - - java.util.Enumeration keys = resourceData.keys(); - int finalAmount = 0; - while (keys.hasMoreElements()) - { - testAbortScript(); - - String resourceType = (String)(keys.nextElement()); - int amt = resourceData.getInt(resourceType); - - if (amt <= 0) - { - continue; - } - - String sceneName = getCurrentSceneName(); - String rsrcMapTable = "datatables/creature_resource/resource_scene_map.iff"; - String correctedPlanetName = dataTableGetString(rsrcMapTable, sceneName, 1); - - if (correctedPlanetName == null || correctedPlanetName.equals("")) - { - correctedPlanetName = "tatooine"; - } - - resourceType = resourceType + "_"+ correctedPlanetName; - - int useDistMap = dataTableGetInt(rsrcMapTable, sceneName, "useDistributionMap"); - location worldLoc = getWorldLocation(target); - if (useDistMap == 0) - { - worldLoc.area = correctedPlanetName; - } - finalAmount += corpse.extractCorpseResource(resourceType, amt, worldLoc, obj_id.NULL_ID, inv, 1); - } - - return (finalAmount > 0); - } - - - public static int getCalculatedAttribute(int minVal, int maxVal, int creatureLevel, int minDropLevel, int maxDropLevel) throws InterruptedException - { - return Math.round(getCalculatedAttribute((float)minVal, (float)maxVal, creatureLevel, minDropLevel, maxDropLevel)); - } - - - public static float getCalculatedAttribute(float minVal, float maxVal, int creatureLevel, int minDropLevel, int maxDropLevel) throws InterruptedException - { - float rank = (float)(creatureLevel - minDropLevel) / (float)(maxDropLevel - minDropLevel); - - if (rank < -1.0f) - { - rank = -1.0f; - } - else if (rank > 2.0f) - { - rank = 2.0f; - } - - float rslt = random.distributedRand(minVal, maxVal, rank); - LOG("loot", "getCalculatedAttribute: -> returning "+ rslt); - return rslt; - } - - - public static int getCalculatedAttribute(int minVal, int maxVal, int creatureLevel) throws InterruptedException - { - return getCalculatedAttribute(minVal, maxVal, creatureLevel, MIN_CREATURE_LEVEL, MAX_CREATURE_LEVEL); - } - - - public static float getCalculatedAttribute(float minVal, float maxVal, int creatureLevel) throws InterruptedException - { - return getCalculatedAttribute(minVal, maxVal, creatureLevel, MIN_CREATURE_LEVEL, MAX_CREATURE_LEVEL); - } - - - public static int getRowIndexForComponent(String componentTemplate) throws InterruptedException - { - if (componentTemplate == null || componentTemplate.equals("")) - { - return -1; - } - - return dataTableSearchColumnForString(componentTemplate, "template", TBL_COMPONENT_DATA); - } - - - public static dictionary getComponentData(obj_id component) throws InterruptedException - { - return getComponentData(getTemplateName(component)); - } - - - public static dictionary getComponentData(String componentTemplate) throws InterruptedException - { - int startRow = getRowIndexForComponent(componentTemplate); - if (startRow < 0) - { - return null; - } - - dictionary dat = new dictionary(); - int totalRows = dataTableGetNumRows(TBL_COMPONENT_DATA); - if (totalRows < startRow + 1) - { - trace.log("loot", "loot::getComponentData: -> Gave starting row of "+ startRow + ", but "+ TBL_COMPONENT_DATA + " only has "+ totalRows + " rows.", null, trace.TL_ERROR_LOG); - return null; - } - - String templateString = ""; - for (int i = startRow; i < totalRows; i++) - { - testAbortScript(); - templateString = dataTableGetString(TBL_COMPONENT_DATA, i, "template"); - - if (!templateString.equals(componentTemplate) && !templateString.equals("")) - { - trace.log("loot", "loot::getComponentData: -> Done fetching data for this object. Stopped at data table row "+ i); - break; - } - - dat.put(dataTableGetString(TBL_COMPONENT_DATA, i, "stringArg"), new float[] - { - dataTableGetFloat(TBL_COMPONENT_DATA, i, "min"), dataTableGetFloat(TBL_COMPONENT_DATA, i, "max") - } - ); - } - - trace.log("loot", "loot:getComponentData: -> Component data has "+ dat.size() + " elements."); - return dat; - } - - - public static boolean redeemFactionCoupon(obj_id redeemer, obj_id player, obj_id coupon) throws InterruptedException - { - if ((redeemer == null) || (player == null) || (coupon == null)) - { - return false; - } - - if (!isFactionalDataItem(coupon)) - { - return false; - } - - String rFaction = getStringObjVar(redeemer, "faction"); - if ((rFaction == null) || (rFaction.equals(""))) - { - return false; - } - - int val = getFactionCouponValue(redeemer, coupon); - if (val < 0) - { - return false; - } - - factions.awardFactionStanding(player, rFaction, val); - - return destroyObject(coupon); - } - - - public static int getFactionCouponValue(obj_id redeemer, obj_id coupon) throws InterruptedException - { - if ((redeemer == null) || (coupon == null)) - { - return -1; - } - - if (!isFactionalDataItem(coupon)) - { - return -1; - } - - if (!hasObjVar(redeemer, factions.FACTION)) - { - return -1; - } - - String rFaction = getStringObjVar(redeemer, factions.FACTION); - String cFaction = getStringObjVar(coupon, DATA_ITEM_FACTION); - - int base_value = getIntObjVar(coupon, DATA_ITEM_VALUE); - - if (!dataTableOpen(TBL_DATA_ITEM_VALUE)) - { - return -1; - } - - float multiplier = utils.dataTableGetFloat(TBL_DATA_ITEM_VALUE, rFaction, cFaction); - if (multiplier < 0) - { - return -1; - } - - int point_value = (int)(base_value * multiplier); - - return point_value; - } - - - public static boolean isFactionalDataItem(obj_id item) throws InterruptedException - { - if ((item == null) || (item == obj_id.NULL_ID)) - { - return false; - } - - if (getGameObjectType(item) == GOT_data_fictional) - { - return true; - } - - return false; - } - - - public static obj_id[] getFactionalDataItems(obj_id target, String faction) throws InterruptedException - { - if ((target == null) || (target == obj_id.NULL_ID)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - - obj_id dp = utils.getDatapad(target); - if ((dp == null) || (dp == obj_id.NULL_ID)) - { - return null; - } - else - { - obj_id[] contents = getContents(dp); - if ((contents == null) || (contents.length == 0)) - { - return null; - } - else - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - obj_id item = contents[i]; - if (isFactionalDataItem(item)) - { - if (faction.equals("")) - { - ret = utils.addElement(ret, item); - } - else - { - String ifac = getStringObjVar(item, DATA_ITEM_FACTION); - if (ifac != null) - { - if (ifac.equals(faction)) - { - ret = utils.addElement(ret, item); - } - } - } - } - } - } - } - - if ((ret == null) || (ret.size() == 0)) - { - return null; - } - else - { - obj_id[] _ret = new obj_id[0]; - if (ret != null) - { - _ret = new obj_id[ret.size()]; - ret.toArray(_ret); - } - return _ret; - } - } - - - public static obj_id[] getFactionalDataItems(obj_id target) throws InterruptedException - { - return getFactionalDataItems(target, ""); - } - - - public static boolean randomizeWeapon(obj_id weapon, int creatureLevel) throws InterruptedException - { - if (!isIdValid(weapon)) - { - return false; - } - - float percentOfMax = getCalculatedAttribute(MIN_ALLOWED_WEAPON_INTENSITY, MAX_ALLOWED_WEAPON_INTENSITY, creatureLevel); - - dictionary weaponCraftingData = weapons.getWeaponDat(weapon); - if (weaponCraftingData == null) - { - return false; - } - - weapons.setWeaponAttributes(weapon, weaponCraftingData, percentOfMax); - return true; - } - - - public static boolean randomizeArmor(obj_id item, int level) throws InterruptedException - { - LOG("loot", "loot:randomizeArmor: -> Randomizing "+ item); - if (!isIdValid(item)) - { - return false; - } - - String template = getTemplateName(item); - int armorCat = armor.getArmorCategoryByTemplate(template); - - if (armorCat < 0 || armorCat > AC_max) - { - return false; - } - - if (!armor.setArmorDataPercent(item, getCalculatedAttribute(0, AL_max-1, level), armorCat, getCalculatedAttribute(0.4f, 0.9f, level), getCalculatedAttribute(0.4f, 1.0f, level))) - { - - return false; - } - - if (armorCat == 0) - { - armor.setArmorSpecialProtectionPercent(item, armor.DATATABLE_RECON_LAYER, 1.0f); - } - if (armorCat == 2) - { - armor.setArmorSpecialProtectionPercent(item, armor.DATATABLE_ASSAULT_LAYER, 1.0f); - } - - if (!armor.isValidArmor(item)) - { - LOG("loot", "loot:randomizeArmor: -> Not valid armor."); - return false; - } - return true; - } - - - public static boolean randomizeMedicine(obj_id item, int level) throws InterruptedException - { - if (!isIdValid(item)) - { - return false; - } - - if (hasObjVar(item, consumable.VAR_CONSUMABLE_MODS)) - { - - attrib_mod[] am = getAttribModArrayObjVar(item, consumable.VAR_CONSUMABLE_MODS); - attrib_mod[] am_new = new attrib_mod[am.length]; - - for (int i = 0; i < am.length; i++) - { - testAbortScript(); - int attrib = am[i].getAttribute(); - int val = am[i].getValue(); - float duration = am[i].getDuration(); - float atk = am[i].getAttack(); - float decay = am[i].getDecay(); - attrib_mod tmp; - - if (healing.isBuffMedicine(item)) - { - tmp = new attrib_mod(attrib, getCalculatedAttribute(600, 900, level), getCalculatedAttribute(9000, 12000, level), atk, decay); - } - else - { - tmp = new attrib_mod(attrib, getCalculatedAttribute(150, 400, level), duration, atk, decay); - } - - am_new[i] = tmp; - } - - if (am_new.length == 0) - { - - return false; - } - - setObjVar(item, consumable.VAR_CONSUMABLE_MODS, am_new); - } - - if (healing.isCureDotMedicine(item) || healing.isApplyDotMedicine(item)) - { - - setObjVar(item, healing.VAR_HEALING_DOT_POWER, getCalculatedAttribute(40, 100, level)); - if (healing.isApplyDotMedicine(item)) - { - - int potency = healing.getDotPotency(item); - setObjVar(item, healing.VAR_HEALING_DOT_POTENCY, getCalculatedAttribute(70, 150, level)); - - int duration = healing.getDotDuration(item); - setObjVar(item, healing.VAR_HEALING_DOT_DURATION, getCalculatedAttribute(400, 800, level)); - } - } - - setCount(item, getCalculatedAttribute(5, 25, level)); - - return true; - } - - - public static float[] validateComponentVals(float[] dat) throws InterruptedException - { - - float[] defaultVal = new float[] - { - 0.0f, 0.0f - }; - - if (dat == null) - { - return defaultVal; - } - - switch(dat.length) - { - case 1: - return new float[]{dat[0], dat[0]}; - case 2: - return dat; - } - - return defaultVal; - } - - - public static boolean randomizeComponent(obj_id item, int level, obj_id container) throws InterruptedException - { - if (!isIdValid(item)) - { - return false; - } - - if (!isIdValid(container)) - { - return false; - } - - String template = getTemplateName(item); - dictionary componentData = getComponentData(template); - if (componentData == null) - { - return false; - } - - int minToDrop = 1; - int maxToDrop = 1; - float[] fVals = null; - - int minCreatureLevelDrop = MIN_CREATURE_LEVEL; - int maxCreatureLevelDrop = MAX_CREATURE_LEVEL; - if (componentData.containsKey("level")) - { - fVals = validateComponentVals(componentData.getFloatArray("level")); - minCreatureLevelDrop = (int)fVals[0]; - maxCreatureLevelDrop = (int)fVals[1]; - componentData.remove("level"); - } - - Enumeration keys = componentData.keys(); - boolean hasAttribBonus = false; - int[] attribBonus = null; - - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)keys.nextElement(); - fVals = validateComponentVals(componentData.getFloatArray(key)); - key = key.trim(); - LOG("loot", "loot::randomizeComponent: -> processing key '"+ key + "' where data[0]="+ fVals[0] + ", data[1]="+ fVals[1] ); - - if (key.equals("amount")) - { - LOG("loot", "loot::randomizeComponent: -> Grabbing amount from dataset"); - minToDrop = (int)fVals[0]; - maxToDrop = (int)fVals[1]; - } - else if (key.startsWith("attribute.bonus.")) - { - String strAttrib = key.substring(key.length()-1); - int intAttrib = utils.stringToInt(strAttrib); - LOG("loot", "loot:randomizeComponent: -> Processing Attributes : "+ intAttrib); - if (intAttrib < 0 || intAttrib >= NUM_ATTRIBUTES) - { - LOG("loot", "loot:randomizeComponent: -> IntAttrib Out of Range : "+ intAttrib); - continue; - } - - if (attribBonus == null) - { - attribBonus = new int[NUM_ATTRIBUTES]; - } - - attribBonus[intAttrib] = getCalculatedAttribute((int)fVals[0], (int)fVals[1], level, minCreatureLevelDrop, maxCreatureLevelDrop); - hasAttribBonus = true; - } - else if (key.startsWith("combat_critical")) - { - int val = rand((int)fVals[0], (int)fVals[1]); - LOG("loot", "loot:randomizeComponent: -> Not an attribute modifier or armor modifier : "+ key); - - setObjVar(item, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ key, val); - LOG("loot", "loot:randomizeComponent: -> setting objvar : "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ key); - } - else - { - float val = getCalculatedAttribute(fVals[0], fVals[1], level, minCreatureLevelDrop, maxCreatureLevelDrop); - - if (key.equals("armorCategory")|| key.equals("armorLevel")) - { - setObjVar(item, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ key,(int)val); - - int armorCat = armor.getArmorCategory(item); - if (armorCat == 0) - { - armor.setArmorSpecialProtectionPercent(item, armor.DATATABLE_RECON_LAYER, 1.0f); - } - if (armorCat == 2) - { - armor.setArmorSpecialProtectionPercent(item, armor.DATATABLE_ASSAULT_LAYER, 1.0f); - } - } - else - { - - setObjVar(item, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ key, key.equals("attackSpeed")|| key.equals("attackCost")? val * -1 : val); - } - } - } - if (hasAttribBonus && attribBonus != null && attribBonus.length == NUM_ATTRIBUTES) - { - LOG("loot", "loot:randomizeComponent: -> Calling Set Attributes : "+ attribBonus.toString()); - for (int i=0; i Attribute "+ i + " = "+ attribBonus[i]); - } - setAttributeBonuses(item, attribBonus); - } - - LOG("loot", "loot:randomizeComponent: -> Amount to drop : "+ minToDrop + "/"+ maxToDrop); - - setCraftedId(item, container); - setCrafter(item, container); - - int numDropped = 1; - if (minToDrop <= maxToDrop) - { - - numDropped = rand(minToDrop, maxToDrop); - } - - LOG("loot", "loot:randomizeComponent: -> Dropping "+ numDropped + " "+ template); - if (numDropped > 1) - { - setObjVar(item, "unstack.serialNumber", container); - setCount(item, numDropped); - attachScript(item, "object.onewayunstack"); - } - - return true; - } - - - public static String getCreatureType(String name) throws InterruptedException - { - return dataTableGetString("datatables/mob/creatures.iff", name, "lootList"); - } - - - public static int getAdjustedCreatureLevel(obj_id target, String name) throws InterruptedException - { - int level = getLevel(target); - int difficultyClass = dataTableGetInt ("datatables/mob/creatures.iff", name, "difficultyClass"); - - if (difficultyClass > 0) - { - float levelMod = 0.4f * difficultyClass; - level += (int)(level * levelMod); - } - - return level; - } - - - public static boolean generateTheftLootRare(obj_id container, obj_id mark, int maxItems, obj_id thief) throws InterruptedException - { - String name = getCreatureName(mark); - String type = getCreatureType(name); - - if (type == null || type.equals("none")) - { - return false; - } - - String strTreasureTable = "treasure/treasure_"; - String treasureLevel = "1_10"; - int intLevel = getIntObjVar(mark, "intCombatDifficulty"); - - if (intLevel <= 90) - { - treasureLevel = "81_90"; - } - - else if (intLevel <= 80) - { - treasureLevel = "71_80"; - } - - else if (intLevel <= 70) - { - treasureLevel = "61_70"; - } - - else if (intLevel <= 60) - { - treasureLevel = "51_60"; - } - - else if (intLevel <= 50) - { - treasureLevel = "41_50"; - } - - else if (intLevel <= 40) - { - treasureLevel = "31_40"; - } - - else if (intLevel <= 30) - { - treasureLevel = "21_30"; - } - - else if (intLevel <= 20) - { - treasureLevel = "11_20"; - } - - else if (intLevel <= 10) - { - treasureLevel = "1_10"; - } - - else - { - return false; - } - - String strTable = strTreasureTable + treasureLevel; - utils.setScriptVar(container, "theft_in_progress", 1); - - return makeLootInContainer(container, strTable, 1, intLevel); - } - - - public static boolean generateTheftLoot(obj_id container, obj_id mark, float chanceMod, int maxItems) throws InterruptedException - { - String name = getCreatureName(mark); - String type = getCreatureType(name); - - if (type == null || type.equals("none")) - { - return false; - } - - int level = getAdjustedCreatureLevel(mark, name); - String strTable = getStringObjVar(mark, "loot.lootTable"); - int intLevel = getIntObjVar(mark, "intCombatDifficulty"); - utils.setScriptVar(container, "theft_in_progress", 1); - return makeLootInContainer(container, strTable, 1, intLevel); - - } - - - public static int getNpcMoney(obj_id target) throws InterruptedException - { - String mobType = ai_lib.getCreatureName(target); - if (mobType == null) - { - return -1; - } - - int niche = ai_lib.aiGetNiche(target); - if (niche != NICHE_NPC) - { - return -1; - } - - int level = ai_lib.getLevel(target); - - int cash = getCashForLevel(mobType, level); - if (cash < 1) - { - cash = rand (1,10); - cash = cash * level; - } - - return cash; - } - - - public static boolean addCashAsLoot(obj_id target, int cash) throws InterruptedException - { - if (cash < 1) - { - return false; - } - - obj_id inv = utils.getInventoryContainer(target); - if (inv == null) - { - return false; - } - - obj_id cashItem = createObject(CASH_ITEM_TEMPLATE, inv, ""); - if (!isIdValid(cashItem)) - { - return false; - } - - setObjVar(cashItem, "loot.cashAmount", cash); - setName(cashItem, formatCashAmount(cash)); - - return true; - } - - - public static String formatCashAmount(int cash) throws InterruptedException - { - final java.text.DecimalFormat CASH_NAME_FORMAT = new java.text.DecimalFormat("#,### cr"); - - return CASH_NAME_FORMAT.format(cash); - } - - - public static boolean isCashLootItem(obj_id item) throws InterruptedException - { - String template = getTemplateName(item); - if (template.equals(CASH_ITEM_TEMPLATE)) - { - if (hasObjVar(item, "loot.cashAmount")) - { - return true; - } - } - return false; - } - - - public static boolean doGroupLooting(obj_id corpseId, obj_id transferer, obj_id item) throws InterruptedException - { - obj_id leader = group.getLeader(transferer); - obj_id team = getGroupObject (transferer); - int groupLootType = getGroupLootRule(team); - obj_id[] objMembersWhoExist = utils.getLocalGroupMemberIds(team); - - obj_id corpseInv = utils.getInventoryContainer(corpseId); - obj_id[] contents = getContents(corpseInv); - int numContents = contents.length; - - if (objMembersWhoExist == null) - { - return false; - } - - if (groupLootType == 0) - { - setGroupLootRule(team, group.FREE_FOR_ALL); - return true; - } - - if (groupLootType == 1) - { - obj_id master = getGroupMasterLooterId(team); - String masterName = getEncodedName (master); - - if (transferer != master) - { - prose_package pp = new prose_package(); - string_id masterMsg = new string_id (group.GROUP_STF, "master_only"); - pp = prose.setStringId(pp, masterMsg); - pp = prose.setTO(pp, masterName); - - sendSystemMessageProse (transferer, pp); - return false; - } - } - - if (groupLootType == 2) - { - if (hasObjVar (corpseId, "autoLootComplete" )) - { - return true; - } - - int numWindows = 0; - if (hasObjVar (corpseId, "numWindowsOpen" )) - { - numWindows = getIntObjVar(corpseId, "numWindowsOpen"); - } - else - { - for (int i = 0; i < objMembersWhoExist.length; i++) - { - testAbortScript(); - - if (numContents > 0 && !(numContents == 1 && isCashLootItem(contents[0]))) - { - openLotteryWindow(objMembersWhoExist[i], corpseInv); - } - - else if (numContents == 1 && isCashLootItem(contents[0])) - { - return true; - } - else - { - string_id emptyCorpse = new string_id (group.GROUP_STF, "corpse_empty"); - sendSystemMessage (objMembersWhoExist[i], emptyCorpse); - lootAiCorpse(transferer, corpseId); - return false; - } - } - numWindows = objMembersWhoExist.length; - setObjVar (corpseId, "numWindowsOpen", numWindows); - } - - if (numWindows > 0) - { - dictionary lotto = new dictionary(); - lotto.put ("player", transferer); - lotto.put ("corpseInv", corpseInv); - messageTo (corpseId, "fireLotteryPulse", lotto, 2, true); - return false; - } - } - - if (groupLootType == 3) - { - return true; - } - - return true; - } - - - public static boolean doGroupLootAllCheck(obj_id player, obj_id corpseId) throws InterruptedException - { - if (player != null && corpseId != null) - { - obj_id leader = group.getLeader(player); - obj_id team = group.getGroupObject(leader); - int lootType = getGroupLootRule(team); - obj_id[] objMembersWhoExist = utils.getLocalGroupMemberIds(team); - - if (objMembersWhoExist == null) - { - return true; - } - - int number = objMembersWhoExist.length; - - if (number < 1) - { - return true; - } - - obj_id corpseInv = utils.getInventoryContainer(corpseId); - if (corpseInv == null) - { - return false; - } - - obj_id[] contents = getContents(corpseInv); - if (contents == null) - { - return false; - } - - int numContents = contents.length; - - if (lootType == 0) - { - setGroupLootRule (team, group.FREE_FOR_ALL); - return true; - } - - if (lootType == 1) - { - obj_id master = getGroupMasterLooterId(team); - String masterName = getEncodedName (master); - if (master == player) - { - return true; - } - else if (!isIdValid(master)) - { - return true; - } - else - { - prose_package pp = new prose_package(); - string_id masterMsg = new string_id (group.GROUP_STF, "master_only"); - pp = prose.setStringId(pp, masterMsg); - pp = prose.setTO(pp, masterName); - - sendSystemMessageProse (player, pp); - return false; - } - } - - else if (lootType == 2) - { - if (hasObjVar (corpseId, "autoLootComplete" )) - { - return true; - } - - if (hasObjVar (corpseId, "numWindowsOpen" )) - { - return false; - } - - for (int i = 0; i < objMembersWhoExist.length; i++) - { - testAbortScript(); - - if (numContents > 0 && !(numContents == 1 && isCashLootItem(contents[0]))) - { - openLotteryWindow(objMembersWhoExist[i], corpseInv); - } - - else if (numContents == 1 && isCashLootItem(contents[0])) - { - return true; - } - else - { - string_id emptyCorpse = new string_id (group.GROUP_STF, "corpse_empty"); - sendSystemMessage (objMembersWhoExist[i], emptyCorpse); - lootAiCorpse(player, corpseId); - return false; - } - } - setObjVar (corpseId, "numWindowsOpen", objMembersWhoExist.length); - - dictionary lotto = new dictionary(); - lotto.put ("player", player); - lotto.put ("corpseInv", corpseInv); - messageTo (corpseId, "fireLotteryPulse", lotto, 2, true); - return false; - } - - else if (lootType == 3) - { - return true; - } - - else - { - string_id cantLoot = new string_id (group.GROUP_STF, "no_loot_group"); - sendSystemMessage (player, cantLoot); - return false; - } - } - return false; - } - - - public static boolean pickRandomLooter(obj_id player, obj_id team, obj_id corpse) throws InterruptedException - { - if (team != null && corpse != null) - { - obj_id[] objMembersWhoExist = utils.getLocalGroupMemberIds(team); - if (objMembersWhoExist == null) - { - return false; - } - obj_id corpsePack = utils.getInventoryContainer(corpse); - obj_id[] corpseContents = getContents(corpsePack); - if (corpseContents != null && corpseContents.length > 0) - { - int numTeam = objMembersWhoExist.length; - int numItems = corpseContents.length; - if (numItems > 0) - { - for (int i = 0; i < numItems; i ++) - { - testAbortScript(); - int choice = rand (0, numTeam-1); - obj_id chosenPlayer = objMembersWhoExist[choice]; - if (chosenPlayer != null) - { - return true; - } - else - { - return false; - } - } - } - } - } - return true; - } - - - public static void sendGroupLootSystemMessage(obj_id item, obj_id winner, String stf, String message) throws InterruptedException - { - sendGroupLootSystemMessage (item, winner, stf, message, false); - return; - } - - - public static void sendGroupLootSystemMessage(obj_id item, obj_id winner, String stf, String message, boolean skipWinner) throws InterruptedException - { - if (!group.isGrouped (winner)) - { - return; - } - else - { - obj_id team = getGroupObject (winner); - obj_id[] objMembersWhoExist = utils.getLocalGroupMemberIds(team); - - prose_package pp = new prose_package(); - string_id lootMsg = new string_id (stf, message); - - pp = prose.setStringId(pp, lootMsg); - pp = prose.setTO(pp, item); - pp = prose.setTT(pp, winner); - - if (!skipWinner) - { - for (int intI = 0; intI < objMembersWhoExist.length; intI++) - { - testAbortScript(); - sendSystemMessageProse(objMembersWhoExist[intI], pp); - } - } - else - { - for (int intI = 0; intI < objMembersWhoExist.length; intI++) - { - testAbortScript(); - if (objMembersWhoExist[intI] != winner) - { - sendSystemMessageProse(objMembersWhoExist[intI], pp); - } - } - } - } - return; - } - - - public static void setAutoLootComplete(obj_id winner, obj_id corpse, obj_id item) throws InterruptedException - { - setObjVar (corpse, "autoLootComplete", 1); - setObjVar (item, "pickupable", winner); - return; - } - - - public static obj_id chooseRandomLootPlayerFromGroup(obj_id corpse, obj_id player) throws InterruptedException - { - obj_id team = getGroupObject(player); - int groupLootRule = getGroupLootRule (team); - obj_id[] objMembersWhoExist = utils.getLocalGroupMemberIds(team); - int teamNumber = objMembersWhoExist.length; - - if (hasObjVar (corpse, "autoLootComplete" )) - { - obj_id corpseInv = utils.getInventoryContainer(corpse); - queueCommand(player, (1880585606), corpseInv, "", COMMAND_PRIORITY_DEFAULT); - } - - if (teamNumber > 0) - { - int which = rand(0, teamNumber-1); - player = objMembersWhoExist[which]; - } - return player; - } - - - public static boolean isMasterLooter(obj_id toTest, boolean sendMessage) throws InterruptedException - { - obj_id team = getGroupObject(toTest); - if (team != null) - { - obj_id masterLooter = getGroupMasterLooterId(team); - String masterName = getEncodedName (masterLooter); - - if (toTest == masterLooter) - { - return true; - } - else if (sendMessage) - { - prose_package pp = new prose_package(); - string_id masterMsg = new string_id (group.GROUP_STF, "master_only"); - pp = prose.setStringId(pp, masterMsg); - pp = prose.setTO(pp, masterName); - - sendSystemMessageProse (toTest, pp); - } - } - - return false; - } - - - public static void lootAiCorpse(obj_id self, obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return; - } - - if (!isMob(target)) - { - return; - } - - if (!isIncapacitated(target)) - { - return; - } - - if (isIncapacitated(self)) - { - return; - } - - if (pet_lib.isPet (target)) - { - return; - } - - if (!hasObjVar(target, "readyToLoot")) - { - return; - } - - if (!corpse.hasLootPermissions(target, self)) - { - return; - } - - if (corpse.lootAICorpse(self, target)) - { - messageTo(target, "handleCorpseEmpty", null, 0, true); - } - return; - } - - - public static obj_id findItemToStack(obj_id item) throws InterruptedException - { - obj_id container = getContainedBy(item); - if (!isIdValid(container)) - { - return null; - } - - String itemStaticName = getStaticItemName(item); - if (itemStaticName == null) - { - itemStaticName = ""; - } - - obj_id[] allItems = utils.getAllItemsInContainerByTemplate( container, getTemplateName(item), false ); - - if ((allItems != null) && (allItems.length > 0)) - { - for (int i = 0; i < allItems.length; ++i) - { - testAbortScript(); - - String curItemStaticName = getStaticItemName(allItems[i]); - if (curItemStaticName == null) - { - curItemStaticName = ""; - } - - if (item != allItems[i] && curItemStaticName.equals(itemStaticName)) - { - return allItems[i]; - } - } - } - return null; - } - - public static void stackItem(obj_id objSourceItem, obj_id objDestinationItem) throws InterruptedException - { - - int sourceCount = getCount(objSourceItem); - if (sourceCount == 0) - { - sourceCount = 1; - } - - int intCount = getCount(objDestinationItem); - if (intCount == 0) - { - intCount = 1; - } - intCount = intCount + sourceCount; - setCount(objDestinationItem, intCount); - destroyObject(objSourceItem); - - obj_id container = getContainedBy(objDestinationItem); - if (utils.hasScriptVar(container, "theft_in_progress")) - { - notifyThiefOfItemStolen(container, objDestinationItem); - } - return; - } - - - public static boolean setupLootItems(obj_id objCreature) throws InterruptedException - { - obj_id objContainer = utils.getInventoryContainer(objCreature); - if (!hasObjVar(objCreature, "loot.lootTable")) - { - LOG("npe", "No Loot Table on "+objCreature+" of template "+getTemplateName(objCreature)); - return false; - - } - String strTable = getStringObjVar(objCreature, "loot.lootTable"); - int intLevel = getIntObjVar(objCreature, "intCombatDifficulty"); - int intItems = getIntObjVar(objCreature, "loot.numItems"); - - return makeLootInContainer(objContainer, strTable, intItems, intLevel); - } - - - public static boolean setupLootItems(obj_id objCreature, int intItems) throws InterruptedException - { - - obj_id objContainer = utils.getInventoryContainer(objCreature); - if (!hasObjVar(objCreature, "loot.lootTable")) - { - LOG("npe", "No Loot Table on "+objCreature+" of template "+getTemplateName(objCreature)); - return false; - - } - String strTable = getStringObjVar(objCreature, "loot.lootTable"); - int intLevel = getIntObjVar(objCreature, "intCombatDifficulty"); - return makeLootInContainer(objContainer, strTable, intItems, intLevel); - - } - - public static boolean makeLootInContainer(obj_id objContainer, String strTable, int intItems, int intLevel) throws InterruptedException - { - boolean boolMadeLoot = false; - String strRootItems = "datatables/loot/loot_items/"; - - String[] parse = split(strTable, ':'); - - strTable = parse[0]; - strTable = "datatables/loot/loot_types/"+strTable+".iff"; - String strItemsHeader = "strItems"; - - if (parse.length == 2) - { - strItemsHeader = parse[1]; - } - - String[] strLootTypes = dataTableGetStringColumnNoDefaults(strTable, strItemsHeader); - String[] strRequiredItems = null; - - if (dataTableHasColumn(strTable, "strRequiredItems")) - { - strRequiredItems = dataTableGetStringColumnNoDefaults(strTable, "strRequiredItems"); - } - - if ((strLootTypes == null)||(strLootTypes.length == 0)) - { - - return boolMadeLoot; - } - - for (int intI = 0; intI < intItems; intI++) - { - testAbortScript(); - - String strItemTable = strLootTypes[rand(0, strLootTypes.length-1)]; - - String[] parseItem = split(strItemTable, ':'); - - strItemTable = parseItem[0]; - strItemTable = strRootItems+strItemTable+".iff"; - String strItemTypeHeader = "strItemType"; - - if (parseItem.length == 2) - { - strItemTypeHeader = parseItem[1]; - } - - if (!dataTableOpen(strItemTable)) - { - - } - else - { - - String[] strItems = dataTableGetStringColumnNoDefaults(strItemTable, strItemTypeHeader); - if ((strItems != null)||(strItems.length > 0)) - { - String strLootToMake = strItems[rand(0, strItems.length-1)]; - - createLootItem(objContainer, strLootToMake, intLevel); - boolMadeLoot = true; - } - else - { - - } - } - } - - if (strRequiredItems != null && strRequiredItems.length > 0) - { - for (int intI = 0; intI-1) - { - - obj_id lootItem = createObject(strLootToMake, objContainer, ""); - - int got = getGameObjectType(lootItem); - if (isGameObjectTypeOf(got, GOT_clothing) || (got == GOT_armor_foot) || (got == GOT_armor_hand)) - { - hue.hueObject(lootItem); - } - if (isGameObjectTypeOf (got, GOT_weapon)) - { - - randomizeWeapon(lootItem, intLevel); - } - - if (got >= GOT_armor && got <= GOT_armor_arm) - { - - randomizeArmor(lootItem, intLevel); - } - - if (got == GOT_misc_pharmaceutical) - { - - randomizeMedicine(lootItem, intLevel); - } - - if ((got >= GOT_component && got <= GOT_component_weapon_ranged) || (got >= GOT_armor_layer && got <= GOT_armor_core) ||(got == GOT_component_new_armor)) - { - randomizeComponent(lootItem, intLevel, objContainer); - } - - if (utils.hasScriptVar(objContainer, "theft_in_progress")) - { - notifyThiefOfItemStolen(objContainer, lootItem); - } - - return lootItem; - } - else if (strLootToMake.startsWith("loot_items/")) - { - String[] parseItem = split(strLootToMake, ':'); - - if (parseItem.length == 2) - { - String itemDatatable = "datatables/loot/"+parseItem[0]+".iff"; - String lootColumnHeader = parseItem[1]; - - if (!dataTableOpen(itemDatatable)) - { - - } - else - { - String[] lootList = dataTableGetStringColumnNoDefaults(itemDatatable, lootColumnHeader); - if (lootList != null && lootList.length > 0) - { - String lootItemsLoot = lootList[rand(0, lootList.length-1)]; - return createLootItem(objContainer, lootItemsLoot, intLevel); - } - else - { - - } - } - } - } - else if (strLootToMake.startsWith("dynamic_")) - { - - static_item.makeDynamicObject(strLootToMake, objContainer, intLevel); - } - else if (strLootToMake.startsWith("resource")) - { - utils.removeScriptVar(objContainer, "theft_in_progress"); - } - else - { - - obj_id lootItem = static_item.createNewItemFunction(strLootToMake, objContainer); - - if (utils.hasScriptVar(objContainer, "theft_in_progress")) - { - notifyThiefOfItemStolen(objContainer, lootItem); - } - - return lootItem; - } - - return null; - } - - - public static boolean addMilkOrEgg(obj_id objCreature) throws InterruptedException - { - if (rand(1,100) > 20) - { - return false; - } - - String mobType = ai_lib.getCreatureName(objCreature); - int niche = ai_lib.aiGetNiche(mobType); - if (niche != NICHE_NPC) - { - return false; - } - - boolean groceries = true; - String[] groceryItems = - { - "milk_domesticated", "milk_wild", "meat_egg", "meat_egg" - }; - obj_id objContainer = utils.getInventoryContainer(objCreature); - int randItem = rand(0, 3); - location here = getLocation(objCreature); - int level = getLevel(objCreature); - int amount = (int)(rand(1, 20) + (level*rand(1.0f, 2.0f) ) ); - - resource.createRandom(groceryItems[randItem], amount, here, objContainer); - - return groceries; - } - - - public static void notifyThiefOfItemStolen(obj_id objContainer, obj_id loot) throws InterruptedException - { - - if (utils.hasScriptVar(objContainer, "theft_in_progress" )) - { - - obj_id thief = getContainedBy(objContainer); - if (isPlayer(thief)) - { - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "stolen_item")); - pp = prose.setTT(pp, loot); - sendSystemMessageProse(thief, pp); - } - utils.removeScriptVar(objContainer, "theft_in_progress"); - } - - return; - } - - - public static boolean addBeastEnzymes(obj_id creature) throws InterruptedException - { - if (storyteller.isStorytellerNpc(creature)) - { - return false; - } - - int chanceSpawn = rand(1,100); - if (chanceSpawn >= BASE_CHANCE_FOR_ENZYME && !hasObjVar(creature, "qa.makeEnzyme")) - { - - return false; - } - - int type = 1; - - obj_id inv = utils.getInventoryContainer(creature); - obj_id enzyme = createObject("object/tangible/loot/beast/enzyme_"+type+".iff", inv, ""); - int level = ai_lib.getLevel(creature); - if (isIdValid(enzyme) && exists(enzyme)) - { - - setObjVar(enzyme, "beast.enzyme.level", level); - return true; - } - else - { - - return false; - } - } - - - public static boolean addCollectionLoot(obj_id target) throws InterruptedException - { - return addCollectionLoot(target, false, null); - - } - - - public static boolean addCollectionLoot(obj_id target, boolean theftBool, obj_id thief) throws InterruptedException - { - String creatureName = ai_lib.getCreatureName(target); - - int collectionLootChance = rand(1, 100); - - dictionary creatureRow = dataTableGetRow(CREATURES_TABLE, creatureName); - - int rollBaseChance = creatureRow.getInt("collectionRoll"); - - rollBaseChance *= COL_LOOT_MULTIPLIER_ON; - - if (creatureRow == null || creatureRow.isEmpty()) - { - - return false; - } - - if (collectionLootChance <= rollBaseChance) - { - - String myCollectionLoot = creatureRow.getString("collectionLoot"); - if (myCollectionLoot.equals("no_loot") || myCollectionLoot == null) - { - - return false; - } - else - { - - String[] collectionsInColumn = split(myCollectionLoot, ','); - int collectionIndex = rand(0, (collectionsInColumn.length - 1)); - myCollectionLoot = collectionsInColumn[collectionIndex]; - - String[] lootArray = dataTableGetStringColumnNoDefaults(COLLECTIONS_LOOT_TABLE, myCollectionLoot); - - int max = lootArray.length -1; - - int idx = rand(0, max); - - String lootToGrant = lootArray[idx]; - - if (theftBool) - { - if (isIdValid(thief)) - { - obj_id thiefInv = utils.getInventoryContainer(thief); - utils.setScriptVar(thiefInv, "theft_in_progress", 1); - obj_id lootItem = static_item.createNewItemFunction(lootToGrant, thiefInv); - notifyThiefOfItemStolen(thiefInv, lootItem); - return true; - } - return false; - } - - obj_id mobInv = utils.getInventoryContainer(target); - obj_id lootItem = static_item.createNewItemFunction(lootToGrant, mobInv); - - if (isIdValid(lootItem) && exists(lootItem)) - { - - CustomerServiceLog("CollectionLootChannel: ", "LootSuccessful: "+ creatureName + "("+ target + ")"+ " successfully dropped: "+ lootToGrant + "("+ lootItem + ")"); - return true; - } - else - { - CustomerServiceLog("CollectionLootChannel: ", "BrokenLoot: "+ creatureName + "("+ target + ")"+ " is having an issue dropping: "+ lootToGrant + " Invalid ID or Does not exist."); - - return false; - } - } - } - else if (collectionLootChance > rollBaseChance) - { - - return false; - } - else - { - - return false; - } - } - - - public static String getFactionalCollectionItem(String faction) throws InterruptedException - { - blog("getFactionalCollectionItem - arrival in function. Faction of winner is: "+faction); - - if (faction == null || faction.equals("")) - { - return null; - } - - blog("getFactionalCollectionItem - Faction check 1: "+faction+"*"); - - if (!faction.equals("Rebel") && !faction.equals("Imperial")) - { - return null; - } - - blog("getFactionalCollectionItem - Faction check 2"); - - Vector factionCols = new Vector(); - factionCols.setSize(0); - int randColInt = 0; - String randColStr = ""; - - String[] allLootColumns = dataTableGetColumnNames(COLLECTIONS_PVP_LOOT_TABLE); - if (allLootColumns == null || allLootColumns.length <= 0) - { - return null; - } - - blog("getFactionalCollectionItem - allLootColumns.length: "+allLootColumns.length); - - for (int i = 0; i < allLootColumns.length; i++) - { - testAbortScript(); - if (allLootColumns[i].startsWith(toLower(faction))) - { - blog("getFactionalCollectionItem - found a column I am adding to col list"); - utils.addElement(factionCols, allLootColumns[i]); - } - } - blog("getFactionalCollectionItem - factionCols.length: "+factionCols.size()); - if (factionCols.size() <= 0) - { - return null; - } - - if (factionCols.size() == 1) - { - blog("getFactionalCollectionItem - randColStr: "+((String)(factionCols.get(randColInt)))); - randColStr = ((String)(factionCols.get(randColInt))); - } - else - { - randColInt = rand(0, factionCols.size()-1); - blog("getFactionalCollectionItem - randColInt: "+randColInt); - - randColStr = ((String)(factionCols.get(randColInt))); - blog("getFactionalCollectionItem - randColStr: "+randColStr); - } - if (randColStr == null || randColStr.equals("")) - { - return null; - } - - String[] colLoot = dataTableGetStringColumnNoDefaults(COLLECTIONS_PVP_LOOT_TABLE, randColStr); - if (colLoot == null || colLoot.length <= 0) - { - return null; - } - - blog("getFactionalCollectionItem - colLoot.length: "+colLoot.length); - - if (colLoot.length == 1) - { - return colLoot[0]; - } - int randLootInt = rand(0, colLoot.length-1); - blog("getFactionalCollectionItem - randLootInt: "+randLootInt); - blog("getFactionalCollectionItem - RETURNING: "+colLoot[randLootInt]); - - return colLoot[randLootInt]; - } - - - public static String getAppropriatePvpRankCollectible(String faction, int rank) throws InterruptedException - { - blog("getAppropriatePvpRankCollectible - arrival in function. Faction: "+faction+" rank: "+rank); - - if (faction == null || faction.equals("")) - { - return null; - } - - blog("getAppropriatePvpRankCollectible - Faction checked 1: "+faction+"*"); - - if (!faction.equals("Rebel") && !faction.equals("Imperial")) - { - return null; - } - - blog("getAppropriatePvpRankCollectible - Faction checked 2"); - - if (rank < 6 || rank > 12) - { - return null; - } - - blog("getFactionalCollectionItem - faction: "+faction); - blog("getFactionalCollectionItem - faction: "+rank); - Vector pvpCols = new Vector(); - pvpCols.setSize(0); - int randColInt = 0; - String randColStr = ""; - - String[] allLootColumns = dataTableGetColumnNames(COLLECTIONS_PVP_RANK_TABLE); - if (allLootColumns == null || allLootColumns.length <= 0) - { - return null; - } - - blog("getFactionalCollectionItem - allLootColumns.length: "+allLootColumns.length); - - for (int i = 0; i < allLootColumns.length; i++) - { - testAbortScript(); - if (allLootColumns[i].startsWith(toLower(faction))) - { - blog("getFactionalCollectionItem - found a column I wanted: "); - utils.addElement(pvpCols, allLootColumns[i]); - } - } - if (pvpCols.size() <= 0) - { - return null; - } - - blog("getFactionalCollectionItem - pvpCols.length: "+pvpCols.size()); - - if (pvpCols.size() == 1) - { - randColStr = ((String)(pvpCols.get(randColInt))); - } - else - { - randColInt = rand(0, pvpCols.size()-1); - randColStr = ((String)(pvpCols.get(randColInt))); - } - blog("getFactionalCollectionItem - pvpCols[randColInt]: "+((String)(pvpCols.get(randColInt)))); - blog("getFactionalCollectionItem - randColStr: "+randColStr); - - switch(rank) - { - - case 7: - return dataTableGetString(COLLECTIONS_PVP_RANK_TABLE, 0, randColStr); - case 8: - return dataTableGetString(COLLECTIONS_PVP_RANK_TABLE, 1, randColStr); - case 9: - return dataTableGetString(COLLECTIONS_PVP_RANK_TABLE, 2, randColStr); - case 10: - return dataTableGetString(COLLECTIONS_PVP_RANK_TABLE, 3, randColStr); - case 11: - return dataTableGetString(COLLECTIONS_PVP_RANK_TABLE, 4, randColStr); - case 12: - return dataTableGetString(COLLECTIONS_PVP_RANK_TABLE, 5, randColStr); - default: - return null; - } - } - - - public static boolean rollRandomFactionalCollectible(obj_id victim, obj_id winner, int victimRank) throws InterruptedException - { - blog("rollRandomFactionalCollectible - arrival in rollRandomFactionalCollectible function"); - - if (isIdNull(winner) || isIdNull(victim)) - { - return false; - } - - if (victimRank <= 0) - { - return false; - } - - blog("rollRandomFactionalCollectible - about to roll."); - - int roll = rand(1,100); - int rollNeeded = COLLECTION_PVP_ROLL; - if (isGod(winner)) - { - rollNeeded = 101; - } - - if (roll <= rollNeeded) - { - return false; - } - - blog("rollRandomFactionalCollectible - won roll."); - - int rewardFunction = 1; - if (victimRank > 6) - { - - rewardFunction = rand(1,2); - blog("rollRandomFactionalCollectible - victim is officer."); - } - - String faction = factions.getFaction(victim); - String rewardItem = ""; - - switch(rewardFunction) - { - case 1: - blog("rollRandomFactionalCollectible - send to getFactionalCollectionItem."); - rewardItem = getFactionalCollectionItem(faction); - break; - case 2: - blog("rollRandomFactionalCollectible - send to getAppropriatePvpRankCollectible."); - rewardItem = getAppropriatePvpRankCollectible(faction, victimRank); - break; - } - - if (rewardItem == null || rewardItem.equals("")) - { - blog("rollRandomFactionalCollectible - reward function returned a NULL."); - return false; - } - blog("rollRandomFactionalCollectible - grant reward."); - grantFactionalCollectible(winner, rewardItem); - return true; - } - - - public static boolean grantFactionalCollectible(obj_id winner, String staticItem) throws InterruptedException - { - blog("grantFactionalCollectible - arrival in grantFactionalCollectible function"); - if (isIdNull(winner)) - { - return false; - } - - if (staticItem == null || staticItem.equals("")) - { - return false; - } - - if (!static_item.isStaticItem(staticItem)) - { - return false; - } - - obj_id pInv = utils.getInventoryContainer(winner); - obj_id itemId = static_item.createNewItemFunction(staticItem, pInv); - if (!isValidId(itemId) || !exists(itemId)) - { - blog("grantFactionalCollectible - FAILED TO CREATE ITEM IN INVENTORY."); - CustomerServiceLog("CollectionLootChannel", "Player "+ getFirstName(winner) + "("+ winner + ") has failed to receive item: "+ staticItem + "."); - return false; - } - - Vector items = new Vector(); - items.setSize(0); - utils.addElement(items, itemId); - - blog("grantFactionalCollectible - SUCCESS, creating item in inventory."); - - prose_package pp = new prose_package(); - prose.setStringId(pp, SID_REWARD_ITEM); - prose.setTT(pp, new string_id("static_item_n", getStaticItemName(itemId))); - sendSystemMessageProse(winner, pp); - CustomerServiceLog("CollectionLootChannel", "Player "+ getFirstName(winner) + "("+ winner + ") has received item: "+ staticItem + "."); - - return true; - } - - - public static obj_id addMeatlumpLumpsAsLoot(obj_id target, obj_id targetInventory, int cash) throws InterruptedException - { - if (!isValidId(target) || !exists(target)) - { - return null; - } - else if (!isValidId(targetInventory) || !exists(targetInventory)) - { - return null; - } - else if (cash < 1) - { - return null; - } - - obj_id inv = utils.getInventoryContainer(target); - if (inv == null) - { - return null; - } - - obj_id cashItem = static_item.createNewItemFunction(MEATLUMP_LUMP, inv); - if (!isIdValid(cashItem)) - { - return null; - } - - incrementCount(cashItem, cash); - return cashItem; - } - - - public static boolean giveMeatlumpPuzzleLoot(obj_id player, boolean puzzleThreshold, boolean puzzleBuff) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - obj_id pInv = utils.getInventoryContainer(player); - if (!isValidId(pInv) || !exists(pInv)) - { - return false; - } - - boolean luckyPlayer = luck.isLucky(player, 0.01f); - - int lumpAmount = rand(0,2); - blog("giveMeatlumpPuzzleLoot - lumpAmount: "+lumpAmount); - - if (luckyPlayer) - { - int lumpRoll = rand(0,100); - if (lumpRoll < 51) - { - lumpAmount++; - } - else if (lumpRoll > 51 && lumpRoll < 90) - { - lumpAmount += 2; - } - else - { - lumpAmount += 3; - } - } - - Vector items = new Vector(); - items.setSize(0); - - blog("giveMeatlumpPuzzleLoot - lucky player lumpAmount: "+lumpAmount); - if (lumpAmount > 0) - { - obj_id lumpsReceived = addMeatlumpLumpsAsLoot(player, pInv, lumpAmount); - blog("giveMeatlumpPuzzleLoot - lumpsReceived: "+lumpsReceived); - if (lumpsReceived == null) - { - return false; - } - - utils.addElement(items, lumpsReceived); - - } - - int lootItemAmount = rand(1,3); - if (rand(0,100) > 99) - { - lootItemAmount += rand(0,1); - } - if (luckyPlayer) - { - lootItemAmount += rand(0,1); - } - else if (puzzleThreshold) - { - if (rand(0,100) > 95) - { - lootItemAmount += rand(0,1); - } - else if (puzzleBuff) - { - lootItemAmount += rand(0,1); - } - - } - for (int i = 0; i < lootItemAmount; i++) - { - testAbortScript(); - int cols = 1; - int randCol = rand(0,100); - if (randCol > 71 && randCol < 90) - { - cols = 3; - } - else if (randCol > 91) - { - cols = 5; - } - blog("giveMeatlumpPuzzleLoot - randCols: "+randCol); - blog("giveMeatlumpPuzzleLoot - TOTAL cols: "+cols); - String[] strLootItems = dataTableGetStringColumnNoDefaults(MEATLUMP_LOOT_TABLE, rand(0,cols)); - if ((strLootItems == null)||(strLootItems.length < 0)) - { - return false; - } - blog("giveMeatlumpPuzzleLoot - strLootItems.length: "+strLootItems.length); - - blog("giveMeatlumpPuzzleLoot - strLootItems.length: "+strLootItems.length); - - String strLootToMake = strLootItems[rand(0, strLootItems.length-1)]; - if (strLootToMake == null || strLootToMake.equals("")) - { - return false; - } - - blog("giveMeatlumpPuzzleLoot - strLootToMake: "+strLootToMake); - - obj_id lootItem = createLootItem(pInv, strLootToMake, 0); - if (!isValidId(lootItem)) - { - return false; - } - utils.addElement(items, lootItem); - - blog("giveMeatlumpPuzzleLoot - createLootItem success"); - - } - blog("giveMeatlumpPuzzleLoot - items.size(): "+items.size()); - obj_id[] finalLootList = new obj_id[items.size()]; - items.toArray(finalLootList); - showLootBox(player, finalLootList); - - return true; - } - - - public static boolean playerForaging(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - CustomerServiceLog("foraging", "Foraging System could not complete because player OID: "+player+ " is invalid or no longer exists."); - return false; - } - - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " is about to start foraging rolls."); - - obj_id pInv = utils.getInventoryContainer(player); - if (!isValidId(pInv) || !exists(pInv)) - { - CustomerServiceLog("foraging", "Foraging System could not find inventory for player OID: "+player+ ". Inventory container is invalid or no longer exists."); - return false; - } - - if (getVolumeFree(pInv) <= 0) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has a full inventory, foraging rolls aborted."); - sendSystemMessage(player, SID_FULL_INVENTORY); - return false; - } - - location curLoc = getLocation(player); - - String scene = getCurrentSceneName(); - forage_blog("scene: "+ scene); - - Vector newListOfLocs = new Vector(); - newListOfLocs.setSize(0); - - int something = 50; - int nothing = 50; - - int somethingMod = 0; - int lootMod = 0; - - String bonusMessage = ""; - - if (buff.hasBuff(player, "bm_truffle_pig")) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has buff bm_truffle_pig and is receiving bonus to avoid getting nothing during forage session."); - - float trufflePigVal = buff.getEffectValue("bm_truffle_pig", 2); - bonusMessage += " Pet"; - forage_blog("playerForaging: bm_truffle_pig increased somethingMod from: "+somethingMod+ " to: "+ (somethingMod+trufflePigVal)); - somethingMod += (int)trufflePigVal; - } - if (buff.hasBuff(player, "ice_cream_forage_buff")) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has buff ice_cream_forage_buff and is receiving bonus to avoid getting nothing during forage session."); - - float iceCreamVal = buff.getEffectValue("ice_cream_forage_buff", 2); - if (bonusMessage.equals("")) - { - bonusMessage += " Ice Cream"; - } - else - { - bonusMessage += ", Ice Cream"; - } - - forage_blog("playerForaging: ice_cream_forage_buff increased somethingMod from: "+somethingMod+ " to: "+ (somethingMod+iceCreamVal)); - somethingMod += (int)iceCreamVal; - } - if (buff.hasBuff(player, "treasure_forage")) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has buff treasure_forage and is receiving bonus to avoid getting nothing during forage session."); - - float treasureVal = buff.getEffectValue("treasure_forage", 1); - if (bonusMessage.equals("")) - { - bonusMessage += " Kommerken Steak"; - } - else - { - bonusMessage += ", Kommerken Steak"; - } - - forage_blog("playerForaging: treasure_forage increased somethingMod from: "+somethingMod+ " to: "+ (somethingMod+treasureVal)); - somethingMod += (int)treasureVal; - } - boolean isLuckyPlayer = luck.isLucky(player, 0.10f); - if (isLuckyPlayer) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " got really lucking and is receiving bonus to avoid getting nothing during forage session."); - if (bonusMessage.equals("")) - { - bonusMessage += " Luck"; - } - else - { - bonusMessage += ", Luck"; - } - - forage_blog("playerForaging: isLuckyPlayer increased somethingMod from: "+somethingMod+ " to: "+ (somethingMod+LUCKY_FIND_MODIFIER)); - somethingMod += (int)LUCKY_FIND_MODIFIER; - } - - if (!bonusMessage.equals("")) - { - prose_package pp = new prose_package(); - string_id msg = new string_id (FORAGING_STF, "forage_bonus_mesage"); - pp = prose.setStringId(pp, msg); - pp = prose.setTO(pp, bonusMessage); - sendSystemMessageProse (player, pp); - } - - if (somethingMod > 0) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has one or more buffs and/or luck modifiers. The forage system is modifying the players chance of receiving nothing."); - - nothing -= somethingMod; - if (nothing < 0) - { - nothing = 0; - } - something += somethingMod; - if (something > 100) - { - something = 100; - } - forage_blog("playerForaging: Nothing: "+nothing); - forage_blog("playerForaging: Something: "+something); - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has a "+nothing+"% chance of receiving nothing within the foraging system."); - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has a "+something+"% chance of receiving something within the foraging system."); - } - - int initialRoll = rand(1,100); - if (initialRoll <= 0) - { - initialRoll = 0; - } - - forage_blog("playerForaging: initialRoll: "+initialRoll); - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has rolled a "+initialRoll+". If this number is less than "+nothing+" the player gets nothing from the foraging system."); - - if (initialRoll <= nothing) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has rolled a "+initialRoll+" and gets nothing from the foraging system."); - forage_blog("YOU ROLLED: "+ initialRoll + " on initial roll and get nothing. You needed to get higher than: "+nothing); - - sendSystemMessage(player, FOUND_NOTHING); - - saveForageLocationOnPlayer(player, newListOfLocs, curLoc); - return true; - } - - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has rolled a "+initialRoll+" and gets some yet to be determined item from the foraging system."); - forage_blog("playerForaging: YOU GET SOMETHING"); - - int enzymeMod = 0; - int treasMod = 0; - String buffMsg = ""; - - if (buff.hasBuff(player,"bm_truffle_pig")) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has the bm_truffle_pig buff and will receive an extra roll for ENZYMES within the foraging system."); - float enzymeBuff = buff.getEffectValue("bm_truffle_pig", 3); - forage_blog("playerForaging: bm_truffle_pig increased enzymeMod score from: "+enzymeMod+ " to: "+ (enzymeMod+enzymeBuff)); - enzymeMod += (int)enzymeBuff; - - } - - if (buff.hasBuff(player, "treasure_forage")) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has the treasure_forage buff and will receive an extra roll for TREASURE MAPS within the foraging system."); - - float treasureValMap = buff.getEffectValue("treasure_forage", 2); - treasMod += (int)treasureValMap; - - } - - boolean buffRoll = false; - - if (enzymeMod > 0) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " is NOW receiving their extra roll for ENZYMES within the foraging system."); - - forage_blog("Player receives extra roll because of buffs for: enzyme"); - buffMsg += " Plant Enzymes"; - int enzymRoll = rand(1,100); - if (enzymRoll <= 0) - { - enzymRoll = 0; - } - - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " rolled "+enzymRoll+". If this number is less than, or equal to "+enzymeMod+", the player will get an enzyme."); - - if (enzymRoll <= enzymeMod) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " rolled "+enzymRoll+" and received an enzyme."); - - forage_blog("rareObject reward: enzyme"); - obj_id enzyme = createObject("object/tangible/loot/beast/enzyme_2.iff", pInv, ""); - sendSystemMessage(player, FOUND_ENZYME); - saveForageLocationOnPlayer(player, newListOfLocs, curLoc); - buffRoll = true; - } - } - - if (treasMod > 0) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " is NOW receiving their extra roll for TREASURE MAPS within the foraging system."); - - forage_blog("Player receives extra roll because of buffs for: treasure map"); - if (buffMsg.equals("")) - { - buffMsg += " Treasure Map"; - } - else - { - buffMsg += ", Treasure Map"; - } - - int treasureRoll = rand(1,100); - if (treasureRoll <= 0) - { - treasureRoll = 0; - } - - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " rolled "+treasureRoll+". If this number is less than, or equal to "+treasMod+", the player will get an enzyme."); - - if (treasureRoll <= treasMod) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " rolled "+treasureRoll+" and received a treasure map."); - - forage_blog("rareObject reward: treasure"); - boolean objectReceived = loot.getRareForagedTreasureMap(player, pInv); - sendSystemMessage(player, FOUND_TREASURE); - saveForageLocationOnPlayer(player, newListOfLocs, curLoc); - buffRoll = true; - } - } - - if (!buffMsg.equals("")) - { - prose_package pp = new prose_package(); - string_id msg = new string_id (FORAGING_STF, "forage_buff_roll_mesage"); - pp = prose.setStringId(pp, msg); - pp = prose.setTO(pp, buffMsg); - sendSystemMessageProse (player, pp); - } - - if (buffRoll) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has received either an ENZYME AND/OR a TREASURE MAP because of their buffs. The forage system is now exiting."); - return true; - } - - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has not received an enzyme or treasure map as a result of a buf so we will continue through the forage system."); - forage_blog("Player moves on to get basic rolls"); - - int enzLow = dataTableGetInt(FORAGING_LOOT_ROLL_TABLE, LOOT_ENZYME, LOOT_LOW_COL); - int enzHigh = dataTableGetInt(FORAGING_LOOT_ROLL_TABLE, LOOT_ENZYME, LOOT_HIGH_COL); - - int compLow = dataTableGetInt(FORAGING_LOOT_ROLL_TABLE, LOOT_COMPONENT, LOOT_LOW_COL); - int compHigh = dataTableGetInt(FORAGING_LOOT_ROLL_TABLE, LOOT_COMPONENT, LOOT_HIGH_COL); - - int wormLow = dataTableGetInt(FORAGING_LOOT_ROLL_TABLE, LOOT_WORM, LOOT_LOW_COL); - int wormHigh = dataTableGetInt(FORAGING_LOOT_ROLL_TABLE, LOOT_WORM, LOOT_HIGH_COL); - - int baitLow = dataTableGetInt(FORAGING_LOOT_ROLL_TABLE, LOOT_BAIT, LOOT_LOW_COL); - int baitHigh = dataTableGetInt(FORAGING_LOOT_ROLL_TABLE, LOOT_BAIT, LOOT_HIGH_COL); - - int treasLow = dataTableGetInt(FORAGING_LOOT_ROLL_TABLE, LOOT_TREASURE, LOOT_LOW_COL); - int treasHigh = dataTableGetInt(FORAGING_LOOT_ROLL_TABLE, LOOT_TREASURE, LOOT_HIGH_COL); - - if ((enzLow < 0 || enzHigh < 0 || compLow < 0 || compHigh < 0 || wormLow < 0 || wormHigh < 0 || baitLow < 0 || baitHigh < 0 || treasLow < 0 || treasHigh < 0)) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has corrupted data for one or more of the foraging data. Contact development."); - return false; - } - - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " will receive an enzyme if they roll between "+enzLow+" and "+enzHigh+"."); - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " will receive a component (ice cream fryer food) if they roll between "+compLow+" and "+compHigh+"."); - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " will receive a worm or theif enemy if they roll between "+wormLow+" and "+wormHigh+"."); - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " will receive a bait or bugs if they roll between "+baitLow+" and "+baitHigh+"."); - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " will receive a treasure map if they roll between "+treasLow+" and "+treasHigh+"."); - - int lootRoll = rand(1,100); - if (lootRoll <= 0) - { - lootRoll = 0; - } - - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " rolled "+lootRoll+". The system will now attempt to reward the player with the specific item won."); - - forage_blog("YOU ROLLED: "+lootRoll); - - if (lootRoll >= enzLow && lootRoll <= enzHigh) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " rolled "+lootRoll+" and has received an ENZYME."); - - forage_blog("rareObject reward: enzyme"); - obj_id enzyme = createObject("object/tangible/loot/beast/enzyme_2.iff", pInv, ""); - sendSystemMessage(player, FOUND_ENZYME); - } - else if (lootRoll >= compLow && lootRoll <= compHigh) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " rolled "+lootRoll+" and has received a COMPONENT."); - - forage_blog("rareObject reward: component"); - giveForagedCollectionObject(player, pInv, scene); - sendSystemMessage(player, FOUND_COMPONENT); - } - else if (lootRoll >= wormLow && lootRoll <= wormHigh) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " rolled "+lootRoll+" and has received a WORM/THEIF ENEMY."); - - forage_blog("rareObject reward: worm"); - - int mobLevel = getLevel(player); - String invis = stealth.getInvisBuff(player); - if (invis != null) - { - stealth.checkForAndMakeVisibleNoRecourse(player); - } - - String[] enemyList = dataTableGetStringColumnNoDefaults(FORAGING_ENEMY_TABLE, "enemy"); - int idx = rand(0, (enemyList.length-1)); - - obj_id mob = create.object(enemyList[idx], curLoc, mobLevel); - setObjVar(mob, "player", player); - attachScript(mob, FORAGE_ENEMY_SCRIPT); - sendSystemMessage(player, FOUND_WORM); - } - else if (lootRoll >= treasLow && lootRoll <= treasHigh) - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " rolled "+lootRoll+" and has received a TREASURE MAP."); - - forage_blog("rareObject reward: treasure map"); - loot.getRareForagedTreasureMap(player, pInv); - sendSystemMessage(player, FOUND_TREASURE); - } - else - { - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " rolled "+lootRoll+" and has received BAIT."); - - forage_blog("reward: bait"); - - String[] bait = dataTableGetStringColumnNoDefaults(FORAGING_RARE_TABLE, "ITEM_TANGIBLE"); - - int itemIndex = rand(0, (bait.length-1)); - - forage_blog("Won BAIT: object/tangible/bait"+itemIndex); - createObjectOverloaded("object/tangible/"+bait[itemIndex], pInv); - - sendSystemMessage(player, FOUND_SOMETHING); - } - - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " should have received a reward object. The forage location will be stored and the forage session will be completed."); - - saveForageLocationOnPlayer(player, newListOfLocs, curLoc); - return true; - } - - - public static int getRandomRareForagedLoot(obj_id self, int enzymeChance, int wormChance, int treasureMapChance, int componentChance) throws InterruptedException - { - forage_blog("getRandomRareForagedLoot init"); - forage_blog("getRandomRareForagedLoot:treasureMapChance: "+treasureMapChance); - - Vector rareItemList = new Vector(); - rareItemList.setSize(0); - utils.addElement(rareItemList, ENZYME); - utils.addElement(rareItemList, WORM); - utils.addElement(rareItemList, TREASURE); - utils.addElement(rareItemList, COMPONENT); - - forage_blog("getRandomRareForagedLoot:treasureMapChance: "+treasureMapChance); - if (enzymeChance > 0) - { - int division = enzymeChance / RARE_COMPONENT_DIVISOR; - for (int i = 0; i < division; ++i) - { - testAbortScript(); - utils.addElement(rareItemList, ENZYME); - } - } - if (wormChance > 0) - { - int division = wormChance / RARE_COMPONENT_DIVISOR; - for (int i = 0; i < division; ++i) - { - testAbortScript(); - utils.addElement(rareItemList, WORM); - } - } - if (treasureMapChance > 0) - { - int division = treasureMapChance / SUPER_RARE_COMPONENT_DIVISOR; - for (int i = 0; i < division; ++i) - { - testAbortScript(); - utils.addElement(rareItemList, TREASURE); - } - } - if (componentChance > 0) - { - int division = componentChance / RARE_COMPONENT_DIVISOR; - for (int i = 0; i < division; ++i) - { - testAbortScript(); - utils.addElement(rareItemList, COMPONENT); - } - } - int listSize = rareItemList.size(); - forage_blog("rareItemList.size(): "+ listSize); - - int randNum = rand(0,listSize-1); - forage_blog("randNum: "+ randNum); - forage_blog("Random return: "+ ((Integer)(rareItemList.get(randNum))).intValue()); - - CustomerServiceLog("foraging", "Player: "+getName(self)+" OID: "+self+ "rolled against a foraging rare item list and received rare loot item category: "+((Integer)(rareItemList.get(randNum))).intValue()); - - forage_blog("getRandomRareForagedLoot do we have the scriptvar: "+utils.hasScriptVar(self, "qa.give_forage_data")); - - if (utils.hasScriptVar(self, "qa.give_forage_data") && isGod(self)) - { - String strForageFeedBack = utils.getStringScriptVar(self, "qa.strForageFeedBack"); - strForageFeedBack += "Categories: Enzyme = 0, Worm/Thief = 1, Component = 2, Treasure Map = 3\n\r"; - strForageFeedBack += "Rare Item List Length: "+ listSize+"\n\r"; - for (int i =0; i < listSize; ++i) - { - testAbortScript(); - strForageFeedBack += "Rare Item Number "+i+" is category: "+ ((Integer)(rareItemList.get(i))).intValue()+"\n\r"; - } - strForageFeedBack += "Winning Item Category: "+ ((Integer)(rareItemList.get(randNum))).intValue()+"\n\r\n\r"; - - strForageFeedBack += "Check Constants - The values should never change.\n\r"; - strForageFeedBack += "DEFAULT_ENZYME_CHANCE: (40) "+DEFAULT_ENZYME_CHANCE+"\n\r"; - strForageFeedBack += "DEFAULT_WORM_CHANCE: (40) "+DEFAULT_WORM_CHANCE+"\n\r"; - strForageFeedBack += "DEFAULT_TREASURE_CHANCE: (0) "+DEFAULT_TREASURE_CHANCE+"\n\r"; - strForageFeedBack += "DEFAULT_COMPONENT_CHANCE: (40) "+DEFAULT_COMPONENT_CHANCE+"\n\r"; - strForageFeedBack += "ENZYME_MODIFIER: (0) "+ENZYME_MODIFIER+"\n\r"; - strForageFeedBack += "TREASURE_MODIFIER: (0) "+TREASURE_MODIFIER+"\n\r"; - strForageFeedBack += "PLAYER_DEFAULT_FIND_MODIFIER: (0) "+PLAYER_DEFAULT_FIND_MODIFIER+"\n\r"; - strForageFeedBack += "LUCKY_FIND_MODIFIER: (6) "+LUCKY_FIND_MODIFIER+"\n\r"; - - utils.setScriptVar(self, "qa.strForageFeedBack", strForageFeedBack); - utils.setScriptVar(self, "qa.strForageFeedBackCategory", ((Integer)(rareItemList.get(randNum))).intValue()); - } - return ((Integer)(rareItemList.get(randNum))).intValue(); - } - - - public static boolean getRareForagedTreasureMap(obj_id player, obj_id pInv) throws InterruptedException - { - forage_blog("getRareForagedTreasureMap init"); - if (!isIdValid(player) || !exists(player)) - { - return false; - } - else if (!isIdValid(pInv) || !exists(pInv)) - { - return false; - } - - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " is rolling for a treasure map."); - - forage_blog("getRareForagedTreasureMap - rareObject reward: treasure map"); - String treasureMap = getPlayerTreasureMapString(player); - if (treasureMap != null && !treasureMap.equals("")) - { - static_item.createNewItemFunction(treasureMap, pInv); - } - else - { - forage_blog("getRareForagedTreasureMap - rareObject reward ERROR: treasure map level not found"); - static_item.createNewItemFunction("item_treasure_map_1_10", pInv); - } - CustomerServiceLog("foraging", "Player: "+getName(player)+" OID: "+player+ " has won treasure map: "+treasureMap); - forage_blog("getRareForagedTreasureMap do we have the scriptvar: "+utils.hasScriptVar(player, "qa.give_forage_data")); - - return true; - } - - - public static String getPlayerTreasureMapString(obj_id player) throws InterruptedException - { - if (!isValidId(player)) - { - return null; - } - - int playerLvl = getLevel(player); - - if (playerLvl <= 0) - { - return null; - } - - String mapPrefix = "item_treasure_map_"; - String mapAppend = "1_10"; - - if (playerLvl >= 81 && playerLvl <= 90) - { - mapAppend = "81_90"; - } - else if (playerLvl >= 71 && playerLvl <= 80) - { - mapAppend = "71_80"; - } - else if (playerLvl >= 61 && playerLvl <= 70) - { - mapAppend = "61_70"; - } - else if (playerLvl >= 51 && playerLvl <= 60) - { - mapAppend = "51_60"; - } - else if (playerLvl >= 41 && playerLvl <= 50) - { - mapAppend = "41_50"; - } - else if (playerLvl >= 31 && playerLvl <= 40) - { - mapAppend = "31_40"; - } - else if (playerLvl >= 21 && playerLvl <= 30) - { - mapAppend = "21_30"; - } - else if (playerLvl >= 11 && playerLvl <= 20) - { - mapAppend = "11_20"; - } - - return mapPrefix + mapAppend; - } - - - public static boolean giveForagedCollectionObject(obj_id self, obj_id pInv, String scene) throws InterruptedException - { - if (!isIdValid(self)) - { - return false; - } - if ((scene == null) || scene.equals("")) - { - return false; - } - - forage_blog("rareObject reward: IN giveCollectionObject"); - forage_blog("rareObject reward: scene: "+scene); - boolean componentPlanet = false; - for (int i =0; i < COMPONENT_PLANETS.length; ++i) - { - testAbortScript(); - if (scene.startsWith(COMPONENT_PLANETS[i])) - { - componentPlanet = true; - break; - } - } - if (!componentPlanet) - { - sendSystemMessage(self, FOUND_NOTHING); - return false; - } - - String[] component = dataTableGetStringColumnNoDefaults(FORAGING_RARE_TABLE, scene); - if ((component == null) || (component.length < 0)) - { - return false; - } - - forage_blog("rareObject reward: IN giveCollectionObject"); - - int itemIndex = rand(0, (component.length-1)); - forage_blog("rareObject reward: IN giveCollectionObject - itemIndex: "+itemIndex); - - String objTemplate = dataTableGetString(FORAGING_RARE_TABLE, itemIndex, scene); - forage_blog("rareObject reward: IN giveCollectionObject - objTemplate: "+objTemplate); - - createObjectOverloaded(objTemplate, pInv); - return true; - } - - - public static boolean saveForageLocationOnPlayer(obj_id self, Vector newListOfLocs, location curLoc) throws InterruptedException - { - if (utils.hasScriptVar(self, "forage.listOfAlreadyForagedLocs")) - { - location[] oldListOfLocs = utils.getLocationArrayScriptVar(self, "forage.listOfAlreadyForagedLocs"); - - for (int i =0; i < oldListOfLocs.length; ++i) - { - testAbortScript(); - utils.addElement(newListOfLocs, oldListOfLocs[i]); - } - } - - utils.addElement(newListOfLocs, curLoc); - - utils.setScriptVar(self, "forage.listOfAlreadyForagedLocs", newListOfLocs); - - utils.setScriptVar(self, "forage.lastLocation", curLoc); - - return true; - } - - - public static boolean logForageData(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - int loopSeed = 1; - if (utils.hasScriptVar(player, "qa.loopseed")) - { - loopSeed = utils.getIntScriptVar(player, "qa.loopseed"); - } - - String strForageFeedBackLog = utils.getStringScriptVar(player, "qa.strForageFeedBack"); - if (strForageFeedBackLog == null || strForageFeedBackLog.equals("")) - { - sendSystemMessageTestingOnly(player, "The log was blank"); - return false; - } - - int strForageFeedBackCategoryLog = utils.getIntScriptVar(player, "qa.strForageFeedBackCategory"); - if (strForageFeedBackCategoryLog < 0) - { - sendSystemMessageTestingOnly(player, "The Category Number was invalid"); - return false; - } - String categoryName = ""; - - switch(strForageFeedBackCategoryLog) - { - case loot.ENZYME: - categoryName = "ENZYME"; - break; - case loot.WORM: - categoryName = "WORMTHIEF"; - break; - case loot.COMPONENT: - categoryName = "COMPONENT"; - break; - case loot.TREASURE: - categoryName = "TREASURE"+getPlayerTreasureMapString(player); - break; - case loot.BAIT: - categoryName = "BAIT"; - break; - case loot.NOTHING: - categoryName = "NOTHING"; - break; - default: - categoryName = "ERROR"; - break; - } - if (categoryName == null || categoryName.equals("")) - { - sendSystemMessageTestingOnly(player, "The Category Name was blank"); - return false; - } - - int number = getGameTime() + loopSeed+ rand(1,100) + rand(1,100); - - String title = ""; - title = "foraged"+ categoryName + number; - if (title == null || title.equals("")) - { - sendSystemMessageTestingOnly(player, "The title was blank"); - return false; - } - - loopSeed++; - utils.setScriptVar(player, "qa.loopseed", loopSeed); - - saveTextOnClient(player, title+".txt", strForageFeedBackLog); - return true; - } - - - public static boolean blog(String msg) throws InterruptedException - { - LOG("minigame", msg); - return true; - } - - - public static boolean forage_blog(String msg) throws InterruptedException - { - if (FORAGE_LOGGING_ON) - { - LOG(FORAGE_LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/movement.java b/sku.0/sys.server/compiled/game/script/library/movement.java deleted file mode 100644 index 893a0b976..000000000 --- a/sku.0/sys.server/compiled/game/script/library/movement.java +++ /dev/null @@ -1,757 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; - - -public class movement extends script.base_script -{ - public movement() - { - } - public static final int MT_BOOST = 1; - public static final int MT_SNARE = 2; - public static final int MT_PERMABOOST = 3; - public static final int MT_PERMASNARE = 4; - public static final int MT_ROOT = 5; - public static final int MT_STUN = 6; - public static final int MT_MEZMERIZE = 7; - public static final int MT_ALL = 99; - - public static final String MOVEMENT_OBJVAR = "movement"; - public static final String MOVEMENT_TABLE = "datatables/movement/movement.iff"; - - - public static boolean refresh(obj_id target) throws InterruptedException - { - boolean result = false; - - if (isIdValid(target)) - { - float modifier = _recalculateMovementModifiers(target); - - if (setMovementPercent(target, modifier)) - { - result = true; - } - else - { - LOG("combat", "MOVEMENT MANAGER - ERROR: Could not set movement percent of "+ modifier + " on "+ getName(target) + " ("+ target + ")"); - } - } - - return result; - } - - - public static boolean canApplyMovementModifier(obj_id target, String name) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if (!isPlayer(target) && !isMob(target)) - { - return false; - } - - if (!isValidModifier(name)) - { - return false; - } - - if (!isPlayer(target) && !canAffectOnFoot(name)) - { - return false; - } - - if (checkForMovementImmunity(target, name)) - { - return false; - } - - if (hasMovementModifier(target, name)) - { - return false; - } - - return true; - } - - - public static boolean applyMovementModifier(obj_id target, String name) throws InterruptedException - { - return applyMovementModifier(target, name, -1.0f); - } - - - public static boolean applyMovementModifier(obj_id target, String name, float strength) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if (!isPlayer(target) && !isMob(target)) - { - return false; - } - - if (!canApplyMovementModifier(target, name)) - { - return false; - } - - boolean customStr = true; - - if (strength == -1) - { - customStr = false; - strength = getStrength(name); - } - - if (getSkillStatisticModifier(target, "expertise_movement_buff_" + name) != 0) - { - customStr = true; - strength += strength * (getSkillStatisticModifier(target, "expertise_movement_buff_"+ name) / 100.0f); - } - - utils.setScriptVar(target, MOVEMENT_OBJVAR + "."+ name + ".time", getGameTime()); - - if (customStr) - { - utils.setScriptVar(target, MOVEMENT_OBJVAR + "."+ name + ".strength", strength); - } - - final boolean result = refresh(target); - - return result; - } - - - public static boolean removeMovementModifier(obj_id target, String name) throws InterruptedException - { - return removeMovementModifier(target, name, true); - } - - - public static boolean removeMovementModifier(obj_id target, String name, boolean recalculate) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if (!isPlayer(target) && !isMob(target)) - { - return false; - } - if (!hasMovementModifier(target, name)) - { - debugSpeakMsg(target, "I have no movement modifier, thus I cannot remove one"); - return false; - } - - if (utils.hasScriptVar(target, MOVEMENT_OBJVAR + "." + name + ".time")) - { - utils.removeScriptVarTree(target, MOVEMENT_OBJVAR + "."+ name); - } - - combat.removeCombatMovementModifierEffect(target, name); - - boolean result = true; - - if (recalculate) - { - result = refresh(target); - - } - - return result; - } - - - public static boolean removeAllModifiers(obj_id target) throws InterruptedException - { - String[] mods = getAllModifiers(target); - - if (mods == null || mods.length == 0) - { - return false; - } - - for (int i = 0; i < mods.length; i++) - { - testAbortScript(); - removeMovementModifier(target, mods[i], false); - } - - return refresh(target); - } - - - public static boolean removeAllModifiersOfType(obj_id target, int type) throws InterruptedException - { - String[] mods = getAllModifiers(target); - - if (mods == null || mods.length == 0) - { - return false; - } - - boolean removed = false; - for (int i = 0; i < mods.length; i++) - { - testAbortScript(); - if (getType(mods[i])==type && buff.canBeDispelled(mods[i])) - { - removeMovementModifier(target, mods[i], false); - removed = true; - } - } - - if (removed) - { - return refresh(target); - } - else - { - return false; - } - - } - - - public static boolean hasMovementModifier(obj_id target) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - java.util.Enumeration keys = dd.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)(keys.nextElement()); - if (key.startsWith(MOVEMENT_OBJVAR + ".")) - { - return true; - } - } - - return false; - } - - - public static boolean hasMovementModifier(obj_id target, String name) throws InterruptedException - { - if (utils.hasScriptVar(target, MOVEMENT_OBJVAR + "." + name + ".time")) - { - return true; - } - - return false; - } - - - public static int getType(String name) throws InterruptedException - { - return getType(getStringCrc(name.toLowerCase())); - } - - - public static int getType(int nameCrc) throws InterruptedException - { - int row = dataTableSearchColumnForInt(nameCrc, "name", MOVEMENT_TABLE); - if (row >= 0) - { - return dataTableGetInt(MOVEMENT_TABLE, row, "type"); - } - return MT_ROOT; - } - - - public static float getStrength(String name) throws InterruptedException - { - return getStrength(getStringCrc(name.toLowerCase())); - } - - - public static float getStrength(int nameCrc) throws InterruptedException - { - int row = dataTableSearchColumnForInt(nameCrc, "name", MOVEMENT_TABLE); - if (row >= 0) - { - return dataTableGetFloat(MOVEMENT_TABLE, row, "strength"); - } - return 0; - } - - - public static float getCurrentStrength(obj_id target, String name) throws InterruptedException - { - if (hasObjVar(target, MOVEMENT_OBJVAR + "." + name + ".strength")) - { - return getFloatObjVar(target, MOVEMENT_OBJVAR + "." + name + ".strength"); - } - - if (utils.hasScriptVar(target, MOVEMENT_OBJVAR + "." + name + ".strength")) - { - return utils.getFloatScriptVar(target, MOVEMENT_OBJVAR + "." + name + ".strength"); - } - - return getStrength(name); - } - - - public static boolean isValidModifier(String name) throws InterruptedException - { - return isValidModifier(getStringCrc(name.toLowerCase())); - } - - - public static boolean isValidModifier(int nameCrc) throws InterruptedException - { - int row = dataTableSearchColumnForInt(nameCrc, "name", MOVEMENT_TABLE); - return (row >= 0); - } - - - public static boolean isRoot(String name) throws InterruptedException - { - return (isRoot(getStringCrc(name.toLowerCase())) || isStunEffect(name)); - } - - - public static boolean isRoot(int nameCrc) throws InterruptedException - { - int row = dataTableSearchColumnForInt(nameCrc, "name", MOVEMENT_TABLE); - if (row >= 0) - { - return (dataTableGetInt(MOVEMENT_TABLE, row, "type") == MT_ROOT ); - } - return false; - } - - - public static boolean isSnare(String name) throws InterruptedException - { - return isSnare(getStringCrc(name.toLowerCase())); - } - - - public static boolean isSnare(int nameCrc) throws InterruptedException - { - int row = dataTableSearchColumnForInt(nameCrc, "name", MOVEMENT_TABLE); - if (row >= 0) - { - int type = dataTableGetInt(MOVEMENT_TABLE, row, "type"); - if (type == MT_SNARE || type == MT_PERMASNARE) - { - return true; - } - } - return false; - } - - - public static boolean isPersisted(String name) throws InterruptedException - { - return isPersisted(getStringCrc(name.toLowerCase())); - } - - - public static boolean isPersisted(int nameCrc) throws InterruptedException - { - int row = dataTableSearchColumnForInt(nameCrc, "name", MOVEMENT_TABLE); - if (row >= 0) - { - return (dataTableGetInt(MOVEMENT_TABLE, row, "persistence") == 1); - } - return false; - } - - - public static boolean canAffectOnFoot(String name) throws InterruptedException - { - return canAffectOnFoot(getStringCrc(name.toLowerCase())); - } - - - public static boolean canAffectOnFoot(int nameCrc) throws InterruptedException - { - int row = dataTableSearchColumnForInt(nameCrc, "name", MOVEMENT_TABLE); - if (row >= 0) - { - return (dataTableGetInt(MOVEMENT_TABLE, row, "affects_onfoot") == 1); - } - return false; - } - - - public static boolean canAffectVehicles(String name) throws InterruptedException - { - return canAffectVehicles(getStringCrc(name.toLowerCase())); - } - - - public static boolean canAffectVehicles(int nameCrc) throws InterruptedException - { - int row = dataTableSearchColumnForInt(nameCrc, "name", MOVEMENT_TABLE); - if (row >= 0) - { - return (dataTableGetInt(MOVEMENT_TABLE, row, "affects_vehicle") == 1); - } - return false; - } - - - public static boolean canAffectMounts(String name) throws InterruptedException - { - return canAffectMounts(getStringCrc(name.toLowerCase())); - } - - - public static boolean canAffectMounts(int nameCrc) throws InterruptedException - { - int row = dataTableSearchColumnForInt(nameCrc, "name", MOVEMENT_TABLE); - if (row >= 0) - { - return (dataTableGetInt(MOVEMENT_TABLE, row, "affects_mount") == 1); - } - return false; - } - - - public static boolean isStunEffect(String name) throws InterruptedException - { - return dataTableGetInt(MOVEMENT_TABLE, name, "type") == MT_STUN; - } - - - public static boolean hasStunEffect(obj_id target) throws InterruptedException - { - String[] movementMods = getAllModifiers(target); - - if (movementMods == null || movementMods.length == 0) - { - return false; - } - - for (int i=0; i boostMod) - { - boostMod = adj; - } - break; - - case MT_SNARE: - if (adj < snareMod) - { - snareMod = adj; - } - break; - - case MT_PERMABOOST: - permaBoost += adj; - break; - - case MT_PERMASNARE: - permaSnare *= (1.0f + adj); - break; - } - } - - if (snareMod < 0.0) - { - boostMod = 0.0f; - } - - float modifier = 1.0f + permaBoost + boostMod; - - modifier = modifier * permaSnare * (1.0f + snareMod); - - if (modifier < 0.0f) - { - modifier = 0.0f; - } - - return modifier; - } - - - public static boolean checkForMovementImmunity(obj_id target, String name) throws InterruptedException - { - - int modifierType = getType(name); - - if (isPlayer(target) && !buff.canBeDispelled(name)) - { - return false; - } - - boolean resisted = false; - - int stunResist = getEnhancedSkillStatisticModifierUncapped(target, "movement_resist_stun"); - int snareResist = getEnhancedSkillStatisticModifierUncapped(target, "movement_resist_snare"); - int rootResist = getEnhancedSkillStatisticModifierUncapped(target, "movement_resist_root"); - - sendSystemMessageTestingOnly(target, "SNARE RESIST: "+snareResist); - - if (modifierType == MT_STUN) - { - if (rand(1, 99) < stunResist) - { - resisted = true; - } - } - else if (modifierType == MT_SNARE) - { - if (rand(1, 99) < snareResist) - { - resisted = true; - } - } - else if (modifierType == MT_ROOT) - { - if (rand(1, 99) < rootResist) - { - resisted = true; - } - } - - return resisted; - } - - - public static boolean testStunEffects(obj_id target) throws InterruptedException - { - boolean isStunned = hasStunEffect(target); - - setState(target, STATE_STUNNED, isStunned); - - float turnRate = isStunned ? 0.0f : 360.0f; - - return isStunned; - } - - - public static void updateMovementImmunity(obj_id target) throws InterruptedException - { - - int stunResist = getEnhancedSkillStatisticModifierUncapped(target, "movement_resist_stun"); - int snareResist = getEnhancedSkillStatisticModifierUncapped(target, "movement_resist_snare"); - int rootResist = getEnhancedSkillStatisticModifierUncapped(target, "movement_resist_root"); - sendSystemMessageTestingOnly(target,"SNARE RESIST: "+snareResist); - - dictionary dict = new dictionary(); - dict.put("self", target); - if (stunResist >= 100) - { - if (removeAllModifiersOfType(target, movement.MT_STUN)) - { - string_id cureMovementMsg = new string_id ("spam", "cure_dot"); - dict.put("detriment", "stunned"); - dict.put("msgId", cureMovementMsg); - messageTo(target, "messageDetrimentalRemoved", dict, 0.0f, false); - } - } - - if (snareResist >= 100) - { - if (removeAllModifiersOfType(target, movement.MT_SNARE)) - { - string_id cureMovementMsg = new string_id ("spam", "cure_dot"); - dict.put("detriment", "snared"); - dict.put("msgId", cureMovementMsg); - messageTo(target, "messageDetrimentalRemoved", dict, 0.0f, false); - } - } - - if (rootResist >= 100) - { - if (removeAllModifiersOfType(target, movement.MT_ROOT)) - { - string_id cureMovementMsg = new string_id ("spam", "cure_dot"); - dict.put("detriment", "rooted"); - dict.put("msgId", cureMovementMsg); - messageTo(target, "messageDetrimentalRemoved", dict, 0.0f, false); - } - } - - } - - - public static void performWalk(obj_id actor) throws InterruptedException - { - removeObjVar(actor, "run"); - setMovementPercent(actor, 1.0f); - setMovementWalk(actor); - } - - - public static void performRun(obj_id actor, String speed) throws InterruptedException - { - removeObjVar(actor, "run"); - - float rate = utils.stringToFloat(speed); - - setObjVar(actor, "run", rate); - - setMovementPercent(actor, rate); - setMovementRun(actor); - } - - - public static void performRun(obj_id actor, float rate) throws InterruptedException - { - removeObjVar(actor, "run"); - - setObjVar(actor, "run", rate); - - setMovementPercent(actor, rate); - setMovementRun(actor); - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/pclib.java b/sku.0/sys.server/compiled/game/script/library/pclib.java deleted file mode 100644 index 538e9feac..000000000 --- a/sku.0/sys.server/compiled/game/script/library/pclib.java +++ /dev/null @@ -1,1960 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.structure; -import script.library.sui; -import script.library.corpse; -import script.library.jedi; -import script.library.utils; -import script.library.prose; -import script.library.healing; -import script.library.battlefield; -import script.library.combat; -import script.library.factions; -import script.library.dot; -import script.library.group; -import script.library.pvp; -import script.library.ai_lib; -import script.library.innate; -import script.library.player_stomach; -import script.library.slots; -import script.library.money; -import script.library.player_structure; -import script.library.meditation; -import script.library.city; -import script.library.force_rank; -import script.library.missions; -import script.library.bounty_hunter; -import script.library.smuggler; -import script.library.buff; -import script.ai.ai_combat; -import java.util.Arrays; -import java.util.Vector; -import java.util.Enumeration; - - -public class pclib extends script.base_script -{ - public pclib() - { - } - public static final int MAX_NEWBIE_DEATHS = 3; - - public static final String VAR_NEWBIE_BASE = "noob"; - - public static final String VAR_NEWBIE_DEATH = VAR_NEWBIE_BASE + ".death"; - - public static final String VAR_NEWBIE_CONFIRM_BASE = VAR_NEWBIE_BASE + ".confirm"; - public static final String VAR_NEWBIE_CONFIRM_INSURE = VAR_NEWBIE_CONFIRM_BASE + ".insure"; - public static final String VAR_NEWBIE_CONFIRM_BIND = VAR_NEWBIE_CONFIRM_BASE + ".bind"; - - public static final string_id SID_NEWBIE_STATUS_EXPIRED = new string_id("base_player","newbie_expired"); - - public static final String HANDLER_NONE = "noHandler"; - - public static final float RANGE_CORPSE_DRAG_NORMAL = 40.0f; - public static final float RANGE_CORPSE_DRAG_INTERIOR = 100.0f; - - public static final string_id SID_TARGET_NOT_PLAYER = new string_id("error_message","target_not_player"); - public static final string_id SID_TARGET_SELF_DISALLOWED = new string_id("error_message","target_self_disallowed"); - - public static final String VAR_SAFE_LOGOUT = "safeLogout"; - - public static final String DICT_COST = "cost"; - - public static final String VAR_FACILITY_CLONING = "isCloningFacility"; - - public static final string_id SID_ISF_BANK = new string_id("error_message","insufficient_funds_bank"); - public static final string_id SID_ISF_CASH = new string_id("error_message","insufficient_funds_cash"); - - public static final String DICT_KILLER = "killer"; - - public static final String VAR_REVIVE_BASE = "revive"; - public static final String VAR_REVIVE_OPTIONS = "revive.options"; - public static final String VAR_REVIVE_CLONE = "revive.cloneLocs"; - public static final String VAR_REVIVE_SPAWN = "revive.spawnLocs"; - public static final String VAR_REVIVE_DAMAGE = "revive.damage"; - - public static final String VAR_SUI_CLONE = "sui.clone"; - - public static final String VAR_CONSENT_TO_BASE = "consentTo"; - public static final String VAR_CONSENT_TO_ID = "consentTo.id"; - public static final String VAR_CONSENT_TO_NAME = "consentTo.name"; - - public static final String VAR_CONSENT_FROM_BASE = "consentFrom"; - public static final String VAR_CONSENT_FROM_ID = "consentFrom.id"; - public static final String VAR_CONSENT_FROM_NAME = "consentFrom.name"; - - public static final string_id PROSE_CONSENT = new string_id("base_player","prose_consent"); - public static final string_id PROSE_UNCONSENT = new string_id("base_player","prose_unconsent"); - public static final string_id PROSE_CONSENT_ALREADY_CONSENTING = new string_id("base_player","prose_consent_already_consenting"); - public static final string_id PROSE_CONSENT_LIST_FULL = new string_id("base_player","prose_consent_list_full"); - - public static final int LIMIT_CONSENT_TO = 5; - - public static final String DICT_CONSENTER_ID = "consenterId"; - public static final String DICT_CONSENTER_NAME = "consenterName"; - - public static final String HANDLER_CONSENT_TO_LOGOUT = "handleConsentToLogout"; - - public static final String HANDLER_RECEIVED_CONSENT = "handleReceivedConsent"; - public static final String HANDLER_RECEIVED_UNCONSENT = "handleReceivedUnconsent"; - - public static final string_id SID_TARGET_OFFLINE = new string_id("error_message","target_offline"); - - public static final string_id SID_CMD_BAD_TARGET = new string_id("error_message","cmd_bad_target"); - - public static final int INSURE_COST_BASE = 65; - - public static final float INSURE_CONST = 0.015f; - - public static final String VAR_TO_INSURE = "toInsure"; - - public static final String HANDLER_INSURE_REQUEST = "handleInsureRequest"; - - public static final String HANDLER_INSURE_SUCCESS = "handleInsureSuccess"; - public static final String HANDLER_INSURE_FAILURE = "handleInsureFailure"; - - public static final String HANDLER_BULK_INSURE_SUCCESS = "handleBulkInsureSuccess"; - public static final String HANDLER_BULK_INSURE_FAILURE = "handleBulkInsureFailure"; - - public static final String HANDLER_CASH_INSURE = "handleCashInsure"; - - public static final String HANDLER_REQUESTED_INSURANCE = "handleRequestedInsurance"; - - public static final int BATCH_SIZE = 10; - - public static final String DICT_ITEM_ID = "itemId"; - - public static final String VAR_INSURE_UI_OPTIONS = "insureUIOptions"; - - public static final string_id SID_INSURE_UI_ERROR = new string_id("error_message","insure_ui_error"); - public static final string_id SID_NO_INSURABLES = new string_id("error_message","no_insurables"); - public static final string_id SID_NOT_ALL_INSURABLE = new string_id("error_message","not_all_insurable"); - - public static final string_id SID_INSURE_SUCCESS = new string_id("base_player","insure_success"); - public static final string_id PROSE_INSURE_SUCCESS = new string_id("base_player","prose_insure_success"); - - public static final string_id SID_BULK_INSURE_ERRORS_TITLE = new string_id("error_message","bulk_insure_errors_title"); - public static final string_id SID_BULK_INSURE_ERRORS_PROMPT = new string_id("error_message","bulk_insure_errors_prompt"); - - public static final string_id PROSE_NSF_TO_INSURE = new string_id("error_message","prose_nsf_insure"); - - public static final string_id PROSE_ITEM_ALREADY_INSURED = new string_id("error_message","prose_item_already_insured"); - public static final string_id PROSE_ITEM_UNINSURABLE = new string_id("error_message","prose_item_uninsurable"); - - public static final string_id SID_NO_CORPSE_PRODUCED = new string_id("base_player", "no_corpse_produced"); - public static final string_id PROSE_NEWBIE_INSURED = new string_id("base_player", "prose_newbie_insured"); - - public static final string_id SID_LAST_NEWBIE_INSURE = new string_id("base_player", "last_newbie_insure"); - - public static final String DICT_SCRIPT_NAME = "scriptName"; - public static final String DICT_OBJVAR_NAME = "objVarName"; - - public static final String DICT_XP_TYPE = "xpType"; - public static final String DICT_XP_AMOUNT = "xpAmount"; - - public static final String HANDLER_ATTACH_SCRIPT = "handleAttachScript"; - public static final String HANDLER_DETACH_SCRIPT = "handleDetachScript"; - - public static final String HANDLER_REMOVE_OBJVAR = "handleRemoveObjVar"; - - public static final String HANDLER_GRANT_XP = "handleGrantXp"; - - public static final string_id SID_CANNOT_ATTACK_TARGET = new string_id("error_message","target_not_attackable"); - public static final string_id SID_TARGET_NOT_INCAPACITATED = new string_id("error_message","target_not_incapacitated"); - - public static final string_id SID_TARGET_ALREADY_DEAD = new string_id("error_message","target_already_dead"); - public static final string_id PROSE_TARGET_ALREADY_DEAD = new string_id("error_message","prose_target_already_dead"); - - public static final string_id SID_KILLER_TARGET_DEAD = new string_id("base_player","killer_target_dead"); - public static final string_id SID_VICTIM_DEAD = new string_id("base_player","victim_dead"); - - public static final string_id PROSE_TARGET_DEAD = new string_id("base_player","prose_target_dead"); - public static final string_id PROSE_VICTIM_DEAD = new string_id("base_player","prose_victim_dead"); - - public static final string_id SID_BIND_REMOVED = new string_id("base_player","bind_removed"); - - public static final string_id SID_YOU_HAVE_CONSENT_FROM = new string_id("base_player","you_have_conent_from"); - public static final string_id SID_YOU_DO_NOT_HAVE_CONSENT = new string_id("base_player","you_do_not_have_consent"); - - public static final string_id SID_DEFEATED_BOUNTY_HUNTER = new string_id("base_player","defeated_bounty_hunter"); - - public static final String HANDLER_PLAYER_DEATH = "handlePlayerDeath"; - - public static final String HANDLER_CLONE_RESPAWN = "handleCloneRespawn"; - - public static final float TIME_DEATH = 0.25f; - - public static final String VAR_CORPSE_BASE = "corpse"; - public static final String VAR_CORPSE_ID = "corpse.id"; - public static final String VAR_CORPSE_KILLER = "corpse.killer"; - public static final String VAR_CORPSE_STAMP = "corpse.stamp"; - - public static final String VAR_BEEN_COUPDEGRACED = "beenCoupDeGraced"; - public static final String VAR_DEATHBLOW_KILLER = VAR_BEEN_COUPDEGRACED+".killer"; - public static final String VAR_DEATHBLOW_STAMP = VAR_BEEN_COUPDEGRACED+".stamp"; - - public static final String DATATABLE_AI_SPECIES = "datatables/ai/species.iff"; - public static final String DATATABLE_COL_SKELETON = "Skeleton"; - - public static final String SKELETON_HUMAN = "human"; - - public static final int NC_DEATH = 0; - - public static final String HANDLER_STAT_MIGRATION = "handleStatMigration"; - - public static final float TIP_WIRE_SURCHARGE = 0.05f; - - public static final String VAR_TIP_BASE = "tip"; - public static final String VAR_TIP_TARGET = VAR_TIP_BASE + ".target"; - public static final String VAR_TIP_TARGET_NAME = VAR_TIP_BASE + ".targetName"; - public static final String VAR_TIP_AMT = VAR_TIP_BASE + ".amt"; - public static final String VAR_TIP_SUI = VAR_TIP_BASE + ".sui"; - - public static final string_id SID_TIP_CLEAR = new string_id("base_player","tip_clear"); - public static final string_id SID_TIP_ABORT = new string_id("base_player","tip_abort"); - public static final string_id PROSE_TIP_ABORT = new string_id("base_player","prose_tip_abort"); - - public static final string_id SID_TIP_ERROR = new string_id("base_player","tip_error"); - - public static final string_id SID_TIP_TARGET_OFFLINE = new string_id("base_player", "tip_target_offline"); - public static final string_id SID_TIP_NSF = new string_id("base_player", "tip_nsf"); - - public static final string_id SID_TIP_SYNTAX = new string_id("base_player", "tip_syntax"); - - public static final string_id SID_TIP_WIRE_TITLE = new string_id("base_player", "tip_wire_title"); - public static final string_id SID_TIP_WIRE_PROMPT = new string_id("base_player", "tip_wire_prompt"); - - public static final string_id PROSE_INVALID_TIP_PARAM = new string_id("base_player", "prose_tip_invalid_param"); - public static final string_id PROSE_INVALID_TIP_AMT = new string_id("base_player", "prose_tip_invalid_amt"); - public static final string_id PROSE_TIP_NSF_CASH = new string_id("base_player", "prose_tip_nsf_cash"); - public static final string_id PROSE_TIP_NSF_BANK = new string_id("base_player", "prose_tip_nsf_bank"); - public static final string_id PROSE_TIP_NSF_WIRE = new string_id("base_player", "prose_tip_nsf_wire"); - public static final string_id PROSE_TIP_RANGE = new string_id("base_player", "prose_tip_range"); - - public static final string_id PROSE_TIP_PASS_SELF = new string_id("base_player", "prose_tip_pass_self"); - public static final string_id PROSE_TIP_PASS_TARGET = new string_id("base_player", "prose_tip_pass_target"); - - public static final string_id SID_WIRE_PASS_SELF = new string_id("base_player", "wire_pass_self"); - public static final string_id PROSE_WIRE_PASS_SELF = new string_id("base_player", "prose_wire_pass_self"); - public static final string_id PROSE_WIRE_PASS_TARGET = new string_id("base_player", "prose_wire_pass_target"); - - public static final string_id SID_MAY_NOT_TIP_TARGET = new string_id("base_player", "may_not_tip_target"); - public static final string_id SID_ONLY_TIP_VALID_TARGETS = new string_id("base_player", "only_tip_valid_targets"); - - public static final string_id SID_WIRE_MAIL_SUBJECT = new string_id("base_player", "wire_mail_subject"); - public static final string_id PROSE_WIRE_MAIL_FROM = new string_id("base_player", "prose_wire_mail_from"); - - public static final string_id PROSE_WIRE_MAIL_SELF = new string_id("base_player", "prose_wire_mail_self"); - public static final string_id PROSE_WIRE_MAIL_TARGET = new string_id("base_player", "prose_wire_mail_target"); - - public static final string_id SID_COVERT_RESPAWN_UNALIGNED = new string_id("base_player", "covert_respawn_unaligned"); - public static final string_id SID_COVERT_RESPAWN_UNFRIENDLY = new string_id("base_player", "covert_respawn_unfriendly"); - public static final string_id SID_COVERT_RESPAWN_OUTSIDE = new string_id("base_player", "covert_respawn_outside"); - - public static final String TBL_INSURE_DECAY_EVENTS = "datatables/player/insure_decay_event.iff"; - public static final String COL_EVENT = "EVENT"; - public static final String COL_INSURED = "INSURED"; - public static final String COL_UNINSURED = "UNINSURED"; - public static final String COL_DO_UNINSURE = "DO_UNINSURE"; - - public static final int MIN_JEDI_WAIT_TIME = 60; - public static final String OBJVAR_JEDI_SKILL_REQUIREMENTS = "jedi.skillsNeeded"; - - public static final float DECAY_RATE = 0.002f; - public static final String DECAY_REMAINDER = "decay.remainder"; - - public static final float MIN_CLONING_SICKNESS_COST = 100; - public static final float MAX_CLONING_SICKNESS_COST = 5000; - - - public static int getCloningSicknessCureCost(obj_id player) throws InterruptedException - { - - float minCost = MIN_CLONING_SICKNESS_COST; - float maxCost = MAX_CLONING_SICKNESS_COST; - int city_id = city.checkCity(player, false); - if (city_id > 0 && city.cityHasSpec(city_id, city.SF_SPEC_CLONING)) - { - minCost = MIN_CLONING_SICKNESS_COST/2; - maxCost = MAX_CLONING_SICKNESS_COST/2; - } - - float level = getLevel(player); - float costRatio = level / 90f; - float cost = minCost + ((maxCost - minCost) * costRatio); - return (int)cost; - } - - - public static boolean canAffordCloningSicknessCure(obj_id player) throws InterruptedException - { - int cost = getCloningSicknessCureCost(player); - int balance = getTotalMoney(player); - - if (cost > balance) - { - return false; - } - - return true; - } - - - public static void cureCloningSickness(obj_id player) throws InterruptedException - { - if (!canAffordCloningSicknessCure(player)) - { - sendSystemMessage(player, new string_id("spam", "not_enough_cash_4_cure")); - return; - } - - int cost = getCloningSicknessCureCost(player); - if (cost > 0) - { - money.requestPayment(player, money.ACCT_CLONING, cost, "none", null, false); - } - - playClientEffectObj(player, "appearance/pt_cure_cloning_sickness.prt", player, ""); - buff.removeBuff(player, "cloning_sickness"); - playMusic(player, "sound/vo_meddroid_01.snd"); - } - - - public static obj_id grantWayPoint(obj_id player, obj_id target) throws InterruptedException - { - if (!isIdValid(player) || (!isPlayer(player)) || !isIdValid(target)) - { - return null; - } - - obj_id waypoint = createWaypointInDatapad(player, target); - - if (!isIdValid(waypoint)) - { - return null; - } - - setWaypointActive(waypoint, true); - setWaypointVisible(waypoint, true); - - return waypoint; - } - - - public static boolean giveTip(obj_id player, obj_id target, String targetName, int amt, boolean useCash) throws InterruptedException - { - - if (!isIdValid(player) || !isIdValid(target) || targetName == null) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " -- Tip aborted: Target or tipper is invalid or Target Name is null."); - if (isIdValid(player)) - { - sendSystemMessage( player, new string_id( "error_message", "tip_target_bad") ); - } - return false; - } - - CustomerServiceLog( "Trade", " Processing Tip, Player: "+ player + " "+ getName(player) + " Target: "+ target + " "+ getName(target) + " Amount: "+ amt + " Cash: "+ useCash ); - - if (target.isLoaded() && !isPlayer(target)) - { - if (targetName == null || targetName.equals("")) - { - targetName = utils.getStringName(target); - } - - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " -- Tip aborted: Target isn't a player."); - prose_package ppNoTipTarget = prose.getPackage(SID_MAY_NOT_TIP_TARGET); - prose.setTT(ppNoTipTarget, target); - sendSystemMessageProse( player, ppNoTipTarget ); - sendSystemMessage( player, SID_ONLY_TIP_VALID_TARGETS ); - return false; - } - - if (amt < 1) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " -- Tip aborted: Tip amount is less than 1."); - prose_package invalidAmt = prose.getPackage( PROSE_INVALID_TIP_AMT, amt ); - sendSystemMessageProse( player, invalidAmt ); - return false; - } - if (amt > 1000000) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " -- Tip aborted: Tip amount is greater than 1000000."); - prose_package invalidAmt = prose.getPackage( PROSE_INVALID_TIP_AMT, amt ); - sendSystemMessageProse( player, invalidAmt ); - return false; - } - - if (!target.isLoaded()) - { - useCash = false; - } - - if (useCash) - { - float dist = getDistance( getLocation(player), getLocation(target) ); - if (dist > 15f) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " -- Tip changing to bank transfer due to distance. Distance: "+ dist ); - prose_package tooFar = prose.getPackage( PROSE_TIP_RANGE, target ); - sendSystemMessageProse( player, tooFar ); - useCash = false; - } - } - - dictionary d = new dictionary(); - d.put("target", target); - d.put("amt", amt); - d.put("useCash", useCash); - d.put("targetName", targetName); - if (useCash) - { - - int cash = getCashBalance( player ); - if (amt > cash) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " Target: "+ target + " -- Tip aborted: Insufficient cash. Amt: "+ amt + " Cash: "+ cash ); - prose_package nsfCash = prose.getPackage( PROSE_TIP_NSF_CASH, target, amt ); - sendSystemMessageProse( player, nsfCash ); - return false; - } - - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " Target: "+ target + " -- Transferring Cash! Amt: "+ amt ); - - if (utils.isFreeTrial(player, target)) - { - doTipLogging(player, target, amt); - } - - boolean success = transferCashTo( player, target, amt, "handleTipSuccess", "handleTipFail", d ); - if (!success) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " Target: "+ target + " -- Tip aborted: transferCashTo failed. Amt: "+ amt ); - sendSystemMessage( player, new string_id( "base_player", "cash_transfer_failed") ); - return false; - } - } - else - { - - int bank = getBankBalance( player ); - if (amt > bank) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " Target: "+ target + " -- Tip aborted: Insufficient bank balance. Amt: "+ amt + " Bank: "+ bank ); - prose_package nsfBank = prose.getPackage( PROSE_TIP_NSF_BANK, target, amt ); - sendSystemMessageProse( player, nsfBank ); - return false; - } - - int pid = showTipSui( player, target, targetName, amt ); - if (pid < 0) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " Target: "+ target + " -- Tip aborted: Unable to create bank tip SUI window."); - sendSystemMessageTestingOnly( player, "Tip aborted: Unable to create bank tip SUI window."); - return false; - } - } - - return true; - } - - - public static int showTipSui(obj_id player, obj_id target, String targetName, int amt) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(target) || (targetName == null) || (targetName.equals(""))) - { - return -1; - } - - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ getName(player) + " Target: "+ target + " -- Showing bank tip wire UI."); - String title = utils.packStringId(SID_TIP_WIRE_TITLE); - String prompt = utils.packStringId(SID_TIP_WIRE_PROMPT); - int cBox = sui.msgbox( player, player, prompt, sui.YES_NO, title, "handleWireConfirm"); - if (cBox > -1) - { - utils.setScriptVar( player, VAR_TIP_SUI, cBox ); - utils.setScriptVar( player, VAR_TIP_TARGET, target ); - utils.setScriptVar( player, VAR_TIP_TARGET_NAME, targetName ); - utils.setScriptVar( player, VAR_TIP_AMT, amt ); - } - - return cBox; - } - - - public static void cleanupTipSui(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return; - } - - utils.removeScriptVar( player, VAR_TIP_TARGET ); - utils.removeScriptVar( player, VAR_TIP_TARGET_NAME ); - utils.removeScriptVar( player, VAR_TIP_AMT ); - utils.removeScriptVar( player, VAR_TIP_SUI ); - } - - - public static void doTipLogging(obj_id player, obj_id target, int amt) throws InterruptedException - { - int trackTipNumIn = 0; - int trackTipAmtIn = 0; - int trackTipNumOut = 0; - int trackTipAmtOut = 0; - - if (!utils.hasScriptVar(player, utils.TIP_OUT_NUM)) - { - utils.setScriptVar(player, utils.TIP_OUT_NUM, 1); - utils.setScriptVar(player, utils.TIP_OUT_AMMOUNT, amt); - utils.setScriptVar(player, utils.TIP_OUT_THACK, getGameTime()); - trackTipNumOut = 1; - trackTipAmtOut = amt; - } - else - { - int tipNum = utils.getIntScriptVar(player, utils.TIP_OUT_NUM) +1; - int tipAmt = utils.getIntScriptVar(player, utils.TIP_OUT_AMMOUNT) + amt; - utils.setScriptVar(player, utils.TIP_OUT_NUM, tipNum); - utils.setScriptVar(player, utils.TIP_OUT_AMMOUNT, tipAmt); - trackTipNumOut = tipNum; - trackTipAmtOut = tipAmt; - } - - if (!utils.hasScriptVar(target, utils.TIP_IN_NUM)) - { - utils.setScriptVar(target, utils.TIP_IN_NUM, 1); - utils.setScriptVar(target, utils.TIP_IN_AMMOUNT, amt); - utils.setScriptVar(target, utils.TIP_IN_THACK, getGameTime()); - trackTipNumIn = 1; - trackTipAmtIn = amt; - } - else - { - int tipNum = utils.getIntScriptVar(target, utils.TIP_IN_NUM) +1; - int tipAmt = utils.getIntScriptVar(target, utils.TIP_IN_AMMOUNT) + amt; - utils.setScriptVar(target, utils.TIP_IN_NUM, tipNum); - utils.setScriptVar(target, utils.TIP_IN_AMMOUNT, tipAmt); - trackTipNumIn = tipNum; - trackTipAmtIn = tipAmt; - } - - if (trackTipNumIn > utils.TIP_NUM_MAX || trackTipAmtIn > utils.TIP_AMT_MAX || trackTipNumOut > utils.TIP_NUM_MAX || trackTipAmtOut > utils.TIP_AMT_MAX) - { - int pTimeHack = utils.getIntScriptVar(player, utils.TIP_OUT_THACK); - int tTimeHack = utils.getIntScriptVar(target, utils.TIP_IN_THACK); - pTimeHack = getGameTime() - pTimeHack; - tTimeHack = getGameTime() - tTimeHack; - - CustomerServiceLog("exploit", "Free Trial Tipping -- Suspicious activity -- %TU has made "+trackTipNumOut+" tips for a total of "+trackTipAmtOut+" over the course of "+pTimeHack+"seconds, %TT has recieved "+trackTipNumIn+" tips for a total of "+trackTipAmtIn+" over the course of "+tTimeHack+" seconds.",player,target); - } - } - - - public static boolean consent(obj_id player, obj_id target) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(target)) - { - return false; - } - - if (target == player) - { - - sendSystemMessage(player, SID_TARGET_SELF_DISALLOWED); - return false; - } - - if (!isPlayer(target)) - { - - sendSystemMessage(player, SID_TARGET_NOT_PLAYER); - return false; - } - - Vector consentTo = getResizeableObjIdArrayObjVar(player, VAR_CONSENT_TO_ID); - if (consentTo == null) - { - Vector newConsentTo = new Vector(); - newConsentTo.setSize(0); - consentTo = newConsentTo; - } - - if (utils.getElementPositionInArray(consentTo, target) > -1) - { - prose_package pp = prose.getPackage(PROSE_CONSENT_ALREADY_CONSENTING, getPlayerFullName(target)); - sendSystemMessageProse(player, pp); - return false; - } - else if (consentTo.size() >= LIMIT_CONSENT_TO) - { - prose_package pp = prose.getPackage(PROSE_CONSENT_LIST_FULL, LIMIT_CONSENT_TO); - sendSystemMessageProse(player, pp); - return false; - } - else - { - consentTo = utils.addElement(consentTo, target); - - obj_id[] corpses = getObjIdArrayObjVar(player, VAR_CORPSE_ID); - if ((corpses != null) && (corpses.length > 0)) - { - corpse.grantCorpseConsent(corpses, target); - } - - if (setObjVar(player, VAR_CONSENT_TO_ID, consentTo, resizeableArrayTypeobj_id)) - { - dictionary d = new dictionary(); - d.put(DICT_CONSENTER_ID, player); - - prose_package pp = prose.getPackage(PROSE_CONSENT, getPlayerFullName(target)); - sendSystemMessageProse(player, pp); - - messageTo(target, HANDLER_RECEIVED_CONSENT, d, 0, true); - return true; - } - } - - return false; - } - - - public static boolean unconsent(obj_id player, obj_id target) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(target)) - { - return false; - } - - if (target == player) - { - - sendSystemMessage(player, SID_TARGET_SELF_DISALLOWED); - return false; - } - - obj_id[] corpses = getObjIdArrayObjVar(player, VAR_CORPSE_ID); - if ((corpses != null) && (corpses.length > 0)) - { - corpse.revokeCorpseConsent(corpses, target); - } - else - { - removeObjVar(player, VAR_CORPSE_ID); - } - - Vector consentTo = getResizeableObjIdArrayObjVar(player, VAR_CONSENT_TO_ID); - if (consentTo != null) - { - int idx = utils.getElementPositionInArray(consentTo, target); - if (idx > -1) - { - consentTo = utils.removeElementAt(consentTo, idx); - - if (consentTo.size() == 0) - { - removeObjVar(player, VAR_CONSENT_TO_BASE); - } - else - { - setObjVar(player, VAR_CONSENT_TO_ID, consentTo, resizeableArrayTypeobj_id); - } - - prose_package pp = prose.getPackage(PROSE_UNCONSENT, getPlayerFullName(target)); - sendSystemMessageProse(player, pp); - - dictionary d = new dictionary(); - d.put(DICT_CONSENTER_ID, player); - - messageTo(target, HANDLER_RECEIVED_UNCONSENT, d, 0, true); - } - else - { - return false; - } - } - else - { - return false; - } - - return true; - } - - - public static boolean hasConsent(obj_id player, obj_id target, boolean verbose) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(target)) - { - return false; - } - - if (target == player) - { - - return false; - } - - boolean isConsented = false; - - obj_id[] consentFrom = getObjIdArrayObjVar(player, VAR_CONSENT_FROM_ID); - if ((consentFrom == null) || (consentFrom.length == 0)) - { - - } - else - { - if (utils.getElementPositionInArray(consentFrom, target) > -1) - { - isConsented = true; - } - } - - if (verbose) - { - if (isConsented) - { - prose_package ppYouHaveConsentFrom = prose.getPackage(SID_YOU_HAVE_CONSENT_FROM); - prose.setTT(ppYouHaveConsentFrom, target); - sendSystemMessageProse(player, ppYouHaveConsentFrom); - } - else - { - prose_package ppYouDoNotHaveConsent = prose.getPackage(SID_YOU_DO_NOT_HAVE_CONSENT); - prose.setTT(ppYouDoNotHaveConsent, target); - sendSystemMessageProse(player, ppYouDoNotHaveConsent); - } - } - - return isConsented; - } - - - public static boolean hasConsent(obj_id player, obj_id target) throws InterruptedException - { - return hasConsent(player, target, false); - } - - - public static boolean relinquishConsents(obj_id player) throws InterruptedException - { - if ((player == null) || (!isPlayer(player))) - { - return false; - } - - if (hasObjVar(player, VAR_CONSENT_FROM_BASE)) - { - obj_id[] consentFromList = getObjIdArrayObjVar(player, VAR_CONSENT_FROM_ID); - if ((consentFromList == null) || (consentFromList.length == 0)) - { - return false; - } - - dictionary d = new dictionary(); - d.put(corpse.DICT_PLAYER_ID, player); - - boolean litmus = true; - for (int i = 0; i < consentFromList.length; i++) - { - testAbortScript(); - litmus &= messageTo(consentFromList[i], HANDLER_CONSENT_TO_LOGOUT, d, 0, true); - } - removeObjVar(player, VAR_CONSENT_FROM_BASE); - return litmus; - } - return false; - } - - - public static location getEffectiveDeathLocation(obj_id player) throws InterruptedException - { - - location loc = getLocation(player); - if (!loc.area.startsWith("space_")) - { - return loc; - } - - loc = getLocationObjVar(player, "space.launchLoc"); - if (loc != null) - { - return loc; - } - - return new location(0.0f, 0.0f, 0.0f, "tatooine"); - } - - - public static void killPlayer(obj_id player, obj_id killer) throws InterruptedException - { - killPlayer(player, killer, true); - } - - - public static void killPlayer(obj_id player, obj_id killer, boolean usePVPRules) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(killer) || (!isPlayer(player))) - { - - return; - } - - int dam = -(getAttrib(player, HEALTH) + 50); - addAttribModifier(player, HEALTH, dam, 0f, 0f, MOD_POOL); - coupDeGrace(player, killer, false, usePVPRules); - } - - - public static void coupDeGrace(obj_id victim, obj_id killer, boolean playAnim) throws InterruptedException - { - coupDeGrace(victim, killer, playAnim, true); - - } - - public static void coupDeGrace(obj_id victim, obj_id killer, boolean playAnim, boolean usePVPRules) throws InterruptedException - { - - if (!isIdValid(victim) || !isIdValid(killer)) - { - return; - } - - if (utils.hasScriptVar(victim, "death.beingCoupDeGraced")) - { - int expireTime = utils.getIntScriptVar(victim, "death.beingCoupDeGraced"); - int currentTime = getGameTime(); - if (currentTime <= expireTime) - { - return; - } - else - { - utils.removeScriptVar(victim, "death.beingCoupDeGraced"); - } - } - - if (!victim.isAuthoritative() || !killer.isAuthoritative()) - { - - requestSameServer(victim, killer); - int expireTime = getGameTime() + 60; - utils.setScriptVar(victim, "death.beingCoupDeGraced", expireTime); - - int numberOfTries = 1; - dictionary dict = new dictionary(); - dict.put("numberOfTries", numberOfTries); - dict.put("victim", victim); - dict.put("killer", killer); - dict.put("playAnim", playAnim); - dict.put("usePVPRules", usePVPRules); - - messageTo(victim, "msgCoupDeGraceAuthoritativeCheck", dict, 2, false); - return; - } - - if (isDead(victim)) - { - prose_package pp = prose.getPackage(PROSE_TARGET_ALREADY_DEAD, victim); - sendSystemMessageProse(killer, pp); - - return; - } - - if (!isIncapacitated(victim)) - { - sendSystemMessage(killer, SID_TARGET_NOT_INCAPACITATED); - return; - } - - utils.setScriptVar(victim, "lastKiller", killer); - - if (!hasObjVar(victim, VAR_BEEN_COUPDEGRACED)) - { - setObjVar(victim, VAR_DEATHBLOW_KILLER, killer); - setObjVar(victim, VAR_DEATHBLOW_STAMP, getGameTime()); - } - - gcw.releaseGcwPointCredit(victim); - - obj_id master = null; - obj_id pvpKiller = killer; - - if (!isPlayer(killer)) - { - if (isMob(killer)) - { - master = getMaster(killer); - - if (isIdValid(master) && isPlayer(master)) - { - pvpKiller = master; - } - } - } - - if (isPlayer(pvpKiller)) - { - utils.setScriptVar(victim, "pvp_death", 1); - - pvp.bfCreditForKill(pvpKiller); - pvp.bfCreditForDeath(victim, pvpKiller); - } - - boolean onBattlefield = false; - - region r = battlefield.getBattlefield(victim); - if (r == null) - { - if (usePVPRules) - { - if (!pvpCanAttack(killer, victim) && (killer != victim)) - { - sendSystemMessage(killer, SID_CANNOT_ATTACK_TARGET); - return; - } - } - } - else - { - onBattlefield = true; - if (!pvpIsEnemy(killer, victim) && (killer != victim)) - { - sendSystemMessage(killer, SID_CANNOT_ATTACK_TARGET); - return; - } - } - - if (playAnim) - { - playDeathBlowAnimation(victim, killer); - } - - boolean dueling = pvpIsDueling(victim, killer); - - if (getPosture(victim) != POSTURE_DEAD) - { - if (!setPosture(victim, POSTURE_DEAD)) - { - - } - } - - if (killer != victim) - { - prose_package ppToKiller = prose.getPackage(PROSE_TARGET_DEAD, victim); - combat.sendCombatSpamMessageProse(killer, victim, ppToKiller, true, false, true); - } - - if (onBattlefield) - { - - if (battlefield.isBattlefieldActive(r)) - { - battlefield.sendBattlefieldMessage(r, getFirstName(victim) + " has been eliminated by "+ getFirstName(killer)); - - obj_id bf_object = battlefield.getMasterObjectFromRegion(r); - dictionary params = new dictionary(); - params.put("master_object", bf_object); - messageTo(victim, "msgBattlefieldDeath", params, battlefield.DEATH_TIME, true); - - battlefield.registerBattlefieldKill(killer, victim, bf_object); - - return; - } - } - else - { - - } - playerDeath(victim, killer, dueling); - } - - - public static void playDeathBlowAnimation(obj_id victim, obj_id killer) throws InterruptedException - { - if (!isIdValid(victim) || !isIdValid(killer)) - { - return; - } - - String skeleton = ""; - if (dataTableOpen(DATATABLE_AI_SPECIES)) - { - int species = getSpecies(killer); - if (species == -1) - { - - } - else - { - skeleton = dataTableGetString(DATATABLE_AI_SPECIES, species, DATATABLE_COL_SKELETON); - } - } - - if (skeleton != null && !skeleton.equals("") && (killer != victim)) - { - if (isPlayer(killer) || (skeleton.equals(SKELETON_HUMAN))) - { - - String strPlaybackScript = ""; - obj_id objWeapon = getCurrentWeapon(killer); - int intWeaponType = getWeaponType(objWeapon); - int intWeaponCategory = combat.getWeaponCategory(intWeaponType); - - if (intWeaponCategory == combat.RANGED_WEAPON) - { - - strPlaybackScript = "ranged_coup_de_grace"; - - } - else - { - - if (intWeaponType == WEAPON_TYPE_UNARMED) - { - strPlaybackScript = "unarmed_coup_de_grace"; - - } - else - { - - strPlaybackScript = "melee_coup_de_grace"; - } - - } - - attacker_results cbtAttackerResults = new attacker_results(); - defender_results[] cbtDefenderResults = new defender_results[1]; - cbtDefenderResults[0] = new defender_results(); - - cbtAttackerResults.id = killer; - cbtAttackerResults.endPosture = getPosture(killer); - cbtAttackerResults.weapon = objWeapon; - - cbtDefenderResults[0].endPosture = POSTURE_DEAD; - cbtDefenderResults[0].result = COMBAT_RESULT_HIT; - cbtDefenderResults[0].id = victim; - doCombatResults(strPlaybackScript, cbtAttackerResults, cbtDefenderResults); - } - } - } - - - public static void coupDeGrace(obj_id victim, obj_id killer) throws InterruptedException - { - coupDeGrace (victim, killer, true); - } - - - public static boolean playerDeath(obj_id player, obj_id killer, boolean dueling) throws InterruptedException - { - - if (!isIdValid(player) || killer == null) - { - return false; - } - - if (!isDead(player)) - { - sendSystemMessageTestingOnly(killer, "apparently, "+ getName(player) + " is still not dead"); - return false; - } - - if (killer == obj_id.NULL_ID || player == killer) - { - sendSystemMessage(player, SID_VICTIM_DEAD); - } - else - { - prose_package ppToVictim = prose.getPackage(PROSE_VICTIM_DEAD, killer); - sendSystemMessageProse(player, ppToVictim); - } - - float factionMod = 1.0f; - - if (!isPlayer(killer) && isMob(killer) && isIdValid(getMaster(killer))) - { - killer = getMaster(killer); - } - - if (isPlayer(killer) && player != killer) - { - if (utils.isProfession(killer, utils.BOUNTY_HUNTER) && isBeingHuntedByBountyHunter(player, killer)) - { - bounty_hunter.winBountyMission(killer, player); - smuggler.checkSmugglerMissionBountyFailure(player, killer); - } - else if (utils.isProfession(player, utils.BOUNTY_HUNTER) && isBeingHuntedByBountyHunter(killer, player)) - { - bounty_hunter.loseBountyMission(player, killer); - } - else - { - if ((getTotalMoney(player) >= bounty_hunter.MIN_BOUNTY_SET) && (!dueling) && (getLevel(killer) >= 20)) - { - bounty_hunter.showSetBountySUI(player, killer); - } - } - - pvp.incrementPlayerDeathBounty(killer, player); - - if (isPlayer(player)) - { - guildUpdateGuildWarKillTracking(killer, player); - } - } - - factions.grantCombatFaction( killer, player, factionMod ); - - dot.removeAllDots(player); - - clearAllHate(player); - - playMusic(player, "sound/music_player_death.snd"); - - obj_id gid = getGroupObject(player); - if (isIdValid(gid)) - { - group.notifyDeath(gid, player); - } - messageTo(player, HANDLER_PLAYER_DEATH, null, TIME_DEATH, true); - dictionary params = new dictionary(); - params.put("victim", player); - messageTo(killer, "handleKillerDeathBlow", params, 1, false); - return true; - } - - - public static void clearAllHate(obj_id self) throws InterruptedException - { - - } - - - public static boolean playerRevive(obj_id player) throws InterruptedException - { - return playerRevive(player, getWorldLocation(player), getLocation(player), 0); - } - - - public static boolean playerRevive(obj_id player, location reviveLoc, location spawnLoc, int damage) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (!isDead(player)) - { - LOG("playerRevive", "playerRevive: player is not dead!"); - return false; - } - - if (reviveLoc == null || spawnLoc == null) - { - return false; - } - - setObjVar(player, "fullHealClone", true); - boolean warped = sendToCloneSpawn(player, HANDLER_CLONE_RESPAWN, reviveLoc, spawnLoc); - - if (!warped) - { - sendSystemMessage(player, cloninglib.SID_RESPAWN_CURRENT_LOCATION); - messageTo(player, HANDLER_CLONE_RESPAWN, null, 2, true); - } - - return true; - } - - - public static boolean equipClone(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - obj_id inv = utils.getInventoryContainer(player); - if (!isIdValid(inv)) - { - return false; - } - - obj_id[] items = utils.getFilteredPlayerContents(player); - if ((items != null) && (items.length > 0)) - { - for (int i = 0; i < items.length; i++) - { - testAbortScript(); - int got = getGameObjectType(items[i]); - if (isGameObjectTypeOf(got, GOT_clothing) || isGameObjectTypeOf(got, GOT_armor)) - { - equip(items[i], player); - } - } - } - - return true; - } - - - public static boolean autoInsureItem(obj_id item) throws InterruptedException - { - if (!isIdValid(item)) - { - return false; - } - - return setAutoInsured(item); - } - - - public static boolean resurrectPlayer(obj_id target) throws InterruptedException - { - return resurrectPlayer(target, false); - } - - - public static boolean resurrectPlayer(obj_id target, boolean playCloneAnimation) throws InterruptedException - { - if (!isIdValid(target) || !isPlayer(target)) - { - return false; - } - - int posture = getPosture(target); - - if (posture == POSTURE_DEAD) - { - clearEffectsForDeath(target); - - if (utils.hasScriptVar(target, VAR_SUI_CLONE)) - { - int suiClone = utils.getIntScriptVar(target, VAR_SUI_CLONE); - if (suiClone > -1) - { - sui.closeSUI(target, suiClone); - } - } - - utils.removeScriptVar(target, VAR_SUI_CLONE); - utils.removeScriptVar(target, VAR_REVIVE_OPTIONS); - - trimLastKiller(target); - - pvpRemoveAllTempEnemyFlags(target); - - removeObjVar(target, VAR_BEEN_COUPDEGRACED); - - queueCommand(target, (-1465754503), target, "", COMMAND_PRIORITY_IMMEDIATE); - - if (playCloneAnimation) - { - playClientEffectObj(target, "clienteffect/player_clone_compile.cef", target, null); - } - - } - - healing.fullHealEveryone(target); - - setAttrib(target, HEALTH, getMaxAttrib(target, HEALTH)); - setAttrib(target, ACTION, getMaxAttrib(target, ACTION)); - - dot.removeAllDots(target); - - return true; - } - - - public static boolean clearCombatData(obj_id target) throws InterruptedException - { - queueCommand(target, (-1465754503), target, "", COMMAND_PRIORITY_IMMEDIATE); - - setCombatTarget(target, null); - stopCombat(target); - - obj_id[] objEnemies = getHateList(target); - for (int i = 0; i < objEnemies.length; i++) - { - testAbortScript(); - if (!isIdValid(objEnemies[i]) || !exists(objEnemies[i])) - { - continue; - } - - if (!isPlayer(objEnemies[i])) - { - if (isIdValid(objEnemies[i]) && exists(objEnemies[i]) && isIdValid(target) && exists(target)) - { - - } - } - else - { - setCombatTarget(objEnemies[i], null); - } - } - - removeObjVar(target, "intBurstRunning"); - removeObjVar(target, "combat.intLastBurstRunTime"); - utils.removeScriptVar(target, "combat.intKnockdownTime"); - utils.removeScriptVar(target, "combat.intPostureChangeTime"); - utils.removeScriptVarTree(target, "combat.combatDelay"); - - removeObjVar(target, innate.VAR_ROAR); - removeObjVar(target, innate.VAR_VITALIZE); - removeObjVar(target, innate.VAR_EQUILIBRIUM); - removeObjVar(target, innate.VAR_REGENERATION); - - pvpRemoveAllTempEnemyFlags(target); - - return true; - } - - - public static boolean clearBuffData(obj_id target) throws InterruptedException - { - return buff.removeAllBuffs(target); - } - - - public static void trimLastKiller(obj_id self) throws InterruptedException - { - Vector killers = utils.getResizeableObjIdBatchObjVar(self, VAR_CORPSE_KILLER); - if (killers != null && killers.size() > 0) - { - killers = utils.removeElementAt(killers, killers.size() - 1); - } - - if (killers == null || killers.size() == 0) - { - removeObjVar(self, VAR_CORPSE_KILLER); - } - else - { - utils.setResizeableBatchObjVar(self, VAR_CORPSE_KILLER, killers); - } - } - - - public static boolean checkCovertRespawn(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - String pFac = factions.getFaction(player); - if (factions.isDeclared(player) && pFac != null && !pFac.equals("")) - { - obj_id topMost = getTopMostContainer(player); - if (isIdValid(topMost)) - { - if (topMost == player) - { - covertRespawn(player, "outside"); - } - else - { - String sFac = factions.getFaction(topMost); - if (sFac == null || sFac.equals("") || !sFac.equals(pFac)) - { - covertRespawn(player, sFac); - } - } - } - } - - return false; - } - - - public static void covertRespawn(obj_id player, String faction) throws InterruptedException - { - if (!isIdValid(player)) - { - return; - } - - if (hasScript (player, "theme_park.dungeon.corvette.timer") || getLocation(player).area.equals("adventure2")) - { - return; - } - - pvpMakeCovert(player); - removeObjVar(player, "travelingCovert"); - - if (faction == null || faction.equals("")) - { - sendSystemMessage(player, SID_COVERT_RESPAWN_UNALIGNED); - } - else if (faction.equals("outside")) - { - sendSystemMessage(player, SID_COVERT_RESPAWN_OUTSIDE); - } - else - { - sendSystemMessage(player, SID_COVERT_RESPAWN_UNFRIENDLY); - } - } - - - public static void destroyPlayerEquipment(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return; - } - - boolean isTrandoshan = isSpecies(player, SPECIES_TRANDOSHAN); - - for (int i = 0; i < slots.EQ_SLOTS.length; ++i) - { - testAbortScript(); - - if (isTrandoshan && slots.EQ_SLOTS[i] == slots.SHOES) - { - continue; - } - - obj_id object = getObjectInSlot(player, slots.EQ_SLOTS[i]); - if (isIdValid(object)) - { - destroyObject(object); - } - } - } - - - public static void destroyPlayerInventory(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return; - } - - obj_id inventory = getObjectInSlot(player, utils.SLOT_INVENTORY); - if (!isIdValid(inventory)) - { - return; - } - - obj_id[] contents = getContents(inventory); - if (contents == null) - { - return; - } - - for (int i = 0; i < contents.length; ++i) - { - testAbortScript(); - if (isIdValid(contents[i])) - { - destroyObject(contents[i]); - } - } - } - - - public static void destroyPlayerBank(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return; - } - - obj_id inventory = getObjectInSlot(player, utils.SLOT_BANK); - if (!isIdValid(inventory)) - { - return; - } - - obj_id[] contents = getContents(inventory); - if (contents == null) - { - return; - } - - for (int i = 0; i < contents.length; ++i) - { - testAbortScript(); - if (isIdValid(contents[i])) - { - destroyObject(contents[i]); - } - } - } - - - public static void damageAndDecayItem(obj_id item, float percent) throws InterruptedException - { - - } - - - public static void damageAndDecayItem(obj_id item, int amount) throws InterruptedException - { - - } - - - public static boolean sendToCloneSpawn(obj_id player, String callback, location world, location spawn) throws InterruptedException - { - - if ((player == null) || (world == null) || (!isPlayer(player))) - { - return false; - } - - if (spawn == null) - { - - warpPlayer(player, world.area, world.x, world.y, world.z, null, world.x, world.y, world.z, callback); - } - else if (spawn.cell == null || spawn.cell == obj_id.NULL_ID) - { - - warpPlayer(player, spawn.area, spawn.x, spawn.y, spawn.z, null, spawn.x, spawn.y, spawn.z, callback); - } - else - { - - warpPlayer(player, world.area, world.x, world.y, world.z, spawn.cell, spawn.x, spawn.y, spawn.z, callback); - } - return true; - } - - - public static boolean sendToAnyLocation(obj_id player, location world, location interior) throws InterruptedException - { - - if ((player == null) || (world == null) || (!isPlayer(player))) - { - return false; - } - - if (interior == null || interior.cell == null || interior.cell == obj_id.NULL_ID) - { - - warpPlayer(player, world.area, world.x, world.y, world.z, null, world.x, world.y, world.z); - } - else - { - - warpPlayer(player, world.area, world.x, world.y, world.z, interior.cell, interior.x, interior.y, interior.z); - } - return true; - } - - - public static boolean sendToAnyLocation(obj_id player, String callback, location world, location interior) throws InterruptedException - { - - if ((player == null) || (world == null) || (!isPlayer(player))) - { - return false; - } - - utils.setScriptVar(player, "waitingOnCloneRespawn", 1); - - if (interior == null || interior.cell == null || interior.cell == obj_id.NULL_ID) - { - - warpPlayer(player, world.area, world.x, world.y, world.z, null, world.x, world.y, world.z, callback); - } - else - { - - warpPlayer(player, world.area, world.x, world.y, world.z, interior.cell, interior.x, interior.y, interior.z, callback); - } - return true; - } - - - public static boolean sendToAnyLocation(obj_id player, location world, location interior, String interiorCell) throws InterruptedException - { - - if ((player == null) || (world == null) || (!isPlayer(player))) - { - return false; - } - - if (interior == null || interiorCell == null) - { - - warpPlayer(player, world.area, world.x, world.y, world.z, null, world.x, world.y, world.z); - } - else - { - - warpPlayer(player, world.area, world.x, world.y, world.z, interior.cell, interiorCell, interior.x, interior.y, interior.z); - } - return true; - } - - - public static boolean sendToAnyLocation(obj_id player, String callback, location world, location interior, String interiorCell) throws InterruptedException - { - - if ((player == null) || (world == null) || (!isPlayer(player))) - { - return false; - } - - utils.setScriptVar(player, "waitingOnCloneRespawn", 1); - - if (interior == null || interiorCell == null) - { - - warpPlayer(player, world.area, world.x, world.y, world.z, null, world.x, world.y, world.z, callback); - } - else - { - - warpPlayer(player, world.area, world.x, world.y, world.z, interior.cell, interiorCell, interior.x, interior.y, interior.z, callback); - } - return true; - } - - - public static boolean clearEffectsForDeath(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - dot.removeAllDots(player); - - removeAllAttribModifiers(player); - - for (int i = 0; i < NUM_ATTRIBUTES; i++) - { - testAbortScript(); - String objvarName = "healing."+ healing.attributeToString(i).toLowerCase() + "_enhance"; - if (hasObjVar(player, objvarName)) - { - removeObjVar(player, objvarName); - } - - if (utils.hasScriptVar(player, objvarName)) - { - utils.removeScriptVar(player, objvarName); - } - } - - removeObjVar(player, "spice"); - utils.setScriptVar(player, "numPukes", 100 ); - detachScript(player, "player.player_spice"); - - if (hasObjVar(player, meditation.VAR_POWERBOOST_ACTIVE)) - { - removeObjVar(player, meditation.VAR_POWERBOOST_ACTIVE); - } - - setPosture(player, POSTURE_INCAPACITATED); - return true; - } - - - public static boolean isContainedByPlayer(obj_id player, obj_id item) throws InterruptedException - { - if ((player == null) || (item == null)) - { - return false; - } - - Vector containers = new Vector(); - containers.setSize(0); - - obj_id c = getContainedBy(item); - if ((c == obj_id.NULL_ID) || (c == null)) - { - return false; - } - - while ((c != obj_id.NULL_ID) && (c != null)) - { - testAbortScript(); - containers = utils.addElement(containers, c); - c = getContainedBy(c); - } - - if (utils.getElementPositionInArray(containers, player) > -1) - { - return true; - } - return false; - } - - - public static boolean msgAttachScript(obj_id player, String scriptName) throws InterruptedException - { - if ((player == null) || (scriptName.equals(""))) - { - return false; - } - - dictionary params = new dictionary(); - - params.put(DICT_SCRIPT_NAME, scriptName); - - return messageTo(player, HANDLER_ATTACH_SCRIPT, params, 0, true); - } - - - public static boolean msgDetachScript(obj_id player, String scriptName) throws InterruptedException - { - if ((player == null) || (scriptName.equals(""))) - { - return false; - } - - dictionary params = new dictionary(); - - params.put(DICT_SCRIPT_NAME, scriptName); - - return messageTo(player, HANDLER_DETACH_SCRIPT, params, 0, true); - } - - - public static boolean msgRemoveObjVar(obj_id player, String objVarName) throws InterruptedException - { - if ((player == null) || (objVarName.equals(""))) - { - return false; - } - - dictionary params = new dictionary(); - - params.put(DICT_OBJVAR_NAME, objVarName); - - return messageTo(player, HANDLER_REMOVE_OBJVAR, params, 0, true); - } - - - public static boolean msgGrantXP(obj_id player, String xpType, int xpAmount) throws InterruptedException - { - if ((player == null) || (xpType.equals(""))) - { - return false; - } - - dictionary params = new dictionary(); - - params.put(DICT_XP_TYPE, xpType); - params.put(DICT_XP_AMOUNT, xpAmount); - - return messageTo(player, HANDLER_GRANT_XP, params, 0, true); - } - - - public static boolean notifyGM(obj_id player, int nc) throws InterruptedException - { - if (player == null) - { - return false; - } - - switch (nc) - { - case NC_DEATH: - sendSystemMessagePlanetTestingOnly("DEATH-related error for player "+ getName(player) + " ("+ player + "). Please alert a GM on their behalf."); - break; - - default: - sendSystemMessagePlanetTestingOnly("Unknown error for player "+ getName(player) + " ("+ player + "). Please alert a GM on their behalf."); - break; - } - - return true; - } - - - public static void requestWaypointDestroy(obj_id target, obj_id wp) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(wp)) - { - return; - } - - dictionary params = new dictionary(); - params.put("wp", wp); - - messageTo(target, "handleWaypointDestroyRequest", params, 1f, true); - } - - - public static void requestWaypointRename(obj_id target, obj_id wp, String name) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(wp) || name == null || name.equals("")) - { - return; - } - - dictionary params = new dictionary(); - params.put("wp", wp); - params.put("name", name); - - messageTo(target, "handleWaypointRenameRequest", params, 1f, true); - } - - - public static void requestWaypointRename(obj_id target, obj_id wp, string_id sid_name) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(wp) || sid_name == null) - { - return; - } - - String name = utils.packStringId(sid_name); - - requestWaypointRename(target, wp, name); - } - - - public static String[] buildSortedResourceList(obj_id[] resources, String resourceClass, int branchLevel) throws InterruptedException - { - Vector resourceList = new Vector(); - resourceList.setSize(0); - - for (int i = 0; i < resources.length; i++) - { - testAbortScript(); - if (!isResourceDerivedFrom(resources[i], resourceClass)) - { - continue; - } - - String parent = getResourceClass(resources[i]); - String child = null; - - if (parent == null) - { - continue; - } - - while (!parent.equals(resourceClass)) - { - testAbortScript(); - child = parent; - parent = getResourceParentClass(child); - } - - if (child == null) - { - child = "\\#pcontrast1 "+getResourceName(resources[i])+"\\#."; - } - - for (int j = 0; j < branchLevel; j++) - { - testAbortScript(); - child = " "+ child; - } - - if (resourceList.indexOf(child) == -1) - { - resourceList.add(child); - } - } - - for (int i = 0; i < resourceList.size(); i++) - { - testAbortScript(); - String parent = ((String)(resourceList.get(i))).trim(); - String[] childBranch = buildSortedResourceList(resources, parent, branchLevel+1); - - for (int j = 0; j < childBranch.length; j++) - { - testAbortScript(); - resourceList.add(++i, childBranch[j]); - } - } - - return (String[])resourceList.toArray(new String[0]); - } - - - public static String createResourcePlanetReport(String[] resourceList, String planet, String resourceClass) throws InterruptedException - { - String report = "Incoming planetary survey report...\n\n"+ - "\\#pcontrast3 Planet: \\#pcontrast1 "+toUpper(planet, 0)+"\n"+ - "\\#pcontrast3 Resource Class: \\#pcontrast1 "+getClassString(resourceClass)+"\n\n"+ - "\\#pcontrast3 Resources located...\\#.\n\n"; - - for (int i = 0; i < resourceList.length; i++) - { - testAbortScript(); - String resourceName = resourceList[i].trim(); - - if (resourceName.startsWith("\\#")) - { - resourceName = resourceName.substring(13, resourceName.length()-3); - } - - obj_id resourceId = getResourceTypeByName(resourceName); - - if (resourceId == null) - { - report += " "+getTab(resourceList[i])+getClassString(resourceName)+"\n"; - } - else - { - report += " "+resourceList[i]+"\n"; - } - } - - report += "\n\n"; - - return report; - } - - - public static String getClassString(String className) throws InterruptedException - { - final String resourceTable = "datatables/resource/resource_tree.iff"; - - String classString = ""; - - int row = dataTableSearchColumnForString(className, 1, resourceTable); - int column = 2; - while ((classString == null || classString.length() == 0) && column <= 9) - { - testAbortScript(); - classString = dataTableGetString(resourceTable, row, column); - column++; - } - - return classString; - } - - - public static String getTab(String str) throws InterruptedException - { - String tab = ""; - int idx = 0; - - while (str.charAt(idx) == ' ') - { - testAbortScript(); - tab += " "; - idx++; - } - - return tab; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/library/performance.java b/sku.0/sys.server/compiled/game/script/library/performance.java deleted file mode 100644 index 7c872a95b..000000000 --- a/sku.0/sys.server/compiled/game/script/library/performance.java +++ /dev/null @@ -1,4482 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.colors; -import script.library.datatable; -import script.library.utils; -import script.library.sui; -import script.library.combat; -import script.library.camping; -import script.library.city; -import script.library.factions; -import script.library.groundquests; -import script.library.regions; -import script.library.group; -import script.library.pet_lib; -import script.library.xp; -import script.library.buff; -import script.library.prose; -import script.library.respec; -import script.library.session; -import script.library.beast_lib; - - -public class performance extends script.base_script -{ - public performance() - { - } - public static final String DATATABLE_PERFORMANCE = "datatables/performance/performance.iff"; - public static final String DATATABLE_COL_HEAL_WOUND = "healMindWound"; - public static final String DATATABLE_COL_HEAL_SHOCK = "healShockWound"; - public static final String DATATABLE_COL_LOOP_DURATION = "loopDuration"; - public static final String DATATABLE_COL_ACTION_COST = "actionPointsPerLoop"; - public static final String DATATABLE_COL_REQ_SKILL = "requiredSkillMod"; - public static final String DATATABLE_COL_REQ_SKILL_VALUE = "requiredSkillModValue"; - public static final String DATATABLE_COL_REQ_INSTRUMENT = "requiredInstrument"; - public static final String DATATABLE_COL_REQ_SONG = "requiredSong"; - public static final String DATATABLE_COL_REQ_DANCE = "requiredDance"; - public static final String DATATABLE_COL_REQ_JUGGLE = "requiredJuggle"; - public static final String DATATABLE_COL_BASE_XP = "baseXp"; - public static final String DATATABLE_COL_FLOURISH_XP_MOD = "flourishXpMod"; - - public static final String DATATABLE_PERFORMANCE_EFFECT = "datatables/performance/perform_effect.iff"; - public static final String DATATABLE_COL_EFFECT_PERFORM_TYPE = "performanceType"; - public static final String DATATABLE_COL_EFFECT_REQ_SKILL = "requiredSkillMod"; - public static final String DATATABLE_COL_EFFECT_REQ_SKILL_VAL = "requiredSkillModValue"; - public static final String DATATABLE_COL_EFFECT_REQ_PERFORM = "requiredPerforming"; - public static final String DATATABLE_COL_EFFECT_TARGET_TYPE = "targetType"; - public static final String DATATABLE_COL_EFFECT_DURATION = "effectDuration"; - public static final String DATATABLE_COL_EFFECT_ACTION_COST = "effectActionCost"; - - public static final String DATATABLE_INSTRUMENT = "datatables/tangible/instrument_datatable.iff"; - public static final String DATATABLE_COL_INSTRUMENT_NAME = "serverTemplateName"; - public static final String DATATABLE_COL_INSTRUMENT_ID = "instrumentAudioId"; - public static final String DATATABLE_COL_VISIBLE_NAME = "visibleName"; - - public static final float PERFORMANCE_HEARTBEAT_TIME = 10.0f; - public static final float PERFORMANCE_FLOURISH_ROUNDTIME = 0.0f; - public static final float PERFORMANCE_EFFECT_ROUNDTIME = 2.0f; - public static final float PERFORMANCE_HEAL_RANGE = 60.0f; - public static final float PERFORMANCE_INSPIRE_RANGE = 20.0f; - public static final float PERFORMANCE_XP_RANGE = 30.0f; - public static final float PERFORMANCE_OUTRO_ROUNDTIME = 15.0f; - public static final float PERFORMANCE_BAND_MEMBER_RANGE = 50.0f; - - public static final int MIN_BUFF_DELAY = 60; - public static final float INSPIRATION_BUFF_SEGMENT = 600.0f; - public static final float MAX_INSPIRATION_TIME = 10800.0f; - - public static final String BUFF_PERFORM_INSPIRATION = "perform_inspire_1"; - - public static final String MUSIC_HEARTBEAT_SCRIPT = "systems.skills.performance.active_music"; - public static final String DANCE_HEARTBEAT_SCRIPT = "systems.skills.performance.active_dance"; - public static final String JUGGLE_HEARTBEAT_SCRIPT = "systems.skills.performance.active_juggle"; - - public static final String PERFORMANCE_SELECT = "systems.skills.performance.select_performance"; - public static final String POST_PERFORMANCE = "systems.skills.performance.post_performance"; - public static final String PERFORMANCE_ENTERTAINED_SCRIPT = "systems.skills.performance.entertained"; - - public static final String PERFORMANCE_TYPE_DANCE = "perf_type_dance"; - public static final String PERFORMANCE_TYPE_MUSIC = "perf_type_music"; - public static final String PERFORMANCE_TYPE_JUGGLE = "perf_type_juggle"; - - public static final String NPC_ENTERTAINMENT_MESSAGE_START = "handleEntertainmentStart"; - public static final String NPC_ENTERTAINMENT_MESSAGE_STOP = "handleEntertainmentStop"; - public static final String NPC_ENTERTAINMENT_NO_ENTERTAIN = "ai.noClap"; - - public static final String VAR_PERFORM = "performance"; - public static final String VAR_PERFORM_FLOURISH = "performance.flourish"; - public static final String VAR_PERFORM_COVERCHARGE = "performance.covercharge"; - public static final String VAR_PERFORM_NO_PAY = "performance.no_pay"; - public static final String VAR_PERFORM_PAY_WAIT = "performance.pay_wait"; - public static final String VAR_PERFORM_PAY_AGREE = "performance.pay_agree"; - public static final String VAR_PERFORM_PAY_DISAGREE = "performance.pay_disagree"; - public static final String VAR_PERFROM_ALREADY_PAID = "performance.already_paid"; - public static final String VAR_PERFORM_INSPIRATION = "performance.inspiration"; - public static final String VAR_PERFORM_EFFECT = "performance.effect"; - public static final String VAR_PERFORM_OUTRO = "post_performance.outro"; - public static final String VAR_PERFORM_SEQUENCE = "performance.sequence"; - public static final String VAR_PERFORM_APPLAUSE_COUNT = "performance.applause_count"; - public static final String VAR_PERFORM_FLOURISH_COUNT = "performance.flourish_count"; - public static final String VAR_PERFORM_FLOURISH_TOTAL = "performance.flourish_total"; - public static final String VAR_PERFORM_FLOURISH_XP = "performance.flourish_xp"; - public static final String VAR_PERFORM_NO_BAND_FLOURISH = "setting.performance.no_band_flourish"; - public static final String VAR_AVAILABLE_PERFORMANCES = "performance.available_performances"; - public static final String VAR_SELECT_JUGGLE_CHANGE = "performance.change_juggle"; - public static final String VAR_SELECT_DANCE_CHANGE = "performance.change_dance"; - public static final String VAR_SELECT_MUSIC_CHANGE = "performance.change_music"; - public static final String VAR_SELECT_MUSIC_BAND = "performance.band_command"; - public static final String VAR_PERFORM_MOOD = "performance.old_mood"; - public static final String VAR_PERFORM_BUFF_TARGET = "performance.buff_target"; - public static final String VAR_HEALING_XP_WOUND = "performance.healing_xp.wound"; - public static final String VAR_HEALING_XP_DAMAGE = "performance.healing_xp.damage"; - public static final String VAR_HEALING_XP_BUFF = "performance.healing_xp.buff"; - public static final String VAR_TROUPE = "performance.troupe"; - public static final String VAR_CURRENT_DANCE = "performance.dance.current"; - - public static final String VAR_BUFF_LIST = "performance.buff.list"; - public static final String VAR_BUFF_TARGET = "performance.buff.target"; - public static final String VAR_BUFF_SUI = "performance.buff.pid"; - public static final String VAR_BUFF_TYPE = "performance.buff.type"; - - public static final int PERFORM_XP_FLOURISH_MAX = 2; - public static final int PERFORM_XP_GROUP_MAX = 8; - public static final int PERFORM_XP_AUDIENCE_MAX_1 = 15; - public static final int PERFORM_XP_AUDIENCE_MAX_2 = 35; - public static final int PERFORM_XP_APPLAUSE_MAX = 5; - public static final int PERFORM_XP_INSPIRATION = 10; - public static final int CURE_CLONING_SICKNESS_XP = 50; - - public static final float PERFORM_XP_GROUP_MOD = 0.33f; - public static final float INSPIRATION_BONUS = .10f; - - public static final String[] APPLAUSE_POSTIVE = - { - "applaud", - "bang", - "cheer", - "clap", - "congratulate", - "encourage", - "softclap", - "tiphat" - }; - - public static final String[] APPLAUSE_NEGATIVE = - { - "bored", - "fidget", - "frown", - "gag", - "groan", - "hiss", - "nausea", - "puke", - "raspberry", - "shake", - "wince", - "zone" - }; - - public static final String[] INSPIRATION_BUFF_ENTERTAINER = - { - "general_inspiration", - "artisan_inspiration", - "entertainer_inspiration" - }; - - public static final String[] INSPIRATION_BUFF_DANCER = - { - "architect_inspiration", - "chef_inspiration", - "tailor_inspiration", - "merchant_inspiration" - }; - - public static final String[] INSPIRATION_BUFF_MUSICIAN = - { - "droidengineer_inspiration", - "weaponsmith_inspiration", - "shipwright_inspiration", - "armorsmith_inspiration" - }; - - public static final int PERFORMANCE_EFFECT_DAZZLE = 1; - public static final int PERFORMANCE_EFFECT_DISTRACT = 2; - public static final int PERFORMANCE_EFFECT_SPOT_LIGHT = 3; - public static final int PERFORMANCE_EFFECT_COLOR_LIGHTS = 4; - public static final int PERFORMANCE_EFFECT_SMOKE_BOMB = 5; - public static final int PERFORMANCE_EFFECT_FIRE_JETS = 6; - public static final int PERFORMANCE_EFFECT_VENTRILOQUISM = 7; - public static final int PERFORMANCE_EFFECT_CENTER_STAGE = 8; - public static final int PERFORMANCE_EFFECT_COLOR_SWIRL = 9; - public static final int PERFORMANCE_EFFECT_DANCE_FLOOR = 10; - public static final int PERFORMANCE_EFFECT_FEATURED_SOLO = 11; - public static final int PERFORMANCE_EFFECT_FIRE_JETS2 = 12; - public static final int PERFORMANCE_EFFECT_LASER_SHOW = 13; - - public static final int SPECIAL_FLOURISH_OUTRO = -1; - public static final int SPECIAL_FLOURISH_PAUSE_MUSIC = 0; - - public static final int HOLOGRAM_COMMAND_START_SONG = 1; - public static final int HOLOGRAM_COMMAND_CHANGE_SONG = 2; - public static final int HOLOGRAM_COMMAND_STOP_SONG = 3; - public static final int HOLOGRAM_COMMAND_START_DANCE = 4; - public static final int HOLOGRAM_COMMAND_CHANGE_DANCE = 5; - public static final int HOLOGRAM_COMMAND_STOP_DANCE = 6; - - public static final String EFFECT_SPOT_LIGHT_1 = "clienteffect/entertainer_spot_light_level_1.cef"; - public static final String EFFECT_SPOT_LIGHT_2 = "clienteffect/entertainer_spot_light_level_2.cef"; - public static final String EFFECT_SPOT_LIGHT_3 = "clienteffect/entertainer_spot_light_level_3.cef"; - public static final String EFFECT_COLOR_LIGHTS_1 = "clienteffect/entertainer_color_lights_level_1.cef"; - public static final String EFFECT_COLOR_LIGHTS_2 = "clienteffect/entertainer_color_lights_level_2.cef"; - public static final String EFFECT_COLOR_LIGHTS_3 = "clienteffect/entertainer_color_lights_level_3.cef"; - public static final String EFFECT_DAZZLE_1 = "clienteffect/entertainer_dazzle_level_1.cef"; - public static final String EFFECT_DAZZLE_2 = "clienteffect/entertainer_dazzle_level_2.cef"; - public static final String EFFECT_DAZZLE_3 = "clienteffect/entertainer_dazzle_level_3.cef"; - public static final String EFFECT_DISTRACT_1 = "clienteffect/entertainer_distract_level_1.cef"; - public static final String EFFECT_DISTRACT_2 = "clienteffect/entertainer_distract_level_2.cef"; - public static final String EFFECT_DISTRACT_3 = "clienteffect/entertainer_distract_level_3.cef"; - public static final String EFFECT_SMOKE_BOMB_1 = "clienteffect/entertainer_smoke_bomb_level_1.cef"; - public static final String EFFECT_SMOKE_BOMB_2 = "clienteffect/entertainer_smoke_bomb_level_2.cef"; - public static final String EFFECT_SMOKE_BOMB_3 = "clienteffect/entertainer_smoke_bomb_level_3.cef"; - public static final String EFFECT_FIRE_JETS_1 = "clienteffect/entertainer_fire_jets_level_1.cef"; - public static final String EFFECT_FIRE_JETS_2 = "clienteffect/entertainer_fire_jets_level_2.cef"; - public static final String EFFECT_FIRE_JETS_3 = "clienteffect/entertainer_fire_jets_level_3.cef"; - public static final String EFFECT_VENTRILOQUISM_1 = "clienteffect/entertainer_ventriloquism_level_1.cef"; - public static final String EFFECT_VENTRILOQUISM_2 = "clienteffect/entertainer_ventriloquism_level_2.cef"; - public static final String EFFECT_VENTRILOQUISM_3 = "clienteffect/entertainer_ventriloquism_level_3.cef"; - - public static final String EFFECT_CENTER_STAGE = "clienteffect/entertainer_center_stage.cef"; - public static final String EFFECT_COLOR_SWIRL = "clienteffect/entertainer_color_swirl.cef"; - public static final String EFFECT_DANCE_FLOOR = "clienteffect/entertainer_dance_floor.cef"; - public static final String EFFECT_FEATURED_SOLO = "clienteffect/entertainer_featured_solo.cef"; - public static final String EFFECT_FIRE_JETS2 = "clienteffect/entertainer_fire_jets2.cef"; - public static final String EFFECT_LASER_SHOW = "clienteffect/entertainer_laser_show.cef"; - - public static final string_id SID_RADIAL_PERFORMANCE_LISTEN = new string_id("radial_performance", "listen"); - public static final string_id SID_RADIAL_PERFORMANCE_WATCH = new string_id("radial_performance", "watch"); - public static final string_id SID_RADIAL_PERFORMANCE_LISTEN_STOP = new string_id("radial_performance", "listen_stop"); - public static final string_id SID_RADIAL_PERFORMANCE_WATCH_STOP = new string_id("radial_performance", "watch_stop"); - - public static final string_id SID_ALREADY_PERFORMING_SELF = new string_id("performance", "already_performing_self"); - - public static final string_id SID_MUSIC_NO_INSTRUMENT = new string_id("performance", "music_no_instrument"); - public static final string_id SID_MUSIC_HOLOGRAM_NO_INSTRUMENT = new string_id("performance", "music_hologram_no_instrument"); - - public static final string_id SID_MUSIC_INVALID_SONG = new string_id("performance", "music_invalid_song"); - public static final string_id SID_MUSIC_START_SELF = new string_id("performance", "music_start_self"); - public static final string_id SID_MUSIC_START_OTHER = new string_id("performance", "music_start_other"); - public static final string_id SID_MUSIC_START_BAND_SELF = new string_id("performance", "music_start_band_self"); - public static final string_id SID_MUSIC_START_BAND_MEMBERS = new string_id("performance", "music_start_band_members"); - public static final string_id SID_MUSIC_START_BAND_OTHER = new string_id("performance", "music_start_band_other"); - public static final string_id SID_MUSIC_JOIN_BAND_SELF = new string_id("performance", "music_join_band_self"); - public static final string_id SID_MUSIC_JOIN_BAND_STOP = new string_id("performance", "music_join_band_stop"); - public static final string_id SID_MUSIC_BAND_JOIN_SONG_SELF = new string_id("performance", "music_band_join_song_self"); - public static final string_id SID_MUSIC_BAND_JOIN_SONG_MEMBERS = new string_id("performance", "music_band_join_song_members"); - public static final string_id SID_MUSIC_STOP_SELF = new string_id("performance", "music_stop_self"); - public static final string_id SID_MUSIC_STOP_OTHER = new string_id("performance", "music_stop_other"); - public static final string_id SID_MUSIC_STOP_BAND_SELF = new string_id("performance", "music_stop_band_self"); - public static final string_id SID_MUSIC_STOP_BAND_MEMBERS = new string_id("performance", "music_stop_band_members"); - public static final string_id SID_MUSIC_STOP_BAND_OTHER = new string_id("performance", "music_stop_band_other"); - public static final string_id SID_MUSIC_PREPARE_STOP_SELF = new string_id("performance", "music_prepare_stop_self"); - public static final string_id SID_MUSIC_PREPARE_STOP_BAND_SELF = new string_id("performance", "music_prepare_stop_band_self"); - public static final string_id SID_MUSIC_PREPARE_STOP_BAND_MEMBERS = new string_id("performance", "music_prepare_stop_band_members"); - public static final string_id SID_MUSIC_LISTEN_SELF = new string_id("performance", "music_listen_self"); - public static final string_id SID_MUSIC_LISTEN_STOP_SELF = new string_id("performance", "music_listen_stop_self"); - public static final string_id SID_MUSIC_LISTEN_PLAYING_SELF = new string_id("performance", "music_listen_playing_self"); - public static final string_id SID_MUSIC_LISTEN_NOT_PLAYING = new string_id("performance", "music_listen_not_playing"); - public static final string_id SID_MUSIC_LISTEN_OUT_OF_RANGE = new string_id("performance", "music_listen_out_of_range"); - public static final string_id SID_MUSIC_LISTEN_NPC = new string_id("performance", "music_listen_npc"); - public static final string_id SID_MUSIC_STILL_PLAYING = new string_id("performance", "music_still_playing"); - public static final string_id SID_MUSIC_NOT_MUSICIAN = new string_id("performance", "music_not_musician"); - public static final string_id SID_MUSIC_NOT_PERFORMING = new string_id("performance", "music_not_performing"); - public static final string_id SID_MUSIC_MUST_BE_PERFORMING_SELF = new string_id("performance", "music_must_be_performing_self"); - public static final string_id SID_MUSIC_LACK_SKILL_INSTRUMENT = new string_id("performance", "music_lack_skill_instrument"); - public static final string_id SID_MUSIC_LACK_SKILL_SONG_SELF = new string_id("performance", "music_lack_skill_song_self"); - public static final string_id SID_MUSIC_LACK_SKILL_SONG_BAND = new string_id("performance", "music_lack_skill_song_band"); - public static final string_id SID_MUSIC_LACK_SKILL_BAND_MEMBER = new string_id("performance", "music_lack_skill_band_member"); - public static final string_id SID_MUSIC_MUST_MATCH_BAND = new string_id("performance", "music_must_match_band"); - public static final string_id SID_MUSIC_FAIL = new string_id("performance", "music_fail"); - public static final string_id SID_MUSIC_OUTRO_WAIT = new string_id("performance", "music_outro_wait"); - public static final string_id SID_MUSIC_TOO_TIRED = new string_id("performance", "music_too_tired"); - public static final string_id SID_MUSIC_NO_MUSIC_PARAM = new string_id("performance", "music_no_music_param"); - public static final string_id SID_MUSIC_TRACK_NOT_AVAILABLE = new string_id("performance", "music_track_not_available"); - public static final string_id SID_MUSIC_OUT_OF_POWER = new string_id("performance", "music_out_of_power"); - - public static final string_id SID_DANCE_START_SELF = new string_id("performance", "dance_start_self"); - public static final string_id SID_DANCE_START_OTHER = new string_id("performance", "dance_start_other"); - public static final string_id SID_DANCE_STOP_SELF = new string_id("performance", "dance_stop_self"); - public static final string_id SID_DANCE_STOP_OTHER = new string_id("performance", "dance_stop_other"); - public static final string_id SID_DANCE_WATCH_SELF = new string_id("performance", "dance_watch_self"); - public static final string_id SID_DANCE_WATCH_STOP_SELF = new string_id("performance", "dance_watch_stop_self"); - public static final string_id SID_DANCE_WATCH_NOT_DANCING = new string_id("performance", "dance_watch_not_dancing"); - public static final string_id SID_DANCE_WATCH_OUT_OF_RANGE = new string_id("performance", "dance_watch_out_of_range"); - public static final string_id SID_DANCE_WATCH_NPC = new string_id("performance", "dance_watch_npc"); - public static final string_id SID_DANCE_MUST_BE_PERFORMING_SELF = new string_id("performance", "dance_must_be_performing_self"); - public static final string_id SID_DANCE_NOT_PERFORMING = new string_id("performance", "dance_not_performing"); - public static final string_id SID_DANCE_UNKNOWN_SELF = new string_id("performance", "dance_unknown_self"); - public static final string_id SID_DANCE_LACK_SKILL_SELF = new string_id("performance", "dance_lack_skill_self"); - public static final string_id SID_DANCE_NOT_DANCER = new string_id("performance", "dance_not_dancer"); - public static final string_id SID_DANCE_TOO_TIRED = new string_id("performance", "dance_too_tired"); - public static final string_id SID_DANCE_NO_DANCE_PARAM = new string_id("performance", "dance_no_dance_param"); - public static final string_id SID_DANCE_FAIL = new string_id("performance", "dance_fail"); - public static final string_id SID_DANCE_LACK_SKILL_BAND = new string_id("performance", "dance_lack_skill_band"); - public static final string_id SID_DANCE_LACK_SKILL_BAND_MEMBER = new string_id("performance", "dance_lack_skill_band_member"); - - public static final string_id SID_JUGGLE_START_SELF = new string_id("performance", "juggle_start_self"); - public static final string_id SID_JUGGLE_START_OTHER = new string_id("performance", "juggle_start_other"); - public static final string_id SID_JUGGLE_STOP_SELF = new string_id("performance", "juggle_stop_self"); - public static final string_id SID_JUGGLE_STOP_OTHER = new string_id("performance", "juggle_stop_other"); - public static final string_id SID_JUGGLE_WATCH_SELF = new string_id("performance", "juggle_watch_self"); - public static final string_id SID_JUGGLE_WATCH_STOP_SELF = new string_id("performance", "juggle_watch_stop_self"); - public static final string_id SID_JUGGLE_WATCH_NOT_DANCING = new string_id("performance", "juggle_watch_not_juggling"); - public static final string_id SID_JUGGLE_WATCH_OUT_OF_RANGE = new string_id("performance", "juggle_watch_out_of_range"); - public static final string_id SID_JUGGLE_WATCH_NPC = new string_id("performance", "juggle_watch_npc"); - public static final string_id SID_JUGGLE_MUST_BE_PERFORMING_SELF = new string_id("performance", "juggle_must_be_performing_self"); - public static final string_id SID_JUGGLE_NOT_PERFORMING = new string_id("performance", "juggle_not_performing"); - public static final string_id SID_JUGGLE_UNKNOWN_SELF = new string_id("performance", "juggle_unknown_self"); - public static final string_id SID_JUGGLE_LACK_SKILL_SELF = new string_id("performance", "juggle_lack_skill_self"); - public static final string_id SID_JUGGLE_NOT_JUGGLER = new string_id("performance", "juggle_not_juggler"); - public static final string_id SID_JUGGLE_TOO_TIRED = new string_id("performance", "juggle_too_tired"); - public static final string_id SID_JUGGLE_NO_JUGGLE_PARAM = new string_id("performance", "juggle_no_juggle_param"); - public static final string_id SID_JUGGLE_FAIL = new string_id("performance", "juggle_fail"); - - public static final string_id SID_FLOURISH_WAIT_SELF = new string_id("performance", "flourish_wait_self"); - public static final string_id SID_FLOURISH_PERFORM = new string_id("performance", "flourish_perform"); - public static final string_id SID_FLOURISH_PERFORM_BAND_SELF = new string_id("performance", "flourish_perform_band_self"); - public static final string_id SID_FLOURISH_PERFORM_BAND_MEMBER = new string_id("performance", "flourish_perform_band_member"); - public static final string_id SID_FLOURISH_FORMAT = new string_id("performance", "flourish_format"); - public static final string_id SID_BAND_FLOURISH_FORMAT = new string_id("performance", "band_flourish_format"); - public static final string_id SID_BAND_SOLO_FORMAT = new string_id("performance", "band_solo_format"); - public static final string_id SID_BAND_PAUSE_FORMAT = new string_id("performance", "band_pause_format"); - public static final string_id SID_BAND_FLOURISH_ON = new string_id("performance", "band_flourish_on"); - public static final string_id SID_BAND_FLOURISH_OFF = new string_id("performance", "band_flourish_off"); - public static final string_id SID_BAND_FLOURISH_STATUS_ON = new string_id("performance", "band_flourish_status_on"); - public static final string_id SID_BAND_FLOURISH_STATUS_OFF = new string_id("performance", "band_flourish_status_off"); - public static final string_id SID_FLOURISH_NOT_PERFORMING = new string_id("performance", "flourish_not_performing"); - public static final string_id SID_FLOURISH_NOT_VALID = new string_id("performance", "flourish_not_valid"); - public static final string_id SID_FLOURISH_TOO_TIRED = new string_id("performance", "flourish_too_tired"); - public static final string_id SID_FLOURISH_INSTRUMENT_UNKNOWN = new string_id("performance", "flourish_instrument_unknown"); - - public static final string_id SID_EFFECT_WAIT_SELF = new string_id("performance", "effect_wait_self"); - public static final string_id SID_EFFECT_NOT_PERFORMING = new string_id("performance", "effect_not_performing"); - public static final string_id SID_EFFECT_NOT_PERFORMING_CORRECT = new string_id("performance", "effect_not_performing_correct"); - public static final string_id SID_EFFECT_LACK_SKILL_SELF = new string_id("performance", "effect_lack_skill_self"); - public static final string_id SID_EFFECT_TOO_TIRED = new string_id("performance", "effect_too_tired"); - public static final string_id SID_EFFECT_NEED_TARGET = new string_id("performance", "effect_need_target"); - public static final string_id SID_EFFECT_LEVEL_TOO_HIGH = new string_id("performance", "effect_level_too_high"); - public static final string_id SID_EFFECT_PERFORM_SPOT_LIGHT = new string_id("performance", "effect_perform_spot_light"); - public static final string_id SID_EFFECT_PERFORM_COLOR_LIGHTS = new string_id("performance", "effect_perform_color_lights"); - public static final string_id SID_EFFECT_PERFORM_DAZZLE = new string_id("performance", "effect_perform_dazzle"); - public static final string_id SID_EFFECT_PERFORM_DISTRACT = new string_id("performance", "effect_perform_distract"); - public static final string_id SID_EFFECT_PERFORM_SMOKE_BOMB = new string_id("performance", "effect_perform_smoke_bomb"); - public static final string_id SID_EFFECT_PERFORM_FIRE_JETS = new string_id("performance", "effect_perform_fire_jets"); - public static final string_id SID_EFFECT_PERFORM_VENTRILOQUISM = new string_id("performance", "effect_perform_ventriloquism"); - public static final string_id SID_EFFECT_PERFORM_CENTER_STAGE = new string_id("performance", "effect_perform_center_stage"); - public static final string_id SID_EFFECT_PERFORM_COLOR_SWIRL = new string_id("performance", "effect_perform_color_swirl"); - public static final string_id SID_EFFECT_PERFORM_DANCE_FLOOR = new string_id("performance", "effect_perform_dance_floor"); - public static final string_id SID_EFFECT_PERFORM_FEATURED_SOLO = new string_id("performance", "effect_perform_featured_solo"); - public static final string_id SID_EFFECT_PERFORM_FIRE_JETS_2 = new string_id("performance", "effect_perform_fire_jets_2"); - public static final string_id SID_EFFECT_PERFORM_LASER_SHOW = new string_id("performance", "effect_perform_laser_show"); - - public static final string_id SID_BUFF_SET_TARGET_SELF = new string_id("performance", "buff_set_target_self"); - public static final string_id SID_BUFF_SET_TARGET_OTHER = new string_id("performance", "buff_set_target_other"); - public static final string_id SID_BUFF_INVALID_TARGET_SELF = new string_id("performance", "buff_invalid_target_self"); - - public static final string_id SID_DENY_SERVICE_ADD_SELF = new string_id("performance", "deny_service_add_self"); - public static final string_id SID_DENY_SERVICE_ADD_OTHER = new string_id("performance", "deny_service_add_other"); - public static final string_id SID_DENY_SERVICE_REMOVE_SELF = new string_id("performance", "deny_service_remove_self"); - public static final string_id SID_DENY_SERVICE_REMOVE_OTHER = new string_id("performance", "deny_service_remove_other"); - public static final string_id SID_DENY_SERVICE_COVER_CHARGE = new string_id("performance", "deny_service_cover_charge"); - - public static final string_id SID_INSPIRE_MAX = new string_id("performance", "perform_inspire_max"); - public static final string_id SID_INSPIRE_BUILDING = new string_id("performance", "perform_inspire_building"); - - public static final string_id SID_CC_START_CHARGE = new string_id("performance", "cc_start_charge"); - public static final string_id SID_CC_STOP_CHARGE = new string_id("performance", "cc_stop_charge"); - public static final string_id SID_CC_NO_FUNDS = new string_id("performance", "cc_no_funds"); - - public static final string_id SID_CC_NO_SKILL = new string_id("performance", "cc_no_skill"); - public static final string_id SID_PERFORM_CC_QUERY1 = new string_id("performance", "cc_query1"); - public static final string_id SID_PERFORM_CC_QUERY2 = new string_id("performance", "cc_query2"); - public static final string_id SID_PERFORM_CC_QUERY_TITLE = new string_id("performance", "cc_query_t"); - - public static final string_id BUFF_TIME_FAILED = new string_id("performance", "buff_time_failed"); - - public static final string_id SHAPECHANGE = new string_id("spam","not_while_shapechanged"); - - - public static void stopInspiration(obj_id actor) throws InterruptedException - { - int inspireBuffCrc = buff.getBuffOnTargetFromGroup(actor, "inspiration"); - - float buff_time = utils.getFloatScriptVar(actor, VAR_PERFORM_INSPIRATION); - - utils.removeScriptVar(actor, VAR_BUFF_TYPE); - - if (utils.hasScriptVar(actor, "performance.inspireMaxReached")) - { - utils.removeScriptVar(actor, "performance.inspireMaxReached"); - } - } - - - public static void stopListen(obj_id actor) throws InterruptedException - { - obj_id watchTarget = getPerformanceWatchTarget(actor); - obj_id listenTarget = getPerformanceListenTarget(actor); - - stopListeningToMessage(listenTarget, "handlePerformerStartPerforming"); - stopListeningToMessage(listenTarget, "handlePerformerStopPerforming"); - removeTriggerVolume("performance_listen_volume"); - - if (!isIdValid(watchTarget)) - { - detachScript(actor, PERFORMANCE_ENTERTAINED_SCRIPT); - } - - setPerformanceListenTarget(actor, obj_id.NULL_ID); - checkPlayerEntertained(actor, "dancer"); - - if (utils.hasScriptVar(actor, VAR_PERFORM_INSPIRATION)) - { - stopInspiration(actor); - } - - if (!utils.hasScriptVar(actor, VAR_PERFROM_ALREADY_PAID)) - { - int charge = utils.getIntScriptVar(actor, performance.VAR_PERFORM_PAY_AGREE); - money.systemPayout(money.ACCT_PERFORM_ESCROW, listenTarget, charge, "handlePayment", null); - } - - utils.removeScriptVar(actor, VAR_PERFORM_PAY_AGREE); - utils.removeScriptVar(actor, VAR_PERFORM_PAY_WAIT); - utils.removeScriptVar(actor, VAR_PERFORM_PAY_DISAGREE); - utils.removeScriptVar(actor, VAR_PERFROM_ALREADY_PAID); - utils.removeScriptVar(actor, VAR_PERFORM_INSPIRATION); - - } - - - public static void listen(obj_id actor, obj_id target) throws InterruptedException - { - session.logActivity(actor, session.ACTIVITY_BEEN_ENTERTAINED); - obj_id musician = getPerformanceListenTarget(actor); - - LOG ("performance_listen", "Current listen target is "+ musician); - - if (isIdValid(musician)) - { - stopListen(musician); - } - - if (!isIdValid(target)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LISTEN_STOP_SELF); - stopListen(actor); - return; - } - - if (!isPlayer(target)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LISTEN_NPC); - return; - } - - if (!hasScript(target, MUSIC_HEARTBEAT_SCRIPT)) - { - performanceMessageToSelf(actor, target, SID_MUSIC_LISTEN_NOT_PLAYING); - return; - } - - if (utils.hasScriptVar(target, performance.VAR_PERFORM_COVERCHARGE)) - { - if (checkDenyService(target, actor)) - { - sendSystemMessage(actor, new string_id("performance", "deny_cant_pay_cover")); - utils.setScriptVar(actor, performance.VAR_PERFORM_PAY_WAIT, 0); - } - else - { - int charge = utils.getIntScriptVar(target, performance.VAR_PERFORM_COVERCHARGE); - utils.setScriptVar(actor, performance.VAR_PERFORM_PAY_WAIT, charge); - String title = "@performance:cc_query_t"; - String prompt = "@performance:cc_query1"; - prompt += " "+ charge + " "; - prompt += "@performance:cc_query2"; - sui.msgbox(target, actor, prompt, sui.YES_NO, title, "HandleCoverCharge"); - - utils.setScriptVar(actor, "dancerID", target); - } - } - - setPerformanceListenTarget(actor, target); - - if (actor != target) - { - listenToMessage(target, "handlePerformerStopPerforming"); - - createTriggerVolume("performance_listen_volume", PERFORMANCE_HEAL_RANGE, true); - - addTriggerVolumeEventSource("performance_listen_volume", target); - - startEntertainingPlayer(actor); - utils.setScriptVar(actor, "performance.musicBuffTimer", getGameTime()); - - if (!hasScript(actor, PERFORMANCE_ENTERTAINED_SCRIPT)) - { - attachScript(actor, PERFORMANCE_ENTERTAINED_SCRIPT); - } - - if (hasScript(target, "quest.crowd_pleaser.player_popularity")) - { - dictionary popularity = new dictionary(); - popularity.put("player", actor); - messageTo(target, "handleEntertainedPlayer", popularity, 1, false); - } - - if (hasScript(target, "theme_park.new_player.new_player")) - { - dictionary webster = new dictionary(); - webster.put("listener", actor); - messageTo(target, "handleNewPlayerEntertainerAction", webster, 1, false); - - obj_id[] bandMembers = getBandMembers(target); - if (bandMembers != null && bandMembers.length > 0) - { - for (int i = 0; i < bandMembers.length; i++) - { - testAbortScript(); - obj_id bandMate = bandMembers[i]; - if (isIdValid(bandMate)) - { - messageTo(bandMate, "handleNewPlayerEntertainerAction", webster, 1, false); - } - } - } - } - } - - if (!utils.hasScriptVar(target, performance.VAR_PERFORM_COVERCHARGE)) - { - performanceMessageToSelf(actor, target, SID_MUSIC_LISTEN_SELF); - } - } - - - public static void stopWatch(obj_id actor) throws InterruptedException - { - obj_id watchTarget = getPerformanceWatchTarget(actor); - obj_id listenTarget = getPerformanceListenTarget(actor); - - stopListeningToMessage(watchTarget, "handlePerformerStartPerforming"); - stopListeningToMessage(watchTarget, "handlePerformerStopPerforming"); - removeTriggerVolume("performance_watch_volume"); - - if (!isIdValid(listenTarget)) - { - detachScript(actor, PERFORMANCE_ENTERTAINED_SCRIPT); - } - - setPerformanceWatchTarget(actor, obj_id.NULL_ID); - checkPlayerEntertained(actor, "musician"); - - if (utils.hasScriptVar(actor, VAR_PERFORM_INSPIRATION)) - { - stopInspiration(actor); - } - - if (!utils.hasScriptVar(actor, VAR_PERFROM_ALREADY_PAID)) - { - int charge = utils.getIntScriptVar(actor, performance.VAR_PERFORM_PAY_AGREE); - money.systemPayout(money.ACCT_PERFORM_ESCROW, watchTarget, charge, "handlePayment", null); - } - - utils.removeScriptVar(actor, VAR_PERFORM_PAY_AGREE); - utils.removeScriptVar(actor, VAR_PERFORM_PAY_WAIT); - utils.removeScriptVar(actor, VAR_PERFORM_PAY_DISAGREE); - utils.removeScriptVar(actor, VAR_PERFROM_ALREADY_PAID); - utils.removeScriptVar(actor, VAR_PERFORM_INSPIRATION); - - } - - - public static void watch(obj_id actor, obj_id target) throws InterruptedException - { - session.logActivity(actor, session.ACTIVITY_BEEN_ENTERTAINED); - obj_id dancer = getPerformanceWatchTarget(actor); - - if (isIdValid(dancer)) - { - stopWatch(dancer); - } - - if (!isIdValid(target)) - { - performanceMessageToSelf(actor, null, SID_DANCE_WATCH_STOP_SELF); - stopWatch(actor); - return; - } - - if (!isPlayer(target)) - { - performanceMessageToSelf(actor, null, SID_DANCE_WATCH_NPC); - return; - } - - if (!hasScript(target, DANCE_HEARTBEAT_SCRIPT)) - { - performanceMessageToSelf(actor, target, SID_DANCE_WATCH_NOT_DANCING); - return; - } - - if (utils.hasScriptVar(target, performance.VAR_PERFORM_COVERCHARGE)) - { - if (checkDenyService(target, actor)) - { - sendSystemMessage(actor, new string_id("performance", "deny_cant_pay_cover")); - utils.setScriptVar(actor, performance.VAR_PERFORM_PAY_WAIT, 0); - } - else - { - int charge = utils.getIntScriptVar(target, performance.VAR_PERFORM_COVERCHARGE); - utils.setScriptVar(actor, performance.VAR_PERFORM_PAY_WAIT, charge); - String title = "@performance:cc_query_t"; - String prompt = "@performance:cc_query1"; - prompt += " "+ charge + " "; - prompt += "@performance:cc_query2"; - sui.msgbox(target, actor, prompt, sui.YES_NO, title, "HandleCoverCharge"); - - utils.setScriptVar(actor, "dancerID", target); - } - } - - setPerformanceWatchTarget(actor, target); - - listenToMessage(target, "handlePerformerStopPerforming"); - - createTriggerVolume("performance_watch_volume", PERFORMANCE_HEAL_RANGE, true); - - addTriggerVolumeEventSource("performance_watch_volume", target); - - startEntertainingPlayer(actor); - utils.setScriptVar(actor, "performance.dancerBuffTimer", getGameTime()); - - if (!hasScript(actor, PERFORMANCE_ENTERTAINED_SCRIPT)) - { - attachScript(actor, PERFORMANCE_ENTERTAINED_SCRIPT); - } - - if (hasScript(target, "theme_park.new_player.new_player")) - { - dictionary webster = new dictionary(); - webster.put("watcher", actor); - messageTo(target, "handleNewPlayerEntertainerAction", webster, 1, false); - } - - if (hasScript(target, "quest.crowd_pleaser.player_popularity")) - { - dictionary popularity = new dictionary(); - popularity.put("player", actor); - messageTo(target, "handleEntertainedPlayer", popularity, 1, false); - } - - if (!utils.hasScriptVar(target, performance.VAR_PERFORM_COVERCHARGE)) - { - performanceMessageToSelf(actor, target, SID_DANCE_WATCH_SELF); - } - } - - - public static void covercharge(obj_id actor, int amount) throws InterruptedException - { - if (!hasCommand(actor, "covercharge")) - { - performanceMessageToSelf(actor, null, SID_CC_NO_SKILL); - return; - } - - utils.setScriptVar(actor, VAR_PERFORM_COVERCHARGE, amount); - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_CC_START_CHARGE); - pp = prose.setDI(pp, amount); - sendSystemMessageProse(actor, pp); - - return; - } - - - public static void startEntertainingPlayer(obj_id actor) throws InterruptedException - { - - setAnimationMood(actor, "entertained"); - - if (beast_lib.getBeastOnPlayer(actor) != null) - { - obj_id beast = beast_lib.getBeastOnPlayer(actor); - obj_id beastBCD = beast_lib.getBeastBCD(beast); - messageTo (beastBCD, "ownerEntertained", null, 1, false); - } - } - - - public static void stopEntertainingPlayer(obj_id actor) throws InterruptedException - { - - setAnimationMood(actor, "default"); - - detachScript(actor, PERFORMANCE_ENTERTAINED_SCRIPT); - } - - - public static boolean checkPlayerEntertained(obj_id actor, String performanceCheck) throws InterruptedException - { - LOG ("performance_entertained", "Checking to see if still being entertained"); - - boolean entertained = false; - - if (performanceCheck.equals("dancer") || performanceCheck.equals("both")) - { - obj_id dancer = getPerformanceWatchTarget(actor); - - if (isIdValid(dancer)) - { - if (getDistance(actor, dancer) < PERFORMANCE_HEAL_RANGE) - { - if (getPerformanceType(dancer) != 0) - { - LOG ("performance_entertained", "Still watching a dancer, still entertained"); - entertained = true; - } - } - else - { - performance.performanceMessageToSelf(actor, dancer, performance.SID_DANCE_WATCH_OUT_OF_RANGE); - performance.stopWatch(actor); - } - } - } - - if (performanceCheck.equals("musician") || performanceCheck.equals("both")) - { - obj_id musician = getPerformanceListenTarget(actor); - - if (isIdValid(musician)) - { - if (getDistance(actor, musician) < PERFORMANCE_HEAL_RANGE) - { - if (getPerformanceType(musician) != 0) - { - LOG ("performance_entertained", "Still listening to a musician, still entertained"); - entertained = true; - } - } - else - { - performance.performanceMessageToSelf(actor, musician, performance.SID_MUSIC_LISTEN_OUT_OF_RANGE); - performance.stopListen(actor); - } - } - } - - if (!entertained) - { - LOG ("performance_entertained", "No performances, leaving entertained mood"); - stopEntertainingPlayer(actor); - } - - return entertained; - } - - - public static int lookupPerformanceIndex(int typeHash, String performanceName, int instrumentNumber) throws InterruptedException - { - String lowerPerformanceName = toLower(performanceName); - int numRows = dataTableGetNumRows(DATATABLE_PERFORMANCE); - for (int row = 0; row < numRows; ++row) - { - testAbortScript(); - int rowTypeHash = dataTableGetInt(DATATABLE_PERFORMANCE, row, "type"); - if (rowTypeHash == typeHash) - { - int rowInstrumentNumber = dataTableGetInt(DATATABLE_PERFORMANCE, row, "instrumentAudioId"); - if (rowInstrumentNumber == instrumentNumber) - { - String rowPerformanceName = dataTableGetString(DATATABLE_PERFORMANCE, row, "performanceName"); - if (rowPerformanceName.equals(lowerPerformanceName)) - { - return row+1; - } - } - } - } - return 0; - } - - - public static boolean checkPerformanceType(int typeHash, int performanceIndex) throws InterruptedException - { - int rowTypeHash = dataTableGetInt(DATATABLE_PERFORMANCE, performanceIndex-1, "type"); - return (rowTypeHash == typeHash); - } - - - public static int findMatchingPerformanceIndex(int leaderPerformanceType, int instrumentNumber) throws InterruptedException - { - if (leaderPerformanceType == 0) - { - return 0; - } - - String performanceName = dataTableGetString(DATATABLE_PERFORMANCE, leaderPerformanceType-1, "performanceName"); - - int numRows = dataTableGetNumRows(DATATABLE_PERFORMANCE); - for (int row = 0; row < numRows; ++row) - { - testAbortScript(); - int rowTypeHash = dataTableGetInt(DATATABLE_PERFORMANCE, row, "type"); - if (rowTypeHash == (866729052)) - { - int rowInstrumentNumber = dataTableGetInt(DATATABLE_PERFORMANCE, row, "instrumentAudioId"); - if (rowInstrumentNumber == instrumentNumber) - { - String rowPerformanceName = dataTableGetString(DATATABLE_PERFORMANCE, row, "performanceName"); - if (rowPerformanceName.equals(performanceName)) - { - return row+1; - } - } - } - } - return 0; - } - - - public static int findMatchingDroidPerformanceIndex(int leaderType, obj_id droid) throws InterruptedException - { - - if (!pet_lib.isDroidPet(droid)) - { - return 0; - } - - if (!hasObjVar(droid, "module_data.playback.tracks")) - { - return 0; - } - - int[] tracks = getIntArrayObjVar(droid, "module_data.playback.tracks"); - - for (int i = 0; i < tracks.length; i++) - { - testAbortScript(); - - int index = tracks[i]; - index--; - - int instrument = dataTableGetInt(DATATABLE_PERFORMANCE, index, "instrumentAudioId"); - int match = findMatchingPerformanceIndex(leaderType, instrument); - - if ((match != 0) && (match == tracks[i])) - { - - return match; - } - } - - return 0; - } - - - public static int getInstrumentFromPerformanceType(int type) throws InterruptedException - { - - type--; - - int instrument = dataTableGetInt(DATATABLE_PERFORMANCE, type, "instrumentAudioId"); - - return instrument; - } - - - public static boolean isHologramPerformer(obj_id who) throws InterruptedException - { - if (isPlayer(who)) - { - return false; - } - - if (utils.hasScriptVar(who, "hologram_performer")) - { - return true; - } - - return false; - } - - - public static obj_id[] getBandMembers(obj_id who) throws InterruptedException - { - - obj_id group = getGroupObject(who); - if (isIdValid(group)) - { - obj_id[] members = getGroupMemberIds(group); - if (members != null) - { - int count = 0; - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - if (isPlayer(members[i]) || isHologramPerformer(members[i]) || (pet_lib.isDroidPet(members[i]) && hasObjVar(members[i], "module_data.playback"))) - { - ++count; - } - } - if (count > 0) - { - obj_id[] ret = new obj_id[count]; - count = 0; - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - if (isPlayer(members[i]) || isHologramPerformer(members[i]) || (pet_lib.isDroidPet(members[i]) && hasObjVar(members[i], "module_data.playback"))) - { - ret[count] = members[i]; - ++count; - } - } - return ret; - } - } - - return null; - } - - if (isPlayer(who) || isHologramPerformer(who) || (pet_lib.isDroidPet(who) && hasObjVar(who, "module_data.playback"))) - { - obj_id[] ret = new obj_id[1]; - ret[0] = who; - return ret; - } - - return null; - } - - - public static void startPlaying(obj_id actor, int performanceIndex, int performanceStartTime, int instrumentNumber) throws InterruptedException - { - dictionary params; - - setPerformanceType(actor, performanceIndex); - setPerformanceStartTime(actor, performanceStartTime); - - if (!isIdValid(getPerformanceListenTarget(actor))) - { - setPerformanceListenTarget(actor, actor); - } - - attachScript(actor, MUSIC_HEARTBEAT_SCRIPT); - - if (!pet_lib.isDroidPet(actor) && !isHologramPerformer(actor)) - { - sendNpcsEntertainmentMessage(actor, NPC_ENTERTAINMENT_MESSAGE_START, PERFORMANCE_TYPE_MUSIC); - - params = new dictionary(); - params.put("performer", actor); - broadcastMessage("handlePerformerStartPerforming", params); - } - - params = new dictionary(); - params.put("performanceIndex", performanceIndex); - params.put("instrumentNumber", instrumentNumber); - params.put("sequence", 0); - messageTo(actor, "OnPulse", params, PERFORMANCE_HEARTBEAT_TIME, false); - } - - - public static void stopPlaying(obj_id actor) throws InterruptedException - { - makeOthersStopListening(actor); - - int type = getPerformanceType(actor); - - if (type != 0) - { - utils.setScriptVar(actor, "performance.performance_delay", getGameTime()); - } - - dictionary params; - - if (!pet_lib.isDroidPet(actor) && !isHologramPerformer(actor)) - { - params = new dictionary(); - params.put("performer", actor); - params.put("check", "dancer"); - broadcastMessage("handlePerformerStopPerforming", params); - - dictionary d = new dictionary(); - d.put("commandType", HOLOGRAM_COMMAND_STOP_SONG); - - broadcastMessage("handleHologramPerformanceCommand", d); - } - - messageTo(actor, "OnPerformanceEnd", null, 0.0f, false); - detachScript(actor, performance.POST_PERFORMANCE); - setPerformanceType(actor, 0); - setPerformanceStartTime(actor, 0); - - if (utils.hasScriptVar(actor, VAR_PERFORM_INSPIRATION)) - { - stopInspiration(actor); - } - } - - - public static void startMusic(obj_id actor, String songName, int instrumentNumber) throws InterruptedException - { - session.logActivity(actor, session.ACTIVITY_ENTERTAINED); - - if (!pet_lib.isDroidPet(actor)) - { - if (getPerformanceType(actor) != 0) - { - if (!hasScript(actor, MUSIC_HEARTBEAT_SCRIPT) && !hasScript(actor, DANCE_HEARTBEAT_SCRIPT)) - { - stopPlaying(actor); - - if (hasObjVar(actor, performance.VAR_PERFORM)) - { - removeObjVar(actor, performance.VAR_PERFORM); - } - } - else - { - performanceMessageToSelf(actor, null, SID_ALREADY_PERFORMING_SELF); - return; - } - } - - instrumentNumber = getInstrumentAudioId(actor); - if (instrumentNumber == 0) - { - if (isHologramPerformer(actor)) - { - obj_id master = getMaster(actor); - performanceMessageToSelf(master, null, SID_MUSIC_HOLOGRAM_NO_INSTRUMENT); - } - else - { - performanceMessageToSelf(actor, null, SID_MUSIC_NO_INSTRUMENT); - } - - return; - } - } - - if (getIntObjVar(actor, VAR_PERFORM_OUTRO) == 1) - { - performanceMessageToSelf(actor, null, SID_MUSIC_OUTRO_WAIT); - return; - } - - boolean activeBandSong = false; - int performanceIndex = 0; - int performanceStartTime = 0; - obj_id[] bandMembers = getBandMembers(actor); - - for (int i = 0; i < bandMembers.length; ++i) - { - testAbortScript(); - obj_id player = bandMembers[i]; - if (player == actor) - { - continue; - } - - if (!hasScript(player, MUSIC_HEARTBEAT_SCRIPT)) - { - continue; - } - - int memberPerformanceIndex = getPerformanceType(player); - if (memberPerformanceIndex != 0) - { - if (!pet_lib.isDroidPet(actor)) - { - - performanceIndex = findMatchingPerformanceIndex(memberPerformanceIndex, instrumentNumber); - - } - else - { - - performanceIndex = findMatchingDroidPerformanceIndex(memberPerformanceIndex, actor); - } - performanceStartTime = getPerformanceStartTime(player); - activeBandSong = true; - break; - } - } - - if (!activeBandSong) - { - if (songName.length() < 1) - { - if (!displayAvailableMusic(actor, false, false)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_SONG_SELF); - } - return; - } - performanceIndex = lookupPerformanceIndex((866729052), songName, instrumentNumber); - performanceStartTime = getGameTime(); - } - - if (performanceIndex == 0) - { - if (!pet_lib.isDroidPet(actor)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_INVALID_SONG); - } - else - { - performanceMessageToMaster(actor, null, SID_MUSIC_TRACK_NOT_AVAILABLE); - } - - return; - } - - if (!notShapechanged(actor)) - { - return; - } - - if (!pet_lib.isDroidPet(actor) && !canUseInstrument(actor, performanceIndex)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_INSTRUMENT); - return; - } - - if (!pet_lib.isDroidPet(actor) && !canPerformSong(actor, performanceIndex)) - { - if (activeBandSong) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_SONG_BAND); - } - else - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_SONG_SELF); - } - return; - } - - startPlaying(actor, performanceIndex, performanceStartTime, instrumentNumber); - - dictionary d = new dictionary(); - d.put("commandType", HOLOGRAM_COMMAND_START_SONG); - d.put("songName", songName); - - broadcastMessage("handleHologramPerformanceCommand", d); - - if (hasScript(actor, "theme_park.new_player.new_player")) - { - dictionary webster = new dictionary(); - webster.put("playingMusic", 1); - messageTo(actor, "handleNewPlayerEntertainerAction", webster, 1, false); - } - - if (!!pet_lib.isDroidPet(actor) && !isHologramPerformer(actor)) - { - - if (activeBandSong) - { - performanceMessageToSelf(actor, null, SID_MUSIC_JOIN_BAND_SELF); - } - else - { - performanceMessageToSelf(actor, null, SID_MUSIC_START_SELF); - } - performanceMessageToBand(actor, null, SID_MUSIC_START_OTHER); - performanceMessageToBandListeners(actor, null, SID_MUSIC_START_OTHER); - } - } - - - public static void startMusic(obj_id actor, String songName) throws InterruptedException - { - startMusic(actor, songName, 0); - } - - - public static void startBand(obj_id actor, String songName, int instrumentNumber) throws InterruptedException - { - - if (!pet_lib.isDroidPet(actor)) - { - - instrumentNumber = getInstrumentAudioId(actor); - if (instrumentNumber == 0) - { - if (isHologramPerformer(actor)) - { - obj_id master = getMaster(actor); - performanceMessageToSelf(master, null, SID_MUSIC_HOLOGRAM_NO_INSTRUMENT); - } - else - { - performanceMessageToSelf(actor, null, SID_MUSIC_NO_INSTRUMENT); - } - - return; - } - } - - if (getIntObjVar(actor, VAR_PERFORM_OUTRO) == 1) - { - performanceMessageToSelf(actor, null, SID_MUSIC_OUTRO_WAIT); - return; - } - - boolean activeSong = false; - int performanceIndex = 0; - int performanceStartTime = 0; - obj_id[] bandMembers = getBandMembers(actor); - - for (int i = 0; i < bandMembers.length; ++i) - { - testAbortScript(); - obj_id player = bandMembers[i]; - - if (!hasScript(player, MUSIC_HEARTBEAT_SCRIPT)) - { - continue; - } - - int memberPerformanceIndex = getPerformanceType(player); - if (memberPerformanceIndex != 0) - { - performanceIndex = findMatchingPerformanceIndex(memberPerformanceIndex, instrumentNumber); - performanceStartTime = getPerformanceStartTime(player); - activeSong = true; - break; - } - } - - if (!activeSong) - { - if (songName.length() < 1) - { - if (!displayAvailableMusic(actor, true, false)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_SONG_SELF); - } - return; - } - performanceIndex = lookupPerformanceIndex((866729052), songName, instrumentNumber); - performanceStartTime = getGameTime(); - } - - if (!notShapechanged(actor)) - { - return; - } - - if (performanceIndex == 0) - { - performanceMessageToSelf(actor, null, SID_MUSIC_INVALID_SONG); - return; - } - - if (!canUseInstrument(actor, performanceIndex)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_INSTRUMENT); - return; - } - - if (!canPerformSong(actor, performanceIndex)) - { - if (activeSong) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_SONG_BAND); - } - else - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_SONG_SELF); - } - return; - } - - startPlaying(actor, performanceIndex, performanceStartTime, instrumentNumber); - - if (hasScript(actor, "theme_park.new_player.new_player")) - { - dictionary webster = new dictionary(); - webster.put("playingMusic", 1); - messageTo(actor, "handleNewPlayerEntertainerAction", webster, 1, false); - } - - boolean bandMemberLackSkill = false; - for (int i = 0; i < bandMembers.length; ++i) - { - testAbortScript(); - obj_id player = bandMembers[i]; - if (player == actor) - { - continue; - } - - if (!isPlayer(player) && !pet_lib.isDroidPet(player) && !isHologramPerformer(player)) - { - continue; - } - - if (getPerformanceType(player) != 0) - { - if (!hasScript(actor, MUSIC_HEARTBEAT_SCRIPT) && !hasScript(actor, DANCE_HEARTBEAT_SCRIPT)) - { - stopPlaying(actor); - - if (hasObjVar(actor, performance.VAR_PERFORM)) - { - removeObjVar(actor, performance.VAR_PERFORM); - } - } - else - { - continue; - } - } - - if (getDistance(actor, player) > PERFORMANCE_BAND_MEMBER_RANGE) - { - continue; - } - - int memberInstrumentNumber = 0; - - if (!pet_lib.isDroidPet(player)) - { - memberInstrumentNumber = getInstrumentAudioId(player); - if (memberInstrumentNumber == 0) - { - continue; - } - } - - int memberPerformanceIndex = 0; - - if (!pet_lib.isDroidPet(player)) - { - memberPerformanceIndex = findMatchingPerformanceIndex(performanceIndex, memberInstrumentNumber); - } - else - { - memberPerformanceIndex = findMatchingDroidPerformanceIndex(performanceIndex, player); - } - - if (memberPerformanceIndex != 0) - { - if (!notShapechanged(actor)) - { - continue; - } - if (!pet_lib.isDroidPet(player) && !canUseInstrument(player, memberPerformanceIndex)) - { - performanceMessageToSelf(player, null, SID_MUSIC_LACK_SKILL_INSTRUMENT); - continue; - } - - if (!pet_lib.isDroidPet(player)) - { - - if (canPerformSong(player, memberPerformanceIndex)) - { - startPlaying(player, memberPerformanceIndex, performanceStartTime, memberInstrumentNumber); - } - else - { - performanceMessageToSelf(player, null, SID_MUSIC_LACK_SKILL_SONG_BAND); - bandMemberLackSkill = true; - } - - } - else - { - - memberInstrumentNumber = getInstrumentFromPerformanceType(memberPerformanceIndex); - startPlaying(player, memberPerformanceIndex, performanceStartTime, memberInstrumentNumber); - } - - } - else - { - - if (pet_lib.isDroidPet(player)) - { - performanceMessageToMaster(player, null, SID_MUSIC_TRACK_NOT_AVAILABLE); - } - } - } - - if (activeSong) - { - performanceMessageToSelf(actor, null, SID_MUSIC_BAND_JOIN_SONG_SELF); - performanceMessageToSelf(actor, null, SID_MUSIC_BAND_JOIN_SONG_MEMBERS); - } - else - { - performanceMessageToSelf(actor, null, SID_MUSIC_START_BAND_SELF); - performanceMessageToBand(actor, null, SID_MUSIC_START_BAND_MEMBERS); - } - performanceMessageToBandListeners(actor, null, SID_MUSIC_START_BAND_OTHER); - - if (bandMemberLackSkill) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_BAND_MEMBER); - } - } - - - public static void startBand(obj_id actor, String songName) throws InterruptedException - { - startBand(actor, songName, 0); - } - - - public static void startTroupe(obj_id actor, String danceName) throws InterruptedException - { - - boolean activeDance = false; - int performanceIndex = 0; - int performanceStartTime = 0; - obj_id[] bandMembers = getBandMembers(actor); - - for (int i = 0; i < bandMembers.length; ++i) - { - testAbortScript(); - obj_id player = bandMembers[i]; - - if (hasScript(player, DANCE_HEARTBEAT_SCRIPT)) - { - stopDance(player); - } - } - - for (int i = 0; i < bandMembers.length; ++i) - { - testAbortScript(); - obj_id player = bandMembers[i]; - - danceName = utils.getStringScriptVar(player, VAR_CURRENT_DANCE); - utils.removeScriptVar(player, VAR_CURRENT_DANCE); - startDance(player, danceName); - } - } - - - public static void stopMusic(obj_id actor) throws InterruptedException - { - - if (hasScript(actor, DANCE_HEARTBEAT_SCRIPT)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_NOT_PERFORMING); - } - - else if (hasScript(actor, MUSIC_HEARTBEAT_SCRIPT)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_PREPARE_STOP_SELF); - - specialFlourish(actor, SPECIAL_FLOURISH_OUTRO); - - setObjVar(actor, VAR_PERFORM_OUTRO, 1); - attachScript(actor, POST_PERFORMANCE); - messageTo(actor, "OnClearOutro", null, PERFORMANCE_OUTRO_ROUNDTIME, false); - } - else - { - stopPlaying(actor); - - if (hasObjVar(actor, performance.VAR_PERFORM)) - { - removeObjVar(actor, performance.VAR_PERFORM); - } - - if (hasObjVar(actor, performance.VAR_PERFORM_OUTRO)) - { - removeObjVar(actor, performance.VAR_PERFORM_OUTRO); - } - - performanceMessageToSelf(actor, null, SID_MUSIC_NOT_PERFORMING); - } - } - - - public static void stopMusicNow(obj_id actor) throws InterruptedException - { - if (hasScript(actor, MUSIC_HEARTBEAT_SCRIPT)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_STOP_SELF); - if (!isHologramPerformer(actor)) - { - performanceMessageToBand(actor, null, SID_MUSIC_STOP_OTHER); - performanceMessageToBandListeners(actor, null, SID_MUSIC_STOP_OTHER); - } - } - - stopPlaying(actor); - } - - - public static void stopBand(obj_id actor) throws InterruptedException - { - obj_id[] bandMembers = getBandMembers(actor); - if (bandMembers != null) - { - performanceMessageToSelf(actor, null, SID_MUSIC_PREPARE_STOP_BAND_SELF); - performanceMessageToBand(actor, null, SID_MUSIC_PREPARE_STOP_BAND_MEMBERS); - - boolean bandStop = false; - for (int i = 0; i < bandMembers.length; ++i) - { - testAbortScript(); - obj_id player = bandMembers[i]; - if (hasScript(player, MUSIC_HEARTBEAT_SCRIPT)) - { - specialFlourish(player, SPECIAL_FLOURISH_OUTRO); - - dictionary params = new dictionary(); - - if (player == actor) - { - params.put("leader", 1 ); - } - else - { - params.put("leader", 0 ); - } - - setObjVar(player, VAR_PERFORM_OUTRO, 1); - attachScript(player, POST_PERFORMANCE); - messageTo(player, "OnClearBandOutro", params, PERFORMANCE_OUTRO_ROUNDTIME, false); - } - } - } - } - - - public static void changeMusic(obj_id actor, String songName, int instrumentNumber) throws InterruptedException - { - - if (!hasScript(actor, MUSIC_HEARTBEAT_SCRIPT)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_MUST_BE_PERFORMING_SELF); - return; - } - - instrumentNumber = getInstrumentAudioId(actor); - if (instrumentNumber == 0) - { - performanceMessageToSelf(actor, null, SID_MUSIC_NO_INSTRUMENT); - return; - } - - if (getIntObjVar(actor, VAR_PERFORM_OUTRO) == 1) - { - performanceMessageToSelf(actor, null, SID_MUSIC_OUTRO_WAIT); - return; - } - - boolean activeBandSong = false; - obj_id[] bandMembers = getBandMembers(actor); - - for (int i = 0; i < bandMembers.length; ++i) - { - testAbortScript(); - obj_id player = bandMembers[i]; - if (player == actor) - { - continue; - } - - if (!hasScript(player, MUSIC_HEARTBEAT_SCRIPT)) - { - continue; - } - - int memberPerformanceIndex = getPerformanceType(player); - if (memberPerformanceIndex != 0) - { - activeBandSong = true; - break; - } - } - - if (activeBandSong) - { - performanceMessageToSelf(actor, null, SID_MUSIC_MUST_MATCH_BAND); - return; - } - - if (songName.length() < 1) - { - if (!displayAvailableMusic(actor, false, true)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_SONG_SELF); - } - return; - } - - int performanceIndex = lookupPerformanceIndex((866729052), songName, instrumentNumber); - int performanceStartTime = getGameTime(); - - if (performanceIndex == 0) - { - performanceMessageToSelf(actor, null, SID_MUSIC_INVALID_SONG); - return; - } - - if (!notShapechanged(actor)) - { - return; - } - - if (!canPerformSong(actor, performanceIndex)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_SONG_SELF); - return; - } - - setPerformanceType(actor, performanceIndex); - queueCommand(actor, (181882275), null, "1", COMMAND_PRIORITY_IMMEDIATE); - - dictionary d = new dictionary(); - d.put("songName", songName); - d.put("commandType", HOLOGRAM_COMMAND_CHANGE_SONG); - - broadcastMessage("handleHologramPerformanceCommand", d); - } - - - public static void changeMusic(obj_id actor, String songName) throws InterruptedException - { - changeMusic(actor, songName, 0); - } - - - public static void changeBandMusic(obj_id actor, String songName, int instrumentNumber) throws InterruptedException - { - - if (!hasScript(actor, MUSIC_HEARTBEAT_SCRIPT)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_MUST_BE_PERFORMING_SELF); - return; - } - - instrumentNumber = getInstrumentAudioId(actor); - if (instrumentNumber == 0) - { - performanceMessageToSelf(actor, null, SID_MUSIC_NO_INSTRUMENT); - return; - } - - if (getIntObjVar(actor, VAR_PERFORM_OUTRO) == 1) - { - performanceMessageToSelf(actor, null, SID_MUSIC_OUTRO_WAIT); - return; - } - - if (songName.length() < 1) - { - if (!displayAvailableMusic(actor, true, true)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_SONG_SELF); - } - return; - } - - int performanceIndex = lookupPerformanceIndex((866729052), songName, instrumentNumber); - int performanceStartTime = getGameTime(); - - if (performanceIndex == 0) - { - performanceMessageToSelf(actor, null, SID_MUSIC_INVALID_SONG); - return; - } - - if (!notShapechanged(actor)) - { - return; - } - - if (!canPerformSong(actor, performanceIndex)) - { - performanceMessageToSelf(actor, null, SID_MUSIC_LACK_SKILL_SONG_SELF); - return; - } - - setPerformanceType(actor, performanceIndex); - queueCommand(actor, (181882275), null, "1", COMMAND_PRIORITY_IMMEDIATE); - - obj_id[] bandMembers = getBandMembers(actor); - - for (int i = 0; i < bandMembers.length; ++i) - { - testAbortScript(); - obj_id player = bandMembers[i]; - if (player == actor) - { - continue; - } - if (!hasScript(actor, MUSIC_HEARTBEAT_SCRIPT)) - { - continue; - } - - if (!pet_lib.isDroidPet(player)) - { - - int memberInstrumentNumber = getInstrumentAudioId(player); - if (memberInstrumentNumber == 0) - { - continue; - } - int memberPerformanceIndex = findMatchingPerformanceIndex(performanceIndex, memberInstrumentNumber); - - if (!notShapechanged(actor)) - { - stopMusicNow(player); - } - - if (memberPerformanceIndex != 0 && canPerformSong(player, memberPerformanceIndex)) - { - - if (!hasScript(player, MUSIC_HEARTBEAT_SCRIPT)) - { - startPlaying(player, memberPerformanceIndex, 1, memberInstrumentNumber); - } - - setPerformanceType(player, memberPerformanceIndex); - queueCommand(player, (181882275), null, "1", COMMAND_PRIORITY_IMMEDIATE); - } - else - { - performanceMessageToSelf(player, null, SID_MUSIC_LACK_SKILL_SONG_BAND); - stopMusicNow(player); - } - - if (!canUseInstrument(player, memberInstrumentNumber)) - { - performanceMessageToSelf(player, null, SID_MUSIC_LACK_SKILL_INSTRUMENT); - stopMusicNow(player); - } - - } - else - { - - int memberPerformanceIndex = findMatchingDroidPerformanceIndex(performanceIndex, player); - - if (memberPerformanceIndex != 0) - { - - setPerformanceType(player, memberPerformanceIndex); - - } - else - { - - performanceMessageToMaster(player, null, SID_MUSIC_TRACK_NOT_AVAILABLE); - stopMusicNow(player); - } - } - } - } - - - public static void changeBandMusic(obj_id actor, String songName) throws InterruptedException - { - changeBandMusic(actor, songName, 0); - } - - - public static void startDance(obj_id actor, String danceName) throws InterruptedException - { - session.logActivity(actor, session.ACTIVITY_ENTERTAINED); - - if (danceName.length() < 1) - { - displayAvailableDances(actor, false); - return; - } - - if (getPerformanceType(actor) != 0) - { - performanceMessageToSelf(actor, null, SID_ALREADY_PERFORMING_SELF); - return; - } - - int performanceIndex = lookupPerformanceIndex((-1788534963), danceName, 0); - if (performanceIndex == 0) - { - performanceMessageToSelf(actor, null, SID_DANCE_UNKNOWN_SELF); - return; - } - - if (!notShapechanged(actor)) - { - return; - } - - if (!canPerformDance(actor, performanceIndex)) - { - performanceMessageToSelf(actor, null, SID_DANCE_LACK_SKILL_SELF); - return; - } - - setClientUsesAnimationLocomotion(actor, true); - - performanceMessageToSelf(actor, null, SID_DANCE_START_SELF); - performanceMessageToWatchers(actor, null, SID_DANCE_START_OTHER); - - if (!isIdValid(getPerformanceWatchTarget(actor))) - { - setPerformanceWatchTarget(actor, actor); - } - - dictionary params; - int startTime = getGameTime(); - - setPerformanceType(actor, performanceIndex); - setPerformanceStartTime(actor, startTime); - - attachScript(actor, DANCE_HEARTBEAT_SCRIPT); - - if (!isHologramPerformer(actor)) - { - sendNpcsEntertainmentMessage(actor, NPC_ENTERTAINMENT_MESSAGE_START, PERFORMANCE_TYPE_DANCE); - - params = new dictionary(); - params.put("performer", actor); - broadcastMessage("handlePerformerStartPerforming", params); - - dictionary d = new dictionary(); - d.put("danceName", danceName); - d.put("commandType", HOLOGRAM_COMMAND_START_DANCE); - - utils.setScriptVar(actor, VAR_CURRENT_DANCE, danceName); - - broadcastMessage("handleHologramPerformanceCommand", d); - - if (hasScript(actor, "theme_park.new_player.new_player")) - { - dictionary webster = new dictionary(); - webster.put("startedDancing", 1); - messageTo(actor, "handleNewPlayerEntertainerAction", webster, 1, false); - } - } - - params = new dictionary(); - params.put("performanceIndex", performanceIndex); - params.put("sequence", 0); - messageTo(actor, "OnPulse", params, PERFORMANCE_HEARTBEAT_TIME, false); - } - - - public static void stopDance(obj_id actor) throws InterruptedException - { - int type = getPerformanceType(actor); - - if (type != 0) - { - utils.setScriptVar(actor, "performance.performance_delay", getGameTime()); - } - - setClientUsesAnimationLocomotion(actor, false); - queueCommand(actor, (-1219480501), null, "0", COMMAND_PRIORITY_IMMEDIATE); - - if (utils.hasScriptVar(actor, "event.dance_party")) - { - utils.removeScriptVar(actor, "event.dance_party"); - } - - if (hasScript(actor, DANCE_HEARTBEAT_SCRIPT)) - { - - if (!isHologramPerformer(actor)) - { - dictionary params = new dictionary(); - params.put("performer", actor); - params.put("check", "musician"); - broadcastMessage("handlePerformerStopPerforming", params); - - if (!utils.hasScriptVar(actor, "stopDanceMessage")) - { - utils.setScriptVar(actor, "stopDanceMessage", 1); - performanceMessageToSelf(actor, null, SID_DANCE_STOP_SELF); - messageTo(actor, "handleStopDanceMessage", null, 1.0f, false); - - makeOthersStopWatching(actor); - } - - performanceMessageToWatchers(actor, null, SID_DANCE_STOP_OTHER); - - dictionary d = new dictionary(); - d.put("commandType", HOLOGRAM_COMMAND_STOP_DANCE); - - broadcastMessage("handleHologramPerformanceCommand", d); - } - - messageTo(actor, "OnPerformanceEnd", null, 0.0f, false); - setPerformanceType(actor, 0); - setPerformanceStartTime(actor, 0); - } - else - { - if (hasObjVar(actor, performance.VAR_PERFORM)) - { - removeObjVar(actor, performance.VAR_PERFORM); - } - performanceMessageToSelf(actor, null, SID_DANCE_NOT_PERFORMING); - } - - if (utils.hasScriptVar(actor, VAR_PERFORM_INSPIRATION)) - { - stopInspiration(actor); - } - } - - - public static void makeOthersStopWatching(obj_id actor) throws InterruptedException - { - obj_id[] watcherToStop = getPerformanceWatchersInRange(actor, PERFORMANCE_HEAL_RANGE); - for (int i = 0; i < watcherToStop.length; i++) - { - testAbortScript(); - if (watcherToStop[i] != actor) - { - queueCommand(watcherToStop[i], (1716628890), null, "", COMMAND_PRIORITY_DEFAULT); - } - } - } - - - public static void makeOthersStopListening(obj_id actor) throws InterruptedException - { - obj_id[] watcherToStop = getPerformanceListenersInRange(actor, PERFORMANCE_HEAL_RANGE); - for (int i = 0; i < watcherToStop.length; i++) - { - testAbortScript(); - if (watcherToStop[i] != actor) - { - queueCommand(watcherToStop[i], (-1025190704), null, "", COMMAND_PRIORITY_DEFAULT); - } - } - } - - - public static void changeDance(obj_id actor, String danceName) throws InterruptedException - { - - if (danceName.length() < 1) - { - displayAvailableDances(actor, true); - return; - } - - if (!hasScript(actor, DANCE_HEARTBEAT_SCRIPT)) - { - performanceMessageToSelf(actor, null, SID_DANCE_MUST_BE_PERFORMING_SELF); - return; - } - - int performanceIndex = lookupPerformanceIndex((-1788534963), danceName, 0); - if (performanceIndex == 0) - { - performanceMessageToSelf(actor, null, SID_DANCE_UNKNOWN_SELF); - return; - } - - if (!notShapechanged(actor)) - { - return; - } - - if (!canPerformDance(actor, performanceIndex)) - { - performanceMessageToSelf(actor, null, SID_DANCE_LACK_SKILL_SELF); - return; - } - - setPerformanceType(actor, performanceIndex); - queueCommand(actor, (-1219480501), null, "1", COMMAND_PRIORITY_IMMEDIATE); - - dictionary d = new dictionary(); - d.put("danceName", danceName); - d.put("commandType", HOLOGRAM_COMMAND_CHANGE_DANCE); - - broadcastMessage("handleHologramPerformanceCommand", d); - } - - - public static void joinBand(obj_id actor) throws InterruptedException - { - if (getPerformanceType(actor) == 0) - { - return; - } - - boolean activeBandSong = false; - int performanceIndex = 0; - int performanceStartTime = 0; - int instrumentNumber = getInstrumentAudioId(actor); - obj_id[] bandMembers = getBandMembers(actor); - - for (int i = 0; i < bandMembers.length; ++i) - { - testAbortScript(); - obj_id player = bandMembers[i]; - if (player == actor) - { - continue; - } - - if (!hasScript(player, MUSIC_HEARTBEAT_SCRIPT)) - { - continue; - } - - int memberPerformanceIndex = getPerformanceType(player); - if (memberPerformanceIndex != 0) - { - performanceIndex = findMatchingPerformanceIndex(memberPerformanceIndex, instrumentNumber); - performanceStartTime = getPerformanceStartTime(player); - activeBandSong = true; - break; - } - } - - if (activeBandSong) - { - if (getPerformanceType(actor) == performanceIndex) - { - setPerformanceStartTime(actor, performanceStartTime); - } - else - { - stopPlaying(actor); - performanceMessageToSelf(actor, null, SID_MUSIC_JOIN_BAND_STOP); - } - } - - return; - } - - - public static void sendNpcsEntertainmentMessage(obj_id actor, String message, String perf_type) throws InterruptedException - { - int count = 0; - obj_id[] npcs = getAllNpcs( getLocation(actor), 10.0f ); - if (npcs != null) - { - dictionary params = new dictionary(); - params.put("entertainer", actor ); - params.put("perf_type", perf_type); - for (int i = 0; i < npcs.length; i++) - { - testAbortScript(); - if (hasScript( npcs[i], "ai.ai" )) - { - if (!utils.hasScriptVar( npcs[i], "ai.listeningTo" )) - { - messageTo( npcs[i], message, params, 0, false ); - count++; - - if (count > 4) - { - return; - } - } - } - } - } - } - - - public static void flourish(obj_id actor, int index) throws InterruptedException - { - - if (getPerformanceType(actor) == 0) - { - performanceMessageToSelf(actor, null, SID_FLOURISH_NOT_PERFORMING); - return; - } - - if ((index < 1) || (index > 8)) - { - performanceMessageToSelf(actor, null, SID_FLOURISH_NOT_VALID); - return; - } - - if (hasObjVar(actor, VAR_PERFORM_FLOURISH_TOTAL)) - { - int flourish_total = getIntObjVar(actor, VAR_PERFORM_FLOURISH_TOTAL); - if (flourish_total > 4) - { - return; - } - } - - if (getIntObjVar(actor, VAR_PERFORM_FLOURISH) == 1) - { - performanceMessageToSelf(actor, null, SID_FLOURISH_WAIT_SELF); - return; - } - else - { - setObjVar(actor, VAR_PERFORM_FLOURISH, 1); - dictionary params = new dictionary(); - messageTo(actor, "OnClearFlourish", params, PERFORMANCE_FLOURISH_ROUNDTIME, false); - } - - float flourishCost = 0; - String entertainmentType = ""; - if (hasScript(actor, MUSIC_HEARTBEAT_SCRIPT)) - { - flourishCost = 0.5f; - entertainmentType = "music"; - } - else if (hasScript(actor, DANCE_HEARTBEAT_SCRIPT)) - { - flourishCost = 1f; - entertainmentType = "dance"; - } - else if (hasScript(actor, JUGGLE_HEARTBEAT_SCRIPT)) - { - flourishCost = 1f; - entertainmentType = "juggle"; - } - - if (applyPerformanceActionCost(actor, flourishCost)) - { - performanceMessageToSelf(actor, null, SID_FLOURISH_PERFORM); - } - else - { - performanceMessageToSelf(actor, null, SID_FLOURISH_TOO_TIRED); - return; - } - - int flourish_count = getIntObjVar(actor, VAR_PERFORM_FLOURISH_COUNT); - flourish_count++; - - int flourish_max = 2; - - LOG("entertainer_xp", "Performance Loop Duration = "+ getPerformanceLoopDuration(getPerformanceType(actor))); - LOG("entertainer_xp", "Max Fourishes = "+ flourish_max); - - if (flourish_count > flourish_max) - { - flourish_count = flourish_max; - } - setObjVar(actor, VAR_PERFORM_FLOURISH_COUNT, flourish_count); - - flourish_count = getIntObjVar(actor, VAR_PERFORM_FLOURISH_TOTAL); - flourish_count++; - setObjVar(actor, VAR_PERFORM_FLOURISH_TOTAL, flourish_count); - - if (hasScript(actor, "theme_park.new_player.new_player")) - { - dictionary webster = new dictionary(); - webster.put("addingFlourish", 1); - webster.put("entertainmentType", entertainmentType); - messageTo(actor, "handleNewPlayerEntertainerAction", webster, 1, false); - } - - dictionary params = new dictionary(); - params.put("performanceIndex", getPerformanceType(actor)); - params.put("flourishIndex", index); - params.put("mistakeChance", getPerformanceMistakeChance(actor)); - messageTo(actor, "OnFlourish", params, 0.0f, false); - } - - - public static void specialFlourish(obj_id actor, int index) throws InterruptedException - { - - if (getPerformanceType(actor) == 0) - { - return; - } - - dictionary params = new dictionary(); - params.put("performanceIndex", getPerformanceType(actor)); - params.put("flourishIndex", index); - messageTo(actor, "OnSpecialFlourish", params, 0.0f, false); - } - - - public static void bandFlourish(obj_id actor, int index, String instrument) throws InterruptedException - { - - if (getPerformanceType(actor) == 0) - { - performanceMessageToSelf(actor, null, SID_FLOURISH_NOT_PERFORMING); - return; - } - - if ((index < 0) || (index > 8)) - { - performanceMessageToSelf(actor, null, SID_FLOURISH_NOT_VALID); - return; - } - - int instrumentNum = -1; - if (instrument != null) - { - - if (!pet_lib.isDroidPet(actor)) - { - instrumentNum = lookupInstrumentNumber(actor, instrument); - } - else - { - instrumentNum = getInstrumentFromPerformanceType(getPerformanceType(actor)); - } - } - - LOG ("performance_music", "Band Flourish: "+ index + ", Instrument: "+ instrument + "("+ instrumentNum + ")"); - - int band_size = 0; - obj_id[] band_members = new obj_id[20]; - - if (instrumentNum > 0) - { - - obj_id group = getGroupObject(actor); - if (isIdValid(group)) - { - obj_id[] members = getGroupMemberIds(group); - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - if (!pet_lib.isDroidPet(members[i])) - { - LOG ("performance_music", "My instrument is "+ getInstrumentAudioId(members[i])); - if (hasScript(members[i], MUSIC_HEARTBEAT_SCRIPT) && (getInstrumentAudioId(members[i]) == instrumentNum)) - { - band_members[band_size] = members[i]; - ++band_size; - } - - } - else - { - - int instrumentID = getInstrumentFromPerformanceType(getPerformanceType(members[i])); - - if (hasScript(members[i], MUSIC_HEARTBEAT_SCRIPT) && (instrumentID == instrumentNum)) - { - band_members[band_size] = members[i]; - ++band_size; - } - } - } - } - } - else if (instrumentNum == -1) - { - String heartbeat_script; - - if (hasScript(actor, DANCE_HEARTBEAT_SCRIPT)) - { - heartbeat_script = DANCE_HEARTBEAT_SCRIPT; - } - else if (hasScript(actor, MUSIC_HEARTBEAT_SCRIPT)) - { - heartbeat_script = MUSIC_HEARTBEAT_SCRIPT; - } - else if (hasScript(actor, JUGGLE_HEARTBEAT_SCRIPT)) - { - heartbeat_script = JUGGLE_HEARTBEAT_SCRIPT; - } - else - { - performanceMessageToSelf(actor, null, SID_FLOURISH_NOT_PERFORMING); - return; - } - - obj_id group = getGroupObject(actor); - if (isIdValid(group)) - { - obj_id[] members = getGroupMemberIds(group); - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - if (hasScript(members[i], heartbeat_script)) - { - band_members[band_size] = members[i]; - ++band_size; - } - } - } - } - - for (int i = 0; i < band_size; i++) - { - testAbortScript(); - obj_id player = band_members[i]; - - if (hasObjVar(player, VAR_PERFORM_NO_BAND_FLOURISH)) - { - continue; - } - - if (getDistance(actor, player) > PERFORMANCE_BAND_MEMBER_RANGE) - { - continue; - } - - if (getIntObjVar(player, VAR_PERFORM_FLOURISH) == 1) - { - performanceMessageToSelf(player, null, SID_FLOURISH_WAIT_SELF); - continue; - } - else - { - setObjVar(player, VAR_PERFORM_FLOURISH, 1); - dictionary params = new dictionary(); - messageTo(player, "OnClearFlourish", params, PERFORMANCE_FLOURISH_ROUNDTIME, false); - } - - if (applyPerformanceActionCost(player, 0.5f)) - { - performanceMessageToSelf(player, null, SID_FLOURISH_PERFORM); - } - else - { - performanceMessageToSelf(player, null, SID_FLOURISH_TOO_TIRED); - continue; - } - - if (player == actor) - { - int flourish_count = getIntObjVar(player, VAR_PERFORM_FLOURISH_COUNT); - flourish_count++; - - int flourish_max = (int) (10 / getPerformanceLoopDuration(getPerformanceType(player))); - if (flourish_count > flourish_max) - { - flourish_count = flourish_max; - } - setObjVar(player, VAR_PERFORM_FLOURISH_COUNT, flourish_count); - } - else - { - performanceMessageToPerson(player, actor, actor, SID_FLOURISH_PERFORM_BAND_MEMBER); - } - - int flourish_count = getIntObjVar(actor, VAR_PERFORM_FLOURISH_TOTAL); - flourish_count++; - setObjVar(actor, VAR_PERFORM_FLOURISH_TOTAL, flourish_count); - - dictionary params = new dictionary(); - - if (index == SPECIAL_FLOURISH_PAUSE_MUSIC) - { - specialFlourish(player, index); - - } - else - { - params.put("performanceIndex", getPerformanceType(player)); - params.put("flourishIndex", index); - params.put("mistakeChance", getPerformanceMistakeChance(player)); - messageTo(player, "OnFlourish", params, 0.0f, false); - performanceMessageToSelf(actor, null, SID_FLOURISH_PERFORM_BAND_SELF); - - } - } - - } - - - public static int lookupInstrumentNumber(obj_id actor, String instrument) throws InterruptedException - { - int instrumentCount = dataTableGetNumRows(DATATABLE_INSTRUMENT); - String instrumentName[] = dataTableGetStringColumn(DATATABLE_INSTRUMENT, DATATABLE_COL_VISIBLE_NAME); - - for (int i = 0; i < instrumentCount; i++) - { - testAbortScript(); - if (instrumentName[i].startsWith(instrument)) - { - return dataTableGetInt(DATATABLE_INSTRUMENT, i, DATATABLE_COL_INSTRUMENT_ID); - } - } - - performanceMessageToSelf(actor, null, SID_FLOURISH_INSTRUMENT_UNKNOWN); - return 0; - } - - - public static void effect(obj_id actor, int effectId, int effectLevel) throws InterruptedException - { - if (effectLevel < 1) - { - effectLevel = 3; - } - - boolean mustPerform = getEffectPerformReq(effectId, effectLevel); - int performanceIndex = getPerformanceType(actor); - - if (mustPerform && (performanceIndex == 0)) - { - performanceMessageToSelf(actor, null, SID_EFFECT_NOT_PERFORMING); - return; - } - - if (getIntObjVar(actor, VAR_PERFORM_EFFECT) == 1) - { - performanceMessageToSelf(actor, null, SID_EFFECT_WAIT_SELF); - return; - } - - float effectRoundTime = getEffectDuration(effectId, effectLevel); - setObjVar(actor, VAR_PERFORM_EFFECT, 1); - dictionary params = new dictionary(); - messageTo(actor, "OnClearEffect", params, effectRoundTime, false); - - params.put("performanceIndex", getPerformanceType(actor)); - params.put("effectId", effectId); - params.put("effectLevel", effectLevel); - messageTo(actor, "OnEffect", params, 0.0f, false); - } - - - public static void playEffectTarget(obj_id self, obj_id target, String effectName, string_id effectString) throws InterruptedException - { - - performanceMessageToSelf(self, null, effectString); - - playClientEffectObj(self, effectName, target, ""); - } - - - public static void playEffectLoc(obj_id self, location loc, String effectName, string_id effectString) throws InterruptedException - { - performanceMessageToSelf(self, null, effectString); - - playClientEffectLoc(self, effectName, loc, 0.0f); - } - - - public static int getEffectIndex(int effectId, int effectLevel) throws InterruptedException - { - return ((effectId - 1) * 3) + (effectLevel - 1); - } - - - public static boolean getEffectPerformReq(int effectId, int effectLevel) throws InterruptedException - { - int effectIndex = getEffectIndex (effectId, effectLevel); - - return (dataTableGetInt(DATATABLE_PERFORMANCE_EFFECT, effectIndex, DATATABLE_COL_EFFECT_REQ_PERFORM) == 1); - } - - - public static String getEffectPerformanceType(int effectId, int effectLevel) throws InterruptedException - { - int effectIndex = getEffectIndex (effectId, effectLevel); - - return dataTableGetString(DATATABLE_PERFORMANCE_EFFECT, effectIndex, DATATABLE_COL_EFFECT_PERFORM_TYPE); - } - - - public static int getEffectPerformSkillLevel(int effectId, int effectLevel) throws InterruptedException - { - int effectIndex = getEffectIndex (effectId, effectLevel); - - return dataTableGetInt(DATATABLE_PERFORMANCE_EFFECT, effectIndex, DATATABLE_COL_EFFECT_REQ_SKILL_VAL); - } - - - public static float getEffectDuration(int effectId, int effectLevel) throws InterruptedException - { - int effectIndex = getEffectIndex (effectId, effectLevel); - - return dataTableGetFloat(DATATABLE_PERFORMANCE_EFFECT, effectIndex, DATATABLE_COL_EFFECT_DURATION); - } - - - public static int getEffectActionCost(int effectId, int effectLevel) throws InterruptedException - { - int effectIndex = getEffectIndex (effectId, effectLevel); - - return dataTableGetInt(DATATABLE_PERFORMANCE_EFFECT, effectIndex, DATATABLE_COL_EFFECT_ACTION_COST); - } - - - public static int getEffectTargetType(int effectId, int effectLevel) throws InterruptedException - { - int effectIndex = getEffectIndex (effectId, effectLevel); - - return dataTableGetInt(DATATABLE_PERFORMANCE_EFFECT, effectIndex, DATATABLE_COL_EFFECT_TARGET_TYPE); - } - - - public static int checkEffectLevel(obj_id actor, int effectId, int effectLevel) throws InterruptedException - { - boolean sendMessage = true; - - if (effectLevel == -1) - { - effectLevel = 3; - sendMessage = false; - } - - String requiredSkill = null; - String performanceType = getEffectPerformanceType(effectId, effectLevel); - - if (hasScript(actor, MUSIC_HEARTBEAT_SCRIPT)) - { - requiredSkill = "healing_music_ability"; - } - else if (hasScript(actor, DANCE_HEARTBEAT_SCRIPT)) - { - requiredSkill = "healing_dance_ability"; - } - else if (hasScript(actor, JUGGLE_HEARTBEAT_SCRIPT)) - { - requiredSkill = "healing_juggle_ability"; - } - - int requiredSkillVal = getEffectPerformSkillLevel(effectId, effectLevel); - - LOG ("entertainer_effect", "Performing Effect: "+ effectId + ", Level: "+ effectLevel); - LOG ("entertainer_effect", "Required Skill: "+ requiredSkill); - - int playerSkill = getSkillStatMod(actor, requiredSkill); - - LOG ("entertainer_effect", "Required Value: "+ requiredSkillVal + ", Player Skill: "+ playerSkill); - - while ((requiredSkillVal > playerSkill) && (effectLevel > 0)) - { - testAbortScript(); - effectLevel -= 1; - requiredSkillVal = getEffectPerformSkillLevel(effectId, effectLevel); - - if (sendMessage) - { - performanceMessageToSelf(actor, null, SID_EFFECT_LEVEL_TOO_HIGH); - sendMessage = false; - } - } - - return effectLevel; - - } - - - public static void performanceMessageToPerson(obj_id person, obj_id actor, obj_id target, string_id message) throws InterruptedException - { - prose_package pp = new prose_package(); - pp.stringId = message; - if (isIdValid(actor)) - { - pp.actor.set(getEncodedName(actor)); - } - if (isIdValid(target)) - { - pp.target.set(getEncodedName(target)); - } - sendSystemMessageProse(person, pp); - } - - - public static void performanceMessageToMaster(obj_id actor, obj_id target, string_id message) throws InterruptedException - { - if (!pet_lib.isDroidPet(actor)) - { - return; - } - - obj_id master = getMaster(actor); - - if (isIdValid(master)) - { - performanceMessageToPerson(master, actor, target, message); - } - } - - - public static void performanceMessageToSelf(obj_id actor, obj_id target, string_id message) throws InterruptedException - { - performanceMessageToPerson(actor, actor, target, message); - } - - - public static void performanceMessageToArray(obj_id[] people, obj_id actor, obj_id target, string_id message) throws InterruptedException - { - if (people != null) - { - for (int i = 0; i < people.length; ++i) - { - testAbortScript(); - if (people[i] != actor) - { - performanceMessageToPerson(people[i], actor, target, message); - } - } - } - } - - - public static void performanceMessageToBand(obj_id actor, obj_id target, string_id message) throws InterruptedException - { - obj_id[] members = getBandMembers(actor); - performanceMessageToArray(members, actor, target, message); - } - - - public static void performanceMessageToBandListeners(obj_id actor, obj_id target, string_id message) throws InterruptedException - { - obj_id[] members = getBandMembers(actor); - if (members != null) - { - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - performanceMessageToListeners(members[i], target, message); - } - } - } - - - public static void performanceMessageToListeners(obj_id actor, obj_id target, string_id message) throws InterruptedException - { - performanceMessageToArray(getPerformanceListenersInRange(actor, PERFORMANCE_HEAL_RANGE), actor, target, message); - } - - - public static void performanceMessageToWatchers(obj_id actor, obj_id target, string_id message) throws InterruptedException - { - performanceMessageToArray(getPerformanceWatchersInRange(actor, PERFORMANCE_HEAL_RANGE), actor, target, message); - } - - - public static int getPerformanceHealWoundMod(int perf_index) throws InterruptedException - { - if (perf_index == 0) - { - return 0; - } - return dataTableGetInt(DATATABLE_PERFORMANCE, perf_index - 1, "healMindWound"); - } - - - public static int getPerformanceHealShockMod(int perf_index) throws InterruptedException - { - if (perf_index == 0) - { - return 0; - } - return dataTableGetInt(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_HEAL_SHOCK); - } - - - public static int getPerformanceActionCost(int perf_index) throws InterruptedException - { - if (perf_index == 0) - { - return 0; - } - return dataTableGetInt(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_ACTION_COST); - } - - - public static float getPerformanceLoopDuration(int perf_index) throws InterruptedException - { - if (perf_index == 0) - { - return 0; - } - return dataTableGetFloat(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_LOOP_DURATION); - } - - - public static int getPerformanceBaseXp(int perf_index) throws InterruptedException - { - if (perf_index == 0) - { - return 0; - } - return dataTableGetInt(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_BASE_XP); - } - - - public static int getFlourishXpMod(int perf_index) throws InterruptedException - { - if (perf_index == 0) - { - return 0; - } - return dataTableGetInt(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_FLOURISH_XP_MOD); - } - - - public static boolean performanceHeal(obj_id actor, String perf_type, float modifier) throws InterruptedException - { - - if (!isIdValid(actor)) - { - return false; - } - - if (!isPlayer(actor)) - { - return false; - } - - int can_heal = canPerformanceHeal(actor); - if (can_heal == 0) - { - return false; - } - - obj_id[] audience; - - if (perf_type.equals(PERFORMANCE_TYPE_DANCE)) - { - audience = getPerformanceWatchersInRange(actor, PERFORMANCE_INSPIRE_RANGE); - } - else if (perf_type.equals(PERFORMANCE_TYPE_MUSIC)) - { - audience = getPerformanceListenersInRange(actor, PERFORMANCE_INSPIRE_RANGE); - } - else - { - return false; - } - - if (audience.length < 1) - { - return false; - } - - int audienceMod = 0; - - prose_package pt = new prose_package(); - pt.target.set(actor); - pt.stringId = new string_id("spam", "cured_clonesick"); - - prose_package pa = new prose_package(); - pa.stringId = new string_id("spam", "cured_clonesick_actor"); - - for (int i = 0; i < audience.length; i++) - { - testAbortScript(); - if (!isIdValid(audience[i]) || !exists(audience[i])) - { - continue; - } - - if (checkDenyService(actor, audience[i])) - { - continue; - } - - if (utils.hasScriptVar(audience[i], VAR_PERFORM_PAY_WAIT)) - { - continue; - } - - if (buff.hasBuff(audience[i], "cloning_sickness")) - { - - buff.removeBuff(audience[i], "cloning_sickness"); - playClientEffectObj(audience[i], "appearance/pt_heal.prt", audience[i], ""); - - if (!utils.hasScriptVar(audience[i], VAR_PERFROM_ALREADY_PAID)) - { - int charge = utils.getIntScriptVar(audience[i], performance.VAR_PERFORM_PAY_AGREE); - if (charge > 0) - { - money.systemPayout(money.ACCT_PERFORM_ESCROW, actor, charge, "handlePayment", null); - utils.setScriptVar(audience[i], VAR_PERFROM_ALREADY_PAID, 1); - } - } - - if (audience[i] != actor) - { - sendSystemMessageProse(audience[i], pt); - } - - pa.target.set(audience[i]); - sendSystemMessageProse(actor, pa); - audienceMod++; - } - - if (buff.hasBuff(audience[i],"gcw_fatigue")) - { - if (groundquests.isQuestActive(actor, "gcw_entertain_fatigue") && factions.isSameFactionorFactionHelper(actor, audience[i])) - { - pt.stringId = new string_id("spam", "cured_fatigue"); - pa.stringId = new string_id("spam", "cured_fatigued_actor"); - - int stackSize = (int)buff.getBuffStackCount(audience[i], "gcw_fatigue"); - if (stackSize <= 0) - { - continue; - } - - else if (stackSize <= 5) - { - - buff.removeBuff(audience[i], "gcw_fatigue"); - } - - else if (stackSize > 5) - { - stackSize = stackSize -5; - buff.removeBuff(audience[i], "gcw_fatigue"); - buff.applyBuffWithStackCount(audience[i], "gcw_fatigue", stackSize); - } - - groundquests.sendSignal(actor, "cureFatigue"); - - obj_id cityEggId = gcw.getInvasionSequencerNearby(actor); - if (isValidId(cityEggId)) - { - trial.addNonInstanceFactionParticipant(actor, cityEggId); - } - - prose_package gcw_fatigue_pt = new prose_package(); - pt.target.set(actor); - pt.stringId = new string_id("spam", "cured_fatigue"); - - prose_package gcw_fatigue_pa = new prose_package(); - pa.stringId = new string_id("spam", "cured_fatigued_actor"); - - playClientEffectObj(audience[i], "appearance/pt_heal.prt", audience[i], ""); - - if (!utils.hasScriptVar(audience[i], VAR_PERFROM_ALREADY_PAID)) - { - int charge = utils.getIntScriptVar(audience[i], performance.VAR_PERFORM_PAY_AGREE); - if (charge > 0) - { - money.systemPayout(money.ACCT_PERFORM_ESCROW, actor, charge, "handlePayment", null); - utils.setScriptVar(audience[i], VAR_PERFROM_ALREADY_PAID, 1); - } - } - - if (audience[i] != actor) - { - sendSystemMessageProse(audience[i], pt); - } - - pa.target.set(audience[i]); - sendSystemMessageProse(actor, pa); - audienceMod++; - } - } - - } - - int experience = (CURE_CLONING_SICKNESS_XP * audienceMod); - obj_id[] band = getBandMembers(actor); - - for (int i = 0; i < band.length; i++) - { - testAbortScript(); - xp.grantSocialStyleXp(band[i], xp.ENTERTAINER, experience); - } - - return true; - } - - - public static float inspireGetMaxDuration(obj_id actor) throws InterruptedException - { - int can_heal = canPerformanceHeal(actor); - - float pctComplete = respec.getPercentageCompletion(actor, getSkillTemplate(actor)); - float totInspireSkill = (pctComplete * 300.0f); - - int city_id = city.checkCity(actor, false); - if (city_id > 0 && (city.cityHasSpec(city_id, city.SF_SPEC_ENTERTAINER))) - { - totInspireSkill = totInspireSkill * 2.2f; - } - - float expertiseDurationIncreaseMod = getEnhancedSkillStatisticModifierUncapped(actor, "expertise_en_inspire_buff_duration_increase")*60; - float maxDuration = (12100.0f - (12100.0f * (1.0f / ((totInspireSkill + (1.0f / 0.01f)) * 0.01f)))) + 3600.0f; - - maxDuration += expertiseDurationIncreaseMod; - - obj_id camp = camping.getCurrentAdvancedCamp(actor); - - if (isIdValid(camp)) - { - if (camping.isInEntertainmentCamp(actor, camp)) - { - float campEffectiveness = getFloatObjVar(camp, "modules.entertainer"); - if (campEffectiveness < 1.0f) - { - maxDuration = maxDuration * campEffectiveness; - } - } - } - - if (can_heal == 3) - { - maxDuration = maxDuration * 0.2f; - } - - return maxDuration; - } - - - public static boolean inspire(obj_id actor, String perf_type) throws InterruptedException - { - if (!isIdValid(actor)) - { - return false; - } - - if (!isPlayer(actor)) - { - return false; - } - - int can_heal = canPerformanceHeal(actor); - if (can_heal == 0) - { - return false; - } - - obj_id[] audience; - - if (perf_type.equals(PERFORMANCE_TYPE_DANCE)) - { - audience = getPerformanceWatchersInRange(actor, PERFORMANCE_INSPIRE_RANGE); - } - else if (perf_type.equals(PERFORMANCE_TYPE_MUSIC)) - { - audience = getPerformanceListenersInRange(actor, PERFORMANCE_INSPIRE_RANGE); - } - else - { - return false; - } - - if (audience.length < 1) - { - return false; - } - - float maxDuration = inspireGetMaxDuration(actor); - - int audienceMod = 0; - for (int i = 0; i < audience.length; i++) - { - testAbortScript(); - if (audience[i] == actor) - { - continue; - } - - if (checkDenyService(actor, audience[i])) - { - continue; - } - - if (utils.hasScriptVar(audience[i], VAR_PERFORM_PAY_WAIT)) - { - continue; - } - - float inspirationScriptVarVal = 0.0f; - - if (utils.hasScriptVar(audience[i], VAR_PERFORM_INSPIRATION)) - { - inspirationScriptVarVal = utils.getFloatScriptVar(audience[i], VAR_PERFORM_INSPIRATION); - } - - if (inspirationScriptVarVal == maxDuration) - { - continue; - } - - int inspireBuffCrc = buff.getBuffOnTargetFromGroup(audience[i], "inspiration"); - - float expertisePerTickBonusTime = getEnhancedSkillStatisticModifierUncapped(actor, "expertise_en_inspire_pulse_duration_increase")*60; - - float perTickMinutesAdded = expertisePerTickBonusTime + INSPIRATION_BUFF_SEGMENT; - - int city_id = city.checkCity(actor, false); - if (city_id > 0 && (city.cityHasSpec(city_id, city.SF_SPEC_ENTERTAINER))) - { - perTickMinutesAdded += 180; - } - - inspirationScriptVarVal += perTickMinutesAdded; - - if (inspirationScriptVarVal > maxDuration) - { - inspirationScriptVarVal = maxDuration; - - if (!utils.hasScriptVar(audience[i], "performance.inspireMaxReached")) - { - showFlyTextPrivate(audience[i], audience[i], new string_id("performance", "buff_maxtime"), 0.66f, colors.LIGHTPINK.getR(), colors.LIGHTPINK.getG(), colors.LIGHTPINK.getB(), true); - showFlyTextPrivate(audience[i], actor, new string_id("performance", "buff_maxtime"), 0.66f, colors.LIGHTPINK.getR(), colors.LIGHTPINK.getG(), colors.LIGHTPINK.getB(), true); - utils.setScriptVar(audience[i], "performance.inspireMaxReached", 1); - } - } - else - { - int perTickMinutesAddedInt = (int)perTickMinutesAdded/60; - string_id strSpam = new string_id("spam", "buff_duration_tick_not_hardcoded"); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, strSpam); - pp = prose.setDI(pp, perTickMinutesAddedInt); - - showFlyTextPrivate(audience[i], audience[i], pp, 0.66f, colors.LIGHTPINK.getR(), colors.LIGHTPINK.getG(), colors.LIGHTPINK.getB(), true); - showFlyTextPrivate(audience[i], actor, pp, 0.66f, colors.LIGHTPINK.getR(), colors.LIGHTPINK.getG(), colors.LIGHTPINK.getB(), true); - - } - - utils.setScriptVar(audience[i], VAR_PERFORM_INSPIRATION, inspirationScriptVarVal); - audienceMod++; - } - - int experience = (PERFORM_XP_INSPIRATION * audienceMod); - obj_id[] band = getBandMembers(actor); - - for (int i = 0; i < band.length; i++) - { - testAbortScript(); - xp.grantSocialStyleXp(band[i], xp.ENTERTAINER, experience); - } - - return true; - } - - - public static boolean performanceTargetedBuffFlourish(obj_id actor, String perf_type, float modifier) throws InterruptedException - { - - return true; - } - - - public static boolean performanceSetPerformanceBuffTarget(obj_id actor, String target) throws InterruptedException - { - obj_id targetId = null; - - if (!isIdValid(targetId)) - { - performanceMessageToSelf(actor, null, SID_BUFF_INVALID_TARGET_SELF); - - return false; - } - - return performanceSetPerformanceBuffTarget(actor, targetId); - } - - - public static boolean performanceSetPerformanceBuffTarget(obj_id actor, obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - performanceMessageToSelf(actor, null, SID_BUFF_INVALID_TARGET_SELF); - return false; - } - - utils.setScriptVar(actor, VAR_PERFORM_BUFF_TARGET, target); - - performanceMessageToSelf(actor, target, SID_BUFF_SET_TARGET_SELF); - performanceMessageToPerson(target, actor, target, SID_BUFF_SET_TARGET_OTHER); - - return true; - } - - - public static boolean applyPerformanceActionCost(obj_id actor, float modifier) throws InterruptedException - { - - return true; - } - - - public static float getPerformanceMistakeChance(obj_id actor) throws InterruptedException - { - - return 0f; - } - - - public static boolean hasInspirationInstrumentUseBuff(obj_id actor, String instrument) throws InterruptedException - { - int col = 0; - - if (utils.hasScriptVar(actor, "buff.musician_inspiration.value")) - { - col = 2; - } - else if (utils.hasScriptVar(actor, "buff.entertainer_inspiration.value")) - { - col = 1; - } - else - { - return false; - } - - String required = dataTableGetString("datatables/buff/entertainment_buff.iff", instrument, col); - - if (required.equals("none")) - { - return true; - } - - return hasCommand(actor, required); - } - - - public static boolean hasInspirationDancePropUseBuff(obj_id actor, String prop) throws InterruptedException - { - int col = 0; - - if (utils.hasScriptVar(actor, "buff.dancer_inspiration.value")) - { - col = 2; - } - else if (utils.hasScriptVar(actor, "buff.entertainer_inspiration.value")) - { - col = 1; - } - else - { - return false; - } - - String required = dataTableGetString("datatables/buff/entertainment_buff.iff", prop, col); - - if (required == null || required.equals("")) - { - return false; - } - - if (required.equals("none")) - { - return true; - } - - return hasCommand(actor, required); - } - - - public static boolean notShapechanged(obj_id actor) throws InterruptedException - { - - int shapechange = buff.getBuffOnTargetFromGroup(actor, "shapechange"); - - if (shapechange != 0) - { - sendSystemMessage(actor, SHAPECHANGE); - return false; - } - return true; - } - - - public static boolean canDoPerformance(obj_id actor, int perf_index) throws InterruptedException - { - if (perf_index == 0) - { - return false; - } - - if (isHologramPerformer(actor)) - { - obj_id master = getMaster(actor); - - if (isIdValid(master)) - { - return canDoPerformance(master, perf_index); - } - else - { - return false; - } - } - - String req_skill_mod = dataTableGetString(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_REQ_SKILL); - int req_skill_value = dataTableGetInt(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_REQ_SKILL_VALUE); - int player_skill_mod = getSkillStatMod(actor, req_skill_mod); - if (player_skill_mod < req_skill_value) - { - return false; - } - return true; - } - - - public static boolean canUseInstrument(obj_id actor, int perf_index) throws InterruptedException - { - - if (perf_index == 0) - { - - return false; - } - - if (isHologramPerformer(actor)) - { - obj_id master = getMaster(actor); - - if (isIdValid(master)) - { - return canUseInstrument(master, perf_index); - } - else - { - - return false; - } - } - - String req_ability = dataTableGetString(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_REQ_INSTRUMENT); - - if (req_ability == null || req_ability.equals("")) - { - - return false; - } - - String[] splitAbility = split(req_ability, '_'); - req_ability = splitAbility[0]; - - if (hasCommand(actor, req_ability) || hasInspirationInstrumentUseBuff(actor, req_ability)) - { - return true; - } - - return false; - } - - - public static boolean canPerformSong(obj_id actor, int perf_index) throws InterruptedException - { - if (perf_index == 0) - { - return false; - } - - if (isHologramPerformer(actor)) - { - obj_id master = getMaster(actor); - - if (isIdValid(master)) - { - return canPerformSong(master, perf_index); - } - else - { - return false; - } - } - - String req_ability = dataTableGetString(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_REQ_SONG); - LOG ("performance", "Required song = "+ req_ability); - if (req_ability == null || req_ability.equals("")) - { - return false; - } - - if (req_ability.indexOf("dirge") > -1) - { - if (!utils.isProfession(actor, utils.ENTERTAINER)) - { - return false; - } - - else if (getLevel(actor) < 82) - { - return false; - } - } - - if (!hasCommand(actor, req_ability)) - { - return false; - } - return true; - } - - - public static boolean canPerformDance(obj_id actor, int perf_index) throws InterruptedException - { - if (perf_index == 0) - { - return false; - } - - if (isHologramPerformer(actor)) - { - obj_id master = getMaster(actor); - - if (isIdValid(master)) - { - return canPerformDance(master, perf_index); - } - else - { - return false; - } - } - - if (utils.hasScriptVar(actor, "event.dance_party")) - { - return true; - } - - String req_ability = dataTableGetString(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_REQ_DANCE); - LOG ("performance", "Required dance = "+ req_ability); - if (req_ability == null || req_ability.equals("")) - { - return false; - } - - if (!hasCommand(actor, req_ability)) - { - return false; - } - return true; - } - - - public static boolean canPerformJuggle(obj_id actor, int perf_index) throws InterruptedException - { - if (perf_index == 0) - { - return false; - } - - if (isHologramPerformer(actor)) - { - return true; - } - - String req_ability = dataTableGetString(DATATABLE_PERFORMANCE, perf_index - 1, DATATABLE_COL_REQ_JUGGLE); - LOG ("performance", "Required juggle = "+ req_ability); - if (req_ability == null || req_ability.equals("")) - { - return false; - } - - if (!hasCommand(actor, req_ability)) - { - return false; - } - return true; - } - - - public static boolean isValidDanceProp(obj_id object) throws InterruptedException - { - if (!isValidId(object)) - { - return false; - } - - String template = getTemplateName(object); - - return isGameObjectTypeOf(object, GOT_misc_instrument) && template.startsWith("object/tangible/dance_prop/"); - } - - - public static boolean isDancePropCertified(obj_id player, obj_id object) throws InterruptedException - { - if (!isValidDanceProp(object)) - { - return true; - } - - if (hasObjVar(object, "nocert") && hasSkill(player, "social_entertainer_novice")) - { - return true; - } - - String template = getTemplateName(object); - - String command = template.substring((template.lastIndexOf("/") + 1), template.lastIndexOf("_")); - - if (hasCommand(player, command)) - { - return true; - } - else if (hasInspirationDancePropUseBuff(player, command)) - { - return true; - } - - return false; - } - - - public static int calcPerformanceXp(obj_id actor) throws InterruptedException - { - if (!isIdValid(actor)) - { - return 0; - } - - if (!isPlayer(actor)) - { - return 0; - } - - int perf_index = getPerformanceType(actor); - int flourish_xp = performance.getFlourishXpMod(perf_index); - int base_xp = performance.getPerformanceBaseXp(perf_index); - - LOG ("entertainer_xp", "Performance Index = "+ perf_index); - LOG ("entertainer_xp", "Initial Flourish XP = "+ flourish_xp); - - int band_size = 1; - obj_id[] band_members = new obj_id[20]; - band_members[0] = actor; - - obj_id group = getGroupObject(actor); - if (isIdValid(group)) - { - obj_id[] members = getGroupMemberIds(group); - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - if (pet_lib.isDroidPet(members[i]) || isHologramPerformer(members[i])) - { - continue; - } - - if (getDistance(actor, members[i]) > PERFORMANCE_BAND_MEMBER_RANGE) - { - continue; - } - - if ((members[i] != actor && (hasScript(members[i], DANCE_HEARTBEAT_SCRIPT) || hasScript(members[i], MUSIC_HEARTBEAT_SCRIPT) || hasScript(members[i], JUGGLE_HEARTBEAT_SCRIPT)))) - { - band_members[band_size] = members[i]; - ++band_size; - } - } - } - - obj_id[] audience = getBandAudienceInRange(band_members, band_size, PERFORMANCE_XP_RANGE); - int audience_size = (audience.length - 1); - - if (audience_size < 0) - { - audience_size = 0; - } - - if (audience_size > (PERFORM_XP_AUDIENCE_MAX_1 + PERFORM_XP_AUDIENCE_MAX_2)) - { - audience_size = PERFORM_XP_AUDIENCE_MAX_1 + PERFORM_XP_AUDIENCE_MAX_2; - } - - int applause_count = getIntObjVar(actor, performance.VAR_PERFORM_APPLAUSE_COUNT); - setObjVar(actor, performance.VAR_PERFORM_APPLAUSE_COUNT, 0); - - int flourish_count = getIntObjVar(actor, performance.VAR_PERFORM_FLOURISH_COUNT); - setObjVar(actor, performance.VAR_PERFORM_FLOURISH_COUNT, 0); - setObjVar(actor, performance.VAR_PERFORM_FLOURISH_TOTAL, 0); - - LOG ("entertainer_xp", "Flourish Count = "+ flourish_count); - - int flourishDec = (int)((float)flourish_xp / 6.0f); - - flourish_xp *= flourish_count; - - int old_flourish_xp = getIntObjVar(actor, VAR_PERFORM_FLOURISH_XP); - - if (old_flourish_xp > flourish_xp) - { - flourish_xp = old_flourish_xp; - if (flourish_xp > 0) - { - flourish_xp -= flourishDec; - } - - if (flourish_xp < 0) - { - flourish_xp = 0; - } - } - setObjVar(actor, VAR_PERFORM_FLOURISH_XP, flourish_xp); - - int xp_amount = base_xp + flourish_xp; - LOG ("entertainer_xp", "XP Amount = "+ xp_amount + ", (Base XP: "+ base_xp + " + (Flourish XP: "+ flourish_xp + "))"); - - float band_mod = ((band_size - 1) / ((float)PERFORM_XP_GROUP_MAX)) * PERFORM_XP_GROUP_MOD; - float applause_mod = applause_count / 100f; - LOG ("entertainer_xp", "Band Mod = "+ band_mod); - LOG ("entertainer_xp", "Applaues Mod = "+ applause_mod); - - float audience_mod = (float)audience_size / 50f; - LOG ("entertainer_xp", "Audience Mod = "+ audience_mod); - - float xp_mod = 1f + band_mod + audience_mod + applause_mod; - - xp_amount = (int) (xp_amount * xp_mod); - - LOG ("entertainer_xp", "XP Mod = "+ xp_mod); - LOG ("entertainer_xp", "Total XP = "+ xp_amount); - - return xp_amount; - } - - - public static obj_id[] getBandAudienceInRange(obj_id[] band_members, int band_size, float range) throws InterruptedException - { - Vector audience = new Vector(); - audience.setSize(0); - - for (int i = 0; i < band_size; i++) - { - testAbortScript(); - obj_id[] member_audience; - - if (isIdValid(band_members[i])) - { - if (hasScript(band_members[i], DANCE_HEARTBEAT_SCRIPT) || hasScript(band_members[i], JUGGLE_HEARTBEAT_SCRIPT)) - { - member_audience = getPerformanceWatchersInRange(band_members[i], range); - } - else - { - member_audience = getPerformanceListenersInRange(band_members[i], range); - } - - if (member_audience != null && member_audience.length > 0) - { - for (int j = 0; j < member_audience.length; j++) - { - testAbortScript(); - if (!utils.isElementInArray(audience, member_audience[j])) - { - if (isIdValid(member_audience[j])) - { - if (!checkDenyService(band_members[i], member_audience[j])) - { - utils.addElement(audience, member_audience[j]); - } - } - } - } - } - } - } - - obj_id[] _audience = new obj_id[0]; - if (audience != null) - { - _audience = new obj_id[audience.size()]; - audience.toArray(_audience); - } - return _audience; - } - - - public static void denyService(obj_id player, obj_id target) throws InterruptedException - { - if (checkDenyService(player, target)) - { - removeDenyService(player, target); - } - else - { - addDenyService(player, target); - } - } - - - public static void addDenyService(obj_id player, obj_id target) throws InterruptedException - { - if (utils.hasScriptVar(target, VAR_PERFORM_PAY_AGREE)) - { - obj_id watched = getPerformanceWatchTarget(target); - obj_id listened = getPerformanceListenTarget(target); - - if ((isIdValid(watched) && watched == player) || (isIdValid(listened) && listened == player)) - { - sendSystemMessage(player, SID_DENY_SERVICE_COVER_CHARGE); - return; - } - } - - Vector denyServiceList = utils.getResizeableObjIdBatchScriptVar(player, "performance.denyService"); - - if (denyServiceList == null) - { - denyServiceList = new Vector(); - } - - utils.addElement(denyServiceList, target); - - utils.setBatchScriptVar(player, "performance.denyService", denyServiceList); - - performanceMessageToSelf(player, target, SID_DENY_SERVICE_ADD_SELF); - performanceMessageToPerson(target, player, target, SID_DENY_SERVICE_ADD_OTHER); - } - - - public static void removeDenyService(obj_id player, obj_id target) throws InterruptedException - { - Vector denyServiceList = utils.getResizeableObjIdBatchScriptVar(player, "performance.denyService"); - - if (denyServiceList == null) - { - return; - } - - utils.removeElement(denyServiceList, target); - - if (denyServiceList.size() == 0) - { - utils.removeBatchScriptVar(player, "performance.denyService"); - } - else - { - utils.setBatchScriptVar(player, "performance.denyService", denyServiceList); - } - - performanceMessageToSelf(player, target, SID_DENY_SERVICE_REMOVE_SELF); - performanceMessageToPerson(target, player, target, SID_DENY_SERVICE_REMOVE_OTHER); - } - - - public static boolean checkDenyService(obj_id player, obj_id target) throws InterruptedException - { - Vector denyServiceList = utils.getResizeableObjIdBatchScriptVar(player, "performance.denyService"); - - if (denyServiceList == null) - { - return false; - } - - return utils.isElementInArray(denyServiceList, target); - } - - - public static boolean displayAvailableMusic(obj_id actor, boolean band, boolean changeMusic) throws InterruptedException - { - if (!isIdValid(actor)) - { - return false; - } - - if (!notShapechanged(actor)) - { - return false; - } - - int instrument_equipped = getInstrumentAudioId(actor); - if (instrument_equipped == 0) - { - performanceMessageToSelf(actor, null, SID_MUSIC_NO_INSTRUMENT); - return true; - } - - Vector available_music = new Vector(); - available_music.setSize(0); - int num_items = dataTableGetNumRows(DATATABLE_PERFORMANCE); - for (int i = 0; i < num_items; i++) - { - testAbortScript(); - dictionary row = dataTableGetRow(DATATABLE_PERFORMANCE, i); - int type = row.getInt("type"); - if (type == (866729052)) - { - - int instrument_id = row.getInt("instrumentAudioId"); - if (instrument_equipped != instrument_id) - { - continue; - } - - String name = row.getString("performanceName"); - - if (canPerformSong(actor, i + 1)) - { - name = name.substring(0,1).toUpperCase() + name.substring(1).toLowerCase(); - available_music = utils.addElement(available_music, name); - } - } - } - - if (available_music.size() > 0) - { - sui.listbox(actor, actor, "@performance:select_song", sui.OK_CANCEL, "@performance:available_songs", available_music, "msgSongSelected"); - - if (!hasScript(actor, PERFORMANCE_SELECT)) - { - attachScript(actor, PERFORMANCE_SELECT); - } - - setObjVar(actor, VAR_AVAILABLE_PERFORMANCES, available_music, resizeableArrayTypeString); - setObjVar(actor, VAR_SELECT_MUSIC_BAND, band); - setObjVar(actor, VAR_SELECT_MUSIC_CHANGE, changeMusic); - - return true; - } - return false; - } - - - public static boolean displayAvailableDances(obj_id actor, boolean changeDance) throws InterruptedException - { - if (!isIdValid(actor)) - { - return false; - } - - if (hasObjVar(actor, VAR_AVAILABLE_PERFORMANCES)) - { - return false; - } - - if (!notShapechanged(actor)) - { - return false; - } - - Vector available_dances = new Vector(); - available_dances.setSize(0); - int num_items = dataTableGetNumRows(DATATABLE_PERFORMANCE); - for (int i = 0; i < num_items; i++) - { - testAbortScript(); - dictionary row = dataTableGetRow(DATATABLE_PERFORMANCE, i); - int type = row.getInt("type"); - if (type == (-1788534963)) - { - - String name = row.getString("performanceName"); - if (canPerformDance(actor, i + 1)) - { - name = name.substring(0,1).toUpperCase() + name.substring(1).toLowerCase(); - available_dances = utils.addElement(available_dances, name); - } - } - } - - if (available_dances.size() > 0) - { - sui.listbox(actor, actor, "@performance:select_dance", sui.OK_CANCEL, "@performance:available_dances", available_dances, "msgDanceSelected"); - - if (!hasScript(actor, PERFORMANCE_SELECT)) - { - attachScript(actor, PERFORMANCE_SELECT); - } - - setObjVar(actor, VAR_AVAILABLE_PERFORMANCES, available_dances, resizeableArrayTypeString); - if (changeDance) - { - setObjVar(actor, VAR_SELECT_DANCE_CHANGE, 1); - } - - return true; - } - return false; - } - - - public static boolean displayAvailableJuggles(obj_id actor, boolean changeJuggle) throws InterruptedException - { - if (!isIdValid(actor)) - { - return false; - } - - if (hasObjVar(actor, VAR_AVAILABLE_PERFORMANCES)) - { - return false; - } - - if (!notShapechanged(actor)) - { - return false; - } - - Vector available_juggles = new Vector(); - available_juggles.setSize(0); - int num_items = dataTableGetNumRows(DATATABLE_PERFORMANCE); - for (int i = 0; i < num_items; i++) - { - testAbortScript(); - dictionary row = dataTableGetRow(DATATABLE_PERFORMANCE, i); - int type = row.getInt("type"); - if (type == (124914482)) - { - - String name = row.getString("performanceName"); - if (canPerformJuggle(actor, i + 1)) - { - name = name.substring(0,1).toUpperCase() + name.substring(1).toLowerCase(); - available_juggles = utils.addElement(available_juggles, name); - } - } - } - - if (available_juggles.size() > 0) - { - sui.listbox(actor, actor, "@performance:select_juggs", sui.OK_CANCEL, "@performance:available_juggs", available_juggles, "msgJuggleSelected"); - - if (!hasScript(actor, PERFORMANCE_SELECT)) - { - attachScript(actor, PERFORMANCE_SELECT); - } - - setObjVar(actor, VAR_AVAILABLE_PERFORMANCES, available_juggles, resizeableArrayTypeString); - if (changeJuggle) - { - setObjVar(actor, VAR_SELECT_JUGGLE_CHANGE, 1); - } - - return true; - } - return false; - } - - - public static int canPerformanceHeal(obj_id actor) throws InterruptedException - { - if (pet_lib.isDroidPet(actor) || isHologramPerformer(actor)) - { - return 0; - } - - if (!utils.isProfession(actor, utils.ENTERTAINER)) - { - return 0; - } - - location loc = getLocation(actor); - if (isIdValid(loc.cell)) - { - obj_id building = getTopMostContainer(loc.cell); - if (!hasObjVar(building, "healing.canhealshock") && !hasObjVar(loc.cell, "healing.canhealshock")) - { - return 0; - } - return 2; - } - - if (camping.isInEntertainmentCamp(actor)) - { - return 2; - } - - region[] regs = getRegionsWithGeographicalAtPoint(getLocation(actor), regions.GEO_THEATER); - if (regs != null && regs.length > 0) - { - return 2; - } - - int improv = (int)getSkillStatisticModifier(actor, "expertise_en_improv"); - if (improv == 1) - { - return 3; - } - - return 0; - } - - - public static boolean isInRightBuilding(obj_id objPlayer, obj_id objBuilding) throws InterruptedException - { - location locTest = getLocation(objPlayer); - if (isIdValid(locTest.cell)) - { - obj_id objOwner = getTopMostContainer(locTest.cell); - if (objBuilding == objOwner) - { - return true; - } - } - return false; - } - - - public static void checkAndIncrementEntertainerMissions(obj_id objPlayer, String strType) throws InterruptedException - { - if (hasObjVar (objPlayer, "newbie_handoff.mission.gig")) - { - incrementNewbieHandoffEntertainerMissions(objPlayer, strType); - } - - LOG("missions", "checking for entertainer missions"); - obj_id[] objMissions = getMissionObjects(objPlayer); - if (objMissions == null) - { - LOG("missions", "no missions found"); - return; - } - int intI = 0; - while (intI < objMissions.length) - { - testAbortScript(); - obj_id objMissionData = objMissions[intI]; - String strMissionType = getMissionType(objMissionData); - LOG("missions", "strMissionType is "+strMissionType); - if (strMissionType.equals(strType)) - { - obj_id objBuilding = getObjIdObjVar(objMissionData, "objBuilding"); - LOG("mission", "building is "+objBuilding); - if (isInRightBuilding(objPlayer, objBuilding)) - { - - int intDuration = getIntObjVar(objMissionData, "intTime"); - int intGameTime = getGameTime(); - int intStartTime = intGameTime; - if (hasObjVar(objMissions[intI], "intStartTime")) - { - intStartTime = getIntObjVar(objMissions[intI], "intStartTime"); - } - else - { - setObjVar(objMissions[intI], "intStartTime", intStartTime); - return; - } - - int intElapsedTime = intGameTime - intStartTime; - LOG("missions", "intElapsedTime is "+intElapsedTime); - - if (intElapsedTime >= intDuration) - { - messageTo(objMissions[intI], "entertainerSuccess", null, 0, true); - } - } - } - - intI = intI+1; - } - } - - - public static void stopEntertainerMissionTracking(obj_id objPlayer, String strType) throws InterruptedException - { - if (hasObjVar (objPlayer, "newbie_handoff.mission.gig")) - { - stopNewbieHandoffEntertainerMissionTracking(objPlayer, strType); - } - - obj_id[] objMissions = getMissionObjects(objPlayer); - - if (objMissions == null) - { - return; - } - - int intI = 0; - - while (intI < objMissions.length) - { - testAbortScript(); - obj_id objMissionData = objMissions[intI]; - - if (!isIdValid(objMissionData)) - { - LOG("DESIGNER_FATAL", "Mission object with null mission data, id is "+objMissions[intI]+" player is "+objPlayer); - return; - } - - String strMissionType = getMissionType(objMissionData); - - if (strMissionType == null) - { - LOG("DESIGNER_FATAL", "strMissionType is null for "+objMissionData+" and player is "+objPlayer+" and objMission is "+objMissions[intI]); - return; - } - - if (strMissionType.equals(strType)) - { - if (hasObjVar(objMissions[intI], "intStartTime")) - { - removeObjVar(objMissions[intI], "intStartTime"); - } - } - - intI++; - } - } - - - public static void incrementNewbieHandoffEntertainerMissions(obj_id player, String type) throws InterruptedException - { - String missionType = getStringObjVar( player, "newbie_handoff.mission.gig.type"); - LOG("newbie_gig_mission", "Current mission type: "+missionType+", current performance type: "+type); - - if (type.equals(missionType)) - { - obj_id building = getObjIdObjVar( player, "newbie_handoff.mission.gig.obj"); - LOG("newbie_gig_mission", "Checking to see if in correct building. - "+building); - - if (isInRightBuilding(player, building)) - { - int duration = getIntObjVar( player, "newbie_handoff.mission.gig.duration"); - int curTime = getGameTime(); - int start = curTime; - - if (hasObjVar(player, "newbie_handoff.mission.gig.start")) - { - start = getIntObjVar( player, "newbie_handoff.mission.gig.start"); - LOG("newbie_gig_mission", "Getting mission start time "+start); - } - else - { - setObjVar( player, "newbie_handoff.mission.gig.start", start); - LOG("newbie_gig_mission", "Initializing mission start time "+start); - return; - } - - int elapsedTime = curTime - start; - - if (elapsedTime >= duration) - { - LOG("newbie_gig_mission", "Mission Complete"); - messageTo( player, "missionGigComplete", null, 0, true ); - } - } - } - } - - - public static void stopNewbieHandoffEntertainerMissionTracking(obj_id player, String type) throws InterruptedException - { - if (hasObjVar(player, "newbie_handoff.mission.gig.start")) - { - LOG("newbie_gig_mission", "Removing time tracking objvar"); - removeObjVar( player, "newbie_handoff.mission.gig.start"); - } - } - - - public static void startJuggling(obj_id actor, String juggleName) throws InterruptedException - { - - if (juggleName == null || juggleName.length() < 1) - { - displayAvailableJuggles(actor, false); - return; - } - - if (getPerformanceType(actor) != 0) - { - performanceMessageToSelf(actor, null, SID_ALREADY_PERFORMING_SELF); - return; - } - - int performanceIndex = lookupPerformanceIndex((124914482), juggleName, 0); - if (performanceIndex == 0) - { - performanceMessageToSelf(actor, null, SID_JUGGLE_UNKNOWN_SELF); - return; - } - - if (!notShapechanged(actor)) - { - return; - } - - if (!canPerformJuggle(actor, performanceIndex)) - { - performanceMessageToSelf(actor, null, SID_JUGGLE_LACK_SKILL_SELF); - return; - } - - performanceMessageToSelf(actor, null, SID_JUGGLE_START_SELF); - performanceMessageToWatchers(actor, null, SID_JUGGLE_START_OTHER); - - dictionary params; - int startTime = getGameTime(); - - setPerformanceType(actor, performanceIndex); - setPerformanceStartTime(actor, startTime); - - setPerformanceWatchTarget(actor, actor); - - attachScript(actor, JUGGLE_HEARTBEAT_SCRIPT); - - sendNpcsEntertainmentMessage(actor, NPC_ENTERTAINMENT_MESSAGE_START, PERFORMANCE_TYPE_JUGGLE); - - params = new dictionary(); - params.put("performer", actor); - broadcastMessage("handlePerformerStartPerforming", params); - - params = new dictionary(); - params.put("performanceIndex", performanceIndex); - params.put("sequence", 0); - messageTo(actor, "OnPulse", params, PERFORMANCE_HEARTBEAT_TIME, false); - } - - - public static void stopJuggling(obj_id actor) throws InterruptedException - { - if (hasScript(actor, JUGGLE_HEARTBEAT_SCRIPT)) - { - - dictionary params = new dictionary(); - params.put("performer", actor); - params.put("check", "musician"); - broadcastMessage("handlePerformerStopPerforming", params); - - messageTo(actor, "OnPerformanceEnd", null, 0.0f, false); - setPerformanceType(actor, 0); - setPerformanceStartTime(actor, 0); - - performanceMessageToSelf(actor, null, SID_JUGGLE_STOP_SELF); - performanceMessageToWatchers(actor, null, SID_JUGGLE_STOP_OTHER); - } - else - { - if (hasObjVar(actor, performance.VAR_PERFORM)) - { - removeObjVar(actor, performance.VAR_PERFORM); - } - performanceMessageToSelf(actor, null, SID_JUGGLE_NOT_PERFORMING); - } - } - - - public static void changeJuggle(obj_id actor, String juggleName) throws InterruptedException - { - - if (juggleName == null || juggleName.length() < 1) - { - displayAvailableJuggles(actor, true); - return; - } - - if (!hasScript(actor, JUGGLE_HEARTBEAT_SCRIPT)) - { - performanceMessageToSelf(actor, null, SID_JUGGLE_MUST_BE_PERFORMING_SELF); - return; - } - - int performanceIndex = lookupPerformanceIndex((124914482), juggleName, 0); - if (performanceIndex == 0) - { - performanceMessageToSelf(actor, null, SID_JUGGLE_UNKNOWN_SELF); - return; - } - - if (!notShapechanged(actor)) - { - return; - } - - if (!canPerformJuggle(actor, performanceIndex)) - { - performanceMessageToSelf(actor, null, SID_JUGGLE_LACK_SKILL_SELF); - return; - } - - setPerformanceType(actor, performanceIndex); - queueCommand(actor, (-1219480501), null, "1", COMMAND_PRIORITY_IMMEDIATE); - } - - - public static void openInspireMenu(obj_id self, obj_id target) throws InterruptedException - { - if (utils.hasScriptVar(self, VAR_BUFF_SUI)) - { - int pidClose = utils.getIntScriptVar(self, VAR_BUFF_SUI); - forceCloseSUIPage(pidClose); - } - - if (!utils.isProfession(self, utils.ENTERTAINER)) - { - return; - } - - Vector dsrc = new Vector(); - Vector list = new Vector(); - for (int i = 0; i < INSPIRATION_BUFF_ENTERTAINER.length; i++) - { - testAbortScript(); - dsrc.addElement("@performance:"+ INSPIRATION_BUFF_ENTERTAINER[i]); - list.addElement(INSPIRATION_BUFF_ENTERTAINER[i]); - } - - String type = ""; - - if (hasScript(self, DANCE_HEARTBEAT_SCRIPT)) - { - obj_id watched = getPerformanceWatchTarget(target); - if (watched != self) - { - sendSystemMessage(self, new string_id("performance", "insp_buff_must_watch")); - return; - } - - for (int i = 0; i < INSPIRATION_BUFF_DANCER.length; i++) - { - testAbortScript(); - dsrc.addElement("@performance:"+ INSPIRATION_BUFF_DANCER[i]); - list.addElement(INSPIRATION_BUFF_DANCER[i]); - } - } - else if (hasScript(self, MUSIC_HEARTBEAT_SCRIPT)) - { - obj_id listened = getPerformanceListenTarget(target); - if (listened != self) - { - sendSystemMessage(self, new string_id("performance", "insp_buff_must_listen")); - return; - } - - for (int i = 0; i < INSPIRATION_BUFF_MUSICIAN.length; i++) - { - testAbortScript(); - dsrc.addElement("@performance:"+ INSPIRATION_BUFF_MUSICIAN[i]); - list.addElement(INSPIRATION_BUFF_MUSICIAN[i]); - } - } - else - { - sendSystemMessage(self, new string_id("performance", "insp_buff_must_perform")); - return; - } - - String prompt = "@performance:inspire_menu_prompt "+ getName(target); - prompt += "\n\n"; - prompt += "@performance:inspire_menu_prompt2"; - String title = "@performance:inspire_menu_title"; - - int pid = sui.listbox(self, self, prompt, sui.OK_CANCEL, title, dsrc, "handleInspireMenu"); - - if (pid >= 0) - { - utils.setScriptVar(self, VAR_BUFF_LIST, utils.toStaticStringArray(list)); - utils.setScriptVar(self, VAR_BUFF_TARGET, target); - utils.setScriptVar(self, VAR_BUFF_SUI, pid); - } - } - - - public static boolean hasMaxHolo(obj_id actor) throws InterruptedException - { - if (!isIdValid(actor)) - { - return true; - } - - if (utils.hasScriptVar(actor, "currentHolo")) - { - int holoPets = utils.getIntScriptVar(actor, "currentHolo"); - int holoMod = (int)getSkillStatisticModifier(actor, "expertise_en_holographic_additional_backup"); - int maxHoloAllowed = 1; - maxHoloAllowed += holoMod; - if (holoPets >= maxHoloAllowed) - { - return true; - } - } - - return false; - } - - - public static void holographicCleanup(obj_id actor) throws InterruptedException - { - obj_id holoDelete = null; - if (utils.hasScriptVar(actor, "holoId1")) - { - holoDelete = utils.getObjIdScriptVar(actor, "holoId1"); - if (exists(holoDelete)) - { - destroyObject(holoDelete); - } - } - - if (utils.hasScriptVar(actor, "holoId2")) - { - holoDelete = utils.getObjIdScriptVar(actor, "holoId2"); - if (exists(holoDelete)) - { - destroyObject(holoDelete); - } - } - - if (utils.hasScriptVar(actor, "holoId3")) - { - holoDelete = utils.getObjIdScriptVar(actor, "holoId3"); - if (exists(holoDelete)) - { - destroyObject(holoDelete); - } - } - - utils.removeScriptVar(actor, "currentHolo"); - utils.removeScriptVar(actor, "holoMessageTime"); - utils.removeScriptVar(actor, "holoId1"); - utils.removeScriptVar(actor, "holoId2"); - utils.removeScriptVar(actor, "holoId3"); - sendSystemMessage(actor, new string_id("spam", "holo_despawned")); - return; - } - - - public static boolean createHolographicBackup(obj_id actor) throws InterruptedException - { - if (!isIdValid(actor)) - { - return false; - } - - if (group.isGrouped(actor)) - { - obj_id groupId = getGroupObject(actor); - obj_id[] groupMembers = getGroupMemberIds( groupId ); - if (groupMembers.length == 8) - { - sendSystemMessage(actor, new string_id("spam", "holo_group_full")); - return false; - } - - obj_id groupLeaderId = getGroupLeaderId( groupId ); - if (groupLeaderId != actor) - { - sendSystemMessage(actor, new string_id("spam", "holo_not_leader")); - return false; - } - } - - location myLoc = getLocation(actor); - - int species = getSpecies(actor); - int gender = getGender(actor); - - String template = "object/mobile/hologram/"; - - String speciesString = "human"; - String genderString = "male"; - - switch(species) - { - case SPECIES_RODIAN: speciesString = "rodian"; - break; - case SPECIES_TRANDOSHAN: speciesString = "trandoshan"; - break; - case SPECIES_MON_CALAMARI: speciesString = "moncal"; - break; - case SPECIES_WOOKIEE: speciesString = "wookiee"; - break; - case SPECIES_BOTHAN: speciesString = "bothan"; - break; - case SPECIES_TWILEK: speciesString = "twilek"; - break; - case SPECIES_ZABRAK: speciesString = "zabrak"; - break; - case SPECIES_ITHORIAN: speciesString = "ithorian"; - break; - case SPECIES_SULLUSTAN: speciesString = "sullustan"; - break; - } - - if (gender == GENDER_FEMALE) - { - genderString = "female"; - } - - template += speciesString + "_"+ genderString + ".iff"; - - obj_id hologram = createObject(template, myLoc); - - if (isIdValid(hologram)) - { - int holoPets = 1; - if (utils.hasScriptVar(actor, "currentHolo")) - { - holoPets = utils.getIntScriptVar(actor, "currentHolo"); - holoPets = holoPets +1; - utils.setScriptVar(actor, "currentHolo", holoPets); - } - else - { - utils.setScriptVar(actor, "currentHolo", holoPets); - } - - int intTime = getGameTime(); - utils.setScriptVar(actor, "holoMessageTime", intTime); - - utils.setScriptVar(actor, "holoId"+holoPets, hologram); - - dictionary msgTimer = new dictionary(); - msgTimer.put("holoMessageTime", intTime); - messageTo(actor, "handleHoloTimeout", msgTimer, 3600, false); - setMaster(hologram, actor); - setScale(hologram, getScale(actor)); - setYaw(hologram, getYaw(actor)); - setHologramType(hologram, HOLOGRAM_TYPE1_QUALITY4); - setName(hologram, "Hologram"); - setInvulnerable(hologram, true); - - custom_var[] var_list = getAllCustomVars(actor); - - if (var_list != null && var_list.length > 0) - { - for (int i = 0; i < var_list.length; i++) - { - testAbortScript(); - ranged_int_custom_var ricv = (ranged_int_custom_var)var_list[i]; - - String var = ricv.getVarName(); - int value = ricv.getValue(); - - if (value != 0) - { - setRangedIntCustomVarValue(hologram, var, value); - } - - } - } - - setPalcolorCustomVarClosestColor(hologram,"/shared_owner/index_color_skin", 255,255,255,255); - - obj_id[] contents = getAllWornItems(actor, false); - - utils.setObjVar(hologram, "hologram_performer", 1); - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (isIdValid(contents[i])) - { - if (getContainerType(contents[i]) == 0) - { - - if (getGameObjectType(contents[i]) == GOT_misc_appearance_only_invisible) - { - continue; - } - - if (!getTemplateName(contents[i]).endsWith("player.iff")) - { - createObject(getTemplateName(contents[i]), hologram, ""); - } - } - } - } - } - - setMaster(hologram, actor); - - attachScript(hologram, "systems.skills.performance.holographic_backup"); - utils.setScriptVar(hologram, "hologram_performer", 1); - - queueCommand(actor, (-2007999144), hologram, "", COMMAND_PRIORITY_DEFAULT); - messageTo(hologram, "handleGroupInvitation", null, 2f, false); - - return true; - } - - return false; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/player_structure.java b/sku.0/sys.server/compiled/game/script/library/player_structure.java deleted file mode 100644 index 033f83757..000000000 --- a/sku.0/sys.server/compiled/game/script/library/player_structure.java +++ /dev/null @@ -1,9495 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.lang.Math; -import script.library.city; -import script.library.prose; -import script.library.regions; -import script.library.static_item; -import script.library.sui; -import script.library.target_dummy; -import script.library.trace; -import script.library.trial; -import script.library.utils; -import script.library.vendor_lib; - - -public class player_structure extends script.base_script -{ - public player_structure() - { - } - public static final boolean LOGGING_ON = false; - public static final String LOGGING_CATEGORY = "special_sign"; - - public static final String SCRIPT_TERMINAL_STRUCTURE = "terminal.terminal_structure"; - public static final String SCRIPT_PERMANENT_STRUCTURE = "structure.permanent_structure"; - - public static final String PLAYER_STRUCTURE_DATATABLE = "datatables/structure/player_structure.iff"; - public static final String PLAYER_STRUCTURE_VALIDATION_DATATABLE = "datatables/structure/player_structure_validation.iff"; - public static final String TBL_SIGN = "datatables/structure/player_structure_sign.iff"; - public static final String TBL_SPECIAL_SIGNS = "datatables/structure/special_sign.iff"; - public static final String SIGN_ADJUST_SIGN_BY_TEMPLATE = "datatables/structure/sign_adjust_by_template.iff"; - - public static final String DATATABLE_COL_STRUCTURE = "STRUCTURE"; - public static final String DATATABLE_COL_TEMP_STRUCTURE = "TEMP_STRUCTURE"; - public static final String DATATABLE_COL_FOOTPRINT = "FOOTPRINT_TEMPLATE"; - public static final String DATATABLE_COL_EJECT_RANGE = "EJECT_RANGE"; - public static final String DATATABLE_COL_X = "X"; - public static final String DATATABLE_COL_Y = "Y"; - public static final String DATATABLE_COL_Z = "Z"; - public static final String DATATABLE_COL_CELL = "CELL"; - public static final String DATATABLE_COL_HEADING = "HEADING"; - public static final String DATATABLE_COL_OBJECT = "OBJECT"; - public static final String DATATABLE_COL_CIVIC = "CIVIC"; - public static final String DATATABLE_COL_CITY_RANK = "CITY_RANK"; - public static final String DATATABLE_COL_CITY_COST = "CITY_COST"; - public static final String DATATABLE_COL_MAINT_RATE = "MAINT_RATE"; - public static final String DATATABLE_COL_DECAY_RATE = "DECAY_RATE"; - public static final String DATATABLE_COL_REDEED_COST = "REDEED_COST"; - public static final String DATATABLE_COL_CONDITION = "CONDITION"; - public static final String DATATABLE_COL_SKILL_MOD = "SKILLMOD"; - public static final String DATATABLE_COL_SKILL_MOD_VALUE = "SKILLMODVALUE"; - public static final String DATATABLE_COL_SKILL_MOD_MESSAGE = "SKILLMOD_MESSAGE"; - public static final String DATATABLE_COL_VERSION = "VERSION"; - public static final String DATATABLE_COL_NO_LOT_REQ = "NO_LOT_REQUIREMENT"; - public static final String DATATABLE_COL_LOT_REDUCTION = "LOT_REDUCTION"; - public static final String DATATABLE_COL_HAS_SIGN = "HAS_SIGN"; - public static final String DATATABLE_COL_POWER_RATE = "POWER_RATE"; - public static final String WORLD_DELTA = "WORLD_DELTA"; - - public static final String DATATABLE_COL_TEMPLATE = "TEMPLATE"; - public static final String DATATABLE_COL_HOPPER_MIN = "HOPPER_MIN"; - public static final String DATATABLE_COL_HOPPER_MAX = "HOPPER_MAX"; - - public static final String VAR_PLAYER_STRUCTURE = "player_structure"; - - public static final String VAR_TERMINAL_HEADING = "player_structure.intendedHeading"; - public static final String OBJVAR_STORED_HANGAR_LITE = "hangar_lite.storedInHangarLite"; - - public static final String VAR_OWNER = "player_structure.owner"; - public static final String VAR_OWNER_FACTION = "player_structure.faction"; - public static final String VAR_ENTER_LIST = "player_structure.enter.enterList"; - public static final String VAR_BAN_LIST = "player_structure.ban.banList"; - public static final String VAR_ADMIN_LIST = "player_structure.admin.adminList"; - public static final String VAR_VENDOR_LIST = "player_structure.vendor.vendorList"; - public static final String VAR_HOPPER_LIST = "player_structure.hopper.hopperList"; - public static final String VAR_CIVIC = "player_structure.civic"; - public static final String VAR_CITY_RANK = "player_structure.city_rank"; - public static final String VAR_CITY_COST = "player_structure.city_cost"; - public static final String VAR_MAINTENANCE_MOD = "player_structure.maintanence.mod"; - public static final String VAR_DECAY_RATE = "player_structure.maintanence.decay"; - public static final String VAR_LAST_MAINTANENCE = "player_structure.last_maintanence"; - public static final String VAR_CONDITION = "player_structure.condition"; - public static final String VAR_MAX_CONDITION = "player_structure.max_condition"; - public static final String VAR_BASE_OBJECT = "player_structure.base_objects"; - public static final String VAR_MAX_EXTRACTION = "player_structure.maxExtraction"; - public static final String VAR_CURRENT_EXTRACTION = "player_structure.currentExtraction"; - public static final String VAR_MAX_HOPPER = "player_structure.maxHopper"; - public static final String VAR_VERSION = "player_structure.version"; - public static final String VAR_IS_GUILD_HALL = "player_structure.is_guild_hall"; - public static final String VAR_LAST_MESSAGE = "player_structure.last_message"; - public static final String VAR_PERMISSIONS_CONVERTED = "player_structure.permissions_converted"; - public static final String VAR_ABANDONED = "player_structure.abandoned"; - public static final String OBJVAR_HANGAR_CREATED = "hangar.created"; - - public static final String VAR_MAINTENANCE_MODIFIERS = "player_structure.maintanence.modifiers"; - public static final String VAR_MAINTENANCE_MOD_FACTORY = VAR_MAINTENANCE_MODIFIERS + ".factory"; - public static final String VAR_MAINTENANCE_MOD_HARVESTER = VAR_MAINTENANCE_MODIFIERS + ".harvester"; - public static final String VAR_MAINTENANCE_MOD_MERCHANT = VAR_MAINTENANCE_MODIFIERS + ".merchant"; - public static final String VAR_MAINTENANCE_MOD_TAX = VAR_MAINTENANCE_MODIFIERS + ".tax"; - - public static final String VAR_POWER_MOD_FACTORY = "player_structure.power.modifiers.factory"; - public static final String VAR_POWER_MOD_HARVESTER = "player_structure.power.modifiers.harvester"; - - public static final String VAR_SIGN_BASE = "player_structure.sign"; - public static final String VAR_SIGN_ID = VAR_SIGN_BASE + ".id"; - public static final String VAR_SIGN_NAME = VAR_SIGN_BASE + ".name"; - public static final String VAR_SIGN_TYPE = VAR_SIGN_BASE + ".type"; - - public static final String SCRIPT_TEMPORARY_STRUCTURE = "structure.temporary_structure"; - public static final String VAR_DEED_TEMPLATE = "player_structure.deed.template"; - public static final String VAR_DEED_TEMPLATE_CRC = "player_structure.deed.template_crc"; - public static final String VAR_DEED_BUILDTIME = "player_structure.deed.buildtime"; - public static final String VAR_DEED_SCENE = "player_structure.deed.scene"; - public static final String VAR_DEED_TIMESTAMP = "player_structure.deed.timestamp"; - public static final String VAR_DEED_MAX_EXTRACTION = "player_structure.deed.maxExtractionRate"; - public static final String VAR_DEED_CURRENT_EXTRACTION = "player_structure.deed.currentExtractionRate"; - public static final String VAR_DEED_MAX_HOPPER = "player_structure.deed.maxHopperSize"; - - public static final String VAR_DEED_SURPLUS_BASE = "player_structure.deed.surplus"; - public static final String VAR_DEED_SURPLUS_POWER = "player_structure.deed.surplus.power"; - public static final String VAR_DEED_SURPLUS_MAINTENANCE = "player_structure.deed.surplus.maintenance"; - - public static final String VAR_TEMP_TEMPLATE = "player_structure.construction.template"; - public static final String VAR_TEMP_OWNER = "player_structure.construction.owner"; - public static final String VAR_TEMP_OWNER_NAME = "player_structure.construction.ownerName"; - public static final String VAR_TEMP_OWNER_FACTION = "player_structure.construction.ownerFaction"; - public static final String VAR_TEMP_ROTATION = "player_structure.construction.rotation"; - public static final String VAR_TEMP_PLACEMENT_HEIGHT = "player_structure.construction.placementHeight"; - - public static final String VAR_LOTS_USED = "player_structure.lotsUsed"; - public static final String VAR_RESIDENCE_BUILDING = "player_structure.residence.building"; - public static final String VAR_RESIDENCE_CAN_DECLARE = "player_structure.residence.canDeclare"; - public static final String VAR_CONFIRM_DESTROY = "player_structure.confirmDestroy"; - - public static final String VAR_IS_PLACED_OBJECT = "player_structure.is_placed_object"; - - public static final String VAR_WAYPOINT_STRUCTURE = "player_structure.waypoint"; - - public static final float INSTALLATION_RANGE = 30.0f; - public static final float CIVIC_INSTALLATION_RANGE = 30.0f; - public static final float RATE_POWER_MIN = 1f; - public static final float MERCHANT_SALES_MODIFIER = -0.2f; - public static final int MIN_RESIDENCE_DURATION = 86400; - public static final int MAX_LOTS = 10; - public static final int MAX_LIST_SIZE = 50; - public static final int MAIL_WARNING_INTERVAL = 86400; - public static final int TIME_TO_NEXT_PACKUP = 86400; - - public static final float HOUSE_PACKUP_FAILURE_TIMER = 0.f; - public static final float HOUSE_PACKUP_LOCKOUT_TIMER = 300.0f; - public static final int ARRAY_LENGTH_FOR_HOUSE_PACKUP = 2; - - public static final String SCRIPTVAR_HOUSE_PACKUP_TREE_PREFIX = "packup_structure"; - public static final String SCRIPTVAR_HOUSE_PACKUP_LOCKOUT_TIME = SCRIPTVAR_HOUSE_PACKUP_TREE_PREFIX + ".time_started"; - - public static final String HOUSE_PACKUP_ARRAY_OBJVAR = "housePackup"; - public static final String HOUSE_PACKUP_DAILY_TALLY_OBJVAR = "dailyHousePackup"; - public static final String HOUSE_PACKUP_DAILY_TIMER_OBJVAR = "maxHousePackupTimer"; - - public static final string_id SID_LOCKOUT_MESSAGE = new string_id("player_structure", "house_lockout_remaining"); - - public static final String[] SIGN_TYPE = - { - "object/tangible/sign/player/house_address.iff", - "object/tangible/sign/player/shop_sign_s01.iff", - "object/tangible/sign/player/shop_sign_s02.iff", - "object/tangible/sign/player/shop_sign_s03.iff", - "object/tangible/sign/player/shop_sign_s04.iff", - "object/tangible/sign/player/house_address_naboo.iff", - "object/tangible/sign/player/house_address_corellia.iff", - "object/tangible/sign/player/house_address_tatooine.iff", - }; - public static final string_id[] SIGN_NAMES = - { - new string_id("player_structure","house_address"), - new string_id("player_structure","shop_sign1"), - new string_id("player_structure","shop_sign2"), - new string_id("player_structure","shop_sign3"), - new string_id("player_structure","shop_sign4") - }; - - public static final String MODIFIED_HOUSE_SIGN = "structure.modifiedSign"; - - public static final String MODIFIED_HOUSE_SIGN_MODEL = "structure.modifiedSignModel"; - - public static final String SPECIAL_SIGN = "structure.special_sign.hasSpecialSign"; - public static final String SPECIAL_SIGN_TEMPLATE = "structure.special_sign.specialSignTemplate"; - public static final String SPECIAL_SIGN_SKILLMOD = "structure.special_sign.specialSignSkillMod"; - public static final String SPECIAL_SIGN_DECREMENT_MOD = "structure.special_sign.specialSignDecrementSkillMod"; - public static final String SPECIAL_SIGN_OWNER_ONLY = "structure.special_sign.specialSignOwnerOnly"; - - public static final String VAR_SPECIAL_SIGN_TREE = "special_sign"; - - public static final String VAR_SPECIAL_SIGN_LIST = VAR_SPECIAL_SIGN_TREE+".sign_list"; - public static final String VAR_SPECIAL_SIGN_NAMES = VAR_SPECIAL_SIGN_TREE+".sign_name"; - public static final String VAR_SPECIAL_SIGN_MENU = VAR_SPECIAL_SIGN_TREE+".sign_menu"; - public static final String VAR_SPECIAL_SIGN_MENU_PID = VAR_SPECIAL_SIGN_TREE+".sign_menu_pid"; - - public static final string_id SID_MAIL_STRUCTURE_DAMAGE_CONDEMN = new string_id("player_structure", "mail_structure_damage_condemn"); - public static final string_id SID_MAIL_STRUCTURE_DAMAGE_SUB = new string_id("player_structure", "mail_structure_damage_sub"); - public static final string_id SID_MAIL_STRUCTURE_DAMAGE = new string_id("player_structure", "mail_structure_damage"); - public static final string_id SID_BUILD_NO_CITY = new string_id("city/city", "build_no_city"); - public static final string_id SID_RANK_REQ = new string_id("city/city", "rank_req"); - public static final string_id SID_NO_RIGHTS = new string_id("player_structure", "no_rights"); - public static final string_id SID_CIVIC_COUNT = new string_id("city/city", "civic_count"); - public static final string_id CANNOT_PLACE_MINEFIELD = new string_id("player_structure", "cannot_place_minefield"); - public static final string_id CANNOT_PLACE_TURRET = new string_id("player_structure", "cannot_place_turret"); - public static final string_id SID_CANNOT_BUILD_GARAGE_TOO_CLOSE = new string_id("player_structure", "cannot_build_garage_too_close"); - - public static final string_id SID_SUI_CONFIRM_PLACEMENT_TITLE = new string_id("player_structure", "sui_confirm_placement_title"); - public static final string_id SID_SUI_CONFIRM_PLACEMENT_PROMPT = new string_id("player_structure", "sui_confirm_placement_prompt"); - public static final string_id SID_NO_FREE_TRIAL = new string_id("player_structure", "no_free_trial"); - - public static final string_id PACKUP_EMAIL_TITLE = new string_id("spam", "packup_email_title"); - public static final string_id PACKUP_EMAIL_BODY = new string_id("spam", "packup_email_body"); - public static final string_id SELF_PACKUP_EMAIL_TITLE = new string_id("spam", "packup_email_title_self"); - public static final string_id SELF_PACKUP_EMAIL_BODY = new string_id("spam", "packup_email_body_self"); - - public static final string_id CANT_APPLY_SKILLMOD = new string_id("base_player", "cant_use_item"); - public static final string_id SID_SPECIAL_SIGN_FAILED = new string_id("base_player", "special_sign_failed"); - public static final string_id SID_SPECIAL_SIGN_SUCCESS = new string_id("base_player", "special_sign_success"); - public static final string_id SID_SPECIAL_SIGN_REVERT_SUCCESS = new string_id("base_player", "special_sign_revert_success"); - public static final string_id SID_SPECIAL_SIGN_REMOVED = new string_id("base_player", "special_sign_removed"); - public static final string_id SID_SPECIAL_SIGN_UI_TITLE = new string_id("base_player", "special_sign_ui_title"); - public static final string_id SID_SPECIAL_SIGN_UI_PROMPT = new string_id("base_player", "special_sign_ui_prompt"); - public static final string_id SID_REMOVE_SPCIAL_SIGN_TO_DESTROY = new string_id("player_structure", "remove_sign_before_structure_destroy"); - public static final string_id SID_SPECIAL_SIGN_NO_TRANSFER = new string_id("player_structure", "remove_sign_before_structure_transfer"); - public static final string_id SID_HALLOWEEN_SIGN_UPDATED = new string_id("player_structure", "halloween_sign_updated"); - public static final string_id SID_ONLY_OWNER_CAN_REMOVE = new string_id("player_structure", "only_owner_can_remove_sign"); - - public static final String STF_FILE = "player_structure"; - public static final String SELFPOWERED_DEED = "object/tangible/veteran_reward/harvester.iff"; - public static final String SELFPOWERED_DEED_ELITE = "object/tangible/veteran_reward/harvester_elite.iff"; - - public static final int MAX_BASE_COUNT = 3; - - public static final int HARVESTER_MAX_EXTRACTION_RATE = 70; - public static final int HARVESTER_MAX_HOPPER_SIZE = 600000; - - public static final int DESTROY_RESULT_SUCCESS = 0; - public static final int DESTROY_RESULT_SUCCESS_SELFPOWERED = 1; - public static final int DESTROY_RESULT_FAIL_COULD_NOT_CREATE_DEED = 2; - public static final int DESTROY_RESULT_FAIL_COULD_NOT_DETERMINE_DEED_FOR_STRUCTURE = 3; - public static final int DESTROY_RESULT_FAIL_TARGET_CONTAINER_FULL = 4; - public static final int DESTROY_RESULT_FAIL_TARGET_CONTAINER_FULL_SELFPOWERED = 5; - public static final int DESTROY_RESULT_INVALID_STRUCTURE = 6; - public static final int DESTROY_RESULT_INVALID_STATIC_ITEM = 7; - public static final int DESTROY_RESULT_INVALID_CONTAINER = 8; - - public static final int PLAYER_STRUCTURE_PRE_ABANDONED = 2; - public static final int PLAYER_STRUCTURE_ABANDONED = 1; - public static final int MAX_PACKUP_PER_DAY = 5; - public static final int NUM_NEEDED_PACKUP_FIRST_BADGE = 10; - public static final int NUM_NEEDED_PACKUP_SECOND_BADGE = 50; - public static final int NUM_NEEDED_PACKUP_THIRD_BADGE = 100; - - public static final String ABANDONED_TEXT = "\\#ff0000 (Abandoned)\\#."; - public static final String CITY_ABANDONED_TEXT = "\\#ff0000 (Zoning Violation)\\#."; - - public static final string_id MSG_STORAGE_OVER_CAP = new string_id(STF_FILE, "msg_over_cap"); - public static final String OBJVAR_STRUCTURE_STORAGE_INCREASE = "structureChange.storageIncrease"; - public static final String OBJVAR_STORAGE_AMOUNT = "increaseAmount"; - public static final int STORAGE_AMOUNT_CAP = 5000; - public static final int STORAGE_AMOUNT_DECREASE_UNIT = 100; - public static final String NON_GENERIC_STORAGE_ITEM_OBJVAR = "nonGenericStorageType"; - - public static final String TCG_STATIC_ITEM_DEED_OBJVAR = "tcg.static_item_deed"; - - public static final String VAR_CITY_ABANDONED = "player_structure.city_abandoned"; - public static final int PLAYER_STRUCTURE_CITY_ABANDONED = 1; - - public static final int HOUSE_ITEMS_SEARCH_LOCKOUT = 5*60; - - public static final string_id SID_NOT_CITY_ABANDONED = new string_id("city/city", "not_city_abandoned"); - public static final string_id SID_NO_CITY = new string_id("city/city", "no_city_during_packup"); - public static final string_id SID_GENERIC_CITY_PACKUP_ERROR = new string_id("city/city", "city_packup_generic_fail"); - public static final string_id SID_MAYOR_PROTECTED = new string_id("city/city", "city_packup_mayor_protected"); - - - public static obj_id createPlayerStructure(String template, obj_id owner, location loc, int rotation, dictionary deed_info) throws InterruptedException - { - - if (template == null) - { - - return null; - } - if (!isIdValid(owner)) - { - - return null; - } - if (loc == null) - { - - return null; - } - - debugSpeakMsg(owner, "I am making my house at "+ loc); - - if (!canPlaceGarage(loc, 120f, template)) - { - sendSystemMessage(owner, new string_id(STF_FILE, "proximity_build_failed")); - return null; - } - - obj_id structure = createObject(template, loc); - if (structure == null || structure == obj_id.NULL_ID) - { - - return null; - } - - float rot_float = (float)(90 * rotation); - setYaw(structure, rot_float); - - persistObject(structure); - - initializeStructure(structure, owner, deed_info); - - dictionary outparams = new dictionary(); - outparams.put( "rotation", rotation ); - messageTo( structure, "createStructureObjects", outparams, 10.f, false ); - - if (!isBuilding( structure )) - { - - if (!isCivic( structure )) - { - attachScript( structure, SCRIPT_TERMINAL_STRUCTURE ); - } - } - - dictionary params = new dictionary(); - params.put("structure_name", getNameStringId(structure)); - messageTo(owner, "OnConstructionComplete", params, 30.0f, true); - - CustomerServiceLog("playerStructure","Structure "+ structure + "("+ getName(structure) + ") placed by "+ owner + " at location "+ loc); - - float ejectRange = dataTableGetFloat(PLAYER_STRUCTURE_DATATABLE, template, DATATABLE_COL_EJECT_RANGE); - if (ejectRange > 0f) - { - dictionary ejectmsg = new dictionary(); - ejectmsg.put("sender", structure); - messageToRange(ejectRange, "handleEjection", ejectmsg, 1); - } - - return structure; - } - - - public static obj_id createTemporaryStructure(obj_id deed, obj_id owner, location loc, int rot, float placementHeight) throws InterruptedException - { - - if (!isIdValid(deed)) - { - return null; - } - - if (!isIdValid(owner)) - { - return null; - } - - if (loc == null) - { - return null; - } - - String cityName = getStringObjVar( deed, "cityName"); - String template = getDeedTemplate(deed); - String deed_template = getTemplateName(deed); - int build_time = getDeedBuildTime(deed); - int time_stamp = getGameTime(); - String owner_name = getPlayerName(owner); - String scene = getDeedScene(deed); - int max_extraction = -1; - int current_extraction = -1; - int max_hopper = -1; - - if (hasObjVar(deed, VAR_DEED_MAX_EXTRACTION)) - { - max_extraction = getIntObjVar(deed, VAR_DEED_MAX_EXTRACTION); - } - - if (hasObjVar(deed, VAR_DEED_CURRENT_EXTRACTION)) - { - current_extraction = getIntObjVar(deed, VAR_DEED_CURRENT_EXTRACTION); - } - - if (hasObjVar(deed, VAR_DEED_MAX_HOPPER)) - { - max_hopper = getIntObjVar(deed, VAR_DEED_MAX_HOPPER); - } - - int storageIncrease = 0; - - if (hasObjVar(deed, "structureChange.storageIncrease")) - { - storageIncrease = getIntObjVar(deed, "structureChange.storageIncrease"); - } - - float surplusPower = getFloatObjVar(deed, VAR_DEED_SURPLUS_POWER); - int maintPool = getIntObjVar(deed, VAR_DEED_SURPLUS_MAINTENANCE); - - if (maintPool > 0) - { - CustomerServiceLog("playerStructure", "Deed "+ deed + " with suplus maintenance used. Amount: "+ maintPool + ". Owner is %TU.", owner, null); - } - - if (template == null) - { - - return null; - } - - if (build_time == -1) - { - - return null; - } - - if (!destroyObject(deed)) - { - - return null; - } - - int idx = getStructureTableIndex(template); - - if (idx == -1) - { - return null; - } - - String temp_template = dataTableGetString(PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_TEMP_STRUCTURE); - - loc.y = getHeightAtLocation(loc.x, loc.z); - obj_id structure = createObject(temp_template, loc); - - if (!isIdValid(structure)) - { - - structure = createObject("object/building/player/construction_structure.iff", loc); - - if (!isIdValid(structure)) - { - return null; - } - } - - persistObject(structure); - - float rot_fl = (float)(rot * 90); - setYaw(structure, rot_fl); - - setObjVar(structure, VAR_DEED_BUILDTIME, build_time); - setObjVar(structure, VAR_DEED_TIMESTAMP, time_stamp); - - String structure_name = localize(getNameStringId(structure)); - addStructure(structure, template, structure_name, loc, owner, owner_name, true, true); - - int maintenance_mod = getSkillStatMod(owner, "structure_maintenance_mod"); - - int factory_mod = getSkillStatMod(owner, "factory_efficiency"); - - dictionary deed_info = new dictionary(); - deed_info.put("template", deed_template); - deed_info.put("build_time", build_time); - deed_info.put("owner_name", owner_name); - - if (storageIncrease > 0) - { - deed_info.put("structure_storage", storageIncrease); - } - - if (surplusPower > 0) - { - deed_info.put("power", surplusPower); - } - - if (maintPool > 0) - { - deed_info.put("maintenance_pool", maintPool); - } - - setObjVar(structure, VAR_TEMP_TEMPLATE, template); - setObjVar(structure, VAR_TEMP_OWNER, owner); - setObjVar(structure, VAR_TEMP_OWNER_NAME, owner_name); - setObjVar(structure, VAR_TEMP_ROTATION, rot); - setObjVar(structure, VAR_TEMP_PLACEMENT_HEIGHT, placementHeight); - - setDeedTemplate(structure, deed_template); - - setObjVar(structure, VAR_DEED_BUILDTIME, build_time); - setObjVar(structure, VAR_DEED_SCENE, scene); - - if (cityName != null && !cityName.equals("")) - { - setObjVar( structure, "cityName", cityName ); - deed_info.put( "cityName", cityName ); - } - - String owner_faction = factions.getFaction(owner); - - if (owner_faction != null && !owner_faction.equals("")) - { - deed_info.put("owner_faction", owner_faction); - setObjVar(structure, VAR_TEMP_OWNER_FACTION, owner_faction); - } - - if (scene != null) - { - deed_info.put("scene", scene); - } - - if (max_extraction != -1) - { - deed_info.put("max_extraction", max_extraction); - - setObjVar(structure, VAR_DEED_MAX_EXTRACTION, max_extraction); - } - - if (current_extraction != -1) - { - deed_info.put("current_extraction", current_extraction); - - setObjVar(structure, VAR_DEED_CURRENT_EXTRACTION, current_extraction); - } - - if (max_hopper != -1) - { - deed_info.put("max_hopper", max_hopper); - - setObjVar(structure, VAR_DEED_MAX_HOPPER, max_hopper); - } - - if (maintenance_mod > 0) - { - deed_info.put("maintenance_mod", maintenance_mod); - } - - if (factory_mod > 0) - { - deed_info.put("factory_mod", factory_mod); - } - - if (hasCommand(owner, "place_merchant_tent")) - { - deed_info.put("merchant_mod", MERCHANT_SALES_MODIFIER); - } - - dictionary params = new dictionary(); - params.put("template", template); - params.put("owner", owner); - params.put("deed_info", deed_info); - params.put("buildTime", build_time); - params.put("rotation", rot); - params.put("timestamp", time_stamp); - params.put("placementHeight", placementHeight); - messageTo(structure, "OnBuildingComplete", params, 5.0f, true); - - return structure; - } - - - public static boolean createStructureObjects(obj_id structure, int rotation) throws InterruptedException - { - if (structure == obj_id.NULL_ID) - { - - return false; - } - - String sceneName = getCurrentSceneName(); - String structureTemplate = getTemplateName(structure); - int numItems = 0; - - if (dataTableOpen(PLAYER_STRUCTURE_DATATABLE)) - { - numItems = dataTableGetNumRows(PLAYER_STRUCTURE_DATATABLE); - } - else - { - - return false; - } - - if (numItems == 0) - { - - return false; - } - - boolean object_set = false; - boolean object_mode = false; - obj_id object = obj_id.NULL_ID; - Vector base_object_list = new Vector(); - base_object_list.setSize(0); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - String buildingTemplate = dataTableGetString(PLAYER_STRUCTURE_DATATABLE, i, DATATABLE_COL_STRUCTURE); - - if (buildingTemplate.equals(structureTemplate)) - { - object_mode = true; - continue; - } - - if (object_mode) - { - - if (buildingTemplate.length() != 0) - { - break; - } - - dictionary item = dataTableGetRow(PLAYER_STRUCTURE_DATATABLE, i); - String TEMPLATE = item.getString(DATATABLE_COL_OBJECT); - - float X = item.getFloat(DATATABLE_COL_X); - float Y = item.getFloat(DATATABLE_COL_Y); - float Z = item.getFloat(DATATABLE_COL_Z); - float HEADING = item.getFloat(DATATABLE_COL_HEADING); - - String CELL_NAME = item.getString(DATATABLE_COL_CELL); - - obj_id CELL_ID = obj_id.NULL_ID; - location s_loc = getLocation(structure); - - if (CELL_NAME.equals(WORLD_DELTA)) - { - - if (rotation != 0) - { - - float[] delta_trans = transformDeltaWorldCoord(X, Z, rotation); - X = delta_trans[0]; - Z = delta_trans[1]; - - HEADING = HEADING + (float)(rotation * 90); - if (HEADING > 360) - { - HEADING = HEADING - 360; - } - - } - location obj_loc = new location(s_loc.x - X, s_loc.y - Y, s_loc.z - Z, sceneName, obj_id.NULL_ID); - - object = createObject(TEMPLATE, obj_loc); - if (isCivic( structure )) - { - setOwner( object, structure ); - } - - } - else - { - CELL_ID = getCellId(structure, CELL_NAME); - if (CELL_ID == null || CELL_ID == obj_id.NULL_ID) - { - - continue; - } - else - { - location spot = new location(X, Y, Z, sceneName, CELL_ID); - object = createObjectInCell(TEMPLATE, structure, CELL_NAME, spot); - - } - } - if ((object != null) && (object != obj_id.NULL_ID)) - { - - setYaw(object, HEADING); - - base_object_list = utils.addElement(base_object_list, object); - - object_set = true; - - object = obj_id.NULL_ID; - } - } - - } - if (!object_set) - { - - return false; - } - else - { - - if (base_object_list.size() > 0) - { - - setObjVar(structure, VAR_BASE_OBJECT, base_object_list, resizeableArrayTypeobj_id); - return true; - - } - else - { - - return false; - } - } - } - - - public static boolean initializeStructure(obj_id structure, obj_id owner, dictionary deed_info) throws InterruptedException - { - if (structure == obj_id.NULL_ID) - { - return false; - } - - if (owner == obj_id.NULL_ID) - { - return false; - } - - LOG("player_structure","deed_info = "+ deed_info.toString()); - - String template = getTemplateName(structure); - - String owner_name = getPlayerName(owner); - - if (owner_name == null) - { - - return false; - } - - String[] adminList = new String[1]; - adminList[0] = owner.toString(); - - int decay_rate = 10; - int condition = 1000; - int civic = 0; - int city_rank = 0; - int city_cost = 0; - float power_value = 0f; - float power_rate = getBasePowerRate(structure); - int items_stored = 0; - int idx = getStructureTableIndex(template); - - if (idx == -1) - { - - } - else - { - decay_rate = dataTableGetInt(PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_DECAY_RATE); - condition = dataTableGetInt(PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_CONDITION); - civic = dataTableGetInt(PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_CIVIC); - city_rank = dataTableGetInt(PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_CITY_RANK); - city_cost = dataTableGetInt(PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_CITY_COST); - } - - int version = dataTableGetInt(PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_VERSION); - - int got = getGameObjectType(structure); - - setOwner(structure, owner); - setObjVar(structure, VAR_OWNER, owner_name); - - String owner_faction = deed_info.getString("owner_faction"); - - if (owner_faction != null && !owner_faction.equals("")) - { - factions.setFaction(structure, owner_faction); - } - - String cityName = deed_info.getString("cityName"); - - if (cityName != null && !cityName.equals("")) - { - setObjVar( structure, "cityName", cityName ); - } - - setObjVar(structure, VAR_CIVIC, civic); - - if (city_rank > 0) - { - setObjVar(structure, VAR_CITY_RANK, city_rank); - } - - if (city_cost > 0) - { - setObjVar(structure, VAR_CITY_COST, city_cost); - } - - setObjVar(structure, VAR_ADMIN_LIST, adminList); - permissionsAddAllowed(structure, owner_name); - setObjVar(structure, VAR_DECAY_RATE, decay_rate); - - if (condition > 0) - { - setMaxHitpoints(structure, condition); - setInvulnerableHitpoints(structure, condition); - } - - setObjVar(structure, VAR_VERSION, version); - - if (isBuilding(structure)) - { - - setObjVar(structure, "healing.canhealwound", 1); - setObjVar(structure, "healing.canhealshock", 1); - setObjVar(structure, "safeLogout", 1); - } - - if (isInstallation(structure) && got != GOT_installation_turret) - { - String[] hopperList = new String[1]; - hopperList[0] = owner.toString(); - setObjVar(structure, VAR_HOPPER_LIST, hopperList); - - if (got == GOT_installation_factory || got == GOT_installation_harvester) - { - if (deed_info.containsKey("power")) - { - setPowerValue(structure, deed_info.getFloat("power")); - } - else - { - setPowerValue(structure, 0.0f); - } - - power_rate = expertiseModifyPowerRate(structure, owner, power_rate); - - if (power_rate < 0) - { - power_rate = 0; - } - - setPowerRate(structure, power_rate); - } - } - - setDeedTemplate(structure, deed_info.getString("template")); - - setObjVar(structure, VAR_DEED_BUILDTIME, deed_info.getInt("build_time")); - setObjVar(structure, VAR_DEED_SCENE, deed_info.getString("scene")); - - if (deed_info.containsKey("current_extraction") && (isHarvester(structure) || isGenerator(structure))) - { - int expertiseExtractionIncrease = (int)getSkillStatisticModifier(owner, "expertise_harvester_collection_increase"); - - int currentExtraction = deed_info.getInt("current_extraction"); - int maxExtraction = deed_info.getInt("max_extraction"); - - setObjVar(structure, "current_extraction", currentExtraction); - setObjVar(structure, "max_extraction", maxExtraction); - - if (expertiseExtractionIncrease > 0) - { - currentExtraction += (int)(currentExtraction * (float)(expertiseExtractionIncrease / 100.0f)); - maxExtraction += (int)(maxExtraction * (float)(expertiseExtractionIncrease / 100.0f)); - } - - if (currentExtraction > HARVESTER_MAX_EXTRACTION_RATE) - { - currentExtraction = HARVESTER_MAX_EXTRACTION_RATE; - } - - if (maxExtraction > HARVESTER_MAX_EXTRACTION_RATE) - { - maxExtraction = HARVESTER_MAX_EXTRACTION_RATE; - } - - setCurrentExtractionRate(structure, currentExtraction); - - setMaxExtractionRate(structure, maxExtraction); - } - - if (deed_info.containsKey("max_hopper")) - { - int max_hopper = deed_info.getInt("max_hopper"); - - setObjVar(structure, VAR_DEED_MAX_HOPPER, max_hopper); - - if (isHarvester(structure) || isGenerator(structure)) - { - int expertiseHopperIncrease = (int)getSkillStatisticModifier(owner, "expertise_havester_storage_increase"); - - if (expertiseHopperIncrease > 0) - { - max_hopper += (int)(max_hopper * (float)(expertiseHopperIncrease / 100.0f)); - } - } - - if (max_hopper > HARVESTER_MAX_HOPPER_SIZE) - { - max_hopper = HARVESTER_MAX_HOPPER_SIZE; - } - - setMaxHopperAmount(structure, max_hopper); - } - - if (deed_info.containsKey("maintenance_pool")) - { - int maintPool = deed_info.getInt("maintenance_pool"); - - transferBankCreditsFromNamedAccount(money.ACCT_STRUCTURE_DESTROYED, structure, maintPool, "noHandler", "noHandler", new dictionary()); - CustomerServiceLog("playerStructure", "Structure "+ structure + " was created with surplus maintenance. Amount: "+ maintPool + ". Owner is %TU.", owner, null); - } - - if (deed_info.containsKey("merchant_mod") && got != GOT_building_factional) - { - setObjVar(structure, VAR_MAINTENANCE_MOD_MERCHANT, deed_info.getFloat("merchant_mod")); - } - - if (deed_info.containsKey("structure_storage")) - { - setObjVar(structure, "structureChange.storageIncrease", deed_info.getInt("structure_storage")); - } - - if (civic == 1 || hasObjVar(structure, "force_public")) - { - permissionsMakePublic(structure); - } - else if (got != GOT_building_factional) - { - permissionsMakePrivate(structure); - } - - attachScript(structure, SCRIPT_PERMANENT_STRUCTURE); - - dictionary new_params = new dictionary(); - new_params.put("structure", structure); - new_params.put("structure_name", localize(getNameStringId(structure))); - new_params.put("structure_loc", getLocation(structure)); - new_params.put("template", template); - messageTo(owner, "OnAddStructure", new_params, 0, true); - - dictionary params = new dictionary(); - int time_stamp = getGameTime(); - setObjVar(structure, VAR_LAST_MAINTANENCE, time_stamp); - - if (civic == 0) - { - params.put("timestamp", time_stamp); - LOG("LOG_CHANNEL", "Messaging "+structure+" to run maintenance loop"); - messageTo(structure, "OnMaintenanceLoop", params, 30, false); - } - - return true; - } - - - public static float getBasePowerRate(obj_id structure) throws InterruptedException - { - String template = getTemplateName(structure); - int idx = getStructureTableIndex(template); - float power_rate = dataTableGetFloat(PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_POWER_RATE); - - if (power_rate < 0f) - { - power_rate = 0; - } - - if (hasObjVar(structure, "selfpowered")) - { - power_rate = 0f; - } - - return power_rate; - } - - - public static float expertiseModifyPowerRate(obj_id structure, obj_id owner, float power_rate) throws InterruptedException - { - if (!isIdValid(structure)) - { - return power_rate; - } - - if (power_rate <= 0) - { - return 0; - } - - int got = getGameObjectType(structure); - - int expertisePowerReduction = 0; - - if (!isIdValid(owner) || !exists(owner)) - { - if (got == GOT_installation_factory && hasObjVar(structure, VAR_POWER_MOD_FACTORY)) - { - expertisePowerReduction = getIntObjVar(structure, VAR_POWER_MOD_FACTORY); - } - - if (got == GOT_installation_harvester && hasObjVar(structure, VAR_POWER_MOD_HARVESTER)) - { - expertisePowerReduction = getIntObjVar(structure, VAR_POWER_MOD_HARVESTER); - } - } - else - { - if (got == GOT_installation_factory) - { - expertisePowerReduction = (int)getSkillStatisticModifier(owner, "expertise_factory_energy_decrease"); - - setObjVar(structure, VAR_POWER_MOD_FACTORY, expertisePowerReduction); - } - - if (got == GOT_installation_harvester) - { - expertisePowerReduction = (int)getSkillStatisticModifier(owner, "expertise_harvester_energy_decrease"); - - setObjVar(structure, VAR_POWER_MOD_HARVESTER, expertisePowerReduction); - } - } - - if (expertisePowerReduction > 0) - { - power_rate -= (int)(power_rate * (float)(expertisePowerReduction / 100.0f)); - } - - return power_rate; - } - - - public static boolean addStructure(obj_id structure, String template, String structure_name, location structure_location, obj_id player, String player_name, boolean struct_loaded, boolean player_loaded) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return false; - } - - if (player == null || player == obj_id.NULL_ID) - { - return false; - } - - String fp_template = getFootprintTemplate( template ); - if (fp_template == null || fp_template.equals("")) - { - return false; - } - - if (player_loaded) - { - - int idx = getStructureTableIndex( template ); - if (idx == -1) - { - return false; - } - - int ignore_lots = dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_NO_LOT_REQ ); - if (ignore_lots != 1) - { - int struct_lots = (getNumberOfLots(fp_template) / 4) - dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_LOT_REDUCTION ); - if (struct_lots < 1) - { - struct_lots = 1; - } - - flagConverted( template, structure ); - - if ((getAccountNumLots(getPlayerObject(player)) + struct_lots) > MAX_LOTS) - { - String realStructureTemplate = template; - if (exists(structure)) - { - realStructureTemplate = getTemplateName(structure); - } - - if ((realStructureTemplate != null) && (realStructureTemplate.length() > 0) && (realStructureTemplate.indexOf("object/building/player/player_house_") == 0)) - { - setObjVar(player, "lotOverlimit.structure_id", structure); - - if ((structure_name != null) && (structure_name.length() > 0)) - { - setObjVar(player, "lotOverlimit.structure_name", structure_name); - } - - if (structure_location != null) - { - setObjVar(player, "lotOverlimit.structure_location", localize(new string_id("planet_n", structure_location.area)) + " ("+ (int)structure_location.x + ", "+ (int)structure_location.z + ")"); - } - - setObjVar(player, "lotOverlimit.violation_time", getCalendarTime()); - } - } - - adjustLotCount( getPlayerObject(player), struct_lots ); - } - } - - if (struct_loaded) - { - - setObjVar(structure, VAR_OWNER, getPlayerName(player)); - setOwner(structure, player); - if (!isAdmin(structure, getPlayerName(player))) - { - modifyList(structure, getPlayerName(player), null, VAR_ADMIN_LIST, false); - } - } - - if (player_loaded && struct_loaded) - { - - } - - city.addStructureToCity( structure ); - - return true; - } - - - public static boolean addStructure(obj_id structure, obj_id player) throws InterruptedException - { - String template = getTemplateName(structure); - String structure_name = localize(getNameStringId(structure)); - location structure_location = getWorldLocation(structure); - String player_name = getPlayerName(player); - - return addStructure(structure, template, structure_name, structure_location, player, player_name, true, true); - } - - - public static boolean removeStructure(obj_id structure, String template, obj_id player, String player_name, boolean struct_loaded, boolean player_loaded) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return false; - } - - if (player == null || player == obj_id.NULL_ID) - { - return false; - } - - String fp_template = getFootprintTemplate( template ); - if (fp_template == null || fp_template.equals("")) - { - return false; - } - - if (player_loaded) - { - - int idx = getStructureTableIndex( template ); - if (idx == -1) - { - return false; - } - - int ignore_lots = dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_NO_LOT_REQ ); - if (ignore_lots != 1) - { - - int struct_lots = (getNumberOfLots(fp_template) / 4) - dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_LOT_REDUCTION ); - if (struct_lots < 1) - { - struct_lots = 1; - } - - CustomerServiceLog("playerStructure","Structure "+ template + " "+ structure + "("+ ") REMOVED by "+ player + " at location "+ getLocation(player)); - adjustLotCount(getPlayerObject(player), -struct_lots); - - int current_lots = getAccountNumLots( getPlayerObject(player) ); - if (current_lots < 0) - { - adjustLotCount( getPlayerObject(player), -current_lots ); - } - } - - if (isResidence( structure, player )) - { - setHouseId( player, obj_id.NULL_ID ); - removeObjVar( structure, VAR_RESIDENCE_BUILDING ); - - city.removeCitizen( player, structure ); - } - } - - if (struct_loaded) - { - removeObjVar( structure, VAR_OWNER ); - - if (isAdmin(structure, getPlayerName(player))) - { - modifyList( structure, getPlayerName(player), null, VAR_ADMIN_LIST, false ); - } - } - - return true; - } - - - public static boolean removeStructure(obj_id structure, obj_id player) throws InterruptedException - { - String template = getTemplateName(structure); - String player_name = getPlayerName(player); - - return removeStructure( structure, template, player, player_name, true, true ); - } - - - public static boolean updateStructureVersion(obj_id structure) throws InterruptedException - { - - if (!isIdValid(structure)) - { - - return false; - } - - String template = getTemplateName(structure); - - if (template == null) - { - return false; - } - - int idx = getStructureTableIndex(template); - if (idx == -1) - { - - return false; - } - - float yaw = getYaw(structure); - if (yaw < 0.0f) - { - yaw = yaw + 360.0f; - } - - int rotation = (int)(yaw + 1) / 90; - - updateStructureData(structure); - - createStructureObjects(structure, rotation); - - createStructureSign(structure); - - return true; - } - - - public static boolean updateStructureData(obj_id structure) throws InterruptedException - { - - if (!isIdValid(structure)) - { - - return false; - } - - String template = getTemplateName(structure); - if (template == null) - { - return false; - } - - int idx = getStructureTableIndex(template); - - if (idx == -1) - { - - return false; - } - - dictionary row = dataTableGetRow(PLAYER_STRUCTURE_DATATABLE, idx); - int decay_rate = row.getInt(DATATABLE_COL_DECAY_RATE); - int condition = row.getInt(DATATABLE_COL_CONDITION); - - setObjVar(structure, VAR_DECAY_RATE, decay_rate); - - float power_rate = 0.0f; - - if (!hasObjVar(structure, "selfpowered")) - { - power_rate = row.getFloat(DATATABLE_COL_POWER_RATE); - power_rate = expertiseModifyPowerRate(structure, null, power_rate); - } - - setPowerRate(structure, power_rate); - - if (condition > 0) - { - int current_hp = getHitpoints(structure); - int max_hp = getMaxHitpoints(structure); - - setMaxHitpoints(structure, condition); - - if (current_hp == max_hp) - { - setInvulnerableHitpoints(structure, condition); - } - } - - return true; - } - - - public static boolean canPlaceStructure(obj_id player, String template, location loc, obj_id deed) throws InterruptedException - { - if (isFreeTrialAccount(player)) - { - sendSystemMessage(player, new string_id(STF_FILE, "no_trial_accounts")); - return false; - } - - int template_idx = getStructureTableIndex(template); - LOG("LOG_CHANNEL", "player_structure::canPlaceStructure -- template_idx ->"+ template_idx); - if (template_idx == -1) - { - LOG("LOG_CHANNEL", "player_structure::OnObjectMenuSelect -- Unable to find template on datatable."); - return false; - } - - String strPlanet = loc.area; - if (strPlanet == null) - { - - return false; - - } - if ((strPlanet.equals("yavin4"))||(strPlanet.equals("dathomir"))||(strPlanet.equals("endor"))) - { - int intIndex = template.indexOf("installation"); - if (intIndex < 0) - { - sendSystemMessage(player, new string_id(STF_FILE, "cannot_use_deed_here")); - return false; - } - } - - if (isIdValid(deed)) - { - if (hasObjVar( deed, VAR_DEED_SCENE )) - { - String scene = getCurrentSceneName(); - String deed_scene = getDeedScene(deed); - - boolean match = false; - java.util.StringTokenizer st = new java.util.StringTokenizer( deed_scene, ","); - while (st.hasMoreTokens()) - { - testAbortScript(); - String curScene = st.nextToken(); - if (scene.equals(curScene)) - { - match = true; - break; - } - } - if (!match) - { - if (!isGod(player)) - { - sendSystemMessage(player, new string_id(STF_FILE, "cannot_use_deed_here")); - return false; - } - else - { - sendSystemMessageTestingOnly(player, "God-Mode Placement Override: Structure is not native to this planet!"); - } - } - } - } - - if (hasScript(deed, "faction_perk.minefield.field_deed")) - { - sendSystemMessage(player, CANNOT_PLACE_MINEFIELD); - return false; - } - - if (hasScript(deed, "faction_perk.turret.turret_deed")) - { - sendSystemMessage(player, CANNOT_PLACE_TURRET); - return false; - } - - if (loc.cell != null && loc.cell != obj_id.NULL_ID) - { - - sendSystemMessage(player, new string_id(STF_FILE, "not_inside")); - return false; - } - - region[] rgnTest = getRegionsWithBuildableAtPoint( loc, regions.BUILD_FALSE ); - if (rgnTest != null) - { - sendSystemMessage(player, new string_id(STF_FILE, "not_permitted")); - return false; - } - - if (!isGameObjectTypeOf (getGameObjectType(deed), GOT_data_house_control_device)) - { - - if (!canOwnStructure(template, player, true)) - { - return false; - } - } - - if (template.indexOf( "cityhall" ) != -1) - { - - int cities_on_planet = 0; - String planet_name = getCurrentSceneName(); - int[] city_ids = getAllCityIds(); - for (int i=0; i= max_cities) - { - sendSystemMessage(player, new string_id(STF_FILE, "max_cities")); - return false; - } - } - - int blocking_city = city.canBuildCityHere( player, loc ); - if (blocking_city > -1) - { - String block_name = cityGetName( blocking_city ); - location block_loc = cityGetLocation( blocking_city ); - sendSystemMessageProse(player, prose.getPackage(new string_id (STF_FILE, "city_too_close"), block_name)); - return false; - } - } - - int city_rank_req = dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, template_idx, DATATABLE_COL_CITY_RANK ); - int civic = dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, template_idx, DATATABLE_COL_CIVIC ); - if (city_rank_req > 0) - { - int city_id = getCityAtLocation( loc, 0 ); - if (!cityExists( city_id )) - { - sendSystemMessage( player, SID_BUILD_NO_CITY ); - return false; - } - - int city_rank = city.getCityRank( city_id ); - if (city_rank < city_rank_req) - { - - prose_package pp = prose.getPackage( SID_RANK_REQ, new string_id( "city/city", "rank"+city_rank_req ), city_rank_req ); - sendSystemMessageProse( player, pp ); - return false; - } - } - - int city_id = getCityAtLocation( loc, 0 ); - obj_id mayor = cityGetLeader( city_id ); - if (cityExists( city_id ) && city.isCityZoned( city_id ) && isIdValid(player)) - { - if (!city.hasZoningRights(player, city_id)) - { - sendSystemMessage( player, SID_NO_RIGHTS ); - return false; - } - } - - if (civic == 1) - { - int civic_count = city.getCivicCount( city_id ); - int max_civic = city.getMaxCivicCount( city_id ); - if (civic_count >= max_civic) - { - prose_package pp = prose.getPackage( SID_CIVIC_COUNT, max_civic ); - sendSystemMessageProse( player, pp ); - return false; - } - } - - return true; - } - - - public static boolean canPlaceStructure(obj_id player, String template) throws InterruptedException - { - location loc = getLocation(player); - - return canPlaceStructure(player, template, loc, null); - } - - - public static boolean canOwnStructure(String template, obj_id player, boolean allowOverLotLimitIfPlayerHouse) throws InterruptedException - { - if (player == null || player == obj_id.NULL_ID) - { - return false; - } - - int idx = getStructureTableIndex( template ); - if (idx == -1) - { - return false; - } - - int ignore_lots = dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_NO_LOT_REQ ); - if (ignore_lots != 1) - { - - int lots = getAccountNumLots( getPlayerObject(player) ); - int lots_needed = (getNumberOfLots(template) / 4) - dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_LOT_REDUCTION ); - if (lots_needed < 1) - { - lots_needed = 1; - } - - if (lots > MAX_LOTS) - { - sendSystemMessageProse(player, prose.getPackage(new string_id (STF_FILE, "not_enough_lots"), lots_needed)); - return false; - } - - if ((lots + lots_needed) > MAX_LOTS) - { - if (allowOverLotLimitIfPlayerHouse && (template.indexOf("object/building/player/player_house_") == 0)) - { - - } - else - { - sendSystemMessageProse(player, prose.getPackage(new string_id (STF_FILE, "not_enough_lots"), lots_needed)); - return false; - } - } - } - else if (isFactionPerkBase(template)) - { - if (hasObjVar(player,"factionBaseCount" )) - { - int factionBaseCount = getIntObjVar(player,"factionBaseCount"); - if (factionBaseCount > MAX_BASE_COUNT-1) - { - string_id strSpam = new string_id("faction_perk", "not_enough_base_units"); - sendSystemMessage(player, strSpam); - getClusterWideData("gcw_player_base", "base_cwdata_manager*", true, player); - return false; - } - } - } - - String skill_mod = dataTableGetString( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_SKILL_MOD ); - if (skill_mod.length() > 0) - { - int skill_mod_value = dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_SKILL_MOD_VALUE ); - int player_skill = getSkillStatMod( player, skill_mod ); - if (player_skill < skill_mod_value) - { - String msg = dataTableGetString( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_SKILL_MOD_MESSAGE ); - if ((msg == null) || (msg.equals(""))) - { - sendSystemMessage(player, new string_id(STF_FILE, "no_skill")); - } - else - { - string_id msgsid = new string_id( STF_FILE, msg ); - sendSystemMessage( player, msgsid ); - } - - return false; - } - } - - return true; - } - - - public static boolean canOwnStructure(obj_id structure, obj_id player) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return false; - } - - String template = getTemplateName(structure); - return canOwnStructure(template, player, false); - } - - - public static String getFootprintTemplate(String template) throws InterruptedException - { - if (template == null || template.equals("")) - { - return null; - } - - String fp_template = dataTableGetString(PLAYER_STRUCTURE_DATATABLE, template, DATATABLE_COL_FOOTPRINT); - LOG("LOG_CHANNEL","retrieved fp_template = "+ fp_template); - if (fp_template == null || fp_template.equals("")) - { - return template; - } - - return fp_template; - } - - - public static boolean canPlaceObject(obj_id structure, obj_id player) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return false; - } - - if (player == null || player == obj_id.NULL_ID) - { - return false; - } - - if (!isAdmin(structure, player)) - { - - sendSystemMessage(player, new string_id(STF_FILE, "admin_only")); - return false; - } - - return true; - } - - - public static boolean isInAdminRange(obj_id structure, obj_id player) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return false; - } - - if (player == null || player == obj_id.NULL_ID) - { - return false; - } - - if (pclib.isContainedByPlayer(player, structure)) - { - return true; - } - - location loc_structure = getLocation(structure); - location loc_player = getLocation(player); - - obj_id building = getTopMostContainer(loc_player.cell); - - if (building == structure) - { - return true; - } - - float distance = loc_structure.distance(loc_player); - - if (distance < getInstallationRange(structure)) - { - return true; - } - else - { - - sendSystemMessage(player, new string_id(STF_FILE, "too_far")); - return false; - } - } - - - public static float getInstallationRange(obj_id structure) throws InterruptedException - { - if (isCivic( structure )) - { - return CIVIC_INSTALLATION_RANGE; - } - else - { - return INSTALLATION_RANGE; - } - } - - - public static String getDeedTemplate(obj_id deed) throws InterruptedException - { - if (!hasObjVar(deed, VAR_DEED_TEMPLATE)) - { - if (hasObjVar(deed, VAR_DEED_TEMPLATE_CRC)) - { - return getObjectTemplateName(getDeedTemplateCrc(deed)); - } - - return null; - } - - return getStringObjVar(deed, VAR_DEED_TEMPLATE); - } - - - public static int getDeedTemplateCrc(obj_id deed) throws InterruptedException - { - return getIntObjVar(deed, VAR_DEED_TEMPLATE_CRC); - } - - - public static boolean setDeedTemplate(obj_id deed, String template) throws InterruptedException - { - if (!isIdValid(deed) || template == null || template.equals("")) - { - return false; - } - - removeObjVar(deed, VAR_DEED_TEMPLATE); - return setObjVar(deed, VAR_DEED_TEMPLATE_CRC, getObjectTemplateCrc(template)); - } - - - public static int getDeedBuildTime(obj_id deed) throws InterruptedException - { - if (!hasObjVar(deed, VAR_DEED_BUILDTIME)) - { - return -1; - } - - return getIntObjVar(deed, VAR_DEED_BUILDTIME); - } - - - public static String getDeedScene(obj_id deed) throws InterruptedException - { - if (!hasObjVar(deed, VAR_DEED_SCENE)) - { - return null; - } - - return getStringObjVar(deed, VAR_DEED_SCENE); - } - - - public static int getDeedMaxExtraction(obj_id deed) throws InterruptedException - { - if (!hasObjVar(deed, VAR_DEED_MAX_EXTRACTION)) - { - return -1; - } - - return getIntObjVar(deed, VAR_DEED_MAX_EXTRACTION); - } - - - public static int getDeedCurrentExtraction(obj_id deed) throws InterruptedException - { - if (!hasObjVar(deed, VAR_DEED_CURRENT_EXTRACTION)) - { - return -1; - } - - return getIntObjVar(deed, VAR_DEED_CURRENT_EXTRACTION); - } - - - public static int getDeedMaxHopper(obj_id deed) throws InterruptedException - { - if (!hasObjVar(deed, VAR_DEED_MAX_HOPPER)) - { - return -1; - } - - return getIntObjVar(deed, VAR_DEED_MAX_HOPPER); - } - - - public static String getStructureOwner(obj_id structure) throws InterruptedException - { - - return getPlayerName(getOwner(structure)); - } - - - public static obj_id getStructureOwnerObjId(obj_id structure) throws InterruptedException - { - return getOwner(structure); - } - - - public static int getMaintenanceRate(obj_id structure) throws InterruptedException - { - int civic = getIntObjVar( structure, VAR_CIVIC ); - if (civic == 1) - { - return 0; - } - else - { - - int maint = getBaseMaintenanceRate(structure); - float merchant_mod = getMaintenanceMerchantMod(structure); - - if (merchant_mod != 0f) - { - maint = Math.round(maint * (1f+merchant_mod)); - } - - float factory_mod = getMaintenanceFactoryMod(structure); - - if (factory_mod != 0f) - { - maint -= Math.round(maint * (factory_mod / 100.0f)); - } - - float harvester_mod = getMaintenanceHarvesterMod(structure); - - if (harvester_mod != 0f) - { - maint -= Math.round(maint * (harvester_mod / 100.0f)); - } - - int tax = getMaintenancePropertyTax(structure); - if (tax > 0) - { - maint += tax; - } - - return maint; - } - } - - - public static int getBaseMaintenanceRate(obj_id structure) throws InterruptedException - { - int idx = getStructureTableIndex( getTemplateName( structure ) ); - return dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_MAINT_RATE ); - } - - - public static int getRedeedCost(obj_id structure) throws InterruptedException - { - int idx = getStructureTableIndex( getTemplateName( structure ) ); - return dataTableGetInt( PLAYER_STRUCTURE_DATATABLE, idx, DATATABLE_COL_REDEED_COST ); - } - - - public static float getMaintenanceMerchantMod(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return 0f; - } - - return getFloatObjVar(structure, VAR_MAINTENANCE_MOD_MERCHANT); - } - - - public static float getMaintenanceFactoryMod(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return 0f; - } - - return getFloatObjVar(structure, VAR_MAINTENANCE_MOD_FACTORY); - } - - - public static float getMaintenanceHarvesterMod(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return 0f; - } - - return getFloatObjVar(structure, VAR_MAINTENANCE_MOD_HARVESTER); - } - - - public static int getMaintenancePropertyTax(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return -1; - } - - int maint = getBaseMaintenanceRate( structure ); - if (maint > 0) - { - return Math.round(maint * city.getPropertyTax(structure)/100.f); - } - - return 0; - } - - - public static int getMaintenancePool(obj_id structure) throws InterruptedException - { - return getBankBalance(structure); - } - - - public static int getDecayRate(obj_id structure) throws InterruptedException - { - return getIntObjVar(structure, VAR_DECAY_RATE); - } - - - public static int getStructureCondition(obj_id structure) throws InterruptedException - { - - return getHitpoints(structure); - } - - - public static int getMaxCondition(obj_id structure) throws InterruptedException - { - - return getMaxHitpoints(structure); - } - - - public static int getMaxExtraction(obj_id structure) throws InterruptedException - { - if (!hasObjVar(structure, VAR_MAX_EXTRACTION)) - { - return -1; - } - - return getIntObjVar(structure, VAR_MAX_EXTRACTION); - } - - - public static int getCurrentExtraction(obj_id structure) throws InterruptedException - { - if (!hasObjVar(structure, VAR_CURRENT_EXTRACTION)) - { - return -1; - } - - return getIntObjVar(structure, VAR_CURRENT_EXTRACTION); - } - - - public static int getMaxHopper(obj_id structure) throws InterruptedException - { - if (!hasObjVar(structure, VAR_MAX_HOPPER)) - { - return -1; - } - - return getIntObjVar(structure, VAR_MAX_HOPPER); - } - - - public static int getStructureVersion(obj_id structure) throws InterruptedException - { - return getIntObjVar(structure, VAR_VERSION); - } - - - public static obj_id getResidence(obj_id player) throws InterruptedException - { - if (player == null || player == obj_id.NULL_ID) - { - return null; - } - - return getHouseId( player ); - } - - - public static int getStructureNumItems(obj_id structure) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return -1; - } - - return getIntObjVar(structure, "itemLimit"); - } - - - public static obj_id[] getStructureBaseObjects(obj_id structure) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return null; - } - - return getObjIdArrayObjVar(structure, VAR_BASE_OBJECT); - } - - - public static String[] getEntryList(obj_id structure) throws InterruptedException - { - if (!isIdValid( structure )) - { - return null; - } - - String[] fullEntryList = permissionsGetAllowed(structure); - - Vector filteredEntryList = new Vector(); - filteredEntryList.setSize(0); - for (int i = 0; i < fullEntryList.length; i++) - { - testAbortScript(); - String entryItemString = fullEntryList[i]; - obj_id entryItemId = utils.stringToObjId(entryItemString); - if (isIdValid(entryItemId)) - { - } - else - { - if (entryItemString.toLowerCase().indexOf("guild:") > -1) - { - int guild_id = findGuild(entryItemString.substring(6).toLowerCase().trim()); - if (guild_id > 0) - { - utils.addElement(filteredEntryList, entryItemString); - } - else - { - - } - } - else - { - utils.addElement(filteredEntryList, entryItemString); - } - } - } - - String[] returnList = new String[0]; - if (filteredEntryList != null) - { - returnList = new String[filteredEntryList.size()]; - filteredEntryList.toArray(returnList); - } - return returnList; - } - - - public static String[] getCompleteEntryList(obj_id structure) throws InterruptedException - { - if (!isIdValid( structure )) - { - return null; - } - - return permissionsGetAllowed(structure); - } - - - public static boolean isNameOnEntryList(obj_id structure, String player_or_guild_name) throws InterruptedException - { - String[] entry_list = getCompleteEntryList(structure); - if (entry_list != null) - { - if (isNameOnPermissionList( entry_list, player_or_guild_name )) - { - return true; - } - } - - return false; - } - - - public static String[] getBanList(obj_id structure) throws InterruptedException - { - if (!isIdValid( structure )) - { - return null; - } - - return permissionsGetBanned(structure); - } - - - public static boolean isNameOnBanList(obj_id structure, String player_or_guild_name) throws InterruptedException - { - String[] ban_list = getBanList(structure); - if (ban_list != null) - { - if (isNameOnPermissionList( ban_list, player_or_guild_name )) - { - return true; - } - } - - return false; - } - - - public static String[] getAdminListRaw(obj_id structure) throws InterruptedException - { - if (!isIdValid( structure )) - { - return null; - } - - return getStringArrayObjVar(structure, VAR_ADMIN_LIST); - } - - - public static String[] getAdminListNames(obj_id structure) throws InterruptedException - { - return convertRawListToNames( getAdminListRaw(structure) ); - } - - - public static boolean isNameOnAdminList(obj_id structure, String player_or_guild_name) throws InterruptedException - { - String[] admin_list = getAdminListRaw(structure); - if (admin_list != null) - { - if (isNameOnRawList( admin_list, player_or_guild_name )) - { - return true; - } - } - - return false; - } - - - public static boolean adminListAddName(obj_id structure, String nameToAdd) throws InterruptedException - { - if (isIdValid( structure )) - { - Vector adminList = getResizeableStringArrayObjVar(structure, VAR_ADMIN_LIST); - - if (adminList == null) - { - adminList = new Vector(); - } - - if (addNameToRawList( adminList, nameToAdd )) - { - if (adminList.size() > 0) - { - setObjVar(structure, VAR_ADMIN_LIST, adminList, resizeableArrayTypeString); - return true; - } - } - } - - return false; - } - - - public static boolean adminListRemoveName(obj_id structure, String nameToRemove) throws InterruptedException - { - if (isIdValid( structure )) - { - Vector adminList = getResizeableStringArrayObjVar(structure, VAR_ADMIN_LIST); - if (removeNameFromRawList( adminList, nameToRemove )) - { - if (adminList.size() == 0) - { - removeObjVar( structure, VAR_ADMIN_LIST ); - } - else - { - setObjVar(structure, VAR_ADMIN_LIST, adminList, resizeableArrayTypeString); - } - return true; - } - } - - return false; - } - - - public static String[] getVendorList(obj_id structure) throws InterruptedException - { - if (!isIdValid( structure )) - { - return null; - } - - String[] vendor_list = new String[0]; - return vendor_list; - } - - - public static String[] getHopperListRaw(obj_id structure) throws InterruptedException - { - if (!isIdValid( structure )) - { - return null; - } - - return getStringArrayObjVar(structure, VAR_HOPPER_LIST); - } - - - public static String[] getHopperListNames(obj_id structure) throws InterruptedException - { - return convertRawListToNames( getHopperListRaw(structure) ); - } - - - public static boolean isNameOnHopperList(obj_id structure, String player_or_guild_name) throws InterruptedException - { - String[] hopper_list = getHopperListRaw(structure); - if (hopper_list != null) - { - if (isNameOnRawList( hopper_list, player_or_guild_name )) - { - return true; - } - } - - return false; - } - - - public static boolean hopperListAddName(obj_id structure, String nameToAdd) throws InterruptedException - { - if (isIdValid( structure )) - { - Vector hopperList = getResizeableStringArrayObjVar(structure, VAR_HOPPER_LIST); - - if (hopperList == null) - { - hopperList = new Vector(); - } - - if (addNameToRawList( hopperList, nameToAdd )) - { - if (hopperList.size() > 0) - { - setObjVar(structure, VAR_HOPPER_LIST, hopperList, resizeableArrayTypeString); - return true; - } - } - } - - return false; - } - - - public static boolean hopperListRemoveName(obj_id structure, String nameToRemove) throws InterruptedException - { - if (isIdValid( structure )) - { - Vector hopperList = getResizeableStringArrayObjVar(structure, VAR_HOPPER_LIST); - if (removeNameFromRawList( hopperList, nameToRemove )) - { - if (hopperList.size() == 0) - { - removeObjVar( structure, VAR_HOPPER_LIST ); - } - else - { - setObjVar(structure, VAR_HOPPER_LIST, hopperList, resizeableArrayTypeString); - } - return true; - } - } - - return false; - } - - - public static obj_id getStructure(obj_id object) throws InterruptedException - { - location loc = getLocation(object); - obj_id structure = getContainedBy(loc.cell); - if ((structure == null)||(structure == obj_id.NULL_ID)) - { - - obj_id obj_owner = getOwner( object ); - if (isInstallation( obj_owner ) && isCivic ( obj_owner )) - { - return obj_owner; - } - - if (isPlayer(object)) - { - structure = getLookAtTarget(object); - - if (!isInstallation(structure)) - { - obj_id target = structure; - structure = obj_id.NULL_ID; - - obj_id[] items = getObjectsInRange(loc, INSTALLATION_RANGE); - - if (items == null) - { - return null; - } - - for (int i = 0; i < items.length; i++) - { - testAbortScript(); - - if (isInstallation(items[i])) - { - - if (isAdmin(items[i], object)) - { - - obj_id[] base_objects = getObjIdArrayObjVar(items[i], "player_structure.base_objects"); - - if (base_objects != null && base_objects.length > 0) - { - - for (int j = 0; j < base_objects.length; j++) - { - testAbortScript(); - - if (base_objects[j] == target) - { - - return items[i]; - } - } - - } - - if ((!isIdValid(structure)) || (getLocation(items[i]).distance(loc) < getLocation(structure).distance(loc))) - { - structure = items[i]; - } - } - } - } - } - } - } - return structure; - } - - - public static obj_id[] getObjectsInBuilding(obj_id structure) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return null; - } - if (!isBuilding(structure)) - { - return null; - } - - obj_id[] cells = getCellIds(structure); - Vector objects = new Vector(); - objects.setSize(0); - if (cells != null) - { - for (int i = 0; i < cells.length; i++) - { - testAbortScript(); - if (isIdValid(cells[i])) - { - obj_id[] cell_contents = getContents(cells[i]); - if (cell_contents.length > 0) - { - objects = utils.concatArrays(objects, cell_contents); - } - } - } - } - - obj_id[] _objects = new obj_id[0]; - if (objects != null) - { - _objects = new obj_id[objects.size()]; - objects.toArray(_objects); - } - return _objects; - } - - - public static obj_id[] getPlayersInBuilding(obj_id structure) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return null; - } - if (!isBuilding(structure)) - { - return null; - } - - Vector players = new Vector(); - players.setSize(0); - obj_id[] objects = getObjectsInBuilding(structure); - if (objects != null && objects.length > 0) - { - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (isIdValid(objects[i]) && isPlayer(objects[i])) - { - players = utils.addElement(players, objects[i]); - } - } - } - - obj_id[] _players = new obj_id[0]; - if (players != null) - { - _players = new obj_id[players.size()]; - players.toArray(_players); - } - return _players; - } - - - public static obj_id[] getPlayersNearInstallation(obj_id structure) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return null; - } - - location loc = getLocation(structure); - Vector players = new Vector(); - players.setSize(0); - obj_id[] items = getObjectsInRange(loc, getInstallationRange(structure)); - if (items == null) - { - obj_id[] _players = new obj_id[0]; - if (players != null) - { - _players = new obj_id[players.size()]; - players.toArray(_players); - } - return _players; - } - - for (int i = 0; i < items.length; i++) - { - testAbortScript(); - if (isPlayer(items[i])) - { - players = utils.addElement(players, items[i]); - } - } - - obj_id[] _players = new obj_id[0]; - if (players != null) - { - _players = new obj_id[players.size()]; - players.toArray(_players); - } - return _players; - } - - - public static void confirmNoReclaimPlacement(obj_id deedOrScd, obj_id player, String template) throws InterruptedException - { - if (utils.hasScriptVar(deedOrScd, "noreclaim.pid")) - { - int oldpid = utils.getIntScriptVar(deedOrScd, "noreclaim.pid"); - obj_id oldplayer = utils.getObjIdScriptVar(deedOrScd, "noreclaim.player"); - - utils.removeScriptVarTree(deedOrScd, "noreclaim"); - - if (isIdValid(oldplayer)) - { - sui.closeSUI(oldplayer, oldpid); - } - } - - String title = utils.packStringId(SID_SUI_CONFIRM_PLACEMENT_TITLE); - String prompt = utils.packStringId(SID_SUI_CONFIRM_PLACEMENT_PROMPT); - - int pid = sui.msgbox(deedOrScd, player, prompt, sui.YES_NO, title, "handleNoReclaimConfirm"); - if (pid > - 1) - { - utils.setScriptVar(deedOrScd, "noreclaim.pid", pid); - utils.setScriptVar(deedOrScd, "noreclaim.player", player); - utils.setScriptVar(deedOrScd, "noreclaim.deedOrScd", deedOrScd); - } - } - - - public static boolean tryQueueStructurePlacement(obj_id deedOrScd, obj_id player) throws InterruptedException - { - String template = player_structure.getDeedTemplate(deedOrScd); - if (!player_structure.canReclaimDeed(template)) - { - if (!player_structure.isFactionPerkBase(template)) - { - confirmNoReclaimPlacement(deedOrScd, player, template); - return false; - } - } - - location loc = getLocation(player); - float range = 200f; - if (!player_structure.canPlaceGarage(loc, range, template)) - { - sendSystemMessage(player, SID_CANNOT_BUILD_GARAGE_TOO_CLOSE); - return false; - } - - if (!player_structure.canPlaceFactionPerkDeed(deedOrScd, player)) - { - return false; - } - - queueCommand(player, (123886506), deedOrScd, "", COMMAND_PRIORITY_DEFAULT); - return true; - } - - - public static boolean tryEnterPlacementMode(obj_id deedOrScd, obj_id player) throws InterruptedException - { - obj_id target = deedOrScd; - if (!isIdValid(target)) - { - return false; - } - - if ((!isGameObjectTypeOf (getGameObjectType(target), GOT_deed) && !isGameObjectTypeOf (getGameObjectType(target), GOT_data_house_control_device))) - { - sendSystemMessage(player, new string_id("player_structure", "not_a_deed")); - return false; - } - - String template = player_structure.getDeedTemplate(target); - if (template == null) - { - return false; - } - - location here = getLocation(player); - if (!player_structure.canPlaceStructure(player, template, here, target)) - { - return false; - } - - String fp_template = player_structure.getFootprintTemplate(template); - if (!fp_template.equals(template)) - { - if (!player_structure.canPlaceStructure(player, fp_template, here, null)) - { - return false; - } - } - - enterClientStructurePlacementMode(player, target, fp_template); - - return true; - } - - - public static boolean canPackBuilding(obj_id player, obj_id structure) throws InterruptedException - { - return !utils.isFreeTrial(player) && !isCivic(structure) && !isHarvester(structure) && !isGenerator(structure) && isOwner(structure, player); - } - - - public static void packBuilding(obj_id player, obj_id structure) throws InterruptedException - { - utils.setScriptVar(player, "packup.structure", structure); - if (utils.hasScriptVar(player, "packup.suiconfirm")) - { - sui.closeSUI(player, utils.getIntScriptVar(player, "packup.suiconfirm")); - } - - String stringId = vendor_lib.isVendorPackUpEnabled() ? "confirm_packup": "confirm_packup_no_vendors"; - if (isInstallation( structure )) - { - stringId += "_factory"; - } - if (!isOwner(structure, player)) - { - stringId += "_abandoned"; - } - - utils.setScriptVar(player, "packup.suiconfirm", sui.msgbox(player, player, utils.packStringId(new string_id("sui", stringId)), sui.YES_NO, "msgConfirmHousePackup")); - - return; - } - - - public static void finalizePackUp(obj_id player, obj_id structure) throws InterruptedException - { - blog("player_structure.finalizePackUp init."); - final boolean isAbandoned = isAbandoned(structure); - blog("player_structure.finalizePackUp isAbandoned: "+isAbandoned); - - obj_id structure_owner = getOwner(structure); - - if (structure_owner != player && isAbandoned) - { - CustomerServiceLog("housepackup", "Structure ("+ structure + ") was abandoned and was not being packed by Owner (" + getPlayerName(structure_owner) + ") "+ structure_owner + ". A player ( "+ getPlayerName(player) - + " is packing this structure. Sending job to the Abandoned Structure Pack Up function." ); - - finalizeAbandonedStructurePackUp(player, structure); - return; - } - blog("player_structure.finalizePackUp PLAYER IS THE OWNER."); - - if (!structure_owner.isLoaded() || !structure_owner.isAuthoritative()) - { - - CustomerServiceLog("housepackup", "Structure ("+ structure + ") could not be packed by player/owner (" + getPlayerName(player) + ") OID ("+player+ ") The cause: Player/owner -" + " isLoaded = "+ player.isLoaded() - + " isAuthoritative = "+ player.isAuthoritative() - ); - return; - } - - CustomerServiceLog("housepackup", "Player/Owner "+ getPlayerName(player) + - " OID ("+ player + ") is attempting to pack structure ("+ structure + ",abandoned=" + isAbandoned + ") Structure is loaded and is Authoritative." ); - - if (!structure.isLoaded() || !structure.isAuthoritative()) - { - blog("player_structure.finalizePackUp structure NOT LOADED or NOT AUTHORITATIVE."); - - CustomerServiceLog("housepackup", "Structure ("+ structure + ") could not be packed by player/owner (" + getPlayerName(player) + ") OID ("+ player + ") because structure -" + " isLoaded = "+ structure.isLoaded() - + " isAuthoritative = "+ structure.isAuthoritative() - ); - return; - } - blog("player_structure.finalizePackUp getting datapad"); - - obj_id datapad = utils.getPlayerDatapad(player); - if (!isIdValid(datapad)) - { - blog("player_structure.finalizePackUp datapad not valid."); - - CustomerServiceLog("housepackup", "Structure ("+ structure + ") could not be packed by player/owner (" + getPlayerName(player) + ") - datapad was not valid" ); - return; - } - - blog("player_structure.finalizePackUp creating SCD"); - - obj_id scd = createObjectOverloaded("object/intangible/house/generic_house_control_device.iff", datapad); - if (!isIdValid(scd)) - { - CustomerServiceLog("housepackup", "Structure ("+ structure + ") could not be packed by player/owner (" + getPlayerName(player) + ") - scd was not valid" ); - return; - } - attachScript(scd, "structure.house_control_device"); - - if (player_structure.isFactory(structure) && isHarvesterActive(structure)) - { - CustomerServiceLog("housepackup", "Structure ("+ structure + ") was a factory that was active. Turning off factory for player/owner (" + getPlayerName(player) + ") OID ("+ player + ")" ); - deactivate(structure); - } - - obj_id[] players = getPlayersInBuilding(structure); - if (players != null) - { - blog("player_structure.finalizePackUp Players are in the building that is about to be packed."); - - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - expelFromBuilding(players[i]); - } - } - - String[] cells = getCellNames(structure); - if (cells != null) - { - for (int i = 0; i < cells.length; i++) - { - testAbortScript(); - obj_id cellid = getCellId(structure, cells[i]); - obj_id contents[] = getContents(cellid); - if (contents != null) - { - for (int j=0; j= player_structure.NUM_NEEDED_PACKUP_FIRST_BADGE) - { - badge.grantBadge (player, "house_packup_badge"); - } - - return true; - } - - if (!badge.hasBadge(player, "house_packup_badge_master")) - { - - if (housePackUpTrackingArray[1] >= player_structure.NUM_NEEDED_PACKUP_SECOND_BADGE) - { - badge.grantBadge (player, "house_packup_badge_master"); - } - - return true; - } - - if (!badge.hasBadge(player, "house_packup_badge_mogul")) - { - - if (housePackUpTrackingArray[1] >= player_structure.NUM_NEEDED_PACKUP_THIRD_BADGE) - { - badge.grantBadge (player, "house_packup_badge_mogul"); - } - - return true; - } - - return true; - } - - - public static boolean hasBeenDeclaredResidence(obj_id structure) throws InterruptedException - { - return hasObjVar(structure, VAR_RESIDENCE_BUILDING); - } - - - public static obj_id getResidentPlayer(obj_id structure) throws InterruptedException - { - if (!hasBeenDeclaredResidence(structure)) - { - return null; - } - - obj_id resident = getObjIdObjVar(structure, VAR_RESIDENCE_BUILDING); - - return resident; - } - - - public static boolean replacePackedStructure(obj_id scd, obj_id owner, location loc, int rot, float placementHeight) throws InterruptedException - { - obj_id[] contents = getContents(scd); - if (contents.length != 1) - { - - trace.log("housepackup", "%TU attempted to unpack a house, but the SCD did not contain one.", owner, trace.TL_CS_LOG | trace.TL_ERROR_LOG); - return false; - } - - obj_id house = contents[0]; - - if (isIdValid(house)) - { - String houseTemplateName = getTemplateName(house); - if ((houseTemplateName != null) && player_structure.isBuildingName(houseTemplateName)) - { - loc.y = placementHeight; - } - } - - if (!setLocation(house, loc)) - { - return false; - } - - if (isIdValid(owner) && exists(owner)) - { - obj_id lotOverlimitStructure = getObjIdObjVar(owner, "lotOverlimit.structure_id"); - if (isIdValid(lotOverlimitStructure) && (lotOverlimitStructure == house)) - { - setObjVar(owner, "lotOverlimit.structure_location", localize(new string_id("planet_n", loc.area)) + " ("+ (int)loc.x + ", "+ (int)loc.z + ")"); - } - } - - if (hasObjVar(house, "packed_house.fix_contained_scene_ids")) - { - removeObjVar(house, "packed_house.fix_contained_scene_ids"); - } - - if (player_structure.isAbandoned( house )) - { - removeObjVar( house, "player_structure.abandoned"); - if (hasObjVar( house, "player_structure.name.original" )) - { - obj_var originalName = getObjVar( house, "player_structure.name.original"); - setName( house, originalName.getStringData() ); - } - } - if (player_structure.isCityAbandoned(house)) - { - removeObjVar(house, "player_structure.city_abandoned"); - if (hasObjVar(house, "player_structure.name.original")) - { - obj_var originalName = getObjVar(house, "player_structure.name.original"); - setName(house, originalName.getStringData()); - } - } - - float rot_float = (float)(90 * rot); - setYaw(house, rot_float); - persistObject(house); - createStructureSign(house, rot_float); - addStructureWaypoint(owner, loc, getStructureName(house), house); - - city.addStructureToCity(house); - trace.log("housepackup", "%TU unpacked their house ("+ house + ") from structure control device ( "+ scd + ") to new location "+ loc.toString(), owner, trace.TL_CS_LOG); - - obj_id[] houseContents = trial.getAllObjectsInDungeon(house); - - for (int i = 0, j = houseContents.length; i < j; i++) - { - testAbortScript(); - messageTo(houseContents[i], "OnUnpack", null, 1.0f, false); - } - - return true; - } - - - public static boolean hasVendors(obj_id structure) throws InterruptedException - { - - String[] cells = getCellNames(structure); - if (cells != null) - { - for (int i = 0; i < cells.length; i++) - { - testAbortScript(); - obj_id cellid = getCellId(structure, cells[i]); - obj_id contents[] = getContents(cellid); - if (contents != null) - { - for (int j=0; j 0 || templateName.indexOf("player_mustafar_house_lg") > 0 || templateName.indexOf("player_house_mustafar_lg") > 0) - { - return true; - } - else - { - return false; - } - } - } - - - public static boolean isCivic(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return false; - } - - if (exists(object) && getIntObjVar(object, VAR_CIVIC) == 1) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isAbandoned(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return false; - } - - return ( getIntObjVar(object, VAR_ABANDONED) == PLAYER_STRUCTURE_ABANDONED ); - } - - public static void setAbandoned(obj_id object) throws InterruptedException - { - setObjVar(object, VAR_ABANDONED, PLAYER_STRUCTURE_ABANDONED); - } - - - public static boolean isPreAbandoned(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return false; - } - - return ( getIntObjVar(object, VAR_ABANDONED) == PLAYER_STRUCTURE_PRE_ABANDONED ); - } - - - public static void setPreAbandoned(obj_id object) throws InterruptedException - { - setObjVar(object, VAR_ABANDONED, PLAYER_STRUCTURE_PRE_ABANDONED); - } - - - public static void setStructureAsNotAbandoned(obj_id object) throws InterruptedException - { - removeObjVar(object, VAR_ABANDONED); - } - - - public static boolean isCityAbandoned(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return false; - } - - if (hasObjVar(object, VAR_CITY_ABANDONED)) - { - return true; - } - - return false; - } - - - public static void setCityAbandoned(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return; - } - - setObjVar(object, VAR_CITY_ABANDONED, PLAYER_STRUCTURE_CITY_ABANDONED); - } - - - public static void removeCityAbandoned(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return; - } - - removeCityAbandonedTagFromHouse(object); - - if (hasObjVar(object, VAR_CITY_ABANDONED)) - { - removeObjVar(object, VAR_CITY_ABANDONED); - } - } - - - public static boolean isCityPackupAuthoritative(obj_id player, obj_id structure) throws InterruptedException - { - if (!player.isLoaded() || !player.isAuthoritative()) - { - return false; - } - - if (!structure.isLoaded() || !structure.isAuthoritative()) - { - return false; - } - - return true; - } - - - public static void removeCityAbandonedTagFromHouse(obj_id structure) throws InterruptedException - { - LOG("sissynoid", "Removing Zoning Violation Text."); - - if (!isIdValid(structure)) - { - return; - } - - if (player_structure.isFactory(structure)) - { - - if (hasObjVar(structure, "player_structure.name.original")) - { - String signOriginal = getStringObjVar(structure, "player_structure.name.original"); - setName(structure, signOriginal); - } - return; - } - else - { - if (!hasObjVar(structure, "player_structure.sign.id")) - { - LOG("sissynoid", "Structure("+ structure +") does not have a House Sign ObjVar"); - return; - } - - obj_id signId = getObjIdObjVar(structure, "player_structure.sign.id"); - String signText = getName(signId); - int indexOfAbandonedText = signText.indexOf(player_structure.CITY_ABANDONED_TEXT); - if (indexOfAbandonedText > -1) - { - - signText = signText.substring(0, indexOfAbandonedText); - setName(signId, signText); - LOG("sissynoid", "Removed Zoning Violation - New Text: "+ signText); - } - } - } - - - public static void updateCityAbandonedFactoryName(obj_id factory) throws InterruptedException - { - if (player_structure.isFactory(factory)) - { - LOG("sissynoid", "Factory - Updating Sign"); - String assignedName = getAssignedName(factory); - - if (!hasObjVar(factory, "player_structure.name.original")) - { - setObjVar(factory, "player_structure.name.original", assignedName == null ? "": assignedName); - } - else - { - - if (assignedName != null && assignedName.indexOf(player_structure.CITY_ABANDONED_TEXT) != -1) - { - - assignedName = getStringObjVar(factory, "player_structure.name.original"); - } - else - { - - setObjVar(factory, "player_structure.name.original", assignedName == null ? "": assignedName); - } - } - - if (assignedName == null || assignedName.length () == 0) - { - String templateName = getTemplateName(factory); - - if (templateName.equals("object/installation/manufacture/food_factory.iff")) - { - assignedName = "Food and Chemical Factory"; - } - else if (templateName.equals("object/installation/manufacture/clothing_factory.iff")) - { - assignedName = "Wearables Factory"; - } - else if (templateName.equals("object/installation/manufacture/weapon_factory.iff")) - { - assignedName = "Equipment Factory"; - } - else if (templateName.equals("object/installation/manufacture/structure_factory.iff")) - { - assignedName = "Structure Factory"; - } - else - { - assignedName = "Factory"; - } - } - - setName(factory, assignedName + player_structure.CITY_ABANDONED_TEXT); - } - } - - - public static boolean isCommercial(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return false; - } - - if (!isCivic(object) && getStructureCityRank(object)>0) - { - return true; - } - return false; - } - - - public static int getStructureCityRank(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return 0; - } - - return getIntObjVar( object, VAR_CITY_RANK ); - } - - - public static int getStructureCityCost(obj_id object) throws InterruptedException - { - if (!isIdValid(object)) - { - return 0; - } - - return getIntObjVar( object, VAR_CITY_COST ); - } - - - public static boolean isCivicTemplate(String template) throws InterruptedException - { - String[] structures = dataTableGetStringColumn( PLAYER_STRUCTURE_DATATABLE, "STRUCTURE"); - for (int i=0; i 0) - { - setObjVar(structure, VAR_MAINTENANCE_MOD, mm); - } - - return true; - } - - - public static boolean applyManagementMods(obj_id structure, obj_id player) throws InterruptedException - { - if (player == null || player == obj_id.NULL_ID) - { - return false; - } - - dictionary mods = new dictionary(); - int maintenance_mod = getSkillStatMod(player, "structure_maintenance_mod"); - if (maintenance_mod > 0) - { - mods.put("maintenance_mod", maintenance_mod); - } - - int factory_mod = getSkillStatMod(player, "factory_efficiency"); - - if (isFactory(structure)) - { - maintenance_mod += (int)getSkillStatisticModifier(player, "expertise_factory_maintenance_decrease"); - } - - if (isHarvester(structure)) - { - maintenance_mod += (int)getSkillStatisticModifier(player, "expertise_harvester_maintenance_decrease"); - } - - if (factory_mod > 0) - { - mods.put("factory_mod", maintenance_mod); - } - - return applyManagementMods(structure, mods); - } - - - public static boolean applyManagementMods(obj_id structure, int mods) throws InterruptedException - { - if (!isIdValid(structure)) - { - return false; - } - - if (mods < 1) - { - return false; - } - - dictionary mods_dict = new dictionary(); - mods_dict.put("maintenance_mod", mods); - - return applyManagementMods(structure, mods_dict); - } - - - public static boolean removeManagementMods(obj_id structure) throws InterruptedException - { - - return true; - } - - - public static boolean isGuildIdOnRawList(String[] nameList, int guildId) throws InterruptedException - { - if ((nameList != null) && (guildId != 0)) - { - - String guildIdAsString = "guild:"+ guildId; - - return ( utils.getElementPositionInArray( nameList, guildIdAsString ) != -1 ); - } - - return false; - } - - - public static boolean isGuildNameOnRawList(String[] nameList, String guildNameToFind) throws InterruptedException - { - if (guildNameToFind != null) - { - return isGuildIdOnRawList( nameList, findGuild( guildNameToFind.trim().toLowerCase() ) ); - } - - return false; - } - - - public static boolean isPlayerObjIdOnRawList(String[] nameList, obj_id playerObjId) throws InterruptedException - { - if ((nameList != null) && isIdValid(playerObjId)) - { - - String playerObjIdAsString = playerObjId.toString(); - - return ( utils.getElementPositionInArray( nameList, playerObjIdAsString ) != -1 ); - } - - return false; - } - - - public static boolean isPlayerNameOnRawList(String[] nameList, String playerNameToFind) throws InterruptedException - { - if (playerNameToFind != null) - { - return isPlayerObjIdOnRawList( nameList, getPlayerIdFromFirstName( playerNameToFind.trim().toLowerCase() ) ); - } - - return false; - } - - - public static boolean isNameOnRawList(String[] nameList, String nameToFind) throws InterruptedException - { - if (nameToFind != null) - { - - if (nameToFind.toLowerCase().indexOf("guild:") > -1) - { - - return isGuildNameOnRawList( nameList, nameToFind.substring(6).toLowerCase().trim() ); - } - else - { - - return isPlayerNameOnRawList( nameList, nameToFind ); - } - } - - return false; - } - - - public static boolean isNameOnPermissionList(String[] permissionList, String nameToFind) throws InterruptedException - { - if ((permissionList != null) && (nameToFind != null)) - { - - if (nameToFind.toLowerCase().indexOf("guild:") > -1) - { - - String guildName = nameToFind.substring(6).toLowerCase().trim(); - - int guildId = findGuild( guildName ); - - for (int i = 0; i < permissionList.length; i++) - { - testAbortScript(); - - if (permissionList[i].toLowerCase().indexOf("guild:") > -1) - { - String permissionListGuildName = permissionList[i].substring(6).toLowerCase().trim(); - - if (guildId == 0) - { - if (guildName.equals(permissionListGuildName)) - { - return true; - } - } - else - { - - int permissionListGuildId = findGuild( permissionListGuildName ); - if (guildId == permissionListGuildId) - { - return true; - } - } - } - } - } - else - { - String playerName = nameToFind.toLowerCase().trim(); - - for (int i = 0; i < permissionList.length; i++) - { - testAbortScript(); - if (permissionList[i].toLowerCase().trim().equals( playerName )) - { - return true; - } - } - } - } - - return false; - } - - - public static boolean addGuildIdToRawList(Vector nameList, int guildId) throws InterruptedException - { - if (guildId != 0) - { - - if (nameList == null) - { - return false; - } - - String guildIdAsString = "guild:"+ guildId; - - if (utils.getElementPositionInArray( nameList, guildIdAsString ) == -1) - { - nameList.add( guildIdAsString ); - return true; - } - - return true; - } - - return false; - } - - - public static boolean addGuildNameToRawList(Vector nameList, String guildNameToAdd) throws InterruptedException - { - if (guildNameToAdd != null) - { - return addGuildIdToRawList( nameList, findGuild( guildNameToAdd.trim().toLowerCase() ) ); - } - - return false; - } - - - public static boolean addPlayerObjIdToRawList(Vector nameList, obj_id playerObjId) throws InterruptedException - { - if (isIdValid(playerObjId)) - { - - if (nameList == null) - { - return false; - } - - String playerObjIdAsString = playerObjId.toString(); - - if (utils.getElementPositionInArray( nameList, playerObjIdAsString ) == -1) - { - nameList.add( playerObjIdAsString ); - return true; - } - } - - return false; - } - - - public static boolean addPlayerNameToRawList(Vector nameList, String playerNameToAdd) throws InterruptedException - { - if (playerNameToAdd != null) - { - return addPlayerObjIdToRawList( nameList, getPlayerIdFromFirstName( playerNameToAdd.trim().toLowerCase() ) ); - } - - return false; - } - - - public static boolean addNameToRawList(Vector nameList, String nameToAdd) throws InterruptedException - { - if (nameToAdd != null) - { - - if (nameToAdd.toLowerCase().indexOf("guild:") > -1) - { - - return addGuildNameToRawList( nameList, nameToAdd.substring(6).toLowerCase().trim() ); - } - else - { - - return addPlayerNameToRawList( nameList, nameToAdd ); - } - } - - return false; - } - - - public static boolean removeGuildIdFromRawList(Vector nameList, int guildId) throws InterruptedException - { - if ((nameList != null) && (guildId != 0)) - { - - String guildIdAsString = "guild:"+ guildId; - - int deleteIndex = utils.getElementPositionInArray( nameList, guildIdAsString ); - if (deleteIndex != -1) - { - - nameList.remove( deleteIndex ); - return true; - } - } - - return false; - } - - - public static boolean removeGuildNameFromRawList(Vector nameList, String guildNameToRemove) throws InterruptedException - { - if (guildNameToRemove != null) - { - return removeGuildIdFromRawList( nameList, findGuild( guildNameToRemove.trim().toLowerCase() ) ); - } - - return false; - } - - - public static boolean removePlayerObjIdFromRawList(Vector nameList, obj_id playerObjId) throws InterruptedException - { - if ((nameList != null) && isIdValid(playerObjId)) - { - - String playerObjIdAsString = playerObjId.toString(); - - int deleteIndex = utils.getElementPositionInArray( nameList, playerObjIdAsString ); - if (deleteIndex != -1) - { - - nameList.remove( deleteIndex ); - return true; - } - } - - return false; - } - - - public static boolean removePlayerNameFromRawList(Vector nameList, String playerNameToRemove) throws InterruptedException - { - if (playerNameToRemove != null) - { - return removePlayerObjIdFromRawList( nameList, getPlayerIdFromFirstName( playerNameToRemove.trim().toLowerCase() ) ); - } - - return false; - } - - - public static boolean removeNameFromRawList(Vector nameList, String nameToRemove) throws InterruptedException - { - if (nameToRemove != null) - { - - if (nameToRemove.toLowerCase().indexOf("guild:") > -1) - { - - return removeGuildNameFromRawList( nameList, nameToRemove.substring(6).toLowerCase().trim() ); - } - else - { - - return removePlayerNameFromRawList( nameList, nameToRemove ); - } - } - - return false; - } - - - public static String[] convertRawListToNames(String[] nameListToConvert) throws InterruptedException - { - Vector converted_list = new Vector(); - converted_list.setSize(0); - - if (nameListToConvert != null) - { - for (int i = 0; i < nameListToConvert.length; i++) - { - testAbortScript(); - - if (nameListToConvert[i].toLowerCase().indexOf("guild:") > -1) - { - String guildIdString = nameListToConvert[i].substring(6).toLowerCase().trim(); - - int guildId = utils.stringToInt( guildIdString ); - if (guildId > 0) - { - String guildAbbrev = guildGetAbbrev( guildId ); - if ((guildAbbrev != null) && (!guildAbbrev.equals(""))) - { - converted_list.add( "Guild:"+ guildAbbrev ); - } - } - } - else - { - - obj_id player = utils.stringToObjId(nameListToConvert[i]); - if (isIdValid(player)) - { - - String player_full_name = getPlayerFullName( player ); - if (player_full_name != null) - { - java.util.StringTokenizer st = new java.util.StringTokenizer(player_full_name); - if (st.hasMoreTokens()) - { - String player_first_name = st.nextToken(); - converted_list.add( player_first_name ); - } - } - } - } - } - } - - return (String[])converted_list.toArray(new String[0]); - } - - - public static boolean modifyList(obj_id structure, String player_or_guild_name, obj_id admin, String objvar, boolean verbose) throws InterruptedException - { - - if (!isIdValid(structure)) - { - return false; - } - - if (!isIdValid(admin) && verbose) - { - return false; - } - - if (isIdValid(admin)) - { - if (!isAdmin(structure, admin)) - { - - if (verbose) - { - sendSystemMessage(admin, new string_id(STF_FILE, "must_be_admin")); - } - return false; - } - } - - if (player_or_guild_name == null) - { - return false; - } - - boolean is_name_on_list = false; - if (objvar.equals(VAR_ENTER_LIST)) - { - is_name_on_list = isNameOnEntryList(structure, player_or_guild_name); - } - else if (objvar.equals(VAR_BAN_LIST)) - { - is_name_on_list = isNameOnBanList(structure, player_or_guild_name); - } - else if (objvar.equals(VAR_ADMIN_LIST)) - { - is_name_on_list = isNameOnAdminList(structure, player_or_guild_name); - } - else if (objvar.equals(VAR_HOPPER_LIST)) - { - is_name_on_list = isNameOnHopperList(structure, player_or_guild_name); - } - else - { - return false; - } - - if (!is_name_on_list) - { - - { - String[] listOfNames = new String[0]; - - if (objvar.equals(VAR_ENTER_LIST)) - { - listOfNames = getEntryList(structure); - } - else if (objvar.equals(VAR_BAN_LIST)) - { - listOfNames = getBanList(structure); - } - else if (objvar.equals(VAR_ADMIN_LIST)) - { - listOfNames = getAdminListRaw(structure); - } - else if (objvar.equals(VAR_HOPPER_LIST)) - { - listOfNames = getHopperListRaw(structure); - } - - if (listOfNames != null) - { - if (listOfNames.length >= MAX_LIST_SIZE) - { - if (verbose && isIdValid(admin)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "too_many_entries")); - } - return false; - } - } - } - - if (player_or_guild_name.toLowerCase().indexOf("guild:") > -1) - { - - if (objvar.equals(VAR_ADMIN_LIST) || objvar.equals(VAR_HOPPER_LIST)) - { - - if (verbose && isIdValid(admin)) - { - sendSystemMessageProse(admin, prose.getPackage(new string_id (STF_FILE, "modify_list_invalid_player"), player_or_guild_name)); - } - return false; - } - - int guild_id = findGuild(player_or_guild_name.substring(6).toLowerCase().trim()); - if (guild_id == 0) - { - if (verbose && isIdValid(admin)) - { - sendSystemMessageProse(admin, prose.getPackage(new string_id (STF_FILE, "modify_list_invalid_guild"), player_or_guild_name.substring(6).trim())); - } - return false; - } - } - else - { - if (!isIdValid(utils.stringToObjId(player_or_guild_name))) - { - - obj_id player_objId = getPlayerIdFromFirstName(player_or_guild_name.toLowerCase().trim()); - if (!isIdValid(player_objId)) - { - if (verbose && isIdValid(admin)) - { - sendSystemMessageProse(admin, prose.getPackage(new string_id (STF_FILE, "modify_list_invalid_player"), player_or_guild_name)); - } - return false; - } - } - } - - if (objvar.equals(VAR_ENTER_LIST)) - { - permissionsAddAllowed(structure, player_or_guild_name); - } - else if (objvar.equals(VAR_BAN_LIST)) - { - permissionsAddBanned(structure, player_or_guild_name); - } - else if (objvar.equals(VAR_ADMIN_LIST)) - { - adminListAddName(structure, player_or_guild_name); - } - else if (objvar.equals(VAR_HOPPER_LIST)) - { - hopperListAddName(structure, player_or_guild_name); - } - - if (verbose && isIdValid(admin)) - { - sendSystemMessageProse(admin, prose.getPackage(new string_id (STF_FILE, "player_added"), player_or_guild_name)); - } - - if (objvar.equals(VAR_ADMIN_LIST)) - { - - if (isBuilding(structure)) - { - if (!isNameOnEntryList(structure, player_or_guild_name)) - { - modifyList(structure, player_or_guild_name, admin, VAR_ENTER_LIST, false); - } - } - - if (isInstallation(structure)) - { - if (!isNameOnHopperList(structure, player_or_guild_name)) - { - modifyList(structure, player_or_guild_name, admin, VAR_HOPPER_LIST, false); - } - } - } - - if (objvar.equals(VAR_BAN_LIST)) - { - - if (isBuilding(structure)) - { - if (isNameOnEntryList(structure, player_or_guild_name)) - { - modifyList(structure, player_or_guild_name, admin, VAR_ENTER_LIST, false); - } - } - - if (isInstallation(structure)) - { - if (isNameOnHopperList(structure, player_or_guild_name)) - { - modifyList(structure, player_or_guild_name, admin, VAR_HOPPER_LIST, false); - } - } - } - } - else - { - if (objvar.equals(VAR_ENTER_LIST)) - { - permissionsRemoveAllowed(structure, player_or_guild_name); - } - else if (objvar.equals(VAR_BAN_LIST)) - { - permissionsRemoveBanned(structure, player_or_guild_name); - } - else if (objvar.equals(VAR_ADMIN_LIST)) - { - adminListRemoveName(structure, player_or_guild_name); - } - else if (objvar.equals(VAR_HOPPER_LIST)) - { - hopperListRemoveName(structure, player_or_guild_name); - } - - if (verbose && isIdValid(admin)) - { - sendSystemMessageProse(admin, prose.getPackage(new string_id (STF_FILE, "player_removed"), player_or_guild_name)); - } - } - - return true; - } - - - public static boolean modifyEntryList(obj_id structure, obj_id player, obj_id admin) throws InterruptedException - { - if (isIdValid(player)) - { - return modifyEntryList( structure, getPlayerName( player ), admin ); - } - else - { - - return false; - } - } - - - public static boolean modifyEntryList(obj_id structure, String player_or_guild_name, obj_id admin) throws InterruptedException - { - if (!isBuilding(structure)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "no_entry_list")); - return false; - } - - if (canEnter(structure, player_or_guild_name)) - { - - if (isAdmin(structure, player_or_guild_name)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "no_remove_admin")); - return false; - } - } - else - { - - if (isBanned(structure, player_or_guild_name)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "no_banned")); - return false; - } - } - - return modifyList(structure, player_or_guild_name, admin, VAR_ENTER_LIST, true); - } - - - public static boolean modifyBanList(obj_id structure, String player_or_guild_name, obj_id admin) throws InterruptedException - { - - if (!isBuilding(structure)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "no_banned")); - return false; - } - - if (!isAdmin(structure, admin)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "admin_only_modify")); - return false; - } - - if (isAdmin(structure, player_or_guild_name)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "cannot_ban_admin")); - return false; - } - - return modifyList(structure, player_or_guild_name, admin, VAR_BAN_LIST, true); - } - - - public static boolean modifyBanList(obj_id structure, obj_id player, obj_id admin) throws InterruptedException - { - if (isIdValid(player)) - { - boolean result = modifyBanList( structure, getPlayerName( player ), admin ); - if (result) - { - - if (player.isLoaded() && player.isAuthoritative()) - { - obj_id ban_structure = getStructure(player); - - if (ban_structure.equals( structure )) - { - expelFromBuilding(player); - } - } - } - - return result; - } - else - { - - return false; - } - } - - - public static boolean modifyAdminList(obj_id structure, obj_id player, obj_id admin) throws InterruptedException - { - return modifyAdminList( structure, getPlayerName( player ), admin ); - } - - - public static boolean modifyAdminList(obj_id structure, String player_or_guild_name, obj_id admin) throws InterruptedException - { - if (player_or_guild_name.equals(getPlayerName(admin))) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "cannot_remove_self")); - return false; - - } - - if (isOwner(structure, player_or_guild_name)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "cannot_remove_owner")); - return false; - } - - if (isBanned(structure, player_or_guild_name)) - { - - sendSystemMessageProse(admin, prose.getPackage(new string_id (STF_FILE, "cannot_add_banned"), player_or_guild_name)); - return false; - } - - return modifyList(structure, player_or_guild_name, admin, VAR_ADMIN_LIST, true); - } - - - public static boolean modifyVendorList(obj_id structure, String player_name, obj_id admin) throws InterruptedException - { - return false; - } - - - public static boolean modifyVendorList(obj_id structure, obj_id player, obj_id admin) throws InterruptedException - { - String player_name = getPlayerName(player); - return modifyVendorList(structure, player_name, admin); - } - - - public static boolean modifyHopperList(obj_id structure, obj_id player, obj_id admin) throws InterruptedException - { - return modifyHopperList( structure, getPlayerName( player ), admin ); - } - - - public static boolean modifyHopperList(obj_id structure, String player_or_guild_name, obj_id admin) throws InterruptedException - { - if (!isInstallation(structure)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "only_installations")); - return false; - } - - if (canHopper(structure, player_or_guild_name)) - { - - if (isAdmin(structure, player_or_guild_name)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "hopper_cannot_remove_admin")); - return false; - } - } - else - { - - if (isBanned(structure, player_or_guild_name)) - { - - sendSystemMessage(admin, new string_id(STF_FILE, "no_banned_vendors")); - return false; - } - } - - return modifyList(structure, player_or_guild_name, admin, VAR_HOPPER_LIST, true); - } - - - public static int getStructureTableIndex(String template) throws InterruptedException - { - if (template == null || template.equals("")) - { - return -1; - } - - int idx = dataTableSearchColumnForString(template, DATATABLE_COL_STRUCTURE, PLAYER_STRUCTURE_DATATABLE); - if (idx == -1) - { - idx = dataTableSearchColumnForString(template, DATATABLE_COL_FOOTPRINT, PLAYER_STRUCTURE_DATATABLE); - } - - return idx; - } - - - public static obj_id addStructureWaypoint(obj_id player, location loc, String name, obj_id structure) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_structure.addStructureWaypoint -- "+ name); - - if (!isIdValid(player)) - { - return null; - } - - if (loc == null) - { - return null; - } - - if (name == null) - { - return null; - } - - obj_id waypoint = createWaypointInDatapad(player, loc); - if (!isIdValid(waypoint)) - { - return null; - } - - setWaypointVisible(waypoint, true); - setWaypointActive(waypoint, true); - setWaypointName(waypoint, name); - - if (structure.isLoaded()) - { - setObjVar(structure, VAR_WAYPOINT_STRUCTURE, waypoint); - } - else - { - dictionary params = new dictionary(); - params.put("waypoint", waypoint); - messageTo(structure, "msgAddWaypointData", params, 0.0f, true); - } - - return waypoint; - } - - - public static boolean payMaintenance(obj_id player, obj_id structure, int amt) throws InterruptedException - { - - if (!isIdValid(player) || !isIdValid(structure)) - { - return false; - } - - if (amt < 1 || amt > 100000) - { - return false; - } - - if (isOwner(structure, player)) - { - doOldToNewLotConversion( player, structure ); - } - - return money.pay(player, structure, amt, "handlePayment", null); - } - - - public static boolean withdrawMaintenance(obj_id player, obj_id structure, int amt) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(structure)) - { - return false; - } - - if (amt < 1) - { - return false; - } - - dictionary d = new dictionary(); - d.put("player", player); - d.put("structure", structure); - d.put("amount", amt); - - CustomerServiceLog("playerStructure", "%TU has initiated a withdraw of "+ amt + " from structure "+ structure + ".", player, null); - - return transferBankCreditsTo(structure, player, amt, "msgPAWithdrawSuccess", "msgPAWithdrawFail", d); - } - - - public static int decrementMaintenancePool(obj_id structure, int amt) throws InterruptedException - { - if (getConfigSetting("GameServer", "disableStructureFees") != null) - { - return 1; - } - - if (!isIdValid(structure)) - { - return -1; - } - - if (amt < 1) - { - return -1; - } - - int pool = getBankBalance(structure); - if (amt > pool) - { - return -2; - } - - int property_tax = city.getPropertyTax(structure); - int pretax_amt = 0, tax_amt = 0; - int base_amt = amt; - if (property_tax > 0) - { - pretax_amt = Math.round(amt / (1+(property_tax/100.f))); - tax_amt = base_amt - pretax_amt; - - if (money.bankTo(structure, money.ACCT_STRUCTURE_MAINTENANCE, pretax_amt)) - { - pool -= pretax_amt; - if ((tax_amt > 0) && money.bankTo( structure, city.getCityHall(structure), tax_amt )) - { - pool -= tax_amt; - } - return pool; - } - } - else - { - if (money.bankTo(structure, money.ACCT_STRUCTURE_MAINTENANCE, amt)) - { - pool -= amt; - return pool; - } - } - - return -1; - } - - - public static int damageStructure(obj_id structure, int amt, boolean boolCondemn) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - return -1; - } - - if (amt < 1) - { - return -1; - } - - int condition = getStructureCondition(structure); - condition = condition - amt; - - if (condition < 1) - { - condition = 0; - if (hasCondition( structure, CONDITION_VENDOR )) - { - destroyObject( structure ); - } - else - { - - if (isBuilding(structure) || isFactory(structure)) - { - if (boolCondemn) - { - setInvulnerableHitpoints(structure, 1); - return 0; - } - } - CustomerServiceLog("playerStructure","Structure "+ structure + " destroyed for lack of maintenance."); - destroyStructure(structure); - } - } - else - { - - setInvulnerableHitpoints(structure, condition); - } - - return condition; - } - - - public static int damageStructure(obj_id structure, int amt) throws InterruptedException - { - return damageStructure(structure, amt, false); - } - - - public static int repairStructure(obj_id structure, int amt) throws InterruptedException - { - if (structure == null || structure == obj_id.NULL_ID) - { - LOG("building", "Returning 1"); - return -1; - } - - if (amt < 1) - { - LOG("building", "Returning 12"); - return -1; - } - - int condition = getStructureCondition(structure); - - int max_condition = getMaxCondition(structure); - - condition = condition + amt; - LOG("building", "new condition is "+condition); - - if (condition > max_condition) - { - condition = max_condition; - } - - setInvulnerableHitpoints(structure, condition); - - if (isStructureCondemned(structure)) - { - removeObjVar(structure, "player_structure.condemned"); - } - - return condition; - } - - - public static boolean initiateRepairCheck(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return false; - } - - int condition = getStructureCondition(structure); - int max_condition = getMaxCondition(structure); - if (condition != max_condition) - { - int damage = max_condition - condition; - int maint_pool = getBankBalance(structure); - - float per_point_cost = getBaseMaintenanceRate( structure ) / 3.0f; - - int repair_cost = (int)(damage * per_point_cost); - int amt_paid = 0; - int amt_repaired = 0; - - if (maint_pool >= per_point_cost) - { - LOG("LOG_CHANNEL", "permanent_structure::OnMaintenanceLoop -- initiating repairs."); - LOG("LOG_CHANNEL", "cond ->"+ condition); - if (maint_pool < repair_cost) - { - - amt_repaired = (int)(maint_pool / per_point_cost); - amt_paid = maint_pool; - } - else - { - - amt_paid = (int)(damage * per_point_cost); - amt_repaired = damage; - } - - int result = decrementMaintenancePool(structure, amt_paid); - if (result > -1) - { - LOG("LOG_CHANNEL", "amt_paid ->"+ amt_paid + " amt_repaired ->"+ amt_repaired); - condition = repairStructure(structure, amt_repaired); - LOG("LOG_CHANNEL", "2cond ->"+ condition); - - } - else - { - LOG("LOG_CHANNEL", "permanent_structure::OnMaintenanceLoop -- unable to pay repair costs."); - } - } - } - - return true; - } - - - public static boolean sendMaintenanceMail(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return false; - } - - int last_message = 0; - if (hasObjVar(structure, VAR_LAST_MESSAGE)) - { - last_message = getIntObjVar(structure, VAR_LAST_MESSAGE); - } - - if (last_message <= getGameTime() && !isStructureCondemned(structure)) - { - int condition = player_structure.getStructureCondition(structure); - int max_condition = player_structure.getMaxCondition(structure); - int perc_condition = (condition * 100) / max_condition; - - if (perc_condition <= 90) - { - - obj_id owner = getStructureOwnerObjId(structure); - if (isIdValid(owner)) - { - location loc = getLocation(structure); - String area = loc.area; - if (area != null) - { - area = area.substring(0,1).toUpperCase() + area.substring(1); - } - - String loc_str = "("+ loc.x + ", "+ loc.z + " "+ loc.area + ")"; - string_id strSpam = player_structure.SID_MAIL_STRUCTURE_DAMAGE; - prose_package pp = prose.getPackage(strSpam, null, structure, loc_str, perc_condition); - utils.sendMail(player_structure.SID_MAIL_STRUCTURE_DAMAGE_SUB, pp, getPlayerName(owner), "@player_structure:management"); - utils.setObjVar(structure, VAR_LAST_MESSAGE, getGameTime()+ MAIL_WARNING_INTERVAL); - return true; - } - } - else if (hasObjVar(structure, VAR_LAST_MESSAGE)) - { - removeObjVar(structure, VAR_LAST_MESSAGE); - } - } - - return false; - } - - - public static int destroyStructure(obj_id structure, obj_id containerForDeed, boolean reclaim, boolean overloaded) throws InterruptedException - { - if (!isValidId(structure) || !exists(structure)) - { - return DESTROY_RESULT_INVALID_STRUCTURE; - } - - String template = getTemplateName(structure); - obj_id owner = getStructureOwnerObjId(structure); - obj_id self = getSelf(); - - String sname = getStructureName( structure ); - CustomerServiceLog("playerStructure","Initiating destroy for structure "+ structure + " (Template: "+ template + " Name: "+ sname + "). Owner is "+ getStructureOwner(structure) + " ("+ owner + ") Location: "+ getLocation(structure) + " Reclaim: "+ reclaim); - - boolean bGetSelfPowered = false; - - if (hasObjVar(structure, "selfpowered")) - { - bGetSelfPowered = true; - } - - if (reclaim) - { - - obj_id deed = null; - boolean isStaticItemDeed = false; - String deed_template = getDeedTemplate(structure); - if (deed_template == null || deed_template.equals("")) - { - CustomerServiceLog("playerStructure","Attempting to reclaim deed, but can't find deed information for "+ structure + ". Owner is "+ getStructureOwner(structure) + "("+ owner + ") Location: "+ getLocation(structure)); - return DESTROY_RESULT_FAIL_COULD_NOT_DETERMINE_DEED_FOR_STRUCTURE; - } - - if (!overloaded && getVolumeFree(containerForDeed) < 1) - { - return DESTROY_RESULT_FAIL_TARGET_CONTAINER_FULL; - } - - if (!overloaded && getVolumeFree(containerForDeed) < 2 && bGetSelfPowered) - { - return DESTROY_RESULT_FAIL_TARGET_CONTAINER_FULL_SELFPOWERED; - } - - if (hasObjVar(structure, TCG_STATIC_ITEM_DEED_OBJVAR)) - { - CustomerServiceLog("playerStructure", "DestroyStructure -- Player has TCG STRUCTURE: "+ structure + ". Owner is %TU. destroyStructure initiated by %TT", owner, self); - - String staticItemDeed = getStringObjVar(structure, TCG_STATIC_ITEM_DEED_OBJVAR); - if (staticItemDeed == null || staticItemDeed.equals("")) - { - return DESTROY_RESULT_INVALID_STATIC_ITEM; - } - - if (!static_item.isStaticItem(staticItemDeed)) - { - return DESTROY_RESULT_INVALID_STATIC_ITEM; - } - - deed = static_item.createNewItemFunction(staticItemDeed, containerForDeed); - isStaticItemDeed = true; - CustomerServiceLog("playerStructure", "DestroyStructure -- Owner has TCG STRUCTURE: "+ structure + " and has the correct static item: "+staticItemDeed+". Owner is %TU. destroyStructure initiated by %TT", owner, self); - } - else - { - deed = overloaded ? createObjectOverloaded(deed_template, containerForDeed) : createObject(deed_template, containerForDeed, ""); - } - - if (!isValidId(deed) || !exists(deed)) - { - CustomerServiceLog("playerStructure","structure("+structure+")|owner("+owner+") was unable to create the deed for caller("+self+") and is dumping out without destroying the structure"); - return DESTROY_RESULT_FAIL_COULD_NOT_CREATE_DEED; - } - - if (!isStaticItemDeed) - { - setDeedTemplate(deed, template); - setObjVar(deed, VAR_DEED_BUILDTIME, getDeedBuildTime(structure)); - String deed_scene = getDeedScene( structure ); - - if (deed_scene != null) - { - if (deed_scene.equals( "tatooine" )) - { - deed_scene = "tatooine,lok,dantooine"; - } - else if (deed_scene.equals( "naboo" )) - { - deed_scene = "naboo,rori,dantooine"; - } - else if (deed_scene.equals( "corellia" )) - { - deed_scene = "corellia,talus"; - } - } - setObjVar(deed, VAR_DEED_SCENE, deed_scene); - } - - if (hasObjVar(structure, "structureChange.storageIncrease")) - { - int storageIncrease = getIntObjVar(structure, "structureChange.storageIncrease"); - setObjVar( deed, "structureChange.storageIncrease", storageIncrease); - setObjVar( deed, "noTrade", 1); - attachScript( deed, "item.special.nomove"); - - } - - int maxExtractionRate = getIntObjVar(structure, "max_extraction"); - if (maxExtractionRate != -1 && isHarvester(structure) || isGenerator(structure)) - { - setObjVar(deed, VAR_DEED_MAX_EXTRACTION, maxExtractionRate); - } - - int currentExtractionRate = getIntObjVar(structure, "current_extraction"); - if (currentExtractionRate != -1 && isHarvester(structure) || isGenerator(structure)) - { - setObjVar(deed, VAR_DEED_CURRENT_EXTRACTION, currentExtractionRate); - } - - int maxHopperAmount = getIntObjVar(structure, VAR_DEED_MAX_HOPPER); - - if (maxHopperAmount > 0) - { - setObjVar(deed, VAR_DEED_MAX_HOPPER, maxHopperAmount); - } - - int maintPool = getBankBalance(structure); - int reclaimCost = getRedeedCost(structure); - transferBankCreditsToNamedAccount(structure, money.ACCT_DEED_RECLAIM, reclaimCost, "noHandler", "noHandler", new dictionary()); - - int surplus = maintPool - reclaimCost; - if (surplus > 0) - { - setObjVar(deed, VAR_DEED_SURPLUS_MAINTENANCE, surplus); - transferBankCreditsToNamedAccount(structure, money.ACCT_STRUCTURE_DESTROYED, surplus, "noHandler", "noHandler", new dictionary()); - CustomerServiceLog("playerStructure", "DestroyStructure -- transferring maintenance to deed "+ deed + " from structure "+ structure + " Amount: "+ surplus + ". Owner is %TU. destroyStructure initiated by %TT", owner, self); - } - - float power = getPowerValue(structure); - - if (power > 0f && (isFactory(structure) || isHarvester(structure) || isGenerator(structure))) - { - setObjVar(deed, VAR_DEED_SURPLUS_POWER, power); - } - - } - else - { - if (isIdValid(containerForDeed) && getVolumeFree(containerForDeed)<1 && bGetSelfPowered) - { - return DESTROY_RESULT_FAIL_TARGET_CONTAINER_FULL_SELFPOWERED; - } - - transferBankCreditsToNamedAccount(structure, money.ACCT_STRUCTURE_DESTROYED, getBankBalance(structure), "noHandler", "noHandler", new dictionary()); - } - - if (bGetSelfPowered) - { - String veteranRewardDeedToReturn = null; - if (isEliteHarvester(structure)) - { - veteranRewardDeedToReturn = SELFPOWERED_DEED_ELITE; - } - else - { - veteranRewardDeedToReturn = SELFPOWERED_DEED; - } - - if (overloaded) - { - createObjectOverloaded( veteranRewardDeedToReturn, containerForDeed); - } - else - { - createObject( veteranRewardDeedToReturn, containerForDeed, ""); - } - } - - city.removeStructureFromCity( structure ); - - if (isBuilding(structure)) - { - obj_id[] players = getPlayersInBuilding(structure); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - - expelFromBuilding(players[i]); - } - } - - } - destroyBaseObjects(structure); - destroyStructureSign(structure); - - dictionary params = new dictionary(); - params.put("structure", structure); - params.put("template", template); - if (hasObjVar(structure, VAR_WAYPOINT_STRUCTURE)) - { - params.put("waypoint", getObjIdObjVar(structure, VAR_WAYPOINT_STRUCTURE)); - } - - adjustLotsForOfflinePlayer( self, structure ); - - messageTo(owner, "OnRemoveStructure", params, 0.1f, true); - - if (vendor_lib.isVendorPackUpEnabled()) - { - - String[] cells = getCellNames(structure); - if (cells != null) - { - for (int i = 0; i < cells.length; i++) - { - testAbortScript(); - obj_id cellid = getCellId(structure, cells[i]); - obj_id contents[] = getContents(cellid); - if (contents != null) - { - for (int j=0; j 4) - { - return "error"; - } - - if (time_values.length == 1 && time_values[0] == Integer.MAX_VALUE) - { - return "3550+ weeks"; - } - - String[] time_strings = - { - "day", "hour", "minute", "second" - }; - int num_times = 0; - for (int i = 0; i < time_values.length; i++) - { - testAbortScript(); - if (time_values[i] != 0) - { - num_times++; - } - } - - int num_left = num_times; - - StringBuffer sb = new StringBuffer(); - - for (int i = 0; i < time_values.length; i++) - { - testAbortScript(); - if (time_values[i] > 0) - { - sb.append(time_values[i] + " "+ time_strings[i]); - if (time_values[i] > 1) - { - sb.append("s"); - } - - if (num_left == 1) - { - sb.append("."); - } - - else if (num_left == 2) - { - if (num_times > 2) - { - sb.append(", and "); - } - else - { - sb.append(" and "); - } - - } - else - { - sb.append(", "); - } - - num_left--; - } - } - - return sb.toString(); - } - - - public static boolean convertPermissionsLists(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - LOG("player_structure", "player_structure.convertPermissionsLists -- structure is invalid."); - return false; - } - - if (!hasObjVar(structure, VAR_PERMISSIONS_CONVERTED)) - { - obj_id[] admin_list_as_objIds = getObjIdArrayObjVar(structure, VAR_ADMIN_LIST); - if (admin_list_as_objIds != null) - { - - String[] new_admin_list = convertObjIdPermissionList(admin_list_as_objIds); - if (new_admin_list != null) - { - if (new_admin_list.length > 0) - { - setObjVar(structure, VAR_ADMIN_LIST, new_admin_list); - } - else - { - removeObjVar(structure, VAR_ADMIN_LIST); - } - } - } - else - { - String[] admin_list_as_strings = getStringArrayObjVar(structure, VAR_ADMIN_LIST); - if (admin_list_as_strings != null) - { - - String[] new_admin_list = convertStringPermissionList(admin_list_as_strings); - if (new_admin_list != null) - { - if (new_admin_list.length > 0) - { - setObjVar(structure, VAR_ADMIN_LIST, new_admin_list); - } - else - { - removeObjVar(structure, VAR_ADMIN_LIST); - } - } - } - } - - obj_id[] hopper_list_as_objIds = getObjIdArrayObjVar(structure, VAR_HOPPER_LIST); - if (hopper_list_as_objIds != null) - { - - String[] new_hopper_list = convertObjIdPermissionList(hopper_list_as_objIds); - if (new_hopper_list != null) - { - if (new_hopper_list.length > 0) - { - setObjVar(structure, VAR_HOPPER_LIST, new_hopper_list); - } - else - { - removeObjVar(structure, VAR_HOPPER_LIST); - } - } - } - else - { - String[] hopper_list_as_strings = getStringArrayObjVar(structure, VAR_HOPPER_LIST); - if (hopper_list_as_strings != null) - { - - String[] new_hopper_list = convertStringPermissionList(hopper_list_as_strings); - if (new_hopper_list != null) - { - if (new_hopper_list.length > 0) - { - setObjVar(structure, VAR_HOPPER_LIST, new_hopper_list); - } - else - { - removeObjVar(structure, VAR_HOPPER_LIST); - } - } - } - } - - setObjVar(structure, VAR_PERMISSIONS_CONVERTED, 1); - } - else - { - - } - - return true; - } - - - public static String[] convertObjIdPermissionList(obj_id[] objId_list) throws InterruptedException - { - if (objId_list == null || objId_list.length < 1) - { - LOG("player_structure", "player_structure.objIdListToNameList -- obj_id_list is null or empty."); - return null; - } - - Vector new_name_list = new Vector(); - new_name_list.setSize(0); - for (int i = 0; i < objId_list.length; i++) - { - testAbortScript(); - if (!addPlayerObjIdToRawList( new_name_list, objId_list[i] )) - { - LOG("player_structure", "player_structure.convertObjIdPermissionList -- invalid object ID "+ objId_list[i].toString()); - } - } - - if (new_name_list.size() > 0) - { - return (String[])new_name_list.toArray(new String[0]); - } - else - { - return null; - } - } - - - public static String[] convertStringPermissionList(String[] name_list) throws InterruptedException - { - if (name_list == null || name_list.length < 1) - { - LOG("player_structure", "player_structure.objIdListToNameList -- obj_id_list is null or empty."); - return null; - } - - Vector new_name_list = new Vector(); - new_name_list.setSize(0); - for (int i = 0; i < name_list.length; i++) - { - testAbortScript(); - if (!addNameToRawList( new_name_list, name_list[i] )) - { - LOG("player_structure", "player_structure.convertStringPermissionList -- couldn't convert the name "+ name_list[i]); - } - } - - if (new_name_list.size() > 0) - { - return (String[])new_name_list.toArray(new String[0]); - } - else - { - return null; - } - } - - - public static float[] transformDeltaWorldCoord(float X, float Z, int rotation) throws InterruptedException - { - - float x = X; - float z = Z; - - switch(rotation) - { - case 0: - break; - case 1: - X = z; - Z = -x; - break; - case 2: - Z = -z; - X = -x; - break; - case 3: - X = -z; - Z = x; - break; - } - - float[] delta_world = - { - X, Z - }; - - return delta_world; - } - - - public static location transformDeltaWorldCoord(location here, float dx, float dz, float yaw) throws InterruptedException - { - yaw = yaw % 360f; - if (yaw < 0) - { - yaw += 360f; - } - - int rotation = java.lang.Math.round(yaw/90f); - float[] xz = transformDeltaWorldCoord(dx, dz, rotation); - if (xz != null & xz.length == 2) - { - location there = (location)here.clone(); - - there.x += xz[0]; - there.z += xz[1]; - - return there; - } - - return null; - } - - - public static boolean hasSign(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return false; - } - - return hasObjVar(structure, VAR_SIGN_ID); - } - - - public static boolean isPackedUp(obj_id structure) throws InterruptedException - { - obj_id container = getContainedBy(structure); - if (!isIdValid(container)) - { - return false; - } - - String template = getTemplateName(container); - return template.equals("object/intangible/house/generic_house_control_device.iff"); - } - - - public static obj_id createStructureSign(obj_id structure, float sYaw) throws InterruptedException - { - - if (!isIdValid(structure)) - { - return null; - } - - if (isPackedUp(structure)) - { - - return null; - } - - String structureTemplate = getTemplateName(structure); - - int needSign = dataTableGetInt(PLAYER_STRUCTURE_DATATABLE, structureTemplate, DATATABLE_COL_HAS_SIGN); - - if (needSign == 1) - { - destroyStructureSign(structure); - - location here = getLocation(structure); - - for (int x = 0; x < SIGN_TYPE.length; x++) - { - testAbortScript(); - obj_id[] nc = getAllObjectsWithTemplate(here, 64f, SIGN_TYPE[x]); - if (nc != null && nc.length > 0) - { - for (int i = 0; i < nc.length; i++) - { - testAbortScript(); - if (isObjectPersisted(nc[i]) && !utils.hasScriptVar(nc[i],"player_structure.parent")) - { - CustomerServiceLog("sign_destruction", "destroying sign "+ nc[i] + " whose name is '"+ getName(nc[i]) + "'"); - destroyObject(nc[i]); - } - } - } - } - - dictionary params = dataTableGetRow(TBL_SIGN, structureTemplate); - if ((params != null) && (!params.isEmpty())) - { - int signType = 0; - float x = params.getFloat("X"); - float y = params.getFloat("Y"); - float z = params.getFloat("Z"); - float heading = params.getFloat("HEADING"); - String signTemplate = params.getString("DEFAULT_SIGN"); - - String signName = "Unnamed Structure"; - - if (isCivic( structure )) - { - signName = utils.getStringName( structure ); - } - else - { - String[] admins = getAdminListNames(structure); - if ((admins != null) && (admins.length != 0)) - { - String admin_name = admins[0]; - if (admin_name != null) - { - if (structureTemplate.indexOf("guild") > -1) - { - signName = admin_name + "'s Guildhall"; - } - else if (structureTemplate.indexOf("barn") > -1) - { - signName = admin_name + "'s Barn"; - } - else if (structureTemplate.indexOf("diner") > -1) - { - signName = admin_name + "'s Diner"; - } - else if (structureTemplate.indexOf("cantina") > -1) - { - signName = admin_name + "'s Cantina"; - } - else if (structureTemplate.indexOf("hospital") > -1) - { - signName = admin_name + "'s Medical Center"; - } - else if (structureTemplate.indexOf("pgc_merchant_tent") > -1) - { - signName = admin_name + "'s Chronicles Tent"; - } - else if (structureTemplate.indexOf("merchant_tent") > -1) - { - signName = admin_name + "'s Merchant Tent"; - } - else if (structureTemplate.indexOf("theater") > -1) - { - signName = admin_name + "'s Theater"; - } - else if (structureTemplate.indexOf("garage") > -1) - { - signName = admin_name + "'s Garage"; - } - else - { - signName = admin_name + "'s House"; - } - } - else - { - if (structureTemplate.indexOf("guild") > -1) - { - signName = "Guildhall"; - } - else if (structureTemplate.indexOf("barn") > -1) - { - signName = admin_name + "Barn"; - } - else if (structureTemplate.indexOf("diner") > -1) - { - signName = admin_name + "Diner"; - } - else if (structureTemplate.indexOf("cantina") > -1) - { - signName = admin_name + "Cantina"; - } - else if (structureTemplate.indexOf("hospital") > -1) - { - signName = admin_name + "Medical Center"; - } - else if (structureTemplate.indexOf("pgc_merchant_tent") > -1) - { - signName = admin_name + "'s Chronicles Tent"; - } - else if (structureTemplate.indexOf("merchant_tent") > -1) - { - signName = admin_name + "Merchant Tent"; - } - else if (structureTemplate.indexOf("theater") > -1) - { - signName = "Theater"; - } - else if (structureTemplate.indexOf("garage") > -1) - { - signName = "Garage"; - } - - else - { - signName = "House"; - } - } - } - } - - if (hasObjVar(structure, VAR_SIGN_BASE)) - { - if (hasObjVar(structure, VAR_SIGN_NAME)) - { - String storedName = getStringObjVar(structure, VAR_SIGN_NAME); - if (storedName != null && !storedName.equals("")) - { - signName = storedName; - } - } - - if (hasObjVar(structure, VAR_SIGN_TYPE)) - { - signType = getIntObjVar(structure, VAR_SIGN_TYPE); - - if (structureTemplate.equals("object/building/player/player_house_mustafar_lg.iff") && hasObjVar(structure, VAR_ABANDONED)) - { - signType = 0; - } - - if (signType > 0) - { - signTemplate = SIGN_TYPE[signType]; - x = params.getFloat("ALT_X"); - y = params.getFloat("ALT_Y"); - z = params.getFloat("ALT_Z"); - heading = params.getFloat("ALT_HEADING"); - } - } - } - - location there = new location(here.x + x, here.y + y, here.z + z, here.area, here.cell); - - if (hasObjVar(structure, MODIFIED_HOUSE_SIGN)) - { - signTemplate = getStringObjVar(structure, MODIFIED_HOUSE_SIGN); - - if ((structureTemplate.equals("object/building/player/player_house_mustafar_lg.iff") && signTemplate.startsWith("object/tangible/sign/player/house_address") && !signTemplate.startsWith("object/tangible/sign/player/house_address_corellia"))) - { - - there.z -= 0.4f; - - z -= 0.4f; - } - - if (structureTemplate.equals("object/building/player/player_house_generic_large_style_01.iff")) - { - if ((signTemplate.startsWith("object/tangible/sign/player/shop_sign_") && !signTemplate.startsWith("object/tangible/sign/player/shop_sign_s0"))) - { - - there.z += 0.8f; - - z += 0.8f; - } - } - - if ((structureTemplate.startsWith("object/building/player/city/cantina_naboo") && signTemplate.startsWith("object/tangible/sign/player/house_address") && !signTemplate.startsWith("object/tangible/sign/municipal/municipal_sign_hanging_cantina"))) - { - - there.z += 0.3f; - - z += 0.3f; - } - - if ((structureTemplate.startsWith("object/building/player/city/cantina_corellia") && signTemplate.startsWith("object/tangible/sign/player/house_address") && !signTemplate.startsWith("object/tangible/sign/municipal/municipal_sign_hanging_cantina"))) - { - - there.z += 0.1f; - - z += 0.1f; - } - } - else if (hasObjVar(structure, SPECIAL_SIGN)) - { - signTemplate = getStringObjVar(structure, player_structure.SPECIAL_SIGN_TEMPLATE); - - if (signTemplate.startsWith("object/tangible/tcg/series5/house_sign_tcg_hanging")) - { - there.y += 1.5f; - y += 1.5f; - } - - if (signTemplate.startsWith("object/tangible/sign/player/pgc_sign_hanging.iff")) - { - - there.x -= 0.45f; - - x -= 0.45f; - - } - - if (structureTemplate.startsWith("object/building/player/player_merchant_tent")) - { - - if ((!signTemplate.startsWith("object/tangible/tcg/series3/house_sign_tcg_s02") && signTemplate.startsWith("object/tangible/tcg/"))) - { - - there.x -= 0.4f; - there.z -= 0.4f; - - x -= 0.4f; - z -= 0.4f; - } - - if (signTemplate.startsWith("object/tangible/tcg/series3/house_sign_tcg_s02")) - { - - there.x += 0.6f; - there.z += 0.1f; - - x += 0.6f; - z += 0.1f; - } - - if (signTemplate.startsWith("object/tangible/sign/player/house_address_halloween")) - { - - there.x -= 0.2f; - there.z -= 0.2f; - - x -= 0.2f; - z -= 0.2f; - } - - if ((signTemplate.startsWith("object/tangible/sign/player/imperial_empire_day_2009_sign_hanging") || signTemplate.startsWith("object/tangible/sign/player/rebel_remembrance_day_2009_sign_hanging"))) - { - - there.x -= 0.37f; - there.z -= 0.37f; - - x -= 0.37f; - z -= 0.37f; - } - - if ((signTemplate.startsWith("object/tangible/sign/player/imperial_empire_day_2009_sign_standing") || signTemplate.startsWith("object/tangible/sign/player/rebel_remembrance_day_2009_sign_standing"))) - { - - there.x += 0.6f; - there.z += 0.1f; - - x += 0.6f; - z += 0.1f; - } - } - - if (structureTemplate.startsWith("object/building/player/player_house_mustafar_lg")) - { - - if (signTemplate.startsWith("object/tangible/tcg/series3/house_sign_tcg_s01")) - { - - there.z -= 0.4f; - - z -= 0.4f; - } - - if ((signTemplate.startsWith("object/tangible/sign/player/imperial_empire_day_2009_sign_hanging") || signTemplate.startsWith("object/tangible/sign/player/rebel_remembrance_day_2009_sign_hanging"))) - { - - there.z -= 0.4f; - - z -= 0.4f; - } - - if (signTemplate.startsWith("object/tangible/tcg/series5/house_sign_tcg_hanging")) - { - - there.z -= 0.4f; - - z -= 0.4f; - } - } - - if (structureTemplate.startsWith("object/building/player/city/theater_corellia")) - { - - if (signTemplate.startsWith("object/tangible/tcg/series5/house_sign_tcg_hanging")) - { - there.x -= 0.4f; - x -= 0.4f; - } - } - - if (structureTemplate.startsWith("object/building/player/player_guildhall_corellia")) - { - - if (signTemplate.startsWith("object/tangible/tcg/series5/house_sign_tcg_hanging")) - { - there.z -= 0.4f; - there.y -= 0.1f; - z -= 0.4f; - y -= 0.1f; - } - } - - if ((structureTemplate.equals("object/building/player/player_house_generic_large_style_01.iff") || structureTemplate.equals("object/building/player/player_house_corellia_large_style_01.iff"))) - { - - if (signTemplate.startsWith("object/tangible/tcg/series5/house_sign_tcg_standing")) - { - there.z += 1.2f; - z += 1.2f; - } - - if ((signTemplate.startsWith("object/tangible/sign/player/rebel_remembrance_day_2009_sign_standing.iff") || signTemplate.startsWith("object/tangible/sign/player/imperial_empire_day_2009_sign_standing.iff"))) - { - there.z += 0.6f; - z += 0.6f; - } - - if ((signTemplate.startsWith("object/tangible/sign/player/rebel_remembrance_day_2009_sign_hanging.iff") || signTemplate.startsWith("object/tangible/sign/player/imperial_empire_day_2009_sign_hanging.iff"))) - { - there.z -= 0.3f; - z -= 0.3f; - } - - } - - if (structureTemplate.startsWith("object/building/player/player_house_generic_medium_windowed_s02.iff")) - { - - if (signTemplate.startsWith("object/tangible/tcg/series5/house_sign_tcg_hanging.iff")) - { - there.z -= 0.25f; - z -= 0.25f; - } - - if ((signTemplate.startsWith("object/tangible/sign/player/rebel_remembrance_day_2009_sign_hanging.iff") || signTemplate.startsWith("object/tangible/sign/player/imperial_empire_day_2009_sign_hanging.iff"))) - { - there.z -= 0.25f; - z -= 0.25f; - } - } - - if (signTemplate.startsWith("object/tangible/sign/player/pgc_sign_hanging.iff")) - { - if (structureTemplate.startsWith("object/building/player/player_house_naboo_small_style_02.iff")) - { - there.x += 0.5f; - x += 0.5f; - } - if (structureTemplate.startsWith("object/building/player/player_house_corellia_large_style_01.iff")) - { - heading += 90; - there.z -= 0.5f; - z -= 0.5f; - } - if ((structureTemplate.startsWith("object/building/player/player_house_corellia_large_style_02.iff") || structureTemplate.startsWith("object/building/player/player_house_corellia_small_style_02.iff") || structureTemplate.startsWith("object/building/player/player_house_corellia_small_style_02_floorplan_02.iff"))) - { - heading += 90; - there.z -= 0.1f; - z -= 0.1f; - } - if (structureTemplate.startsWith("object/building/player/player_house_corellia_medium_style_01.iff")) - { - heading += 90; - } - if ((structureTemplate.startsWith("object/building/player/player_house_corellia_small_style_01.iff") || structureTemplate.startsWith("object/building/player/player_house_corellia_small_style_01_floorplan_02.iff"))) - { - heading += 90; - there.x += 0.5f; - x += 0.5f; - } - if ((structureTemplate.startsWith("object/building/player/player_merchant_tent_style_01.iff") || structureTemplate.startsWith("object/building/player/player_merchant_tent_style_02.iff") || structureTemplate.startsWith("object/building/player/player_merchant_tent_style_03.iff"))) - { - heading += 10; - there.x += 0.3f; - there.z -= 0.1f; - x += 0.3f; - z -= 0.1f; - } - if (structureTemplate.startsWith("object/building/player/player_house_tatooine_large_style_01.iff")) - { - there.z -= 0.1f; - z -= 0.1f; - } - if (structureTemplate.startsWith("object/building/player/player_house_mustafar_lg.iff")) - { - heading += 180; - there.x -= 0.3f; - x -= 0.3f; - } - if ((structureTemplate.startsWith("object/building/player/player_house_generic_large_style_01.iff") || structureTemplate.startsWith("object/building/player/player_house_generic_large_style_02.iff") || structureTemplate.startsWith("object/building/player/player_house_generic_medium_style_02.iff") || structureTemplate.startsWith("object/building/player/player_house_generic_small_style_02.iff"))) - { - there.z += 0.2f; - z += 0.2f; - } - if (structureTemplate.startsWith("object/building/player/player_house_generic_medium_windowed_s02.iff")) - { - there.z -= 0.2f; - z -= 0.2f; - } - if (structureTemplate.startsWith("object/building/player/player_house_generic_small_style_01.iff")) - { - there.z += 0.2f; - there.x += 0.7f; - z += 0.2f; - x += 0.7f; - } - if (structureTemplate.startsWith("object/building/player/player_house_naboo_small_style_01.iff")) - { - heading -= 10; - there.x += 0.4f; - x += 0.4f; - } - if (structureTemplate.startsWith("object/building/player/player_house_generic_small_windowed.iff")) - { - there.x += 0.5f; - x += 0.5f; - } - if (structureTemplate.startsWith("object/building/player/player_house_generic_small_window_style_03.iff")) - { - there.x += 1; - there.z -= 0.2f; - x += 1; - z -= 0.2f; - } - if (structureTemplate.startsWith("object/building/player/player_house_naboo_small_window_style_01.iff")) - { - heading -= 12; - there.x += 0.6f; - x += 0.6f; - } - } - - if ((structureTemplate.startsWith("object/building/player/player_house_corellia_small_style_02_floorplan_02.iff") || structureTemplate.startsWith("object/building/player/player_house_corellia_small_style_02.iff") || structureTemplate.startsWith("object/building/player/player_house_tatooine_small_style_02.iff") || structureTemplate.startsWith("object/building/player/player_house_tatooine_large_style_01.iff"))) - { - - if ((signTemplate.startsWith("object/tangible/sign/player/rebel_remembrance_day_2009_sign_hanging.iff") || signTemplate.startsWith("object/tangible/sign/player/imperial_empire_day_2009_sign_hanging.iff"))) - { - there.z -= 0.2f; - z -= 0.2f; - } - } - - if (structureTemplate.startsWith("object/building/player/player_house_tcg_vehicle_garage.iff")) - { - if (( signTemplate.startsWith("object/tangible/tcg/series3/house_sign_tcg_s01.iff") || signTemplate.startsWith("object/tangible/sign/player/house_address_halloween_sign.iff") || signTemplate.startsWith("object/tangible/sign/player/imperial_empire_day_2009_sign_hanging.iff") || signTemplate.startsWith("object/tangible/sign/player/rebel_remembrance_day_2009_sign_hanging.iff") || signTemplate.startsWith("object/tangible/tcg/series5/house_sign_tcg_hanging.iff") || signTemplate.startsWith("object/tangible/sign/player/pgc_sign_hanging.iff"))) - { - heading += 90; - there.z -= 0.3f; - z -= 0.3f; - } - } - - if (structureTemplate.startsWith("object/building/player/player_house_tcg_vip_bunker.iff")) - { - if (( signTemplate.startsWith("object/tangible/tcg/series3/house_sign_tcg_s01.iff") || signTemplate.startsWith("object/tangible/sign/player/house_address_halloween_sign.iff") || signTemplate.startsWith("object/tangible/sign/player/imperial_empire_day_2009_sign_hanging.iff") || signTemplate.startsWith("object/tangible/sign/player/rebel_remembrance_day_2009_sign_hanging.iff") || signTemplate.startsWith("object/tangible/tcg/series5/house_sign_tcg_hanging.iff") || signTemplate.startsWith("object/tangible/sign/player/pgc_sign_hanging.iff"))) - { - heading += 90; - there.z += 0.3f; - z += 0.3f; - } - } - - if (structureTemplate.startsWith("object/building/player/player_house_tcg_commando_bunker.iff")) - { - if (( signTemplate.startsWith("object/tangible/tcg/series3/house_sign_tcg_s01.iff") || signTemplate.startsWith("object/tangible/sign/player/house_address_halloween_sign.iff") || signTemplate.startsWith("object/tangible/sign/player/imperial_empire_day_2009_sign_hanging.iff") || signTemplate.startsWith("object/tangible/sign/player/rebel_remembrance_day_2009_sign_hanging.iff") || signTemplate.startsWith("object/tangible/tcg/series5/house_sign_tcg_hanging.iff") || signTemplate.startsWith("object/tangible/sign/player/pgc_sign_hanging.iff"))) - { - heading += 90; - there.z -= 0.6f; - z -= 0.6f; - } - } - } - - location spawn = (location)there.clone(); - - if (sYaw != 0f) - { - location newspawn = transformDeltaWorldCoord(here, x, z, sYaw); - newspawn.y = there.y; - spawn = (location)newspawn.clone(); - - } - - if ((signTemplate != null) && (!signTemplate.equals(""))) - { - - obj_id sign = createObject(signTemplate, spawn); - if (isIdValid(sign)) - { - String preSignName = ""; - String postSignName = ""; - String viewSignName = signName; - if (isAbandoned( structure ) || isPreAbandoned( structure )) - { - int indexOfAbandonedText = signName.indexOf(ABANDONED_TEXT); - String filteredSignName = ""; - boolean foundAbandonedText = false; - - while (indexOfAbandonedText != -1) - { - testAbortScript(); - filteredSignName += signName.substring(0, indexOfAbandonedText); - signName = signName.substring(indexOfAbandonedText + ABANDONED_TEXT.length()); - indexOfAbandonedText = signName.indexOf(ABANDONED_TEXT); - foundAbandonedText = true; - } - - if (foundAbandonedText) - { - signName = filteredSignName + signName; - viewSignName = signName; - } - - postSignName = ABANDONED_TEXT; - - if (viewSignName.length() > 100) - { - viewSignName = viewSignName.substring(0, 99); - } - } - - if (isCityAbandoned(structure) && cityIsInactivePackupActive()) - { - int indexOfAbandonedText = signName.indexOf(CITY_ABANDONED_TEXT); - String filteredSignName = ""; - boolean foundAbandonedText = false; - - while (indexOfAbandonedText != -1) - { - testAbortScript(); - filteredSignName += signName.substring(0, indexOfAbandonedText); - signName = signName.substring(indexOfAbandonedText + CITY_ABANDONED_TEXT.length()); - indexOfAbandonedText = signName.indexOf(CITY_ABANDONED_TEXT); - foundAbandonedText = true; - } - - if (foundAbandonedText) - { - signName = filteredSignName + signName; - viewSignName = signName; - } - - postSignName = CITY_ABANDONED_TEXT; - - if (viewSignName.length() > 100) - { - viewSignName = viewSignName.substring(0, 99); - } - } - - setName(sign, preSignName + viewSignName + postSignName); - - setObjVar(structure, VAR_SIGN_ID, sign); - setObjVar(structure, VAR_SIGN_NAME, signName); - setObjVar(structure, VAR_SIGN_TYPE, signType); - - float tYaw = sYaw + heading; - if (tYaw != 0f) - { - - setYaw(sign, tYaw); - } - - utils.setScriptVar(sign, "player_structure.parent", structure); - return sign; - } - } - else - { - - } - } - else - { - - } - } - else - { - - } - - return null; - } - - - public static obj_id createStructureSign(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return null; - } - - float sYaw = getYaw(structure); - sYaw = (float)(Math.round(sYaw)); - - return createStructureSign(structure, sYaw); - } - - - public static void destroyStructureSign(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return; - } - - obj_id sign = getObjIdObjVar(structure, VAR_SIGN_ID); - if (isIdValid(sign) && exists(sign)) - { - destroyObject(sign); - } - - removeObjVar(structure, VAR_SIGN_ID); - } - - - public static float powerInstallation(obj_id bldg, obj_id energon) throws InterruptedException - { - - if (!isIdValid(bldg) || !isIdValid(energon)) - { - - return -1f; - } - - int energonGOT = getGameObjectType(energon); - if (isGameObjectTypeOf(energonGOT, GOT_resource_container)) - { - - return -1f; - } - - int bldgGOT = getGameObjectType(bldg); - if (!isGameObjectTypeOf(bldgGOT, GOT_installation)) - { - - return -1f; - } - - obj_id rId = getResourceContainerResourceType(energon); - if (!isIdValid(rId)) - { - - return -1f; - } - - if (!isResourceDerivedFrom(rId, "energy") || !isResourceDerivedFrom(rId, "radioactive")) - { - - return -1f; - } - - int amt = resource.getPotentialEnergyValue(energon); - if (amt > 0f) - { - - return powerInstallation(bldg, amt); - } - - return -1f; - } - - - public static float powerInstallation(obj_id bldg, int amt) throws InterruptedException - { - if (!isIdValid(bldg) || (amt <= 0f)) - { - return -1f; - } - - incrementPowerValue(bldg, amt); - return getPowerValue(bldg); - } - - - public static void validateHarvestedResources(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return; - } - - if (utils.hasScriptVar(structure, "validatedResources")) - { - return; - } - - if (!isHarvester(structure) && !isGenerator(structure)) - { - return; - } - - String listPath = "resource"; - if (hasObjVar(structure, listPath)) - { - obj_var_list ovl = getObjVarList(structure, listPath); - if (ovl != null) - { - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - obj_var ov = ovl.getObjVar(i); - if (ov != null) - { - String ovName = ov.getName(); - obj_id rId = utils.stringToObjId(ovName); - if (!isValidResourceId(rId)) - { - - float amt = ov.getFloatData(); - - String mType = getHarvesterMasterResource(structure); - if (mType != null && !mType.equals("")) - { - obj_id newId = pickRandomNonDepeletedResource(mType); - if (isIdValid(newId)) - { - setObjVar(structure, "resource."+ newId, amt); - } - else - { - CustomerServiceLog("trade","bad resouce found in installation #"+ structure + " and the system was unable to find a suitable replacement!"); - CustomerServiceLog("trade","installation #"+ structure + " report: bad resource id = "+ ovName + " amt = "+ Math.round(amt)); - } - } - else - { - CustomerServiceLog("trade","bad resouce found in installation #"+ structure + " and the system was unable to determine a suitable resource type for replacement!"); - CustomerServiceLog("trade","installation #"+ structure + " report: bad resource id = "+ ovName + " amt = "+ Math.round(amt)); - } - - removeObjVar(structure, listPath + "."+ ovName); - } - } - } - } - } - - utils.setScriptVar(structure, "validatedResources", true); - } - - - public static String getHarvesterMasterResource(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return null; - } - - if (!isHarvester(structure) && !isGenerator(structure)) - { - return null; - } - - String template = getTemplateName(structure); - if (template == null || template.equals("")) - { - return null; - } - - if (isHarvester(structure)) - { - if (template.indexOf("mining_ore") > -1) - { - return "mineral"; - } - - if (template.indexOf("mining_gas") > -1) - { - return "gas"; - } - - if (template.indexOf("mining_liquid") > -1) - { - if (template.indexOf("moisture") > -1) - { - return "water"; - } - - return "chemical"; - } - - if (template.indexOf("mining_organic") > -1) - { - if (template.indexOf("creature") > -1) - { - return "creature_resources"; - } - - return "flora_resources"; - } - } - else if (isGenerator(structure)) - { - if (template.indexOf("fusion") > -1) - { - return "radioactive"; - } - - if (template.indexOf("solar") > -1) - { - return "energy_renewable_unlimited_solar"; - } - - if (template.indexOf("wind") > -1) - { - return "energy_renewable_unlimited_wind"; - } - } - - return null; - } - - - public static boolean canReclaimDeed(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return false; - } - - String template = getTemplateName(structure); - return canReclaimDeed(template); - } - - - public static boolean canReclaimDeed(String structureTemplate) throws InterruptedException - { - if (structureTemplate == null || structureTemplate.equals("")) - { - return false; - } - - return dataTableGetInt(PLAYER_STRUCTURE_DATATABLE, structureTemplate, "CAN_RECLAIM") == 1; - } - - - public static void showChangeSignSui(obj_id structure, obj_id player) throws InterruptedException - { - if (!isIdValid(structure) || !isIdValid(player)) - { - return; - } - - int skillmod = getSkillStatMod(player, "shop_sign"); - if (skillmod < 1) - { - return; - } - - Vector entries = new Vector(); - entries.setSize(0); - for (int i = 0; i <= skillmod; i++) - { - testAbortScript(); - if (i < SIGN_NAMES.length) - { - entries = utils.addElement(entries, utils.packStringId(SIGN_NAMES[i])); - } - else - { - break; - } - } - - if (entries != null && entries.size() > 0) - { - String prompt = "@player_structure:changesign_prompt"; - String title = "@player_structure:changesign_title"; - sui.listbox(structure, player, prompt, sui.OK_CANCEL, title, entries, "handleChangeSignSui"); - } - } - - - public static String getStructureName(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return null; - } - - if (isBuilding(structure) && hasObjVar(structure, VAR_SIGN_NAME)) - { - String signName = getStringObjVar(structure, VAR_SIGN_NAME); - if (signName != null && !signName.equals("")) - { - return signName; - } - } - - return utils.getStringName(structure); - } - - - public static boolean canPlaceGarage(location loc, float range, String template) throws InterruptedException - { - - if (1 == dataTableGetInt(player_structure.PLAYER_STRUCTURE_DATATABLE, template, "GARAGE")) - { - obj_id check = getFirstObjectWithTemplate(loc, range, template); - if (check != null) - { - return false; - } - } - - return true; - - } - - - public static boolean hasMaintenanceDroid(obj_id player) throws InterruptedException - { - obj_id[] datapad = getContents(utils.getPlayerDatapad(player)); - - for (int i = 0; i < datapad.length; i++) - { - testAbortScript(); - if (hasObjVar(datapad[i], "module_data.struct_maint")) - { - return true; - } - } - - return false; - } - - - public static obj_id[] getMaintenanceDroids(obj_id player) throws InterruptedException - { - Vector droids = new Vector(); - droids.setSize(0); - obj_id[] datapad = getContents(utils.getPlayerDatapad(player)); - - for (int i = 0; i < datapad.length; i++) - { - testAbortScript(); - if (hasObjVar(datapad[i], "module_data.struct_maint")) - { - droids = utils.addElement(droids, datapad[i]); - } - } - - obj_id[] _droids = new obj_id[0]; - if (droids != null) - { - _droids = new obj_id[droids.size()]; - droids.toArray(_droids); - } - return _droids; - } - - - public static void flagConverted(String template, obj_id structure) throws InterruptedException - { - - if (template.indexOf( "_guildhall_" ) != -1) - { - - setObjVar(structure, "newBuilding", true ); - setObjVar(structure, "newBuildPartTwo", true ); - } - else if (template.indexOf( "structure_factory" ) != -1) - { - - setObjVar(structure, "newBuilding", true ); - setObjVar(structure, "newBuildPartTwo", true ); - } - else if (template.indexOf( "player_house_" ) != -1) - { - if (template.indexOf( "_large_style_" ) != -1) - { - setObjVar(structure, "newBuilding", true ); - setObjVar(structure, "newBuildPartTwo", true ); - } - } - } - - - public static int convertLotCosts(obj_id structure, String template, int struct_lots) throws InterruptedException - { - if (!hasObjVar(structure, "newBuilding" ) || !hasObjVar(structure, "newBuildPartTwo" )) - { - - if (template.indexOf( "_guildhall_" ) != -1) - { - - if (template.indexOf("_guildhall_tatooine_") == -1) - { - - struct_lots = 9; - } - else - { - - struct_lots = 7; - } - } - else if (template.indexOf( "structure_factory" ) != -1) - { - - struct_lots = 2; - } - else if (template.indexOf( "player_house_" ) != -1) - { - if (template.indexOf( "_large_style_" ) != -1) - { - - struct_lots = 6; - } - } - } - return struct_lots; - } - - - public static void doOldToNewLotConversion(obj_id player, obj_id structure) throws InterruptedException - { - if (!isOwner(structure, player)) - { - return; - } - - if (!hasObjVar(structure, "newBuilding" )) - { - String template = getTemplateName(structure); - - if (template.indexOf( "_guildhall_" ) != -1) - { - - if (template.indexOf("_guildhall_tatooine_") == -1) - { - - adjustLotCount(getPlayerObject(player), -4); - setObjVar(structure, "newBuilding", true ); - setObjVar(structure, "newBuildPartTwo", true ); - } - else - { - - adjustLotCount(getPlayerObject(player), -2); - setObjVar(structure, "newBuilding", true ); - setObjVar(structure, "newBuildPartTwo", true ); - } - } - else if (template.indexOf( "structure_factory" ) != -1) - { - - adjustLotCount(getPlayerObject(player), -1); - setObjVar(structure, "newBuilding", true ); - } - else if (template.indexOf( "player_house_" ) != -1) - { - if (template.indexOf( "_large_style_" ) != -1) - { - - adjustLotCount(getPlayerObject(player), -1); - setObjVar(structure, "newBuilding", true ); - setObjVar(structure, "newBuildPartTwo", true ); - } - } - } - else if (!hasObjVar(structure, "newBuildPartTwo" )) - { - String template = getTemplateName(structure); - - if (template.indexOf( "_guildhall_" ) != -1) - { - - adjustLotCount(getPlayerObject(player), -2); - setObjVar(structure, "newBuildPartTwo", true ); - } - else if (template.indexOf( "player_house_" ) != -1) - { - if (template.indexOf( "_large_style_" ) != -1) - { - - adjustLotCount(getPlayerObject(player), -1); - setObjVar(structure, "newBuildPartTwo", true ); - } - } - } - } - - - public static void adjustLotsForOfflinePlayer(obj_id owner, obj_id structure) throws InterruptedException - { - dictionary params = new dictionary(); - - if (!hasObjVar(structure, "newBuilding" )) - { - String template = getTemplateName(structure); - - if (template.indexOf( "_guildhall_" ) != -1) - { - - if (template.indexOf("_guildhall_tatooine_") == -1) - { - - params.put( "lotAdjust", -4 ); - setObjVar(structure, "newBuilding", true ); - setObjVar(structure, "newBuildPartTwo", true ); - messageTo( owner, "handleAdjustLotCount", params, 0, true ); - } - else - { - - params.put( "lotAdjust", -2 ); - setObjVar(structure, "newBuilding", true ); - setObjVar(structure, "newBuildPartTwo", true ); - messageTo( owner, "handleAdjustLotCount", params, 0, true ); - } - } - else if (template.indexOf( "structure_factory" ) != -1) - { - - params.put( "lotAdjust", -1 ); - setObjVar(structure, "newBuilding", true ); - setObjVar(structure, "newBuildPartTwo", true ); - messageTo( owner, "handleAdjustLotCount", params, 0, true ); - } - else if (template.indexOf( "player_house_" ) != -1) - { - if (template.indexOf( "_large_style_" ) != -1) - { - - params.put( "lotAdjust", -1 ); - setObjVar(structure, "newBuilding", true ); - setObjVar(structure, "newBuildPartTwo", true ); - messageTo( owner, "handleAdjustLotCount", params, 0, true ); - } - } - } - else if (!hasObjVar(structure, "newBuildPartTwo" )) - { - String template = getTemplateName(structure); - - if (template.indexOf( "_guildhall_" ) != -1) - { - - params.put( "lotAdjust", -2 ); - setObjVar(structure, "newBuildPartTwo", true ); - messageTo( owner, "handleAdjustLotCount", params, 0, true ); - } - else if (template.indexOf( "player_house_" ) != -1) - { - if (template.indexOf( "_large_style_" ) != -1) - { - - params.put( "lotAdjust", -1 ); - setObjVar(structure, "newBuildPartTwo", true ); - messageTo( owner, "handleAdjustLotCount", params, 0, true ); - } - } - } - } - - - public static void doCondemnedSui(obj_id objStructure, obj_id objItem) throws InterruptedException - { - - obj_id objOwner = getStructureOwnerObjId(objStructure); - - LOG("test", "objOwner is "+objOwner+" and item is "+objItem); - if (isPlayer(objItem)) - { - if (objOwner == objItem || player_structure.isAdmin(objStructure, objItem)) - { - int intRepairCost = getStructureRepairCost(objStructure); - int intBankCredits = getBankBalance(objItem); - - if (intRepairCost <= intBankCredits) - { - - String strTitle = "@player_structure:fix_condemned_title"; - string_id strPrompt = new string_id(STF_FILE, "structure_condemned_owner_has_credits"); - String strConfirm = "@player_structure:confirm_pay"; - prose_package pp = new prose_package(); - prose.setStringId(pp, strPrompt); - prose.setDI(pp, intRepairCost); - - int pid = sui.msgbox(objStructure, objItem, pp, sui.OK_CANCEL, strTitle, "payCondemnedFees"); - - if (pid > -1) - { - - showSUIPage(pid); - } - return; - } - else - { - string_id strSpam = new string_id(STF_FILE, "structure_condemned_owner_no_credits"); - prose_package pp = new prose_package(); - prose.setStringId(pp, strSpam); - prose.setDI(pp, intRepairCost); - sendSystemMessageProse(objItem, pp); - return; - } - } - else - { - string_id strSpam = new string_id(STF_FILE, "structure_condemned_not_owner"); - sendSystemMessage(objItem, strSpam); - return; - } - - } - - } - - - public static int getStructureRepairCost(obj_id structure) throws InterruptedException - { - - int condition = getStructureCondition(structure); - int max_condition = getMaxCondition(structure); - int damage = max_condition - condition; - int maint_pool = getBankBalance(structure); - - float per_point_cost = getBaseMaintenanceRate( structure ) / 3.0f; - - int repair_cost = (int)(damage * per_point_cost); - return repair_cost; - } - - - public static boolean isStructureCondemned(obj_id objStructure) throws InterruptedException - { - return hasObjVar(objStructure, "player_structure.condemned"); - - } - - - public static void sendCondemnedMail(obj_id objStructure) throws InterruptedException - { - obj_id objOwner = getOwner(objStructure); - String strName = getPlayerName(objOwner); - string_id strSubject = new string_id(STF_FILE, "structure_condemned_subject"); - string_id strBody = new string_id(STF_FILE, "structure_condemned_body"); - int intRepairCost = getStructureRepairCost(objStructure); - location loc = getLocation(objStructure); - String area = loc.area; - if (area != null) - { - area = area.substring(0,1).toUpperCase() + area.substring(1); - } - String loc_str = "("+ loc.x + ", "+ loc.z + " "+ loc.area + ")"; - - prose_package pp = new prose_package(); - - prose.setStringId(pp, strBody); - - prose.setTO(pp, loc_str); - prose.setTT(pp, objStructure); - prose.setDI(pp, intRepairCost); - - utils.sendMail(strSubject, pp, strName , "@player_structure:management"); - return; - } - - public static int getMaintenanceHeartbeat() throws InterruptedException - { - final int MAINTENANCE_HEARTBEAT = 1800; - String strConfigSetting = getConfigSetting("GameServer", "maintenanceHeartbeat"); - if ((strConfigSetting != null)&&(!strConfigSetting.equals(""))) - { - int intHeartBeat = utils.stringToInt(strConfigSetting); - if (intHeartBeat > 0) - { - return intHeartBeat; - } - } - return MAINTENANCE_HEARTBEAT; - - } - - public static void sendOutOfMaintenanceMail(obj_id objStructure) throws InterruptedException - { - - obj_id objOwner = getOwner(objStructure); - String strName = getPlayerName(objOwner); - string_id strSubject = new string_id(STF_FILE, "structure_maintenance_empty_subject"); - string_id strBody = new string_id(STF_FILE, "structure_maintenance_empty_body"); - - location loc = getLocation(objStructure); - String area = loc.area; - if (area != null) - { - area = area.substring(0,1).toUpperCase() + area.substring(1); - } - String loc_str = "("+ loc.x + ", "+ loc.z + " "+ loc.area + ")"; - - prose_package pp = new prose_package(); - prose.setStringId(pp, strBody); - prose.setTO(pp, loc_str); - prose.setTT(pp, objStructure); - - String strTest = getString(strSubject); - - strTest = getString(strBody); - - utils.sendMail(strSubject, pp, strName , "@player_structure:management"); - return; - } - - - public static boolean isFactionPerkBase(String objectTemplateName) throws InterruptedException - { - return objectTemplateName.indexOf ("object/building/faction_perk/hq/") != -1; - } - - - public static boolean isFactionPerkBaseDeed(obj_id objDeed) throws InterruptedException - { - return isFactionPerkBaseDeed(getTemplateName(objDeed)); - - } - - public static boolean isFactionPerkBaseDeed(String deedObjectTemplateName) throws InterruptedException - { - return deedObjectTemplateName.indexOf ("object/tangible/deed/faction_perk/hq/") != -1; - } - - - public static boolean canPlaceFactionPerkDeed(obj_id objDeed, obj_id objPlayer) throws InterruptedException - { - final float CHECK_RANGE = 600f; - final int BASES_ALLOWED = 3; - if (player_structure.isFactionPerkBaseDeed(objDeed)) - { - location locTest = getLocation(objPlayer); - obj_id[] objBases = getAllObjectsWithScript(locTest, CHECK_RANGE, "faction_perk.hq.loader"); - if ((objBases != null)&&(objBases.length >= BASES_ALLOWED)) - { - string_id strSpam = new string_id("gcw", "too_many_bases"); - sendSystemMessage(objPlayer, strSpam); - return false; - } - } - return true; - } - - - public static int validateHopperSize(obj_id structureObject) throws InterruptedException - { - int objvar_hopper = 0; - - if (!isIdValid(structureObject)) - { - return 0; - } - - String templateName = getTemplateName(structureObject); - - if (templateName == null || templateName.length() <= 0) - { - return 0; - } - - dictionary dict = utils.dataTableGetRow(PLAYER_STRUCTURE_VALIDATION_DATATABLE, templateName); - - if (dict == null) - { - return -1; - } - - int minHopper = dataTableGetInt(PLAYER_STRUCTURE_VALIDATION_DATATABLE, templateName, DATATABLE_COL_HOPPER_MIN); - int maxHopper = dataTableGetInt(PLAYER_STRUCTURE_VALIDATION_DATATABLE, templateName, DATATABLE_COL_HOPPER_MAX); - - if (minHopper <= 0 || maxHopper <= 0) - { - return 0; - } - - if (hasObjVar(structureObject, VAR_DEED_MAX_HOPPER)) - { - objvar_hopper = getIntObjVar(structureObject, VAR_DEED_MAX_HOPPER); - } - else - { - objvar_hopper = (minHopper + maxHopper) / 2; - - return objvar_hopper; - } - - if (objvar_hopper <= minHopper) - { - objvar_hopper = (minHopper + maxHopper) / 2; - } - - if (objvar_hopper > HARVESTER_MAX_HOPPER_SIZE) - { - objvar_hopper = HARVESTER_MAX_HOPPER_SIZE; - } - - return objvar_hopper; - } - - - public static boolean doesUnmarkedStructureQualifyForHousePackup(obj_id structure) throws InterruptedException - { - if (!isBuilding(structure) && !isInstallation(structure)) - { - return false; - } - - if (isInstallation(structure) && !isFactory(structure)) - { - return false; - } - - if (isCivic(structure)) - { - return false; - } - - String templateName = getTemplateName(structure); - - if (templateName == null || isFactionPerkBase(templateName)) - { - return false; - } - - return true; - } - - - public static boolean needsPreAbandonCheck(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return false; - } - - if (!utils.checkConfigFlag("GameServer", "enableHousePackup")) - { - return false; - } - - if (isAbandoned(structure) || isPreAbandoned(structure)) - { - return true; - } - - if (!doesUnmarkedStructureQualifyForHousePackup(structure)) - { - return false; - } - - return true; - } - - - public static boolean needsAbandonCheck(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - return false; - } - - if (!utils.checkConfigFlag("GameServer", "enableAbandonedHousePackup")) - { - return false; - } - - if (isPreAbandoned(structure) || isAbandoned(structure)) - { - return true; - } - - if (!doesUnmarkedStructureQualifyForHousePackup(structure)) - { - return false; - } - - return true; - } - - - public static boolean needsCityAbandonCheck(obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - LOG("sissynoid", "Failed 'needsCityAbandonedCheck - Invalid STructure"); - return false; - } - if (!cityIsInactivePackupActive()) - { - LOG("sissynoid", "Failed 'needsCityAbandonedCheck - cityIsInactivePackupActive Config Inactive"); - return false; - } - if (!doesUnmarkedStructureQualifyForHousePackup(structure)) - { - LOG("sissynoid", "Failed 'needsCityAbandonedCheck - Structure is unpackable"); - return false; - } - - location loc = getLocation(structure); - int city_id = getCityAtLocation(loc, 0); - if (!cityExists(city_id)) - { - LOG("sissynoid", "Failed 'needsCityAbandonedCheck - No City Exists at this Location"); - return false; - } - return true; - } - - - public static String getStructureInfo(obj_id structure) throws InterruptedException - { - final String yes = "Y|"; - final String no = "N|"; - final String blank = "|"; - - final String templateName = getTemplateName(structure); - final obj_id ownerId = getOwner(structure); - - String result = "|"+ structure + "|"+ ownerId + "|"+ templateName + "|"; - - result += needsPreAbandonCheck(structure) ? yes : no; - - result += needsAbandonCheck(structure) ? yes : no; - - result += doesUnmarkedStructureQualifyForHousePackup(structure) ? yes : no; - - result += isIdValid(structure) ? yes : no; - - result += isAccountQualifiedForHousePackup(ownerId) ? yes : no; - - result += isBuilding(structure) ? yes : no; - - result += isInstallation(structure) ? yes : no; - - result += isFactory(structure) ? yes : no; - - result += isFactionPerkBase(templateName) ? yes : no; - - result += isCivic(structure) ? yes : no; - - result += isInWorld(structure) ? yes : no; - - result += isInWorldCell(structure) ? yes : no; - - if (hasObjVar(structure, VAR_CIVIC)) - { - result += getIntObjVar(structure, VAR_CIVIC) + "|"; - } - else - { - result += blank; - } - - if (hasObjVar(structure, VAR_ABANDONED)) - { - result += getIntObjVar(structure, VAR_ABANDONED); - } - else - { - result += blank; - } - - if (hasObjVar(structure, VAR_LAST_MAINTANENCE)) - { - result += getIntObjVar(structure, VAR_LAST_MAINTANENCE) + "|"; - } - else - { - result += blank; - } - - return result; - } - - - public static boolean isEliteHarvester(obj_id structure) throws InterruptedException - { - if (isIdValid(structure)) - { - String templateName = getTemplateName(structure); - if (templateName.endsWith("_style_4.iff") || templateName.endsWith("_elite.iff")) - { - return true; - } - } - return false; - } - - - public static boolean canShowPackOption(obj_id player, obj_id structure) throws InterruptedException - { - if (!isIdValid(structure) || !isIdValid(player)) - { - return false; - } - - if (!utils.checkConfigFlag("GameServer", "allowPlayersToPackAbandonedStructures")) - { - return false; - } - - if (!player_structure.isAbandoned(structure)) - { - return false; - } - - if (utils.isFreeTrial(player)) - { - return false; - } - - if (!isCommoditiesServerAvailable()) - { - return false; - } - - return true; - } - - - public static boolean canPlayerPackAbandonedStructure(obj_id player, obj_id structure) throws InterruptedException - { - if (!canShowPackOption(player, structure)) - { - return false; - } - - if (isAtPendingLoadRequestLimit()) - { - return false; - } - - if (!player.isLoaded() || !player.isAuthoritative()) - { - return false; - } - - if (!structure.isLoaded() || !structure.isAuthoritative()) - { - return false; - } - - return true; - } - - - public static boolean canPackStructureWithVendors(obj_id player, obj_id structure) throws InterruptedException - { - final boolean hasVendors = hasVendors(structure); - - if (hasVendors && !vendor_lib.isVendorPackUpEnabled()) - { - sendSystemMessage(player, new string_id("sui", "cant_pack_vendors")); - return false; - } - - if (hasVendors && !isCommoditiesServerAvailable()) - { - sendSystemMessage(player, new string_id("sui", "cannot_pack_now")); - return false; - } - - return true; - } - - - public static void packAbandonedBuilding(obj_id player, obj_id structure, dictionary params) throws InterruptedException - { - - if (hasObjVar(player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR)) - { - int resetTime = getIntObjVar(player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR); - if (getGameTime() >= resetTime) - { - removeObjVar(player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR); - removeObjVar(player, HOUSE_PACKUP_DAILY_TALLY_OBJVAR); - - params.put("structure", structure); - messageTo(player, "msgFinalizePackup", params, 0, false); - return; - } - } - - if (!hasObjVar(player, HOUSE_PACKUP_DAILY_TALLY_OBJVAR)) - { - params.put("structure", structure); - messageTo(player, "msgFinalizePackup", params, 0, false); - return; - } - - int dailyHousePacking = getIntObjVar (player, HOUSE_PACKUP_DAILY_TALLY_OBJVAR); - if (dailyHousePacking < 0) - { - dailyHousePacking = 0; - } - if (dailyHousePacking > MAX_PACKUP_PER_DAY) - { - dailyHousePacking = MAX_PACKUP_PER_DAY; - } - - if (dailyHousePacking < MAX_PACKUP_PER_DAY) - { - - if (!hasObjVar (player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR)) - { - removeObjVar (player, HOUSE_PACKUP_DAILY_TALLY_OBJVAR); - } - - params.put("structure", structure); - messageTo(player, "msgFinalizePackup", params, 0, false); - return; - } - - else if (!canPackMoreToday(player)) - { - - if (!hasObjVar (player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR)) - { - int resetTime = getGameTime() + TIME_TO_NEXT_PACKUP; - blog("packAbandonedBuilding - resetting time to next packup: "+resetTime); - - setObjVar(player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR, resetTime); - } - - int timeLeft = getIntObjVar (player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR); - timeLeft -= getGameTime(); - String displayTime = utils.assembleTimeRemainToUse(timeLeft, false); - string_id stringId = new string_id("spam", "wait_twenty_four"); - prose_package p = new prose_package(); - prose.setStringId(p, stringId); - prose.setDI(p, MAX_PACKUP_PER_DAY); - prose.setTT(p, displayTime); - commPlayers(player, "object/mobile/dressed_hiddendagger_pilot_m_01.iff", "sound/sys_comm_other.snd", 5f, player, p); - messageTo(player, "handleFailedStructurePackup", null, 0, false); - - messageTo(player, "handlePlayerStructurePackupLockoutRemoval", null, 0, false); - - } - - else - { - blog("player_structure.packAbandonedBuilding I HAVER FALLEN THROUGH THE NORMAL CONDITIONS!!!!"); - - removeObjVar (player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR); - removeObjVar (player, HOUSE_PACKUP_DAILY_TALLY_OBJVAR); - messageTo (structure, "packAbandonedBuilding", params, 4, false); - } - } - - - public static boolean canPackMoreToday(obj_id player) throws InterruptedException - { - blog("canPackMoreToday - Init."); - if (!isIdValid(player)) - { - return false; - } - - if (!hasObjVar(player, HOUSE_PACKUP_DAILY_TALLY_OBJVAR)) - { - blog("canPackMoreToday - Player has no tally at all and can pack more."); - return true; - } - blog("canPackMoreToday - Player has pack up DAILY TALLY objvar"); - - if (!hasObjVar (player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR)) - { - blog("canPackMoreToday - The Player CAN PACK MORE"); - return true; - } - - blog("canPackMoreToday - Player has pack up DAILY TIMER objvar"); - - int dailyHousePacking = getIntObjVar (player, HOUSE_PACKUP_DAILY_TALLY_OBJVAR); - if (dailyHousePacking < 0) - { - CustomerServiceLog("playerStructure","House Pack Up - Player "+ player + "("+ getName(player) + ") had an INVALID pack up tally amount of less than zero. We are correcting by setting to ZERO"); - dailyHousePacking = 0; - } - blog("canPackMoreToday - Player has dailyHousePacking: "+dailyHousePacking); - - if (dailyHousePacking > MAX_PACKUP_PER_DAY) - { - dailyHousePacking = MAX_PACKUP_PER_DAY; - } - - blog("canPackMoreToday - Player has dailyHousePacking: "+MAX_PACKUP_PER_DAY); - - if (dailyHousePacking < MAX_PACKUP_PER_DAY) - { - blog("canPackMoreToday - The Player CAN PACK MORE"); - return true; - } - - blog("canPackMoreToday - the player has met or exceeded the MAX_PACKUP_PER_DAY but we need to check to make sure that wasn't yesterday's timer."); - int resetTime = getIntObjVar (player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR); - blog("canPackMoreToday - timer resetTime: "+resetTime); - blog("canPackMoreToday - timer resetTime - gameTime: "+(resetTime - getGameTime())); - if (resetTime - getGameTime() <= 0) - { - blog("canPackMoreToday - timer has expired."); - return true; - - } - blog("canPackMoreToday - timer has not expired."); - return false; - } - - - public static boolean isPlayerGatedFromHousePackUp(obj_id player) throws InterruptedException - { - blog("player_structure.isPlayerGatedFromHousePackUp init"); - if (!isValidId(player) || !exists(player)) - { - return true; - } - - blog("player_structure.isPlayerGatedFromHousePackUp is calling canPackMoreToday(player)"); - - boolean canPackMore = canPackMoreToday(player); - boolean playerLockedOut = isPlayerLockedOutOfHousePackup(player); - - if (canPackMore && !playerLockedOut) - { - blog("player_structure.isPlayerGatedFromHousePackUp - canPackMoreToday(player) && !utils.hasScriptVar(player, SCRIPTVAR_HOUSE_PACKUP_LOCKOUT_TIME)"); - - return false; - } - else if (playerLockedOut && canPackMore) - { - - blog("player_structure.isPlayerLockedOutOfHousePackup PLAYER HAS BEEN LOCKED OUT"); - - int timeNeeded = utils.getIntScriptVar(player, SCRIPTVAR_HOUSE_PACKUP_LOCKOUT_TIME) + (int)HOUSE_PACKUP_LOCKOUT_TIMER; - int timeNow = getGameTime(); - - blog("player_structure.isPlayerLockedOutOfHousePackup timeNeeded: "+timeNeeded); - blog("player_structure.isPlayerLockedOutOfHousePackup timeNow: "+timeNow); - blog("player_structure.isPlayerLockedOutOfHousePackup timeNow - timeNeeded: "+(timeNow - timeNeeded)); - int timeDiff = timeNeeded - timeNow; - if (timeDiff <= 0) - { - blog("player_structure.isPlayerLockedOutOfHousePackup THE LOCK OUT TIME EXPIRED ALREADY"); - - messageTo(player, "handlePlayerStructurePackupLockoutRemoval", null, 0, false); - return false; - } - - String timeMessage = utils.formatTimeVerbose(timeDiff); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_LOCKOUT_MESSAGE); - pp = prose.setTO(pp, timeMessage); - sendSystemMessageProse(player, pp); - } - else if (!canPackMore) - { - blog("player_structure.isPlayerGatedFromHousePackUp - !canPackMoreToday(player)"); - - if (!hasObjVar (player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR)) - { - int resetTime = getGameTime() + TIME_TO_NEXT_PACKUP; - blog("isPlayerGatedFromHousePackUp - resetting time to next packup: "+resetTime); - setObjVar(player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR, resetTime); - } - - int timeLeft = getIntObjVar (player, HOUSE_PACKUP_DAILY_TIMER_OBJVAR); - timeLeft -= getGameTime(); - String displayTime = utils.assembleTimeRemainToUse(timeLeft, false); - string_id stringId = new string_id("spam", "wait_twenty_four"); - prose_package p = new prose_package(); - prose.setStringId(p, stringId); - prose.setDI(p, MAX_PACKUP_PER_DAY); - prose.setTT(p, displayTime); - commPlayers(player, "object/mobile/dressed_hiddendagger_pilot_m_01.iff", "sound/sys_comm_other.snd", 5f, player, p); - messageTo(player, "handleFailedStructurePackup", null, 0, false); - - messageTo(player, "handlePlayerStructurePackupLockoutRemoval", null, 0, false); - } - return true; - } - - - public static boolean isPlayerLockedOutOfHousePackup(obj_id player) throws InterruptedException - { - blog("player_structure.isPlayerLockedOutOfHousePackup init"); - - if (!isValidId(player) || !exists(player)) - { - return true; - } - - if (utils.hasScriptVar(player, SCRIPTVAR_HOUSE_PACKUP_LOCKOUT_TIME)) - { - return true; - } - - blog("player_structure.isPlayerLockedOutOfHousePackup FALSE........FALSE on LOCKOUT"); - - return false; - } - - - public static int getTotalIncreasedStorageAmountStructure(obj_id structure) throws InterruptedException - { - if (isIdValid(structure)) - { - if (hasObjVar(structure, OBJVAR_STRUCTURE_STORAGE_INCREASE)) - { - return getIntObjVar(structure, OBJVAR_STRUCTURE_STORAGE_INCREASE); - } - } - - return 0; - } - - - public static boolean validSafeStorageRemoval(obj_id structure, int decreaseAmount) throws InterruptedException - { - int numItems = player_structure.getStructureNumItems(structure); - int baseItemLimit = getPobBaseItemLimit(structure); - int storageIncreased = getTotalIncreasedStorageAmountStructure(structure); - - int projectedAmount = baseItemLimit + (storageIncreased - decreaseAmount); - - if ((numItems > projectedAmount) || (projectedAmount < baseItemLimit)) - { - return false; - } - - return true; - } - - - public static boolean incrementStorageAmount(obj_id player, obj_id structure, obj_id deed, int increaseAmount) throws InterruptedException - { - if (isIdValid(structure) && increaseAmount > 0) - { - - int baseStorageIncrease = getTotalIncreasedStorageAmountStructure(structure); - - int newStrucStorage = baseStorageIncrease + increaseAmount; - - if (newStrucStorage > STORAGE_AMOUNT_CAP) - { - sendSystemMessage (player, MSG_STORAGE_OVER_CAP); - return false; - } - - if (newStrucStorage > baseStorageIncrease) - { - setObjVar(structure, OBJVAR_STRUCTURE_STORAGE_INCREASE, newStrucStorage); - if (isNonGenericLootItem(deed)) - { - setNonGenericStorageIncreaseOfTypeObjVar(structure, deed, increaseAmount); - } - return true; - } - } - return false; - } - - - public static boolean decrementStorageAmount(obj_id player, obj_id structure, obj_id terminal, int selectedRedeedTypeIndex) throws InterruptedException - { - if (isIdValid(structure) && isIdValid(terminal)) - { - String crate = "item_storage_increase_05_03"; - if (utils.hasScriptVar(terminal, "storageTypeNamesRef")) - { - String[] storageTypeNamesArrayRef = utils.getStringBatchScriptVar(terminal, "storageTypeNamesRef"); - crate = storageTypeNamesArrayRef[selectedRedeedTypeIndex]; - } - int decreaseAmount = STORAGE_AMOUNT_DECREASE_UNIT; - String nonGenericStorageTypeObjVar = NON_GENERIC_STORAGE_ITEM_OBJVAR+"."+crate; - if (hasObjVar(structure, nonGenericStorageTypeObjVar)) - { - decreaseAmount = getIntObjVar(structure, nonGenericStorageTypeObjVar); - } - - int baseStorageIncrease = getTotalIncreasedStorageAmountStructure(structure); - - int newStrucStorage = baseStorageIncrease - decreaseAmount; - - if (newStrucStorage >= 0 && validSafeStorageRemoval(structure, decreaseAmount)) - { - obj_id pInv = utils.getInventoryContainer(player); - - if (!isIdValid(pInv)) - { - return false; - } - - static_item.createNewItemFunction(crate, pInv); - removeNonGenericStorageIncreaseOfTypeObjVar(structure, crate); - - if (newStrucStorage == 0) - { - - removeObjVar(structure, OBJVAR_STRUCTURE_STORAGE_INCREASE); - return true; - } - - setObjVar(structure, OBJVAR_STRUCTURE_STORAGE_INCREASE, newStrucStorage); - return true; - } - else - { - sendSystemMessage(player, new string_id("player_structure", "storage_item_cannot_remove")); - player_structure.displayAvailableNonGenericStorageTypes(player, terminal, structure); - } - } - return false; - } - - - public static boolean isNonGenericLootItem(obj_id deed) throws InterruptedException - { - return hasObjVar(deed, "nonGenericStorageItem"); - } - - - public static boolean alreadyHasNonGenericStorageIncreaseOfType(obj_id structure, obj_id deed) throws InterruptedException - { - String deedType = getStaticItemName(deed); - String nonGenericStorageTypeObjVar = NON_GENERIC_STORAGE_ITEM_OBJVAR+"."+deedType; - return hasObjVar(structure, nonGenericStorageTypeObjVar); - } - - - public static void setNonGenericStorageIncreaseOfTypeObjVar(obj_id structure, obj_id deed, int increaseAmount) throws InterruptedException - { - String deedType = getStaticItemName(deed); - String nonGenericStorageTypeObjVar = NON_GENERIC_STORAGE_ITEM_OBJVAR+"."+deedType; - setObjVar(structure, nonGenericStorageTypeObjVar, increaseAmount); - return; - } - - - public static void removeNonGenericStorageIncreaseOfTypeObjVar(obj_id structure, String type) throws InterruptedException - { - String nonGenericStorageTypeObjVar = NON_GENERIC_STORAGE_ITEM_OBJVAR+"."+type; - if (hasObjVar(structure, nonGenericStorageTypeObjVar)) - { - removeObjVar(structure, nonGenericStorageTypeObjVar); - } - return; - } - - - public static void displayAvailableNonGenericStorageTypes(obj_id player, obj_id terminal, obj_id structure) throws InterruptedException - { - if (utils.hasScriptVar(player, "structureStorageRedeedPid")) - { - int oldSui = utils.getIntScriptVar(player, "structureStorageRedeedPid"); - forceCloseSUIPage(oldSui); - } - - String[] storageTypeNamesArrayRef = getStorageTypeNamesArray(structure); - - if (!hasObjVar(structure, NON_GENERIC_STORAGE_ITEM_OBJVAR)) - { - if (validSafeStorageRemoval(structure, STORAGE_AMOUNT_DECREASE_UNIT)) - { - handleStorageReclaimConfirmation(player, terminal); - } - else - { - sendSystemMessage(player, new string_id("sui", "storage_item_count_over_base")); - } - } - else - { - String title = utils.packStringId(new string_id("player_structure", "sui_storage_nongeneric_redeed_title")); - String prompt = utils.packStringId(new string_id("player_structure","sui_storage_nongeneric_redeed_prompt")); - - String[] storageTypeNamesArrayStrings = new String[storageTypeNamesArrayRef.length]; - for (int i = 0; i < storageTypeNamesArrayRef.length; i++) - { - testAbortScript(); - String nonGenericStorateType = storageTypeNamesArrayRef[i]; - - int decreaseAmount = STORAGE_AMOUNT_DECREASE_UNIT; - String nonGenericStorageTypeObjVar = NON_GENERIC_STORAGE_ITEM_OBJVAR+"."+nonGenericStorateType; - if (hasObjVar(structure, nonGenericStorageTypeObjVar)) - { - decreaseAmount = getIntObjVar(structure, nonGenericStorageTypeObjVar); - } - - if (validSafeStorageRemoval(structure, decreaseAmount)) - { - storageTypeNamesArrayStrings[i] = utils.packStringId(new string_id("static_item_n", nonGenericStorateType)); - } - else - { - - String greyedOut = utils.packStringId(new string_id("static_item_n", nonGenericStorateType)); - string_id contrastText_sid = new string_id("faction_recruiter","rank_list_empty"); - prose_package pp = prose.getPackage(contrastText_sid); - prose.setTO(pp, greyedOut); - storageTypeNamesArrayStrings[i] = "\0" + packOutOfBandProsePackage(null, pp); - } - } - - int newSui = sui.listbox(terminal, player, prompt, sui.OK_CANCEL, title, storageTypeNamesArrayStrings, "handleStorageRedeedChoice"); - utils.setScriptVar(player, "structureStorageRedeedPid", newSui); - } - - utils.setBatchScriptVar(terminal, "storageTypeNamesRef", storageTypeNamesArrayRef); - return; - } - - - public static String[] getStorageTypeNamesArray(obj_id structure) throws InterruptedException - { - Vector storageIncreaseTypes = new Vector(); - storageIncreaseTypes.setSize(0); - int totalNonGenericStorageIncrease = 0; - - if (hasObjVar(structure, NON_GENERIC_STORAGE_ITEM_OBJVAR)) - { - obj_var_list nonGenericStorageObjvarList = getObjVarList(structure, NON_GENERIC_STORAGE_ITEM_OBJVAR); - if (nonGenericStorageObjvarList != null) - { - int numItem = nonGenericStorageObjvarList.getNumItems(); - for (int i = 0; i < numItem; i++) - { - testAbortScript(); - obj_var nonGenericStorageObjvar = nonGenericStorageObjvarList.getObjVar(i); - String nonGenericStorageObjvarName = nonGenericStorageObjvar.getName(); - totalNonGenericStorageIncrease = totalNonGenericStorageIncrease + nonGenericStorageObjvar.getIntData(); - - if (nonGenericStorageObjvarName != null && nonGenericStorageObjvarName.length() > 0) - { - storageIncreaseTypes = utils.addElement(storageIncreaseTypes, nonGenericStorageObjvarName); - } - } - } - } - - if (getTotalIncreasedStorageAmountStructure(structure) > totalNonGenericStorageIncrease) - { - storageIncreaseTypes = utils.addElement(storageIncreaseTypes, "item_storage_increase_05_03"); - } - - return (String[])storageIncreaseTypes.toArray(new String[0]); - } - - - public static boolean handleStorageReclaimConfirmation(obj_id player, obj_id terminal) throws InterruptedException - { - String title = utils.packStringId(new string_id("player_structure", "sui_storage_redeed_title")); - String prompt = utils.packStringId(new string_id("player_structure", "sui_storage_redeed_prompt")); - sui.msgbox(terminal, player, prompt, sui.YES_NO, title, "handleStorageRedeedChoice"); - - return false; - } - - - public static boolean canRotateFurnitureInPitchRollAxes(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - return hasCompletedCollection(player, "force_shui_tier_02"); - } - - - public static boolean isPlayerStructure(obj_id target) throws InterruptedException - { - if (!isValidId(target) || !exists(target)) - { - return false; - } - - if (!isBuilding(target)) - { - return false; - } - - if (!hasObjVar(target, "player_structure")) - { - return false; - } - - String template = getTemplateName(target); - if (template == null || template.equals("")) - { - return false; - } - - if (!template.startsWith("object/building/player/")) - { - return false; - } - - if (!isGameObjectTypeOf(target, GOT_building_player)) - { - return false; - } - - return true; - } - - - public static boolean hasSpecialSignSkillMod(obj_id player, obj_id structure) throws InterruptedException - { - blog("player_structure.hasSpecialSignSkillMod: init"); - - if (!isValidId(player) || !exists(player)) - { - return false; - } - - boolean owner = isOwner(structure, player); - - blog("player_structure.hasSpecialSignSkillMod: initial validation passes"); - - String[] specialSignSkillMods = dataTableGetStringColumn(TBL_SPECIAL_SIGNS, "skillmod_name"); - int[] adminSpecialSign = dataTableGetIntColumn(TBL_SPECIAL_SIGNS, "admin_placement"); - - if (specialSignSkillMods == null || specialSignSkillMods.length <= 0) - { - return false; - } - - blog("player_structure.hasSpecialSignSkillMod: about to test each of the special signs to see if I have the necessary skill mods."); - - for (int i = 0; i < specialSignSkillMods.length; i++) - { - testAbortScript(); - if (getSkillStatMod(player, specialSignSkillMods[i]) <= 0) - { - continue; - } - - if (!owner && adminSpecialSign[i] == 0) - { - continue; - } - - blog("player_structure.hasSpecialSignSkillMod: Found a skill mod I have: "+specialSignSkillMods[i]); - return true; - } - - return false; - } - - - public static boolean getSpecialSignList(obj_id player, obj_id structure) throws InterruptedException - { - blog("player_structure.getSpecialSignList: init"); - - if (!isValidId(player) || !exists(player)) - { - return false; - } - - boolean owner = isOwner(structure, player); - - blog("player_structure.getSpecialSignList: initial validation passes"); - - String[] specialSignSkillMods = dataTableGetStringColumn(TBL_SPECIAL_SIGNS, "skillmod_name"); - String[] specialSignTemplates = dataTableGetStringColumn(TBL_SPECIAL_SIGNS, "sign_template"); - String[] specialSignNames = dataTableGetStringColumn(TBL_SPECIAL_SIGNS, "string_mapping"); - int[] adminSpecialSign = dataTableGetIntColumn(TBL_SPECIAL_SIGNS, "admin_placement"); - - if (specialSignSkillMods == null || specialSignSkillMods.length <= 0) - { - return false; - } - else if (specialSignTemplates == null || specialSignTemplates.length <= 0) - { - return false; - } - else if (specialSignSkillMods.length != specialSignTemplates.length) - { - return false; - } - - Vector allSignTemplates = new Vector(); - allSignTemplates.setSize(0); - Vector allSignStrings = new Vector(); - allSignStrings.setSize(0); - - blog("player_structure.getSpecialSignList: about to test each of the special signs to see if I have the necessary skill mods."); - - for (int i = 0; i < specialSignSkillMods.length; i++) - { - testAbortScript(); - if (getSkillStatMod(player, specialSignSkillMods[i]) <= 0) - { - continue; - } - - if (!owner && adminSpecialSign[i] <= 0) - { - continue; - } - - blog("player_structure.getSpecialSignList: Found a skill mod I have: "+specialSignSkillMods[i]); - utils.addElement(allSignTemplates, specialSignTemplates[i]); - utils.addElement(allSignStrings, "@"+specialSignNames[i]); - } - - if (allSignTemplates.size() <= 0) - { - return false; - } - if (allSignStrings.size() <= 0) - { - return false; - } - - String[] signList = new String[allSignTemplates.size()]; - allSignTemplates.toArray(signList); - - String[] signName = new String[allSignStrings.size()]; - allSignStrings.toArray(signName); - - utils.setScriptVar(player, VAR_SPECIAL_SIGN_LIST, signList); - utils.setScriptVar(player, VAR_SPECIAL_SIGN_NAMES, signName); - return true; - } - - - public static boolean removeSpecialSign(obj_id player, obj_id structure, boolean revertMessage) throws InterruptedException - { - blog("player_structure.removeSpecialSign - init"); - - if (!isValidId(player) || !isValidId(structure)) - { - return false; - } - - if (hasObjVar(structure, MODIFIED_HOUSE_SIGN_MODEL)) - { - revertCustomSign(player, structure); - return true; - } - - boolean owner = isOwner(structure, player); - if (hasObjVar(structure, SPECIAL_SIGN_OWNER_ONLY)) - { - boolean needsOwnerToRemove = getBooleanObjVar(structure, SPECIAL_SIGN_OWNER_ONLY); - if (!owner && needsOwnerToRemove) - { - sendSystemMessage(player, SID_ONLY_OWNER_CAN_REMOVE); - return false; - } - } - - String skillmod = getStringObjVar(structure, SPECIAL_SIGN_SKILLMOD); - if (skillmod == null || skillmod.length() <= 0) - { - return false; - } - blog("player_structure.removeSpecialSign - validation completed"); - - String skillmodRecovery = getStringObjVar(structure, SPECIAL_SIGN_SKILLMOD); - - boolean ownerOnlyRecovery = false; - if (hasObjVar(structure, SPECIAL_SIGN_OWNER_ONLY) && getBooleanObjVar(structure, SPECIAL_SIGN_OWNER_ONLY)) - { - ownerOnlyRecovery = true; - } - - String signTemplateRecovery = getStringObjVar(structure, SPECIAL_SIGN_TEMPLATE); - int signTypeRecovery = 0; - if (hasObjVar(structure, VAR_SIGN_TYPE)) - { - signTypeRecovery = getIntObjVar(structure, VAR_SIGN_TYPE); - } - - if (signTemplateRecovery == null || signTemplateRecovery.length() <= 0 || signTypeRecovery <= -1) - { - blog("player_structure.removeSpecialSign - signTemplateRecovery failed"); - sendSystemMessage(player, SID_SPECIAL_SIGN_FAILED); - CustomerServiceLog("playerStructure","Special Sign could not be removed and replaced with default sign on structure "+ structure + ". The player: "+player+". Reason: signTemplateRecovery failed."); - return false; - } - - removeObjVar(structure, SPECIAL_SIGN); - removeObjVar(structure, SPECIAL_SIGN_TEMPLATE); - removeObjVar(structure, VAR_SIGN_TYPE); - removeObjVar(structure, SPECIAL_SIGN_SKILLMOD); - removeObjVar(structure, SPECIAL_SIGN_OWNER_ONLY); - - if (!isValidId(player_structure.createStructureSign(structure))) - { - setObjVar(structure, SPECIAL_SIGN, true); - setObjVar(structure, SPECIAL_SIGN_TEMPLATE, signTemplateRecovery); - setObjVar(structure, VAR_SIGN_TYPE, signTypeRecovery); - setObjVar(structure, VAR_SIGN_TYPE, skillmodRecovery); - setObjVar(structure, SPECIAL_SIGN_OWNER_ONLY, ownerOnlyRecovery); - - blog("player_structure.removeSpecialSign - Default Sign Creation failed!!!!!!!!!!!!!!!!!"); - sendSystemMessage(player, SID_SPECIAL_SIGN_FAILED); - CustomerServiceLog("playerStructure","Special Sign could not be removed and replaced with default sign on structure "+ structure + ". The player: "+player+". Reason: createStructureSign failed."); - return false; - } - - if (hasObjVar(structure, SPECIAL_SIGN_DECREMENT_MOD)) - { - if (!applySkillStatisticModifier(player, skillmod, 1)) - { - blog("player_structure.removeSpecialSign - Applying skillmod failed!!!!!!!!!!!!!!!!!"); - CustomerServiceLog("playerStructure","Player: "+player+" attempted to remove special sign from structure: "+ structure + ". During the destroy process the skillmod: "+ skillmod + " failed to be reimbursed so the process was aborted."); - sendSystemMessage(player, SID_SPECIAL_SIGN_FAILED); - return false; - } - removeObjVar(structure, player_structure.SPECIAL_SIGN_DECREMENT_MOD); - } - blog("player_structure.removeSpecialSign - skillmod reimbursed and default sign created"); - if (revertMessage) - { - sendSystemMessage(player, SID_SPECIAL_SIGN_REVERT_SUCCESS); - } - - CustomerServiceLog("playerStructure","Player: "+player+" removed special sign from structure: "+ structure + ". During the destroy process the skillmod: "+ skillmod + " was reimbursed."); - return true; - } - - - public static boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } - - - public static void revertCustomSign(obj_id player, obj_id structure) throws InterruptedException - { - blog("revertCustomSign - revertCustomSign init"); - player_structure.destroyStructureSign(structure); - removeObjVar(structure, player_structure.MODIFIED_HOUSE_SIGN); - String customSign = getStringObjVar(structure, player_structure.MODIFIED_HOUSE_SIGN_MODEL); - String newSign = ""; - - blog("revertCustomSign - customSign: "+customSign); - - if (customSign.equals("item_event_halloween_house_sign")) - { - blog("revertCustomSign - customSign: item_event_halloween_house_sign "+customSign); - - newSign = "item_special_sign_halloween_hanging_sign"; - } - else if (customSign.equals("item_event_halloween_house_sign_standing")) - { - blog("revertCustomSign - customSign: item_event_halloween_house_sign_standing "+customSign); - - newSign = "item_special_sign_halloween_standing_sign"; - } - - if (newSign == null || newSign.length() <= 0) - { - blog("revertCustomSign - customSign: FAIL!!!!!!!!!!!"); - - obj_id sign = static_item.createNewItemFunction(customSign, player); - if (isValidId(sign)) - { - CustomerServiceLog("playerStructure","Player: "+player+" attempted to remove their old Galactic Moon Festival Sign: "+customSign+" from structure: "+structure+" but it failed to update to the new special sign system. The player was reimbursed with the old sign object: "+sign+"."); - } - else - { - CustomerServiceLog("playerStructure","Player: "+player+" attempted to remove their old Galactic Moon Festival Sign: "+customSign+" from structure: "+structure+" but it failed to update to the new special sign system. The player was reimbursed with the old sign object: "+sign+"."); - } - } - else - { - blog("revertCustomSign - customSign: SUCCESS: "+newSign); - - obj_id sign = static_item.createNewItemFunction(newSign, player); - if (isValidId(sign)) - { - blog("revertCustomSign - customSign: Object ID: "+sign); - - CustomerServiceLog("playerStructure","Player: "+player+" remove their old Galactic Moon Festival Sign: "+customSign+" from structure: "+structure+" and received a new skillmod sign object: "+sign+"."); - sendSystemMessage(player, SID_HALLOWEEN_SIGN_UPDATED); - } - else - { - blog("revertCustomSign - customSign: Object COULD NOT BE CREATED"); - - CustomerServiceLog("playerStructure","Player: "+player+" attempted to remove their old Galactic Moon Festival Sign: "+customSign+" from structure: "+structure+" but it failed to update to the new special sign system. The player was reimbursed with the old sign object: "+sign+"."); - } - } - removeObjVar(structure, player_structure.MODIFIED_HOUSE_SIGN_MODEL); - player_structure.createStructureSign(structure); - } - - - public static void initializeFindAllItemsInHouse(obj_id self, obj_id player) throws InterruptedException - { - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - - showFindItemsListboxPage(self, player, 0); - return; - } - - - public static void initializeItemSearchInHouse(obj_id self, obj_id player) throws InterruptedException - { - String title = utils.packStringId(new string_id("player_structure", "find_items_search_keyword_title")); - String prompt = getString(new string_id("player_structure","find_items_search_keyword_prompt")); - int pid = sui.inputbox(self, player, prompt, sui.OK_CANCEL, title, sui.INPUT_NORMAL, null, "handlePlayerStructureSearchItemsGetKeyword"); - if (pid > -1) - { - sui.showSUIPage(pid); - - utils.setScriptVar(player, "findItems.pid", pid); - } - - return; - } - - - public static void showFindItemsListboxPage(obj_id self, obj_id player, int startingIndex) throws InterruptedException - { - - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - - Vector myItemsInBuilding = getMyItemsInBuilding(player); - - if (myItemsInBuilding != null && myItemsInBuilding.size() > 0) - { - int totalNumItems = myItemsInBuilding.size(); - if (totalNumItems <= 49) - { - startingIndex = 0; - } - - int endingIndex = startingIndex + 49; - if (endingIndex >= totalNumItems) - { - endingIndex = totalNumItems - 1; - } - - String[] itemsPageNamesList = new String[(endingIndex + 1) - startingIndex]; - obj_id[] itemsPageList = new obj_id[(endingIndex + 1) - startingIndex]; - - int j = 0; - for (int i = startingIndex; i <= endingIndex; i++) - { - testAbortScript(); - obj_id item = ((obj_id)(myItemsInBuilding.get(i))); - String itemName = getEncodedName(item); - - itemsPageNamesList[j] = itemName; - itemsPageList[j] = item; - - ++j; - } - - showFindItemsListboxSui(self, player, startingIndex, totalNumItems, itemsPageList, itemsPageNamesList); - } - else - { - sendSystemMessage(player, new string_id("player_structure", "find_items_no_items_found")); - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - } - - return; - } - - - public static void repeatFindItemsListboxPage(obj_id self, obj_id player, int startingIndex, int totalNumItems, obj_id[] itemsPageList) throws InterruptedException - { - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - - String[] itemsPageNamesList = new String[itemsPageList.length]; - for (int i = 0; i < itemsPageList.length; i++) - { - testAbortScript(); - obj_id item = itemsPageList[i]; - String itemName = getEncodedName(item); - itemsPageNamesList[i] = itemName; - } - - showFindItemsListboxSui(self, player, startingIndex, totalNumItems, itemsPageList, itemsPageNamesList); - return; - } - - - public static void showFindItemsListboxSui(obj_id self, obj_id player, int startingIndex, int totalNumItems, obj_id[] itemsPageList, String[] itemsPageNamesList) throws InterruptedException - { - String title = utils.packStringId(new string_id("player_structure", "find_items_title")); - String prompt = utils.packStringId(new string_id("player_structure", "find_items_prompt")); - - prompt += target_dummy.addLineBreaks(2); - prompt += target_dummy.ORANGE + "Number of Items Found: "+ target_dummy.WHITE + totalNumItems; - - int endingIndex = startingIndex + 49; - if (endingIndex >= totalNumItems) - { - endingIndex = totalNumItems - 1; - } - prompt += target_dummy.addLineBreaks(1); - prompt += target_dummy.ORANGE + "Displaying Items: "+ target_dummy.WHITE + (startingIndex+1) + " through "+ (endingIndex+1); - - int pid = sui.listbox(self, player, prompt, sui.OK_CANCEL_REFRESH, title, itemsPageNamesList, "handlePlayerStructureFindItemsListResponse"); - if (pid > -1) - { - if (totalNumItems > 50) - { - sui.listboxUseOtherButton(pid, "Change Page"); - } - else - { - sui.listboxUseOtherButton(pid, "Refresh Page"); - } - - sui.setSUIProperty(pid, sui.LISTBOX_BTN_OK, sui.PROP_TEXT,"Retrieve Object"); - sui.showSUIPage(pid); - - utils.setScriptVar(player, "findItems.pid", pid); - utils.setScriptVar(player, "findItems.startingIndex", startingIndex); - utils.setScriptVar(player, "findItems.totalNumItems", totalNumItems); - utils.setScriptVar(self, "findItems.itemsPageList", itemsPageList); - } - - return; - } - - - public static Vector getMyItemsInBuilding(obj_id player) throws InterruptedException - { - Vector myItemsInBuilding = new Vector(); - myItemsInBuilding.setSize(0); - - location here = getLocation(player); - obj_id myCell = here.cell; - if (isIdValid(myCell)) - { - obj_id building = getContainedBy(myCell); - if (isIdValid(building)) - { - obj_id buildingOwner = getOwner(building); - if ((isIdValid(buildingOwner) && player == buildingOwner) || isGod(player)) - { - obj_id[] cellList = getContents(building); - if (cellList != null && cellList.length > 0) - { - for (int i = 0; i < cellList.length; i++) - { - testAbortScript(); - obj_id buildingCell = cellList[i]; - if (getTemplateName(buildingCell).equals(structure.TEMPLATE_CELL)) - { - addPlayerItemsFromContainerToList(buildingCell, player, myItemsInBuilding); - } - } - } - } - else - { - sendSystemMessage(player, new string_id("player_structure", "find_items_not_building_owner")); - } - } - else - { - sendSystemMessage(player, new string_id("player_structure", "find_items_not_in_a_cell")); - } - } - else - { - sendSystemMessage(player, new string_id("player_structure", "find_items_not_in_a_building")); - } - - if (myItemsInBuilding.size() > 0) - { - return myItemsInBuilding; - } - - return null; - } - - - public static void addPlayerItemsFromContainerToList(obj_id container, obj_id player, Vector myItemsInBuilding) throws InterruptedException - { - obj_id[] contents = getContents(container); - if (contents != null && contents.length > 0) - { - for (int j = 0; j < contents.length; j++) - { - testAbortScript(); - obj_id thing = contents[j]; - if (isIdValid(thing)) - { - boolean isValidPlayerOwnedObject = true; - - obj_id thingOwner = getOwner(thing); - if (player != thingOwner && !isGod(player)) - { - isValidPlayerOwnedObject = false; - } - - if (!isObjectPersisted(thing)) - { - isValidPlayerOwnedObject = false; - } - - if (isPlayer(thing)) - { - isValidPlayerOwnedObject = false; - } - - if (isMob(thing)) - { - isValidPlayerOwnedObject = false; - } - - obj_id ship = space_transition.getContainingShip(thing); - if (isIdValid(ship)) - { - obj_id lootBox = obj_id.NULL_ID; - if (hasObjVar(ship, "objLootBox")) - { - lootBox = getObjIdObjVar(ship, "objLootBox"); - } - - if (isIdValid(lootBox) && lootBox == thing) - { - isValidPlayerOwnedObject = false; - } - } - - if (hasCondition(thing, CONDITION_VENDOR)) - { - isValidPlayerOwnedObject = false; - } - - if (isValidPlayerOwnedObject) - { - if (getContainerType(thing) != 0 && getGameObjectType(thing) != GOT_misc_factory_crate) - { - addPlayerItemsFromContainerToList(thing, player, myItemsInBuilding); - } - - utils.addElement(myItemsInBuilding, thing); - } - } - } - } - } - - - public static boolean moveItemInBuildingToPlayer(obj_id player, obj_id selectedItem) throws InterruptedException - { - location here = getLocation(player); - obj_id myCell = here.cell; - if (isIdValid(myCell)) - { - obj_id building = getContainedBy(myCell); - if (isIdValid(building)) - { - obj_id buildingOwner = getOwner(building); - if ((isIdValid(buildingOwner) && player == buildingOwner) || isGod(player)) - { - if (exists(selectedItem)) - { - if (!utils.isNestedWithinAPlayer(selectedItem)) - { - obj_id itemTopMost = getTopMostContainer(selectedItem); - obj_id myTopMost = getTopMostContainer(player); - if (itemTopMost == myTopMost) - { - obj_id topNonCellContainer = getTopNonCellContainer(selectedItem); - - String itemName = getEncodedName(selectedItem); - String containerName = getEncodedName(topNonCellContainer); - string_id message = new string_id("player_structure", "find_items_item_moved"); - if (topNonCellContainer != selectedItem) - { - message = new string_id("player_structure", "find_items_item_container_moved"); - } - prose_package pp = prose.getPackage(message); - prose.setTO(pp, itemName); - prose.setTT(pp, containerName); - sendQuestSystemMessage(player, pp); - - setLocation(topNonCellContainer, here); - return true; - } - else - { - sendSystemMessage(player, new string_id("player_structure", "find_items_failed_not_in_same_building")); - } - } - else - { - if (utils.isNestedWithin(selectedItem, player)) - { - sendSystemMessage(player, new string_id("player_structure", "find_items_failed_nested_within_you")); - } - else - { - sendSystemMessage(player, new string_id("player_structure", "find_items_failed_nested_within_other_player")); - } - } - } - else - { - sendSystemMessage(player, new string_id("player_structure", "find_items_failed_no_longer_exists")); - } - } - else - { - sendSystemMessage(player, new string_id("player_structure", "find_items_failed_not_owner")); - } - } - else - { - sendSystemMessage(player, new string_id("player_structure", "find_items_failed_uncontained_cell")); - } - } - else - { - sendSystemMessage(player, new string_id("player_structure", "find_items_failed_not_outside")); - } - - return false; - } - - - public static obj_id getTopNonCellContainer(obj_id item) throws InterruptedException - { - obj_id container = getContainedBy(item); - if (!isIdValid(container)) - { - - return item; - } - else if (getTemplateName(container).equals(structure.TEMPLATE_CELL)) - { - - return item; - } - else - { - - return getTopNonCellContainer(container); - } - } - - - public static void cleanupFindItemScriptVars(obj_id target) throws InterruptedException - { - utils.removeScriptVarTree(target, "findItems"); - return; - } - - - public static void handleFindItemsListResponse(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return; - } - - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return; - } - - int button = sui.getIntButtonPressed(params); - if (button == sui.BP_CANCEL) - { - sendSystemMessage(player, new string_id("player_structure", "find_items_search_cancelled")); - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - return; - } - - int startingIndex = utils.getIntScriptVar(player, "findItems.startingIndex"); - int totalNumItems = utils.getIntScriptVar(player, "findItems.totalNumItems"); - - obj_id[] itemsPageList = utils.getObjIdArrayScriptVar(self, "findItems.itemsPageList"); - if (itemsPageList == null || itemsPageList.length < 1) - { - sendSystemMessage(player, new string_id("player_structure", "find_items_no_items_found")); - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - return; - } - - if (button == sui.BP_REVERT) - { - if (totalNumItems > 50) - { - - String title = utils.packStringId(new string_id("player_structure", "find_items_page_title")); - String prompt = ""; - - int pid = sui.createSUIPage(sui.SUI_MSGBOX, self, player, "handlePlayerStructureFindItemsPageResponse"); - if (startingIndex == 0) - { - if (pid > -1) - { - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, title); - prompt = utils.packStringId(new string_id("player_structure", "find_items_page_next_prompt")); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, prompt); - - sui.msgboxButtonSetup(pid, sui.YES_NO); - setSUIProperty(pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, "Next Page"); - setSUIProperty(pid, sui.MSGBOX_BTN_CANCEL, sui.PROP_TEXT, "Cancel"); - - sui.showSUIPage(pid); - } - } - else if (startingIndex + 50 >= totalNumItems) - { - if (pid > -1) - { - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, title); - prompt = utils.packStringId(new string_id("player_structure", "find_items_page_previous_prompt")); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, prompt); - - sui.msgboxButtonSetup(pid, sui.YES_NO); - setSUIProperty(pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, "Previous Page"); - setSUIProperty(pid, sui.MSGBOX_BTN_CANCEL, sui.PROP_TEXT, "Cancel"); - - utils.setScriptVar(player, "findItems.lastPage", 1); - - sui.showSUIPage(pid); - } - } - else - { - if (pid > -1) - { - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, title); - prompt = utils.packStringId(new string_id("player_structure", "find_items_page_next_previous_prompt")); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, prompt); - - sui.msgboxButtonSetup(pid, sui.YES_NO_CANCEL); - setSUIProperty(pid, sui.MSGBOX_BTN_REVERT, sui.PROP_TEXT, "Previous Page"); - setSUIProperty(pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, "Next Page"); - setSUIProperty(pid, sui.MSGBOX_BTN_CANCEL, sui.PROP_TEXT, "Cancel"); - - setSUIProperty(pid, sui.MSGBOX_BTN_REVERT, "OnPress", "RevertWasPressed=1\r\nparent.btnOk.press=t"); - subscribeToSUIProperty(pid, sui.MSGBOX_BTN_REVERT, "RevertWasPressed"); - - sui.showSUIPage(pid); - } - } - } - else - { - repeatFindItemsListboxPage(self, player, startingIndex, totalNumItems, itemsPageList); - } - - return; - } - - int item_selected = sui.getListboxSelectedRow(params); - if (item_selected < 0) - { - sendSystemMessage(player, new string_id("player_structure", "find_items_no_selection")); - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - return; - } - - obj_id selectedItem = itemsPageList[item_selected]; - if (isIdValid(selectedItem)) - { - moveItemInBuildingToPlayer(player, selectedItem); - repeatFindItemsListboxPage(self, player, startingIndex, totalNumItems, itemsPageList); - return; - } - - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - return; - } - - - public static void handleFindItemsChangePageResponse(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return; - } - - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return; - } - - String revert = params.getString(sui.MSGBOX_BTN_REVERT+".RevertWasPressed"); - int button = sui.getIntButtonPressed( params ); - - if (button == sui.BP_CANCEL) - { - sendSystemMessage(player, new string_id("player_structure", "find_items_search_cancelled")); - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - return; - } - - int startingIndex = utils.getIntScriptVar(player, "findItems.startingIndex"); - if (revert != null && !revert.equals("")) - { - - startingIndex = startingIndex - 50; - } - else if (utils.hasScriptVar(player, "findItems.lastPage")) - { - - startingIndex = startingIndex - 50; - } - else - { - - startingIndex = startingIndex + 50; - } - - if (startingIndex < 0) - { - startingIndex = 0; - } - - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - - showFindItemsListboxPage(self, player, startingIndex); - - return; - } - - - public static void handleSearchItemsGetKeyword(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return; - } - - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return; - } - - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - sendSystemMessage(player, new string_id("player_structure", "find_items_search_cancelled")); - return; - } - - String keyword = toLower(sui.getInputBoxText(params)); - - if (keyword == null || keyword.length() < 1) - { - sendSystemMessage(player, new string_id("player_structure", "find_items_search_no_keyword")); - return; - } - - Vector myItemsInBuilding = player_structure.getMyItemsInBuilding(player); - Vector keywordMatchedIds = new Vector(); - keywordMatchedIds.setSize(0); - Vector keywordMatchedNames = new Vector(); - keywordMatchedNames.setSize(0); - - int numMatches = 0; - String prompt = utils.packStringId(new string_id("player_structure", "find_items_search_list_prompt")); - - for (int i = 0; i < myItemsInBuilding.size(); i++) - { - testAbortScript(); - obj_id thing = ((obj_id)(myItemsInBuilding.get(i))); - String name = getAssignedName(thing); - if (name == null || name.length () < 1) - { - string_id sidName = getNameStringId(thing); - if (sidName != null && !sidName.isEmpty()) - { - sidName = utils.unpackString("@"+ sidName.toString()); - name = getString(sidName); - if (name.startsWith("@")) - { - CustomerServiceLog("findItemInStructure", "Server localization for this item failed: "+getTemplateName(thing)+" ("+thing+")."); - } - } - } - - String lowerCaseName = toLower(name); - int stringCheck = lowerCaseName.indexOf(keyword); - if (stringCheck > -1) - { - utils.addElement(keywordMatchedIds, thing); - utils.addElement(keywordMatchedNames, name); - ++numMatches; - } - - if (numMatches >= 50) - { - prompt = utils.packStringId(new string_id("player_structure", "find_items_search_list_too_long_prompt")); - break; - } - } - - if (keywordMatchedIds == null || keywordMatchedIds.size() < 1) - { - sendSystemMessage(player, new string_id("player_structure", "find_items_search_not_found")); - return; - } - - if (keywordMatchedNames == null || keywordMatchedNames.size() < 1 || keywordMatchedIds.size() != keywordMatchedNames.size()) - { - - return; - } - - String[] matchingItemsNameList = utils.toStaticStringArray(keywordMatchedNames); - obj_id[] matchingItemsList = utils.toStaticObjIdArray(keywordMatchedIds); - - showSearchItemsListboxSui(self, player, matchingItemsList, matchingItemsNameList, prompt); - - return; - } - - - public static void repeatSearchItemsKeywordList(obj_id self, obj_id player, obj_id[] matchingItemsList) throws InterruptedException - { - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - - String[] matchingItemsNamesList = new String[matchingItemsList.length]; - for (int i = 0; i < matchingItemsList.length; i++) - { - testAbortScript(); - obj_id item = matchingItemsList[i]; - String itemName = getEncodedName(item); - matchingItemsNamesList[i] = itemName; - } - - String prompt = utils.packStringId(new string_id("player_structure", "find_items_search_list_prompt")); - if (matchingItemsList.length >= 50) - { - prompt = utils.packStringId(new string_id("player_structure", "find_items_search_list_too_long_prompt")); - } - - showSearchItemsListboxSui(self, player, matchingItemsList, matchingItemsNamesList, prompt); - return; - } - - - public static void showSearchItemsListboxSui(obj_id self, obj_id player, obj_id[] matchingItemsList, String[] matchingItemsNamesList, String prompt) throws InterruptedException - { - String title = utils.packStringId(new string_id("player_structure", "find_items_search_list_title")); - int pid = sui.listbox(self, player, prompt, sui.OK_CANCEL, title, matchingItemsNamesList, "handlePlayerStructureSearchItemsSelectedResponse"); - if (pid > -1) - { - sui.setSUIProperty(pid, sui.LISTBOX_BTN_OK, sui.PROP_TEXT,"Retrieve Object"); - sui.showSUIPage(pid); - - utils.setScriptVar(player, "findItems.pid", pid); - utils.setScriptVar(self, "findItems.searchList", matchingItemsList); - } - - return; - } - - - public static void handleSearchItemsSelectedResponse(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return; - } - - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return; - } - - int button = sui.getIntButtonPressed(params); - if (button == sui.BP_CANCEL) - { - sendSystemMessage(player, new string_id("player_structure", "find_items_search_cancelled")); - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - return; - } - - obj_id[] searchList = utils.getObjIdArrayScriptVar(self, "findItems.searchList"); - if (searchList == null || searchList.length < 1) - { - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - return; - } - - int item_selected = sui.getListboxSelectedRow(params); - if (item_selected < 0) - { - sendSystemMessage(player, new string_id("player_structure", "find_items_no_selection")); - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - return; - } - - obj_id selectedItem = searchList[item_selected]; - if (isIdValid(selectedItem)) - { - moveItemInBuildingToPlayer(player, selectedItem); - repeatSearchItemsKeywordList(self, player, searchList); - return; - } - - cleanupFindItemScriptVars(player); - cleanupFindItemScriptVars(self); - return; - } - - - public static void removeStructureFromMaintenance(obj_id droid, obj_id pcd, int indexOfStructure) throws InterruptedException - { - if (!isIdValid(pcd)) - { - return; - } - - obj_id[] struct_list = getObjIdArrayObjVar(pcd, "module_data.maint_list.ids"); - - if (struct_list == null || struct_list.length <= 0) - { - return; - } - - if (indexOfStructure < 0 || indexOfStructure >= struct_list.length) - { - return; - } - - obj_id[] new_struct_list = new obj_id[struct_list.length - 1]; - - int currentIndex = 0; - - for (int i = 0; i < struct_list.length; i++) - { - testAbortScript(); - if (i == indexOfStructure) - { - if (isIdValid(droid)) - { - removeObjVar(droid, "module_data.maint_list.loc_"+ i); - } - - removeObjVar(pcd, "module_data.maint_list.loc_"+ i); - continue; - } - - if (i < indexOfStructure) - { - new_struct_list[i] = struct_list[i]; - } - else - { - new_struct_list[i - 1] = struct_list[i]; - - if (hasObjVar(pcd, "module_data.maint_list.loc_" + i)) - { - if (isIdValid(droid)) - { - setObjVar(droid, "module_data.maint_list.loc_"+ (i - 1), getLocationObjVar(droid, "module_data.maint_list.loc_"+ i)); - } - - setObjVar(pcd, "module_data.maint_list.loc_"+ (i - 1), getLocationObjVar(pcd, "module_data.maint_list.loc_"+ i)); - } - else - { - if (isIdValid(droid)) - { - removeObjVar(droid, "module_data.maint_list.loc_"+ (i - 1)); - } - - removeObjVar(pcd, "module_data.maint_list.loc_"+ (i - 1)); - } - } - } - - if (isIdValid(droid)) - { - setObjVar(droid, "module_data.maint_list.ids", new_struct_list); - } - - setObjVar(pcd, "module_data.maint_list.ids", new_struct_list); - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/resource.java b/sku.0/sys.server/compiled/game/script/library/resource.java deleted file mode 100644 index 54d38cba5..000000000 --- a/sku.0/sys.server/compiled/game/script/library/resource.java +++ /dev/null @@ -1,1468 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.buff; -import script.library.city; -import script.library.utils; - - -public class resource extends script.base_script -{ - public resource() - { - } - public static final int SURVEY_RESOLUTION_MIN = 3; - public static final int SURVEY_RESOLUTION_MAX = 6; - public static final int SURVEY_RESOLUTION_DEFAULT = 3; - - public static final int SURVEY_RANGE_MIN = 16; - public static final int SURVEY_RANGE_MAX = 384; - public static final int SURVEY_RANGE_DEFAULT = 64; - - public static final String VAR_SURVEY_BASE = "survey"; - public static final String VAR_SURVEY_CLASS = VAR_SURVEY_BASE + ".resource_class"; - - public static final String VAR_SURVEY_RESOLUTION_MIN = VAR_SURVEY_BASE + ".resolution.min"; - public static final String VAR_SURVEY_RESOLUTION_MAX = VAR_SURVEY_BASE + ".resolution.max"; - public static final String VAR_SURVEY_RESOLUTION_VALUE = VAR_SURVEY_BASE + ".resolution.value"; - - public static final String VAR_SURVEY_RANGE_MIN = VAR_SURVEY_BASE + ".range.min"; - public static final String VAR_SURVEY_RANGE_MAX = VAR_SURVEY_BASE + ".range.max"; - public static final String VAR_SURVEY_RANGE_VALUE = VAR_SURVEY_BASE + ".range.value"; - - public static final String VAR_SAMPLE_STAMP = VAR_SURVEY_BASE + ".sample.stamp"; - - public static final String HANDLER_SET_RANGE = "handleSetRange"; - public static final String HANDLER_SET_RESOLUTION = "handleSetResolution"; - - public static final String VAR_SETTINGS_BASE = VAR_SURVEY_BASE + ".settings"; - - public static final String VAR_SETTINGS_PLAYER = VAR_SETTINGS_BASE + ".player"; - public static final String VAR_SETTINGS_INDEX = VAR_SETTINGS_BASE + ".index"; - public static final String VAR_SETTINGS_RANGES = VAR_SETTINGS_BASE + ".ranges"; - public static final String VAR_SETTINGS_RESOLUTIONS = VAR_SETTINGS_BASE + ".resolutions"; - - public static final String PID_NAME = "resourceSpecialEvent"; - - public static final int CLASS_RESOURCE = 0; - public static final int CLASS_INORGANIC = 1; - public static final int CLASS_MINERAL = 2; - public static final int CLASS_WATER = 3; - public static final int CLASS_CHEMICAL = 4; - public static final int CLASS_GAS = 5; - public static final int CLASS_ENERGY = 6; - public static final int CLASS_ORGANIC = 7; - public static final int CLASS_FOOD = 8; - public static final int CLASS_CREATURE_STRUCTURAL = 9; - public static final int CLASS_FLORA_RESOURCE = 10; - public static final int CLASS_FLORA_STRUCTURAL = 11; - public static final int CLASS_ENERGY_WIND = 12; - public static final int CLASS_ENERGY_SOLAR = 13; - public static final int CLASS_MAX = 14; - - public static final String[] CLASS_NAME = - { - "resource", - "inorganic", - "mineral", - "water", - "chemical", - "gas", - "energy", - "organic", - "creature_food", - "creature_structural", - "flora_resources", - "flora_structural", - "energy_renewable_unlimited_wind", - "energy_renewable_unlimited_solar" - }; - - public static final String RT_ORGANIC = "organic"; - public static final String RT_INORGANIC = "inorganic"; - - public static final String RT_MINERAL = "mineral"; - - public static final String RT_GAS = "gas"; - public static final String RT_LIQUID_VAPORS = "liquid_vapors"; - - public static final String RT_LIQUID_WATER = "water"; - public static final String RT_LIQUID_CHEMICAL = "chemical"; - - public static final String RT_CREATURE_RESOURCES = "creature_resources"; - - public static final String RT_FLORA_RESOURCES = "flora_resources"; - - public static final String RT_FLORA_FOOD = "flora_food"; - - public static final String RT_FLORA_STRUCTURAL = "flora_structural"; - - public static final String RT_ENERGY_WIND = "energy_renewable_unlimited_wind"; - public static final String RT_ENERGY_SOLAR = "energy_renewable_unlimited_solar"; - public static final String RT_ENERGY_GEO = "energy_renewable_site_limited_geothermal"; - - public static final String MOD_SURVEY_ORGANIC = "survey_organic"; - public static final String MOD_SURVEY_ORGANIC_RANGE = "survey_organic_range"; - public static final String MOD_SURVEY_ORGANIC_RESOLUTION = "survey_organic_resolution"; - - public static final String MOD_SURVEY_INORGANIC = "survey_inorganic"; - public static final String MOD_SURVEY_INORGANIC_RANGE = "survey_inorganic_range"; - public static final String MOD_SURVEY_INORGANIC_RESOLUTION = "survey_inorganic_resolution"; - - public static final String MOD_SURVEY_SOLID = "survey_solid"; - public static final String MOD_SURVEY_SOLID_RANGE = "survey_solid_range"; - public static final String MOD_SURVEY_SOLID_RESOLUTION = "survey_solid_resolution"; - - public static final String MOD_SURVEY_GAS = "survey_gas"; - public static final String MOD_SURVEY_GAS_RANGE = "survey_gas_range"; - public static final String MOD_SURVEY_GAS_RESOLUTION = "survey_gas_resolution"; - - public static final String MOD_SURVEY_LIQUID = "survey_liquid"; - public static final String MOD_SURVEY_LIQUID_RANGE = "survey_liquid_range"; - public static final String MOD_SURVEY_LIQUID_RESOLUTION = "survey_liquid_resolution"; - - public static final String MOD_SURVEY_CREATURE = "survey_creature"; - public static final String MOD_SURVEY_CREATURE_RANGE = "survey_creature_range"; - public static final String MOD_SURVEY_CREATURE_RESOLUTION = "survey_creature_resolution"; - - public static final String MOD_SURVEY_FOOD = "survey_food"; - public static final String MOD_SURVEY_FOOD_RANGE = "survey_food_range"; - public static final String MOD_SURVEY_FOOD_RESOLUTION = "survey_food_resolution"; - - public static final String MOD_SURVEY_FLORA_STRUCTURAL = "survey_flora_structural"; - public static final String MOD_SURVEY_FLORA_STRUCTURAL_RANGE = "survey_flora_structural_range"; - public static final String MOD_SURVEY_FLORA_STRUCTURAL_RESOLUTION = "survey_flora_structural_resolution"; - - public static final String MOD_SURVEY_ENERGY_WIND = "survey_energy_wind"; - public static final String MOD_SURVEY_ENERGY_WIND_RANGE = "survey_energy_wind_range"; - public static final String MOD_SURVEY_ENERGY_WIND_RESOLUTION = "survey_energy_wind_resolution"; - - public static final String MOD_SURVEY_ENERGY_SOLAR = "survey_energy_solar"; - public static final String MOD_SURVEY_ENERGY_SOLAR_RANGE = "survey_energy_solar_range"; - public static final String MOD_SURVEY_ENERGY_SOLAR_RESOLUTION = "survey_energy_solar_resolution"; - - public static final String MOD_SURVEY_ENERGY_GEO = "survey_energy_geo_thermal"; - public static final String MOD_SURVEY_ENERGY_GEO_RANGE = "survey_energy_geo_thermal_range"; - public static final String MOD_SURVEY_ENERGY_GEO_RESOLUTION = "survey_energy_geo_thermal_resolution"; - - public static final String MOD_SURVEY_ALL = "survey_resources_all"; - - public static final float SAMPLE_DENSITY_THRESHOLD = 0.3f; - public static final int BASE_HARVEST_XP = 40; - - public static final int TIME_SAMPLE = 18; - - public static final int TIME_FAIL_BONUS = 180; - - public static final int BASE_SAMPLE_AMOUNT = 22; - - public static final String STF_SURVEY = "survey"; - public static final string_id SID_WRONG_TOOL = new string_id(STF_SURVEY, "wrong_tool"); - - public static final string_id SID_NSF_SKILL = new string_id("error_message","prose_nsf_skill"); - public static final string_id SID_NSF_SKILL_PLURAL = new string_id("error_message","prose_nsf_skill_plural"); - - public static final string_id SID_SAMPLE_LOCATED = new string_id(STF_SURVEY, "sample_located"); - public static final string_id SID_SAMPLE_FAILED = new string_id(STF_SURVEY, "sample_failed"); - - public static final string_id SID_DENSITY_BELOW_THESHOLD = new string_id(STF_SURVEY, "density_below_threshold"); - public static final string_id SID_TRACE_AMOUNT = new string_id(STF_SURVEY, "trace_amount"); - public static final string_id SID_EFFICIENCY_TOO_LOW = new string_id(STF_SURVEY, "efficiency_too_low"); - public static final string_id SID_TOOL_RECHARGE_TIME = new string_id(STF_SURVEY, "tool_recharge_time"); - public static final string_id SID_NO_INV_SPACE = new string_id(STF_SURVEY, "no_inv_space"); - - public static final string_id SID_CRITICAL_SUCCESS = new string_id(STF_SURVEY, "critical_success"); - public static final string_id SID_NODE_NOT_CLOSE = new string_id(STF_SURVEY, "node_not_close"); - public static final string_id SID_NODE_RECOVERY = new string_id(STF_SURVEY, "node_recovery"); - public static final string_id SID_GAMBLE_SUCCESS = new string_id(STF_SURVEY, "gamble_success"); - public static final string_id SID_GAMBLE_FAIL = new string_id(STF_SURVEY, "gamble_fail"); - public static final string_id SID_PET_SEARCH_SUCCESS = new string_id(STF_SURVEY, "pet_search_success"); - public static final string_id SID_PET_SEARCH_FAIL = new string_id(STF_SURVEY, "pet_search_fail"); - public static final string_id SID_GAMBLE_RARE = new string_id(STF_SURVEY, "gamble_rare"); - - public static final string_id SID_EFFECTS_OF_RADIATION_SICKNESS = new string_id(STF_SURVEY, "effects_of_radiation_sickness"); - - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_TITLE = new string_id(STF_SURVEY, "sui_survey_tool_properties_title"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_HEADER = new string_id(STF_SURVEY, "sui_survey_tool_properties_header"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_RESOURCE_HEADER = new string_id(STF_SURVEY, "sui_survey_tool_properties_resource_header"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_RESOURCE = new string_id(STF_SURVEY, "sui_survey_tool_properties_resource"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_RESOLUTION = new string_id(STF_SURVEY, "sui_survey_tool_properties_resolution"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_RESOLUTION_MIN = new string_id(STF_SURVEY, "sui_survey_tool_properties_resolution_min"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_RESOLUTION_MAX = new string_id(STF_SURVEY, "sui_survey_tool_properties_resolution_max"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_RESOLUTION_VAL = new string_id(STF_SURVEY, "sui_survey_tool_properties_resolution_val"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_RANGE = new string_id(STF_SURVEY, "sui_survey_tool_properties_range"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_RANGE_MIN = new string_id(STF_SURVEY, "sui_survey_tool_properties_range_min"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_RANGE_MAX = new string_id(STF_SURVEY, "sui_survey_tool_properties_range_max"); - public static final string_id SID_SUI_SURVEY_TOOL_PROPERTIES_RANGE_VAL = new string_id(STF_SURVEY, "sui_survey_tool_properties_range_val"); - - public static final string_id SID_SURVEY_ERROR = new string_id("error_message","survey_error"); - - public static final String DATATABLE_RESOURCES = "datatables/resource/resource_tree.iff"; - public static final String DATATABLE_COL_ENUM = "Enum"; - public static final String DATATABLE_COL_RESOURCE_CRATE_TYPE = "Resource Container Type"; - - public static final String DEFAULT_CONTAINER = "object/resource_container/simple.iff"; - - public static final int CONTAINER_VOLUME_MAX = 100000; - - public static final String MSG_SELECT_RANGE = "@"+ STF_SURVEY + ":select_range"; - public static final String MSG_SELECT_CLASS = "@"+ STF_SURVEY + ":select_class"; - - public static final int SAMPLE_STOP_LOOP = 0; - public static final int SAMPLE_CONTINUE_LOOP = 1; - public static final int SAMPLE_CONTINUE_LOOP_NOSAMPLE = 2; - public static final int SAMPLE_PAUSE_LOOP_EVENT = 3; - - - public static boolean isResourceDerivedFrom(String resource_type, String parent_class) throws InterruptedException - { - if ((resource_type.equals("")) || (parent_class.equals(""))) - { - return false; - } - - if (resource_type.equals(parent_class)) - { - return true; - } - - obj_id resourceId = getResourceTypeByName(resource_type); - if ((resourceId == null) || (resourceId == obj_id.NULL_ID)) - { - return false; - } - - if (isResourceDerivedFrom(resourceId, parent_class)) - { - return true; - } - - return false; - } - - - public static obj_id[] create(obj_id resourceId, int amt, obj_id targetContainer, obj_id playerId) throws InterruptedException - { - if ((resourceId == null) || (resourceId == obj_id.NULL_ID)) - { - return null; - } - - if ((targetContainer == null) || (targetContainer == obj_id.NULL_ID)) - { - return null; - } - - if (amt < 1) - { - return null; - } - - int total = amt; - - Vector ret = new Vector(); - ret.setSize(0); - - String containerTemplate = getResourceContainerTemplate(resourceId); - if ((containerTemplate == null) || (containerTemplate.equals(""))) - { - containerTemplate = DEFAULT_CONTAINER; - } - - int chunks = (int)(amt / CONTAINER_VOLUME_MAX); - if (amt % CONTAINER_VOLUME_MAX > 0) - { - chunks++; - } - - for (int i = 0; i < chunks; i++) - { - testAbortScript(); - if (total > 0) - { - obj_id crate = createObject(containerTemplate, targetContainer, ""); - if ((crate == null) || (crate == obj_id.NULL_ID)) - { - } - else - { - int containerAmount = CONTAINER_VOLUME_MAX; - if (total < CONTAINER_VOLUME_MAX) - { - containerAmount = total; - } - - addResourceToContainer(crate, resourceId, containerAmount, playerId); - total -= containerAmount; - - ret = utils.addElement(ret, crate); - } - } - } - - if ((ret == null) || (ret.size() == 0)) - { - return null; - } - - obj_id[] _ret = new obj_id[0]; - if (ret != null) - { - _ret = new obj_id[ret.size()]; - ret.toArray(_ret); - } - return _ret; - } - - - public static obj_id[] create(obj_id resourceId, int amt, obj_id targetContainer) throws InterruptedException - { - return create(resourceId, amt, targetContainer, obj_id.NULL_ID); - } - - - public static obj_id[] createRandom(String resourceClass, int amt, location loc, obj_id targetContainer, obj_id playerId, int min) throws InterruptedException - { - if ((resourceClass == null) || (resourceClass.equals(""))) - { - return null; - } - - if (loc == null) - { - return null; - } - - if (min < 1) - { - min = 1; - } - - if (!isIdValid(targetContainer)) - { - return null; - } - - if (getVolumeFree(targetContainer) <= 0) - { - return null; - } - - obj_id resourceId = null; - - if ((loc == null || loc.compareTo(new location()) == 0 || (loc.cell != null && loc.cell != obj_id.NULL_ID)) && isIdValid(targetContainer)) - { - obj_id topmost = getTopMostContainer(targetContainer); - if (topmost != targetContainer) - { - loc = getLocation(topmost); - } - - resourceId = pickRandomNonDepeletedResource(resourceClass); - if ((resourceId == null) || (resourceId == obj_id.NULL_ID)) - { - return null; - } - } - else - { - - resource_density[] availableResources = requestResourceList(loc, 0.0f, 1.0f, resourceClass); - - if (availableResources == null || availableResources.length == 0) - { - return null; - } - - int idx = rand(0, availableResources.length-1); - resourceId = availableResources[idx].getResourceType(); - if ((resourceId == null) || (resourceId == obj_id.NULL_ID)) - { - return null; - } - } - - float eff = getResourceEfficiency( resourceId, loc ); - - int finalAmount = oneTimeHarvest( resourceId, amt, loc ); - if (finalAmount < min) - { - finalAmount = min; - } - - utils.setScriptVar( playerId, "resource.lastEff", eff ); - utils.setScriptVar( playerId, "resource.lastAmt", finalAmount ); - utils.setScriptVar( playerId, "resource.lastId", resourceId ); - - return create( resourceId, finalAmount, targetContainer, playerId ); - } - - - public static obj_id[] createRandom(String resourceClass, int amt, location loc, obj_id targetContainer, obj_id playerId) throws InterruptedException - { - return createRandom(resourceClass, amt, loc, targetContainer, playerId, 1); - } - - - public static obj_id[] createRandom(String resourceClass, int amt, location loc, obj_id targetContainer) throws InterruptedException - { - return createRandom(resourceClass, amt, loc, targetContainer, obj_id.NULL_ID, 1); - } - - - public static boolean setToolClass(obj_id tool, int resource_class) throws InterruptedException - { - if (tool == null) - { - return false; - } - - if ((resource_class < CLASS_RESOURCE) || (resource_class >= CLASS_MAX)) - { - return false; - } - - return setObjVar(tool, VAR_SURVEY_CLASS, CLASS_NAME[resource_class]); - } - - - public static boolean requestSetToolRatio(obj_id user, obj_id tool) throws InterruptedException - { - if ((user == null) || (tool == null)) - { - return false; - } - - String resource_class = getStringObjVar(tool, resource.VAR_SURVEY_CLASS); - if (resource_class.equals("")) - { - sendSystemMessageTestingOnly(user, "ERROR: survey tool broken -> no assigned resource class"); - return false; - } - - String baseMod = getSkillModForClass(resource_class); - if (baseMod.equals("")) - { - sendSystemMessageTestingOnly(user, "ERROR: survey tool broken -> unknown resource class"); - return false; - } - - int rangeVal = getSkillStatMod(user, "surveying") / 20; - if (rangeVal < 1) - { - rangeVal = 1; - } - int resVal = getSkillStatMod(user, "surveying") / 20; - - int range_min = getIntObjVar(tool, VAR_SURVEY_RANGE_MIN); - int range_max = getIntObjVar(tool, VAR_SURVEY_RANGE_MAX); - - int res_min = getIntObjVar(tool, VAR_SURVEY_RESOLUTION_MIN); - int res_max = getIntObjVar(tool, VAR_SURVEY_RESOLUTION_MAX); - - Vector options = new Vector(); - options.setSize(0); - Vector ranges = new Vector(); - ranges.setSize(0); - Vector resolutions = new Vector(); - resolutions.setSize(0); - float res = SURVEY_RESOLUTION_MIN; - int count = 1; - for (int range = range_min; range <= range_max; range += ((range_max-range_min)/5)) - { - testAbortScript(); - if (count > rangeVal) - { - break; - } - res += (res_max - res_min) / 5.0; - ranges = utils.addElement(ranges, range); - resolutions = utils.addElement(resolutions, (int) res); - options = utils.addElement(options, ""+ range + "m x "+ ((int) res) + "pts"); - count++; - } - - if (ranges.size() == 0 || resolutions.size() == 0) - { - - return false; - } - - removeObjVar(tool, VAR_SETTINGS_BASE); - - setObjVar(tool, VAR_SETTINGS_PLAYER, user); - setObjVar(tool, VAR_SETTINGS_RANGES, ranges, resizeableArrayTypeint); - setObjVar(tool, VAR_SETTINGS_RESOLUTIONS, resolutions, resizeableArrayTypeint); - - sui.listbox(tool, user, MSG_SELECT_RANGE, options, HANDLER_SET_RANGE); - - return true; - } - - - public static int getSample(obj_id user, obj_id tool, String type) throws InterruptedException - { - if ((user == null) || (tool == null) || (type.equals(""))) - { - return SAMPLE_STOP_LOOP; - } - - obj_id typeId = getResourceTypeByName(type); - if (!isIdValid(typeId)) - { - debugSpeakMsg(user, "resource::getSample: unable to retrieve obj_id for "+ type); - sendSystemMessage(user, SID_SURVEY_ERROR); - return SAMPLE_STOP_LOOP; - } - - String resource_class = getStringObjVar(tool, resource.VAR_SURVEY_CLASS); - if (resource_class == null || resource_class.equals("")) - { - sendSystemMessageTestingOnly(user, "ERROR: survey tool broken -> no assigned resource class"); - return SAMPLE_STOP_LOOP; - } - if (!isResourceDerivedFrom(typeId, resource_class)) - { - prose_package pp = prose.getPackage(SID_WRONG_TOOL, type); - sendSystemMessageProse(user, pp); - return SAMPLE_STOP_LOOP; - } - - float density = getResourceEfficiency(typeId, getLocation(user)); - - if (density < 0) - { - return SAMPLE_STOP_LOOP; - } - else if (density < 0.1f) - { - prose_package proseFailed = prose.getPackage(SID_EFFICIENCY_TOO_LOW, type); - sendSystemMessageProse(user, proseFailed); - return SAMPLE_STOP_LOOP; - } - - int modVal = getSkillStatMod(user, "surveying"); - - float threshold = SAMPLE_DENSITY_THRESHOLD * ((100f - modVal)/100f); - if (density > threshold) - { - float deltaDensity = density - threshold; - - float famt = BASE_SAMPLE_AMOUNT * deltaDensity; - - if (famt < 1) - { - prose_package proseFailed = prose.getPackage(SID_TRACE_AMOUNT, type); - sendSystemMessageProse(user, proseFailed); - return SAMPLE_STOP_LOOP; - } - - location nodecritloc = null; - int gamble = 0; - if (utils.hasScriptVar( user, "survey_event.tool" )) - { - if (utils.hasScriptVar( user, "survey_event.gamble" )) - { - - gamble = utils.getIntScriptVar( user, "survey_event.gamble");; - utils.removeScriptVar( user, "survey_event.gamble"); - utils.removeScriptVar( user, "survey_event.tool"); - } - else - { - - obj_id crittool = utils.getObjIdScriptVar( user, "survey_event.tool"); - if (crittool != tool) - { - utils.removeScriptVar( user, "survey_event.tool"); - } - else - { - nodecritloc = utils.getLocationScriptVar( user, "survey_event.location"); - - location ploc = getLocation( user ); - if (utils.getDistance2D( ploc, nodecritloc ) > 5) - { - utils.removeScriptVar( user, "survey_event.tool"); - utils.removeScriptVar( user, "survey_event.location"); - nodecritloc = null; - sendSystemMessage( user, SID_NODE_NOT_CLOSE ); - } - } - } - } - - int city_id = city.checkCity( user, false ); - - float chance = 50f + 20f*((modVal-15f)/85f); - if (chance > 70) - { - chance = 70; - } - int roll = rand( 1, 100 ); - - if (city_id > 0 && city.cityHasSpec( city_id, city.SF_SPEC_SAMPLE_RICH )) - { - chance += 10; - } - - if ((roll <= chance) || (gamble > 0) || (nodecritloc != null)) - { - float resultModifier = ((2*chance) - roll)/(2*chance); - int amt = (int)(famt * resultModifier); - if (amt == 0) - { - amt = 1; - } - - if (city_id > 0 && city.cityHasSpec( city_id, city.SF_SPEC_SAMPLE_RICH )) - { - amt *= 1.2; - } - - if (gamble == 1) - { - sendSystemMessage( user, SID_GAMBLE_SUCCESS ); - amt *= 4; - } - else if (gamble == 2) - { - sendSystemMessage( user, SID_GAMBLE_FAIL ); - } - else if (gamble == 3) - { - sendSystemMessage( user, SID_PET_SEARCH_SUCCESS ); - amt *= 3; - } - else if (gamble == 4) - { - sendSystemMessage( user, SID_PET_SEARCH_FAIL); - } - else if (gamble == 5) - { - sendSystemMessage( user, SID_GAMBLE_RARE); - } - else if (nodecritloc != null) - { - - sendSystemMessage( user, SID_NODE_RECOVERY ); - amt *= 3; - utils.removeScriptVar( user, "survey_event.location"); - utils.removeScriptVar( user, "survey_event.tool"); - } - else - { - - int critRoll = rand( 1, 100 ); - int rollResult = 10; - if (isGod (user)) - { - rollResult = 100; - } - if (roll <= rollResult) - { - critRoll = rand( 1, 100 ); - if (critRoll <= 50) - { - - sendSystemMessage( user, SID_CRITICAL_SUCCESS ); - amt *= 2; - } - else if (critRoll <= 75) - { - - utils.setScriptVar( user, "survey_event.tool", tool ); - - obj_id beastCheck = (beast_lib.getBeastOnPlayer(user)); - if (beastCheck != null) - { - - String[] nodeOptions = new String[3]; - nodeOptions[0] = "@survey:cnode_1"; - nodeOptions[1] = "@survey:cnode_2"; - nodeOptions[2] = "@survey:cnode_collection"; - - if (!sui.hasPid(user, PID_NAME)) - { - int pid = sui.listbox( user, user, "@survey:cnode_d", sui.OK_CANCEL, "@survey:cnode_t", nodeOptions, "handleSurveyNodeChoice", true ); - sui.setPid(user, pid , PID_NAME); - } - - } - - else - { - - String[] nodeOptions = new String[2]; - nodeOptions[0] = "@survey:cnode_1"; - nodeOptions[1] = "@survey:cnode_2"; - - if (!sui.hasPid(user, PID_NAME)) - { - int pid = sui.listbox( user, user, "@survey:cnode_d", sui.OK_CANCEL, "@survey:cnode_t", nodeOptions, "handleSurveyNodeChoice", true ); - sui.setPid(user, pid , PID_NAME); - } - } - - return SAMPLE_PAUSE_LOOP_EVENT; - } - else - { - - utils.setScriptVar( user, "survey_event.tool", tool ); - - String collectionName = "col_resource_"+ resource_class + "_01"; - if (!hasCompletedCollectionSlot(user, collectionName)) - { - String[] nodeOptions = new String[3]; - nodeOptions[0] = "@survey:gnode_1"; - nodeOptions[1] = "@survey:gnode_2"; - nodeOptions[2] = "@survey:gnode_collection"; - - if (!sui.hasPid(user, PID_NAME)) - { - int pid = sui.listbox( user, user, "@survey:gnode_d", sui.OK_CANCEL, "@survey:gnode_t", nodeOptions, "handleSurveyGambleChoice", true ); - sui.setPid(user, pid , PID_NAME); - } - - } - - else - { - - String[] nodeOptions = new String[2]; - nodeOptions[0] = "@survey:gnode_1"; - nodeOptions[1] = "@survey:gnode_2"; - - if (!sui.hasPid(user, PID_NAME)) - { - int pid = sui.listbox( user, user, "@survey:gnode_d", sui.OK_CANCEL, "@survey:gnode_t", nodeOptions, "handleSurveyGambleChoice", true ); - sui.setPid(user, pid , PID_NAME); - } - } - - return SAMPLE_PAUSE_LOOP_EVENT; - } - } - } - - int expertiseResourceIncrease = (int)getSkillStatisticModifier(user, "expertise_resource_sampling_increase"); - - if (expertiseResourceIncrease > 0) - { - amt += (int)(amt * (float)(expertiseResourceIncrease / 100.0f)); - } - - if (buff.hasBuff(user, "tcg_series4_falleens_fist")) - { - amt = (int)(amt * 1.5f); - LOG("sissynoid", "Granting 50% Increase due to Falleen's Fist Buff"); - } - - String crateTemplate = getResourceContainerTemplate(typeId); - if (!crateTemplate.equals("")) - { - obj_id pInv = utils.getInventoryContainer(user); - if (pInv != null) - { - obj_id crate = createObject( crateTemplate, pInv, ""); - - if (addResourceToContainer( crate, typeId, amt, user )) - { - location curloc = getLocation( user ); - setLocation( crate, curloc ); - putIn( crate, pInv, user ); - - if (hasScript(user, "theme_park.new_player.new_player")) - { - dictionary webster = new dictionary(); - webster.put("sampling", 1); - messageTo(user, "handleNewPlayerArtisanAction", webster, 1, false); - } - - if (hasScript (user, "toad.survey_quest")) - { - dictionary merriam = new dictionary(); - merriam.put ("resource", typeId); - messageTo (user, "forceSensitiveQuestInfo", merriam, 1, false); - } - - prose_package proseSuccess = prose.getPackage( SID_SAMPLE_LOCATED, type, amt ); - sendSystemMessageProse( user, proseSuccess ); - - if (isResourceDerivedFrom(typeId, "radioactive")) - { - - int pe = resource.getResourceAttribute(typeId, "res_potential_energy"); - - if (pe > 500) - { - int damage = (pe - 500) / 2; - if (damage < 1) - { - damage = 1; - } - - int current = getAttrib(user, HEALTH); - if (damage > current) - { - damage = (current - 1); - } - - addAttribModifier(user, HEALTH, (damage * -1), 0, 0, MOD_POOL); - - int fatigue = damage / 4; - addShockWound(user, fatigue); - - sendSystemMessage(user, SID_EFFECTS_OF_RADIATION_SICKNESS); - } - } - - return SAMPLE_CONTINUE_LOOP; - } - else - { - setObjVar( user, "sampleCrateGenFailed", 1 ); - sendSystemMessage( user, SID_NO_INV_SPACE ); - setObjVar(user, VAR_SAMPLE_STAMP, getGameTime()- TIME_FAIL_BONUS ); - return SAMPLE_STOP_LOOP; - } - } - } - } - } - else - { - prose_package proseFailed = prose.getPackage( SID_DENSITY_BELOW_THESHOLD, type ); - sendSystemMessageProse( user, proseFailed ); - return SAMPLE_STOP_LOOP; - } - - setObjVar(user, VAR_SAMPLE_STAMP, getGameTime()- TIME_FAIL_BONUS ); - - prose_package proseFailed = prose.getPackage( SID_SAMPLE_FAILED, type ); - sendSystemMessageProse( user, proseFailed ); - - return SAMPLE_CONTINUE_LOOP_NOSAMPLE; - } - - - public static String getResourceContainerTemplate(obj_id typeId) throws InterruptedException - { - if (typeId == null) - { - return ""; - } - - String tpf = getResourceContainerForType(typeId); - if (tpf.equals("")) - { - return DEFAULT_CONTAINER; - } - - return tpf; - } - - - public static boolean showToolProperties(obj_id target, obj_id tool) throws InterruptedException - { - if ((target == null) || (tool == null)) - { - return false; - } - - Vector dsrc = new Vector(); - dsrc.setSize(0); - - String resource_class = getStringObjVar(tool, resource.VAR_SURVEY_CLASS); - dsrc = utils.addElement(dsrc, utils.packStringId(SID_SUI_SURVEY_TOOL_PROPERTIES_RESOURCE_HEADER)); - prose_package ppResource = prose.getPackage(SID_SUI_SURVEY_TOOL_PROPERTIES_RESOURCE); - prose.setTO(ppResource, resource_class); - dsrc = utils.addElement(dsrc, " \0"+ packOutOfBandProsePackage(null, ppResource)); - - dsrc = utils.addElement(dsrc, " "); - - int res_min = getIntObjVar(tool, resource.VAR_SURVEY_RESOLUTION_MIN); - int res_max = getIntObjVar(tool, resource.VAR_SURVEY_RESOLUTION_MAX); - int res_val = getIntObjVar(tool, resource.VAR_SURVEY_RESOLUTION_VALUE); - dsrc = utils.addElement(dsrc, utils.packStringId(SID_SUI_SURVEY_TOOL_PROPERTIES_RESOLUTION)); - prose_package ppResMin = prose.getPackage(SID_SUI_SURVEY_TOOL_PROPERTIES_RESOLUTION_MIN); - prose.setDI(ppResMin, res_min); - dsrc = utils.addElement(dsrc, " \0"+ packOutOfBandProsePackage(null, ppResMin)); - prose_package ppResMax = prose.getPackage(SID_SUI_SURVEY_TOOL_PROPERTIES_RESOLUTION_MAX); - prose.setDI(ppResMax, res_max); - dsrc = utils.addElement(dsrc, " \0"+ packOutOfBandProsePackage(null, ppResMax)); - prose_package ppResVal = prose.getPackage(SID_SUI_SURVEY_TOOL_PROPERTIES_RESOLUTION_VAL); - prose.setDI(ppResVal, res_val); - dsrc = utils.addElement(dsrc, " \0"+ packOutOfBandProsePackage(null, ppResVal)); - - dsrc = utils.addElement(dsrc, " "); - - int range_min = getIntObjVar(tool, resource.VAR_SURVEY_RANGE_MIN); - int range_max = getIntObjVar(tool, resource.VAR_SURVEY_RANGE_MAX); - int range_val = getIntObjVar(tool, resource.VAR_SURVEY_RANGE_VALUE); - dsrc = utils.addElement(dsrc, utils.packStringId(SID_SUI_SURVEY_TOOL_PROPERTIES_RANGE)); - prose_package ppRangeMin = prose.getPackage(SID_SUI_SURVEY_TOOL_PROPERTIES_RANGE_MIN); - prose.setDI(ppRangeMin, range_min); - dsrc = utils.addElement(dsrc, " \0"+ packOutOfBandProsePackage(null, ppRangeMin)); - prose_package ppRangeMax = prose.getPackage(SID_SUI_SURVEY_TOOL_PROPERTIES_RANGE_MAX); - prose.setDI(ppRangeMax, range_max); - dsrc = utils.addElement(dsrc, " \0"+ packOutOfBandProsePackage(null, ppRangeMax)); - prose_package ppRangeVal = prose.getPackage(SID_SUI_SURVEY_TOOL_PROPERTIES_RANGE_VAL); - prose.setDI(ppRangeVal, range_val); - dsrc = utils.addElement(dsrc, " \0"+ packOutOfBandProsePackage(null, ppRangeVal)); - - if ((dsrc != null) && (dsrc.size() > 0)) - { - String title = utils.packStringId(SID_SUI_SURVEY_TOOL_PROPERTIES_TITLE); - String header = utils.packStringId(SID_SUI_SURVEY_TOOL_PROPERTIES_HEADER); - sui.listbox(target, title, header, dsrc); - return true; - } - - return false; - } - - - public static String getSkillModForClass(String resource_class) throws InterruptedException - { - if (resource_class.equals("resource")) - { - return MOD_SURVEY_ALL; - } - - if (resource_class.equals("")) - { - return ""; - } - - if (isFloraResource(resource_class)) - { - return MOD_SURVEY_FLORA_STRUCTURAL; - } - - if (isCreatureResource(resource_class)) - { - return MOD_SURVEY_CREATURE; - } - - if (isLiquid(resource_class)) - { - return MOD_SURVEY_LIQUID; - } - - if (isGas(resource_class)) - { - return MOD_SURVEY_GAS; - } - - if (isSolid(resource_class)) - { - return MOD_SURVEY_SOLID; - } - - if (isEnergyWindResource(resource_class)) - { - return MOD_SURVEY_ENERGY_WIND; - } - - if (isEnergySolarResource(resource_class)) - { - return MOD_SURVEY_ENERGY_SOLAR; - } - - if (isEnergyGeoThermal(resource_class)) - { - return MOD_SURVEY_ENERGY_GEO; - } - - if (isInorganic(resource_class)) - { - return MOD_SURVEY_INORGANIC; - } - - if (isOrganic(resource_class)) - { - return MOD_SURVEY_ORGANIC; - } - - return ""; - } - - - public static boolean isEnergyGeoThermal(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_ENERGY_GEO)) - { - return true; - } - - return false; - } - - - public static boolean isOrganic(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_ORGANIC)) - { - return true; - } - - return false; - } - - - public static boolean isInorganic(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_INORGANIC)) - { - return true; - } - - return false; - } - - - public static boolean isSolid(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_MINERAL)) - { - return true; - } - - return false; - } - - - public static boolean isGas(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_GAS)) - { - return true; - } - - return false; - } - - - public static boolean isLiquid(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_LIQUID_WATER)) - { - return true; - } - - if (isResourceClassDerivedFrom(resource_class, RT_LIQUID_CHEMICAL)) - { - return true; - } - - return false; - } - - - public static boolean isCreatureResource(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_CREATURE_RESOURCES)) - { - return true; - } - - return false; - } - - - public static boolean isFloraResource(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_FLORA_RESOURCES)) - { - return true; - } - - return false; - } - - - public static boolean isFloraFoodResource(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_FLORA_FOOD)) - { - return true; - } - - return false; - } - - - public static boolean isFloraStructuralResource(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_FLORA_STRUCTURAL)) - { - return true; - } - - return false; - } - - - public static boolean isEnergyWindResource(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_ENERGY_WIND)) - { - return true; - } - - return false; - } - - - public static boolean isEnergySolarResource(String resource_class) throws InterruptedException - { - if (resource_class.equals("")) - { - return false; - } - - if (isResourceClassDerivedFrom(resource_class, RT_ENERGY_SOLAR)) - { - return true; - } - - return false; - } - - - public static String getResourceName(String resource_class) throws InterruptedException - { - int rowNum = dataTableSearchColumnForString( resource_class, 1, DATATABLE_RESOURCES ); - if (rowNum < 0) - { - return ""; - } - - dictionary row = dataTableGetRow( DATATABLE_RESOURCES, rowNum ); - - int i = 0; - String res = null; - while ((res == null) || (res.equals(""))) - { - testAbortScript(); - res = row.getString( "CLASS "+ i++ ); - } - return res; - } - - - public static int getEnergyTotalOnTarget(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return -1; - } - - int cnt = 0; - - obj_id[] items = getInventoryAndEquipment(target); - if ((items != null) && (items.length > 0)) - { - for (int i = 0; i < items.length; i++) - { - testAbortScript(); - if (isGameObjectTypeOf(getGameObjectType(items[i]), GOT_resource_container)) - { - obj_id rId = getResourceContainerResourceType(items[i]); - if (isIdValid(rId)) - { - if (isResourceDerivedFrom(rId, "energy") || isResourceDerivedFrom(rId, "radioactive")) - { - cnt += getPotentialEnergyValue(items[i]); - } - } - } - } - } - - return cnt; - } - - - public static int getPotentialEnergyValue(obj_id crate) throws InterruptedException - { - if (!isIdValid(crate)) - { - return 0; - } - - int amt = getResourceContainerQuantity(crate); - if (amt < 1) - { - return 0; - } - - obj_id rType = getResourceContainerResourceType(crate); - if (!isIdValid(rType)) - { - return 0; - } - - float ratio = getEnergyPowerRatio(rType); - return Math.round(ratio * amt); - - } - - - public static float getEnergyPowerRatio(obj_id rType) throws InterruptedException - { - int potential = getResourceAttribute(rType, "res_potential_energy"); - if (potential < 1) - { - return 1f; - } - - if (potential <= 500) - { - return 1f; - } - else - { - return 1f + (potential-500f)/500f; - } - } - - - public static int getResourceAttribute(String resourceName, String attribName) throws InterruptedException - { - if (resourceName == null || resourceName.equals("")) - { - return -1; - } - - return getResourceAttribute(getResourceTypeByName(resourceName), attribName); - } - - - public static dictionary getGeoThermalEnergyInformationOnTarget(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - int cnt = 0; - String resourceName = ""; - int resourceQuality = 0; - - obj_id[] items = getInventoryAndEquipment(target); - Vector tempListUniqueList = new Vector(); - tempListUniqueList.setSize(0); - dictionary resourceInfo = new dictionary(); - - if ((items != null) && (items.length > 0)) - { - for (int i = 0; i < items.length; i++) - { - testAbortScript(); - if (isGameObjectTypeOf(getGameObjectType(items[i]), GOT_resource_container)) - { - obj_id resourceType = getResourceContainerResourceType(items[i]); - if (isIdValid(resourceType)) - { - if (isResourceDerivedFrom(resourceType, "energy_renewable_site_limited_geothermal")) - { - if (tempListUniqueList.size() == 0) - { - tempListUniqueList.addElement(resourceType); - resourceName = getResourceName(resourceType); - resourceQuality = getResourceAttribute(resourceType, "res_quality"); - } - - if (tempListUniqueList.contains(resourceType)) - { - cnt += getResourceContainerQuantity(items[i]); - } - } - } - } - } - } - - resourceInfo.put("resourceName", resourceName); - resourceInfo.put("cnt", cnt); - resourceInfo.put("resourceQuality", resourceQuality); - return resourceInfo; - } - - - public static void cleanupTool(obj_id player, obj_id tool) throws InterruptedException - { - if (isIdValid(player)) - { - removeObjVar( player, "surveying.sampleLocation"); - utils.removeScriptVar(player, "surveying.takingSamples"); - utils.removeScriptVar(player, "surveying.tool"); - utils.removeScriptVar(player, "surveying.surveying"); - } - if (isIdValid(tool)) - { - utils.removeScriptVar(tool, "surveying.takingSamples"); - utils.removeScriptVar(tool, "surveying.player"); - utils.removeScriptVar(tool, "surveying.surveying"); - } - } - - - public static boolean consumeResource(obj_id player, String resource, int quantity) throws InterruptedException - { - obj_id[] contents = getInventoryAndEquipment(player); - - if (contents == null || contents.length < 1) - { - return false; - } - - for (int i = 0, j = contents.length; i < j; i++) - { - testAbortScript(); - if (!isIdValid(contents[i]) || !exists(contents[i])) - { - continue; - } - - if (!isResourceContainer(contents[i])) - { - continue; - } - - obj_id container = getResourceContainerResourceType(contents[i]); - - if (!isIdValid(container)) - { - continue; - } - - String name = getResourceClass(container); - String typeName = getResourceName(container); - String parent = getResourceParentClass(name); - parent = getResourceParentClass(parent); - parent = getResourceParentClass(parent); - - if (resource.equals(parent) && getResourceContainerQuantity(contents[i]) >= quantity) - { - - removeResourceFromContainer(contents[i], getResourceContainerResourceType(contents[i]), quantity); - return true; - } - } - - return false; - } - - - public static boolean hasResource(obj_id player, String resource, int quantity) throws InterruptedException - { - obj_id[] contents = getInventoryAndEquipment(player); - - if (contents == null || contents.length < 1) - { - return false; - } - - for (int i = 0, j = contents.length; i < j; i++) - { - testAbortScript(); - if (!isIdValid(contents[i]) || !exists(contents[i])) - { - continue; - } - - if (!isResourceContainer(contents[i])) - { - continue; - } - - obj_id container = getResourceContainerResourceType(contents[i]); - - if (!isIdValid(container)) - { - continue; - } - - String name = getResourceClass(container); - String typeName = getResourceName(container); - String parent = getResourceParentClass(name); - parent = getResourceParentClass(parent); - parent = getResourceParentClass(parent); - - if (resource.equals(parent) && getResourceContainerQuantity(contents[i]) >= quantity) - { - - return true; - } - } - - return false; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/ship_ai.java b/sku.0/sys.server/compiled/game/script/library/ship_ai.java deleted file mode 100644 index d0281fb10..000000000 --- a/sku.0/sys.server/compiled/game/script/library/ship_ai.java +++ /dev/null @@ -1,1056 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import java.util.Random; -import java.util.Vector; -import script.transform; -import script.vector; - - -public class ship_ai extends script.base_script -{ - public ship_ai() - { - } - public static final float DEFAULT_FOLLOW_DISTANCE = 40.0f; - - public static final int BEHAVIOR_IDLE = 0; - public static final int BEHAVIOR_TRACK = 1; - public static final int BEHAVIOR_MOVETO = 2; - public static final int BEHAVIOR_PATROL = 3; - public static final int BEHAVIOR_FOLLOW = 4; - - public static final int ATTACK_ORDERS_HOLD_FIRE = 0; - public static final int ATTACK_ORDERS_RETURN_FIRE = 1; - public static final int ATTACK_ORDERS_ATTACK_FREELY = 2; - - public static final int FORMATION_INVALID = 0; - public static final int FORMATION_CLAW = 1; - public static final int FORMATION_WALL = 2; - public static final int FORMATION_SPHERE = 3; - public static final int FORMATION_DELTA = 4; - public static final int FORMATION_BROAD = 5; - public static final int FORMATION_X = 6; - - - public static int unitGetBehavior(obj_id unit) throws InterruptedException - { - return _spaceUnitGetBehavior(unit); - } - - - public static void unitIdle(obj_id unit) throws InterruptedException - { - _spaceUnitIdle(unit); - } - - - public static void squadIdle(int squadId) throws InterruptedException - { - _spaceSquadIdle(squadId); - } - - - public static void unitTrack(obj_id unit, obj_id target) throws InterruptedException - { - _spaceUnitTrack(unit, target); - } - - - public static void squadTrack(int squadId, obj_id target) throws InterruptedException - { - _spaceSquadTrack(squadId, target); - } - - - public static void unitMoveTo(obj_id unit, transform[] path) throws InterruptedException - { - _spaceUnitMoveTo(unit, path); - } - - - public static void squadMoveTo(int squadId, transform[] path) throws InterruptedException - { - _spaceSquadMoveTo(squadId, path); - } - - - public static void unitMoveTo(obj_id unit, transform position) throws InterruptedException - { - transform path[] = new transform[1]; - path[0] = position; - _spaceUnitMoveTo(unit, path); - } - - - public static void squadMoveTo(int squadId, transform position) throws InterruptedException - { - transform path[] = new transform[1]; - path[0] = position; - _spaceSquadMoveTo(squadId, path); - } - - - public static void unitAddPatrolPath(obj_id unit, transform[] path) throws InterruptedException - { - _spaceUnitAddPatrolPath(unit, path); - } - - - public static void squadAddPatrolPath(int squadId, transform[] path) throws InterruptedException - { - _spaceSquadAddPatrolPath(squadId, path); - } - - - public static void unitPatrol(obj_id unit, transform[] path) throws InterruptedException - { - unitClearPatrolPath(unit); - unitAddPatrolPath(unit, path); - } - - - public static void squadPatrol(int squadId, transform[] path) throws InterruptedException - { - squadClearPatrolPath(squadId); - squadAddPatrolPath(squadId, path); - } - - - public static transform[] createPatrolPathCircle(vector position_w, float radius) throws InterruptedException - { - final int points = 20; - transform path[] = new transform[points]; - - for (int i = 0; i < points; ++i) - { - testAbortScript(); - final float radian = (float)Math.PI * 2.0f * ((float)i / (float)points); - final float x = position_w.x + (float)Math.sin(radian) * radius; - final float y = position_w.y; - final float z = position_w.z + (float)Math.cos(radian) * radius; - path[i] = transform.identity.setPosition_p(x, y, z); - } - - return path; - } - - - public static transform[] createPatrolPathLoiter(transform transform_w, float minDist, float maxDist) throws InterruptedException - { - final int points = 20; - transform path[] = new transform[points]; - for (int i = 0; i < points; ++i) - { - testAbortScript(); - final vector direction = vector.randomUnit(); - vector position = transform_w.getPosition_p().add(direction.multiply(minDist + (float)Math.random() * (maxDist - minDist))); - path[i] = transform.identity.setPosition_p(position); - } - - return path; - } - - - public static void unitLoiter(obj_id unit, transform transform_w, float minDist, float maxDist) throws InterruptedException - { - unitPatrol(unit, createPatrolPathLoiter(transform_w, minDist, maxDist)); - } - - - public static void squadLoiter(int squadId, transform transform_w, float minDist, float maxDist) throws InterruptedException - { - squadPatrol(squadId, createPatrolPathLoiter(transform_w, minDist, maxDist)); - } - - - public static void unitClearPatrolPath(obj_id unit) throws InterruptedException - { - _spaceUnitClearPatrolPath(unit); - } - - - public static void squadClearPatrolPath(int squadId) throws InterruptedException - { - obj_id[] unitList = squadGetUnitList(squadId); - - for (int i = 0; i < unitList.length; ++i) - { - testAbortScript(); - _spaceUnitClearPatrolPath(unitList[i]); - } - } - - - public static void unitFollow(obj_id unit, obj_id followedUnit, vector direction_o, float distance) throws InterruptedException - { - _spaceUnitFollow(unit, followedUnit, direction_o, distance); - } - - - public static void squadFollow(int squadId, obj_id followedUnit, vector direction_o, float distance) throws InterruptedException - { - _spaceSquadFollow(squadId, followedUnit, direction_o, distance); - } - - - public static void unitAddDamageTaken(obj_id unit, obj_id targetUnit, float damage) throws InterruptedException - { - _spaceUnitAddDamageTaken(unit, targetUnit, damage); - } - - - public static void unitSetAttackOrders(obj_id unit, int attackOrders) throws InterruptedException - { - - LOG("space_debug_ai", "Attack Orders received for: "+ unit + " order: "+ attackOrders); - - _spaceUnitSetAttackOrders(unit, attackOrders); - } - - - public static void squadSetAttackOrders(int squadId, int attackOrders) throws InterruptedException - { - obj_id[] unitList = squadGetUnitList(squadId); - - for (int i = 0; i < unitList.length; ++i) - { - testAbortScript(); - unitSetAttackOrders(unitList[i], attackOrders); - } - } - - - public static void unitSetLeashDistance(obj_id unit, float distance) throws InterruptedException - { - _spaceUnitSetLeashDistance(unit, distance); - } - - - public static void squadSetLeashDistance(int squadId, float distance) throws InterruptedException - { - obj_id[] unitList = squadGetUnitList(squadId); - - for (int i = 0; i < unitList.length; ++i) - { - testAbortScript(); - unitSetLeashDistance(unitList[i], distance); - } - } - - - public static void unitSetPilotType(obj_id unit, String pilotType) throws InterruptedException - { - _spaceUnitSetPilotType(unit, pilotType); - } - - - public static String unitGetPilotType(obj_id unit) throws InterruptedException - { - return _spaceUnitGetPilotType(unit); - } - - - public static obj_id unitGetPrimaryAttackTarget(obj_id unit) throws InterruptedException - { - return _spaceUnitGetPrimaryAttackTarget(unit); - } - - - public static obj_id[] unitGetAttackTargetList(obj_id unit) throws InterruptedException - { - return _spaceUnitGetAttackTargetList(unit); - } - - - public static obj_id[] unitGetWhoIsTargetingMe(obj_id unit) throws InterruptedException - { - return _spaceUnitGetWhoIsTargetingMe(unit); - } - - - public static boolean unitIsAttacking(obj_id unit) throws InterruptedException - { - return _spaceUnitIsAttacking(unit); - } - - - public static void unitIncreaseHate(obj_id unit, obj_id unitToHate, float amountToHate, float hateDelay, int maxRecursions) throws InterruptedException - { - if ((!isIdValid(unit)) || isPlayer(unit) || !isIdValid(unitToHate)) - { - return; - } - - if (!exists(unitToHate) || !unitToHate.isLoaded()) - { - return; - } - - --maxRecursions; - if (maxRecursions < 1) - { - return; - } - else if (maxRecursions > 20) - { - maxRecursions = 20; - } - - if (hateDelay < 10.0f) - { - hateDelay = 10.0f; - } - - if (unitGetPrimaryAttackTarget(unit) != unitToHate) - { - unitAddDamageTaken(unit, unitToHate, amountToHate); - } - - dictionary parms = new dictionary(); - parms.put( "unitToHate", unitToHate ); - parms.put( "amountToHate", amountToHate ); - parms.put( "hateDelay", hateDelay ); - parms.put( "maxRecursions", maxRecursions ); - messageTo( unit, "handleUnitIncreaseHate", parms, hateDelay, false ); - } - - - public static void unitRemoveAttackTarget(obj_id unit, obj_id unitToRemove) throws InterruptedException - { - _spaceUnitRemoveAttackTarget(unit, unitToRemove); - } - - - public static void unitRemoveFromAllAttackTargetLists(obj_id unit) throws InterruptedException - { - obj_id[] whoIsTargetingMeList = unitGetWhoIsTargetingMe(unit); - - for (int index = 0; index < whoIsTargetingMeList.length; ++index) - { - testAbortScript(); - if (exists(whoIsTargetingMeList[index]) && (whoIsTargetingMeList[index].isLoaded())) - { - if (!space_utils.isPlayerControlledShip(whoIsTargetingMeList[index])) - { - unitRemoveAttackTarget(whoIsTargetingMeList[index], unit); - } - else - { - LOG("space", whoIsTargetingMeList[index] + " was passed into getWhoistargetingme but it's a PLAYER"); - } - } - else - { - LOG("space", whoIsTargetingMeList[index] + " was passed into unitGetWhoIsTargetingMe but doesn't exist on the server"); - - } - } - } - - - public static void unitSetPrimaryTarget(obj_id unit, obj_id targetUnit) throws InterruptedException - { - unitAddDamageTaken(unit, targetUnit, 100000.0f); - } - - - public static void unitAddTarget(obj_id unit, obj_id targetUnit) throws InterruptedException - { - unitAddDamageTaken(unit, targetUnit, 100.0f); - } - - - public static void squadSetPrimaryTarget(int squadId, obj_id targetUnit) throws InterruptedException - { - obj_id[] unitList = squadGetUnitList(squadId); - - for (int i = 0; i < unitList.length; ++i) - { - testAbortScript(); - unitAddDamageTaken(unitList[i], targetUnit, 100000.0f); - } - } - - - public static void squadAddTarget(int squadId, obj_id targetUnit) throws InterruptedException - { - obj_id[] unitList = squadGetUnitList(squadId); - - for (int i = 0; i < unitList.length; ++i) - { - testAbortScript(); - unitAddDamageTaken(unitList[i], targetUnit, 100.0f); - } - } - - - public static void squadSetPrimaryTarget(int squadId, int targetSquadId) throws InterruptedException - { - obj_id[] unitList = squadGetUnitList(squadId); - obj_id[] targetUnitList = squadGetUnitList(targetSquadId); - - for (int i = 0; i < unitList.length; ++i) - { - testAbortScript(); - for (int j = 0; j < targetUnitList.length; ++j) - { - testAbortScript(); - unitAddDamageTaken(unitList[i], targetUnitList[j], (float)Math.random() * 100000.0f + 100000.0f); - } - } - } - - - public static void squadAddTarget(int squadId, int targetSquadId) throws InterruptedException - { - obj_id[] unitList = squadGetUnitList(squadId); - obj_id[] targetUnitList = squadGetUnitList(targetSquadId); - - for (int i = 0; i < unitList.length; ++i) - { - testAbortScript(); - for (int j = 0; j < targetUnitList.length; ++j) - { - testAbortScript(); - unitAddDamageTaken(unitList[i], targetUnitList[j], (float)Math.random() * 100.0f + 100.0f); - } - } - } - - - public static void unitSetSquadId(obj_id unit, int squadId) throws InterruptedException - { - LOG("space_debug_ai", "unit: "+ unit + " unitGetSquadId: "+_spaceUnitGetSquadId(unit)); - - _spaceUnitSetSquadId(unit, squadId); - - LOG("space_debug_ai", "unit: "+ unit + " unitGetSquadId: "+_spaceUnitGetSquadId(unit)); - } - - - public static int unitGetSquadId(obj_id unit) throws InterruptedException - { - return _spaceUnitGetSquadId(unit); - } - - - public static int squadCreateSquadId() throws InterruptedException - { - return _spaceSquadCreateSquadId(); - } - - - public static int squadRemoveUnit(obj_id unit) throws InterruptedException - { - return _spaceSquadRemoveUnit(unit); - } - - - public static int squadCombine(int squadId1, int squadId2) throws InterruptedException - { - return _spaceSquadCombine(squadId1, squadId2); - } - - - public static int squadGetSize(int squadId) throws InterruptedException - { - return _spaceSquadGetSize(squadId); - } - - - public static obj_id[] squadGetUnitList(int squadId) throws InterruptedException - { - return _spaceSquadGetUnitList(squadId); - } - - - public static void squadSetFormation(int squadId, int formation) throws InterruptedException - { - _spaceSquadSetFormation(squadId, formation); - } - - - public static void squadSetFormationRandom(int squadId) throws InterruptedException - { - Random random = new Random(); - final int value = Math.abs(random.nextInt()) % 6; - int formation = FORMATION_INVALID; - - switch (value) - { - case 0: - { - formation = FORMATION_CLAW; - } - break; - case 1: - { - formation = FORMATION_WALL; - } - break; - case 2: - { - formation = FORMATION_SPHERE; - } - break; - case 3: - { - formation = FORMATION_DELTA; - } - break; - case 4: - { - formation = FORMATION_BROAD; - } - break; - case 5: - { - formation = FORMATION_X; - } - break; - } - _spaceSquadSetFormation(squadId, formation); - } - - - public static void squadSetFormationSpacing(int squadId, float scale) throws InterruptedException - { - _spaceSquadSetFormationSpacing(squadId, scale); - } - - - public static int squadGetFormation(int squadId) throws InterruptedException - { - return _spaceSquadGetFormation(squadId); - } - - - public static void squadSetLeader(int squadId, obj_id unit) throws InterruptedException - { - _spaceSquadSetLeader(squadId, unit); - } - - - public static obj_id squadGetLeader(int squadId) throws InterruptedException - { - return _spaceSquadGetLeader(squadId); - } - - - public static void squadSetGuardTarget(int squad, int targetSquad) throws InterruptedException - { - _spaceSquadSetGuardTarget(squad, targetSquad); - } - - - public static boolean squadIsGuarding(int squad) throws InterruptedException - { - return (squadGetGuardTarget(squad) == 0); - } - - - public static int squadGetGuardTarget(int squad) throws InterruptedException - { - return _spaceSquadGetGuardTarget(squad); - } - - - public static void squadRemoveGuardTarget(int squad) throws InterruptedException - { - _spaceSquadRemoveGuardTarget(squad); - } - - - public static void unitDock(obj_id unit, obj_id dockTarget, float timeAtDock) throws InterruptedException - { - _spaceUnitDock(unit, dockTarget, timeAtDock); - } - - - public static void unitDock(obj_id unit, obj_id dockTarget) throws InterruptedException - { - unitDock(unit, dockTarget, -1.0f); - } - - - public static void unitUnDock(obj_id unit) throws InterruptedException - { - _spaceUnitUnDock(unit); - } - - - public static boolean unitIsDocked(obj_id unit) throws InterruptedException - { - return _spaceUnitIsDocked(unit); - } - - - public static boolean unitIsDocking(obj_id unit) throws InterruptedException - { - return _spaceUnitIsDocking(unit); - } - - - public static void unitSetAutoAggroImmuneTime(obj_id unit, float time) throws InterruptedException - { - _spaceUnitSetAutoAggroImmuneTime(unit, time); - } - - - public static void unitSetAutoAggroImmune(obj_id unit, boolean enabled) throws InterruptedException - { - _spaceUnitSetAutoAggroImmuneTime(unit, enabled ? -1.0f : 0.0f); - } - - - public static boolean unitIsAutoAggroImmune(obj_id unit) throws InterruptedException - { - return _spaceUnitIsAutoAggroImmune(unit); - } - - - public static void unitSetDamageAggroImmune(obj_id unit, boolean enabled) throws InterruptedException - { - _spaceUnitSetDamageAggroImmune(unit, enabled); - } - - - public static transform unitGetDockTransform(obj_id dockTarget, obj_id dockingUnit) throws InterruptedException - { - return _spaceUnitGetDockTransform(dockTarget, dockingUnit); - } - - - public static void unitAddExclusiveAggro(obj_id unit, obj_id pilot) throws InterruptedException - { - _spaceUnitAddExclusiveAggro(unit, pilot); - } - - - public static void unitRemoveExclusiveAggro(obj_id unit, obj_id pilot) throws InterruptedException - { - _spaceUnitRemoveExclusiveAggro(unit, pilot); - } - - - public static boolean isSquadIdValid(int squadId) throws InterruptedException - { - return _spaceSquadIsSquadIdValid(squadId); - } - - - public static boolean isShipDead(obj_id ship) throws InterruptedException - { - if (!isIdValid( ship )) - { - return true; - } - - if (!ship.isLoaded()) - { - return true; - } - - return ( hasObjVar( ship, "ship.isDead" ) ); - } - - - public static boolean isPlayerShip(obj_id ship) throws InterruptedException - { - obj_id pilot = getPilotId( ship ); - if (isIdValid( pilot )) - { - return ( isPlayer( pilot ) ); - } - else - { - return false; - } - } - - - public static boolean isShipAggro(obj_id ship) throws InterruptedException - { - if (isPlayerShip(ship)) - { - return false; - } - - if (!hasObjVar( ship, "ship.shipName" )) - { - return true; - } - - String shipName = getStringObjVar( ship, "ship.shipName"); - return ( dataTableGetInt( "datatables/space_mobile/space_mobile.iff", shipName, "isAggro" ) == 1 ); - } - - - public static boolean isShipAggroToward(obj_id ship, obj_id target) throws InterruptedException - { - String shipFaction = getShipFaction( ship ); - String targetFaction = getShipFaction( target ); - if (shipFaction == null || targetFaction == null) - { - return false; - } - - if (shipFaction.equals(targetFaction)) - { - return false; - } - - if (!hasObjVar( ship, "ship.shipName" )) - { - return false; - } - - String shipName = getStringObjVar( ship, "ship.shipName"); - String enemyFactionList = dataTableGetString( "datatables/space_mobile/space_mobile.iff", shipName, "enemyFactions"); - if (enemyFactionList == null) - { - return false; - } - - String[] enemiesList = split( enemyFactionList, ','); - for (int i = 0; i < enemiesList.length; i++) - { - testAbortScript(); - if (enemiesList[i].equals( targetFaction )) - { - return true; - } - } - - return false; - } - - - public static boolean isShipAlliedWith(obj_id ship, obj_id target) throws InterruptedException - { - if (!isShipSocial( ship )) - { - return false; - } - - String shipFaction = getShipFaction( ship ); - String targetFaction = getShipFaction( target ); - if (shipFaction == null || targetFaction == null) - { - return false; - } - - if (shipFaction.equals(targetFaction)) - { - return true; - } - - if (!hasObjVar( ship, "ship.shipName" )) - { - return false; - } - - String shipName = getStringObjVar( ship, "ship.shipName"); - String allyFactionList = dataTableGetString( "datatables/space_mobile/space_mobile.iff", shipName, "alliedFactions"); - if (allyFactionList == null) - { - return false; - } - - String[] allyList = split( allyFactionList, ','); - for (int i = 0; i < allyList.length; i++) - { - testAbortScript(); - if (allyList[i].equals( targetFaction )) - { - return true; - } - } - - return false; - } - - - public static boolean isShipSocial(obj_id ship) throws InterruptedException - { - if (!hasObjVar( ship, "ship.shipName" )) - { - return true; - } - - String shipName = getStringObjVar( ship, "ship.shipName"); - - String enemyFactionList = dataTableGetString( "datatables/space_mobile/space_mobile.iff", shipName, "enemyFactions"); - String allyFactionList = dataTableGetString( "datatables/space_mobile/space_mobile.iff", shipName, "alliedFactions"); - if (enemyFactionList == null || allyFactionList == null) - { - return false; - } - - if (enemyFactionList.equals("") || allyFactionList.equals("")) - { - return false; - } - - return true; - } - - - public static boolean isSameFaction(obj_id ship, obj_id target) throws InterruptedException - { - String shipFaction = getShipFaction( ship ); - String targetFaction = getShipFaction( target ); - if (shipFaction == null || targetFaction == null) - { - return false; - } - - return (shipFaction.equals(targetFaction)); - } - - - public static obj_id[] getGroupShips(obj_id group, obj_id primaryTarget) throws InterruptedException - { - obj_id[] groupMembers = getGroupMemberIds( group ); - Vector groupShips = new Vector(); - groupShips.add( primaryTarget ); - for (int i = 0; i < groupMembers.length; i++) - { - testAbortScript(); - - if (groupMembers[i].isLoaded()) - { - obj_id ship = getPilotedShip( groupMembers[i] ); - - if (isIdValid(ship) && ship != primaryTarget && getDistance( ship, primaryTarget ) < 120.0f) - { - groupShips.add( ship ); - } - } - } - - obj_id[] returnArray = new obj_id[groupShips.size()]; - groupShips.toArray( returnArray ); - return returnArray; - } - - - public static String unitGetBehaviorString(int behavior) throws InterruptedException - { - String result; - - switch (behavior) - { - default: - { - result = "invalid"; - } - break; - case BEHAVIOR_IDLE: - { - result = "BEHAVIOR_IDLE"; - } - break; - case BEHAVIOR_MOVETO: - { - result = "BEHAVIOR_MOVETO"; - } - break; - case BEHAVIOR_PATROL: - { - result = "BEHAVIOR_PATROL"; - } - break; - case BEHAVIOR_FOLLOW: - { - result = "BEHAVIOR_FOLLOW"; - } - break; - case BEHAVIOR_TRACK: - { - result = "BEHAVIOR_TRACK"; - } - break; - } - - LOG("space_debug_ai", "unitGetBehaviorString: "+ result); - - return result; - } - - - public static String unitGetAttackOrdersString(int attackOrders) throws InterruptedException - { - String result; - - switch (attackOrders) - { - default: - { - result = "invalid"; - } - break; - case ATTACK_ORDERS_HOLD_FIRE: - { - result = "ATTACK_ORDERS_HOLD_FIRE"; - } - break; - case ATTACK_ORDERS_RETURN_FIRE: - { - result = "ATTACK_ORDERS_DEFEND"; - } - break; - case ATTACK_ORDERS_ATTACK_FREELY: - { - result = "ATTACK_ORDERS_ATTACK_FREELY"; - } - break; - } - LOG("space_debug_ai", "unitGetAttackOrdersString: "+ result); - - return result; - } - - - public static void spaceAttack(obj_id ship, obj_id target) throws InterruptedException - { - unitAddDamageTaken(ship, target, 100000.0f); - } - - - public static void spaceAttack(obj_id ship, obj_id[] targets) throws InterruptedException - { - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - unitAddDamageTaken(ship, targets[i], 100000.0f); - } - } - - - public static obj_id spaceGetPrimaryTarget(obj_id ship) throws InterruptedException - { - return unitGetPrimaryAttackTarget(ship); - } - - - public static boolean spaceIsInCombat(obj_id ship) throws InterruptedException - { - return unitIsAttacking(ship); - } - - - public static void spaceStopAttack(obj_id ship) throws InterruptedException - { - unitSetAttackOrders(ship, ATTACK_ORDERS_HOLD_FIRE); - } - - - public static void spaceStopAttack(obj_id ship, obj_id target) throws InterruptedException - { - unitRemoveAttackTarget(ship, target); - } - - - public static void spaceGuard(obj_id ship, obj_id target) throws InterruptedException - { - debugServerConsoleMsg( ship, "Guarding is not supported ATM"); - } - - - public static void spaceGuard(obj_id ship, obj_id[] targets) throws InterruptedException - { - debugServerConsoleMsg( ship, "Guarding is not supported ATM"); - } - - - public static Vector spaceGetGuardList(obj_id ship) throws InterruptedException - { - debugServerConsoleMsg( ship, "Guarding is not supported ATM"); - return null; - } - - - public static boolean spaceIsGuarding(obj_id ship, obj_id target) throws InterruptedException - { - debugServerConsoleMsg( ship, "Guarding is not supported ATM"); - return false; - } - - - public static void spaceStopGuarding(obj_id ship, obj_id target) throws InterruptedException - { - debugServerConsoleMsg( ship, "Guarding is not supported ATM"); - } - - - public static void spaceMoveTo(obj_id ship, transform position) throws InterruptedException - { - unitMoveTo(ship, position); - } - - - public static void spaceMoveTo(obj_id ship, transform[] path) throws InterruptedException - { - unitMoveTo(ship, path); - } - - - public static void spacePatrol(obj_id ship, transform[] transforms) throws InterruptedException - { - unitAddPatrolPath(ship, transforms); - } - - - public static void spaceStop(obj_id ship) throws InterruptedException - { - unitIdle(ship); - } - - - public static void spaceLoiter(obj_id ship, transform transform_w, float minDist, float maxDist) throws InterruptedException - { - unitLoiter(ship, transform_w, minDist, maxDist); - } - - - public static void spaceFollow(obj_id ship, obj_id target, float dist) throws InterruptedException - { - unitFollow(ship, target, new vector(0.0f, 0.0f, 1.0f), dist); - } - - - public static void spaceFollow(obj_id ship, obj_id target) throws InterruptedException - { - spaceFollow( ship, target, DEFAULT_FOLLOW_DISTANCE ); - } - - - public static void spaceFollowInFormation(obj_id ship, obj_id target, int formationType) throws InterruptedException - { - spaceFollow( ship, target, DEFAULT_FOLLOW_DISTANCE ); - } - - - public static int spaceGetShipBehavior(obj_id ship) throws InterruptedException - { - return unitGetBehavior(ship); - } - - - public static obj_id[] getWhoIsTargetingShip(obj_id ship) throws InterruptedException - { - return unitGetWhoIsTargetingMe(ship); - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/smuggler.java b/sku.0/sys.server/compiled/game/script/library/smuggler.java deleted file mode 100644 index f4e6ea48c..000000000 --- a/sku.0/sys.server/compiled/game/script/library/smuggler.java +++ /dev/null @@ -1,1812 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.chat; -import script.library.skill; -import script.library.prose; -import script.library.luck; -import script.library.static_item; -import script.library.utils; -import script.library.corpse; -import script.library.groundquests; - - -public class smuggler extends script.base_script -{ - public smuggler() - { - } - public static final String TBL = "datatables/npc/junk_dealer/junk_dealer.iff"; - - public static final String SCRIPTVAR_JUNK_SUI = "relicdealer.biogenic.sui"; - public static final String SCRIPTVAR_JUNK_IDS = "relicdealer.biogenic.ids"; - - public static final String SCRIPTVAR_SOLD = "soldAsJunk"; - - public static final String STF = "loot_dealer"; - - public static final string_id PROSE_NO_BUY_FENCE = new string_id(STF, "prose_no_buy_smuggler"); - public static final string_id PROSE_NO_BUY_FENCE_ALL = new string_id(STF, "prose_no_buy_all_smuggler"); - public static final string_id PROSE_NO_BUY = new string_id(STF, "prose_no_buy"); - public static final string_id PROSE_NO_BUY_ALL = new string_id(STF, "prose_no_buy_all"); - public static final string_id PROSE_SOLD_JUNK_FENCE = new string_id(STF, "prose_sold_junk_smuggler"); - public static final string_id PROSE_NO_SALE_FENCE = new string_id(STF, "prose_no_sale_smuggler"); - public static final string_id PROSE_SOLD_JUNK = new string_id(STF, "prose_sold_junk"); - public static final string_id PROSE_NO_SALE = new string_id(STF, "prose_no_sale"); - public static final string_id PROSE_PURCHASED_JUNK = new string_id(STF, "prose_buy_back_junk"); - public static final string_id PROSE_NO_BUY_BACK = new string_id(STF, "prose_no_buy_back"); - public static final string_id PROSE_SOLD_ALL_JUNK = new string_id(STF, "prose_sold_all_junk"); - public static final string_id PROSE_NO_ALL_SALE = new string_id(STF, "prose_no_all_sale"); - public static final string_id PROSE_JUNK_SOLD = new string_id(STF, "prose_junk_sold"); - public static final string_id SID_NO_BUY_BACK_ITEMS_FOUND = new string_id(STF, "no_buy_back_items_found"); - public static final string_id PROSE_JUNK_SOLD_FENCE = new string_id(STF, "prose_junk_sold_smuggler"); - public static final string_id PROSE_FENCE_COMM_NOTHING = new string_id(STF, "prose_fence_comm_nothing"); - public static final string_id GENERIC_NO_SALE = new string_id(STF, "generic_no_sale"); - public static final string_id SID_NO_SPACE_IN_INVENTORY = new string_id(STF, "no_space_in_inventory"); - - public static final string_id MENU_SELL = new string_id("junk_dealer", "mnu_sell_junk"); - public static final string_id MENU_BUY_BACK = new string_id("junk_dealer", "mnu_buy_back_junk"); - public static final string_id MENU_FLAG_NO_SALE = new string_id("junk_dealer", "mnu_flag_no_sale_junk"); - - public static final String SELL_TITLE = "@"+ STF + ":sell_title"; - public static final String SELL_PROMPT = "@"+ STF + ":sell_prompt"; - public static final String NO_ITEMS_PROMPT = "@"+ STF + ":no_items"; - public static final String BTN_EXAMINE = "@"+ STF + ":examine"; - public static final String BTN_SELL = "@"+ STF + ":btn_sell"; - public static final String BTN_BUY_BACK = "@"+ STF + ":btn_buy_back"; - public static final String BUY_BACK_PROMPT = "@"+ STF + ":buy_back_prompt"; - public static final String BUY_BACK_TITLE = "@"+ STF + ":buy_back_title"; - public static final String SELL_TITLE_FENCE = "@"+ STF + ":sell_title_smuggler"; - public static final String SELL_PROMPT_FENCE = "@"+ STF + ":sell_prompt_smuggler"; - public static final String BTN_SELL_FENCE = "@"+ STF + ":btn_sell_smuggler"; - public static final String BTN_CANCEL_FENCE = "@"+ STF + ":btn_cancel_smuggler"; - public static final String FLAG_NO_SELL_TITLE = "@"+ STF + ":junk_no_sell_title"; - public static final String FLAG_NO_SELL_DESC = "@"+ STF + ":junk_no_sell_desc"; - public static final String FLAG_NO_SELL = "@"+ STF + ":junk_no_sell_button"; - public static final String REFLAG_SELL_TITLE = "@"+ STF + ":junk_reflag_sell_title"; - public static final String REFLAG_SELL_DESC = "@"+ STF + ":junk_reflag_sell_desc"; - public static final String REFLAG_SELL = "@"+ STF + ":junk_reflag_sell_button"; - public static final String FLAG_ITEM_TITLE = "@"+ STF + ":junk_not_found_title"; - public static final String NO_ITEMS_FOUND_PROMPT = "@"+ STF + ":junk_not_found_description"; - - public static final String BUY_BACK_CONTROL_DEVICE_TEMPLATE = "object/intangible/buy_back/buy_back_control_device.iff"; - - public static final string_id[] PROSE_FENCE_COMM = - { - new string_id(STF, "prose_fence_comm"), - new string_id(STF, "prose_fence_comm_1"), - new string_id(STF, "prose_fence_comm_2") - }; - public static final String[] COMM_SPECIES = - { - "object/mobile/dressed_borvos_thief.iff", - "object/mobile/dressed_corsair_cutthroat_hum_m.iff", - "object/mobile/dressed_binayre_thief_twk_male_01.iff", - "object/mobile/dressed_binayre_goon_bith_male_01.iff", - "object/mobile/dressed_cobral_mugger_human_male_01.iff" - }; - - public static final String[] COMM_SOUND = - { - "sound/sys_comm_other.snd", - "sound/sys_comm_generic.snd", - "sound/sys_comm_imperial.snd", - "sound/sys_comm_rebel_male.snd" - }; - - public static final string_id SID_CONTRABAND_FOUND = new string_id( "smuggler/messages", "contraband_found"); - - public static final float FENCE_MULTIPLIER_LOW = 0.80f; - public static final float FENCE_MULTIPLIER = 0.85f; - public static final float FENCE_MULTIPLIER_HIGH = 0.95f; - - public static final int TIER_1_ILLICIT_SELL_VALUE = 1000; - public static final int TIER_2_ILLICIT_SELL_VALUE = 2500; - public static final int TIER_3_ILLICIT_SELL_VALUE = 5000; - public static final int TIER_4_ILLICIT_SELL_VALUE = 7500; - public static final int TIER_5_ILLICIT_SELL_VALUE = 10000; - - public static final int TIER_1_GENERIC_FRONT_COST = 500; - public static final int TIER_2_GENERIC_FRONT_COST = 1000; - public static final int TIER_3_GENERIC_FRONT_COST = 2000; - public static final int TIER_4_GENERIC_FRONT_COST = 3000; - public static final int TIER_5_GENERIC_FRONT_COST = 5000; - - public static final int TIER_4_GENERIC_PVP_FRONT_COST = 13000; - public static final int TIER_5_GENERIC_PVP_FRONT_COST = 18000; - - public static final String BUYBACK_OBJ_TIMESTAMP = "buyback.timeMoved"; - public static final String BUYBACK_OBJ_CREDITS = "buyback.credits"; - public static final String BUYBACK_OBJ_SOLD = "buyback.soldAsJunk"; - public static final String BUYBACK_CONTAINER_VAR = "buyBackContainer"; - public static final String JUNK_DEALKER_NO_SALE_FLAG = "doNotSellFlag"; - - public static final boolean LOGGING_ON = true; - public static final String LOGNAME = "junk_log"; - - - public static obj_id[] getAllJunkItems(obj_id player) throws InterruptedException - { - return getAllJunkItems(player, false); - } - - - public static obj_id[] getAllJunkItems(obj_id player, boolean getFlaggedNoSale) throws InterruptedException - { - - if (!isIdValid(player)) - { - return null; - } - - obj_id[] contents = utils.getFilteredPlayerContents(player); - - if ((contents != null) && (contents.length > 0)) - { - Vector junk = new Vector(); - junk.setSize(0); - - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - - if (!validateItemsBeingSold(player, contents[i])) - { - continue; - } - - if (!getFlaggedNoSale && hasObjVar(contents[i], JUNK_DEALKER_NO_SALE_FLAG)) - { - continue; - } - - if (hasObjVar(contents[i], "noTrade") || utils.isEquipped(contents[i])) - { - continue; - } - - if (hasObjVar(contents[i], "junkDealer.intPrice")) - { - junk = utils.addElement(junk, contents[i]); - } - - else if (static_item.isStaticItem(contents[i])) - { - if (static_item.getStaticObjectValue(getStaticItemName(contents[i])) > 0) - { - junk = utils.addElement(junk, contents[i]); - } - } - - else - { - if (!isCrafted(contents[i])) - { - - String template = getTemplateName(contents[i]); - - if ((template != null) && (!template.equals(""))) - { - - if (dataTableGetInt(TBL, template, "price") > 0) - { - - junk = utils.addElement(junk, contents[i]); - } - } - } - } - } - - if ((junk != null) && (junk.size() > 0)) - { - - return utils.toStaticObjIdArray(junk); - } - } - - return null; - } - - - public static void showSellJunkSui(obj_id player, obj_id salesman, boolean fence, boolean showCommWindow) throws InterruptedException - { - - if (!isIdValid(player) || !isValidId(salesman)) - { - return; - } - - if (player != salesman) - { - if (utils.outOfRange(salesman, player, 10.0f, true)) - { - return; - } - } - - if (utils.hasScriptVar(player, SCRIPTVAR_JUNK_SUI)) - { - - int pidClose = utils.getIntScriptVar(player, SCRIPTVAR_JUNK_SUI); - cleanupSellJunkSui(player); - - sui.closeSUI(player, pidClose); - } - - obj_id[] junk = getAllJunkItems(player); - - String strSpecies = COMM_SPECIES[rand(0, COMM_SPECIES.length-1)]; - String strSound = COMM_SOUND[rand(0, COMM_SOUND.length-1)]; - - if (junk != null && junk.length > 0) - { - if (showCommWindow && fence) - { - prose_package ppfence = prose.getPackage(PROSE_FENCE_COMM[rand(0, PROSE_FENCE_COMM.length-1)]); - commPlayers(player, strSpecies, strSound, 7f, player, ppfence); - } - - float cashMultiplier = 1.0f; - if (fence) - { - int playerLevel = getLevel(player); - cashMultiplier = FENCE_MULTIPLIER_LOW; - - if (playerLevel > 55) - { - cashMultiplier = FENCE_MULTIPLIER; - } - if (playerLevel > 80) - { - cashMultiplier = FENCE_MULTIPLIER_HIGH; - } - } - - String[] entries = new String[junk.length]; - - for (int i = 0; i < junk.length; i++) - { - testAbortScript(); - int price = (int)(getPrice(junk[i])); - if (fence) - { - - price = (int)(getPrice(junk[i]) * cashMultiplier); - } - - String name = getAssignedName(junk[i]); - if (name.equals("") || name == null) - { - name = getString(getNameStringId(junk[i])); - } - String entry = "["+ price + "] "+ name; - - entries[i] = entry; - - } - - if (entries != null && entries.length > 0) - { - String title = SELL_TITLE; - String description = SELL_PROMPT; - String buttonSell = BTN_SELL; - - if (fence) - { - title = SELL_TITLE_FENCE; - description = SELL_PROMPT_FENCE; - buttonSell = BTN_SELL_FENCE; - utils.setScriptVar(player, "fence", true); - } - else - { - utils.setScriptVar(player, "fence", false); - } - - int pid = sui.listbox(salesman, player, description, sui.OK_CANCEL_REFRESH, title, entries, "handleSellJunkSui", false, false); - - if (pid > -1) - { - - setSUIProperty(pid, sui.LISTBOX_BTN_OK, sui.PROP_TEXT, buttonSell); - setSUIProperty (pid, sui.LISTBOX_BTN_OTHER, sui.PROP_VISIBLE, "true"); - setSUIProperty (pid, sui.LISTBOX_BTN_OTHER, sui.PROP_TEXT, BTN_EXAMINE); - subscribeToSUIProperty (pid, "this", sui.LISTBOX_PROP_OTHER_PRESSED); - showSUIPage(pid); - - utils.setScriptVar(player, SCRIPTVAR_JUNK_SUI, pid); - utils.setBatchScriptVar(player, SCRIPTVAR_JUNK_IDS, junk); - } - } - } - - else - { - if (fence) - { - prose_package ppfence = prose.getPackage(PROSE_FENCE_COMM_NOTHING); - commPlayers(player, strSpecies, strSound, 7f, player, ppfence); - } - else - { - int msgPid = sui.msgbox(salesman, player, NO_ITEMS_PROMPT, sui.OK_ONLY, SELL_TITLE, "noHandler"); - } - cleanupSellJunkSui(player); - } - } - - - public static void cleanupSellJunkSui(obj_id player) throws InterruptedException - { - utils.removeScriptVar(player, "fence"); - utils.removeScriptVar(player, SCRIPTVAR_JUNK_SUI); - utils.removeBatchScriptVar(player, SCRIPTVAR_JUNK_IDS); - } - - - public static void sellJunkItem(obj_id player, obj_id item, boolean fence, boolean reshowSui) throws InterruptedException - { - obj_id salesman = getSelf(); - - if (!isIdValid(player) || !isIdValid(item)) - { - return; - } - - if (salesman != player) - { - blog("smuggler.sellJunkItem() the salesperson is not the player."); - - if (utils.outOfRange(salesman, player, 10.0f, true)) - { - return; - } - } - - if (!validateItemsBeingSold(player, item)) - { - prose_package ppSold = prose.getPackage(GENERIC_NO_SALE, item); - sendSystemMessageProse(player, ppSold); - return; - } - - if (hasObjVar(item, BUYBACK_OBJ_SOLD)) - { - prose_package ppSold = prose.getPackage(PROSE_JUNK_SOLD, item); - sendSystemMessageProse(player, ppSold); - return; - } - - float cashMultiplier = 1.0f; - if (fence) - { - int playerLevel = getLevel(player); - cashMultiplier = FENCE_MULTIPLIER_LOW; - - if (playerLevel > 55) - { - cashMultiplier = FENCE_MULTIPLIER; - } - if (playerLevel > 80) - { - cashMultiplier = FENCE_MULTIPLIER_HIGH; - } - } - - int price = (int)(getPrice(item)); - if (fence) - { - price = (int)(getPrice(item) * cashMultiplier); - } - - if (price > 0 && !hasObjVar(item, "quest_item")) - { - dictionary params = new dictionary(); - params.put("item",item); - params.put("price",price); - params.put("reshowSui", reshowSui); - - if (luck.isLucky(player, 0.01f)) - { - float bonus = price * 0.2f; - if (bonus < 1.0f) - { - bonus = 1.0f; - } - - price += bonus; - } - - if (fence) - { - blog("smuggler.sellJunkItem() this is a fence player"); - params.put("fence", true); - } - else - { - blog("smuggler.sellJunkItem() this is NOT a fence player"); - params.put("fence", false); - } - - money.systemPayout(money.ACCT_JUNK_DEALER, player, price, "handleSoldJunk", params); - - int calendarTime = getCalendarTime(); - String realTime = getCalendarTimeStringLocal(calendarTime); - String playerName = getName(player); - String itemName = getEncodedName(item); - CustomerServiceLog("Junk_Dealer: ", "smuggler.sellJunkItem() - Player ("+ playerName + " OID: "+ player + ") sold item ("+ itemName + " OID: "+ item + ") for ("+ price + ")credits, at ("+ realTime + ")"); - - if (!fence && (player != salesman)) - { - obj_id master = utils.getObjIdScriptVar(salesman, "smugglerMaster"); - - if (isIdValid(master) && group.inSameGroup(player, master)) - { - dictionary junkParams = new dictionary(); - params.put("item",item); - params.put("price",price); - params.put("reshowSui", false); - - int smugglerCut = (int)getSkillStatisticModifier(master, "expertise_junk_dealer_cut"); - - if (smugglerCut > 0) - { - price = (int)((float)price * (float)smugglerCut * 0.01f); - - money.systemPayout(money.ACCT_RELIC_DEALER, master, price, "handleSoldJunk", junkParams); - - CustomerServiceLog("Junk_Dealer: ", "smuggler.sellJunkItem() - Player ("+ playerName + " OID: "+ player + ") sold item ("+ itemName + " OID: "+ item + ") for ("+ price + ")credits, at ("+ realTime + ")"); - - int totalProfits = utils.getIntScriptVar(salesman, "totalProfits"); - - totalProfits += price; - - utils.setScriptVar(salesman, "totalProfits", totalProfits); - } - } - } - } - - else - { - prose_package ppNoBuy = prose.getPackage(PROSE_NO_BUY, salesman, item); - if (fence) - { - ppNoBuy = prose.getPackage(PROSE_NO_BUY_FENCE, salesman, item); - } - sendSystemMessageProse(player, ppNoBuy); - } - } - - - public static void sellJunkItem(obj_id player, obj_id item) throws InterruptedException - { - sellJunkItem(player, item, false); - } - - - public static void sellJunkItem(obj_id player, obj_id item, boolean reshowUi) throws InterruptedException - { - sellJunkItem(player, item, false, reshowUi); - } - - - public static int getPrice(obj_id item) throws InterruptedException - { - int price = 0; - - if (hasObjVar(item, "junkDealer.intPrice")) - { - price = getIntObjVar(item, "junkDealer.intPrice"); - } - else if (static_item.isStaticItem(item)) - { - price = static_item.getStaticObjectValue(getStaticItemName(item)); - } - - else - { - String template = getTemplateName(item); - price = dataTableGetInt(TBL, template, "price"); - } - int intCount = getCount(item); - if (intCount > 0) - { - price = price * intCount; - } - return price; - - } - - - public static boolean checkInventory(obj_id player, obj_id npc) throws InterruptedException - { - String item = ""; - String itemTemplate = ""; - - int itemLength = dataTableGetNumRows(TBL); - - int x = 0; - int y = 0; - - obj_id inventory = utils.getInventoryContainer(player); - - if (isIdValid(inventory)) - { - obj_id[] contents = utils.getContents(inventory, true); - if (contents != null) - { - for (x = 0; x < contents.length; x++) - { - testAbortScript(); - y = 0; - if (!isCrafted(contents[x])) - { - if (static_item.getStaticObjectValue(getStaticItemName(contents[x])) > 0) - { - return true; - } - - itemTemplate = getTemplateName(contents[x]); - while (y < itemLength) - { - testAbortScript(); - item = dataTableGetString(TBL, y, "items"); - - if (itemTemplate.equals(item)) - { - return true; - } - y++; - } - } - } - } - } - return false; - } - - - public static boolean hasItemsInContainer(obj_id item) throws InterruptedException - { - if (getContainerType(item) == 2) - { - obj_id[] subContents = utils.getContents(item); - - if (subContents.length > 0) - { - return true; - } - } - return false; - } - - - public static boolean validateItemsBeingSold(obj_id player, obj_id item) throws InterruptedException - { - if (utils.getContainingPlayer(item) != (player)) - { - return false; - } - - if (hasItemsInContainer(item)) - { - return false; - } - - if (utils.isEquipped(item)) - { - return false; - } - - return true; - } - - - public static boolean canSlyLie(obj_id playerSmuggler) throws InterruptedException - { - location here = getLocation(playerSmuggler); - obj_id[] objects = getObjectsInRange(here, 25); - - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (hasObjVar(objects[i], "quest.owner")) - { - if (playerSmuggler == getObjIdObjVar(objects[i], "quest.owner")) - { - if (utils.hasScriptVar(objects[i], "contrabandCheck")) - { - return true; - } - } - } - } - - return false; - } - - - public static boolean doSlyLie(obj_id playerSmuggler) throws InterruptedException - { - location here = getLocation(playerSmuggler); - obj_id[] objects = getObjectsInRange(here, 25); - - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (hasObjVar(objects[i], "quest.owner")) - { - if (playerSmuggler == getObjIdObjVar(objects[i], "quest.owner")) - { - if (utils.hasScriptVar(objects[i], "contrabandCheck")) - { - utils.setScriptVar(objects[i], "slyLie", 1); - return true; - } - } - } - - } - sendSystemMessage(playerSmuggler, new string_id("smuggler/enemy", "sly_lie_failure")); - - return false; - } - - - public static boolean canFastTalk(obj_id playerSmuggler, obj_id target) throws InterruptedException - { - if (!hasScript(target, "ai.smuggler_spawn_enemy")) - { - - return false; - } - - if (ai_lib.isInCombat(target)) - { - obj_id enemyTarget = getHateTarget(target); - if (enemyTarget != playerSmuggler) - { - - return false; - } - } - - return true; - } - - - public static boolean doFastTalk(obj_id playerSmuggler, obj_id target) throws InterruptedException - { - if (!hasScript(target, "ai.smuggler_spawn_enemy")) - { - - return false; - } - - if (ai_lib.isInCombat(target)) - { - obj_id enemyTarget = getHateTarget(target); - if (enemyTarget != playerSmuggler) - { - - return false; - } - } - - dictionary params = new dictionary(); - params.put("playerSmuggler", playerSmuggler); - - messageTo(target, "fastTalkReaction", params, 0, false); - - return true; - } - - - public static int getSmugglerRank(float underworldFaction) throws InterruptedException - { - if (underworldFaction < 1000.0f) - { - return 0; - } - - if (underworldFaction < 2000.0f) - { - return 1; - } - - if (underworldFaction < 3000.0f) - { - return 2; - } - - return 3; - } - - - public static int getSmuggleTier(float underworldFaction) throws InterruptedException - { - if (underworldFaction < 1000.0f) - { - return 1; - } - - if (underworldFaction < 1500.0f) - { - return 2; - } - - if (underworldFaction < 2000.0f) - { - return 3; - } - - if (underworldFaction < 2500.0f) - { - return 4; - } - - return 5; - } - - - public static boolean hasIllicitContraband(obj_id player) throws InterruptedException - { - String contrabandName = "item_smuggler_contraband_0"; - obj_id[] contents = getInventoryAndEquipment(player); - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (static_item.isStaticItem(contents[i])) - { - String itemName = getStaticItemName(contents[i]); - - if (itemName.startsWith(contrabandName)) - { - return true; - } - } - } - } - - return false; - } - - - public static boolean hasIllicitMissionContraband(obj_id player) throws InterruptedException - { - String contrabandName = "item_smuggler_contraband_0"; - obj_id[] contents = getInventoryAndEquipment(player); - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (static_item.isStaticItem(contents[i])) - { - String itemName = getStaticItemName(contents[i]); - - if (itemName.startsWith(contrabandName)) - { - obj_id[] contrabandToCheck = utils.getAllStaticItemsInPlayerInventory(player, itemName); - - int contrabandCount = utils.countOfStackedItemsInArray(contrabandToCheck); - - if (contrabandCount >= 5) - { - return true; - } - } - } - } - } - - return false; - } - - - public static int getIllicitContrabandTier(String itemName) throws InterruptedException - { - if (itemName.startsWith("item_smuggler_contraband_01")) - { - return 1; - } - - if (itemName.startsWith("item_smuggler_contraband_02")) - { - return 2; - } - - if (itemName.startsWith("item_smuggler_contraband_03")) - { - return 3; - } - - if (itemName.startsWith("item_smuggler_contraband_04")) - { - return 4; - } - - if (itemName.startsWith("item_smuggler_contraband_05")) - { - return 5; - } - - return 0; - } - - - public static String getIllicitMissionContrabandSmugglerTier(obj_id player, int smugglerTier) throws InterruptedException - { - - String contrabandName = "item_smuggler_contraband_0"; - String contrabandFound = ""; - obj_id[] contents = getInventoryAndEquipment(player); - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (static_item.isStaticItem(contents[i])) - { - String itemName = getStaticItemName(contents[i]); - if (itemName.startsWith(contrabandName)) - { - obj_id[] contrabandToCheck = utils.getAllStaticItemsInPlayerInventory(player, itemName); - - int contrabandCount = utils.countOfStackedItemsInArray(contrabandToCheck); - - if (contrabandCount >= 5) - { - int contrabandTier = getIllicitContrabandTier(itemName); - - if (contrabandTier == smugglerTier) - { - return itemName; - } - else - { - contrabandFound = itemName; - } - } - } - } - } - } - - return contrabandFound; - } - - - public static boolean hasMissionContrabandForTransaction(obj_id player, int brokerTier) throws InterruptedException - { - - String contrabandName = "item_smuggler_contraband_0"; - obj_id[] contents = getInventoryAndEquipment(player); - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (static_item.isStaticItem(contents[i])) - { - String itemName = getStaticItemName(contents[i]); - - if (itemName.startsWith(contrabandName)) - { - obj_id[] contrabandToCheck = utils.getAllStaticItemsInPlayerInventory(player, itemName); - - int contrabandCount = utils.countOfStackedItemsInArray(contrabandToCheck); - - if (contrabandCount >= 5) - { - int contrabandTier = getIllicitContrabandTier(itemName); - if (contrabandTier == brokerTier) - { - return true; - } - } - } - } - } - } - - return false; - } - - - public static String getMissionContrabandForTransactionName(obj_id player, int brokerTier) throws InterruptedException - { - String contrabandName = "item_smuggler_contraband_0"; - obj_id[] contents = getInventoryAndEquipment(player); - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (static_item.isStaticItem(contents[i])) - { - String itemName = getStaticItemName(contents[i]); - - if (itemName.startsWith(contrabandName)) - { - obj_id[] contrabandToCheck = utils.getAllStaticItemsInPlayerInventory(player, itemName); - - int contrabandCount = utils.countOfStackedItemsInArray(contrabandToCheck); - - if (contrabandCount >= 5) - { - int contrabandTier = getIllicitContrabandTier(itemName); - if (contrabandTier == brokerTier) - { - return itemName; - } - } - } - } - } - - } - - return ""; - } - - - public static int getMissionCotrabandPointerTier(obj_id player) throws InterruptedException - { - - String contrabandName = "item_smuggler_contraband_0"; - obj_id[] contents = getInventoryAndEquipment(player); - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (static_item.isStaticItem(contents[i])) - { - String itemName = getStaticItemName(contents[i]); - - if (itemName.startsWith(contrabandName)) - { - obj_id[] contrabandToCheck = utils.getAllStaticItemsInPlayerInventory(player, itemName); - - int contrabandCount = utils.countOfStackedItemsInArray(contrabandToCheck); - - if (contrabandCount >= 5) - { - return(getIllicitContrabandTier(itemName)); - } - } - } - } - } - - return 0; - } - - - public static void createRandomContrabandTier(obj_id player, int dropTier) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - - int tierItem = rand(1,5); - - String contrabandToCreate = "item_smuggler_contraband_0"+dropTier +"_0"+tierItem; - - string_id contrabandName = new string_id ("static_item_n", contrabandToCreate); - - obj_id newItem = static_item.createNewItemFunction (contrabandToCreate, pInv); - - prose_package pp = null; - - pp = prose.getPackage(SID_CONTRABAND_FOUND, contrabandName); - - sendSystemMessageProse(player, pp); - - return; - } - - - public static void spaceContrabandDropCheck(obj_id player) throws InterruptedException - { - float underworldFaction = factions.getFactionStanding( player, "underworld"); - int tier = getSmuggleTier(underworldFaction); - - int chance = (12 - tier*2); - int buffFeelingLucky = 0; - - chance += buffFeelingLucky = (int)getSkillStatisticModifier(player, "expertise_increase_smuggler_loot"); - - if (chance >= rand(1,100)) - { - createRandomContrabandTier(player, tier); - if (buffFeelingLucky > 0 && !buff.hasBuff(player, "sm_feeling_lucky") && !buff.hasBuff(player, "sm_feeling_lucky_recourse")) - { - - buff.applyBuff(player, "sm_feeling_lucky"); - } - } - return; - } - - - public static void contrabandDropCheck(obj_id player, obj_id target, int tier, int corpseLevel) throws InterruptedException - { - int dropTier = 0; - - if (corpseLevel > 0 && corpseLevel < 21) - { - dropTier = 1; - } - - if (corpseLevel > 20 && corpseLevel < 41) - { - dropTier = 2; - } - - if (corpseLevel > 40 && corpseLevel < 61) - { - dropTier = 3; - } - - if (corpseLevel > 60 && corpseLevel < 71) - { - dropTier = 4; - } - - if (corpseLevel > 70) - { - dropTier = 5; - } - - if (dropTier > tier) - { - dropTier = tier; - } - - int chance = (12 - (dropTier*2)); - int buffFeelingLucky = 0; - - chance += buffFeelingLucky = (int)getSkillStatisticModifier(player, "expertise_increase_smuggler_loot"); - - utils.setScriptVar(target, "contrabandChecked", 1); - if (chance >= rand(1,100)) - { - createRandomContrabandTier(player, dropTier); - - if (buffFeelingLucky > 0 && !buff.hasBuff(player, "sm_feeling_lucky") && !buff.hasBuff(player, "sm_feeling_lucky_recourse")) - { - - buff.applyBuff(player, "sm_feeling_lucky"); - } - return; - } - sendSystemMessage(player, new string_id("smuggler/messages", "no_contraband_found")); - return; - } - - - public static void inspectCorpseForContraband(obj_id player, obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return; - } - - if (!isMob(target)) - { - return; - } - - if (!isIncapacitated(target)) - { - return; - } - - if (isIncapacitated(player)) - { - return; - } - - if (pet_lib.isPet (target)) - { - return; - } - - if (utils.hasScriptVar(target, "contrabandChecked")) - { - sendSystemMessage(player, new string_id("smuggler/messages", "contraband_already_checked")); - return; - } - - if (!corpse.hasLootPermissions(target, player)) - { - return; - } - - String strLootTable = getStringObjVar(target, "loot.lootTable"); - - if (!strLootTable.startsWith("npc") && (!strLootTable.startsWith("droid"))) - { - sendSystemMessage(player, new string_id("smuggler/messages", "contraband_not_possible")); - return; - } - - float underworldFaction = factions.getFactionStanding( player, "underworld"); - - int smugglerTier = getSmuggleTier(underworldFaction); - - int intLevel = getIntObjVar(target, "intCombatDifficulty"); - - contrabandDropCheck(player, target, smugglerTier, intLevel); - - return; - } - - - public static void removeFromBountyTerminal(obj_id self, int questCrc, boolean failed) throws InterruptedException - { - if (questCrc == (1824374497) || questCrc == (1752998742)) - { - if (hasObjVar(self, "smuggler.bounty")) - { - int bounty = getIntObjVar(self, "smuggler.bounty"); - int current_bounty = 0; - - if (failed) - { - bounty *= 0.95f; - } - - if (hasObjVar(self, "bounty.amount")) - { - current_bounty = getIntObjVar(self, "bounty.amount"); - } - - current_bounty -= bounty; - if (current_bounty <= 0) - { - current_bounty = 0; - removeObjVar(self, "bounty.amount"); - setJediBountyValue(self, 0); - } - else - { - setObjVar(self, "bounty.amount", current_bounty); - setJediBountyValue(self, current_bounty); - } - - if (current_bounty < 15000) - { - obj_id[] hunters = getJediBounties(self); - - dictionary d = new dictionary(); - d.put("target", self); - d.put("bounty", current_bounty); - - if (hunters != null && hunters.length > 0) - { - for (int i = 0; i < hunters.length; i++) - { - testAbortScript(); - messageTo(hunters[i], "handleBountyMissionIncomplete", d, 0.0f, true); - } - } - - removeAllJediBounties(self); - } - - removeObjVar(self, "smuggler.bounty"); - updateJediScriptData(self, "smuggler", 0); - } - } - - return; - } - - - public static void checkSmugglerMissionBountyFailure(obj_id player, obj_id killer) throws InterruptedException - { - if (utils.isProfession(player, utils.SMUGGLER)) - { - if (groundquests.isQuestActive(player, "quest/smuggle_pvp_4") || groundquests.isQuestActive(player, "quest/smuggle_pvp_5")) - { - int amount = 50; - - if (groundquests.isQuestActive(player, "quest/smuggle_pvp_5")) - { - amount = 100; - } - - groundquests.applyQuestPenalty(killer, "underworld", amount); - - removeObjVar(player, "smuggler.bounty"); - updateJediScriptData(player, "smuggler", 0); - - messageTo(player, "handleSmugglerMissionFailureSignal", null, 1.0f, true); - } - } - } - - - public static void checkSmugglerTitleGrants(obj_id player, float value) throws InterruptedException - { - - if (value >= 1000.0f) - { - if (!hasSkill(player, "sm_title_bootlegger")) - { - grantSkill(player, "sm_title_bootlegger"); - } - } - else - { - if (hasSkill(player, "sm_title_bootlegger")) - { - revokeSkill(player, "sm_title_bootlegger"); - } - } - - if (value >= 2000.0f) - { - if (!hasSkill(player, "sm_title_pirate")) - { - grantSkill(player, "sm_title_pirate"); - } - } - else - { - if (hasSkill(player, "sm_title_pirate")) - { - revokeSkill(player, "sm_title_pirate"); - } - } - - if (value >= 3000.0f) - { - if (!hasSkill(player, "sm_title_master_smuggler")) - { - grantSkill(player, "sm_title_master_smuggler"); - } - } - else - { - if (hasSkill(player, "sm_title_master_smuggler")) - { - revokeSkill(player, "sm_title_master_smuggler"); - } - } - return; - } - - - public static void checkBountyTitleGrants(obj_id player, float value) throws InterruptedException - { - if (value <= -1000.0f) - { - if (!hasSkill(player, "bh_title_informant")) - { - grantSkill(player, "bh_title_informant"); - } - } - - if (value <= -2000.0f) - { - if (!hasSkill(player, "bh_title_inspector")) - { - grantSkill(player, "bh_title_inspector"); - } - } - - if (value <= -3000.0f) - { - if (!hasSkill(player, "bh_title_agent")) - { - grantSkill(player, "bh_title_agent"); - } - } - return; - } - - - public static void checkRewardQuestGrants(obj_id target, float value) throws InterruptedException - { - if (value >= 1000.0f) - { - if ((!groundquests.isQuestActive(target, "smuggler_reward_1") && (!groundquests.hasCompletedQuest(target, "smuggler_reward_1")) )) - { - groundquests.requestGrantQuest(target, "smuggler_reward_1"); - } - } - - if (value >= 2000.0f) - { - if ((!groundquests.isQuestActive(target, "smuggler_reward_2") && (!groundquests.hasCompletedQuest(target, "smuggler_reward_2")) )) - { - groundquests.requestGrantQuest(target, "smuggler_reward_2"); - } - } - - if (value >= 3000.0f) - { - if ((!groundquests.isQuestActive(target, "smuggler_reward_3") && (!groundquests.hasCompletedQuest(target, "smuggler_reward_3")) )) - { - groundquests.requestGrantQuest(target, "smuggler_reward_3"); - } - } - - return; - } - - - public static boolean moveBuyBackObjectIntoContainer(obj_id player, obj_id object, int credits) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (!isValidId(object) || !exists(object)) - { - return false; - } - - if (credits <= 0) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.moveBuyBackObjectIntoContainer() - Player (OID: "+ player + ") attempted to move an object with a value of 0 or less into his buy back container."); - return false; - } - - if (!hasObjVar(player, BUYBACK_CONTAINER_VAR)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.moveBuyBackObjectIntoContainer() - Player (OID: "+ player + ") did not havee a buy back conteiner objvar yet!!"); - return false; - } - - obj_id objContainer = getObjIdObjVar(player, BUYBACK_CONTAINER_VAR); - if (!isIdValid(objContainer)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.moveBuyBackObjectIntoContainer() - Player (OID: "+ player + ") does not have a valid buy back container."); - return false; - } - - obj_id[] allObjects = getBuyBackItemsInContainer(player); - if (allObjects != null && allObjects.length == 10) - { - if (!isIdValid(allObjects[0]) || getIntObjVar(allObjects[0], BUYBACK_OBJ_TIMESTAMP) <= 0) - { - return false; - } - - obj_id oldestObject = allObjects[0]; - int oldestTime = getIntObjVar(oldestObject, BUYBACK_OBJ_TIMESTAMP); - for (int i = 1; i <= allObjects.length - 1; i++) - { - testAbortScript(); - if (!isIdValid(allObjects[i])) - { - continue; - } - - int oldTimerCandidate = getIntObjVar(allObjects[i], BUYBACK_OBJ_TIMESTAMP); - if (oldTimerCandidate <= 0) - { - continue; - } - - if (oldTimerCandidate < oldestTime) - { - oldestObject = allObjects[i]; - oldestTime = oldTimerCandidate; - } - } - - CustomerServiceLog("Junk_Dealer: ", "smuggler.moveBuyBackObjectIntoContainer() - Player (OID: "+ player + ") has had object: "+ oldestObject + " deleted in the buy back container: "+objContainer+" because the item was the oldest of the 10 objects in that container."); - destroyObject(oldestObject); - } - - int timeNow = getCalendarTime(); - setObjVar(object, BUYBACK_OBJ_TIMESTAMP, timeNow); - setObjVar(object, BUYBACK_OBJ_CREDITS, credits); - - if (putIn(object, objContainer, player)) - { - return true; - } - return false; - } - - - public static boolean moveBuyBackObjectIntoInventory(obj_id player, obj_id object) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (!isValidId(object) || !exists(object)) - { - return false; - } - - if (!hasObjVar(player, BUYBACK_CONTAINER_VAR)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.moveBuyBackObjectIntoInventory() - Player (OID: "+ player + ") did not havee a buy back conteiner objvar yet!!"); - return false; - } - - obj_id objContainer = utils.getInventoryContainer(player); - if (!isIdValid(objContainer) || !exists(objContainer)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.moveBuyBackObjectIntoInventory() - Player (OID: "+ player + ") does not have a valid buy back container."); - return false; - } - - if (putIn(object, objContainer, player)) - { - removeObjVar(object, BUYBACK_OBJ_TIMESTAMP); - removeObjVar(object, BUYBACK_OBJ_CREDITS); - removeObjVar(object, BUYBACK_OBJ_SOLD); - return true; - } - - CustomerServiceLog("Junk_Dealer: ", "smuggler.moveBuyBackObjectIntoInventory() - Player (OID: "+ player + ") could not put object: "+object+" in buy back container."); - return false; - } - - - public static obj_id[] getBuyBackItemsInContainer(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return null; - } - - if (!hasObjVar(player, BUYBACK_CONTAINER_VAR)) - { - return null; - } - - obj_id objContainer = getObjIdObjVar(player, BUYBACK_CONTAINER_VAR); - if (!isIdValid(objContainer) || !exists(objContainer)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.getBuyBackItemsInContainer() - Player (OID: "+ player + ") does not have a valid buy back container."); - return null; - } - - obj_id[] objContents = utils.getContents(objContainer, true); - if (objContents == null || objContents.length <= 0) - { - return null; - } - - return objContents; - } - - - public static boolean hasBuyBackContainer(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (!hasObjVar(player, BUYBACK_CONTAINER_VAR)) - { - return false; - } - - obj_id buyBackContainer = getObjIdObjVar(player, BUYBACK_CONTAINER_VAR); - if (!isValidId(buyBackContainer) || !exists(buyBackContainer)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.hasBuyBackContainer() - Player (OID: "+ player + ") does not have a valid buy back container."); - return false; - } - - return true; - } - - - public static obj_id createBuyBackControlDeviceOnPlayer(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return null; - } - - obj_id datapad = utils.getPlayerDatapad(player); - if (!isValidId(datapad)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.createBuyBackControlDeviceOnPlayer() - Player (OID: "+ player + ") did not have a valid datapad."); - return null; - } - - obj_id[] objContents = utils.getContents(datapad, true); - if (objContents != null && objContents.length > 0) - { - for (int i = 0; i < objContents.length; i++) - { - testAbortScript(); - if (isIdValid(objContents[i])) - { - String template = getTemplateName(objContents[i]); - if (template != null && template.length() > 0) - { - if (template.equals(BUY_BACK_CONTROL_DEVICE_TEMPLATE)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.createBuyBackControlDeviceOnPlayer() - Player (OID: "+ player + ") had an already valid buy back controller device that somehow got removed!: "+objContents[i]); - setBuyBackContainerObjVar(player, objContents[i]); - return objContents[i]; - } - } - } - } - } - - obj_id buyBackControlDevice = createObject(BUY_BACK_CONTROL_DEVICE_TEMPLATE, datapad, ""); - if (!isValidId(buyBackControlDevice)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.createBuyBackControlDeviceOnPlayer() - Player (OID: "+ player + ") did not receive a valid buy back container."); - return null; - } - - setBuyBackContainerObjVar(player, buyBackControlDevice); - return buyBackControlDevice; - } - - - public static void setBuyBackContainerObjVar(obj_id player, obj_id buyBackControlDevice) throws InterruptedException - { - obj_id buyBackContainer = utils.getInventoryContainer(buyBackControlDevice); - if (isIdValid(buyBackContainer)) - { - setObjVar(player, BUYBACK_CONTAINER_VAR, buyBackContainer); - } - else - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.setBuyBackContainerObjVar() - Player (OID: "+ player + ") buy back control device did not have a back buy container in its inventory."); - } - return; - } - - - public static obj_id getBuyBackContainerObjVar(obj_id player) throws InterruptedException - { - if (hasObjVar(player, BUYBACK_CONTAINER_VAR)) - { - return getObjIdObjVar(player, BUYBACK_CONTAINER_VAR); - } - CustomerServiceLog("Junk_Dealer: ", "smuggler.getBuyBackContainerObjVar() - Player (OID: "+ player + ") did not have a buy back container objvar. Attempting to find buy back control device."); - return utils.getInventoryContainer(createBuyBackControlDeviceOnPlayer(player)); - } - - - public static boolean hasBuyBackItems(obj_id player) throws InterruptedException - { - if (!isValidId(player)) - { - return false; - } - - obj_id[] listOfBuyBacks = getBuyBackItemsInContainer(player); - return listOfBuyBacks != null && listOfBuyBacks.length > 0; - } - - - public static boolean showBuyBackSui(obj_id player, obj_id target) throws InterruptedException - { - - if (!isIdValid(player) || !isIdValid(target)) - { - return false; - } - - if (utils.outOfRange(target, player, 10.0f, true)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.showBuyBackSui() - Player: "+player+" attempted to get a list of buy back items but the action failed. The player was too far away from the NPC."); - return false; - } - - obj_id playerInv = utils.getInventoryContainer(player); - if (isIdValid(playerInv)) - { - int free_space = getVolumeFree(playerInv); - if (free_space < 1) - { - sendSystemMessage(player, SID_NO_SPACE_IN_INVENTORY); - CustomerServiceLog("Junk_Dealer: ", "smuggler.showBuyBackSui() - Player: "+player+" could not buy back any more items due to inventory space restrictions."); - return false; - } - } - - if (utils.hasScriptVar(player, SCRIPTVAR_JUNK_SUI)) - { - - int pidClose = utils.getIntScriptVar(player, SCRIPTVAR_JUNK_SUI); - cleanupSellJunkSui(player); - - sui.closeSUI(player, pidClose); - } - - obj_id[] junk = getBuyBackItemsInContainer(player); - - if (junk == null && junk.length <= 0) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.showBuyBackSui() - Player: "+player+" attempted to get a list of buy back items but the action failed. There were no items to buy back."); - sendSystemMessage(player, SID_NO_BUY_BACK_ITEMS_FOUND); - return false; - } - - String[] entries = new String[junk.length]; - - for (int i = 0; i < junk.length; i++) - { - testAbortScript(); - int price = getIntObjVar(junk[i], BUYBACK_OBJ_CREDITS); - - String name = getAssignedName(junk[i]); - if (name.equals("") || name == null) - { - name = getString(getNameStringId(junk[i])); - } - String entry = "["+ price + "] "+ name; - - entries[i] = entry; - } - - if (entries == null || entries.length <= 0) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.showBuyBackSui() - Player: "+player+" attempted to get a list of buy back items but the action failed. Somehow the Junk Dealer system failed to create a list of buy back item string names."); - return false; - } - - int pid = sui.listbox(target, player, BUY_BACK_PROMPT, sui.OK_CANCEL_REFRESH, BUY_BACK_TITLE, entries, "handleBuyBackSui", false, false); - if (pid <= -1) - { - return false; - } - - setSUIProperty(pid, sui.LISTBOX_BTN_OK, sui.PROP_TEXT, BTN_BUY_BACK); - setSUIProperty (pid, sui.LISTBOX_BTN_OTHER, sui.PROP_VISIBLE, "true"); - setSUIProperty (pid, sui.LISTBOX_BTN_OTHER, sui.PROP_TEXT, BTN_EXAMINE); - subscribeToSUIProperty (pid, "this", sui.LISTBOX_PROP_OTHER_PRESSED); - showSUIPage(pid); - - utils.setScriptVar(player, SCRIPTVAR_JUNK_SUI, pid); - utils.setBatchScriptVar(player, SCRIPTVAR_JUNK_IDS, junk); - return true; - } - - - public static boolean buyBackJunkItem(obj_id player, obj_id junkDealer, obj_id item, boolean reshowSui) throws InterruptedException - { - - if (!isIdValid(player) || !isIdValid(item) || !isValidId(junkDealer)) - { - return false; - } - - if (utils.outOfRange(junkDealer, player, 10.0f, true)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.buyBackJunkItem() - Player: "+player+" cannot buy back item: "+item+" because they walked too far from the Junk Dealer: "+junkDealer); - return false; - } - - if (!hasObjVar(player, smuggler.BUYBACK_CONTAINER_VAR)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.buyBackJunkItem() - Player: "+player+" cannot buy back item: "+item+" because the player doesn't have a buy back container objvar."); - return false; - } - - if (!hasObjVar(item, smuggler.BUYBACK_OBJ_SOLD)) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.buyBackJunkItem() - Player: "+player+" cannot buy back item: "+item+" because it has a sold objvar. This item has already been marked as sold. Aborting."); - return false; - } - - if (!hasObjVar(item, smuggler.BUYBACK_OBJ_CREDITS) || getIntObjVar(item, smuggler.BUYBACK_OBJ_CREDITS) <= 0) - { - CustomerServiceLog("Junk_Dealer: ", "smuggler.buyBackJunkItem() - Player: "+player+" cannot buy back item: "+item+" because the credit amount was not found or invalid."); - return false; - } - - int price = getIntObjVar(item, smuggler.BUYBACK_OBJ_CREDITS); - - dictionary params = new dictionary(); - params.put("item",item); - params.put("price",price); - CustomerServiceLog("Junk_Dealer: ", "junk_dealer.buyBackJunkItem() - Player: "+player+" is about to be charged: "+price+" for object: "+item+" as part of the buy back functionality."); - money.requestPayment(player, junkDealer, price, "handleTheBuyBack", params, true); - return true; - } - - - public static void flagJunkSaleSui(obj_id player, obj_id salesman) throws InterruptedException - { - - if (!isIdValid(player) || !isValidId(salesman)) - { - return; - } - - if (utils.outOfRange(salesman, player, 10.0f, true)) - { - return; - } - - if (utils.hasScriptVar(player, smuggler.SCRIPTVAR_JUNK_SUI)) - { - - int pidClose = utils.getIntScriptVar(player, smuggler.SCRIPTVAR_JUNK_SUI); - smuggler.cleanupSellJunkSui(player); - - sui.closeSUI(player, pidClose); - } - - obj_id[] junk = smuggler.getAllJunkItems(player, true); - - if (junk != null && junk.length > 0) - { - String[] entries = new String[junk.length]; - - for (int i = 0; i < junk.length; i++) - { - testAbortScript(); - - String entry = "[ Sellable ] "+getString(getNameStringId(junk[i])); - if (hasObjVar(junk[i], smuggler.JUNK_DEALKER_NO_SALE_FLAG)) - { - entry = "[ *No Sell* ] "+getString(getNameStringId(junk[i])); - } - - entries[i] = entry; - } - - if (entries != null && entries.length > 0) - { - - int pid = sui.listbox(salesman, player, smuggler.FLAG_NO_SELL_DESC, sui.OK_CANCEL_REFRESH, smuggler.FLAG_NO_SELL_TITLE, entries, "handleFlagJunkSui", false, false); - - if (pid > -1) - { - - setSUIProperty(pid, sui.LISTBOX_BTN_OK, sui.PROP_TEXT, smuggler.FLAG_NO_SELL); - setSUIProperty (pid, sui.LISTBOX_BTN_OTHER, sui.PROP_VISIBLE, "true"); - setSUIProperty (pid, sui.LISTBOX_BTN_OTHER, sui.PROP_TEXT, smuggler.BTN_EXAMINE); - subscribeToSUIProperty (pid, "this", sui.LISTBOX_PROP_OTHER_PRESSED); - showSUIPage(pid); - - utils.setScriptVar(player, smuggler.SCRIPTVAR_JUNK_SUI, pid); - utils.setBatchScriptVar(player, smuggler.SCRIPTVAR_JUNK_IDS, junk); - } - } - } - - else - { - int msgPid = sui.msgbox(salesman, player, smuggler.NO_ITEMS_FOUND_PROMPT, sui.OK_ONLY, smuggler.FLAG_ITEM_TITLE, "noHandler"); - smuggler.cleanupSellJunkSui(player); - } - } - - - public static boolean blog(String txt) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(LOGNAME, txt); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/space_combat.java b/sku.0/sys.server/compiled/game/script/library/space_combat.java deleted file mode 100644 index 689b05099..000000000 --- a/sku.0/sys.server/compiled/game/script/library/space_combat.java +++ /dev/null @@ -1,6243 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.callable; -import script.library.utils; -import script.library.space_utils; -import script.library.factions; -import script.library.space_crafting; -import script.library.ship_ai; -import script.library.xp; -import script.library.badge; -import script.library.buff; -import script.library.space_flags; -import script.library.groundquests; -import script.library.smuggler; - - -public class space_combat extends script.base_script -{ - public space_combat() - { - } - public static final float SPACE_DEATH_DELAY = 10.0f; - - public static final int CHASSIS = 1; - public static final int COMPONENT = 2; - public static final int SHIELD = 3; - public static final int ARMOR = 4; - - public static final int LIGHT = 1; - public static final int HEAVY = 2; - - public static final int ALL_WEAPONS = -1; - - public static final float GROUND_XP_PERCENT = 0.01f; - - public static final int[] MANDATORY_COMPONENTS = - { - ship_chassis_slot_type.SCST_reactor, - ship_chassis_slot_type.SCST_engine - }; - - public static final int[] WEAPON_SLOTS = - { - ship_chassis_slot_type.SCST_weapon_0, - ship_chassis_slot_type.SCST_weapon_1, - ship_chassis_slot_type.SCST_weapon_2, - ship_chassis_slot_type.SCST_weapon_3, - ship_chassis_slot_type.SCST_weapon_4, - ship_chassis_slot_type.SCST_weapon_5, - ship_chassis_slot_type.SCST_weapon_6, - ship_chassis_slot_type.SCST_weapon_7 - }; - - public static final float MINIMUM_DAMAGE_THRESHOLD = .05f; - public static final float MINIMUM_EFFICIENCY = .10f; - public static final float NO_CHANGE = -1f; - - public static final int SHIP = ship_chassis_slot_type.SCST_num_types; - public static final int FRONT = 0; - public static final int BACK = 1; - public static final int NONE = -2; - - public static final int NOVA_ORION_RESOURCE_MIN = 1; - public static final int NOVA_ORION_RESOURCE_MAX = 15; - public static final int NOVA_ORION_RESOURCE_CHANCE = 25; - public static final int NOVA_ORION_BUFF_MIDLITHE_BONUS = 5; - - public static final int NOVA_ORION_BUFF_COLLECTIBLES_BONUS = 2; - - public static final String NOVA_ORION_RESOURCE = "item_nova_orion_space_resource_01_01"; - - public static final String SHIP_DATATABLE = "datatables/space_mobile/space_mobile.iff"; - - public static final float DROID_VOCALIZE_DELAY_CONST = 1.0f; - public static final String DROID_VOCALIZE_DATATABLE = "datatables/space_combat/droid_vocalizations.iff"; - - public static final int AVERAGE_COMMAND_SUCCESS_RATE = 65; - - public static final int FIRST_WEAPON = ship_chassis_slot_type.SCST_weapon_first; - public static final int LAST_WEAPON = ship_chassis_slot_type.SCST_weapon_last; - - public static final String PIRATE_EQUIPMENT_DATATABLE = "datatables/space_command/pirate_ship_table.iff"; - public static final String PIRATE_EQUIPMENT_AA = "PIRATE_EQUIPMENT_AA"; - public static final String PIRATE_EQUIPMENT_A = "PIRATE_EQUIPMENT_A"; - public static final String PIRATE_EQUIPMENT_B = "PIRATE_EQUIPMENT_B"; - public static final String PIRATE_EQUIPMENT_C = "PIRATE_EQUIPMENT_C"; - public static final String PIRATE_EQUIPMENT_D = "PIRATE_EQUIPMENT_D"; - - public static final int NPC_DAMAGE_MULTIPLIER = 4; - - public static final string_id SID_DISABLED = new string_id("space/space_interaction", "disabled"); - - public static final String SPACE_COLLECTIONS_LOOT_TABLE = "datatables/space_loot/space_collection_loot.iff"; - - - public static void addToCombatDamage(obj_id objAttacker, obj_id objDefender, int intDamage) throws InterruptedException - { - Vector objAttackers = utils.getResizeableObjIdArrayLocalVar(objDefender, "damage.objAttackers"); - Vector intDamageDone = utils.getResizeableIntArrayLocalVar(objDefender, "damage.intDamageDone"); - int intIndex = utils.getElementPositionInArray(objAttackers, objAttacker); - - if (intIndex < 0) - { - objAttackers = utils.addElement(objAttackers, objAttacker); - intDamageDone = utils.addElement(intDamageDone, intDamage); - utils.setLocalVar(objDefender, "damage.objAttackers", objAttackers); - utils.setLocalVar(objDefender, "damage.intDamageDone", intDamageDone); - - return; - } - else - { - intDamageDone.set(intIndex, new Integer(((Integer)(intDamageDone.get(intIndex))).intValue() + intDamage)); - utils.setLocalVar(objDefender, "damage.intDamageDone", intDamageDone); - } - - return; - } - - - public static void targetDestroyed(obj_id objTarget) throws InterruptedException - { - - dictionary dctParams = new dictionary(); - - space_utils.notifyObject(objTarget, "objectDestroyed", dctParams); - - return; - } - - - public static void normalizeAllComponents(obj_id objShip) throws InterruptedException - { - String[] normalizeList = - { - "weapons_normalize", "engine_normalize", "shields_normalize", "reactor_normalize", "weapcap_equalize" - }; - - for (int i = 0; i < normalizeList.length; i++) - { - testAbortScript(); - space_combat.unrestrictedDroidCommand(objShip, normalizeList[i]); - } - } - - - public static void unrestrictedDroidCommand(obj_id objShip, String strCommand) throws InterruptedException - { - if (!isIdValid(objShip) || !exists(objShip)) - { - return; - } - - dictionary dctCommandInfo = dataTableGetRow("datatables/space_combat/droid_commands.iff", strCommand); - - if (dctCommandInfo == null) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.performDroidCommands - FAILED TO GET COMMAND INFO DICTIONARY. STRING NOT FOUND WAS:"+ strCommand); - return; - } - - String strClientEffect = dctCommandInfo.getString("strClientEffect"); - String strStringId = dctCommandInfo.getString("strStringId"); - int intComponentToModify = dctCommandInfo.getInt("intComponentToModify"); - float fltEnergyEfficiency = dctCommandInfo.getFloat("fltEnergyEfficiency"); - float fltGeneralEfficiency = dctCommandInfo.getFloat("fltGeneralEfficiency"); - float fltRepairMin = dctCommandInfo.getFloat("fltRepairMin"); - float fltRepairMax = dctCommandInfo.getFloat("fltRepairMax"); - float fltBaseDelay = dctCommandInfo.getFloat("fltBaseDelay"); - float fltRepairKitConsumed = dctCommandInfo.getFloat("fltRepairKitConsumed"); - float fltCountermeasureCapacitorCost = dctCommandInfo.getFloat("fltCountermeasureCapacitorCost"); - float fltCountermeasureShieldCost = dctCommandInfo.getFloat("fltCountermeasureShieldCost"); - float fltFrontToBackShieldReinforcePercentage = dctCommandInfo.getFloat("fltFrontToBackShieldReinforcePercentage"); - float fltBackToFrontShieldReinforcePercentage = dctCommandInfo.getFloat("fltBackToFrontShieldReinforcePercentage"); - float fltCapacitorReinforcePercentage = dctCommandInfo.getFloat("fltCapacitorReinforcePercentage"); - float fltMissileSavingThrow = dctCommandInfo.getFloat("fltMissileSavingThrow"); - String strMessageHandlerOnPlayer = dctCommandInfo.getString("strMessageHandlerOnPlayer"); - float fltDamageToComponent = dctCommandInfo.getFloat("fltDamageToComponent"); - float fltFrontShieldRatio = dctCommandInfo.getFloat("fltFrontShieldRatio"); - - if ((intComponentToModify != NONE) && (intComponentToModify != ALL_WEAPONS)) - { - if (!isShipSlotInstalled(objShip, intComponentToModify)) - { - return; - } - - if (fltDamageToComponent > 0) - { - float fltCurrentHitpoints = getShipComponentHitpointsCurrent(objShip, intComponentToModify); - float fltCurrentArmorHitpoints = getShipComponentArmorHitpointsCurrent(objShip, intComponentToModify); - - fltCurrentArmorHitpoints = fltCurrentArmorHitpoints - fltDamageToComponent; - - if (fltCurrentArmorHitpoints < 0) - { - float fltRemainingDamage = Math.abs(fltCurrentArmorHitpoints); - - fltCurrentHitpoints = fltCurrentHitpoints - fltRemainingDamage; - - if (fltCurrentHitpoints < 0) - { - return; - } - else - { - setShipComponentArmorHitpointsCurrent(objShip, intComponentToModify, 0); - setShipComponentHitpointsCurrent(objShip, intComponentToModify, fltCurrentHitpoints); - recalculateEfficiencyGeneral(intComponentToModify, objShip); - } - } - else - { - setShipComponentArmorHitpointsCurrent(objShip, intComponentToModify, fltCurrentArmorHitpoints); - - } - } - - if ((fltGeneralEfficiency != 0) && (fltEnergyEfficiency != 0)) - { - if (isEfficiencyModified(intComponentToModify, objShip)) - { - setEfficiencyModifier(intComponentToModify, objShip, 1.0f, 1.0f); - } - - setEfficiencyModifier(intComponentToModify, objShip, fltGeneralEfficiency, fltEnergyEfficiency); - } - - if (fltFrontShieldRatio > 0) - { - - float fltShieldTotal = getShipShieldHitpointsFrontMaximum(objShip) + getShipShieldHitpointsBackMaximum(objShip); - float fltFrontMax = (fltShieldTotal / 2) * fltFrontShieldRatio; - float fltBackMax = fltShieldTotal - fltFrontMax; - - setShipShieldHitpointsFrontMaximum(objShip, fltFrontMax); - setShipShieldHitpointsBackMaximum(objShip, fltBackMax); - } - } - else if (intComponentToModify == ALL_WEAPONS) - { - - for (int intI = 0; intI < WEAPON_SLOTS.length; intI++) - { - testAbortScript(); - if (isShipSlotInstalled(objShip, WEAPON_SLOTS[intI])) - { - if (fltDamageToComponent > 0) - { - float fltCurrentHitpoints = getShipComponentHitpointsCurrent(objShip, WEAPON_SLOTS[intI]); - float fltCurrentArmorHitpoints = getShipComponentArmorHitpointsCurrent(objShip, WEAPON_SLOTS[intI]); - - fltCurrentArmorHitpoints = fltCurrentArmorHitpoints - fltDamageToComponent; - - if (fltCurrentArmorHitpoints < 0) - { - float fltRemainingDamage = Math.abs(fltCurrentArmorHitpoints); - - fltCurrentHitpoints = fltCurrentHitpoints - fltRemainingDamage; - - if (fltCurrentHitpoints < 1) - { - return; - } - else - { - setShipComponentArmorHitpointsCurrent(objShip, WEAPON_SLOTS[intI], 0); - setShipComponentHitpointsCurrent(objShip, WEAPON_SLOTS[intI], fltCurrentHitpoints); - recalculateEfficiencyGeneral(WEAPON_SLOTS[intI], objShip); - } - } - else - { - setShipComponentArmorHitpointsCurrent(objShip, WEAPON_SLOTS[intI], fltCurrentArmorHitpoints); - - } - - } - - if ((fltGeneralEfficiency != 0) && (fltEnergyEfficiency != 0)) - { - if (isEfficiencyModified(WEAPON_SLOTS[intI], objShip)) - { - setEfficiencyModifier(WEAPON_SLOTS[intI], objShip, 1.0f, 1.0f); - } - - setEfficiencyModifier(WEAPON_SLOTS[intI], objShip, fltGeneralEfficiency, fltEnergyEfficiency); - } - } - } - } - - if (fltCapacitorReinforcePercentage != 0) - { - if (!reinforceShieldsFromCapacitor(objShip, fltCapacitorReinforcePercentage)) - { - return; - } - } - - if (fltFrontToBackShieldReinforcePercentage != 0) - { - if (!transferFrontShieldToBack(objShip, fltFrontToBackShieldReinforcePercentage)) - { - return; - } - } - - if (fltBackToFrontShieldReinforcePercentage != 0) - { - if (!transferBackShieldToFront(objShip, fltBackToFrontShieldReinforcePercentage)) - { - return; - } - } - } - - - public static void performDroidCommands(obj_id objPlayer, String strCommand) throws InterruptedException - { - - obj_id objShip = space_transition.getContainingShip(objPlayer); - - if (!isIdValid(objShip)) - { - - debugServerConsoleMsg(null, "SPACE_COMBAT.performDroidCommands - FAILED TO GET SHIP OBJID through getContainingShip(objPlayer) method"); - return; - } - - if (doDroidPreCheck(objPlayer, objShip, strCommand)) - { - dictionary dctCommandInfo = dataTableGetRow("datatables/space_combat/droid_commands.iff", strCommand); - - if (dctCommandInfo == null) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.performDroidCommands - FAILED TO GET COMMAND INFO DICTIONARY. STRING NOT FOUND WAS:"+ strCommand); - return; - } - - String strClientEffect = dctCommandInfo.getString("strClientEffect"); - - String strStringId = dctCommandInfo.getString("strStringId"); - - int intComponentToModify = dctCommandInfo.getInt("intComponentToModify"); - - float fltEnergyEfficiency = dctCommandInfo.getFloat("fltEnergyEfficiency"); - - float fltGeneralEfficiency = dctCommandInfo.getFloat("fltGeneralEfficiency"); - - float fltRepairMin = dctCommandInfo.getFloat("fltRepairMin"); - - float fltRepairMax = dctCommandInfo.getFloat("fltRepairMax"); - - float fltBaseDelay = dctCommandInfo.getFloat("fltBaseDelay"); - - float fltRepairKitConsumed = dctCommandInfo.getFloat("fltRepairKitConsumed"); - - float fltCountermeasureCapacitorCost = dctCommandInfo.getFloat("fltCountermeasureCapacitorCost"); - - float fltCountermeasureShieldCost = dctCommandInfo.getFloat("fltCountermeasureShieldCost"); - - float fltFrontToBackShieldReinforcePercentage = dctCommandInfo.getFloat("fltFrontToBackShieldReinforcePercentage"); - - float fltBackToFrontShieldReinforcePercentage = dctCommandInfo.getFloat("fltBackToFrontShieldReinforcePercentage"); - - float fltCapacitorReinforcePercentage = dctCommandInfo.getFloat("fltCapacitorReinforcePercentage"); - - float fltMissileSavingThrow = dctCommandInfo.getFloat("fltMissileSavingThrow"); - - String strMessageHandlerOnPlayer = dctCommandInfo.getString("strMessageHandlerOnPlayer"); - - float fltDamageToComponent = dctCommandInfo.getFloat("fltDamageToComponent"); - - float fltFrontShieldRatio = dctCommandInfo.getFloat("fltFrontShieldRatio"); - - float fltComponentDelay = getShipDroidInterfaceCommandSpeed(objShip); - - if (fltComponentDelay < 1) - { - fltComponentDelay = 1.0f; - } - - if ((intComponentToModify != NONE) && (intComponentToModify != ALL_WEAPONS)) - { - if (!isShipSlotInstalled(objShip, intComponentToModify)) - { - string_id strSpam = new string_id("space/space_interaction", "droid_component_not_installed"); - - sendSystemMessage(objPlayer, strSpam); - return; - } - - if (fltDamageToComponent > 0) - { - - float fltCurrentHitpoints = getShipComponentHitpointsCurrent(objShip, intComponentToModify); - float fltCurrentArmorHitpoints = getShipComponentArmorHitpointsCurrent(objShip, intComponentToModify); - - fltCurrentArmorHitpoints = fltCurrentArmorHitpoints - fltDamageToComponent; - - if (fltCurrentArmorHitpoints < 0) - { - float fltRemainingDamage = Math.abs(fltCurrentArmorHitpoints); - - fltCurrentHitpoints = fltCurrentHitpoints - fltRemainingDamage; - - if (fltCurrentHitpoints < 0) - { - string_id strSpam = new string_id("space/space_interaction", "droid_component_too_damaged"); - string_id strComponent = new string_id("space/space_interaction", space_crafting.getShipComponentStringType(intComponentToModify)); - prose_package proseTest = prose.getPackage(strSpam, strComponent); - - return; - } - else - { - setShipComponentArmorHitpointsCurrent(objShip, intComponentToModify, 0); - setShipComponentHitpointsCurrent(objShip, intComponentToModify, fltCurrentHitpoints); - recalculateEfficiencyGeneral(intComponentToModify, objShip); - } - } - else - { - setShipComponentArmorHitpointsCurrent(objShip, intComponentToModify, fltCurrentArmorHitpoints); - - } - - } - - if ((fltGeneralEfficiency != 0) && (fltEnergyEfficiency != 0)) - { - if (isEfficiencyModified(intComponentToModify, objShip)) - { - setEfficiencyModifier(intComponentToModify, objShip, 1.0f, 1.0f); - - } - - setEfficiencyModifier(intComponentToModify, objShip, fltGeneralEfficiency, fltEnergyEfficiency); - } - - if (fltFrontShieldRatio > 0) - { - - float fltShieldTotal = getShipShieldHitpointsFrontMaximum(objShip) + getShipShieldHitpointsBackMaximum(objShip); - float fltFrontMax = (fltShieldTotal / 2) * fltFrontShieldRatio; - float fltBackMax = fltShieldTotal - fltFrontMax; - - setShipShieldHitpointsFrontMaximum(objShip, fltFrontMax); - setShipShieldHitpointsBackMaximum(objShip, fltBackMax); - } - } - else if (intComponentToModify == ALL_WEAPONS) - { - - for (int intI = 0; intI < WEAPON_SLOTS.length; intI++) - { - testAbortScript(); - if (isShipSlotInstalled(objShip, WEAPON_SLOTS[intI])) - { - if (fltDamageToComponent > 0) - { - float fltCurrentHitpoints = getShipComponentHitpointsCurrent(objShip, WEAPON_SLOTS[intI]); - float fltCurrentArmorHitpoints = getShipComponentArmorHitpointsCurrent(objShip, WEAPON_SLOTS[intI]); - - fltCurrentArmorHitpoints = fltCurrentArmorHitpoints - fltDamageToComponent; - - if (fltCurrentArmorHitpoints < 0) - { - float fltRemainingDamage = Math.abs(fltCurrentArmorHitpoints); - - fltCurrentHitpoints = fltCurrentHitpoints - fltRemainingDamage; - - if (fltCurrentHitpoints < 1) - { - string_id strSpam = new string_id("space/space_interaction", "droid_command_weapons_too_damaged"); - - space_utils.sendSystemMessageShip(objShip, strSpam, true, true, true, true); - return; - } - else - { - setShipComponentArmorHitpointsCurrent(objShip, WEAPON_SLOTS[intI], 0); - setShipComponentHitpointsCurrent(objShip, WEAPON_SLOTS[intI], fltCurrentHitpoints); - recalculateEfficiencyGeneral(WEAPON_SLOTS[intI], objShip); - } - } - else - { - setShipComponentArmorHitpointsCurrent(objShip, WEAPON_SLOTS[intI], fltCurrentArmorHitpoints); - - } - - } - - if ((fltGeneralEfficiency != 0) && (fltEnergyEfficiency != 0)) - { - if (isEfficiencyModified(WEAPON_SLOTS[intI], objShip)) - { - setEfficiencyModifier(WEAPON_SLOTS[intI], objShip, 1.0f, 1.0f); - } - - setEfficiencyModifier(WEAPON_SLOTS[intI], objShip, fltGeneralEfficiency, fltEnergyEfficiency); - } - } - - } - - } - - if (fltCapacitorReinforcePercentage != 0) - { - - if (!reinforceShieldsFromCapacitor(objShip, fltCapacitorReinforcePercentage)) - { - string_id strSpam = new string_id("space/space_interaction", "no_capacitor_energy"); - - sendSystemMessage(objPlayer, strSpam); - return; - } - } - - if (fltFrontToBackShieldReinforcePercentage != 0) - { - - if (!transferFrontShieldToBack(objShip, fltFrontToBackShieldReinforcePercentage)) - { - - string_id strSpam = new string_id("space/space_interaction", "no_front_shield_energy"); - - sendSystemMessage(objPlayer, strSpam); - return; - - } - } - - if (fltBackToFrontShieldReinforcePercentage != 0) - { - if (!transferBackShieldToFront(objShip, fltBackToFrontShieldReinforcePercentage)) - { - - string_id strSpam = new string_id("space/space_interaction", "no_back_shield_energy"); - - sendSystemMessage(objPlayer, strSpam); - return; - } - } - - if (!strMessageHandlerOnPlayer.equals("")) - { - space_utils.notifyObject(objPlayer, strMessageHandlerOnPlayer, dctCommandInfo); - } - - if (fltBaseDelay > 0) - { - int intTime = getGameTime(); - float fltFullDelay = fltComponentDelay * fltBaseDelay; - - intTime = intTime + (int) fltFullDelay; - utils.setLocalVar(objShip, "intDroidTimestamp", intTime); - string_id strSpam = new string_id("space/space_interaction", "droid_delay_ready"); - - space_utils.sendDelayedSystemMessage(objPlayer, strSpam, fltFullDelay); - } - - if (!strStringId.equals("")) - { - string_id strSpam = new string_id("space/droid_commands", strStringId); - prose_package pp = prose.getPackage(strSpam); - - flightDroidVocalize(objShip, 2, pp); - } - else - { - flightDroidVocalize(objShip, 2); - } - } - } - - - public static boolean doDroidPreCheck(obj_id objPlayer, obj_id objShip, String strCommand) throws InterruptedException - { - - int intCurrentTime = getGameTime(); - int intLastTime = utils.getIntLocalVar(objShip, "intDroidTimestamp"); - - if (intCurrentTime < intLastTime) - { - string_id strSpam = new string_id("space/space_interaction", "droid_command_delay"); - prose_package pp = prose.getPackage(strSpam, intLastTime - intCurrentTime); - - sendSystemMessageProse(objPlayer, pp); - - return false; - } - - if (!isShipSlotInstalled(objShip, ship_chassis_slot_type.SCST_droid_interface)) - { - - string_id strSpam = new string_id("space/space_interaction", "droid_command_fail_no_interface"); - - sendSystemMessage(objPlayer, strSpam); - - return false; - } - - if (isShipComponentDisabled(objShip, ship_chassis_slot_type.SCST_droid_interface)) - { - - sendSystemMessage(objPlayer, SID_DISABLED); - string_id strSpam = new string_id("space/space_interaction", "droid_command_fail_interface_disabled"); - - sendSystemMessage(objPlayer, strSpam); - - return false; - } - - obj_id objControlDevice = getDroidControlDeviceForShip(objShip); - - if (!isIdValid(objControlDevice)) - { - string_id strSpam = new string_id("space/space_interaction", "droid_command_fail_no_droid"); - - sendSystemMessage(objPlayer, strSpam); - - return false; - } - if (!droidHasAbility(objControlDevice, strCommand)) - { - string_id strSpam = new string_id("space/space_interaction", "droid_command_fail_no_command"); - - sendSystemMessage(objPlayer, strSpam); - - return false; - } - - return true; - } - - - public static boolean droidHasAbility(obj_id objControlDevice, String strCommand) throws InterruptedException - { - - obj_id objDataPad = utils.getDatapad(objControlDevice); - - if (!isIdValid(objDataPad)) - { - - return false; - } - - obj_id[] objContents = utils.getContents(objDataPad); - boolean retval = false; - - for (int intI = 0; intI < objContents.length; intI++) - { - testAbortScript(); - - if (hasObjVar(objContents[intI], "strDroidCommand")) - { - - String strTest = getStringObjVar(objContents[intI], "strDroidCommand"); - - if (strTest.equals(strCommand)) - { - retval = true; - } - } - } - - return retval; - } - - - public static float getCommandEfficacy(obj_id objDroid, String strCategory, float fltEfficacy) throws InterruptedException - { - - return 1.0f; - } - - - public static void registerDamageDoneToShip(obj_id objAttacker, obj_id objDefender, float fltDamage) throws InterruptedException - { - - if (fltDamage == 0) - { - return; - - } - - if (!space_utils.isPlayerControlledShip(objAttacker)) - { - - if (hasObjVar(objAttacker, "commanderPlayer")) - { - obj_id objCommander = getObjIdObjVar(objAttacker, "commanderPlayer"); - - if (isIdValid(objCommander) && (objCommander.isLoaded())) - { - obj_id objShip = space_transition.getContainingShip(objCommander); - - if (isIdValid(objShip)) - { - objAttacker = objShip; - } - else - { - return; - } - } - else - { - return; - } - } - else - { - return; - } - } - - if (space_utils.isPlayerControlledShip(objDefender)) - { - - return; - } - - Vector objAttackers = new Vector(); - objAttackers.setSize(0); - Vector fltDamageTracked = new Vector(); - fltDamageTracked.setSize(0); - Vector fltGroupDamage = new Vector(); - fltGroupDamage.setSize(0); - - if (utils.hasLocalVar(objDefender, "combat.objAttackers")) - { - - objAttackers = utils.getResizeableObjIdArrayLocalVar(objDefender, "combat.objAttackers"); - fltDamageTracked = utils.getResizeableFloatArrayLocalVar(objDefender, "combat.fltDamageTracked"); - - } - else - { - - } - - int intIndex = -1; - - obj_id objGroup = getGroupObject(objAttacker); - - if (!isIdValid(objGroup)) - { - - intIndex = utils.getElementPositionInArray(objAttackers, objAttacker); - - } - else - { - intIndex = utils.getElementPositionInArray(objAttackers, objGroup); - - } - - if (intIndex > -1) - { - - fltDamageTracked.set(intIndex, new Float(((Float)(fltDamageTracked.get(intIndex))).floatValue() + fltDamage)); - - if (isIdValid(objGroup)) - { - - Vector objGroupMembers = utils.getResizeableObjIdArrayLocalVar(objDefender, "combat.groups."+ objGroup); - - intIndex = utils.getElementPositionInArray(objGroupMembers, objAttacker); - fltGroupDamage = utils.getResizeableFloatArrayLocalVar(objDefender, "combat.groups."+ objGroup + ".fltDamage"); - - if (intIndex < 0) - { - - objGroupMembers = utils.addElement(objGroupMembers, objAttacker); - fltGroupDamage = utils.addElement(fltGroupDamage, fltDamage); - utils.setLocalVar(objDefender, "combat.groups."+ objGroup, objGroupMembers); - utils.setLocalVar(objDefender, "combat.groups."+ objGroup + ".fltDamage", fltGroupDamage); - } - else - { - fltGroupDamage.set(intIndex, new Float(((Float)(fltGroupDamage.get(intIndex))).floatValue() + fltDamage)); - utils.setLocalVar(objDefender, "combat.groups."+ objGroup + ".fltDamage", fltGroupDamage); - } - } - } - else - { - if (isIdValid(objGroup)) - { - - objAttackers = utils.addElement(objAttackers, objGroup); - fltDamageTracked = utils.addElement(fltDamageTracked, fltDamage); - Vector objGroupMembers = new Vector(); - objGroupMembers.setSize(0); - - objGroupMembers = utils.addElement(objGroupMembers, objAttacker); - fltGroupDamage = utils.addElement(fltGroupDamage, fltDamage); - utils.setLocalVar(objDefender, "combat.groups."+ objGroup, objGroupMembers); - utils.setLocalVar(objDefender, "combat.groups."+ objGroup + ".fltDamage", fltGroupDamage); - } - - objAttackers = utils.addElement(objAttackers, objAttacker); - fltDamageTracked = utils.addElement(fltDamageTracked, fltDamage); - - } - - utils.setLocalVar(objDefender, "combat.objAttackers", objAttackers); - utils.setLocalVar(objDefender, "combat.fltDamageTracked", fltDamageTracked); - - return; - } - - - public static void doFactionPointGrant(obj_id objPlayer, int intImperialFactionPoints, int intRebelFactionPoints) throws InterruptedException - { - if (intImperialFactionPoints != 0) - { - factions.addFactionStanding(objPlayer, factions.FACTION_IMPERIAL, (float) intImperialFactionPoints); - } - - if (intRebelFactionPoints != 0) - { - factions.addFactionStanding(objPlayer, factions.FACTION_REBEL, (float) intRebelFactionPoints); - } - - return; - } - - - public static void grantRewardsAndCreditForKills(obj_id objDefender) throws InterruptedException - { - - dictionary dctParams = getKillPercentages(objDefender); - - if (dctParams == null) - { - - return; - } - - obj_id[] objAttackers = dctParams.getObjIdArray("objAttackers"); - - if (objAttackers == null) - { - return; - } - - obj_id objWinner = dctParams.getObjId("objWinner"); - - if (!isIdValid(objWinner)) - { - return; - } - - float[] fltPercentages = dctParams.getFloatArray("fltPercentages"); - - obj_id[] objWinningMembers = dctParams.getObjIdArray("objWinningMembers"); - float[] fltWinningMemberDamage = dctParams.getFloatArray("fltWinningMemberDamage"); - - int intXP = getIntObjVar(objDefender, "xp.intXP"); - - for (int intI = 0; intI < objAttackers.length; intI++) - { - testAbortScript(); - if ((objAttackers[intI].isLoaded() && (objAttackers[intI].isAuthoritative()))) - { - - if (fltPercentages[intI] > MINIMUM_DAMAGE_THRESHOLD) - { - - notifyAttacker(objAttackers[intI], objDefender, fltPercentages[intI]); - Vector objPlayers = space_transition.getContainedPlayers(objAttackers[intI], null); - - if ((objPlayers != null) && (objPlayers.size() > 0)) - { - - int intAmount = intXP; - float fltTest = (float) intAmount; - - fltTest = fltTest / objPlayers.size(); - - intAmount = (int) fltTest; - - String defenderType = getStringObjVar(objDefender, "ship.shipName"); - - String[] slotNames = getAllCollectionSlotsInCategory("kill_"+ defenderType); - - int intImperialFactionPoints = 0; - int intRebelFactionPoints = 0; - - if ((pvpGetType(objAttackers[intI]) == PVPTYPE_DECLARED)) - { - intImperialFactionPoints = utils.getIntLocalVar(objDefender, "intImperialFactionPoints"); - intRebelFactionPoints = utils.getIntLocalVar(objDefender, "intRebelFactionPoints"); - - fltTest = (float) intImperialFactionPoints; - fltTest = fltTest / objPlayers.size(); - intImperialFactionPoints = (int) fltTest; - - fltTest = (float) intRebelFactionPoints; - fltTest = fltTest / objPlayers.size(); - intRebelFactionPoints = (int) fltTest; - } - - for (int intJ = 0; intJ < objPlayers.size(); intJ++) - { - testAbortScript(); - collection.spaceGetCreditForKills(((obj_id)(objPlayers.get(intJ))), slotNames); - String tier = getPlayerTierString(((obj_id)(objPlayers.get(intJ)))); - - if (utils.getIntLocalVar(objDefender, "intRebelFactionPoints") > 0 && factions.isRebel(((obj_id)(objPlayers.get(intJ))))) - { - int credit = 0; - - if (isCapShip(objDefender)) - { - credit = 30; - } - else - { - credit = gcw.getSpaceKillCredit(space_flags.getPilotTier(((obj_id)(objPlayers.get(intJ)))), getShipDifficulty(objDefender)); - } - - String information = getName(objDefender); - - gcw.grantModifiedGcwPoints(((obj_id)(objPlayers.get(intJ))), credit, gcw.GCW_POINT_TYPE_SPACE_PVE, information); - } - - if (utils.getIntLocalVar(objDefender, "intImperialFactionPoints") > 0 && factions.isImperial(((obj_id)(objPlayers.get(intJ))))) - { - int credit = 0; - - if (isCapShip(objDefender)) - { - credit = 30; - } - else - { - credit = gcw.getSpaceKillCredit(space_flags.getPilotTier(((obj_id)(objPlayers.get(intJ)))), getShipDifficulty(objDefender)); - } - - String information = getName(objDefender); - - gcw.grantModifiedGcwPoints(((obj_id)(objPlayers.get(intJ))), credit, gcw.GCW_POINT_TYPE_SPACE_PVE, information); - } - - String disableGroundXp = getConfigSetting("GameServer", "disableGroundXpInSpace"); - - if (disableGroundXp == null || disableGroundXp.equals("false") || disableGroundXp.equals("0")) - { - if (!utils.isProfession(((obj_id)(objPlayers.get(intJ))), utils.TRADER) && !utils.isProfession(((obj_id)(objPlayers.get(intJ))), utils.ENTERTAINER)) - { - int combatLevel = getLevel(((obj_id)(objPlayers.get(intJ)))); - - if (combatLevel < 90) - { - float fltGroundXp = intAmount * GROUND_XP_PERCENT; - int intGroundXp = (int) fltGroundXp; - - xp.grant(((obj_id)(objPlayers.get(intJ))), "combat_general", intGroundXp); - } - } - } - - doFactionPointGrant(((obj_id)(objPlayers.get(intJ))), intImperialFactionPoints, intRebelFactionPoints); - - if (hasSkill(((obj_id)(objPlayers.get(intJ))), "pilot_rebel_navy_master")) - { - xp.grant(((obj_id)(objPlayers.get(intJ))), xp.SPACE_PRESTIGE_REBEL, intAmount, true); - CustomerServiceLog("space_xp", "SPACE_PRESTIGE_REBEL|V1|"+ tier + "|TIME:"+ getGameTime() + "|PLAYER:"+ ((obj_id)(objPlayers.get(intJ))) + "|PLAYER_SHIP:"+ getPilotedShip(((obj_id)(objPlayers.get(intJ)))) + "|DEFENDER:"+ objDefender + "|DEFENDER_TYPE:"+ defenderType + "|AMT:"+ intAmount); - } - else if (hasSkill(((obj_id)(objPlayers.get(intJ))), "pilot_imperial_navy_master")) - { - xp.grant(((obj_id)(objPlayers.get(intJ))), xp.SPACE_PRESTIGE_IMPERIAL, intAmount, true); - CustomerServiceLog("space_xp", "SPACE_PRESTIGE_IMPERIAL|V1|"+ tier + "|TIME:"+ getGameTime() + "|PLAYER:"+ ((obj_id)(objPlayers.get(intJ))) + "|PLAYER_SHIP:"+ getPilotedShip(((obj_id)(objPlayers.get(intJ)))) + "|DEFENDER:"+ objDefender + "|DEFENDER_TYPE:"+ defenderType + "|AMT:"+ intAmount); - - } - else if (hasSkill(((obj_id)(objPlayers.get(intJ))), "pilot_neutral_master")) - { - xp.grant(((obj_id)(objPlayers.get(intJ))), xp.SPACE_PRESTIGE_PILOT, intAmount, true); - CustomerServiceLog("space_xp", "SPACE_PRESTIGE_PILOT|V1|"+ tier + "|TIME:"+ getGameTime() + "|PLAYER:"+ ((obj_id)(objPlayers.get(intJ))) + "|PLAYER_SHIP:"+ getPilotedShip(((obj_id)(objPlayers.get(intJ)))) + "|DEFENDER:"+ objDefender + "|DEFENDER_TYPE:"+ defenderType + "|AMT:"+ intAmount); - - } - else - { - xp.grant(((obj_id)(objPlayers.get(intJ))), xp.SPACE_COMBAT_GENERAL, intAmount, true); - - CustomerServiceLog("space_xp", "SPACE_COMBAT_GENERAL|V1|"+ tier + "|TIME:"+ getGameTime() + "|PLAYER:"+ ((obj_id)(objPlayers.get(intJ))) + "|PLAYER_SHIP:"+ getPilotedShip(((obj_id)(objPlayers.get(intJ)))) + "|DEFENDER:"+ objDefender + "|DEFENDER_TYPE:"+ defenderType + "|AMT:"+ intAmount); - int badgeCount = 0; - - if (badge.hasBadge(((obj_id)(objPlayers.get(intJ))), "pilot_rebel_navy_naboo")) - { - badgeCount++; - } - else if (badge.hasBadge(((obj_id)(objPlayers.get(intJ))), "pilot_rebel_navy_corellia")) - { - badgeCount++; - } - else if (badge.hasBadge(((obj_id)(objPlayers.get(intJ))), "pilot_rebel_navy_tatooine")) - { - badgeCount++; - } - - if (badge.hasBadge(((obj_id)(objPlayers.get(intJ))), "pilot_imperial_navy_naboo")) - { - badgeCount++; - } - else if (badge.hasBadge(((obj_id)(objPlayers.get(intJ))), "pilot_imperial_navy_corellia")) - { - badgeCount++; - } - else if (badge.hasBadge(((obj_id)(objPlayers.get(intJ))), "pilot_imperial_navy_tatooine")) - { - badgeCount++; - } - - if (badge.hasBadge(((obj_id)(objPlayers.get(intJ))), "pilot_neutral_naboo")) - { - badgeCount++; - } - else if (badge.hasBadge(((obj_id)(objPlayers.get(intJ))), "pilot_neutral_corellia")) - { - badgeCount++; - } - else if (badge.hasBadge(((obj_id)(objPlayers.get(intJ))), "pilot_neutral_tatooine")) - { - badgeCount++; - } - - if (badgeCount > 0) - { - int bonus = intAmount * badgeCount; - string_id sid_xp = new string_id(xp.STF_XP_N, xp.SPACE_COMBAT_GENERAL); - - xp.grant(((obj_id)(objPlayers.get(intJ))), xp.SPACE_COMBAT_GENERAL, bonus, false); - CustomerServiceLog("space_xp", "SPACE_COMBAT_GENERAL_BONUS|TIME:"+ getGameTime() + "|PLAYER:"+ ((obj_id)(objPlayers.get(intJ))) + "|PLAYER_SHIP:"+ getPilotedShip(((obj_id)(objPlayers.get(intJ)))) + "|DEFENDER:"+ objDefender + "|DEFENDER_TYPE:"+ defenderType + "|AMT:"+ bonus); - - prose_package pp = prose.getPackage(xp.PROSE_GRANT_XP_BONUS, sid_xp); - - if (exists(((obj_id)(objPlayers.get(intJ)))) && (((obj_id)(objPlayers.get(intJ))).isLoaded())) - { - sendSystemMessageProse(((obj_id)(objPlayers.get(intJ))), pp); - } - } - } - } - } - } - - } - } - - if (objWinningMembers != null) - { - int intRoll = rand(0, objWinningMembers.length - 1); - - objWinner = objWinningMembers[rand(0, objWinningMembers.length - 1)]; - } - - if ((objWinner.isLoaded() && (objWinner.isAuthoritative()))) - { - createLoot(objDefender, objWinner); - CustomerServiceLog("space_loot", "Creating Loot from "+ objDefender + " in "+ getLocation(objDefender) + " for "+ objWinner); - - if (space_battlefield.isInBattlefield(objWinner)) - { - CustomerServiceLog("battlefield", "Creating Loot from "+ objDefender + " in "+ getLocation(objDefender) + " for "+ objWinner); - } - } - - return; - } - - - public static String getPlayerTierString(obj_id player) throws InterruptedException - { - if (space_flags.isInTierOne(player)) - { - return "TIER1"; - } - else if (space_flags.isInTierTwo(player)) - { - return "TIER2"; - } - else if (space_flags.isInTierThree(player)) - { - return "TIER3"; - } - else if (space_flags.isInTierFour(player)) - { - return "TIER4"; - } - else - { - return "MASTER"; - } - } - - - public static void sendCreditNotification(obj_id objShip, int intCredits) throws InterruptedException - { - Vector objPlayers = space_transition.getContainedPlayers(objShip); - - if (space_utils.isShipWithInterior(objShip)) - { - - obj_id objGroup = group.getGroupObject(((obj_id)(objPlayers.get(0)))); - - if (isIdValid(objGroup)) - { - obj_id[] objGroupMembers = space_utils.getSpaceGroupMemberIds(objGroup); - - if (objGroupMembers != null) - { - string_id strSpam = new string_id("space/space_loot", "looted_credits"); - - prose_package proseTest = new prose_package(); - - proseTest = prose.setStringId(proseTest, strSpam); - proseTest = prose.setTT(proseTest, getEncodedName(objShip)); - proseTest = prose.setDI(proseTest, intCredits); - - for (int intI = 0; intI < objGroupMembers.length; intI++) - { - testAbortScript(); - if (exists(objGroupMembers[intI])) - { - sendSystemMessageProse(objGroupMembers[intI], proseTest); - } - } - } - } - else - { - string_id strSpam = new string_id("space/space_loot", "looted_credits_you"); - - prose_package proseTest = new prose_package(); - - proseTest = prose.setStringId(proseTest, strSpam); - proseTest = prose.setDI(proseTest, intCredits); - - sendSystemMessageProse(((obj_id)(objPlayers.get(0))), proseTest); - } - } - else - { - obj_id objGroup = group.getGroupObject(((obj_id)(objPlayers.get(0)))); - - if (isIdValid(objGroup)) - { - - obj_id objPilot = getPilotId(objShip); - - if (!isIdValid(objPilot)) - { - - return; - } - - string_id strSpam = new string_id("space/space_loot", "looted_credits"); - - prose_package proseTest = new prose_package(); - - proseTest = prose.setStringId(proseTest, strSpam); - proseTest = prose.setTT(proseTest, getEncodedName(objPilot)); - proseTest = prose.setDI(proseTest, intCredits); - - if (isIdValid(objGroup)) - { - obj_id[] objGroupMembers = space_utils.getSpaceGroupMemberIds(objGroup); - if (objGroupMembers != null) - { - for (int intI = 0; intI < objGroupMembers.length; intI++) - { - testAbortScript(); - if (exists(objGroupMembers[intI])) - { - sendSystemMessageProse(objGroupMembers[intI], proseTest); - } - } - } - } - - } - else - { - - obj_id objPilot = getPilotId(objShip); - - if (!isIdValid(objPilot)) - { - - return; - } - string_id strSpam = new string_id("space/space_loot", "looted_credits_you"); - - prose_package proseTest = new prose_package(); - - proseTest = prose.setStringId(proseTest, strSpam); - proseTest = prose.setDI(proseTest, intCredits); - - sendSystemMessageProse(objPilot, proseTest); - } - } - } - - - public static void sendItemNotification(obj_id objShip, obj_id objItem) throws InterruptedException - { - Vector objPlayers = space_transition.getContainedPlayers(objShip); - - if (space_utils.isShipWithInterior(objShip)) - { - - obj_id objGroup = group.getGroupObject(((obj_id)(objPlayers.get(0)))); - - if (isIdValid(objGroup)) - { - string_id strSpam = new string_id("space/space_loot", "looted_item"); - - prose_package proseTest = new prose_package(); - - proseTest = prose.setStringId(proseTest, strSpam); - proseTest = prose.setTT(proseTest, getEncodedName(objShip)); - proseTest = prose.setTO(proseTest, getEncodedName(objItem)); - - obj_id[] objGroupMembers = space_utils.getSpaceGroupMemberIds(objGroup); - if (objGroupMembers != null) - { - for (int intI = 0; intI < objGroupMembers.length; intI++) - { - testAbortScript(); - if (exists(objGroupMembers[intI])) - { - sendSystemMessageProse(objGroupMembers[intI], proseTest); - } - } - } - } - else - { - string_id strSpam = new string_id("space/space_loot", "looted_item_you"); - prose_package proseTest = new prose_package(); - - proseTest = prose.setStringId(proseTest, strSpam); - proseTest = prose.setTO(proseTest, getEncodedName(objItem)); - - sendSystemMessageProse(((obj_id)(objPlayers.get(0))), proseTest); - } - } - else - { - obj_id objGroup = group.getGroupObject(((obj_id)(objPlayers.get(0)))); - - if (isIdValid(objGroup)) - { - - obj_id objPilot = getPilotId(objShip); - - if (!isIdValid(objPilot)) - { - - return; - } - string_id strSpam = new string_id("space/space_loot", "looted_item"); - - prose_package proseTest = new prose_package(); - - proseTest = prose.setStringId(proseTest, strSpam); - proseTest = prose.setTT(proseTest, getEncodedName(objPilot)); - proseTest = prose.setTO(proseTest, getEncodedName(objItem)); - - if (isIdValid(objGroup)) - { - obj_id[] objGroupMembers = space_utils.getSpaceGroupMemberIds(objGroup); - if (objGroupMembers != null) - { - for (int intI = 0; intI < objGroupMembers.length; intI++) - { - testAbortScript(); - if (exists(objGroupMembers[intI])) - { - sendSystemMessageProse(objGroupMembers[intI], proseTest); - } - } - } - } - } - else - { - - obj_id objPilot = getPilotId(objShip); - - if (!isIdValid(objPilot)) - { - - return; - } - string_id strSpam = new string_id("space/space_loot", "looted_item_you"); - - prose_package proseTest = new prose_package(); - - proseTest = prose.setStringId(proseTest, strSpam); - - proseTest = prose.setTO(proseTest, getEncodedName(objItem)); - - sendSystemMessageProse(objPilot, proseTest); - } - } - } - - - public static void createLoot(obj_id objDefender, obj_id objAttacker) throws InterruptedException - { - final String LOOT_TABLE = "datatables/space_loot/loot_items.iff"; - final String LOOKUP_TABLE = "datatables/space_loot/loot_lookup.iff"; - String strContainer = "object/tangible/container/drum/warren_drum_loot.iff"; - obj_id objContainer = null; - obj_id objPilot = getPilotId(objAttacker); - - if (space_utils.isShipWithInterior(objAttacker)) - { - - objContainer = getObjIdObjVar(objAttacker, "objLootBox"); - } - else - { - - if (!isIdValid(objPilot)) - { - - return; - } - objContainer = utils.getInventoryContainer(objPilot); - - } - - if (!isIdValid(objContainer)) - { - - return; - } - - int intCredits = getIntObjVar(objDefender, "loot.intCredits"); - if (intCredits > 0) - { - obj_id creditChip = space_create.makeCreditChip(objContainer, intCredits); - if (isIdValid(creditChip)) - { - CustomerServiceLog("space_loot", "Made credit chip worth "+ intCredits + " in container "+ objContainer + " owned by "+ objAttacker, getOwner(objAttacker)); - sendCreditNotification(objAttacker, intCredits); - } - else - { - CustomerServiceLog("space_loot", "Failed to make credit chip due to inventory/loot box being full "+ intCredits + " in container "+ objContainer + " owned by "+ objAttacker, getOwner(objAttacker)); - string_id strSpam = new string_id("space/space_loot", "no_more_credits"); - space_utils.sendSystemMessageShip(objAttacker, strSpam, true, true, true, true); - - } - } - - if (hasObjVar(objDefender, "collection.collectionLoot") && hasObjVar(objDefender, "collection.rollBaseChance")) - { - - int playerRoll = rand(1, 100); - - int rollBaseChance = getIntObjVar(objDefender, "collection.rollBaseChance"); - - if (buff.hasBuff(objPilot, "nova_orion_rank6_lucky_salvage")) - { - rollBaseChance = rollBaseChance + NOVA_ORION_BUFF_COLLECTIBLES_BONUS; - } - - if (playerRoll <= rollBaseChance) - { - - String collectionLoot = getStringObjVar(objDefender, "collection.collectionLoot"); - - boolean success = getCollectionLoot(objAttacker, objPilot, objContainer, collectionLoot); - if (!success) - { - CustomerServiceLog("CollectionLootChannel: ", "LootFailed: "+ objDefender + "("+ objPilot + ")"+ " failed to receive dropped space collection item due to a failure in the getCollectionLoot function. Notify development."); - } - } - } - - int intNumItems = getIntObjVar(objDefender, "loot.intNumItems"); - String strTable = getStringObjVar(objDefender, "loot.strLootTable"); - - String[] strColumns = dataTableGetStringColumnNoDefaults(LOOKUP_TABLE, strTable); - - if (strColumns == null) - { - return; - } - - if (isIdValid(objPilot) && (utils.getPlayerProfession(objPilot) == utils.SMUGGLER)) - { - smuggler.spaceContrabandDropCheck(objPilot); - } - - for (int intI = 0; intI < intNumItems; intI++) - { - testAbortScript(); - - int intRoll = rand(0, strColumns.length - 1); - - String[] strItems = dataTableGetStringColumnNoDefaults(LOOT_TABLE, strColumns[intRoll]); - - if (strItems == null) - { - return; - } - - if ((strItems != null) && (strItems.length > 0)) - { - int intRoll2 = rand(0, strItems.length - 1); - String itemTemplateName = ""; - - if (getConfigSetting("GameServer", "enableLevelUpLoot") != null && (rand(1, 10000) == 1)) - { - itemTemplateName = "object/tangible/loot/quest/levelup_lifeday_orb.iff"; - } - else - { - itemTemplateName = strItems[intRoll2]; - } - - if (space_battlefield.isInBattlefield(objAttacker)) - { - CustomerServiceLog("battlefield", "%TU Created "+ itemTemplateName + " in "+ objContainer + " contained by "+ objAttacker, getOwner(objAttacker)); - } - - boolean success = attemptToGrantLootItem(itemTemplateName, objAttacker, objContainer); - if (!success) - { - break; - } - } - else - { - - return; - } - } - - if (hasObjVar(objDefender, "loot.novaOrionLoot")) - { - - int chance = rand(1,100); - - if (buff.hasBuff(objPilot, "nova_orion_rank6_lucky_salvage")) - { - chance = chance - NOVA_ORION_BUFF_MIDLITHE_BONUS; - } - - if (chance <= NOVA_ORION_RESOURCE_CHANCE) - { - int novaOrionLootModifier = getIntObjVar(objDefender, "loot.novaOrionLoot"); - - int min = NOVA_ORION_RESOURCE_MIN + novaOrionLootModifier; - int max = NOVA_ORION_RESOURCE_MAX + novaOrionLootModifier; - int count = rand(min, max); - - obj_id[] contents = getContents(objContainer); - boolean foundCrystal = false; - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; ++i) - { - testAbortScript(); - if (static_item.isStaticItem(contents[i]) && getStaticItemName(contents[i]).equals(NOVA_ORION_RESOURCE)) - { - int oldCount = getCount(contents[i]); - int newCount = oldCount + count; - setCount(contents[i], newCount); - foundCrystal = true; - break; - } - } - } - if (!foundCrystal) - { - obj_id lootItem = static_item.createNewItemFunction(NOVA_ORION_RESOURCE, objContainer); - setCount(lootItem, count); - } - string_id strSpam = new string_id("space/space_loot", "looted_item_you"); - - prose_package proseTest = new prose_package(); - - proseTest = prose.setStringId(proseTest, strSpam); - - proseTest = prose.setTO(proseTest, utils.packStringId(new string_id(static_item.STATIC_ITEM_NAME, NOVA_ORION_RESOURCE))); - - sendSystemMessageProse(objPilot, proseTest); - - } - } - - return; - } - - - public static void grantLootPermission(obj_id objWinner, obj_id objContainer) throws InterruptedException - { - - Vector objWinners = new Vector(); - objWinners.setSize(0); - - if (hasObjVar(objContainer, "objLooters")) - { - objWinners = getResizeableObjIdArrayObjVar(objContainer, "objLooters"); - } - - objWinners = utils.addElement(objWinners, objWinner); - setObjVar(objContainer, "objLooters", objWinners); - - return; - } - - - public static void notifyAttacker(obj_id objAttacker, obj_id objDefender, float fltPercentage) throws InterruptedException - { - dictionary dctParams = new dictionary(); - - dctParams.put("ship", objDefender); - String strShipType = getStringObjVar(objDefender, "ship.shipName"); - - if (strShipType != null) - { - dctParams.put("strShipType", strShipType); - } - - obj_id sourceSpawner = getObjIdObjVar(objDefender, "objParent"); - - if (isIdValid(sourceSpawner)) - { - String spawner_name = getStringObjVar(sourceSpawner, "strSpawnerName"); - - if (spawner_name != null) - { - dctParams.put("strSpawnerName", spawner_name); - } - } - - dctParams.put("fltPercentage", fltPercentage); - space_utils.notifyObject(objAttacker, "targetDestroyed", dctParams); - - return; - } - - - public static void notifyAttackerDisabled(obj_id objAttacker, obj_id objDefender, dictionary dctParams) throws InterruptedException - { - dctParams.put("ship", objDefender); - String strShipType = getStringObjVar(objDefender, "ship.shipName"); - - if (strShipType != null) - { - dctParams.put("strShipType", strShipType); - } - - obj_id sourceSpawner = getObjIdObjVar(objDefender, "objParent"); - - if (isIdValid(sourceSpawner)) - { - String spawner_name = getStringObjVar(sourceSpawner, "strSpawnerName"); - - if (spawner_name != null) - { - dctParams.put("strSpawnerName", spawner_name); - } - } - - space_utils.notifyObject(objAttacker, "targetDisabled", dctParams); - - return; - } - - - public static dictionary getKillPercentages(obj_id objDefender) throws InterruptedException - { - - Vector objAttackers = new Vector(); - objAttackers.setSize(0); - Vector fltPercentages = new Vector(); - fltPercentages.setSize(0); - float fltTotalDamage = 0; - dictionary dctParams = new dictionary(); - - float fltMaxDamage = 0; - int intMaxDamageIndex = 0; - - obj_id[] objTrackedAttackers = utils.getObjIdArrayLocalVar(objDefender, "combat.objAttackers"); - - float[] fltTrackedDamage = utils.getFloatArrayLocalVar(objDefender, "combat.fltDamageTracked"); - - if (fltTrackedDamage != null && objTrackedAttackers != null) - { - for (int intI = 0; intI < fltTrackedDamage.length; intI++) - { - testAbortScript(); - if ((objTrackedAttackers[intI].isLoaded() && (objTrackedAttackers[intI].isAuthoritative()))) - { - if (fltMaxDamage < fltTrackedDamage[intI]) - { - fltMaxDamage = fltTrackedDamage[intI]; - intMaxDamageIndex = intI; - } - - fltTotalDamage = fltTotalDamage + fltTrackedDamage[intI]; - } - - } - - dctParams.put("fltTotalDamage", fltTotalDamage); - dctParams.put("fltMaxDamage", fltMaxDamage); - dctParams.put("intMaxDamageIndex", intMaxDamageIndex); - dctParams.put("objWinner", objTrackedAttackers[intMaxDamageIndex]); - - if (utils.hasLocalVar(objDefender, "combat.groups." + objTrackedAttackers[intMaxDamageIndex])) - { - dctParams.put("objWinningMembers", utils.getObjIdArrayLocalVar(objDefender, "combat.groups."+ objTrackedAttackers[intMaxDamageIndex])); - dctParams.put("fltWinningMemberDamage", utils.getFloatArrayLocalVar(objDefender, "combat.groups."+ objTrackedAttackers[intMaxDamageIndex] + "fltDamage")); - } - - float fltDamage = 0; - float fltPercentage = 0; - - for (int intI = 0; intI < objTrackedAttackers.length; intI++) - { - testAbortScript(); - - fltDamage = fltTrackedDamage[intI]; - fltPercentage = fltDamage / fltTotalDamage; - - if (utils.hasLocalVar(objDefender, "combat.groups." + objTrackedAttackers[intI])) - { - obj_id[] objGroupMembers = utils.getObjIdArrayLocalVar(objDefender, "combat.groups."+ objTrackedAttackers[intI]); - - for (int intJ = 0; intJ < objGroupMembers.length; intJ++) - { - testAbortScript(); - - if ((objGroupMembers[intJ].isLoaded() && (objGroupMembers[intJ].isAuthoritative()))) - { - objAttackers = utils.addElement(objAttackers, objGroupMembers[intJ]); - fltPercentages = utils.addElement(fltPercentages, fltPercentage); - } - } - } - else - { - - if (objTrackedAttackers[intI].isLoaded() && objTrackedAttackers[intI].isAuthoritative()) - { - objAttackers = utils.addElement(objAttackers, objTrackedAttackers[intI]); - fltPercentages = utils.addElement(fltPercentages, fltPercentage); - } - } - } - - if (objAttackers.size() > 0) - { - dctParams.put("objAttackers", objAttackers); - dctParams.put("fltPercentages", fltPercentages); - } - } - - return dctParams; - } - - - public static void setEfficiencyModifier(int intSlot, obj_id objShip, float fltGeneralModifier, float fltEnergyModifier) throws InterruptedException - { - - if ((fltGeneralModifier == 1.0f) && (fltEnergyModifier == 1.0f)) - { - clearEfficiencyModifier(intSlot, objShip); - return; - - } - else - { - String strName = ship_chassis_slot_type.names[intSlot]; - - utils.setLocalVar(objShip, strName + "Efficiency", 1); - utils.setLocalVar(objShip, strName + "EfficiencyGeneral", fltGeneralModifier); - utils.setLocalVar(objShip, strName + "EfficiencyEnergy", fltEnergyModifier); - recalculateEfficiency(intSlot, objShip); - } - - return; - } - - - public static void clearEfficiencyModifier(int intSlot, obj_id objShip) throws InterruptedException - { - String strName = ship_chassis_slot_type.names[intSlot]; - - utils.removeLocalVar(objShip, strName + "Efficiency"); - utils.removeLocalVar(objShip, strName + "EfficiencyGeneral"); - utils.removeLocalVar(objShip, strName + "EfficiencyEnergy"); - recalculateEfficiency(intSlot, objShip); - - return; - } - - - public static boolean isEfficiencyModified(int intSlot, obj_id objShip) throws InterruptedException - { - String strName = ship_chassis_slot_type.names[intSlot]; - - if (utils.hasLocalVar(objShip, strName + "Efficiency")) - { - return true; - } - - return false; - } - - - public static void recalculateEfficiency(int intSlot, obj_id objShip, float fltRawEfficiency) throws InterruptedException - { - - if (fltRawEfficiency == 0) - { - return; - } - - String strName = ship_chassis_slot_type.names[intSlot]; - float fltEnergyModifier = 1.0f; - float fltGeneralModifier = 1.0f; - - if (utils.hasLocalVar(objShip, strName + "Efficiency")) - { - fltGeneralModifier = utils.getFloatLocalVar(objShip, strName + "EfficiencyGeneral"); - fltEnergyModifier = utils.getFloatLocalVar(objShip, strName + "EfficiencyEnergy"); - - } - float fltFinalGeneralEfficiency = fltGeneralModifier * fltRawEfficiency; - float fltFinalEnergyEfficiency = fltEnergyModifier; - - setEfficiencies(intSlot, objShip, fltFinalGeneralEfficiency, fltFinalEnergyEfficiency); - } - - - public static void recalculateEfficiencyGeneral(int intSlot, obj_id objShip) throws InterruptedException - { - recalculateEfficiencyGeneral(intSlot, objShip, getRawEfficiency(intSlot, objShip)); - } - - - public static void recalculateEfficiencyGeneral(int intSlot, obj_id objShip, float fltRawEfficiency) throws InterruptedException - { - - if (fltRawEfficiency == 0) - { - return; - } - - String strName = ship_chassis_slot_type.names[intSlot]; - float fltGeneralModifier = 1.0f; - - if (utils.hasLocalVar(objShip, strName + "Efficiency")) - { - fltGeneralModifier = utils.getFloatLocalVar(objShip, strName + "EfficiencyGeneral"); - } - - float fltFinalGeneralEfficiency = fltGeneralModifier * fltRawEfficiency; - - setEfficiencyGeneral(intSlot, objShip, fltFinalGeneralEfficiency); - } - - - public static void recalculateEfficiency(int intSlot, obj_id objShip) throws InterruptedException - { - float fltRawEfficiency = getRawEfficiency(intSlot, objShip); - - recalculateEfficiency(intSlot, objShip, fltRawEfficiency); - } - - - public static void setEfficiencyGeneral(int intSlot, obj_id objShip, float fltGeneralModifier) throws InterruptedException - { - if (fltGeneralModifier < MINIMUM_EFFICIENCY) - { - fltGeneralModifier = MINIMUM_EFFICIENCY; - } - setShipComponentEfficiencyGeneral(objShip, intSlot, fltGeneralModifier); - - return; - } - - - public static void setEfficiencies(int intSlot, obj_id objShip, float fltGeneralModifier, float fltEnergyModifier) throws InterruptedException - { - - if (fltEnergyModifier < MINIMUM_EFFICIENCY) - { - fltEnergyModifier = MINIMUM_EFFICIENCY; - } - if (fltGeneralModifier < MINIMUM_EFFICIENCY) - { - fltGeneralModifier = MINIMUM_EFFICIENCY; - } - - setShipComponentEfficiencyGeneral(objShip, intSlot, fltGeneralModifier); - setShipComponentEfficiencyEnergy(objShip, intSlot, fltEnergyModifier); - - return; - } - - - public static void zeroEfficienciesClearPowerups(int intSlot, obj_id objShip) throws InterruptedException - { - String strName = ship_chassis_slot_type.names[intSlot]; - - utils.removeLocalVar(objShip, strName + "Efficiency"); - utils.removeLocalVar(objShip, strName + "EfficiencyGeneral"); - utils.removeLocalVar(objShip, strName + "EfficiencyEnergy"); - setEfficiencies(intSlot, objShip, 0.0f, 0.0f); - - return; - } - - - public static float getRawEfficiency(int intSlot, obj_id objShip) throws InterruptedException - { - - boolean boolUpdateComponent = true; - float fltCurrentHitpoints = getShipComponentHitpointsCurrent(objShip, intSlot); - float fltMaximumHitpoints = getShipComponentHitpointsMaximum(objShip, intSlot); - - if (fltMaximumHitpoints == 0) - { - if (hasScript(objShip, "space.ship.ship_interior")) - { - dictionary dctParams = new dictionary(); - - dctParams.put("intSlot", intSlot); - space_utils.notifyObject(objShip, "componentDisabledByDamage", dctParams); - boolUpdateComponent = false; - } - - space_utils.setComponentDisabled(objShip, intSlot, true); - - return 0; - } - - if (fltCurrentHitpoints == 0) - { - if (hasScript(objShip, "space.ship.ship_interior")) - { - dictionary dctParams = new dictionary(); - - dctParams.put("intSlot", intSlot); - space_utils.notifyObject(objShip, "componentDisabledByDamage", dctParams); - boolUpdateComponent = false; - } - - space_utils.setComponentDisabled(objShip, intSlot, true); - - return 0; - } - - if (boolUpdateComponent) - { - if (hasScript(objShip, "space.ship.ship_interior")) - { - dictionary dctParams = new dictionary(); - - dctParams.put("intSlot", intSlot); - dctParams.put("fltCurrentHitpoints", fltCurrentHitpoints); - dctParams.put("fltMaximumHitpoints", fltMaximumHitpoints); - space_utils.notifyObject(objShip, "componentEfficiencyChanged", dctParams); - } - } - - float fltEfficiency = fltCurrentHitpoints / fltMaximumHitpoints; - - return fltEfficiency; - } - - - public static void recalculateEfficiencies(obj_id objComponent) throws InterruptedException - { - - float fltMaximumHitpoints = space_crafting.getComponentMaximumHitpoints(objComponent); - float fltCurrentHitpoints = space_crafting.getComponentCurrentHitpoints(objComponent); - float fltEfficiency = 0; - - if (fltCurrentHitpoints > 0) - { - fltEfficiency = fltMaximumHitpoints / fltCurrentHitpoints; - } - else - { - fltEfficiency = 0; - } - - setEfficiencies(objComponent, fltEfficiency, fltEfficiency); - } - - - public static void setEfficiencies(obj_id objComponent, float fltGeneralModifier, float fltEnergyModifier) throws InterruptedException - { - - if (fltEnergyModifier < MINIMUM_EFFICIENCY) - { - fltEnergyModifier = MINIMUM_EFFICIENCY; - } - if (fltGeneralModifier < MINIMUM_EFFICIENCY) - { - fltGeneralModifier = MINIMUM_EFFICIENCY; - } - - space_crafting.setComponentGeneralEfficiency(objComponent, fltGeneralModifier); - space_crafting.setComponentEnergyEfficiency(objComponent, fltEnergyModifier); - - return; - } - - - public static boolean drainEnergyFromCapacitor(obj_id objShip, float fltEnergy, boolean boolOverride) throws InterruptedException - { - - float fltCurrentEnergy = getShipCapacitorEnergyCurrent(objShip); - - if (fltCurrentEnergy < fltEnergy) - { - if (boolOverride) - { - fltCurrentEnergy = 0; - } - else - { - return false; - } - - } - else - { - fltCurrentEnergy = fltCurrentEnergy - fltEnergy; - } - - setShipCapacitorEnergyCurrent(objShip, fltCurrentEnergy); - - return true; - } - - - public static boolean drainEnergyFromShield(obj_id objShip, int intSide, float fltEnergy, boolean boolOverride) throws InterruptedException - { - if (intSide == FRONT) - { - float fltCurrentEnergy = getShipShieldHitpointsFrontCurrent(objShip); - - if (fltCurrentEnergy < fltEnergy) - { - if (boolOverride) - { - fltCurrentEnergy = 0; - } - else - { - return false; - } - - } - else - { - fltCurrentEnergy = fltCurrentEnergy - fltEnergy; - } - - setShipShieldHitpointsFrontCurrent(objShip, fltCurrentEnergy); - - return true; - } - else - { - float fltCurrentEnergy = getShipShieldHitpointsBackCurrent(objShip); - - if (fltCurrentEnergy < fltEnergy) - { - if (boolOverride) - { - fltCurrentEnergy = 0; - } - else - { - return false; - } - - } - else - { - fltCurrentEnergy = fltCurrentEnergy - fltEnergy; - } - - setShipShieldHitpointsBackCurrent(objShip, fltCurrentEnergy); - - return true; - } - } - - - public static boolean addEnergyToCapacitor(obj_id objShip, int intWeaponCapacitor, float fltEnergy, boolean boolOverride) throws InterruptedException - { - - float fltCurrentEnergy = getShipCapacitorEnergyCurrent(objShip); - float fltMaximumEnergy = getShipCapacitorEnergyMaximum(objShip); - float fltDifference = fltMaximumEnergy - fltCurrentEnergy; - - if (fltDifference < fltEnergy) - { - if (boolOverride) - { - fltCurrentEnergy = fltMaximumEnergy; - } - else - { - return false; - } - } - else - { - fltCurrentEnergy = fltCurrentEnergy + fltEnergy; - } - - setShipCapacitorEnergyCurrent(objShip, fltCurrentEnergy); - - return true; - } - - - public static boolean addEnergyToShield(obj_id objShip, int intSide, float fltEnergy, boolean boolOverride) throws InterruptedException - { - if (intSide == FRONT) - { - float fltCurrentEnergy = getShipShieldHitpointsFrontCurrent(objShip); - float fltMaximumEnergy = getShipShieldHitpointsFrontMaximum(objShip); - float fltDifference = fltMaximumEnergy - fltCurrentEnergy; - - if (fltDifference < fltEnergy) - { - if (boolOverride) - { - fltCurrentEnergy = fltMaximumEnergy; - } - else - { - return false; - } - } - else - { - fltCurrentEnergy = fltCurrentEnergy + fltEnergy; - } - - setShipShieldHitpointsFrontCurrent(objShip, fltCurrentEnergy); - - return true; - } - else - { - float fltCurrentEnergy = getShipShieldHitpointsBackCurrent(objShip); - float fltMaximumEnergy = getShipShieldHitpointsBackMaximum(objShip); - float fltDifference = fltMaximumEnergy - fltCurrentEnergy; - - if (fltDifference < fltEnergy) - { - if (boolOverride) - { - fltCurrentEnergy = fltMaximumEnergy; - } - else - { - return false; - } - } - else - { - fltCurrentEnergy = fltCurrentEnergy + fltEnergy; - } - - setShipShieldHitpointsBackCurrent(objShip, fltCurrentEnergy); - - return true; - } - } - - - public static boolean transferFrontShieldToBack(obj_id objShip, float fltPercentage) throws InterruptedException - { - float fltCurrentEnergy = getShipShieldHitpointsFrontCurrent(objShip); - float fltEnergy = fltCurrentEnergy * fltPercentage; - - if (drainEnergyFromShield(objShip, space_combat.FRONT, fltEnergy, false)) - { - addEnergyToShield(objShip, space_combat.BACK, fltEnergy, true); - - return true; - } - else - { - return false; - } - } - - - public static boolean transferBackShieldToFront(obj_id objShip, float fltPercentage) throws InterruptedException - { - float fltCurrentEnergy = getShipShieldHitpointsBackCurrent(objShip); - float fltEnergy = fltCurrentEnergy * fltPercentage; - - if (drainEnergyFromShield(objShip, space_combat.BACK, fltEnergy, false)) - { - addEnergyToShield(objShip, space_combat.FRONT, fltEnergy, true); - return true; - } - else - { - return false; - } - } - - - public static boolean reinforceShieldsFromCapacitor(obj_id objShip, float fltPercentage) throws InterruptedException - { - float fltCurrentEnergy = getShipCapacitorEnergyCurrent(objShip); - - float fltEnergy = fltCurrentEnergy * fltPercentage; - - if (drainEnergyFromCapacitor(objShip, fltEnergy, false)) - { - - fltCurrentEnergy = getShipCapacitorEnergyCurrent(objShip); - - addEnergyToShield(objShip, space_combat.FRONT, fltEnergy / 2, true); - - addEnergyToShield(objShip, space_combat.BACK, fltEnergy / 2, true); - return true; - } - - return false; - } - - - public static boolean isComponentMandatory(obj_id objShip, int intSlot) throws InterruptedException - { - for (int intI = 0; intI < MANDATORY_COMPONENTS.length; intI++) - { - testAbortScript(); - if (intSlot == MANDATORY_COMPONENTS[intI]) - { - return true; - } - } - - return false; - } - - - public static boolean isShipDisabled(obj_id objShip, int intSlot) throws InterruptedException - { - if (isComponentMandatory(objShip, intSlot)) - { - return true; - } - - return false; - } - - - public static boolean isShipDisabled(obj_id objShip) throws InterruptedException - { - - for (int intI = 0; intI < MANDATORY_COMPONENTS.length; intI++) - { - testAbortScript(); - if (isShipComponentDisabled(objShip, MANDATORY_COMPONENTS[intI])) - { - return true; - } - } - - return false; - } - - - public static void killSpacePlayer(obj_id objShip) throws InterruptedException - { - - LOG("space", "Killing "+ objShip); - Vector objPlayers = space_utils.getPlayersInShip(objShip); - - if (utils.hasScriptVar(objShip, "intEjecting")) - { - utils.removeScriptVar(objShip, "intEjecting"); - } - - if (hasObjVar(objShip, "intAlarmsOn")) - { - space_crafting.turnOnInteriorAlarms(objShip); - } - - space_crafting.fixAllPlasmaConduits(objShip); - - clearHyperspace(objShip); - - if (objPlayers != null) - { - for (int intI = 0; intI < objPlayers.size(); intI++) - { - testAbortScript(); - - groundquests.sendSignal(((obj_id)(objPlayers.get(intI))), "smugglerEnemyIncap"); - string_id strSpam = new string_id("space/space_interaction", "your_ship_esploded"); - - sendSystemMessage(((obj_id)(objPlayers.get(intI))), strSpam); - CustomerServiceLog("space_death", "Wounding "+ ((obj_id)(objPlayers.get(intI))) + " because "+ objShip + " exploded", ((obj_id)(objPlayers.get(intI)))); - healing.healClone(((obj_id)(objPlayers.get(intI))), false); - } - } - - ship_ai.unitRemoveFromAllAttackTargetLists(objShip); - ship_ai.unitSetAutoAggroImmune(objShip, true); - - space_pilot_command.allPurposeShipComponentReset(objShip); - space_transition.clearOvertStatus(objShip); - obj_id objPilot = getPilotId(objShip); - - if (utils.hasScriptVar(objShip, "intPVPKill")) - { - space_crafting.repairDamageToPercentage(objPilot, objShip, 1.0f); - } - - clearDeathFlags(objShip); - clearCondition(objShip, CONDITION_EJECT); - - if (space_battlefield.isInBattlefield(objShip)) - { - CustomerServiceLog("battlefield", "Battlefield death for "+ objShip + " removing them from "+ getLocation(objShip), getOwner(objShip)); - doBattlefieldRepairCheck(objShip); - location locTest = getLocationObjVar(objShip, "battlefield.locRespawnLocation"); - - if (locTest == null) - { - locTest = getLocation(objShip); - locTest.x = 0; - locTest.y = 0; - locTest.z = 0; - - warpPlayer(objShip, locTest.area, locTest.x, locTest.y, locTest.z, null, locTest.x, locTest.y, locTest.z, null, true); - - } - else - { - removeObjVar(objShip, "battlefield.locRespawnLocation"); - warpPlayer(objShip, locTest.area, locTest.x, locTest.y, locTest.z, null, locTest.x, locTest.y, locTest.z, null, true); - } - - return; - } - else - { - obj_id objClosestStation = getClosestSpaceStation(objShip); - - if (isIdValid(objClosestStation) && (!exists(objClosestStation))) - { - objClosestStation = null; - } - - if (!isIdValid(objClosestStation)) - { - - if (isIdValid(objPilot)) - { - sendSystemMessageTestingOnly(getPilotId(objShip), "Respawn failure. You don't have any space stations defined, or no quest manager for them to register with. Sorry :("); - } - - location locTest = getLocation(objShip); - - locTest.x = 0; - locTest.y = 0; - locTest.z = 0; - - warpPlayer(objShip, locTest.area, locTest.x, locTest.y, locTest.z, null, locTest.x, locTest.y, locTest.z, null, true); - } - else - { - - transform trTest = space_utils.getRandomPositionInSphere(getTransform_o2p(objClosestStation), 425f, 450f, false); - - vector vctTest = space_utils.getVector(objClosestStation); - - CustomerServiceLog("space_loot", "Killing "+ objShip + " and sending them to "+ getLocation(objClosestStation), getOwner(objShip)); - transform trFinalTransform = space_utils.faceTransformToVector(trTest, vctTest); - - location locTest = getLocation(objShip); - - space_utils.openCommChannelAfterLoad(objShip, objClosestStation); - warpPlayer(objShip, locTest.area, vctTest.x, vctTest.y, vctTest.z, null, vctTest.x, vctTest.y, vctTest.z, null, true); - setTransform_o2p(objShip, trFinalTransform); - - } - - } - - return; - } - - - public static obj_id getClosestSpaceStation(obj_id objShip) throws InterruptedException - { - obj_id objQuestManager = null; - - if (!utils.checkConfigFlag("ScriptFlags", "liveSpaceServer")) - { - try - { - objQuestManager = getNamedObject(space_quest.QUEST_MANAGER); - } - catch(Throwable err) - { - return null; - } - } - else - { - objQuestManager = getNamedObject(space_quest.QUEST_MANAGER); - } - - if (!isIdValid(objQuestManager)) - { - - return null; - } - - location locTest = getLocation(objShip); - - obj_id[] objSpaceStations = utils.getObjIdArrayScriptVar(objQuestManager, "objSpaceStations"); - - if (objSpaceStations == null || objSpaceStations.length == 0) - { - - return null; - } - - float fltDistance = 320000; - obj_id objClosestStation = null; - - for (int intI = 0; intI < objSpaceStations.length; intI++) - { - testAbortScript(); - - location locStation = getLocation(objSpaceStations[intI]); - - float fltTest = getDistance(locTest, locStation); - - if (fltTest < fltDistance) - { - objClosestStation = objSpaceStations[intI]; - - fltDistance = fltTest; - } - } - - return objClosestStation; - } - - - public static void initializeCommandTimer(obj_id pilot, int commandDelay) throws InterruptedException - { - int time = getGameTime(); - - time = time + commandDelay; - utils.setScriptVar(pilot, "cmd.commandTimeStamp", time); - dictionary outparams = new dictionary(); - - if (!messageTo(pilot, "commandTimerTimeout", outparams, (float) (commandDelay), false)) - { - debugServerConsoleMsg(null, "+++ space_combat . initializeCommandTimer +++ FAILED to send messageTo. ObjID of pilot was: "+ pilot + " amount of time delay was: "+ commandDelay); - } - } - - - public static boolean commandTimePassed(obj_id pilot) throws InterruptedException - { - int intCurrentTime = getGameTime(); - int intLastTime = utils.getIntScriptVar(pilot, "cmd.commandTimeStamp"); - - if (intCurrentTime < intLastTime) - { - string_id strSpam = new string_id("space/space_interaction", "pilot_command_delay"); - - sendSystemMessage(pilot, strSpam); - - if ((intLastTime - intCurrentTime) < 60) - { - - string_id strSpam2 = new string_id("space/space_interaction", "pilot_command_delay_bit"); - - sendSystemMessage(pilot, strSpam2); - } - else if ((intLastTime - intCurrentTime) < 120) - { - - string_id strSpam2 = new string_id("space/space_interaction", "pilot_command_delay_some"); - - sendSystemMessage(pilot, strSpam2); - } - - return false; - } - - return true; - } - - - public static boolean doReactorPumpPulse(obj_id pilot, obj_id ship) throws InterruptedException - { - if (!isShipSlotInstalled(ship, ship_chassis_slot_type.SCST_reactor)) - { - debugServerConsoleMsg(null, "+++ SPACE COMMAND . doReactorPumpPulse +++ No reactor onboard. What the!?."); - return false; - } - - flightDroidVocalize(ship, 1); - - if (space_combat.doesReactorScram(pilot, ship, "level1command")) - { - space_combat.scramReactor(pilot, ship); - return true; - } - - if (isEfficiencyModified(ship_chassis_slot_type.SCST_reactor, ship)) - { - setEfficiencyModifier(ship_chassis_slot_type.SCST_reactor, ship, 1.0f, 1.0f); - - string_id strSpam = new string_id("space/space_interaction", "aborting_reactor_pump"); - - sendSystemMessage(pilot, strSpam); - } - else - { - string_id strSpam = new string_id("space/space_interaction", "do_reactor_pump_one"); - string_id strSpamTwo = new string_id("space/space_interaction", "do_reactor_pump_two"); - - sendSystemMessage(pilot, strSpam); - sendSystemMessage(pilot, strSpamTwo); - - float rndReactorUpgradeEffect = rand(1.1f, 1.4f); - - debugServerConsoleMsg(null, "+++ SPACE COMMAND . doReactorPumpPulse +++ Looks like the upgrade will be: "+ rndReactorUpgradeEffect); - - setEfficiencyModifier(ship_chassis_slot_type.SCST_reactor, ship, rndReactorUpgradeEffect, 1.0f); - setEfficiencyModifier(ship_chassis_slot_type.SCST_engine, ship, rndReactorUpgradeEffect, 1.0f); - - int pumpPulseLoops = (int) (rand(1.0f, 10.0f)); - - dictionary outparams = new dictionary(); - - outparams.put("ship", ship); - outparams.put("loops", pumpPulseLoops); - outparams.put("pilot", pilot); - - if (!messageTo(ship, "reactorPumpPulseTimeout", outparams, 5.0f, false)) - { - debugServerConsoleMsg(null, "+++ SPACE COMMAND . doReactorPumpPulse +++ FAILED to send messageTo. ObjID of ship was: "+ ship + " objID of pilot was: "+ pilot + " number of loops was: "+ pumpPulseLoops); - } - } - - return true; - - } - - - public static boolean doesReactorScram(obj_id pilot, obj_id ship, String difficultyOfCommand) throws InterruptedException - { - if (!isIdValid(pilot) || !isIdValid(ship)) - { - return true; - } - - int successLevel = doPilotCommandSkillCheck(pilot, difficultyOfCommand); - - if (successLevel > 4) - { - return true; - } - - return false; - } - - - public static void scramReactor(obj_id pilot, obj_id ship) throws InterruptedException - { - string_id strSpam = new string_id("space/space_interaction", "scramming_reactor"); - - sendSystemMessage(pilot, strSpam); - - space_utils.setComponentDisabled(ship, ship_chassis_slot_type.SCST_reactor, true); - space_utils.setComponentDisabled(ship, ship_chassis_slot_type.SCST_engine, true); - - if (isShipSlotInstalled(ship, ship_chassis_slot_type.SCST_booster)) - { - space_utils.setComponentDisabled(ship, ship_chassis_slot_type.SCST_booster, true); - } - - if (getShipHasWings(ship)) - { - clearCondition(ship, CONDITION_WINGS_OPENED); - } - - String cefPlayBackHardpoint = targetHardpointForCefPlayback(ship); - - playClientEffectObj(pilot, "clienteffect/space_command/scram_reactor_shuttingdown_siren.cef", ship, cefPlayBackHardpoint); - playClientEffectObj(pilot, "clienteffect/space_command/scram_reactor_shutdown_engine.cef", ship, cefPlayBackHardpoint); - - int scramLoops = (int) (rand(1.0f, 10.0f)); - - dictionary outparams = new dictionary(); - - outparams.put("ship", ship); - outparams.put("loops", scramLoops); - outparams.put("pilot", pilot); - - messageTo(ship, "unScramReactor", outparams, 5.0f, false); - } - - - public static int getPlayerCommandSkill(obj_id pilot) throws InterruptedException - { - int playerSkill = 0; - - if (hasSkill(pilot, "pilot_rebel_navy_master") || hasSkill(pilot, "pilot_imperial_navy_master") || hasSkill(pilot, "pilot_neutral_master")) - { - playerSkill = 10; - } - else if (hasSkill(pilot, "pilot_imperial_navy_procedures_04") || hasSkill(pilot, "pilot_neutral_procedures_04") || hasSkill(pilot, "pilot_rebel_navy_procedures_04")) - { - playerSkill = 7; - } - else if (hasSkill(pilot, "pilot_imperial_navy_procedures_03") || hasSkill(pilot, "pilot_neutral_procedures_03") || hasSkill(pilot, "pilot_rebel_navy_procedures_03")) - { - playerSkill = 5; - } - else if (hasSkill(pilot, "pilot_imperial_navy_procedures_02") || hasSkill(pilot, "pilot_neutral_procedures_02") || hasSkill(pilot, "pilot_rebel_navy_procedures_02")) - { - playerSkill = 3; - } - else - { - playerSkill = 1; - } - - return playerSkill; - } - - - public static int getAttackerSkill(obj_id targetShip) throws InterruptedException - { - final int CONST_PILOT_FAIL = 0; - - int pilotSkill = 0; - - if (ship_ai.isPlayerShip(targetShip)) - { - obj_id playerPilot = space_utils.getCommandExecutor(targetShip); - - if (isIdValid(playerPilot)) - { - pilotSkill = getPlayerCommandSkill(playerPilot); - } - } - else if (hasObjVar(targetShip, "ship.pilotType")) - { - String strPilot = getStringObjVar(targetShip, "ship.pilotType"); - - if (strPilot == null) - { - debugServerConsoleMsg(null, "space_combat.getNpcPilotSkill -- strPilot checked out as NULL"); - pilotSkill = CONST_PILOT_FAIL; - } - else if (strPilot.equals("ace")) - { - pilotSkill = 10; - } - else if (strPilot.equals("average")) - { - pilotSkill = 5; - } - else if (strPilot.equals("rookie")) - { - pilotSkill = 2; - } - else - { - pilotSkill = CONST_PILOT_FAIL; - } - return pilotSkill; - } - return CONST_PILOT_FAIL; - } - - - public static boolean doIffScramble(obj_id pilot, obj_id ship) throws InterruptedException - { - debugServerConsoleMsg(null, "space_combat.doIffScramble ++ entered function"); - - obj_id[] myAttackers = ship_ai.unitGetWhoIsTargetingMe(ship); - - if ((myAttackers == null) || (myAttackers.length == 0)) - { - string_id strSpam = new string_id("space/space_interaction", "iff_spoof_dont_bother"); - - sendSystemMessage(pilot, strSpam); - return false; - } - - flightDroidVocalize(ship, 1); - - int rnd = rand(1, 10); - - int playerSkill = getPlayerCommandSkill(pilot); - int spoofedAttackers = 0; - dictionary params = new dictionary(); - - int numberOfJammedDudes = 0; - int sumTotalOfSkillCheckDeltas = 0; - int lowestSkillCheckDelta = 0; - int highestSkillCheckDelta = 0; - - for (int i = 0; i < myAttackers.length; i++) - { - testAbortScript(); - if (isIdValid(myAttackers[i])) - { - obj_id thisAttacker = myAttackers[i]; - - if (exists(thisAttacker)) - { - if (!space_utils.isPlayerControlledShip(myAttackers[i])) - { - int attackerSkill = getAttackerSkill(myAttackers[i]); - - if ((playerSkill + rnd) > (attackerSkill + 3)) - { - debugServerConsoleMsg(null, "space_combat.doIffScramble ++ iff scrambled ship "+ thisAttacker + " with my skill "+ playerSkill + " and botskill "+ attackerSkill + " and rnd "+ rnd); - - ship_ai.unitRemoveAttackTarget(thisAttacker, ship); - - playClientEffectObj(ship, "clienteffect/space_command/shp_shocked_radio_01_noshake.cef", thisAttacker, ""); - - spoofedAttackers++; - int skillCheckDelta = (playerSkill + rnd) - (attackerSkill + 3); - - sumTotalOfSkillCheckDeltas += skillCheckDelta; - numberOfJammedDudes++; - - } - else - { - debugServerConsoleMsg(null, "space_combat.doIffScramble ++ iff did NOT scramble ship "+ thisAttacker + " with my skill "+ playerSkill + " and botskill "+ attackerSkill + " and rnd "+ rnd); - } - } - } - } - } - - if (spoofedAttackers <= 0) - { - string_id strSpam = new string_id("space/space_interaction", "iff_spoofing_unsuccessful"); - - sendSystemMessage(pilot, strSpam); - - dictionary outparams = new dictionary(); - - outparams.put("pilot", pilot); - outparams.put("ship", ship); - messageTo(pilot, "unIffScramble", outparams, 360.0f, false); - - return false; - } - - float agroImmuneTime = (sumTotalOfSkillCheckDeltas / numberOfJammedDudes) * 5; - - if (agroImmuneTime < 20.0f) - { - agroImmuneTime = 20.0f; - } - - ship_ai.unitSetAutoAggroImmuneTime(ship, agroImmuneTime); - - string_id strSpam = new string_id("space/space_interaction", "iff_spoofed"); - - sendSystemMessage(pilot, strSpam); - - dictionary outparams = new dictionary(); - - outparams.put("pilot", pilot); - outparams.put("ship", ship); - messageTo(pilot, "unIffScramble", outparams, 360.0f, false); - - return true; - } - - - public static void disableWeaponry(obj_id ship, boolean disable) throws InterruptedException - { - for (int chassisSlot = ship_chassis_slot_type.SCST_weapon_first; chassisSlot < ship_chassis_slot_type.SCST_weapon_last; chassisSlot++) - { - testAbortScript(); - if (isShipSlotInstalled(ship, chassisSlot)) - { - if (disable == true) - { - space_utils.setComponentDisabled(ship, chassisSlot, true); - } - else - { - float fltCurrentHitPoints = getShipComponentHitpointsCurrent(ship, chassisSlot); - - if (fltCurrentHitPoints > 0) - { - space_utils.setComponentDisabled(ship, chassisSlot, false); - recalculateEfficiency(chassisSlot, ship); - } - } - } - } - - return; - } - - - public static String[] getProgrammedDroidCommands(obj_id objPlayer) throws InterruptedException - { - - obj_id objShip = space_transition.getContainingShip(objPlayer); - - if (!isIdValid(objShip)) - { - return null; - } - - obj_id objControlDevice = getDroidControlDeviceForShip(objShip); - - if (!isIdValid(objControlDevice)) - { - return null; - } - obj_id objDataPad = utils.getDatapad(objControlDevice); - - if (!isIdValid(objDataPad)) - { - - return null; - } - - obj_id[] objContents = utils.getContents(objDataPad); - Vector strCommands = new Vector(); - - for (int intI = 0; intI < objContents.length; intI++) - { - testAbortScript(); - if (hasObjVar(objContents[intI], "strDroidCommand")) - { - String strTest = getStringObjVar(objContents[intI], "strDroidCommand"); - - strCommands = utils.addElement(strCommands, strTest); - } - } - - return (String[])strCommands.toArray(new String[0]); - } - - - public static String[] getDroidCommands(obj_id objPlayer) throws InterruptedException - { - String[] strRawCommands = getCommandListingForPlayer(objPlayer); - - Vector strDroidCommands = new Vector(); - strDroidCommands.setSize(0); - - for (int intI = 0; intI < strRawCommands.length; intI++) - { - testAbortScript(); - int intIndex = strRawCommands[intI].indexOf("droidcommand"); - - if (intIndex > -1) - { - strDroidCommands = utils.addElement(strDroidCommands, strRawCommands[intI]); - } - } - - if (strDroidCommands.size() > 0) - { - return (String[])strDroidCommands.toArray(new String[0]); - } - else - { - return null; - } - } - - - public static void grantCapitalShipSequenceRewardsAndCreditForKills(obj_id objDefender) throws InterruptedException - { - - dictionary dctParams = getKillPercentages(objDefender); - - if (dctParams == null) - { - - return; - } - obj_id[] objAttackers = dctParams.getObjIdArray("objAttackers"); - obj_id objWinner = dctParams.getObjId("objWinner"); - float[] fltPercentages = dctParams.getFloatArray("fltPercentages"); - - obj_id[] objWinningMembers = utils.getObjIdArrayLocalVar(objDefender, "objWinningMembers"); - - utils.removeLocalVar(objDefender, "objAttackers"); - utils.removeLocalVar(objDefender, "objWinner"); - utils.removeLocalVar(objDefender, "fltPercentages"); - utils.removeLocalVar(objDefender, "objWinningMembers"); - - int intXP = 500; - - if (objAttackers != null) - { - for (int intI = 0; intI < objAttackers.length; intI++) - { - testAbortScript(); - - if (fltPercentages[intI] > MINIMUM_DAMAGE_THRESHOLD) - { - - notifyAttacker(objAttackers[intI], objDefender, fltPercentages[intI]); - - int intAmount = intXP; - float fltTest = (float) intAmount; - - fltTest = fltTest * fltPercentages[intI]; - intAmount = (int) fltTest; - xp.grant(getPilotId(objAttackers[intI]), xp.SPACE_COMBAT_GENERAL, intAmount, true); - - } - } - } - return; - - } - - - public static void flightDroidVocalize(obj_id ship, int vocalizePriority) throws InterruptedException - { - flightDroidVocalize(ship, vocalizePriority, null); - } - - - public static void flightDroidVocalize(obj_id ship, int vocalizePriority, prose_package pp) throws InterruptedException - { - debugServerConsoleMsg(null, "SPACE_COMBAT.flightDroidVocalize: ############################################################# Just Entered function."); - - if (!isIdValid(ship)) - { - return; - } - - obj_id droidPcd = getDroidControlDeviceForShip(ship); - - debugServerConsoleMsg(null, "SPACE_COMBAT.flightDroidVocalize: Ship's droidPCD is: "+ droidPcd); - - if (!isIdValid(droidPcd)) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.flightDroidVocalize: Wanted to vocalize, but no droid PCD assigned to ship, so no vocalize."); - return; - } - - if (utils.hasLocalVar(ship, "droidcmd.muteDroid")) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.flightDroidVocalize: Wanted to vocalize, but ship has muteDroid localvar, so aborted."); - return; - } - - obj_id player = getShipPilot(ship); - - int currentTime = getGameTime(); - int storedVocalizeTime = 0; - - if (utils.hasLocalVar(ship, "droidVocTime")) - { - storedVocalizeTime = utils.getIntLocalVar(ship, "droidVocTime"); - } - int timeDelta = currentTime - storedVocalizeTime; - - if (vocalizePriority < 2) - { - if (!utils.hasLocalVar(ship, "droidVocTime") || timeDelta > 3) - { - utils.setLocalVar(ship, "droidVocTime", getGameTime()); - vocalizeSpaceDroid(droidPcd, player, ship, vocalizePriority); - - if (pp != null) - { - obj_id droid = callable.getCDCallable(droidPcd); - - if (isIdValid(droid)) - { - space_utils.tauntPlayer(player, droid, pp); - } - else if (space_crafting.isFlightComputerController(droidPcd)) - { - space_utils.tauntPlayer(player, droidPcd, pp); - } - else - { - debugServerConsoleMsg(null, "SPACE_COMBAT.flightDroidVocalize: ERROR! COULD NOT FIND A VALID DROID OBJ_ID. space_utils.tauntPlayer call loc #1"); - } - } - } - - return; - } - else if (vocalizePriority < 3) - { - if (!utils.hasLocalVar(ship, "droidVocTime") || timeDelta > 7) - { - utils.setLocalVar(ship, "droidVocTime", getGameTime()); - obj_id droid = callable.getCDCallable(droidPcd); - - if (isIdValid(droid)) - { - space_utils.tauntPlayer(player, droid, pp); - } - else if (space_crafting.isFlightComputerController(droidPcd)) - { - space_utils.tauntPlayer(player, droidPcd, pp); - } - else - { - debugServerConsoleMsg(null, "SPACE_COMBAT.flightDroidVocalize: ERROR! COULD NOT FIND A VALID DROID OBJ_ID. space_utils.tauntPlayer call loc #2"); - } - - vocalizeSpaceDroid(droidPcd, player, ship, vocalizePriority); - } - - return; - } - else - { - if (!utils.hasLocalVar(ship, "droidVocalizationQueued")) - { - dictionary outparams = new dictionary(); - - outparams.put("ship", ship); - outparams.put("vocalizePriority", vocalizePriority); - int droidVocalizeDelay = rndDroidVocalizeDelay(); - - utils.setLocalVar(ship, "droidVocalizationQueued", droidVocalizeDelay); - messageTo(ship, "flightDroidVocalize", outparams, droidVocalizeDelay, false); - - return; - } - else - { - if (utils.getIntLocalVar(ship, "droidVocalizationQueued") >= getGameTime()) - { - if (!utils.hasLocalVar(ship, "droidVocTime") || timeDelta > 7) - { - utils.setLocalVar(ship, "droidVocTime", getGameTime()); - vocalizeSpaceDroid(droidPcd, player, ship, vocalizePriority); - } - utils.removeLocalVar(ship, "droidVocalizationQueued"); - } - } - } - - return; - } - - - public static int rndDroidVocalizeDelay() throws InterruptedException - { - int currentTime = getGameTime(); - int rndVocDelay = (int) (rand(5.0f * DROID_VOCALIZE_DELAY_CONST, 30.0f * DROID_VOCALIZE_DELAY_CONST)); - int newProjectedVocTime = currentTime + rndVocDelay; - - return newProjectedVocTime; - } - - - public static void vocalizeSpaceDroid(obj_id droidPcd, obj_id player, obj_id ship, int vocalizePriority) throws InterruptedException - { - debugServerConsoleMsg(null, "SPACE_COMBAT.vocalizeSpaceDroid: ############################################################# Just Entered function."); - - obj_id droid = null; - - debugServerConsoleMsg(null, "SPACE_COMBAT.vocalizeSpaceDroid: Just read in pet.current ObjIdScriptVar off of droidPCD. The droidPcd we grabbed from was: "+ droidPcd + " and the pet.current obj_id was: "+ droid); - int droidSpecies = 0; - - if (space_crafting.isFlightComputerController(droidPcd)) - { - droidSpecies = 216; - } - else - { - droid = callable.getCDCallable(droidPcd); - droidSpecies = getSpecies(droid); - } - - debugServerConsoleMsg(null, "SPACE_COMBAT.vocalizeSpaceDroid: just got the species off the droid. The value was: "+ droidSpecies); - int speciesChecksum = dataTableSearchColumnForInt(droidSpecies, 0, DROID_VOCALIZE_DATATABLE); - - if (speciesChecksum == -1) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.vocalizeSpaceDroid: speciesChecksum failed out as being -1"); - return; - } - - int column = 0; - - if (vocalizePriority == 1) - { - column = 7; - } - else if (vocalizePriority == 2) - { - column = rand(4, 6); - } - else - { - column = rand(1, 3); - } - - int droidSpeciesRow = dataTableSearchColumnForInt(droidSpecies, 0, DROID_VOCALIZE_DATATABLE); - - debugServerConsoleMsg(null, "SPACE_COMBAT.vocalizeSpaceDroid: Found the droid species designator int in row: "+ droidSpeciesRow + " of the DROID_VOCALIZE_DATATABLE"); - String droidVocalizationEffectFile = dataTableGetString(DROID_VOCALIZE_DATATABLE, droidSpeciesRow, column); - - debugServerConsoleMsg(null, "SPACE_COMBAT.vocalizeSpaceDroid: Droid vocalization we are going to play is from file:"+ droidVocalizationEffectFile); - - if (droidVocalizationEffectFile == null) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.vocalizeSpaceDroid: droidVocalizationEffectFile was null. Kicking out! "); - - return; - } - else if (droidSpecies == 214 || droidSpecies == 215 || droidSpecies == 216) - { - playClientEffectObj(player, droidVocalizationEffectFile, ship, "engine_glow1"); - } - else - { - playClientEffectObj(player, droidVocalizationEffectFile, ship, "astromech"); - } - - return; - } - - - public static String targetHardpointForCefPlayback(obj_id ship) throws InterruptedException - { - String templateName = utils.getTemplateFilenameNoPath(ship); - String shipUsesThis = dataTableGetString(space_crafting.STARSHIP_DROID_TABLE, templateName, "usesDroidOrFlightComputer"); - - debugServerConsoleMsg(null, "+++ SPACE_CRAFTING . Got shipUsesThis. It was: "+ shipUsesThis); - - if (shipUsesThis == null || shipUsesThis.equals("")) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.targetHardpointForCefPlayback: shipUsesThis failed out as being -1"); - - return "engine_glow1"; - } - - if (shipUsesThis.equals("astromech")) - { - return "astromech"; - } - - return "engine_glow1"; - } - - - public static void createFlightDroidFromData(obj_id petControlDevice, obj_id objContainer) throws InterruptedException - { - String creatureName = getStringObjVar(petControlDevice, "pet.creatureName"); - - if (creatureName == null || creatureName.equals("")) - { - return; - } - - obj_id datapad = getContainedBy(petControlDevice); - - if (!isIdValid(datapad)) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.createFlightDroidFromData: FAILURE. Kicking out after databad isIdValid check failed. Datapad was: "+ datapad); - return; - } - - obj_id master = getContainedBy(datapad); - - if (!isIdValid(master)) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.createFlightDroidFromData: FAILURE. Kicking out after master isIdValid check failed. Master was: "+ master); - return; - } - - if (!hasScript(master, "ai.pet_master")) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.createFlightDroidFromData: No ai.pet_master script detected. Adding it."); - attachScript(master, "ai.pet_master"); - } - - obj_id pet = null; - - if (!isIdValid(objContainer)) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.createFlightDroidFromData: FIRST CUSTOM SPACEFLIGHT DROID CREATION BIT. objContainer isIdValid check failed. objContainer was: "+ objContainer); - return; - } - else - { - pet = create.object(creatureName, objContainer, false, true); - } - - if (!isIdValid(pet)) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.createFlightDroidFromData: FAILURE. new pet obj_id failed isIdValid check "+ pet); - sendSystemMessage(master, pet_lib.SID_PRIVATE_HOUSE); - return; - } - - sendDirtyObjectMenuNotification(petControlDevice); - - callable.setCallableLinks(master, petControlDevice, pet); - - if (hasObjVar(petControlDevice, "pet.crafted")) - { - pet_lib.setCraftedPetStatsByGrowth(petControlDevice, pet, 10); - - if (ai_lib.aiGetNiche(pet) == NICHE_DROID) - { - pet_lib.initDroidCraftedInventoryDroid(pet, petControlDevice); - pet_lib.initDroidCraftedDatapadDroid(pet, petControlDevice); - pet_lib.initDroidPersonality(pet, petControlDevice); - pet_lib.initDroidRepairPower(pet, petControlDevice); - - } - } - - pet_lib.reduceStatsForVitality(pet, petControlDevice); - - pet_lib.restoreDamage(pet, petControlDevice); - - if (hasObjVar(petControlDevice, "ai.pet.command")) - { - pet_lib.initializePetCommandList(pet, petControlDevice); - } - - if (hasObjVar(petControlDevice, "alreadyTrained")) - { - setObjVar(pet, "alreadyTrained", true); - } - - if (hasObjVar(petControlDevice, pet_lib.VAR_PALVAR_BASE)) - { - pet_lib.restoreCustomization(pet, petControlDevice); - } - - if (pet_lib.isDroidPet(pet)) - { - copyObjVar(petControlDevice, pet, "module_data"); - } - - String name = getAssignedName(petControlDevice); - - setName(pet, name); - } - - - public static boolean removeFlightDroidFromShip(obj_id droidControlDevice, obj_id droid) throws InterruptedException - { - if (isIdValid(droidControlDevice)) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.removeFlightDroidFromShip: petControlDevice obj_id isIdValid check passed."); - - obj_id currentPet = callable.getCDCallable(droidControlDevice); - - debugServerConsoleMsg(null, "SPACE_COMBAT.removeFlightDroidFromShip: got the objIdScriptVar off of the pcd. currentPet obj_id value was: "+ currentPet); - - if (isIdValid(currentPet) && currentPet == droid) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.removeFlightDroidFromShip: currentPet checked out as a a valid obj_id, and it equals the pet obj_id that was passed into the function at start. Proceeding."); - pet_lib.savePetInfo(droid, droidControlDevice); - setObjVar(droidControlDevice, "pet.timeStored", getGameTime()); - callable.setCDCallable(droidControlDevice, null); - } - } - - debugServerConsoleMsg(null, "+++ SPACE_COMBAT.removeFlightDroidFromShip: +++ destroying the pet now"); - utils.setScriptVar(droid, "stored", true); - - if (destroyObject(droid)) - { - return true; - } - - debugServerConsoleMsg(null, "+++ SPACE_COMBAT.removeFlightDroidFromShip: +++ WARNINGWARNING - FAILED TO DESTROY SELF"); - - return false; - } - - - public static void openFlightComputerDatapad(obj_id navicompControlDevice, obj_id owner) throws InterruptedException - { - - obj_id navicompDPad = utils.getDatapad(navicompControlDevice); - - if (!isIdValid(navicompDPad)) - { - debugServerConsoleMsg(null, "********** aaa.a navicompDPad objId failed isIdValid check, and we're kicking out."); - return; - } - - obj_id myContainer = getContainedBy(navicompControlDevice); - obj_id yourPad = utils.getPlayerDatapad(owner); - - if (myContainer != yourPad) - { - if (hasScript(myContainer, "item.tool.navicomputer_control_device")) - { - - putIn(navicompControlDevice, yourPad); - } - return; - } - - utils.requestContainerOpen(owner, navicompDPad); - } - - - public static boolean isAnInitializedNavicomp(obj_id navicomp) throws InterruptedException - { - if (!isIdValid(navicomp)) - { - return false; - } - - if (!hasObjVar(navicomp, "item.controlDevice")) - { - return false; - } - - obj_id controlDevice = getObjIdObjVar(navicomp, "item.controlDevice"); - - if (!isIdValid(controlDevice)) - { - return false; - } - - if (!hasObjVar(controlDevice, "item.current")) - { - return false; - } - - obj_id currentItem = getObjIdObjVar(controlDevice, "item.current"); - - if (currentItem != navicomp) - { - return false; - } - - obj_id controllerDpad = utils.getDatapad(controlDevice); - - if (!isIdValid(controllerDpad)) - { - return false; - } - - return true; - } - - - public static boolean readyForEmergencyPower(obj_id ship) throws InterruptedException - { - if (!isIdValid(ship)) - { - return false; - } - - return true; - } - - - public static int[] getInstalledMissileWeapons(obj_id objShip) throws InterruptedException - { - Vector intWeapons = new Vector(); - intWeapons.setSize(0); - - for (int intI = FIRST_WEAPON; intI < LAST_WEAPON; intI++) - { - testAbortScript(); - if (isShipSlotInstalled(objShip, intI)) - { - int intCrc = getShipComponentCrc(objShip, intI); - - if ((getShipComponentDescriptorWeaponIsMissile(intCrc)) && (!getShipComponentDescriptorWeaponIsCountermeasure(intCrc))) - { - intWeapons = utils.addElement(intWeapons, intI); - } - } - } - - int[] _intWeapons = new int[0]; - if (intWeapons != null) - { - _intWeapons = new int[intWeapons.size()]; - for (int _i = 0; _i < intWeapons.size(); ++_i) - { - _intWeapons[_i] = ((Integer)intWeapons.get(_i)).intValue(); - } - } - return _intWeapons; - } - - - public static void emergencyCmdDamageToShipsSystems(obj_id pilot, obj_id ship, float percentToDamageTo, String clientEffect, int primaryComponent) throws InterruptedException - { - if (!isIdValid(ship)) - { - return; - } - - final int[] WEAPON_SLOTS = - { - ship_chassis_slot_type.SCST_weapon_0, - ship_chassis_slot_type.SCST_weapon_1, - ship_chassis_slot_type.SCST_weapon_2, - ship_chassis_slot_type.SCST_weapon_3, - ship_chassis_slot_type.SCST_weapon_4, - ship_chassis_slot_type.SCST_weapon_5, - ship_chassis_slot_type.SCST_weapon_6, - ship_chassis_slot_type.SCST_weapon_7 - }; - - if (!clientEffect.equals("") && clientEffect != null) - { - playClientEffectObj(pilot, clientEffect, ship, targetHardpointForCefPlayback(ship)); - } - - float fltDamageToComponent = (getShipComponentHitpointsMaximum(ship, primaryComponent) * (percentToDamageTo / 100)); - - if ((primaryComponent != NONE) && (primaryComponent != ALL_WEAPONS)) - { - if (!isShipSlotInstalled(ship, primaryComponent)) - { - - string_id strSpam = new string_id("space/space_interaction", "component_not_installed"); - - sendSystemMessage(pilot, strSpam); - return; - } - - float fltCurrentHitpoints = getShipComponentHitpointsCurrent(ship, primaryComponent); - float fltCurrentArmorHitpoints = getShipComponentArmorHitpointsCurrent(ship, primaryComponent); - - fltCurrentArmorHitpoints = fltCurrentArmorHitpoints - fltDamageToComponent; - - if (fltDamageToComponent > 0) - { - float currentHitpoints = getShipComponentHitpointsCurrent(ship, primaryComponent); - float currentArmorHitpoints = getShipComponentArmorHitpointsCurrent(ship, primaryComponent); - - currentArmorHitpoints = currentArmorHitpoints - fltDamageToComponent; - if (currentArmorHitpoints < 0) - { - float fltRemainingDamage = Math.abs(currentArmorHitpoints); - - currentHitpoints = currentHitpoints - fltRemainingDamage; - if (currentHitpoints < 0) - { - string_id strSpam = new string_id("space/space_interaction", "droid_component_too_damaged"); - string_id strComponent = new string_id("space/space_interaction", space_crafting.getShipComponentStringType(primaryComponent)); - prose_package proseTest = prose.getPackage(strSpam, strComponent); - - return; - } - else - { - setShipComponentArmorHitpointsCurrent(ship, primaryComponent, 0); - setShipComponentHitpointsCurrent(ship, primaryComponent, currentHitpoints); - recalculateEfficiency(primaryComponent, ship); - } - } - else - { - setShipComponentArmorHitpointsCurrent(ship, primaryComponent, currentArmorHitpoints); - - } - } - } - - return; - } - - - public static void vampiricTypeShipsSystemsRepair(obj_id pilot, obj_id ship, int successLevel) throws InterruptedException - { - - if (!isIdValid(ship)) - { - return; - } - - float highestDamagedComponentPercentage = 0.0f; - int highestDamagedComponentIndexNumber = 0; - float componentDamagePercentageSum = 0.0f; - int badComponentCounter = 0; - float highestDamagedComponentMaxPoints = 0.0f; - float totalComponentMaxHitPoints = 0.0f; - - int[] componentSlotsTarget = space_crafting.getShipInstalledSlots(ship); - float[] currentDamagePercentage = new float[componentSlotsTarget.length]; - - for (int currentShipComponent = 0; currentShipComponent < componentSlotsTarget.length; currentShipComponent++) - { - testAbortScript(); - - float currentHitPoints = getShipComponentHitpointsCurrent(ship, currentShipComponent); - - float maxHitPoints = getShipComponentHitpointsMaximum(ship, currentShipComponent); - - if (maxHitPoints >= 1.0f) - { - - totalComponentMaxHitPoints += maxHitPoints; - - currentDamagePercentage[currentShipComponent] = (((maxHitPoints - currentHitPoints) / maxHitPoints) * 100); - - componentDamagePercentageSum += currentDamagePercentage[currentShipComponent]; - - if (currentDamagePercentage[currentShipComponent] > highestDamagedComponentPercentage) - { - - highestDamagedComponentPercentage = currentDamagePercentage[currentShipComponent]; - - highestDamagedComponentIndexNumber = currentShipComponent; - - highestDamagedComponentMaxPoints = getShipComponentHitpointsMaximum(ship, currentShipComponent); - - } - } - else - { - - badComponentCounter++; - } - } - - float averageDamagePercentageMinusMaxOne = (componentDamagePercentageSum - highestDamagedComponentPercentage) / (componentSlotsTarget.length - (badComponentCounter + 1)); - - float damagePercentageDelta = highestDamagedComponentPercentage - averageDamagePercentageMinusMaxOne; - - if (damagePercentageDelta < 5.0f) - { - - string_id strSpam = new string_id("space/space_interaction", "vampiric_repair_useless_abort"); - - sendSystemMessage(pilot, strSpam); - return; - } - - float damagePointDispersionPool = (damagePercentageDelta / 100.0f) * highestDamagedComponentMaxPoints; - - float currentHitPointAdjustment = getShipComponentHitpointsCurrent(ship, highestDamagedComponentIndexNumber) + damagePointDispersionPool; - - if (currentHitPointAdjustment > highestDamagedComponentMaxPoints) - { - currentHitPointAdjustment = highestDamagedComponentMaxPoints; - } - setShipComponentHitpointsCurrent(ship, highestDamagedComponentIndexNumber, currentHitPointAdjustment); - - if (successLevel == 1) - { - damagePointDispersionPool = damagePointDispersionPool - (damagePointDispersionPool * 0.15f); - } - else if (successLevel == 2) - { - damagePointDispersionPool = damagePointDispersionPool - (damagePointDispersionPool * 0.05f); - } - else if (successLevel == 4) - { - damagePointDispersionPool = damagePointDispersionPool + (damagePointDispersionPool * 0.05f); - } - else if (successLevel == 6) - { - damagePointDispersionPool = damagePointDispersionPool + (damagePointDispersionPool * 0.20f); - } - - debugServerConsoleMsg(null, "vampiricTypeShipsSystemsRepair ********** Just resized the damagePointDispersionPool based upon successlevel of skill check."); - debugServerConsoleMsg(null, "vampiricTypeShipsSystemsRepair ********** Size of skill-modified damagePointDispersionPool is: "+ damagePointDispersionPool); - - int damageLoops = (int) (damagePointDispersionPool / 10); - - if (damageLoops > 5) - { - damageLoops = 5; - } - dictionary params = new dictionary(); - - params.put("damage_loops", damageLoops); - params.put("pilot", pilot); - messageTo(ship, "vRepairDamageCEFLoop", params, 3.0f, false); - - for (int currentShipComponent = 0; currentShipComponent < componentSlotsTarget.length; currentShipComponent++) - { - testAbortScript(); - float mmaxHitPoints = getShipComponentHitpointsMaximum(ship, currentShipComponent); - - if (mmaxHitPoints >= 1.0f) - { - float percentageOfTotalComponentHitPoints = mmaxHitPoints / totalComponentMaxHitPoints; - float hitPointDelta = percentageOfTotalComponentHitPoints * damagePointDispersionPool; - float currentHitPoints = getShipComponentHitpointsCurrent(ship, currentShipComponent); - - if (hitPointDelta > currentHitPoints) - { - hitPointDelta = (currentHitPoints - 1); - } - float newHitPoints = currentHitPoints - hitPointDelta; - - setShipComponentHitpointsCurrent(ship, currentShipComponent, newHitPoints); - - } - else - { - - } - } - - if (damagePointDispersionPool > 0.0f) - { - - float currentHitPoints = getShipComponentHitpointsCurrent(ship, highestDamagedComponentIndexNumber); - - setShipComponentHitpointsCurrent(ship, highestDamagedComponentIndexNumber, currentHitPoints - damagePointDispersionPool); - } - - string_id strSpam = new string_id("space/space_interaction", "vampiric_repair_underway"); - - sendSystemMessage(pilot, strSpam); - - space_pilot_command.allPurposeShipComponentReset(ship); - - successLevel--; - switch (successLevel) - { - case 5: - strSpam = new string_id("space/space_interaction", "vampiric_big_fail"); - sendSystemMessage(pilot, strSpam); - break; - case 4: - break; - case 3: - strSpam = new string_id("space/space_interaction", "vampiric_slight_fail"); - sendSystemMessage(pilot, strSpam); - break; - case 2: - strSpam = new string_id("space/space_interaction", "vampiric_success"); - sendSystemMessage(pilot, strSpam); - break; - case 1: - strSpam = new string_id("space/space_interaction", "vampiric_good_success"); - sendSystemMessage(pilot, strSpam); - break; - case 0: - strSpam = new string_id("space/space_interaction", "vampiric_great_success"); - sendSystemMessage(pilot, strSpam); - break; - } - - return; - } - - - public static int getShipsPilotCommandSkillCheckMods(obj_id ship) throws InterruptedException - { - int mods = 0; - int currentTime = getGameTime(); - - if (utils.hasLocalVar(ship, "cmd.wasDamagedSkillMod")) - { - int duration = utils.getIntLocalVar(ship, "cmd.wasDamagedSkillMod"); - - if (currentTime < duration) - { - mods += 20; - } - } - - if (utils.hasLocalVar(ship, "cmd.firedWeaponsSkillMod")) - { - int duration = utils.getIntLocalVar(ship, "cmd.firedWeaponsSkillMod"); - - if (currentTime < duration) - { - mods += 10; - } - } - - return mods; - } - - - public static int doPilotCommandSkillCheck(obj_id player, String difficultyOfCommand) throws InterruptedException - { - - debugServerConsoleMsg(null, "========================================================="); - debugServerConsoleMsg(null, "SPACE_COMBAT.doPilotCommandSkillCheck ============= ENTERED FUNCTION "); - debugServerConsoleMsg(null, "passed in player obj_id of: "+ player + " and passed in difficulty of command of: "+ difficultyOfCommand); - - int risk = 0; - - if (difficultyOfCommand.equals("level1command")) - { - risk = 20; - } - else if (difficultyOfCommand.equals("level2command")) - { - risk = 40; - } - else if (difficultyOfCommand.equals("level3command")) - { - risk = 60; - } - else if (difficultyOfCommand.equals("level4command")) - { - risk = 80; - } - else if (difficultyOfCommand.equals("level5command")) - { - risk = 100; - } - else - { - risk = 60; - } - - debugServerConsoleMsg(null, "Risk is computed as being "+ risk); - - int playerSkill = getEnhancedSkillStatisticModifier(player, "pilot_special_tactics"); - - debugServerConsoleMsg(null, "Player skill is "+ playerSkill); - - int shipMods = 0; - obj_id ship = space_transition.getContainingShip(player); - - if (isIdValid(ship)) - { - shipMods = getShipsPilotCommandSkillCheckMods(ship); - } - - debugServerConsoleMsg(null, "shipMods came back as "+ shipMods); - - float dieRoll = rand(1f, 100f); - float moddedRoll = dieRoll + (float) (risk) + (float) (shipMods) - (float) (playerSkill); - - debugServerConsoleMsg(null, "moddedRoll came back as "+ moddedRoll); - - float goodSuccess = AVERAGE_COMMAND_SUCCESS_RATE - (AVERAGE_COMMAND_SUCCESS_RATE * 0.25f); - - float greatSuccess = AVERAGE_COMMAND_SUCCESS_RATE - (AVERAGE_COMMAND_SUCCESS_RATE * 0.50f); - - float moderateFailure = AVERAGE_COMMAND_SUCCESS_RATE + (AVERAGE_COMMAND_SUCCESS_RATE * 0.20f); - - float bigFailure = AVERAGE_COMMAND_SUCCESS_RATE + (AVERAGE_COMMAND_SUCCESS_RATE * 0.40f); - - int successLevel = 0; - - if (moddedRoll < greatSuccess) - { - successLevel = 1; - } - else if (moddedRoll < goodSuccess) - { - successLevel = 2; - } - else if (moddedRoll < AVERAGE_COMMAND_SUCCESS_RATE) - { - successLevel = 3; - } - else if (moddedRoll < moderateFailure) - { - successLevel = 4; - } - else if (rand(1f, 100f) < 50f) - { - successLevel = 5; - } - else - { - successLevel = 6; - } - - debugServerConsoleMsg(null, "returning a success level of "+ successLevel); - - return successLevel; - } - - - public static boolean readyForBomberStrike(obj_id ship, obj_id commander) throws InterruptedException - { - debugServerConsoleMsg(null, "space_combat - readyForBomberStrike"); - - if (utils.hasLocalVar(commander, "cmd.bmb.bmbrStrike")) - { - - string_id strSpam = new string_id("space/space_interaction", "already_bmbr_strike"); - - sendSystemMessage(commander, strSpam); - return false; - } - - if (isShipComponentDisabled(ship, ship_chassis_slot_type.SCST_reactor)) - { - - string_id strSpam = new string_id("space/space_interaction", "systems_disabled_strike_pack"); - - sendSystemMessage(commander, strSpam); - return false; - } - - int localCalledBomberCount = 0; - - obj_id[] nearbyPlayers = getObservedPlayerShips(ship, true); - - for (int i = 0; i < nearbyPlayers.length; i++) - { - testAbortScript(); - if (isIdValid(nearbyPlayers[i])) - { - if (utils.hasLocalVar(nearbyPlayers[i], "cmd.bmb.bmbrStrike")) - { - localCalledBomberCount++; - } - } - } - - if (localCalledBomberCount > 9) - { - - string_id strSpam = new string_id("space/space_interaction", "bomberstrike_none_available"); - - sendSystemMessage(commander, strSpam); - return false; - } - - obj_id target = getLookAtTarget(ship); - - if (!isIdValid(target)) - { - - string_id strSpam = new string_id("space/space_pilot_command", "bomberstrike_not_at_player"); - - sendSystemMessage(commander, strSpam); - return false; - } - - if (space_utils.isPlayerControlledShip(target) || hasObjVar(target, "intInvincible") || space_pilot_command.isStation(target)) - { - - string_id strSpam = new string_id("space/space_pilot_command", "bomberstrike_not_at_player"); - - sendSystemMessage(commander, strSpam); - return false; - } - else if (pvpCanAttack(ship, target)) - { - - string_id strSpam = new string_id("space/space_interaction", "calling_bomberstrike"); - - sendSystemMessage(commander, strSpam); - return true; - } - - string_id strSpam = new string_id("space/space_interaction", "bomber_not_enemy_1"); - string_id strSpam2 = new string_id("space/space_interaction", "bomber_not_enemy_2"); - - sendSystemMessage(commander, strSpam); - sendSystemMessage(commander, strSpam2); - return false; - } - - - public static boolean executeLightBomberStrike(obj_id ship, obj_id commander, obj_id target, int CMD_LIGHT_STRIKE_DELAY) throws InterruptedException - { - debugServerConsoleMsg(null, "space_combat.executeLightBomberStrike ***** Entered Function"); - - int skillCheck = doPilotCommandSkillCheck(commander, "level3command"); - - if (skillCheck > 4) - { - string_id strSpam = new string_id("space/space_interaction", "bomberstrike_bad_skillcheck"); - - sendSystemMessage(commander, strSpam); - strSpam = new string_id("space/space_interaction", "bomberstrike_none_available"); - sendSystemMessage(commander, strSpam); - initializeCommandTimer(commander, CMD_LIGHT_STRIKE_DELAY); - return false; - } - - String packageType = "light"; - - String attackType = "many"; - - if (!space_combat.spawnStrikeBombers(ship, commander, packageType, attackType, target)) - { - debugServerConsoleMsg(null, "space_combat.executeLightBomberStrike ***** This script has created a FATAL ERROR! Couldn't spawn for some reason."); - return false; - } - - playClientEffectObj(commander, "clienteffect/space_command/sys_comm_imperial.cef", ship, ""); - - space_combat.flightDroidVocalize(ship, 1); - - utils.setLocalVar(ship, "cmd.bmb.bmbrStrike", 1); - - initializeCommandTimer(commander, CMD_LIGHT_STRIKE_DELAY); - - String cefPlayBackHardpoint = space_combat.targetHardpointForCefPlayback(ship); - - playClientEffectObj(commander, "clienteffect/space_command/emergency_power_on.cef", ship, cefPlayBackHardpoint); - - return true; - } - - - public static boolean executeMediumBomberStrike(obj_id ship, obj_id commander, obj_id target, int CMD_LIGHT_STRIKE_DELAY) throws InterruptedException - { - - int skillCheck = doPilotCommandSkillCheck(commander, "level4command"); - - if (skillCheck > 4) - { - string_id strSpam = new string_id("space/space_interaction", "bomberstrike_bad_skillcheck"); - - sendSystemMessage(commander, strSpam); - strSpam = new string_id("space/space_interaction", "bomberstrike_none_available"); - sendSystemMessage(commander, strSpam); - initializeCommandTimer(commander, CMD_LIGHT_STRIKE_DELAY); - return false; - } - - String packageType = "medium"; - - String attackType = "many"; - - if (!space_combat.spawnStrikeBombers(ship, commander, packageType, attackType, target)) - { - debugServerConsoleMsg(null, "space_combat.executeMediumBomberStrike ***** This script has created a FATAL ERROR! Couldn't spawn for some reason."); - return false; - } - - playClientEffectObj(commander, "clienteffect/space_command/sys_comm_imperial.cef", ship, ""); - - space_combat.flightDroidVocalize(ship, 1); - - utils.setLocalVar(ship, "cmd.bmb.bmbrStrike", 2); - - initializeCommandTimer(commander, CMD_LIGHT_STRIKE_DELAY); - - String cefPlayBackHardpoint = space_combat.targetHardpointForCefPlayback(ship); - - playClientEffectObj(commander, "clienteffect/space_command/emergency_power_on.cef", ship, cefPlayBackHardpoint); - - return true; - } - - - public static boolean executeHeavyBomberStrike(obj_id ship, obj_id commander, obj_id target, int CMD_LIGHT_STRIKE_DELAY) throws InterruptedException - { - int skillCheck = doPilotCommandSkillCheck(commander, "level5command"); - - if (skillCheck > 4) - { - string_id strSpam = new string_id("space/space_interaction", "bomberstrike_bad_skillcheck"); - - sendSystemMessage(commander, strSpam); - strSpam = new string_id("space/space_interaction", "bomberstrike_none_available"); - sendSystemMessage(commander, strSpam); - initializeCommandTimer(commander, CMD_LIGHT_STRIKE_DELAY); - return false; - } - - String packageType = "heavy"; - - String attackType = "many"; - - if (!space_combat.spawnStrikeBombers(ship, commander, packageType, attackType, target)) - { - debugServerConsoleMsg(null, "space_combat.executeHeavyBomberStrike ***** This script has created a FATAL ERROR! Couldn't spawn for some reason."); - return false; - } - - playClientEffectObj(commander, "clienteffect/space_command/sys_comm_imperial.cef", ship, ""); - - space_combat.flightDroidVocalize(ship, 1); - - utils.setLocalVar(ship, "cmd.bmb.bmbrStrike", 3); - - initializeCommandTimer(commander, CMD_LIGHT_STRIKE_DELAY); - - String cefPlayBackHardpoint = space_combat.targetHardpointForCefPlayback(ship); - - playClientEffectObj(commander, "clienteffect/space_command/emergency_power_on.cef", ship, cefPlayBackHardpoint); - - return true; - } - - - public static transform playerCommandSpawnerLocGetter(obj_id ship, boolean flip) throws InterruptedException - { - debugServerConsoleMsg(null, "PLAYERcOMMANDsPAWNERlOCgETTER"); - - transform loc = getTransform_o2w(ship); - - float dist = rand(600.f, 700.f); - vector n = loc.getLocalFrameK_p().normalize().multiply(dist); - - loc = loc.move_p(n); - - if (flip == true) - { - loc = loc.yaw_l(3.14f); - } - - vector vi = loc.getLocalFrameI_p().normalize().multiply(rand(-150.f, 150.f)); - vector vj = loc.getLocalFrameJ_p().normalize().multiply(rand(-150.f, 150.f)); - vector vd = vi.add(vj); - - loc = loc.move_p(vd); - - return loc; - } - - - public static boolean spawnStrikeBombers(obj_id ship, obj_id commander, String packageType, String attack_type, obj_id target) throws InterruptedException - { - debugServerConsoleMsg(null, "space_combat.spawnStrikeBombers ***** Entered Function"); - - if (!isIdValid(ship) || !isIdValid(commander) || !isIdValid(target)) - { - return false; - } - - transform loc = playerCommandSpawnerLocGetter(ship, true); - - String targetDifficultyTier = "_tier3"; - - int targetSquad = ship_ai.unitGetSquadId(target); - int targetSquadSize = ship_ai.squadGetSize(targetSquad); - - targetDifficultyTier = "_tier"+ space_pilot_command.targetTierDetect(target); - String strikePackageType = "squad_plyr_cmd_bmbr_basic"+ targetDifficultyTier; - - if (packageType.equals("medium")) - { - strikePackageType = "squad_plyr_cmd_bmbr_advanced"+ targetDifficultyTier; - } - else if (packageType.equals("heavy")) - { - strikePackageType = "squad_plyr_cmd_bmbr_extreme"+ targetDifficultyTier; - } - - Vector objStrikePack = space_create.createSquadHyperspace(null, strikePackageType, loc, 20.0f, null); - - if (!isIdValid(((obj_id)(objStrikePack.get(0))))) - { - return false; - } - - int bomberSquadId = ship_ai.unitGetSquadId(((obj_id)(objStrikePack.get(0)))); - - obj_id[] squaddyList = null; - if (ship_ai.isSquadIdValid(bomberSquadId)) - { - squaddyList = ship_ai.squadGetUnitList(bomberSquadId); - } - else - { - return false; - } - - if (objStrikePack.size() > 1) - { - ship_ai.squadSetFormationSpacing(bomberSquadId, 3.0f); - } - - for (int i = 0; i < squaddyList.length; i++) - { - testAbortScript(); - setObjVar(squaddyList[i], "commanderPlayer", commander); - } - - if (utils.hasLocalVar(commander, "cmd.bmb.bmbrSquadId")) - { - utils.removeLocalVar(commander, "cmd.bmb.bmbrSquadId"); - } - utils.setLocalVar(commander, "cmd.bmb.bmbrSquadId", bomberSquadId); - - if (utils.hasLocalVar(commander, "cmd.bmb.initialStrikePackSize")) - { - utils.removeLocalVar(commander, "cmd.bmb.initialStrikePackSize"); - } - utils.setLocalVar(commander, "cmd.bmb.initialStrikePackSize", objStrikePack.size()); - utils.setLocalVar(commander, "cmd.bmb.currentStrikePackSize", objStrikePack.size()); - - transform targetLoc = getTransform_o2w(target); - - transform[]loiterPath = ship_ai.createPatrolPathLoiter(targetLoc, 100.0f, 100.0f); - ship_ai.squadPatrol(bomberSquadId, loiterPath); - - if (attack_type.equals("single")) - { - ship_ai.squadAddTarget(bomberSquadId, target); - } - else - { - ship_ai.squadAddTarget(bomberSquadId, targetSquad); - } - - initializeTargetTracking(commander, bomberSquadId, targetSquad); - - string_id sid = new string_id("space/space_interaction", "bombers_arriving"); - prose_package pp = new prose_package(); - - pp.stringId = sid; - commPlayers(squaddyList[0], null, null, 6.0f, commander, pp); - - return true; - } - - - public static boolean setupStrikePackageEscort(int bomberSquadId, String packageType, obj_id commander, String targetDifficultyTier) throws InterruptedException - { - debugServerConsoleMsg(null, "SETUPsTRIKEpACKAGEeSCORT"); - - obj_id[] bomberSquaddyList = null; - if (ship_ai.isSquadIdValid(bomberSquadId)) - { - bomberSquaddyList = ship_ai.squadGetUnitList(bomberSquadId); - } - else - { - return false; - } - - int numBombers = ship_ai.squadGetSize(bomberSquadId); - - int successLevel = doPilotCommandSkillCheck(commander, "level3command"); - - String escortPackageType = ""; - - debugServerConsoleMsg(null, "============================================"); - debugServerConsoleMsg(null, "SPACE_COMBAT.SETUPsTRIKEpACKAGEeSCORT = successLevel came back as: "+ successLevel); - - switch (successLevel) - { - case 6: - escortPackageType = "squad_plyr_cmd_bmbr_escort_basic"+ targetDifficultyTier; - break; - case 5: - escortPackageType = "squad_plyr_cmd_bmbr_escort_basic"+ targetDifficultyTier; - break; - case 4: - escortPackageType = "squad_plyr_cmd_bmbr_escort_basic"+ targetDifficultyTier; - break; - case 3: - escortPackageType = "squad_plyr_cmd_bmbr_escort_interceptor"+ targetDifficultyTier; - break; - case 2: - escortPackageType = "squad_plyr_cmd_bmbr_escort_interceptor"+ targetDifficultyTier; - break; - case 1: - escortPackageType = "squad_plyr_cmd_bmbr_escort_advanced"+ targetDifficultyTier; - break; - case 0: - escortPackageType = "squad_plyr_cmd_bmbr_escort_advanced"+ targetDifficultyTier; - break; - } - - transform loc = playerCommandSpawnerLocGetter(bomberSquaddyList[0], false); - - int totalEscorts = 0; - - for (int i = 0; i < bomberSquaddyList.length; i++) - { - testAbortScript(); - Vector objStrikeEscortPack = space_create.createSquadHyperspace(null, escortPackageType, loc, 20.0f, null); - - int escortSquadId = ship_ai.unitGetSquadId(((obj_id)(objStrikeEscortPack.get(0)))); - - obj_id[] escortSquaddyList = null; - if (ship_ai.isSquadIdValid(escortSquadId)) - { - escortSquaddyList = ship_ai.squadGetUnitList(escortSquadId); - } - else - { - return false; - } - - totalEscorts += objStrikeEscortPack.size(); - - utils.setLocalVar(bomberSquaddyList[i], "escortSquadId", escortSquadId); - utils.setLocalVar(bomberSquaddyList[i], "crrntEscrtSqdSz", escortSquaddyList.length); - - for (int j = 0; j < escortSquaddyList.length; j++) - { - testAbortScript(); - setObjVar(escortSquaddyList[j], "commanderPlayer", commander); - } - - if (utils.hasLocalVar(commander, "cmd.bmb.initEscrtPckSize")) - { - utils.removeLocalVar(commander, "cmd.bmb.initEscrtPckSize"); - } - - utils.setLocalVar(commander, "cmd.bmb.initEscrtPckSize", totalEscorts); - - ship_ai.squadFollow(escortSquadId, bomberSquaddyList[i], new vector(0.0f, 0.0f, -1.0f), 2.0f); - ship_ai.squadSetGuardTarget(escortSquadId, bomberSquadId); - - } - - return true; - } - - - public static void strikePackageEvac(obj_id commander, int bomberSquadId, int fighterSquadId) throws InterruptedException - { - debugServerConsoleMsg(null, "STRIKEpACKAGEeVAC"); - - utils.removeLocalVar(commander, "cmd.bmb"); - - obj_id ship = space_transition.getContainingShip(commander); - - obj_id strikeLeader = null; - int strikeSurvivorSquad = -1; - - int currentStrikePackageSize = utils.getIntLocalVar(commander, "cmd.bmb.currentStrikePackSize"); - - if (bomberSquadId > 0 && fighterSquadId < 0) - { - obj_id[] bomberSquaddyList = null; - if (ship_ai.isSquadIdValid(bomberSquadId)) - { - bomberSquaddyList = ship_ai.squadGetUnitList(bomberSquadId); - } - else - { - return; - } - - if (hasObjVar(bomberSquaddyList[0], "evacuate")) - { - return; - } - - for (int i = 0; i < bomberSquaddyList.length; i++) - { - testAbortScript(); - setObjVar(bomberSquaddyList[i], "evacuate", 1); - - } - strikeLeader = bomberSquaddyList[0]; - strikeSurvivorSquad = bomberSquadId; - } - - obj_id squadTarget = ship_ai.unitGetPrimaryAttackTarget(strikeLeader); - - if (!isIdValid(ship)) - { - ship = strikeLeader; - } - - transform loc = space_combat.playerCommandSpawnerLocGetter(ship, true); - - ship_ai.squadSetAttackOrders(strikeSurvivorSquad, ship_ai.ATTACK_ORDERS_HOLD_FIRE); - ship_ai.squadMoveTo(strikeSurvivorSquad, loc); - - string_id sid = new string_id("space/space_interaction", "strikeforce_withdrawing"); - prose_package pp = new prose_package(); - - pp.stringId = sid; - commPlayers(strikeLeader, null, null, 6.0f, commander, pp); - - if (utils.hasLocalVar(commander, "cmd.bmb.targetSquadId") && !utils.hasLocalVar(commander, "cmd.bmb.targetSquadCrrntSz")) - { - int targetSquadId = utils.getIntLocalVar(commander, "cmd.bmb.targetSquadId"); - - obj_id[] targetSquaddyList = null; - if (ship_ai.isSquadIdValid(targetSquadId)) - { - targetSquaddyList = ship_ai.squadGetUnitList(targetSquadId); - } - else - { - return; - } - - for (int i = 0; i < targetSquaddyList.length; i++) - { - testAbortScript(); - if (hasScript(targetSquaddyList[i], "space.command.player_cmd_bomber_strike_target")) - { - detachScript(targetSquaddyList[i], "space.command.player_cmd_bomber_strike_target"); - } - if (hasObjVar(targetSquaddyList[i], "targetedByPlayerObjId")) - { - removeObjVar(targetSquaddyList[i], "targetedByPlayerObjId"); - } - if (hasObjVar(targetSquaddyList[i], "damageMultiplier")) - { - removeObjVar(targetSquaddyList[i], "damageMultiplier"); - } - } - } - - return; - } - - - public static void initializeTargetTracking(obj_id commander, int bomberSquadId, int targetSquadId) throws InterruptedException - { - if (utils.hasLocalVar(commander, "cmd.bmb.targetSquadId")) - { - utils.removeLocalVar(commander, "cmd.bmb.targetSquadId"); - } - - obj_id[] targetSquaddyList = null; - if (ship_ai.isSquadIdValid(targetSquadId)) - { - targetSquaddyList = ship_ai.squadGetUnitList(targetSquadId); - } - else - { - return; - } - - utils.setLocalVar(commander, "cmd.bmb.targetSquadId", targetSquadId); - utils.setLocalVar(commander, "cmd.bmb.targetSquadCrrntSz", targetSquaddyList.length); - - for (int i = 0; i < targetSquaddyList.length; i++) - { - testAbortScript(); - attachScript(targetSquaddyList[i], "space.command.player_cmd_bomber_strike_target"); - setObjVar(targetSquaddyList[i], "targetedByPlayerObjId", commander); - setObjVar(targetSquaddyList[i], "damageMultiplier", NPC_DAMAGE_MULTIPLIER); - } - - return; - } - - - public static void strikeBomberCleanup(obj_id commander) throws InterruptedException - { - if (utils.hasLocalVar(commander, "cmd.bmb.bmbrSquadId")) - { - int bomberSquadId = utils.getIntLocalVar(commander, "cmd.bmb.bmbrSquadId"); - - if (ship_ai.isSquadIdValid(bomberSquadId)) - { - strikePackageEvac(commander, bomberSquadId, -1); - } - } - - return; - } - - - public static boolean readyForPirateRaid(obj_id ship, obj_id commander) throws InterruptedException - { - debugServerConsoleMsg(null, "SPACE_COMBAT.readyForPirateRaid"); - - if (utils.hasLocalVar(ship, "cmd.pirate.goRaid")) - { - - string_id strSpam = new string_id("space/space_interaction", "already_pirate_raid"); - - sendSystemMessage(commander, strSpam); - return false; - } - - if (isShipComponentDisabled(ship, ship_chassis_slot_type.SCST_reactor)) - { - - string_id strSpam = new string_id("space/space_interaction", "systems_disabled_pirate_raid"); - - sendSystemMessage(commander, strSpam); - return false; - } - - int localCalledPirateCount = 0; - - obj_id[] nearbyPlayers = getObservedPlayerShips(ship, true); - - for (int i = 0; i < nearbyPlayers.length; i++) - { - testAbortScript(); - if (isIdValid(nearbyPlayers[i])) - { - if (utils.hasLocalVar(nearbyPlayers[i], "cmd.pirate.goRaid")) - { - localCalledPirateCount++; - } - } - } - - if (localCalledPirateCount > 4) - { - - string_id strSpam = new string_id("space/space_pilot_command", "pirateraid_none_available"); - - sendSystemMessage(commander, strSpam); - return false; - } - - obj_id target = getLookAtTarget(ship); - - if (isIdValid(target)) - { - if (!space_pilot_command.isStation(target)) - { - if (space_utils.isShip(target)) - { - if (pvpCanAttack(ship, target)) - { - - string_id strSpam = new string_id("space/space_interaction", "calling_pirate_raid"); - - sendSystemMessage(commander, strSpam); - return true; - } - } - } - } - else if (!isIdValid(target)) - { - - string_id strSpam = new string_id("space/space_interaction", "calling_pirate_raid"); - - sendSystemMessage(commander, strSpam); - return true; - } - - string_id strSpam = new string_id("space/space_interaction", "pirate_raid_not_enemy"); - - sendSystemMessage(commander, strSpam); - return false; - } - - - public static boolean executePirateRaidOne(obj_id ship, obj_id commander, obj_id target, int CMD_PIRATE_LURE_DELAY) throws InterruptedException - { - debugServerConsoleMsg(null, "SPACE_COMBAT.executePirateRaidOne"); - - String packageType = "light"; - - String attackType = "many"; - String level = "level1"; - - if (!space_combat.spawnPirateRaiders(ship, commander, level, attackType, target)) - { - string_id strSpam = new string_id("space/space_interaction", "pirate_raid_systems_not_ready"); - - sendSystemMessage(commander, strSpam); - debugServerConsoleMsg(null, "space_combat.executePirateRaidone ***** script has created a FATAL ERROR! Could not spawn for some reason"); - return false; - } - - playClientEffectObj(commander, "clienteffect/space_command/sys_comm_generic.cef", ship, ""); - - space_combat.flightDroidVocalize(ship, 1); - - utils.setLocalVar(ship, "cmd.pirate.goRaid", 1); - - initializeCommandTimer(commander, CMD_PIRATE_LURE_DELAY); - - String cefPlayBackHardpoint = space_combat.targetHardpointForCefPlayback(ship); - - playClientEffectObj(commander, "clienteffect/space_command/emergency_power_on.cef", ship, cefPlayBackHardpoint); - - return true; - } - - - public static boolean executePirateRaidTwo(obj_id ship, obj_id commander, obj_id target, int CMD_PIRATE_LURE_DELAY) throws InterruptedException - { - debugServerConsoleMsg(null, "SPACE_COMBAT.executePirateRaidOne"); - - String packageType = "light"; - - String attackType = "many"; - String level = "level2"; - - if (!space_combat.spawnPirateRaiders(ship, commander, level, attackType, target)) - { - string_id strSpam = new string_id("space/space_interaction", "pirate_raid_systems_not_ready"); - - sendSystemMessage(commander, strSpam); - debugServerConsoleMsg(null, "space_combat.executePirateRaidTwo ***** script has created a FATAL ERROR! Could not spawn for some reason"); - return false; - } - - playClientEffectObj(commander, "clienteffect/space_command/sys_comm_generic.cef", ship, ""); - - space_combat.flightDroidVocalize(ship, 1); - - utils.setLocalVar(ship, "cmd.pirate.goRaid", 2); - - initializeCommandTimer(commander, CMD_PIRATE_LURE_DELAY); - - String cefPlayBackHardpoint = space_combat.targetHardpointForCefPlayback(ship); - - playClientEffectObj(commander, "clienteffect/space_command/emergency_power_on.cef", ship, cefPlayBackHardpoint); - - return true; - } - - - public static boolean spawnPirateRaiders(obj_id ship, obj_id commander, String level, String attack_type, obj_id target) throws InterruptedException - { - debugServerConsoleMsg(null, "SPACE_COMBAT.spawnPirateRaiders"); - - if (!isIdValid(ship) || !isIdValid(commander)) - { - return false; - } - - if (!isIdValid(target)) - { - debugServerConsoleMsg(null, "SPACE_COMBAT.spawnPirateRaiders -- Skipping spawning stuff. Target was invalid and wasn't null"); - return false; - } - - transform loc = playerCommandSpawnerLocGetter(ship, true); - - int pirateForceMaxSize = 1; - String pirateForceGear = PIRATE_EQUIPMENT_D; - int successLevel = 4; - - if (level.equals("level1")) - { - successLevel = doPilotCommandSkillCheck(commander, "level2command"); - - debugServerConsoleMsg(null, "============================================"); - debugServerConsoleMsg(null, "SPACE_COMBAT.spawnPirateRaiders = successLevel came back as: "+ successLevel); - - switch (successLevel) - { - case 6: - pirateForceMaxSize = 3; - pirateForceGear = PIRATE_EQUIPMENT_B; - break; - case 5: - pirateForceMaxSize = 0; - break; - case 4: - pirateForceMaxSize = 2; - pirateForceGear = PIRATE_EQUIPMENT_D; - break; - case 3: - pirateForceMaxSize = 4; - pirateForceGear = PIRATE_EQUIPMENT_C; - break; - case 2: - pirateForceMaxSize = 4; - pirateForceGear = PIRATE_EQUIPMENT_C; - break; - case 1: - pirateForceMaxSize = 4; - pirateForceGear = PIRATE_EQUIPMENT_B; - break; - case 0: - pirateForceMaxSize = 6; - pirateForceGear = PIRATE_EQUIPMENT_B; - break; - } - - if (successLevel == 5) - { - - string_id strSpam = new string_id("space/space_interaction", "none_around_pirate_raid"); - - sendSystemMessage(commander, strSpam); - return false; - } - } - else if (level.equals("level2")) - { - successLevel = doPilotCommandSkillCheck(commander, "level4command"); - - debugServerConsoleMsg(null, "============================================"); - debugServerConsoleMsg(null, "SPACE_COMBAT.spawnPirateRaiders = successLevel came back as: "+ successLevel); - - switch (successLevel) - { - case 6: - pirateForceMaxSize = 3; - pirateForceGear = PIRATE_EQUIPMENT_A; - break; - case 5: - pirateForceMaxSize = 0; - break; - case 4: - pirateForceMaxSize = 2; - pirateForceGear = PIRATE_EQUIPMENT_C; - break; - case 3: - pirateForceMaxSize = 4; - pirateForceGear = PIRATE_EQUIPMENT_B; - break; - case 2: - pirateForceMaxSize = 4; - pirateForceGear = PIRATE_EQUIPMENT_A; - break; - case 1: - pirateForceMaxSize = 4; - pirateForceGear = PIRATE_EQUIPMENT_A; - break; - case 0: - pirateForceMaxSize = 6; - pirateForceGear = PIRATE_EQUIPMENT_AA; - break; - } - - if (successLevel == 5) - { - - string_id strSpam = new string_id("space/space_interaction", "none_around_pirate_raid"); - - sendSystemMessage(commander, strSpam); - return false; - } - else if (successLevel < 4) - { - ship_ai.unitSetAutoAggroImmuneTime(ship, 60.0f); - } - } - - String[] possibleShips = dataTableGetStringColumnNoDefaults(PIRATE_EQUIPMENT_DATATABLE, pirateForceGear); - - String leadPirate = possibleShips[(int) (rand(0, possibleShips.length - 1))]; - - debugServerConsoleMsg(null, "SPACE_COMBAT.spawnPirateRaiders ------------ leadPirate chosen was: "+ leadPirate); - - obj_id pirateLeader = space_create.createShipHyperspace(leadPirate, loc, null); - - if (!isIdValid(pirateLeader)) - { - return false; - } - - int pirateSquadId = ship_ai.unitGetSquadId(pirateLeader); - - int pirateForceSize = (int) (rand(1, pirateForceMaxSize - 1)); - - for (int i = 0; i < pirateForceSize; i++) - { - testAbortScript(); - String spawnShip = possibleShips[(int) (rand(0, possibleShips.length - 1))]; - - debugServerConsoleMsg(null, "SPACE_COMBAT.spawnPirateRaiders ------------ secondary pirate chosen was: "+ spawnShip); - loc = playerCommandSpawnerLocGetter(ship, true); - obj_id currentPirate = space_create.createShipHyperspace(spawnShip, loc, null); - - ship_ai.unitSetSquadId(currentPirate, pirateSquadId); - } - - obj_id[] squaddyList = null; - - if (ship_ai.isSquadIdValid(pirateSquadId)) - { - squaddyList = ship_ai.squadGetUnitList(pirateSquadId); - } - else - { - return false; - } - - pirateForceSize = ship_ai.squadGetSize(pirateSquadId); - - if (squaddyList.length > 1) - { - ship_ai.squadSetFormationSpacing(pirateSquadId, 3.0f); - } - - for (int i = 0; i < squaddyList.length; i++) - { - testAbortScript(); - setObjVar(squaddyList[i], "commanderPlayer", commander); - attachScript(squaddyList[i], "space.command.player_cmd_pirate"); - } - - if (utils.hasLocalVar(commander, "cmd.pirate.squadId")) - { - utils.removeLocalVar(commander, "cmd.pirate.squadId"); - } - - utils.setLocalVar(commander, "cmd.pirate.squadId", pirateSquadId); - - if (utils.hasLocalVar(commander, "cmd.pirate.initialSize")) - { - utils.removeLocalVar(commander, "cmd.pirate.initialSize"); - } - utils.setLocalVar(commander, "cmd.pirate.initialSize", pirateForceSize); - - if (isIdValid(target)) - { - transform targetLoc = getTransform_o2w(target); - - transform[]loiterPath = ship_ai.createPatrolPathLoiter(targetLoc, 100.0f, 100.0f); - ship_ai.squadPatrol(pirateSquadId, loiterPath); - } - else - { - transform targetLoc = getTransform_o2w(ship); - - transform[]loiterPath = ship_ai.createPatrolPathLoiter(targetLoc, 100.0f, 100.0f); - ship_ai.squadPatrol(pirateSquadId, loiterPath); - } - - dictionary params = new dictionary(); - - for (int j = 0; j < squaddyList.length; j++) - { - testAbortScript(); - obj_id thisAttacker = squaddyList[j]; - - params.put("loopsleft", 2); - params.put("targetship", ship); - messageTo(squaddyList[j], "iAmSpoofed", params, 2.0f, false); - } - - if (successLevel == 6) - { - ship_ai.squadAddTarget(pirateSquadId, ship); - } - else - { - if (isIdValid(target)) - { - if (!space_utils.isPlayerControlledShip(target)) - { - int targetSquad = ship_ai.unitGetSquadId(target); - int targetSquadSize = ship_ai.squadGetSize(targetSquad); - - if (targetSquadSize > 1) - { - obj_id[] targetSquaddyList = null; - - if (ship_ai.isSquadIdValid(targetSquad)) - { - targetSquaddyList = ship_ai.squadGetUnitList(targetSquad); - } - else - { - return true; - } - - for (int k = 0; k < targetSquaddyList.length; k++) - { - testAbortScript(); - setObjVar(targetSquaddyList[k], "damageMultiplier", NPC_DAMAGE_MULTIPLIER); - } - - ship_ai.squadSetPrimaryTarget(pirateSquadId, targetSquad); - } - else - { - if (ship_ai.isSquadIdValid(targetSquad)) - { - setObjVar(target, "damageMultiplier", NPC_DAMAGE_MULTIPLIER); - ship_ai.squadSetPrimaryTarget(pirateSquadId, target); - } - else - { - return true; - } - } - } - else - { - - ship_ai.squadSetPrimaryTarget(pirateSquadId, target); - - } - } - } - - return true; - } - - - public static void piratePackageEvac(obj_id commander, int pirateSquadId) throws InterruptedException - { - debugServerConsoleMsg(null, "PIRATEpACKAGEeVAC"); - - utils.removeLocalVar(commander, "cmd.pirate"); - - obj_id ship = space_transition.getContainingShip(commander); - - obj_id[] pirateSquaddyList = null; - - if (ship_ai.isSquadIdValid(pirateSquadId)) - { - pirateSquaddyList = ship_ai.squadGetUnitList(pirateSquadId); - } - else - { - return; - } - - if (hasObjVar(pirateSquaddyList[0], "evacuate")) - { - return; - } - - for (int i = 0; i < pirateSquaddyList.length; i++) - { - testAbortScript(); - setObjVar(pirateSquaddyList[i], "evacuate", 1); - } - - obj_id pirateLeader = pirateSquaddyList[0]; - obj_id squadTarget = ship_ai.unitGetPrimaryAttackTarget(pirateLeader); - - if (!isIdValid(ship)) - { - ship = pirateLeader; - } - - transform loc = playerCommandSpawnerLocGetter(ship, true); - - ship_ai.squadSetAttackOrders(pirateSquadId, ship_ai.ATTACK_ORDERS_HOLD_FIRE); - ship_ai.squadMoveTo(pirateSquadId, loc); - - if (utils.hasLocalVar(commander, "cmd.pirate.squadId")) - { - int targetSquadId = utils.getIntLocalVar(commander, "cmd.pirate.squadId"); - - obj_id[] targetSquaddyList = null; - - if (ship_ai.isSquadIdValid(targetSquadId)) - { - targetSquaddyList = ship_ai.squadGetUnitList(targetSquadId); - } - else - { - return; - } - - for (int i = 0; i < targetSquaddyList.length; i++) - { - testAbortScript(); - if (hasObjVar(targetSquaddyList[i], "damageMultiplier")) - { - removeObjVar(targetSquaddyList[i], "damageMultiplier"); - } - } - } - - return; - } - - - public static float getShipWeaponDamage(obj_id objAttacker, obj_id objDefender, int intWeaponSlot) throws InterruptedException - { - final float NPC_NPC_DAMAGE_MULTIPLIER_DEEP_SPACE = 10.0f; - final float NPC_NPC_DAMAGE_MULTIPLIER = 1.0f; - final float PVP_MULTIPLIER = .5f; - - float fltMinDamage = getShipWeaponDamageMinimum(objAttacker, intWeaponSlot); - float fltMaxDamage = getShipWeaponDamageMaximum(objAttacker, intWeaponSlot); - - float fltGeneralEfficiency = getShipComponentEfficiencyGeneral(objAttacker, intWeaponSlot); - - fltMinDamage = fltMinDamage * fltGeneralEfficiency; - fltMaxDamage = fltMaxDamage * fltGeneralEfficiency; - float fltDamage = rand(fltMinDamage, fltMaxDamage); - - if ((!space_utils.isPlayerControlledShip(objAttacker) && (!space_utils.isPlayerControlledShip(objDefender)))) - { - location locTest = getLocation(objAttacker); - - if (locTest.area.equals("space_heavy")) - { - fltDamage = fltDamage * NPC_NPC_DAMAGE_MULTIPLIER_DEEP_SPACE; - } - else - { - if (hasObjVar(objDefender, "damageMultiplier")) - { - int intTest = getIntObjVar(objDefender, "damageMultiplier"); - float fltMultiplier = (float) (intTest); - - if (fltMultiplier <= 0) - { - fltMultiplier = 1.0f; - } - - fltDamage = fltDamage * fltMultiplier; - } - else - { - fltDamage = fltDamage * NPC_NPC_DAMAGE_MULTIPLIER; - } - } - } - else if (space_utils.isPlayerControlledShip(objAttacker) && (space_utils.isPlayerControlledShip(objDefender))) - { - fltDamage = fltDamage * PVP_MULTIPLIER; - } - - float skillMod = (float)getEnhancedSkillStatisticModifierUncapped(objAttacker, "ship_weapon_damage")/100; - fltDamage = fltDamage * (1.0f + skillMod); - - return fltDamage; - - } - - - public static float doShieldDamage(obj_id objAttacker, obj_id objDefender, int intWeaponSlot, float fltDamage, int intSide) throws InterruptedException - { - - fltDamage = damageShield(objAttacker, objDefender, intWeaponSlot, fltDamage, intSide); - return fltDamage; - } - - - public static float doArmorDamage(obj_id objAttacker, obj_id objDefender, int intWeaponSlot, float fltDamage, int intSide) throws InterruptedException - { - fltDamage = damageArmor(objAttacker, objDefender, intWeaponSlot, fltDamage, intSide); - - return fltDamage; - } - - - public static float doChassisDamage(obj_id objAttacker, obj_id objDefender, int intWeaponSlot, float fltDamage) throws InterruptedException - { - - float fltChassisHitPoints = getShipCurrentChassisHitPoints(objDefender); - - float fltMaximumChassisHitPoints = getShipMaximumChassisHitPoints(objDefender); - - if ((fltChassisHitPoints - fltDamage) < (fltMaximumChassisHitPoints / 2) && fltChassisHitPoints > (fltMaximumChassisHitPoints / 2)) - { - - dictionary dctParams = new dictionary(); - - space_utils.notifyObject(objDefender, "OnHullNearlyDestroyed", dctParams); - } - - fltChassisHitPoints = fltChassisHitPoints - fltDamage; - - doInteriorDamageNotification(objDefender, space_combat.CHASSIS, fltMaximumChassisHitPoints, fltChassisHitPoints); - - if ((fltChassisHitPoints + fltDamage) > 0.0f && fltMaximumChassisHitPoints > 0.0f) - { - location locDefender = getLocation(objDefender); - location locAttacker = isIdValid(objAttacker) ? getLocation(objAttacker) : locDefender; - - vector up_w = new vector(locAttacker.x - locDefender.x, locAttacker.y - locDefender.y, locAttacker.z - locDefender.z); - - float integrity = fltChassisHitPoints / fltMaximumChassisHitPoints; - float previousIntegrity = (fltChassisHitPoints + fltDamage) / fltMaximumChassisHitPoints; - - if (Math.abs(integrity - previousIntegrity) > 0.01f) - { - notifyShipHit(objDefender, up_w, vector.zero, ship_hit_type.HT_chassis, integrity, previousIntegrity); - } - } - - if (fltChassisHitPoints <= 0) - { - space_combat.registerDamageDoneToShip(objAttacker, objDefender, fltDamage + fltChassisHitPoints); - - location locTest = getLocation(objDefender); - - setShipCurrentChassisHitPoints(objDefender, 0); - doChassisDamageSpam(objAttacker, objDefender, fltDamage, fltChassisHitPoints); - return 10; - } - else - { - space_combat.registerDamageDoneToShip(objAttacker, objDefender, fltDamage); - - if (fltChassisHitPoints > fltMaximumChassisHitPoints) - { - fltChassisHitPoints = fltMaximumChassisHitPoints; - } - - doChassisDamageSpam(objAttacker, objDefender, fltDamage, fltChassisHitPoints); - setShipCurrentChassisHitPoints(objDefender, fltChassisHitPoints); - return 0; - } - - } - - - public static float getShieldHitPoints(obj_id objDefender, int intSide) throws InterruptedException - { - if (isShipSlotInstalled(objDefender, ship_chassis_slot_type.SCST_shield_0)) - { - if (intSide == space_combat.FRONT) - { - return getShipShieldHitpointsFrontCurrent(objDefender); - } - else if (intSide == space_combat.BACK) - { - return getShipShieldHitpointsBackCurrent(objDefender); - } - } - - return 0; - } - - - public static float getShieldHitPointsMaximum(obj_id objDefender, int intSide) throws InterruptedException - { - if (isShipSlotInstalled(objDefender, ship_chassis_slot_type.SCST_shield_0)) - { - if (intSide == space_combat.FRONT) - { - return getShipShieldHitpointsFrontMaximum(objDefender); - } - else if (intSide == space_combat.BACK) - { - return getShipShieldHitpointsBackMaximum(objDefender); - } - } - - return 0; - } - - - public static float getArmorHitPoints(obj_id objDefender, int intSide) throws InterruptedException - { - if (intSide == space_combat.FRONT) - { - - int intSlot = ship_chassis_slot_type.SCST_armor_0; - - if (isShipSlotInstalled(objDefender, intSlot)) - { - return getShipComponentArmorHitpointsCurrent(objDefender, intSlot); - } - } - else if (intSide == space_combat.BACK) - { - int intSlot = ship_chassis_slot_type.SCST_armor_1; - - if (isShipSlotInstalled(objDefender, intSlot)) - { - return getShipComponentArmorHitpointsCurrent(objDefender, intSlot); - } - } - - return 0; - } - - - public static float getArmorHitPointsMaximum(obj_id objDefender, int intSide) throws InterruptedException - { - if (intSide == space_combat.FRONT) - { - - int intSlot = ship_chassis_slot_type.SCST_armor_0; - - if (isShipSlotInstalled(objDefender, intSlot)) - { - return getShipComponentArmorHitpointsMaximum(objDefender, intSlot); - } - - } - else if (intSide == space_combat.BACK) - { - int intSlot = ship_chassis_slot_type.SCST_armor_1; - - if (isShipSlotInstalled(objDefender, intSlot)) - { - return getShipComponentArmorHitpointsMaximum(objDefender, intSlot); - } - } - - return 0; - } - - - public static void setShieldHitPoints(obj_id objDefender, int intSide, float fltHitPoints) throws InterruptedException - { - - if (isShipSlotInstalled(objDefender, ship_chassis_slot_type.SCST_shield_0)) - { - - if (intSide == space_combat.FRONT) - { - setShipShieldHitpointsFrontCurrent(objDefender, fltHitPoints); - - } - else if (intSide == space_combat.BACK) - { - setShipShieldHitpointsBackCurrent(objDefender, fltHitPoints); - } - else - { - - } - } - } - - public static void setArmorHitPoints(obj_id objDefender, int intSide, float fltHitPoints) throws InterruptedException - { - if (intSide == space_combat.FRONT) - { - int intSlot = ship_chassis_slot_type.SCST_armor_0; - - if (isShipSlotInstalled(objDefender, intSlot)) - { - setShipComponentArmorHitpointsCurrent(objDefender, intSlot, fltHitPoints); - } - } - else if (intSide == space_combat.BACK) - { - int intSlot = ship_chassis_slot_type.SCST_armor_1; - - if (isShipSlotInstalled(objDefender, intSlot)) - { - setShipComponentArmorHitpointsCurrent(objDefender, intSlot, fltHitPoints); - } - } - else - { - - } - } - - - public static float damageShield(obj_id objAttacker, obj_id objDefender, int intWeaponSlot, float fltDamage, int intSide) throws InterruptedException - { - float fltShieldHitPoints = getShieldHitPoints(objDefender, intSide); - - if (fltShieldHitPoints > 0) - { - if (isIdValid(objAttacker)) - { - if (isShipSlotInstalled(objAttacker, intWeaponSlot)) - { - float fltWeaponShieldRating = getShipWeaponEffectivenessShields(objAttacker, intWeaponSlot); - - fltDamage = fltDamage * fltWeaponShieldRating; - } - } - - int intDamage = (int) fltDamage; - - fltDamage = (float) intDamage; - } - - float fltOldShieldHitPoints = fltShieldHitPoints; - - fltShieldHitPoints = fltShieldHitPoints - fltDamage; - - float fltShieldHitPointsMaximum = getShieldHitPointsMaximum(objDefender, intSide); - - if (fltOldShieldHitPoints > 0.0f && fltShieldHitPointsMaximum > 0.0f) - { - location locDefender = getLocation(objDefender); - location locAttacker = isIdValid(objAttacker) ? getLocation(objAttacker) : locDefender; - - vector up_w = new vector(locAttacker.x - locDefender.x, locAttacker.y - locDefender.y, locAttacker.z - locDefender.z); - - float integrity = fltShieldHitPoints / fltShieldHitPointsMaximum; - float previousIntegrity = (fltShieldHitPoints + fltDamage) / fltShieldHitPointsMaximum; - - if (Math.abs(integrity - previousIntegrity) > 0.01f) - { - notifyShipHit(objDefender, up_w, vector.zero, ship_hit_type.HT_shield, integrity, previousIntegrity); - } - } - - if (fltShieldHitPoints < 0) - { - if (((fltOldShieldHitPoints - fltDamage) < 0) && (fltOldShieldHitPoints > 0)) - { - dictionary dctParams = new dictionary(); - - space_utils.notifyObject(objDefender, "OnShieldsDepleted", dctParams); - } - - space_combat.registerDamageDoneToShip(objAttacker, objDefender, fltDamage + fltShieldHitPoints); - setShieldHitPoints(objDefender, intSide, 0); - - return Math.abs(fltShieldHitPoints); - } - else - { - if (intSide == space_combat.FRONT) - { - - float fltMaximumShieldHitPoints = getShipShieldHitpointsFrontMaximum(objDefender); - - if (((fltOldShieldHitPoints - fltDamage) < fltMaximumShieldHitPoints / 2) && (fltOldShieldHitPoints > (fltMaximumShieldHitPoints / 2))) - { - - dictionary dctParams = new dictionary(); - - space_utils.notifyObject(objDefender, "OnShieldsHalf", dctParams); - } - - doInteriorDamageNotification(objDefender, space_combat.SHIELD, fltMaximumShieldHitPoints, fltShieldHitPoints); - } - else if (intSide == space_combat.BACK) - { - float fltMaximumShieldHitPoints = getShipShieldHitpointsBackMaximum(objDefender); - - if (((fltOldShieldHitPoints - fltDamage) < fltMaximumShieldHitPoints / 2) && (fltOldShieldHitPoints > (fltMaximumShieldHitPoints / 2))) - { - - dictionary dctParams = new dictionary(); - - space_utils.notifyObject(objDefender, "OnShieldsHalf", dctParams); - } - - doInteriorDamageNotification(objDefender, space_combat.SHIELD, fltMaximumShieldHitPoints, fltShieldHitPoints); - } - - setShieldHitPoints(objDefender, intSide, fltShieldHitPoints); - doShieldDamageSpam(objAttacker, objDefender, intSide, fltDamage, fltShieldHitPoints); - space_combat.registerDamageDoneToShip(objAttacker, objDefender, fltDamage); - - return 0; - } - } - - - public static float damageArmor(obj_id objAttacker, obj_id objDefender, int intWeaponSlot, float fltDamage, int intSide) throws InterruptedException - { - float fltArmorHitPoints = getArmorHitPoints(objDefender, intSide); - - if (fltArmorHitPoints > 0) - { - if (isIdValid(objAttacker)) - { - if (isShipSlotInstalled(objAttacker, intWeaponSlot)) - { - float fltWeaponArmorRating = getShipWeaponEffectivenessArmor(objAttacker, intWeaponSlot); - - fltDamage = fltDamage * fltWeaponArmorRating; - } - } - - int intDamage = (int) fltDamage; - - fltDamage = (float) intDamage; - } - - fltArmorHitPoints = fltArmorHitPoints - fltDamage; - - float fltMaximumArmorHitPoints = getArmorHitPointsMaximum(objDefender, intSide); - - if ((fltArmorHitPoints + fltDamage) > 0.0f && fltMaximumArmorHitPoints > 0.0f) - { - location locDefender = getLocation(objDefender); - location locAttacker = isIdValid(objAttacker) ? getLocation(objAttacker) : locDefender; - - vector up_w = new vector(locAttacker.x - locDefender.x, locAttacker.y - locDefender.y, locAttacker.z - locDefender.z); - - float integrity = fltArmorHitPoints / fltMaximumArmorHitPoints; - float previousIntegrity = (fltArmorHitPoints + fltDamage) / fltMaximumArmorHitPoints; - - if (Math.abs(integrity - previousIntegrity) > 0.01f) - { - notifyShipHit(objDefender, up_w, vector.zero, ship_hit_type.HT_armor, integrity, previousIntegrity); - } - } - - if (fltArmorHitPoints < 0) - { - space_combat.registerDamageDoneToShip(objAttacker, objDefender, fltDamage + fltArmorHitPoints); - setArmorHitPoints(objDefender, intSide, 0); - doArmorDamageSpam(objAttacker, objDefender, intSide, fltDamage + fltArmorHitPoints, 0); - return Math.abs(fltArmorHitPoints); - } - else - { - if (intSide == space_combat.FRONT) - { - int intSlot = ship_chassis_slot_type.SCST_armor_0; - - doInteriorDamageNotification(objDefender, space_combat.ARMOR, getShipComponentArmorHitpointsMaximum(objDefender, intSlot), fltArmorHitPoints); - } - else if (intSide == space_combat.BACK) - { - int intSlot = ship_chassis_slot_type.SCST_armor_1; - - doInteriorDamageNotification(objDefender, space_combat.ARMOR, getShipComponentArmorHitpointsMaximum(objDefender, intSlot), fltArmorHitPoints); - } - - space_combat.registerDamageDoneToShip(objAttacker, objDefender, fltDamage + fltDamage); - setArmorHitPoints(objDefender, intSide, fltArmorHitPoints); - doArmorDamageSpam(objAttacker, objDefender, intSide, fltDamage, fltArmorHitPoints); - - return 0; - } - } - - - public static float doComponentDamage(obj_id objAttacker, obj_id objDefender, int intWeaponSlot, int intTargetedComponent, float fltDamage, int intSide) throws InterruptedException - { - - boolean boolNoPassThrough = false; - - if (intTargetedComponent != space_combat.SHIP) - { - if (!isShipSlotInstalled(objDefender, intTargetedComponent)) - { - intTargetedComponent = getComponentToDamage(objAttacker, objDefender, intTargetedComponent, intSide); - if (intTargetedComponent == space_combat.SHIP) - { - - return fltDamage; - } - } - else - { - - fltDamage = fltDamage * 1.0f; - - boolNoPassThrough = true; - } - } - else - { - intTargetedComponent = getComponentToDamage(objAttacker, objDefender, intTargetedComponent, intSide); - - if (intTargetedComponent == space_combat.SHIP) - { - - return fltDamage; - } - } - - fltDamage = damageComponent(objAttacker, objDefender, intWeaponSlot, intTargetedComponent, fltDamage, intSide, boolNoPassThrough); - - if (boolNoPassThrough) - { - return 0; - - } - - return fltDamage; - } - - - public static dictionary getComponentWeightings(obj_id objDefender, int intTargetedComponent) throws InterruptedException - { - if (intTargetedComponent != space_combat.SHIP) - { - - if (!isShipSlotInstalled(objDefender, intTargetedComponent)) - { - intTargetedComponent = space_combat.SHIP; - } - else - { - dictionary dctReturn = new dictionary(); - int[] intSlots = new int[1]; - int[] intWeightings = new int[1]; - - intSlots[0] = intTargetedComponent; - intWeightings[0] = 100; - dctReturn.put("intWeightings", intWeightings); - dctReturn.put("intSlots", intSlots); - return dctReturn; - } - - } - - String strFileName = "datatables/space/ship_chassis.iff"; - - String strChassisType = getShipChassisType(objDefender); - dictionary dctRow = dataTableGetRow(strFileName, strChassisType); - - if (dctRow == null) - { - - dctRow = dataTableGetRow(strFileName, "xwing"); - } - - Vector intWeightings = new Vector(); - intWeightings.setSize(0); - Vector intSlots = new Vector(); - intSlots.setSize(0); - - int[] intRawSlots = getShipChassisSlots(objDefender); - - for (int intI = 0; intI < intRawSlots.length; intI++) - { - testAbortScript(); - - if ((isShipSlotInstalled(objDefender, intRawSlots[intI])) && (intRawSlots[intI] != ship_chassis_slot_type.SCST_armor_0) && (intRawSlots[intI] != ship_chassis_slot_type.SCST_armor_1)) - { - - String strSlotName = space_crafting.getComponentSlotNameString(intRawSlots[intI]); - - strSlotName = strSlotName + "_hitweight"; - - intWeightings = utils.addElement(intWeightings, dctRow.getInt(strSlotName)); - - intSlots = utils.addElement(intSlots, intRawSlots[intI]); - } - else - { - - } - } - - if (intWeightings.size() == 0) - { - - return null; - } - - dictionary dctReturn = new dictionary(); - - dctReturn.put("intWeightings", intWeightings); - dctReturn.put("intSlots", intSlots); - return dctReturn; - - } - - - public static int getComponentToDamage(obj_id objAttacker, obj_id objDefender, int intTargetedComponent, int intSide) throws InterruptedException - { - - dictionary dctReturn = getComponentWeightings(objDefender, intTargetedComponent); - - if (dctReturn == null) - { - - return space_combat.SHIP; - - } - - int[] intSlots = dctReturn.getIntArray("intSlots"); - int[] intRawWeightings = dctReturn.getIntArray("intWeightings"); - int[] intNewWeightings = new int[intRawWeightings.length * 2]; - - int intCounter = 0; - - if (intRawWeightings.length > 1) - { - - int intJ = 0; - - for (int intI = 0; intI < intNewWeightings.length; intI = intI + 2) - { - testAbortScript(); - intNewWeightings[intI] = intCounter; - - intCounter = intCounter + intRawWeightings[intJ]; - intJ = intJ + 1; - - intNewWeightings[intI + 1] = intCounter; - intCounter = intCounter + 1; - } - - int intRoll = rand(0, intNewWeightings[intNewWeightings.length - 1]); - - intCounter = 0; - - for (int intI = 0; intI < intNewWeightings.length; intI = intI + 2) - { - testAbortScript(); - - if ((intNewWeightings[intI] <= intRoll) && (intNewWeightings[intI + 1] >= intRoll)) - { - - break; - } - - intCounter++; - } - } - else - { - - } - - int intComponent = intSlots[intCounter]; - - return intComponent; - } - - - public static float damageComponent(obj_id objAttacker, obj_id objDefender, int intWeaponSlot, int intComponent, float fltDamage, int intSide, boolean boolTrackDisabled) throws InterruptedException - { - int intDamage = (int) fltDamage; - - fltDamage = (float) intDamage; - - float fltOldComponentArmor = getShipComponentArmorHitpointsCurrent(objDefender, intComponent); - float fltOldComponentHitPoints = getShipComponentHitpointsCurrent(objDefender, intComponent); - - float fltComponentArmor = fltOldComponentArmor; - float fltComponentHitPoints = fltOldComponentHitPoints; - - float fltRemainingDamage = 0; - - if ((fltComponentHitPoints == 0) && (fltComponentArmor == 0)) - { - return fltDamage; - } - - fltComponentArmor = fltComponentArmor - fltDamage; - - if (fltComponentArmor < 0) - { - - space_combat.registerDamageDoneToShip(objAttacker, objDefender, fltDamage + fltComponentArmor); - setShipComponentArmorHitpointsCurrent(objDefender, intComponent, 0); - fltDamage = Math.abs(fltComponentArmor); - fltComponentArmor = 0; - fltComponentHitPoints = fltComponentHitPoints - fltDamage; - - if (fltComponentHitPoints < 0) - { - - space_combat.registerDamageDoneToShip(objAttacker, objDefender, fltDamage + fltComponentHitPoints); - fltRemainingDamage = Math.abs(fltComponentHitPoints); - setShipComponentHitpointsCurrent(objDefender, intComponent, 0); - space_combat.recalculateEfficiency(intComponent, objDefender); - - if (boolTrackDisabled) - { - if (space_combat.isShipDisabled(objDefender, intComponent) && !hasObjVar(objDefender, "isDisabled")) - { - dictionary dctParams = new dictionary(); - - dctParams.put("objAttacker", objAttacker); - dctParams.put("objDefender", objDefender); - - if (space_utils.isPlayerControlledShip(objDefender) && (!space_utils.isShipWithInterior(objDefender))) - { - setCondition(objDefender, CONDITION_EJECT); - } - - space_utils.notifyObject(objDefender, "OnShipDisabled", dctParams); - - if (!hasObjVar(objDefender, "noNotifyDisable")) - { - space_combat.notifyAttackerDisabled(objAttacker, objDefender, dctParams); - } - - setObjVar(objDefender, "isDisabled", getGameTime() + 5); - } - } - else - { - if (space_utils.isPlayerControlledShip(objDefender)) - { - if (space_utils.isPlayerControlledShip(objDefender) && (!space_utils.isShipWithInterior(objDefender))) - { - setCondition(objDefender, CONDITION_EJECT); - } - } - } - - doComponentDamageSpam(objAttacker, objDefender, intComponent, fltDamage); - fltComponentHitPoints = 0; - } - else - { - - space_combat.recalculateEfficiency(intComponent, objDefender); - doInteriorDamageNotification(objDefender, space_combat.COMPONENT, 90, 100); - space_combat.registerDamageDoneToShip(objAttacker, objDefender, fltDamage); - setShipComponentHitpointsCurrent(objDefender, intComponent, fltComponentHitPoints); - space_combat.recalculateEfficiency(intComponent, objDefender); - doComponentDamageSpam(objAttacker, objDefender, intComponent, fltDamage); - fltRemainingDamage = 0; - } - } - else - { - doInteriorDamageNotification(objDefender, space_combat.COMPONENT, 20, 100); - - space_combat.registerDamageDoneToShip(objAttacker, objDefender, fltDamage); - - setShipComponentArmorHitpointsCurrent(objDefender, intComponent, fltComponentArmor); - doComponentDamageSpam(objAttacker, objDefender, intComponent, fltDamage); - fltRemainingDamage = 0; - } - - float fltComponentHitpointsArmorMaximum = getShipComponentArmorHitpointsMaximum(objDefender, intComponent) + getShipComponentHitpointsMaximum(objDefender, intComponent); - float fltOldComponentHitpointsArmor = fltOldComponentArmor + fltOldComponentHitPoints; - - if (fltOldComponentHitpointsArmor > 0.0f && fltComponentHitpointsArmorMaximum > 0.0f) - { - float fltComponentHitpointsArmor = fltComponentArmor + fltComponentHitPoints; - - location locDefender = getLocation(objDefender); - location locAttacker = isIdValid(objAttacker) ? getLocation(objAttacker) : locDefender; - - vector up_w = new vector(locAttacker.x - locDefender.x, locAttacker.y - locDefender.y, locAttacker.z - locDefender.z); - - float integrity = fltComponentHitpointsArmor / fltComponentHitpointsArmorMaximum; - float previousIntegrity = (fltOldComponentHitpointsArmor) / fltComponentHitpointsArmorMaximum; - - if (Math.abs(integrity - previousIntegrity) > 0.01f) - { - notifyShipHit(objDefender, up_w, vector.zero, ship_hit_type.HT_component, integrity, previousIntegrity); - } - } - - return fltRemainingDamage; - } - - - public static String getSideName(int intSide) throws InterruptedException - { - if (intSide == space_combat.FRONT) - { - return "Front"; - } - - if (intSide == space_combat.BACK) - { - return "Back"; - } - return ""; - } - - - public static void doShieldDamageSpam(obj_id objAttacker, obj_id objDefender, int intSide, float fltDamage, float fltRemainingHitPoints) throws InterruptedException - { - if (!space_utils.isShip(objAttacker) || (!space_utils.isShip(objDefender))) - { - return; - } - - obj_id objAttackerPilot = getPilotId(objAttacker); - obj_id objDefenderPilot = getPilotId(objDefender); - - if (isIdValid(objAttackerPilot) && hasObjVar(objAttackerPilot, "intCombatDebug")) - { - if (fltDamage > 0) - { - String strSide = getSideName(intSide); - - sendSystemMessageTestingOnly(objAttackerPilot, "Succesful Shield Hit! Side: "+ strSide + " Damage:"+ fltDamage + " Remaining Shield Points:"+ fltRemainingHitPoints); - } - } - - if (isIdValid(objDefenderPilot)) - { - - } - - return; - } - - - public static void doArmorDamageSpam(obj_id objAttacker, obj_id objDefender, int intSide, float fltDamage, float fltRemainingHitPoints) throws InterruptedException - { - if (!space_utils.isShip(objAttacker) || (!space_utils.isShip(objDefender))) - { - return; - } - - obj_id objAttackerPilot = getPilotId(objAttacker); - obj_id objDefenderPilot = getPilotId(objDefender); - - if (!isIdValid(objAttackerPilot)) - { - return; - } - - if (hasObjVar(objAttackerPilot, "intCombatDebug")) - { - if (fltDamage > 0) - { - String strSide = getSideName(intSide); - - if (isIdValid(objAttackerPilot)) - { - - } - } - } - - if (isIdValid(objDefenderPilot)) - { - - } - - return; - } - - - public static void doComponentDamageSpam(obj_id objAttacker, obj_id objDefender, int intComponent, float fltDamage) throws InterruptedException - { - if (!space_utils.isShip(objAttacker) || (!space_utils.isShip(objDefender))) - { - return; - } - - obj_id objAttackerPilot = getPilotId(objAttacker); - obj_id objDefenderPilot = getPilotId(objDefender); - - if (!isIdValid(objAttackerPilot)) - { - return; - } - - if (hasObjVar(objAttackerPilot, "intCombatDebug")) - { - if (fltDamage > 0) - { - - float fltHp = getShipComponentHitpointsCurrent(objDefender, intComponent); - float fltGeneralEfficiency = getShipComponentEfficiencyGeneral(objDefender, intComponent); - float fltEnergyEfficiency = getShipComponentEfficiencyEnergy(objDefender, intComponent); - - float fltArmor = getShipComponentArmorHitpointsCurrent(objDefender, intComponent); - - if (isIdValid(objAttackerPilot)) - { - sendSystemMessageTestingOnly(objAttackerPilot, "Succesful Component Hit! Component Name:"+ space_crafting.getComponentSlotNameString(intComponent) + " Damage:"+ fltDamage); - } - - if (fltHp <= 0) - { - if (isIdValid(objAttackerPilot)) - { - sendSystemMessageTestingOnly(objAttackerPilot, "Component Destroyed!"); - } - } - else - { - if (isIdValid(objAttackerPilot)) - { - sendSystemMessageTestingOnly(objAttackerPilot, "Component Armor Integrity:"+ fltArmor + " Component Energy Efficacy:"+ fltEnergyEfficiency + "%"+ " General Efficiency: "+ fltGeneralEfficiency); - } - } - } - } - - if (isIdValid(objDefenderPilot)) - { - - } - - return; - - } - - - public static void doChassisDamageSpam(obj_id objAttacker, obj_id objDefender, float fltDamage, float fltRemainingHitPoints) throws InterruptedException - { - if (!space_utils.isShip(objAttacker) || !space_utils.isShip(objDefender)) - { - return; - } - - obj_id objAttackerPilot = getPilotId(objAttacker); - - if (!isIdValid(objAttackerPilot)) - { - return; - } - - obj_id objDefenderPilot = getPilotId(objDefender); - - if (hasObjVar(objAttackerPilot, "intCombatDebug")) - { - if (fltDamage > 0) - { - - if (isIdValid(objAttackerPilot)) - { - - sendSystemMessageTestingOnly(objAttackerPilot, "Succesful Chasis Hit! Damage:"+ fltDamage + " Reamining Chassis Integrity:"+ fltRemainingHitPoints); - } - } - } - - if (isIdValid(objDefenderPilot)) - { - - } - - return; - } - - - public static void doInteriorDamageNotification(obj_id objShip, int intDamageType, float fltCurrentHitpoints, float fltMaximumHitpoints) throws InterruptedException - { - - if (hasScript(objShip, "space.ship.ship_interior")) - { - dictionary dctParams = new dictionary(); - - dctParams.put("intDamageType", intDamageType); - int intDamageIntensity = space_combat.LIGHT; - - if ((fltCurrentHitpoints > (fltMaximumHitpoints / 2))) - { - intDamageIntensity = space_combat.HEAVY; - } - - dctParams.put("intDamageIntensity", intDamageIntensity); - space_utils.notifyObject(objShip, "interiorDamageNotification", dctParams); - - } - } - - - public static void checkAndPerformCombatTaunts(obj_id objTaunter, obj_id objTauntee, String strLocalVar, String strType, float fltRange) throws InterruptedException - { - final int TAUNT_DELAY = 3; - final int TAUNT_QUANTITY = 5; - final int TAUNT_LISTEN_DELAY = 2; - - if ((isIdValid(objTauntee) && (!space_utils.isPlayerControlledShip(objTauntee)))) - { - - return; - } - - if ((isIdValid(objTaunter) && (space_utils.isPlayerControlledShip(objTaunter)))) - { - - return; - } - - obj_id objOwner = getOwner(objTauntee); - - if (hasObjVar(objOwner, "jtl.combatTauntsDisabled")) - { - return; - } - - int intGameTime = getGameTime(); - int intLastTime = 0; - - if (isIdValid(objTaunter)) - { - intLastTime = utils.getIntLocalVar(objTaunter, "intTauntTime"); - - if (((intGameTime - intLastTime) < TAUNT_DELAY)) - { - - return; - } - - } - - if (isIdValid(objTauntee)) - { - intLastTime = utils.getIntLocalVar(objTauntee, "intTauntTime"); - - if (((intGameTime - intLastTime) < TAUNT_DELAY)) - { - - return; - } - - } - - float fltChance = utils.getFloatLocalVar(objTaunter, strLocalVar); - float fltRoll = rand(); - - fltRoll = fltRoll * 100; - fltChance = fltChance * 100; - - if (fltRoll < fltChance) - { - - String strDiction = utils.getStringLocalVar(objTaunter, "strTauntDiction"); - - if ((strDiction != null) && (!strDiction.equals(""))) - { - String strFileName = "space/taunts/"+ strDiction; - - strType = strType + rand(1, TAUNT_QUANTITY); - string_id strSpam = new string_id(strFileName, strType); - - if (fltRange > 0) - { - obj_id[] objPlayerShips = getObservedPlayerShips(objTaunter, true); - - if (objPlayerShips != null) - { - for (int intI = 0; intI < objPlayerShips.length; intI++) - { - testAbortScript(); - intLastTime = utils.getIntLocalVar(objPlayerShips[intI], "intTauntTime"); - - if (((intGameTime - intLastTime) > TAUNT_LISTEN_DELAY)) - { - if ((getDistance(objPlayerShips[intI], objTaunter) < fltRange)) - { - prose_package pp = new prose_package(); - - pp.stringId = strSpam; - pp.actor.set(objOwner); - pp.target.set(objOwner); - space_utils.tauntShip(objPlayerShips[intI], objTaunter, pp, true, false, true, true); - utils.setLocalVar(objTaunter, "intTauntTime", intGameTime); - utils.setLocalVar(objTauntee, "intTauntTime", intGameTime); - } - } - } - } - } - else - { - - prose_package pp = new prose_package(); - - pp.stringId = strSpam; - pp.actor.set(objOwner); - pp.target.set(objOwner); - - space_utils.tauntShip(objTauntee, objTaunter, pp, true, false, true, true); - utils.setLocalVar(objTaunter, "intTauntTime", intGameTime); - utils.setLocalVar(objTauntee, "intTauntTime", intGameTime); - } - } - } - } - - - public static void setupCapitalShipFromTurretDefinition(obj_id objShip, String strDefinition) throws InterruptedException - { - String strFileName = "datatables/space_combat/turret_definitions/"+ strDefinition + ".iff"; - - String[] strSlots = dataTableGetStringColumn(strFileName, "strSlot"); - int[] intComponents = dataTableGetIntColumn(strFileName, "intComponent"); - float[] fltComponentHitpoints = dataTableGetFloatColumn(strFileName, "fltComponentHitpoints"); - float[] fltArmorHitpoints = dataTableGetFloatColumn(strFileName, "fltArmorHitpoints"); - float[] fltMinDamage = dataTableGetFloatColumn(strFileName, "fltMinDamage"); - float[] fltMaxDamage = dataTableGetFloatColumn(strFileName, "fltMaxDamage"); - float[] fltRefire = dataTableGetFloatColumn(strFileName, "fltRefire"); - float[] fltDrain = dataTableGetFloatColumn(strFileName, "fltDrain"); - float[] fltShieldEfficiency = dataTableGetFloatColumn(strFileName, "fltShieldEfficiency"); - float[] fltArmorEfficiency = dataTableGetFloatColumn(strFileName, "fltArmorEfficiency"); - - for (int intI = 0; intI < strSlots.length; intI++) - { - testAbortScript(); - if (intComponents[intI] != 0) - { - int intSlot = space_crafting.getComponentSlotInt(strSlots[intI]); - - if (!shipPseudoInstallComponent(objShip, intSlot, intComponents[intI])) - { - - } - else - { - setShipSlotTargetable(objShip, intSlot, true); - setShipComponentArmorHitpointsMaximum(objShip, intSlot, fltArmorHitpoints[intI]); - setShipComponentArmorHitpointsCurrent(objShip, intSlot, fltArmorHitpoints[intI]); - setShipComponentHitpointsMaximum(objShip, intSlot, fltComponentHitpoints[intI]); - setShipComponentHitpointsCurrent(objShip, intSlot, fltComponentHitpoints[intI]); - setShipWeaponDamageMaximum(objShip, intSlot, fltMinDamage[intI]); - setShipWeaponDamageMinimum(objShip, intSlot, fltMaxDamage[intI]); - setShipWeaponEffectivenessShields(objShip, intSlot, fltShieldEfficiency[intI]); - setShipWeaponEffectivenessArmor(objShip, intSlot, fltShieldEfficiency[intI]); - setShipWeaponEnergyPerShot(objShip, intSlot, fltDrain[intI]); - setShipWeaponRefireRate(objShip, intSlot, fltRefire[intI]); - setShipWeaponEfficiencyRefireRate(objShip, intSlot, 1.0f); - setShipComponentEfficiencyGeneral(objShip, intSlot, 1.0f); - setShipComponentEfficiencyEnergy(objShip, intSlot, 1.0f); - } - } - } - - String strPilotType = getStringObjVar(objShip, "ship.pilotType"); - - ship_ai.unitSetPilotType(objShip, strPilotType); - - return; - } - - - public static void playCombatTauntSound(obj_id objPlayer) throws InterruptedException - { - String[] strSounds = - { - "sound/sys_comm_generic.snd", - "sound/sys_comm_imperial.snd", - "sound/sys_comm_rebel.snd" - }; - - if (!isIdValid(objPlayer)) - { - return; - } - - playMusic(objPlayer, strSounds[rand(0, strSounds.length - 1)]); - } - - - public static transform getClosestStationRespawnLocation(obj_id objShip) throws InterruptedException - { - obj_id objClosestStation = getClosestSpaceStation(objShip); - - if (!isIdValid(objClosestStation) || !exists(objClosestStation)) - { - return null; - - } - - transform trTest = space_utils.getRandomPositionInSphere(getTransform_o2p(objClosestStation), 425f, 450f, false); - vector vctTest = space_utils.getVector(objClosestStation); - transform trFinalTransform = space_utils.faceTransformToVector(trTest, vctTest); - - return trFinalTransform; - } - - - public static location getClosestStationLocation(obj_id objShip) throws InterruptedException - { - obj_id objClosestStation = getClosestSpaceStation(objShip); - - if (!isIdValid(objClosestStation) || !exists(objClosestStation)) - { - return null; - } - - return getLocation(objClosestStation); - } - - - public static void sendDestructionNotification(obj_id objShip, obj_id objAttacker) throws InterruptedException - { - if (space_utils.isPlayerControlledShip(objShip)) - { - Vector objOfficers = space_utils.getShipOfficers(objShip); - dictionary dctParams = new dictionary(); - - dctParams.put("objAttacker", objAttacker); - dctParams.put("objShip", objShip); - - for (int intI = 0; intI < objOfficers.size(); intI++) - { - testAbortScript(); - space_utils.notifyObject(((obj_id)(objOfficers.get(intI))), "playerShipDestroyed", dctParams); - } - } - - return; - } - - - public static void clearHyperspace(obj_id objShip) throws InterruptedException - { - if (utils.hasScriptVar(objShip, "intHyperspacing")) - { - utils.removeScriptVar(objShip, "intHyperspacing"); - } - - if (utils.hasScriptVar(objShip, "intHyperspaceDelayStamp")) - { - utils.removeScriptVar(objShip, "intHyperspaceDelayStamp"); - } - - obj_id objPilot = getPilotId(objShip); - - if (isIdValid(objPilot)) - { - hyperspaceRestoreShipOnClientFromAbortedHyperspace(objPilot); - } - } - - - public static void doDeathCleanup(obj_id self) throws InterruptedException - { - if (hasObjVar(self, "intAlarmsOn")) - { - space_crafting.turnOffInteriorAlarms(self); - setObjVar(self, "intAlarmsOn", 1); - } - - utils.removeScriptVar(self, "intHyperspacing"); - } - - - public static void setDeathFlags(obj_id objShip) throws InterruptedException - { - - utils.setScriptVar(objShip, "intDestroyed", getGameTime()); - return; - } - - - public static void clearDeathFlags(obj_id objShip) throws InterruptedException - { - - utils.removeScriptVar(objShip, "intDestroyed"); - utils.removeScriptVar(objShip, "intPVPKill"); - - return; - } - - - public static boolean hasDeathFlags(obj_id objShip) throws InterruptedException - { - - if (utils.hasScriptVar(objShip, "intDestroyed")) - { - int intTime = getGameTime(); - int intFlagTime = utils.getIntScriptVar(objShip, "intDestroyed"); - int intDifference = intTime - intFlagTime; - - if (intDifference > 20) - { - utils.removeScriptVar(objShip, "intDestroyed"); - - return false; - } - - return true; - } - - return false; - } - - - public static void addModuleToDatapad(obj_id objModule, obj_id objDatapad) throws InterruptedException - { - String strDroidCommand = getStringObjVar(objModule, "strDroidCommand"); - - int programSize = 1; - - if (hasObjVar(objModule, "programSize")) - { - programSize = getIntObjVar(objModule, "programSize"); - addModuleToDatapad(strDroidCommand, objDatapad, programSize); - destroyObject(objModule); - } - else - { - addModuleToDatapad(strDroidCommand, objDatapad); - } - - return; - } - - - public static void addModuleToDatapad(String strDroidCommand, obj_id objDatapad) throws InterruptedException - { - int programSize = space_pilot_command.getDroidProgramSize(strDroidCommand, null); - - addModuleToDatapad(strDroidCommand, objDatapad, programSize); - - return; - } - - - public static void addModuleToDatapad(String strDroidCommand, obj_id objDatapad, int intProgramSize) throws InterruptedException - { - String programDataTemplate = "object/intangible/data_item/droid_command.iff"; - - switch (intProgramSize) - { - case 35: - programDataTemplate = "object/intangible/data_item/droid_command_5.iff"; - break; - case 25: - programDataTemplate = "object/intangible/data_item/droid_command_4.iff"; - break; - case 20: - programDataTemplate = "object/intangible/data_item/droid_command_3.iff"; - break; - case 10: - programDataTemplate = "object/intangible/data_item/droid_command_2.iff"; - break; - case 5: - programDataTemplate = "object/intangible/data_item/droid_command_1.iff"; - break; - } - - obj_id objNewCommand = createObject(programDataTemplate, objDatapad, ""); - - setObjVar(objNewCommand, "strDroidCommand", strDroidCommand); - setName(objNewCommand, new string_id("space/droid_commands", strDroidCommand + "_chipname")); - setObjVar(objNewCommand, "programSize", intProgramSize); - - return; - } - - - public static void doBattlefieldRepairCheck(obj_id objShip) throws InterruptedException - { - location locTest = getLocation(objShip); - - if (locTest.area.equals("space_heavy1")) - { - - obj_id objPlayer = getOwner(objShip); - - space_crafting.repairDamage(objPlayer, objShip, 1.0f, 0); - } - - return; - } - - - public static void simpleShieldRatioRebalance(obj_id ship) throws InterruptedException - { - float fltShieldFrontMaximum = getShipShieldHitpointsFrontMaximum(ship); - float fltShieldBackMaximum = getShipShieldHitpointsBackMaximum(ship); - - if (fltShieldFrontMaximum != fltShieldBackMaximum) - { - float fltShieldTotal = fltShieldFrontMaximum + fltShieldBackMaximum; - float fltFrontMax = (fltShieldTotal / 2); - float fltBackMax = fltShieldTotal - fltFrontMax; - - setShipShieldHitpointsFrontMaximum(ship, fltFrontMax); - setShipShieldHitpointsBackMaximum(ship, fltBackMax); - } - - return; - } - - - public static boolean isCapShip(obj_id ship) throws InterruptedException - { - return (dataTableGetInt("datatables/space_mobile/space_mobile.iff", getStringObjVar(ship, "ship.shipName"), "shipClass") == 2); - } - - - public static boolean getCollectionLoot(obj_id objAttacker, obj_id objPilot, obj_id objContainer, String collectionLoot) throws InterruptedException - { - if (!isIdValid(objAttacker)) - { - return false; - } - - if (!isIdValid(objPilot)) - { - return false; - } - - if (!isIdValid(objContainer)) - { - return false; - } - - if (collectionLoot.equals("")) - { - return false; - } - - String[] collectionsInColumn = split(collectionLoot, ','); - int collectionIndex = rand(0, (collectionsInColumn.length - 1)); - collectionLoot = collectionsInColumn[collectionIndex]; - - String[] lootArray = dataTableGetStringColumnNoDefaults(SPACE_COLLECTIONS_LOOT_TABLE, collectionLoot); - int max = lootArray.length -1; - int idx = rand(0, max); - String lootToGrant = lootArray[idx]; - - attemptToGrantLootItem(lootToGrant, objAttacker, objContainer); - - return true; - } - - - public static boolean attemptToGrantLootItem(String lootItem, obj_id objAttacker, obj_id objContainer) throws InterruptedException - { - - if (!isIdValid(objAttacker)) - { - return false; - } - - if (!isIdValid(objContainer)) - { - return false; - } - - if (lootItem.equals("")) - { - return false; - } - - obj_id objItem = space_utils.createObjectTrackItemCount(lootItem, objContainer); - - if (isIdValid(objItem)) - { - sendItemNotification(objAttacker, objItem); - return true; - } - - string_id strSpam = new string_id("space/space_loot", "no_more_loot"); - - if (space_utils.isShipWithInterior(objAttacker)) - { - strSpam = new string_id("space/space_loot", "loot_box_full"); - } - - space_utils.sendSystemMessageShip(objAttacker, strSpam, true, true, true, true); - CustomerServiceLog("space_loot", "Failed to create "+ lootItem + " in "+ objContainer + " contained by "+ objAttacker + ". The Ship or Player Inventory container was full.", getOwner(objAttacker)); - return false; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/space_crafting.java b/sku.0/sys.server/compiled/game/script/library/space_crafting.java deleted file mode 100644 index a4d72006b..000000000 --- a/sku.0/sys.server/compiled/game/script/library/space_crafting.java +++ /dev/null @@ -1,3335 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import java.lang.Math; -import script.library.space_utils; -import script.library.sui; -import script.library.badge; -import script.library.groundquests; -import script.library.space_quest; -import script.library.space_combat; - - -public class space_crafting extends script.base_script -{ - public space_crafting() - { - } - public static final int CHASSIS = space_combat.SHIP; - - public static final int HULL = -1; - public static final int LIFE_SUPPORT = -2; - public static final int PLASMA_CONDUIT = -3; - public static final int AMMO_BAY = -4; - public static final int HYPERDRIVE = -5; - - public static final int HULL_BREACH_DAMAGE = 50; - public static final float HULL_BREACH_DAMAGE_TIMER = 5; - - public static final String SHIP_DROID_SLOT_NAME = "ship_droid"; - - public static final String STF_COMPONENT_TOOL = "reverse_engineering_tool"; - public static final String SCRIPT_COMPONENT_NAME_HANDLER = "space.crafting.component_name_handler"; - - public static final int DAMAGE_CHANCE = 5; - public static final int[] NON_COMPONENT_DAMAGEABLES_LIGHT = - { - PLASMA_CONDUIT - }; - - public static final int[] NON_COMPONENT_DAMAGEABLES_MEDIUM = - { - PLASMA_CONDUIT, - }; - - public static final int[] NON_COMPONENT_DAMAGEABLES_HEAVY = - { - PLASMA_CONDUIT, - }; - - public static final int REACTOR = ship_chassis_slot_type.SCST_reactor; - public static final int ENGINE = ship_chassis_slot_type.SCST_engine; - public static final int SHIELD_GENERATOR = ship_chassis_slot_type.SCST_shield_0; - public static final int ARMOR_0 = ship_chassis_slot_type.SCST_armor_0; - public static final int ARMOR_1 = ship_chassis_slot_type.SCST_armor_1; - public static final int CAPACITOR = ship_chassis_slot_type.SCST_capacitor; - public static final int BOOSTER = ship_chassis_slot_type.SCST_booster; - public static final int DROID_INTERFACE = ship_chassis_slot_type.SCST_droid_interface; - public static final int TARGETING_STATION = ship_chassis_slot_type.SCST_targeting_station; - public static final int WEAPON_0 = ship_chassis_slot_type.SCST_weapon_0; - public static final int WEAPON_1 = ship_chassis_slot_type.SCST_weapon_1; - public static final int WEAPON_2 = ship_chassis_slot_type.SCST_weapon_2; - public static final int WEAPON_3 = ship_chassis_slot_type.SCST_weapon_3; - public static final int WEAPON_4 = ship_chassis_slot_type.SCST_weapon_4; - public static final int WEAPON_5 = ship_chassis_slot_type.SCST_weapon_5; - public static final int WEAPON_6 = ship_chassis_slot_type.SCST_weapon_6; - public static final int WEAPON_7 = ship_chassis_slot_type.SCST_weapon_7; - public static final int CARGO = ship_chassis_slot_type.SCST_cargo_hold; - - public static final string_id SID_INCORRECTLY_CONFIGURED_ITEM = new string_id("space/space_interaction", "incorrectly_configured_item"); - - public static final String STARSHIP_DROID_TABLE = "datatables/space_combat/ship_droid_assignments.iff"; - - - public static double randBell(double avg, double var) throws InterruptedException - { - var = var / 2; - double r, v1, v2; - - do - { - testAbortScript(); - v1 = 2.0 * rand() - 1.0; - v2 = 2.0 * rand() - 1.0; - r = v1 * v1 + v2 * v2; - } - while(r >= 1.0 || r == 0.0); - - double fac = Math.sqrt(-2.0 * Math.log(r) / r); - double value = (avg + (v1 * fac) * (avg * var)); - - if (value < 0) - { - return 0; - } - else - { - return value; - } - } - - - public static float getBellValue(float fltValue, float fltModifier) throws InterruptedException - { - - return (float) (randBell(fltValue, fltModifier)); - } - - - public static float getModifiedValue(float fltValue, float fltModifier) throws InterruptedException - { - - fltValue = fltValue + rand(-1 * fltModifier, fltModifier); - return fltValue; - } - - - public static float getRawModifiedValue(float fltModifier) throws InterruptedException - { - return rand(-1 * fltModifier, fltModifier); - } - - - public static String getShipComponentStringType(obj_id objComponent) throws InterruptedException - { - int intComponentType = getShipComponentDescriptorType(objComponent); - - return getShipComponentStringType(intComponentType); - } - - - public static String getShipComponentStringType(int intComponentType) throws InterruptedException - { - if (intComponentType < ship_component_type.names.length) - { - return ship_component_type.names[intComponentType]; - } - - LOG("space", "type is "+ intComponentType); - return null; - } - - - public static int getComponentSlotInt(String strName) throws InterruptedException - { - return ship_chassis_slot_type.getTypeByName(strName); - } - - - public static String getComponentSlotNameString(int intSlot) throws InterruptedException - { - return ship_chassis_slot_type.getNameByType(intSlot); - } - - - public static obj_id setupStandardStatistics(obj_id objComponent, dictionary dctParams) throws InterruptedException - { - - float fltCurrentHitpoints = dctParams.getFloat("fltCurrentHitpoints"); - float fltMaximumHitpoints = dctParams.getFloat("fltMaximumHitpoints"); - - float fltEnergyMaintenanceModifier = dctParams.getFloat("fltEnergyMaintenanceModifier"); - float fltEnergyMaintenance = dctParams.getFloat("fltEnergyMaintenance"); - - fltEnergyMaintenance = getBellValue(fltEnergyMaintenance, fltEnergyMaintenanceModifier); - - float fltMassModifier = dctParams.getFloat("fltMassModifier"); - float fltMass = dctParams.getFloat("fltMass"); - - fltMass = getBellValue(fltMass, fltMassModifier); - - float fltCurrentConduitHitpoints = dctParams.getFloat("fltCurrentConduitHitpoints"); - float fltMaximumConduitHitpoints = dctParams.getFloat("fltMaximumConduitHitpoints"); - - float fltEfficiency = dctParams.getFloat("fltEfficiency"); - float fltCurrentArmorHitpoints = dctParams.getFloat("fltCurrentArmorHitpoints"); - - String strComponentType = getShipComponentStringType(objComponent); - int armorfactor = 2; - - if (strComponentType.equals("armor")) - { - armorfactor = 1; - } - - float fltArmor = dctParams.getFloat("fltMaximumArmorHitpoints"); - float fltArmorMod = dctParams.getFloat("fltMaximumArmorHitpointsMod"); - - fltArmor = getBellValue(fltArmor, fltArmorMod); - setComponentCurrentArmorHitpoints(objComponent, fltArmor); - setComponentMaximumArmorHitpoints(objComponent, fltArmor); - setComponentMaximumConduitHitpoints(objComponent, fltArmor); - setComponentCurrentConduitHitpoints(objComponent, fltArmor); - setComponentCurrentHitpoints(objComponent, fltArmor); - setComponentMaximumHitpoints(objComponent, fltArmor); - - setComponentMass(objComponent, fltMass); - setComponentEnergyMaintenance(objComponent, fltEnergyMaintenance); - - setComponentEnergyEfficiency(objComponent, fltEfficiency); - setComponentGeneralEfficiency(objComponent, fltEfficiency); - - return objComponent; - } - - - public static int getReverseEngineeringLevel(obj_id objComponent) throws InterruptedException - { - if (hasObjVar(objComponent, "character.builder")) - { - return SCRIPT_CONTINUE; - } - - String strComponentType = getShipComponentStringType(objComponent); - - LOG("CARGO_HOLD", "COMPONENT IS OF TYPE "+ strComponentType); - - if ((strComponentType != null) && (!strComponentType.equals(""))) - { - dictionary dctParams = dataTableGetRow("datatables/ship/components/"+ strComponentType + ".iff", getTemplateName(objComponent)); - - if (dctParams == null) - { - LOG("ERROR", "TEMPLATE OF TYPE "+ getTemplateName(objComponent) + " HAS BEEN PASSED TO SETUP SPACE COMPONENT. THIS DOES NOT EXIST IN THE DATATBLE of "+ "datatables/ship/components/"+ strComponentType + ".iff"); - return 0; - } - return dctParams.getInt("reverseEngineeringLevel"); - } - else - { - LOG("space", "MEGA FUCKUP WITH "+ objComponent + " template is "+ objComponent); - } - return 0; - } - - - public static obj_id initializeSpaceShipComponent(obj_id objComponent) throws InterruptedException - { - - String strComponentType = getShipComponentStringType(objComponent); - - if (strComponentType == null) - { - LOG("space", "MAJOR FUCKUP! "+ objComponent + " is 9 kinds of fucked up"); - setName(objComponent, "BAD COMPONENT: "+ getTemplateName(objComponent) + " : PLEASE REPORT BUG"); - return null; - } - - if (!strComponentType.equals("")) - { - - dictionary dctParams = dataTableGetRow("datatables/ship/components/"+ strComponentType + ".iff", getTemplateName(objComponent)); - - if (dctParams == null) - { - LOG("ERROR", "TEMPLATE OF TYPE "+ getTemplateName(objComponent) + " HAS BEEN PASSED TO SETUP SPACE COMPONENT. THIS DOES NOT EXIST IN THE DATATBLE of "+ "datatables/ship/components/"+ strComponentType + ".iff"); - - return null; - } - - objComponent = setupStandardStatistics(objComponent, dctParams); - - if (strComponentType.equals("armor")) - { - - } - else if (strComponentType.equals("booster")) - { - float fltCurrentEnergy = dctParams.getFloat("fltCurrentEnergy"); - - float fltMaximumEnergyModifier = dctParams.getFloat("fltMaximumEnergyModifier"); - float fltMaximumEnergy = dctParams.getFloat("fltMaximumEnergy"); - float fltRoll = rand(-1 * fltMaximumEnergyModifier, fltMaximumEnergyModifier); - - fltMaximumEnergy = fltMaximumEnergy + fltRoll; - fltCurrentEnergy = fltCurrentEnergy + fltRoll; - - setBoosterMaximumEnergy(objComponent, fltMaximumEnergy); - setBoosterCurrentEnergy(objComponent, fltCurrentEnergy); - - float fltRechargeRateModifier = dctParams.getFloat("fltRechargeRateModifier"); - float fltRechargeRate = dctParams.getFloat("fltRechargeRate"); - - fltRechargeRate = getBellValue(fltRechargeRate, fltRechargeRateModifier); - - setBoosterEnergyRechargeRate(objComponent, fltRechargeRate); - - float fltConsumptionRateModifier = dctParams.getFloat("fltConsumptionRateModifier"); - float fltConsumptionRate = dctParams.getFloat("fltConsumptionRate"); - - fltConsumptionRate = getBellValue(fltConsumptionRate, fltConsumptionRateModifier); - - setBoosterEnergyConsumptionRate(objComponent, fltConsumptionRate); - - float fltAccelerationModifier = dctParams.getFloat("fltAccelerationModifier"); - float fltAcceleration = dctParams.getFloat("fltAcceleration"); - - fltAcceleration = getBellValue(fltAcceleration, fltAccelerationModifier); - - setBoosterAcceleration(objComponent, fltAcceleration); - - float fltMaxSpeedModifier = dctParams.getFloat("fltMaxSpeedModifier"); - float fltMaxSpeed = dctParams.getFloat("fltMaxSpeed"); - - fltMaxSpeed = getBellValue(fltMaxSpeed, fltMaxSpeedModifier); - - setBoosterMaximumSpeed(objComponent, fltMaxSpeed); - } - else if (strComponentType.equals("cargo_hold")) - { - int intCargoHoldCapacity = dctParams.getInt("intCargoHoldCapacity"); - - setCargoHoldMaxCapacity(objComponent, intCargoHoldCapacity); - } - else if (strComponentType.equals("droid_interface")) - { - float fltCommandSpeedModifier = dctParams.getFloat("fltCommandSpeedModifier"); - float fltCommandSpeed = dctParams.getFloat("fltCommandSpeed"); - - fltCommandSpeed = getBellValue(fltCommandSpeed, fltCommandSpeedModifier); - - setDroidInterfaceCommandSpeed(objComponent, fltCommandSpeed); - } - else if (strComponentType.equals("engine")) - { - float fltMaxSpeedModifier = dctParams.getFloat("fltMaxSpeedModifier"); - float fltMaxSpeed = dctParams.getFloat("fltMaxSpeed"); - - fltMaxSpeed = getBellValue(fltMaxSpeed, fltMaxSpeedModifier); - - setEngineMaximumSpeed(objComponent, fltMaxSpeed); - - float fltMaxPitchModifier = dctParams.getFloat("fltMaxPitchModifier"); - float fltMaxPitch = dctParams.getFloat("fltMaxPitch"); - - fltMaxPitch = getBellValue(fltMaxPitch, fltMaxPitchModifier); - - setEngineMaximumPitch(objComponent, fltMaxPitch); - - float fltMaxRollModifier = dctParams.getFloat("fltMaxRollModifier"); - float fltMaxRoll = dctParams.getFloat("fltMaxRoll"); - - fltMaxRoll = getBellValue(fltMaxRoll, fltMaxRollModifier); - - setEngineMaximumRoll(objComponent, fltMaxRoll); - - float fltMaxYawModifier = dctParams.getFloat("fltMaxYawModifier"); - float fltMaxYaw = dctParams.getFloat("fltMaxYaw"); - - fltMaxYaw = getBellValue(fltMaxYaw, fltMaxYawModifier); - - setEngineMaximumYaw(objComponent, fltMaxYaw); - } - else if (strComponentType.equals("reactor")) - { - float fltEnergyGenerationModifier = dctParams.getFloat("fltEnergyGenerationModifier"); - float fltEnergyGeneration = dctParams.getFloat("fltEnergyGeneration"); - - fltEnergyGeneration = getBellValue(fltEnergyGeneration, fltEnergyGenerationModifier); - - setReactorEnergyGeneration(objComponent, fltEnergyGeneration); - } - else if (strComponentType.equals("shield")) - { - float fltShieldHitpointsMaximumFrontModifier = dctParams.getFloat("fltShieldHitpointsMaximumFrontModifier"); - float fltShieldHitpointsMaximumFront = dctParams.getFloat("fltShieldHitpointsMaximumFront"); - - fltShieldHitpointsMaximumFront = getBellValue(fltShieldHitpointsMaximumFront, fltShieldHitpointsMaximumFrontModifier); - - float fltShieldHitpointsMaximumBackModifier = dctParams.getFloat("fltShieldHitpointsMaximumBackModifier"); - float fltShieldHitpointsMaximumBack = dctParams.getFloat("fltShieldHitpointsMaximumFront"); - - fltShieldHitpointsMaximumBack = getBellValue(fltShieldHitpointsMaximumBack, fltShieldHitpointsMaximumBackModifier); - - setShieldGeneratorCurrentFrontHitpoints(objComponent, 0f); - setShieldGeneratorCurrentBackHitpoints(objComponent, 0f); - - setShieldGeneratorMaximumFrontHitpoints(objComponent, fltShieldHitpointsMaximumFront); - setShieldGeneratorMaximumBackHitpoints(objComponent, fltShieldHitpointsMaximumBack); - float fltShieldRechargeRateModifier = dctParams.getFloat("fltShieldRechargeRateModifier"); - float fltShieldRechargeRate = dctParams.getFloat("fltShieldRechargeRate"); - - fltShieldRechargeRate = getBellValue(fltShieldRechargeRate, fltShieldRechargeRateModifier); - - setShieldGeneratorRechargeRate(objComponent, fltShieldRechargeRate); - } - else if (strComponentType.equals("weapon")) - { - float fltMinDamageModifier = dctParams.getFloat("fltMinDamageModifier"); - float fltMinDamage = dctParams.getFloat("fltMinDamage"); - - fltMinDamage = getBellValue(fltMinDamage, fltMinDamageModifier); - - setWeaponMinimumDamage(objComponent, fltMinDamage); - - float fltMaxDamageModifier = dctParams.getFloat("fltMaxDamageModifier"); - float fltMaxDamage = dctParams.getFloat("fltMaxDamage"); - - fltMaxDamage = getBellValue(fltMaxDamage, fltMaxDamageModifier); - - setWeaponMaximumDamage(objComponent, fltMaxDamage); - - float fltShieldEffectivenessModifier = dctParams.getFloat("fltShieldEffectivenessModifier"); - float fltShieldEffectiveness = dctParams.getFloat("fltShieldEffectiveness"); - - fltShieldEffectiveness = getBellValue(fltShieldEffectiveness, fltShieldEffectivenessModifier); - - setWeaponShieldEffectiveness(objComponent, fltShieldEffectiveness); - - float fltArmorEffectivenessModifier = dctParams.getFloat("fltArmorEffectivenessModifier"); - float fltArmorEffectiveness = dctParams.getFloat("fltArmorEffectiveness"); - - fltArmorEffectiveness = getBellValue(fltArmorEffectiveness, fltArmorEffectivenessModifier); - - setWeaponArmorEffectiveness(objComponent, fltArmorEffectiveness); - - float fltEnergyPerShotModifier = dctParams.getFloat("fltEnergyPerShotModifier"); - float fltEnergyPerShot = dctParams.getFloat("fltEnergyPerShot"); - - fltEnergyPerShot = getBellValue(fltEnergyPerShot, fltEnergyPerShotModifier); - - setWeaponEnergyPerShot(objComponent, fltEnergyPerShot); - - float fltRefireRateModifier = dctParams.getFloat("fltRefireRateModifier"); - float fltRefireRate = dctParams.getFloat("fltRefireRate"); - - fltRefireRate = getBellValue(fltRefireRate, fltRefireRateModifier); - - setWeaponRefireRate(objComponent, fltRefireRate); - } - else if (strComponentType.equals("capacitor")) - { - float fltCurrentEnergy = dctParams.getFloat("fltCurrentEnergy"); - float fltMaxEnergyModifier = dctParams.getFloat("fltMaxEnergyModifier"); - float fltMaxEnergy = dctParams.getFloat("fltMaxEnergy"); - - fltMaxEnergy = getBellValue(fltMaxEnergy, fltMaxEnergyModifier); - - setWeaponCapacitorMaximumEnergy(objComponent, fltMaxEnergy); - setWeaponCapacitorCurrentEnergy(objComponent, fltMaxEnergy); - - float fltRechargeRateModifier = dctParams.getFloat("fltRechargeRateModifier"); - float fltRechargeRate = dctParams.getFloat("fltRechargeRate"); - - fltRechargeRate = getBellValue(fltRechargeRate, fltRechargeRateModifier); - - setWeaponCapacitorRechargeRate(objComponent, fltRechargeRate); - } - - return objComponent; - } - else - { - return objComponent; - } - } - - - public static void uninstallAll(obj_id ship) throws InterruptedException - { - if (isIdValid(ship)) - { - for (int i = 0; i < ship_chassis_slot_type.SCST_num_types; i++) - { - testAbortScript(); - if (isShipSlotInstalled(ship, i)) - { - obj_id kill = shipUninstallComponent(null, ship, i, null); - } - } - } - } - - - public static boolean setComponentCurrentHitpoints(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.hitpoints_current"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setComponentMaximumHitpoints(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.hitpoints_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setComponentCurrentArmorHitpoints(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.armor_hitpoints_current"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setComponentMaximumArmorHitpoints(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.armor_hitpoints_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setComponentGeneralEfficiency(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.efficiency_general"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setComponentEnergyEfficiency(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.efficiency_energy"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setComponentEnergyMaintenance(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.energy_maintenance_requirement"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setComponentMass(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.mass"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setComponentCurrentConduitHitpoints(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.conduit_hitpoints_current"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setComponentMaximumConduitHitpoints(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.conduit_hitpoints_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setBoosterCurrentEnergy(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.energy_current"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setBoosterMaximumEnergy(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.energy_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setBoosterEnergyRechargeRate(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.energy_recharge_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setBoosterEnergyConsumptionRate(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.energy_consumption_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setBoosterAcceleration(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.acceleration"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setBoosterMaximumSpeed(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.speed_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setCargoHoldMaxCapacity(obj_id objComponent, int intValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.cargo_hold.contents_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, intValue); - } - - - public static boolean setCargoHoldCurrentContents(obj_id objComponent, int intValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.cargo_hold.contents_current"; - - return setObjVar(objComponent, OBJVAR_NAME, intValue); - } - - - public static boolean setWeaponCapacitorCurrentEnergy(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.capacitor.energy_current"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setWeaponCapacitorMaximumEnergy(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.capacitor.energy_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setWeaponCapacitorRechargeRate(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.capacitor.energy_recharge_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setDroidInterfaceCommandSpeed(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.droid_interface.command_speed"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineAcceleration(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.acceleration_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineDeceleration(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.deceleration_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEnginePitch(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.pitch_acceleration_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineYaw(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.yaw_acceleration_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineRoll(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.roll_acceleration_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineSpeedRotationFactorMaximum(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.speed_rotation_factor_max"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineSpeedRotationFactorMinimum(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.speed_rotation_factor_min"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineSpeedRotationFactorOptimal(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.speed_rotation_factor_optimal"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineMaximumPitch(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.pitch_rate_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineMaximumYaw(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.yaw_rate_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineMaximumRoll(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.roll_rate_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setEngineMaximumSpeed(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.speed_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setReactorEnergyGeneration(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.reactor.energy_generation_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setShieldGeneratorCurrentFrontHitpoints(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.shield.hitpoints_front_current"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setShieldGeneratorMaximumFrontHitpoints(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.shield.hitpoints_front_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setShieldGeneratorCurrentBackHitpoints(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.shield.hitpoints_back_current"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setShieldGeneratorMaximumBackHitpoints(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.shield.hitpoints_back_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setShieldGeneratorRechargeRate(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.shield.recharge_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setWeaponMaximumDamage(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.damage_maximum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setWeaponMinimumDamage(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.damage_minimum"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setWeaponShieldEffectiveness(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.effectiveness_shields"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setWeaponArmorEffectiveness(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.effectiveness_armor"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setWeaponEnergyPerShot(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.energy_per_shot"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setWeaponRefireRate(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.refire_rate"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static boolean setWeaponProjectileSpeed(obj_id objComponent, float fltValue) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.projectile_speed"; - - return setObjVar(objComponent, OBJVAR_NAME, fltValue); - } - - - public static float getComponentCurrentHitpoints(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.hitpoints_current"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getComponentMaximumHitpoints(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.hitpoints_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getComponentCurrentArmorHitpoints(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.armor_hitpoints_current"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getComponentMaximumArmorHitpoints(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.armor_hitpoints_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getComponentEnergyEfficiency(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.efficiency_energy"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getComponentGeneralEfficiency(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.efficiency_general"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getComponentEnergyMaintenance(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.energy_maintenance_requirement"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getComponentMass(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.mass"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getComponentCurrentConduitHitpoints(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.conduit_hitpoints_current"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getComponentMaximumConduitHitpoints(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.conduit_hitpoints_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getBoosterCurrentEnergy(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.energy_current"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getBoosterMaximumEnergy(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.energy_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getBoosterEnergyRechargeRate(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.energy_recharge_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getboosterEnergyConsumptionRate(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.energy_consumption_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getBoosterAcceleration(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.acceleration"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getBoosterMaximumSpeed(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.booster.speed_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getWeaponCapacitorCurrentEnergy(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.capacitor.energy_current"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getWeaponCapacitorMaximumEnergy(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.capacitor.energy_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getWeaponCapacitorRechargeRate(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.capacitor.energy_recharge_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getDroidInterfaceCommandSpeed(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.droid_interface.command_speed"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineAcceleration(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.acceleration_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineDeceleration(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.deceleration_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEnginePitch(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.pitch_acceleration_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineYaw(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.yaw_acceleration_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineRoll(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.roll_acceleration_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineSpeedRotationFactorMaximum(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.speed_rotation_factor_max"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineSpeedRotationFactorMinimum(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.speed_rotation_factor_min"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineSpeedRotationFactorOptimal(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.speed_rotation_factor_optimal"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineMaximumPitch(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.pitch_rate_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineMaximumYaw(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.yaw_rate_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineMaximumRoll(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.roll_rate_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getEngineMaximumSpeed(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.engine.speed_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getReactorEnergyGeneration(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.reactor.energy_generation_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getShieldGeneratorCurrenFrontHitpointst(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.shield.hitpoints_front_current"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getShieldGeneratorMaximumFrontHitpoints(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.shield.hitpoints_front_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getShieldGeneratorCurrentBackHitpoints(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.shield.hitpoints_back_current"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getShieldGeneratorMaximumBackHitpoints(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.shield.hitpoints_back_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getShieldGeneratorRechargeRate(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.shield.recharge_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getWeaponMaximumDamage(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.damage_maximum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getWeaponMinimumDamage(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.damage_minimum"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getWeaponShieldEffectiveness(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.effectiveness_shields"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getWeaponArmorEffectiveness(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.effectiveness_armor"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getWeaponEnergyPerShot(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.energy_per_shot"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getWeaponRefireRate(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.refire_rate"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static float getWeaponProjectileSpeed(obj_id objComponent) throws InterruptedException - { - String OBJVAR_NAME = "ship_comp.weapon.projectile_speed"; - - return getFloatObjVar(objComponent, OBJVAR_NAME); - } - - - public static Vector getRepairKitsForItem(obj_id objPlayer, int intSlot) throws InterruptedException - { - String strComponent = ""; - - if (intSlot == CHASSIS) - { - strComponent = "chassis"; - } - else if (intSlot == PLASMA_CONDUIT) - { - strComponent = "plasma_conduit"; - } - else - { - int intType = ship_chassis_slot_type.getComponentTypeForSlot(intSlot); - - strComponent = getShipComponentStringType(intType); - LOG("space", "strComponent is "+ strComponent); - } - - return getRepairKitsForItem(objPlayer, strComponent); - } - - - public static Vector getRepairKitsForItem(obj_id objPlayer, String strComponent) throws InterruptedException - { - obj_id[] objContents = getInventoryAndEquipment(objPlayer); - Vector objKits = new Vector(); - - for (int intI = 0; intI < objContents.length; intI++) - { - testAbortScript(); - if (hasObjVar(objContents[intI], "strKitType")) - { - String strKitType = getStringObjVar(objContents[intI], "strKitType"); - - if ((strKitType.equals(strComponent)) || (strKitType.equals("all_purpose"))) - { - objKits = utils.addElement(objKits, objContents[intI]); - } - } - } - - if (objKits.size() > 0) - { - return objKits; - } - - return null; - } - - - public static boolean repairComponentOnShip(int intSlot, Vector objRepairKits, obj_id objPlayer, obj_id objShip) throws InterruptedException - { - - if ((objRepairKits == null) || (objRepairKits.size() < 1)) - { - return false; - } - - boolean boolHealed = false; - - String strComponent = ""; - - if (intSlot == CHASSIS) - { - strComponent = "chassis"; - } - else - { - strComponent = getShipComponentStringType(intSlot); - } - - obj_id objRepairKit = ((obj_id)(objRepairKits.get(0))); - - if (intSlot == CHASSIS) - { - - float fltMaximumHitpoints = getShipMaximumChassisHitPoints(objShip); - float fltCurrentHitpoints = getShipCurrentChassisHitPoints(objShip); - - if (fltCurrentHitpoints == fltMaximumHitpoints) - { - - string_id strSpam = new string_id("space/space_interaction", "no_damage_to_repair"); - - sendSystemMessage(objPlayer, strSpam); - return false; - } - else - { - float fltDifference = fltMaximumHitpoints - fltCurrentHitpoints; - float fltRemainingRepairPoints = (float) getCount(objRepairKit); - - if (fltDifference > fltRemainingRepairPoints) - { - - fltCurrentHitpoints = fltCurrentHitpoints + fltRemainingRepairPoints; - - setShipCurrentChassisHitPoints(objShip, fltCurrentHitpoints); - - string_id strSpam = new string_id("space/space_interaction", "repaired_x_chassis_damage_destroy_kit"); - prose_package ppRepairInfo = prose.getPackage(strSpam, (int) fltRemainingRepairPoints); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - destroyObject(objRepairKit); - - objRepairKits = utils.removeElementAt(objRepairKits, 0); - - if (objRepairKits.size() > 0) - { - repairComponentOnShip(intSlot, objRepairKits, objPlayer, objShip); - return true; - } - else - { - strSpam = new string_id("space/space_interaction", "damage_left_chassis"); - int intDifference = (int) fltDifference - (int) fltRemainingRepairPoints; - - ppRepairInfo = prose.getPackage(strSpam, intDifference); - sendSystemMessageProse(objPlayer, ppRepairInfo); - return true; - } - - } - else - { - fltCurrentHitpoints = fltCurrentHitpoints + fltDifference; - setShipCurrentChassisHitPoints(objShip, fltCurrentHitpoints); - - string_id strSpam = new string_id("space/space_interaction", "repaired_x_chassis_damage"); - prose_package ppRepairInfo = prose.getPackage(strSpam, (int) fltDifference); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - fltRemainingRepairPoints = fltRemainingRepairPoints - fltDifference; - setCount(objRepairKit, (int) fltRemainingRepairPoints); - - return true; - } - } - } - - float fltMaximumHitpoints = getShipComponentHitpointsMaximum(objShip, intSlot); - float fltCurrentHitpoints = getShipComponentHitpointsCurrent(objShip, intSlot); - - float fltMaximumArmorHitpoints = getShipComponentArmorHitpointsMaximum(objShip, intSlot); - float fltCurrentArmorHitpoints = getShipComponentArmorHitpointsCurrent(objShip, intSlot); - - float fltEnergyEfficiency = getShipComponentEfficiencyEnergy(objShip, intSlot); - float fltGeneralEfficiency = getShipComponentEfficiencyGeneral(objShip, intSlot); - - if ((fltCurrentHitpoints == fltMaximumHitpoints) && (fltMaximumArmorHitpoints == fltCurrentArmorHitpoints)) - { - string_id strSpam = new string_id("space/space_interaction", "no_damage_to_repair"); - - sendSystemMessage(objPlayer, strSpam); - return false; - } - - float fltRemainingRepairPoints = (float) getCount(objRepairKit); - float fltDifference = fltMaximumHitpoints - fltCurrentHitpoints; - - if (fltDifference > fltRemainingRepairPoints) - { - - fltCurrentHitpoints = fltCurrentHitpoints + fltRemainingRepairPoints; - - setShipComponentHitpointsCurrent(objShip, intSlot, fltCurrentHitpoints); - - string_id strSpam = new string_id("space/space_interaction", "repaired_x_component_damage_destroy_kit"); - prose_package ppRepairInfo = prose.getPackage(strSpam, getShipComponentName(objShip, intSlot), (int) fltRemainingRepairPoints); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - destroyObject(objRepairKit); - space_utils.setComponentDisabled(objShip, intSlot, false); - space_combat.recalculateEfficiency(intSlot, objShip); - objRepairKits = utils.removeElementAt(objRepairKits, 0); - - if (objRepairKits.size() > 0) - { - repairComponentOnShip(intSlot, objRepairKits, objPlayer, objShip); - return true; - } - else - { - strSpam = new string_id("space/space_interaction", "damage_left_component"); - int intDifference = (int) fltDifference - (int) fltRemainingRepairPoints; - - ppRepairInfo = prose.getPackage(strSpam, intDifference); - sendSystemMessageProse(objPlayer, ppRepairInfo); - return true; - } - } - else if (fltDifference > 0) - { - - setShipComponentHitpointsCurrent(objShip, intSlot, fltMaximumHitpoints); - - string_id strSpam = new string_id("space/space_interaction", "repaired_x_component_damage"); - prose_package ppRepairInfo = prose.getPackage(strSpam, getShipComponentName(objShip, intSlot), (int) fltDifference); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - fltRemainingRepairPoints = fltRemainingRepairPoints - fltDifference; - setCount(objRepairKit, (int) fltRemainingRepairPoints); - space_utils.setComponentDisabled(objShip, intSlot, false); - space_combat.recalculateEfficiency(intSlot, objShip); - boolHealed = true; - } - - fltDifference = fltMaximumArmorHitpoints - fltCurrentArmorHitpoints; - - if (fltDifference > fltRemainingRepairPoints) - { - - fltCurrentHitpoints = fltCurrentHitpoints + fltRemainingRepairPoints; - setShipComponentArmorHitpointsCurrent(objShip, intSlot, fltCurrentHitpoints); - - string_id strSpam = new string_id("space/space_interaction", "repaired_x_armor_component_damage_destroy_kit"); - prose_package ppRepairInfo = prose.getPackage(strSpam, getShipComponentName(objShip, intSlot), (int) fltRemainingRepairPoints); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - destroyObject(objRepairKit); - space_utils.setComponentDisabled(objShip, intSlot, false); - space_combat.recalculateEfficiency(intSlot, objShip); - objRepairKits = utils.removeElementAt(objRepairKits, 0); - - if (objRepairKits.size() > 0) - { - repairComponentOnShip(intSlot, objRepairKits, objPlayer, objShip); - return true; - } - else - { - strSpam = new string_id("space/space_interaction", "damage_left_component_armor"); - int intDifference = (int) fltDifference - (int) fltRemainingRepairPoints; - - ppRepairInfo = prose.getPackage(strSpam, intDifference); - sendSystemMessageProse(objPlayer, ppRepairInfo); - return true; - } - - } - else if (fltDifference > 0) - { - - setShipComponentArmorHitpointsCurrent(objShip, intSlot, fltMaximumArmorHitpoints); - - string_id strSpam = new string_id("space/space_interaction", "repaired_x_armor_component_damage"); - prose_package ppRepairInfo = prose.getPackage(strSpam, getShipComponentName(objShip, intSlot), (int) fltDifference); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - fltRemainingRepairPoints = fltRemainingRepairPoints - fltDifference; - setCount(objRepairKit, (int) fltRemainingRepairPoints); - space_utils.setComponentDisabled(objShip, intSlot, false); - space_combat.recalculateEfficiency(intSlot, objShip); - boolHealed = true; - } - - return boolHealed; - } - - - public static boolean repairComponentInInventory(obj_id objComponent, Vector objRepairKits, obj_id objPlayer) throws InterruptedException - { - - if ((objRepairKits == null) || (objRepairKits.size() < 1)) - { - return false; - } - - obj_id objRepairKit = ((obj_id)(objRepairKits.get(0))); - boolean boolHealed = false; - String strComponent = getShipComponentStringType(objComponent); - - float fltMaximumHitpoints = getComponentMaximumHitpoints(objComponent); - float fltCurrentHitpoints = getComponentCurrentHitpoints(objComponent); - - float fltMaximumArmorHitpoints = getComponentMaximumArmorHitpoints(objComponent); - float fltCurrentArmorHitpoints = getComponentCurrentArmorHitpoints(objComponent); - - float fltEnergyEfficiency = getComponentEnergyEfficiency(objComponent); - float fltGeneralEfficiency = getComponentGeneralEfficiency(objComponent); - - if ((fltCurrentHitpoints == fltMaximumHitpoints) && (fltMaximumArmorHitpoints == fltCurrentArmorHitpoints)) - { - string_id strSpam = new string_id("space/space_interaction", "no_damage_to_repair"); - - sendSystemMessage(objPlayer, strSpam); - return false; - } - - float fltRemainingRepairPoints = (float) getCount(objRepairKit); - float fltDifference = fltMaximumHitpoints - fltCurrentHitpoints; - - if (fltDifference > fltRemainingRepairPoints) - { - - fltCurrentHitpoints = fltCurrentHitpoints + fltRemainingRepairPoints; - setComponentCurrentHitpoints(objComponent, fltCurrentHitpoints); - clearComponentDisabledFlag(objComponent); - - string_id strSpam = new string_id("space/space_interaction", "repaired_x_component_damage_destroy_kit"); - prose_package ppRepairInfo = prose.getPackage(strSpam, getEncodedName(objComponent), (int) fltRemainingRepairPoints); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - objRepairKits = utils.removeElementAt(objRepairKits, 0); - destroyObject(objRepairKit); - repairComponentInInventory(objComponent, objRepairKits, objPlayer); - return true; - } - else if (fltDifference > 0) - { - - setComponentCurrentHitpoints(objComponent, fltMaximumHitpoints); - clearComponentDisabledFlag(objComponent); - string_id strSpam = new string_id("space/space_interaction", "repaired_x_component_damage"); - prose_package ppRepairInfo = prose.getPackage(strSpam, getEncodedName(objComponent), (int) fltDifference); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - fltRemainingRepairPoints = fltRemainingRepairPoints - fltDifference; - setCount(objRepairKit, (int) fltRemainingRepairPoints); - boolHealed = true; - } - - fltDifference = fltMaximumArmorHitpoints - fltCurrentArmorHitpoints; - - if (fltDifference > fltRemainingRepairPoints) - { - - fltCurrentArmorHitpoints = fltCurrentArmorHitpoints + fltRemainingRepairPoints; - setComponentCurrentArmorHitpoints(objComponent, fltCurrentArmorHitpoints); - - string_id strSpam = new string_id("space/space_interaction", "repaired_x_armor_component_damage_destroy_kit"); - prose_package ppRepairInfo = prose.getPackage(strSpam, getEncodedName(objComponent), (int) fltRemainingRepairPoints); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - objRepairKits = utils.removeElementAt(objRepairKits, 0); - destroyObject(objRepairKit); - repairComponentInInventory(objComponent, objRepairKits, objPlayer); - return true; - } - else if (fltDifference > 0) - { - - setComponentCurrentArmorHitpoints(objComponent, fltMaximumArmorHitpoints); - - string_id strSpam = new string_id("space/space_interaction", "repaired_x_armor_component_damage"); - prose_package ppRepairInfo = prose.getPackage(strSpam, getEncodedName(objComponent), (int) fltDifference); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - fltRemainingRepairPoints = fltRemainingRepairPoints - fltDifference; - setCount(objRepairKit, (int) fltRemainingRepairPoints); - boolHealed = true; - } - return boolHealed; - } - - - public static boolean isRepairKit(obj_id objItem) throws InterruptedException - { - String strTest = getTemplateName(objItem); - int intIndex = strTest.indexOf("object/tangible/ship/crafted/repair"); - - if (intIndex < 0) - { - return false; - } - - return true; - } - - - public static obj_id getDroidContainer(obj_id objShip) throws InterruptedException - { - return getObjectInSlot(objShip, SHIP_DROID_SLOT_NAME); - } - - - public static obj_id[] getDatapadDroidCommands(obj_id objControlDevice) throws InterruptedException - { - obj_id objDatapad = utils.getDatapad(objControlDevice); - - if (!isIdValid(objDatapad)) - { - debugServerConsoleMsg(null, "SPACE_CRAFTING.getDatapadDroidCommands *** DATAPAD OBJ-ID WAS NULL!!! ARGH! "); - return null; - } - - obj_id[] objContents = utils.getContents(objDatapad); - Vector objCommands = new Vector(); - objCommands.setSize(0); - - for (int intI = 0; intI < objContents.length; intI++) - { - testAbortScript(); - if (hasObjVar(objContents[intI], "strDroidCommand")) - { - objCommands = utils.addElement(objCommands, objContents[intI]); - } - } - - if (objCommands.size() > 0) - { - obj_id[] _objCommands = new obj_id[0]; - if (objCommands != null) - { - _objCommands = new obj_id[objCommands.size()]; - objCommands.toArray(_objCommands); - } - return _objCommands; - } - else - { - return null; - } - } - - - public static int getDroidCommandLevelFromDatapad(obj_id objControlDevice) throws InterruptedException - { - obj_id objDatapad = utils.getDatapad(objControlDevice); - - if (!isIdValid(objDatapad)) - { - return 1; - } - - String strName = getTemplateName(objDatapad); - String strRaw = "object/tangible/datapad/droid_datapad_"; - - for (int intI = 1; intI <= 6; intI++) - { - testAbortScript(); - String strTest = strRaw + intI + ".iff"; - - if (strName.equals(strTest)) - { - return intI; - } - } - - return -1; - } - - - public static boolean isUsableAstromechPet(obj_id objControlDevice) throws InterruptedException - { - int intDroidLevel = getDroidCommandLevelFromDatapad(objControlDevice); - - if (intDroidLevel == -1) - { - return false; - } - - String[] strDroidTypes = - { - "r2", - "r2_crafted", - "r2d2", - "r3", - "r3_crafted", - "r4", - "r4_crafted", - "r5", - "r5_crafted", - "navicomputer_1", - "navicomputer_2", - "navicomputer_3", - "navicomputer_4", - "navicomputer_5", - "navicomputer_6", - }; - - String strName = getStringObjVar(objControlDevice, "pet.creatureName"); - - if (strName != null) - { - int intIndex = utils.getElementPositionInArray(strDroidTypes, strName); - - LOG("space", "intIndex: "+ intIndex + " strName: "+ strName); - - if (intIndex > -1) - { - return true; - } - } - else - { - if (hasObjVar(objControlDevice, "item.objectName")) - { - strName = getStringObjVar(objControlDevice, "item.objectName"); - int intIndex = utils.getElementPositionInArray(strDroidTypes, strName); - - LOG("space", "intIndex: "+ intIndex + " strName: "+ strName); - - if (intIndex > -1) - { - return true; - } - } - else - { - LOG("space", "NULL!"); - } - } - return false; - } - - - public static boolean isFlightComputerController(obj_id controlDevice) throws InterruptedException - { - String[] computerTypes = - { - "navicomputer_1", - "navicomputer_2", - "navicomputer_3", - "navicomputer_4", - "navicomputer_5", - "navicomputer_6", - }; - - if (hasObjVar(controlDevice, "item.objectName")) - { - String name = getStringObjVar(controlDevice, "item.objectName"); - int intIndex = utils.getElementPositionInArray(computerTypes, name); - - if (intIndex > -1) - { - return true; - } - } - - return false; - } - - - public static boolean isCertifiedForAstromech(obj_id objControlDevice, obj_id objPlayer) throws InterruptedException - { - - int intDroidLevel = getDroidCommandLevelFromDatapad(objControlDevice); - - LOG("space", "level is "+ intDroidLevel + " Looking for command cert_droid_astromech_"+ intDroidLevel); - - if (!hasCommand(objPlayer, "cert_droid_astromech_" + intDroidLevel)) - { - LOG("space", objPlayer + " doesnt have the cert!"); - return false; - } - - return true; - } - - - public static obj_id getAstromechDroidForShip(obj_id objPlayer) throws InterruptedException - { - obj_id objDataPad = utils.getDatapad(objPlayer); - - obj_id[] objContents = utils.getContents(objDataPad); - - if (objContents == null) - { - return null; - } - - for (int intI = 0; intI < objContents.length; intI++) - { - testAbortScript(); - - if (hasObjVar(objContents[intI], "objActiveShipDroid")) - { - obj_id objTest = getObjIdObjVar(objContents[intI], "objActiveShipDroid"); - - if (objTest != objPlayer) - { - - removeObjVar(objTest, "objActiveShipDroid"); - } - else - { - return objContents[intI]; - } - } - } - return null; - } - - - public static boolean isUsingCorrectComputer(obj_id objControlDevice, obj_id ship) throws InterruptedException - { - if (!usesFlightComputerNotAstromech(ship) && hasObjVar(objControlDevice, "pet.creatureName")) - { - return true; - } - else if (usesFlightComputerNotAstromech(ship) && !hasObjVar(objControlDevice, "pet.creatureName")) - { - return true; - } - - return false; - } - - - public static boolean usesFlightComputerNotAstromech(obj_id ship) throws InterruptedException - { - - String templateName = utils.getTemplateFilenameNoPath(ship); - String shipUsesThis = dataTableGetString(STARSHIP_DROID_TABLE, templateName, "usesDroidOrFlightComputer"); - - debugServerConsoleMsg(null, "+++ SPACE_CRAFTING . Got shipUsesThis. It was: "+ shipUsesThis); - - if ((shipUsesThis.equals("")) || (shipUsesThis == null)) - { - debugServerConsoleMsg(null, "SPACE_CRAFTING.usesFlightComputerNotAstromech: shipUsesThis failed out as being -1"); - return false; - } - - if (shipUsesThis.equals("flight_computer")) - { - return true; - } - - return false; - } - - - public static boolean isMissileSlot(obj_id objShip, int intSlot) throws InterruptedException - { - if (isShipSlotInstalled(objShip, intSlot)) - { - int intCrc = getShipComponentCrc(objShip, intSlot); - - return getShipComponentDescriptorWeaponIsMissile(intCrc); - } - return false; - - } - - - public static boolean isCounterMeasureSlot(obj_id objShip, int intSlot) throws InterruptedException - { - if (isShipSlotInstalled(objShip, intSlot)) - { - int intCrc = getShipComponentCrc(objShip, intSlot); - - return getShipComponentDescriptorWeaponIsCountermeasure(intCrc); - } - return false; - } - - - public static boolean isProperAmmoForWeapon(obj_id objAmmo, obj_id objShip, int intSlot) throws InterruptedException - { - - int intWeaponAmmoType = getShipWeaponAmmoType(objShip, intSlot); - int intWeaponType = getIntObjVar(objAmmo, "weapon.intAmmoType"); - - if (intWeaponAmmoType != intWeaponType) - { - return false; - } - - return true; - } - - - public static boolean applyAmmoToWeapon(obj_id objShip, obj_id objAmmo, int intSlot, obj_id objPlayer, boolean boolVerbose) throws InterruptedException - { - - int intCurrentAmmo = getShipWeaponAmmoCurrent(objShip, intSlot); - int intCount = getCount(objAmmo); - - float fltMinDamage = getFloatObjVar(objAmmo, "fltMinDamage"); - float fltMaxDamage = getFloatObjVar(objAmmo, "fltMaxDamage"); - float fltRefireRate = getFloatObjVar(objAmmo, "fltRefireRate"); - float fltWeaponEffectivenessShields = getFloatObjVar(objAmmo, "fltShieldEffectiveness"); - float fltWeaponEffectivenessArmor = getFloatObjVar(objAmmo, "fltArmorEffectiveness"); - - setShipWeaponDamageMaximum(objShip, intSlot, fltMaxDamage); - setShipWeaponDamageMinimum(objShip, intSlot, fltMinDamage); - setShipWeaponRefireRate(objShip, intSlot, fltRefireRate); - setShipWeaponEffectivenessArmor(objShip, intSlot, fltWeaponEffectivenessArmor); - setShipWeaponEffectivenessShields(objShip, intSlot, fltWeaponEffectivenessShields); - setShipWeaponAmmoMaximum(objShip, intSlot, intCount); - - setShipWeaponAmmoCurrent(objShip, intSlot, intCount); - - string_id strSpam = new string_id("space/space_interaction", "reloaded_x_missile_ammo"); - prose_package ppRepairInfo = prose.getPackage(strSpam, getName(objAmmo), (int) intCount); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - destroyObject(objAmmo); - - return true; - - } - - - public static boolean applyCountermeasuresToLauncher(obj_id objAmmo, obj_id objShip, int intSlot, obj_id objPlayer, boolean boolVerbose) throws InterruptedException - { - - int intCurrentAmmo = getShipWeaponAmmoCurrent(objShip, intSlot); - - if (intCurrentAmmo != 0) - { - if (boolVerbose) - { - - string_id strSpam = new string_id("space/space_interaction", "countermeasure_full_no_reload"); - - sendSystemMessage(objPlayer, strSpam); - } - return false; - } - - int intCount = getCount(objAmmo); - - float fltMinDamage = getFloatObjVar(objAmmo, "fltMinDamage"); - float fltMaxDamage = getFloatObjVar(objAmmo, "fltMaxDamage"); - float fltRefireRate = getFloatObjVar(objAmmo, "fltRefireRate"); - float fltEnergyPerShot = getFloatObjVar(objAmmo, "fltEnergyPerShot"); - - setShipWeaponDamageMaximum(objShip, intSlot, fltMaxDamage); - setShipWeaponDamageMinimum(objShip, intSlot, fltMinDamage); - setShipWeaponRefireRate(objShip, intSlot, fltRefireRate); - setShipWeaponAmmoMaximum(objShip, intSlot, intCount); - setShipWeaponAmmoCurrent(objShip, intSlot, intCount); - setShipWeaponEnergyPerShot(objShip, intSlot, fltEnergyPerShot); - - string_id strSpam = new string_id("space/space_interaction", "reloaded_x_countermeasure_ammo"); - prose_package ppRepairInfo = prose.getPackage(strSpam, getName(objAmmo), (int) intCount); - - sendSystemMessageProse(objPlayer, ppRepairInfo); - - destroyObject(objAmmo); - - return true; - - } - - - public static boolean isWeaponAmmo(obj_id objAmmo) throws InterruptedException - { - if (hasObjVar(objAmmo, "weapon.intAmmoType")) - { - return true; - } - return false; - } - - - public static boolean isDamaged(obj_id objPlayer) throws InterruptedException - { - float fltDamage = getDamageTotalModified(space_transition.getContainingShip(objPlayer), 1.0f); - - if (fltDamage > 0) - { - return true; - } - return false; - } - - - public static float getDamageTotal(obj_id objPlayer, obj_id objShip) throws InterruptedException - { - return getDamageTotalModified(objShip, 1.0f); - } - - - public static float getDamageTotalModified(obj_id objShip, float fltPercentage) throws InterruptedException - { - - float fltMaximumHitpoints = getShipMaximumChassisHitPoints(objShip); - float fltCurrentHitpoints = getShipCurrentChassisHitPoints(objShip); - - float fltDifference = fltMaximumHitpoints - fltCurrentHitpoints; - float fltRepairValue = 0; - - fltRepairValue = fltRepairValue + fltDifference; - int[] intSlots = getShipInstalledSlots(objShip); - - for (int intI = 0; intI < intSlots.length; intI++) - { - testAbortScript(); - - fltMaximumHitpoints = getShipComponentHitpointsMaximum(objShip, intSlots[intI]); - fltCurrentHitpoints = getShipComponentHitpointsCurrent(objShip, intSlots[intI]); - - float fltMaximumArmorHitpoints = getShipComponentArmorHitpointsMaximum(objShip, intSlots[intI]); - float fltCurrentArmorHitpoints = getShipComponentArmorHitpointsCurrent(objShip, intSlots[intI]); - - fltDifference = fltMaximumHitpoints - fltCurrentHitpoints; - fltRepairValue = fltRepairValue + fltDifference; - fltDifference = fltMaximumArmorHitpoints - fltCurrentArmorHitpoints; - fltRepairValue = fltRepairValue + fltDifference; - } - - fltRepairValue = fltRepairValue * fltPercentage; - LOG("space", "Raw damage pre % of "+ fltPercentage + "is "+ fltRepairValue + " Modified damage POst % of "+ fltPercentage + " is "+ fltRepairValue); - - return fltRepairValue; - } - - - public static boolean repairDamageToPercentage(obj_id objPlayer, obj_id objShip, float fltPercentage) throws InterruptedException - { - LOG("space", "Repairing ship of "+ objPlayer + " to "+ fltPercentage); - - if (fltPercentage > 1.0f) - { - fltPercentage = 1.0f; - } - - float fltMaximumHitpoints = getShipMaximumChassisHitPoints(objShip); - float fltCurrentHitpoints = getShipCurrentChassisHitPoints(objShip); - - float fltDifference = fltMaximumHitpoints - fltCurrentHitpoints; - - LOG("space", "Chassis difference is "+ fltDifference); - fltDifference = fltDifference * fltPercentage; - - if (fltDifference > 0) - { - fltCurrentHitpoints = fltCurrentHitpoints + fltDifference; - setShipCurrentChassisHitPoints(objShip, fltCurrentHitpoints); - } - - fltDifference = 0; - - int[] intSlots = getShipInstalledSlots(objShip); - - for (int intI = 0; intI < intSlots.length; intI++) - { - testAbortScript(); - - fltMaximumHitpoints = getShipComponentHitpointsMaximum(objShip, intSlots[intI]); - fltCurrentHitpoints = getShipComponentHitpointsCurrent(objShip, intSlots[intI]); - - float fltMaximumArmorHitpoints = getShipComponentArmorHitpointsMaximum(objShip, intSlots[intI]); - float fltCurrentArmorHitpoints = getShipComponentArmorHitpointsCurrent(objShip, intSlots[intI]); - - float fltEnergyEfficiency = getShipComponentEfficiencyEnergy(objShip, intSlots[intI]); - float fltGeneralEfficiency = getShipComponentEfficiencyGeneral(objShip, intSlots[intI]); - - fltDifference = fltMaximumHitpoints - fltCurrentHitpoints; - fltDifference = fltDifference * fltPercentage; - - LOG("space", "RAW for "+ fltDifference + " worth of points on "+ intSlots[intI] + " Repairing "+ fltDifference + " worth of points"); - - if (fltDifference > 0) - { - fltCurrentHitpoints = fltCurrentHitpoints + fltDifference; - setShipComponentHitpointsCurrent(objShip, intSlots[intI], fltCurrentHitpoints); - } - else - { - clearCondition(objShip, CONDITION_EJECT); - space_utils.setComponentDisabled(objShip, intSlots[intI], false); - } - - fltDifference = 0; - - fltDifference = fltMaximumArmorHitpoints - fltCurrentArmorHitpoints; - fltDifference = fltDifference * fltPercentage; - - LOG("space", "RAW ARMOR for "+ fltDifference + " worth of points on "+ intSlots[intI] + " Repairing "+ fltDifference + " worth of points"); - - if (fltDifference > 0) - { - fltCurrentArmorHitpoints = fltCurrentArmorHitpoints + fltDifference; - - setShipComponentArmorHitpointsCurrent(objShip, intSlots[intI], fltCurrentArmorHitpoints); - - clearCondition(objShip, CONDITION_EJECT); - space_utils.setComponentDisabled(objShip, intSlots[intI], false); - } - - space_combat.recalculateEfficiency(intSlots[intI], objShip); - } - - space_combat.normalizeAllComponents(objShip); - - return true; - } - - - public static boolean repairDamage(obj_id objPlayer, obj_id objShip, float fltPercentage) throws InterruptedException - { - LOG("space", "Calling repairDamage "); - return repairDamage(objPlayer, objShip, fltPercentage, 0.0f); - } - - - public static boolean repairDamage(obj_id objPlayer, obj_id objShip, float fltPercentage, float decayRate) throws InterruptedException - { - return repairDamageToPercentage(objPlayer, objShip, fltPercentage); - } - - - public static int[] getShipInstalledSlots(obj_id objShip) throws InterruptedException - { - int[] intRawSlots = getShipChassisSlots(objShip); - Vector intInstalledSlots = new Vector(); - intInstalledSlots.setSize(0); - - for (int intI = 0; intI < intRawSlots.length; intI++) - { - testAbortScript(); - if (isShipSlotInstalled(objShip, intRawSlots[intI])) - { - intInstalledSlots = utils.addElement(intInstalledSlots, intRawSlots[intI]); - } - } - - int[] _intInstalledSlots = new int[0]; - if (intInstalledSlots != null) - { - _intInstalledSlots = new int[intInstalledSlots.size()]; - for (int _i = 0; _i < intInstalledSlots.size(); ++_i) - { - _intInstalledSlots[_i] = ((Integer)intInstalledSlots.get(_i)).intValue(); - } - } - return _intInstalledSlots; - } - - - public static boolean canAffordShipRepairs(obj_id objPlayer, obj_id objStation, float fltPercentage) throws InterruptedException - { - obj_id objShip = space_transition.getContainingShip(objPlayer); - - if (!isIdValid(objShip)) - { - return false; - } - - float fltDamageTotal = getDamageTotal(objPlayer, objShip); - - fltDamageTotal = fltDamageTotal * fltPercentage; - float fltCostPerPoint = getFloatObjVar(objStation, "fltCostPerDamagePoint"); - - int intTotalCost = (int) (fltCostPerPoint * fltDamageTotal); - - if (space_utils.isBasicShip(objShip) || space_utils.isPrototypeShip(objShip)) - { - - intTotalCost = (int) (fltCostPerPoint * (100.0f * fltPercentage)); - } - - if (money.hasFunds(objPlayer, money.MT_TOTAL, intTotalCost)) - { - LOG("space", "CANAFFORD"); - return true; - } - - return false; - } - - - public static int getStationRepairCost(obj_id objPlayer, obj_id objStation, float fltPercentage) throws InterruptedException - { - obj_id objShip = space_transition.getContainingShip(objPlayer); - - if (!isIdValid(objShip)) - { - LOG("Space", "Returning asdsa"); - return 0; - } - - float fltDamageTotal = getDamageTotal(objPlayer, objShip); - - LOG("space", "Total 1 damage i s"+ fltDamageTotal); - float fltCostPerPoint = getFloatObjVar(objStation, "fltCostPerDamagePoint"); - - fltDamageTotal = fltDamageTotal * fltPercentage; - LOG("space", "Total damage 2 is"+ fltDamageTotal); - - int intTotalCost = (int) (fltCostPerPoint * fltDamageTotal); - - if (space_utils.isBasicShip(objShip) || space_utils.isPrototypeShip(objShip)) - { - - intTotalCost = (int) (fltCostPerPoint * (100.0f * fltPercentage)); - } - - LOG("space", "returning "+ intTotalCost); - - return intTotalCost; - } - - - public static void doStationToShipRepairs(obj_id objPlayer, obj_id objStation, float fltPercentage) throws InterruptedException - { - LOG("space", "Doing station to ship repairs"); - float fltDistance = getDistance(objStation, space_transition.getContainingShip(objPlayer)); - - if (fltDistance > space_transition.STATION_COMM_MAX_DISTANCE) - { - string_id strSpam = new string_id("space/space_interaction", "too_far"); - - sendSystemMessage(objPlayer, strSpam); - return; - } - - fixAllPlasmaConduits(space_transition.getContainingShip(objPlayer)); - doStationToShipRepairs(objPlayer, objStation, fltPercentage, 0.0f); - } - - - public static void doStationToShipRepairs(obj_id objPlayer, obj_id objStation, float fltPercentage, float decayRate) throws InterruptedException - { - obj_id objShip = space_transition.getContainingShip(objPlayer); - - LOG("space", "Doing station to ship repairs2 "); - - if (!isIdValid(objShip)) - { - return; - } - - float fltDamageTotal = getDamageTotal(objPlayer, objShip); - float fltCostPerPoint = getFloatObjVar(objStation, "fltCostPerDamagePoint"); - - fltDamageTotal = fltDamageTotal * fltPercentage; - - int intTotalCost = (int) (fltCostPerPoint * fltDamageTotal); - - if (space_utils.isBasicShip(objShip) || space_utils.isPrototypeShip(objShip)) - { - - intTotalCost = (int) (fltCostPerPoint * (100.0f * fltPercentage)); - } - - LOG("space", "Doing station to ship repairs3, charginh "+ intTotalCost); - - if (money.hasFunds(objPlayer, money.MT_TOTAL, intTotalCost)) - { - money.requestPayment(objPlayer, "SPACE_STATION_REPAIR", intTotalCost, "repairSuccess", null, false); - LOG("space", "Taking cash"); - CustomerServiceLog("space_repair", "Taking "+ intTotalCost + " from %TU for repairs", getOwner(objShip)); - repairDamage(objPlayer, objShip, fltPercentage); - } - else - { - LOG("space", "NOFUNDS"); - } - - return; - } - - - public static float getDamagePercentage(obj_id objShip, int intSlot) throws InterruptedException - { - float fltMaximumHitpoints = getShipComponentArmorHitpointsMaximum(objShip, intSlot); - - fltMaximumHitpoints = fltMaximumHitpoints + getShipComponentHitpointsMaximum(objShip, intSlot); - - float fltCurrentHitpoints = getShipComponentArmorHitpointsCurrent(objShip, intSlot); - - fltCurrentHitpoints = fltCurrentHitpoints + getShipComponentHitpointsCurrent(objShip, intSlot); - - if (fltCurrentHitpoints == 0) - { - return 0; - } - - float fltPercent = fltCurrentHitpoints / fltMaximumHitpoints; - - return fltPercent; - } - - - public static int getExtendedComponentType(String strSlot) throws InterruptedException - { - int intSlot = ship_chassis_slot_type.getTypeByName(strSlot); - - if (intSlot == ship_chassis_slot_type.SCST_num_types) - { - - if (strSlot.equals("hull")) - { - return HULL; - } - if (strSlot.equals("life_support")) - { - return LIFE_SUPPORT; - } - if (strSlot.equals("plasma_conduit")) - { - return PLASMA_CONDUIT; - } - if (strSlot.equals("ammo_bay")) - { - return AMMO_BAY; - - } - if (strSlot.equals("hyperdrive")) - { - return HYPERDRIVE; - } - } - - return intSlot; - } - - - public static String getExtendedComponentType(int intSlot) throws InterruptedException - { - String strType = ship_chassis_slot_type.getNameByType(intSlot); - - if (strType.equals("none")) - { - - if (intSlot == HULL) - { - return "hull"; - - } - if (intSlot == LIFE_SUPPORT) - { - return "life_support"; - } - if (intSlot == PLASMA_CONDUIT) - { - return "plasma_conduit"; - - } - if (intSlot == AMMO_BAY) - { - return "ammo_bay"; - } - if (intSlot == HYPERDRIVE) - { - return "hyperdrive"; - - } - return null; - } - - return strType; - } - - - public static void breakHullPanel(obj_id objPanel, obj_id objShip, location locTest, boolean boolAddToList) throws InterruptedException - { - obj_id objCell = locTest.cell; - int intHitpoints = getHitpoints(objPanel); - - if (intHitpoints == 1) - { - return; - } - - if (boolAddToList) - { - Vector locBrokenComponents = new Vector(); - locBrokenComponents.setSize(0); - - if (hasObjVar(objShip, "locBrokenCompents")) - { - locBrokenComponents = getResizeableLocationArrayObjVar(objShip, "locBrokenComponents"); - } - locBrokenComponents = utils.addElement(locBrokenComponents, locTest); - setObjVar(objShip, "locBrokenComponents", locBrokenComponents); - } - - setInvulnerableHitpoints(objPanel, 1); - - if (hasObjVar(objShip, "intHullBreached")) - { - float intDamage = getIntObjVar(objShip, "intHullBreached"); - - intDamage = intDamage + HULL_BREACH_DAMAGE; - setObjVar(objShip, "intHullBreached", intDamage); - } - else - { - setObjVar(objShip, "intHullBreached", HULL_BREACH_DAMAGE); - messageTo(objShip, "doHullBreach", null, HULL_BREACH_DAMAGE_TIMER, false); - turnOnInteriorAlarms(objShip); - string_id strSpam = new string_id("space/space_interaction", "hull_breach"); - - space_utils.sendSystemMessageShip(objShip, strSpam, true, true, true, true); - - } - - float fltDamage = 0; - - if (hasShipInternalDamageOverTime(objShip, ship_chassis_slot_type.SCST_num_types)) - { - fltDamage = getShipInternalDamageOverTimeDamageRate(objShip, ship_chassis_slot_type.SCST_num_types); - } - - fltDamage = fltDamage + 0.5f; - setShipInternalDamageOverTime(objShip, ship_chassis_slot_type.SCST_num_types, fltDamage, 0); - - return; - } - - - public static void fixHullPanel(obj_id objPanel, obj_id objShip, location locTest) throws InterruptedException - { - obj_id objCell = locTest.cell; - int intHitpoints = getHitpoints(objPanel); - - if (intHitpoints == getMaxHitpoints(objPanel)) - { - return; - } - - if (!hasObjVar(objShip, "locBrokenComponents")) - { - LOG("space", "ship dot system has faled on "+ objShip); - return; - } - - Vector locBrokenComponents = getResizeableLocationArrayObjVar(objShip, "locBrokenComponents"); - int intIndex = utils.getElementPositionInArray(locBrokenComponents, locTest); - - locBrokenComponents = utils.removeElementAt(locBrokenComponents, intIndex); - - if (locBrokenComponents.size() > 0) - { - setObjVar(objShip, "locBrokenComponents", locBrokenComponents); - } - else - { - removeObjVar(objShip, "locBrokenComponents"); - } - - float intHullBreached = getIntObjVar(objShip, "intHullBreached"); - - intHullBreached = intHullBreached - HULL_BREACH_DAMAGE; - - if (intHullBreached <= 0) - { - removeObjVar(objShip, "intHullBreached"); - turnOffInteriorAlarms(objShip); - } - else - { - setObjVar(objShip, "intHullBreached", intHullBreached); - } - - float fltDamage = 0; - - if (hasShipInternalDamageOverTime(objShip, ship_chassis_slot_type.SCST_num_types)) - { - fltDamage = getShipInternalDamageOverTimeDamageRate(objShip, ship_chassis_slot_type.SCST_num_types); - } - - fltDamage = fltDamage - 0.5f; - - if (fltDamage < 0) - { - fltDamage = 0; - } - - setShipInternalDamageOverTime(objShip, ship_chassis_slot_type.SCST_num_types, fltDamage, 0); - setInvulnerableHitpoints(objPanel, getMaxHitpoints(objPanel)); - - return; - } - - - public static void breakPlasmaConduit(obj_id objConduit, obj_id objShip, location locTest, boolean boolAddToList) throws InterruptedException - { - if (locTest == null) - { - return; - } - - locTest.area = ""; - LOG("space", "Breaking "+ objConduit + " boolAddToList is "+ boolAddToList); - LOG("space", "locTest is "+ locTest); - - obj_id objCell = locTest.cell; - - if (!isIdValid(objCell)) - { - LOG("space", "Bad Cell!"); - return; - } - - int intHitpoints = getHitpoints(objConduit); - - if (hasCondition(objConduit, CONDITION_ON)) - { - LOG("space", "Already on!!"); - return; - } - - if (!hasScript(objCell, "space.ship.ship_cell_manager")) - { - attachScript(objCell, "space.ship.ship_cell_manager"); - } - - turnOnInteriorAlarms(objShip); - - if (boolAddToList) - { - LOG("space", "adding "+ locTest + " to list"); - Vector locBrokenComponents = new Vector(); - locBrokenComponents.setSize(0); - - if (hasObjVar(objShip, "locBrokenComponents")) - { - locBrokenComponents = getResizeableLocationArrayObjVar(objShip, "locBrokenComponents"); - } - locBrokenComponents = utils.addElement(locBrokenComponents, locTest); - LOG("space", "locBrokenComponetns is a resizeable array of length "+ locBrokenComponents.size()); - setObjVar(objShip, "locBrokenComponents", locBrokenComponents); - } - - if (hasObjVar(objConduit, "intConduitSlot")) - { - LOG("space", "has slot and breaking it "); - int intConduitSlot = getIntObjVar(objConduit, "intConduitSlot"); - - if (isShipSlotInstalled(objShip, intConduitSlot)) - { - float fltDamage = 0; - - if (hasShipInternalDamageOverTime(objShip, intConduitSlot)) - { - fltDamage = getShipInternalDamageOverTimeDamageRate(objShip, intConduitSlot); - } - - fltDamage = fltDamage + 0.5f; - setShipInternalDamageOverTime(objShip, intConduitSlot, fltDamage, 0); - } - - string_id strSpam = new string_id("space/space_interaction", "conduit_burst"); - prose_package pp = prose.getPackage(strSpam, getEncodedName(objConduit)); - - space_utils.sendSystemMessageShip(objShip, pp, true, true, true, true); - - } - - dictionary dctParams = new dictionary(); - - dctParams.put("intSlot", space_crafting.PLASMA_CONDUIT); - - LOG("space", "Notifying cell"); - - space_utils.notifyObject(objCell, "incrementDotDamage", dctParams); - - setCondition(objConduit, CONDITION_ON); - - return; - } - - - public static void fixPlasmaConduit(obj_id objConduit, obj_id objShip, location locTest) throws InterruptedException - { - locTest.area = ""; - obj_id objCell = getLocation(objConduit).cell; - - LOG("space", "fixPlasmaConduit() Cell is "+ objCell); - - if (!hasObjVar(objShip, "locBrokenComponents")) - { - LOG("space", "fixPlasmaConduit() ship dot system has faled on "+ objShip); - return; - } - - Vector locBrokenComponents = getResizeableLocationArrayObjVar(objShip, "locBrokenComponents"); - int intIndex = utils.getElementPositionInArray(locBrokenComponents, locTest); - - LOG("space", "fixPlasmaConduit() conduit loc: "+ locTest + " intIndex: "+ intIndex); - - if (locBrokenComponents == null) - { - LOG("space", "fixPlasmaConduit() Broken components is null for some reason"); - } - - if (intIndex > -1) - { - locBrokenComponents = utils.removeElementAt(locBrokenComponents, intIndex); - - LOG("space", "fixPlasmaConduit() Removing "+ intIndex + " locBrokenComponents.length is "+ locBrokenComponents.size()); - } - - if (locBrokenComponents.size() > 0) - { - setObjVar(objShip, "locBrokenComponents", locBrokenComponents); - } - else - { - turnOffInteriorAlarms(objShip); - removeObjVar(objShip, "intAlarmsOn"); - removeObjVar(objShip, "locBrokenComponents"); - } - - if (hasObjVar(objConduit, "intConduitSlot")) - { - int intConduitSlot = getIntObjVar(objConduit, "intConduitSlot"); - float fltDamage = 0; - - if (isShipSlotInstalled(objShip, intConduitSlot)) - { - if (hasShipInternalDamageOverTime(objShip, intConduitSlot)) - { - fltDamage = getShipInternalDamageOverTimeDamageRate(objShip, intConduitSlot); - } - - fltDamage = fltDamage - 0.5f; - - if (fltDamage < 0) - { - fltDamage = 0; - } - - setShipInternalDamageOverTime(objShip, intConduitSlot, fltDamage, 0); - } - } - - dictionary dctParams = new dictionary(); - - dctParams.put("intSlot", space_crafting.PLASMA_CONDUIT); - - LOG("space", "fixPlasmaConduit() Notifying "+ objCell); - - space_utils.notifyObject(objCell, "decrementDotDamage", dctParams); - clearCondition(objConduit, CONDITION_ON); - - return; - } - - - public static boolean grantAmmoBay(obj_id objShip, int intSlot, transform trTest, obj_id objCell, int intLevel) throws InterruptedException - { - - String strContainer = "object/tangible/container/drum/warren_drum_loot.iff"; - obj_id objContainer = createObject(strContainer, trTest, objCell); - - if (!isIdValid(objContainer)) - { - return false; - } - - setObjVar(objShip, "weapon.objAmmoBay"+ intSlot, objContainer); - persistObject(objContainer); - setObjVar(objContainer, "intWeaponSlot", intSlot); - attachScript(objContainer, "space.crafting.ammo_bay"); - setObjVar(objContainer, "intBayLevel", intLevel); - - return true; - } - - - public static boolean removeAmmoBay(obj_id objShip, int intSlot) throws InterruptedException - { - obj_id objBay = getObjIdObjVar(objShip, "weapon.objAmmoBay"+ intSlot); - - if (isIdValid(objBay)) - { - destroyObject(objBay); - return true; - } - return false; - } - - - public static void reloadWeaponSlot(obj_id objShip, obj_id objItem, int intSlot, obj_id objPlayer, boolean boolVerbose) throws InterruptedException - { - if (space_crafting.isMissileSlot(objShip, intSlot)) - { - space_crafting.applyAmmoToWeapon(objShip, objItem, intSlot, objPlayer, boolVerbose); - } - else if (space_crafting.isCounterMeasureSlot(objShip, intSlot)) - { - space_crafting.applyCountermeasuresToLauncher(objShip, objItem, intSlot, objPlayer, boolVerbose); - } - else - { - sendSystemMessage(objPlayer, SID_INCORRECTLY_CONFIGURED_ITEM); - return; - } - } - - - public static Vector getAllInstalledComponents(obj_id objShip) throws InterruptedException - { - int[] intRawSlots = getShipChassisSlots(objShip); - Vector intSlots = new Vector(); - intSlots.setSize(0); - - for (int intI = 0; intI < intRawSlots.length; intI++) - { - testAbortScript(); - if (isShipSlotInstalled(objShip, intRawSlots[intI])) - { - intSlots = utils.addElement(intSlots, intRawSlots[intI]); - } - } - - return intSlots; - } - - - public static void turnOnInteriorAlarms(obj_id objShip) throws InterruptedException - { - if (utils.hasScriptVar(objShip, "objAlarms")) - { - setObjVar(objShip, "intAlarmsOn", 1); - obj_id[] objAlarms = utils.getObjIdArrayScriptVar(objShip, "objAlarms"); - for (int intI = 0; intI < objAlarms.length; intI++) - { - testAbortScript(); - - setCondition(objAlarms[intI], CONDITION_ON); - } - } - - return; - } - - - public static void turnOffInteriorAlarms(obj_id objShip) throws InterruptedException - { - if (utils.hasScriptVar(objShip, "objAlarms")) - { - removeObjVar(objShip, "intAlarmsOn"); - obj_id[] objAlarms = utils.getObjIdArrayScriptVar(objShip, "objAlarms"); - for (int intI = 0; intI < objAlarms.length; intI++) - { - testAbortScript(); - - clearCondition(objAlarms[intI], CONDITION_ON); - } - } - - return; - } - - - public static boolean isValidShipComponent(obj_id objShipComponent) throws InterruptedException - { - if (isIdValid(objShipComponent)) - { - String type = getShipComponentStringType(objShipComponent); - - if (type == null || type.equals("")) - { - return false; - } - - else if ((getShipComponentStringType(objShipComponent) == "armor" || getShipComponentStringType(objShipComponent) == "booster" || getShipComponentStringType(objShipComponent) == "capacitor" || getShipComponentStringType(objShipComponent) == "droid_interface" || getShipComponentStringType(objShipComponent) == "engine" || getShipComponentStringType(objShipComponent) == "reactor" || getShipComponentStringType(objShipComponent) == "shield" || getShipComponentStringType(objShipComponent) == "weapon")) - { - return true; - } - - else - { - return false; - } - } - else - { - return false; - } - } - - - public static void setShipEngineRotationRate(obj_id objPlayer, obj_id objShip, float fltRateMax, float fltRateMin, float fltOptimal) throws InterruptedException - { - setShipEngineSpeedRotationFactorMaximum(objShip, fltRateMax); - setShipEngineSpeedRotationFactorMinimum(objShip, fltRateMin); - setShipEngineSpeedRotationFactorOptimal(objShip, fltOptimal); - return; - } - - - public static void setShipChassisPerformanceVariations(obj_id objShip, String strType, obj_id objPlayer) throws InterruptedException - { - String strFileName = "datatables/ship/chassis_modifiers.iff"; - dictionary dctShipInfo = dataTableGetRow(strFileName, strType); - - if (dctShipInfo == null) - { - sendSystemMessageTestingOnly(objPlayer, "No Ship Type of "+ strType + " in "+ strFileName); - LOG("space", "Bad ship type of "+ strType); - return; - } - - setShipEngineRotationRate(objPlayer, objShip, dctShipInfo.getFloat("speed_rotation_factor_max"), dctShipInfo.getFloat("speed_rotation_factor_min"), dctShipInfo.getFloat("speed_rotation_factor_optimal")); - return; - } - - - public static void purchaseChassisFromBroker(obj_id player, obj_id broker) throws InterruptedException - { - - final String SHIP_TABLE = "datatables/space_crafting/chassis_npc.iff"; - final String BROKER_STF = "chassis_npc"; - - final String SCRIPTVAR_CHASSIS_SUI = "chassis_npc.sui"; - - final String BUY_SHIP_TITLE = "@"+ BROKER_STF + ":buy_ship_title"; - final String BUY_SHIP_PROMPT = "@"+ BROKER_STF + ":buy_ship_prompt"; - final String BTN_BUY = "@"+ BROKER_STF + ":btn_buy"; - - int rows = dataTableGetNumRows(SHIP_TABLE); - - String shipTypes[] = new String[rows]; - int shipPrices[] = new int[rows]; - - int shipCount = 0; - - obj_id[] inv = getInventoryAndEquipment(player); - obj_id[] shipDeeds = new obj_id[inv.length]; - String entries[] = new String[inv.length]; - - for (int i = 0; i < inv.length; i++) - { - testAbortScript(); - if (hasObjVar(inv[i], "shiptype")) - { - if (!hasObjVar(getContainedBy(inv[i]), "crafting.tool")) - { - if (utils.getContainingPlayer(inv[i]) == player) - { - shipDeeds[shipCount] = inv[i]; - String type = getStringObjVar(inv[i], "shiptype"); - int price = dataTableGetInt(SHIP_TABLE, type, 1); - String name = dataTableGetString(SHIP_TABLE, type, 2); - - entries[shipCount] = ("[" + price + "] " + " --- " + name + " --- " + getName(inv[i])); - shipCount++; - } - } - } - } - - String realEntries[] = new String[shipCount]; - - for (int i = 0; i < realEntries.length; i++) - { - testAbortScript(); - realEntries[i] = entries[i]; - } - - if (entries[0] != null && entries.length > 0) - { - int pid = sui.listbox(broker, player, BUY_SHIP_PROMPT, sui.OK_CANCEL, BUY_SHIP_TITLE, realEntries, "handleCheckShip", false, false); - - if (pid > -1) - { - - setSUIProperty(pid, sui.LISTBOX_BTN_OK, sui.PROP_TEXT, BTN_BUY); - showSUIPage(pid); - - utils.setScriptVar(player, SCRIPTVAR_CHASSIS_SUI, pid); - utils.setScriptVar(player, "chassis_npc.price", shipPrices); - utils.setScriptVar(player, "chassis_npc.deed", shipDeeds); - - } - } - else - { - string_id msgNoDeeds = new string_id(BROKER_STF, "no_deeds"); - - chat.publicChat(broker, player, msgNoDeeds); - utils.removeScriptVar(player, SCRIPTVAR_CHASSIS_SUI); - utils.removeScriptVar(player, "chassis_npc.price"); - utils.removeBatchScriptVar(player, "chassis_npc.type"); - utils.removeScriptVar(player, "chassis_npc.deed"); - } - - return; - } - - - public static boolean sellLootItem(obj_id objPlayer, obj_id objBroker, obj_id objItem) throws InterruptedException - { - if (utils.hasScriptVar(objItem, "intSold")) - { - return false; - } - - obj_id objOwner = utils.getContainingPlayer(objItem); - - if (objOwner != objPlayer) - { - return false; - } - - float fltDistance = getDistance(objPlayer, objBroker); - - if (fltDistance > 24) - { - return false; - } - - utils.setScriptVar(objItem, "intSold", 1); - int intValue = getComponentSellPrice(objItem); - - CustomerServiceLog("chassis_broker", "%TU Sold item "+ objItem + " ("+ getTemplateName(objItem) + ") To Dealer "+ objBroker + " FOR "+ intValue, objPlayer); - - string_id strSpam = new string_id("space/space_loot", "sold_item"); - prose_package proseTest = new prose_package(); - - proseTest = prose.setStringId(proseTest, strSpam); - proseTest = prose.setTO(proseTest, getEncodedName(objItem)); - proseTest = prose.setDI(proseTest, intValue); - sendSystemMessageProse(objPlayer, proseTest); - - destroyObject(objItem); - money.bankTo("space_component_sale", objPlayer, intValue); - - return true; - } - - - public static boolean hasLootToSell(obj_id objPlayer) throws InterruptedException - { - obj_id[] objContents = getInventoryAndEquipment(objPlayer); - - for (int intI = 0; intI < objContents.length; intI++) - { - testAbortScript(); - if (hasScript(objContents[intI], "space.crafting.component_loot")) - { - return true; - } - } - return false; - } - - - public static int getComponentSellPrice(obj_id objComponent) throws InterruptedException - { - final String[] strLootLevels = - { - "cert_ordnance_level1", - "cert_ordnance_level2", - "cert_ordnance_level3", - "cert_ordnance_level4", - "cert_ordnance_level5", - "cert_ordnance_level6", - "cert_ordnance_level7", - "cert_ordnance_level8", - "cert_ordnance_level9", - "cert_ordnance_levelten" - }; - final int[] intValue = - { - 1000, - 2000, - 3000, - 4000, - 5000, - 6000, - 7000, - 8000, - 9000, - 10000, - }; - - String[] strCerts = getRequiredCertifications(objComponent); - - if ((strCerts != null) && (strCerts.length > 0)) - { - int intIndex = utils.getElementPositionInArray(strLootLevels, strCerts[0]); - - if (intIndex < 0) - { - return 500; - } - - return intValue[intIndex]; - } - else - { - return 500; - } - } - - - public static void sellComponentsToBroker(obj_id objPlayer, obj_id objBroker) throws InterruptedException - { - String strTitle = "@space/space_loot:sell_loot_title"; - String strPrompt = "@space/space_loot:sell_loot_prompt"; - String strSellButton = "@space/space_loot:sell_loot_button"; - - obj_id[] objContents = getInventoryAndEquipment(objPlayer); - - Vector objLoot = new Vector(); - objLoot.setSize(0); - Vector ppEntries = new Vector(); - ppEntries.setSize(0); - string_id strSpam = new string_id("space/space_loot", "item_list"); - - for (int intI = 0; intI < objContents.length; intI++) - { - testAbortScript(); - if (hasScript(objContents[intI], "space.crafting.component_loot")) - { - int intValue = getComponentSellPrice(objContents[intI]); - - prose_package ppTest = new prose_package(); - - prose.setTO(ppTest, getEncodedName(objContents[intI])); - prose.setDI(ppTest, intValue); - prose.setStringId(ppTest, strSpam); - - String strLine = "["+ intValue + "] "+ " ------- "+ getName(objContents[intI]); - - objLoot = utils.addElement(objLoot, objContents[intI]); - ppEntries = utils.addElement(ppEntries, ppTest); - } - } - - if (ppEntries != null && ppEntries.size() > 0) - { - - prose_package[] ppRawEntries = new prose_package[ppEntries.size()]; - - for (int intI = 0; intI < ppEntries.size(); intI++) - { - testAbortScript(); - prose_package ppTest = ((prose_package)(ppEntries.get(intI))); - - ppRawEntries[intI] = ppTest; - } - - int pid = sui.listbox(objBroker, objPlayer, strPrompt, sui.OK_CANCEL, strTitle, ppRawEntries, "sellLootComponents", false, false); - - if (pid > -1) - { - - setSUIProperty(pid, sui.LISTBOX_BTN_OK, sui.PROP_TEXT, strSellButton); - showSUIPage(pid); - utils.setScriptVar(objPlayer, "objLootToSell", objLoot); - } - } - else - { - strSpam = new string_id("space/space_loot", "nothing_to_sell"); - sendSystemMessage(objPlayer, strSpam); - - } - return; - } - - - public static obj_id createDeedFromBlueprints(obj_id player, String type, obj_id inventory, float mass, float hp) throws InterruptedException - { - if (isIdValid(player)) - { - obj_id newDeed = createObject("object/tangible/ship/crafted/chassis/"+ type + "_deed.iff", inventory, ""); - - setObjVar(newDeed, "ship_chassis.mass", mass); - setObjVar(newDeed, "ship_chassis.hp", hp); - setObjVar(newDeed, "ship_chassis.type", type); - return newDeed; - } - else - { - return null; - } - } - - - public static boolean setupChassisDifferentiation(obj_id objShip) throws InterruptedException - { - String strChassis = getShipChassisType(objShip); - - return setupChassisDifferentiation(objShip, strChassis); - } - - - public static boolean setupChassisDifferentiation(obj_id objShip, String strChassis) throws InterruptedException - { - if (space_utils.isPlayerControlledShip(objShip)) - { - LOG("space", "setting modifier to "+ strChassis); - String strFileName = "datatables/ship/chassis_modifiers.iff"; - dictionary dctShipInfo = dataTableGetRow(strFileName, strChassis); - - if (dctShipInfo == null) - { - LOG("space", "No entry for "+ strChassis); - return false; - } - LOG("space", "setting modifier to "+ dctShipInfo); - setShipEngineAccelerationRate(objShip, dctShipInfo.getFloat("engine_accel")); - setShipEngineDecelerationRate(objShip, dctShipInfo.getFloat("engine_decel")); - setShipEnginePitchAccelerationRateDegrees(objShip, dctShipInfo.getFloat("engine_pitch_accel")); - setShipEngineYawAccelerationRateDegrees(objShip, dctShipInfo.getFloat("engine_yaw_accel")); - setShipEngineRollAccelerationRateDegrees(objShip, dctShipInfo.getFloat("engine_roll_accel")); - setShipEngineSpeedRotationFactorMaximum(objShip, dctShipInfo.getFloat("speed_rotation_factor_max")); - setShipEngineSpeedRotationFactorMinimum(objShip, dctShipInfo.getFloat("speed_rotation_factor_min")); - setShipEngineSpeedRotationFactorOptimal(objShip, dctShipInfo.getFloat("speed_rotation_factor_optimal")); - setShipSlideDampener(objShip, dctShipInfo.getFloat("slideDamp")); - setShipChassisSpeedMaximumModifier(objShip, dctShipInfo.getFloat("fltMaxSpeedModifier")); - } - else - { - LOG("space", "NO ROTATIONAL RESET"); - return false; - } - return true; - } - - - public static void resetChassisRotationalVelocity(obj_id objShip) throws InterruptedException - { - if (space_utils.isPlayerControlledShip(objShip)) - { - String strChassis = getShipChassisType(objShip); - String strFileName = "datatables/ship/chassis_modifiers.iff"; - - float fltRotationSpeedFactorMaximum = dataTableGetFloat(strFileName, strChassis, "speed_rotation_factor"); - - if (fltRotationSpeedFactorMaximum <= 0) - { - fltRotationSpeedFactorMaximum = 1.0f; - } - - setShipEngineSpeedRotationFactorMaximum(objShip, fltRotationSpeedFactorMaximum); - } - - return; - } - - - public static void clearComponentDisabledFlag(obj_id objComponent) throws InterruptedException - { - int flags = getIntObjVar(objComponent, "ship_comp.flags"); - - flags &= ~(base_class.ship_component_flags.SCF_disabled); - flags &= ~(base_class.ship_component_flags.SCF_demolished); - setObjVar(objComponent, "ship_comp.flags", flags); - return; - } - - - public static obj_id createChassisFromDeed(obj_id player, obj_id deed, float hp, float currentHp, float mass, String type) throws InterruptedException - { - final String STF = "chassis_npc"; - - if (isIdValid(player)) - { - obj_id datapad = utils.getDatapad(player); - obj_id pcd = createObject("object/intangible/ship/"+ type + "_pcd.iff", datapad, ""); - - if (!isIdValid(pcd)) - { - return null; - } - else - { - obj_id ship = createObject("object/ship/player/player_"+ type + ".iff", pcd, ""); - - if (!hasCertificationsForItem(player, ship)) - { - destroyObject(ship); - destroyObject(pcd); - sendSystemMessage(player, new string_id(STF, "not_certified")); - return null; - } - - if (hasObjVar(deed, "ship_chassis.badgeRestricted") && !isGod(player)) - { - int badgeReq = getIntObjVar(deed, "ship_chassis.badgeRestricted"); - String badgeName = getCollectionSlotName(badgeReq); - - if ((badgeName == null) || (badgeName.length() == 0) || (!badge.hasBadge(player, badgeName))) - { - destroyObject(ship); - destroyObject(pcd); - sendSystemMessage(player, new string_id(STF, "no_badge")); - return null; - } - } - - if (hasObjVar(deed, "ship_chassis.groundQuestRestricted") && !isGod(player)) - { - String reqGroundQuest = getStringObjVar(deed, "ship_chassis.groundQuestRestricted"); - - if (!groundquests.hasCompletedQuest(player, reqGroundQuest)) - { - destroyObject(ship); - destroyObject(pcd); - sendSystemMessage(player, new string_id(STF, "no_quest")); - return null; - } - - } - - if (hasObjVar(deed, "ship_chassis.spaceQuestRestricted") && !isGod(player)) - { - String reqSpaceQuest = getStringObjVar(deed, "ship_chassis.spaceQuestRestricted"); - String reqSpaceQuestType = getStringObjVar(deed, "ship_chassis.spaceQuestRestrictedType"); - - if (!space_quest.hasReceivedReward(player, reqSpaceQuestType, reqSpaceQuest) && !space_quest.hasWonQuest(player, reqSpaceQuestType, reqSpaceQuest)) - { - destroyObject(ship); - destroyObject(pcd); - sendSystemMessage(player, new string_id(STF, "no_quest")); - return null; - } - - } - - if (isIdValid(ship)) - { - CustomerServiceLog("ship_deed", "ship deed used: deed="+ deed + " scd="+ pcd + " ship="+ ship + " player="+ player + "("+ getPlayerName(player) + ")"); - - if (space_utils.isPobType(type)) - { - if (!hasObjVar(pcd, "lotReqRemoved")) - { - setObjVar(pcd, "lotReqRemoved", true); - } - - } - - setOwner(ship, player); - - if (!type.equals("sorosuub_space_yacht")) - { - space_crafting.uninstallAll(ship); - } - - setShipMaximumChassisHitPoints(ship, hp); - - if (currentHp > hp) - { - currentHp = hp; - } - - setShipCurrentChassisHitPoints(ship, currentHp); - setChassisComponentMassMaximum(ship, mass); - String strParkingLocation = getStringObjVar(deed, "strParkingLocation"); - - if (strParkingLocation != null) - { - setObjVar(pcd, "strParkingLocation", strParkingLocation); - } - - if (hasObjVar(deed, "noTrade")) - { - setObjVar(pcd, "noTrade", true); - } - - if (!hasScript(deed, "item.special.nodestroy")) - { - destroyObject(deed); - } - - string_id successMessage = new string_id(STF, "succeed"); - - sendSystemMessage(player, successMessage); - - } - else - { - string_id message3 = new string_id(STF, "failed"); - - sendSystemMessage(player, message3); - } - } - } - - return null; - } - - - public static void fixAllPlasmaConduits(obj_id objShip) throws InterruptedException - { - LOG("space", "FIXING ALL PLASMA CONDUITS"); - - if (utils.hasScriptVar(objShip, "objPlasmaConduits")) - { - Vector objPlasmaConduits = utils.getResizeableObjIdArrayScriptVar(objShip, "objPlasmaConduits"); - - for (int intI = 0; intI < objPlasmaConduits.size(); intI++) - { - testAbortScript(); - LOG("space", "Plasma conduit ["+ intI + "]"); - - if (hasCondition(((obj_id)(objPlasmaConduits.get(intI))), CONDITION_ON)) - { - LOG("space", "Conduit is on"); - fixPlasmaConduit(((obj_id)(objPlasmaConduits.get(intI))), objShip, getLocation(((obj_id)(objPlasmaConduits.get(intI))))); - } - } - } - - return; - } - - - public static void sellResourcesToSpaceStation(obj_id player, obj_id npc) throws InterruptedException - { - String priceList = getStringObjVar(npc, "space_mining.priceList"); - - if (isIdValid(player) && isIdValid(npc)) - { - openSpaceMiningUi(player, npc, priceList); - } - - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/space_create.java b/sku.0/sys.server/compiled/game/script/library/space_create.java deleted file mode 100644 index 54fc0fa99..000000000 --- a/sku.0/sys.server/compiled/game/script/library/space_create.java +++ /dev/null @@ -1,524 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.vector; -import script.transform; -import script.library.hue; -import script.library.ship_ai; -import script.library.sui; - - -public class space_create extends script.base_script -{ - public space_create() - { - } - public static final int MAX_SQUAD_SIZE = 10; - - public static final String SHIP_DATATABLE = "datatables/space_mobile/space_mobile.iff"; - public static final String SHIP_DIRECTORY = "object/ship/"; - - - public static obj_id createShip(String strShipType, transform locTransform) throws InterruptedException - { - return createShip( strShipType, locTransform, null ); - } - - - public static obj_id createShip(String strShipType, transform locTransform, obj_id objCell) throws InterruptedException - { - return _createShip( strShipType, locTransform, objCell, false ); - } - - - public static obj_id createShipHyperspace(String strShipType, transform locTransform) throws InterruptedException - { - return _createShip( strShipType, locTransform, null, true ); - } - - - public static obj_id createShipHyperspace(String strShipType, transform locTransform, obj_id objCell) throws InterruptedException - { - return _createShip( strShipType, locTransform, objCell, true ); - } - - - public static obj_id _createShip(String strShipType, transform locTransform, obj_id objCell, boolean hyperspace) throws InterruptedException - { - dictionary dctShipInfo = dataTableGetRow( SHIP_DATATABLE, strShipType ); - if (dctShipInfo == null) - { - - return null; - } - String strShip = "object/ship/"+dctShipInfo.getString("strShip")+".iff"; - - obj_id objShip = null; - if (hyperspace) - { - objShip = createObjectHyperspace( strShip, locTransform, objCell ); - } - else - { - objShip = createObject( strShip, locTransform, objCell ); - } - if (!isIdValid(objShip)) - { - - return null; - } - - setObjVar( objShip, "ship.shipName", strShipType ); - String strPilot = dctShipInfo.getString( "strPilot"); - setObjVar( objShip, "ship.pilotType", strPilot ); - ship_ai.unitSetPilotType( objShip, strPilot ); - setupAIFlightModeling(objShip, strPilot); - int intXP = dctShipInfo.getInt( "intXP"); - setObjVar( objShip, "xp.intXP", intXP ); - - String strShipt = dctShipInfo.getString("strShip"); - setShipTypeName( objShip, strShipt ); - - if (strShipt.indexOf( "tier" ) > -1) - { - int index = strShipt.lastIndexOf( "_"); - if (index > -1) - { - String tier = strShipt.substring( index+1, strShipt.length() ); - setShipDifficulty( objShip, tier ); - } - } - - String strFaction = dctShipInfo.getString("space_faction"); - setShipFaction(objShip, strFaction); - - int intMinCredits = dctShipInfo.getInt( "intMinCredits"); - int intMaxCredits = dctShipInfo.getInt( "intMaxCredits"); - setObjVar( objShip, "loot.intCredits", rand(intMinCredits, intMaxCredits) ); - - int intRolls = dctShipInfo.getInt( "intRolls"); - float fltItemChance = dctShipInfo.getFloat( "fltItemChance"); - - int intNumItems = 0; - fltItemChance = fltItemChance * 100; - - for (int intI = 0; intI -1) - { - hue.setColor( objShip, "/shared_owner/index_color_1", intColor0); - } - - if (intColor1 > -1) - { - hue.setColor( objShip, "/shared_owner/index_color_2", intColor1); - } - - if (intTextureIndex > -1) - { - hue.setRangedIntCustomVar( objShip, "/shared_owner/index_texture_1", intTextureIndex); - } - - String cargo_type = dctShipInfo.getString( "cargo"); - if ((cargo_type != null) && !cargo_type.equals( "none" ) && !cargo_type.equals( "" )) - { - String[] cargo_types = dataTableGetStringColumn( "datatables/spacequest/inspect_cargo/"+cargo_type+".iff", "name"); - - if (cargo_types != null && cargo_types.length > 0) - { - String cargo = null; - - if (cargo_types.length == 1) - { - cargo = cargo_types[0]; - } - else - { - cargo = cargo_types[rand(0,cargo_types.length-1)]; - } - - setObjVar( objShip, "cargo", cargo ); - setObjVar( objShip, "cargo_type", cargo_type ); - } - } - String strCapitalShipType = dctShipInfo.getString("strCapitalShipType"); - - if (!strCapitalShipType.equals("")) - { - setObjVar( objShip, "strCapitalShipType", strCapitalShipType ); - attachScript( objShip, "space.combat.combat_ship_capital"); - } - String strInteriorChassisType = dctShipInfo.getString( "strInteriorChassisType"); - if (!strInteriorChassisType.equals("")) - { - - setObjVar( objShip, "strInteriorChassisType", strInteriorChassisType ); - attachScript( objShip, "space.ship.ship_interior"); - dictionary dctParams = new dictionary(); - space_utils.notifyObject( objShip, "doInteriorBuildout", dctParams ); - } - - String strBoardingType = dctShipInfo.getString( "strBoardingType"); - if (!strBoardingType.equals("")) - { - - setObjVar( objShip, "strBoardingType", strBoardingType ); - attachScript( objShip, "space.combat.combat_ship_boardable"); - - } - String strAppearanceType = dctShipInfo.getString("strAppearance"); - String[] strAppearances = dataTableGetStringColumnNoDefaults("datatables/space_mobile/space_appearances.iff", strAppearanceType); - if ((strAppearances != null)&&(strAppearances.length > 0)) - { - if (strAppearances.length == 1) - { - setObjVar(objShip, "convo.appearance", strAppearances[0]); - } - else - { - setObjVar(objShip, "convo.appearance", strAppearances[rand(0, strAppearances.length-1)]); - } - } - String strDiction = dctShipInfo.getString("strTauntDiction"); - if (!strDiction.equals("")) - { - utils.setLocalVar(objShip, "strTauntDiction", strDiction); - } - String strConversation = dctShipInfo.getString("strConversation"); - if ((strConversation != null)&&(!strConversation.equals(""))) - { - attachScript(objShip, strConversation); - } - - float fltAttackTauntChance = dctShipInfo.getFloat("fltAttackTauntChance"); - utils.setLocalVar(objShip, "fltAttackTauntChance", fltAttackTauntChance); - - float fltDefendTauntChance = dctShipInfo.getFloat("fltDefendTauntChance"); - utils.setLocalVar(objShip, "fltDefendTauntChance", fltDefendTauntChance); - - float fltDieTauntChance = dctShipInfo.getFloat("fltDieTauntChance"); - utils.setLocalVar(objShip, "fltDieTauntChance", fltDieTauntChance); - - utils.setLocalVar(objShip, "intImperialFactionPoints", dctShipInfo.getInt("intImperialFactionPoints")); - utils.setLocalVar(objShip, "intRebelFactionPoints", dctShipInfo.getInt("intRebelFactionPoints")); - - return objShip; - } - - - public static obj_id makeCreditChip(obj_id objContainer, int intCredits) throws InterruptedException - { - - String TEMPLATE_NAME = "object/tangible/item/loot_credit_chip.iff"; - if (intCredits > 0) - { - - obj_id objCreditChip = getCreditChip(objContainer); - if (isIdValid(objCreditChip)) - { - int intAmount = getIntObjVar(objCreditChip, "loot.intCredits"); - intAmount = intAmount + intCredits; - setCount(objCreditChip, intAmount); - setObjVar(objCreditChip, "loot.intCredits", intAmount); - return objCreditChip; - } - else - { - - if (isIdValid(objContainer)) - { - - obj_id objChip = space_utils.createObjectTrackItemCount(TEMPLATE_NAME, objContainer); - if (isIdValid(objChip)) - { - setCount(objChip, intCredits); - setObjVar(objChip, "loot.intCredits", intCredits); - - } - return objChip; - } - } - } - return null; - } - - - public static obj_id getCreditChip(obj_id objContainer) throws InterruptedException - { - - if (!isIdValid(objContainer)) - { - - return null; - } - obj_id[] objContents = getContents(objContainer); - if (objContents == null) - { - - return null; - } - for (int intI= 0; intI< objContents.length; intI++) - { - testAbortScript(); - - if (hasObjVar(objContents[intI], "loot.intCredits")) - { - return objContents[intI]; - } - } - return null; - } - - - public static Vector createSquad(obj_id objParent, String strSquad, transform trSpawnLocation, float fltDistance, obj_id objCell) throws InterruptedException - { - return _createSquad( objParent, strSquad, trSpawnLocation, fltDistance, objCell, false); - } - - - public static Vector createSquadHyperspace(obj_id objParent, String strSquad, transform trSpawnLocation, float fltDistance, obj_id objCell) throws InterruptedException - { - return _createSquad( objParent, strSquad, trSpawnLocation, fltDistance, objCell, true); - } - - - public static Vector _createSquad(obj_id objParent, String strSquad, transform trSpawnLocation, float fltDistance, obj_id objCell, boolean hyperspace) throws InterruptedException - { - dictionary dctSquadInfo = dataTableGetRow( "datatables/space_content/spawners/squads.iff", strSquad ); - if (strSquad == null) - { - - return null; - } - Vector objMembers = new Vector(); - objMembers.setSize(0); - - for (int intI = 1; intI< MAX_SQUAD_SIZE; intI++) - { - testAbortScript(); - String strShipType = dctSquadInfo.getString("strShip"+intI); - if (!strShipType.equals("")) - { - obj_id objShip = null; - if (hasObjVar(objParent, "intLaunchFromDockingPoint")) - { - objShip = space_create.createShip(strShipType, getTransform_o2p(objParent), null); - transform trTest = ship_ai.unitGetDockTransform(objParent, objShip); - transform trFoo = getTransform_o2p(objShip).rotateTranslate_l2p(trTest); - - location locTest = space_utils.getLocationFromTransform(trFoo); - - setTransform_o2p(objShip, trFoo); - } - else - { - transform trTest = space_utils.getRandomPositionInSphere(trSpawnLocation, 0f, fltDistance, true); - objShip = space_create._createShip( strShipType, trTest, objCell, hyperspace); - } - - if (!isIdValid(objShip)) - { - - } - else - { - objMembers = utils.addElement(objMembers, objShip); - String strMemberScript = dctSquadInfo.getString("strMemberScript"); - if (!strMemberScript.equals("")) - { - attachScript(objShip, strMemberScript); - } - attachScript(objShip, "space.content_tools.squad_member"); - } - } - else - { - intI = MAX_SQUAD_SIZE +1; - } - - } - if (objMembers.size() > 0) - { - float fltDestroyPercentage = dctSquadInfo.getFloat("fltDestroyPercentage"); - - int intSquadId = ship_ai.unitGetSquadId(((obj_id)(objMembers.get(0)))); - utils.setScriptVar(((obj_id)(objMembers.get(0))), "fltDestroyPercentage", fltDestroyPercentage); - utils.setScriptVar(((obj_id)(objMembers.get(0))), "intStartPopulation", objMembers.size()); - for (int intI = 1; intI < objMembers.size(); intI++) - { - testAbortScript(); - - utils.setScriptVar(((obj_id)(objMembers.get(intI))), "fltDestroyPercentage", fltDestroyPercentage); - utils.setScriptVar(((obj_id)(objMembers.get(intI))), "intStartPopulation", objMembers.size()); - setObjVar(((obj_id)(objMembers.get(intI))), "intNoDump", 1); - ship_ai.unitSetSquadId(((obj_id)(objMembers.get(intI))), intSquadId); - if (!isIdValid(objParent)) - { - setObjVar( ((obj_id)(objMembers.get(intI))), "objParent", objParent ); - } - } - - ship_ai.squadSetFormation( intSquadId, dctSquadInfo.getInt("intFormationShape") ); - ship_ai.squadSetLeader( intSquadId, ((obj_id)(objMembers.get(0))) ); - } - else - { - - return null; - } - for (int intI = 0; intI < objMembers.size(); intI++) - { - testAbortScript(); - - } - - return objMembers; - } - - - public static obj_id setupShipFromObjVars(obj_id objShip) throws InterruptedException - { - - String strShipType = getStringObjVar(objShip, "ship.shipName"); - dictionary dctShipInfo = dataTableGetRow( space_create.SHIP_DATATABLE, strShipType ); - - if (dctShipInfo == null) - { - - destroyObject(objShip); - return null; - } - - setObjVar( objShip, "ship.shipName", strShipType ); - String strPilot = dctShipInfo.getString( "strPilot"); - if (hasObjVar(objShip, "ship.pilotType")) - { - strPilot = getStringObjVar(objShip, "ship.pilotType"); - if ((strPilot == null)||(strPilot.equals(""))) - { - strPilot = "default"; - } - - } - else - { - if ((strPilot == null)||(strPilot.equals(""))) - { - strPilot = "default"; - } - setObjVar( objShip, "ship.pilotType", strPilot ); - - } - - if (strPilot.indexOf( "tier" ) > -1) - { - int index = strPilot.lastIndexOf( "_"); - if (index > -1) - { - String tier = strPilot.substring( index+1, strPilot.length() ); - setShipDifficulty( objShip, tier ); - } - } - setShipTypeName( objShip, dctShipInfo.getString("strShip") ); - String strFaction = ""; - if (!hasObjVar(objShip, "ship.space_faction")) - { - - strFaction = dctShipInfo.getString("space_faction"); - } - else - { - - strFaction = getStringObjVar(objShip, "ship.space_faction"); - } - - setShipFaction(objShip, strFaction); - - string_id strSpam = new string_id("space/ship_names", strShipType); - setName( objShip, strSpam ); - ship_ai.unitSetPilotType(objShip, strPilot ); - - return objShip; - - } - - public static void setupAIFlightModeling(obj_id objShip, String strPilotType) throws InterruptedException - { - if ((strPilotType != null)&&(!strPilotType.equals(""))) - { - dictionary dctShipInfo = dataTableGetRow("datatables/ship/ship_debug.iff",strPilotType); - if (dctShipInfo == null) - { - - return; - } - - setShipEngineAccelerationRate(objShip, dctShipInfo.getFloat("engine_accel")); - setShipEngineDecelerationRate(objShip, dctShipInfo.getFloat("engine_decel")); - setShipEnginePitchAccelerationRateDegrees(objShip, dctShipInfo.getFloat("engine_pitch_accel")); - setShipEngineYawAccelerationRateDegrees(objShip, dctShipInfo.getFloat("engine_yaw_accel")); - setShipEngineRollAccelerationRateDegrees(objShip, dctShipInfo.getFloat("engine_roll_accel")); - setShipEnginePitchRateMaximumDegrees(objShip, dctShipInfo.getFloat("engine_pitch")); - setShipEngineYawRateMaximumDegrees(objShip, dctShipInfo.getFloat("engine_yaw")); - setShipEngineRollRateMaximumDegrees(objShip, dctShipInfo.getFloat("engine_roll")); - setShipEngineSpeedMaximum(objShip, dctShipInfo.getFloat("engine_speed")); - setShipEngineSpeedRotationFactorMaximum(objShip, dctShipInfo.getFloat("speed_rotation_factor_max")); - setShipEngineSpeedRotationFactorMinimum(objShip, dctShipInfo.getFloat("speed_rotation_factor_min")); - setShipEngineSpeedRotationFactorOptimal(objShip, dctShipInfo.getFloat("speed_rotation_factor_optimal")); - setShipSlideDampener(objShip, dctShipInfo.getFloat("slideDamp")); - int intHoldFire = dctShipInfo.getInt("intHoldFire"); - if (intHoldFire > 0) - { - ship_ai.unitSetAttackOrders(objShip, ship_ai.ATTACK_ORDERS_HOLD_FIRE); - } - if (isShipSlotInstalled(objShip, space_crafting.BOOSTER)) - { - - setShipBoosterEnergyCurrent(objShip, dctShipInfo.getFloat("booster_energy")); - setShipBoosterEnergyMaximum(objShip, dctShipInfo.getFloat("booster_energy")); - setShipBoosterEnergyRechargeRate(objShip, dctShipInfo.getFloat("booster_recharge")); - setShipBoosterEnergyConsumptionRate(objShip, dctShipInfo.getFloat("booster_consumption")); - setShipBoosterAcceleration(objShip, dctShipInfo.getFloat("booster_accel")); - setShipBoosterSpeedMaximum(objShip, dctShipInfo.getFloat("booster_speed")); - } - } - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/spawning.java b/sku.0/sys.server/compiled/game/script/library/spawning.java deleted file mode 100644 index 66caf8e03..000000000 --- a/sku.0/sys.server/compiled/game/script/library/spawning.java +++ /dev/null @@ -1,351 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.space_utils; - - -public class spawning extends script.base_script -{ - public spawning() - { - } - - public static void activateSpawnerHack(obj_id objPlayer) throws InterruptedException - { - - obj_id[] objSpawners = getAllObjectsWithObjVar(getLocation(objPlayer), 24000, "intSpawnSystem"); - if (objSpawners.length == 0) - { - return; - } - - messageTo(objSpawners[rand(0, objSpawners.length-1)], "doSpawnEvent", null, 0, false); - return; - } - - - public static location getRandomLocationInCircle(location locTest, float fltSize) throws InterruptedException - { - locTest.x = locTest.x + rand(-1*fltSize, fltSize); - locTest.z= locTest.z + rand(-1*fltSize, fltSize); - return locTest; - } - - - public static location getRandomLocationAtDistance(location locTest, float fltSize) throws InterruptedException - { - - int position = 1; - if (rand(0,1) == 0) - { - position = -1; - } - - if (rand(0,1) == 1) - { - - locTest.x = locTest.x + rand(-1*fltSize, fltSize); - locTest.z= locTest.z + fltSize*position; - } - else - { - - locTest.x = locTest.x + fltSize*position; - locTest.z= locTest.z + rand(-1*fltSize, fltSize); - } - - return locTest; - } - - - public static boolean checkSpawnCount(obj_id self) throws InterruptedException - { - int intSpawnCount = getIntObjVar(self, "intSpawnCount"); - int intCurrentSpawnCount = utils.getIntScriptVar(self, "intCurrentSpawnCount"); - if (intCurrentSpawnCount >= intSpawnCount) - { - - return false; - } - return true; - } - - - public static void incrementSpawnCount(obj_id self) throws InterruptedException - { - int intCurrentSpawnCount = utils.getIntScriptVar(self, "intCurrentSpawnCount"); - int intSpawnCount = getIntObjVar(self, "intSpawnCount"); - intCurrentSpawnCount = intCurrentSpawnCount +1; - if (intCurrentSpawnCount <= intSpawnCount) - { - - utils.setScriptVar(self, "intCurrentSpawnCount", intCurrentSpawnCount); - } - return; - - } - - - public static void addToSpawnDebugList(obj_id self, obj_id spawned) throws InterruptedException - { - Vector debugSpawnList = new Vector(); - debugSpawnList.setSize(0); - if (utils.hasScriptVar(self, "debugSpawnList")) - { - debugSpawnList = utils.getResizeableObjIdArrayScriptVar(self, "debugSpawnList"); - } - - debugSpawnList = utils.addElement(debugSpawnList, spawned); - - utils.setScriptVar(self, "debugSpawnList", debugSpawnList); - } - - - public static Vector getAllObjectsWithObjVar(location locTest, String strObjVarName) throws InterruptedException - { - - Vector objArray = new Vector(); - objArray.setSize(0); - - return objArray; - } - - public static Vector getObjectsWithObjVar(obj_id objParent, String strObjVarName, Vector objArray) throws InterruptedException - { - if (hasObjVar(objParent, strObjVarName)) - { - objArray = utils.addElement(objArray, objParent); - } - obj_id[] objContents = getContents(objParent); - if ((objContents != null)&&(objContents.length > 0)) - { - for (int intI = 0; intI < objContents.length; intI++) - { - testAbortScript(); - getObjectsWithObjVar(objContents[intI], strObjVarName, objArray); - } - } - return objArray; - } - - - public static obj_id[] getAllContents(obj_id objObject) throws InterruptedException - { - Vector objContents = new Vector(); - objContents.setSize(0); - obj_id[] objCells = getContents(objObject); - - for (int intI = 0; intI< objCells.length; intI++) - { - testAbortScript(); - obj_id[] objTestContents = getContents(objCells[intI]); - if ((objTestContents != null)&&(objTestContents.length > 0)) - { - for (int intJ = 0; intJ < objTestContents.length; intJ++) - { - testAbortScript(); - objContents = utils.addElement(objContents, objTestContents[intJ]); - } - } - } - obj_id[] _objContents = new obj_id[0]; - if (objContents != null) - { - _objContents = new obj_id[objContents.size()]; - objContents.toArray(_objContents); - } - return _objContents; - } - - - public static void planetSpawnersCreatureDied(obj_id spawner, obj_id deadGuy) throws InterruptedException - { - - if (!isIdValid(spawner)) - { - - CustomerServiceLog("SPAWNER_OVERLOAD", "Spawner "+ spawner + " is invalid"); - return; - } - - int count = utils.getIntScriptVar(spawner, "count"); - - count = count - 1; - - if (count < 0) - { - - CustomerServiceLog("SPAWNER_OVERLOAD", "Count went below 0 on "+ spawner + " on Rori. Rori_npc_medium script."); - count = 0; - } - - utils.setScriptVar(spawner, "count", count); - - Vector spawnedList = utils.getResizeableObjIdArrayScriptVar (spawner, "myCreations"); - - for (int i = 0; i < spawnedList.size(); i++) - { - testAbortScript(); - - if (((obj_id)(spawnedList.get(i))) == deadGuy) - { - - spawnedList.remove(((obj_id)(spawnedList.get(i)))); - continue; - } - - if (((obj_id)(spawnedList.get(i))) == null) - { - - spawnedList.remove(((obj_id)(spawnedList.get(i)))); - continue; - } - } - - utils.setScriptVar(spawner, "myCreations", spawnedList); - - return; - } - - - public static obj_id createSpawnInLegacyCell(obj_id dungeon, location creatureLocation, String creatureName) throws InterruptedException - { - if (!isValidId(dungeon)) - { - CustomerServiceLog("bad_spawner_data", "createSpawnInLegacyCell - Dungeon passed to function was invalid."); - return null; - } - - if (creatureLocation == null) - { - CustomerServiceLog("bad_spawner_data", "createSpawnInLegacyCell - Location passed to function was invalid for dungeon: "+dungeon); - return null; - } - - if (creatureName == null || creatureName.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "createSpawnInLegacyCell - Creature Name passed to function was invalid for dungeon: "+dungeon); - return null; - } - - obj_id creature = create.object(creatureName, creatureLocation); - if (!isValidId(creature)) - { - CustomerServiceLog("bad_spawner_data", "createSpawnInLegacyCell - Creature could not be created for dungeon: "+dungeon); - return null; - } - - setObjVar(creature, "dungeon", dungeon); - create.addDestroyMessage(creature, creatureName+"Dead", 300f, dungeon); - return creature; - } - - - public static boolean spawnObjectsInDungeonFromTable(obj_id dungeon, String planet, String table) throws InterruptedException - { - if (!isValidId(dungeon)) - { - return false; - } - - if (table == null || table.length() <= 0) - { - return false; - } - - if (planet == null || planet.length() <= 0) - { - return false; - } - - int numberOfObjectsToSpawn = dataTableGetNumRows(table); - if (numberOfObjectsToSpawn <= 0) - { - return false; - } - - for (int i = 0; i < numberOfObjectsToSpawn; i++) - { - testAbortScript(); - dictionary objToSpawn = dataTableGetRow(table, i); - if (objToSpawn == null) - { - continue; - } - - String object = objToSpawn.getString("object"); - if (object == null || object.length() <= 0) - { - continue; - } - - float xCoord = objToSpawn.getFloat("loc_x"); - float yCoord = objToSpawn.getFloat("loc_y"); - float zCoord = objToSpawn.getFloat("loc_z"); - float yaw = objToSpawn.getFloat("yaw"); - - String spawnRoom = objToSpawn.getString("room"); - if (spawnRoom == null || spawnRoom.length() <= 0) - { - continue; - } - - obj_id room = getCellId(dungeon, spawnRoom); - if (!isValidId(room)) - { - continue; - } - - location objectLocation = new location (xCoord, yCoord, zCoord, planet, room); - - obj_id objectCreated = createObject(object, objectLocation); - if (!isValidId(objectCreated)) - { - continue; - } - - setYaw(objectCreated, yaw); - - String script = objToSpawn.getString("script"); - if (script == null || script.length() <= 0) - { - continue; - } - - if (script != null && script.length() > 0) - { - - String[] scripts = split(script, ','); - for (int j = 0; j < scripts.length; j++) - { - testAbortScript(); - if (!hasScript(objectCreated, scripts[j])) - { - attachScript(objectCreated, scripts[j]); - } - } - } - - String objVars = objToSpawn.getString("objvar"); - if (objVars != null && objVars.length() > 0) - { - utils.setObjVarsListUsingSemiColon(objectCreated, objVars); - } - - String objName = objToSpawn.getString("name"); - if (objName != null && objName.length() > 0) - { - setName(objectCreated, objName); - } - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/static_item.java b/sku.0/sys.server/compiled/game/script/library/static_item.java deleted file mode 100644 index adb50355f..000000000 --- a/sku.0/sys.server/compiled/game/script/library/static_item.java +++ /dev/null @@ -1,2695 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.jedi; -import java.lang.Math; -import script.library.loot; -import script.library.storyteller; - - -public class static_item extends script.base_script -{ - public static_item() - { - } - public static final int NUM_DYNAMIC_MODIFIERS = 3; - - public static final String MASTER_ITEM_TABLE = "datatables/item/master_item/master_item.iff"; - public static final String WEAPON_STAT_BALANCE_TABLE = "datatables/item/master_item/weapon_stats.iff"; - public static final String ARMOR_STAT_BALANCE_TABLE = "datatables/item/master_item/armor_stats.iff"; - public static final String ITEM_STAT_BALANCE_TABLE = "datatables/item/master_item/item_stats.iff"; - public static final String WEAPON_EXAMINE_SCRIPT = "systems.combat.combat_weapon"; - public static final string_id SID_NOT_LINKED = new string_id("base_player", "not_linked"); - public static final string_id SID_NOT_LINKED_TO_HOLDER = new string_id("base_player", "not_linked_to_holder"); - public static final string_id ALREADY_HAVE_SIMILAR_BUFF = new string_id("base_player", "already_have_similar_buff"); - public static final string_id BUFF_APPLIED = new string_id("base_player", "buff_applied"); - public static final string_id SID_ITEM_LEVEL_TOO_LOW = new string_id("base_player", "level_too_low_for_effect"); - public static final string_id SID_UNIQUE_NO_CREATE = new string_id("base_player", "unique_failed_create"); - public static final string_id SID_ITEM_NOT_ENOUGH_SKILL = new string_id("base_player", "not_correct_skill"); - public static final String STATIC_ITEM_NAME = "static_item_n"; - public static final String ORIG_OWNER = "origOwner"; - - public static final int IT_WEAPON = 1; - public static final int IT_ARMOR = 2; - public static final int IT_ITEM = 3; - - public static final java.text.NumberFormat noDecimalFormat = new java.text.DecimalFormat("###"); - - public static final String SET_BONUS_TABLE = "datatables/item/item_sets.iff"; - - - public static obj_id createNewItemFunction(String itemName, obj_id container) throws InterruptedException - { - return createNewItemFunction (itemName, container, null); - } - - - public static obj_id createNewItemFunction(String itemName, obj_id container, location pos) throws InterruptedException - { - - if (itemName == null || itemName.equals("")) - { - LOG( "loot", itemName + " could not be made because itemName is null"); - return null; - } - if (isIdNull(container)) - { - LOG( "loot", itemName + " could not be made because inital container is bad "+container ); - return null; - } - - if (isUniqueStaticItem(itemName)) - { - if (!canCreateUniqueStaticItem(container, itemName)) - { - sendSystemMessage(container, SID_UNIQUE_NO_CREATE); - return null; - } - } - - dictionary itemData = new dictionary(); - itemData = dataTableGetRow(MASTER_ITEM_TABLE, itemName); - if (itemData == null) - { - LOG( "loot", itemName + " could not be made because row in datatable is bad"); - return null; - } - - if (getContainerType(container) != 2 && pos == null) - { - container = utils.getInventoryContainer(container); - - if (getContainerType(container) != 2) - { - LOG( "loot", itemName + " could not be made because we failed the inventory container check"); - return null; - } - } - - obj_id newItem = null; - - if (pos != null) - { - if (isValidInteriorLocation(pos)) - { - newItem = createObject (itemData.getString ("template_name"), pos); - } - } - else - { - - if (utils.isNestedWithinAPlayer(container)) - { - newItem = createObjectOverloaded(itemData.getString ("template_name"), container); - } - else - { - newItem = createObject(itemData.getString ("template_name"), container, ""); - } - } - - if (!isIdValid(newItem)) - { - LOG( "loot", itemName + " could not be made because item is not valid"); - return null; - } - - setStaticItemName(newItem, itemName ); - String objVarList = itemData.getString("creation_objvars"); - - if (objVarList != null && !objVarList.equals("")) - { - utils.setObjVarsList(newItem, objVarList); - } - - setStaticItemVersion(newItem, itemData.getInt("version")); - - int chargeList = itemData.getInt("charges"); - - if (chargeList > 0 && chargeList <= 500) - { - setCount(newItem, chargeList); - } - - initializeObject(newItem, itemData); - - return newItem; - } - - - public static void initializeObject(obj_id object, dictionary itemData) throws InterruptedException - { - - String scriptList = itemData.getString("scripts"); - String itemName = itemData.getString("name"); - - if (itemName == null || itemName.equals("")) - { - LOG( "create", object + " InitializeObject FAILED: No NAME field in datatable or bad dictionary passed in"); - return; - } - - if (scriptList != null && !scriptList.equals("")) - { - String[] scriptArray = split(scriptList, ','); - for (int i = 0; i < scriptArray.length; i++) - { - testAbortScript(); - if (!hasScript(object,scriptArray[i])) - { - attachScript( object, scriptArray[i] ); - } - } - } - - attachScript(object, "item.static_item_base"); - - if (!jedi.isCrystalTuned(object)) - { - setName(object, ""); - } - - if (exists(object) && !hasObjVar (object, "playerQuest")) - { - setName(object, new string_id("static_item_n", itemName)); - } - - setDescriptionStringId(object, new string_id("static_item_d", itemName)); - LOG("npe", "MAKING THING"); - switch (itemData.getInt("type")) - { - case 1: - initializeWeapon(object,itemName); - break; - case 2: - initializeArmor(object,itemName); - break; - case 3: - initializeItem(object,itemName); - break; - case 4: - initializeStorytellerObject(object, itemName); - break; - case 5: - break; - } - - return; - } - - - public static boolean initializeArmor(obj_id object, String itemName) throws InterruptedException - { - - dictionary itemData = new dictionary(); - - int row = dataTableSearchColumnForString( itemName , 0, ARMOR_STAT_BALANCE_TABLE); - if (row == -1) - { - return false; - } - itemData = dataTableGetRow(ARMOR_STAT_BALANCE_TABLE, row); - - float condition = itemData.getFloat("condition_multiplier"); - float generalProtection = itemData.getFloat("protection"); - int armorLevel = itemData.getInt("armor_level"); - int armorCategory = itemData.getInt("armor_category"); - int sockets = itemData.getInt("sockets"); - int hitPoints = itemData.getInt("hit_points"); - String skillMods = itemData.getString("skill_mods"); - String attributeBonus = itemData.getString("attribute_bonus"); - String objVarList = itemData.getString("objvars"); - String colorMods = itemData.getString("color"); - - armor.setArmorDataPercent(object, armorLevel, armorCategory, generalProtection, condition); - - if (armorCategory == 0) - { - armor.setArmorSpecialProtectionPercent(object, armor.DATATABLE_RECON_LAYER, 1.0f); - } - if (armorCategory == 2) - { - armor.setArmorSpecialProtectionPercent(object, armor.DATATABLE_ASSAULT_LAYER, 1.0f); - } - - setMaxHitpoints(object, hitPoints); - setHitpoints(object, hitPoints); - - if (sockets > 0) - { - setSkillModSockets(object, 1); - } - else - { - setSkillModSockets(object, 0); - } - - if (attributeBonus != null && !attributeBonus.equals("")) - { - - String[] stringArray = split(attributeBonus, ','); - for (int i = 0; i < stringArray.length; i++) - { - testAbortScript(); - - String[] attributeArray = split(stringArray[i], '='); - for (int x = 0; x < attributeArray.length; x++) - { - testAbortScript(); - int attribute = 0; - if (attributeArray[0].equalsIgnoreCase ("health")) - { - attribute = HEALTH; - } - else if (attributeArray[0].equalsIgnoreCase ("action")) - { - attribute = ACTION; - } - else if (attributeArray[0].equalsIgnoreCase ("mind")) - { - attribute = MIND; - } - else if (attributeArray[0].equalsIgnoreCase ("constitution")) - { - attribute = CONSTITUTION; - } - else if (attributeArray[0].equalsIgnoreCase ("stamina")) - { - attribute = STAMINA; - } - else if (attributeArray[0].equalsIgnoreCase ("willpower")) - { - attribute = WILLPOWER; - } - - setAttributeBonus(object, attribute, utils.stringToInt(attributeArray[1])); - } - } - - } - - dictionary dict = parseSkillModifiers(null, skillMods); - if (dict != null) - { - java.util.Enumeration keys = dict.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String skillModName = (String)keys.nextElement(); - int skillModValue = dict.getInt(skillModName); - setSkillModBonus(object, skillModName, skillModValue); - } - } - - if (objVarList != null && !objVarList.equals("")) - { - utils.setObjVarsList(object, objVarList); - } - - if (colorMods != null && !colorMods.equals("")) - { - String[] colorArray = split(colorMods, ','); - for (int i = 0; i < colorArray.length; i++) - { - testAbortScript(); - - String[] colorIndex = split(colorArray[i], '='); - for (int x = 0; x < colorIndex.length; x++) - { - testAbortScript(); - hue.setColor(object, "/private/"+colorIndex[0], Integer.parseInt(colorIndex[1])); - - } - } - } - - return true; - } - - - public static boolean initializeWeapon(obj_id object, String itemName) throws InterruptedException - { - - dictionary itemData = new dictionary(); - - int row = dataTableSearchColumnForString( itemName , 0, WEAPON_STAT_BALANCE_TABLE); - if (row == -1) - { - return false; - } - itemData = dataTableGetRow(WEAPON_STAT_BALANCE_TABLE, row); - - int minDamage = itemData.getInt("min_damage"); - int maxDamage = itemData.getInt("max_damage"); - int attackSpeed = itemData.getInt("attack_speed"); - int woundChance = itemData.getInt("wound_chance"); - int hp = itemData.getInt("hit_points"); - int accuracy = itemData.getInt("accuracy"); - int minRange = itemData.getInt("min_range_distance"); - int maxRange = itemData.getInt("max_range_distance"); - int attackCost = itemData.getInt("special_attack_cost"); - int elementalType = itemData.getInt("elemental_type"); - int elementalDamage = itemData.getInt("elemental_damage"); - int damageType = itemData.getInt("damage_type"); - String skillMods = itemData.getString("skill_mods"); - String objVarList = itemData.getString("objvars"); - - if (damageType == 1) - { - damageType = DAMAGE_KINETIC; - } - else - { - damageType = DAMAGE_ENERGY; - } - - if (!hasScript(object, WEAPON_EXAMINE_SCRIPT)) - { - attachScript(object, WEAPON_EXAMINE_SCRIPT); - } - - setObjVar(object, "weapon.original_max_range", (float)maxRange); - - setWeaponMinDamage(object, minDamage); - setWeaponMaxDamage(object, maxDamage); - setWeaponAttackSpeed(object, (float)attackSpeed/100.0f); - setWeaponWoundChance(object, (float)woundChance/10.0f); - setMaxHitpoints(object,(hp)); - setHitpoints(object,(hp)); - setWeaponAccuracy(object, accuracy); - setWeaponDamageType(object, damageType); - setWeaponRangeInfo(object, (float)minRange, (float) maxRange); - setWeaponAttackCost(object, attackCost); - setWeaponElementalDamage(object, elementalType, elementalDamage); - weapons.setHeavyWeaponAoeSplashPercent(object); - - if (objVarList != null && !objVarList.equals("")) - { - utils.setObjVarsList(object, objVarList); - } - - dictionary dict = parseSkillModifiers(null, skillMods); - if (dict != null) - { - java.util.Enumeration keys = dict.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String skillModName = (String)keys.nextElement(); - int skillModValue = dict.getInt(skillModName); - setSkillModBonus(object, skillModName, skillModValue); - } - } - weapons.setWeaponData(object); - - return true; - } - - - public static boolean initializeItem(obj_id object, String itemName) throws InterruptedException - { - - dictionary itemData = new dictionary(); - - int row = dataTableSearchColumnForString( itemName , 0, ITEM_STAT_BALANCE_TABLE); - if (row == -1) - { - return false; - } - itemData = dataTableGetRow(ITEM_STAT_BALANCE_TABLE, row); - - String skillMods = itemData.getString("skill_mods"); - String attributeBonus = itemData.getString("attribute_bonus"); - String objVarList = itemData.getString("objvars"); - String colorMods = itemData.getString("color"); - - if (attributeBonus != null && !attributeBonus.equals("")) - { - - String[] stringArray = split(attributeBonus, ','); - for (int i = 0; i < stringArray.length; i++) - { - testAbortScript(); - - String[] attributeArray = split(stringArray[i], '='); - for (int x = 0; x < attributeArray.length; x++) - { - testAbortScript(); - int attribute = 0; - if (attributeArray[0].equalsIgnoreCase ("health")) - { - attribute = HEALTH; - } - else if (attributeArray[0].equalsIgnoreCase ("action")) - { - attribute = ACTION; - } - else if (attributeArray[0].equalsIgnoreCase ("constitution")) - { - attribute = CONSTITUTION; - } - else if (attributeArray[0].equalsIgnoreCase ("stamina")) - { - attribute = STAMINA; - } - - setAttributeBonus(object, attribute, utils.stringToInt(attributeArray[1])); - } - } - - } - - dictionary dict = parseSkillModifiers(null, skillMods); - if (dict != null) - { - java.util.Enumeration keys = dict.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String skillModName = (String)keys.nextElement(); - int skillModValue = dict.getInt(skillModName); - setSkillModBonus(object, skillModName, skillModValue); - } - } - - if (objVarList != null && !objVarList.equals("")) - { - utils.setObjVarsList(object, objVarList); - } - - if (colorMods != null && !colorMods.equals("")) - { - String[] colorArray = split(colorMods, ','); - for (int i = 0; i < colorArray.length; i++) - { - testAbortScript(); - - String[] colorIndex = split(colorArray[i], '='); - for (int x = 0; x < colorIndex.length; x++) - { - testAbortScript(); - hue.setColor(object, "/private/"+colorIndex[0], Integer.parseInt(colorIndex[1])); - - } - } - } - - return true; - } - - - public static boolean initializeStorytellerObject(obj_id newObject, String itemName) throws InterruptedException - { - - dictionary itemData = new dictionary(); - if (!dataTableOpen(storyteller.STORYTELLER_DATATABLE)) - { - return false; - } - - int row = dataTableSearchColumnForString( itemName , "name", storyteller.STORYTELLER_DATATABLE); - if (row == -1) - { - return false; - } - - itemData = dataTableGetRow(storyteller.STORYTELLER_DATATABLE, row); - - String template = itemData.getString("template_name"); - int type = itemData.getInt("type"); - String objvarString = itemData.getString("objvar"); - String scriptString = itemData.getString("scripts"); - - setObjVarString(newObject, objvarString, type); - setScriptString(newObject, scriptString, type); - - setName(newObject, getString(new string_id("static_item_n", itemName)) + getString(new string_id("storyteller", "token_label"))); - - return true; - } - - - public static void setObjVarString(obj_id object, String objVarString) throws InterruptedException - { - setObjVarString(object, objVarString, -1); - } - - - public static void setObjVarString(obj_id object, String objVarString, int type) throws InterruptedException - { - - switch (type) - { - case storyteller.PROP: - break; - case storyteller.STATIC_EFFECT: - break; - case storyteller.IMMEDIATE_EFFECT: - break; - case storyteller.COMBAT_NPC: - break; - case storyteller.FLAVOR_NPC: - break; - case storyteller.OTHER: - break; - case storyteller.THEATER: - break; - } - - if (objVarString == null || objVarString.equals("") || objVarString.equals("none")) - { - return; - } - - String[] parse = split(objVarString, ','); - - if (parse == null || parse.length == 0) - { - return; - } - - for (int i=0; i 0) - { - - if (playerLevel < requiredLevel) - { - return false; - } - } - } - - return true; - } - - - public static boolean validateLevelRequiredForWornEffect(obj_id player, obj_id item) throws InterruptedException - { - int playerLevel = getLevel(player); - String itemName = getStaticItemName(item); - dictionary itemData = getStaticObjectTypeDictionary(itemName); - - if (itemData != null) - { - int requiredLevel = itemData.getInt("required_level_for_effect"); - if (requiredLevel > 0) - { - - if (playerLevel < requiredLevel) - { - return false; - } - } - } - - return true; - } - - - public static void decrementStaticItem(obj_id item) throws InterruptedException - { - if (!isIdValid(item)) - { - return; - } - - int count = getCount(item); - count--; - - if (count <= 0) - { - destroyObject(item); - } - else - { - setCount(item, count); - } - } - - - public static void decrementStaticItemAmount(obj_id item, int amount) throws InterruptedException - { - if (!isIdValid(item)) - { - return; - } - - int count = getCount(item); - int newCount = count - amount; - - if (count < amount) - { - return; - } - else if (newCount <= 0) - { - destroyObject(item); - } - else - { - setCount(item, newCount); - } - } - - - public static void decrementUnstackedStaticItemAmount(obj_id[] items, int amount) throws InterruptedException - { - int totalCount = amount; - - for (int i = 0; i < items.length; i++) - { - testAbortScript(); - int itemCount = getCount(items[i]); - - if (itemCount <= totalCount) - { - destroyObject(items[i]); - } - else if (itemCount > totalCount) - { - totalCount = itemCount - totalCount; - setCount(items[i], totalCount); - return; - } - - totalCount = totalCount - itemCount; - } - } - - - public static dictionary getMasterItemDictionary(String itemName) throws InterruptedException - { - if (itemName == null || itemName.equals("")) - { - LOG( "create", " Bad itemName passed into the getMasterItemDictionary "+itemName ); - return null; - } - - dictionary itemData = new dictionary(); - itemData = dataTableGetRow(MASTER_ITEM_TABLE, itemName); - if (itemData == null) - { - LOG( "create", itemName + " Initalize from getMasterItemDictionary could not happen because row in datatable is bad"); - return null; - } - - return itemData; - } - - - public static dictionary getMasterItemDictionary(obj_id item) throws InterruptedException - { - if (isIdValid(item)) - { - String itemName = getStaticItemName(item); - if (itemName == null || itemName.equals("")) - { - CustomerServiceLog( "static_item", item + " BAD ITEM:No Static Item Name this item needs to be fixed by adding a value to objvar staticItem"); - return null; - } - return getMasterItemDictionary (itemName); - } - else - { - LOG( "create","Bad item passed into the getMasterItemDictionary, bailing out"); - return null; - } - } - - - public static boolean isStaticItem(obj_id item) throws InterruptedException - { - String itemName = getStaticItemName(item); - if (itemName == null || itemName.equals("")) - { - return false; - } - else - { - return true; - } - } - - - public static boolean isStaticItem(String itemName) throws InterruptedException - { - int rowNum = dataTableSearchColumnForString(itemName, 0, MASTER_ITEM_TABLE); - - return rowNum != -1; - } - - - public static int getStaticObjectType(String itemName) throws InterruptedException - { - return dataTableGetInt(MASTER_ITEM_TABLE, itemName, "type"); - } - - - public static int getStaticObjectValue(String itemName) throws InterruptedException - { - return dataTableGetInt(MASTER_ITEM_TABLE, itemName, "value"); - } - - - public static dictionary getStaticObjectTypeDictionary(String itemName) throws InterruptedException - { - if (itemName == null || itemName.equals("")) - { - LOG( "create", " Itemname is Bad "+itemName ); - return null; - } - - dictionary itemData = null; - switch (getStaticObjectType(itemName)) - { - case 1: - itemData = getStaticItemWeaponDictionary(itemName); - break; - case 2: - itemData = getStaticArmorDictionary(itemName); - break; - case 3: - itemData = getStaticItemDictionary(itemName); - break; - } - - return itemData; - - } - - - public static dictionary getStaticItemWeaponDictionary(String itemName) throws InterruptedException - { - if (itemName == null || itemName.equals("")) - { - LOG( "create", " Itemname is Bad "+itemName ); - return null; - } - - dictionary itemData = new dictionary(); - itemData = dataTableGetRow(WEAPON_STAT_BALANCE_TABLE, itemName); - if (itemData == null) - { - LOG( "create", itemName + " Initalize from getStaticItemWeaponDictionary could not happen because row in datatable is bad"); - } - - return itemData; - } - - - public static dictionary getStaticItemWeaponDictionary(obj_id item) throws InterruptedException - { - if (isIdValid(item)) - { - String itemName = getStaticItemName(item); - return getStaticItemWeaponDictionary (itemName); - } - else - { - LOG( "create","Bad item passed into the getWeaponDictionary, bailing out"); - return null; - } - } - - - public static dictionary getStaticItemDictionary(String itemName) throws InterruptedException - { - if (itemName == null || itemName.equals("")) - { - LOG( "create", " Itemname is Bad "+itemName ); - return null; - } - - dictionary itemData = new dictionary(); - itemData = dataTableGetRow(ITEM_STAT_BALANCE_TABLE, itemName); - if (itemData == null) - { - LOG( "create", itemName + " Initalize from getStaticItemDictionary could not happen because row in datatable is bad"); - } - - return itemData; - } - - - public static dictionary getStaticItemDictionary(obj_id item) throws InterruptedException - { - if (isIdValid(item)) - { - String itemName = getStaticItemName(item); - return getStaticItemDictionary (itemName); - } - else - { - LOG( "create","Bad item passed into the getStaticItemDictionary, bailing out"); - return null; - } - } - - - public static dictionary getStaticArmorDictionary(String itemName) throws InterruptedException - { - if (itemName == null || itemName.equals("")) - { - LOG( "create", " Itemname is Bad "+itemName ); - return null; - } - - dictionary itemData = new dictionary(); - itemData = dataTableGetRow(ARMOR_STAT_BALANCE_TABLE, itemName); - if (itemData == null) - { - LOG( "create", itemName + " Initalize from getStaticArmorDictionary could not happen because row in datatable is bad"); - } - - return itemData; - } - - - public static dictionary getStaticArmorDictionary(obj_id item) throws InterruptedException - { - if (isIdValid(item)) - { - String itemName = getStaticItemName(item); - return getStaticArmorDictionary (itemName); - } - else - { - LOG( "create","Bad armor passed into the getStaticArmorDictionary, bailing out"); - return null; - } - } - - - public static void versionUpdate(obj_id self, dictionary itemData) throws InterruptedException - { - - String itemName = itemData.getString("name"); - obj_id player = utils.getContainingPlayer(self); - obj_id bioLink = getBioLink(self); - - String currentTemplate = getTemplateName(self); - String staticName = getStaticItemName(self); - if (staticName.equals("") || staticName == null) - { - return; - } - - int itemRow = dataTableSearchColumnForString(staticName, "name", MASTER_ITEM_TABLE); - - String tableTemplate = dataTableGetString(MASTER_ITEM_TABLE, itemRow, "template_name"); - - if (!currentTemplate.equals(tableTemplate)) - { - CustomerServiceLog("versionUpdate: ", "Old Item's ("+ self + ") object template has changed. A new one must be created."); - - obj_id container = getContainedBy(self); - if (isIdValid(container)) - { - - obj_id newItem = createNewItemFunction(staticName, getContainedBy(self)); - if (isIdValid(newItem)) - { - - if (isIdValid(player)) - { - CustomerServiceLog("versionUpdate: ", "New Item ("+ newItem + ") has been created in "+ getPlayerName(player) + "("+player+")'s inventory."); - } - else - { - obj_id newItemsContainer = getContainedBy(newItem); - CustomerServiceLog("versionUpdate: ", "New Item ("+ newItem + ") has been created in container ("+ newItemsContainer + ")."); - } - CustomerServiceLog("versionUpdate: ", "Now deleting the old object ("+ self + ")."); - - if (bioLink != null && bioLink != utils.OBJ_ID_BIO_LINK_PENDING) - { - setBioLink(newItem, bioLink); - } - - destroyObject(self); - } - else - { - CustomerServiceLog("versionUpdate: ", "A new version was NOT created, so we will NOT destroy old item ("+self+")"); - } - } - else - { - CustomerServiceLog("versionUpdate: ", "Old Item ("+ self + ") returned an invalid container, we will NOT destroy it."); - } - - return; - } - - detachAllScripts(self); - removeWornBuffs(self, player); - checkForRemoveSetBonus(self, player); - removeAllObjVars(self); - - if (bioLink != null && bioLink != utils.OBJ_ID_BIO_LINK_PENDING) - { - setBioLink(self, bioLink); - } - - setStaticItemName(self, itemName ); - String objVarList = itemData.getString("creation_objvars"); - - if (objVarList != null && !objVarList.equals("")) - { - utils.setObjVarsList(self, objVarList); - } - - setStaticItemVersion(self, itemData.getInt("version")); - - int chargeList = itemData.getInt("charges"); - - if (chargeList > 0 && chargeList <= 500) - { - setCount(self, chargeList); - } - - initializeObject(self, itemData); - - return; - } - - - public static void validateWornEffects(obj_id player) throws InterruptedException - { - obj_id[] equipSlots = metrics.getWornItems(player); - if (equipSlots != null && equipSlots.length > 0) - { - for (int i = 0; i < equipSlots.length; i++) - { - testAbortScript(); - String itemName = getStaticItemName(equipSlots[i]); - if (itemName != null && !itemName.equals("")) - { - dictionary itemData = getStaticObjectTypeDictionary(itemName); - if (itemData != null) - { - String buffName = itemData.getString("buff_name"); - if (buffName != null && !buffName.equals("")) - { - if (validateLevelRequiredForWornEffect(player,(equipSlots[i]))) - { - applyWornBuffs(equipSlots[i], getContainedBy(equipSlots[i])); - checkForAddSetBonus(equipSlots[i], getContainedBy(equipSlots[i])); - } - } - } - } - } - } - } - - - public static void applyWornBuffs(obj_id self, obj_id player) throws InterruptedException - { - - if (hasScript(self, "item.armor.biolink_item_non_faction")) - { - - obj_id bioLinked = getBioLink(self); - if (bioLinked == null || bioLinked == utils.OBJ_ID_BIO_LINK_PENDING) - { - sendSystemMessage(player, SID_NOT_LINKED); - return; - - } - if (bioLinked != player) - { - sendSystemMessage(player, SID_NOT_LINKED_TO_HOLDER); - return; - } - } - - String itemName = getStaticItemName(self); - if (itemName == null || itemName.equals("")) - { - LOG( "create", "Worn Buff Itemname bad, name is "+itemName ); - return; - } - - dictionary itemData = getStaticObjectTypeDictionary(itemName); - - if (itemData == null) - { - LOG( "create", itemName + "Worn Buff Apply could not happen because row in datatable is bad"); - return; - } - - String buffName = itemData.getString("buff_name"); - String clientEffect = itemData.getString("client_effect"); - int requiredLevel = itemData.getInt("required_level_for_effect"); - int playerLevel = getLevel(player); - - if (buffName == null || buffName.equals("")) - { - LOG( "create","Worn Buff Name is bad"); - return; - } - - if (static_item.validateLevelRequired(player,requiredLevel)) - { - if (buff.canApplyBuff(player, buffName)) - { - buff.applyBuff(player, buffName); - - playClientEffectObj(player, clientEffect, player, ""); - } - else - { - utils.setScriptVar(self,"buffNotApplied", true); - sendSystemMessage(player, ALREADY_HAVE_SIMILAR_BUFF); - return; - } - } - else - { - utils.setScriptVar(self,"buffNotApplied", true); - sendSystemMessage(player, SID_ITEM_LEVEL_TOO_LOW); - return; - } - - return; - } - - - public static void removeWornBuffs(obj_id self, obj_id player) throws InterruptedException - { - - String itemName = getStaticItemName(self); - if (itemName == null || itemName.equals("")) - { - LOG( "create", "Worn Buff Itemname bad, name is "+itemName ); - return; - } - - dictionary itemData = getStaticObjectTypeDictionary(itemName); - - if (itemData == null) - { - LOG( "create", itemName + "Worn Buff Remove could not happen because row in datatable is bad"); - return; - } - - String buffName = itemData.getString("buff_name"); - - if (buffName == null || buffName.equals("")) - { - LOG( "create","Remove Buff Name is bad"); - return; - } - - if (!utils.hasScriptVar(self, "buffNotApplied")) - { - buff.removeBuff(player, buffName); - } - else - { - utils.removeScriptVar(self, "buffNotApplied"); - } - - return; - } - - - public static void checkForAddSetBonus(obj_id item, obj_id player) throws InterruptedException - { - if (!isSetBonusItem(item)) - { - return; - } - - int setBonusIndex = getSetBonusIndex(item); - int numberOfSetItems = getNumSetItems(player, item, setBonusIndex); - String setBonusBuffName = getSetBonusBuffName(item, setBonusIndex, numberOfSetItems); - - if (!setBonusBuffName.equals(null) && !setBonusBuffName.equals("none")) - { - if (!buff.hasBuff(player, setBonusBuffName)) - { - buff.applyBuff(player, setBonusBuffName); - sendSystemMessage(player, new string_id("set_bonus", setBonusBuffName + "_sys")); - } - } - - return; - } - - - public static void checkForRemoveSetBonus(obj_id item, obj_id player) throws InterruptedException - { - if (!isSetBonusItem(item)) - { - return; - } - - int setBonusIndex = getSetBonusIndex(item); - int numberOfSetItems = getNumSetItems(player, item, setBonusIndex); - String setBonusBuffName = getSetBonusBuffName(item, setBonusIndex, numberOfSetItems + 1); - - if (!setBonusBuffName.equals(null) && !setBonusBuffName.equals("none")) - { - if (buff.hasBuff(player, setBonusBuffName)) - { - buff.removeBuff(player, setBonusBuffName); - } - - String lowerSetBonusBuffName = getSetBonusBuffName(item, setBonusIndex, numberOfSetItems); - - if (!lowerSetBonusBuffName.equals(null) && !setBonusBuffName.equals("none")) - { - if (!buff.hasBuff(player, lowerSetBonusBuffName)) - { - buff.applyBuff(player, lowerSetBonusBuffName); - } - } - } - - return; - } - - - public static boolean isSetBonusItem(obj_id item) throws InterruptedException - { - return hasScript(item, "item.set_bonus_item"); - } - - - public static int getSetBonusIndex(obj_id item) throws InterruptedException - { - int setBonusIndex = -1; - - if (!isIdValid(item)) - { - return setBonusIndex; - } - - if (hasObjVar(item, "item.set.set_id")) - { - setBonusIndex = getIntObjVar(item, "item.set.set_id"); - } - else - { - sendSystemMessageTestingOnly(getContainedBy(item), "getSetBonusIndex called on object missing set bonus index objvar."); - } - - return setBonusIndex; - } - - - public static int getNumSetItems(obj_id player, obj_id item, int setBonusIndex) throws InterruptedException - { - int numSetItems = 0; - - if (setBonusIndex == -1) - { - return numSetItems; - } - - obj_id[] equippedItems = metrics.getWornItems(player); - - if (equippedItems != null && equippedItems.length > 0) - { - for (int i = 0; i < equippedItems.length; i++) - { - testAbortScript(); - if (isSetBonusItem(equippedItems[i])) - { - if (setBonusIndex == getSetBonusIndex(equippedItems[i])) - { - numSetItems++; - } - } - } - } - - return numSetItems; - } - - - public static String getSetBonusBuffName(obj_id item, int setBonusIndex, int numberOfSetItems) throws InterruptedException - { - String setBonusBuffName = "none"; - - int numTableRows = dataTableGetNumRows(SET_BONUS_TABLE); - - for (int i = 0; i < numTableRows; i++) - { - testAbortScript(); - int thisRowSetBonusIndex = dataTableGetInt(SET_BONUS_TABLE, i, "SETID"); - int thisRowNumberOfSetItems = dataTableGetInt(SET_BONUS_TABLE, i, "NUM_ITEMS"); - - if (setBonusIndex == thisRowSetBonusIndex && numberOfSetItems == thisRowNumberOfSetItems) - { - setBonusBuffName = dataTableGetString(SET_BONUS_TABLE, i, "EFFECT"); - return setBonusBuffName; - } - - } - - return setBonusBuffName; - } - - - public static String getItemType(String itemName) throws InterruptedException - { - dictionary itemData = new dictionary(); - itemData = dataTableGetRow(MASTER_ITEM_TABLE, itemName); - if (itemData == null) - { - return ""; - } - - switch (itemData.getInt("type")) - { - case 1: - return "weapon"; - case 2: - return "armor"; - case 3: - return "item"; - } - - return ""; - } - - - public static dictionary getMergedItemDictionary(String itemName) throws InterruptedException - { - dictionary masterItemData = getMasterItemDictionary(itemName); - String itemType = static_item.getItemType(itemName); - dictionary specificItemData = null; - if (itemType.equals("weapon")) - { - specificItemData = getStaticItemWeaponDictionary (itemName); - } - else if (itemType.equals("armor")) - { - specificItemData = getStaticArmorDictionary (itemName); - } - else if (itemType.equals("item")) - { - specificItemData = getStaticItemDictionary (itemName); - } - - if (specificItemData != null) - { - java.util.Enumeration e = specificItemData.keys(); - while (e.hasMoreElements()) - { - testAbortScript(); - String s = e.nextElement().toString(); - masterItemData.put(s, specificItemData.get(s)); - } - } - return masterItemData; - } - - - public static void getAttributes(obj_id player, String staticItemName, String[] names, String[] attribs) throws InterruptedException - { - String itemType = static_item.getItemType(staticItemName); - if (itemType.equals("weapon")) - { - getStaticWeaponObjectAttributes(player, staticItemName, names, attribs); - } - else if (itemType.equals("armor")) - { - getStaticArmorObjectAttributes(player, staticItemName, names, attribs); - } - else if (itemType.equals("item")) - { - getStaticItemObjectAttributes(player, staticItemName, names, attribs); - } - } - - - public static void getStaticWeaponObjectAttributes(obj_id player, String staticItemName, String[] names, String[] attribs) throws InterruptedException - { - String at = "@obj_attr_n:"; - int free = 0; - - dictionary itemData = static_item.getMergedItemDictionary(staticItemName); - - int levelRequired = itemData.getInt("required_level"); - names[free] = "healing_combat_level_required"; - attribs[free++] = "" + levelRequired; - - names[free] = "tooltip.healing_combat_level_required"; - attribs[free++] = "" + levelRequired; - - String skillRequired = itemData.getString("required_skill"); - String skillRequiredAttribute; - if (skillRequired != null && !skillRequired.equals("")) - { - skillRequiredAttribute = "@skl_n:"+ skillRequired; - } - else - { - skillRequiredAttribute = "None"; - } - - names[free] = "skillmodmin"; - attribs[free++] = skillRequiredAttribute; - - names[free] = "tooltip.skillmodmin"; - attribs[free++] = skillRequiredAttribute; - - int damageType = itemData.getInt("damage_type"); - String wpn_damage_type = "cat_wpn_damage.wpn_damage_type"; - names[free] = wpn_damage_type; - String damageTypeStr = "kinetic"; - if (damageType == 1) - { - damageTypeStr = "kinetic"; - } - else if (damageType == 2) - { - damageTypeStr = "energy"; - } - else - { - damageTypeStr = "unknown"; - } - attribs[free++] = at + "armor_eff_" + damageTypeStr; - - names[free] = "tooltip.wpn_damage_type"; - attribs[free++] = at + "armor_eff_" + damageTypeStr; - - int minDamage = itemData.getInt("min_damage"); - int maxDamage = itemData.getInt("max_damage"); - names[free] = "cat_wpn_damage.damage"; - String weaponDamage = Integer.toString(minDamage) + " - "+ Integer.toString(maxDamage); - attribs[free++] = weaponDamage; - - names[free] = "tooltip.damage"; - attribs[free++] = weaponDamage; - - names[free] = "cat_wpn_other.wpn_range"; - int minRange = itemData.getInt("min_range_distance"); - int maxRange = itemData.getInt("max_range_distance"); - String weaponRange = noDecimalFormat.format(minRange) + "-"+ noDecimalFormat.format(maxRange) + "m"; - attribs[free++] = weaponRange; - - names[free] = "tooltip.wpn_range"; - attribs[free++] = weaponRange; - - int tier = itemData.getInt("tier"); - names[free] = "tier"; - attribs[free++] = "" + tier; - - names[free] = "tooltip.tier"; - attribs[free++] = "" + tier; - - String skillMods = itemData.getString("skill_mods"); - dictionary dict = parseSkillModifiers(player, skillMods); - String statstf = "@stat_n:"; - - if (dict != null) - { - java.util.Enumeration keys = dict.keys(); - - while (keys.hasMoreElements()) - { - testAbortScript(); - String skillModName = (String)keys.nextElement(); - int skillModValue = dict.getInt(skillModName); - - names[free] = statstf + skillModName; - attribs[free++] = Integer.toString(skillModValue); - - names[free] = "tooltip." + statstf + skillModName; - attribs[free++] = Integer.toString(skillModValue); - } - } - } - - - public static void getStaticArmorObjectAttributes(obj_id player, String staticItemName, String[] names, String[] attribs) throws InterruptedException - { - String at = "@obj_attr_n:"; - int free = 0; - - dictionary itemData = static_item.getMergedItemDictionary(staticItemName); - - int levelRequired = itemData.getInt("required_level"); - names[free] = "healing_combat_level_required"; - attribs[free++] = "" + levelRequired; - - names[free] = "tooltip.healing_combat_level_required"; - attribs[free++] = "" + levelRequired; - - String skillRequired = itemData.getString("required_skill"); - String skillRequiredAttribute; - if (skillRequired != null && !skillRequired.equals("")) - { - skillRequiredAttribute = "@skl_n:"+ skillRequired; - } - else - { - skillRequiredAttribute = "None"; - } - - names[free] = "skillmodmin"; - attribs[free++] = skillRequiredAttribute; - - names[free] = "tooltip.skillmodmin"; - attribs[free++] = skillRequiredAttribute; - - int damageType = itemData.getInt("damage_type"); - String wpn_damage_type = "cat_wpn_damage.wpn_damage_type"; - names[free] = wpn_damage_type; - String damageTypeStr = "kinetic"; - if (damageType == 1) - { - damageTypeStr = "kinetic"; - } - else if (damageType == 2) - { - damageTypeStr = "energy"; - } - else - { - damageTypeStr = "unknown"; - } - attribs[free++] = at + "armor_eff_" + damageTypeStr; - - int tier = itemData.getInt("tier"); - names[free] = "tier"; - attribs[free++] = "" + tier; - - names[free] = "tooltip.tier"; - attribs[free++] = "" + tier; - - String skillMods = itemData.getString("skill_mods"); - dictionary dict = parseSkillModifiers(player, skillMods); - String statstf = "@stat_n:"; - - if (dict != null) - { - java.util.Enumeration keys = dict.keys(); - - while (keys.hasMoreElements()) - { - testAbortScript(); - String skillModName = (String)keys.nextElement(); - int skillModValue = dict.getInt(skillModName); - - names[free] = statstf + skillModName; - attribs[free++] = Integer.toString(skillModValue); - - names[free] = "tooltip." + statstf + skillModName; - attribs[free++] = Integer.toString(skillModValue); - } - } - - } - - - public static void getStaticItemObjectAttributes(obj_id player, String item_name, String[] names, String[] attribs) throws InterruptedException - { - String at = "@obj_attr_n:"; - int free = 0; - - dictionary itemData = static_item.getMergedItemDictionary(item_name); - - int requiredLevelToEquip = itemData.getInt("required_level"); - if (requiredLevelToEquip != 0) - { - names[free] = utils.packStringId(new string_id ("proc/proc", "required_combat_level")); - attribs[free++] = "" + requiredLevelToEquip; - names[free] = utils.packStringId(new string_id ("proc/proc", "tooltip.required_combat_level")); - attribs[free++] = "" + requiredLevelToEquip; - } - - String requiredSkillToEquip = itemData.getString("required_skill"); - if (requiredSkillToEquip != null && !requiredSkillToEquip.equals("")) - { - names[free] = utils.packStringId(new string_id ("proc/proc", "required_skill")); - attribs[free++] = utils.packStringId(new string_id ("ui_roadmap", requiredSkillToEquip)); - names[free] = utils.packStringId(new string_id ("proc/proc", "tooltip.required_skill")); - attribs[free++] = utils.packStringId(new string_id ("ui_roadmap", requiredSkillToEquip)); - } - - int reuseTime = itemData.getInt("reuse_time"); - if (reuseTime != 0) - { - names[free] = utils.packStringId(new string_id ("proc/proc", "reuse_time")); - attribs[free++] = "" + reuseTime + " / sec"; - names[free] = utils.packStringId(new string_id ("proc/proc", "tooltip.reuse_time")); - attribs[free++] = "" + reuseTime + " / sec"; - } - - if (reuseTime > 30) - { - names[free] = utils.packStringId(new string_id ("spam", "reuse_time_counted")); - - String coolDownGroup = itemData.getString("cool_down_group"); - String varName = "clickItem."+ coolDownGroup; - int current_time = getGameTime(); - int timestamp = -1; - - if (hasObjVar(player,varName)) - { - timestamp = getIntObjVar(player,varName); - } - - int time_remaining = timestamp - current_time; - - if (timestamp == -1 || time_remaining <= 0) - { - attribs[free] = "0"; - } - else - { - attribs[free] = utils.assembleTimeRemainToUse(time_remaining); - } - free++; - } - - int requiredLevelForEffect = itemData.getInt("required_level_for_effect"); - if (requiredLevelForEffect != 0) - { - names[free] = utils.packStringId(new string_id ("proc/proc", "effect_level")); - attribs[free++] = "" + requiredLevelForEffect; - names[free] = utils.packStringId(new string_id ("proc/proc", "tooltip.effect_level")); - attribs[free++] = "" + requiredLevelForEffect; - } - - String buffName = itemData.getString("buff_name"); - if (buffName != null && !buffName.equals("")) - { - names[free] = utils.packStringId(new string_id ("proc/proc", "proc_name")); - attribs[free++] = utils.packStringId(new string_id ("ui_buff", buffName)); - names[free] = utils.packStringId(new string_id ("proc/proc", "tooltip.proc_name")); - attribs[free++] = utils.packStringId(new string_id ("ui_buff", buffName)); - } - - String skillMods = itemData.getString("skill_mods"); - dictionary dict = parseSkillModifiers(player, skillMods); - String statstf = "@stat_n:"; - - if (dict != null) - { - java.util.Enumeration keys = dict.keys(); - - while (keys.hasMoreElements()) - { - testAbortScript(); - String skillModName = (String)keys.nextElement(); - int skillModValue = dict.getInt(skillModName); - - names[free] = statstf + skillModName; - attribs[free++] = Integer.toString(skillModValue); - - names[free] = "tooltip." + statstf + skillModName; - attribs[free++] = Integer.toString(skillModValue); - } - } - - int tier = itemData.getInt("tier"); - names[free] = "tier"; - attribs[free++] = "" + tier; - - names[free] = "tooltip.tier"; - attribs[free++] = "" + tier; - } - - - public static dictionary parseSkillModifiers(obj_id player, String skillMods) throws InterruptedException - { - dictionary dict = new dictionary(); - if (skillMods != null && !skillMods.equals("")) - { - String[] stringArray = split(skillMods, ','); - for (int i = 0; i < stringArray.length; i++) - { - testAbortScript(); - String[] modsArray = split(stringArray[i], '='); - for (int x = 0; x < modsArray.length; x+=2) - { - testAbortScript(); - dict.put(modsArray[0], utils.stringToInt(modsArray[1])); - } - } - } - return dict; - } - - - public static obj_id makeDynamicObject(String strName, obj_id objContainer, int intLevel) throws InterruptedException - { - int whatRow = -1; - if (intLevel > 90) - { - intLevel = 90; - } - if (intLevel < 1) - { - intLevel = 1; - } - String strBaseTable = "datatables/item/dynamic_item/types/"; - boolean boolIsWeapon = false; - if (strName.startsWith("dynamic_weapon")) - { - strBaseTable = strBaseTable+"weapons.iff"; - boolIsWeapon = true; - } - - else if (strName.startsWith("dynamic_armor") && intLevel > 21) - { - strBaseTable = strBaseTable + "armor.iff"; - } - else if (strName.startsWith("dynamic_clothing")) - { - strBaseTable = strBaseTable + "clothing.iff"; - } - else - { - return null; - } - - dictionary dctItemInfo = dataTableGetRow(strBaseTable, strName); - if (dctItemInfo == null) - { - return null; - } - String strAppearance = dctItemInfo.getString("strBaseAppearance"); - if (strAppearance.endsWith(".iff")) - { - - } - else - { - String[] strTemplates = dataTableGetStringColumnNoDefaults("datatables/item/dynamic_item/appearances/"+strAppearance+".iff", "strTemplate"); - if ((strTemplates == null)||(strTemplates.length < 1)) - { - return null; - } - - whatRow = rand(0, strTemplates.length-1); - strAppearance = strTemplates[whatRow]; - } - obj_id objObject = createObject(strAppearance, objContainer, ""); - - if (utils.hasScriptVar(objContainer, "theft_in_progress")) - { - loot.notifyThiefOfItemStolen(objContainer, objObject); - } - - if (!isIdValid(objObject)) - { - return null; - } - if (boolIsWeapon) - { - dictionary dctWeaponStats = dataTableGetRow("datatables/item/dynamic_item/root_balance_data/weapon_data.iff",intLevel); - return setupDynamicWeapon(objObject, strName, intLevel, dctWeaponStats, dctItemInfo, true); - } - - if (strName.startsWith("dynamic_armor")) - { - if (strName.startsWith("dynamic_armor_jedi")) - { - setObjVar(objObject, "dynamic_item.required_skill", "force_sensitive"); - } - - if (whatRow > -1) - { - String strAppearanceForReals = dctItemInfo.getString("strBaseAppearance"); - int indexColor = dataTableGetInt("datatables/item/dynamic_item/appearances/"+strAppearanceForReals+".iff", whatRow, "indexColor"); - int maxHue = dataTableGetInt("datatables/item/dynamic_item/appearances/"+strAppearanceForReals+".iff", whatRow, "maxHue"); - int datatableArmorType = dataTableGetInt("datatables/item/dynamic_item/appearances/"+strAppearanceForReals+".iff", whatRow, "armorType"); - - if (indexColor >= 0 && maxHue >= 0) - { - int thisHue = rand(0, maxHue); - hue.setColor(objObject, "/private/index_color_"+ indexColor, thisHue); - } - - if (datatableArmorType > -1) - { - setObjVar(objObject, "armor.armorCategory", datatableArmorType); - } - - } - - return setupDynamicArmor(objObject, intLevel, dctItemInfo, true); - } - - if (strName.startsWith("dynamic_clothing")) - { - - if (whatRow > -1) - { - String strAppearanceForReals = dctItemInfo.getString("strBaseAppearance"); - int indexColor = dataTableGetInt("datatables/item/dynamic_item/appearances/"+strAppearanceForReals+".iff", whatRow, "indexColor"); - int maxHue = dataTableGetInt("datatables/item/dynamic_item/appearances/"+strAppearanceForReals+".iff", whatRow, "maxHue"); - - if (indexColor >= 0 && maxHue >= 0) - { - int thisHue = rand(0, maxHue); - hue.setColor(objObject, "/private/index_color_"+ indexColor, thisHue); - } - } - setObjVar(objObject, "dynamic_item.intLevelRequired", intLevel); - generateItemStatBonuses(objObject, intLevel, dctItemInfo); - String strSuffix = getArmorNameSuffix(objObject); - dctItemInfo.put("strSuffix", strSuffix); - setupDynamicItemName(objObject, dctItemInfo); - attachScript(objObject, "item.armor.dynamic_armor"); - - int basePrice = (int)(Math.pow( (intLevel*12.0f), 1.3f) ); - - if (basePrice > 10200) - { - basePrice = 10200; - } - - setObjVar(objObject, "junkDealer.intPrice", basePrice); - int minPriceValue = 0; - int maxPriceValue = intLevel * 10; - setupJunkDealerPrice(objObject, minPriceValue, maxPriceValue, 0); - } - - return objObject; - } - - - public static obj_id setupDynamicArmor(obj_id objArmor, int intLevel) throws InterruptedException - { - - return setupDynamicArmor(objArmor, intLevel, null, false); - } - - - public static obj_id setupDynamicArmor(obj_id objArmor, int intLevel, dictionary dctItemInfo, boolean boolSetupData) throws InterruptedException - { - String armorBalanceTable = "datatables/item/dynamic_item/root_balance_data/armor_data.iff"; - String modifiersTable = "datatables/item/dynamic_item/modifiers/armor_mods.iff"; - String armorTypeTable = "datatables/item/dynamic_item/types/armor.iff"; - - int minLevel = dataTableGetInt(armorBalanceTable, 0, "minLevel"); - int protectIncreasePerLevel = dataTableGetInt(armorBalanceTable, 0, "protectIncreasePerLevel"); - int minRawProtection = dataTableGetInt(armorBalanceTable, 0, "minRawProtection"); - int maxRawProtection = dataTableGetInt(armorBalanceTable, 0, "maxRawProtection"); - float balanceMod = dataTableGetFloat(armorBalanceTable, 0, "balanceMod"); - float minBaseMod = dataTableGetFloat(armorBalanceTable, 0, "minBaseMod"); - float maxBaseMod = dataTableGetFloat(armorBalanceTable, 0, "maxBaseMod"); - float minPrimaryMod = dataTableGetFloat(armorBalanceTable, 0, "minPrimaryMod"); - float maxPrimaryMod = dataTableGetFloat(armorBalanceTable, 0, "maxPrimaryMod"); - float minSpecialMod = dataTableGetFloat(armorBalanceTable, 0, "minSpecialMod"); - float maxSpecialMod = dataTableGetFloat(armorBalanceTable, 0, "maxSpecialMod"); - float baseSpecialMod = dataTableGetFloat(armorBalanceTable, 0, "baseSpecialMod"); - - float baseMod = minBaseMod; - float primaryMod = minPrimaryMod; - float specialMod = minSpecialMod; - int armorTypeModRow = 0; - - if (boolSetupData) - { - - baseMod = rand(minBaseMod, maxBaseMod); - primaryMod = rand(minPrimaryMod, maxPrimaryMod); - specialMod = rand(minSpecialMod, maxSpecialMod); - armorTypeModRow = rand(0, dataTableGetNumRows(modifiersTable) - 1 ); - - setObjVar(objArmor, "dynamic_item.intLevelRequired", intLevel); - setObjVar(objArmor, "dynamic_item.baseMod", baseMod); - setObjVar(objArmor, "dynamic_item.primaryMod", primaryMod); - setObjVar(objArmor, "dynamic_item.specialMod", specialMod); - setObjVar(objArmor, "dynamic_item.armorTypeModRow", armorTypeModRow); - } - - else - { - baseMod = getFloatObjVar(objArmor, "dynamic_item.baseMod"); - primaryMod = getFloatObjVar(objArmor, "dynamic_item.primaryMod"); - specialMod = getFloatObjVar(objArmor, "dynamic_item.specialMod"); - armorTypeModRow = getIntObjVar(objArmor, "dynamic_item.armorTypeModRow"); - intLevel = getIntObjVar(objArmor, "dynamic_item.intLevelRequired"); - - if (baseMod < minBaseMod) - { - baseMod = minBaseMod; - setObjVar(objArmor, "dynamic_item.baseMod", baseMod); - } - - if (baseMod > maxBaseMod) - { - baseMod = maxBaseMod; - setObjVar(objArmor, "dynamic_item.baseMod", baseMod); - } - - if (primaryMod < minPrimaryMod) - { - primaryMod = minPrimaryMod; - setObjVar(objArmor, "dynamic_item.primaryMod", primaryMod); - } - if (primaryMod > maxPrimaryMod) - { - primaryMod = maxPrimaryMod; - setObjVar(objArmor, "dynamic_item.primaryMod", primaryMod); - } - - if (specialMod < minSpecialMod) - { - specialMod = minSpecialMod; - setObjVar(objArmor, "dynamic_item.specialMod", specialMod); - } - - if (specialMod > maxSpecialMod) - { - specialMod = maxSpecialMod; - setObjVar(objArmor, "dynamic_item.specialMod", specialMod); - } - - if (armorTypeModRow > dataTableGetNumRows(modifiersTable) - 1) - { - armorTypeModRow = dataTableGetNumRows(modifiersTable) - 1; - setObjVar(objArmor, "dynamic_item.armorTypeModRow", armorTypeModRow); - } - - if (armorTypeModRow < 0) - { - armorTypeModRow = 0; - setObjVar(objArmor, "dynamic_item.armorTypeModRow", armorTypeModRow); - } - - if (intLevel > 90) - { - intLevel = 90; - setObjVar(objArmor, "dynamic_item.intLevelRequired", intLevel); - } - - if (intLevel < 1) - { - intLevel = 1; - setObjVar(objArmor, "dynamic_item.intLevelRequired", intLevel); - } - } - - int rawProtection = ( (intLevel - minLevel) * protectIncreasePerLevel ) + minRawProtection; - rawProtection *= balanceMod; - - if (rawProtection > maxRawProtection) - { - rawProtection = maxRawProtection; - } - - dictionary armorTypeMods = dataTableGetRow(modifiersTable, armorTypeModRow); - float baseProtection = baseMod * rawProtection; - - float kinMod = armorTypeMods.getFloat("kinMod"); - float engMod = armorTypeMods.getFloat("engMod"); - - float kinProtFloat = (1 + (kinMod * primaryMod) ) * baseProtection; - float engProtFloat = (1 + (engMod * primaryMod) ) * baseProtection; - - float heatMod = armorTypeMods.getFloat("heatMod"); - float coldMod = armorTypeMods.getFloat("coldMod"); - float acidMod = armorTypeMods.getFloat("acidMod"); - float electMod = armorTypeMods.getFloat("electMod"); - - float heatProtFloat = (1 + (heatMod * specialMod) ) * baseProtection * baseSpecialMod; - float coldProtFloat = (1 + (coldMod * specialMod) ) * baseProtection * baseSpecialMod; - float acidProtFloat = (1 + (acidMod * specialMod) ) * baseProtection * baseSpecialMod; - float electProtFloat = (1 + (electMod * specialMod) ) * baseProtection * baseSpecialMod; - - setObjVar(objArmor, "armor.fake_armor.kinetic", (int)kinProtFloat); - setObjVar(objArmor, "armor.fake_armor.energy", (int)engProtFloat); - setObjVar(objArmor, "armor.fake_armor.heat", (int)heatProtFloat); - setObjVar(objArmor, "armor.fake_armor.cold", (int)coldProtFloat); - setObjVar(objArmor, "armor.fake_armor.acid", (int)acidProtFloat); - setObjVar(objArmor, "armor.fake_armor.electricity", (int)electProtFloat); - - if (boolSetupData) - { - - int basePrice = (int)(Math.pow( (intLevel*12.0f), 1.3f) ); - - if (basePrice > 10200) - { - basePrice = 10200; - } - - setObjVar(objArmor, "junkDealer.intPrice", basePrice); - - int minPriceValue = 0; - int maxPriceValue = intLevel * 10; - - attachScript(objArmor, "item.armor.dynamic_armor"); - setupJunkDealerPrice(objArmor, minPriceValue, maxPriceValue, 0); - generateItemStatBonuses(objArmor, intLevel, dctItemInfo); - - String strSuffix = getArmorNameSuffix(objArmor); - armorTypeMods.put("strSuffix", strSuffix); - setupDynamicItemName(objArmor, armorTypeMods); - - if (!hasScript(objArmor, "item.armor.new_armor")) - { - attachScript(objArmor, "item.armor.new_armor"); - } - } - - return objArmor; - } - - - public static float getDynamicWeaponRange(obj_id weapon) throws InterruptedException - { - int level = getIntObjVar(weapon, "dynamic_item.intLevelRequired"); - dictionary dctWeaponStats = dataTableGetRow("datatables/item/dynamic_item/root_balance_data/weapon_data.iff", level); - int intWeaponType = getWeaponType(weapon); - String strWeaponString = combat.getWeaponStringType(intWeaponType); - return dctWeaponStats.getFloat(strWeaponString + "_max_range"); - } - - - public static obj_id setupDynamicWeapon(obj_id objWeapon, String itemName, int intLevel, dictionary dctWeaponStats, dictionary dctItemInfo, boolean boolSetupData) throws InterruptedException - { - obj_id self = getSelf(); - - dictionary dctItemNames = new dictionary(); - - if (boolSetupData) - { - String strBaseName = dctItemInfo.getString("strRootName"); - if (!strBaseName.equals("")) - { - dctItemNames.put("strBaseName", strBaseName); - } - } - - float fltMinDamageVal = 0; - float fltMaxDamageVal = 0; - - if (boolSetupData) - { - fltMinDamageVal = rand(0f, 1f); - fltMaxDamageVal = rand(0f, 1f); - setObjVar(objWeapon, "dynamic_item.minDamageVal", fltMinDamageVal); - setObjVar(objWeapon, "dynamic_item.maxDamageVal", fltMaxDamageVal); - } - else - { - fltMinDamageVal = getFloatObjVar(objWeapon, "dynamic_item.minDamageVal"); - fltMaxDamageVal = getFloatObjVar(objWeapon, "dynamic_item.maxDamageVal"); - - } - - int intWeaponType = getWeaponType(objWeapon); - String strWeaponString = combat.getWeaponStringType(intWeaponType); - - int intMinDamageMin = dctWeaponStats.getInt(strWeaponString + "_min_damage_min"); - int intMinDamageMax = dctWeaponStats.getInt(strWeaponString + "_min_damage_max"); - - int intMaxDamageMin = dctWeaponStats.getInt(strWeaponString + "_max_damage_min"); - int intMaxDamageMax = dctWeaponStats.getInt(strWeaponString + "_max_damage_max"); - - float fltMin = (float) (intMinDamageMax - intMinDamageMin); - float fltMax = (float) (intMaxDamageMax - intMaxDamageMin); - - fltMin = fltMin * fltMinDamageVal; - fltMax = fltMax * fltMaxDamageVal; - - int intMinDamage = intMinDamageMin + (int)fltMin; - int intMaxDamage = intMaxDamageMin + (int)fltMax; - - float fltAttackSpeed = dctWeaponStats.getFloat(strWeaponString + "_attack_speed"); - float fltMaxRange = dctWeaponStats.getFloat(strWeaponString + "_max_range"); - - int intDamageType = DAMAGE_NONE; - - if (boolSetupData) - { - intDamageType = dctItemInfo.getInt("baseDamageType"); - - if (intDamageType == -1) - { - int intRoll = rand(1,2); - if (intRoll == 1) - { - intDamageType = DAMAGE_KINETIC; - } - else - { - intDamageType = DAMAGE_ENERGY; - } - } - } - else - { - intDamageType = getWeaponDamageType(objWeapon); - } - - setWeaponMinDamage(objWeapon, intMinDamage); - setWeaponMaxDamage(objWeapon, intMaxDamage); - setWeaponAttackSpeed(objWeapon, fltAttackSpeed); - setWeaponWoundChance(objWeapon, 0); - setMaxHitpoints(objWeapon,(1000)); - setHitpoints(objWeapon,(1000)); - setWeaponAccuracy(objWeapon, 0); - setWeaponDamageType(objWeapon, intDamageType); - setWeaponRangeInfo(objWeapon, 0, fltMaxRange); - setWeaponAttackCost(objWeapon, 0); - - setupJunkDealerPrice(objWeapon, dctWeaponStats.getInt("intMinValue"), dctWeaponStats.getInt("intMaxValue"), (fltMinDamageVal + fltMaxDamageVal) /2); - - setObjVar(objWeapon, "dynamic_item.intLevelRequired", intLevel); - setObjVar(objWeapon, "weapon.original_max_range", fltMaxRange); - - if (boolSetupData) - { - setupDynamicItemName(objWeapon, dctItemNames); - } - - weapons.setWeaponData(objWeapon); - setConversionId(objWeapon, weapons.CONVERSION_VERSION); - - return objWeapon; - } - - - public static void generateItemStatBonuses(obj_id item, int level, dictionary dctItemInfo) throws InterruptedException - { - - float[] numStatChances = - { - 101.0f, 101.0f, 101.0f, 101.0f, 101.0f, 101.0f, 101.0f - }; - int[] statBonuses = - { - 0, 0, 0, 0, 0, 0, 0 - }; - String[] statBonusNames = - { - "precision_modified", "strength_modified", "stamina_modified", - "constitution_modified", "agility_modified", "luck_modified", "camouflage" - }; - - for (int i = 0; i < numStatChances.length; i ++) - { - testAbortScript(); - float thisChance = dctItemInfo.getFloat( i + "statChance"); - - if (thisChance < 0) - { - thisChance = 0; - } - - numStatChances[i] = thisChance; - } - - float numberOfStatsRoll = rand(1.0f, 100.0f); - int numberOfStats = 0; - - for (int i = 6; i > 0; i --) - { - testAbortScript(); - if (numberOfStatsRoll > numStatChances[i]) - { - numberOfStats = i; - break; - } - } - - if (numberOfStats > 0) - { - for (int i = 0; i < numberOfStats; i ++) - { - testAbortScript(); - int statBonus = generateStatMod(level); - - for (int j = 0; j < 12; j ++) - { - testAbortScript(); - int isCamo = rand(1, 100); - int thisStat = rand(0, 5); - if (isCamo <= 5) - { - thisStat = 6; - } - - if (statBonuses[thisStat] == 0) - { - - statBonuses[thisStat] = statBonus; - break; - } - } - } - } - - for (int i = 0; i < statBonuses.length; i++) - { - testAbortScript(); - if (statBonuses[i] > 0) - { - setObjVar(item, "skillmod.bonus."+ statBonusNames[i], statBonuses[i]); - } - } - - return; - } - - - public static int generateStatMod(int level) throws InterruptedException - { - final float VARIANCE = 0.125f; - final float BASE_MOD = 0.2f; - final float MAX_MOD = 0.312f; - final float FLOOR_CHANCE = 60.0f; - - float varianceIncrements = level*MAX_MOD-level*BASE_MOD; - float exponentIncrement = 18/varianceIncrements; - float baseMod = level* BASE_MOD; - float maxMod = level*MAX_MOD; - float currentIncrement = 0.0f; - - float finalModFloat = baseMod; - - if (varianceIncrements < 1) - { - varianceIncrements = 1.0f; - } - - if (exponentIncrement < 1) - { - exponentIncrement = 1.0f; - } - - if (baseMod < 1) - { - baseMod = 1.0f; - } - - if (maxMod < 1) - { - maxMod = 1.0f; - } - - float roll = rand(1.0f, 100.0f); - - for (float f = 0.0f; f <= 18; f += exponentIncrement) - { - testAbortScript(); - currentIncrement = (float)Math.pow(FLOOR_CHANCE, 1+(f/100) ); - - if (roll < currentIncrement) - { - finalModFloat = baseMod; - break; - } - baseMod++; - } - - if (baseMod > maxMod) - { - baseMod = maxMod; - } - - int statMod = (int)baseMod; - - return statMod; - } - - - public static String getArmorNameSuffix(obj_id item) throws InterruptedException - { - String strSuffix = "@dynamic_items:armor_none"; - int numStats = 0; - int highestStatNum = 0; - int highestStatValue = 0; - - String[] statBonusNames = - { - "precision_modified", "strength_modified", "stamina_modified", - "constitution_modified", "agility_modified", "luck_modified", "camouflage" - }; - - if (hasObjVar(item, "skillmod.bonus")) - { - for (int i = 0; i < statBonusNames.length; i++) - { - testAbortScript(); - int thisStat = getIntObjVar(item, "skillmod.bonus."+ statBonusNames[i]); - - if (thisStat > 0) - { - numStats++; - - if (thisStat > highestStatValue) - { - highestStatNum = i; - highestStatValue = thisStat; - } - } - } - - if (numStats >= 6) - { - strSuffix = "@dynamic_items:armor_six_stat"; - } - - if (numStats == 5) - { - strSuffix = "@dynamic_items:armor_five_stat"; - } - - if (numStats >= 1 && numStats < 5) - { - strSuffix = "@dynamic_items:armor_"+ statBonusNames[highestStatNum] + "_"+ numStats; - } - } - - return strSuffix; - } - - - public static void setupJunkDealerPrice(obj_id objObject, int intMinValue, int intMaxValue, float fltRange) throws InterruptedException - { - - if (fltRange != 0) - { - - int intPrice = getIntObjVar(objObject, "junkDealer.intPrice"); - float fltDiff = (float)(intMaxValue - intMinValue); - - fltDiff = fltDiff * fltRange; - - intPrice = intMinValue + (int) fltDiff; - - setObjVar(objObject, "junkDealer.intPrice", intPrice); - } - else - { - int intPrice = getIntObjVar(objObject, "junkDealer.intPrice"); - intPrice = intPrice + rand(intMinValue, intMaxValue); - - setObjVar(objObject, "junkDealer.intPrice", intPrice); - } - return; - } - - - public static dictionary applyWeaponItemModifers(obj_id objWeapon, String strModifier, int intMinDamage, int intMaxDamage, dictionary dctItemNames) throws InterruptedException - { - - dictionary dctModifierInfo = null; - if (strModifier.startsWith("elemental_damage")) - { - - String strTable = "datatables/item/dynamic_item/modifiers/elemental_damage_modifiers.iff"; - dctModifierInfo = dataTableGetRow(strTable, strModifier); - - if (dctModifierInfo == null) - { - return dctItemNames; - } - - float fltMedianDamage = (float)(intMinDamage + intMaxDamage)/2; - if (fltMedianDamage < 1) - { - return dctItemNames ; - } - - float fltDamageAdded = dctModifierInfo.getFloat("fltDamageAdded"); - int intDamageType = dctModifierInfo.getInt("intDamageType"); - int intDamage = (int)(fltDamageAdded * fltMedianDamage); - if (intDamage < 1) - { - return dctItemNames; - } - setWeaponElementalDamage(objWeapon, intDamageType, intDamage); - - } - if (dctModifierInfo == null) - { - return dctItemNames; - } - setupJunkDealerPrice(objWeapon, dctModifierInfo.getInt("intMinValueAdded"), dctModifierInfo.getInt("intMaxValueAdded"), 0); - - String strPrefix = dctModifierInfo.getString("strDisplayPrefix"); - String strSuffix = dctModifierInfo.getString("strDisplaySuffix"); - if (!strPrefix.equals("")) - { - - dctItemNames.put("strPrefix", strPrefix); - } - if (!strSuffix.equals("")) - { - - dctItemNames.put("strSuffix", strSuffix); - } - - return dctItemNames; - - } - - - public static void setupDynamicItemName(obj_id objItem, dictionary dctNames) throws InterruptedException - { - - String strPrefix = dctNames.getString("strPrefix"); - String strBaseName = dctNames.getString("strBaseName"); - String strSuffix = dctNames.getString("strSuffix"); - - if (strPrefix != null) - { - int intIndex = strPrefix.indexOf('@'); - if (intIndex>-1) - { - strPrefix = getString(utils.unpackString(strPrefix)); - } - } - else - { - strPrefix = ""; - } - if (strBaseName != null) - { - int intIndex = strBaseName.indexOf('@'); - if (intIndex>-1) - { - strBaseName = getString(utils.unpackString(strPrefix)); - } - - } - else - { - strBaseName = ""; - } - if (strSuffix != null) - { - int intIndex = strSuffix.indexOf('@'); - if (intIndex>-1) - { - strSuffix= getString(utils.unpackString(strSuffix)); - } - - } - else - { - strSuffix = ""; - } - - if ((!strPrefix.equals(""))||(!strSuffix.equals(""))||(!strBaseName.equals(""))) - { - - String strName = ""; - if (!strPrefix.equals("")) - { - strName +=strPrefix + " "; - } - - if (!strBaseName.equals("")) - { - strName+=strBaseName+" "; - } - else - { - - strName+=getString(utils.unpackString(getEncodedName(objItem)))+" "; - } - if (!strSuffix.equals("")) - { - strName += strSuffix; - } - - if (!strName.equals("")) - { - setName(objItem, ""); - setName(objItem, strName); - } - } - - return; - } - - - public static boolean isDynamicItem(obj_id objItem) throws InterruptedException - { - if (hasObjVar(objItem, "dynamic_item")) - { - return true; - } - return false; - } - - - public static boolean isUniqueStaticItem(obj_id item) throws InterruptedException - { - String item_name = getStaticItemName(item); - dictionary dict = getMasterItemDictionary(item_name); - if (dict != null) - { - return dict.getInt("unique") == 1; - } - else - { - LOG( "create", " Could not check for unique, dictionary returned null "+item ); - return false; - } - } - - - public static boolean isUniqueStaticItem(String item) throws InterruptedException - { - dictionary dict = getMasterItemDictionary(item); - if (dict != null) - { - return dict.getInt("unique") == 1; - } - else - { - LOG( "create", " Could not check for unique, dictionary returned null "+item ); - return false; - } - - } - - - public static boolean canCreateUniqueStaticItem(obj_id container, String itemName) throws InterruptedException - { - if (!isPlayer(getOwner(container))) - { - return true; - } - - return (!utils.playerHasStaticItemInBankOrInventory(getOwner(container), itemName)); - } - - - public static boolean canEquip(obj_id player, obj_id item) throws InterruptedException - { - dictionary itemData = static_item.getMasterItemDictionary(item); - - int requiredLevel = itemData.getInt("required_level"); - String requiredSkill = itemData.getString("required_skill"); - - boolean canEquip = true; - - if (!static_item.validateLevelRequired(player,requiredLevel)) - { - canEquip = false; - } - if (requiredSkill != null && !requiredSkill.equals("")) - { - String classTemplate = getSkillTemplate(player); - if (classTemplate != null && !classTemplate.equals("")) - { - if (!classTemplate.startsWith(requiredSkill)) - { - canEquip = false; - } - } - } - - return canEquip; - } - - - public static void origOwnerCheckStamp(obj_id object, obj_id player) throws InterruptedException - { - if (hasObjVar(object, ORIG_OWNER)) - { - return; - } - - if (!utils.isNestedWithinAPlayer(object)) - { - return; - } - - if (isIdValid(player)) - { - setObjVar(object, ORIG_OWNER, player); - } - - return; - } - - - public static boolean userIsOrigOwner(obj_id object, obj_id player) throws InterruptedException - { - if (!isIdValid(object) || !isIdValid(player)) - { - return false; - } - - obj_id origOwner = utils.getObjIdObjVar(object, ORIG_OWNER); - obj_id currentOwner = utils.getContainingPlayer(object); - - if (!isIdValid(origOwner) || !isIdValid(currentOwner)) - { - return false; - } - - if (origOwner == currentOwner) - { - return true; - } - - return false; - } - - - public static string_id getStaticItemStringIdName(obj_id object) throws InterruptedException - { - if (!isIdValid(object) || !exists(object)) - { - return null; - } - - if (!isStaticItem(object)) - { - return null; - } - - String staticItemName = getStaticItemName(object); - - return new string_id(STATIC_ITEM_NAME, staticItemName); - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/stealth.java b/sku.0/sys.server/compiled/game/script/library/stealth.java deleted file mode 100644 index ed0383a80..000000000 --- a/sku.0/sys.server/compiled/game/script/library/stealth.java +++ /dev/null @@ -1,4649 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import java.lang.Math; -import java.util.StringTokenizer; -import script.library.ai_lib; -import script.library.beast_lib; -import script.library.buff; -import script.library.city; -import script.library.colors; -import script.library.combat; -import script.library.dot; -import script.library.factions; -import script.library.group; -import script.library.locations; -import script.library.loot; -import script.library.luck; -import script.library.money; -import script.library.pet_lib; -import script.library.prose; -import script.library.static_item; -import script.library.sui; -import script.library.utils; -import script.library.vehicle; -import script.library.xp; -import script.library.weapons; - - -public class stealth extends script.base_script -{ - public stealth() - { - } - public static final java.text.NumberFormat floatFormat = new java.text.DecimalFormat("###.##"); - - public static final int MAX_BUILDINGS_FOR_WILDNERNESS = 5; - public static final int MIN_BLENDIN_CROWD_SIZE = 10; - public static final String CAMO_KIT_ID = "camoKit"; - public static final String ACTIVE_HEP = "active_hep"; - public static final int MIN_MOVEMENT_PRIORITY = 3; - public static final int MIN_POSTURE_CHANGE_PRIORITY = 4; - - public static final String INVIS_BREAK_RADIUS_FAR = "invis_break_far"; - public static final String INVIS_BREAK_RADIUS_NEAR = "invis_break__near"; - public static final String INVIS_UPKEEP_MSG_DISPATCHED = "invis_upkeep_dispatched"; - public static final String TRAP_PROXIMITY_VOLUME = "trap_proximity"; - public static final String SENSOR_PROXIMITY_VOLUME = "sensor_proximity"; - - public static final float INVIS_BREAK_MAX_FAR_DISTANCE = 20f; - public static final float INVIS_BREAK_NEAR_DISTANCE = 8f; - - public static final int PASSIVE_BREACH_FAR = 2; - public static final int PASSIVE_BREACH_NEAR = 1; - - public static final float PASSIVE_DETECT_CHANCE_FAR = 15.0f; - public static final float PASSIVE_DETECT_CHANCE_NEAR = 45.0f; - public static final float PASSIVE_DETECT_CHANCE_MOB = 20.0f; - public static final String INCOGNITO_OLD_FACTION = "stealth.incognitoFaction"; - - public static final float MIN_CHANCE_TO_DETECT_HIDDEN = 1f; - public static final float MAX_CHANCE_TO_DETECT_HIDDEN = 99f; - public static final float PASSIVE_DETECT_CHANCE = 20f; - public static final float ACTIVE_DETECT_CHANCE = 50f; - public static final float MAX_HIDING_DETECT_SCORE = 220; - - public static final int HEP_UPKEEP_COST = 10; - public static final String HEP_BASE_POWER = "basePower"; - public static final String HEP_EFFECTIVENESS = "effectiveness"; - - public static final int STEAL_NOTHING = 0; - public static final int STEAL_CREDITS = 1; - public static final int STEAL_LOOT = 2; - public static final int STEAL_TEMPLATE = 4; - public static final int STEAL_MARKED_ITEMS = 8; - public static final int STEAL_STEALING_TABLE = 16; - - public static final float STEAL_LOOT_CHANCE_MOD = -0.90f; - public static final int STEAL_FAIL_CHANCE = 50; - public static final int STEAL_REGULAR_ITEM = 75; - public static final int STEAL_RARE_ITEM = 98; - public static final String STEAL_TYPE = "stealing.type"; - public static final String STEAL_TEMPLATE_ITEMS = "stealing.availableLoot"; - public static final String STEAL_ITEM_IS_STEALABLE = "stealing.isStealable"; - - public static final String TRAP_TR_ACCURACY = "trap.accuracy"; - public static final String TRAP_POWER = "trap.power"; - public static final String TRIGGER_TYPE = "trap.triggerType"; - public static final String TRAP_TYPE = "trap.trapType"; - public static final String TIMER_TIME = "trap.detonateTime"; - public static final String PROXIMITY_RANGE = "trap.proximityRange"; - public static final String TRAP_TRIGGER_ID = "trap.triggerId"; - public static final String TRAP_MY_TRAP = "trap.myTrap"; - public static final String TRAP_MY_PROXIMITY_TRIGGER = "trap.myTrap"; - public static final String TRAP_FACTION = "trap.faction"; - public static final String TRAP_PVP_TYPE = "trap.pvpType"; - public static final String TRAP_DIFFICULTY = "trap.difficulty"; - public static final String TRAP_FREQUENCY = "trap.frequency"; - public static final String TRAP_GROUP = "trap.groupObject"; - public static final String DETECT_EFFECTIVENESS = "trap.detect.effectiveness"; - public static final String CONCEALABLE_DEVICE = "concealable"; - public static final String CONCEALED_OBJECT = "isObjectConcealed"; - public static final String CAMO_SKILL = "camouflageSkill"; - public static final String DETECT_ATTEMPTS = "detectAttempts"; - public static final String DETECT_TIMES = "detectTimes"; - public static final String CAMOUFLAGED_AT_LEVEL = "camouflagedAtLevel"; - public static final String TRAP_LEVEL = "levelOfTrap"; - public static final String BIO_PROBE_TARGET_NAME = "trap.targetName"; - public static final String BIO_PROBE_TRAP_TARGET = "trap.probeTarget"; - public static final String BIO_PROBE_DECAYED = "probe.decayed"; - public static final String BIO_PROBE_SAMPLE_TIME = "probe.sampleTime"; - public static final String BIO_PROBE_STORAGE_TIME = "probe.storageTime"; - public static final String BEACON_BATTERY = "beacon.battery"; - public static final String BEACON_LOCATION = "beacon.location"; - public static final String BEACON_TARGET = "beacon.target"; - public static final String BEACON_TARGET_NAME = "beacon.targetName"; - public static final String BEACON_MSG_DISPATCHED = "beacon.msgDispatched"; - public static final String BEACON_SHUTDOWN_PENDING = "beacon.shutdownPending"; - public static final String BEACON_LAST_KNOWN_LOC = "beacon.lastKnownLoc"; - public static final String BEACON_LAST_KNOWN_TARGET_NAME = "beacon.lastKnownTargetName"; - public static final String BEACON_LAST_KNOWN_TARGET = "beacon.lastKnownTarget"; - public static final String SENSOR_ARMED_TIME = "sensor.armedTime"; - public static final String BUFF_NO_BREAK_INVIS = "no_break_invis"; - - public static final float SENSOR_RANGE = 10f; - public static final float BEACON_INTERVAL = 20f; - - public static final int TRIGGER_TYPE_TIMER = 1; - public static final int TRIGGER_TYPE_REMOTE = 2; - public static final int TRIGGER_TYPE_PROXIMITY = 3; - - public static final int TRAP_CALTROP = 1; - public static final int TRAP_FLASHBANG = 2; - public static final int TRAP_HX2 = 3; - public static final int TRAP_KAMINODART = 4; - - public static final int[] ALL_TRAP_TYPES = new int[] - { - TRAP_CALTROP, TRAP_FLASHBANG, TRAP_HX2, TRAP_KAMINODART - }; - public static final int[] ALL_TRIGGER_TYPES = new int[] - { - TRIGGER_TYPE_TIMER, TRIGGER_TYPE_REMOTE, TRIGGER_TYPE_PROXIMITY - }; - - public static final float TRAP_MIN_DISTANCE_BETWEEN = 10f; - public static final float TRAP_SELF_DESTRUCT_TIMEOUT = 60 * 10; - public static final float TRAP_HX2_BLAST_RADIUS = 15f; - public static final float TRAP_FLASHBANG_BLAST_RADIUS = 20f; - public static final float TRAP_CALTROP_BLAST_RADIUS = 10f; - public static final float TRAP_KAMINODART_BLAST_RADIUS = 10f; - - public static final float KAMINODART_MAX_DURATION = 30; - public static final float KAMINODART_MAX_POTENCY = 175; - public static final float KAMINODART_MAX_STRENGTH = 175; - - public static final int CALTROP_MAX_SNARE = 65; - public static final int CALTROP_MAX_DURATION = 30; - - public static final int FLASHBANG_MAX_COMBAT_SLOW = -100; - public static final int FLASHBANG_MAX_DURATION = 60; - - public static final int TRAP_HX2_MIN_BASE_DAMAGE = 4000; - public static final int TRAP_HX2_MAX_BASE_DAMAGE = 5500; - - public static final float BASE_DETECT_CAMOUFLAGE_DISTANCE = 20; - public static final int PLAYER_DETECT_SAFETY_INTERVAL = 60; - public static final int MAX_INVIS_BUFF_TO_DETECT = 5; - - public static final float BASE_DISARM_CHANCE = 55f; - public static final float MAX_CHANCE_TO_DISARM = 95f; - public static final float MIN_CHANCE_TO_DISARM = 10f; - public static final float PERCENT_EFFECT_MOD_DISARM_FAIL = 2f; - public static final float CHAFF_FLARE_DISTANCE = 15f; - public static final float MAX_BIO_PROBE_STORAGE_TIME = 3600; - public static final float MAX_PROBE_DISTANCE = 10f; - - public static final String[] TRAP_RESTRICTED_REGIONS = - { - "dathomir_fs_village_unpassable" - }; - - - public static void setBioProbeData(obj_id trap, obj_id target, String targetName) throws InterruptedException - { - } - - - public static void setTriggerData(obj_id trap, int triggerType, int accuracy, int param) throws InterruptedException - { - setObjVar(trap, TRAP_TR_ACCURACY, accuracy); - setObjVar(trap, TRIGGER_TYPE, triggerType); - - switch(triggerType) - { - case TRIGGER_TYPE_TIMER: - setObjVar(trap, TIMER_TIME, param); - break; - case TRIGGER_TYPE_REMOTE: - String frequency = ""+ rand(0, 999) + "."+ rand(0, 999) + "."+ rand(0, 999); - setObjVar(trap, stealth.TRAP_FREQUENCY, frequency); - break; - case TRIGGER_TYPE_PROXIMITY: - setObjVar(trap, PROXIMITY_RANGE, param); - break; - } - } - - - public static void createRangerLoot(int level, String object, obj_id container, int count) throws InterruptedException - { - object = toLower(object); - String template = ""; - int type = 1; - int trigType = 1; - int power = getPowerLevel(level, false); - - if (count < 0) - { - count = getNumLootItems(level, container); - } - - int trigHash = getStringCrc(object.substring(0, 3)); - int trapHash = getStringCrc(object.substring(4)); - - switch(trigHash) - { - case (265639046): - trigType = TRIGGER_TYPE_PROXIMITY; - break; - case (-1964272009): - trigType = TRIGGER_TYPE_TIMER; - break; - case (-1799474985): - trigType = TRIGGER_TYPE_REMOTE; - break; - default: - trapHash = getStringCrc(object); - break; - } - - switch(trapHash) - { - case (-2001914999): - for (int i = 0; i < count; i++) - { - testAbortScript(); - type = ALL_TRAP_TYPES[rand(0, ALL_TRAP_TYPES.length-1)]; - trigType = ALL_TRIGGER_TYPES[rand(0, ALL_TRIGGER_TYPES.length-1)]; - createTrapObject(container, getPowerLevel(level, true), type, 1, trigType, getPowerLevel(level, true), rand(5, 20)); - } - break; - case (-279247418): - createMotionSensorObject(container, power, count); - break; - case (-1752438899): - createChaffFlareObject(container, power, count); - break; - case (487387167): - createHEPObject(container, power, count); - break; - case (1253827732): - createBioProbeObject(container, power, count); - break; - case (579649147): - createTrackingBeaconObject(container, power, count); - break; - case (240293015): - createTrapObject(container, power, TRAP_CALTROP, count, trigType, power, 10); - break; - case (1254944108): - createTrapObject(container, power, TRAP_FLASHBANG, count, trigType, power, 10); - break; - case (546611802): - createTrapObject(container, power, TRAP_HX2, count, trigType, power, 10); - break; - case (-1152836626): - createTrapObject(container, power, TRAP_KAMINODART, count, trigType, power, 10); - } - return; - } - - - public static void createRangerLoot(obj_id mob, int level, String object, obj_id container) throws InterruptedException - { - createRangerLoot(level, object, container, -1); - return; - } - - - public static int getNumLootItems(int level, obj_id destContainer) throws InterruptedException - { - float lvl = level; - int numItems = 1 + (int)Math.ceil(level/30); - - int free = getVolumeFree(destContainer); - if (free < numItems) - { - numItems = free; - } - - return numItems; - } - - - public static int getPowerLevel(int level, boolean includeVariance) throws InterruptedException - { - if (includeVariance) - { - return loot.getCalculatedAttribute(500, 1100, level, loot.MIN_CREATURE_LEVEL, loot.MAX_CREATURE_LEVEL); - } - - float minPower = 500; - float maxPower = 1000; - - float difference = maxPower - minPower; - float ratio = level/100f; - - return (int)Math.ceil(minPower + (difference * ratio)); - } - - - public static obj_id createHEPObject(obj_id container, int power, int count) throws InterruptedException - { - String template = "object/tangible/scout/misc/hep.iff"; - - obj_id hep = null; - for (int i = 0; i < count; i++) - { - testAbortScript(); - hep = createObject(template, container, ""); - if (!isIdValid(hep)) - { - return null; - } - - if (rand(0, 1) == 0) - { - setObjVar(hep, HEP_BASE_POWER, power); - setCount(hep, power); - setObjVar(hep, HEP_EFFECTIVENESS, Math.round(power / 2)); - } - else - { - setObjVar(hep, HEP_EFFECTIVENESS, power); - power = Math.round(power/2); - setObjVar(hep, HEP_BASE_POWER, power); - setCount(hep, power); - } - } - return hep; - } - - - public static obj_id createTrackingBeaconObject(obj_id container, float power, int count) throws InterruptedException - { - String template = "object/tangible/scout/misc/trackingbeacon.iff"; - - obj_id probe = null; - for (int i = 0; i < count; i++) - { - testAbortScript(); - probe = createObject(template, container, ""); - if (!isIdValid(probe)) - { - return null; - } - - setObjVar(probe, BEACON_BATTERY, power * 3); - setObjVar(probe, DETECT_EFFECTIVENESS, power); - setObjVar(probe, BIO_PROBE_STORAGE_TIME, MAX_BIO_PROBE_STORAGE_TIME); - - } - return probe; - } - - - public static obj_id createBioProbeObject(obj_id container, float power, int count) throws InterruptedException - { - String template = "object/tangible/scout/misc/biosensorprobe.iff"; - - obj_id probe = null; - for (int i = 0; i < count; i++) - { - testAbortScript(); - - probe = createObject(template, container, ""); - if (!isIdValid(probe)) - { - return null; - } - - setObjVar(probe, BIO_PROBE_STORAGE_TIME, power / 1000 * MAX_BIO_PROBE_STORAGE_TIME); - } - return probe; - } - - - public static obj_id createMotionSensorObject(obj_id container, float batteryPower, int count) throws InterruptedException - { - String template = "object/tangible/scout/misc/motionsensor.iff"; - - obj_id sensor = null; - for (int i = 0; i < count; i++) - { - testAbortScript(); - sensor = createObject(template, container, ""); - if (!isIdValid(sensor)) - { - return null; - } - - setObjVar(sensor, BEACON_BATTERY, batteryPower); - } - return sensor; - } - - - public static obj_id createChaffFlareObject(obj_id container, int power, int count) throws InterruptedException - { - String template = "object/tangible/scout/misc/chaffflare.iff"; - - obj_id flare = null; - for (int i = 0; i < count; i++) - { - testAbortScript(); - flare = createObject(template, container, ""); - if (!isIdValid(flare)) - { - return null; - } - - setObjVar(flare, DETECT_EFFECTIVENESS, power); - } - - return flare; - } - - - public static obj_id createTrapObject(obj_id container, int power, int trapType, int count, int triggerType, int triggerAccuracy, int triggerParam) throws InterruptedException - { - String template = ""; - switch(trapType) - { - case TRAP_CALTROP: - template = "object/tangible/scout/trap/trap_ap_caltrop.iff"; - break; - case TRAP_FLASHBANG: - template = "object/tangible/scout/trap/trap_ap_flashbang.iff"; - break; - case TRAP_HX2: - template = "object/tangible/scout/trap/trap_ap_hx2mine.iff"; - break; - case TRAP_KAMINODART: - template = "object/tangible/scout/trap/trap_ap_kaminoandart.iff"; - break; - default: - template = "object/tangible/scout/trap/trap_ap_hx2mine.iff"; - break; - } - - obj_id trap = null; - trap = createObject(template, container, ""); - if (!isIdValid(trap)) - { - return null; - } - - setObjVar(trap, TRAP_POWER, power); - setTriggerData(trap, triggerType, triggerAccuracy, triggerParam); - setCount(trap, count); - - return trap; - } - - - public static boolean canPlaceMotionSensor(obj_id player, obj_id sensor) throws InterruptedException - { - obj_id[] stuff = getNonCreaturesInRange(getLocation(player), TRAP_MIN_DISTANCE_BETWEEN * 2); - for (int i = 0; i < stuff.length; i++) - { - testAbortScript(); - if (hasObjVar(stuff[i], TRAP_TYPE) || hasObjVar(stuff[i], BEACON_BATTERY)) - { - sendSystemMessage(player, new string_id("spam", "other_trap")); - return false; - } - } - - return true; - } - - - public static void placeMotionSensor(obj_id player, obj_id sensor) throws InterruptedException - { - location loc = getLocation(player); - if (!setLocation(sensor, loc)) - { - return; - } - - setObjVar(sensor, "armed", 1); - messageTo(sensor, "msgBatteryDead", null, getFloatObjVar(sensor, BEACON_BATTERY), true); - setObjVar(sensor, SENSOR_ARMED_TIME, getGameTime()); - doAnimationAction(player, "point_down"); - setOwner(sensor, player); - playClientEffectLoc(sensor, "clienteffect/frs_light_vigilance.cef", getLocation(sensor), 0.0f); - messageTo(sensor, "msgDeploy", null, 1, false); - } - - - public static void tripMotionSensor(obj_id sensor, obj_id breacher, boolean wasFiltered) throws InterruptedException - { - obj_id owner = getOwner(sensor); - if (!isIdValid(owner)) - { - return; - } - - if (hasObjVar(sensor, "lastSent")) - { - int lastTime = getIntObjVar(sensor, "lastSent"); - if (lastTime + 30 > getGameTime()) - { - return; - } - } - - setObjVar(sensor, "lastSent", getGameTime()); - dictionary dic = new dictionary(); - dic.put("sensor", sensor); - dic.put("breacherId", breacher); - dic.put("breacherName", isPlayer(breacher)? getName(breacher) : getCreatureName(breacher)); - dic.put("wasFiltered", wasFiltered); - dic.put("sensorLoc", getLocation(sensor)); - - messageTo(owner, "msgMotionSensorTripped", dic, 1, false); - - return; - } - - - public static void cleanComponentFromContainer(obj_id component, obj_id container) throws InterruptedException - { - if (!isIdValid(container)) - { - return; - } - - if (!hasObjVar(container, DETECT_EFFECTIVENESS) && !hasObjVar(container, TRAP_TYPE) && !hasObjVar(container, BEACON_BATTERY)) - { - return; - } - - obj_var_list ovl = getObjVarList(component, "trap"); - if (ovl == null) - { - return; - } - - int numItems = ovl.getNumItems(); - String name = ""; - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - obj_var ov = ovl.getObjVar(i); - if (ov != null) - { - name = "trap."+ ov.getName(); - removeObjVar(container, name); - } - } - - return; - } - - - public static boolean canActivateTrackingBeacon(obj_id player, obj_id beacon, boolean silent) throws InterruptedException - { - if ((!utils.testItemClassRequirements(player, beacon, false, "") || !utils.testItemLevelRequirements(player, beacon, false, ""))) - { - return false; - } - - obj_id target = getBioProbeTarget(beacon); - if (!isIdValid(target)) - { - if (!silent) - { - sendSystemMessage(player, new string_id("spam", "bio_sample_bad")); - return false; - } - } - - if (getFloatObjVar(beacon, BEACON_BATTERY) < BEACON_INTERVAL) - { - if (!silent) - { - sendSystemMessage(player, new string_id("spam", "traker_power_low")); - return false; - } - } - - if (hasObjVar(beacon, BEACON_TARGET)) - { - if (getObjIdObjVar(beacon, BEACON_TARGET) != target) - { - sendSystemMessage(player, new string_id("spam", "different_sample")); - return false; - } - } - - return true; - } - - - public static void startTrackingBeacon(obj_id player, obj_id beacon) throws InterruptedException - { - obj_id target = getObjIdObjVar(beacon, BIO_PROBE_TRAP_TARGET); - if (!isIdValid(target)) - { - return; - } - - dictionary dic = new dictionary(); - dic.put("sendingPlayer", player); - dic.put("sendingBeacon", beacon); - - sendSystemMessage(player, new string_id("spam", "uploading_tracking")); - - removeObjVar(beacon, BEACON_SHUTDOWN_PENDING); - if (!hasObjVar(beacon, BEACON_MSG_DISPATCHED)) - { - setObjVar(beacon, BEACON_MSG_DISPATCHED, 1); - - messageTo(beacon, "msgTrackingBeaconUpdate", dic, BEACON_INTERVAL, true); - messageTo(target, "msgTrackingBeaconLocationRequest", dic, 0, false); - } - return; - } - - - public static void stopTrackingBeacon(obj_id beacon, obj_id player) throws InterruptedException - { - if (hasObjVar(beacon, BEACON_MSG_DISPATCHED)) - { - sendSystemMessage(player, new string_id("spam", "requestin_disconnect")); - setObjVar(beacon, BEACON_SHUTDOWN_PENDING, 1); - } - else if (isIdValid(player)) - { - sendSystemMessage(player, new string_id("spam", "connection_severed")); - removeObjVar(beacon, BEACON_LOCATION); - removeObjVar(beacon, BEACON_TARGET); - removeObjVar(beacon, BEACON_TARGET_NAME); - } - - return; - } - - - public static void updateTrackingBeaconDisplay(obj_id beacon) throws InterruptedException - { - obj_id player = utils.getContainingPlayer(beacon); - removeObjVar(beacon, BEACON_MSG_DISPATCHED); - if (hasObjVar(beacon, BEACON_SHUTDOWN_PENDING)) - { - stopTrackingBeacon(beacon, player); - return; - } - - float power = getFloatObjVar(beacon, BEACON_BATTERY); - power -= BEACON_INTERVAL; - setObjVar(beacon, BEACON_BATTERY, power); - - if (!isIdValid(player)) - { - stopTrackingBeacon(beacon, player); - return; - } - - obj_id target = getObjIdObjVar(beacon, BEACON_TARGET); - if (!isIdValid(target)) - { - sendSystemMessage(player, new string_id("spam", "tracking_failed")); - } - else - { - setObjVar(beacon, BEACON_LAST_KNOWN_LOC, getLocationObjVar(beacon, BEACON_LOCATION)); - setObjVar(beacon, BEACON_LAST_KNOWN_TARGET_NAME, getStringObjVar(beacon, BEACON_TARGET_NAME)); - setObjVar(beacon, BEACON_LAST_KNOWN_TARGET, target); - - prose_package pp = prose.getPackage(new string_id("spam", "tracker_updated")); - pp = prose.setTT(pp, target); - sendSystemMessageProse(player, pp); - } - - if (canActivateTrackingBeacon(player, beacon, false)) - { - if (!hasObjVar(beacon, BEACON_MSG_DISPATCHED)) - { - dictionary dic = new dictionary(); - dic.put("sendingPlayer", player); - dic.put("sendingBeacon", beacon); - sendSystemMessage(player, new string_id("spam", "requesting_target")); - setObjVar(beacon, BEACON_MSG_DISPATCHED, 1); - messageTo(beacon, "msgTrackingBeaconUpdate", dic, BEACON_INTERVAL, true); - messageTo(getObjIdObjVar(beacon, BEACON_TARGET), "msgTrackingBeaconLocationRequest", dic, 0, false); - } - } - else - { - stopTrackingBeacon(beacon, player); - } - - return; - } - - - public static void updateTrackingBeaconData(obj_id beacon, obj_id target, location targetLoc, String targetName) throws InterruptedException - { - setObjVar(beacon, BEACON_LOCATION, targetLoc); - setObjVar(beacon, BEACON_TARGET, target); - setObjVar(beacon, BEACON_TARGET_NAME, targetName); - } - - - public static obj_id getBioProbeTarget(obj_id thing) throws InterruptedException - { - obj_id target = null; - if ((hasObjVar(thing, TRAP_TYPE) || hasObjVar(thing, BEACON_BATTERY)) && hasObjVar(thing, BIO_PROBE_TRAP_TARGET)) - { - if (hasObjVar(thing, BIO_PROBE_STORAGE_TIME)) - { - - if (!hasObjVar(thing, BIO_PROBE_DECAYED)) - { - target = getObjIdObjVar(thing, BIO_PROBE_TRAP_TARGET); - } - - } - } - - return target; - } - - - public static boolean canBioProbe(obj_id player, obj_id probe, obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - showFlyTextPrivate(player, player, new string_id("spam", "bad_target"), 1.5f, colors.TOMATO); - return false; - } - - if (!ai_lib.isHumanoid(target)) - { - sendSystemMessage(player, new string_id("spam", "sample_humanoid")); - return false; - } - - if (!pvpCanAttack(player, target)) - { - sendSystemMessage(player, new string_id("spam", "cant_sample")); - return false; - } - - if (getDistance(getLocation(player), getLocation(target)) > MAX_PROBE_DISTANCE) - { - showFlyTextPrivate(player, player, new string_id("spam", "too_far"), 1.5f, colors.TOMATO); - return false; - } - - return true; - } - - - public static void bioProbe(obj_id player, obj_id probe, obj_id target) throws InterruptedException - { - float effectiveness = getIntObjVar(probe, DETECT_EFFECTIVENESS); - float timeToDecay = getFloatObjVar(probe, BIO_PROBE_STORAGE_TIME); - - setObjVar(probe, BIO_PROBE_SAMPLE_TIME, getGameTime()); - messageTo(probe, "msgDecaySample", null, timeToDecay, true); - - doAnimationAction(player, "heal_other"); - setObjVar(probe, BIO_PROBE_TRAP_TARGET, target); - setObjVar(probe, BIO_PROBE_TARGET_NAME, isPlayer(target)? getName(target) : "a "+ getCreatureName(target)); - - if (isPlayer(target)) - { - prose_package pp = prose.getPackage(new string_id("spam", "feel_twinge")); - pp = prose.setTT(pp, player); - sendSystemMessageProse(target, pp); - } - - prose_package pp = prose.getPackage(new string_id("spam", "got_probe")); - pp = prose.setTT(pp, target); - sendSystemMessageProse(player, pp); - - return; - } - - - public static void doChaffFlareEffect(obj_id player, obj_id flare) throws InterruptedException - { - doAnimationAction(player, "manipulate_high"); - playClientEffectLoc(player, "appearance/pt_sparking_blast_md.prt", getLocation(player), 0.0f); - float flareDistance = CHAFF_FLARE_DISTANCE; - float detectSkill = getEnhancedSkillStatisticModifier(player, "detect_hidden"); - obj_id[] stuff = getObjectsInRange(player, flareDistance); - boolean foundSomething = false; - prose_package pp = prose.getPackage(new string_id("spam", "chaff_uncover")); - flareDistance += (detectSkill / 10); - - pp = prose.setTT(pp, player); - for (int i = 0; i < stuff.length; i++) - { - testAbortScript(); - if (!hasObjVar(stuff[i], TRAP_TYPE) || !validateTrapTarget(stuff[i], player)) - { - continue; - } - - int hidePower = getIntObjVar(stuff[i], CAMO_SKILL); - int chaffPower = getIntObjVar(flare, DETECT_EFFECTIVENESS); - - if (hidePower > chaffPower) - { - continue; - } - - pp = prose.setTU(pp, stuff[i]); - - foundSomething = true; - unconcealDevice(player, stuff[i]); - } - - if (foundSomething) - { - sendSystemMessage(player, new string_id("spam", "chaff_foundsomething")); - doAnimationAction(player, "point_forward"); - } - else - { - sendSystemMessage(player, new string_id("spam", "chaff_nothing")); - } - - return; - } - - - public static boolean canDisarmTrap(obj_id player, obj_id trap) throws InterruptedException - { - if (!hasObjVar(trap, TRAP_TYPE) && !hasObjVar(trap, BEACON_BATTERY)) - { - sendSystemMessage(player, new string_id("spam", "bad_disarm_target")); - return false; - } - - if (!validateTrapTarget(trap, player) && getOwner(trap) != player) - { - sendSystemMessage(player, new string_id("spam", "cant_disarm")); - return false; - } - - return true; - } - - - public static void disarmTrap(obj_id player, obj_id trap) throws InterruptedException - { - - if (getOwner(trap) == player || hasObjVar(trap, BEACON_BATTERY)) - { - showFlyText(trap, new string_id("spam", "disarm_go"), 1.5f, colors.TOMATO); - sendSystemMessage(player, new string_id("spam", "disarm")); - playTrapFizzle(trap); - destroyObject(trap); - return; - } - - float baseChanceToDisarm = BASE_DISARM_CHANCE; - - int trapLevel = getIntObjVar(trap, TRAP_LEVEL); - int trapSkillMod = getIntObjVar(trap, TRAP_DIFFICULTY); - float trapperScore = trapLevel + trapSkillMod; - - int diffuserLevel = getLevel(player); - int diffuserSkillMod = getEnhancedSkillStatisticModifier(player, "ranger_trap"); - int spyBonus = utils.isProfession(player, utils.SPY)? 30 : 0; - float diffuserScore = diffuserLevel + diffuserSkillMod + spyBonus; - - float totalDisparity = diffuserScore - trapperScore; - float chanceToDetect = baseChanceToDisarm; - float detectRange = MAX_CHANCE_TO_DISARM - MIN_CHANCE_TO_DISARM; - - if (totalDisparity > 0) - { - chanceToDetect += (totalDisparity / MAX_HIDING_DETECT_SCORE) * detectRange; - } - - if (chanceToDetect > MAX_CHANCE_TO_DISARM) - { - chanceToDetect = MAX_CHANCE_TO_DISARM; - } - - float roll = rand(0f, 100f); - - if (roll < chanceToDetect) - { - - if (hasObjVar(trap, stealth.TRAP_FREQUENCY)) - { - obj_id myRemote = getObjIdObjVar(trap, stealth.TRAP_MY_PROXIMITY_TRIGGER); - - if (exists(myRemote)) - { - messageTo(myRemote, "trapDisarmed", null, 1, false); - } - } - - showFlyText(trap, new string_id("spam", "disarm_go"), 1.5f, colors.TOMATO); - sendSystemMessage(player, new string_id("spam", "disarm")); - playTrapFizzle(trap); - destroyObject(trap); - } - else - { - - if (hasObjVar(trap, stealth.TRAP_FREQUENCY)) - { - obj_id myRemote = getObjIdObjVar(trap, stealth.TRAP_MY_PROXIMITY_TRIGGER); - - if (exists(myRemote)) - { - messageTo(myRemote, "trapDisarmed", null, 1, false); - } - } - - Vector target = new Vector(); - target.add(player); - doTrapDetonateEffect(trap, getIntObjVar(trap, TRAP_TYPE), target, PERCENT_EFFECT_MOD_DISARM_FAIL); - sendSystemMessage(player, new string_id("spam", "fail_disarm")); - } - - return; - } - - - public static boolean canDetectCamouflage(obj_id player) throws InterruptedException - { - return true; - } - - - public static void detectCamouflage(obj_id player, boolean findMobiles, boolean findInanimate, float distance, float baseChanceToDetect) throws InterruptedException - { - obj_id[] stuff = getObjectsInRange(player, distance); - Vector detected = new Vector(); - Vector times = new Vector(); - int now = getGameTime(); - boolean foundSomething = false; - obj_id target = null; - prose_package pp = prose.getPackage(new string_id("spam", "revealed_by")); - String invis = ""; - boolean objIsMobile = false; - location playerLoc = getLocation(player); - - playClientEffectLoc(getPlayerCreaturesInRange(playerLoc, 100.0f), "appearance/pt_spy_reveal_wave.prt", playerLoc, 0.0f); - - if (utils.isProfession(player, utils.SPY)) - { - invis = getInvisBuff(player); - - if (invis == null) - { - playClientEffectLoc(player, "appearance/pt_spy_expose_shadows.prt", getLocation(player), 0.0f); - } - else - { - Vector clients = new Vector(); - clients = utils.addElement(clients, player); - - dictionary revealList = getPassiveRevealList(player); - - if (revealList != null) - { - Vector ids = revealList.getResizeableObjIdArray("id"); - if ((ids != null) && (ids.size() != 0)) - { - clients = utils.concatArrays(clients, ids); - } - } - - playClientEffectLoc(utils.toStaticObjIdArray(clients), "appearance/pt_spy_expose_shadows.prt", getLocation(player), 0.0f); - } - } - else - { - playClientEffectLoc(player, "appearance/pt_fireworks_secondary_shockwave2.prt", getLocation(player), 0.0f); - } - - for (int i = 0; i < stuff.length; i++) - { - testAbortScript(); - objIsMobile = false; - target = stuff[i]; - - if (!isIdValid(target)) - { - continue; - } - - if (isPlayer(target) || ai_lib.isHumanoid(target) || isMob(target)) - { - objIsMobile = true; - if (!pvpCanAttack(player, target)) - { - continue; - } - - invis = getInvisBuff(target); - if (invis == null) - { - continue; - } - else if (buff.getPriority(invis) > MAX_INVIS_BUFF_TO_DETECT) - { - continue; - } - - if (invis.startsWith("invis_sp_buff_invis_notrace") || invis.startsWith("invis_sp_diversion_stealth")) - { - continue; - - } - - detected = utils.getResizeableStringBatchObjVar(target, DETECT_ATTEMPTS); - times = utils.getResizeableStringBatchObjVar(target, DETECT_TIMES); - if (detected == null) - { - detected = new Vector(); - } - - if (times == null) - { - times = new Vector(); - } - - if (detected.size() != times.size()) - { - - continue; - } - - int idx = detected.indexOf(player); - if (idx > -1) - { - int when = ((Integer)times.get(idx)).intValue(); - if (when - now < PLAYER_DETECT_SAFETY_INTERVAL) - { - continue; - } - - times.setElementAt(new Integer(now), idx); - } - else - { - detected.add(player); - times.add(new Integer(now)); - } - - utils.setResizeableBatchObjVar(target, DETECT_ATTEMPTS, detected); - utils.setResizeableBatchObjVar(target, DETECT_TIMES, times); - } - else if (!hasObjVar(target, CONCEALED_OBJECT) || !validateTrapTarget(target, player)) - { - continue; - } - - if (activeDetectHiddenTarget(target, player, baseChanceToDetect)) - { - if (objIsMobile) - { - checkForAndMakeVisible(target); - } - else - { - unconcealDevice(player, target); - } - foundSomething = true; - playClientEffectLoc(target, "clienteffect/lair_med_damage_smoke.cef", getLocation(target), 0.0f); - } - - } - - if (foundSomething) - { - sendSystemMessage(player, new string_id("spam", "detected_something")); - doAnimationAction(player, "point_forward"); - } - else - { - sendSystemMessage(player, new string_id("spam", "no_detect")); - } - - return; - } - - - public static boolean canConcealDevice(obj_id player, obj_id target) throws InterruptedException - { - if (!isIdValid(target) || !exists(target)) - { - - return false; - } - - if (!hasObjVar(target, CONCEALABLE_DEVICE)) - { - sendSystemMessage(player, new string_id("spam", "cant_conceal_that")); - return false; - } - - if (hasObjVar(target, CONCEALED_OBJECT)) - { - sendSystemMessage(player, new string_id("spam", "already_concealed")); - return false; - } - - obj_id owner = getOwner(target); - if (owner != player) - { - if (!group.inSameGroup(player, owner)) - { - sendSystemMessage(player, new string_id("spam", "cant_conceal_owner")); - return false; - } - } - - if (getDistance(getLocation(target), getLocation(player)) > 15) - { - sendSystemMessage(player, new string_id("spam", "too_far_conceal")); - return false; - } - - return true; - } - - - public static void concealDevice(obj_id player, obj_id target) throws InterruptedException - { - int camoSkill = getEnhancedSkillStatisticModifier(player, "camouflage"); - camoSkill += getEnhancedSkillStatisticModifier(player, "stealth"); - setObjVar(target, CONCEALED_OBJECT, 1); - setObjVar(target, CAMO_SKILL, camoSkill); - setObjVar(target, CAMOUFLAGED_AT_LEVEL, getLevel(player)); - - hideFromClient(target, true); - } - - - public static void unconcealDevice(obj_id player, obj_id target) throws InterruptedException - { - removeObjVar(target, CONCEALED_OBJECT); - removeObjVar(target, CAMO_SKILL); - removeObjVar(target, CAMOUFLAGED_AT_LEVEL); - hideFromClient(target, false); - - location loc = getLocation(target); - loc.y -= 10; - playClientEffectLoc(player, "clienteffect/frs_dark_vengeance.cef", loc, 0); - stopClientEffectObjByLabel(target, "trapConceal"); - doAnimationAction(player, "point_down"); - } - - - public static boolean canSetTrap(obj_id player, obj_id trap) throws InterruptedException - { - if (!isIdValid(trap) || !hasScript(trap, "systems.skills.stealth.trap")) - { - - return false; - } - - if (ai_lib.isInCombat(player)) - { - sendSystemMessage(player, new string_id("spam", "trap_not_in_combat")); - return false; - } - - if (!utils.isNestedWithin(trap, player)) - { - sendSystemMessage(player, new string_id("spam", "trap_not_possession")); - return false; - } - - if (isPvPTrap(trap) && !factions.isDeclared(player)) - { - sendSystemMessage(player, new string_id("spam", "trap_not_declared")); - return false; - } - - if (pet_lib.isMounted(player)) - { - sendSystemMessage(player, new string_id("spam", "trap_not_while_mounted")); - return false; - } - - if (!hasObjVar(trap, TRIGGER_TYPE)) - { - sendSystemMessage(player, new string_id("spam", "trap_no_trigger_installed")); - return false; - } - - if (locations.isInCity(getLocation(player))) - { - sendSystemMessage(player, new string_id("spam", "no_trap_city")); - return false; - } - - if (inTrapRestrictedRegion(player)) - { - sendSystemMessage(player, new string_id("spam", "trap_restricted_region")); - return false; - } - - if (utils.isInHouseCellSpace(player)) - { - obj_id house = getTopMostContainer(player); - if (hasObjVar( house, "player_structure.admin.adminList" )) - { - sendSystemMessage(player, new string_id("spam", "trap_not_house")); - return false; - } - - } - - obj_id[] stuff = getNonCreaturesInRange(getLocation(player), TRAP_MIN_DISTANCE_BETWEEN); - for (int i = 0; i < stuff.length; i++) - { - testAbortScript(); - if (hasObjVar(stuff[i], TRAP_TYPE)) - { - sendSystemMessage(player, new string_id("spam", "other_trap")); - return false; - } - } - - return true; - } - - - public static boolean inTrapRestrictedRegion(obj_id player) throws InterruptedException - { - for (int i = 0; i < TRAP_RESTRICTED_REGIONS.length; i++) - { - testAbortScript(); - if (groundquests.isInNamedRegion(player, TRAP_RESTRICTED_REGIONS[i])) - { - return true; - } - } - return false; - } - - - public static void onGetTrapAttributes(obj_id self, obj_id player, String[] names, String[] attribs, int free) throws InterruptedException - { - - if (free == -1) - { - return; - } - - if (hasObjVar(self, TRAP_TYPE)) - { - int trapTypeInt = getIntObjVar(self, TRAP_TYPE); - if (trapTypeInt == TRAP_CALTROP) - { - float trapRadiusFlt = TRAP_CALTROP_BLAST_RADIUS; - names[free] = "trap_radius"; - attribs[free++] = "" + trapRadiusFlt + "m"; - } - - if (trapTypeInt == TRAP_FLASHBANG) - { - float trapRadiusFlt = TRAP_FLASHBANG_BLAST_RADIUS; - names[free] = "trap_radius"; - attribs[free++] = "" + trapRadiusFlt + "m"; - } - - if (trapTypeInt == TRAP_HX2) - { - float trapRadiusFlt = TRAP_HX2_BLAST_RADIUS; - names[free] = "trap_radius"; - attribs[free++] = "" + trapRadiusFlt + "m"; - } - - if (trapTypeInt == TRAP_KAMINODART) - { - float trapRadiusFlt = TRAP_KAMINODART_BLAST_RADIUS; - names[free] = "trap_radius"; - attribs[free++] = "" + trapRadiusFlt + "m"; - } - } - - if (hasObjVar(self, TRAP_POWER)) - { - names[free] = "trap_power"; - attribs[free++] = "" + floatFormat.format(getIntObjVar(self, TRAP_POWER) / 10) + "%"; - } - - if (hasObjVar(self, TIMER_TIME) && (utils.isNestedWithin(self, player) || getOwner(self) == player)) - { - names[free] = "trigger_time"; - attribs[free++] = "" + getIntObjVar(self, TIMER_TIME) + " seconds"; - - names[free] = "tooltip.trap_type"; - attribs[free++] = "@spam:trap_trigger_timed"; - - names[free] = "trap_type"; - attribs[free++] = "@spam:trap_trig_desc_timed"; - } - - if (hasObjVar(self, PROXIMITY_RANGE) && (utils.isNestedWithin(self, player) || getOwner(self) == player)) - { - names[free] = "trigger_proximity"; - - int proximityRange = getIntObjVar(self, PROXIMITY_RANGE); - String meterPluralization = " meters"; - - if (proximityRange == 1) - { - meterPluralization = " meter"; - } - - attribs[free++] = "" + proximityRange + meterPluralization; - - names[free] = "tooltip.trap_type"; - attribs[free++] = "@spam:trap_trigger_proximity"; - - names[free] = "trap_type"; - attribs[free++] = "@spam:trap_trig_desc_proximity"; - } - - if (hasObjVar(self, TRAP_FREQUENCY) && (utils.isNestedWithin(self, player) || getOwner(self) == player)) - { - names[free] = "tooltip.trap_type"; - attribs[free++] = "@spam:trap_trigger_remote"; - - names[free] = "trap_type"; - attribs[free++] = "@spam:trap_trig_desc_remote"; - } - - if (hasObjVar(self, TRAP_FREQUENCY) && hasObjVar(self, "armed")) - { - names[free] = "trap_frequency"; - attribs[free++] = "" + getStringObjVar(self, TRAP_FREQUENCY) + " mHz"; - } - - if (hasObjVar(self, BIO_PROBE_TRAP_TARGET)) - { - names[free] = "trigger_filter"; - attribs[free++] = "" + getStringObjVar(self, BIO_PROBE_TARGET_NAME); - } - - free = utils.addClassRequirementAttributes(player, self, names, attribs, free, "trap."); - free = utils.addClassRequirementAttributes(player, self, names, attribs, free, "trap.trigger."); - - return; - } - - - public static boolean tryDetonateTrap(obj_id trap, obj_id target) throws InterruptedException - { - if (!hasObjVar(trap, "armed")) - { - return false; - } - - int trapType = getIntObjVar(trap, TRAP_TYPE); - int triggerAccuracy = getIntObjVar(trap, TRAP_TR_ACCURACY); - boolean success = rand(1, 100) <= triggerAccuracy; - if (!success) - { - playTrapFizzle(trap); - - if (getIntObjVar(trap, TRIGGER_TYPE) == TRIGGER_TYPE_TIMER) - { - dictionary parms = new dictionary(); - int time = getGameTime(); - parms.put("armed", time); - float newTime = getIntObjVar(trap, TIMER_TIME) * rand(0.1f, 0.25f); - messageTo(trap, "msgTryDetonateTimer", parms, newTime, false); - setObjVar(trap, "armed", time); - - } - - return false; - } - - Vector targets = getTrapTargets(trap, trapType); - if (validateTrapTarget(trap, target) && targets.indexOf(target) == -1) - { - targets.add(target); - } - - hideFromClient(trap, false); - doTrapDetonateEffect(trap, trapType, targets, 0, target); - - return true; - } - - - public static Vector getTrapTargets(obj_id trap, int trapType) throws InterruptedException - { - obj_id[] targets = new obj_id[0]; - switch(trapType) - { - case TRAP_HX2: - targets = getCreaturesInRange(getLocation(trap), TRAP_HX2_BLAST_RADIUS); - break; - case TRAP_FLASHBANG: - targets = getCreaturesInRange(getLocation(trap), TRAP_FLASHBANG_BLAST_RADIUS); - break; - case TRAP_CALTROP: - targets = getCreaturesInRange(getLocation(trap), TRAP_CALTROP_BLAST_RADIUS); - break; - case TRAP_KAMINODART: - targets = getCreaturesInRange(getLocation(trap), TRAP_KAMINODART_BLAST_RADIUS); - break; - } - - Vector finalTargets = new Vector(); - obj_id filter = getBioProbeTarget(trap); - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - if (!isIdValid(filter) || targets[i] == filter) - { - if (validateTrapTarget(trap, targets[i])) - { - finalTargets.add(targets[i]); - } - } - } - - return finalTargets; - } - - - public static void doTrapDetonateEffect(obj_id trap, int trapType, Vector targets, float percentMod, obj_id breacher) throws InterruptedException - { - if (targets.size() > 0) - { - - switch(trapType) - { - case TRAP_HX2: - dictionary params = new dictionary(); - obj_id owner = getOwner(trap); - - if (!isIdValid(breacher)) - { - breacher = (obj_id)targets.elementAt(0); - if (!isIdValid(breacher)) - { - break; - } - } - - params.put("target", breacher); - params.put("owner", owner); - messageTo(trap, "co_mine_hx2", params, 0, false); - break; - case TRAP_FLASHBANG: - doFlashBangDetonate(trap, targets, percentMod); - break; - case TRAP_CALTROP: - doCaltropDetonate(trap, targets, percentMod); - break; - case TRAP_KAMINODART: - doKaminoDartDetonate(trap, targets, percentMod); - break; - } - } - else - { - playClientEffectLoc(trap, "clienteffect/lair_damage_heavy.cef", getLocation(trap), 0.0f); - } - - destroyObject(trap); - } - - - public static void doTrapDetonateEffect(obj_id trap, int trapType, Vector targets) throws InterruptedException - { - doTrapDetonateEffect(trap, trapType, targets, 0); - } - - - public static void doTrapDetonateEffect(obj_id trap, int trapType, Vector targets, float percentMod) throws InterruptedException - { - doTrapDetonateEffect(trap, trapType, targets, 0, null); - } - - - public static void doKaminoDartDetonate(obj_id trap, Vector targets) throws InterruptedException - { - doKaminoDartDetonate(trap, targets, 0); - } - - - public static void doKaminoDartDetonate(obj_id trap, Vector targets, float percentMod) throws InterruptedException - { - - float trapPower = getIntObjVar(trap, TRAP_POWER); - int potency = (int) (KAMINODART_MAX_POTENCY * (trapPower/1000)); - int duration = (int) (KAMINODART_MAX_DURATION * (trapPower/1000)); - int strength = (int) (KAMINODART_MAX_STRENGTH * (trapPower/1000)); - obj_id owner = getOwner(trap); - boolean isInvis = false; - String invis = null; - boolean attackerPresent = false; - if (isIdValid(owner) && exists(owner)) - { - attackerPresent = true; - invis = getInvisBuff(getOwner(trap)); - } - - isInvis = invis != null && invis.length() > 0; - duration += duration * percentMod; - strength += strength * percentMod; - - obj_id curObj = null; - prose_package pp = prose.getPackage(new string_id("spam", "kamino_trap_hit")); - playClientEffectLoc(trap, "clienteffect/lair_damage_light.cef", getLocation(curObj), 0.0f); - - for (int i = 0; i < targets.size(); i++) - { - testAbortScript(); - curObj = (obj_id)targets.get(i); - playClientEffectLoc(curObj, "clienteffect/lair_damage_light.cef", getLocation(curObj), 0.0f); - dot.applyDotEffect(curObj, owner, dot.DOT_POISON, "rangerTrapKaminoDart", HEALTH, potency, strength, duration, true, null); - pp = prose.setTT(pp, curObj); - - if (attackerPresent) - { - if (isInvis && rand(1, 100) < 50) - { - continue; - } - - startCombat(curObj, owner); - } - } - - return; - } - - - public static void doCaltropDetonate(obj_id trap, Vector targets) throws InterruptedException - { - doCaltropDetonate(trap, targets, 0); - } - - - public static void doCaltropDetonate(obj_id trap, Vector targets, float percentMod) throws InterruptedException - { - - float trapPower = getIntObjVar(trap, TRAP_POWER); - float duration = CALTROP_MAX_DURATION * (trapPower / 1000); - float snareAmount = CALTROP_MAX_SNARE * (trapPower / 1000); - obj_id curObj = null; - prose_package pp = prose.getPackage(new string_id("spam", "caltrop_trap_hit")); - obj_id owner = getOwner(trap); - boolean isInvis = false; - String invis = null; - boolean attackerPresent = false; - - if (isIdValid(owner) && exists(owner)) - { - attackerPresent = true; - invis = getInvisBuff(getOwner(trap)); - } - - isInvis = invis != null && invis.length() > 0; - - playClientEffectLoc(trap, "clienteffect/lair_med_damage_smoke.cef", getLocation(trap), 0.0f); - - duration += duration * percentMod; - snareAmount += snareAmount * percentMod; - if (snareAmount > 95) - { - snareAmount = 95; - } - for (int i = 0; i < targets.size(); i++) - { - testAbortScript(); - curObj = (obj_id)targets.get(i); - if (buff.canApplyBuff(curObj, "caltropSnare")) - { - playClientEffectLoc(curObj, "clienteffect/lair_damage_light.cef", getLocation(curObj), 0.0f); - buff.applyBuff(curObj, "caltropSnare", duration, snareAmount); - - if (attackerPresent) - { - if (isInvis && rand(1, 100) < 50) - { - continue; - } - - startCombat(curObj, owner); - } - } - } - } - - - public static void doFlashBangDetonate(obj_id trap, Vector targets) throws InterruptedException - { - doFlashBangDetonate(trap, targets, 0); - } - - - public static void doFlashBangDetonate(obj_id trap, Vector targets, float percentMod) throws InterruptedException - { - - float trapPower = getIntObjVar(trap, TRAP_POWER); - float duration = FLASHBANG_MAX_DURATION * (trapPower / 1000); - float amount = FLASHBANG_MAX_COMBAT_SLOW * (trapPower / 1000); - obj_id curObj = null; - prose_package pp = prose.getPackage(new string_id("spam", "flashbang_trap_hit")); - obj_id owner = getOwner(trap); - boolean isInvis = false; - String invis = null; - boolean attackerPresent = false; - - if (isIdValid(owner) && exists(owner)) - { - attackerPresent = true; - invis = getInvisBuff(getOwner(trap)); - } - - isInvis = invis != null && invis.length() > 0; - - playClientEffectLoc(trap, "clienteffect/int_camshake_light.cef", getLocation(trap), 0.0f); - playClientEffectLoc(trap, "appearance/pt_flash_bomb.prt", getLocation(trap), 0.0f); - - duration += duration * percentMod; - amount += amount * percentMod; - - for (int i = 0; i < targets.size(); i++) - { - testAbortScript(); - curObj = (obj_id)targets.get(i); - if (buff.canApplyBuff(curObj, "flashBang")) - { - if (isPlayer(curObj)) - { - doAnimationAction(curObj, "cover_ears_mocking"); - } - buff.applyBuff(curObj, "flashBang", duration, amount); - - if (attackerPresent) - { - if (isInvis && rand(1, 100) < 50) - { - continue; - } - startCombat(curObj, owner); - } - } - else - { - - } - } - - return; - } - - - public static boolean safePvPCanAttack(obj_id trap, obj_id target) throws InterruptedException - { - obj_id trapOwner = getOwner(trap); - if (isIdValid(trapOwner) && exists(trapOwner)) - { - return pvpCanAttack(trapOwner, target); - } - - if (isInvulnerable(target)) - { - return false; - } - - if (trapOwner == target) - { - return false; - } - - boolean actorIsPlayer = true; - int actorFaction = getIntObjVar(trap, TRAP_FACTION); - int actorPvPType = getIntObjVar(trap, TRAP_PVP_TYPE); - - int targetFaction = pvpGetAlignedFaction(target); - boolean targetIsPlayer = isPlayer(target); - int targetPvPType = pvpGetType(target); - - if (targetIsPlayer && actorPvPType != PVPTYPE_DECLARED) - { - return false; - } - - if (targetIsPlayer && actorIsPlayer) - { - - if (pvpAreFactionsOpposed(actorFaction, targetFaction)) - { - - if (actorPvPType == PVPTYPE_DECLARED && targetPvPType == PVPTYPE_DECLARED) - { - return true; - } - } - } - - if (actorIsPlayer && !targetIsPlayer) - { - - if (targetFaction != 0) - { - - if (actorFaction != targetFaction) - { - - return pvpAreFactionsOpposed(actorFaction, targetFaction); - } - - return false; - } - else - { - return true; - } - - } - - return false; - } - - - public static boolean validateTrapTarget(obj_id trap, obj_id target) throws InterruptedException - { - if (!isIdValid(target) || trap == target) - { - - return false; - } - - if (isDead(target)) - { - - return false; - } - - if (isIncapacitated(target)) - { - - return false; - } - - if (!safePvPCanAttack(trap, target)) - { - - return false; - } - - location trapLoc = getLocation( trap ); - trapLoc.y += 0.5f; - if (!canSee(target, trapLoc)) - { - - return false; - } - - return true; - } - - - public static void playTrapFizzle(obj_id trap) throws InterruptedException - { - playClientEffectLoc(trap, "clienteffect/frs_light_serenity.cef", getLocation(trap), 0.0f); - } - - - public static void playSelfDestruct(obj_id trap) throws InterruptedException - { - playClientEffectLoc(trap, "clienteffect/combat_grenade_thermal_detonator.cef", getLocation(trap), 0.0f); - } - - - public static boolean setTrap(obj_id player, obj_id invTrap) throws InterruptedException - { - if (!hasObjVar(invTrap, TRIGGER_TYPE)) - { - return false; - } - - int count = getCount(invTrap); - if (count < 1) - { - destroyObject(invTrap); - return false; - } - - location loc = getLocation(player); - int triggerType = getIntObjVar(invTrap, TRIGGER_TYPE); - String template = getTemplateName(invTrap); - obj_id trap = utils.cloneObject(invTrap, loc); - int time = getGameTime(); - - if (!isIdValid(trap)) - { - return false; - } - - switch(triggerType) - { - case TRIGGER_TYPE_TIMER: - dictionary parms = new dictionary(); - parms.put("armed", time); - messageTo(trap, "msgTryDetonateTimer", parms, getIntObjVar(trap, TIMER_TIME), false); - setObjVar(trap, "armed", time); - break; - case TRIGGER_TYPE_REMOTE: - obj_id pInv = utils.getInventoryContainer(player); - int free = getVolumeFree(pInv); - if (free < 1) - { - sendSystemMessage(player, new string_id("spam", "no_room_remote_trigger")); - return false; - } - String remote = "object/tangible/scout/trap/trap_ap_tr_remote.iff"; - obj_id remoteTrigger = createObject(remote, pInv, ""); - - if (!isIdValid(remoteTrigger)) - { - destroyObject(trap); - return false; - } - - String frequency = ""+ rand(0, 999) + "."+ rand(0, 999) + "."+ rand(0, 999);; - setObjVar(remoteTrigger, stealth.TRAP_FREQUENCY, frequency); - setObjVar(trap, stealth.TRAP_FREQUENCY, frequency); - - setObjVar(trap, stealth.TRAP_MY_PROXIMITY_TRIGGER, remoteTrigger); - setObjVar(remoteTrigger, stealth.TRAP_MY_TRAP, trap); - - sendSystemMessage(player, new string_id("spam", "trap_keyed_remote")); - setObjVar(trap, "armed", time); - setObjVar(remoteTrigger, "armed", true); - break; - case TRIGGER_TYPE_PROXIMITY: - dictionary timeArmed = new dictionary(); - timeArmed.put("armed", time); - messageTo(trap, "msgArmProximity", timeArmed, 0, false); - break; - } - - playClientEffectObj(trap, "appearance/pt_trap_reticule.prt", trap, "", null, "trapReticle"); - doAnimationAction(player, "point_down"); - setOwner(trap, player); - setObjVar(trap, TRAP_FACTION, pvpGetAlignedFaction(player)); - setObjVar(trap, TRAP_PVP_TYPE, pvpGetType(player)); - setObjVar(trap, TRAP_DIFFICULTY, getEnhancedSkillStatisticModifier(player, "ranger_trap")); - setObjVar(trap, TRAP_LEVEL, getLevel(player)); - - if (hasObjVar(trap, "concealable")) - { - if (buff.hasBuff(player, "conceal_trap")) - { - stealth.concealDevice(player, trap); - } - } - - setWeaponMinDamage(trap, 1); - setWeaponMaxDamage(trap, 1); - setWeaponAttackSpeed(trap, 0.25f); - - weapons.setWeaponData(trap); - - messageTo(trap, "msgSelfDestructTimeout", null, TRAP_SELF_DESTRUCT_TIMEOUT, false); - count--; - if (count < 1) - { - destroyObject(invTrap); - } - else - { - setCount(invTrap, count); - } - return true; - } - - - public static obj_id getTrigger(obj_id trap) throws InterruptedException - { - if (hasObjVar(trap, TRAP_MY_PROXIMITY_TRIGGER)) - { - return getObjIdObjVar(trap, TRAP_MY_PROXIMITY_TRIGGER); - } - - obj_id[] stuff = getContents(trap); - for (int i = 0; i < stuff.length; i++) - { - testAbortScript(); - if (hasScript(stuff[i], "systems.skills.stealth.traptrigger")) - { - return stuff[i]; - } - } - - return null; - } - - - public static boolean doTheftLoot(obj_id thief, obj_id mark) throws InterruptedException - { - obj_id thiefInventory = utils.getInventoryContainer(thief); - int free = getVolumeFree(thiefInventory); - prose_package pp = new prose_package(); - if (free < 1) - { - sendSystemMessage(thief, new string_id("spam", "cant_steal_inventory_full")); - return false; - } - - int stealFlags = stealFlags = STEAL_CREDITS | STEAL_LOOT; - - if (utils.hasScriptVar(mark, STEAL_TYPE)) - { - stealFlags = utils.getIntScriptVar(mark, STEAL_TYPE); - } - - if (isPlayer(mark)) - { - stealFlags = STEAL_MARKED_ITEMS; - } - else if (hasStealingLootTableEntry(mark)) - { - stealFlags |= STEAL_STEALING_TABLE; - } - - Vector types = new Vector(); - if (isFlagSet(stealFlags, STEAL_CREDITS)) - { - types.add(new Integer(STEAL_CREDITS)); - } - - if (isFlagSet(stealFlags, STEAL_LOOT)) - { - types.add(new Integer(STEAL_LOOT)); - } - - if (isFlagSet(stealFlags, STEAL_TEMPLATE)) - { - types.add(new Integer(STEAL_TEMPLATE)); - } - - if (isFlagSet(stealFlags, STEAL_MARKED_ITEMS)) - { - types.add(new Integer(STEAL_MARKED_ITEMS)); - } - - if (isFlagSet(stealFlags, STEAL_STEALING_TABLE)) - { - types.add(new Integer(STEAL_STEALING_TABLE)); - } - - boolean gotSomething = false; - while (types.size() > 0 && !gotSomething) - { - testAbortScript(); - int roll = rand(0, types.size()-1); - int flag = ((Integer)types.get(roll)).intValue(); - int markLevel = getLevel(mark); - int thiefLevel = getLevel(thief); - int stealRoll = rand(1,100); - if (STEAL_FAIL_CHANCE < stealRoll) - { - - switch(flag) - { - case STEAL_CREDITS: - if (isPlayer(mark)) - { - break; - } - int amt = (int)(getNpcCash(mark) * .2f); - if (amt > 0) - { - dictionary d = new dictionary(); - d.put(money.DICT_AMOUNT, amt); - boolean boolReturn = transferBankCreditsFromNamedAccount(money.ACCT_NPC_LOOT, thief, amt, "handleStealCashSuccess", "handleStealCashFail", d); - utils.moneyInMetric(mark, money.ACCT_NPC_LOOT, amt); - gotSomething = true; - - } - break; - - case STEAL_LOOT: - if (isPlayer(mark)) - { - break; - } - - int lootRoll = rand(1, 100); - - if (lootRoll >= STEAL_RARE_ITEM) - { - - if (thiefLevel <= (markLevel + 10)) - { - if (!hasCompletedCollection(thief, "spy_unarmed_01")) - { - long slotValueOne = getCollectionSlotValue(thief, "col_spy_unarmed_01_01"); - long slotValueTwo = getCollectionSlotValue(thief, "col_spy_unarmed_01_02"); - long slotValueThree = getCollectionSlotValue(thief, "col_spy_unarmed_01_03"); - long slotValueFour = getCollectionSlotValue(thief, "col_spy_unarmed_01_04"); - - if (slotValueOne == 0) - { - modifyCollectionSlotValue(thief, "col_spy_unarmed_01_01", 1); - } - - else if (slotValueTwo == 0) - { - modifyCollectionSlotValue(thief, "col_spy_unarmed_01_02", 1); - } - - else if (slotValueThree == 0) - { - modifyCollectionSlotValue(thief, "col_spy_unarmed_01_03", 1); - } - - else if (slotValueFour == 0) - { - modifyCollectionSlotValue(thief, "col_spy_unarmed_01_04", 1); - } - } - - gotSomething = loot.generateTheftLootRare(thiefInventory, mark, 1, thief); - break; - } - - gotSomething = loot.generateTheftLoot(thiefInventory, mark, STEAL_LOOT_CHANCE_MOD, 1); - break; - - } - - if (lootRoll >= STEAL_REGULAR_ITEM && lootRoll < STEAL_RARE_ITEM) - { - if (thiefLevel <= (markLevel + 10)) - { - - boolean gotCollectionItem = false; - gotCollectionItem = loot.addCollectionLoot(mark, true, thief); - gotSomething = gotCollectionItem; - - if (!gotCollectionItem) - { - gotSomething = loot.generateTheftLoot(thiefInventory, mark, STEAL_LOOT_CHANCE_MOD, 1); - break; - } - break; - } - - else - { - gotSomething = loot.generateTheftLoot(thiefInventory, mark, STEAL_LOOT_CHANCE_MOD, 1); - break; - - } - - } - - if (lootRoll < STEAL_REGULAR_ITEM) - { - gotSomething = loot.generateTheftLoot(thiefInventory, mark, STEAL_LOOT_CHANCE_MOD, 1); - break; - } - - break; - - case STEAL_TEMPLATE: - Vector itms = getStealableTemplates(mark); - if (itms.size() < 1) - { - break; - } - String templateLoot = (String)itms.get(rand(0, itms.size()-1)); - if (templateLoot == null || templateLoot.length() < 1) - { - break; - } - - obj_id templateObj = null; - if (templateLoot.startsWith("static:")) - { - java.util.StringTokenizer st = new java.util.StringTokenizer(templateLoot, ":"); - if (st.countTokens() == 2) - { - st.nextToken(); - String itemName = st.nextToken(); - templateObj = static_item.createNewItemFunction(templateLoot, thiefInventory); - } - } - else - { - templateObj = createObjectOverloaded(templateLoot, thiefInventory); - } - - gotSomething = templateObj != null; - if (gotSomething) - { - utils.setScriptVar(thiefInventory, "theft_in_progress", 1); - loot.notifyThiefOfItemStolen(thiefInventory, templateObj); - } - break; - - case STEAL_MARKED_ITEMS: - obj_id[] stuff = utils.getFilteredPlayerContents(mark); - Vector eligibleItems = new Vector(); - for (int i = 0; i < stuff.length; i++) - { - testAbortScript(); - if (isItemStealable(stuff[i])) - { - eligibleItems.add(stuff[i]); - } - } - - if (eligibleItems.size() < 1) - { - break; - } - - obj_id markedObj = (obj_id)eligibleItems.get(rand(0, eligibleItems.size()-1)); - gotSomething = putIn(markedObj, thiefInventory); - if (gotSomething) - { - CustomerServiceLog("stealing", "%TU stole an item ("+ markedObj + " - "+ getName(markedObj) + - ") from player %TT", thief, mark); - utils.setScriptVar(thiefInventory, "theft_in_progress", 1); - loot.notifyThiefOfItemStolen(thiefInventory, markedObj); - } - break; - - case STEAL_STEALING_TABLE: - String tableTemplate = getStealableTemplateFromTable(mark); - if (tableTemplate == null || tableTemplate.length() < 1) - { - break; - } - - obj_id tableObj = null; - if (tableTemplate.startsWith("static:")) - { - java.util.StringTokenizer st = new java.util.StringTokenizer(tableTemplate, ":"); - if (st.countTokens() == 2) - { - st.nextToken(); - String itemName = st.nextToken(); - tableObj = static_item.createNewItemFunction(tableTemplate, thiefInventory); - } - } - else - { - tableObj = createObjectOverloaded(tableTemplate, thiefInventory); - } - gotSomething = tableObj != null; - if (gotSomething) - { - utils.setScriptVar(thiefInventory, "theft_in_progress", 1); - loot.notifyThiefOfItemStolen(thiefInventory, tableObj); - } - break; - } - } - stealFlags &= ~flag; - types.removeElementAt(roll); - } - - if (!isPlayer(mark)) - { - utils.setScriptVar(mark, STEAL_TYPE, stealFlags); - } - return gotSomething; - } - - - public static boolean hasStealingLootTableEntry(obj_id mark) throws InterruptedException - { - String name = getCreatureName(mark); - String type = loot.getCreatureType(name); - String table = "datatables/loot/stealing_loot.iff"; - int row = dataTableSearchColumnForInt(getStringCrc(type), "npc_type", table); - - if (row < 0) - { - return false; - } - - return true; - } - - - public static String getStealableTemplateFromTable(obj_id mark) throws InterruptedException - { - Vector stuff = new Vector(); - Vector weights = new Vector(); - - String name = getCreatureName(mark); - - String table = "datatables/loot/stealing_loot.iff"; - int row = dataTableSearchColumnForInt(getStringCrc(name), "npc_type", table); - - if (row < 0) - { - return null; - } - - int rows = dataTableGetNumRows(table); - while (true) - { - testAbortScript(); - stuff.add(dataTableGetString(table, row, "stealableObjects")); - weights.add(new Integer(dataTableGetInt(table, row, "weight"))); - - row++; - - if (row >= rows || dataTableGetInt(table, row, "npc_type") != 0) - { - break; - } - } - - int total = 0; - int[] weightArray = new int[weights.size()]; - for (int i = 0; i < weightArray.length; i++) - { - testAbortScript(); - weightArray[i] = ((Integer)weights.get(i)).intValue(); - total += weightArray[i]; - } - - if (total < 1) - { - total = 1; - } - - int roll = rand(1, total); - - int idx = -1; - int low_range = 0; - for (int j = 0; j < weightArray.length; j++) - { - testAbortScript(); - int high_range = low_range + weightArray[j]; - - if (roll > low_range && roll <= high_range) - { - idx = j; - break; - } - low_range = high_range; - } - - if (idx < stuff.size()) - { - return (String)stuff.get(idx); - } - return (String)stuff.get(rand(0, stuff.size()-1)); - } - - - public static void flagItemAsStealable(obj_id item) throws InterruptedException - { - setObjVar(item, STEAL_ITEM_IS_STEALABLE, 1); - } - - - public static boolean isItemStealable(obj_id item) throws InterruptedException - { - return hasObjVar(item, STEAL_ITEM_IS_STEALABLE); - } - - - public static void unflagItemAsStealable(obj_id item) throws InterruptedException - { - removeObjVar(item, STEAL_ITEM_IS_STEALABLE); - } - - - public static void addStealableTemplate(obj_id mark, String template) throws InterruptedException - { - Vector itms = getStealableTemplates(mark); - itms.add(template); - utils.setResizeableBatchObjVar(mark, STEAL_TEMPLATE_ITEMS, itms); - } - - - public static Vector getStealableTemplates(obj_id mark) throws InterruptedException - { - return utils.getResizeableStringBatchObjVar(mark, STEAL_TEMPLATE_ITEMS); - } - - - public static int getNpcCash(obj_id mark) throws InterruptedException - { - String mobType = ai_lib.getCreatureName(mark); - if (mobType == null) - { - return 0; - } - - int level = ai_lib.getLevel(mark); - int cash = loot.getCashForLevel(mobType, level); - - if (cash > 0) - { - return cash; - } - - cash = rand (1, 10); - cash = cash * level; - - return cash; - } - - - public static boolean canSteal(obj_id thief, obj_id mark) throws InterruptedException - { - if (!pvpCanAttack(thief, mark)) - { - sendSystemMessage(thief, new string_id("spam", "steal_cant_pvp")); - return false; - } - - if (!ai_lib.isHumanoid(mark)) - { - sendSystemMessage(thief, new string_id("spam", "steal_not_humanoid")); - return false; - } - - if (utils.hasScriptVar(mark, STEAL_TYPE)) - { - int stealFlags = utils.getIntScriptVar(mark, STEAL_TYPE); - if (stealFlags == STEAL_NOTHING) - { - sendSystemMessage(thief, new string_id("spam", "stolen_got_nothing")); - return false; - } - } - - return true; - } - - - public static boolean steal(obj_id thief, obj_id mark) throws InterruptedException - { - if (!luck.isLucky(thief, 0.01f)) - { - if (isCoughtWhileStealing(thief, mark) || luck.isLucky(mark, 0.01f)) - { - sendSystemMessageTestingOnly(thief, "STEALING CHECK FAILED: CAUGHT"); - showFlyText(thief, new string_id("spam", "stealing_cought"), 1.5f, colors.TOMATO); - sendSystemMessage(thief, new string_id("spam", "stolen_cought")); - String invis = getInvisBuff(thief); - if (invis != null && invis.length() > 0) - { - buff.removeBuff(thief, invis); - } - if (isPlayer(mark)) - { - prose_package pp = prose.getPackage(new string_id("spam", "almost_got_item_stolen"), thief); - sendSystemMessageProse(mark, pp); - } - else - { - startCombat(mark, thief); - startCombat(thief, mark); - } - return false; - } - } - - showFlyTextPrivate(thief, thief, new string_id("spam", "stealin_on"), 1.5f, colors.TOMATO); - if (doTheftLoot(thief, mark)) - { - - } - else - { - sendSystemMessage(thief, new string_id("spam", "stolen_nothing")); - } - - return true; - } - - - public static boolean isCoughtWhileStealing(obj_id thief, obj_id mark) throws InterruptedException - { - return passiveDetectHiddenTarget(thief, mark, PASSIVE_BREACH_NEAR); - } - - - public static boolean witnessModifiedSkillCheck(obj_id player, String skillMod, float distance, int witnessPenalty, int skillModMod) throws InterruptedException - { - int skill = getEnhancedSkillStatisticModifier(player, skillMod) + skillModMod; - if (skill < 0) - { - skill = 0; - } - - obj_id[] stuff = getCreaturesInRange(player, distance); - - int cnt = 0; - int sGuildId = getGuildId(player); - - if (stuff.length > 0) - { - for (int i = 0; i < stuff.length; i++) - { - testAbortScript(); - if (ai_lib.isHumanoid(stuff[i])) - { - boolean isInSameGuild = (sGuildId != 0) && (getGuildId(stuff[i]) == sGuildId); - if (!isInSameGuild && !group.inSameGroup(player, stuff[i])) - { - skill -= witnessPenalty; - } - } - } - - float rslt = (1/ (1+ ((skill+10) / 10))); - return (rand(0, 1f) > rslt); - } - - return true; - } - - - public static void invisBuffRemoved(obj_id player, String sbuff) throws InterruptedException - { - - if (buff.hasBuff(player, BUFF_NO_BREAK_INVIS)) - { - return; - } - - if (buff.hasBuff(player, "sp_burst_shadows")) - { - buff.removeBuff(player, "sp_burst_shadows"); - } - - _makeVisible(player, new string_id("spam", "stealthoff"), null); - - messageTo(player, "addAppearanceItemEffect", null, 1, false); - - } - - - public static void OnLocomotionChange(obj_id player, int oldLoco, int newLoco) throws InterruptedException - { - String invis = getInvisBuff(player); - if (invis == null) - { - return; - } - - int pri = buff.getPriority(invis); - if (pri < MIN_MOVEMENT_PRIORITY) - { - sendSystemMessage(player, new string_id("spam", "posturechangereveal")); - buff.removeBuff(player, invis); - } - } - - - public static void OnPostureChanged(obj_id player, int before, int after) throws InterruptedException - { - String invis = getInvisBuff(player); - if (invis == null) - { - return; - } - - int pri = buff.getPriority(invis); - if (pri < MIN_POSTURE_CHANGE_PRIORITY) - { - sendSystemMessage(player, new string_id("spam", "posturechangereveal")); - buff.removeBuff(player, invis); - } - } - - - public static int getApplicableInvisSkillMod(obj_id thing, String buffName) throws InterruptedException - { - String modName = "camouflage"; - switch(getStringCrc(buffName)) - { - - case (-879194497): - modName = "camouflage"; - break; - case (1252380095): - modName = "camouflage"; - break; - case (815407714): - case (-1923109470): - break; - case (-121504680): - modName = "cover"; - break; - case (1206342977): - case (-50098035): - modName = "stealth"; - break; - case (342850470): - modName = ""; - break; - } - - int mod = 0; - if (modName.length() > 0) - { - mod = getEnhancedSkillStatisticModifierUncapped(thing, modName); - - if (modName.equals("camouflage")) - { - mod += getEnhancedSkillStatisticModifierUncapped(thing, "stealth"); - } - } - - return mod; - } - - - public static int getApplicableInvisSkillMod(obj_id thing) throws InterruptedException - { - int mod = 0; - if (isPlayer(thing)) - { - String invis = getInvisBuff(thing); - if (invis == null || invis.length() < 1) - { - return mod; - } - - mod = getApplicableInvisSkillMod(thing, invis); - } - else - { - mod = getIntObjVar(thing, "camouflageMod"); - } - - return mod; - } - - - public static float getDetectChance(obj_id target, obj_id detector, float baseChanceToDetect) throws InterruptedException - { - String invis = getInvisBuff(target); - - if (beast_lib.isBeast(target)) - { - invis = "invis"; - } - - if (invis != null && invis.length() > 0) - { - if (buff.getPriority(invis) > MAX_INVIS_BUFF_TO_DETECT) - { - return 0.0f; - } - - if (invis.startsWith("invis_sp_buff_invis_notrace")) - { - return 0.0f; - } - } - - float finalChanceToDetect = 0.0f; - - int stealtherLevel = getLevel(target); - int detectorLevel = getLevel(detector); - - float levelChanceToDetectMod = 0.0f; - - if (stealtherLevel > detectorLevel) - { - float levelDiff = stealtherLevel - detectorLevel; - if (baseChanceToDetect > 30) - { - levelChanceToDetectMod = (levelDiff *5.0f); - } - else - { - levelChanceToDetectMod = (levelDiff *1.5f); - } - finalChanceToDetect = baseChanceToDetect - levelChanceToDetectMod; - } - - if (stealtherLevel < detectorLevel) - { - float levelDiff = detectorLevel - stealtherLevel; - levelChanceToDetectMod = (levelDiff*2.5f); - finalChanceToDetect = baseChanceToDetect + levelChanceToDetectMod; - } - - if (stealtherLevel == detectorLevel) - { - finalChanceToDetect = baseChanceToDetect; - } - - float modChanceToDetectMod = 0.0f; - - int stealtherSkillMod = getApplicableInvisSkillMod(target); - - if (beast_lib.isBeast(target)) - { - obj_id master = getMaster(target); - - if (isIdValid(master) && exists(master)) - { - stealtherSkillMod = getApplicableInvisSkillMod(master); - } - } - - int detectorSkillMod = getEnhancedSkillStatisticModifierUncapped(detector, "detect_hidden"); - - if (stealtherSkillMod > detectorSkillMod) - { - float modDiff = (stealtherSkillMod - detectorSkillMod); - modChanceToDetectMod = modDiff/9.0f; - finalChanceToDetect = finalChanceToDetect - modChanceToDetectMod; - } - - if (stealtherSkillMod < detectorSkillMod) - { - float modDiff = (detectorSkillMod - stealtherSkillMod); - modChanceToDetectMod = modDiff/4.0f; - finalChanceToDetect = finalChanceToDetect + modChanceToDetectMod; - } - - if (invis.startsWith("invis_forceCloak") || (invis.startsWith("invis_fs_buff_invis") )) - { - - finalChanceToDetect = (finalChanceToDetect - 10.0f); - } - - if (!isPlayer(detector)) - { - String name = getCreatureName(detector); - int difficultyClass = dataTableGetInt ("datatables/mob/creatures.iff", name, "difficultyClass"); - if (difficultyClass == 1) - { - - finalChanceToDetect = (finalChanceToDetect +5.0f); - } - if (difficultyClass == 2) - { - - finalChanceToDetect = (finalChanceToDetect +10.0f); - } - } - - if (finalChanceToDetect > MAX_CHANCE_TO_DETECT_HIDDEN) - { - finalChanceToDetect = MAX_CHANCE_TO_DETECT_HIDDEN; - } - - if (finalChanceToDetect < MIN_CHANCE_TO_DETECT_HIDDEN) - { - if (isPlayer(detector)) - { - finalChanceToDetect = MIN_CHANCE_TO_DETECT_HIDDEN; - } - } - - return finalChanceToDetect; - } - - - public static float getDetectChanceWithDetailedOutput(obj_id target, obj_id detector, float baseChanceToDetect, obj_id objectToReceiveDetailedOutput) throws InterruptedException - { - String invis = getInvisBuff(target); - if (invis != null && invis.length() > 0) - { - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealther="+ target + ", detector="+ detector + ", baseChanceToDetect="+ baseChanceToDetect + ", stealther invisBuff="+ invis); - - if (buff.getPriority(invis) > MAX_INVIS_BUFF_TO_DETECT) - { - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: buff.getPriority(stealther invisBuff)="+ buff.getPriority(invis) + " which is > "+ MAX_INVIS_BUFF_TO_DETECT + " so setting finalChanceToDetect to 0.0"); - return 0.0f; - } - - if (invis.startsWith("invis_sp_buff_invis_notrace")) - { - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealther invisBuff is invis_sp_buff_invis_notrace* so setting finalChanceToDetect to 0.0"); - return 0.0f; - } - } - float finalChanceToDetect = 0.0f; - - int stealtherLevel = getLevel(target); - int detectorLevel = getLevel(detector); - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealtherLevel="+ stealtherLevel + ", detectorLevel="+ detectorLevel); - - float levelChanceToDetectMod = 0.0f; - - if (stealtherLevel > detectorLevel) - { - float levelDiff = stealtherLevel - detectorLevel; - if (baseChanceToDetect > 30) - { - levelChanceToDetectMod = (levelDiff *5.0f); - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealtherLevel > detectorLevel, levelDiff="+ levelDiff + ", baseChanceToDetect > 30, levelChanceToDetectMod (levelDiff * 5.0f)="+ levelChanceToDetectMod); - } - else - { - levelChanceToDetectMod = (levelDiff *1.5f); - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealtherLevel > detectorLevel, levelDiff="+ levelDiff + ", baseChanceToDetect <= 30, levelChanceToDetectMod (levelDiff * 1.5f)="+ levelChanceToDetectMod); - } - finalChanceToDetect = baseChanceToDetect - levelChanceToDetectMod; - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealtherLevel > detectorLevel, finalChanceToDetect (baseChanceToDetect - levelChanceToDetectMod)="+ finalChanceToDetect); - } - - if (stealtherLevel < detectorLevel) - { - float levelDiff = detectorLevel - stealtherLevel; - levelChanceToDetectMod = (levelDiff*2.5f); - finalChanceToDetect = baseChanceToDetect + levelChanceToDetectMod; - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealtherLevel < detectorLevel, levelDiff="+ levelDiff + ", levelChanceToDetectMod (levelDiff * 2.5f)="+ levelChanceToDetectMod + ", finalChanceToDetect (baseChanceToDetect + levelChanceToDetectMod)="+ finalChanceToDetect); - } - - if (stealtherLevel == detectorLevel) - { - finalChanceToDetect = baseChanceToDetect; - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealtherLevel = detectorLevel, finalChanceToDetect (baseChanceToDetect)="+ finalChanceToDetect); - } - - float modChanceToDetectMod = 0.0f; - - int stealtherSkillMod = getApplicableInvisSkillMod(target); - - int detectorSkillMod = getEnhancedSkillStatisticModifierUncapped(detector, "detect_hidden"); - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealtherSkillMod="+ stealtherSkillMod + ", detectorSkillMod (detect_hidden)="+ detectorSkillMod); - - if (stealtherSkillMod > detectorSkillMod) - { - float modDiff = (stealtherSkillMod - detectorSkillMod); - modChanceToDetectMod = modDiff/9.0f; - finalChanceToDetect = finalChanceToDetect - modChanceToDetectMod; - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealtherSkillMod > detectorSkillMod, modDiff="+ modDiff + ", modChanceToDetectMod (modDiff / 9.0f)="+ modChanceToDetectMod + ", finalChanceToDetect (finalChanceToDetect - modChanceToDetectMod)="+ finalChanceToDetect); - } - - if (stealtherSkillMod < detectorSkillMod) - { - float modDiff = (detectorSkillMod - stealtherSkillMod); - modChanceToDetectMod = modDiff/4.0f; - finalChanceToDetect = finalChanceToDetect + modChanceToDetectMod; - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealtherSkillMod < detectorSkillMod, modDiff="+ modDiff + ", modChanceToDetectMod (modDiff / 4.0f)="+ modChanceToDetectMod + ", finalChanceToDetect (finalChanceToDetect + modChanceToDetectMod)="+ finalChanceToDetect); - } - - if (invis.startsWith("invis_forceCloak") || (invis.startsWith("invis_fs_buff_invis") )) - { - - finalChanceToDetect = (finalChanceToDetect - 10.0f); - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: Jedi with invis_forceCloak* or invis_fs_buff_invis*, finalChanceToDetect (finalChanceToDetect - 10.0f)="+ finalChanceToDetect); - } - - if (!isPlayer(detector)) - { - String name = getCreatureName(detector); - int difficultyClass = dataTableGetInt ("datatables/mob/creatures.iff", name, "difficultyClass"); - if (difficultyClass == 1) - { - - finalChanceToDetect = (finalChanceToDetect +5.0f); - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: detector ("+ name + ", difficultyClass="+ difficultyClass + ") is elite NPC, finalChanceToDetect (finalChanceToDetect + 5.0f)="+ finalChanceToDetect); - } - if (difficultyClass == 2) - { - - finalChanceToDetect = (finalChanceToDetect +10.0f); - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: detector ("+ name + ", difficultyClass="+ difficultyClass + ") is boss NPC, finalChanceToDetect (finalChanceToDetect + 10.0f)="+ finalChanceToDetect); - } - } - - if (finalChanceToDetect > MAX_CHANCE_TO_DETECT_HIDDEN) - { - finalChanceToDetect = MAX_CHANCE_TO_DETECT_HIDDEN; - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: finalChanceToDetect > "+ MAX_CHANCE_TO_DETECT_HIDDEN + " so finalChanceToDetect set to "+ finalChanceToDetect); - } - - if (finalChanceToDetect < MIN_CHANCE_TO_DETECT_HIDDEN) - { - if (isPlayer(detector)) - { - finalChanceToDetect = MIN_CHANCE_TO_DETECT_HIDDEN; - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: finalChanceToDetect < "+ MIN_CHANCE_TO_DETECT_HIDDEN + " and detector is player so finalChanceToDetect set to "+ finalChanceToDetect); - } - } - - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: ****FINAL CALCULATED*** finalChanceToDetect="+ finalChanceToDetect); - return finalChanceToDetect; - } - - - public static boolean activeDetectHiddenTarget(obj_id target, obj_id detector, float baseChanceToDetect) throws InterruptedException - { - float finalChanceToDetect = getDetectChance(target, detector, baseChanceToDetect); - float roll = rand(0f, 100f); - return (roll < finalChanceToDetect); - } - - - public static boolean passiveDetectHiddenTarget(obj_id target, obj_id detector, int volume) throws InterruptedException - { - - if (isPlayer(detector)) - { - if (!pvpCanAttack(detector, target)) - { - return false; - } - } - else - { - if (!ai_lib.isAggroToward(detector, target)) - { - return false; - } - } - float baseChanceToDetect = PASSIVE_DETECT_CHANCE_MOB; - - if (volume == PASSIVE_BREACH_FAR) - { - baseChanceToDetect = PASSIVE_DETECT_CHANCE_FAR; - } - if (volume == PASSIVE_BREACH_NEAR) - { - baseChanceToDetect = PASSIVE_DETECT_CHANCE_NEAR; - } - - float finalChanceToDetect = getDetectChance(target, detector, baseChanceToDetect); - - float roll = rand(0.0f, 100.0f); - - return (roll < finalChanceToDetect); - } - - - public static boolean passiveDetectHiddenTargetWithDetailedOutput(obj_id target, obj_id detector, int volume, obj_id objectToReceiveDetailedOutput) throws InterruptedException - { - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealther="+ target + ", detector="+ detector + ", volume="+ volume); - - if (isPlayer(detector)) - { - if (!pvpCanAttack(detector, target)) - { - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealther="+ target + ", detector="+ detector + ", volume="+ volume + ", isPlayer(detector) and !pvpCanAttack(detector, stealther) so returning detection FAIL"); - return false; - } - } - else - { - if (!ai_lib.isAggroToward(detector, target)) - { - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: stealther="+ target + ", detector="+ detector + ", volume="+ volume + ", !isPlayer(detector) and !ai_lib.isAggroToward(detector, stealther) so returning detection FAIL"); - return false; - } - } - float baseChanceToDetect = PASSIVE_DETECT_CHANCE_MOB; - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: setting baseChanceToDetect to default value of PASSIVE_DETECT_CHANCE_MOB("+ baseChanceToDetect + ")"); - - if (volume == PASSIVE_BREACH_FAR) - { - baseChanceToDetect = PASSIVE_DETECT_CHANCE_FAR; - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: volume is PASSIVE_BREACH_FAR so setting baseChanceToDetect to PASSIVE_DETECT_CHANCE_FAR("+ baseChanceToDetect + ")"); - } - if (volume == PASSIVE_BREACH_NEAR) - { - baseChanceToDetect = PASSIVE_DETECT_CHANCE_NEAR; - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: volume is PASSIVE_BREACH_NEAR so setting baseChanceToDetect to PASSIVE_DETECT_CHANCE_NEAR("+ baseChanceToDetect + ")"); - } - - float finalChanceToDetect = getDetectChanceWithDetailedOutput(target, detector, baseChanceToDetect, objectToReceiveDetailedOutput); - float roll = rand(0.0f, 100.0f); - - if (roll < finalChanceToDetect) - { - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: getDetectChanceWithDetailedOutput() returned finalChanceToDetect="+ finalChanceToDetect + ", dice roll="+ roll + ", dice roll < finalChanceToDetect so returning detection SUCCESS"); - } - else - { - sendConsoleMessage(objectToReceiveDetailedOutput, "passiveDetectInfo: getDetectChanceWithDetailedOutput() returned finalChanceToDetect="+ finalChanceToDetect + ", dice roll="+ roll + ", dice roll >= finalChanceToDetect so returning detection FAIL"); - } - - return (roll < finalChanceToDetect); - } - - - public static boolean testBubbleBreached(obj_id bubbleHolder, obj_id breacher, int volume) throws InterruptedException - { - if (hasObjVar(bubbleHolder, "debuggingPassiveDetectDetailedOutput")) - { - obj_id objectToReceiveDetailedOutput = bubbleHolder; - - if (hasObjVar(bubbleHolder, "debuggingPassiveDetectDetailedOutputObject")) - { - String objVarValue = getStringObjVar(bubbleHolder, "debuggingPassiveDetectDetailedOutputObject"); - if (objVarValue != null && objVarValue.length() > 0) - { - obj_id objVarValueAsOid = utils.stringToObjId(objVarValue.substring(1)); - if (isValidId(objVarValueAsOid) && exists(objVarValueAsOid)) - { - objectToReceiveDetailedOutput = objVarValueAsOid; - } - } - } - - return passiveDetectHiddenTargetWithDetailedOutput(bubbleHolder, breacher, volume, objectToReceiveDetailedOutput); - } - else - { - return passiveDetectHiddenTarget(bubbleHolder, breacher, volume); - } - - } - - - public static void testUseAction(obj_id player, obj_id object, int menuItem) throws InterruptedException - { - String invis = getInvisBuff(player); - if (invis != null && invis.length() > 0) - { - buff.removeBuff(player, invis); - } - } - - - public static void testInvisNonCombatAction(obj_id player, obj_id target) throws InterruptedException - { - testInvisCombatAction(player, target, -1); - } - - - public static void testInvisNonCombatAction(obj_id player, obj_id target, combat_data combatData) throws InterruptedException - { - - if (!combatData.specialLine.equals("no_proc")) - { - testInvisCombatAction(player, target, combatData.minInvisLevelRequired); - } - } - - - public static void testInvisNonCombatAction(obj_id player, obj_id target, int minInvisRequiredForAction) throws InterruptedException - { - if (isIdValid(player) && exists(player) && beast_lib.isBeast(player)) - { - player = getMaster(player); - } - - String invis = getInvisBuff(player); - - if (invis != null && !invis.startsWith("invis_")) - { - int pri = buff.getPriority(invis); - if (minInvisRequiredForAction == -1 || pri < minInvisRequiredForAction) - { - if (!buff.hasBuff(player, BUFF_NO_BREAK_INVIS)) - { - buff.removeBuff(player, invis); - } - } - } - } - - - public static void testInvisCombatAction(obj_id player, obj_id target) throws InterruptedException - { - testInvisCombatAction(player, target, -1); - } - - - public static void testInvisCombatAction(obj_id player, obj_id target, combat_data combatData) throws InterruptedException - { - - if (!combatData.specialLine.equals("no_proc")) - { - testInvisCombatAction(player, target, combatData.minInvisLevelRequired); - } - } - - - public static void testInvisCombatAction(obj_id player, obj_id target, int minInvisRequiredForAction) throws InterruptedException - { - if (isIdValid(player) && exists(player) && beast_lib.isBeast(player)) - { - player = getMaster(player); - } - - String invis = getInvisBuff(player); - - if (invis != null) - { - int pri = buff.getPriority(invis); - - if (minInvisRequiredForAction == -1 || pri < minInvisRequiredForAction) - { - if (!buff.hasBuff(player, BUFF_NO_BREAK_INVIS)) - { - combat.combatLog(player, target, "combatStandardAction", "Invisible - Clearing invisibility"); - - if (isPlayer(player)) - { - utils.setScriptVar(player, "stealth.invisRemoved", invis); - utils.setScriptVar(player, "stealth.invisRemovedTime", getGameTime()); - utils.setScriptVar(player, "stealth.invisRemovedTimeLeft", buff.getBuffTimeRemaining(player, invis)); - } - - buff.removeBuff(player, invis); - buff.applyBuff(player, "sp_attack_invis_recourse"); - } - } - } - } - - - public static void reinstateInvisFromCombat(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player) || !isPlayer(player)) - { - return; - } - - int invisTime = utils.getIntScriptVar(player, "stealth.invisRemovedTime"); - String invisName = utils.getStringScriptVar(player, "stealth.invisRemoved"); - - if (invisTime > 0 && invisName != null && invisName.length() > 0 && invisTime - getGameTime() < 2) - { - float timeLeft = utils.getFloatScriptVar(player, "stealth.invisRemovedTimeLeft"); - - if (timeLeft > 0) - { - buff.applyBuff(player, invisName, timeLeft); - } - } - } - - - public static void clearPreviousInvis(obj_id player) throws InterruptedException - { - if (!isPlayer(player)) - { - return; - } - - utils.removeScriptVar(player, "stealth.invisRemoved"); - utils.removeScriptVar(player, "stealth.invisRemovedTime"); - } - - - public static float calcBreachDistanceForSkill(obj_id player, String skillMod) throws InterruptedException - { - int mod = getEnhancedSkillStatisticModifier(player, skillMod); - float difference = INVIS_BREAK_MAX_FAR_DISTANCE - INVIS_BREAK_NEAR_DISTANCE; - return INVIS_BREAK_NEAR_DISTANCE + (difference / (1+ ((mod) / 100))); - } - - - public static void cleanupHate(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return; - } - - obj_id[] hateList = getHateList(player); - - for (int i = 0; i < hateList.length; i++) - { - testAbortScript(); - if (isIdValid(hateList[i]) && exists(hateList[i])) - { - removeHateTarget(hateList[i], player); - - removeHateTarget(player, hateList[i]); - } - } - - clearHateList(player); - } - - - public static obj_id makeBeastInvisible(obj_id player, String clientEffect) throws InterruptedException - { - if (!isIdValid(player) || !exists(player) || !beast_lib.isBeastMaster(player)) - { - return null; - } - - obj_id beast = beast_lib.getBeastOnPlayer(player); - - if (!isIdValid(beast) || !exists(beast)) - { - return null; - } - - attachScript(beast, "systems.skills.stealth.stealth_monitor"); - messageTo(beast, "updatePassiveRevealList", null, 10, false); - setState(beast, STATE_COVER, true); - setCreatureCoverVisibility(beast, false); - - cleanupHate(beast); - stopCombat(beast); - utils.removeScriptVar(beast, "ai.combat.target"); - - addPassiveReveal(beast, player, 1); - makePassiveRevealed(beast); - - if (clientEffect == null || clientEffect.length() <= 0) - { - clientEffect = "appearance/pt_smoke_puff.prt"; - } - - playClientEffectObj(beast, clientEffect, beast, ""); - - int covert_mastery = getEnhancedSkillStatisticModifierUncapped(player, "expertise_covert_mastery"); - - if (covert_mastery > 0) - { - buff.applyBuff(beast, "sp_covert_mastery"); - } - - return beast; - } - - - public static boolean canBeastStealth(obj_id beast) throws InterruptedException - { - obj_id master = getMaster(beast); - - if (isDead(beast) || ai_lib.isInCombat(beast)) - { - return false; - } - - if (isIdValid(master) && exists(master) && getState(master, STATE_COVER) == 1) - { - return true; - } - - return false; - } - - - public static void makeCreatureVisible(obj_id creature) throws InterruptedException - { - if (!isIdValid(creature) || !exists(creature)) - { - return; - } - - detachScript(creature, "systems.skills.stealth.stealth_monitor"); - - setState(creature, STATE_COVER, false); - - clearPassiveRevealList(creature); - setCreatureCoverVisibility(creature, true); - playClientEffectObj(creature, "appearance/pt_sonic_pulse.prt", creature, ""); - } - - - public static void makeBeastVisible(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player) || !beast_lib.isBeastMaster(player)) - { - return; - } - - obj_id beast = beast_lib.getBeastOnPlayer(player); - - makeCreatureVisible(beast); - } - - - public static void makePassiveRevealed(obj_id target) throws InterruptedException - { - obj_id beast = null; - - if (isIdValid(target) && exists(target) && beast_lib.isBeast(target)) - { - obj_id master = getMaster(target); - - if (isIdValid(master) && exists(master)) - { - target = master; - } - } - - if (isPlayer(target)) - { - beast = beast_lib.getBeastOnPlayer(target); - } - - if (group.isGrouped(target)) - { - obj_id groupObj = getGroupObject(target); - obj_id[] groupMembers = getGroupMemberIds(groupObj); - int numGroupMembers = groupMembers.length; - - for (int f = 0; f < numGroupMembers; f++) - { - testAbortScript(); - obj_id groupie = groupMembers[f]; - - if (isIdValid(groupie) && exists(groupie) && groupie != target) - { - - addPassiveReveal(target, groupie, 1); - - if (isIdValid(beast) && exists(beast)) - { - addPassiveReveal(beast, groupie, 1); - } - } - } - } - } - - - public static void _makeInvisible(obj_id player, string_id flyText, String clientEffect, string_id msg, float breachDistance) throws InterruptedException - { - if (breachDistance <= INVIS_BREAK_NEAR_DISTANCE) - { - breachDistance = INVIS_BREAK_NEAR_DISTANCE + 1f; - } - - attachScript(player, "systems.skills.stealth.stealth_monitor"); - messageTo(player, "updatePassiveRevealList", null, 10, false); - setState(player, STATE_COVER, true); - setCreatureCoverVisibility(player, false); - - cleanupHate(player); - - obj_id beast = makeBeastInvisible(player, clientEffect); - - makePassiveRevealed(player); - - if (flyText != null) - { - showFlyTextPrivate(player, player, flyText, 1.5f, colors.TOMATO); - } - - if (clientEffect != null && clientEffect.length() > 0) - { - playClientEffectObj(player, clientEffect, player, ""); - } - - if (msg != null) - { - sendSystemMessage(player, msg); - } - - if (!utils.hasScriptVar(player, INVIS_UPKEEP_MSG_DISPATCHED)) - { - messageTo(player, "invisibilityUpkeep", null, 1, false); - } - - if (breachDistance > 0) - { - createTriggerVolume(INVIS_BREAK_RADIUS_FAR, breachDistance, true ); - createTriggerVolume(INVIS_BREAK_RADIUS_NEAR, INVIS_BREAK_NEAR_DISTANCE, true ); - } - - } - - - public static void _makeVisible(obj_id player, string_id flyText, string_id msg) throws InterruptedException - { - - removeTriggerVolume(INVIS_BREAK_RADIUS_FAR); - removeTriggerVolume(INVIS_BREAK_RADIUS_NEAR); - clearPassiveRevealList(player); - detachScript(player, "systems.skills.stealth.stealth_monitor"); - - if (!utils.hasScriptVar(player, "supressVisible")) - { - setState(player, STATE_COVER, false); - - setCreatureCoverVisibility(player, true); - - makeBeastVisible(player); - - if (flyText != null) - { - showFlyTextPrivate(player, player, flyText, 1.5f, colors.TOMATO); - } - - if (msg != null) - { - sendSystemMessage(player, msg); - } - - playClientEffectObj(player, "appearance/pt_sonic_pulse.prt", player, ""); - } - else - { - utils.removeScriptVar(player, "supressVisible"); - } - } - - - public static boolean checkRevealRecourse(obj_id player) throws InterruptedException - { - if (buff.hasBuff(player, "sp_sneak_recourse")) - { - return true; - } - return false; - } - - - public static boolean checkAttackRevealRecourse(obj_id player) throws InterruptedException - { - if (buff.hasBuff(player, "sp_attack_invis_recourse")) - { - return true; - } - return false; - } - - - public static boolean canPerformForceCloak(obj_id player) throws InterruptedException - { - if (combat.isInCombat(player) && (int)getSkillStatisticModifier(player, "expertise_force_cloak_combat_escape") <= 0) - { - return false; - } - - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_state")); - return false; - } - - if (buff.hasBuff(player, "battlefield_communication_run")) - { - return false; - } - - if (checkRevealRecourse(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_recourse")); - return false; - } - - if (utils.hasScriptVar(player, "petCreationPending") && utils.getIntScriptVar(player, "petCreationPending") > getGameTime()) - { - sendSystemMessage(player, new string_id("spam", "cannot_perform_calling_companion")); - return false; - } - - return true; - } - - - public static boolean canPerformHide(obj_id player) throws InterruptedException - { - return canPerformStationaryInvis(player); - } - - - public static void forceCloak(obj_id player) throws InterruptedException - { - if (buff.hasBuff(player, "fs_force_run")) - { - buff.removeBuff(player, "fs_force_run"); - } - - _makeInvisible(player, new string_id("combat_effects", "go_cloak"), - "clienteffect/combat_special_attacker_cover.cef", null, -1); - } - - - public static void hide(obj_id player) throws InterruptedException - { - _makeInvisible(player, new string_id("spam", "hide_go"), - "clienteffect/combat_special_attacker_cover.cef", null, -1); - } - - - public static boolean canPerformSmokeGrenade(obj_id player) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_state")); - return false; - } - - if (!buff.canApplyBuff(player, "invis_sp_buff_invis_1")) - { - sendSystemMessage(player, new string_id("spam", "cant_apply_invis_buff")); - return false; - } - - if (buff.hasBuff(player, "battlefield_communication_run")) - { - return false; - } - - if (utils.hasScriptVar(player, "petCreationPending") && utils.getIntScriptVar(player, "petCreationPending") > getGameTime()) - { - sendSystemMessage(player, new string_id("spam", "cannot_perform_calling_companion")); - return false; - } - if (checkAttackRevealRecourse(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_attack_recourse")); - return false; - } - - return true; - } - - - public static boolean canPerformWithoutTrace(obj_id player) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_state")); - return false; - } - - if (!buff.canApplyBuff(player, "invis_sp_buff_invis_notrace_1")) - { - sendSystemMessage(player, new string_id("spam", "cant_apply_invis_buff")); - return false; - } - - if (buff.hasBuff(player, "battlefield_communication_run")) - { - return false; - } - - if (utils.hasScriptVar(player, "petCreationPending") && utils.getIntScriptVar(player, "petCreationPending") > getGameTime()) - { - sendSystemMessage(player, new string_id("spam", "cannot_perform_calling_companion")); - return false; - } - - return true; - } - - - public static boolean canPerformStationaryInvis(obj_id player) throws InterruptedException - { - - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_state")); - return false; - } - - if (!buff.canApplyBuff(player, "invis_blendIn")) - { - sendSystemMessage(player, new string_id("spam", "cant_apply_invis_buff")); - return false; - } - - if (buff.hasBuff(player, "battlefield_communication_run")) - { - return false; - } - - if (utils.hasScriptVar(player, "petCreationPending") && utils.getIntScriptVar(player, "petCreationPending") > getGameTime()) - { - sendSystemMessage(player, new string_id("spam", "cannot_perform_calling_companion")); - return false; - } - - return true; - } - - - public static void smokeGrenade(obj_id player) throws InterruptedException - { - _makeInvisible(player, new string_id("spam", "smokegrenade"), "appearance/pt_smoke_puff.prt", null, -1); - buff.applyBuff(player, BUFF_NO_BREAK_INVIS); - } - - - public static void bothanInnate(obj_id player) throws InterruptedException - { - _makeInvisible(player, new string_id("spam", "fly_bothan_ability_1"), - "appearance/pt_smoke_puff.prt", null, -1); - } - - - public static boolean canPerformStealth(obj_id player) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_state")); - return false; - } - - if (ai_lib.isInCombat(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_combat")); - return false; - } - - String invis = getInvisBuff(player); - - if (invis != null) - { - if (invis.startsWith("invis_sp_buff_invis_notrace")) - { - sendSystemMessage(player, new string_id("spam", "cant_apply_invis_buff")); - return false; - } - } - - if (buff.hasBuff(player, "battlefield_communication_run")) - { - return false; - } - - if (!hasServerCoverState(player)) - { - if (checkRevealRecourse(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_recourse")); - return false; - } - - } - - if (utils.hasScriptVar(player, "petCreationPending") && utils.getIntScriptVar(player, "petCreationPending") > getGameTime()) - { - sendSystemMessage(player, new string_id("spam", "cannot_perform_calling_companion")); - return false; - } - - return true; - } - - - public static void stealth(obj_id player) throws InterruptedException - { - _makeInvisible(player, new string_id("spam", "stealth"),"appearance/pt_smoke_puff.prt", null, calcBreachDistanceForSkill(player, "camouflage")); - buff.applyBuff(player, BUFF_NO_BREAK_INVIS); - } - - - public static void withoutTrace(obj_id player) throws InterruptedException - { - _makeInvisible(player, new string_id("spam", "without_trace"),"appearance/pt_smoke_puff.prt", null, -1); - int covert_mastery = getEnhancedSkillStatisticModifierUncapped(player, "expertise_covert_mastery"); - - if (covert_mastery > 0) - { - buff.applyBuff(player, "sp_covert_mastery"); - } - - buff.applyBuff(player, BUFF_NO_BREAK_INVIS); - } - - - public static void decoyStealth(obj_id player) throws InterruptedException - { - _makeInvisible(player, new string_id("spam", "decoy_stealth"),"", null, -1); - buff.applyBuff(player, BUFF_NO_BREAK_INVIS); - - } - - - public static void invisBuffAdded(obj_id mobile, String effectName) throws InterruptedException - { - effectName = toLower(effectName); - - messageTo(mobile, "addAppearanceItemEffect", null, 1, false); - - if (effectName.startsWith("invis_sp_buff_invis_notrace")) - { - withoutTrace(mobile); - } - else if (effectName.startsWith("invis_sp_buff_invis")) - { - smokeGrenade(mobile); - } - else if (effectName.startsWith("invis_bothan_ability_1")) - { - bothanInnate(mobile); - } - else if (effectName.startsWith("invis_sp_buff_stealth")) - { - stealth(mobile); - } - else if (effectName.startsWith("invis_fs_buff_invis")) - { - forceCloak(mobile); - } - else if (effectName.startsWith("invis_sm_buff_invis")) - { - stealth(mobile); - } - else if (effectName.startsWith("invis_sp_diversion_stealth")) - { - decoyStealth(mobile); - } - return; - } - - - public static boolean canPerformCamouflageSelf(obj_id player) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_state")); - return false; - } - - if (checkRevealRecourse(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_recourse")); - return false; - } - - if (!buff.canApplyBuff(player, "invis_camouflage")) - { - sendSystemMessage(player, new string_id("spam", "cant_apply_invis_buff")); - return false; - } - - if (buff.hasBuff(player, "battlefield_communication_run")) - { - return false; - } - - if (isInUrban(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_camo_self_urban")); - return false; - } - - obj_id kit = getCamoKitForCurrentPlanet(player); - if (!isIdValid(kit)) - { - sendSystemMessage(player, new string_id("spam", "cant_camo_self_no_kit")); - return false; - } - - utils.setScriptVar(player, CAMO_KIT_ID, kit); - return true; - } - - - public static void camouflageSelf(obj_id player) throws InterruptedException - { - obj_id kit = utils.getObjIdScriptVar(player, CAMO_KIT_ID); - if (!isIdValid(kit)) - { - return; - } - - consumeCamoKit(kit); - - boolean success = witnessModifiedSkillCheck(player, "camouflage", 15, 5, 0); - if (success) - { - _makeInvisible(player, new string_id("spam", "camouflaged"), - "appearance/pt_smoke_puff.prt", null, calcBreachDistanceForSkill(player, "camouflage")); - } - else - { - sendSystemMessage(player, new string_id("spam", "failedcamo")); - } - - return; - } - - - public static boolean canPerformCamouflageAlly(obj_id player, obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - sendSystemMessage(player, new string_id("spam", "no_target")); - return false; - } - - if (!isPlayer(target)) - { - sendSystemMessage(player, new string_id("spam", "bad_target")); - return false; - } - - int shapechange = buff.getBuffOnTargetFromGroup(target, "shapechange"); - - if (shapechange != 0) - { - sendSystemMessage(player, new string_id("spam", "not_while_shapechanged")); - return false; - } - - if (target == player) - { - sendSystemMessage(player, new string_id("spam", "cant_apply_invis_self")); - return false; - } - - if (buff.hasBuff(target, "battlefield_communication_run")) - { - return false; - } - - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_state")); - return false; - } - - if (getDistance(player, target) > 46) - { - sendSystemMessage(player, new string_id("spam", "cant_camo_ally_far")); - return false; - } - - if (!pvpCanHelp(player, target)) - { - sendSystemMessage(player, new string_id("spam", "cant_camo_ally_faction")); - return false; - } - - if (checkRevealRecourse(target)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_recourse_other")); - return false; - } - - int tGuildId = getGuildId(target); - int sGuildId = getGuildId(player); - boolean isInSameGuild = (tGuildId != 0) && (tGuildId == sGuildId); - - if (!isInSameGuild && !group.inSameGroup(player, target)) - { - sendSystemMessage(player, new string_id("spam", "cant_camo_ally_not_allied")); - return false; - } - - return true; - } - - - public static boolean canPerformUrbanStealth(obj_id player, obj_id possibleHep) throws InterruptedException - { - if (buff.hasBuff(player, "forceRun") || buff.hasBuff(player, "forceRun_1") || buff.hasBuff(player, "forceRun_2")) - { - sendSystemMessage(player, new string_id("spam", "cant_fc_run")); - return false; - } - - if (buff.hasBuff(player, "battlefield_communication_run")) - { - return false; - } - - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_state")); - return false; - } - - if (checkRevealRecourse(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_recourse")); - return false; - } - - if (!buff.canApplyBuff(player, "invis_urbanStealth")) - { - sendSystemMessage(player, new string_id("spam", "cant_apply_invis_buff")); - return false; - } - - if (!stealth.isInUrban(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_urban_stealth_environment")); - return false; - } - - obj_id hep = stealth.getHEPObj(player, possibleHep); - if (!isIdValid(hep)) - { - sendSystemMessage(player, new string_id("spam", "cant_urban_stealth_no_hep")); - return false; - } - - if (!buff.hasBuff(player, "invis_blendIn")) - { - int sGuildId = getGuildId(player); - boolean isInSameGuild = false; - obj_id[] stuff = getCreaturesInRange(player, 20f); - - for (int i = 0; i < stuff.length; i++) - { - testAbortScript(); - if (isPlayer(stuff[i]) || ai_lib.isNpc(stuff[i])) - { - isInSameGuild = (sGuildId != 0) && (getGuildId(stuff[i]) == sGuildId); - if (!isInSameGuild && !group.inSameGroup(player, stuff[i])) - { - sendSystemMessage(player, new string_id("spam", "cant_urban_stealth_people_in_area")); - return false; - } - } - } - } - - utils.setScriptVar(player, CAMO_KIT_ID, hep); - return true; - } - - - public static void urbanStealth(obj_id player) throws InterruptedException - { - obj_id hep = utils.getObjIdScriptVar(player, CAMO_KIT_ID); - if (!isIdValid(hep)) - { - return; - } - - if (!testAndDoHepUpkeep(hep, player, false)) - { - return; - } - - utils.makeItemNoDrop(hep); - setObjVar(player, ACTIVE_HEP, hep); - if (hasInvisibleBuff(player)) - { - - utils.setScriptVar(player, "supressVisible", 1); - } - - _makeInvisible(player, new string_id("spam", "stealthon"), "appearance/pt_detector.prt", null, calcBreachDistanceForSkill(player, "stealth")); - } - - - public static boolean canPerformWildernessStealth(obj_id player) throws InterruptedException - { - if (buff.hasBuff(player, "forceRun") || buff.hasBuff(player, "forceRun_1") || buff.hasBuff(player, "forceRun_2")) - { - sendSystemMessage(player, new string_id("spam", "cant_fc_run")); - return false; - } - - if (buff.hasBuff(player, "battlefield_communication_run")) - { - return false; - } - - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_state")); - return false; - } - - if (checkRevealRecourse(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_recourse")); - return false; - } - - if (!buff.canApplyBuff(player, "invis_wildernessStealth")) - { - sendSystemMessage(player, new string_id("spam", "cant_apply_invis_buff")); - return false; - } - - if (!stealth.isInWilderness(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_wilderness_stealth_environment")); - return false; - } - - boolean isHidden = hasInvisibleBuff(player); - if (!isHidden) - { - obj_id kit = getCamoKitForCurrentPlanet(player); - if (!isIdValid(kit)) - { - sendSystemMessage(player, new string_id("spam", "cant_wilderness_stealth_no_kit")); - return false; - } - - utils.setScriptVar(player, CAMO_KIT_ID, kit); - } - - return true; - } - - - public static void wildernessStealth(obj_id player) throws InterruptedException - { - obj_id kit = utils.getObjIdScriptVar(player, CAMO_KIT_ID); - - int penalty = 0; - if (!hasInvisibleBuff(player)) - { - if (!isIdValid(kit)) - { - return; - } - - consumeCamoKit(kit); - penalty = 50; - } - else - { - - utils.setScriptVar(player, "supressVisible", 1); - } - - boolean success = witnessModifiedSkillCheck(player, "stealth", 20, 10, penalty); - if (success) - { - _makeInvisible(player, new string_id("spam", "stealthon"), - "appearance/pt_smoke_puff.prt", null, calcBreachDistanceForSkill(player, "stealth")); - } - else - { - utils.removeScriptVar(player, "supressVisible"); - sendSystemMessage(player, new string_id("spam", "stealthfail")); - } - - return; - } - - - public static boolean canPerformCover(obj_id player) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_state")); - return false; - } - - if (buff.hasBuff(player, "battlefield_communication_run")) - { - return false; - } - - if (checkRevealRecourse(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_do_it_recourse")); - return false; - } - - if (!buff.canApplyBuff(player, "invis_cover")) - { - sendSystemMessage(player, new string_id("spam", "cant_apply_invis_buff")); - return false; - } - - return true; - } - - - public static void cover(obj_id player) throws InterruptedException - { - _makeInvisible(player, new string_id("combat_effects", "go_cover"), - "clienteffect/combat_special_attacker_cover.cef", null, calcBreachDistanceForSkill(player, "camouflage")); - sendSystemMessage(player, new string_id("cbt_spam", "cover_success_single")); - } - - - public static void disableHep(obj_id hep, obj_id player) throws InterruptedException - { - if (isIdValid(hep) && exists(hep)) - { - int power = getCount(hep); - float multiplier = .5f; - if (power > HEP_UPKEEP_COST) - { - multiplier = .95f; - } - - power = (int)(getIntObjVar(hep, HEP_BASE_POWER) * multiplier); - setCount(hep, power); - setObjVar(hep, HEP_BASE_POWER, power); - - utils.clearNoDropFromItem(hep); - - if (power < HEP_UPKEEP_COST) - { - sendSystemMessage(player, new string_id("spam", "hep_low_power")); - setCondition(hep, CONDITION_DISABLED); - } - } - - if (isIdValid(player)) - { - removeObjVar(player, ACTIVE_HEP); - } - } - - - public static boolean testAndDoHepUpkeep(obj_id hep, obj_id player, boolean silent) throws InterruptedException - { - int power = getCount(hep); - if (power < HEP_UPKEEP_COST) - { - if (!silent) - { - sendSystemMessage(player, new string_id("spam", "hep_out_of_juice")); - } - - return false; - } - - power = getCount(hep) - HEP_UPKEEP_COST; - setCount(hep, power); - - return true; - } - - - public static boolean checkSpyStealthUpkeep(obj_id player) throws InterruptedException - { - float camouflage = getEnhancedSkillStatisticModifierUncapped(player, "camouflage"); - camouflage += getEnhancedSkillStatisticModifierUncapped(player, "stealth"); - - float drainRatio = 10.0f; - if (camouflage < 100.0f) - { - drainRatio = 7.91f - (.1f / (.1f + ((camouflage) / 100.0f))); - } - int actionCost = (int)(getMaxAction(player) / drainRatio); - int action = testDrainAttribute(player, ACTION, actionCost); - if (action < 0 || !drainAttributes(player, actionCost, 0)) - { - checkForAndMakeVisible(player); - return false; - } - - string_id strSpam = new string_id("combat_effects", "damage_fly"); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, strSpam); - pp = prose.setDI(pp, -actionCost); - showFlyText(player, pp, 1f, colors.GREEN); - - return true; - } - - - public static boolean checkUrbanStealthUpkeep(obj_id player) throws InterruptedException - { - if (!isInUrban(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_urban_stealth_environment")); - buff.removeBuff(player, "invis_urbanStealth"); - return false; - } - - obj_id hep = getObjIdObjVar(player, ACTIVE_HEP); - if (!isIdValid(hep) || !exists(hep)) - { - - buff.removeBuff(player, "invis_urbanStealth"); - return false; - } - - if (!testAndDoHepUpkeep(hep, player, false)) - { - buff.removeBuff(player, "invis_urbanStealth"); - return false; - } - - return true; - } - - - public static boolean checkWildernessStealthUpkeep(obj_id player) throws InterruptedException - { - if (!isInWilderness(player)) - { - sendSystemMessage(player, new string_id("spam", "cant_wilderness_stealth_environment")); - buff.removeBuff(player, "invis_wildernessStealth"); - return false; - } - - return true; - } - - - public static boolean checkForceCloakUpkeep(obj_id player) throws InterruptedException - { - float forceCost = dataTableGetFloat(jedi.JEDI_ACTIONS_FILE, "forceCloak", "extraForceCost"); - - obj_id[] players = getPlayerCreaturesInRange(player, stealth.INVIS_BREAK_MAX_FAR_DISTANCE); - obj_id[] npcs = getNPCsInRange(player, stealth.INVIS_BREAK_MAX_FAR_DISTANCE); - int nearCount = players.length + npcs.length; - - int i = 0; - for (i = 0; i < players.length; i++) - { - testAbortScript(); - if (group.inSameGroup(player, players[i])) - { - nearCount--; - } - } - - for (i = 0; i < npcs.length; i++) - { - testAbortScript(); - if (group.inSameGroup(player, npcs[i])) - { - nearCount--; - } - } - - if (nearCount < 0) - { - nearCount = 0; - } - - forceCost *= nearCount; - - if (!jedi.drainForcePower(player, (int)forceCost)) - { - buff.removeBuff(player, "invi_forceCloak"); - return false; - } - - return true; - } - - - public static boolean checkForAndMakeVisible(obj_id player) throws InterruptedException - { - String ibuff = getInvisBuff(player); - if (ibuff == null || ibuff.length() < 1) - { - return false; - } - - buff.applyBuff(player, "sp_sneak_recourse"); - buff.removeBuff(player, ibuff); - return true; - } - - - public static boolean checkForAndMakeVisibleNoRecourse(obj_id player) throws InterruptedException - { - String ibuff = getInvisBuff(player); - if (ibuff == null || ibuff.length() < 1) - { - return false; - } - - buff.removeBuff(player, ibuff); - return true; - } - - - public static boolean hasInvisibleBuff(obj_id object) throws InterruptedException - { - return getInvisBuff(object) != null || (isMob(object) && !getCreatureCoverVisibility(object)); - } - - - public static String getInvisBuff(obj_id player) throws InterruptedException - { - int[] buffs = buff.getAllBuffs(player); - if (buffs == null) - { - return null; - } - - String curBuff = ""; - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - curBuff = buff.getBuffNameFromCrc(buffs[i]); - if (curBuff != null && curBuff.startsWith("invis_")) - { - return curBuff; - } - } - - return null; - } - - - public static boolean hasServerCoverState(obj_id player) throws InterruptedException - { - return getState(player, STATE_COVER) > 0; - } - - - public static obj_id getHEPObj(obj_id player, obj_id possibleHep) throws InterruptedException - { - int power = 0; - if (hasObjVar(possibleHep, "isHEP" )) - { - power = getCount(possibleHep); - if (power >= HEP_UPKEEP_COST) - { - - return possibleHep; - } - } - - obj_id pInv = utils.getInventoryContainer(player); - if (!isIdValid(pInv)) - { - return null; - } - - obj_id[] contents = getContents(pInv); - obj_id hep = null; - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (hasObjVar(contents[i], "isHEP" )) - { - power = getCount(contents[i]); - if (power >= HEP_UPKEEP_COST) - { - - hep = contents[i]; - break; - } - } - } - - return hep; - } - - - public static obj_id getCamoKitForCurrentPlanet(obj_id player) throws InterruptedException - { - - String planetName = getCurrentSceneName(); - if (planetName.length() > 7) - { - String sceneSubString = planetName.substring(0,8); - - if (sceneSubString.equals("kashyyyk")) - { - planetName = "kashyyyk"; - } - } - - obj_id pInv = utils.getInventoryContainer(player); - if (!isIdValid(pInv)) - { - return null; - } - - obj_id[] contents = getContents(pInv); - obj_id kit = null; - for (int i=0; i MAX_BUILDINGS_FOR_WILDNERNESS) - { - return false; - } - - return true; - } - - - public static boolean isInUrban(obj_id player) throws InterruptedException - { - return (!isInWilderness(player)); - } - - - public static boolean isFlagSet(int mask, int flag) throws InterruptedException - { - if ((mask & flag) == flag) - { - return true; - } - - return false; - } - - - public static boolean isPvPTrap(obj_id trap) throws InterruptedException - { - int triggerTypeInt = getIntObjVar(trap, TRIGGER_TYPE); - if (triggerTypeInt == TRIGGER_TYPE_PROXIMITY) - { - return true; - } - - return false; - } - - - public static obj_id createDecoy(obj_id spy) throws InterruptedException - { - location myLoc = getLocation(spy); - int species = getSpecies(spy); - int gender = getGender(spy); - - String template = "object/mobile/hologram/"; - - String speciesString = "human"; - String genderString = "male"; - - switch(species) - { - case SPECIES_RODIAN: speciesString = "rodian"; - break; - case SPECIES_TRANDOSHAN: speciesString = "trandoshan"; - break; - case SPECIES_MON_CALAMARI: speciesString = "moncal"; - break; - case SPECIES_WOOKIEE: speciesString = "wookiee"; - break; - case SPECIES_BOTHAN: speciesString = "bothan"; - break; - case SPECIES_TWILEK: speciesString = "twilek"; - break; - case SPECIES_ZABRAK: speciesString = "zabrak"; - break; - case SPECIES_ITHORIAN: speciesString = "ithorian"; - break; - case SPECIES_SULLUSTAN: speciesString = "sullustan"; - break; - } - - if (gender == GENDER_FEMALE) - { - genderString = "female"; - } - - template += speciesString + "_"+ genderString + ".iff"; - - obj_id hologram = createObject(template, myLoc); - - if (isIdValid(hologram)) - { - setMaster(hologram, spy); - setScale(hologram, getScale(spy)); - setYaw(hologram, getYaw(spy)); - setName(hologram, getName(spy)); - setDescriptionStringId(hologram, new string_id("mob/creature_names", "decoy_bio")); - setInvulnerable(hologram, false); - factions.setFaction(hologram, factions.getFaction(spy)); - setDecoyOrigin(hologram, spy); - - custom_var[] var_list = getAllCustomVars(spy); - - if (var_list != null && var_list.length > 0) - { - for (int i = 0; i < var_list.length; i++) - { - testAbortScript(); - ranged_int_custom_var ricv = (ranged_int_custom_var)var_list[i]; - - String var = ricv.getVarName(); - int value = ricv.getValue(); - - if (value != 0) - { - setRangedIntCustomVarValue(hologram, var, value); - } - - } - } - - obj_id[] contents = getAllWornItems(spy, false); - obj_id headSlotItem = getObjectInSlot(spy, "hat"); - - utils.setObjVar(hologram, "hologram_performer", 1); - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (isIdValid(contents[i])) - { - if (getContainerType(contents[i]) == 0) - { - if (!getTemplateName(contents[i]).endsWith("player.iff")) - { - - if (headSlotItem == contents[i] && isPlayerHelmetHidden(spy)) - { - continue; - } - - if (getGameObjectType(contents[i]) == GOT_misc_appearance_only_invisible) - { - continue; - } - - custom_var[] object_var = getAllCustomVars(contents[i]); - - obj_id newObject = createObject(getTemplateName(contents[i]), hologram, ""); - - if (object_var != null && isIdValid(newObject)) - { - for (int q=0; q 0) - { - for (int i=0; i 0) - { - utils.setScriptVar(hologram, "flank", true); - } - else - { - utils.setScriptVar(hologram, "flank", false); - } - - return hologram; - } - - return null; - } - - - public static boolean isDecoy(obj_id object) throws InterruptedException - { - return utils.hasScript(object, "ai.spy_decoy"); - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/sui.java b/sku.0/sys.server/compiled/game/script/library/sui.java deleted file mode 100644 index 65208ebf5..000000000 --- a/sku.0/sys.server/compiled/game/script/library/sui.java +++ /dev/null @@ -1,2391 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.colors_hex; - - -public class sui extends script.base_script -{ - public sui() - { - } - public static final int MAX_INPUT_LENGTH = 127; - - public static final String DEFAULT_TITLE = "@base_player:swg"; - - public static final String OWNER = "owner"; - public static final String THIS = "this"; - public static final String ASSOCIATE = "associate"; - public static final String RANGE = "range"; - - public static final String TITLE = "title"; - - public static final String BUTTONS = "buttons"; - - public static final String HANDLER = "handler"; - - public static final String HANDLER_SUI = "handleSUI"; - - public static final String CTRL_TITLE = "bg.caption.lblTitle"; - - public static final String BTN_OK = "btnOk"; - public static final String BTN_REVERT = "btnRevert"; - public static final String BTN_CANCEL = "btnCancel"; - - public static final String PROP_NAME = "Name"; - - public static final String PROP_TEXT = "Text"; - public static final String PROP_LOCALTEXT = "LocalText"; - - public static final String PROP_SELECTEDROW = "SelectedRow"; - public static final String PROP_SELECTEDTEXT = "SelectedText"; - public static final String PROP_SELECTEDINDEX = "SelectedIndex"; - - public static final String PROP_TARGETID = "TargetNetworkId"; - public static final String PROP_TARGETVAR = "TargetVariable"; - public static final String PROP_TARGETRANGEMIN = "TargetRangeMin"; - public static final String PROP_TARGETRANGEMAX = "TargetRangeMax"; - - public static final String PROP_BUTTONPRESSED = "buttonPressed"; - - public static final String PROP_VISIBLE = "visible"; - - public static final String PROP_AUTOSAVE = "autosave"; - public static final String PROP_LOCATION = "Location"; - public static final String PROP_SIZE = "Size"; - public static final String PROP_SOUND = "sound"; - - public static final String SUI_COLORPICKER = "Script.ColorPicker"; - - public static final String COLORPICKER_PAGE_CAPTION = "bg.caption"; - - public static final String COLORPICKER_COLORPICKER = "ColorPicker"; - public static final String COLORPICKER_TITLE = COLORPICKER_PAGE_CAPTION + ".lblTitle"; - - public static final String SUI_MSGBOX = "Script.messageBox"; - - public static final String MSGBOX_PAGE_PROMPT = "Prompt"; - public static final String MSGBOX_PAGE_CAPTION = "bg.caption"; - - public static final String MSGBOX_BTN_REVERT = "btnRevert"; - public static final String MSGBOX_BTN_CANCEL = "btnCancel"; - public static final String MSGBOX_BTN_OK = "btnOk"; - public static final String MSGBOX_PROMPT = MSGBOX_PAGE_PROMPT + ".lblPrompt"; - public static final String MSGBOX_TITLE = MSGBOX_PAGE_CAPTION + ".lblTitle"; - - public static final String SUI_COUNTDOWNTIMER = "Script.CountdownTimerBar"; - public static final String COUNTDOWNTIMER_PROMPT = "comp.text"; - public static final String COUNTDOWNTIMER_TIMEVALUE = "countdownTimerTimeValue"; - - public static final String COUNTDOWNTIMER_VAR = "countdown_sui"; - public static final String COUNTDOWNTIMER_OWNER_VAR = COUNTDOWNTIMER_VAR + ".owner"; - public static final String COUNTDOWNTIMER_CALLBACK_VAR = COUNTDOWNTIMER_VAR + ".callback"; - public static final String COUNTDOWNTIMER_FLAGS_VAR = COUNTDOWNTIMER_VAR + ".flags"; - public static final String COUNTDOWNTIMER_SUI_VAR = COUNTDOWNTIMER_VAR + ".sui_pid"; - - public static final String COUNTDOWNTIMER_PLAYER_SCRIPT = "player.player_countdown"; - - public static final int COUNTDOWNTIMER_MAXTIMEVALUE = 86400; - - public static final int CD_EVENT_NONE = 0x00000000; - public static final int CD_EVENT_COMBAT = 0x00000001; - public static final int CD_EVENT_LOCOMOTION = 0x00000002; - public static final int CD_EVENT_POSTURE = 0x00000004; - public static final int CD_EVENT_INCAPACITATE = 0x00000008; - public static final int CD_EVENT_DAMAGED = 0x00000010; - - public static final String SUI_INPUTBOX = "Script.inputBox"; - - public static final String INPUTBOX_PAGE_PROMPT = "Prompt"; - public static final String INPUTBOX_PAGE_CAPTION = "bg.caption"; - - public static final String INPUTBOX_BTN_CANCEL = "btnCancel"; - public static final String INPUTBOX_BTN_OK = "btnOk"; - public static final String INPUTBOX_PROMPT = INPUTBOX_PAGE_PROMPT + ".lblPrompt"; - public static final String INPUTBOX_TITLE = INPUTBOX_PAGE_CAPTION + ".lblTitle"; - public static final String INPUTBOX_INPUT = "txtInput"; - public static final String INPUTBOX_COMBO = "cmbInput"; - public static final String INPUTBOX_DATASOURCE = "dataInput"; - - public static final String INPUTBOX_INPUT_NAME = INPUTBOX_INPUT + "."+ PROP_NAME; - public static final String INPUTBOX_INPUT_LOCALTEXT = INPUTBOX_INPUT + "."+ PROP_LOCALTEXT; - - public static final String INPUTBOX_COMBO_SELECTEDTEXT = INPUTBOX_INPUT + "."+ PROP_SELECTEDTEXT; - public static final String INPUTBOX_COMBO_SELECTEDINDEX = INPUTBOX_INPUT + "."+ PROP_SELECTEDINDEX; - - public static final String SUI_LISTBOX = "Script.listBox"; - - public static final String LISTBOX_PAGE_PROMPT = "Prompt"; - public static final String LISTBOX_PAGE_CAPTION = "bg.caption"; - public static final String LISTBOX_PAGE_LIST = "List"; - - public static final String LISTBOX_BTN_REVERT = "btnRevert"; - public static final String LISTBOX_BTN_CANCEL = "btnCancel"; - public static final String LISTBOX_BTN_OK = "btnOk"; - public static final String LISTBOX_BTN_OTHER = "btnOther"; - public static final String LISTBOX_TITLE = LISTBOX_PAGE_CAPTION + ".lblTitle"; - public static final String LISTBOX_PROMPT = LISTBOX_PAGE_PROMPT + ".lblPrompt"; - public static final String LISTBOX_LIST = LISTBOX_PAGE_LIST + ".lstList"; - public static final String LISTBOX_DATASOURCE = LISTBOX_PAGE_LIST + ".dataList"; - public static final String LISTBOX_SELECTEDROW = LISTBOX_LIST + "."+ PROP_SELECTEDROW; - - public static final String LISTBOX_PROP_OTHER_PRESSED = "otherPressed"; - - public static final String SUI_TRANSFER = "Script.transfer"; - - public static final String TRANSFER_PAGE_PROMPT = "Prompt"; - public static final String TRANSFER_PAGE_CAPTION = "bg.caption"; - public static final String TRANSFER_PAGE_TRANSACTION = "transaction"; - - public static final String TRANSFER_BTN_OK = "btnOk"; - public static final String TRANSFER_BTN_CANCEL = "btnCancel"; - public static final String TRANSFER_BTN_REVERT = "btnRevert"; - - public static final String TRANSFER_TITLE = TRANSFER_PAGE_CAPTION + ".lblTitle"; - public static final String TRANSFER_PROMPT = TRANSFER_PAGE_PROMPT + ".lblPrompt"; - public static final String TRANSFER_INPUT_FROM = TRANSFER_PAGE_TRANSACTION + ".txtInputFrom"; - public static final String TRANSFER_INPUT_TO = TRANSFER_PAGE_TRANSACTION + ".txtInputTo"; - public static final String TRANSFER_FROM = TRANSFER_PAGE_TRANSACTION + ".lblStartingFrom"; - public static final String TRANSFER_TO = TRANSFER_PAGE_TRANSACTION + ".lblStartingTo"; - public static final String TRANSFER_FROM_TEXT = TRANSFER_PAGE_TRANSACTION + ".lblFrom"; - public static final String TRANSFER_TO_TEXT = TRANSFER_PAGE_TRANSACTION + ".lblTo"; - public static final String TRANSFER_SLIDER = TRANSFER_PAGE_TRANSACTION + ".slider"; - - public static final String TRANSFER_INPUT_FROM_TEXT = TRANSFER_INPUT_FROM + "."+ PROP_TEXT; - public static final String TRANSFER_INPUT_TO_TEXT = TRANSFER_INPUT_TO + "."+ PROP_TEXT; - - public static final String PROP_CONVERSION_RATIO_FROM = "ConversionRatioFrom"; - public static final String PROP_CONVERSION_RATIO_TO = "ConversionRatioTo"; - - public static final String MSG_BANK_TITLE = "@base_player:bank_title"; - public static final String MSG_BANK_PROMPT = "@base_player:bank_prompt"; - - public static final String HANDLER_DEPOSIT_WITHDRAW = "handleDepositWithdraw"; - - public static final int MAX_ARRAY_SIZE = 50; - - public static final int OK_ONLY = 0; - public static final int OK_CANCEL = 1; - public static final int YES_NO = 2; - public static final int YES_NO_CANCEL = 3; - public static final int YES_NO_MAYBE = 4; - public static final int YES_NO_ABSTAIN = 5; - public static final int RETRY_CANCEL = 6; - public static final int ABORT_RETRY_CANCEL = 7; - public static final int OK_REFRESH = 8; - public static final int OK_CANCEL_REFRESH = 9; - public static final int REFRESH_CANCEL = 10; - public static final int REFRESH_ONLY = 11; - public static final int OK_CANCEL_ALL = 12; - public static final int MOVEUP_MOVEDOWN_DONE = 13; - public static final int BET_MAX_BET_ONE_QUIT = 14; - public static final int BET_MAX_BET_ONE_SPIN = 15; - public static final int REFRESH_LEAVE_GAME = 16; - public static final int REMOVE_CANCEL = 17; - - public static final int MSG_NORMAL = 0; - public static final int MSG_CRITICAL = 1; - public static final int MSG_EXCLAMATION = 2; - public static final int MSG_QUESTION = 3; - public static final int MSG_INFORMATION = 4; - - public static final int INPUT_NORMAL = 0; - public static final int INPUT_COMBO = 1; - - public static final String OK = "Ok"; - public static final String CANCEL = "Cancel"; - public static final String REVERT = "Revert"; - - public static final int BP_OK = 0; - public static final int BP_CANCEL = 1; - public static final int BP_REVERT = 2; - - public static final string_id PROSE_OVER_MAX_ENTRIES = new string_id("error_message","prose_over_max_entries"); - public static final string_id OUT_OF_RANGE = new string_id("error_message","out_of_range"); - - public static final String SCRIPT_FILTER_OWNER = "sui.filter.owner"; - - public static final String VAR_FILTER_BASE = "sui.filter"; - public static final String VAR_FILTER_COUNT = VAR_FILTER_BASE + ".count"; - - public static final String HANDLER_FILTER_INPUT = "handleFilterInput"; - - - public static int msgbox(obj_id target, string_id sid_prompt, dictionary params) throws InterruptedException - { - if (!isIdValid(target)) - { - return -1; - } - - if (sid_prompt == null) - { - return -1; - } - - int pid = createSUIPage(SUI_MSGBOX, target, target, HANDLER_SUI); - - String prompt = utils.packStringId(sid_prompt); - - setSUIProperty(pid, MSGBOX_PROMPT, PROP_TEXT, prompt); - setSUIProperty(pid, MSGBOX_TITLE, PROP_TEXT, DEFAULT_TITLE); - - setPageProperties(pid, params); - - trackSUI(target, pid, params); - - showSUIPage(pid); - - return pid; - } - - - public static int msgbox(obj_id target, string_id sid_prompt) throws InterruptedException - { - return msgbox(target, sid_prompt, null); - } - - - public static int countdownTimerSUI(obj_id owner, obj_id target, String type, string_id sid_prompt, int current_time, int total_time, String suiHandler) throws InterruptedException - { - if (!isIdValid(owner) || !isIdValid(target)) - { - return -1; - } - - if (sid_prompt == null) - { - sid_prompt = new string_id("sui", "countdowntimer_default_prompt"); - } - - String prompt = utils.packStringId(sid_prompt); - if (prompt == null || prompt.equals("")) - { - prompt = "@sui:countdowntimer_default_prompt"; - } - - if (type == null || type.equals("")) - { - return -1; - } - - if (current_time < 0) - { - return -1; - } - - if (total_time <= 0) - { - return -1; - } - - if (total_time > COUNTDOWNTIMER_MAXTIMEVALUE) - { - return -1; - } - - if (current_time >= total_time) - { - return -1; - } - - if (suiHandler == null || suiHandler.equals("")) - { - suiHandler = "noHandler"; - } - - int pid = createSUIPage(SUI_COUNTDOWNTIMER, owner, target, suiHandler); - - if (pid == -1) - { - return -1; - } - - if (!setSUIProperty(pid, COUNTDOWNTIMER_PROMPT, PROP_TEXT, prompt)) - { - return -1; - } - - if (!setSUIProperty(pid, CTRL_TITLE, PROP_TEXT, type)) - { - return -1; - } - - if (!setSUIProperty(pid, THIS, COUNTDOWNTIMER_TIMEVALUE, current_time + "," + total_time)) - { - return -1; - } - - if (!showSUIPage(pid)) - { - return -1; - } - - if (owner != target) - { - setAssociateRange(target, pid, owner); - } - - return pid; - } - - - public static int smartCountdownTimerSUI(obj_id owner, obj_id target, String type, string_id sid_prompt, int current_time, int total_time, String suiHandler, float range, int flags) throws InterruptedException - { - if (!isIdValid(owner) || !isIdValid(target)) - { - return -1; - } - - if (sid_prompt == null) - { - sid_prompt = new string_id("sui", "countdowntimer_default_prompt"); - } - - String prompt = utils.packStringId(sid_prompt); - if (prompt == null || prompt.equals("")) - { - prompt = "@sui:countdowntimer_default_prompt"; - } - - if (type == null || type.equals("")) - { - return -1; - } - - if (current_time < 0) - { - return -1; - } - - if (total_time <= 0) - { - return -1; - } - - if (total_time > COUNTDOWNTIMER_MAXTIMEVALUE) - { - return -1; - } - - if (current_time >= total_time) - { - return -1; - } - - if (suiHandler == null || suiHandler.equals("")) - { - suiHandler = "noHandler"; - } - - if (hasScript(target, COUNTDOWNTIMER_PLAYER_SCRIPT)) - { - sendSystemMessage(target, new string_id("sui", "countdowntimer_too_busy")); - return -1; - } - - int pid = createSUIPage(SUI_COUNTDOWNTIMER, owner, target, suiHandler); - - if (pid == -1) - { - return -1; - } - - if (!setSUIProperty(pid, COUNTDOWNTIMER_PROMPT, PROP_TEXT, prompt)) - { - return -1; - } - - if (!setSUIProperty(pid, CTRL_TITLE, PROP_TEXT, type)) - { - return -1; - } - - if (!setSUIProperty(pid, THIS, COUNTDOWNTIMER_TIMEVALUE, current_time + "," + total_time)) - { - return -1; - } - - if (!showSUIPage(pid)) - { - return -1; - } - - if (owner != target) - { - setSUIAssociatedObject(pid, owner); - setSUIMaxRangeToObject(pid, range); - } - else - { - setSUIAssociatedLocation(pid,owner); - setSUIMaxRangeToObject(pid, range); - } - - flushSUIPage(pid); - - if (pid > -1) - { - setObjVar(target, COUNTDOWNTIMER_SUI_VAR, pid); - - utils.setScriptVar(target, COUNTDOWNTIMER_OWNER_VAR, owner); - utils.setScriptVar(target, COUNTDOWNTIMER_CALLBACK_VAR, suiHandler); - utils.setScriptVar(target, COUNTDOWNTIMER_FLAGS_VAR, flags); - - attachScript(target, COUNTDOWNTIMER_PLAYER_SCRIPT); - - dictionary d = new dictionary(); - d.put("buttonPressed", OK); - d.put("player", target); - d.put("id", pid); - d.put("event", CD_EVENT_NONE); - - int timeRemaining = total_time - current_time; - - messageTo(owner, suiHandler, d, timeRemaining, false); - messageTo(target, "handleCountdownTimerCleanup", d, (timeRemaining + 2), false); - } - - return pid; - } - - - public static boolean updateCountdownTimerSUI(int pid, string_id sid_prompt, int current_time, int total_time) throws InterruptedException - { - if (sid_prompt == null) - { - return false; - } - - String prompt = utils.packStringId(sid_prompt); - if (prompt == null || prompt.equals("")) - { - return false; - } - - if (current_time < 0) - { - return false; - } - - if (total_time <= 0) - { - return false; - } - - if (total_time > COUNTDOWNTIMER_MAXTIMEVALUE) - { - return false; - } - - if (current_time >= total_time) - { - return false; - } - - if (!setSUIProperty(pid, COUNTDOWNTIMER_PROMPT, PROP_TEXT, prompt)) - { - return false; - } - - if (!setSUIProperty(pid, THIS, COUNTDOWNTIMER_TIMEVALUE, current_time + "," + total_time)) - { - return false; - } - - if (!flushSUIPage(pid)) - { - return false; - } - - return true; - } - - - public static boolean setPageProperties(int pid, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - setButtonStyle(pid, OK_ONLY); - return true; - } - - setPageTitle(pid, params); - - setPageButtons(pid, params); - - java.util.Enumeration keys = params.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)(keys.nextElement()); - if (key.indexOf('-') > -1) - { - String[] s = split(key, '-'); - if ((s != null) && (s.length == 2)) - { - Object val = params.get(key); - String sVal = null; - - if (val != null) - { - if (val instanceof string_id) - { - sVal = utils.packStringId((string_id)(val)); - } - else if (val instanceof String) - { - sVal = (String)(val); - } - else - { - - } - - if (sVal != null) - { - setSUIProperty(pid, s[0], s[1], sVal); - } - } - } - } - } - - return true; - } - - - public static boolean setPageTitle(int pid, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return false; - } - - Object tmp = params.get(TITLE); - String title = null; - if (tmp != null) - { - if (tmp instanceof string_id) - { - title = utils.packStringId((string_id)(tmp)); - } - else if (tmp instanceof String) - { - title = (String)(tmp); - } - - if (title != null) - { - return setSUIProperty(pid, CTRL_TITLE, PROP_TEXT, DEFAULT_TITLE); - } - - params.remove(TITLE); - } - - return false; - } - - - public static boolean setPageButtons(int pid, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return false; - } - - int btns = params.getInt(BUTTONS); - setButtonStyle(pid, btns); - return true; - } - - - public static void setButtonStyle(int pid, int btns) throws InterruptedException - { - switch ( btns ) - { - case OK_ONLY: - hideBtnCancel(pid); - hideBtnRevert(pid); - break; - - case OK_CANCEL: - hideBtnRevert(pid); - break; - - case YES_NO: - hideBtnRevert(pid); - setSUIProperty(pid, BTN_CANCEL, PROP_TEXT,"@no"); - setSUIProperty(pid, BTN_OK, PROP_TEXT,"@yes"); - break; - - case YES_NO_CANCEL: - setSUIProperty(pid, BTN_REVERT, PROP_TEXT,"@no"); - setSUIProperty(pid, BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, BTN_OK, PROP_TEXT,"@yes"); - break; - - case YES_NO_MAYBE: - setSUIProperty(pid, BTN_REVERT, PROP_TEXT,"@maybe"); - setSUIProperty(pid, BTN_CANCEL, PROP_TEXT,"@no"); - setSUIProperty(pid, BTN_OK, PROP_TEXT,"@yes"); - break; - - case YES_NO_ABSTAIN: - setSUIProperty(pid, BTN_REVERT, PROP_TEXT,"@abstain"); - setSUIProperty(pid, BTN_CANCEL, PROP_TEXT,"@no"); - setSUIProperty(pid, BTN_OK, PROP_TEXT,"@yes"); - break; - - case RETRY_CANCEL: - hideBtnRevert(pid); - setSUIProperty(pid, BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, BTN_OK, PROP_TEXT,"@retry"); - break; - - case ABORT_RETRY_CANCEL: - setSUIProperty(pid, BTN_REVERT, PROP_TEXT,"@retry"); - setSUIProperty(pid, BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, BTN_OK, PROP_TEXT,"@abort"); - break; - - case OK_REFRESH: - hideBtnRevert(pid); - setSUIProperty(pid, BTN_CANCEL, PROP_TEXT,"@refresh"); - break; - - case OK_CANCEL_REFRESH: - setSUIProperty(pid, BTN_REVERT, PROP_TEXT,"@refresh"); - break; - - default: - break; - } - } - - - public static void hideBtnCancel(int pid) throws InterruptedException - { - setSUIProperty(pid, BTN_CANCEL, "Enabled","False"); - setSUIProperty(pid, BTN_CANCEL, "Visible","False"); - } - - - public static void hideBtnRevert(int pid) throws InterruptedException - { - setSUIProperty(pid, BTN_REVERT, "Enabled","False"); - setSUIProperty(pid, BTN_REVERT, "Visible","False"); - } - - - public static boolean trackSUI(obj_id target, int pid, dictionary params) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if ((params == null) || (params.isEmpty())) - { - trackSUI(target, pid, target, "noHandler"); - return false; - } - - obj_id owner = params.getObjId(OWNER); - if (!isIdValid(owner)) - { - owner = target; - } - - String handler = params.getString(HANDLER); - if ((handler == null) || (handler.equals(""))) - { - handler = "noHandler"; - } - - return trackSUI(target, pid, owner, handler); - } - - - public static boolean trackSUI(obj_id target, int pid, obj_id owner, String handler) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(owner) || (handler == null) || (handler.equals(""))) - { - return false; - } - - String path = "sui."+ pid; - utils.setScriptVar(target, path + ".owner", owner); - utils.setScriptVar(target, path + ".handler", handler); - - return true; - } - - - public static int msgbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, int style, String suiHandler) throws InterruptedException - { - if (!isIdValid(owner) || !isIdValid(target)) - { - return -1; - } - - if (prompt == null || prompt.equals("")) - { - return -1; - } - - if (suiHandler == null || suiHandler.equals("")) - { - suiHandler = "noHandler"; - } - - if (box_title == null || box_title.equals("")) - { - box_title = DEFAULT_TITLE; - } - - int pid = createSUIPage(SUI_MSGBOX, owner, target, suiHandler); - - setSUIProperty(pid, MSGBOX_PROMPT, PROP_TEXT, prompt); - setSUIProperty(pid, MSGBOX_TITLE, PROP_TEXT, box_title); - - msgboxButtonSetup(pid, buttons); - - showSUIPage(pid); - - if (owner != target) - { - setAssociateRange(target, pid, owner); - } - - return pid; - } - - - public static void msgboxButtonSetup(int pid, int buttons) throws InterruptedException - { - switch(buttons) - { - case OK_CANCEL: - msgboxHideBtnLeft(pid); - setSUIProperty(pid, MSGBOX_BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, MSGBOX_BTN_OK, PROP_TEXT,"@ok"); - break; - case YES_NO: - msgboxHideBtnLeft(pid); - setSUIProperty(pid, MSGBOX_BTN_CANCEL, PROP_TEXT,"@no"); - setSUIProperty(pid, MSGBOX_BTN_OK, PROP_TEXT,"@yes"); - break; - case YES_NO_CANCEL: - setSUIProperty(pid, MSGBOX_BTN_REVERT, PROP_TEXT,"@no"); - setSUIProperty(pid, MSGBOX_BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, MSGBOX_BTN_OK, PROP_TEXT,"@yes"); - break; - case YES_NO_MAYBE: - setSUIProperty(pid, MSGBOX_BTN_REVERT, PROP_TEXT,"@maybe"); - setSUIProperty(pid, MSGBOX_BTN_CANCEL, PROP_TEXT,"@no"); - setSUIProperty(pid, MSGBOX_BTN_OK, PROP_TEXT,"@yes"); - break; - case YES_NO_ABSTAIN: - setSUIProperty(pid, MSGBOX_BTN_REVERT, PROP_TEXT,"@abstain"); - setSUIProperty(pid, MSGBOX_BTN_CANCEL, PROP_TEXT,"@no"); - setSUIProperty(pid, MSGBOX_BTN_OK, PROP_TEXT,"@yes"); - break; - case RETRY_CANCEL: - msgboxHideBtnLeft(pid); - setSUIProperty(pid, MSGBOX_BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, MSGBOX_BTN_OK, PROP_TEXT,"@retry"); - break; - case ABORT_RETRY_CANCEL: - setSUIProperty(pid, MSGBOX_BTN_REVERT, PROP_TEXT,"@retry"); - setSUIProperty(pid, MSGBOX_BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, MSGBOX_BTN_OK, PROP_TEXT,"@abort"); - break; - case OK_ONLY: - default: - msgboxHideBtnLeft(pid); - msgboxHideBtnMiddle(pid); - setSUIProperty(pid, MSGBOX_BTN_OK, PROP_TEXT,"@ok"); - break; - } - } - - - public static void msgboxHideBtnLeft(int pid) throws InterruptedException - { - setSUIProperty(pid, MSGBOX_BTN_REVERT, "Enabled","False"); - setSUIProperty(pid, MSGBOX_BTN_REVERT, "Visible","False"); - } - - - public static void msgboxHideBtnMiddle(int pid) throws InterruptedException - { - setSUIProperty(pid, MSGBOX_BTN_CANCEL, "Enabled","False"); - setSUIProperty(pid, MSGBOX_BTN_CANCEL, "Visible","False"); - } - - - public static int msgbox(obj_id owner, obj_id target, String prompt, String suiHandler) throws InterruptedException - { - return msgbox(owner, target, prompt, OK_ONLY, DEFAULT_TITLE, MSG_NORMAL, suiHandler); - } - - - public static int msgbox(obj_id owner, String prompt, String suiHandler) throws InterruptedException - { - return msgbox(owner, owner, prompt, OK_ONLY, DEFAULT_TITLE, MSG_NORMAL, suiHandler); - } - - - public static int msgbox(obj_id owner, obj_id target, String prompt) throws InterruptedException - { - return msgbox(owner, target, prompt, OK_ONLY, DEFAULT_TITLE, MSG_NORMAL, "noHandler"); - } - - - public static int msgbox(obj_id owner, String prompt) throws InterruptedException - { - return msgbox(owner, owner, prompt, OK_ONLY, DEFAULT_TITLE, MSG_NORMAL, "noHandler"); - } - - - public static int msgbox(obj_id owner, obj_id target, String prompt, int buttons, String suiHandler) throws InterruptedException - { - return msgbox(owner, target, prompt, buttons, DEFAULT_TITLE, MSG_NORMAL, suiHandler); - } - - - public static int msgbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, String suiHandler) throws InterruptedException - { - return msgbox(owner, target, prompt, buttons, box_title, MSG_NORMAL, suiHandler); - } - - - public static int msgbox(obj_id owner, obj_id target, prose_package prompt, int buttons, String box_title, int style, String suiHandler) throws InterruptedException - { - String oob = packOutOfBandProsePackage(null, prompt); - return msgbox(owner, target, "\0" + oob, buttons, box_title, style, suiHandler); - } - - - public static int msgbox(obj_id owner, obj_id target, prose_package prompt, String suiHandler) throws InterruptedException - { - return msgbox(owner, target, prompt, OK_ONLY, DEFAULT_TITLE, MSG_NORMAL, suiHandler); - } - - - public static int msgbox(obj_id owner, prose_package prompt, String suiHandler) throws InterruptedException - { - return msgbox(owner, owner, prompt, OK_ONLY, DEFAULT_TITLE, MSG_NORMAL, suiHandler); - } - - - public static int msgbox(obj_id owner, obj_id target, prose_package prompt) throws InterruptedException - { - return msgbox(owner, target, prompt, OK_ONLY, DEFAULT_TITLE, MSG_NORMAL, "noHandler"); - } - - - public static int msgbox(obj_id owner, prose_package prompt) throws InterruptedException - { - return msgbox(owner, owner, prompt, OK_ONLY, DEFAULT_TITLE, MSG_NORMAL, "noHandler"); - } - - - public static int msgbox(obj_id owner, obj_id target, prose_package prompt, int buttons, String suiHandler) throws InterruptedException - { - return msgbox(owner, target, prompt, buttons, DEFAULT_TITLE, MSG_NORMAL, suiHandler); - } - - - public static int msgbox(obj_id owner, obj_id target, prose_package prompt, int buttons, String box_title, String suiHandler) throws InterruptedException - { - return msgbox(owner, target, prompt, buttons, box_title, MSG_NORMAL, suiHandler); - } - - - public static int inputbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, int style, String[] dsrc, String suiHandler, dictionary params) throws InterruptedException - { - if (dsrc == null) - { - LOG("sui", "inputbox: dsrc = null & style = "+ style); - } - - if (!isIdValid(owner) || !isIdValid(target)) - { - return -1; - } - - if (prompt == null || prompt.equals("")) - { - return -1; - } - - if (suiHandler == null || suiHandler.equals("")) - { - suiHandler = "noHandler"; - } - - if (box_title.equals("")) - { - box_title = DEFAULT_TITLE; - } - - int pid = createSUIPage(SUI_INPUTBOX, owner, target, suiHandler); - - setSUIProperty(pid, INPUTBOX_PROMPT, PROP_TEXT, prompt); - setSUIProperty(pid, INPUTBOX_TITLE, PROP_TEXT, box_title); - - inputboxButtonSetup(pid, buttons); - inputboxStyleSetup(pid, style); - - if ((style > INPUT_NORMAL) && (dsrc != null)) - { - LOG("sui", "sui.inputbox: entering data source modification"); - int maxArraySize = utils.getIntConfigSetting("GameServer", "suiListLimit"); - if (maxArraySize == 0) - { - CustomerServiceLog("sui", "WARNING: could not find config setting [GameServer] suiListLimit, "+ - "using default value of "+ MAX_ARRAY_SIZE); - maxArraySize = MAX_ARRAY_SIZE; - } - else if (maxArraySize > MAX_ARRAY_SIZE) - { - CustomerServiceLog("sui", "WARNING: config setting [GameServer] suiListLimit = "+ maxArraySize + - " greater than default value of "+ MAX_ARRAY_SIZE + ", please verify that the sui system can handle the value"); - } - if (dsrc.length > maxArraySize) - { - LOG("sui", "inputbox: passed dsrc array too large!"); - - prose_package pp = prose.getPackage(PROSE_OVER_MAX_ENTRIES, "", maxArraySize); - sendSystemMessageProse(target, pp); - - String[] newSrc = new String[maxArraySize]; - for (int i = 0; i < maxArraySize; i++) - { - testAbortScript(); - newSrc[i] = dsrc[i]; - } - - dsrc = newSrc; - } - - LOG("sui", "inputbox: clearing datasource dataInput"); - clearSUIDataSource(pid, INPUTBOX_DATASOURCE); - - int ubound = dsrc.length; - for (int i = 0; i < ubound; i++) - { - testAbortScript(); - addSUIDataItem(pid, INPUTBOX_DATASOURCE, ""+ i); - setSUIProperty(pid, INPUTBOX_DATASOURCE + "."+ i, PROP_TEXT, dsrc[i]); - - } - } - - setSUIProperty(pid, INPUTBOX_INPUT, "MaxLength", String.valueOf(MAX_INPUT_LENGTH)); - setSUIProperty(pid, INPUTBOX_COMBO, "MaxLength", String.valueOf(MAX_INPUT_LENGTH)); - - if ((params != null) && (!params.isEmpty())) - { - java.util.Enumeration keys = params.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)(keys.nextElement()); - String val = params.getString(key); - - LOG("sui","inputbox set params: key = "+ key + " val = "+ val); - java.util.StringTokenizer st = new java.util.StringTokenizer(key,"-"); - if (st.countTokens() == 2) - { - String control = st.nextToken(); - String prop = st.nextToken(); - - LOG("sui","control = "+ control + " prop = "+ prop + " val = "+ val); - setSUIProperty(pid, control, prop, val); - } - } - } - - subscribeToSUIProperty(pid, INPUTBOX_INPUT, PROP_LOCALTEXT); - subscribeToSUIProperty(pid, INPUTBOX_COMBO, PROP_SELECTEDTEXT); - - showSUIPage(pid); - - if (owner != target) - { - setAssociateRange(target, pid, owner); - } - - return pid; - } - - - public static int inputbox(obj_id owner, obj_id target, String prompt, String box_title, String suiHandler, int maxLength, boolean filtered, String defaultText) throws InterruptedException - { - if (!isIdValid(owner) || !isIdValid(target)) - { - return -1; - } - - if (prompt == null || prompt.equals("")) - { - return -1; - } - - if (suiHandler == null || suiHandler.equals("")) - { - return -1; - } - - String scriptvar_pid = VAR_FILTER_BASE + "."+ target + ".pid"; - String scriptvar_handler = VAR_FILTER_BASE + "."+ target + ".handler"; - - if (utils.hasScriptVar(owner, scriptvar_pid)) - { - int oldpid = utils.getIntScriptVar(owner, scriptvar_pid); - if (oldpid > -1) - { - closeSUI(target, oldpid); - } - - cleanupFilteredInputbox(owner, target); - } - - dictionary params = null; - - if (maxLength < 1) - { - maxLength = MAX_INPUT_LENGTH; - } - else - { - params = new dictionary(); - params.put(INPUTBOX_INPUT + "-MaxLength", maxLength); - } - - if (!filtered) - { - return inputbox(owner, target, prompt, OK_CANCEL, box_title, INPUT_NORMAL, null, suiHandler, params); - } - - attachScript(owner, SCRIPT_FILTER_OWNER); - - int pid = createSUIPage(SUI_INPUTBOX, owner, target, HANDLER_FILTER_INPUT); - if (pid > -1) - { - trackFilteredInputbox(owner, target, pid, suiHandler, defaultText); - - if (box_title.equals("")) - { - box_title = DEFAULT_TITLE; - } - - setSUIProperty(pid, INPUTBOX_PROMPT, PROP_TEXT, prompt); - setSUIProperty(pid, INPUTBOX_TITLE, PROP_TEXT, box_title); - - inputboxButtonSetup(pid, OK_CANCEL); - inputboxStyleSetup(pid, INPUT_NORMAL); - - setSUIProperty(pid, INPUTBOX_INPUT, "MaxLength", String.valueOf(MAX_INPUT_LENGTH)); - - if (defaultText != null && !defaultText.equals("")) - { - setSUIProperty(pid, INPUTBOX_INPUT, PROP_TEXT, defaultText); - } - - subscribeToSUIProperty(pid, INPUTBOX_PROMPT, PROP_TEXT); - subscribeToSUIProperty(pid, INPUTBOX_TITLE, PROP_TEXT); - subscribeToSUIProperty(pid, INPUTBOX_INPUT, "MaxLength"); - - subscribeToSUIProperty(pid, INPUTBOX_INPUT, PROP_LOCALTEXT); - - showSUIPage(pid); - return pid; - } - - return -1; - } - - - public static int inputbox(obj_id owner, obj_id target, String prompt, String box_title, String suiHandler, String defaultText) throws InterruptedException - { - return inputbox(owner, target, prompt, box_title, suiHandler, 32, true, defaultText); - } - - - public static int filteredInputbox(obj_id owner, obj_id target, String prompt, String box_title, String suiHandler, String defaultText) throws InterruptedException - { - return inputbox(owner, target, prompt, box_title, suiHandler, defaultText); - } - - - public static void trackFilteredInputbox(obj_id owner, obj_id player, int pid, String suiHandler, String defaultText) throws InterruptedException - { - if (!isIdValid(owner) || !isIdValid(player)) - { - return; - } - - String scriptvar_pid = VAR_FILTER_BASE + "."+ player + ".pid"; - String scriptvar_handler = VAR_FILTER_BASE + "."+ player + ".handler"; - String scriptvar_default = VAR_FILTER_BASE + "."+ player + ".defaultText"; - - utils.setScriptVar(owner, scriptvar_pid, pid); - utils.setScriptVar(owner, scriptvar_handler, suiHandler); - - if (defaultText != null && !defaultText.equals("")) - { - utils.setScriptVar(owner, scriptvar_default, defaultText); - } - - if (!hasScript(owner, SCRIPT_FILTER_OWNER)) - { - attachScript(owner, SCRIPT_FILTER_OWNER); - } - - int cnt = utils.getIntScriptVar(owner, VAR_FILTER_COUNT); - cnt++; - - utils.setScriptVar(owner, VAR_FILTER_COUNT, cnt); - } - - - public static void cleanupFilteredInputbox(obj_id owner, obj_id player) throws InterruptedException - { - if (!isIdValid(owner) || !isIdValid(player)) - { - return; - } - - String scriptvar_pid = VAR_FILTER_BASE + "."+ player + ".pid"; - String scriptvar_handler = VAR_FILTER_BASE + "."+ player + ".handler"; - String scriptvar_default = VAR_FILTER_BASE + "."+ player + ".defaultText"; - - utils.removeScriptVar(owner, scriptvar_pid); - utils.removeScriptVar(owner, scriptvar_handler); - utils.removeScriptVar(owner, scriptvar_default); - - int cnt = utils.getIntScriptVar(owner, VAR_FILTER_COUNT); - cnt--; - - if (cnt < 1) - { - utils.removeScriptVar(owner, VAR_FILTER_COUNT); - detachScript(owner, SCRIPT_FILTER_OWNER); - } - else - { - utils.setScriptVar(owner, VAR_FILTER_COUNT, cnt); - } - } - - - public static String getInputBoxText(dictionary params) throws InterruptedException - { - return params.getString(INPUTBOX_INPUT + "." + PROP_LOCALTEXT); - } - - - public static String getInputBoxTitle(dictionary params) throws InterruptedException - { - return params.getString(INPUTBOX_TITLE + "." + PROP_TEXT); - } - - - public static String getInputBoxPrompt(dictionary params) throws InterruptedException - { - return params.getString(INPUTBOX_PROMPT + "." + PROP_TEXT); - } - - - public static int getInputBoxMaxLength(dictionary params) throws InterruptedException - { - return utils.stringToInt(params.getString(INPUTBOX_INPUT + ".MaxLength")); - } - - - public static String getComboBoxText(dictionary params) throws InterruptedException - { - return params.getString(INPUTBOX_COMBO + "." + PROP_SELECTEDTEXT); - } - - - public static void inputboxButtonSetup(int pid, int buttons) throws InterruptedException - { - switch(buttons) - { - case OK_CANCEL: - setSUIProperty(pid, INPUTBOX_BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, INPUTBOX_BTN_OK, PROP_TEXT,"@ok"); - break; - case OK_ONLY: - default: - msgboxHideBtnMiddle(pid); - setSUIProperty(pid, INPUTBOX_BTN_OK, PROP_TEXT,"@ok"); - break; - } - } - - - public static void inputboxHideBtnMiddle(int pid) throws InterruptedException - { - setSUIProperty(pid, INPUTBOX_BTN_CANCEL, "Enabled","False"); - setSUIProperty(pid, INPUTBOX_BTN_CANCEL, "Visible","False"); - } - - - public static void inputboxStyleSetup(int pid, int style) throws InterruptedException - { - switch(style) - { - case INPUT_COMBO: - setSUIProperty(pid, INPUTBOX_INPUT, "Enabled","false"); - setSUIProperty(pid, INPUTBOX_INPUT, "Visible","false"); - - setSUIProperty(pid, INPUTBOX_COMBO, "Enabled","true"); - setSUIProperty(pid, INPUTBOX_COMBO, "Visible","true"); - break; - case INPUT_NORMAL: - default: - setSUIProperty(pid, INPUTBOX_INPUT, "Enabled","true"); - setSUIProperty(pid, INPUTBOX_INPUT, "Visible","true"); - - setSUIProperty(pid, INPUTBOX_COMBO, "Enabled","false"); - setSUIProperty(pid, INPUTBOX_COMBO, "Visible","false"); - break; - } - } - - - public static int inputbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, int style, String[] dsrc, String suiHandler) throws InterruptedException - { - return inputbox(owner, target, prompt, buttons, box_title, style, dsrc, suiHandler, null); - } - - - public static int inputbox(obj_id owner, obj_id target, String prompt, String suiHandler) throws InterruptedException - { - return inputbox(owner, target, prompt, OK_ONLY, DEFAULT_TITLE, INPUT_NORMAL, null, suiHandler); - } - - - public static int inputbox(obj_id owner, String prompt, String suiHandler) throws InterruptedException - { - return inputbox(owner, owner, prompt, OK_ONLY, DEFAULT_TITLE, INPUT_NORMAL, null, suiHandler); - } - - - public static int inputbox(obj_id owner, obj_id target, String prompt) throws InterruptedException - { - return inputbox(owner, target, prompt, OK_ONLY, DEFAULT_TITLE, INPUT_NORMAL, null, "noHandler"); - } - - - public static int inputbox(obj_id owner, String prompt) throws InterruptedException - { - return inputbox(owner, owner, prompt, OK_ONLY, DEFAULT_TITLE, INPUT_NORMAL, null, "noHandler"); - } - - - public static int inputbox(obj_id owner, obj_id target, String prompt, String[] dsrc, String suiHandler) throws InterruptedException - { - return inputbox(owner, target, prompt, OK_ONLY, DEFAULT_TITLE, INPUT_COMBO, dsrc, suiHandler); - } - - - public static int combobox(obj_id owner, obj_id target, String prompt, String[] dsrc, String suiHandler) throws InterruptedException - { - return inputbox(owner, target, prompt, OK_ONLY, DEFAULT_TITLE, INPUT_COMBO, dsrc, suiHandler); - } - - - public static int combobox(obj_id owner, String prompt, String[] dsrc, String suiHandler) throws InterruptedException - { - return inputbox(owner, owner, prompt, OK_ONLY, DEFAULT_TITLE, INPUT_COMBO, dsrc, suiHandler); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, prose_package[] dsrc, String suiHandler, boolean show, boolean truncate) throws InterruptedException - { - if (!isIdValid(owner) || !isIdValid(target) || suiHandler == null || suiHandler.equals("") || dsrc == null || dsrc.length == 0) - { - if (!isIdValid(owner)) - { - LOG("sui", "sui.listbox: invalid owner"); - } - if (!isIdValid(target)) - { - LOG("sui", "sui.listbox: invalid target"); - } - if (suiHandler == null || suiHandler.equals("")) - { - LOG("sui", "sui.listbox: invalid suiHandler"); - } - if (dsrc == null || dsrc.length == 0) - { - LOG("sui", "sui.listbox: invalid dsrc"); - } - return -1; - } - - if (box_title.equals("")) - { - box_title = DEFAULT_TITLE; - } - - int maxArraySize = utils.getIntConfigSetting("GameServer", "suiListLimit"); - if (maxArraySize == 0) - { - CustomerServiceLog("sui", "WARNING: could not find config setting [GameServer] suiListLimit, "+ - "using default value of "+ MAX_ARRAY_SIZE); - maxArraySize = MAX_ARRAY_SIZE; - } - else if (maxArraySize > MAX_ARRAY_SIZE) - { - CustomerServiceLog("sui", "WARNING: config setting [GameServer] suiListLimit = "+ maxArraySize + - " greater than default value of "+ MAX_ARRAY_SIZE + ", please verify that the sui system can handle the value"); - } - if (dsrc.length > maxArraySize && truncate) - { - LOG("sui", "sui.listbox: entering data source modification"); - if (dsrc.length > maxArraySize) - { - LOG("sui", "listbox: passed dsrc array too large!"); - - prose_package pp = prose.getPackage(PROSE_OVER_MAX_ENTRIES, "", maxArraySize); - sendSystemMessageProse(target, pp); - - prose_package[] newSrc = new prose_package[maxArraySize]; - for (int i = 0; i < maxArraySize; i++) - { - testAbortScript(); - newSrc[i] = dsrc[i]; - } - - dsrc = newSrc; - } - } - - int pid = createSUIPage(SUI_LISTBOX, owner, target, suiHandler); - if (pid > -1) - { - setSUIProperty(pid, LISTBOX_TITLE, PROP_TEXT, box_title); - setSUIProperty(pid, LISTBOX_PROMPT, PROP_TEXT, prompt); - - listboxButtonSetup(pid, buttons); - - if (dsrc != null) - { - clearSUIDataSource(pid, LISTBOX_DATASOURCE); - - int ubound = dsrc.length; - for (int i = 0; i < ubound; i++) - { - testAbortScript(); - addSUIDataItem(pid, LISTBOX_DATASOURCE, ""+ i); - String oob = ""; - oob = packOutOfBandProsePackage(oob, -1, dsrc[i]); - setSUIPropertyOOB(pid, LISTBOX_DATASOURCE + "."+ i, PROP_TEXT, oob); - } - } - - subscribeToSUIProperty(pid, LISTBOX_LIST, PROP_SELECTEDROW); - subscribeToSUIProperty(pid, LISTBOX_TITLE, PROP_TEXT); - - if (show) - { - showSUIPage(pid); - - if (owner != target) - { - setAssociateRange(target, pid, owner); - } - } - } - - return pid; - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, String[] dsrc, String suiHandler, boolean show, boolean truncate) throws InterruptedException - { - if (!isIdValid(owner) || !isIdValid(target) || suiHandler == null || suiHandler.equals("") || dsrc == null || dsrc.length == 0) - { - if (!isIdValid(owner)) - { - LOG("sui", "sui.listbox: invalid owner"); - } - if (!isIdValid(target)) - { - LOG("sui", "sui.listbox: invalid target"); - } - if (suiHandler == null || suiHandler.equals("")) - { - LOG("sui", "sui.listbox: invalid suiHandler"); - } - if (dsrc == null || dsrc.length == 0) - { - LOG("sui", "sui.listbox: invalid dsrc"); - } - return -1; - } - - if (box_title.equals("")) - { - box_title = DEFAULT_TITLE; - } - - int maxArraySize = utils.getIntConfigSetting("GameServer", "suiListLimit"); - if (maxArraySize == 0) - { - CustomerServiceLog("sui", "WARNING: could not find config setting [GameServer] suiListLimit, "+ - "using default value of "+ MAX_ARRAY_SIZE); - maxArraySize = MAX_ARRAY_SIZE; - } - else if (maxArraySize > MAX_ARRAY_SIZE) - { - CustomerServiceLog("sui", "WARNING: config setting [GameServer] suiListLimit = "+ maxArraySize + - " greater than default value of "+ MAX_ARRAY_SIZE + ", please verify that the sui system can handle the value"); - } - if (dsrc.length > maxArraySize && truncate) - { - LOG("sui", "sui.listbox: entering data source modification"); - if (dsrc.length > maxArraySize) - { - LOG("sui", "listbox: passed dsrc array too large!"); - - prose_package pp = prose.getPackage(PROSE_OVER_MAX_ENTRIES, "", maxArraySize); - sendSystemMessageProse(target, pp); - - String[] newSrc = new String[maxArraySize]; - for (int i = 0; i < maxArraySize; i++) - { - testAbortScript(); - newSrc[i] = dsrc[i]; - } - - dsrc = newSrc; - } - } - - int pid = createSUIPage(SUI_LISTBOX, owner, target, suiHandler); - if (pid > -1) - { - setSUIProperty(pid, LISTBOX_TITLE, PROP_TEXT, box_title); - setSUIProperty(pid, LISTBOX_PROMPT, PROP_TEXT, prompt); - - listboxButtonSetup(pid, buttons); - - if (dsrc != null) - { - clearSUIDataSource(pid, LISTBOX_DATASOURCE); - - int ubound = dsrc.length; - for (int i = 0; i < ubound; i++) - { - testAbortScript(); - addSUIDataItem(pid, LISTBOX_DATASOURCE, ""+ i); - setSUIProperty(pid, LISTBOX_DATASOURCE + "."+ i, PROP_TEXT, dsrc[i]); - } - } - - subscribeToSUIProperty(pid, LISTBOX_LIST, PROP_SELECTEDROW); - subscribeToSUIProperty(pid, LISTBOX_TITLE, PROP_TEXT); - - if (show) - { - showSUIPage(pid); - - if (owner != target) - { - setAssociateRange(target, pid, owner); - } - } - } - - return pid; - } - - - public static int emptylistbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, String suiHandler, boolean show) throws InterruptedException - { - if (!isIdValid(owner) || !isIdValid(target) || suiHandler == null || suiHandler.equals("")) - { - if (!isIdValid(owner)) - { - LOG("sui", "sui.emptylistbox: invalid owner"); - } - if (!isIdValid(target)) - { - LOG("sui", "sui.emptylistbox: invalid target"); - } - if (suiHandler == null || suiHandler.equals("")) - { - LOG("sui", "sui.emptylistbox: invalid suiHandler"); - } - return -1; - } - - if (box_title.equals("")) - { - box_title = DEFAULT_TITLE; - } - - int pid = createSUIPage(SUI_LISTBOX, owner, target, suiHandler); - if (pid > -1) - { - setSUIProperty(pid, LISTBOX_TITLE, PROP_TEXT, box_title); - setSUIProperty(pid, LISTBOX_PROMPT, PROP_TEXT, prompt); - - listboxButtonSetup(pid, buttons); - - clearSUIDataSource(pid, LISTBOX_DATASOURCE); - - subscribeToSUIProperty(pid, LISTBOX_LIST, PROP_SELECTEDROW); - subscribeToSUIProperty(pid, LISTBOX_TITLE, PROP_TEXT); - - if (show) - { - showSUIPage(pid); - } - } - - return pid; - } - - - public static int getListboxSelectedRow(dictionary params) throws InterruptedException - { - return utils.stringToInt(params.getString(LISTBOX_LIST + "." + PROP_SELECTEDROW)); - } - - - public static String getListboxTitle(dictionary params) throws InterruptedException - { - return params.getString(LISTBOX_TITLE + "." + PROP_TEXT); - } - - - public static void listboxButtonSetup(int pid, int buttons) throws InterruptedException - { - switch(buttons) - { - case OK_CANCEL: - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@ok"); - break; - case YES_NO: - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@no"); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@yes"); - break; - case OK_REFRESH: - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@refresh"); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@ok"); - break; - case OK_CANCEL_REFRESH: - listboxUseOtherButton(pid, "@refresh"); - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@ok"); - break; - case REFRESH_CANCEL: - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@refresh"); - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@cancel"); - break; - case REFRESH_ONLY: - listboxHideBtnMiddle(pid); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@refresh"); - break; - case OK_CANCEL_ALL: - listboxUseOtherButton(pid, "@all"); - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@ok"); - break; - case MOVEUP_MOVEDOWN_DONE: - listboxUseOtherButton(pid, "@movedown"); - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@done"); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@moveup"); - break; - case BET_MAX_BET_ONE_QUIT: - listboxUseOtherButton(pid, "@bet_one"); - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@quit"); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@bet_max"); - break; - case BET_MAX_BET_ONE_SPIN: - listboxUseOtherButton(pid, "@bet_one"); - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@spin"); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@bet_max"); - break; - case REFRESH_LEAVE_GAME: - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@leave_game"); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@refresh"); - break; - case REMOVE_CANCEL: - setSUIProperty(pid, LISTBOX_BTN_CANCEL, PROP_TEXT,"@cancel"); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@remove"); - break; - case OK_ONLY: - default: - msgboxHideBtnMiddle(pid); - setSUIProperty(pid, LISTBOX_BTN_OK, PROP_TEXT,"@ok"); - break; - } - } - - - public static void listboxHideBtnMiddle(int pid) throws InterruptedException - { - setSUIProperty(pid, LISTBOX_BTN_CANCEL, "Enabled","False"); - setSUIProperty(pid, LISTBOX_BTN_CANCEL, "Visible","False"); - } - - - public static void listboxUseOtherButton(int pid, String caption) throws InterruptedException - { - setSUIProperty (pid, LISTBOX_BTN_OTHER, PROP_VISIBLE, "true"); - setSUIProperty (pid, LISTBOX_BTN_OTHER, PROP_TEXT, caption); - subscribeToSUIProperty (pid, "this", LISTBOX_PROP_OTHER_PRESSED); - } - - - public static boolean getListboxOtherButtonPressed(dictionary params) throws InterruptedException - { - return Boolean.valueOf (params.getString("this." + LISTBOX_PROP_OTHER_PRESSED)).booleanValue (); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, String[] dsrc, String suiHandler, boolean show) throws InterruptedException - { - return listbox(owner, target, prompt, buttons, box_title, dsrc, suiHandler, show, true); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, Vector dsrc, String suiHandler, boolean show) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, target, prompt, buttons, box_title, dsrcArray, suiHandler, show, true); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, Vector dsrc, String suiHandler, boolean show, boolean truncate) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, target, prompt, buttons, box_title, dsrcArray, suiHandler, show, truncate); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, String[] dsrc, String suiHandler) throws InterruptedException - { - return listbox (owner, target, prompt, buttons, box_title, dsrc, suiHandler, true, true); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, int buttons, String box_title, Vector dsrc, String suiHandler) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox (owner, target, prompt, buttons, box_title, dsrcArray, suiHandler, true, true); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, String[] dsrc, String suiHandler) throws InterruptedException - { - return listbox(owner, target, prompt, OK_ONLY, "", dsrc, suiHandler); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, Vector dsrc, String suiHandler) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, target, prompt, OK_ONLY, "", dsrcArray, suiHandler); - } - - - public static int listbox(obj_id owner, String prompt, String[] dsrc, String suiHandler) throws InterruptedException - { - return listbox(owner, owner, prompt, OK_ONLY, "", dsrc, suiHandler); - } - - - public static int listbox(obj_id owner, String prompt, Vector dsrc, String suiHandler) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, owner, prompt, OK_ONLY, "", dsrcArray, suiHandler); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, String[] dsrc) throws InterruptedException - { - return listbox(owner, target, prompt, OK_ONLY, "", dsrc, "noHandler"); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, Vector dsrc) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, target, prompt, OK_ONLY, "", dsrc, "noHandler"); - } - - - public static int listbox(obj_id owner, String prompt, String[] dsrc) throws InterruptedException - { - return listbox(owner, owner, prompt, OK_ONLY, "", dsrc, "noHandler"); - } - - - public static int listbox(obj_id owner, String prompt, Vector dsrc) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, owner, prompt, OK_ONLY, "", dsrcArray, "noHandler"); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, String title, String[] dsrc, String suiHandler) throws InterruptedException - { - return listbox(owner, target, prompt, OK_ONLY, title, dsrc, suiHandler); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, String title, Vector dsrc, String suiHandler) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, target, prompt, OK_ONLY, title, dsrcArray, suiHandler); - } - - - public static int listbox(obj_id owner, String prompt, String title, String[] dsrc, String suiHandler) throws InterruptedException - { - return listbox(owner, owner, prompt, OK_ONLY, title, dsrc, suiHandler); - } - - - public static int listbox(obj_id owner, String prompt, String title, Vector dsrc, String suiHandler) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, owner, prompt, OK_ONLY, title, dsrcArray, suiHandler); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, String title, String[] dsrc) throws InterruptedException - { - return listbox(owner, target, prompt, OK_ONLY, title, dsrc, "noHandler"); - } - - - public static int listbox(obj_id owner, obj_id target, String prompt, String title, Vector dsrc) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, target, prompt, OK_ONLY, title, dsrcArray, "noHandler"); - } - - - public static int listbox(obj_id owner, String prompt, String title, String[] dsrc) throws InterruptedException - { - return listbox(owner, owner, prompt, OK_ONLY, title, dsrc, "noHandler"); - } - - - public static int listbox(obj_id owner, String prompt, String title, Vector dsrc) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, owner, prompt, OK_ONLY, title, dsrcArray, "noHandler"); - } - - - public static int listbox(obj_id owner, String prompt, String title, int btn, String[] dsrc) throws InterruptedException - { - return listbox(owner, owner, prompt, btn, title, dsrc, "noHandler"); - } - - - public static int listbox(obj_id owner, String prompt, String title, int btn, Vector dsrc) throws InterruptedException - { - if (dsrc == null) - { - return -1; - } - - String[] dsrcArray = new String[dsrc.size()]; - dsrc.toArray(dsrcArray); - return listbox(owner, owner, prompt, btn, title, dsrcArray, "noHandler"); - } - - - public static int transfer(obj_id owner, obj_id target, String prompt, String box_title, String lblFrom, int inputFrom, String lblTo, int inputTo, String suiHandler, int conversionFrom, int conversionTo) throws InterruptedException - { - if ((owner == null) || (target == null) || (suiHandler.equals("")) || conversionFrom <= 0 || conversionTo <= 0) - { - return -1; - } - - if (box_title.equals("")) - { - box_title = DEFAULT_TITLE; - } - - int pid = createSUIPage(SUI_TRANSFER, owner, target, suiHandler); - - setSUIProperty(pid, TRANSFER_TITLE, PROP_TEXT, box_title); - setSUIProperty(pid, TRANSFER_PROMPT, PROP_TEXT, prompt); - - setSUIProperty(pid, TRANSFER_FROM_TEXT, PROP_TEXT, lblFrom); - setSUIProperty(pid, TRANSFER_TO_TEXT, PROP_TEXT, lblTo); - - setSUIProperty(pid, TRANSFER_FROM, PROP_TEXT, Integer.toString(inputFrom)); - setSUIProperty(pid, TRANSFER_TO, PROP_TEXT, Integer.toString(inputTo)); - - setSUIProperty(pid, TRANSFER_INPUT_FROM, PROP_TEXT, Integer.toString(inputFrom)); - setSUIProperty(pid, TRANSFER_INPUT_TO, PROP_TEXT, Integer.toString(inputTo)); - - setSUIProperty(pid, TRANSFER_PAGE_TRANSACTION, PROP_CONVERSION_RATIO_FROM, Integer.toString(conversionFrom)); - setSUIProperty(pid, TRANSFER_PAGE_TRANSACTION, PROP_CONVERSION_RATIO_TO, Integer.toString(conversionTo)); - - subscribeToSUIProperty(pid, TRANSFER_INPUT_FROM, PROP_TEXT); - subscribeToSUIProperty(pid, TRANSFER_INPUT_TO, PROP_TEXT); - - showSUIPage(pid); - - if (owner != target) - { - setAssociateRange(target, pid, owner); - } - - return pid; - } - - - public static int transfer(obj_id owner, obj_id target, String prompt, String box_title, String lblFrom, int inputFrom, String lblTo, int inputTo, String suiHandler) throws InterruptedException - { - return transfer(owner, target, prompt, box_title, lblFrom, inputFrom, lblTo, inputTo, suiHandler, 1, 1); - } - - - public static int getTransferInputTo(dictionary params) throws InterruptedException - { - return utils.stringToInt(params.getString(TRANSFER_INPUT_TO + "." + PROP_TEXT)); - } - - - public static int getTransferInputFrom(dictionary params) throws InterruptedException - { - return utils.stringToInt(params.getString(TRANSFER_INPUT_FROM + "." + PROP_TEXT)); - } - - - public static int bank(obj_id player) throws InterruptedException - { - if (player == null) - { - return -1; - } - - int cash = getCashBalance(player); - int bank = getBankBalance(player); - return transfer(player, player, MSG_BANK_PROMPT, MSG_BANK_TITLE, "Cash", cash, "Bank", bank, HANDLER_DEPOSIT_WITHDRAW); - } - - - public static int colorize(obj_id owner, obj_id player, obj_id target, String customizationVar, String handler) throws InterruptedException - { - if ((player == null) || (target == null) || (customizationVar.equals(""))) - { - return -1; - } - - customizationVar = customizationVar.trim(); - if (customizationVar.startsWith("/")) - { - customizationVar = customizationVar.substring(1); - } - - LOG("sui", "colorize: customizationVar = "+ customizationVar + "<>"); - - int pid = createSUIPage (SUI_COLORPICKER, owner, player, handler); - if (pid > -1) - { - setSUIProperty (pid, COLORPICKER_COLORPICKER, PROP_TARGETID, target.toString()); - setSUIProperty (pid, COLORPICKER_COLORPICKER, PROP_TARGETVAR, customizationVar); - setSUIProperty (pid, COLORPICKER_COLORPICKER, PROP_TARGETRANGEMAX, "500"); - - setSUIProperty (pid, COLORPICKER_TITLE, PROP_TEXT, DEFAULT_TITLE); - - subscribeToSUIProperty (pid, COLORPICKER_COLORPICKER, PROP_SELECTEDINDEX); - showSUIPage (pid); - } - - return pid; - } - - - public static int getColorPickerIndex(dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return -1; - } - - return utils.stringToInt(params.getString(COLORPICKER_COLORPICKER + "." + PROP_SELECTEDINDEX)); - } - - - public static String getButtonPressed(dictionary params) throws InterruptedException - { - return params.getString(PROP_BUTTONPRESSED); - } - - - public static int getIntButtonPressed(dictionary params) throws InterruptedException - { - String bp = params.getString(PROP_BUTTONPRESSED); - if ((bp == null) || (bp.equals(""))) - { - - } - else if (bp.equals(OK)) - { - if (params.containsKey("this.otherPressed")) - { - if (params.getString("this.otherPressed").equals("true")) - { - return BP_REVERT; - } - } - - return BP_OK; - } - else if (bp.equals(REVERT)) - { - return BP_REVERT; - } - - return BP_CANCEL; - } - - - public static obj_id getPlayerId(dictionary params) throws InterruptedException - { - return params.getObjId("player"); - } - - - public static boolean setSUIObjVars(obj_id target, int pid, dictionary params) throws InterruptedException - { - java.util.Enumeration keys = params.keys(); - - while (keys.hasMoreElements()) - { - testAbortScript(); - Object key = keys.nextElement(); - Object value = params.get(key); - - if (value instanceof Integer) - { - int v = ((Integer)value).intValue(); - setObjVar(target, "sui."+ pid + "."+ key, v); - } - else if (value instanceof int[]) - { - int[] v = (int[])value; - if (v.length > 0) - { - setObjVar(target, "sui."+ pid + "."+ key, v); - } - } - else if (value instanceof Float) - { - float v = ((Float)value).floatValue(); - setObjVar(target, "sui."+ pid + "."+ key, v); - } - else if (value instanceof float[]) - { - float[] v = (float[])value; - if (v.length > 0) - { - setObjVar(target, "sui."+ pid + "."+ key, v); - } - } - else if (value instanceof String) - { - String v = (String)value; - setObjVar(target, "sui."+ pid + "."+ key, v); - } - else if (value instanceof String[]) - { - String[] v = (String[])value; - if (v.length > 0) - { - setObjVar(target, "sui."+ pid + "."+ key, v); - } - } - else if (value instanceof obj_id) - { - obj_id v = (obj_id)value; - setObjVar(target, "sui."+ pid + "."+ key, v); - } - else if (value instanceof obj_id[]) - { - obj_id[] v = (obj_id[])value; - if (v.length > 0) - { - setObjVar(target, "sui."+ pid + "."+ key, v); - } - } - else if (value instanceof location) - { - location v = (location)value; - setObjVar(target, "sui."+ pid + "."+ key, v); - } - else if (value instanceof location[]) - { - location[] v = (location[])value; - if (v.length > 0) - { - setObjVar(target, "sui."+ pid + "."+ key, v); - } - } - else if (value instanceof string_id) - { - string_id v = (string_id)value; - setObjVar(target, "sui."+ pid + "."+ key, v); - } - else if (value instanceof string_id[]) - { - string_id[] v = (string_id[])value; - if (v.length > 0) - { - setObjVar(target, "sui."+ pid + "."+ key, v); - } - } - - } - return true; - } - - - public static void clearSUIObjVar(obj_id target, int pid) throws InterruptedException - { - removeObjVar(target, "sui."+ pid); - } - - - public static void closeSUI(obj_id target, int pid) throws InterruptedException - { - if (!isIdValid(target)) - { - return; - } - - dictionary params = new dictionary(); - params.put("pid", pid); - messageTo(target, "handleCloseSui", params, 0, false); - } - - - public static void setAssociateRange(obj_id player, int pid, obj_id target, float range) throws InterruptedException - { - if (!isIdValid(player)) - { - LOG("sui", "sui.setAssociateRange: invalid player"); - return; - } - - if (!isIdValid(target)) - { - LOG("sui", "sui.setAssociateRange: invalid target"); - return; - } - - if (pid < 0) - { - LOG("sui", "sui.setAssociateRange: pid < 0"); - return; - } - - if (range <= 0f) - { - LOG("sui", "sui.setAssociateRange: invalid range <= 0f"); - return; - } - - setSUIAssociatedObject(pid, target); - setSUIMaxRangeToObject(pid, range); - } - - - public static void setAssociateRange(obj_id player, int pid, obj_id target) throws InterruptedException - { - setAssociateRange(player, pid, target, 16f); - } - - - public static void setAssociateRange(obj_id player, int pid, obj_id target, String key) throws InterruptedException - { - float range = 16f; - - String tbl = "datatables/sui/associate_range.iff"; - float dta = dataTableGetFloat(tbl, key, "RANGE"); - if (dta > 0f) - { - range = dta; - } - - setAssociateRange(player, pid, target, range); - } - - - public static void setAutosaveProperty(int pid, boolean autosave) throws InterruptedException - { - setSUIProperty(pid, THIS, PROP_AUTOSAVE, autosave ? "true": "false"); - } - - - public static void setSizeProperty(int pid, int width, int height) throws InterruptedException - { - if (width < 0) - { - LOG("sui", "setSizeProperty: Invalid size. width = "+ width); - return; - } - - if (height < 0) - { - LOG("sui", "setSizeProperty: Invalid size. height = "+ height); - return; - } - - setSUIProperty(pid, THIS, PROP_SIZE, width + ","+ height); - } - - - public static void setLocationProperty(int pid, int x, int y) throws InterruptedException - { - setSUIProperty(pid, THIS, PROP_LOCATION, x + ","+ y); - } - - - public static void setSoundProperty(int pid, String sound) throws InterruptedException - { - setSUIProperty(pid, THIS, PROP_SOUND, sound == null ? "": sound); - } - - - public static boolean hasPid(obj_id player, String pidName) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - if (pidName == null || pidName.equals("")) - { - return false; - } - - return utils.hasScriptVar(player, "pid." + pidName); - } - - - public static void setPid(obj_id player, int pid, String pidName) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return; - } - - if (pidName == null || pidName.equals("")) - { - return; - } - - if (pid == 0) - { - return; - } - - utils.setScriptVar(player, "pid."+ pidName, pid); - } - - - public static void removePid(obj_id player, String pidName) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return; - } - - if (pidName == null || pidName.equals("")) - { - return; - } - - utils.removeScriptVar(player, "pid."+ pidName); - } - - - public static int getPid(obj_id player, String pidName) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return 0; - } - - if (pidName == null || pidName.equals("")) - { - return 0; - } - - return utils.getIntScriptVar(player, "pid." + pidName); - } - - - public static boolean outOfRange(obj_id object, obj_id player, float range, boolean message) throws InterruptedException - { - if (!isIdValid(object)) - { - return false; - } - - if (!isIdValid(player)) - { - return false; - } - - location a = getLocation(object); - location b = getLocation(player); - if (a.cell == b.cell && a.distance(b) < range) - { - return false; - } - - if (message) - { - sendSystemMessage(player, OUT_OF_RANGE); - } - - return true; - } - - - public static String colorGreen() throws InterruptedException - { - return "\\#99FF33"; - } - - - public static String colorRed() throws InterruptedException - { - return "\\#FF3300"; - } - - - public static String colorOrange() throws InterruptedException - { - return "\\#FFCC66"; - } - - - public static String colorWhite() throws InterruptedException - { - return "\\#FFFFFF"; - } - - - public static String colorBlue() throws InterruptedException - { - return "\\#0099FF"; - } - - - public static String newLine() throws InterruptedException - { - return newLine(1); - } - - - public static String newLine(int n) throws InterruptedException - { - String returnString = ""; - for (int i = 0; i < n; i++) - { - testAbortScript(); - returnString += "\n"; - } - - return returnString; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/tcg.java b/sku.0/sys.server/compiled/game/script/library/tcg.java deleted file mode 100644 index 25458c20b..000000000 --- a/sku.0/sys.server/compiled/game/script/library/tcg.java +++ /dev/null @@ -1,1079 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.beast_lib; -import script.library.incubator; -import script.library.spawning; -import script.library.static_item; -import script.library.target_dummy; -import script.library.utils; - - -public class tcg extends script.base_script -{ - public tcg() - { - } - public static final String RANCHHAND_CELL_SCRIPT = "systems.tcg.barn_cell"; - - public static final String RANCHHAND_PREFIX = "ranchhand"; - public static final String RANCHHAND_CELLCHECK = RANCHHAND_PREFIX + ".ranchhandcheck"; - public static final String RANCHHAND_CELL = RANCHHAND_PREFIX + ".ranchhandcell"; - public static final String RANCHHAND_STRUCTURE = RANCHHAND_PREFIX + ".structure"; - public static final String RANCHHAND_OBJECT = RANCHHAND_PREFIX + ".ranchhand_object"; - - public static final String RANCH_HAND_TEMPLATE = "object/tangible/tcg/series1/structure_barn_ranchhand.iff"; - public static final String CELL_NAME = "entry"; - - public static final float RANCH_HAND_X = 4.2f; - public static final float RANCH_HAND_Y = 0.0f; - public static final float RANCH_HAND_Z = 2.7f; - public static final float RANCH_HAND_HEADING = 172.0f; - - public static final String BARN_STRUCTURE_TEMPLATE = "object/building/player/city/barn_no_planet_restriction.iff"; - public static final String BARN_RANCHHAND_SCRIPT = "systems.tcg.barn_ranchhand"; - public static final String BARN_BEAST_SCRIPT = "systems.tcg.barn_beast"; - - public static final int MAX_NUM_BARN_PETS = 40; - - public static final String[] BEAST_OBJVARS = - { - "beast", - "beastmood", - "abilities" - }; - - - public static boolean isBarnRanchhand(obj_id target) throws InterruptedException - { - if (hasScript(target, BARN_RANCHHAND_SCRIPT)) - { - return true; - } - - return false; - } - - - public static boolean isBarnStructure(obj_id building) throws InterruptedException - { - String template = getTemplateName(building); - if (template.equals(BARN_STRUCTURE_TEMPLATE)) - { - return true; - } - return false; - } - - - public static void barnStoreBeastPrompt(obj_id player, obj_id ranchhand) throws InterruptedException - { - obj_id[] initialBcdsList = beast_lib.getDatapadBCDs(player); - if (initialBcdsList == null || initialBcdsList.length < 1) - { - sendSystemMessage(player, new string_id("tcg", "barn_no_beast_control_devices_found")); - } - else - { - Vector vectorBcdsList = new Vector(); - vectorBcdsList.setSize(0); - Vector vectorBeastNames = new Vector(); - vectorBeastNames.setSize(0); - for (int i = 0; i < initialBcdsList.length; i++) - { - testAbortScript(); - obj_id bcd = initialBcdsList[i]; - String beastName = beast_lib.getBCDBeastName(bcd); - if (beastName != null && beastName.length() > 0) - { - utils.addElement(vectorBeastNames, toUpper(beastName, 0)); - utils.addElement(vectorBcdsList, bcd); - } - } - - if (vectorBeastNames != null && vectorBcdsList != null && vectorBeastNames.size() > 0 && vectorBcdsList.size() > 0) - { - obj_id[] finalBcdsList = utils.toStaticObjIdArray(vectorBcdsList); - String[] finalBeastNames = utils.toStaticStringArray(vectorBeastNames); - - String promptExtra = ""; - obj_id barn = getTopMostContainer(ranchhand); - if (isIdValid(barn)) - { - promptExtra = target_dummy.addLineBreaks(2); - promptExtra += "Number of Beasts in the Barn: "+getTotalBarnStoredBeasts(barn)+" of "+MAX_NUM_BARN_PETS; - } - - barnSelectPlayerBeastSui(player, ranchhand, finalBcdsList, finalBeastNames, "barn_beast_selection_storage_prompt", promptExtra, "handleBarnBeastStorage"); - } - } - return; - } - - - public static void barnSelectPlayerBeastSui(obj_id player, obj_id ranchhand, obj_id[] beastControlDevices, String[] beastNames, String promptRef, String promptExtra, String handler) throws InterruptedException - { - - if (utils.hasScriptVar(player, "barnRanchHand.pid")) - { - int oldPid = utils.getIntScriptVar(player, "barnRanchHand.pid"); - forceCloseSUIPage(oldPid); - utils.removeScriptVar(player, "barnRanchHand.pid"); - } - - if (utils.hasScriptVar(player, "barnRanchHand."+handler)) - { - utils.removeScriptVar(player, "barnRanchHand."+handler); - } - - String[] alphabetizedBeastNames = new String[beastNames.length]; - obj_id[] sortedBeastControlDevices = new obj_id[beastControlDevices.length]; - - utils.copyArray(beastNames, alphabetizedBeastNames); - Arrays.sort(alphabetizedBeastNames); - for (int j = 0; j < alphabetizedBeastNames.length; j++) - { - testAbortScript(); - String alphabetizedName = alphabetizedBeastNames[j]; - int index = utils.getElementPositionInArray(beastNames, alphabetizedName); - obj_id sortedBeast = beastControlDevices[index]; - - sortedBeastControlDevices[j] = sortedBeast; - beastNames[index] = "_"; - } - - String title = utils.packStringId(new string_id("tcg", "barn_beast_selection_title")); - String prompt = utils.packStringId(new string_id("tcg", promptRef)); - if (promptExtra != null && promptExtra.length() > 0) - { - prompt += promptExtra; - } - - int pid = sui.listbox(ranchhand, player, prompt, sui.OK_CANCEL, title, alphabetizedBeastNames, handler); - - if (pid > -1) - { - utils.setScriptVar(player, "barnRanchHand.pid", pid); - utils.setScriptVar(player, "barnRanchHand."+handler, sortedBeastControlDevices); - } - return; - } - - - public static void barnReclaimBeastPrompt(obj_id player, obj_id barn, obj_id ranchhand) throws InterruptedException - { - String[] initialStorageList = getBarnBeastStorageSlots(barn); - if (initialStorageList == null || initialStorageList.length < 1) - { - sendSystemMessage(player, new string_id("tcg", "barn_no_beast_control_devices_found")); - } - else - { - Vector vectorBcdsList = new Vector(); - vectorBcdsList.setSize(0); - Vector vectorBeastNames = new Vector(); - vectorBeastNames.setSize(0); - for (int i = 0; i < initialStorageList.length; i++) - { - testAbortScript(); - String bcdSlot = initialStorageList[i]; - String beastName = ""; - if (hasObjVar(barn, "barnStorage."+bcdSlot+".beast.beastName")) - { - beastName =getStringObjVar(barn, "barnStorage."+bcdSlot+".beast.beastName"); - } - else if (hasObjVar(barn, "barnStorage."+bcdSlot+".tempName")) - { - beastName = getStringObjVar(barn, "barnStorage."+bcdSlot+".tempName"); - } - if (beastName != null && beastName.length() > 0) - { - utils.addElement(vectorBeastNames, toUpper(beastName, 0)); - utils.addElement(vectorBcdsList, bcdSlot); - } - } - - if (vectorBeastNames != null && vectorBcdsList != null && vectorBeastNames.size() > 0 && vectorBcdsList.size() > 0) - { - String[] finalBcdsList = utils.toStaticStringArray(vectorBcdsList); - String[] finalBeastNames = utils.toStaticStringArray(vectorBeastNames); - - String promptExtra = target_dummy.addLineBreaks(2); - promptExtra += "Number of Beasts in the Barn: "+getTotalBarnStoredBeasts(barn)+" of "+MAX_NUM_BARN_PETS; - - barnSelectStoredBeastSui(player, ranchhand, finalBcdsList, finalBeastNames, "barn_beast_selection_reclaim_prompt", promptExtra, "handleBarnBeastReclaim"); - } - } - return; - } - - - public static void barnDisplayBeastPrompt(obj_id player, obj_id barn, obj_id ranchhand) throws InterruptedException - { - String[] initialStorageList = getBarnBeastStorageSlots(barn); - if (initialStorageList == null || initialStorageList.length < 1) - { - sendSystemMessage(player, new string_id("tcg", "barn_no_beast_control_devices_found")); - } - else - { - Vector vectorBcdsList = new Vector(); - vectorBcdsList.setSize(0); - Vector vectorBeastNames = new Vector(); - vectorBeastNames.setSize(0); - for (int i = 0; i < initialStorageList.length; i++) - { - testAbortScript(); - String bcdSlot = initialStorageList[i]; - String beastName = ""; - if (hasObjVar(barn, "barnStorage."+bcdSlot+".beast.beastName")) - { - beastName =getStringObjVar(barn, "barnStorage."+bcdSlot+".beast.beastName"); - } - else if (hasObjVar(barn, "barnStorage."+bcdSlot+".tempName")) - { - beastName = getStringObjVar(barn, "barnStorage."+bcdSlot+".tempName"); - } - - if (utils.hasScriptVar(barn, bcdSlot)) - { - beastName = beastName + " [Displayed]"; - } - else - { - beastName = beastName + " [Stored]"; - } - - if (beastName != null && beastName.length() > 0) - { - utils.addElement(vectorBeastNames, toUpper(beastName, 0)); - utils.addElement(vectorBcdsList, bcdSlot); - } - } - - if (vectorBeastNames != null && vectorBcdsList != null && vectorBeastNames.size() > 0 && vectorBcdsList.size() > 0) - { - String[] finalBcdsList = utils.toStaticStringArray(vectorBcdsList); - String[] finalBeastNames = utils.toStaticStringArray(vectorBeastNames); - barnSelectStoredBeastSui(player, ranchhand, finalBcdsList, finalBeastNames, "barn_beast_selection_display_prompt", "", "handleBarnBeastDisplay"); - } - } - return; - } - - - public static void barnSelectStoredBeastSui(obj_id player, obj_id ranchhand, String[] beastControlSlots, String[] beastNames, String promptRef, String promptExtra, String handler) throws InterruptedException - { - - if (utils.hasScriptVar(player, "barnRanchHand.pid")) - { - int oldPid = utils.getIntScriptVar(player, "barnRanchHand.pid"); - forceCloseSUIPage(oldPid); - utils.removeScriptVar(player, "barnRanchHand.pid"); - } - - if (utils.hasScriptVar(player, "barnRanchHand."+handler)) - { - utils.removeScriptVar(player, "barnRanchHand."+handler); - } - - String[] alphabetizedBeastNames = new String[beastNames.length]; - String[] sortedBeastControlSlots = new String[beastControlSlots.length]; - - utils.copyArray(beastNames, alphabetizedBeastNames); - Arrays.sort(alphabetizedBeastNames); - for (int j = 0; j < alphabetizedBeastNames.length; j++) - { - testAbortScript(); - String alphabetizedName = alphabetizedBeastNames[j]; - int index = utils.getElementPositionInArray(beastNames, alphabetizedName); - String sortedBeast = beastControlSlots[index]; - - sortedBeastControlSlots[j] = sortedBeast; - beastNames[index] = "_"; - } - - String title = utils.packStringId(new string_id("tcg", "barn_beast_selection_title")); - String prompt = utils.packStringId(new string_id("tcg", promptRef)); - if (promptExtra != null && promptExtra.length() > 0) - { - prompt += promptExtra; - } - - int pid = sui.listbox(ranchhand, player, prompt, sui.OK_CANCEL, title, alphabetizedBeastNames, handler); - - if (pid > -1) - { - utils.setScriptVar(player, "barnRanchHand.pid", pid); - utils.setScriptVar(player, "barnRanchHand."+handler, sortedBeastControlSlots); - } - return; - } - - - public static boolean transferBeastControlDeviceToBarn(obj_id selectedBeastControlDevice, obj_id player, obj_id barn) throws InterruptedException - { - String nextAvailableStorageSlot = getNextAvailableBarnStorageSlot(barn, player); - if (nextAvailableStorageSlot != null && nextAvailableStorageSlot.length() > 0) - { - String bcdTemplate = getTemplateName(selectedBeastControlDevice); - if (bcdTemplate != null && bcdTemplate.length() > 0) - { - setObjVar(barn, nextAvailableStorageSlot+".bcdTemplate", bcdTemplate); - if (!hasObjVar(selectedBeastControlDevice, "beast.beastName")) - { - setObjVar(barn, nextAvailableStorageSlot+".tempName", beast_lib.getBeastLocalizedName(selectedBeastControlDevice)); - } - - for (int i = 0; i < BEAST_OBJVARS.length; i++) - { - testAbortScript(); - String beastObjvar = BEAST_OBJVARS[i]; - if (hasObjVar(selectedBeastControlDevice, beastObjvar)) - { - obj_var_list beastData = getObjVarList(selectedBeastControlDevice, beastObjvar); - if (beastData != null) - { - setBCDDataObjVars(player, barn, nextAvailableStorageSlot+"."+ beastObjvar +".", beastData); - } - else - { - if (hasObjVar(barn, nextAvailableStorageSlot)) - { - removeObjVar(barn, nextAvailableStorageSlot); - } - return false; - } - } - } - } - else - { - if (hasObjVar(barn, nextAvailableStorageSlot)) - { - removeObjVar(barn, nextAvailableStorageSlot); - } - return false; - } - } - else - { - if (hasObjVar(barn, nextAvailableStorageSlot)) - { - removeObjVar(barn, nextAvailableStorageSlot); - } - return false; - } - - beast_lib.storeBeast(selectedBeastControlDevice); - destroyObject(selectedBeastControlDevice); - return true; - } - - - public static obj_id transferBeastControlDeviceFromBarn(String selectedStorageSlot, obj_id player, obj_id barn) throws InterruptedException - { - obj_id bcd = obj_id.NULL_ID; - - if (callable.hasMaxStoredCombatPets(player)) - { - sendSystemMessage(player, new string_id("tcg", "barn_beast_reclaim_player_datapad_full")); - return obj_id.NULL_ID; - } - - obj_id datapad = utils.getPlayerDatapad(player); - if (isIdValid(datapad)) - { - String bcdTemplate = getStringObjVar(barn, "barnStorage."+selectedStorageSlot+".bcdTemplate"); - if (bcdTemplate != null && bcdTemplate.length() > 0) - { - bcd = createObject(bcdTemplate, datapad, ""); - if (isIdValid(bcd)) - { - for (int i = 0; i < BEAST_OBJVARS.length; i++) - { - testAbortScript(); - String beastObjvar = BEAST_OBJVARS[i]; - if (hasObjVar(barn, "barnStorage."+selectedStorageSlot+"."+beastObjvar)) - { - obj_var_list beastData = getObjVarList(barn, "barnStorage."+selectedStorageSlot+"."+beastObjvar); - if (beastData != null) - { - setBCDDataObjVars(player, bcd, beastObjvar+".", beastData); - } - else - { - - destroyObject(bcd); - return obj_id.NULL_ID; - } - } - } - - attachScript(bcd, "ai.beast_control_device"); - setName(bcd, beast_lib.getBCDBeastName(bcd)); - - removeObjVar(barn, "barnStorage."+selectedStorageSlot); - - if (utils.hasScriptVar(barn, selectedStorageSlot)) - { - obj_id displayedBeast = utils.getObjIdScriptVar(barn, selectedStorageSlot); - if (isIdValid(displayedBeast) && exists(displayedBeast)) - { - destroyObject(displayedBeast); - utils.removeScriptVar(barn, selectedStorageSlot); - } - } - } - else - { - - } - } - else - { - - } - } - else - { - - } - - return bcd; - } - - - public static void setBCDDataObjVars(obj_id player, obj_id target, String objvarNamePrefix, obj_var_list data) throws InterruptedException - { - int numItem = data.getNumItems(); - for (int i = 0; i < numItem; i++) - { - testAbortScript(); - obj_var dataObjvar = data.getObjVar(i); - String dataObjvarName = dataObjvar.getName(); - - if (data.isIntObjVar(dataObjvarName)) - { - int intData = data.getIntObjVar(dataObjvarName); - setObjVar(target, objvarNamePrefix + dataObjvarName, intData); - } - else if (data.isIntArrayObjVar(dataObjvarName)) - { - int[] intArrayData = data.getIntArrayObjVar(dataObjvarName); - setObjVar(target, objvarNamePrefix + dataObjvarName, intArrayData); - } - else if (data.isFloatObjVar(dataObjvarName)) - { - float floatData = data.getFloatObjVar(dataObjvarName); - setObjVar(target, objvarNamePrefix + dataObjvarName, floatData); - } - else if (data.isFloatArrayObjVar(dataObjvarName)) - { - float[] floatArrayData = data.getFloatArrayObjVar(dataObjvarName); - setObjVar(target, objvarNamePrefix + dataObjvarName, floatArrayData); - } - else if (data.isStringObjVar(dataObjvarName)) - { - String stringData = data.getStringObjVar(dataObjvarName); - setObjVar(target, objvarNamePrefix + dataObjvarName, stringData); - } - else if (data.isStringArrayObjVar(dataObjvarName)) - { - String[] stringArrayData = data.getStringArrayObjVar(dataObjvarName); - setObjVar(target, objvarNamePrefix + dataObjvarName, stringArrayData); - } - else if (data.isObjIdObjVar(dataObjvarName)) - { - obj_id objIdData = data.getObjIdObjVar(dataObjvarName); - setObjVar(target, objvarNamePrefix + dataObjvarName, objIdData); - } - else if (data.isObjIdArrayObjVar(dataObjvarName)) - { - obj_id[] objIdArrayData = data.getObjIdArrayObjVar(dataObjvarName); - setObjVar(target, objvarNamePrefix + dataObjvarName, objIdArrayData); - } - else if (data.isBooleanObjVar(dataObjvarName)) - { - boolean booleanData = data.getBooleanObjVar(dataObjvarName); - setObjVar(target, objvarNamePrefix + dataObjvarName, booleanData); - } - else - { - if (isGod(player)) - { - sendSystemMessage(player, "God Mode Message::Unknown data type for "+dataObjvarName+".", ""); - } - } - } - return; - } - - - public static String getNextAvailableBarnStorageSlot(obj_id barn, obj_id player) throws InterruptedException - { - String storageSlot = ""; - - if (hasObjVar(barn, "barnStorage")) - { - obj_var_list barnStorageData = getObjVarList(barn, "barnStorage"); - if (barnStorageData != null) - { - int numItem = barnStorageData.getNumItems(); - if (numItem < MAX_NUM_BARN_PETS) - { - for (int i = 0; i < MAX_NUM_BARN_PETS; i++) - { - testAbortScript(); - String testName = "slot_0"+i; - if (i > 9) - { - testName = "slot_"+i; - } - if (!barnStorageData.hasObjVar(testName)) - { - storageSlot = "barnStorage."+testName; - break; - } - } - } - else - { - sendSystemMessage(player, new string_id ("tcg","barn_is_full")); - } - } - } - else - { - storageSlot = "barnStorage.slot_00"; - } - - return storageSlot; - } - - - public static String[] getBarnBeastStorageSlots(obj_id barn) throws InterruptedException - { - obj_var_list beastData = getObjVarList(barn, "barnStorage"); - if (beastData != null) - { - int numItems = beastData.getNumItems(); - String[] slots = new String[numItems]; - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - obj_var beastDataObjvar = beastData.getObjVar(i); - String beastDataObjvarName = beastDataObjvar.getName(); - slots[i] = beastDataObjvarName; - } - - return slots; - } - - return null; - } - - - public static int getTotalBarnStoredBeastsFromRanchhand(obj_id ranchhand) throws InterruptedException - { - int numStoredBeasts = 0; - - if (isIdValid(ranchhand) && exists(ranchhand)) - { - obj_id barn = getTopMostContainer(ranchhand); - if (isIdValid(barn)) - { - numStoredBeasts = getTotalBarnStoredBeasts(barn); - } - } - - return numStoredBeasts; - } - - - public static int getTotalBarnStoredBeasts(obj_id barn) throws InterruptedException - { - int numStoredBeasts = 0; - - if (isIdValid(barn) && exists(barn)) - { - obj_var_list beastStorageData = getObjVarList(barn, "barnStorage"); - if (beastStorageData != null) - { - numStoredBeasts = beastStorageData.getNumItems(); - } - } - - return numStoredBeasts; - } - - - public static obj_id barnDisplayBeast(obj_id ranchhand, String storageSlot, obj_id barn) throws InterruptedException - { - location here = getLocation(ranchhand); - location spawnCenter = new location(-7.0f, 0.0f, -2.4f, here.area, here.cell); - location spawnLocation = spawning.getRandomLocationInCircle(spawnCenter, 5.0f); - - String beastType = ""; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_TYPE)) - { - int hashBeastType = getIntObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_TYPE); - beastType = incubator.convertHashTypeToString(hashBeastType); - } - if (beastType == null || beastType.length() < 1) - { - return obj_id.NULL_ID; - } - - dictionary beastDict = utils.dataTableGetRow(beast_lib.BEASTS_TABLE, beastType); - if (beastDict == null) - { - return obj_id.NULL_ID; - } - - String mobileTemplateName = beastDict.getString("template"); - if (mobileTemplateName.equals("") || mobileTemplateName == null) - { - return obj_id.NULL_ID; - } - - obj_id beast = createObject(beast_lib.MOBILE_TEMPLATE_PREFIX + mobileTemplateName, spawnLocation); - if (!isIdValid(beast)) - { - return obj_id.NULL_ID; - } - - LOG("barnStorage","getting hues for beast: "+ beast); - - int primaryHue = -1; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE)) - { - primaryHue = getIntObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE); - LOG("barnStorage","primaryHue: "+ primaryHue); - } - int secondaryHue = -1; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE2)) - { - secondaryHue = getIntObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE2); - LOG("barnStorage","secondaryHue: "+ secondaryHue); - - } - int thirdHue = -1; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE3)) - { - thirdHue = getIntObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE3); - LOG("barnStorage","thirdHue: "+ secondaryHue); - } - - String primaryPalette = ""; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE)) - { - primaryPalette = getStringObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE); - LOG("barnStorage","primaryPalette: "+ primaryPalette); - - } - String secondaryPalette = ""; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE2)) - { - secondaryPalette = getStringObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE2); - LOG("barnStorage","secondaryPalette: "+ secondaryPalette); - } - String thirdPalette = ""; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE3)) - { - thirdPalette = getStringObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE3); - LOG("barnStorage","thirdPalette: "+ thirdPalette); - } - - if (primaryHue >= 0 && (primaryPalette == null || primaryPalette.length() <= 0)) - { - LOG("barnStorage","setting primary hue only!! "+ primaryHue); - setRoamingBeastHue(beast, "/private/index_color_1", primaryHue); - } - else - { - LOG("barnStorage","setting all available hues!"); - - if (primaryPalette != null || primaryPalette.length() > 0) - { - LOG("barnStorage","setting "+ primaryPalette + " to "+primaryHue); - setRoamingBeastHue(beast, primaryPalette, primaryHue); - } - if (secondaryPalette != null || secondaryPalette.length() > 0) - { - LOG("barnStorage","setting "+ secondaryPalette + " to "+secondaryHue); - setRoamingBeastHue(beast, secondaryPalette, secondaryHue); - } - if (thirdPalette != null || thirdPalette.length() > 0) - { - LOG("barnStorage","setting "+ thirdPalette + " to "+thirdHue); - setRoamingBeastHue(beast, thirdPalette, thirdHue); - } - } - - utils.setScriptVar(barn, storageSlot, beast); - - utils.setScriptVar(beast, "barnSlot", storageSlot); - utils.setScriptVar(beast, "barnId", barn); - - beast_lib.setBeastBCD(beast, barn); - - utils.setScriptVar(beast, "beast.creationInProgress", true); - - initializeBeastStatsFromBarn(barn, beast, storageSlot, beastType); - - setYaw(beast, rand(0.0f, 360.0f)); - - utils.removeScriptVar(beast, "beast.creationInProgress"); - - setAttributeAttained(beast, attrib.BEAST); - - attachScript(beast, BARN_BEAST_SCRIPT); - attachScript(beast, "ai.ai"); - - setInvulnerable(beast, true); - - return beast; - } - - - public static void initializeBeastStatsFromBarn(obj_id barn, obj_id beast, String storageSlot, String beastType) throws InterruptedException - { - int primaryHue = -1; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE)) - { - primaryHue = getIntObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE); - } - int secondaryHue = -1; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE2)) - { - secondaryHue = getIntObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE2); - } - int thirdHue = -1; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE3)) - { - thirdHue = getIntObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_HUE3); - } - - String primaryPalette = ""; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE)) - { - primaryPalette = getStringObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE); - } - String secondaryPalette = ""; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE2)) - { - secondaryPalette = getStringObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE2); - } - String thirdPalette = ""; - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE3)) - { - thirdPalette = getStringObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_PALETTE3); - } - - if (primaryHue >= 0 && (primaryPalette == null || primaryPalette.length() <= 0)) - { - beast_lib.setBeastHuePrimary(beast, "/private/index_color_1", primaryHue); - } - else - { - beast_lib.setBeastHuePrimary(beast, primaryPalette, primaryHue); - beast_lib.setBeastHueSecondary(beast, secondaryPalette, secondaryHue); - beast_lib.setBeastHueThird(beast, thirdPalette, thirdHue); - } - - int level = 1; - - if (hasObjVar(barn, "barnStorage."+storageSlot+".beast.level")) - { - level = getIntObjVar(barn, "barnStorage."+storageSlot+".beast.level"); - } - setLevel(beast, level); - - String beastName = beast_lib.getBeastLocalizedName(beast); - if (hasObjVar(barn, "barnStorage."+storageSlot+".beast.beastName")) - { - beastName = getStringObjVar(barn, "barnStorage."+storageSlot+".beast.beastName"); - } - else if (hasObjVar(barn, "barnStorage."+storageSlot+".tempName")) - { - beastName = getStringObjVar(barn, "barnStorage."+storageSlot+".tempName"); - } - setName(beast, beastName); - - dictionary beastDict = utils.dataTableGetRow(beast_lib.BEASTS_TABLE, beastType); - if (beastDict == null || beastDict.size() <= 0) - { - return; - } - - dictionary beastStatsDict = utils.dataTableGetRow(beast_lib.BEASTS_STATS, level - 1); - if (beastStatsDict == null || beastStatsDict.size() <= 0) - { - return; - } - - int[] incubationBonuses = new int[beast_lib.ARRAY_BEAST_INCUBATION_STATS.length]; - - if (hasObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_INCUBATION_BONUSES)) - { - incubationBonuses = getIntArrayObjVar(barn, "barnStorage."+storageSlot+"."+beast_lib.OBJVAR_BEAST_INCUBATION_BONUSES); - } - else - { - for (int i = 0; i < beast_lib.ARRAY_BEAST_INCUBATION_STATS.length; ++i) - { - testAbortScript(); - incubationBonuses[i] = 0; - } - } - - for (int i = 0; i < beast_lib.ARRAY_BEAST_INCUBATION_STATS.length; ++i) - { - testAbortScript(); - utils.setScriptVar(beast, beast_lib.ARRAY_BEAST_INCUBATION_STATS[i], (float)incubationBonuses[i]); - } - - beast_lib.addInnateBeastBonuses(beast, beastType); - - beast_lib.setBeastSkillBonuses(beast); - - setScale(beast, beast_lib.getBeastScaleByLevel(beast)); - - addSkillModModifier(beast, "slope_move", "slope_move", 50, -1, false, false); - - int expertiseRegen = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_regen"); - int expertiseHealth = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_health"); - int expertiseAttackSpeed = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_attack_speed"); - int expertiseArmor = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_armor"); - int expertiseDamage = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_pet_damage"); - - float incubationArmorBonus = utils.getFloatScriptVar(beast, beast_lib.OBJVAR_INCREASE_ARMOR); - float incubationDamageBonus = utils.getFloatScriptVar(beast, beast_lib.OBJVAR_INCREASE_DPS); - float incubationHealthBonus = utils.getFloatScriptVar(beast, beast_lib.OBJVAR_INCREASE_HEALTH); - - int intMinDamage = (int)beastStatsDict.getInt("MinDmg"); - int intMaxDamage = (int)beastStatsDict.getInt("MaxDmg"); - intMinDamage = beast_lib.getExpertiseStat(intMinDamage, expertiseDamage, .5f); - intMaxDamage = beast_lib.getExpertiseStat(intMaxDamage, expertiseDamage, .5f); - - float floatMinDamage = (float)intMinDamage * (1.0f + incubationDamageBonus / 100.0f); - float floatMaxDamage = (float)intMaxDamage * (1.0f + incubationDamageBonus / 100.0f); - intMinDamage = (int)floatMinDamage; - intMaxDamage = (int)floatMaxDamage; - - int specialDamagePercent = beast_lib.getExpertiseStat(100, expertiseDamage, .5f) - 100; - - if (!hasSkillModModifier (beast, "expertise_damage_line_beast_only")) - { - addSkillModModifier(beast, "expertise_damage_line_beast_only", "expertise_damage_line_beast_only", specialDamagePercent, -1, false, false); - } - - float primarySpeed = beast_lib.getExpertiseSpeed(beast_lib.BEAST_WEAPON_SPEED, expertiseAttackSpeed); - - obj_id beastWeapon = getCurrentWeapon(beast); - - if (isIdValid(beastWeapon)) - { - setWeaponAttackSpeed(beastWeapon, primarySpeed); - setWeaponMaxDamage(beastWeapon, intMaxDamage); - setWeaponMinDamage(beastWeapon, intMinDamage); - weapons.setWeaponData(beastWeapon); - - utils.setScriptVar(beastWeapon, "isCreatureWeapon", 1); - } - - obj_id defaultWeapon = getDefaultWeapon(beast); - - if (isIdValid(defaultWeapon)) - { - setWeaponAttackSpeed(defaultWeapon, primarySpeed); - setWeaponMaxDamage(defaultWeapon, intMaxDamage); - setWeaponMinDamage(defaultWeapon, intMinDamage); - weapons.setWeaponData(defaultWeapon); - - utils.setScriptVar(defaultWeapon, "isCreatureWeapon", 1); - } - - int beastHealth = (int)(beast_lib.getExpertiseStat(beastStatsDict.getInt("HP"), expertiseHealth, .5f) * (1.0f + (incubationHealthBonus * 0.2f) / 100.0f)); - - int constitutionBonus = getEnhancedSkillStatisticModifierUncapped(beast, "constitution_modified"); - int staminaBonus = getEnhancedSkillStatisticModifierUncapped(beast, "stamina_modified"); - - beastHealth += (constitutionBonus * 8) + (staminaBonus * 2); - - setMaxAttrib(beast, HEALTH, beastHealth); - - beastHealth = 0; - if (hasObjVar(barn, "barnStorage."+storageSlot+".beast.health")) - { - beastHealth = getIntObjVar(barn, "barnStorage."+storageSlot+".beast.health"); - } - - if (beastHealth <= 0) - { - setAttrib(beast, HEALTH, getMaxAttrib(beast, HEALTH)); - } - else - { - if (utils.hasScriptVar(beast, "beast.creationInProgress")) - { - setAttrib(beast, HEALTH, beastHealth); - setAttrib(beast, ACTION, 100); - } - - boolean beastIsDead = false; - if (hasObjVar(barn, "barnStorage."+storageSlot+".beast.isDead")) - { - beastIsDead = getBooleanObjVar(barn, "barnStorage."+storageSlot+".beast.isDead"); - } - - if (beastIsDead) - { - kill(beast); - } - } - - setMaxAttrib(beast, ACTION, 100); - - if (!combat.isInCombat(beast)) - { - int healthRegen = beast_lib.getExpertiseStat(beastStatsDict.getInt("HealthRegen"), expertiseRegen, .5f); - int actionRegen = beast_lib.getExpertiseStat(beastStatsDict.getInt("ActionRegen"), expertiseRegen, .5f); - - setRegenRate(beast, HEALTH, healthRegen); - setRegenRate(beast, ACTION, actionRegen); - } - - float runSpeed = 12; - setBaseRunSpeed(beast, runSpeed); - if (getBaseWalkSpeed(beast) > runSpeed) - { - setBaseWalkSpeed(beast, runSpeed); - } - - armor.removeAllArmorData(beast); - - int intArmor = (int)(beast_lib.getExpertiseStat(beastStatsDict.getInt("Armor"), expertiseArmor, .5f) * (1.0f + incubationArmorBonus / 100.0f)); - - intArmor += (int)getSkillStatisticModifier(beast, "expertise_innate_protection_all"); - - utils.setScriptVar(beast, "beast.display.armor", intArmor); - - if (intArmor >= 0) - { - - String armorCategoryObjVar = armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_ARMOR_CATEGORY; - setObjVar(beast, armorCategoryObjVar, AC_battle); - - String armorLevelObjVar = armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_ARMOR_LEVEL; - setObjVar(beast, armorLevelObjVar, AL_standard); - - String genProtectionObjVar = armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_GENERAL_PROTECTION; - setObjVar(beast, genProtectionObjVar, (float)intArmor); - utils.setScriptVar(beast, armor.SCRIPTVAR_CACHED_GENERAL_PROTECTION, intArmor); - } - - int exp = 0; - if (hasObjVar(barn, "barnStorage."+storageSlot+".beast.experience")) - { - exp = getIntObjVar(barn, "barnStorage."+storageSlot+".beast.experience"); - } - beast_lib.setBeastExperience(beast, exp); - - boolean canLevel = false; - if (hasObjVar(barn, "barnStorage."+storageSlot+".beast.canLevel")) - { - canLevel = getBooleanObjVar(barn, "barnStorage."+storageSlot+".beast.canLevel"); - } - beast_lib.setBeastCanLevel(beast, canLevel); - - int attentionPenaltyReduction = getEnhancedSkillStatisticModifierUncapped(getMaster(beast), "expertise_bm_self_debuff_reduction"); - int attentionPenalty = beast_lib.BASE_ATTENTION_PENALTY + attentionPenaltyReduction; - int hackeyWorkAroundValue = (attentionPenalty / 5) * -1; - - if (hackeyWorkAroundValue > 5) - { - hackeyWorkAroundValue = 5; - } - - if (attentionPenalty < 0 || hackeyWorkAroundValue > 0) - { - buff.applyBuff(getMaster(beast), beast_lib.ATTENTION_PENALTY_DEBUFF + hackeyWorkAroundValue); - } - else - { - beast_lib.removeAttentionPenaltyDebuff(getMaster(beast)); - } - - return; - } - - - public static boolean grantPackageContents(obj_id objectPacked, obj_id player) throws InterruptedException - { - if (!isValidId(objectPacked) || !exists(objectPacked)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!hasObjVar(objectPacked, "tcg.object")) - { - return false; - } - - String objList = getStringObjVar(objectPacked, "tcg.object"); - if (objList == null || objList.equals("")) - { - return false; - } - - String[] staticObjects = split(objList, ':'); - if (staticObjects == null) - { - return false; - } - - for (int i = 0; i < staticObjects.length; i++) - { - testAbortScript(); - obj_id unpackedObject = static_item.createNewItemFunction(staticObjects[i], player); - CustomerServiceLog("tcg", "Packed item: "+ objectPacked + " "+ getName(objectPacked) + " unpacked: "+unpackedObject+" "+getName(unpackedObject)+" for player: "+ player + " "+ getName(player)+"."); - } - - return true; - } - - - public static boolean setRoamingBeastHue(obj_id beast, String palette, int hueIndex) throws InterruptedException - { - if (!isValidId(beast) || !exists(beast)) - { - return false; - } - if (palette == null || palette.length() <= 0) - { - return false; - } - if (hueIndex < 0) - { - return false; - } - - LOG("barnStorage", "setRoamingBeastHue palette: "+ palette + " hueIndex: "+ hueIndex); - - hue.setColor(beast, palette, hueIndex); - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/library/trial.java b/sku.0/sys.server/compiled/game/script/library/trial.java deleted file mode 100644 index 94b667f88..000000000 --- a/sku.0/sys.server/compiled/game/script/library/trial.java +++ /dev/null @@ -1,3616 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.beast_lib; -import script.library.utils; -import script.library.colors; -import script.library.space_dungeon; -import script.library.stealth; -import script.library.attrib; -import script.library.prose; - - -public class trial extends script.base_script -{ - public trial() - { - } - public static final String MESSAGE_SESSION = "messageTo.session"; - public static final String WP_OBJECT = "object/tangible/ground_spawning/patrol_waypoint.iff"; - public static final String PARENT = "parent"; - public static final String ARRAY_CHILDREN = "parent.tempChildren"; - public static final String TEMP_OBJECT = "tempObject"; - public static final String WP_NAME = "wp_name"; - - public static final boolean LOGGING = false; - - public static final String UPLINK_WIN_SIGNAL = "mustafar_uplink_established"; - public static final String DECREPIT_ENTER_SIGNAL = "mustafar_factory_found"; - public static final String DECREPIT_WIN_SIGNAL = "mustafar_factory_fixed"; - public static final String ARMY_WIN_SIGNAL = "mustafar_droidarmy_victory"; - public static final String WORKING_ENTER_SIGNAL = "mustafar_droidfactory_final"; - public static final String WORKING_WIN_SIGNAL = "mustafar_droidfactory_shutdown"; - public static final String VOLCANO_ENTER_SIGNAL = "volcano_arena_pilot"; - public static final String VOLCANO_WIN_SIGNAL = "volcano_arena_victory"; - - public static final String DECREPIT_STF = "mustafar/decrepit_droid_factory"; - public static final string_id SID_NOT_LOCKED = new string_id(DECREPIT_STF, "decrepit_not_locked"); - public static final string_id SID_ACCESS_GRANTED = new string_id(DECREPIT_STF, "access_granted"); - - public static final String DECREPIT_MAIN_HALL = "mainroom27"; - public static final String DECREPIT_ONE_TWO_STAIR = "hall2"; - public static final String DECREPIT_TWO_THREE_STAIR = "hall5"; - public static final String DECREPIT_TRAP_ROOM = "smallroom4"; - public static final String DECREPIT_PRE_TRAP_ROOM = "smallroom5"; - public static final String DECREPIT_ENVIRONMENTAL = "smallroom12"; - public static final String DECREPIT_FIRE_CELL_EXIT = "hall15"; - public static final String DECREPIT_FINAL_ROOM = "centralroom28"; - public static final String[] FIRE_CELLS = - { - "mediumroom10","smallroom11","smallroom12","hall13" - }; - - public static final String SECOND_ACCESS_BASE = "second_floor_access"; - public static final String ACCESS_CODE = SECOND_ACCESS_BASE+".code"; - public static final String RESET_CODE = SECOND_ACCESS_BASE+".reset"; - public static final int RESET_TIMER = 20; - public static final int SENSOR_RESET_TIME = 4; - - public static final String TRAP_STATE = "trap_state"; - public static final String SENSOR_STATE = "sensor_state"; - public static final String FIRE_CELL_STATE = "fire_cell_state"; - public static final String POWER_CORE_STATE = "power_core_state"; - public static final String GUARDIAN_LOCK_STATE = "guardian_lock_state"; - public static final String DECREPIT_VICTORY_STATE = "decrepit_victory_state"; - - public static final String WORKING_STF = "mustafar/working_droid_factory"; - public static final string_id TWINS_RESPAWN = new string_id (WORKING_STF, "twin_respawn"); - public static final string_id TWINS_DEFEATED = new string_id (WORKING_STF, "twin_defeated"); - public static final string_id TWINS_LOCK_ACTIVE = new string_id (WORKING_STF, "access_denied"); - public static final string_id TWINS_KILL_CLUE = new string_id (WORKING_STF, "twin_kill_clue"); - - public static final string_id WORKING_DEVISTATOR_DEFEATED = new string_id (WORKING_STF, "devistator_defeated"); - public static final string_id WORKING_INHIBITOR_NOCHARGE = new string_id (WORKING_STF, "inhibitor_lost_charge"); - public static final string_id WORKING_INHIBITOR_RECHARGE = new string_id (WORKING_STF, "inhibitor_recharging"); - public static final string_id WORKING_INHIBITOR_INACTIVE = new string_id (WORKING_STF, "inhibitor_inactive"); - public static final string_id WORKING_INHIBITOR_COLLECT = new string_id (WORKING_STF, "inhibitor_collect"); - public static final string_id WORKING_INHIBITOR_TAKEN = new string_id (WORKING_STF, "inhibitor_taken"); - public static final string_id WORKING_RRU_OP_CLUE = new string_id (WORKING_STF, "rru_clue"); - public static final string_id WORKING_RRU_INACTIVE = new string_id (WORKING_STF, "rru_inactive"); - public static final string_id WORKING_RRU_ACTIVE = new string_id (WORKING_STF, "rru_active"); - public static final string_id WORKING_RRU_FALTER = new string_id (WORKING_STF, "rru_falter"); - public static final string_id WORKING_RRU_RECHARGE = new string_id (WORKING_STF, "rru_recharge"); - public static final string_id WORKING_MDE_DEFEATED = new string_id (WORKING_STF, "mde_defeated"); - public static final string_id WORKING_MDE_TAUNT = new string_id (WORKING_STF, "mde_taunt"); - public static final string_id WORKING_DOOM_DEFEATED = new string_id (WORKING_STF, "doom_defeated"); - public static final string_id WORKING_DOOM_FAILURE = new string_id (WORKING_STF, "doom_failure"); - public static final string_id WORKING_HK47_TAUNT = new string_id (WORKING_STF, "hk47_taunt"); - public static final string_id WORKING_DUALITY_APPLY = new string_id (WORKING_STF, "duality_applied"); - public static final string_id WORKING_IMBALANCE_APPLY = new string_id (WORKING_STF, "imbalance_applied"); - public static final string_id WORKING_IMBALANCE_FADE = new string_id (WORKING_STF, "imbalance_fade"); - public static final string_id WORKING_OBSERVER_DETONATE = new string_id (WORKING_STF, "observer_detonate"); - - public static final String WORKING_MAIN_HALL = "mainroom27"; - public static final String WORKING_ONE_TWO_STAIR = "hall2"; - public static final String WORKING_TWO_THREE_STAIR = "hall7"; - public static final String WORKING_DE_HALL = "hall13"; - public static final String WORKING_MASTER_CONTROL = "centralroom28"; - - public static final String WORKING_CLONER_EXIT = "mdeClonerExit"; - - public static final String OBJECT_INHIBITOR = "object/tangible/dungeon/mustafar/working_droid_factory/inhibitor_storage.iff"; - public static final String OBJECT_REACTIVE_REPAIR = "object/tangible/dungeon/mustafar/working_droid_factory/reactive_repair_module.iff"; - public static final String OBJECT_DE_CLONER = "object/tangible/dungeon/mustafar/working_droid_factory/rapid_assembly_station.iff"; - public static final String OBJECT_DECTRUCT_PILE = "object/tangible/dungeon/mustafar/working_droid_factory/radioactive_pile.iff"; - - public static final String WORKING_AUREK_KILLED = "isAurekKilled"; - public static final String WORKING_BESH_KILLED = "isBeshKilled"; - public static final String WORKING_AUREK_BESH_ENGAGED = "isAurekBeckEngaged"; - public static final String AUREK_HEALTH = "health.aurek"; - public static final String BESH_HEALTH = "health.besh"; - - public static final String WORKING_DEVISTATOR_KILLED = "isDevistatorKilled"; - public static final String WORKING_DEVISTATOR_ENGAGED = "isDevistatorEngaged"; - public static final String WORKING_INHIBITOR_TRACKER = "currentInhibitorSession"; - public static final String WORKING_RRU_STATE = "rapidRepairUnitState"; - - public static final String WORKING_MDE_KILLED = "isMasterDroidEngineerKilled"; - public static final String WORKING_MDE_ENGAGED = "isMdeEngaged"; - public static final String WORKING_MDE_MOB = "isMdeMob"; - public static final String WORKING_ASSEMBLY_STAGE = "eventStage"; - public static final String WORKING_MDE_REVIVED = "wasRevived"; - - public static final String WORKING_POWER_SHUT_DOWN = "isPowerCoreOff"; - - public static final String WORKING_DOOM_BRINGER_KILLED = "isDoomBringerKilled"; - public static final String WORKING_ACTIVE_HOD = "doom.activeHandOfDoom"; - public static final String WORKING_PRIMARY_HAND = "doom.primaryHand"; - public static final String WORKING_HOD_TARGET = "doom.objectiveTarget"; - - public static final String WORKING_HK_SPAWNED = "hk.isSpawned"; - public static final String WORKING_HK_BOMB = "hk.isDetonated"; - - public static final String WORKING_AUREKBESH_KILL_TIME = "aurekBeshKillTime"; - public static final int WORKING_AUREKBESH_RESPAWN_DELAY = 15; - - public static final boolean WORKING_LOGGING = false; - - public static final boolean UPLINK_LOGGING = false; - public static final String UPLINK_STF = "mustafar/uplink_cave"; - public static final String UPLINK_VICTORY_STATE = "isUplinkEstablished"; - public static final String UPLINK_DATA = "datatables/dungeon/mustafar_trials/link_establish/link_event_data.iff"; - public static final String RELAY_OBJECT = "object/tangible/dungeon/mustafar/uplink_trial/relay_object.iff"; - public static final String UPLINK_ESTABLISH_EFFECT = "blah.cef"; - public static final String UPLINK_ROOM = "mainroom"; - public static final String UPLINK_ACTIVE = "isUplinkTrialActive"; - - public static final string_id UPLINK_FOREMAN_SPAWN = new string_id(UPLINK_STF, "foreman_spawn"); - - public static final boolean VALLEY_LOGGING = false; - public static final String VALLEY_DATA = "datatables/dungeon/mustafar_trials/valley_battlefield/valley_event_data.iff"; - public static final String BATTLEFIELD_VICTORY_STATE = "armyDefeated"; - public static final String BATTLEFIELD_DROID_ARMY = "isArmy"; - public static final String BATTLEFIELD_MINER = "isMiner"; - public static final String BATTLEFIELD_COMMANDER_KILLED = "isCommanderKilled"; - public static final String BATTLEFIELD_GENERATOR_DESTROYED = "isGeneratorDestoryed"; - public static final String BATTLEFIELD_COMMANDER_LOGIC = "assaultFinal"; - public static final String BATTLEFIELD_DROID_CORPSE = "droidCorpse"; - - public static final String BATTLEFIELD_STF = "mustafar/valley_battlefield"; - public static final string_id BATTLEFIELD_GENERATOR_DEAD = new string_id(BATTLEFIELD_STF, "generator_destroyed"); - public static final string_id BATTLEFIELD_COMMANDER_DIED = new string_id(BATTLEFIELD_STF, "commander_killed"); - public static final string_id BATTLEFIELD_CMNDR_INTRO = new string_id(BATTLEFIELD_STF, "commander_intro"); - public static final string_id BATTLEFIELD_WIN_MESSAGE = new string_id(BATTLEFIELD_STF, "battlefield_win_message"); - public static final string_id BATTLEFIELD_LOSE_MESSAGE = new string_id(BATTLEFIELD_STF, "battlefield_lose_message"); - public static final string_id BATTLEFIELD_LOSE_1 = new string_id(BATTLEFIELD_STF, "about_to_lose_1"); - public static final string_id BATTLEFIELD_LOSE_2 = new string_id(BATTLEFIELD_STF, "about_to_lose_2"); - public static final string_id BATTLEFIELD_LOSE_3 = new string_id(BATTLEFIELD_STF, "about_to_lose_3"); - - public static final int BATTLEFIELD_WAVE_DELAY = 150; - public static final int BATTLEFIELD_COMM_REZ_DELAY = 18; - - public static final boolean VOLCANO_LOGGING = false; - public static final String VOLCANO_STF = "mustafar/volcano_battlefield"; - public static final string_id VOLCANO_TASKMASTER_STRENGTHEN = new string_id(VOLCANO_STF, "taskmaster_strengthen"); - public static final string_id VOLCANO_CYM_BEETLE_NOTIFY = new string_id(VOLCANO_STF, "four_summon_add"); - public static final string_id VOLCANO_OPP_ADD_NOTIFY = new string_id(VOLCANO_STF, "five_summon_trio"); - public static final string_id VOLCANO_OPP_MIDGUARD = new string_id(VOLCANO_STF, "five_summon_midguard"); - public static final string_id VOLCANO_HK_SUMMON_AK = new string_id(VOLCANO_STF, "hk_summon_walker"); - public static final string_id VOLCANO_HK_TAUNT = new string_id(VOLCANO_STF, "hk_prefight_taunt"); - - public static final String VOLCANO_THREE_IS_BOSS = "isCommander"; - public static final String VOLCANO_THREE_IS_CORPSE = "isCorpse"; - - public static final String VOLCANO_FOUR_IS_BEETLE = "isKubazaBeetle"; - - public static final String VOLCANO_FINAL_IS_CORPSE = "isCorpse"; - - public static final boolean MONSTER_LOGGING = false; - public static final String MONSTER_DATA = "datatables/dungeon/mustafar_trials/sher_kar/sher_kar_data"; - public static final String MONSTER_STF = "mustafar/sher_kar"; - public static final String MONSTER_AREA = "r1"; - public static final String MONSTER_WP = "spawn_point"; - public static final String MONSTER_SHER_KAR = "sherKar.id"; - public static final String MONSTER_KARLING = "som_sherkar_karling"; - public static final String MONSTER_PRAETORIAN = "som_sherkar_praetorian"; - public static final String MONSTER_SYMBIOT = "som_sherkar_symbiot"; - - public static final string_id MONSTER_ENRAGE_WARNING = new string_id(MONSTER_STF, "enrage_warning"); - public static final string_id MONSTER_SK_DEFEATED = new string_id(MONSTER_STF, "sk_defeated"); - - public static final String SND_POWERUP = "clienteffect/snd_forcefield_powerup.cef"; - public static final String SND_POWERDOWN = "clienteffect/snd_forcefield_powerdown.cef"; - public static final String PRT_CYM_DISEASE = "clienteffect/mus_cym_disease.cef"; - public static final String PRT_CYM_POISON = "clienteffect/mus_cym_poison.cef"; - public static final String PRT_DROID_HEAL = "clienteffect/mus_droid_heal.cef"; - public static final String PRT_DROID_REVIVE = "clienteffect/mus_droid_revive.cef"; - public static final String PRT_RELAY_ACTIVATE = "clienteffect/mus_relay_activate.cef"; - public static final String PRT_RELAY_CREATE = "clienteffect/mus_relay_create.cef"; - public static final String PRT_KUBAZA_EXPLODE = "clienteffect/exp_ap_landmine.cef"; - public static final String PRT_KUBAZA_WARNING = "clienteffect/mus_kubaza_warning.cef"; - public static final String PRT_INVULN_SHIELD = "appearance/pt_flash_shield.prt"; - public static final String PRT_TRAP_STUN = "clienteffect/mus_relay_activate.cef"; - public static final String PRT_WORKING_REPAIR_REZ = "clienteffect/mus_relay_create.cef"; - public static final String PRT_WORKING_REPAIR_COMPILE = "clienteffect/mus_relay_create.cef"; - public static final String PRT_WORKING_DUALITY_EXPLOSION = "appearance/pt_cmndo_shock_grenade5.prt"; - public static final String PRT_WORKING_HK_BOOM_1 = "clienteffect/avatar_explosion_01.cef"; - public static final String PRT_WORKING_HK_BOOM_2 = "clienteffect/avatar_explosion_02.cef"; - public static final String PRT_WORKING_HK_BOOM_3 = "clienteffect/avatar_room_explosion.cef"; - public static final String PRT_VOLCANO_WAVE_PRE = "appearance/pt_blast_wave_build_up.prt"; - public static final String PRT_VOLCANO_WAVE_EXE = "appearance/pt_blast_wave.prt"; - public static final String PRT_VOLCANO_AIR_PRE = "appearance/pt_rocket_barrage_wind_up.prt"; - public static final String PRT_VOLCANO_AIR_EXE = "appearance/pt_rocket_barrage.prt"; - public static final String PRT_VOLCANO_CONE_PRE = "appearance/pt_large_beam_warm_up.prt"; - public static final String PRT_VOLCANO_CONE_EXE = "appearance/pt_large_beam.prt"; - public static final String PRT_VOLCANO_YT_LANDING = "appearance/must_smoke_plume01.prt"; - public static final String PRT_SHER_KAR_CAVE_IN = "clienteffect/cave_in_roof.cef"; - - public static final String MUS_BATTLEFIELD_DROID_ARMY_INTRO = "sound/mus_mustafar_droid_invasion_intro.snd"; - public static final String MUS_VOLCANO_HK_INTRO = "sound/mus_mustafar_hk47_intro.snd"; - public static final String MUS_MUST_QUEST_WIN = "sound/mus_mustafar_quest_success.snd"; - public static final String MUS_MUST_QUEST_FAIL = "sound/mus_mustafar_quest_fail.snd"; - - public static final int HP_DECREPIT_COLONEL = 145000; - public static final int HP_DECREPIT_GUARDIAN = 185250; - - public static final int HP_WORKING_AUREK_BESH = 448220; - public static final int HP_WORKING_DEVISTATOR = 635425; - public static final int HP_WORKING_MDE = 385225; - public static final int HP_WORKING_FIXER_ONE = 855965; - public static final int HP_WORKING_DOOM_HAND = 125000; - public static final int HP_WORKING_DOOM_BRINGER = 705385; - - public static final int HP_DOOM_TARGET = 200000; - public static final int HP_WORKING_ASSEMBLY = 50000; - - public static final int HP_BATTLEFIELD_GENERATOR = 65000; - - public static final int HP_VOLCANO_ONE_GUARD = 65000; - public static final int HP_VOLCANO_ONE_BOSS = 545000; - - public static final int HP_VOLCANO_TWO_GUARD = 95250; - public static final int HP_VOLCANO_TWO_BOSS = 655280; - - public static final int HP_VOLCANO_THREE_GUARD = 33500; - public static final int HP_VOLCANO_THREE_RISEN = 60250; - public static final int HP_VOLCANO_THREE_BOSS = 655250; - - public static final int HP_VOLCANO_FOUR_GUARD = 3000; - public static final int HP_VOLCANO_FOUR_BOSS = 950485; - - public static final int HP_VOLCANO_FIVE_GUARD = 50000; - public static final int HP_VOLCANO_FIVE_MIDGUARD = 100000; - public static final int HP_VOLCANO_FIVE_BOSS = 220000; - - public static final int HP_VOLCANO_HK_SOLDIER = 14000; - public static final int HP_VOLCANO_HK_SQUAD_LEADER = 20000; - public static final int HP_VOLCANO_HK_RISEN_GUARD = 22525; - public static final int HP_VOLCANO_HK_BEETLE = 9000; - public static final int HP_VOLCANO_HK_SEPTIPOD = 75250; - public static final int HP_VOLCANO_HK_CWW = 55855; - public static final int HP_VOLCANO_HK47 = 545852; - - public static final int HP_SHER_KAR = 885000; - public static final int HP_SHER_KAR_CONSORT = 225000; - public static final int HP_SHER_KARLING = 65400; - public static final int HP_SHER_KAR_PRAETORIAN = 120000; - public static final int HP_SHER_KAR_LIFESAPPER = 95000; - - public static final int HP_AKXVA_NANDINA = 245440; - public static final int HP_AXKVA_GORVO = 614525; - public static final int HP_AXKVA_LILLI_HI = 599258; - public static final int HP_AXKVA_KIMARU = 818125; - public static final int HP_AXKVA_SUIN = 1012400; - public static final int HP_AXKVA = 1305858; - - public static final int HP_EXAR_OPEN = 515325; - public static final int HP_EXAR_MINDER = 623145; - public static final int HP_EXAR_LURESH = 355245; - public static final int HP_EXAR_VINRITH = 255454; - public static final int HP_EXAR_CLOSED = 1485235; - - public static final int HP_UNCLE_JOE = 818125; - public static final int HP_JOES_ADDS = 355325; - - public static final int TIME_UPLINK_WIN = 60*60*2; - public static final int TIME_DECREPIT_ADD = 60*90*1; - public static final int TIME_DECREPIT_WIN = 60*60*3; - public static final int TIME_BATTLEFIELD_WIN = 60*60*3; - public static final int TIME_WORKING_ADD = 60*60*2; - public static final int TIME_WORKING_WIN = 60*60*6; - public static final int TIME_VOLCANO_ADD = 60*60*2; - public static final int TIME_VOLCANO_WIN = 60*60*12; - public static final int TIME_MONSTER_WIN = 60*60*20; - - public static final String[] HEROIC_TOKENS = - { - "item_heroic_token_axkva_01_01", - "item_heroic_token_tusken_01_01", - "item_heroic_token_ig88_01_01", - "item_heroic_token_black_sun_01_01", - "item_heroic_token_exar_01_01", - "item_heroic_token_echo_base_01_01", - "item_battlefield_rebel_token_massassi_isle", - "item_battlefield_imperial_token_massassi_isle", - "item_battlefield_rebel_token_battlefield2", - "item_battlefield_imperial_token_battlefield2", - "item_battlefield_rebel_token_battlefield3", - "item_battlefield_imperial_token_battlefield3", - "item_battlefield_rebel_token_battlefield4", - "item_battlefield_imperial_token_battlefield4", - "item_pgc_token_01", - "item_pgc_token_02", - "item_pgc_token_03" - }; - - public static final int NUM_HEROIC_TOKEN_TYPES = 17; - - public static final String KIMARU_HATE_LIST = "kimaru_hate_list"; - - public static final String WP_DATA = "nearPoint"; - public static final String PROT_CHILD = "protected_data"; - public static final String PROT_CHILD_ARRAY = "protected_data.child_array"; - public static final String PROT_CHILD_KEY_LIST = "protected_data.key_list"; - public static final String PATROL_PATH_FULL_DATA = "all_instance_patrol_path"; - public static final String SEQUENCER_PATH_DATA = "sequencer_path_data"; - - - public static void initializeBox(obj_id self) throws InterruptedException - { - int[] tokenTypes = new int[trial.NUM_HEROIC_TOKEN_TYPES]; - - for (int i = 0; i < trial.NUM_HEROIC_TOKEN_TYPES; i++) - { - testAbortScript(); - tokenTypes[i] = 0; - } - - setObjVar(self, "item.set.tokens_held", tokenTypes); - - return; - } - - - public static void verifyBox(obj_id self) throws InterruptedException - { - int[] tokenTypes = getIntArrayObjVar(self, "item.set.tokens_held"); - - if (tokenTypes == null) - { - initializeBox(self); - } - - else if (tokenTypes.length < trial.NUM_HEROIC_TOKEN_TYPES) - { - int[] newTokenTypes = new int[trial.NUM_HEROIC_TOKEN_TYPES]; - - for (int i = 0; i < trial.NUM_HEROIC_TOKEN_TYPES; i++) - { - testAbortScript(); - newTokenTypes[i] = 0; - } - - for (int i = 0; i < tokenTypes.length; i++) - { - testAbortScript(); - newTokenTypes[i] = tokenTypes[i]; - } - - setObjVar(self, "item.set.tokens_held", newTokenTypes); - } - - return; - } - - - public static String generateNewKeyCode(obj_id dungeon) throws InterruptedException - { - int code = rand(100000,999999); - String stringCode = Integer.toString(code); - int endTime = getGameTime() + RESET_TIMER; - - utils.setScriptVar(dungeon, ACCESS_CODE, stringCode); - utils.setScriptVar(dungeon, RESET_CODE, endTime); - messageTo(dungeon, "codeResetOccured", null, 0, false); - - return stringCode; - } - - - public static String initializeCode(obj_id dungeon) throws InterruptedException - { - int code = 0; - String stringCode = Integer.toString(code); - int endTime = 0; - - utils.setScriptVar(dungeon, ACCESS_CODE, stringCode); - utils.setScriptVar(dungeon, RESET_CODE, endTime); - - return stringCode; - } - - - public static String getKeyCode(obj_id dungeon) throws InterruptedException - { - dungeon = getTop(dungeon); - - if (!utils.hasScriptVar(dungeon, ACCESS_CODE)) - { - return generateNewKeyCode(dungeon); - } - else - { - return utils.getStringScriptVar(dungeon, ACCESS_CODE); - } - } - - - public static int getResetTime(obj_id dungeon) throws InterruptedException - { - dungeon = getTop(dungeon); - - if (!utils.hasScriptVar(dungeon, RESET_CODE)) - { - generateNewKeyCode(dungeon); - return utils.getIntScriptVar(dungeon, RESET_CODE); - } - else - { - return utils.getIntScriptVar(dungeon, RESET_CODE); - } - } - - - public static void doCountdownTimerFlyText(obj_id terminal, int timer) throws InterruptedException - { - dictionary dict = new dictionary(); - - switch (timer) - { - case 10: - showFlyText( terminal, new string_id(DECREPIT_STF, "ten"), 1.0f, colors.GREEN ); - dict.put("timer", 9); - messageTo(terminal, "showStatusFlyText", dict, 1, false); - return; - case 9: - showFlyText( terminal, new string_id(DECREPIT_STF, "nine"), 1.0f, colors.GREEN ); - dict.put("timer", 8); - messageTo(terminal, "showStatusFlyText", dict, 1, false); - return; - case 8: - showFlyText( terminal, new string_id(DECREPIT_STF, "eight"), 1.0f, colors.GREEN ); - dict.put("timer", 7); - messageTo(terminal, "showStatusFlyText", dict, 1, false); - return; - case 7: - showFlyText( terminal, new string_id(DECREPIT_STF, "seven"), 1.0f, colors.GREEN ); - dict.put("timer", 6); - messageTo(terminal, "showStatusFlyText", dict, 1, false); - return; - case 6: - showFlyText( terminal, new string_id(DECREPIT_STF, "six"), 1.0f, colors.GREEN ); - dict.put("timer", 5); - messageTo(terminal, "showStatusFlyText", dict, 1, false); - return; - case 5: - showFlyText( terminal, new string_id(DECREPIT_STF, "five"), 1.0f, colors.GREEN ); - dict.put("timer", 4); - messageTo(terminal, "showStatusFlyText", dict, 1, false); - return; - case 4: - showFlyText( terminal, new string_id(DECREPIT_STF, "four"), 1.0f, colors.GREEN ); - dict.put("timer", 3); - messageTo(terminal, "showStatusFlyText", dict, 1, false); - return; - case 3: - showFlyText( terminal, new string_id(DECREPIT_STF, "three"), 1.0f, colors.GREEN ); - dict.put("timer", 2); - messageTo(terminal, "showStatusFlyText", dict, 1, false); - return; - case 2: - showFlyText( terminal, new string_id(DECREPIT_STF, "two"), 1.0f, colors.GREEN ); - dict.put("timer", 1); - messageTo(terminal, "showStatusFlyText", dict, 1, false); - return; - case 1: - showFlyText( terminal, new string_id(DECREPIT_STF, "one"), 1.0f, colors.GREEN ); - dict.put("timer", 0); - messageTo(terminal, "showStatusFlyText", dict, 1, false); - return; - - } - - } - - - public static boolean isTrapActive(obj_id dungeon) throws InterruptedException - { - dungeon = getTop(dungeon); - - boolean triggered = true; - if (utils.hasScriptVar(dungeon, TRAP_STATE)) - { - return utils.getBooleanScriptVar(dungeon, TRAP_STATE); - } - else - { - return false; - } - } - - - public static boolean isTrapPrimed(obj_id dungeon) throws InterruptedException - { - dungeon = getTop(dungeon); - - obj_id[] sensors = getObjectsInDungeonWithScript(dungeon, "theme_park.dungeon.mustafar_trials.decrepit_droid_factory.trap_terminal_scanner"); - - if (sensors == null || sensors.length == 0) - { - doLogging("isTrapPrimed", "Sensor list was null or empty"); - return false; - } - boolean primed = false; - for (int i=0; i 0) - { - for (int k=0; k 0) - { - return convertedArray; - } - else - { - return null; - } - } - - - public static obj_id[] getValidTargetsInDungeon(obj_id dungeon) throws InterruptedException - { - obj_id[] players = getPlayersInDungeon(dungeon); - obj_id[] pets = getObjectsInDungeonWithScript(dungeon, "ai.pet"); - - Vector validTargets = new Vector(); - validTargets.setSize(0); - - if (players != null && players.length > 0) - { - for (int i=0; i 0) - { - for (int q=0; q 0) - { - for (int k=0; k 0) - { - for (int k=0; k 0) - { - for (int k=0; k 0) - { - for (int k=0; k 0) - { - for (int k=0; k 0) - { - for (int k=0; k 0) - { - for (int k=0; k 0) - { - for (int i=0; i 0) - { - for (int k=0; k -1; q--) - { - testAbortScript(); - newPpl.add(ppl[q]); - } - - for (int r=0; r 0) - { - dictionary path_data = utils.hasScriptVar(kitParent, trial.SEQUENCER_PATH_DATA) ? utils.getDictionaryScriptVar(kitParent, trial.SEQUENCER_PATH_DATA) : null; - - if (path_data != null && !path_data.isEmpty()) - { - utils.setScriptVar(npc, trial.SEQUENCER_PATH_DATA, utils.getDictionaryScriptVar(kitParent, trial.SEQUENCER_PATH_DATA)); - } - - setObjVar(npc, "patrol_path", patrol); - setHibernationDelay(npc, 3600.0f); - removeObjVar(npc, gcw.GCW_ENTERTAINMENT_FLAG); - aiEquipPrimaryWeapon(npc); - } - else - { - - utils.setScriptVar(patrolPoint, gcw.GCW_NPC_SCRIPTVAR_FLAG, npc); - } - - attachScript(npc, "systems.dungeon_sequencer.ai_controller"); - - return npc; - } - - - public static boolean addNonInstanceFactionParticipant(obj_id who, obj_id target) throws InterruptedException - { - if (!isIdValid(who) || !exists(who) || !isPlayer(who) || !isIdValid(target) || !exists(target)) - { - return false; - } - - if (gcw.getGcwCityInvasionPhase(target) <= 0) - { - CustomerServiceLog("gcw_city_invasion", "trial.addNonInstanceFactionParticipant: Player: "+who+" could not be added as a participant because the parent object did not have vars for combat or construction phase."); - return false; - } - - obj_id parent = trial.getParent(target); - - if (!isIdValid(parent) || !exists(parent)) - { - return false; - } - - obj_id lastParent = null; - - while (!hasScript(parent, "systems.dungeon_sequencer.sequence_controller") && parent != lastParent) - { - testAbortScript(); - lastParent = parent; - parent = trial.getParent(parent); - - if (!isIdValid(parent) || !exists(parent)) - { - return false; - } - } - - String participantScriptVar = ""; - - if (factions.isRebelorRebelHelper(who)) - { - participantScriptVar = "gcw.rebel.participants"; - } - else if (factions.isImperialorImperialHelper(who)) - { - participantScriptVar = "gcw.imperial.participants"; - } - - if (participantScriptVar == null || participantScriptVar.length() < 1) - { - CustomerServiceLog("gcw_city_invasion", "trial.addNonInstanceFactionParticipant: Player: "+who+" did not have the faction affiliation needed to be added to a participant list."); - return false; - } - - Vector sideParticipants = new Vector(); - sideParticipants.setSize(0); - - if (utils.hasScriptVar(parent, participantScriptVar)) - { - sideParticipants = utils.getResizeableObjIdArrayScriptVar(parent, participantScriptVar); - - if (sideParticipants != null && utils.isElementInArray(sideParticipants, who)) - { - CustomerServiceLog("gcw_city_invasion", "trial.addNonInstanceFactionParticipant: Player: "+who+" was already on the list as a paricipant so the operation was aborted."); - return false; - } - } - - utils.addElement(sideParticipants, who); - utils.setScriptVar(parent, participantScriptVar, sideParticipants); - return true; - } - - - public static boolean removeNonInstanceFactionParticipant(obj_id who, obj_id target) throws InterruptedException - { - if (!isIdValid(who) || !exists(who) || !isPlayer(who) || !isIdValid(target) || !exists(target)) - { - return false; - } - - obj_id parent = trial.getParent(target); - - if (!isIdValid(parent) || !exists(parent)) - { - return false; - } - - obj_id lastParent = null; - - while (!hasScript(parent, "systems.dungeon_sequencer.sequence_controller") && parent != lastParent) - { - testAbortScript(); - lastParent = parent; - parent = trial.getParent(parent); - - if (!isIdValid(parent) || !exists(parent)) - { - return false; - } - } - - String participantScriptVar = ""; - - if (factions.isRebelorRebelHelper(who)) - { - participantScriptVar = "gcw.rebel.participants"; - } - else if (factions.isImperialorImperialHelper(who)) - { - participantScriptVar = "gcw.imperial.participants"; - } - - if (participantScriptVar == null || participantScriptVar.length() < 1) - { - return false; - } - - Vector sideParticipants = new Vector(); - sideParticipants.setSize(0); - - if (utils.hasScriptVar(parent, participantScriptVar)) - { - sideParticipants = utils.getResizeableObjIdArrayScriptVar(parent, participantScriptVar); - - if (sideParticipants != null && !utils.isElementInArray(sideParticipants, who)) - { - return false; - } - } - - LOG("participant_credit", "removeNonInstanceFactionParticipant green light to remove from list: "+participantScriptVar); - LOG("participant_credit", "removeNonInstanceFactionParticipant sideParticipants.length: "+sideParticipants.size()); - - utils.removeElement(sideParticipants, who); - - if (sideParticipants.size() == 0) - { - utils.removeScriptVar(parent, participantScriptVar); - return true; - } - else if (utils.setScriptVar(parent, participantScriptVar, sideParticipants)) - { - LOG("participant_credit", "removeNonInstanceFactionParticipant this should have worked. sideParticipants.length: "+sideParticipants.size()); - return true; - } - - LOG("participant_credit", "removeNonInstanceFactionParticipant failed to set script var"); - - return false; - } - - - public static boolean isNonInstanceFactionParticipant(obj_id who, obj_id target) throws InterruptedException - { - LOG("participant_credit", "isNonInstanceFactionParticipant init for who: "+who); - - if (!isIdValid(who) || !exists(who) || !isPlayer(who) || !isIdValid(target) || !exists(target)) - { - return false; - } - - obj_id parent = trial.getParent(target); - - if (!isIdValid(parent) || !exists(parent)) - { - return false; - } - - LOG("participant_credit", "isNonInstanceFactionParticipant parent of: "+target+" is "+parent); - - obj_id lastParent = null; - - while (!hasScript(parent, "systems.dungeon_sequencer.sequence_controller") && parent != lastParent) - { - testAbortScript(); - lastParent = parent; - parent = trial.getParent(parent); - - if (!isIdValid(parent) || !exists(parent)) - { - return false; - } - } - - String participantScriptVar = ""; - - if (factions.isRebelorRebelHelper(who)) - { - participantScriptVar = "gcw.rebel.participants"; - } - else if (factions.isImperialorImperialHelper(who)) - { - participantScriptVar = "gcw.imperial.participants"; - } - LOG("participant_credit", "isNonInstanceFactionParticipant participantScriptVar: "+participantScriptVar); - - if (participantScriptVar == null || participantScriptVar.length() < 1) - { - return false; - } - - Vector sideParticipants = new Vector(); - sideParticipants.setSize(0); - - if (utils.hasScriptVar(parent, participantScriptVar)) - { - sideParticipants = utils.getResizeableObjIdArrayScriptVar(parent, participantScriptVar); - - if (sideParticipants != null && !utils.isElementInArray(sideParticipants, who)) - { - return false; - } - - LOG("participant_credit", "isNonInstanceFactionParticipant sideParticipants.length: "+sideParticipants.size()); - - for (int i = 0; i < sideParticipants.size(); i++) - { - testAbortScript(); - if (!isValidId(((obj_id)(sideParticipants.get(i))))) - { - LOG("participant_credit", "isNonInstanceFactionParticipant sideParticipant not valid: "+((obj_id)(sideParticipants.get(i)))); - continue; - } - LOG("participant_credit", "isNonInstanceFactionParticipant valid sideParticipant: "+((obj_id)(sideParticipants.get(i)))); - - if (((obj_id)(sideParticipants.get(i))) != who) - { - LOG("participant_credit", "isNonInstanceFactionParticipant sideParticipant: "+((obj_id)(sideParticipants.get(i)))+" not equal to "+who); - continue; - } - return true; - } - } - return false; - } - - - public static Vector getNonInstanceFactionParticipants(obj_id sequencer, int faction) throws InterruptedException - { - if (!isIdValid(sequencer) || !exists(sequencer)) - { - CustomerServiceLog("gcw_city_invasion", "trial.getNonInstanceFactionParticipants: Sequencer was invalid. Returning NULL."); - return null; - } - - if (!hasScript(sequencer, "systems.dungeon_sequencer.sequence_controller")) - { - CustomerServiceLog("gcw_city_invasion", "trial.getNonInstanceFactionParticipants: Sequencer did not have the sequence controller script. Returning NULL."); - return null; - } - - String participantScriptVar = ""; - - if (factions.FACTION_FLAG_REBEL == faction) - { - participantScriptVar = "gcw.rebel.participants"; - } - else if (factions.FACTION_FLAG_IMPERIAL == faction) - { - participantScriptVar = "gcw.imperial.participants"; - } - - if (participantScriptVar == null || participantScriptVar.length() <= 0) - { - CustomerServiceLog("gcw_city_invasion", "trial.getNonInstanceFactionParticipants: Participant list not found. Returning NULL."); - return null; - } - - if (utils.hasScriptVar(sequencer, participantScriptVar)) - { - return utils.getResizeableObjIdArrayScriptVar(sequencer, participantScriptVar); - } - - return null; - } - - - public static void clearNonInstanceFactionParticipants(obj_id sequencer) throws InterruptedException - { - if (!isIdValid(sequencer) || !exists(sequencer)) - { - CustomerServiceLog("gcw_city_invasion", "trial.clearNonInstanceFactionParticipants: Sequencer invalid. Aborting."); - return; - } - - if (!hasScript(sequencer, "systems.dungeon_sequencer.sequence_controller")) - { - CustomerServiceLog("gcw_city_invasion", "trial.clearNonInstanceFactionParticipants: Sequencer did not have sequence controller script. Aborting."); - return; - } - - utils.removeScriptVar(sequencer, "gcw.rebel.participants"); - utils.removeScriptVar(sequencer, "gcw.imperial.participants"); - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/utils.java b/sku.0/sys.server/compiled/game/script/library/utils.java deleted file mode 100644 index 6ca8d464a..000000000 --- a/sku.0/sys.server/compiled/game/script/library/utils.java +++ /dev/null @@ -1,10190 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.util.Arrays; -import java.lang.System; -import java.lang.Math; - -import java.util.Arrays; -import java.util.Enumeration; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Vector; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; - -import script.script_entry; - -import script.library.player_structure; -import script.library.healing; -import script.library.ai_lib; -import script.library.pclib; -import script.library.armor; -import script.library.chat; -import script.library.performance; -import script.library.trial; -import script.library.cloninglib; -import script.library.static_item; - - -public class utils extends script.base_script -{ - public utils() - { - } - public static final String VERSION = "v0.01.00"; - - public static final String VAR_OWNER = "owner"; - public static final String VAR_COOWNERS = "coowners"; - - public static final String SLOT_INVENTORY = "inventory"; - public static final String SLOT_DATAPAD = "datapad"; - public static final String SLOT_HANGAR = "hangar"; - public static final String SLOT_BANK = "bank"; - public static final String SLOT_MISSION_BAG = "mission_bag"; - - public static final String FREE_TRIAL = "free_trial"; - public static final String TIP = FREE_TRIAL+".tip"; - public static final String TIP_OUT_NUM = TIP + ".tip_out_num"; - public static final String TIP_OUT_AMMOUNT = TIP + ".tip_out_ammount"; - public static final String TIP_IN_NUM = TIP + ".tip_in_num"; - public static final String TIP_IN_AMMOUNT = TIP + ".tip_in_ammount"; - public static final String TIP_IN_THACK = TIP + ".tip_in_timeHack"; - public static final String TIP_OUT_THACK = TIP + ".tip_out_timeHack"; - - public static final String TRIAL_STRUCTURE = FREE_TRIAL+".trial_structure"; - - public static final int TIP_NUM_MAX = 25; - public static final int TIP_AMT_MAX = 100000; - - public static final String NO_TRADE_SCRIPT = "item.special.nomove"; - - public static final String CTS_OBJVAR_HISTORY = "ctsRetroHistory"; - - public static final int BIT_LIST_SIZE = 32; - - public static final string_id SID_OBJECT_NOT_ACTIVE = new string_id("error_message", "object_not_active"); - - public static final String[] WAYPOINT_COLORS = - { - waypoint_colors.blue, - waypoint_colors.green, - waypoint_colors.orange, - waypoint_colors.yellow, - waypoint_colors.purple, - waypoint_colors.white - }; - - public static final string_id SID_SECONDS = new string_id("spam", "seconds"); - public static final string_id SID_MINUTES = new string_id("spam", "minutes"); - public static final string_id SID_HOURS = new string_id("spam", "hours"); - public static final string_id SID_DAYS = new string_id("spam", "days"); - public static final string_id SID_OUT_OF_RANGE = new string_id("spam", "out_of_range"); - - public static final int COMMANDO = 1; - public static final int SMUGGLER = 2; - public static final int MEDIC = 3; - public static final int OFFICER = 4; - public static final int SPY = 5; - public static final int BOUNTY_HUNTER = 6; - public static final int FORCE_SENSITIVE = 7; - public static final int TRADER = 8; - public static final int ENTERTAINER = 9; - - public static final String LIFEDAY_OWNER = "lifeday.owner"; - public static final String XMAS_RECEIVED_V1 = "gift.xmas05"; - public static final String XMAS_RECEIVED_V2 = "gift.xmas05v2"; - - public static final String XMAS_RECEIVED_VI1 = "gift.xmas06"; - public static final String XMAS_RECEIVED_VI2 = "gift.xmas06v2"; - - public static final String XMAS_RECEIVED_VII1 = "gift.xmas07"; - public static final String XMAS_RECEIVED_VII2 = "gift.xmas07v2"; - public static final String XMAS_NOT_RECEIVED_TUTORIAL = "gift.xmas06_inTutorialFail"; - - public static final String XMAS_RECEIVED_VIII1 = "gift.xmas08"; - public static final String XMAS_RECEIVED_VIII2 = "gift.xmas08v2"; - - public static final String XMAS_RECEIVED_IX_01 = "gift.xmas09"; - - public static final String EMPIRE_DAY_RECEIVED_VI = "gift.empire08"; - - public static final string_id GIFT_GRANTED = new string_id("system_msg", "gift_granted"); - public static final string_id GIFT_GRANTED_SUB = new string_id("system_msg", "gift_granted_sub"); - - public static final int HOUSE_CURRENT = 0; - public static final int HOUSE_HISTORY = 1; - public static final int HOUSE_MAX = 2; - - public static final obj_id OBJ_ID_BIO_LINK_PENDING = obj_id.getObjId(1); - - public static final String VENDOR_SCRIPT = "terminal.vendor"; - public static final String BAZAAR_SCRIPT = "terminal.bazaar"; - - - public static int clipRange(int iValue, int iClipMin, int iClipMax) throws InterruptedException - { - return (iValue < iClipMin) ? iClipMin : (iValue > iClipMax) ? iClipMax : iValue; - } - - - public static location getRandomAwayLocation(location pos, float fMinRadius, float fMaxRadius) throws InterruptedException - { - float fTheta = rand() * (2f * (float)Math.PI); - float fRadius = Math.min(fMinRadius, fMaxRadius) + rand() * Math.abs(fMaxRadius - fMinRadius); - - pos.x += fRadius * Math.cos(fTheta); - pos.z += fRadius * Math.sin(fTheta); - return pos; - } - - - public static float getDistance2D(location locTarget1, location locTarget2) throws InterruptedException - { - if (locTarget1 == null || locTarget2 == null) - { - return -1.00f; - } - - location loc1 = (location)locTarget1.clone(); - loc1.y = 0f; - - location loc2 = (location)locTarget2.clone(); - loc2.y = 0f; - - return getDistance(loc1, loc2); - } - - - public static float getDistance2D(obj_id hereTarget, obj_id thereTarget) throws InterruptedException - { - if (!isIdValid(hereTarget) || !isIdValid(thereTarget)) - { - return -1.00f; - } - - return getDistance2D(getWorldLocation(hereTarget), getWorldLocation(thereTarget)); - } - - - public static attrib_mod[] addMindAttribToStim(int power) throws InterruptedException - { - attrib_mod[] am = new attrib_mod[2]; - - for (int i = 0; i < 2; i++) - { - testAbortScript(); - am[i] = createHealDamageAttribMod(i * 2, power); - } - return am; - } - - - public static int randix(float[] fArray) throws InterruptedException - { - - if (fArray.length > 1) - { - - float fSum = 0.0f; - for (int i = 0; i < fArray.length; i++) - { - testAbortScript(); - fSum += fArray[i]; - } - - float fRandom = rand() * fSum; - - fSum = 0.0f; - for (int i = 0; i < fArray.length; i++) - { - testAbortScript(); - fSum += fArray[i]; - if (fRandom <= fSum) - { - return i; - } - } - } - - return 0; - } - - - public static boolean isMando(obj_id armor) throws InterruptedException - { - - if (isIdValid(armor)) - { - String template = getTemplateName(armor); - - if ((template.endsWith("armor_mandalorian_belt.iff") || template.endsWith("armor_mandalorian_bicep_l.iff")|| template.endsWith("armor_mandalorian_bicep_r.iff")|| template.endsWith("armor_mandalorian_bracer_l.iff")|| template.endsWith("armor_mandalorian_bracer_r.iff")|| template.endsWith("armor_mandalorian_chest_plate.iff")|| template.endsWith("armor_mandalorian_helmet.iff")|| template.endsWith("armor_mandalorian_leggings.iff")|| template.endsWith("armor_mandalorian_shoes.iff")|| template.endsWith("armor_mandalorian_gloves.iff") )) - { - return true; - } - } - - return false; - } - - - public static boolean hasSpecialSkills(obj_id player) throws InterruptedException - { - boolean skillCheck = false; - - if (hasSkill (player, "class_commando_phase4_master")) - { - skillCheck = true; - } - - if (hasSkill (player, "class_bountyhunter_phase4_master")) - { - skillCheck = true; - } - - return skillCheck; - } - - - public static int unequipAndNotifyUncerted(obj_id player) throws InterruptedException - { - int totalUnequipped = 0; - String[] armorSlots = new String[] - { - "hat", - "chest2", - "bicep_r", - "bicep_l", - "bracer_upper_r", - "bracer_lower_r", - "bracer_upper_l", - "bracer_lower_l", - "gloves", - "pants2", - "shoes", - "chest1", - "pants1", - "utility_belt" - }; - - obj_id curArmor = null; - obj_id inv = utils.getInventoryContainer(player); - String classTemplate = getSkillTemplate(player); - - for (int i = 0; i < armorSlots.length; i++) - { - testAbortScript(); - curArmor = getObjectInSlot(player, armorSlots[i]); - if (( (isIdValid(curArmor) && !armor.isArmorCertified(player, curArmor)) ||(isMando(curArmor) && !hasSpecialSkills(player)) )) - { - totalUnequipped++; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "armor_lost_cert")); - pp = prose.setTT(pp, curArmor); - sendSystemMessageProse(player, pp); - putInOverloaded(curArmor, inv); - } - - if (!isIdNull(curArmor) && hasObjVar(curArmor, "armor.fake_armor") && hasObjVar(curArmor, "dynamic_item.required_skill")) - { - String requiredSkill = getStringObjVar(curArmor, "dynamic_item.required_skill"); - if (classTemplate != null && !classTemplate.equals("")) - { - if (!classTemplate.startsWith(requiredSkill)) - { - totalUnequipped++; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "armor_lost_cert")); - pp = prose.setTT(pp, curArmor); - sendSystemMessageProse(player, pp); - putInOverloaded(curArmor, inv); - } - } - } - - } - - obj_id[] equipSlots = metrics.getWornItems(player); - if (equipSlots != null && equipSlots.length > 0) - { - for (int i = 0; i < equipSlots.length; i++) - { - testAbortScript(); - - if (!static_item.validateLevelRequired(player,(equipSlots[i]))) - { - totalUnequipped++; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "item_lost_cert")); - pp = prose.setTT(pp, equipSlots[i]); - sendSystemMessageProse(player, pp); - putInOverloaded(equipSlots[i], inv); - } - - else if (!static_item.validateLevelRequiredForWornEffect(player,(equipSlots[i]))) - { - static_item.removeWornBuffs(equipSlots[i], player); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "item_lost_cert_effect")); - pp = prose.setTT(pp, equipSlots[i]); - sendSystemMessageProse(player, pp); - } - } - } - - obj_id weapon = getCurrentWeapon(player); - if (isIdValid(weapon) && !combat.hasCertification(player, weapon)) - { - totalUnequipped++; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "weapon_lost_cert")); - pp = prose.setTT(pp, weapon); - sendSystemMessageProse(player, pp); - putInOverloaded(weapon, inv); - } - - obj_id hold_l = getObjectInSlot(player, "hold_l"); - obj_id hold_r = getObjectInSlot(player, "hold_r"); - - if (isIdValid(hold_l) && !performance.isDancePropCertified(player, hold_l)) - { - totalUnequipped++; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "prop_lost_cert")); - pp = prose.setTT(pp, hold_l); - sendSystemMessageProse(player, pp); - putInOverloaded(hold_l, inv); - hold_l = obj_id.NULL_ID; - } - - if (isIdValid(hold_r) && !performance.isDancePropCertified(player, hold_r)) - { - totalUnequipped++; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "prop_lost_cert")); - pp = prose.setTT(pp, hold_r); - sendSystemMessageProse(player, pp); - putInOverloaded(hold_r, inv); - hold_r = obj_id.NULL_ID; - } - - if (performance.isValidDanceProp(hold_l) && performance.isValidDanceProp(hold_r) && !hasCommand(player, "prop_dual_wield")) - { - totalUnequipped++; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "dual_prop_lost_cert")); - pp = prose.setTT(pp, hold_l); - sendSystemMessageProse(player, pp); - putInOverloaded(hold_l, inv); - hold_l = obj_id.NULL_ID; - } - - obj_id[] appearanceItems = getAllItemsFromAppearanceInventory(player); - if (appearanceItems != null && appearanceItems.length > 0) - { - for (int i = 0; i < appearanceItems.length; ++i) - { - testAbortScript(); - curArmor = appearanceItems[i]; - - if (( (isIdValid(curArmor) && !armor.isArmorCertified(player, curArmor)) ||(isMando(curArmor) && !hasSpecialSkills(player)) )) - { - totalUnequipped++; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "armor_lost_cert")); - pp = prose.setTT(pp, curArmor); - sendSystemMessageProse(player, pp); - putInOverloaded(curArmor, inv); - } - if (!isIdNull(curArmor) && hasObjVar(curArmor, "armor.fake_armor") && hasObjVar(curArmor, "dynamic_item.required_skill")) - { - String requiredSkill = getStringObjVar(curArmor, "dynamic_item.required_skill"); - if (classTemplate != null && !classTemplate.equals("")) - { - if (!classTemplate.startsWith(requiredSkill)) - { - totalUnequipped++; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "armor_lost_cert")); - pp = prose.setTT(pp, curArmor); - sendSystemMessageProse(player, pp); - putInOverloaded(curArmor, inv); - } - } - } - - if (!static_item.validateLevelRequired(player,curArmor)) - { - totalUnequipped++; - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "item_lost_cert")); - pp = prose.setTT(pp, curArmor); - sendSystemMessageProse(player, pp); - putInOverloaded(curArmor, inv); - } - - else if (!static_item.validateLevelRequiredForWornEffect(player,curArmor)) - { - static_item.removeWornBuffs(curArmor, player); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "item_lost_cert_effect")); - pp = prose.setTT(pp, curArmor); - sendSystemMessageProse(player, pp); - } - - } - } - - return totalUnequipped; - } - - - public static int getIntObjVar(obj_id object, String name, int intDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return intDefault; - } - return getIntObjVar( object, name ); - } - - - public static int[] getIntArrayObjVar(obj_id object, String name, int[] intArrayDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return intArrayDefault; - } - return getIntArrayObjVar( object, name ); - } - - - public static float getFloatObjVar(obj_id object, String name, float fltDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return fltDefault; - } - return getFloatObjVar( object, name ); - } - - - public static float[] getFloatArrayObjVar(obj_id object, String name, float[] fltArrayDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return fltArrayDefault; - } - return getFloatArrayObjVar( object, name ); - } - - - public static String getStringObjVar(obj_id object, String name, String strDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return strDefault; - } - return getStringObjVar( object, name ); - } - - - public static String[] getStringArrayObjVar(obj_id object, String name, String[] strArrayDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return strArrayDefault; - } - return getStringArrayObjVar( object, name ); - } - - - public static obj_id getObjIdObjVar(obj_id object, String name, obj_id idDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return idDefault; - } - return getObjIdObjVar( object, name ); - } - - - public static obj_id[] getObjIdArrayObjVar(obj_id object, String name, obj_id[] idArrayDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return idArrayDefault; - } - return getObjIdArrayObjVar( object, name ); - } - - - public static location getLocationObjVar(obj_id object, String name, location locDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return locDefault; - } - return getLocationObjVar( object, name ); - } - - - public static location[] getLocationArrayObjVar(obj_id object, String name, location[] locArrayDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return locArrayDefault; - } - return getLocationArrayObjVar( object, name ); - } - - - public static boolean getBooleanObjVar(obj_id object, String name, boolean bDefault) throws InterruptedException - { - if (!hasObjVar( object, name )) - { - return bDefault; - } - - return getBooleanObjVar( object, name ); - } - - - public static boolean isObjIdInArray(obj_id[] objIdArray, obj_id objTarget) throws InterruptedException - { - if (objIdArray == null || objIdArray.length == 0) - { - return false; - } - - for (int i = 0; i < objIdArray.length; i++) - { - testAbortScript(); - if (objIdArray[i ] == objTarget) - { - return true; - } - - } - return false; - } - - - public static boolean isElementInArray(Vector objIdArray, Object objTarget) throws InterruptedException - { - if (objIdArray == null || objIdArray.isEmpty()) - { - return false; - } - - return objIdArray.contains(objTarget); - } - - - public static int getElementPositionInArray(Vector array, Object element) throws InterruptedException - { - if (array == null) - { - return -1; - } - - return array.indexOf(element); - } - - - public static int getElementPositionInArray(obj_id[] array, obj_id element) throws InterruptedException - { - if (array == null || array.length == 0) - { - return -1; - } - - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - if (array[i ] == element) - { - return i; - } - - } - return -1; - } - - - public static int getElementPositionInArray(int[] array, int element) throws InterruptedException - { - if (array == null || array.length == 0) - { - return -1; - } - - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - if (array[i ] == element) - { - return i; - } - - } - return -1; - } - - - public static int getElementPositionInArray(float[] array, float element) throws InterruptedException - { - if (array == null || array.length == 0) - { - return -1; - } - - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - if (array[i ] == element) - { - return i; - } - - } - return -1; - } - - - public static int getElementPositionInArray(boolean[] array, boolean element) throws InterruptedException - { - if (array == null || array.length == 0) - { - return -1; - } - - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - if (array[i ] == element) - { - return i; - } - - } - return -1; - } - - - public static int getElementPositionInArray(String[] array, String element) throws InterruptedException - { - if (array == null || array.length == 0) - { - return -1; - } - - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - if (array[i ].equals(element)) - { - return i; - } - - } - return -1; - } - - - public static int getElementPositionInArray(region[] array, region element) throws InterruptedException - { - if (array == null || array.length == 0) - { - return -1; - } - - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - if (array[i ].equals(element)) - { - return i; - } - - } - return -1; - } - - - public static int getElementPositionInArray(location[] array, location element) throws InterruptedException - { - if (array == null || array.length == 0) - { - return -1; - } - - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - if (array[i ].equals(element)) - { - return i; - } - - } - return -1; - } - - - public static int getElementPositionInArray(string_id[] array, string_id element) throws InterruptedException - { - if (array == null || array.length == 0) - { - return -1; - } - - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - if (array[i ].equals(element)) - { - return i; - } - - } - return -1; - } - - - public static int getElementPositionInArray(attrib_mod[] array, attrib_mod element) throws InterruptedException - { - if (array == null || array.length == 0) - { - return -1; - } - - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - if (array[i ].equals(element)) - { - return i; - } - - } - return -1; - } - - - public static obj_id[] copyObjIdArray(obj_id[] objSourceArray, obj_id[] objDestinationArray) throws InterruptedException - { - - if ((objSourceArray == null || objDestinationArray == null || objSourceArray.length == 0 || objDestinationArray.length == 0 || objSourceArray.length > objDestinationArray.length)) - { - return null; - } - - for (int i = 0; i < objSourceArray.length; i++) - { - testAbortScript(); - objDestinationArray[i ] = objSourceArray[i ]; - } - - return objDestinationArray; - } - - - public static obj_id[] copyArray(obj_id[] oldArray, obj_id[] newArray) throws InterruptedException - { - if ((oldArray == null || newArray == null || oldArray.length == 0 || newArray.length == 0 || oldArray.length > newArray.length)) - { - return null; - } - - for (int i = 0; i < oldArray.length; i++) - { - testAbortScript(); - newArray[i ] = oldArray[i ]; - } - - return newArray; - } - - - public static int[] copyArray(int[] oldArray, int[] newArray) throws InterruptedException - { - if ((oldArray == null || newArray == null || oldArray.length == 0 || newArray.length == 0 || oldArray.length > newArray.length)) - { - return null; - } - - for (int i = 0; i < oldArray.length; i++) - { - testAbortScript(); - newArray[i ] = oldArray[i ]; - } - - return newArray; - } - - - public static float[] copyArray(float[] oldArray, float[] newArray) throws InterruptedException - { - if ((oldArray == null || newArray == null || oldArray.length == 0 || newArray.length == 0 || oldArray.length > newArray.length)) - { - return null; - } - - for (int i = 0; i < oldArray.length; i++) - { - testAbortScript(); - newArray[i ] = oldArray[i ]; - } - - return newArray; - } - - - public static boolean[] copyArray(boolean[] oldArray, boolean[] newArray) throws InterruptedException - { - if ((oldArray == null || newArray == null || oldArray.length == 0 || newArray.length == 0 || oldArray.length > newArray.length)) - { - return null; - } - - for (int i = 0; i < oldArray.length; i++) - { - testAbortScript(); - newArray[i ] = oldArray[i ]; - } - - return newArray; - } - - - public static String[] copyArray(String[] oldArray, String[] newArray) throws InterruptedException - { - if ((oldArray == null || newArray == null || oldArray.length == 0 || newArray.length == 0 || oldArray.length > newArray.length)) - { - return null; - } - - for (int i = 0; i < oldArray.length; i++) - { - testAbortScript(); - newArray[i ] = oldArray[i ]; - } - - return newArray; - } - - - public static region[] copyArray(region[] oldArray, region[] newArray) throws InterruptedException - { - if ((oldArray == null || newArray == null || oldArray.length == 0 || newArray.length == 0 || oldArray.length > newArray.length)) - { - return null; - } - - for (int i = 0; i < oldArray.length; i++) - { - testAbortScript(); - newArray[i ] = oldArray[i ]; - } - - return newArray; - } - - - public static location[] copyArray(location[] oldArray, location[] newArray) throws InterruptedException - { - if ((oldArray == null || newArray == null || oldArray.length == 0 || newArray.length == 0 || oldArray.length > newArray.length)) - { - return null; - } - - for (int i = 0; i < oldArray.length; i++) - { - testAbortScript(); - newArray[i ] = oldArray[i ]; - } - - return newArray; - } - - - public static string_id[] copyArray(string_id[] oldArray, string_id[] newArray) throws InterruptedException - { - if ((oldArray == null || newArray == null || oldArray.length == 0 || newArray.length == 0 || oldArray.length > newArray.length)) - { - return null; - } - - for (int i = 0; i < oldArray.length; i++) - { - testAbortScript(); - newArray[i ] = oldArray[i ]; - } - - return newArray; - } - - - public static attrib_mod[] copyArray(attrib_mod[] oldArray, attrib_mod[] newArray) throws InterruptedException - { - if ((oldArray == null || newArray == null || oldArray.length == 0 || newArray.length == 0 || oldArray.length > newArray.length)) - { - return null; - } - - for (int i = 0; i < oldArray.length; i++) - { - testAbortScript(); - newArray[i ] = oldArray[i ]; - } - - return newArray; - } - - - public static String[] copyArrayOfRange(String[] oldArray, String[] newArray, int startIndex, int stopIndex) throws InterruptedException - { - if ((oldArray == null || newArray == null || oldArray.length == 0 || newArray.length == 0 || oldArray.length < stopIndex+1)) - { - return null; - } - - int j = 0; - for (int i = startIndex; i <= stopIndex; i++) - { - testAbortScript(); - newArray[j ] = oldArray[i ]; - j++; - } - - return newArray; - } - - - public static int setBit(int intBits, int intPos) throws InterruptedException - { - if (intPos < 0 || intPos > 31) - { - - return 0; - } - int posVal = 1 << intPos; - return ( intBits |= posVal ); - } - - - public static int clearBit(int intBits, int intPos) throws InterruptedException - { - if (intPos < 0 || intPos > 31) - { - - return ~0; - } - int posVal = 1 << intPos; - return ( intBits &= ~posVal ); - } - - - public static boolean checkBit(int intBits, int intPos) throws InterruptedException - { - if (intPos < 0 || intPos > 31) - { - - return false; - } - int posVal = 1 << intPos; - return ((intBits & posVal) != 0 ); - } - - - public static obj_id stringToObjId(String text) throws InterruptedException - { - - Long lngId; - - try - { - lngId = new Long(text); - } - catch (NumberFormatException err) - { - - return null; - } - obj_id objObject = obj_id.getObjId(lngId.longValue()); - return objObject; - } - - - public static obj_id[] stringToObjId(String[] text) throws InterruptedException - { - if ((text == null) || (text.length == 0)) - { - return null; - } - - obj_id[] ids = new obj_id[text.length]; - - for (int i = 0; i < text.length; i++) - { - testAbortScript(); - ids[i] = stringToObjId(text[i]); - } - - if (ids.length == text.length) - { - return ids; - } - - return null; - } - - - public static int stringToInt(String text) throws InterruptedException - { - if (text == null || text.equals("")) - { - return -1; - } - - int amt; - - try - { - amt = Integer.parseInt(text); - } - catch (NumberFormatException err) - { - - return -1; - } - - return amt; - } - - - public static long stringToLong(String text) throws InterruptedException - { - if (text == null || text.equals("")) - { - return -1; - } - - long amt; - - try - { - amt = Long.parseLong(text); - } - catch (NumberFormatException err) - { - - return -1; - } - - return amt; - } - - - public static float stringToFloat(String text) throws InterruptedException - { - if (text == null || text.equals("")) - { - return Float.NEGATIVE_INFINITY; - } - - float amt; - - try - { - amt = Float.parseFloat(text); - } - catch (NumberFormatException err) - { - - return Float.NEGATIVE_INFINITY; - } - - return amt; - } - - - public static String objIdArrayToString(obj_id[] array) throws InterruptedException - { - String text = "[ "; - - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - text += ""+array[i]; - - if (i < array.length-1) - { - text += ", "; - } - } - - text += " ]"; - - return text; - } - - - public static Vector removeElementAt(Vector array, int index) throws InterruptedException - { - if (array == null) - { - return null; - } - - if (index < 0 || index >= array.size()) - { - return array; - } - - array.removeElementAt(index); - return array; - } - - - public static Vector removeElement(Vector array, obj_id element) throws InterruptedException - { - if (array == null) - { - return null; - } - - if (element == null) - { - return array; - } - - array.removeElement(element); - return array; - } - - - public static Vector removeElements(Vector array, obj_id[] elements) throws InterruptedException - { - if (array == null) - { - return null; - } - - if (elements == null || elements.length == 0) - { - return array; - } - - List collection = Arrays.asList(elements); - array.removeAll(collection); - return array; - } - - - public static Vector removeElements(obj_id[] array, obj_id[] elements) throws InterruptedException - { - if (array == null) - { - return null; - } - - Vector ret = new Vector(Arrays.asList(array)); - if (ret == null) - { - return null; - } - - if (elements == null || elements.length == 0) - { - return ret; - } - - List collection = Arrays.asList(elements); - ret.removeAll(collection); - return ret; - } - - - public static Vector removeElements(Vector array, Vector elements) throws InterruptedException - { - if (array == null) - { - return null; - } - - if (elements == null || elements.size() == 0) - { - return array; - } - - array.removeAll(elements); - return array; - } - - - public static Vector addElement(Vector array, Object element) throws InterruptedException - { - if (array == null) - { - return addElement(new Vector(), element); - } - - if (element == null) - { - return array; - } - - array.add(element); - return array; - } - - - public static Vector addElement(Vector array, boolean element) throws InterruptedException - { - return addElement( array, new Boolean(element) ); - } - - - public static Vector addElement(Vector array, int element) throws InterruptedException - { - return addElement( array, new Integer(element) ); - } - - - public static Vector addElement(Vector array, float element) throws InterruptedException - { - return addElement( array, new Float(element) ); - } - - - public static obj_id[] toStaticObjIdArray(Vector vector) throws InterruptedException - { - if (vector == null || vector.size() == 0) - { - return null; - } - - obj_id[] ret = new obj_id[vector.size()]; - vector.toArray(ret); - return ret; - } - - - public static String[] toStaticStringArray(Vector vector) throws InterruptedException - { - if (vector == null || vector.size() == 0) - { - return null; - } - - String[] ret = new String[vector.size()]; - vector.toArray(ret); - return ret; - } - - - public static location[] toStaticLocationArray(Vector vector) throws InterruptedException - { - if (vector == null || vector.size() == 0) - { - return null; - } - - location[] ret = new location[vector.size()]; - vector.toArray(ret); - return ret; - } - - - public static boolean[] messageTo(obj_id[] targets, String messageName, dictionary params, float time, boolean guaranteed) throws InterruptedException - { - if (targets != null && targets.length > 0) - { - boolean[] results = new boolean[targets.length ]; - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - results[i] = messageTo( targets[i], messageName, params, time, guaranteed ); - } - return results; - } - return null; - } - - - public static boolean isLocSufficientDistanceFromObjects(location loc, obj_id[] items, float dist) throws InterruptedException - { - if ((items == null) || (dist < 0)) - { - return false; - } - - for (int i = 0; i < items.length; i++) - { - testAbortScript(); - if (getDistance2D(loc, getLocation(items[i])) < dist) - { - return false; - } - } - - return true; - } - - - public static obj_id[] concatArrays(obj_id[] array1, obj_id[] array2) throws InterruptedException - { - if (array1 == null) - { - return array2; - } - - else if (array2 == null) - { - return array1; - } - - obj_id[] toPass = new obj_id[array1.length + array2.length]; - - for (int i = 0; i < array1.length; i++) - { - testAbortScript(); - toPass[i] = array1[i]; - } - - for (int i = 0; i < array2.length; i++) - { - testAbortScript(); - toPass[i + array1.length] = array2[i]; - } - - return toPass; - } - - - public static Vector concatArrays(Vector array1, Vector array2) throws InterruptedException - { - if (array1 == null) - { - return array2; - } - else if (array2 == null) - { - return array1; - } - - array1.addAll(array2); - return array1; - } - - - public static Vector concatArrays(Vector array1, Object[] array2) throws InterruptedException - { - if (array2 == null) - { - return array1; - } - - if (array1 == null) - { - array1 = new Vector(array2.length + 10); - } - - array1.addAll(Arrays.asList(array2)); - return array1; - } - - - public static Vector concatArrays(Vector array1, int[] array2) throws InterruptedException - { - if (array2 == null) - { - return array1; - } - - Object[] toPass = new Object[array2.length]; - for (int i = 0; i < array2.length; i++) - { - testAbortScript(); - toPass[i] = new Integer(array2[i]); - } - - return concatArrays(array1, toPass); - } - - - public static Vector concatArrays(Vector array1, float[] array2) throws InterruptedException - { - if (array2 == null) - { - return array1; - } - - Object[] toPass = new Object[array2.length]; - for (int i = 0; i < array2.length; i++) - { - testAbortScript(); - toPass[i] = new Float(array2[i]); - } - - return concatArrays(array1, toPass); - } - - - public static Vector concatArrays(Vector array1, boolean[] array2) throws InterruptedException - { - if (array2 == null) - { - return array1; - } - - Object[] toPass = new Object[array2.length]; - for (int i = 0; i < array2.length; i++) - { - testAbortScript(); - toPass[i] = new Boolean(array2[i]); - } - - return concatArrays(array1, toPass); - } - - - public static String[] concatArrays(String[] array1, String[] array2) throws InterruptedException - { - if (array1 == null) - { - return array2; - } - - if (array2 == null) - { - return array1; - } - - String[] toPass = new String[array1.length + array2.length]; - for (int i = 0; i < array1.length; i++) - { - testAbortScript(); - toPass[i] = array1[i]; - } - - for (int i = 0; i < array2.length; i++) - { - testAbortScript(); - toPass[i+array1.length] = array2[i]; - } - - return toPass; - } - - - public static boolean isSubset(obj_id[] array1, obj_id[] array2) throws InterruptedException - { - if ((array1 == null) || (array2 == null)) - { - return false; - } - - Vector v1 = new Vector( Arrays.asList(array1) ); - Vector v2 = new Vector( Arrays.asList(array2) ); - - return v1.containsAll(v2); - } - - - public static boolean isSubset(String[] array1, String[] array2) throws InterruptedException - { - if ((array1 == null) || (array2 == null)) - { - return false; - } - - Vector v1 = new Vector( Arrays.asList(array1) ); - Vector v2 = new Vector( Arrays.asList(array2) ); - - return v1.containsAll(v2); - } - - - public static boolean isSubset(string_id[] array1, string_id[] array2) throws InterruptedException - { - if ((array1 == null) || (array2 == null)) - { - return false; - } - - Vector v1 = new Vector( Arrays.asList(array1) ); - Vector v2 = new Vector( Arrays.asList(array2) ); - - return v1.containsAll(v2); - } - - - public static boolean isSubset(region[] array1, region[] array2) throws InterruptedException - { - if ((array1 == null) || (array2 == null)) - { - return false; - } - - Vector v1 = new Vector( Arrays.asList(array1) ); - Vector v2 = new Vector( Arrays.asList(array2) ); - - return v1.containsAll(v2); - } - - - public static boolean isSubset(location[] array1, location[] array2) throws InterruptedException - { - if ((array1 == null) || (array2 == null)) - { - return false; - } - - Vector v1 = new Vector( Arrays.asList(array1) ); - Vector v2 = new Vector( Arrays.asList(array2) ); - - return v1.containsAll(v2); - } - - - public static boolean isSubset(attrib_mod[] array1, attrib_mod[] array2) throws InterruptedException - { - if ((array1 == null) || (array2 == null)) - { - return false; - } - - Vector v1 = new Vector( Arrays.asList(array1) ); - Vector v2 = new Vector( Arrays.asList(array2) ); - - return v1.containsAll(v2); - } - - - public static String[] makeNameListFromPlayerObjIdList(obj_id[] players) throws InterruptedException - { - if (players == null) - { - return null; - } - - Vector nameList = new Vector(); - nameList.setSize(0); - - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - if (isPlayer(players[i])) - { - nameList = addElement(nameList, getName(players[i])); - } - } - - if (nameList.size() == players.length) - { - return (String[])nameList.toArray(new String[0]); - } - else - { - return null; - } - } - - - public static String[] makeNameList(obj_id[] targets) throws InterruptedException - { - if (targets == null) - { - return null; - } - - Vector nameList = new Vector(); - nameList.setSize(0); - - obj_id self = getSelf(); - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - if (isIdValid(targets[i])) - { - String itemName = getEncodedName(targets[i]); - if (itemName != null) - { - nameList = addElement(nameList, itemName); - } - } - } - - if (nameList.size() == targets.length) - { - return (String[])nameList.toArray(new String[0]); - } - else - { - return null; - } - } - - - public static String[] makeNameList(Vector targets) throws InterruptedException - { - if (targets == null || targets.isEmpty()) - { - return null; - } - - obj_id[] targetsArray = new obj_id[targets.size()]; - targetsArray = (obj_id[])targets.toArray(targetsArray); - return makeNameList(targetsArray); - } - - - public static boolean isOwner(obj_id target, obj_id player) throws InterruptedException - { - if ((!isIdValid(target)) || (!isIdValid(player))) - { - return false; - } - - if (getOwner(target) == player) - { - return true; - } - - if (getObjIdObjVar(target, VAR_OWNER) == player) - { - return true; - } - - return false; - } - - - public static boolean isCoOwner(obj_id target, obj_id player) throws InterruptedException - { - if ((target == null) || (!isIdValid(player))) - { - return false; - } - - obj_id[] coowners = getObjIdArrayObjVar(target, VAR_COOWNERS); - if (coowners == null) - { - return false; - } - - if (getElementPositionInArray(coowners, player) > -1) - { - return true; - } - - return false; - } - - - public static obj_id[] getContents(obj_id container, boolean recurse, Vector excludedNodes) throws InterruptedException - { - Vector contents = getResizeableContents(container, recurse, excludedNodes); - obj_id[] _contents = new obj_id[0]; - if (contents != null) - { - _contents = new obj_id[contents.size()]; - contents.toArray(_contents); - } - return _contents; - } - - - public static obj_id[] getContents(obj_id container, boolean recurse) throws InterruptedException - { - Vector contents = getResizeableContents(container, recurse, null); - obj_id[] _contents = new obj_id[0]; - if (contents != null) - { - _contents = new obj_id[contents.size()]; - contents.toArray(_contents); - } - return _contents; - } - - - public static Vector getResizeableContents(obj_id container, boolean recurse, Vector excludedNodes) throws InterruptedException - { - if ((!isIdValid(container)) || (getContainerType(container) == 0)) - { - return null; - } - - if (!recurse) - { - return getResizeableContents(container); - } - else - { - Vector contents = getResizeableContents(container); - if (contents == null) - { - return null; - } - - boolean exclude = true; - if ((excludedNodes == null) || excludedNodes.isEmpty()) - { - exclude = false; - } - - for (int i = 0; i < contents.size(); i++) - { - testAbortScript(); - obj_id item = ((obj_id)(contents.get(i))); - if (isIdValid(item)) - { - - boolean keepItem = true; - if (exclude) - { - int idx = excludedNodes.indexOf(item); - if (idx > -1) - { - contents = removeElementAt(contents, i); - i--; - keepItem = false; - } - } - - if (keepItem) - { - - int itemGameObjectType = getGameObjectType(item); - if (itemGameObjectType != GOT_misc_factory_crate && itemGameObjectType != GOT_chronicles_quest_holocron) - { - int containerType = getContainerType(item); - if (containerType != 0) - { - obj_id[] newContents = getContents(item); - if (newContents != null) - { - contents = concatArrays(contents, newContents); - } - } - } - } - } - } - return contents; - } - } - - - public static obj_id[] getSharedContainerObjects(obj_id object) throws InterruptedException - { - if (!isIdValid(object) || !exists(object)) - { - return null; - } - - obj_id container = getContainedBy(object); - if (!isIdValid(container) || !exists(container)) - { - return null; - } - - return getContents(container); - } - - - public static Vector getResizeableContents(obj_id container, boolean recurse) throws InterruptedException - { - return getResizeableContents(container, recurse, null); - } - - - public static obj_id[] getNonBankPlayerContents(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return null; - } - - obj_id bank = getPlayerBank(player); - if (!isIdValid(bank)) - { - return null; - } - - Vector toExclude = addElement(null, bank); - obj_id[] contents = getContents(player, true, toExclude); - return contents; - } - - - public static obj_id[] getFilteredPlayerContents(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return null; - } - - Vector toExclude = null; - - obj_id bank = getPlayerBank(player); - if (isIdValid(bank)) - { - toExclude = addElement(toExclude, bank); - } - - obj_id missionBag = getMissionBag(player); - if (isIdValid(missionBag)) - { - toExclude = addElement(toExclude, missionBag); - } - - obj_id datapad = getPlayerDatapad(player); - if (isIdValid(datapad)) - { - toExclude = addElement(toExclude, datapad); - } - - return getContents(player, true, toExclude); - } - - - public static obj_id[] getAllContentsOwnedByPlayer(obj_id container, obj_id player) throws InterruptedException - { - if ((!isIdValid(container)) || (container == obj_id.NULL_ID) || (!isIdValid(player))) - { - return null; - } - - Vector ownedObjects = new Vector(); - ownedObjects.setSize(0); - obj_id[] allObjects = getContents(container, true); - - if (allObjects == null) - { - return null; - } - - for (int i = 0; i < allObjects.length; i++) - { - testAbortScript(); - if (getObjIdObjVar(allObjects[i], VAR_OWNER) == player) - { - ownedObjects = addElement(ownedObjects, allObjects[i]); - } - } - - if (ownedObjects.size() > 0) - { - obj_id[] _ownedObjects = new obj_id[0]; - if (ownedObjects != null) - { - _ownedObjects = new obj_id[ownedObjects.size()]; - ownedObjects.toArray(_ownedObjects); - } - return _ownedObjects; - } - - return null; - } - - - public static boolean isNestedWithin(obj_id item, obj_id container) throws InterruptedException - { - if (!isIdValid(item) || !isIdValid(container)) - { - return false; - } - - obj_id containedBy = getContainedBy(item); - if (!isIdValid(containedBy)) - { - return false; - } - else if (containedBy == container) - { - return true; - } - - return isNestedWithin(containedBy, container); - } - - - public static boolean isNestedWithinAPlayer(obj_id item) throws InterruptedException - { - return isNestedWithinAPlayer(item, true); - } - - - public static boolean isNestedWithinAPlayer(obj_id item, boolean searchBank) throws InterruptedException - { - if (!isIdValid(item)) - { - return false; - } - - if (isIdValid(getContainingPlayer(item))) - { - if (searchBank) - { - return true; - } - else - { - obj_id player = getContainingPlayer(item); - obj_id bank = getPlayerBank(player); - - if (isIdValid(bank)) - { - obj_id containedBy = getContainedBy(item); - - if (containedBy == bank) - { - return false; - } - else - { - return true; - } - } - else - { - return true; - } - } - } - - return false; - } - - - public static obj_id getContainingPlayer(obj_id item) throws InterruptedException - { - obj_id containedBy = getContainedBy(item); - if (!isIdValid(containedBy)) - { - return null; - } - else if (isPlayer(containedBy)) - { - return containedBy; - } - return getContainingPlayer(containedBy); - } - - - public static boolean isNestedWithinANpcCreature(obj_id item) throws InterruptedException - { - if (!isIdValid(item)) - { - return false; - } - - if (isIdValid(getContainingNpcCreature(item))) - { - return true; - } - - return false; - } - - - public static obj_id getContainingNpcCreature(obj_id item) throws InterruptedException - { - obj_id containedBy = getContainedBy(item); - if (!isIdValid(containedBy)) - { - return null; - } - else if (isNpcCreature(containedBy)) - { - return containedBy; - } - - return getContainingNpcCreature(containedBy); - } - - - public static obj_id getContainingPlayerOrCreature(obj_id item) throws InterruptedException - { - obj_id containedBy = getContainedBy(item); - if (!isIdValid(containedBy)) - { - return null; - } - else if (isNpcCreature(containedBy) || isPlayer(containedBy)) - { - return containedBy; - } - - return getContainingPlayerOrCreature(containedBy); - } - - - public static boolean playerHasItemByTemplate(obj_id objPlayer, String strTemplate) throws InterruptedException - { - obj_id objInventory = getInventoryContainer(objPlayer); - if (isIdValid(objInventory)) - { - obj_id[] objContents = getContents(objInventory, true); - - if (objContents != null) - { - for (int intI = 0; intI 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - String itemName = getStaticItemName(contents[i]); - if (itemName != null && staticItem != null && staticItem.equals(itemName)) - { - return contents[i]; - } - } - } - - obj_id bank = getPlayerBank(player); - if (isIdValid(bank)) - { - contents = getContents(bank, true); - - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - String itemName = static_item.getStaticItemName(contents[i]); - if (itemName != null && staticItem != null && staticItem.equals(itemName)) - { - return contents[i]; - } - } - } - } - - return null; - } - - - public static boolean playerHasStaticItemInAppearanceInventory(obj_id player, String staticItem) throws InterruptedException - { - return (isIdValid(getStaticItemInAppearanceInventory(player, staticItem))); - } - - - public static obj_id getStaticItemInAppearanceInventory(obj_id player, String staticItem) throws InterruptedException - { - obj_id[] contents = getAllItemsFromAppearanceInventory(player); - { - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - String itemName = getStaticItemName(contents[i]); - if (itemName != null && staticItem != null && staticItem.equals(itemName)) - { - return contents[i]; - } - } - } - } - - return null; - } - - - public static obj_id[] getAllStaticItemsInPlayerInventory(obj_id player, String staticItem) throws InterruptedException - { - Vector objectList = new Vector (); - - obj_id inventory = getInventoryContainer(player); - if (isIdValid(inventory)) - { - obj_id[] contents = getInventoryAndEquipment(player); - - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (contents[i] != null) - { - if (static_item.isStaticItem(contents[i])) - { - String itemName = getStaticItemName(contents[i]); - if (itemName.equals(staticItem)) - { - objectList = addElement (objectList, contents[i]); - } - } - } - } - } - } - - if (objectList.size () > 0) - { - obj_id[] staticList = new obj_id[objectList.size()]; - objectList.toArray (staticList); - return staticList; - } - - return null; - } - - - public static obj_id getStaticItemInInventory(obj_id player, String staticItem) throws InterruptedException - { - obj_id[] contents = getInventoryAndEquipment(player); - if (contents != null && contents.length > 0) - { - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - String itemName = getStaticItemName(contents[i]); - if (itemName != null && staticItem != null && staticItem.equals(itemName)) - { - return contents[i]; - } - } - } - - return null; - } - - - public static int countOfStackedItemsInArray(obj_id[] items) throws InterruptedException - { - int totalCount = 0; - - for (int i = 0; i < items.length; i++) - { - testAbortScript(); - int itemCount = getCount(items[i]); - totalCount = itemCount + totalCount; - } - return totalCount; - } - - - public static obj_id getItemPlayerHasByTemplate(obj_id objPlayer, String strTemplate) throws InterruptedException - { - obj_id objInventory = getInventoryContainer(objPlayer); - if (isIdValid(objInventory)) - { - obj_id[] objContents = getContents(objInventory, true); - - if (objContents != null) - { - for (int i = 0; i < objContents.length; i++) - { - testAbortScript(); - String strItemTemplate = getTemplateName(objContents[i]); - if (strItemTemplate.equals(strTemplate)) - { - return objContents[i]; - } - } - } - } - return null; - } - - - public static obj_id getItemPlayerHasByTemplateInDatapad(obj_id objPlayer, String strTemplate) throws InterruptedException - { - obj_id pDataPad = getPlayerDatapad(objPlayer); - if (isIdValid(pDataPad)) - { - obj_id[] objContents = getContents(pDataPad, true); - - if (objContents != null) - { - for (int i = 0; i < objContents.length; i++) - { - testAbortScript(); - String strItemTemplate = getTemplateName(objContents[i]); - if (strItemTemplate.equals(strTemplate)) - { - return objContents[i]; - } - } - } - } - return null; - } - - - public static obj_id getItemPlayerHasByTemplateInBank(obj_id objPlayer, String strTemplate) throws InterruptedException - { - obj_id objBank = getPlayerBank(objPlayer); - if (isIdValid(objBank)) - { - obj_id[] objContents = getContents(objBank, true); - - if (objContents != null) - { - for (int i = 0; i < objContents.length; i++) - { - testAbortScript(); - String strItemTemplate = getTemplateName(objContents[i]); - if (strItemTemplate.equals(strTemplate)) - { - return objContents[i]; - } - } - } - } - return null; - } - - - public static obj_id getItemPlayerHasByTemplateInBankOrInventory(obj_id objPlayer, String strTemplate) throws InterruptedException - { - obj_id itemObj = getItemPlayerHasByTemplate(objPlayer, strTemplate); - if (isIdValid( itemObj )) - { - return itemObj; - } - else - { - itemObj = getItemPlayerHasByTemplateInBank(objPlayer, strTemplate); - if (isIdValid(itemObj)) - { - return itemObj; - } - } - return null; - } - - - public static obj_id[] getAllItemsPlayerHasByTemplate(obj_id objPlayer, String strTemplate) throws InterruptedException - { - obj_id objInventory = getInventoryContainer(objPlayer); - if (isIdValid(objInventory)) - { - return getAllItemsInContainerByTemplate( objInventory, strTemplate, true); - } - else - { - return null; - } - } - - - public static obj_id[] getAllItemsPlayerHasByTemplateInBank(obj_id objPlayer, String strTemplate) throws InterruptedException - { - obj_id objBank = getPlayerBank(objPlayer); - if (isIdValid(objBank)) - { - return getAllItemsInContainerByTemplate( objBank, strTemplate, true ); - } - else - { - return null; - } - } - - public static obj_id[] getAllItemsInContainerByTemplate(obj_id container, String template, boolean recurse) throws InterruptedException - { - return getAllItemsInContainerByTemplate(container, template, recurse, true); - } - - - public static obj_id[] getAllItemsInContainerByTemplate(obj_id container, String template, boolean recurse, boolean allowEquipped) throws InterruptedException - { - Vector objectList = new Vector (); - if (isIdValid(container)) - { - obj_id[] objContents = getContents(container, recurse); - if (objContents != null) - { - for (int intI = 0; intI 0) - { - obj_id[] staticList = new obj_id[objectList.size()]; - objectList.toArray (staticList); - return staticList; - } - else - { - return null; - } - } - - - public static obj_id[] getAllItemsPlayerHasByTemplateStartsWith(obj_id objPlayer, String strTemplate) throws InterruptedException - { - obj_id objInventory = getInventoryContainer(objPlayer); - if (isIdValid(objInventory)) - { - return getAllItemsInContainerByTemplateStartsWith( objInventory, strTemplate, true); - } - else - { - return null; - } - } - - - public static obj_id[] getAllItemsPlayerHasByTemplateInBankStartsWith(obj_id objPlayer, String strTemplate) throws InterruptedException - { - obj_id objBank = getPlayerBank(objPlayer); - if (isIdValid(objBank)) - { - return getAllItemsInContainerByTemplateStartsWith( objBank, strTemplate, true ); - } - else - { - return null; - } - } - - - public static obj_id[] getAllItemsInContainerByTemplateStartsWith(obj_id container, String template, boolean recurse) throws InterruptedException - { - Vector objectList = new Vector (); - if (isIdValid(container)) - { - obj_id[] objContents = getContents(container, recurse); - if (objContents != null) - { - for (int intI = 0; intI 0) - { - obj_id[] staticList = new obj_id[objectList.size()]; - objectList.toArray (staticList); - return staticList; - } - else - { - return null; - } - } - - - public static obj_id[] getAllItemsPlayerHasByTemplateInBankAndInventory(obj_id objPlayer, String strTemplate) throws InterruptedException - { - Vector objectList = new Vector (); - - obj_id objInventory = getInventoryContainer(objPlayer); - if (isIdValid(objInventory)) - { - obj_id[] objContents = getContents(objInventory, true); - - if (objContents != null) - { - for (int i = 0; i < objContents.length; i++) - { - testAbortScript(); - String strItemTemplate = getTemplateName(objContents[i]); - if (strItemTemplate.equals(strTemplate)) - { - objectList = addElement (objectList, objContents[i]); - } - } - } - } - - obj_id objBank = getPlayerBank(objPlayer); - if (isIdValid(objBank)) - { - obj_id[] objContents = getContents(objBank, true); - - if (objContents != null) - { - for (int j = 0; j < objContents.length; j++) - { - testAbortScript(); - String strItemTemplate = getTemplateName(objContents[j]); - if (strItemTemplate.equals(strTemplate)) - { - objectList = addElement (objectList, objContents[j]); - } - } - } - } - if (objectList.size () > 0) - { - obj_id[] staticList = new obj_id[objectList.size()]; - objectList.toArray (staticList); - return staticList; - } - - return null; - } - - - public static obj_id[] getAllItemsInBankAndInventory(obj_id objPlayer) throws InterruptedException - { - Vector objectList = new Vector (); - - obj_id[] objContents = getInventoryAndEquipment(objPlayer); - - if (objContents != null) - { - for (int i = 0; i < objContents.length; i++) - { - testAbortScript(); - objectList = addElement (objectList, objContents[i]); - } - } - - obj_id objBank = getPlayerBank(objPlayer); - if (isIdValid(objBank)) - { - objContents = getContents(objBank, true); - - if (objContents != null) - { - for (int j = 0; j < objContents.length; j++) - { - testAbortScript(); - objectList = addElement (objectList, objContents[j]); - } - } - } - if (objectList.size () > 0) - { - obj_id[] staticList = new obj_id[objectList.size()]; - objectList.toArray (staticList); - return staticList; - } - - return null; - } - - - public static location getRandomLocationInRing(location locOrigin, float fltMinDistance, float fltMaxDistance) throws InterruptedException - { - - float fltRand = rand(); - - float fltDistance = (fltMaxDistance - fltMinDistance) * fltRand +fltMinDistance; - obj_id objTest = null; - debugServerConsoleMsg(objTest, "fltDistance is "+fltDistance); - - float fltAngle = rand(0, 360); - locOrigin = rotatePointXZ(locOrigin, fltDistance, fltAngle); - - return locOrigin; - } - - - public static location rotatePointXZ(location locOrigin, float fltDistance, float fltAngle) throws InterruptedException - { - location locOffset = (location)locOrigin.clone(); - locOffset.x = locOrigin.x + fltDistance; - locOffset.z = locOrigin.z; - - return rotatePointXZ(locOrigin, locOffset, fltAngle); - } - - - public static location rotatePointXZ(location locOrigin, location locPoint, float fltAngle) throws InterruptedException - { - float dx = locPoint.x - locOrigin.x; - float dz = locPoint.z - locOrigin.z; - - float fltRadians = (float)Math.toRadians(fltAngle); - float fltC = (float)Math.cos(fltRadians); - float fltS = (float) Math.sin(fltRadians); - - location locNewOffset = (location)locOrigin.clone(); - locNewOffset.x += (dx * fltS) - (dz * fltC); - locNewOffset.y = locPoint.y; - locNewOffset.z += (dx * fltC) + (dz * fltS); - - return locNewOffset; - } - - - public static location rotatePointXZ(location locPoint, float fltAngle) throws InterruptedException - { - - float fltRadians = (float) Math.toRadians(fltAngle); - float fltC = (float) Math.cos(fltRadians); - float fltS = (float) Math.sin(fltRadians); - - location locNewPoint = (location)locPoint.clone(); - locNewPoint.x += (locPoint.x * fltC) - (locPoint.z * fltS); - locNewPoint.z += (locPoint.x * fltS) + (locPoint.z * fltC); - - return locNewPoint; - } - - - public static float getHeadingToLocation(location here, location there) throws InterruptedException - { - if (here == null || there == null) - { - return -1f; - } - - float dx = there.x - here.x; - float dz = there.z - here.z; - - double radHeading = Math.atan2(-dx, dz); - double degreeHeading = Math.toDegrees(radHeading); - return (float)(degreeHeading); - } - - - public static location findLocInFrontOfTarget(obj_id target, float distance) throws InterruptedException - { - if (target == null || !exists(target)) - { - return null; - } - - location origin = getLocation(target); - - if (origin == null) - { - return null; - } - - float yaw = getYaw(target); - - location newLoc = rotatePointXZ(origin, distance, yaw); - - return newLoc; - } - - - public static attrib_mod createAttribMod(int attrib, int value, float duration, float attack, float decay) throws InterruptedException - { - return new attrib_mod(attrib, value, duration, attack, decay); - } - - - public static attrib_mod createAttribMod(int attrib, int value, float duration, float attack) throws InterruptedException - { - return new attrib_mod(attrib, value, duration, attack, 0.0f); - } - - - public static attrib_mod createAttribMod(int attrib, int value, float duration) throws InterruptedException - { - return new attrib_mod(attrib, value, duration, 0.0f, 0.0f); - } - - - public static attrib_mod createHealDamageAttribMod(int attrib, int value) throws InterruptedException - { - if ((value < 1) || (attrib % 3 != 0)) - { - return null; - } - - return new attrib_mod(attrib, value, 0.0f, 0.0f, MOD_POOL); - } - - - public static attrib_mod createHealWoundAttribMod(int attrib, int value) throws InterruptedException - { - if (value < 1) - { - return null; - } - - return new attrib_mod(attrib, value, 0.0f, healing.AM_HEAL_WOUND, 0.0f); - } - - - public static attrib_mod createHealShockAttribMod(int value) throws InterruptedException - { - if (value < 1) - { - return null; - } - - return new attrib_mod(0, value, 0.0f, healing.AM_HEAL_SHOCK, 0.0f); - } - - - public static attrib_mod createAddShockAttribMod(int value) throws InterruptedException - { - if (value < 1) - { - return null; - } - - return new attrib_mod(0, value, 0.0f, healing.AM_ADD_SHOCK, 0.0f); - } - - - public static attrib_mod createWoundAttribMod(int attrib, int value) throws InterruptedException - { - if (value < 1) - { - return null; - } - - return new attrib_mod(attrib, value, 0.0f, 0.0f, MOD_WOUND); - } - - - public static attrib_mod createAntidoteAttribMod(int attrib) throws InterruptedException - { - return new attrib_mod(attrib, 0, 0.0f, 0.0f, MOD_ANTIDOTE); - } - - - public static boolean addAttribMod(obj_id target, int attrib, int value, float duration) throws InterruptedException - { - return addAttribModifier(target, attrib, value, duration, 0.0f, 0.0f); - } - - - public static boolean addAttribMod(obj_id target, attrib_mod am) throws InterruptedException - { - if (target == null || am == null) - { - return false; - } - - boolean litmus = true; - - int attrib = am.getAttribute(); - float duration = am.getDuration(); - - int amt = am.getValue(); - int attack = (int)(am.getAttack()); - int decay = (int)(am.getDecay()); - - if (attack < 0) - { - switch (attack) - { - case (int)healing.AM_HEAL_WOUND: - if (amt < 0) - { - amt = 0; - } - break; - - case (int)healing.AM_HEAL_SHOCK: - if (amt < 0) - { - amt = 0; - } - litmus &= healShockWound(target, amt); - break; - - case (int)healing.AM_ADD_SHOCK: - if (amt < 0) - { - amt = 0; - } - litmus &= addShockWound(target, amt); - break; - } - } - - else - { - if (!addAttribModifier(target, attrib, amt, duration, am.getAttack(), am.getDecay())) - { - - litmus = false; - } - } - return litmus; - } - - - public static boolean addAttribMod(obj_id target, attrib_mod[] am) throws InterruptedException - { - if ((target == null) || (am == null) || (am.length == 0)) - { - return false; - } - - boolean ret = true; - - for (int i = 0; i < am.length; i++) - { - testAbortScript(); - ret &= addAttribMod(target, am[i]); - } - - return ret; - } - - - public static boolean setHeading(obj_id target, float heading) throws InterruptedException - { - if (target == null) - { - return false; - } - - return setYaw(target, heading); - } - - - public static dictionary parseKeyPairList(String keyPairList, char delim) throws InterruptedException - { - if (keyPairList.equals("")) - { - return null; - } - - dictionary d = new dictionary(); - - String[] pairs = split(keyPairList, delim); - if ((pairs == null) || (pairs.length == 0)) - { - return null; - } - - for (int i = 0; i < pairs.length; i++) - { - testAbortScript(); - String[] tmp = split(pairs[i], '='); - if ((tmp != null) && (tmp.length == 2)) - { - int val = stringToInt(tmp[1]); - if (val != -1) - { - d.put(tmp[0],val); - } - } - } - - return d; - } - - - public static dictionary parseKeyPairList(String keyPairList) throws InterruptedException - { - return parseKeyPairList(keyPairList, ','); - } - - - public static boolean putInPlayerInventory(obj_id player, obj_id item) throws InterruptedException - { - if ((!isIdValid(player)) || (!isPlayer(player)) || (item == null)) - { - return false; - } - - obj_id inventory = getObjectInSlot(player, SLOT_INVENTORY); - if (inventory == null) - { - return false; - } - - return putIn(item, inventory); - } - - - public static boolean putInPlayerDatapad(obj_id player, obj_id item) throws InterruptedException - { - if ((!isIdValid(player)) || (!isPlayer(player)) || (item == null)) - { - - return false; - } - - obj_id datapad = getObjectInSlot(player, SLOT_DATAPAD); - if (datapad == null) - { - - return false; - } - - return putIn(item, datapad); - } - - - public static obj_id getInventoryContainer(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - return getObjectInSlot(target, SLOT_INVENTORY); - } - - - public static obj_id getDroidInventoryContainer(obj_id droid) throws InterruptedException - { - if (!isIdValid(droid)) - { - return null; - } - - if (callable.hasCallableCD(droid)) - { - return getObjectInSlot(callable.getCallableCD(droid), SLOT_INVENTORY); - } - else - { - return null; - } - - } - - - public static obj_id getMissionBag(obj_id objPlayer) throws InterruptedException - { - if (!isIdValid(objPlayer)) - { - return null; - } - - return getObjectInSlot(objPlayer, SLOT_MISSION_BAG); - - } - - - public static obj_id getDatapad(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - return getObjectInSlot(target, SLOT_DATAPAD); - } - - - public static obj_id getPlayerDatapad(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !isPlayer(player)) - { - return null; - } - - return getObjectInSlot(player, SLOT_DATAPAD); - } - - - public static obj_id getPlayerHangar(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !isPlayer(player)) - { - return null; - } - - return getObjectInSlot(player, SLOT_HANGAR); - } - - - public static obj_id getPlayerBank(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !isPlayer(player)) - { - return null; - } - - return getObjectInSlot(player, SLOT_BANK); - } - - - public static boolean itemNotActive(obj_id player) throws InterruptedException - { - if ((!isIdValid(player)) || (!isPlayer(player))) - { - return false; - } - - sendSystemMessage(player, SID_OBJECT_NOT_ACTIVE); - return true; - } - - - public static boolean requestContainerOpen(obj_id player, obj_id container) throws InterruptedException - { - if ((!isIdValid(player)) || (!isPlayer(player)) || (!isIdValid(container)) || (getContainerType(container) == 0)) - { - return false; - } - - queueCommand(player, (1880585606), container, "", COMMAND_PRIORITY_DEFAULT); - return true; - } - - - public static String packStringId(string_id strId) throws InterruptedException - { - if (strId == null) - { - - return null; - } - - if (!strId.isValid()) - { - return null; - } - - String strPackedId = "@"+strId.getTable()+":"+strId.getAsciiId(); - return strPackedId; - - } - - public static string_id unpackString(String strId) throws InterruptedException - { - if (strId == null || strId.equals("")) - { - return null; - } - - if (strId.startsWith("@")) - { - strId = strId.substring(1); - } - - String[] s = split(strId, ':'); - if (s != null && s.length == 2) - { - return new string_id(s[0], s[1]); - } - - return null; - } - - - public static obj_id getNearbyPlayerByName(obj_id actor, String name) throws InterruptedException - { - java.util.StringTokenizer st = new java.util.StringTokenizer(name); - if (st.hasMoreTokens()) - { - String compareName = toLower(st.nextToken()); - - obj_id[] players = getPlayerCreaturesInRange(actor, 128.0f); - if (players != null) - { - for (int i = 0; i < players.length; ++i) - { - testAbortScript(); - java.util.StringTokenizer st2 = new java.util.StringTokenizer(getName(players[i])); - String playerName = toLower(st2.nextToken()); - if (compareName.equals(playerName)) - { - return players[i]; - } - } - } - } - return obj_id.NULL_ID; - } - - - public static void sendPostureChange(obj_id objCreature, int intPosture) throws InterruptedException - { - attacker_results cbtAttackerResults = new attacker_results(); - - setPosture(objCreature, intPosture); - String strPlayback = "change_posture"; - cbtAttackerResults.id = objCreature; - cbtAttackerResults.endPosture = intPosture; - cbtAttackerResults.weapon = null; - doCombatResults(strPlayback, cbtAttackerResults, null); - return; - } - - - public static obj_id[] getBuildingsInObjIdList(obj_id[] items) throws InterruptedException - { - if ((items == null) || (items.length == 0)) - { - return null; - } - - Vector buildings = new Vector(); - buildings.setSize(0); - - for (int i = 0; i < items.length; i++) - { - testAbortScript(); - if (getCellNames(items[i]) == null) - { - } - else - { - buildings = addElement(buildings, items[i]); - } - } - - if ((buildings == null) || (buildings.size() == 0)) - { - return null; - } - else - { - obj_id[] _buildings = new obj_id[0]; - if (buildings != null) - { - _buildings = new obj_id[buildings.size()]; - buildings.toArray(_buildings); - } - return _buildings; - } - } - - - public static obj_id[] getContainedGOTObjects(obj_id container, int got, boolean recurse, boolean allowDerived) throws InterruptedException - { - if (!isIdValid(container) || (got < 0)) - { - return null; - } - - if (getContainerType(container) == 0) - { - - return null; - } - - obj_id[] contents = getContents(container, recurse); - if ((contents == null) || (contents.length == 0)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - int myType = getGameObjectType(contents[i]); - if (!allowDerived) - { - if (myType == got) - { - ret = addElement(ret, contents[i]); - } - } - else - { - if (isGameObjectTypeOf(myType, got)) - { - ret = addElement(ret, contents[i]); - } - } - } - if ((ret == null) || (ret.size() == 0)) - { - return null; - } - obj_id[] _ret = new obj_id[0]; - if (ret != null) - { - _ret = new obj_id[ret.size()]; - ret.toArray(_ret); - } - return _ret; - } - - - public static obj_id[] getContainedGOTObjects(obj_id container, int got, boolean recurse) throws InterruptedException - { - return getContainedGOTObjects(container, got, recurse, false); - } - - - public static obj_id[] getContainedGOTObjects(obj_id container, int got) throws InterruptedException - { - return getContainedGOTObjects(container, got, false); - } - - - public static obj_id[] getContainedObjectsWithObjVar(obj_id container, String var, boolean recurse) throws InterruptedException - { - if (!isIdValid(container)) - { - return null; - } - - if (getContainerType(container) == 0) - { - return null; - } - - if (var == null || var.equals("")) - { - return null; - } - - obj_id[] contents = getContents(container, recurse); - if (contents == null || contents.length == 0) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (hasObjVar(contents[i], var)) - { - ret = addElement(ret, contents[i]); - } - } - - if ((ret == null) || (ret.size() == 0)) - { - return null; - } - - obj_id[] _ret = new obj_id[0]; - if (ret != null) - { - _ret = new obj_id[ret.size()]; - ret.toArray(_ret); - } - return _ret; - } - - - public static obj_id[] getContainedObjectsWithObjVar(obj_id container, String var) throws InterruptedException - { - return getContainedObjectsWithObjVar(container, var, false); - } - - - public static obj_id[] getContainedObjectsWithScript(obj_id container, String script, boolean recurse) throws InterruptedException - { - if (!isIdValid(container)) - { - return null; - } - - if (getContainerType(container) == 0) - { - return null; - } - - if (script == null || script.equals("")) - { - return null; - } - - obj_id[] contents = getContents(container, recurse); - if (contents == null || contents.length == 0) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (hasScript(contents[i], script)) - { - ret = addElement(ret, contents[i]); - } - } - - if ((ret == null) || (ret.size() == 0)) - { - return null; - } - - obj_id[] _ret = new obj_id[0]; - if (ret != null) - { - _ret = new obj_id[ret.size()]; - ret.toArray(_ret); - } - return _ret; - } - - - public static obj_id[] getContainedObjectsWithScript(obj_id container, String script) throws InterruptedException - { - return getContainedObjectsWithScript(container, script, false); - } - - - public static void sendMail(string_id subject, string_id body, String to, String from) throws InterruptedException - { - String body_oob = chatMakePersistentMessageOutOfBandBody(null, body); - String subject_str = "@"+ subject.toString (); - - chatSendPersistentMessage( from, to, subject_str, null, body_oob ); - - return; - } - - - public static void sendMail(string_id subject, string_id body, obj_id to, String from) throws InterruptedException - { - String body_oob = chatMakePersistentMessageOutOfBandBody(null, body); - String subject_str = "@"+ subject.toString (); - - chatSendPersistentMessage( from, to, subject_str, null, body_oob ); - } - - - public static void sendMail(string_id subject, prose_package body, obj_id to, String from) throws InterruptedException - { - String body_oob = chatMakePersistentMessageOutOfBandBody(null, body); - String subject_str = "@"+ subject.toString (); - - chatSendPersistentMessage( from, to, subject_str, null, body_oob ); - } - - - public static void sendMail(string_id subject, prose_package body, String to, String from) throws InterruptedException - { - String body_oob = chatMakePersistentMessageOutOfBandBody(null, body); - String subject_str = "@"+ subject.toString (); - - chatSendPersistentMessage( from, to, subject_str, null, body_oob ); - } - - - public static boolean isNightTime() throws InterruptedException - { - if (getLocalTime () < getLocalDayLength ()) - { - - return false; - } - else - { - return true; - - } - } - - - public static void sendSystemMessageTestingOnly(obj_id[] players, String message) throws InterruptedException - { - if (players == null || players.length == 0) - { - return; - } - - for (int i=0; i< players.length; i++) - { - testAbortScript(); - if (isIdValid(players[i]) && exists(players[i])) - { - sendSystemMessageTestingOnly(players[i], message); - } - } - } - - - public static void sendSystemMessage(obj_id[] players, string_id message) throws InterruptedException - { - if (players == null || players.length == 0) - { - return; - } - - for (int i=0; i< players.length; i++) - { - testAbortScript(); - if (isIdValid(players[i]) && exists(players[i])) - { - sendSystemMessage(players[i], message); - } - } - } - - - public static void sendSystemMessageProse(obj_id[] players, prose_package message) throws InterruptedException - { - if (players == null || players.length == 0) - { - return; - } - - for (int i=0; i< players.length; i++) - { - testAbortScript(); - if (isIdValid(players[i]) && exists(players[i])) - { - sendSystemMessageProse(players[i], message); - } - } - } - - - public static void sendSystemMessagePob(obj_id pob, string_id message) throws InterruptedException - { - obj_id[] players = trial.getPlayersInDungeon(pob); - if (players != null && players.length > 0) - { - utils.sendSystemMessage(players, message); - } - } - - - public static void sendSystemMessageProsePob(obj_id pob, prose_package message) throws InterruptedException - { - obj_id[] players = trial.getPlayersInDungeon(pob); - if (players != null && players.length > 0) - { - utils.sendSystemMessageProse(players, message); - } - } - - - public static void messagePlayer(obj_id source, obj_id player, string_id message, String templateOverride) throws InterruptedException - { - prose_package pp = new prose_package(); - pp.stringId = message; - - if (templateOverride.equals("none")) - { - commPlayer(source, player, pp); - } - else - { - commPlayer(source, player, pp, templateOverride); - } - } - - - public static void messagePlayer(obj_id source, obj_id player, string_id message) throws InterruptedException - { - messagePlayer(source, player, message, "none"); - } - - - public static void messagePlayer(obj_id source, obj_id[] players, string_id message, String templateOverride) throws InterruptedException - { - prose_package pp = new prose_package(); - pp.stringId = message; - - if (templateOverride.equals("none")) - { - commPlayers(source, players, pp); - } - else - { - commPlayers(source, players, pp, templateOverride); - } - } - - - public static void messagePlayer(obj_id source, obj_id[] players, string_id message, String templateOverride, float duration) throws InterruptedException - { - prose_package pp = new prose_package(); - pp.stringId = message; - - if (templateOverride.equals("none")) - { - commPlayers(source, players, pp); - return; - } - - if (duration <= 0.0f) - { - commPlayers(source, players, pp, templateOverride); - } - else - { - commPlayers(source, templateOverride, null, duration, players, pp); - } - } - - - public static void messagePlayer(obj_id source, obj_id[] players, string_id message) throws InterruptedException - { - messagePlayer(source, players, message, "none"); - } - - - public static boolean setLocalVar(obj_id target, String path, Vector val) throws InterruptedException - { - - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - if (val == null || val.isEmpty()) - { - return false; - } - - Object sample = val.get(0); - if (sample == null) - { - return false; - } - - boolean result = false; - if (sample instanceof Integer) - { - int count = val.size(); - int[] tempVal = new int[count]; - for (int i = 0; i < count; ++i) - { - testAbortScript(); - tempVal[i] = ((Integer)val.get(i)).intValue(); - } - result = setLocalVar(target, path, tempVal); - } - else if (sample instanceof Boolean) - { - int count = val.size(); - boolean[] tempVal = new boolean[count]; - for (int i = 0; i < count; ++i) - { - testAbortScript(); - tempVal[i] = ((Boolean)val.get(i)).booleanValue(); - } - result = setLocalVar(target, path, tempVal); - } - else if (sample instanceof Float) - { - int count = val.size(); - float[] tempVal = new float[count]; - for (int i = 0; i < count; ++i) - { - testAbortScript(); - tempVal[i] = ((Float)val.get(i)).intValue(); - } - result = setLocalVar(target, path, tempVal); - } - else if (sample instanceof String) - { - String[] tempVal = new String[val.size()]; - tempVal = (String[])val.toArray(tempVal); - result = setLocalVar(target, path, tempVal); - } - else if (sample instanceof obj_id) - { - obj_id[] tempVal = new obj_id[val.size()]; - tempVal = (obj_id[])val.toArray(tempVal); - result = setLocalVar(target, path, tempVal); - } - else if (sample instanceof location) - { - location[] tempVal = new location[val.size()]; - tempVal = (location[])val.toArray(tempVal); - result = setLocalVar(target, path, tempVal); - } - else if (sample instanceof transform) - { - transform[] tempVal = new transform[val.size()]; - tempVal = (transform[])val.toArray(tempVal); - result = setLocalVar(target, path, tempVal); - } - else if (sample instanceof vector) - { - vector[] tempVal = new vector[val.size()]; - tempVal = (vector[])val.toArray(tempVal); - result = setLocalVar(target, path, tempVal); - } - - return result; - } - - - public static boolean setLocalVar(obj_id target, String path, location val) throws InterruptedException - { - - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - public static boolean setLocalVar(obj_id target, String path, location[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - - public static boolean setLocalVar(obj_id target, String path, String val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - public static boolean setLocalVar(obj_id target, String path, String[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - - public static boolean setLocalVar(obj_id target, String path, obj_id val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - public static boolean setLocalVar(obj_id target, String path, obj_id[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - - public static boolean setLocalVar(obj_id target, String path, int val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - public static boolean setLocalVar(obj_id target, String path, int[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - - public static boolean setLocalVar(obj_id target, String path, float val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - public static boolean setLocalVar(obj_id target, String path, float[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - - public static boolean setLocalVar(obj_id target, String path, boolean val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - public static boolean setLocalVar(obj_id target, String path, transform val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - } - - - public static boolean setLocalVar(obj_id target, String path, transform[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - } - - - public static boolean setLocalVar(obj_id target, String path, vector val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - } - - - public static boolean setLocalVar(obj_id target, String path, vector[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - } - - - public static boolean setLocalVar(obj_id target, String path, boolean[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val ); - return true; - - } - - - public static boolean setLocalVar(obj_id target, String path, dictionary val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.put(path, val); - return true; - } - - - public static boolean hasLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.containsKey(path); - } - - - public static boolean removeLocalVar(obj_id target, String path) throws InterruptedException - { - if ((target == null) || (target == obj_id.NULL_ID)) - { - return false; - } - - if ((path == null) || (path.equals(""))) - { - return false; - } - - dictionary dd = target.getScriptDictionary(); - dd.remove(path); - - return true; - } - - - public static int getIntLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getInt(path); - } - - - public static int[] getIntArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getIntArray(path); - } - - - public static float getFloatLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getFloat(path); - } - - - public static float[] getFloatArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getFloatArray(path); - } - - - public static String getStringLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getString(path); - } - - - public static String[] getStringArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getStringArray(path); - } - - - public static transform[] getTransformArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getTransformArray(path); - } - - - public static boolean getBooleanLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getBoolean(path); - } - - - public static boolean[] getBooleanArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getBooleanArray(path); - } - - - public static location getLocationLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getLocation(path); - } - - - public static location[] getLocationArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getLocationArray(path); - } - - - public static obj_id getObjIdLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getObjId(path); - } - - - public static obj_id[] getObjIdArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getObjIdArray(path); - } - - - public static Vector getResizeableObjIdArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - obj_id[] objArray = dd.getObjIdArray(path); - return new Vector(Arrays.asList(objArray)); - } - - - public static Vector getResizeableLocationArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - location[] locArray = dd.getLocationArray(path); - return new Vector(Arrays.asList(locArray)); - } - - - public static Vector getResizeableIntArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - int[] intArray = dd.getIntArray(path); - Vector rszArray = new Vector(intArray.length + 1); - for (int i = 0; i < intArray.length; ++i) - { - testAbortScript(); - rszArray.add(new Integer(intArray[i])); - } - return rszArray; - } - - - public static Vector getResizeableFloatArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - float[] fltArray = dd.getFloatArray(path); - Vector rszArray = new Vector(fltArray.length + 10); - for (int i = 0; i < fltArray.length; ++i) - { - testAbortScript(); - rszArray.add(new Float(fltArray[i])); - } - return rszArray; - } - - - public static Vector getResizeableStringArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - String[] strArray = dd.getStringArray(path); - return new Vector(Arrays.asList((String[])strArray)); - } - - - public static Vector getResizeableTransformArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - transform[] trArray = dd.getTransformArray(path); - Vector v1 = new Vector( Arrays.asList(trArray)); - - return v1; - } - - - public static Vector getResizeableVectorArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - vector[] vctArray = dd.getVectorArray(path); - Vector v1 = new Vector( Arrays.asList(vctArray)); - return v1; - } - - - public static string_id getStringIdLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getStringId(path); - } - - - public static string_id[] getStringIdArrayLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getStringIdArray(path); - } - - - public static dictionary getDictionaryLocalVar(obj_id target, String path) throws InterruptedException - { - dictionary dd = target.getScriptDictionary(); - return dd.getDictionary(path); - } - - - public static boolean setScriptVar(obj_id target, String path, location val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, location[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, String val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, String[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, String[][] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, obj_id val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, obj_id[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, int val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, int[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, long val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, long[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, double val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, double[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, float val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, float[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, boolean val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, transform val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, transform[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, vector val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, vector[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, boolean[] val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val ); - return true; - } - - - public static boolean setScriptVar(obj_id target, String path, Vector val) throws InterruptedException - { - - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - if (val == null || val.isEmpty()) - { - return false; - } - - Object sample = val.get(0); - if (sample == null) - { - return false; - } - - boolean result = false; - if (sample instanceof Integer) - { - int count = val.size(); - int[] tempVal = new int[count]; - for (int i = 0; i < count; ++i) - { - testAbortScript(); - tempVal[i] = ((Integer)val.get(i)).intValue(); - } - result = setScriptVar(target, path, tempVal); - } - else if (sample instanceof Boolean) - { - int count = val.size(); - boolean[] tempVal = new boolean[count]; - for (int i = 0; i < count; ++i) - { - testAbortScript(); - tempVal[i] = ((Boolean)val.get(i)).booleanValue(); - } - result = setScriptVar(target, path, tempVal); - } - else if (sample instanceof Float) - { - int count = val.size(); - float[] tempVal = new float[count]; - for (int i = 0; i < count; ++i) - { - testAbortScript(); - tempVal[i] = ((Float)val.get(i)).intValue(); - } - result = setScriptVar(target, path, tempVal); - } - else if (sample instanceof String) - { - String[] tempVal = new String[val.size()]; - tempVal = (String[])val.toArray(tempVal); - result = setScriptVar(target, path, tempVal); - } - else if (sample instanceof obj_id) - { - obj_id[] tempVal = new obj_id[val.size()]; - tempVal = (obj_id[])val.toArray(tempVal); - result = setScriptVar(target, path, tempVal); - } - else if (sample instanceof location) - { - location[] tempVal = new location[val.size()]; - tempVal = (location[])val.toArray(tempVal); - result = setScriptVar(target, path, tempVal); - } - else if (sample instanceof transform) - { - transform[] tempVal = new transform[val.size()]; - tempVal = (transform[])val.toArray(tempVal); - result = setScriptVar(target, path, tempVal); - } - else if (sample instanceof vector) - { - vector[] tempVal = new vector[val.size()]; - tempVal = (vector[])val.toArray(tempVal); - result = setScriptVar(target, path, tempVal); - } - - return result; - } - - - public static boolean setScriptVar(obj_id target, String path, dictionary val) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.put(path, val); - return true; - } - - - public static boolean hasScriptVar(obj_id target, String path) throws InterruptedException - { - return target.hasScriptVar( path ); - } - - - public static boolean hasScriptVarTree(obj_id target, String path) throws InterruptedException - { - if ((target == null) || (target == obj_id.NULL_ID)) - { - return false; - } - - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - Enumeration keys = dd.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)(keys.nextElement()); - if (key.equals(path) || key.startsWith(path + ".")) - { - return true; - } - } - - return false; - } - - - public static boolean removeScriptVar(obj_id target, String path) throws InterruptedException - { - if ((target == null) || (target == obj_id.NULL_ID)) - { - return false; - } - - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - dd.remove(path); - - return true; - } - - - public static boolean removeScriptVarTree(obj_id target, String path) throws InterruptedException - { - if ((target == null) || (target == obj_id.NULL_ID)) - { - return false; - } - - if ((path == null) || (path.equals(""))) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - Enumeration keys = dd.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)(keys.nextElement()); - if (key.equals(path) || key.startsWith(path + ".")) - { - dd.remove(key); - } - } - - return true; - } - - - public static int getIntScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getInt(path); - } - - - public static int[] getIntArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getIntArray(path); - } - - - public static float getFloatScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getFloat(path); - } - - - public static float[] getFloatArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getFloatArray(path); - } - - - public static long getLongScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getLong(path); - } - - - public static long[] getLongArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getLongArray(path); - } - - - public static double getDoubleScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getDouble(path); - } - - - public static double[] getDoubleArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getDoubleArray(path); - } - - - public static String getStringScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getString(path); - } - - - public static String[] getStringArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getStringArray(path); - } - - - public static String[][] getStringArrayArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getStringArrayArray(path); - } - - - public static transform[] getTransformArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getTransformArray(path); - } - - - public static transform getTransformScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getTransform(path); - } - - public static boolean getBooleanScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getBoolean(path); - } - - - public static boolean[] getBooleanArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getBooleanArray(path); - } - - - public static location getLocationScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getLocation(path); - } - - - public static location[] getLocationArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getLocationArray(path); - } - - - public static obj_id getObjIdScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getObjId(path); - } - - - public static obj_id[] getObjIdArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getObjIdArray(path); - } - - - public static Vector getResizeableObjIdArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getResizeableObjIdArray(path); - } - - - public static Vector getResizeableLocationArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getResizeableLocationArray(path); - } - - - public static Vector getResizeableIntArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getResizeableIntArray(path); - } - - - public static Vector getResizeableFloatArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getResizeableFloatArray(path); - } - - - public static Vector getResizeableStringArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getResizeableStringArray(path); - } - - - public static Vector getResizeableTransformArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getResizeableTransformArray(path); - } - - - public static Vector getResizeableVectorArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getResizeableVectorArray(path); - } - - - public static string_id getStringIdScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getStringId(path); - } - - - public static string_id[] getStringIdArrayScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getStringIdArray(path); - } - - - public static dictionary getDictionaryScriptVar(obj_id target, String path) throws InterruptedException - { - deltadictionary dd = target.getScriptVars(); - return dd.getDictionary(path); - } - - - public static boolean emptyContainer(obj_id target) throws InterruptedException - { - if ((target == null) || (target == obj_id.NULL_ID)) - { - return false; - } - - obj_id[] contents = getContents(target); - if ((contents == null) || (contents.length == 0)) - { - return false; - } - - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - destroyObject(contents[i]); - } - - return true; - } - - - public static boolean emptyContainerExceptStorytellerLoot(obj_id target) throws InterruptedException - { - if ((target == null) || (target == obj_id.NULL_ID)) - { - return false; - } - - obj_id[] contents = getContents(target); - if ((contents == null) || (contents.length == 0)) - { - return false; - } - - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - obj_id contentsItem = contents[i]; - if (!utils.hasScriptVar(contentsItem, "storytellerLoot")) - { - destroyObject(contentsItem); - } - } - - return true; - } - - - public static location getLocationInArc(obj_id objPlayer, float fltStartAngle, float fltArcSize, float fltDistance) throws InterruptedException - { - - location locHeading = getHeading(objPlayer); - location locCenter = getLocation(objPlayer); - - locHeading.x = locHeading.x * fltDistance; - locHeading.z = locHeading.z * fltDistance; - - locHeading.y = locCenter.y; - locHeading.cell = locCenter.cell; - locHeading.area = locCenter.area; - - float fltAngle = rand(fltStartAngle - fltArcSize, fltStartAngle + fltArcSize); - - location locNewHeading = rotatePointXZ(locHeading, fltAngle); - - locNewHeading.x = locCenter.x + locNewHeading.x; - locNewHeading.z = locCenter.z + locNewHeading.z; - - return locNewHeading; - - } - - - public static float getHeadingDegrees(obj_id objTarget) throws InterruptedException - { - location locStart = getLocation(objTarget); - location locHeading = getHeading(objTarget); - locHeading.x = locStart.x + locHeading.x; - locHeading.z = locStart.z + locHeading.z; - locHeading.y = locStart.y + locHeading.y; - - float fltAngle = thetaDegrees(locStart, locHeading); - return fltAngle; - - } - - - public static float thetaDegrees(location direction) throws InterruptedException - { - return (float) Math.toDegrees (Math.atan2 (direction.x, direction.z)); - } - - - public static float thetaDegrees(location start, location end) throws InterruptedException - { - location direction = new location (); - direction.x = end.x - start.x; - direction.y = end.y - start.y; - direction.z = end.z - start.z; - - return thetaDegrees (direction); - } - - - public static int countSubStringObjVars(obj_id[] objObjects, String strObjVar, String strSubString) throws InterruptedException - { - if (objObjects == null) - { - - return 0; - } - int intCount = 0; - for (int intI = 0; intI-1) - { - intCount = intCount +1; - } - } - } - return intCount; - } - - - public static dictionary addObjVarToDictionary(obj_var ov, dictionary d, String basePath) throws InterruptedException - { - if (ov == null || d == null) - { - return d; - } - - if (basePath == null) - { - basePath = ""; - } - - Object dta = ov.getData(); - if (dta == null) - { - return d; - } - - String name = ov.getName(); - String path = basePath + name; - - if (dta instanceof Integer) - { - int iVal = ov.getIntData(); - int iCur = d.getInt(path); - - iVal += iCur; - - d.put(path, iVal); - } - else if (dta instanceof Float) - { - float fVal = ov.getFloatData(); - float fCur = d.getFloat(path); - - fVal += fCur; - - d.put(path, fVal); - } - else if (dta instanceof int[]) - { - int[] iaVal = ov.getIntArrayData(); - int[] iaCur = d.getIntArray(path); - if ((iaCur == null) || (iaCur.length == 0)) - { - d.put(path, iaVal); - } - else - { - if (iaVal.length == iaCur.length) - { - for (int z = 0; z < iaVal.length; z++) - { - testAbortScript(); - iaVal[z] += iaCur[z]; - } - - d.put(path, iaVal); - } - } - } - else if (dta instanceof float[]) - { - float[] faVal = ov.getFloatArrayData(); - float[] faCur = d.getFloatArray(path); - if ((faCur == null) || (faCur.length == 0)) - { - d.put(path, faVal); - } - else - { - if (faVal.length == faCur.length) - { - for (int z = 0; z < faVal.length; z++) - { - testAbortScript(); - faVal[z] += faCur[z]; - } - - d.put(path, faVal); - } - } - } - - return d; - } - - - public static dictionary addObjVarToDictionary(obj_var ov, dictionary d) throws InterruptedException - { - return addObjVarToDictionary(ov, d, null); - } - - - public static dictionary addObjVarListToDictionary(obj_var_list ovl, dictionary d, String basePath) throws InterruptedException - { - if (ovl == null || d == null) - { - return d; - } - - if (basePath == null) - { - basePath = ""; - } - - String name = ovl.getName(); - String path = basePath + name; - - boolean litmus = true; - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - obj_var ov = ovl.getObjVar(i); - if (ov != null) - { - if (ov instanceof obj_var_list) - { - d = addObjVarListToDictionary((obj_var_list)(ov), d, path + "."); - } - else - { - d = addObjVarToDictionary(ov, d, path + "."); - } - } - } - - return d; - } - - - public static dictionary addObjVarListToDictionary(obj_var_list ovl, dictionary d) throws InterruptedException - { - return addObjVarListToDictionary(ovl, d, null); - } - - - public static obj_id cloneObject(obj_id template, obj_id container) throws InterruptedException - { - String templateName = getTemplateName(template); - obj_id clone = createObject(templateName, container, ""); - if (!isIdValid(clone)) - { - return null; - } - - copyObjectData(template, clone); - return clone; - } - - - public static obj_id cloneObject(obj_id template, location loc) throws InterruptedException - { - String templateName = getTemplateName(template); - obj_id clone = createObject(templateName, loc); - if (!isIdValid(clone)) - { - return null; - } - - copyObjectData(template, clone); - return clone; - } - - - public static void copyObjectData(obj_id template, obj_id clone) throws InterruptedException - { - - obj_var_list ovl = getObjVarList(clone, ""); - - if (ovl == null) - { - return; - } - - int numItems = ovl.getNumItems(); - for (int x = 0; x < numItems; x++) - { - testAbortScript(); - obj_var ov = ovl.getObjVar(x); - if (ov != null) - { - copyObjVar(template, clone, ov.getName()); - } - } - } - - - public static boolean copyObjVar(obj_id target, String basePath, obj_var ov) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if (basePath == null) - { - basePath = ""; - } - - if (ov == null) - { - return false; - } - - String name = ov.getName(); - String path = basePath + name; - - Object dta = ov.getData(); - if (dta instanceof Integer) - { - int val = ov.getIntData(); - return setObjVar(target, path, val); - } - else if (dta instanceof int[]) - { - int[] val = ov.getIntArrayData(); - return setObjVar(target, path, val); - } - else if (dta instanceof Float) - { - float val = ov.getFloatData(); - return setObjVar(target, path, val); - } - else if (dta instanceof float[]) - { - float[] val = ov.getFloatArrayData(); - return setObjVar(target, path, val); - } - else if (dta instanceof Boolean) - { - boolean val = ov.getBooleanData(); - return setObjVar(target, path, val); - } - else if (dta instanceof Boolean[]) - { - boolean[] val = ov.getBooleanArrayData(); - return setObjVar(target, path, val); - } - else if (dta instanceof String) - { - String val = ov.getStringData(); - return setObjVar(target, path, val); - } - else if (dta instanceof String[]) - { - String[] val = ov.getStringArrayData(); - return setObjVar(target, path, val); - } - else if (dta instanceof obj_id) - { - obj_id val = ov.getObjIdData(); - return setObjVar(target, path, val); - } - else if (dta instanceof obj_id[]) - { - obj_id[] val = ov.getObjIdArrayData(); - return setObjVar(target, path, val); - } - else if (dta instanceof location) - { - location val = ov.getLocationData(); - return setObjVar(target, path, val); - } - else if (dta instanceof location[]) - { - location[] val = ov.getLocationArrayData(); - return setObjVar(target, path, val); - } - else if (dta instanceof string_id) - { - string_id val = ov.getStringIdData(); - return setObjVar(target, path, val); - } - else if (dta instanceof string_id[]) - { - string_id[] val = ov.getStringIdArrayData(); - return setObjVar(target, path, val); - } - else if (dta instanceof attrib_mod) - { - attrib_mod val = ov.getAttribModData(); - return setObjVar(target, path, val); - } - else if (dta instanceof attrib_mod[]) - { - attrib_mod[] val = ov.getAttribModArrayData(); - return setObjVar(target, path, val); - } - - return false; - } - - - public static boolean[] removeObjVarList(obj_id object, String[] objVarList) throws InterruptedException - { - boolean[] result = new boolean[objVarList.length]; - - for (int i=0; i 0) - { - if (!Character.isLetterOrDigit(rootName.charAt(0))) - { - return false; - } - if (rootName.charAt(rootName.length() - 1) != '.') - { - rootName = rootName + "."; - } - } - - Enumeration keys = dict.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = null; - try - { - key = (String)keys.nextElement(); - } - catch ( ClassCastException err ) - { - return false; - } - Object data = dict.get(key); - if (data instanceof Integer) - { - - setObjVar(object, rootName + key, ((Integer)data).intValue()); - } - else if (data instanceof Float) - { - - setObjVar(object, rootName + key, ((Float)data).floatValue()); - } - else if (data instanceof String) - { - - setObjVar(object, rootName + key, (String)data); - } - else if (data instanceof int[]) - { - - setObjVar(object, rootName + key, (int[])data); - } - else if (data instanceof float[]) - { - - setObjVar(object, rootName + key, (float[])data); - } - else if (data instanceof dictionary) - { - - saveDictionaryAsObjVar(object, rootName + key, (dictionary)data); - } - else - { - - } - } - return true; - } - - - public static String getFactionSubString(String strSearchString) throws InterruptedException - { - if (strSearchString == null) - { - return null; - } - String strTestString = toLower(strSearchString); - final String[] FACTION_SEARCH_STRINGS = - { - factions.FACTION_IMPERIAL, factions.FACTION_REBEL - }; - for (int intI = 0; intI-1) - { - return FACTION_SEARCH_STRINGS[intI]; - } - - } - return null; - } - - - public static boolean setBatchObjVar(obj_id target, String base_path, Object[] array) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return false; - } - - if ((array == null) || (array.length == 0)) - { - return false; - } - - if (hasObjVar(target, base_path)) - { - removeObjVar(target, base_path); - } - - int BatchSize = 10; - - boolean litmus = true; - int n = 0; - Vector toSet = new Vector(); - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - toSet.add(array[i]); - if (toSet.size() >= BatchSize) - { - litmus &= setObjectArrayObjVar(target, base_path + "."+ n, toSet); - toSet.clear(); - n++; - } - } - - litmus &= setObjectArrayObjVar(target, base_path + "."+ n, toSet); - - return litmus; - } - - - public static void removeBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return; - } - - if (!hasObjVar(target, base_path)) - { - return; - } - - if (hasObjVar(target, base_path)) - { - removeObjVar(target, base_path); - } - - obj_var_list list = getObjVarList(target, null); - - if (list == null) - { - return; - } - - int listLength = list.getNumItems(); - int intQ = 0; - - for (int i=0; i= BatchSize) - { - litmus &= setObjectArrayObjVar(target, base_path + "."+ n, toSet); - toSet.clear(); - n++; - } - } - - litmus &= setObjectArrayObjVar(target, base_path + "."+ n, toSet); - - return litmus; - } - - - public static boolean setResizeableBatchObjVar(obj_id target, String base_path, Vector vector) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if ((base_path == null) || (base_path.equals(""))) - { - - return false; - } - - if ((vector == null) || (vector.size() == 0)) - { - - return false; - } - - if (hasObjVar(target, base_path)) - { - removeObjVar(target, base_path); - } - - int BatchSize = 10; - - boolean litmus = true; - int n = 0; - Vector toSet = new Vector(); - for (int i = 0; i < vector.size(); i++) - { - testAbortScript(); - toSet.add(vector.get(i)); - if (toSet.size() >= BatchSize) - { - litmus &= setObjectArrayObjVar(target, base_path + "."+ n, toSet); - toSet.clear(); - n++; - } - } - - litmus &= setObjectArrayObjVar(target, base_path + "."+ n, toSet); - - return litmus; - } - - - public static boolean setObjectArrayObjVar(obj_id target, String path, Vector vec) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if ((path == null) || (path.equals(""))) - { - return false; - } - - if ((vec == null) || (vec.size() == 0)) - { - return false; - } - - int size = vec.size(); - - Object test = vec.elementAt(0); - - if (test instanceof String) - { - String[] tmp = new String[size]; - vec.toArray(tmp); - return setObjVar(target, path, tmp); - } - else if (test instanceof string_id) - { - string_id[] tmp = new string_id[size]; - vec.toArray(tmp); - return setObjVar(target, path, tmp); - } - else if (test instanceof obj_id) - { - obj_id[] tmp = new obj_id[size]; - vec.toArray(tmp); - return setObjVar(target, path, tmp); - } - else if (test instanceof attrib_mod) - { - attrib_mod[] tmp = new attrib_mod[size]; - vec.toArray(tmp); - return setObjVar(target, path, tmp); - } - else if (test instanceof location) - { - location[] tmp = new location[size]; - vec.toArray(tmp); - return setObjVar(target, path, tmp); - } - else if (test instanceof Integer) - { - int[] tmp = new int[size]; - for (int i = 0; i < vec.size(); i ++) - { - testAbortScript(); - tmp[i] = ((Integer)(vec.get(i))).intValue(); - } - return setObjVar(target, path, tmp); - } - - return false; - } - - - public static String[] getStringBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasObjVar(target, base_path)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - obj_var_list ovl = getObjVarList(target, base_path); - if ((ovl == null) || (ovl.getNumItems() == 0)) - { - return null; - } - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - String[] tmp = getStringArrayObjVar(target, base_path + "."+ i); - if ((tmp != null) && (tmp.length > 0)) - { - ret = concatArrays(ret, tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return (String[])ret.toArray(new String[0]); - } - - return null; - } - - - public static Vector getResizeableStringBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasObjVar(target, base_path)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - obj_var_list ovl = getObjVarList(target, base_path); - if ((ovl == null) || (ovl.getNumItems() == 0)) - { - return null; - } - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - String[] tmp = getStringArrayObjVar(target, base_path + "."+ i); - if ((tmp != null) && (tmp.length > 0)) - { - ret = concatArrays(ret, tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return ret; - } - - return null; - } - - - public static string_id[] getStringIdBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasObjVar(target, base_path)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - obj_var_list ovl = getObjVarList(target, base_path); - if ((ovl == null) || (ovl.getNumItems() == 0)) - { - return null; - } - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - string_id[] tmp = getStringIdArrayObjVar(target, base_path + "."+ i); - if ((tmp != null) && (tmp.length > 0)) - { - ret = concatArrays(ret, tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return (string_id[])ret.toArray(new string_id[0]); - } - - return null; - } - - - public static obj_id[] getObjIdBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasObjVar(target, base_path)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - obj_var_list ovl = getObjVarList(target, base_path); - if ((ovl == null) || (ovl.getNumItems() == 0)) - { - return null; - } - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - obj_id[] tmp = getObjIdArrayObjVar(target, base_path + "."+ i); - if ((tmp != null) && (tmp.length > 0)) - { - ret = concatArrays(ret, tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - obj_id[] _ret = new obj_id[0]; - if (ret != null) - { - _ret = new obj_id[ret.size()]; - ret.toArray(_ret); - } - return _ret; - } - - return null; - } - - - public static Vector getResizeableObjIdBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasObjVar(target, base_path)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - obj_var_list ovl = getObjVarList(target, base_path); - if ((ovl == null) || (ovl.getNumItems() == 0)) - { - return null; - } - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - obj_id[] tmp = getObjIdArrayObjVar(target, base_path + "."+ i); - if ((tmp != null) && (tmp.length > 0)) - { - ret = concatArrays(ret, tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return ret; - } - - return null; - } - - - public static int[] getIntBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasObjVar(target, base_path)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - obj_var_list ovl = getObjVarList(target, base_path); - if ((ovl == null) || (ovl.getNumItems() == 0)) - { - return null; - } - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - int[] tmp = getIntArrayObjVar(target, base_path + "."+ i); - if ((tmp != null) && (tmp.length > 0)) - { - ret = concatArrays(ret, tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - int[] _ret = new int[0]; - if (ret != null) - { - _ret = new int[ret.size()]; - for (int _i = 0; _i < ret.size(); ++_i) - { - _ret[_i] = ((Integer)ret.get(_i)).intValue(); - } - } - return _ret; - } - - return null; - } - - - public static Vector getResizeableIntBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasObjVar(target, base_path)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - obj_var_list ovl = getObjVarList(target, base_path); - if ((ovl == null) || (ovl.getNumItems() == 0)) - { - return null; - } - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - int[] tmp = getIntArrayObjVar(target, base_path + "."+ i); - if ((tmp != null) && (tmp.length > 0)) - { - ret = concatArrays(ret, tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return ret; - } - - return null; - } - - - public static attrib_mod[] getAttribModBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasObjVar(target, base_path)) - { - return null; - } - - obj_var_list ovl = getObjVarList(target, base_path); - if ((ovl == null) || (ovl.getNumItems() == 0)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - attrib_mod[] tmp = getAttribModArrayObjVar(target, base_path + "."+ i); - if ((tmp != null) && (tmp.length > 0)) - { - ret = concatArrays(ret, tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return (attrib_mod[])ret.toArray(new attrib_mod[0]); - } - - return null; - } - - - public static location[] getLocationBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasObjVar(target, base_path)) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - obj_var_list ovl = getObjVarList(target, base_path); - if ((ovl == null) || (ovl.getNumItems() == 0)) - { - return null; - } - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - location[] tmp = getLocationArrayObjVar(target, base_path + "."+ i); - if ((tmp != null) && (tmp.length > 0)) - { - ret = concatArrays(ret, tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return (location[])ret.toArray(new location[0]); - } - - return null; - } - - - public static boolean hasStringBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - return getStringBatchObjVar(target, base_path) != null; - } - - - public static boolean hasResizeableStringBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - return getResizeableStringBatchObjVar(target, base_path) != null; - } - - - public static boolean hasStringIdBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - return getStringIdBatchObjVar(target, base_path) != null; - } - - - public static boolean hasObjIdBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - return getObjIdBatchObjVar(target, base_path) != null; - } - - - public static boolean hasResizeableObjIdBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - return getResizeableObjIdBatchObjVar(target, base_path) != null; - } - - - public static boolean hasIntBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - return getIntBatchObjVar(target, base_path) != null; - } - - - public static boolean hasResizeableIntBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - return getResizeableIntBatchObjVar(target, base_path) != null; - } - - - public static boolean hasAttribModBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - return getAttribModBatchObjVar(target, base_path) != null; - } - - - public static boolean hasLocationBatchObjVar(obj_id target, String base_path) throws InterruptedException - { - return getLocationBatchObjVar(target, base_path) != null; - } - - - public static boolean setBatchScriptVar(obj_id target, String base_path, Vector array) throws InterruptedException - { - if (!isIdValid(target)) - { - return false; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return false; - } - - if ((array == null) || (array.size() == 0)) - { - return false; - } - - deltadictionary dd = target.getScriptVars(); - - int BatchSize = 10; - - int n = 0; - Vector toSet = new Vector(); - for (int i = 0; i < array.size(); i++) - { - testAbortScript(); - toSet.add(array.elementAt(i)); - if (toSet.size() >= BatchSize) - { - dd.put(base_path + "."+ n, toSet); - toSet.clear(); - n++; - } - } - - if (toSet.size() > 0) - { - dd.put(base_path + "."+ n, toSet); - n++; - } - - dd.put(base_path, n); - return true; - } - - - public static boolean setBatchScriptVar(obj_id target, String base_path, obj_id[] array) throws InterruptedException - { - if ((array == null) || (array.length == 0)) - { - return false; - } - - Vector vArray = new Vector(Arrays.asList(array)); - return setBatchScriptVar(target, base_path, vArray); - } - - - public static boolean setBatchScriptVar(obj_id target, String base_path, String[] array) throws InterruptedException - { - if ((array == null) || (array.length == 0)) - { - return false; - } - - Vector vArray = new Vector(Arrays.asList(array)); - return setBatchScriptVar(target, base_path, vArray); - } - - - public static boolean setBatchScriptVar(obj_id target, String base_path, string_id[] array) throws InterruptedException - { - if ((array == null) || (array.length == 0)) - { - return false; - } - - Vector vArray = new Vector(Arrays.asList(array)); - return setBatchScriptVar(target, base_path, vArray); - } - - - public static boolean setBatchScriptVar(obj_id target, String base_path, location[] array) throws InterruptedException - { - if ((array == null) || (array.length == 0)) - { - return false; - } - - Vector vArray = new Vector(Arrays.asList(array)); - return setBatchScriptVar(target, base_path, vArray); - } - - - public static Vector getResizeableObjIdBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasScriptVar(target, base_path)) - { - return null; - } - - int cnt = getIntScriptVar(target, base_path); - deltadictionary dd = target.getScriptVars(); - - Vector ret = new Vector(); - for (int i = 0; i < cnt; i++) - { - testAbortScript(); - Vector tmp = dd.getResizeableObjIdArray(base_path + "."+ i); - if ((tmp != null) && (tmp.size() > 0)) - { - ret.addAll(tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return ret; - } - - return null; - } - - - public static obj_id[] getObjIdBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - Vector ret = getResizeableObjIdBatchScriptVar(target, base_path); - if ((ret != null) && (ret.size() > 0)) - { - return toStaticObjIdArray(ret); - } - - return null; - } - - - public static Vector getResizeableStringBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasScriptVar(target, base_path)) - { - return null; - } - - int cnt = getIntScriptVar(target, base_path); - deltadictionary dd = target.getScriptVars(); - - Vector ret = new Vector(); - for (int i = 0; i < cnt; i++) - { - testAbortScript(); - Vector tmp = dd.getResizeableStringArray(base_path + "."+ i); - if ((tmp != null) && (tmp.size() > 0)) - { - ret.addAll(tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return ret; - } - - return null; - } - - - public static String[] getStringBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - Vector ret = getResizeableStringBatchScriptVar(target, base_path); - if ((ret != null) && (ret.size() > 0)) - { - return toStaticStringArray(ret); - } - - return null; - } - - - public static Vector getResizeableLocationBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasScriptVar(target, base_path)) - { - return null; - } - - int cnt = getIntScriptVar(target, base_path); - deltadictionary dd = target.getScriptVars(); - - Vector ret = new Vector(); - for (int i = 0; i < cnt; i++) - { - testAbortScript(); - Vector tmp = dd.getResizeableLocationArray(base_path + "."+ i); - if ((tmp != null) && (tmp.size() > 0)) - { - ret.addAll(tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return ret; - } - - return null; - } - - - public static Vector getResizeableIntBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return null; - } - - if (!hasScriptVar(target, base_path)) - { - return null; - } - - int cnt = getIntScriptVar(target, base_path); - deltadictionary dd = target.getScriptVars(); - - Vector ret = new Vector(); - for (int i = 0; i < cnt; i++) - { - testAbortScript(); - Vector tmp = dd.getResizeableIntArray(base_path + "."+ i); - if ((tmp != null) && (tmp.size() > 0)) - { - ret.addAll(tmp); - } - } - - if ((ret != null) && (ret.size() > 0)) - { - return ret; - } - - return null; - } - - - public static location[] getLocationBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - Vector ret = getResizeableLocationBatchScriptVar(target, base_path); - if ((ret != null) && (ret.size() > 0)) - { - return toStaticLocationArray(ret); - } - - return null; - } - - - public static int[] getIntBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - Vector ret = getResizeableIntBatchScriptVar(target, base_path); - if ((ret != null) && (ret.size() > 0)) - { - int[] _ret = new int[0]; - if (ret != null) - { - _ret = new int[ret.size()]; - for (int _i = 0; _i < ret.size(); ++_i) - { - _ret[_i] = ((Integer)ret.get(_i)).intValue(); - } - } - return _ret; - } - - return null; - } - - - public static void removeBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - if (!isIdValid(target)) - { - return; - } - - if ((base_path == null) || (base_path.equals(""))) - { - return; - } - - if (!hasScriptVar(target, base_path)) - { - return; - } - - int cnt = getIntScriptVar(target, base_path); - deltadictionary dd = target.getScriptVars(); - dd.remove(base_path); - - for (int i = 0; i < cnt; i++) - { - testAbortScript(); - dd.remove(base_path + "."+ i); - } - } - - - public static boolean hasResizeableObjIdBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - return getResizeableObjIdBatchScriptVar(target, base_path) != null; - } - - - public static boolean hasObjIdBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - return getObjIdBatchScriptVar(target, base_path) != null; - } - - - public static boolean hasResizeableStringBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - return getResizeableStringBatchScriptVar(target, base_path) != null; - } - - - public static boolean hasStringBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - return getStringBatchScriptVar(target, base_path) != null; - } - - - public static boolean hasResizeableLocationBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - return getResizeableLocationBatchScriptVar(target, base_path) != null; - } - - - public static boolean hasResizeableIntBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - return getResizeableIntBatchScriptVar(target, base_path) != null; - } - - - public static boolean hasLocationBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - return getLocationBatchScriptVar(target, base_path) != null; - } - - - public static boolean hasIntBatchScriptVar(obj_id target, String base_path) throws InterruptedException - { - return getIntBatchScriptVar(target, base_path) != null; - } - - - public static int getIntConfigSetting(String section, String key) throws InterruptedException - { - String setting = getConfigSetting(section, key); - if (setting == null || setting.length() == 0) - { - return 0; - } - - try - { - return Integer.parseInt(setting); - } - catch ( NumberFormatException err) - { - } - return 0; - } - - - public static float getFloatConfigSetting(String section, String key) throws InterruptedException - { - String setting = getConfigSetting(section, key); - if (setting == null || setting.length() == 0) - { - return 0; - } - - try - { - return Float.parseFloat(setting); - } - catch ( NumberFormatException err) - { - } - return 0; - } - - - public static boolean checkConfigFlag(String strSection, String strConfigSetting) throws InterruptedException - { - - String strTest = getConfigSetting(strSection, strConfigSetting); - if (strTest != null) - { - strTest = toLower(strTest); - if (strTest.equals("true")) - { - return true; - - } - if (strTest.equals("1")) - { - return true; - - } - return false; - - } - else - { - return false; - } - - } - - public static boolean checkServerSpawnLimits() throws InterruptedException - { - final int intServerSpawnLimit = getServerSpawnLimit(); - final int intNumCreatures = utils.getNumCreaturesForSpawnLimit(); - final int intNumPlayers = getNumPlayers(); - if (intNumPlayers > 0) - { - - if (intServerSpawnLimit > 0) - { - - if (intNumCreatures > intServerSpawnLimit) - { - return false; - - } - } - else - { - if (intNumPlayers < 200000) - { - - if (intNumCreatures > 5000) - { - return false; - - } - - } - else - { - float fltRatio = (float)(intNumCreatures/intNumPlayers); - - if (fltRatio > 10) - { - return false; - - } - } - } - } - return true; - } - - - public static String formatTimeVerbose(int seconds) throws InterruptedException - { - if (seconds < 1) - { - return ""; - } - - int[] convert_time = player_structure.convertSecondsTime(seconds); - - int idx = 0; - for (int i = 0; i < convert_time.length; i++) - { - testAbortScript(); - if (convert_time[i] > 0) - { - idx = i; - break; - } - } - - if (idx == convert_time.length - 1) - { - idx--; - } - - String time_str = ""; - String[] verboseIndex = - { - " days ", - " hours ", - " minutes ", - " seconds " - }; - - for (int n = idx; n < convert_time.length; n++) - { - testAbortScript(); - - time_str += convert_time[n]+verboseIndex[n]; - - if (n < convert_time.length - 1) - { - time_str += ", "; - } - } - - if (time_str != null && !time_str.equals("")) - { - return time_str; - } - - return ""; - } - - - public static String formatTimeVerboseNoSpaces(int seconds) throws InterruptedException - { - if (seconds < 1) - { - return ""; - } - - int[] convert_time = player_structure.convertSecondsTime(seconds); - - int idx = 0; - for (int i = 0; i < convert_time.length; i++) - { - testAbortScript(); - if (convert_time[i] > 0) - { - idx = i; - break; - } - } - - if (idx == convert_time.length - 1) - { - idx--; - } - - String time_str = ""; - String[] verboseIndex = - { - " days", - " hours", - " minutes", - " seconds" - }; - - for (int n = idx; n < convert_time.length; n++) - { - testAbortScript(); - - time_str += convert_time[n]+verboseIndex[n]; - - if (n < convert_time.length - 1) - { - time_str += ", "; - } - } - - if (time_str != null && !time_str.equals("")) - { - return time_str; - } - - return ""; - } - - - public static String formatTime(int seconds) throws InterruptedException - { - if (seconds < 1) - { - return ""; - } - - int[] convert_time = player_structure.convertSecondsTime(seconds); - - int idx = 0; - for (int i = 0; i < convert_time.length; i++) - { - testAbortScript(); - if (convert_time[i] > 0) - { - idx = i; - break; - } - } - - if (idx == convert_time.length - 1) - { - idx--; - } - - String time_str = ""; - for (int n = idx; n < convert_time.length; n++) - { - testAbortScript(); - - time_str += convert_time[n]; - - if (n < convert_time.length - 1) - { - time_str += ":"; - } - } - - if (time_str != null && !time_str.equals("")) - { - return time_str; - } - - return ""; - } - - - public static String formatTime(float fTime) throws InterruptedException - { - int iTime = (int)fTime; - - float diff = fTime - iTime; - int decimals = (int)(diff*100); - - if (iTime > 0) - { - String sTime = formatTime(iTime); - sTime += "."+ decimals; - return sTime; - } - else - { - return "0." + decimals; - } - } - - - public static String padTimeDHMS(int seconds) throws InterruptedException - { - if (seconds < 0) - { - return null; - } - - int days = seconds / (3600 * 24); - - String daysText = ""+ days; - - if (daysText.length() <= 4) - { - daysText = "0000".substring(0, 4 - daysText.length()) + daysText; - } - - seconds = seconds % (3600 * 24); - - int hours = seconds / 3600; - - String hoursText = ""+ hours; - - if (hoursText.length() <= 2) - { - hoursText = "00".substring(0,2 - hoursText.length()) + hoursText; - } - - seconds = seconds % 3600; - - int minutes = seconds / 60; - - String minutesText = ""+ minutes; - - if (minutesText.length() <= 2) - { - minutesText = "00".substring(0,2 - minutesText.length()) + minutesText; - } - - seconds = seconds % 60; - - String secondsText = ""+ seconds; - - if (secondsText.length() <= 2) - { - secondsText = "00".substring(0,2 - secondsText.length()) + secondsText; - } - - return daysText + "d:" + hoursText + "h:" + minutesText + "m:" + secondsText + "s"; - } - - - public static String padTimeHM(int seconds) throws InterruptedException - { - seconds = seconds % (3600 * 24); - - int hours = seconds / 3600; - - String hoursText = ""+ hours; - - if (hoursText.length() <= 2) - { - hoursText = "00".substring(0,2 - hoursText.length()) + hoursText; - } - - seconds = seconds % 3600; - - int minutes = seconds / 60; - - String minutesText = ""+ minutes; - - if (minutesText.length() <= 2) - { - minutesText = "00".substring(0,2 - minutesText.length()) + minutesText; - } - - return hoursText + "h:" + minutesText + "m"; - } - - - public static void sendDelayedSystemMessage(obj_id target, string_id sid, float delay) throws InterruptedException - { - if (!isIdValid(target) || (sid == null) || (delay < 0f)) - { - return; - } - - dictionary msg = new dictionary(); - msg.put("sidMsg", sid); - - messageTo(target, "handleDelayedSystemMessage", msg, delay, false); - } - - - public static void sendDelayedSystemMessage(obj_id target, String sid, float delay) throws InterruptedException - { - if (!isIdValid(target) || (sid == null) || sid.equals("") || (delay < 0f)) - { - return; - } - - dictionary msg = new dictionary(); - msg.put("stringMsg", sid); - - messageTo(target, "handleDelayedSystemMessage", msg, delay, false); - } - - - public static void sendDelayedProseMessage(obj_id msgTarget, string_id sid, obj_id actor, String actorString, string_id actorStringId, obj_id target, String targetString, string_id targetStringId, obj_id other, String otherString, string_id otherStringId, int di, float df, float delay) throws InterruptedException - { - if (!isIdValid(msgTarget) || (sid == null) || (delay < 0f)) - { - return; - } - - dictionary msg = new dictionary(); - msg.put("sid", sid); - - msg.put("actor", actor); - msg.put("actorString", actorString); - msg.put("actorStringId", actorStringId); - - msg.put("target", target); - msg.put("targetString", targetString); - msg.put("targetStringId", targetStringId); - - msg.put("other", other); - msg.put("otherString", otherString); - msg.put("otherStringId", otherStringId); - - msg.put("di", di); - msg.put("df", df); - - messageTo(msgTarget, "handleDelayedProseMessage", msg, delay, false); - } - - - public static Vector alphabetizeStringArray(String[] array) throws InterruptedException - { - if ((array == null) || (array.length == 0)) - { - return null; - } - - Vector tmp = new Vector(); - java.text.Collator myCol = java.text.Collator.getInstance(); - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - boolean inserted = false; - for (int n = 0; n < tmp.size(); n++) - { - testAbortScript(); - if (myCol.compare(array[i], tmp.elementAt(n)) < 0) - { - tmp.add(n, array[i]); - inserted = true; - break; - } - } - - if (!inserted) - { - tmp.add(array[i]); - } - } - - if ((tmp == null) || (tmp.size() == 0)) - { - return null; - } - - return tmp; - } - - - public static Vector alphabetizeStringArray(Vector array) throws InterruptedException - { - if ((array == null) || (array.size() == 0)) - { - return null; - } - - String[] toPass = toStaticStringArray(array); - if ((toPass == null) || (toPass.length == 0)) - { - return null; - } - - return alphabetizeStringArray(toPass); - } - - - public static String getPlayerSpeciesName(int species) throws InterruptedException - { - switch (species) - { - case SPECIES_HUMAN: - return "human"; - - case SPECIES_BOTHAN: - return "bothan"; - - case SPECIES_RODIAN: - return "rodian"; - - case SPECIES_TWILEK: - return "twilek"; - - case SPECIES_TRANDOSHAN: - return "trandoshan"; - - case SPECIES_MON_CALAMARI: - return "moncalamari"; - - case SPECIES_WOOKIEE: - return "wookiee"; - - case SPECIES_ZABRAK: - return "zabrak"; - case SPECIES_ITHORIAN: - return "ithorian"; - case SPECIES_SULLUSTAN: - return "sullustan"; - default: - return "unknown"; - } - } - - - public static void addListener(String strObjVar, obj_id objListener, obj_id objTarget) throws InterruptedException - { - - if (strObjVar == null) - { - LOG("DESIGNER_FATAL", "Null objVar paseed into addListener"); - return; - - } - if (!isIdValid(objTarget)) - { - LOG("DESIGNER_FATAL", "Null owner paseed into addListener"); - return; - } - if (!isIdValid(objListener)) - { - - LOG("DESIGNER_FATAL", "Null listener paseed into addListener"); - } - - dictionary dctParams = new dictionary(); - dctParams.put("objListener", objListener); - dctParams.put("strObjVar", strObjVar); - messageTo(objTarget, "addListener", dctParams, 0, true); - return; - - } - - - public static void removeListener(String strObjVar, obj_id objListener, obj_id objTarget) throws InterruptedException - { - if (strObjVar == null) - { - LOG("DESIGNER_FATAL", "Null objVar paseed into removeListener"); - return; - - } - if (!isIdValid(objTarget)) - { - LOG("DESIGNER_FATAL", "Null target paseed into removeListener"); - return; - } - if (!isIdValid(objListener)) - { - - LOG("DESIGNER_FATAL", "Null listener paseed into removeListeer"); - } - - dictionary dctParams = new dictionary(); - dctParams.put("objListener", objListener); - dctParams.put("strObjVar", strObjVar); - messageTo(objTarget, "removeListener", dctParams, 0, true); - return; - - } - - - public static void messageListeners(String strObjVar, obj_id objOwner, String strMessageName, dictionary dctParams) throws InterruptedException - { - - if (strObjVar == null) - { - LOG("DESIGNER_FATAL", "Null objVar paseed into messageListeners"); - return; - - } - if (!isIdValid(objOwner)) - { - LOG("DESIGNER_FATAL", "Null owner paseed into messageListeners"); - return; - } - if (strMessageName == null) - { - LOG("DESIGNER_FATAL", "Null messageName paseed into messageListeners"); - - } - - if (hasObjVar(objOwner, strObjVar)) - { - - int intI = 0; - obj_id objListeners[] = getObjIdArrayObjVar(objOwner, "mission.objListeners"); - while (intI < objListeners.length) - { - testAbortScript(); - - messageTo(objListeners[intI], strMessageName, dctParams, 0, true); - intI = intI+1; - } - } - - return; - - } - - - public static int getTheaterSize(String strLairType) throws InterruptedException - { - if (isTheater(strLairType)) - { - int intIndex = strLairType.indexOf("medium"); - if (intIndex > 0) - { - return 40; - - } - intIndex = strLairType.indexOf("small"); - if (intIndex > 0) - { - return 24; - - } - intIndex = strLairType.indexOf("large"); - if (intIndex > 0) - { - return 72; - - } - - return 24; - } - return -1; - - } - - - public static boolean isTheater(String strLairType) throws InterruptedException - { - - if (strLairType == null) - { - return false; - } - int intIndex = strLairType.indexOf("theater"); - if (intIndex > 0) - { - return true; - } - return false; - } - - - public static boolean isAppropriateName(String name) throws InterruptedException - { - if (name == null || name.equals("")) - { - return false; - } - - java.util.StringTokenizer st = new java.util.StringTokenizer(name); - while (st.hasMoreTokens()) - { - testAbortScript(); - String tkn = st.nextToken(); - if (stringToFloat(tkn) == Float.NEGATIVE_INFINITY) - { - if (isObscene(tkn) || !isAppropriateText(tkn)) - { - return false; - } - } - } - - return true; - } - - - public static boolean setNonProfaneName(obj_id target, String name) throws InterruptedException - { - if (!isIdValid(target) || name == null || name.equals("")) - { - return false; - } - - if (!isAppropriateName(name)) - { - return false; - } - - return setName(target, name); - } - - - public static boolean setNonReservedName(obj_id target, String name) throws InterruptedException - { - if (!isIdValid(target) || name == null || name.equals("")) - { - return false; - } - - if (!isNameReserved(name)) - { - return setName(target, name); - } - - return false; - } - - - public static boolean setFilteredName(obj_id target, String name) throws InterruptedException - { - if (!isIdValid(target) || name == null || name.equals("")) - { - return false; - } - - if (!isNameReserved(name)) - { - return setNonProfaneName(target, name); - } - - return false; - } - - - public static void destroyObjects(obj_id[] objects) throws InterruptedException - { - if (objects == null || objects.length == 0) - { - return; - } - - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (isIdValid(objects[i])) - { - destroyObject(objects[i]); - } - } - } - - - public static String getTemplateFilenameNoPath(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - String filename = null; - String fullPath = getTemplateName(target); - if (fullPath != null && !fullPath.equals("")) - { - String[] tmp = split(fullPath, '/'); - if (tmp != null && tmp.length > 0) - { - filename = tmp[tmp.length - 1]; - } - } - - return filename; - } - - - public static int getFirstNonValidIdIndex(obj_id[] ids) throws InterruptedException - { - if (ids == null || ids.length == 0) - { - return -1; - } - - for (int i = 0; i < ids.length; i++) - { - testAbortScript(); - if (!isIdValid(ids[i])) - { - return i; - } - } - - return -1; - } - - - public static int getFirstValidIdIndex(obj_id[] ids) throws InterruptedException - { - if (ids == null || ids.length == 0) - { - return -1; - } - - for (int i = 0; i < ids.length; i++) - { - testAbortScript(); - if (isIdValid(ids[i])) - { - return i; - } - } - - return -1; - } - - - public static void moneyInMetric(obj_id objTransferer, String strAccount, int intAmount) throws InterruptedException - { - - int intTime = getGameTime(); - String strSpam = "moneyIn;"+intTime+";"+objTransferer+";"+strAccount+";"+intAmount; - logBalance(strSpam); - return; - } - - - public static void moneyOutMetric(obj_id objTransferer, String strAccount, int intAmount) throws InterruptedException - { - int intTime = getGameTime(); - String strSpam = "moneyOut;"+intTime+";"+objTransferer+";"+strAccount+";"+intAmount; - logBalance(strSpam); - return; - } - - - public static int getValidAttributeIndex(String[] array) throws InterruptedException - { - for (int i = 0; i < array.length; i++) - { - testAbortScript(); - if (array[i] == null || array[i].equals("")) - { - return i; - } - } - return -1; - } - - - public static String getStringName(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return null; - } - - String name = getEncodedName(target); - string_id sid_name = unpackString(name); - if (sid_name != null) - { - name = getString(sid_name); - } - - return name; - } - - - public static void warpPlayer(obj_id player, location dest) throws InterruptedException - { - if (isIdValid(dest.cell)) - { - warpPlayer (player, dest.area, 0.0f, 0.0f, 0.0f, dest.cell, dest.x, dest.y, dest.z); - } - else - { - warpPlayer (player, dest.area, dest.x, dest.y, dest.z, null, 0.0f, 0.0f, 0.0f); - } - } - - - public static void warpPlayer(obj_id player, String planet, location dest) throws InterruptedException - { - warpPlayer (player, planet, dest.x, dest.y, dest.z, null, 0.0f, 0.0f, 0.0f); - } - - - public static boolean copyObjVarList(obj_id from, obj_id to, String listpath) throws InterruptedException - { - if (!isIdValid(from) || !isIdValid(to) || listpath == null || listpath.equals("")) - { - return false; - } - - obj_var_list ovl = getObjVarList(from, listpath); - if (ovl == null) - { - return false; - } - - boolean litmus = true; - - int numItems = ovl.getNumItems(); - for (int i = 0; i < numItems; i++) - { - testAbortScript(); - obj_var ov = ovl.getObjVar(i); - if (ov != null) - { - litmus &= copyObjVar(from, to, listpath + "."+ ov.getName()); - } - } - - return litmus; - } - - - public static string_id getCardinalDirectionForPoints(location locTest1, location locTest2) throws InterruptedException - { - String cardinalString = getStringCardinalDirection(locTest1, locTest2); - if (cardinalString == null || cardinalString.equals("")) - { - return null; - } - - return new string_id("mission/mission_generic", cardinalString); - } - - - public static String getStringCardinalDirection(location locTest1, location locTest2, boolean abbreviated) throws InterruptedException - { - if (locTest1 == null || locTest2 == null) - { - return null; - } - - float fltAngle = getHeadingToLocation(locTest1, locTest2); - - if ((fltAngle>=-22.5)&&(fltAngle <= 22.5)) - { - if (!abbreviated) - { - return "north"; - } - else - { - return "N"; - } - } - else if ((fltAngle>=-67.5)&&(fltAngle<=-22.5)) - { - if (!abbreviated) - { - return "northeast"; - } - else - { - return "NE"; - } - } - else if ((fltAngle>=-112.5)&&(fltAngle<=-67.5)) - { - if (!abbreviated) - { - return "east"; - } - else - { - return "E"; - } - } - else if ((fltAngle>=-157.5)&&(fltAngle<=-112.5)) - { - if (!abbreviated) - { - return "southeast"; - } - else - { - return "SE"; - } - } - - else if ((fltAngle >= 22.5)&&(fltAngle <= 67.5)) - { - if (!abbreviated) - { - return "northwest"; - } - else - { - return "NW"; - } - } - else if ((fltAngle >= 67.5)&&(fltAngle <= 112.5)) - { - if (!abbreviated) - { - return "west"; - } - else - { - return "W"; - } - } - else if ((fltAngle >= 112.5)&&(fltAngle <= 157.5)) - { - if (!abbreviated) - { - return "southwest"; - } - else - { - return "SW"; - } - } - else - { - if (!abbreviated) - { - return "south"; - } - else - { - return "S"; - } - } - } - - - public static String getStringCardinalDirection(location locTest1, location locTest2) throws InterruptedException - { - return getStringCardinalDirection(locTest1, locTest2, false); - } - - - public static boolean isContainer(obj_id target) throws InterruptedException - { - if (isIdValid(target)) - { - return (getContainerType(target)!=0); - } - - return false; - } - - - public static boolean noIncapDrainAttributes(obj_id target, int actionCost, int mindCost) throws InterruptedException - { - if (!isIdValid(target) || actionCost < 0) - { - return false; - } - - if (getAttrib(target, ACTION) < actionCost) - { - - return false; - } - - return drainAttributes(target, actionCost, 0); - } - - - public static int getUnbuffedWoundedMaxAttrib(obj_id target, int attrib) throws InterruptedException - { - if (!isIdValid(target) || attrib < HEALTH || attrib > WILLPOWER) - { - return -1; - } - - int unmodmax = getUnmodifiedMaxAttrib(target, attrib); - return unmodmax; - } - - - public static boolean validatePlayerHairStyle(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - String hair_table = "datatables/customization/hair_assets_skill_mods.iff"; - - obj_id hair = getObjectInSlot(player, "hair"); - - if (!isIdValid(hair)) - { - return false; - } - - String hair_template = getTemplateName(hair); - - int idx = dataTableSearchColumnForString(hair_template, "SERVER_TEMPLATE", hair_table); - - if (idx < 0) - { - return false; - } - - String required_template = dataTableGetString(hair_table, idx, "SERVER_PLAYER_TEMPLATE"); - - if (required_template == null) - { - return false; - } - - String player_template = getTemplateName(player); - - if (!player_template.equals(required_template)) - { - - int new_hair_idx = dataTableSearchColumnForString(player_template, "SERVER_PLAYER_TEMPLATE", hair_table); - - String new_hair_template = dataTableGetString(hair_table, new_hair_idx, "SERVER_TEMPLATE"); - - if (new_hair_template == null) - { - CustomerServiceLog("imageDesigner", getFirstName(player) + "("+ player + ") has an invalid hairstyle, but a replacement cannot be found!"); - return false; - } - - destroyObject(hair); - createObject(new_hair_template, player, "hair"); - CustomerServiceLog("imageDesigner", getFirstName(player) + "("+ player + ") has an invalid hairstyle. It has been replaced with a default style."); - sendSystemMessageTestingOnly(player, "An illegal hairstyle has been detected on your character. This has been corrected."); - } - - return true; - } - - - public static String getPackedScripts(obj_id objObject) throws InterruptedException - { - String strTest = ""; - String[] strScripts = getScriptList(objObject); - if (strScripts.length > 0) - { - for (int intI = 0; intI 0) - { - debugSpeakMsg(objObject, "list length is "+strScripts.length); - String[] strCorrectArray = new String[strScripts.length]; - for (int intI = 0; intI -1) - { - script = script.substring( 7 ); - debugSpeakMsg(objObject, "setting array to "+script); - strCorrectArray[intI] = script; - } - } - return strCorrectArray; - } - return null; - - } - - - public static String[] unpackScriptString(String strScripts) throws InterruptedException - { - String[] strTest = split(strScripts, ','); - return strTest; - } - - - public static boolean isEquipped(obj_id item) throws InterruptedException - { - if (!isIdValid(item)) - { - return false; - } - - obj_id containedBy = getContainedBy(item); - return ( isIdValid(containedBy) && getContainerType(containedBy) == 1 ); - } - - - public static obj_id unequipWeaponHand(obj_id player) throws InterruptedException - { - return unequipSlot(player, "hold_r"); - } - - - public static obj_id unequipOffHand(obj_id player) throws InterruptedException - { - return unequipSlot(player, "hold_l"); - } - - - public static obj_id unequipSlot(obj_id player, String slot) throws InterruptedException - { - obj_id equipment = getObjectInSlot(player, slot); - if (isIdValid(equipment)) - { - obj_id playerInv = utils.getInventoryContainer(player); - if (isIdValid(playerInv)) - { - putInOverloaded(equipment, playerInv); - return equipment; - } - } - return obj_id.NULL_ID; - } - - - public static obj_id[] getAttackableTargetsInRadius(obj_id attacker, int radius, boolean player_targets) throws InterruptedException - { - - location loc = getLocation(attacker); - if (loc == null) - { - return null; - } - - obj_id[] objects = getObjectsInRange(loc, radius); - Vector attackable_targets = new Vector(); - attackable_targets.setSize(0); - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (isMob(objects[i])) - { - if (pvpCanAttack(attacker, objects[i])) - { - if (!isIncapacitated(objects[i]) && !isDead(objects[i])) - { - if (isPlayer(objects[i])) - { - if (!player_targets) - { - continue; - } - } - - if (canSee(attacker, objects[i])) - { - attackable_targets = utils.addElement(attackable_targets, objects[i]); - } - } - } - } - else if (ai_lib.isTurret(objects[i])) - { - if (pvpCanAttack(attacker, objects[i])) - { - - if (canSee(attacker, objects[i])) - { - attackable_targets = utils.addElement(attackable_targets, objects[i]); - } - } - } - } - - if (attackable_targets.size() < 1) - { - return null; - } - else - { - obj_id[] _attackable_targets = new obj_id[0]; - if (attackable_targets != null) - { - _attackable_targets = new obj_id[attackable_targets.size()]; - attackable_targets.toArray(_attackable_targets); - } - return _attackable_targets; - } - } - - - public static obj_id getTrapDroidId(obj_id player) throws InterruptedException - { - obj_id dataPad = getPlayerDatapad(player); - Vector data = getResizeableContents(dataPad); - - for (int i = 0; i < data.size(); i++) - { - testAbortScript(); - if (callable.hasCDCallable(((obj_id)(data.get(i)))) && hasObjVar(((obj_id)(data.get(i))), "module_data.trap_bonus")) - { - return ((obj_id)(data.get(i))); - } - } - - return null; - - } - - - public static int getTimeLeft(obj_id player, String toCheckFor, int timePenalty) throws InterruptedException - { - - int currentTime = getGameTime(); - int timeCalled = utils.getIntScriptVar(player, toCheckFor); - if (timeCalled < 1) - { - return -1; - } - - int timeDone = timeCalled + timePenalty; - int timeLeft = timeDone - currentTime; - - return timeLeft; - - } - - - public static int getTimeLeft(obj_id player, String toCheckFor, String modifiedTime) throws InterruptedException - { - - int currentTime = getGameTime(); - int timeCalled = utils.getIntScriptVar(player, toCheckFor); - if (timeCalled < 1) - { - return -1; - } - - int timePenalty = utils.getIntScriptVar(player, modifiedTime); - int timeDone = timeCalled + timePenalty; - int timeLeft = timeDone - currentTime; - - return timeLeft; - - } - - - public static boolean isFreeTrial(obj_id player) throws InterruptedException - { - return isFreeTrialAccount(player); - } - - - public static boolean isFreeTrial(obj_id player, obj_id target) throws InterruptedException - { - return isFreeTrialAccount(player); - - } - - - public static void notifyObject(obj_id objTarget, String strNotificationName, dictionary dctParams) throws InterruptedException - { - if (!isIdValid(objTarget)) - { - debugServerConsoleMsg(null, "Null object id passed into notifyObject, exceptioning"); - Thread.dumpStack(); - throw new InterruptedException(); - } - if (strNotificationName == null) - { - debugServerConsoleMsg(null, "null notification name passed into notifyObject, exceptioning"); - Thread.dumpStack(); - throw new InterruptedException(); - } - if (strNotificationName.equals("")) - { - debugServerConsoleMsg(null, "Empty Notification name passed into notifyObject, exceptioning"); - Thread.dumpStack(); - throw new InterruptedException(); - } - - try - { - int intReturn = script_entry.callMessageHandlers(strNotificationName, objTarget, dctParams); - return; - } - catch (Throwable err) - { - debugServerConsoleMsg(null, "Unable to call into callMessageHandlers "); - Thread.dumpStack(); - throw new InterruptedException(); - } - } - - - public static void callTrigger(String strTrigger, Object[] params) throws InterruptedException - { - try - { - script_entry.runScripts(strTrigger, params); - return; - } - catch (Throwable err) - { - debugServerConsoleMsg(null, "Unable to call into callMessageHandlers "); - Thread.dumpStack(); - throw new InterruptedException(); - } - } - - - public static String getCellName(obj_id building, obj_id cell) throws InterruptedException - { - - String[] cellNames = getCellNames(building); - - for (int i = 0; i < cellNames.length; i++) - { - testAbortScript(); - - String cellName = cellNames[i]; - obj_id thisCell = getCellId(building, cellName); - - if (thisCell == cell) - { - - return cellName; - } - } - - return ""; - } - - - public static String getRealPlayerFirstName(obj_id player) throws InterruptedException - { - String firstName = getPlayerName(player); - - if (firstName == null) - { - return null; - } - - int idx = firstName.toLowerCase().indexOf("corpse of"); - if (idx >= 0) - { - firstName = firstName.substring(idx+1); - } - - if (firstName.length() > 0) - { - char first = firstName.charAt(0); - first = Character.toUpperCase(first); - firstName = first + firstName.substring(1); - } - - return firstName; - } - - - public static void dismountRiderJetpackCheck(obj_id rider) throws InterruptedException - { - if (!isIdValid(rider)) - { - return; - } - - obj_id mount = getMountId (rider); - - if (!exists(mount)) - { - return; - } - - if (isIdValid(mount)) - { - pet_lib.doDismountNow(rider, false); - String name = getTemplateName (mount); - - if (vehicle.isJetPackVehicle(mount)) - { - string_id jetDismount = new string_id ("pet/pet_menu", "jetpack_dismount"); - sendSystemMessage(rider, jetDismount); - - obj_id petControlDevice = callable.getCallableCD(mount); - vehicle.storeVehicle(petControlDevice, rider); - } - } - - return; - } - - - public static location getLocationFromTransform(transform trTest) throws InterruptedException - { - location locTest = new location(); - vector vctTest = trTest.getPosition_p(); - locTest.x = vctTest.x; - locTest.y = vctTest.y; - locTest.z = vctTest.z; - return locTest; - } - - - public static int addClassRequirementAttributes(obj_id player, obj_id item, String[] names, String[] attribs, int firstFree, String prefix) throws InterruptedException - { - - if (hasObjVar(item, prefix + "classRequired")) - { - - String requiredClasses = getStringObjVar(item, prefix + "classRequired"); - java.util.StringTokenizer st = new java.util.StringTokenizer(requiredClasses, ","); - String requiredText = ""; - boolean qualifies = false; - - while (st.hasMoreTokens()) - { - testAbortScript(); - String classId = st.nextToken(); - String tmp = "@skl_n:class_"+ classId + "\0"; - if (st.hasMoreTokens()) - { - tmp += "\n\\>117\0"; - } - - requiredText += tmp; - - if (isProfession(player, stringToInt(classId))) - { - qualifies = true; - break; - } - } - - if (!qualifies) - { - names[firstFree] = "class_required"; - attribs[firstFree++] = requiredText; - } - } - - if (hasObjVar(item, prefix + "levelRequired")) - { - int minLevel = getIntObjVar(item, prefix + "levelRequired"); - if (minLevel > getLevel(player)) - { - names[firstFree] = "levelrequired"; - attribs[firstFree++] = "" + minLevel; - } - } - - return firstFree; - } - - - public static boolean testItemClassRequirements(obj_id player, String requiredClasses, boolean silent) throws InterruptedException - { - java.util.StringTokenizer st = new java.util.StringTokenizer(requiredClasses, ","); - String requiredText = ""; - - while (st.hasMoreTokens()) - { - testAbortScript(); - String classId = st.nextToken(); - if (isProfession(player, stringToInt(classId))) - { - return true; - } - } - - if (!silent) - { - sendSystemMessage(player, new string_id("spam", "classrequired")); - } - - return false; - } - - - public static boolean testItemClassRequirements(obj_id player, obj_id thing, boolean silent, String prefix) throws InterruptedException - { - if (!hasObjVar(thing, prefix + "classRequired")) - { - return true; - } - - String requiredClasses = getStringObjVar(thing, prefix + "classRequired"); - return testItemClassRequirements(player, requiredClasses, silent); - } - - - public static boolean testItemLevelRequirements(obj_id player, obj_id thing, boolean silent, String prefix) throws InterruptedException - { - if (!hasObjVar(thing, prefix + "levelRequired")) - { - return true; - } - - int minLevel = getIntObjVar(thing, prefix + "levelRequired"); - if (minLevel > getLevel(player)) - { - if (!silent) - { - prose_package pp = prose.getPackage(new string_id("spam", "levelrequired"), ""+ minLevel); - sendSystemMessageProse(player, pp); - } - return false; - } - - return true; - } - - - public static boolean testItemAbilityRequirements(obj_id player, obj_id thing, boolean silent, String prefix) throws InterruptedException - { - if (!hasObjVar(thing, prefix + "abilityRequired")) - { - return true; - } - - String commandRequired = getStringObjVar(thing, prefix + "abilityRequired"); - if (!hasCommand(player, commandRequired)) - { - if (!silent) - { - prose_package pp = prose.getPackage(new string_id("spam", "abilityrequired"), "@cmd_n:"+ toLower(commandRequired)); - sendSystemMessageProse(player, pp); - } - return false; - } - - return true; - } - - - public static boolean testItemSkillRequirements(obj_id player, obj_id thing, boolean silent, String prefix) throws InterruptedException - { - if (!hasObjVar(thing, prefix + "skillRequired")) - { - return true; - } - - String skillRequired = getStringObjVar(thing, prefix + "skillRequired"); - if (!hasSkill(player, skillRequired)) - { - if (!silent) - { - prose_package pp = prose.getPackage(new string_id("spam", "skill_required"), "@skl_n:"+ toLower(skillRequired)); - sendSystemMessageProse(player, pp); - } - return false; - } - - return true; - } - - - public static void makeItemNoDrop(obj_id item) throws InterruptedException - { - attachScript(item, "item.special.nomove"); - setObjVar(item, "noTrade", 1); - } - - - public static boolean isItemNoDrop(obj_id item) throws InterruptedException - { - return hasScript(item, "item.special.nomove") || hasObjVar(item, "noTrade"); - } - - - public static void clearNoDropFromItem(obj_id item) throws InterruptedException - { - detachScript(item, "item.special.nomove"); - removeObjVar(item, "noTrade"); - } - - - public static obj_id findNoTradeItem(obj_id[] items, boolean testPlayers) throws InterruptedException - { - return findNoTradeItem( items, testPlayers, false ); - } - - - public static obj_id findNoTradeItem(obj_id[] items, boolean testPlayers, boolean novendor) throws InterruptedException - { - if (items != null) - { - for (int i = 0; i < items.length; ++i) - { - testAbortScript(); - if (isIdValid(items[i]) && (testPlayers || !isPlayer(items[i]))) - { - if (novendor && hasScript( items[i], "terminal.vendor" )) - { - continue; - } - if (!canTrade(items[i])) - { - return items[i]; - } - else if (utils.isContainer(items[i])) - { - obj_id result = findNoTradeItem(getContents(items[i]), testPlayers); - if (isIdValid(result)) - { - return result; - } - } - } - } - } - return null; - } - - - public static obj_id findNoTradeItemNotVendor(obj_id[] items, boolean testPlayers) throws InterruptedException - { - return findNoTradeItem( items, testPlayers, true ); - } - - - public static obj_id hasWaypoint(obj_id player, String name) throws InterruptedException - { - if (!isIdValid(player) || name == null) - { - return null; - } - - obj_id[] waypoints = getWaypointsInDatapad(player); - if (waypoints == null) - { - return null; - } - - for (int i = 0; i < waypoints.length; ++i) - { - testAbortScript(); - if (isIdValid(waypoints[i])) - { - String waypointName = getWaypointName(waypoints[i]); - if (waypointName != null && waypointName.equals(name)) - { - return waypoints[i]; - } - } - } - return null; - } - - - public static boolean waypointExists(obj_id player, obj_id waypoint) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(waypoint)) - { - return false; - } - - obj_id[] waypoints = getWaypointsInDatapad(player); - if (waypoints == null || waypoints.length <= 0) - { - return false; - } - - for (int i = 0; i < waypoints.length; ++i) - { - testAbortScript(); - if (isIdValid(waypoints[i])) - { - if (waypoints[i] == waypoint) - { - return true; - } - } - } - return false; - } - - - public static boolean isExtendedASCII(String inString) throws InterruptedException - { - - if (inString == null) - { - return false; - } - - for (int i = 0; i < inString.length(); i++) - { - testAbortScript(); - int ASCIIValue = inString.charAt(i); - if (ASCIIValue < 0 || ASCIIValue > 255) - { - return true; - } - } - return false; - } - - - public static boolean isAntiDecay(obj_id item) throws InterruptedException - { - if (isIdValid(item) && hasObjVar(item, "antidecay")) - { - return true; - } - else - { - return false; - } - } - - - public static boolean makeAntiDecay(obj_id item) throws InterruptedException - { - if (isIdValid(item)) - { - setObjVar(item, "antidecay", 1); - attachScript(item, "systems.veteran_reward.antidecay_examine"); - - return true; - } - - else - { - - return false; - } - } - - - public static boolean removeAntiDecay(obj_id item) throws InterruptedException - { - if (isIdValid(item)) - { - if (hasObjVar(item, "antidecay")) - { - removeObjVar(item, "antidecay"); - } - - return true; - } - - else - { - return false; - } - } - - - public static boolean validItemForAntiDecay(obj_id item) throws InterruptedException - { - if (isIdValid(item)) - { - - if (jedi.isLightsaber(item)) - { - return true; - } - - if (isGameObjectTypeOf(item, GOT_armor_psg)) - { - return false; - } - - if (cloninglib.isDamagedOnCloneGOT(getGameObjectType(item)) || isGameObjectTypeOf(item, GOT_weapon)) - { - return true; - } - } - return false; - } - - - public static obj_id[] getLocalGroupMemberIds(obj_id group) throws InterruptedException - { - if (!isIdValid(group)) - { - return null; - } - - obj_id[] groupMemberIds = getGroupMemberIds(group); - if (groupMemberIds == null || groupMemberIds.length == 0) - { - return null; - } - - Vector localMemberIdsVector = new Vector(); - for (int i =0; i < groupMemberIds.length; ++i) - { - testAbortScript(); - if (isIdValid(groupMemberIds[i]) && exists(groupMemberIds[i]) && isPlayer(groupMemberIds[i])) - { - localMemberIdsVector.addElement(groupMemberIds[i]); - } - } - - if (localMemberIdsVector == null || localMemberIdsVector.size() < 1) - { - return null; - } - - return ( utils.toStaticObjIdArray(localMemberIdsVector)); - } - - - public static boolean canSpeakWookiee(obj_id player, obj_id npc) throws InterruptedException - { - if (hasSkill(player, "class_smuggler_phase1_novice")) - { - return false; - } - - if (hasSkill(player, "social_language_wookiee_comprehend")) - { - return false; - } - - else - { - return true; - } - } - - - public static void emoteWookieeConfusion(obj_id player, obj_id npc) throws InterruptedException - { - playClientEffectObj(npc, "clienteffect/voc_wookiee_med_4sec.cef", player, ""); - chat.thinkTo(player, player, new string_id("ep3/sidequests", "wke_convo_failure")); - } - - - public static void setObjVarsList(obj_id object, String objVarList) throws InterruptedException - { - if (objVarList == null || objVarList.equals("")) - { - return; - } - - String[] pairs = split(objVarList, ','); - for (int i = 0; i < pairs.length; i++) - { - testAbortScript(); - - String[] objVarToSet = split(pairs[i], '='); - String objVarValue = objVarToSet[1]; - - String[] objVarNameAndType = split(objVarToSet[0], ':'); - String objVarType = objVarNameAndType[0]; - String objVarName = objVarNameAndType[1]; - - if (objVarType.equals("string")) - { - setObjVar(object, objVarName, objVarValue); - } - else if (objVarType.equals("int")) - { - setObjVar(object, objVarName, utils.stringToInt( objVarValue)); - } - else if (objVarType.equals("float")) - { - setObjVar(object, objVarName, utils.stringToFloat( objVarValue)); - } - else if (objVarType.equals("boolean") || objVarType.equals("bool")) - { - setObjVar(object, objVarName, utils.stringToInt( objVarValue)); - } - else - { - setObjVar(object, objVarName, objVarValue); - } - - } - } - - - public static void setObjVarsListUsingSemiColon(obj_id object, String objVarList) throws InterruptedException - { - if (objVarList == null || objVarList.equals("")) - { - return; - } - - String[] pairs = split(objVarList, ','); - for (int i = 0; i < pairs.length; i++) - { - testAbortScript(); - - String[] objVarToSet = split(pairs[i], '='); - String objVarValue = objVarToSet[1]; - - String[] objVarNameAndType = split(objVarToSet[0], ';'); - String objVarType = objVarNameAndType[0]; - String objVarName = objVarNameAndType[1]; - - if (objVarType.equals("string")) - { - setObjVar(object, objVarName, objVarValue); - } - else if (objVarType.equals("int")) - { - setObjVar(object, objVarName, utils.stringToInt( objVarValue)); - } - else if (objVarType.equals("float")) - { - setObjVar(object, objVarName, utils.stringToFloat( objVarValue)); - } - else if (objVarType.equals("boolean") || objVarType.equals("bool")) - { - setObjVar(object, objVarName, utils.stringToInt( objVarValue)); - } - else - { - setObjVar(object, objVarName, objVarValue); - } - - } - } - - - public static boolean verifyLocationBasedDestructionAnchor(obj_id subject, float distance) throws InterruptedException - { - if (!hasObjVar(subject, "recordLoc")) - { - location recordLoc = getLocation(subject); - setObjVar(subject, "recordLoc", recordLoc); - return true; - } - - location verifyLoc = getLocationObjVar(subject, "recordLoc"); - location here = getLocation(getTopMostContainer(subject)); - float distanceDifference = getDistance(verifyLoc, here); - if (distanceDifference > distance || distanceDifference == -1f) - { - destroyObject(subject); - return false; - } - - return true; - } - - - public static boolean verifyLocationBasedDestructionAnchor(obj_id subject, location recordLoc, float distance) throws InterruptedException - { - if (!hasObjVar(subject, "recordLoc")) - { - setObjVar(subject, "recordLoc", recordLoc); - return true; - } - - location verifyLoc = getLocationObjVar(subject, "recordLoc"); - location here = getLocation(getTopMostContainer(subject)); - float distanceDifference = getDistance(verifyLoc, here); - if (distanceDifference > distance || distanceDifference == -1f) - { - destroyObject(subject); - return false; - } - - return true; - } - - - public static String assembleTimeRemainToUse(int time) throws InterruptedException - { - return assembleTimeRemainToUse(time, true); - } - - - public static String assembleTimeRemainToUse(int time, boolean localized) throws InterruptedException - { - - if (time <= 60) - { - String attrib = ""; - if (localized) - { - attrib = time + (time != 1 ? " $@spam:seconds$": " $@spam:second$"); - } - else - { - attrib = time + (time != 1 ? " seconds": " second"); - } - - return attrib; - } - - if (time > 60 && time <= 3600) - { - - int minutes = (int)Math.floor(time / 60); - - int remainder_time = time % 60; - - String attrib = ""; - if (localized) - { - attrib = minutes + (minutes != 1 ? " $@spam:minutes$, ": " $@spam:minute$, ") + remainder_time + (remainder_time != 1 ? " $@spam:seconds$": " $@spam:second$"); - } - else - { - attrib = minutes + (minutes != 1 ? " minutes, ": " minute, ") + remainder_time + (remainder_time != 1 ? " seconds": " second"); - } - return attrib; - } - - if (time > 3600 && time <= 86400) - { - - int hours = (int)Math.floor(time / 3600); - - int remainder_time = (time % 3600) / 60; - - String attrib = ""; - if (localized) - { - attrib = hours + (hours != 1 ? " $@spam:hours$, ": " $@spam:hour$, ") + remainder_time + (remainder_time != 1 ? " $@spam:minutes$": " $@spam:minute$"); - } - else - { - attrib = hours + (hours != 1 ? " hours, ": " hour, ") + remainder_time + (remainder_time != 1 ? " minutes": " minute"); - } - return attrib; - } - - if (time > 86400 && time < Integer.MAX_VALUE) - { - - int days = (int)Math.floor(time / 86400); - - int remainder_hours = (time % 86400) / 3600; - int remainder_minutes = (time % 3600) / 60; - - String attrib = ""; - if (localized) - { - attrib = days + (days != 1 ? " $@spam:days$, ": " $@spam:day$, ") + remainder_hours + (remainder_hours != 1 ? " $@spam:hours$, ": " $@spam:hour$, ") + - + remainder_minutes + (remainder_minutes != 1 ? " $@spam:minutes$": " $@spam:minute$"); - } - else - { - attrib = days + (days != 1 ? " days, ": " day, ") + remainder_hours + (remainder_hours != 1 ? " hours, ": " hour, ") + - + remainder_minutes + (remainder_minutes != 1 ? " minutes": " minute"); - } - - return attrib; - } - - return null; - } - - - public static boolean isProfession(obj_id player, int profession) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (!isPlayer(player)) - { - return false; - } - - String classTemplate = getSkillTemplate(player); - String professionName = ""; - - switch(profession) - { - case COMMANDO: - professionName = "commando"; - break; - case SMUGGLER: - professionName = "smuggler"; - break; - case MEDIC: - professionName = "medic"; - break; - case OFFICER: - professionName = "officer"; - break; - case SPY: - professionName = "spy"; - break; - case BOUNTY_HUNTER: - professionName = "bounty"; - break; - case FORCE_SENSITIVE: - professionName = "force"; - break; - case TRADER: - professionName = "trader"; - break; - case ENTERTAINER: - professionName = "entertainer"; - break; - default: - break; - } - - if (classTemplate != null && classTemplate.startsWith(professionName)) - { - return true; - } - return false; - } - - - public static int getPlayerProfession(obj_id player) throws InterruptedException - { - String[] noviceSkillList = - { - "class_forcesensitive_phase1_novice", - "class_bountyhunter_phase1_novice", - "class_smuggler_phase1_novice", - "class_commando_phase1_novice", - "class_officer_phase1_novice", - "class_spy_phase1_novice", - "class_medic_phase1_novice", - "class_entertainer_phase1_novice" - }; - - int[] professionList = - { - FORCE_SENSITIVE, - BOUNTY_HUNTER, - SMUGGLER, - COMMANDO, - OFFICER, - SPY, - MEDIC, - ENTERTAINER - }; - - for (int i=0; i 0) - { - - int[] housePacking = new int[utils.HOUSE_MAX]; - - if (!hasObjVar (objPlayer, "housePackup")) - { - setObjVar (objPlayer, "housePackup", housePacking); - } - - housePacking = getIntArrayObjVar (objPlayer, "housePackup"); - - if (housePacking.length != utils.HOUSE_MAX) - { - return; - } - - housePacking[0]++; - housePacking[1]++; - setObjVar (objPlayer, "housePackup", housePacking); - - if (!hasObjVar (objPlayer, "dailyHousePackup")) - { - setObjVar (objPlayer, "dailyHousePackup", 1); - int resetTime = getGameTime() + player_structure.TIME_TO_NEXT_PACKUP; - setObjVar (objPlayer, "maxHousePackupTimer", resetTime); - } - else - { - int dailyHousePacking = getIntObjVar (objPlayer, "dailyHousePackup"); - dailyHousePacking++; - setObjVar (objPlayer, "dailyHousePackup", dailyHousePacking); - } - - if (!badge.hasBadge (objPlayer, "house_packup_badge")) - { - int[] packupObjVar = getIntArrayObjVar (objPlayer, "housePackup"); - - if (packupObjVar != null && packupObjVar.length > 0) - { - if (packupObjVar[1] >= player_structure.NUM_NEEDED_PACKUP_FIRST_BADGE) - { - badge.grantBadge (objPlayer, "house_packup_badge"); - } - } - } - if (badge.hasBadge (objPlayer, "house_packup_badge")) - { - if (!badge.hasBadge (objPlayer, "house_packup_badge_master")) - { - int[] packupObjVar = getIntArrayObjVar (objPlayer, "housePackup"); - - if (packupObjVar != null && packupObjVar.length > 0) - { - if (packupObjVar[1] >= player_structure.NUM_NEEDED_PACKUP_SECOND_BADGE) - { - badge.grantBadge (objPlayer, "house_packup_badge_master"); - } - } - } - } - } - - else - { - - int[] housePacking = new int[utils.HOUSE_MAX]; - - housePacking = getIntArrayObjVar (objPlayer, "housePackup"); - - if (housePacking.length != utils.HOUSE_MAX) - { - return; - } - - housePacking[0]--; - setObjVar (objPlayer, "housePackup", housePacking); - } - } - - - public static boolean isInHouseCellSpace(obj_id object) throws InterruptedException - { - if (isIdValid(object)) - { - - if (isNestedWithinAPlayer(object)) - { - return false; - } - - obj_id house = getTopMostContainer(object); - if (isIdValid(house) && !player_structure.isBuilding(house)) - { - return false; - } - - obj_id container = getContainedBy(object); - if (isIdValid(container) && (getContainedBy(container) != house)) - { - return false; - } - - if (!hasObjVar(house, "player_structure.admin.adminList")) - { - return false; - } - - return true; - } - - return false; - } - - - public static boolean hasResourceInInventory(obj_id player, String resource) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (resource == null || resource.equals("")) - { - return false; - } - - obj_id[] contents = getFilteredPlayerContents(player); - if ((contents == null) || (contents.length == 0)) - { - return false; - } - - for (int n = 0; n < contents.length; n++) - { - testAbortScript(); - int got = getGameObjectType(contents[n]); - if (isGameObjectTypeOf(got, GOT_resource_container)) - { - obj_id resourceCrate = contents[n]; - if (isIdValid(resourceCrate)) - { - obj_id resourceId = getResourceContainerResourceType(resourceCrate); - if (isIdValid(resourceId)) - { - if (isResourceDerivedFrom(resourceId, resource)) - { - return true; - } - - } - } - } - } - return false; - } - - - public static obj_id[] validateObjIdArray(obj_id[] source) throws InterruptedException - { - Vector target = new Vector(); - target.setSize(0); - - for (int i = 0; i < source.length; i++) - { - testAbortScript(); - if (isIdValid(source[i]) && exists(source[i])) - { - addElement(target, source[i]); - } - } - - if (target != null) - { - source = new obj_id[target.size()]; - target.toArray(source); - } - - return source; - } - - - public static obj_id[] getPlayersInBuildoutRow(obj_id player) throws InterruptedException - { - location loc = getLocation(player); - return getPlayersInBuildoutRow(loc.area, locations.getBuildoutAreaRow(player)); - } - - - public static obj_id[] getPlayersInBuildoutDimensions(String scene, float x1, float x2, float z1, float z2) throws InterruptedException - { - float centX = Math.abs((x2 - x1) / 2.0f) + x1; - float centZ = Math.abs((z2 - z1) / 2.0f) + z1; - - location centerLoc = new location(centX, 0.0f, centZ, scene); - location lowerLeft = new location(x1, 0.0f, z1, scene); - - float hypotenuse = getDistance(centerLoc, lowerLeft); - - obj_id[] allPlayers = getAllPlayers(centerLoc, hypotenuse * 3.0f); - - Vector playersInArea = new Vector(); - playersInArea.setSize(0); - - if (allPlayers == null || allPlayers.length == 0) - { - return null; - } - - for (int i = 0; i < allPlayers.length; i++) - { - testAbortScript(); - location loc = getLocation(trial.getTop(allPlayers[i])); - - if (loc.x < x1 || loc.x > x2 || loc.z < z1 || loc.z > z2) - { - LOG("doLogging", ""+loc.x+" vs: "+x1+", "+x2+" and "+loc.z+" vs: "+z1+", "+z2); - continue; - } - - utils.addElement(playersInArea, allPlayers[i]); - } - - if (playersInArea == null || playersInArea.size() == 0) - { - return null; - } - - obj_id[] _playersInArea = new obj_id[0]; - if (playersInArea != null) - { - _playersInArea = new obj_id[playersInArea.size()]; - playersInArea.toArray(_playersInArea); - } - return _playersInArea; - } - - - public static dictionary getCoordinatesInBuildoutRow(String scene, int buildout_row) throws InterruptedException - { - String datatable = "datatables/buildout/areas_"+scene+".iff"; - dictionary data = dataTableGetRow(datatable, buildout_row); - - return data; - } - - - public static obj_id[] getPlayersInBuildoutRow(String scene, int buildout_row) throws InterruptedException - { - String datatable = "datatables/buildout/areas_"+scene+".iff"; - dictionary data = dataTableGetRow(datatable, buildout_row); - - return getPlayersInBuildoutDimensions(scene, data.getFloat("x1"), data.getFloat("x2"), data.getFloat("z1"), data.getFloat("z2")); - } - - - public static obj_id[] getPlayersInBuildoutArea(String scene, String buildout_area) throws InterruptedException - { - String datatable = "datatables/buildout/areas_"+scene+".iff"; - int rowNum = dataTableSearchColumnForString(buildout_area, 0, datatable); - - if (rowNum == -1) - { - return null; - } - - return getPlayersInBuildoutRow(scene, rowNum); - } - - - public static obj_id[] getAllNpcInBuildoutArea(obj_id baseObject) throws InterruptedException - { - location loc = getLocation(baseObject); - int buildout_area = locations.getBuildoutAreaRow(baseObject); - - obj_id[] allObjects = getAllObjectsInBuildoutArea(loc.area, buildout_area); - - if (allObjects == null || allObjects.length == 0) - { - return null; - } - - Vector allNpc = new Vector(); - allNpc.setSize(0); - - for (int i=0; i x2 || testLoc.z < z1 || testLoc.z > z2) - { - continue; - } - - objectsInArea.add(allObjects[i]); - - } - - if (objectsInArea == null || objectsInArea.size() == 0) - { - return null; - } - - obj_id[] _objectsInArea = new obj_id[0]; - if (objectsInArea != null) - { - _objectsInArea = new obj_id[objectsInArea.size()]; - objectsInArea.toArray(_objectsInArea); - } - return _objectsInArea; - - } - - - public static Vector shuffleArray(Vector list) throws InterruptedException - { - Vector newList = new Vector(); - - for (int size = list.size(); size > 0; size--) - { - testAbortScript(); - - int i = rand(0, (size - 1)); - - newList = utils.addElement(newList, list.get(i)); - list = utils.removeElementAt(list, i); - } - - if (newList == null || newList.size() == 0) - { - return null; - } - - return newList; - - } - - - public static boolean grantGift(obj_id player) throws InterruptedException - { - - if ((getCurrentBirthDate() - getPlayerBirthDate(player)) < 10) - { - return false; - } - - if (hasObjVar(player, XMAS_RECEIVED_VI1)) - { - return false; - } - - if (!isIdValid(player)) - { - return false; - } - - String config = getConfigSetting("GameServer", "grantGift"); - if (config != null) - { - if (config.equals("false")) - { - return false; - } - } - - if (isInTutorialArea(player)) - { - setObjVar(player, XMAS_NOT_RECEIVED_TUTORIAL, 1); - CustomerServiceLog("grantGift", getFirstName(player) + "("+ player + ") did not receive Christmas '06 gift because they logged in on the tutorial planet."); - return false; - } - - removeObjVar(player, XMAS_NOT_RECEIVED_TUTORIAL); - - obj_id inv = utils.getInventoryContainer(player); - if (!isIdValid(inv)) - { - CustomerServiceLog("grantGift", getFirstName(player) + "("+ player + ") did not have an inventory container. Didn't receive Christmas '06 gift, but not blocked from future attempt."); - return false; - } - - obj_id giftSelf = static_item.createNewItemFunction( "item_lifeday_gift_self_01_02", inv); - - obj_id giftOther = static_item.createNewItemFunction( "item_lifeday_gift_other_01_02", inv); - setObjVar(giftOther, LIFEDAY_OWNER, player); - - utils.sendMail(GIFT_GRANTED_SUB, GIFT_GRANTED, player, "System"); - setObjVar(player, XMAS_RECEIVED_VI1, 1); - CustomerServiceLog("grantGift", getFirstName(player) + "("+ player + ") has received his Christmas '06 gift."); - - return true; - } - - - public static void fullExpertiseReset(obj_id player, boolean storeBeast) throws InterruptedException - { - - if (storeBeast) - { - if (beast_lib.isBeastMaster(player)) - { - beast_lib.storeBeasts(player); - } - } - - if (utils.isProfession(player, utils.FORCE_SENSITIVE)) - { - if (buff.isInStance(player)) - { - buff.removeBuff(player, jedi.JEDI_STANCE); - } - - if (buff.isInFocus(player)) - { - buff.removeBuff(player, jedi.JEDI_FOCUS); - } - } - - respec.setRespecVersion(player); - - buff.removeAllBuffs(player, false, true); - - resetExpertises(player); - } - - - public static obj_id[] getAllRidersInVehicle(obj_id player, obj_id vehicle) throws InterruptedException - { - - if (!isIdValid(player) || !isIdValid(vehicle)) - { - return null; - } - if (!exists(player) || !exists(vehicle)) - { - return null; - } - - Vector resizeList = new Vector(); - resizeList.setSize(0); - - for (int i = 1; i <= 25; ++i) - { - testAbortScript(); - - obj_id tempRider = getObjectInSlot(vehicle, "rider"+i); - - if (!isIdValid(tempRider) || !exists(tempRider)) - { - continue; - } - - resizeList = addElement(resizeList, tempRider); - } - - obj_id[] _resizeList = new obj_id[0]; - if (resizeList != null) - { - _resizeList = new obj_id[resizeList.size()]; - resizeList.toArray(_resizeList); - } - return _resizeList; - } - - - public static void updateCTSObjVars(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return; - } - - boolean retrievedCtsOjbvars = false; - dictionary[] ctsOjbvars = null; - - String updateObjvar = utils.CTS_OBJVAR_HISTORY + ".1"; - if (!hasObjVar(player, updateObjvar)) - { - if ((ctsOjbvars == null) && !retrievedCtsOjbvars) - { - ctsOjbvars = getCharacterRetroactiveCtsObjvars(player); - retrievedCtsOjbvars = true; - } - - if ((ctsOjbvars != null) && (ctsOjbvars.length > 0)) - { - utils.updateRespecCTSObjvars(player, ctsOjbvars); - utils.updateBeastMasterCTSObjvars(player, ctsOjbvars); - } - - setObjVar(player, updateObjvar, 1); - } - - updateObjvar = utils.CTS_OBJVAR_HISTORY + ".2"; - if (!hasObjVar(player, updateObjvar)) - { - if ((ctsOjbvars == null) && !retrievedCtsOjbvars) - { - ctsOjbvars = getCharacterRetroactiveCtsObjvars(player); - retrievedCtsOjbvars = true; - } - - if ((ctsOjbvars != null) && (ctsOjbvars.length > 0)) - { - utils.updateHousePackupCTSObjvars(player, ctsOjbvars); - } - - setObjVar(player, updateObjvar, 1); - } - - } - - - public static void updateRespecCTSObjvars(obj_id player, dictionary[] ctsOjbvars) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return; - } - - if ((ctsOjbvars == null) || (ctsOjbvars.length <= 0)) - { - return; - } - - final int indexMostRecentTransfer = ctsOjbvars.length - 1; - if ((ctsOjbvars[indexMostRecentTransfer] != null) && ctsOjbvars[indexMostRecentTransfer].containsKey("respecsBought") && ctsOjbvars[indexMostRecentTransfer].isInt("respecsBought")) - { - final int respecsBoughtFromTransfer = ctsOjbvars[indexMostRecentTransfer].getInt("respecsBought"); - int respecsBoughtCurrentValue = 0; - if (hasObjVar(player, "respecsBought")) - { - respecsBoughtCurrentValue = getIntObjVar(player, "respecsBought"); - } - - if (respecsBoughtFromTransfer > respecsBoughtCurrentValue) - { - CustomerServiceLog("CharacterTransferRetroactiveHistory", "changing respecsBought objvar for "+ player + " from "+ respecsBoughtCurrentValue + " to "+ respecsBoughtFromTransfer); - setObjVar(player, "respecsBought", respecsBoughtFromTransfer); - } - } - - int[] recpecLevelsFromTransfer = - { - -1, -1, -1 - }; - for (int i = 0; i < ctsOjbvars.length; ++i) - { - testAbortScript(); - if ((ctsOjbvars[i] != null) && ctsOjbvars[i].containsKey(respec.PROF_LEVEL_ARRAY) && ctsOjbvars[i].isIntArray(respec.PROF_LEVEL_ARRAY)) - { - int[] levelArray = ctsOjbvars[i].getIntArray(respec.PROF_LEVEL_ARRAY); - if ((levelArray != null) && (levelArray.length == 3)) - { - if (levelArray[0] > recpecLevelsFromTransfer[0]) - { - recpecLevelsFromTransfer[0] = levelArray[0]; - } - - if (levelArray[1] > recpecLevelsFromTransfer[1]) - { - recpecLevelsFromTransfer[1] = levelArray[1]; - } - - if (levelArray[2] > recpecLevelsFromTransfer[2]) - { - recpecLevelsFromTransfer[2] = levelArray[2]; - } - } - } - } - - if ((recpecLevelsFromTransfer[0] > -1) || (recpecLevelsFromTransfer[1] > -1) || (recpecLevelsFromTransfer[2] > -1)) - { - int[] recpecLevelsCurrentValue = - { - -1, -1, -1 - }; - if (hasObjVar(player, respec.PROF_LEVEL_ARRAY)) - { - recpecLevelsCurrentValue = getIntArrayObjVar(player, respec.PROF_LEVEL_ARRAY); - } - - if ((recpecLevelsCurrentValue != null) && (recpecLevelsCurrentValue.length == 3)) - { - int[] recpecLevelsNewValue = - { - -1, -1, -1 - }; - recpecLevelsNewValue[0] = Math.max(recpecLevelsCurrentValue[0], recpecLevelsFromTransfer[0]); - recpecLevelsNewValue[1] = Math.max(recpecLevelsCurrentValue[1], recpecLevelsFromTransfer[1]); - recpecLevelsNewValue[2] = Math.max(recpecLevelsCurrentValue[2], recpecLevelsFromTransfer[2]); - - if ((recpecLevelsNewValue[0] != recpecLevelsCurrentValue[0]) || (recpecLevelsNewValue[1] != recpecLevelsCurrentValue[1]) || (recpecLevelsNewValue[2] != recpecLevelsCurrentValue[2])) - { - CustomerServiceLog("CharacterTransferRetroactiveHistory", "changing "+ respec.PROF_LEVEL_ARRAY + " objvar for "+ player + " from ("+ recpecLevelsCurrentValue[0] + ","+ recpecLevelsCurrentValue[1] + ","+ recpecLevelsCurrentValue[2] + ") to ("+ recpecLevelsNewValue[0] + ","+ recpecLevelsNewValue[1] + ","+ recpecLevelsNewValue[2] + ")"); - setObjVar(player, respec.PROF_LEVEL_ARRAY, recpecLevelsNewValue); - } - } - } - - if (hasObjVar(player, respec.PROF_LEVEL_ARRAY)) - { - - String skillTemplate = getSkillTemplate(player); - - int[] recpecLevelsValue = getIntArrayObjVar(player, respec.PROF_LEVEL_ARRAY); - - if ((skillTemplate != null) && (skillTemplate.length() > 0) && (recpecLevelsValue != null) && (recpecLevelsValue.length == 3)) - { - - int currentLevel = getLevel(player); - - if (!skillTemplate.startsWith("entertainer") && !skillTemplate.startsWith("trader")) - { - - int combatLevel = recpecLevelsValue[respec.PROF_LEVEL_COMBAT]; - - if (currentLevel < combatLevel) - { - respec.autoLevelPlayer(player, combatLevel, true); - } - } - - else if (skillTemplate.startsWith("entertainer")) - { - - int entLevel = recpecLevelsValue[respec.PROF_LEVEL_ENT]; - - if (currentLevel < entLevel) - { - respec.autoLevelPlayer(player, entLevel, true); - } - } - - else if (skillTemplate.startsWith("trader")) - { - - int traderLevel = recpecLevelsValue[respec.PROF_LEVEL_TRADER]; - - if (currentLevel < traderLevel) - { - respec.autoLevelPlayer(player, traderLevel, true); - } - } - } - } - } - - - public static void updateBeastMasterCTSObjvars(obj_id player, dictionary[] ctsOjbvars) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return; - } - - if ((ctsOjbvars == null) || (ctsOjbvars.length <= 0)) - { - return; - } - - HashSet abilities = new HashSet(); - - for (int i = 0; i < ctsOjbvars.length; ++i) - { - testAbortScript(); - if (ctsOjbvars[i] != null) - { - int j = 0; - while (true) - { - testAbortScript(); - final String objVarName = beast_lib.PLAYER_KNOWN_SKILLS_LIST + "."+ j; - if (ctsOjbvars[i].containsKey(objVarName) && ctsOjbvars[i].isIntArray(objVarName)) - { - final int[] objVarValue = ctsOjbvars[i].getIntArray(objVarName); - if ((objVarValue != null) && (objVarValue.length > 0)) - { - for (int k = 0; k < objVarValue.length; ++k) - { - testAbortScript(); - abilities.add(new Integer(objVarValue[k])); - } - } - - ++j; - } - else - { - break; - } - } - } - } - - if (!abilities.isEmpty()) - { - - Vector abilitiesCurrent = utils.getResizeableIntBatchObjVar(player, beast_lib.PLAYER_KNOWN_SKILLS_LIST); - - boolean updateRequired = false; - if ((abilitiesCurrent == null) || (abilitiesCurrent.size() <= 0)) - { - updateRequired = true; - } - else - { - - HashSet abilitiesCurrentNoDupes = new HashSet(); - for (int i = 0; i < abilitiesCurrent.size(); ++i) - { - testAbortScript(); - abilitiesCurrentNoDupes.add(new Integer(((Integer)(abilitiesCurrent.get(i))).intValue())); - } - - Iterator abilitiesIterator = abilitiesCurrentNoDupes.iterator(); - while (abilitiesIterator.hasNext()) - { - testAbortScript(); - Integer ability = (Integer)abilitiesIterator.next(); - abilities.add(ability); - } - - if (abilities.size() != abilitiesCurrentNoDupes.size()) - { - updateRequired = true; - } - } - - if (updateRequired) - { - int[] abilitiesNew = new int[abilities.size()]; - Iterator abilitiesIterator = abilities.iterator(); - String strAbilitiesNew = new String(); - int i = 0; - while (abilitiesIterator.hasNext() && (i < abilitiesNew.length)) - { - testAbortScript(); - Integer ability = (Integer)abilitiesIterator.next(); - abilitiesNew[i] = ability.intValue(); - strAbilitiesNew += ""+ abilitiesNew[i] + ", "; - - ++i; - } - - String strAbilitiesCurrent = new String(); - if ((abilitiesCurrent != null) && (abilitiesCurrent.size() > 0)) - { - for (int j = 0; j < abilitiesCurrent.size(); ++j) - { - testAbortScript(); - strAbilitiesCurrent += ""+ ((Integer)(abilitiesCurrent.get(j))).intValue() + ", "; - } - } - - CustomerServiceLog("CharacterTransferRetroactiveHistory", "changing "+ beast_lib.PLAYER_KNOWN_SKILLS_LIST + " objvar for "+ player + " from ("+ strAbilitiesCurrent + ") to ("+ strAbilitiesNew + ")"); - - utils.setBatchObjVar(player, beast_lib.PLAYER_KNOWN_SKILLS_LIST, abilitiesNew); - } - } - } - - - public static void updateHousePackupCTSObjvars(obj_id player, dictionary[] ctsOjbvars) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return; - } - - if ((ctsOjbvars == null) || (ctsOjbvars.length <= 0)) - { - return; - } - - int[] housePackupNewValues = - { - 0, 0 - }; - for (int i = 0; i < ctsOjbvars.length; ++i) - { - testAbortScript(); - if ((ctsOjbvars[i] != null) && ctsOjbvars[i].containsKey(player_structure.HOUSE_PACKUP_ARRAY_OBJVAR) && ctsOjbvars[i].isIntArray(player_structure.HOUSE_PACKUP_ARRAY_OBJVAR)) - { - int[] housePackupCTSValues = ctsOjbvars[i].getIntArray(player_structure.HOUSE_PACKUP_ARRAY_OBJVAR); - if ((housePackupCTSValues != null) && (housePackupCTSValues.length == 2)) - { - if (housePackupCTSValues[0] > 0) - { - housePackupNewValues[0] += housePackupCTSValues[0]; - } - - if (housePackupCTSValues[1] > 0) - { - housePackupNewValues[1] += housePackupCTSValues[1]; - } - } - } - } - - if ((housePackupNewValues[0] > 0) || (housePackupNewValues[1] > 0)) - { - int[] housePackupCurrentValues = - { - 0, 0 - }; - if (hasObjVar(player, player_structure.HOUSE_PACKUP_ARRAY_OBJVAR)) - { - housePackupCurrentValues = getIntArrayObjVar(player, player_structure.HOUSE_PACKUP_ARRAY_OBJVAR); - } - - if ((housePackupCurrentValues != null) && (housePackupCurrentValues.length == 2)) - { - housePackupNewValues[0] += housePackupCurrentValues[0]; - housePackupNewValues[1] += housePackupCurrentValues[1]; - - CustomerServiceLog("CharacterTransferRetroactiveHistory", "changing "+ player_structure.HOUSE_PACKUP_ARRAY_OBJVAR + " objvar for "+ player + " from ("+ housePackupCurrentValues[0] + ", "+ housePackupCurrentValues[1] + ") to ("+ housePackupNewValues[0] + ", "+ housePackupNewValues[1] + ")"); - setObjVar(player, player_structure.HOUSE_PACKUP_ARRAY_OBJVAR, housePackupNewValues); - } - } - } - - - public static String getOnlineOfflineStatus(obj_id player) throws InterruptedException - { - String returnData = ""; - - if (!isPlayer(player)) - { - returnData = "Deleted"; - } - else if (!isPlayerConnected(player)) - { - int lastLoginTime = getPlayerLastLoginTime(player); - - if (lastLoginTime > 0) - { - int timeDifference = getCalendarTime() - lastLoginTime; - - if (timeDifference > 0) - { - returnData = "Offline "+ utils.padTimeDHMS(timeDifference); - } - else - { - returnData = "Offline ????d:??h:??m:??s"; - } - } - else - { - returnData = "Unknown"; - } - } - else - { - String locText = "Unknown"; - dictionary playerLoc = getConnectedPlayerLocation(player); - - if (playerLoc == null) - { - return locText; - } - - String planet = playerLoc.getString("planet"); - - if (planet != null && planet.length() > 0) - { - locText = localize(new string_id("planet_n", planet)); - } - - String region = playerLoc.getString("region"); - - if (region != null && region.length() > 0) - { - locText += ": "+ localize(new string_id(region.substring(1, region.indexOf(":")), region.substring(region.indexOf(":") + 1, region.length()))); - } - - String city = playerLoc.getString("playerCity"); - - if (city != null && city.length() > 0) - { - locText += ", "+ city; - } - - returnData = "Online "+ locText; - } - return returnData; - } - - - public static String localizeSIDString(String text) throws InterruptedException - { - if (text == null || text.length() < 1) - { - return null; - } - - int left = 0; - - if (text.startsWith("@")) - { - left = 1; - } - - if (text.indexOf(":") < 0) - { - return text; - } - - return localize(new string_id(text.substring(left, text.indexOf(":")), text.substring(text.indexOf(":") + 1, text.length()))); - } - - - public static boolean colorizeItemFromWidget(obj_id player, obj_id item, String params) throws InterruptedException - { - - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(item) || !exists(item)) - { - utils.removeScriptVar(player, "veteranRewardItemColor.color_setting"); - return false; - } - - if (params == null || params.equals("")) - { - utils.removeScriptVar(player, "veteranRewardItemColor.color_setting"); - return false; - } - - String[] colorArray = split(params, ' '); - if (colorArray == null || colorArray.length <= 0) - { - utils.removeScriptVar(player, "veteranRewardItemColor.color_setting"); - return false; - } - - for (int i = 0; i < colorArray.length; i+=2) - { - testAbortScript(); - if (colorArray[i] == null || colorArray[i].equals("")) - { - break; - } - hue.setColor(item, colorArray[i], utils.stringToInt(colorArray[i+1])); - } - utils.removeScriptVar(player, "veteranRewardItemColor.color_setting"); - return true; - } - - - public static boolean validateSkillModsAttached(obj_id item) throws InterruptedException - { - return true; - } - - - public static int getNumCreaturesForSpawnLimit() throws InterruptedException - { - - final int intNumCreatures = getNumAI() - (getNumHibernatingAI() / 2); - if (intNumCreatures <= 0) - { - return 0; - } - - return intNumCreatures; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/library/vehicle.java b/sku.0/sys.server/compiled/game/script/library/vehicle.java deleted file mode 100644 index 9fd2f141b..000000000 --- a/sku.0/sys.server/compiled/game/script/library/vehicle.java +++ /dev/null @@ -1,1267 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.callable; -import script.library.colors; -import script.library.money; -import script.library.pet_lib; -import script.library.hue; -import script.library.space_transition; -import script.library.group; -import script.library.ai_lib; -import script.library.space_dungeon; -import script.library.buff; -import script.library.instance; - - -public class vehicle extends script.base_script -{ - public vehicle() - { - } - public static final int MAX_STORED_VEHICLES = 3; - public static final int MAX_STORED_VEHICLES_MUSTAFAR_EXPANSION = 6; - public static final int MAX_VEHICLES = 1; - - public static final int VAR_SPEED_MIN = 0; - public static final int VAR_SPEED_MAX = 1; - public static final int VAR_TURN_RATE_MIN = 2; - public static final int VAR_TURN_RATE_MAX = 3; - public static final int VAR_ACCEL_MIN = 4; - public static final int VAR_ACCEL_MAX = 5; - public static final int VAR_DECEL = 6; - public static final int VAR_SLOPE_MOD = 7; - public static final int VAR_DAMP_ROLL = 8; - public static final int VAR_DAMP_PITCH = 9; - public static final int VAR_DAMP_HEIGHT = 10; - public static final int VAR_GLIDE = 11; - public static final int VAR_BANKING = 12; - public static final int VAR_HOVER_HEIGHT = 13; - public static final int VAR_AUTO_LEVEL = 14; - public static final int VAR_STRAFE = 15; - - public static final string_id SID_SYS_CANT_CALL_LOC = new string_id("pet/pet_menu","cant_call_vehicle"); - public static final string_id SID_SYS_CANT_CALL_NUM = new string_id("pet/pet_menu","cant_call_vehicle"); - public static final string_id SID_SYS_HAS_MAX_VEHICLE = new string_id("pet/pet_menu","has_max_vehicle"); - public static final string_id SID_NO_GROUND_VEHICLE_IN_SPACE = new string_id("space/space_interaction", "no_ground_vehicle_in_space"); - public static final string_id SID_NOT_WHILE_IN_COMBAT = new string_id("pet/pet_menu","cannot_call_in_combat"); - public static final string_id SID_NOT_WHILE_DEAD = new string_id("pet/pet_menu", "cannot_call_while_dead"); - public static final string_id SID_NO_CALL_INDOORS = new string_id("pet/pet_menu", "cannot_call_indoors"); - - public static final String VEHICLE_FINISH = "player.vehicleCallFinish"; - - public static final string_id SID_SYS_USES_LEFT_NEW = new string_id("pet/pet_menu","uses_left_new"); - public static final string_id SID_SYS_USES_LEFT = new string_id("pet/pet_menu","uses_left"); - public static final string_id SID_SYS_USES_LEFT_LAST = new string_id("pet/pet_menu","uses_left_last"); - public static final string_id SID_SYS_USES_COMPLETE = new string_id("pet/pet_menu","uses_complete"); - public static final string_id SID_SUI_CONFIRM_VEHICLE_REPAIRS = new string_id("pet/pet_menu","sui_confirm_vehicle_repairs"); - - public static final String STF = "pet/pet_menu"; - public static final String VEHICLE_STAT_TABLE = "datatables/vehicle/vehicle_stats.iff"; - - public static final int MOD_TYPE_MAX_SPEED = 1; - public static final String OBJVAR_MOD_MAX_SPEED_DURATION = "vehicle.mod.maxSpeed.duration"; - public static final String OBJVAR_MOD_MAX_SPEED_OLD = "vehicle.mod.maxSpeed.old"; - - public static final String[] s_varInfoNames = new String[] - { - "/private/index_speed_min", - "/private/index_speed_max", - "/private/index_turn_rate_min", - "/private/index_turn_rate_max", - "/private/index_accel_min", - "/private/index_accel_max", - "/private/index_decel", - "/private/index_slope_mod", - "/private/index_damp_roll", - "/private/index_damp_pitch", - "/private/index_damp_height", - "/private/index_glide", - "/private/index_banking", - "/private/index_hover_height", - "/private/index_auto_level", - "/private/index_strafe", - }; - - public static final float[] s_varInfoConversions = new float[] - { - 10.0f, - 10.0f, - 1.0f, - 1.0f, - 10.0f, - 10.0f, - 10.0f, - 10.0f, - 10.0f, - 10.0f, - 10.0f, - 10.0f, - 1.0f, - 10.0f, - 100.0f, - 1.0f, - }; - - public static final int VEHICLE_DECAY_CYCLE = 600; - - public static final int CUSTOMIZATION_COUNT = 200; - - public static final String VAR_PALVAR_BASE = "ai.pet.palvar"; - public static final String VAR_PALVAR_VARS = VAR_PALVAR_BASE + ".vars"; - public static final String VAR_PALVAR_CNT = VAR_PALVAR_BASE + ".cnt"; - - - public static int setValue(obj_id vehicle, float value, int var_index) throws InterruptedException - { - String vi_name = s_varInfoNames[var_index]; - float vi_conversion = s_varInfoConversions[var_index]; - - int ivalue = (int)(value * vi_conversion); - setRangedIntCustomVarValue(vehicle, vi_name, ivalue); - - return ivalue; - } - - - public static float getValue(obj_id vehicle, int var_index) throws InterruptedException - { - String vi_name = s_varInfoNames[var_index]; - float vi_conversion = s_varInfoConversions[var_index]; - - int ivalue = getRangedIntCustomVarValue(vehicle, vi_name); - float value = ((float)ivalue) / vi_conversion; - - return value; - } - - - public static void setMinimumSpeed(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_SPEED_MIN); - } - - - public static void setMaximumSpeed(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_SPEED_MAX); - } - - - public static void setTurnRateMin(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_TURN_RATE_MIN); - } - - - public static void setTurnRateMax(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_TURN_RATE_MAX); - } - - - public static void setAccelMin(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_ACCEL_MIN); - } - - - public static void setAccelMax(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_ACCEL_MAX); - } - - - public static void setDecel(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_DECEL); - } - - - public static void setDampingRoll(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_DAMP_ROLL); - } - - - public static void setDampingPitch(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_DAMP_PITCH); - } - - - public static void setDampingHeight(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_DAMP_HEIGHT); - } - - - public static void setGlide(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_GLIDE); - } - - - public static void setBankingAngle(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_BANKING); - } - - - public static void setHoverHeight(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_HOVER_HEIGHT); - } - - - public static void setAutoLevelling(obj_id vehicle, float value) throws InterruptedException - { - setValue (vehicle, value, VAR_AUTO_LEVEL); - } - - - public static void setStrafe(obj_id vehicle, boolean canStrafe) throws InterruptedException - { - float value = canStrafe ? 1.0f : 0.0f; - setValue (vehicle, value, VAR_STRAFE); - } - - - public static float getMinimumSpeed(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_SPEED_MIN); - } - - - public static float getMaximumSpeed(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_SPEED_MAX); - } - - - public static float getTurnRateMin(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_TURN_RATE_MIN); - } - - - public static float getTurnRateMax(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_TURN_RATE_MAX); - } - - - public static float getAccelMin(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_ACCEL_MIN); - } - - - public static float getAccelMax(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_ACCEL_MAX); - } - - - public static float getDecel(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_DECEL); - } - - - public static float getDampingRoll(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_DAMP_ROLL); - } - - - public static float getDampingPitch(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_DAMP_PITCH); - } - - - public static float getDampingHeight(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_DAMP_HEIGHT); - } - - - public static float getGlide(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_GLIDE); - } - - - public static float getBankingAngle(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_BANKING); - } - - - public static float getHoverHeight(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_HOVER_HEIGHT); - } - - - public static float getAutoLevelling(obj_id vehicle) throws InterruptedException - { - return getValue (vehicle, VAR_AUTO_LEVEL); - } - - - public static boolean getStrafe(obj_id vehicle) throws InterruptedException - { - float value = getValue (vehicle, VAR_STRAFE); - return value > 0.0f ? true : false; - } - - - public static boolean isRidingVehicle(obj_id objPlayer) throws InterruptedException - { - obj_id objMount = getMountId(objPlayer); - - if (isIdValid(objMount)) - { - if (hasScript(objMount,"systems.vehicle_system.vehicle_base") || isBattlefieldVehicle(objMount)) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } - } - - - public static boolean isRidingBattlefieldVehicle(obj_id objPlayer) throws InterruptedException - { - obj_id objMount = getMountId(objPlayer); - - if (isIdValid(objMount)) - { - if (isBattlefieldVehicle(objMount)) - { - return true; - } - else - { - return false; - } - } - else - { - return false; - } - } - - - public static boolean isDriveableVehicle(obj_id objThing) throws InterruptedException - { - if (hasScript(objThing,"systems.vehicle_system.vehicle_base")) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isVehicle(obj_id obj) throws InterruptedException - { - return isGameObjectTypeOf (getGameObjectType (obj), GOT_vehicle); - } - - - public static boolean isBattlefieldVehicle(obj_id obj) throws InterruptedException - { - return isVehicle(obj) && hasScript(obj, "systems.vehicle_system.battlefield_vehicle"); - } - - - public static String getVehicleTemplate(obj_id controlDevice) throws InterruptedException - { - if (!isIdValid(controlDevice)) - { - return null; - } - - String ref = getVehicleReference(controlDevice); - if (ref == null || ref.equals("")) - { - return null; - } - - return dataTableGetString(create.VEHICLE_TABLE, ref, "OBJECT_TEMPLATE"); - } - - - public static void doTempMaxSpeedReduction(obj_id vehicle, float factor, float duration) throws InterruptedException - { - if (factor < 0.01f || factor > 1.0f) - { - return; - } - - if (hasObjVar(vehicle, OBJVAR_MOD_MAX_SPEED_OLD)) - { - return; - } - - float currentMaxSpeed = getMaximumSpeed(vehicle); - setObjVar(vehicle, OBJVAR_MOD_MAX_SPEED_OLD, currentMaxSpeed); - setObjVar(vehicle, OBJVAR_MOD_MAX_SPEED_DURATION, duration); - dictionary params = new dictionary(); - params.put("type", MOD_TYPE_MAX_SPEED); - messageTo(vehicle, "revertVehicleMod", params, duration, false); - setMaximumSpeed(vehicle, currentMaxSpeed * factor); - - return; - } - - - public static String getVehicleReference(obj_id controlDevice) throws InterruptedException - { - if (!isIdValid(controlDevice)) - { - return null; - } - - return getStringObjVar(controlDevice, "vehicle_attribs.object_ref"); - } - - - public static boolean repairVehicle(obj_id player, obj_id vehicle) throws InterruptedException - { - if (!isIdValid(player) || !isIdValid(vehicle) || !vehicle.isLoaded()) - { - return false; - } - - obj_id petControlDevice = callable.getCallableCD(vehicle); - - if ((isDisabled(vehicle) || getHitpoints(vehicle) < 1) && !canRepairDisabledVehicle(petControlDevice)) - { - sendSystemMessage(player, new string_id("pet/pet_menu", "cannot_repair_disabled")); - return false; - } - - obj_id garage = utils.getObjIdScriptVar(vehicle, "inRepairZone"); - if (!isIdValid(garage) || !garage.isLoaded()) - { - sendSystemMessage(player, new string_id("pet/pet_menu", "repair_unrecognized_garages")); - return false; - } - - if (utils.hasScriptVar(player, "vehicleRepair.pid")) - { - int oldpid = utils.getIntScriptVar(player, "vehicleRepair.pid"); - sui.closeSUI(player, oldpid); - utils.removeScriptVarTree(player, "vehicleRepair"); - } - - int cost = getVehicleRepairCost(vehicle); - - if (cost == 0) - { - sendSystemMessage(player, new string_id("pet/pet_menu", "undamaged_vehicle")); - return false; - } - else if (cost < 0) - { - sendSystemMessage(player, new string_id("pet/pet_menu", "repair_error")); - return false; - } - - int total = getTotalMoney(player); - - if (total < cost) - { - prose_package ppLackFunds = prose.getPackage(new string_id(STF, "lacking_funds")); - prose.setDI(ppLackFunds, cost - total); - sendSystemMessageProse(player, ppLackFunds); - return false; - } - - String prompt = getString(new string_id(STF, "vehicle_repair_d")); - - prompt += "\n\n"+ getString(new string_id(STF, "vehicle_prompt")) +getString(getNameStringId(vehicle)); - prompt += "\n"+ getString(new string_id(STF, "repair_cost_prompt")) + cost; - prompt += "\n"+ getString(new string_id(STF, "total_funds_prompt")) + total; - - String title = utils.packStringId(SID_SUI_CONFIRM_VEHICLE_REPAIRS); - - int pid = sui.msgbox(garage, player, prompt, sui.OK_CANCEL, title, "handleRepairConfirm"); - - if (pid > -1) - { - - utils.setScriptVar(player, "vehicleRepair.pid", pid); - utils.setScriptVar(player, "vehicleRepair.vehicle", vehicle); - utils.setScriptVar(player, "vehicleRepair.cost", cost); - return true; - } - - return false; - } - - - public static int getVehicleRepairCost(obj_id vehicle) throws InterruptedException - { - if (!isIdValid(vehicle)) - { - return -1; - } - - int toHeal = getMaxHitpoints(vehicle)-getHitpoints(vehicle); - - float repair_rate = getVehicleRepairRate(vehicle); - float city_base = 100f; - float city_add = 0f; - - int city_id = getCityAtLocation(getLocation(vehicle), 0); - obj_id city = cityGetCityHall(city_id); - if (isIdValid(city)) - { - String cityName = cityGetName(city_id); - String cityGarage = cityName + ".garageFee"; - if (hasObjVar(city, cityGarage)) - { - city_add = (float)getIntObjVar(city, cityGarage); - } - } - - if (!isIdValid(city)) - { - city = obj_id.NULL_ID; - } - utils.setScriptVar(vehicle, "vehicleRepair.city_id", city); - - float city_tax = ((city_base + city_add)/100f); - float city_cut = (((toHeal * repair_rate) * city_tax) - (toHeal * repair_rate)); - utils.setScriptVar(vehicle, "vehicleRepair.city_tax", city_cut); - - return Math.round((toHeal * repair_rate) * city_tax); - } - - - public static float getVehicleRepairRate(obj_id vehicle) throws InterruptedException - { - if (!isIdValid(vehicle)) - { - return -1f; - } - - obj_id controlDevice = callable.getCallableCD(vehicle); - - if (!isIdValid(controlDevice)) - { - return -1f; - } - - String ref = getVehicleReference(controlDevice); - if (ref == null || ref.equals("")) - { - return -1f; - } - - return dataTableGetFloat(create.VEHICLE_TABLE, ref, "REPAIR_RATE"); - } - - - public static void decayVehicle(obj_id vehicle) throws InterruptedException - { - if (!isIdValid(vehicle)) - { - return; - } - - int now = getGameTime(); - float decay_rate = getVehicleDecayRate(vehicle); - if (decay_rate <= 0f) - { - return; - } - - int decayAmt = 0; - if (utils.hasScriptVar(vehicle, "decay.stamp")) - { - int stamp = utils.getIntScriptVar(vehicle, "decay.stamp"); - int delta = now - stamp; - - float ratio = delta / VEHICLE_DECAY_CYCLE; - - decayAmt = Math.round(ratio * decay_rate); - } - else - { - decayAmt = Math.round(decay_rate / 2f); - } - - if (decayAmt <= 0) - { - return; - } - - int currentHP = getHitpoints(vehicle); - currentHP -= decayAmt; - - setHitpoints(vehicle, currentHP); - - obj_id vcd = callable.getCallableCD(vehicle); - - dictionary params = new dictionary(); - params.put("hp", currentHP); - params.put("penalty", decayAmt); - messageTo(vcd, "handleStoreVehicleDamage", params, 0f, false); - - utils.setScriptVar(vehicle, "decay.stamp", now); - messageTo(vehicle, "handleVehicleDecay", null, VEHICLE_DECAY_CYCLE, false); - } - - - public static float getVehicleDecayRate(obj_id vehicle) throws InterruptedException - { - if (!isIdValid(vehicle)) - { - return -1f; - } - - obj_id controlDevice = callable.getCallableCD(vehicle); - - if (!isIdValid(controlDevice)) - { - return -1f; - } - - String ref = getVehicleReference(controlDevice); - - if (ref == null || ref.equals("")) - { - return -1f; - } - - return dataTableGetFloat(create.VEHICLE_TABLE, ref, "DECAY_RATE"); - } - - - public static boolean isInValidUnpackLocation(obj_id master) throws InterruptedException - { - - if (isSpaceScene()) - { - sendSystemMessage(master, SID_NO_GROUND_VEHICLE_IN_SPACE); - return false; - } - - location yourLoc = getLocation(master); - - if (isIdValid(yourLoc.cell)) - { - sendSystemMessage(master, SID_NO_CALL_INDOORS); - return false; - } - if (isInRestrictedScene(master)) - { - sendSystemMessage(master, pet_lib.SID_SYS_VEHICLE_RESTRICTED_SCENE); - return false; - } - - return true; - } - - - public static boolean isInRestrictedScene(obj_id master) throws InterruptedException - { - String scene = getCurrentSceneName(); - String restrictionTable = "datatables/vehicle/vehicle_restrictions.iff"; - String[] restrictedScenes = dataTableGetStringColumn(restrictionTable, 0); - int[] restrictions = dataTableGetIntColumn(restrictionTable, 1); - - if (isIdValid(instance.getAreaInstanceController(master)) && !instance.vehicleAllowedInInstance(instance.getAreaInstanceController(master))) - { - sendSystemMessage(master, new string_id("instance", "no_vehicle")); - return true; - } - - if (hasObjVar(master, space_dungeon.VAR_DUNGEON_ID)) - { - return true; - } - - for (int i = 0; i < restrictedScenes.length; i++) - { - testAbortScript(); - if (restrictedScenes[i].equals(scene)) - { - if (restrictions[i] == 1) - { - if (isGod(master)) - { - sendSystemMessageTestingOnly(master, "GODMODE MSG: You are in a vehicle restricted scene."); - } - return true; - } - } - } - - return false; - } - - - public static boolean canQuickUnpack(obj_id master) throws InterruptedException - { - location yourLoc = getLocation(master); - if (isIdValid(yourLoc.cell)) - { - return false; - } - - if (isInRestrictedScene(master)) - { - return false; - } - - return true; - } - - - public static boolean isInValidCallState(obj_id player) throws InterruptedException - { - if (ai_lib.aiIsDead(player)) - { - sendSystemMessage(player, SID_NOT_WHILE_DEAD); - return false; - } - - if (ai_lib.isInCombat(player)) - { - sendSystemMessage(player, SID_NOT_WHILE_IN_COMBAT); - return false; - } - - return true; - } - - - public static boolean storeVehicle(obj_id vehicleControlDevice, obj_id player) throws InterruptedException - { - return storeVehicle(vehicleControlDevice, player, true); - } - - - public static boolean storeVehicle(obj_id vehicleControlDevice, obj_id player, boolean checkCombat) throws InterruptedException - { - obj_id currentVehicle = callable.getCDCallable(vehicleControlDevice); - - if (!isIdValid(currentVehicle)) - { - debugServerConsoleMsg(player, "+++ VEHICLE library . storeVehicle +++ current vehicle obj_id is NOT valid"); - return false; - } - - if (checkCombat) - { - if (pet_lib.wasInCombatRecently(currentVehicle, player, true) && !isJetPack(vehicleControlDevice)) - { - return false; - } - } - - debugServerConsoleMsg(player, "+++ VEHICLE library . storeVehicle +++ current vehicle obj_id is valid. Doing tons of stuff."); - - if (hasObjVar(vehicleControlDevice, "pet.uses_left")) - { - int uses = getIntObjVar(vehicleControlDevice, "pet.uses_left"); - - if (uses <= 0) - { - sendSystemMessage(player, SID_SYS_USES_COMPLETE); - destroyObject(vehicleControlDevice); - - return true; - } - } - - setTimeStored(vehicleControlDevice); - - int currentHP = getHitpoints(currentVehicle); - - dictionary params = new dictionary(); - params.put("hp", currentHP); - params.put("penalty", 0); - - messageTo(vehicleControlDevice, "handleStoreVehicleDamage", params, 0f, false); - - messageTo(currentVehicle, "handlePackRequest", null, 1, false); - - callable.setCDCallable(vehicleControlDevice, null); - - return true; - } - - - public static void setTimeStored(obj_id PCD) throws InterruptedException - { - setObjVar(PCD, "pet.timeStored", getGameTime()); - } - - - public static void storeAllVehicles(obj_id master) throws InterruptedException - { - debugServerConsoleMsg(master, "+++ VEHICLE library . storeAllVehicles +++ just entered function. master obj_id fed in is: "+ master); - - obj_id objVehicle = callable.getCallable(master, callable.CALLABLE_TYPE_RIDEABLE); - - if (isIdValid(objVehicle)) - { - if (!objVehicle.isLoaded() == false) - { - - messageTo(objVehicle, "handlePackRequest", null, 0, false); - } - else - { - if (group.isGrouped(objVehicle)) - { - obj_id group = getGroupObject(objVehicle); - - if (isIdValid(group)) - { - queueCommand(objVehicle, (1348589140), group, "", COMMAND_PRIORITY_IMMEDIATE); - } - } - - if (ai_lib.aiIsDead(master)) - { - debugServerConsoleMsg(master, "+++ VEHICLE library . storeAllVehicles +++ Game thinks that we're dead. Following that branch of storeAllVehicles"); - - boolean isFactionPet = (ai_lib.isNpc(objVehicle) || ai_lib.aiGetNiche(objVehicle) == NICHE_VEHICLE || ai_lib.isAndroid(objVehicle)); - - if (hasObjVar(objVehicle, battlefield.VAR_CONSTRUCTED) || isFactionPet) - { - - obj_id petControlDevice = callable.getCallableCD(objVehicle); - - if (isIdValid(petControlDevice)) - { - messageTo(petControlDevice, "handleFlagDeadCreature", null, 0, false); - } - - destroyObject(objVehicle); - } - else - { - debugServerConsoleMsg(master, "+++ VEHICLE library . storeAllVehicles +++ Looks like we're dead, but pet's weren't faction. Firing off a storeVehicle function."); - - storeVehicle(objVehicle, master); - } - } - else - { - - debugServerConsoleMsg(master, "+++ VEHICLE library . storeAllVehicles +++ We aren't dead. Firing off a storeVehicle function."); - storeVehicle(objVehicle, master); - } - } - } - } - - - public static boolean hasMaxStoredVehicles(obj_id player) throws InterruptedException - { - return callable.hasMaxStoredRideables(player); - } - - - public static void reHueVehicle(obj_id vehicleControlDevice, obj_id vehicle) throws InterruptedException - { - - int colorIdx = hue.getVarColorIndex(vehicleControlDevice, hue.INDEX_1); - if (hasObjVar(vehicleControlDevice, "creature_attribs.hue")) - { - colorIdx = getIntObjVar(vehicleControlDevice, "creature_attribs.hue"); - } - - hue.setColor(vehicle, hue.INDEX_1, colorIdx); - - return; - } - - - public static void saveVehicleInfo(obj_id vehicleControlDevice, obj_id vehicle) throws InterruptedException - { - if (!isIdValid(vehicle) || !isIdValid(vehicleControlDevice)) - { - return; - } - - if (!vehicle.isLoaded()) - { - return; - } - - obj_id master = getMaster(vehicle); - if (isIdValid(master) && master.isLoaded()) - { - setHomeLocation(vehicle, getLocation(master)); - } - - pet_lib.storeDamage(vehicle, vehicleControlDevice); - setObjVar(vehicleControlDevice, "pet.timeStored", getGameTime()); - - ranged_int_custom_var[] ri = hue.getPalcolorVars(vehicle); - if (ri != null && ri.length > 0) - { - boolean wasUpdated = false; - for (int i = 0; i < ri.length; i++) - { - testAbortScript(); - int val = ri[i].getValue(); - if (val > -1) - { - String varpath = VAR_PALVAR_VARS + "."+ ri[i].getVarName(); - int cur = getIntObjVar(vehicleControlDevice, varpath); - if (cur != val) - { - setObjVar(vehicleControlDevice, varpath, val); - } - } - } - - if (utils.hasScriptVar(vehicle, "customizationUpdated")) - { - setObjVar(vehicleControlDevice, VAR_PALVAR_CNT, CUSTOMIZATION_COUNT); - } - } - } - - - public static void storeDamage(obj_id vcd, int currentHP, int penalty) throws InterruptedException - { - - if (!isIdValid(vcd)) - { - return; - } - - if (currentHP == ATTRIB_ERROR) - { - - currentHP = getIntObjVar(vcd, "attrib.hit_points"); - currentHP -= penalty; - - if (currentHP < 0) - { - currentHP = 0; - } - - } - - setObjVar(vcd, "attrib.hit_points", currentHP); - } - - - public static void initializeVehicle(obj_id vehicle) throws InterruptedException - { - initializeVehicle(vehicle, null); - } - - - public static void initializeVehicle(obj_id vehicle, obj_id player) throws InterruptedException - { - - if (!isIdValid(player)) - { - player = vehicle; - } - - String datatable = VEHICLE_STAT_TABLE; - String row = getTemplateName (vehicle); - - if (dataTableHasColumn (datatable, "min_speed")) - { - float minSpeed = dataTableGetFloat (datatable, row, "min_speed"); - setMinimumSpeed (vehicle, minSpeed); - } - - if (dataTableHasColumn (datatable, "speed")) - { - float speed = dataTableGetFloat (datatable, row, "speed"); - setMaximumSpeed (vehicle, speed); - } - - if (dataTableHasColumn (datatable, "turn_rate")) - { - float turnRate = dataTableGetFloat (datatable, row, "turn_rate"); - float turnSkillMod = getEnhancedSkillStatisticModifier (player, "force_vehicle_control"); - - turnRate = turnRate + turnSkillMod; - setTurnRateMin (vehicle, turnRate); - } - - if (dataTableHasColumn (datatable, "turn_rate_max")) - { - float turnRateMax = dataTableGetFloat (datatable, row, "turn_rate_max"); - float maxTurnSkillMod = getEnhancedSkillStatisticModifier (player, "force_vehicle_control"); - - turnRateMax = turnRateMax + maxTurnSkillMod; - setTurnRateMax (vehicle, turnRateMax); - } - - if (dataTableHasColumn (datatable, "accel_min")) - { - float accelMin = dataTableGetFloat (datatable, row, "accel_min"); - float accelSkillMod = getEnhancedSkillStatisticModifier (player, "force_vehicle_speed"); - - accelMin = accelMin + accelSkillMod; - setAccelMin (vehicle, accelMin); - } - - if (dataTableHasColumn (datatable, "accel_max")) - { - float accelMax = dataTableGetFloat (datatable, row, "accel_max"); - float maxAccelSkillMod = getEnhancedSkillStatisticModifier (player, "force_vehicle_speed"); - - accelMax = accelMax + maxAccelSkillMod; - setAccelMax (vehicle, accelMax); - } - - if (dataTableHasColumn (datatable, "decel")) - { - float decel = dataTableGetFloat (datatable, row, "decel"); - float decelSkillMod = getEnhancedSkillStatisticModifier (player, "force_vehicle_speed"); - - decel = decel + decelSkillMod; - setDecel (vehicle, decel); - } - - if (dataTableHasColumn (datatable, "damping_roll")) - { - float dampingRoll = dataTableGetFloat (datatable, row, "damping_roll"); - setDampingRoll (vehicle, dampingRoll); - } - - if (dataTableHasColumn (datatable, "damping_pitch")) - { - float dampingPitch = dataTableGetFloat (datatable, row, "damping_pitch"); - setDampingPitch (vehicle, dampingPitch); - } - - if (dataTableHasColumn (datatable, "damping_height")) - { - float dampingHeight = dataTableGetFloat (datatable, row, "damping_height"); - setDampingHeight (vehicle, dampingHeight); - } - - if (dataTableHasColumn (datatable, "glide")) - { - float glide = dataTableGetFloat (datatable, row, "glide"); - setGlide (vehicle, glide); - } - - if (dataTableHasColumn (datatable, "banking_angle")) - { - float bankingAngle = dataTableGetFloat (datatable, row, "banking_angle"); - setBankingAngle (vehicle, bankingAngle); - } - - if (dataTableHasColumn (datatable, "hover_height")) - { - float hoverHeight = dataTableGetFloat (datatable, row, "hover_height"); - setHoverHeight (vehicle, hoverHeight); - } - - if (dataTableHasColumn (datatable, "auto_level")) - { - float autoLevel = dataTableGetFloat (datatable, row, "auto_level"); - setAutoLevelling (vehicle, autoLevel); - } - - if (dataTableHasColumn (datatable, "strafe")) - { - int strafe = dataTableGetInt(datatable, row, "strafe"); - setStrafe (vehicle, strafe != 0); - } - - return; - } - - - public static boolean mountPermissionCheck(obj_id vehicle, obj_id rider, boolean verbose) throws InterruptedException - { - if (!isIdValid(vehicle) || !isIdValid(rider)) - { - return false; - } - - obj_id driver = getRiderId(vehicle); - - if (!isIdValid(driver)) - { - return false; - } - - if (getOwner(vehicle) == rider) - { - return true; - } - - if (!group.inSameGroup(rider, driver)) - { - return false; - } - - if (getState(rider, STATE_COMBAT) == 1) - { - if (verbose) - { - string_id strSpam = new string_id("vehicle/vehicle", "rider_in_combat"); - sendSystemMessage(rider, strSpam); - } - return false; - } - - if (factions.isDeclared(rider)) - { - if (factions.isDeclared(driver) && pvpAreFactionsOpposed(pvpGetAlignedFaction(rider), pvpGetAlignedFaction(driver))) - { - if (verbose) - { - string_id strSpam = new string_id("vehicle/vehicle", "rider_opposing_faction"); - sendSystemMessage(rider, strSpam); - } - return false; - } - else if (!factions.isDeclared(driver)) - { - if (verbose) - { - string_id strSpam = new string_id("vehicle/vehicle", "rider_overt_driver_not"); - sendSystemMessage(rider, strSpam); - } - return false; - } - } - - return true; - } - - - public static void restoreVehicle(obj_id player, obj_id vehicle) throws InterruptedException - { - obj_id tool = utils.getItemPlayerHasByTemplate(player, "object/tangible/item/ep3/barc_repair_tool.iff"); - if (!isIdValid(tool)) - { - return; - } - - clearCondition(vehicle, CONDITION_DISABLED); - int maxHp = getMaxHitpoints(vehicle); - setHitpoints(vehicle, maxHp); - - int currentCount = getCount(tool); - if (currentCount > 1) - { - --currentCount; - setCount(tool, currentCount); - } - else - { - destroyObject(tool); - } - } - - - public static boolean isJetPack(obj_id vehicleControlDevice) throws InterruptedException - { - String name = getVehicleTemplate(vehicleControlDevice); - if (name.equals("object/mobile/vehicle/jetpack.iff")) - { - return true; - } - return false; - } - - - public static void applyVehicleBuffs(obj_id player, obj_id vehicle) throws InterruptedException - { - String template = getTemplateName(vehicle); - if (template == null || template.equals("")) - { - LOG("mount", template + " bailed out because template is bad"); - return; - } - - dictionary vehicleData = new dictionary(); - vehicleData = dataTableGetRow(VEHICLE_STAT_TABLE, template); - if (vehicleData == null || vehicleData.equals("")) - { - LOG("mount", vehicleData + " bailed out because row in datatable is bad"); - return; - } - - String buffName = vehicleData.getString("player_buff"); - String vehicleBuffName = vehicleData.getString("vehicle_buff"); - String clientEffect = vehicleData.getString("buff_client_effect"); - - boolean hasPlayerBuff = buffName != null && !buffName.equals(""); - boolean hasVehicleBuff = vehicleBuffName != null && !vehicleBuffName.equals(""); - - if (!hasPlayerBuff && !hasVehicleBuff) - { - LOG("mount","bailed out because this vehicle has no buffs"); - return; - } - - if (hasPlayerBuff && buff.canApplyBuff(player, buffName)) - { - buff.applyBuff(player, buffName); - - if (clientEffect != null && !clientEffect.equals("")) - { - playClientEffectObj(player, clientEffect, vehicle, ""); - } - } - - if (hasVehicleBuff && buff.canApplyBuff(vehicle, vehicleBuffName)) - { - buff.applyBuff(vehicle, vehicleBuffName); - } - - return; - } - - - public static boolean canRepairDisabledVehicle(obj_id controlDevice) throws InterruptedException - { - String ref = getVehicleReference(controlDevice); - if (ref == null || ref.equals("")) - { - return false; - } - - if (dataTableGetInt(create.VEHICLE_TABLE, ref, "CAN_REPAIR_DISABLED") == 1) - { - return true; - } - - return false; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/vendor_lib.java b/sku.0/sys.server/compiled/game/script/library/vendor_lib.java deleted file mode 100644 index 53e7b7d5b..000000000 --- a/sku.0/sys.server/compiled/game/script/library/vendor_lib.java +++ /dev/null @@ -1,996 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.util.Vector; -import script.library.create; -import script.library.player_structure; -import script.library.static_item; - - -public class vendor_lib extends script.base_script -{ - public vendor_lib() - { - } - public static final String VAR_MAINTENANCE_RATE = "vendor.maintanence.rate"; - public static final String VAR_DECAY_RATE = "vendor.maintanence.decay"; - public static final String VAR_LAST_MAINTANENCE = "vendor.last_maintanence"; - public static final String VAR_CONDITION = "vendor.condition"; - public static final String VAR_MAX_CONDITION = "vendor.max_condition"; - public static final String VAR_PACKUP_VERSION = "vendor.packup_version"; - public static final String SPECIAL_VENDOR_IDENTIFIER = "vendor.special_vendor"; - - public static final int MAINTENANCE_HEARTBEAT = 3600; - - public static final int BASE_MAINT_RATE = 1; - public static final int BASE_DECAY_RATE = 2; - - public static final boolean LOGGING_ON = true; - public static final String LOGGING_CATEGORY = "vendor"; - public static final String STATIC_ITEM_DEED_NAME = "static_item_deed_name"; - - public static final String OWNER_OBJVAR = "object.owner"; - public static final String CHILD_GREETER_NONVENDOR_ID_OBJVAR = "object.child_greeter_nonvendor_objid"; - public static final String CNTRLR_GREETER_NONVENDOR_ID_OBJVAR = "object.terminal_greeter_nonvendor_objid"; - public static final String LASTKNOWN_GREETER_TERMINAL_LOC = "object.terminal_last_location"; - - public static final String NONVENDOR_VENDOR_SCRIPT = "terminal.nonvendor"; - public static final String NONVENDOR_VAR_PREFIX = "nonvendor"; - public static final String NONVENDOR_TYPE_PREFIX = "nonvendor_"; - public static final String NONTRADER_NONVENDOR_TYPE = NONVENDOR_VAR_PREFIX + ".give_nontrader"; - public static final String NONVENDOR_CREATURE_TYPE_SCRVAR = NONVENDOR_VAR_PREFIX + ".creature_type"; - public static final String NONVENDOR_NAMES_SCRVAR = NONVENDOR_VAR_PREFIX + ".unsplit_nonvendor_names"; - public static final String NONVENDOR_STRING_ID_SCRVAR = NONVENDOR_VAR_PREFIX + ".unsplit_nonvendor_string_ids"; - public static final String NONVENDOR_CREATURE_NAME_SCRVAR = NONVENDOR_VAR_PREFIX + ".selection_creature_name"; - public static final String NONVENDOR_CREATURE_TEMPLATE_SCRVAR = NONVENDOR_VAR_PREFIX + ".selection_nonvendor_template"; - public static final String NONVENDOR_CREATURE_TEMPLATE_LIST = NONVENDOR_VAR_PREFIX + ".selection_nonvendor_template_list"; - public static final String NONVENDOR_CREATURENAME_LIST_SCRVAR = NONVENDOR_VAR_PREFIX + ".selection_creature_name_list"; - public static final String NONVENDOR_SELECTION_SCRVAR = NONVENDOR_VAR_PREFIX + ".selection_string_id"; - public static final String NONVENDOR_CUSTOM_NAME_SCRVAR = NONVENDOR_VAR_PREFIX + ".creature_custom_name"; - public static final String NONVENDOR_APPEARANCE_LIST = NONVENDOR_VAR_PREFIX + ".appearance_list"; - - public static final String TCG_OBJVAR_PREFIX = "tcg"; - public static final String GREETER_OBJVAR_TREE = TCG_OBJVAR_PREFIX + ".greeter"; - public static final String GREETER_TYPE_PREFIX = "greeter_"; - public static final String GREETER_VAR_PREFIX = "greeter_prefix"; - public static final String CREATING_GREETER = GREETER_VAR_PREFIX+".creatingGreeter"; - public static final String GREETER_NOT_INIT_OBJVAR = GREETER_VAR_PREFIX+".greeter_not_initialized"; - public static final String GREETER_INIT_OBJVAR = GREETER_VAR_PREFIX+".greeter_initialized"; - public static final String GREETER_OWNER_OBJVAR = GREETER_VAR_PREFIX+".greeter_owner"; - public static final String GREETER_TYPE_OBJVAR = GREETER_VAR_PREFIX+".greeter_type"; - - public static final String GREETER_ACTIVE_OBJVAR = GREETER_VAR_PREFIX+".greeter_active"; - public static final String GREETER_IS_ACTIVATED_OBJVAR = GREETER_VAR_PREFIX+".greeter_currently_activated"; - public static final String GREETER_ANIMATES_OBJVAR = GREETER_VAR_PREFIX+".greeter_animates"; - public static final String GREETER_ANIMATING_OBJVAR = GREETER_VAR_PREFIX+".greeter_currently_animating"; - public static final String GREETER_VOICES_OBJVAR = GREETER_VAR_PREFIX+".greeter_voices"; - public static final String GREETER_VOICING_OBJVAR = GREETER_VAR_PREFIX+".greeter_currently_voicing"; - public static final String GREETER_SOUNDS_OBJVAR = GREETER_VAR_PREFIX+".greeter_sounds"; - public static final String GREETER_MOODS_OBJVAR = GREETER_VAR_PREFIX+".greeter_moods"; - public static final String GREETER_EFFECT_OBJVAR = GREETER_VAR_PREFIX+".greeter_effects"; - public static final String GREETER_HAS_EFFECT_OBJVAR = GREETER_VAR_PREFIX+".greeter_has_effect"; - public static final String GREETER_STATEMENT_OBJVAR = GREETER_VAR_PREFIX+".greeter_statement"; - public static final String GREETER_HAS_STATEMENT_OBJVAR = GREETER_VAR_PREFIX+".greeter_has_statement"; - public static final String GREETER_HAS_COLOR_OBJVAR = GREETER_VAR_PREFIX+".greeter_has_color"; - - public static final String CREATURE_TYPE = GREETER_VAR_PREFIX+".creature_type"; - - public static final String GREETER_DATA_OBTAINED = GREETER_VAR_PREFIX+".greeter_data_obtained"; - public static final String GREETER_TYPE = GREETER_VAR_PREFIX+".greeter_type"; - public static final String GREETER_CAN_DRESS_OBJVAR = GREETER_VAR_PREFIX+".greeter_can_be_dressed"; - public static final String GREETER_TYPE_NICHE = GREETER_VAR_PREFIX+".greeter_niche"; - public static final String GREETER_TYPE_HAS_FEMALE_OBJVAR = GREETER_VAR_PREFIX+".greeter_has_female"; - public static final String GREETER_TYPE_SPEAKBASIC_OBJVAR = GREETER_VAR_PREFIX+".greeter_speaks_basic"; - - public static final String GREETER_ACTUAL_ANIMATION = GREETER_VAR_PREFIX+".greeter_actual_animation"; - public static final String GREETER_ACTUAL_VOICE = GREETER_VAR_PREFIX+".greeter_actual_voice"; - public static final String GREETER_ACTUAL_MOOD = GREETER_VAR_PREFIX+".greeter_actual_mood"; - public static final String GREETER_ACTUAL_SOUND = GREETER_VAR_PREFIX+".greeter_actual_sound"; - public static final String GREETER_ACTUAL_EFFECT = GREETER_VAR_PREFIX+".greeter_actual_effect"; - public static final String GREETER_ACTUAL_STATEMENT = GREETER_VAR_PREFIX+".greeter_actual_statement"; - - public static final String GREETER_CREATURE_TYPE_OBJVAR = GREETER_VAR_PREFIX + ".greeter_verified_creature_type"; - public static final String GREETER_CREATURE_NAME_OBJVAR = GREETER_VAR_PREFIX + ".selection_creature_name"; - public static final String GREETER_NAMES_OBJVAR = GREETER_VAR_PREFIX + ".unsplit_greeter_names"; - public static final String GREETER_STRING_ID_OBJVAR = GREETER_VAR_PREFIX + ".unsplit_greeter_string_ids"; - public static final String GREETER_CREATURENAME_LIST_OBJVAR = GREETER_VAR_PREFIX + ".selection_creature_name_list"; - public static final String GREETER_SELECTION_OBJVAR = GREETER_VAR_PREFIX + ".selection_string_id"; - public static final String GREETER_CUSTOM_NAME_OBJVAR = GREETER_VAR_PREFIX + ".creature_custom_name"; - public static final String GREETER_APPEARANCE_LIST = GREETER_VAR_PREFIX + ".appearance_list"; - public static final String GREETER_COLOR_OBJVAR = GREETER_VAR_PREFIX + ".color_setting"; - public static final String GREETER_ALREADY_BARKED_SCRVAR = GREETER_VAR_PREFIX + ".greeter_already_barked"; - - public static final String GREETER_HAS_NICHE_OBJVAR = GREETER_VAR_PREFIX + ".greeter_niche"; - public static final String GREETER_IS_DRESSABLE = GREETER_VAR_PREFIX + ".greeter_is_dressable"; - public static final String GREETER_SPEAKS_BASIC = GREETER_VAR_PREFIX + ".greeter_speaks_basic"; - public static final String GREETER_HAS_ANIMS_OBJVAR = GREETER_VAR_PREFIX + ".greeter_has_anims"; - public static final String GREETER_HAS_VO_OBJVAR = GREETER_VAR_PREFIX + ".greeter_has_vo"; - public static final String GREETER_HAS_SOUND_OBJVAR = GREETER_VAR_PREFIX + ".greeter_has_sound"; - public static final String GREETER_HAS_MOOD_OBJVAR = GREETER_VAR_PREFIX + ".greeter_has_mood"; - public static final String GREETER_HAS_CHAT_OBJVAR = GREETER_VAR_PREFIX + ".greeter_has_chat"; - - public static final String GREETER_SCRIPT = "terminal.greeter"; - public static final String GREETER_DEED_OBJVAR = "greeter.give_greeter"; - public static final String GREETER_OWNER_OID_OBJVAR = GREETER_VAR_PREFIX + ".greeter_owner"; - - public static final String TBL_VENDOR_ROOT_TBL_DIR = "datatables/vendor/"; - public static final String TBL_GREETER_ANIMS = "datatables/vendor/vendor_areabark_anims.iff"; - public static final String TBL_GREETER_MOODS = "datatables/vendor/vendor_areabark_moods.iff"; - public static final String TBL_GREETER_SAY_CHAT = "datatables/vendor/greeter_say_chat.iff"; - public static final String TBL_GREETER_SOUND_VOICE_EFFECT = "datatables/vendor/greeter_sound_voice_effect.iff"; - public static final String TBL_GREETER_NONVENDOR_TABLE = "datatables/vendor/greeter_nonvendor_data.iff"; - public static final String COL_CREATURE_TYPE = "creature_type"; - public static final String COL_GREETER_CREATURE_NAME = "greeter_creature_name"; - public static final String COL_NONVENDOR_CREATURE_NAME = "nonvendor_creature_name"; - public static final String COL_NONVENDOR_CREATURE_TEMPLATE = "nonvendor_template_name"; - public static final String COL_NICHE = "greeter_niche"; - public static final String COL_GRTR_STRING_ID = "greeter_appearance_string_id"; - public static final String COL_NONVNDR_STRING_ID = "nonvendor_appearance_string_id"; - public static final String COL_DRESSED = "greeter_can_be_dressed"; - public static final String COL_SPEAK_BASIC = "greeter_speaks_basic"; - public static final String COL_SAY_CHAT = "greeter_say_chat"; - public static final String COL_ANIMATES = "greeter_animates"; - public static final String COL_VO = "greeter_voice_over"; - public static final String COL_SOUNDS = "greeter_sounds"; - public static final String COL_MOODS = "greeter_has_moods"; - public static final String COL_COLOR = "greeter_can_color"; - - public static final int VAR_TRUE = 1; - public static final int VAR_FALSE = 0; - - public static final string_id SID_OBSCENE = new string_id("player_structure", "obscene"); - public static final string_id SID_INVALID_GREETER_TABLE_DATA = new string_id("player_vendor", "greeter_data_table_corrupt"); - public static final string_id SID_SYS_CREATE_GREETER_SUCCESS = new string_id("player_structure", "create_greeter_success"); - public static final string_id SID_INVENTORY_FULL_GENERIC = new string_id("player_structure", "inventory_full_generic"); - public static final string_id SID_GREETER_PACK_UP_SUCCESS = new string_id("player_structure", "greeter_packup_success"); - public static final string_id SID_GREETER_PACK_UP_FAILURE = new string_id("player_structure", "greeter_packup_failure"); - - - public static boolean payMaintenance(obj_id player, obj_id vendor, int amt) throws InterruptedException - { - if (player == null || player == obj_id.NULL_ID) - { - return false; - } - - if (vendor == null || vendor == obj_id.NULL_ID) - { - return false; - } - - if (amt < 1 || amt > 100000) - { - return false; - } - - dictionary params = new dictionary(); - params.put( money.DICT_MSG_PAYER, "1"); - return money.requestPayment( player, vendor, amt, "handleVendorPayment", params, true ); - } - - - public static boolean withdrawMaintenance(obj_id player, obj_id vendor, int amt) throws InterruptedException - { - if (player == null || player == obj_id.NULL_ID) - { - return false; - } - - if (vendor == null || vendor == obj_id.NULL_ID) - { - return false; - } - - if (amt < 1 || amt > 100000) - { - return false; - } - - dictionary d = new dictionary(); - d.put("player", player); - d.put("amount", amt); - return transferBankCreditsTo( vendor, player, amt, "msgVendorWithdrawSuccess", "msgVendorWithdrawFail", d ); - } - - - public static int decrementMaintenancePool(obj_id vendor, int amt) throws InterruptedException - { - if (vendor == null || vendor == obj_id.NULL_ID) - { - return -1; - } - - if (amt < 1) - { - return -1; - } - - int pool = getBankBalance( vendor ); - if (amt > pool) - { - return -2; - } - - if (money.bankTo( vendor, money.ACCT_VENDOR, amt )) - { - CustomerServiceLog( "vendor", "Vendor decrement maintenance pool. Vendor "+ vendor + " Amount: "+ amt ); - return pool - amt; - } - else - { - return -1; - } - } - - - public static int damageVendor(obj_id vendor, int amt) throws InterruptedException - { - if (vendor == null || vendor == obj_id.NULL_ID) - { - return -1; - } - - if (amt < 1) - { - return -1; - } - - int condition = getVendorCondition( vendor ); - - condition = condition - amt; - - CustomerServiceLog( "vendor", "VENDOR DAMAGE DUE TO NO EMPTY MAINTENANCE POOL! Vendor "+ vendor + " Damage: "+ amt ); - if (condition < 1) - { - CustomerServiceLog( "vendor", "VENDOR CONDITION ZERO! Disabling vendor due to nonpayment of maintenance. Vendor "+ vendor ); - CustomerServiceLog( "vendor", "Note: Vendor disable code is not finished. Vendor will continue to operate normally. Vendor "+ vendor ); - condition = 0; - - obj_id inv = utils.getInventoryContainer( vendor ); - if (inv == null) - { - inv = vendor; - } - setObjVar( inv, "vendor_deactivated", 1 ); - } - else - { - setObjVar(vendor, VAR_CONDITION, condition); - } - - return condition; - } - - - public static int repairVendor(obj_id vendor, int amt) throws InterruptedException - { - if (vendor == null || vendor == obj_id.NULL_ID) - { - return -1; - } - - if (amt < 1) - { - return -1; - } - - int condition = getVendorCondition( vendor ); - int max_condition = getMaxCondition( vendor ); - - condition = condition + amt; - - if (condition > max_condition) - { - condition = max_condition; - } - - setObjVar(vendor, VAR_CONDITION, condition); - CustomerServiceLog( "vendor", "Vendor repair damage. Vendor "+ vendor + " Amount: "+ amt ); - - if (condition == max_condition) - { - obj_id inv = utils.getInventoryContainer( vendor ); - if (inv == null) - { - inv = vendor; - } - removeObjVar( inv, "vendor_deactivated"); - } - - return condition; - } - - - public static int getMaintenanceRate(obj_id vendor) throws InterruptedException - { - return getIntObjVar( vendor, VAR_MAINTENANCE_RATE ); - } - - - public static int getMaintenancePool(obj_id vendor) throws InterruptedException - { - return getBankBalance( vendor ); - } - - - public static int getDecayRate(obj_id vendor) throws InterruptedException - { - return getIntObjVar( vendor, VAR_DECAY_RATE ); - } - - - public static int getVendorCondition(obj_id vendor) throws InterruptedException - { - return getIntObjVar( vendor, VAR_CONDITION ); - } - - - public static int getMaxCondition(obj_id vendor) throws InterruptedException - { - return getIntObjVar( vendor, VAR_MAX_CONDITION ); - } - - - public static void finalizePackUp(obj_id player, obj_id vendor, obj_id packer, boolean isAbandoned) throws InterruptedException - { - - obj_id vcd = null; - obj_id datapad = null; - - final boolean isLoadedAndAuthoritative = player.isLoaded() && player.isAuthoritative(); - - CustomerServiceLog("vendorpackup", "Player "+ getPlayerName(packer) + - " ("+ packer + ") is attempting to pack vendor ("+ vendor + ",abandoned="+ isAbandoned + ") owned by player "+ - getPlayerName(player) + " ("+ player + ")"); - - if (isLoadedAndAuthoritative) - { - datapad = utils.getPlayerDatapad(player); - } - else - { - datapad = utils.getPlayerDatapad(packer); - } - - if (!isIdValid(datapad)) - { - return; - } - vcd = createObjectOverloaded("object/intangible/vendor/generic_vendor_control_device.iff", datapad); - if (!isIdValid(vcd)) - { - return; - } - - if (isAbandoned) - { - setObjVar(vcd, "abandoned.packer", packer); - setObjVar(vcd, "abandoned.owner", player); - setObjVar(vcd, "abandoned.vendor", vendor); - } - - attachScript(vcd, "vendor.vendor_control_device"); - String vendorName = getName( vendor ); - - setObjVar(vendor, VAR_PACKUP_VERSION, 1); - - updateVendorStatus(vendor, VENDOR_STATUS_FLAG_PACKED); - - if (hasObjVar(vendor, "vendor.map_registered")) - { - removeObjVar(vendor, "vendor.map_registered"); - removePlanetaryMapLocation(vendor); - } - - setName(vcd, vendorName); - - putIn(vendor, vcd, player); - if (!isLoadedAndAuthoritative) - { - - final int maxDepth = isNpcVendor(vendor) ? 1 : 0; - - moveToOfflinePlayerDatapadAndUnload(vcd, player, maxDepth + 1); - fixLoadWith(vendor, player, maxDepth); - } - - CustomerServiceLog("vendorpackup", "Player "+ getPlayerName(packer) + - " ("+ packer + ") packed vendor ("+ vendor + ",abandoned="+ isAbandoned + ") owned by player "+ - getPlayerName(player) + " ("+ player + ") into device ("+ vcd +")"); - - return; - } - - - public static boolean isVendorPackUpEnabled() throws InterruptedException - { - return utils.checkConfigFlag("GameServer", "allowPlayersToPackVendors"); - } - - - public static obj_id getAuctionContainer(obj_id vendor) throws InterruptedException - { - obj_id container = utils.getInventoryContainer(vendor); - if (container == null) - { - container = vendor; - } - - return container; - } - - - public static boolean isNpcVendor(obj_id vendor) throws InterruptedException - { - - return getAuctionContainer(vendor) != vendor; - } - - - public static String[] getAllGreeterDatatableColumnNames(obj_id object, String datatablePath) throws InterruptedException - { - blog("vendor_lib.getAllGreeterDatatableColumnNames:init"); - - if (!isValidId(object) || !exists(object)) - { - return null; - } - else if (datatablePath == null || datatablePath.equals("")) - { - return null; - } - else if (!datatablePath.startsWith(TBL_VENDOR_ROOT_TBL_DIR)) - { - return null; - } - - String[] preParsedColList = dataTableGetColumnNames(datatablePath); - if (preParsedColList == null) - { - return null; - } - - int preParsedColListLength = preParsedColList.length; - if (preParsedColListLength < 0) - { - return null; - } - - blog("vendor_lib.getAllGreeterDatatableColumnNames: prevalidation completed"); - - Vector greeterColNames = new Vector(); - greeterColNames.setSize(0); - - for (int i = 0; i < preParsedColListLength; i++) - { - testAbortScript(); - if (preParsedColList[i].startsWith("greeter")) - { - greeterColNames = utils.addElement(greeterColNames, preParsedColList[i]); - } - } - - if (greeterColNames.size() <= 0) - { - return null; - } - blog("vendor_lib.getAllGreeterDatatableColumnNames: greeter col name list being returned."); - return (String[])greeterColNames.toArray(new String[0]); - } - - - public static boolean buildNpcInPlayerStructure(obj_id controller, obj_id player, String npcType) throws InterruptedException - { - if (!isValidId(controller) || !exists(controller)) - { - blog("vendor_lib.buildNpcInPlayerStructure: Unable to create a nonvendor: deed invalid."); - return false; - } - if (!isValidId(player) || !exists(player)) - { - blog("vendor_lib.buildNpcInPlayerStructure: Unable to create a nonvendor: player invalid."); - return false; - } - if (npcType == null || npcType.equals("")) - { - blog("vendor_lib.buildNpcInPlayerStructure: Unable to get NPC TYPE to create."); - return false; - } - - return buildNpcInPlayerStructure(controller, player, npcType, null); - } - - - public static boolean buildNpcInPlayerStructure(obj_id controller, obj_id player, String npcType, location where) throws InterruptedException - { - if (!isValidId(controller) || !exists(controller)) - { - blog("vendor_lib.buildNpcInPlayerStructure: Unable to create a nonvendor: deed invalid."); - return false; - } - if (!isValidId(player) || !exists(player)) - { - blog("vendor_lib.buildNpcInPlayerStructure: Unable to create a nonvendor: player invalid."); - return false; - } - if (npcType == null || npcType.equals("")) - { - blog("vendor_lib.buildNpcInPlayerStructure: Unable to create a nonvendor: npcType invalid."); - return false; - } - if (!npcType.startsWith(NONVENDOR_VAR_PREFIX) && !npcType.startsWith(GREETER_VAR_PREFIX)) - { - blog("vendor_lib.buildNpcInPlayerStructure: Unable to create a nonvendor: npcType could not be found."); - blog("vendor_lib.buildNpcInPlayerStructure: npcType received: "+npcType+" npcType needed:"+NONVENDOR_TYPE_PREFIX); - - return false; - } - if (!validateNpcPlacementInStructure(player)) - { - blog("vendor_lib.buildNpcInPlayerStructure: Unable to create a nonvendor: validateNpcPlacementInStructure said NO."); - return false; - } - - location loc = null; - if (where == null) - { - loc = getLocation(player); - } - else - { - loc = (location)where.clone(); - } - - if (loc == null) - { - blog("vendor_lib.buildNpcInPlayerStructure: Location could not be found"); - return false; - } - - String itemName = getStaticItemName(controller); - if (itemName == null || itemName.equals("")) - { - blog("vendor_lib.buildNpcInPlayerStructure: Static Item Name not found"); - return false; - } - - if (npcType.startsWith(NONVENDOR_VAR_PREFIX)) - { - blog("vendor_lib.buildNpcInPlayerStructure: I am a nonvendor vendor"); - - String nonVendorSpawn = utils.getStringScriptVar(player, NONVENDOR_CREATURE_TEMPLATE_SCRVAR); - if (nonVendorSpawn == null || nonVendorSpawn.equals("")) - { - blog("vendor_lib.buildNpcInPlayerStructure: Creature Name not found"); - return false; - } - obj_id nonVendorCreature = createObject(nonVendorSpawn, loc); - - blog("vendor_lib.buildNpcInPlayerStructure: created mob staticObject: "+nonVendorCreature); - String nonVendorName = utils.getStringScriptVar(player, NONVENDOR_CUSTOM_NAME_SCRVAR); - blog("vendor_lib.buildNpcInPlayerStructure: nonVendorName: "+nonVendorName); - if (nonVendorName != null && !nonVendorName.equals("")) - { - setName(nonVendorCreature, nonVendorName); - } - - setObjVar(nonVendorCreature, STATIC_ITEM_DEED_NAME, itemName); - setObjVar(nonVendorCreature, GREETER_OWNER_OBJVAR, player); - persistObject(nonVendorCreature); - setOwner(nonVendorCreature, player); - attachScript(nonVendorCreature, NONVENDOR_VENDOR_SCRIPT); - CustomerServiceLog("tcg", "TCG NonVendor: "+nonVendorCreature+" of type: "+nonVendorSpawn+" was placed at location: "+loc+ " by owner: "+ player + "."); - - return true; - } - - blog("vendor_lib.buildNpcInPlayerStructure: I am a GREETER"); - - String greeterSelection = utils.getStringObjVar(controller, vendor_lib.GREETER_CREATURE_NAME_OBJVAR); - if (greeterSelection == null || greeterSelection.equals("")) - { - blog("vendor_lib.buildNpcInPlayerStructure: Greeter Spawn String Not Found"); - return false; - } - String customName = utils.getStringObjVar(controller, vendor_lib.GREETER_CUSTOM_NAME_OBJVAR); - if (customName == null || customName.equals("")) - { - blog("vendor_lib.buildNpcInPlayerStructure: Greeter Custom Name Not Found"); - return false; - } - - String creatureType = utils.getStringObjVar(controller, vendor_lib.GREETER_CREATURE_TYPE_OBJVAR); - if (creatureType == null || creatureType.equals("")) - { - blog("vendor_lib.buildNpcInPlayerStructure: Creature Type Not Found"); - return false; - } - - blog("vendor_lib.buildNpcInPlayerStructure: primary greeter build validation complete. About to spawn: "+greeterSelection); - - obj_id greeterObj = create.staticObject(greeterSelection, loc); - if (!isValidId(greeterObj) || !exists(greeterObj)) - { - blog("vendor_lib.buildNpcInPlayerStructure: Greeter Creature Could NOT BE CREATED"); - return false; - } - - String greeterName = "Greeter: "+ customName; - setName(greeterObj, greeterName); - - setObjVar(controller, vendor_lib.CHILD_GREETER_NONVENDOR_ID_OBJVAR, greeterObj); - - setObjVar(greeterObj, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR, controller); - - setInvulnerable(greeterObj, true); - - attachScript(greeterObj, GREETER_SCRIPT); - setObjVar(greeterObj, STATIC_ITEM_DEED_NAME, itemName); - - ai_lib.setDefaultCalmBehavior(greeterObj, ai_lib.BEHAVIOR_SENTINEL); - setOwner(greeterObj, player); - setObjVar(greeterObj, vendor_lib.GREETER_OWNER_OBJVAR, player); - persistObject(greeterObj); - setObjVar(greeterObj, vendor_lib.CREATURE_TYPE, creatureType); - - if (utils.getIntObjVar(controller, GREETER_HAS_ANIMS_OBJVAR) == VAR_TRUE) - { - blog("player_building.buildGreeter: GREETER_ANIMATES_SCRVAR:"+utils.getIntScriptVar(player, GREETER_HAS_ANIMS_OBJVAR)); - setObjVar(greeterObj, GREETER_ANIMATES_OBJVAR, true); - } - if (utils.getIntObjVar(controller, GREETER_HAS_VO_OBJVAR) == VAR_TRUE) - { - blog("player_building.buildGreeter: GREETER_VO_SCRVAR:"+utils.getIntScriptVar(player, GREETER_HAS_VO_OBJVAR)); - setObjVar(greeterObj, GREETER_VOICES_OBJVAR, true); - } - if (utils.getIntObjVar(controller, GREETER_HAS_SOUND_OBJVAR) == VAR_TRUE) - { - blog("player_building.buildGreeter: GREETER_SOUNDS_SCRVAR:"+utils.getIntScriptVar(player, GREETER_HAS_SOUND_OBJVAR)); - setObjVar(greeterObj, GREETER_SOUNDS_OBJVAR, true); - } - if (utils.getIntObjVar(controller, GREETER_HAS_MOOD_OBJVAR) == VAR_TRUE) - { - blog("player_building.buildGreeter: GREETER_MOODS_SCRVAR:"+utils.getIntScriptVar(player, GREETER_HAS_MOOD_OBJVAR)); - setObjVar(greeterObj, vendor_lib.GREETER_MOODS_OBJVAR, true); - } - if (utils.getIntObjVar(controller, GREETER_HAS_CHAT_OBJVAR) == VAR_TRUE) - { - blog("player_building.buildGreeter: GREETER_SAY_CHAT_SCRVAR:"+utils.getIntScriptVar(player, GREETER_HAS_CHAT_OBJVAR)); - setObjVar(greeterObj, vendor_lib.GREETER_STATEMENT_OBJVAR, true); - } - if (utils.getIntObjVar(controller, GREETER_SPEAKS_BASIC) == VAR_TRUE) - { - blog("player_building.buildGreeter: GREETER_SPEAK_BASIC_SCRVAR:"+utils.getIntScriptVar(player, GREETER_SPEAKS_BASIC)); - setObjVar(greeterObj, vendor_lib.GREETER_TYPE_SPEAKBASIC_OBJVAR, true); - } - if (utils.getIntObjVar(controller, GREETER_IS_DRESSABLE) == VAR_TRUE) - { - blog("player_building.buildGreeter: GREETER_DRESSED_SCRVAR:"+utils.getIntScriptVar(player, GREETER_IS_DRESSABLE)); - setObjVar(greeterObj, vendor_lib.GREETER_CAN_DRESS_OBJVAR, true); - } - if (utils.getIntObjVar(controller, GREETER_HAS_NICHE_OBJVAR) == VAR_TRUE) - { - blog("player_building.buildGreeter: GREETER_NICHE_SCRVAR:"+utils.getIntScriptVar(player, GREETER_HAS_NICHE_OBJVAR)); - setObjVar(greeterObj, vendor_lib.GREETER_TYPE_NICHE, true); - } - if (utils.getIntObjVar(controller, GREETER_COLOR_OBJVAR) == VAR_TRUE) - { - blog("player_building.buildGreeter: GREETER_COLOR_OBJVAR:"); - setObjVar(greeterObj, vendor_lib.GREETER_COLOR_OBJVAR, true); - } - - setObjVar(controller, "unmoveable", 1); - sendSystemMessage(player, SID_SYS_CREATE_GREETER_SUCCESS); - CustomerServiceLog("tcg", "TCG Greeter: "+greeterObj+" of type: "+greeterSelection+" was placed at location: "+loc+ " by owner: "+ player + "."); - - return true; - } - - - public static boolean validateNpcPlacementInStructure(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - obj_id structure = getTopMostContainer(player); - if (!isValidId(structure) || !exists(structure)) - { - return false; - } - - if (!player_structure.isPlayerStructure(structure) || player_structure.isCivic(structure)) - { - return false; - } - - if (player_structure.isOwner(structure, player)) - { - return true; - } - - if (player_structure.isAdmin(structure, player)) - { - return true; - } - - return false; - } - - - public static String getGreeterNonVendorCreatureType(obj_id object, String greeterOrNonVendorType) throws InterruptedException - { - blog("vendor_lib.getGreeterNonVendorCreatureType init"); - - if (!isValidId(object) || !exists(object)) - { - return null; - } - else if (greeterOrNonVendorType == null || greeterOrNonVendorType.equals("")) - { - return null; - } - - blog("vendor_lib.getGreeterNonVendorCreatureType validation complete"); - String[] creatureTypes = dataTableGetStringColumnNoDefaults(TBL_GREETER_NONVENDOR_TABLE, COL_CREATURE_TYPE); - if (creatureTypes == null) - { - if (isPlayer(object)) - { - sendSystemMessage(object, SID_INVALID_GREETER_TABLE_DATA); - } - return null; - } - blog("vendor_lib.getGreeterNonVendorCreatureType creatureTypes received"); - - for (int i = 0; i < creatureTypes.length; i++) - { - testAbortScript(); - if (greeterOrNonVendorType.indexOf(creatureTypes[i]) == -1) - { - blog("vendor_lib.getGreeterNonVendorCreatureType greeterOrNonVendorType: "+ greeterOrNonVendorType + " "+creatureTypes[i]); - continue; - } - - blog("vendor_lib.getGreeterNonVendorCreatureType greeterOrNonVendorType FOUND: "+creatureTypes[i]+ "row: "+i); - return creatureTypes[i]; - } - blog("vendor_lib.getGreeterNonVendorCreatureType greeterOrNonVendorType NOT found"); - return null; - } - - - public static boolean isSpecialVendor(obj_id object) throws InterruptedException - { - if (!isValidId(object) || !exists(object)) - { - return false; - } - - if (!hasObjVar(object, vendor_lib.SPECIAL_VENDOR_IDENTIFIER)) - { - return false; - } - - if (getBooleanObjVar(object, vendor_lib.SPECIAL_VENDOR_IDENTIFIER) != true) - { - return false; - } - - return true; - } - - - public static obj_id setObjectOwner(obj_id controller) throws InterruptedException - { - if (!isValidId(controller) || !exists(controller)) - { - return null; - } - - obj_id owner = getOwner(controller); - if (!isValidId(owner)) - { - owner = utils.getContainingPlayer(controller); - if (!isValidId(owner) && !exists(owner)) - { - return null; - } - - setOwner(controller, owner); - } - - if (!hasObjVar(controller, vendor_lib.OWNER_OBJVAR)) - { - setObjVar(controller, vendor_lib.OWNER_OBJVAR, owner); - } - - return owner; - } - - - public static obj_id getObjectOwner(obj_id controller) throws InterruptedException - { - if (!isValidId(controller) || !exists(controller)) - { - return null; - } - - obj_id owner = getOwner(controller); - if (!isValidId(owner)) - { - owner = setObjectOwner(controller); - if (!isValidId(owner)) - { - return null; - } - } - return owner; - } - - - public static boolean isControllerOrChildInValidLocation(obj_id controller) throws InterruptedException - { - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - - obj_id structure = getTopMostContainer(controller); - if (!isValidId(structure) || !exists(structure)) - { - return false; - } - - if (!player_structure.isPlayerStructure(structure)) - { - return false; - } - - return true; - } - - - public static boolean isObjectInSameCellAsController(obj_id controller, obj_id object) throws InterruptedException - { - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - if (!isValidId(object) || !exists(object)) - { - return false; - } - - obj_id controllerStructure = getTopMostContainer(controller); - if (!isValidId(controllerStructure) || !exists(controllerStructure)) - { - return false; - } - - if (!player_structure.isPlayerStructure(controllerStructure)) - { - return false; - } - - location controllerLoc = getLocation(controller); - if (controllerLoc == null) - { - return false; - } - - location objLocation = getLocation(object); - if (objLocation == null) - { - return false; - } - - if (controllerLoc.cell != objLocation.cell) - { - return false; - } - - return true; - } - - - public static boolean recreateObject(obj_id controller, obj_id player) throws InterruptedException - { - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - - location where = getLocation(controller); - if (where == null) - { - return false; - } - - String npcType = ""; - if (hasObjVar(controller, NONVENDOR_VAR_PREFIX)) - { - npcType = NONVENDOR_VAR_PREFIX; - } - else if (hasObjVar(controller, GREETER_VAR_PREFIX)) - { - npcType = GREETER_VAR_PREFIX; - } - - if (npcType == null || npcType.equals("")) - { - return false; - } - - return buildNpcInPlayerStructure(controller, player, npcType, where); - } - - - public static boolean controllerContainmentCheck(obj_id controller) throws InterruptedException - { - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - if (utils.isNestedWithinAPlayer(controller)) - { - return false; - } - - obj_id building = getTopMostContainer(controller); - if (!player_structure.isPlayerStructure(building)) - { - return false; - } - location here = getLocation(controller); - if (getContainedBy(controller) == here.cell) - { - return true; - } - - return false; - } - - - public static boolean removeObjectFromController(obj_id controller, obj_id greeter) throws InterruptedException - { - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - - removeObjVar(controller, vendor_lib.CHILD_GREETER_NONVENDOR_ID_OBJVAR); - - if (isValidId(greeter) && exists(greeter)) - { - destroyObject(greeter); - } - - removeObjVar(controller, "unmoveable"); - - return true; - } - - - public static boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/weapons.java b/sku.0/sys.server/compiled/game/script/library/weapons.java deleted file mode 100644 index cdb79f1a9..000000000 --- a/sku.0/sys.server/compiled/game/script/library/weapons.java +++ /dev/null @@ -1,3457 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.combat; -import script.library.factions; -import script.library.heavyweapons; -import script.library.powerup; -import script.library.smuggler; -import script.library.trace; -import script.library.utils; - - -public class weapons extends script.base_script -{ - public weapons() - { - } - public static final String WEAPON_DATA_TABLE = "datatables/crafting/weapon_schematics.iff"; - public static final String COL_SCHEMATIC_NAME = "schematic_name"; - public static final String COL_CRAFTING_SCRIPT = "crafting_script"; - public static final String COL_ITEMS_PER_CONTAINER = "items_per_container"; - public static final String COL_NUM_COMPONENTS = "slots"; - public static final String COL_COMPLEXITY = "complexity"; - public static final String COL_XP = "xp"; - public static final String COL_XP_TYPE = "xp_type"; - public static final String COL_TEMPLATE = "crafted_object_template"; - public static final String COL_TEMPLATE_HASH = "crafted_object_template_hash"; - - public static final String COL_MIN_DMG_LOW = "min_damage_low"; - public static final String COL_MIN_DMG_HIGH = "min_damage_high"; - public static final String COL_MAX_DMG_LOW = "max_damage_low"; - public static final String COL_MAX_DMG_HIGH = "max_damage_high"; - - public static final String COL_MIN_DMG_HIGH_CAP = "min_damage_high_cap"; - public static final String COL_MAX_DMG_HIGH_CAP = "max_damage_high_cap"; - - public static final String COL_MIN_DMG_LOW_CAP = "min_damage_low_cap"; - public static final String COL_MAX_DMG_LOW_CAP = "max_damage_low_cap"; - - public static final String COL_SPEED_LOW = "attack_speed_low"; - public static final String COL_SPEED_HIGH = "attack_speed_high"; - - public static final String COL_WOUND_CHANCE_LOW = "wound_chance_low"; - public static final String COL_WOUND_CHANCE_HIGH = "wound_chance_high"; - - public static final String COL_HP_LOW = "hit_points_low"; - public static final String COL_HP_HIGH = "hit_points_high"; - - public static final String COL_ACCURACY_LOW = "min_accuracy_low"; - public static final String COL_ACCURACY_HIGH = "min_accuracy_high"; - - public static final String COL_MIN_RANGE_DISTANCE = "min_range_distance"; - public static final String COL_MAX_RANGE_DISTANCE = "max_range_distance"; - - public static final String COL_ATTACK_COST_LOW = "special_attack_cost_low"; - public static final String COL_ATTACK_COST_HIGH = "special_attack_cost_high"; - - public static final String COL_DAMAGE_TYPE = "damage_type"; - public static final String COL_ELEMENTAL_TYPE = "elemental_type"; - public static final String COL_ELEMENTAL_VALUE_LOW = "elemental_value_low"; - public static final String COL_ELEMENTAL_VALUE_HIGH = "elemental_value_high"; - - public static final String COL_SLOT_TYPE = "slot_type"; - public static final String COL_SLOT_OPTIONAL = "optional"; - public static final String COL_SLOT_NAME_KEY = "slot_name"; - public static final String COL_INGREDIENT = "slot_ingredient_name"; - public static final String COL_INGREDIENT_COUNT = "slot_ingredient_count"; - - public static final int VIA_TEMPLATE = 1; - public static final int VIA_SCHEMATIC = 2; - - public static final int DEFAULT_VALUE = 10; - public static final String WEAPONS = "weapons"; - - public static final float MIN_AOE_PERCENT = 0.1f; - public static final float MAX_AOE_PERCENT = 1f; - public static final float MAX_WEAPON_RANGE = 64; - - public static final float MAX_STAT_VALIDATION_INTENSITY = 1.00f; - - public static final String OBJVAR_NEW_WP = "newWeapon"; - public static final String OBJVAR_NEW_WP_COMPONENT = OBJVAR_NEW_WP + ".component"; - public static final String OBJVAR_NEW_WP_WEAPON = OBJVAR_NEW_WP + ".weapon"; - public static final String OBJVAR_WP_LEVEL = OBJVAR_NEW_WP + ".coreLevel"; - public static final String OBJVAR_WP_CORE_QUALITY_MIN = OBJVAR_NEW_WP + ".coreQualityMin"; - public static final String OBJVAR_WP_CORE_QUALITY_MAX = OBJVAR_NEW_WP + ".coreQualityMax"; - public static final String OBJVAR_MODIFIER_GAS_QUALITY_MIN = OBJVAR_NEW_WP + ".gasQualityMin"; - public static final String OBJVAR_MODIFIER_GAS_QUALITY_MAX = OBJVAR_NEW_WP + ".gasQualityMax"; - public static final String OBJVAR_MODIFIER_MELEE_QUALITY_MIN = OBJVAR_NEW_WP + ".meleeQualityMin"; - public static final String OBJVAR_MODIFIER_MELEE_QUALITY_MAX = OBJVAR_NEW_WP + ".meleeQualityMax"; - public static final String OBJVAR_MODIFIER_COMPONENT_BONUS_MIN = OBJVAR_NEW_WP + ".componentBonusMin"; - public static final String OBJVAR_MODIFIER_COMPONENT_BONUS_MAX = OBJVAR_NEW_WP + ".componentBonusMax"; - public static final String OBJVAR_MODIFIER_APPEARANCE_BONUS_MIN = OBJVAR_NEW_WP + ".appearanceBonusMin"; - public static final String OBJVAR_MODIFIER_APPEARANCE_BONUS_MAX = OBJVAR_NEW_WP + ".appearanceBonusMax"; - public static final String OBJVAR_ELEMENTAL_VALUE = OBJVAR_NEW_WP + ".elementalValue"; - public static final String OBJVAR_ELEMENTAL_TYPE = OBJVAR_NEW_WP + ".elementalType"; - public static final String OBJVAR_CRIT_BONUS_RANGED = OBJVAR_NEW_WP + ".critBonusRanged"; - public static final String OBJVAR_CRIT_BONUS_MELEE = OBJVAR_NEW_WP + ".critBonusMelee"; - - public static final int NEW_COMPONENT_MODIFIER = 1000; - public static final int WP_CORE_MODIFIER = 10; - public static final float NEW_COMPONENT_CAP = .075f; - public static final float NEW_WP_DAMAGE_CAP = 1.50f; - - public static final String[] WEAPON_TYPES = - { - "none", - "rifle", - "carbine", - "pistol", - "heavy", - "melee", - "directional", - "component" - }; - - public static final String[] ATTRIBUTES = - { - "HEALTH", - "CONSTITUTION", - "ACTION", - "STAMINA", - "MIND", - "WILLPOWER" - }; - - public static final String WEAPON_CORE_TABLE = "datatables/crafting/weapon_core.iff"; - public static final String WEAPON_APP_TABLE = "datatables/crafting/weapon_appearance.iff"; - public static final String WEAPON_APP_BONUS_TABLE = "datatables/crafting/appearance_bonus.iff"; - - public static final String WEAPON_CORE_LEVEL_COL = "core_level"; - - public static final String WEAPON_APP_TYPE = "type"; - public static final String WEAPON_APP_TEMPLATE = "crafted_object_template"; - public static final String WEAPON_APP_SPEED = "attack_speed_high"; - public static final String WEAPON_APP_WOUND = "wound_chance_high"; - public static final String WEAPON_APP_COST = "special_attack_cost_high"; - public static final String WEAPON_APP_DAMAGE_TYPE = "damage_type"; - public static final String WEAPON_APP_ELEMENT_TYPE = "elemental_type"; - public static final String WEAPON_APP_ACC = "accuracy_high"; - public static final String WEAPON_APP_MAX_RANGE = "max_range_distance"; - public static final String WEAPON_APP_MIN_RANGE = "min_range_distance"; - - public static final int NUM_DAMAGE_TYPES = 13; - - public static final string_id SID_WEAPON_TO_SCHEM = new string_id("spam", "weapon_to_schem"); - public static final string_id SID_CONVERT_PROMPT = new string_id("spam", "weapon_to_schem_prompt"); - public static final string_id SID_CONVERT_TITLE = new string_id("spam", "weapon_to_schem_title"); - public static final string_id SID_CONVERT_CONVERT_FAIL = new string_id("spam", "weapon_to_schem_failure"); - public static final string_id SID_CONVERT_CONVERT_SUCCESS = new string_id("spam", "weapon_to_schem_success"); - public static final string_id SID_CONVERT_INVALID_RESPONSE = new string_id("spam", "weapon_to_schem_invalid_response"); - public static final string_id SID_MIN_DAMAGE_GREATER_THAN_MAX = new string_id("spam", "min_damage_greater_than_max"); - - public static final String[] DAMAGE_TYPE_NAMES = new String[NUM_DAMAGE_TYPES]; - - public static final int CONVERSION_VERSION = 14; - public static final int CORED_WEAPON_CONVERSION_VERSION = 3; - - - public static int _GetTableValue(String col, String searchArg, int VIA_what) throws InterruptedException - { - String searchCol = COL_SCHEMATIC_NAME; - int row = -1; - - if (VIA_what == VIA_TEMPLATE) - { - searchCol = COL_TEMPLATE_HASH; - row = dataTableSearchColumnForInt(getStringCrc(searchArg), searchCol, WEAPON_DATA_TABLE); - } - else - { - row = dataTableSearchColumnForString(searchArg, searchCol, WEAPON_DATA_TABLE); - } - - if (row < 0) - { - return DEFAULT_VALUE; - } - - return dataTableGetInt(WEAPON_DATA_TABLE, row, col); - } - - - public static int getMinDamageLow(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_MIN_DMG_LOW)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_MIN_DMG_LOW); - } - - - public static int getMinDamageLow(String weaponName, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_MIN_DMG_LOW, weaponName, VIA_what); - } - - - public static int getMinDamageHigh(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_MIN_DMG_HIGH)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_MIN_DMG_HIGH); - } - - - public static int getMinDamageHighCap(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_MIN_DMG_HIGH_CAP)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_MIN_DMG_HIGH_CAP); - } - - - public static int getMinDamageLowCap(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_MIN_DMG_LOW_CAP)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_MIN_DMG_LOW_CAP); - } - - - public static int getMinDamageHigh(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_MIN_DMG_HIGH, name, VIA_what); - } - - - public static int getMinDamageHighCap(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_MIN_DMG_HIGH_CAP, name, VIA_what); - } - - - public static int getMaxDamageLow(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_MAX_DMG_LOW)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_MAX_DMG_LOW); - } - - - public static int getMaxDamageLow(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_MAX_DMG_LOW, name, VIA_what); - } - - - public static int getMaxDamageHigh(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_MAX_DMG_HIGH)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_MAX_DMG_HIGH); - - } - - - public static int getMaxDamageHighCap(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_MAX_DMG_HIGH_CAP)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_MAX_DMG_HIGH_CAP); - } - - - public static int getMaxDamageLowCap(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_MAX_DMG_LOW_CAP)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_MAX_DMG_LOW_CAP); - } - - - public static int getMaxDamageHigh(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_MAX_DMG_HIGH, name, VIA_what); - } - - - public static int getMaxDamageHighCap(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_MAX_DMG_HIGH_CAP, name, VIA_what); - } - - - public static int getSpeedLow(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_SPEED_LOW)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_SPEED_LOW); - - } - - - public static int getSpeedLow(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_SPEED_LOW, name, VIA_what); - } - - - public static int getSpeedHigh(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_SPEED_HIGH)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_SPEED_HIGH); - - } - - - public static int getSpeedHigh(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_SPEED_HIGH, name, VIA_what); - } - - - public static int getWoundChanceLow(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_WOUND_CHANCE_LOW)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_WOUND_CHANCE_LOW); - } - - - public static int getWoundChanceLow(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_WOUND_CHANCE_LOW, name, VIA_what); - } - - - public static int getWoundChanceHigh(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_WOUND_CHANCE_HIGH)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_WOUND_CHANCE_HIGH); - } - - - public static int getWoundChanceHigh(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_WOUND_CHANCE_HIGH, name, VIA_what); - } - - - public static int getHPLow(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_HP_LOW)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_HP_LOW); - } - - - public static int getHPLow(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_HP_LOW, name, VIA_what); - } - - - public static int getHPHigh(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_HP_HIGH)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_HP_HIGH); - } - - - public static int getHPHigh(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_HP_HIGH, name, VIA_what); - } - - - public static int getAccuracyLow(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_ACCURACY_LOW)) - { - return 0; - } - - return dic.getInt(COL_ACCURACY_LOW); - } - - - public static int getAccuracyLow(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_ACCURACY_LOW, name, VIA_what); - } - - - public static int getAccuracyHigh(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_ACCURACY_HIGH)) - { - return 0; - } - - return dic.getInt(COL_ACCURACY_HIGH); - } - - - public static int getAccuracyHigh(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_ACCURACY_HIGH, name, VIA_what); - } - - - public static int getMinRangeDistance(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_MIN_RANGE_DISTANCE)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_MIN_RANGE_DISTANCE); - } - - - public static int getMinRangeDistance(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_MIN_RANGE_DISTANCE, name, VIA_what); - } - - - public static int getMaxRangeDistance(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_MAX_RANGE_DISTANCE)) - { - return DEFAULT_VALUE; - } - - return dic.getInt(COL_MAX_RANGE_DISTANCE); - } - - - public static int getMaxRangeDistance(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_MAX_RANGE_DISTANCE, name, VIA_what); - } - - - public static int getAttackCostLow(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_ATTACK_COST_LOW)) - { - return 0; - } - - return dic.getInt(COL_ATTACK_COST_LOW); - } - - - public static int getAttackCostLow(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_ATTACK_COST_LOW, name, VIA_what); - } - - - public static int getAttackCostHigh(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_ATTACK_COST_HIGH)) - { - return 0; - } - - return dic.getInt(COL_ATTACK_COST_HIGH); - } - - - public static int getAttackCostHigh(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_ATTACK_COST_HIGH, name, VIA_what); - } - - - public static int getDamageType(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_DAMAGE_TYPE)) - { - return -1; - } - - return dic.getInt(COL_DAMAGE_TYPE); - } - - - public static int getDamageType(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_DAMAGE_TYPE, name, VIA_what); - } - - - public static int getElementalType(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_ELEMENTAL_TYPE)) - { - return 0; - } - - return dic.getInt(COL_ELEMENTAL_TYPE); - } - - - public static int getElementalType(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_ELEMENTAL_TYPE, name, VIA_what); - } - - - public static int getElementalValueLow(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_ELEMENTAL_VALUE_LOW)) - { - return 0; - } - - return dic.getInt(COL_ELEMENTAL_VALUE_LOW); - } - - - public static int getElementalValueLow(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_ELEMENTAL_VALUE_LOW, name, VIA_what); - } - - - public static int getElementalValueHigh(dictionary dic) throws InterruptedException - { - if (!dic.containsKey(COL_ELEMENTAL_VALUE_HIGH)) - { - return 0; - } - - return dic.getInt(COL_ELEMENTAL_VALUE_HIGH); - } - - - public static int getElementalValueHigh(String name, int VIA_what) throws InterruptedException - { - return _GetTableValue(COL_ELEMENTAL_VALUE_HIGH, name, VIA_what); - } - - - public static obj_id _createFromDictionary(dictionary dat, obj_id container, float speed, float damage, float effeciency, float elementalVal) throws InterruptedException - { - return _createFromDictionary(dat, container, speed, damage, effeciency, elementalVal, false); - } - - - public static obj_id _createFromDictionary(dictionary dat, obj_id container, float speed, float damage, float effeciency, float elementalVal, boolean overloadInv) throws InterruptedException - { - obj_id obj = null; - - if (!dat.containsKey(COL_TEMPLATE)) - { - return obj; - } - - if (overloadInv) - { - obj = createObjectOverloaded(dat.getString(COL_TEMPLATE), container); - } - else - { - obj = createObject(dat.getString(COL_TEMPLATE), container, ""); - } - - if (obj == null) - { - return obj; - } - - setWeaponAttributes(obj, dat, speed, damage, effeciency, elementalVal); - - return obj; - - } - - - public static obj_id _createFromDictionary(dictionary dat, obj_id container, float percentOfMax) throws InterruptedException - { - return _createFromDictionary(dat, container, percentOfMax, percentOfMax, percentOfMax, percentOfMax); - } - - - public static void setWeaponAttributes(obj_id weapon, dictionary dat, float speedPercent, float damagePercent, float effeciencyPercent, float elementalValPercent) throws InterruptedException - { - - int damageLow = (int)((float)getMinDamageHighCap(dat) * damagePercent); - int minDamageLow = getMinDamageLow(dat); - if (damageLow < minDamageLow) - { - damageLow = minDamageLow; - } - - int damageHigh = (int)((float)getMaxDamageHighCap(dat) * damagePercent); - int minDamageHigh = getMaxDamageLow(dat); - if (damageHigh < minDamageHigh) - { - damageHigh = minDamageHigh; - } - - int minSpeed = getSpeedLow(dat); - int maxSpeed = getSpeedHigh(dat); - int diff = maxSpeed - minSpeed; - - diff = Math.round((diff * (1.0f - speedPercent))); - int speed = minSpeed + diff; - - if (speed < minSpeed) - { - speed = minSpeed; - } - - int woundChance = (int)((float)getWoundChanceHigh(dat) * damagePercent); - int minWoundChance = getWoundChanceLow(dat); - if (woundChance < minWoundChance) - { - woundChance = minWoundChance; - } - - int hp = (int)((float)getHPHigh(dat) * 0.3f); - int minHp = getHPLow(dat); - if (hp < minHp) - { - hp = minHp; - } - - int accuracy = (int)((float)getAccuracyHigh(dat) * damagePercent); - int minAccuracy = getAccuracyLow(dat); - if (accuracy < minAccuracy) - { - accuracy = minAccuracy; - } - - int minRange = getMinRangeDistance(dat); - int maxRange = getMaxRangeDistance(dat); - - int minAttackCost = getAttackCostLow(dat); - int maxAttackCost = getAttackCostHigh(dat); - - int valueRange = maxAttackCost - minAttackCost; - valueRange = (int)((float)valueRange * effeciencyPercent); - int attackCost = maxAttackCost - valueRange; - - int elementalType = getElementalType(dat); - int elementalValue = (int)((float)getElementalValueHigh(dat) * elementalValPercent); - int minElementalValue = getElementalValueLow(dat); - if (elementalValue < minElementalValue) - { - elementalValue = minElementalValue; - } - - int damType = getDamageType(dat); - if (damType == -1) - { - damType = DAMAGE_KINETIC; - } - - setWeaponMinDamage(weapon, damageLow); - setWeaponMaxDamage(weapon, damageHigh); - setWeaponAttackSpeed(weapon, (float)speed/100.0f); - setWeaponWoundChance(weapon, (float)woundChance/10.0f); - setMaxHitpoints(weapon, (int)(hp)); - setHitpoints(weapon, (int)(hp)); - setWeaponAccuracy(weapon, accuracy); - - setWeaponDamageType(weapon, damType); - - setWeaponAttackCost(weapon, attackCost); - setWeaponElementalDamage(weapon, elementalType, elementalValue); - setHeavyWeaponAoeSplashPercent(weapon); - return; - } - - - public static void setWeaponAttributes(obj_id weapon, dictionary dat, float percentOfMax) throws InterruptedException - { - setWeaponAttributes(weapon, dat, percentOfMax, percentOfMax, percentOfMax, percentOfMax); - } - - - public static dictionary getWeaponDat(String weapon) throws InterruptedException - { - - int row = dataTableSearchColumnForInt(getStringCrc(weapon), COL_TEMPLATE_HASH, WEAPON_DATA_TABLE); - - if (row < 0) - { - return null; - } - dictionary dic = dataTableGetRow(WEAPON_DATA_TABLE, row); - return dic; - } - - - public static dictionary getWeaponDat(obj_id weapon) throws InterruptedException - { - String template = getTemplateName(weapon); - return getWeaponDat(template); - } - - - public static dictionary getWeaponCoreData(int coreLevel) throws InterruptedException - { - - int row = dataTableSearchColumnForInt(coreLevel, WEAPON_CORE_LEVEL_COL, WEAPON_CORE_TABLE); - - if (row < 0) - { - - return null; - } - - dictionary dict = dataTableGetRow(WEAPON_CORE_TABLE, row); - - return dict; - } - - - public static obj_id createPossibleWeapon(String name, obj_id container, float percentOfMax) throws InterruptedException - { - return createPossibleWeapon(name, container, percentOfMax, percentOfMax, percentOfMax, percentOfMax); - } - - - public static obj_id createPossibleWeapon(String name, obj_id container, float speed, float damage, float effeciency, float elementalVal) throws InterruptedException - { - obj_id thing = null; - if (name.startsWith("object/weapon/")) - { - thing = createWeapon(name, container, VIA_TEMPLATE, speed, damage, effeciency, elementalVal); - } - - if (!isIdValid(thing)) - { - thing = createObject(name, container, ""); - } - - return thing; - } - - - public static obj_id createWeapon(String name, obj_id container, float percentOfMax) throws InterruptedException - { - return createWeapon(name, container, VIA_TEMPLATE, percentOfMax); - } - - - public static obj_id createWeapon(String name, obj_id container, float speed, float damage, float effeciency, float elementalVal) throws InterruptedException - { - return createWeapon(name, container, VIA_TEMPLATE, speed, damage, effeciency, elementalVal); - } - - - public static obj_id createWeapon(String name, obj_id container, int VIA_what, float speed, float damage, float effeciency, float elementalVal) throws InterruptedException - { - return createWeapon(name, container, VIA_what, speed, damage, effeciency, elementalVal, false); - } - - - public static obj_id createWeaponOverloaded(String name, obj_id container, float speed, float damage, float effeciency, float elementalVal) throws InterruptedException - { - return createWeapon(name, container, VIA_TEMPLATE, speed, damage, effeciency, elementalVal, true); - } - - - public static obj_id createWeapon(String name, obj_id container, int VIA_what, float speed, float damage, float effeciency, float elementalVal, boolean overloadInv) throws InterruptedException - { - String col = COL_SCHEMATIC_NAME; - - int row = -1; - - if (VIA_what == VIA_TEMPLATE) - { - col = COL_TEMPLATE_HASH; - row = dataTableSearchColumnForInt(getStringCrc(name), col, WEAPON_DATA_TABLE); - } - else - { - row = dataTableSearchColumnForString(name, col, WEAPON_DATA_TABLE); - } - - LOG("weapons", "Found "+ name + " at row "+ row); - if (row < 0) - { - return null; - } - - if (isPlayer(container)) - { - container = utils.getInventoryContainer(container); - } - - dictionary dic = dataTableGetRow(WEAPON_DATA_TABLE, row); - obj_id weapon = _createFromDictionary(dic, container, speed, damage, effeciency, elementalVal, overloadInv); - if (weapon != null && name.indexOf("component") > -1) - { - attachScript(weapon, "item.special.serialize_component"); - } - - weapons.setWeaponData(weapon); - return weapon; - } - - - public static obj_id createWeapon(String name, obj_id container, int VIA_what, float percentOfMax) throws InterruptedException - { - return createWeapon(name, container, VIA_what, percentOfMax, percentOfMax, percentOfMax, percentOfMax); - } - - - public static Vector getWeaponIdsForType(String fragment) throws InterruptedException - { - String type = toLower(fragment); - String[] allWeaps = dataTableGetStringColumn(WEAPON_DATA_TABLE, COL_TEMPLATE); - - String lookFor = "all"; - if (type.equals("melee")) - { - lookFor = "special"; - } - - Vector names = new Vector(); - String template = ""; - for (int i = 0; i < allWeaps.length; i++) - { - testAbortScript(); - template = dataTableGetString(WEAPON_DATA_TABLE, i, COL_TEMPLATE); - if (template != null && (type.equals("all") || template.indexOf(type) > -1)) - { - if (template.indexOf("component") > -1) - { - continue; - } - - names.add(dataTableGetString(WEAPON_DATA_TABLE, i, COL_SCHEMATIC_NAME)); - } - } - - return names; - } - - - public static int createOneOfEach(String nameFragment, obj_id container, int VIA_what, float percentOfMax) throws InterruptedException - { - String col = COL_SCHEMATIC_NAME; - if (VIA_what == VIA_TEMPLATE) - { - col = COL_TEMPLATE; - } - - if (isPlayer(container)) - { - container = utils.getInventoryContainer(container); - } - - nameFragment = toLower(nameFragment); - - String[] allWeaps = dataTableGetStringColumn(WEAPON_DATA_TABLE, col); - - if (allWeaps == null || allWeaps.length < 1) - { - return -1; - } - - int numCreated = 0; - dictionary dic = null; - for (int i = 0; i < allWeaps.length; i++) - { - testAbortScript(); - dic = dataTableGetRow(WEAPON_DATA_TABLE, i); - if (nameFragment.equals("all") || dic.getString(col).indexOf(nameFragment) > -1) - { - numCreated = (_createFromDictionary(dic, container, percentOfMax) != null? numCreated+1 : numCreated); - } - } - - return numCreated; - } - - - public static void grantOrDenyAllWeaponSchematics(String nameFragment, obj_id player, int VIA_what, boolean grant) throws InterruptedException - { - String col = COL_SCHEMATIC_NAME; - if (VIA_what == VIA_TEMPLATE) - { - col = COL_TEMPLATE; - } - - nameFragment = toLower(nameFragment); - - String[] allEntries = dataTableGetStringColumnNoDefaults(WEAPON_DATA_TABLE, col); - trace.log(WEAPONS, "Got "+ allEntries.length + " schematic entries from col "+ col); - - for (int i = 0; i < allEntries.length; i++) - { - testAbortScript(); - if (!nameFragment.equals("all") && toLower(allEntries[i]).indexOf(nameFragment) < 0) - { - trace.log(WEAPONS, allEntries[i] + " does will not be adjusted."); - continue; - } - - trace.log(WEAPONS, allEntries[i] + " will be "+ (grant? "granted": "revoked")); - String path = "object/draft_schematic/weapon/"; - if ((grant? grantSchematic(player, path+allEntries[i]+".iff") : revokeSchematic(player, path+allEntries[i]+".iff"))) - { - sendSystemMessageTestingOnly(player, "Schematic "+ (grant? "granted: ": "revoked: ") + allEntries[i]); - } - } - - return; - } - - - public static obj_id createLimitedUseSchematic(String name, int numUses, obj_id container, String schematicNameKey) throws InterruptedException - { - return createLimitedUseSchematic(name, VIA_TEMPLATE, numUses, container, schematicNameKey); - } - - - public static obj_id createLimitedUseSchematic(String name, int VIA_what, int numUses, obj_id container, String schematicNameKey) throws InterruptedException - { - return createLimitedUseSchematic(name, VIA_what, numUses, container, schematicNameKey, "class_munitions_phase4_master"); - } - - - public static obj_id createLimitedUseSchematic(String name, int VIA_what, int numUses, obj_id container, String schematicNameKey, String skillRequired) throws InterruptedException - { - if (toLower(name).indexOf("component") > -1) - { - return null; - } - - String col = COL_SCHEMATIC_NAME; - int row = -1; - - if (VIA_what == VIA_TEMPLATE) - { - col = COL_TEMPLATE_HASH; - row = dataTableSearchColumnForInt(getStringCrc(name), col, WEAPON_DATA_TABLE); - } - else - { - row = dataTableSearchColumnForString(name, col, WEAPON_DATA_TABLE); - } - - if (row < 0) - { - return null; - } - - if (isPlayer(container)) - { - container = utils.getInventoryContainer(container); - } - - String schematicName = dataTableGetString(WEAPON_DATA_TABLE, row, COL_SCHEMATIC_NAME); - obj_id obj = createObject("object/tangible/loot/loot_schematic/generic_limited_use.iff", container, ""); - if (obj == null) - { - return obj; - } - - setObjVar(obj, "loot_schematic.schematic", "object/draft_schematic/weapon/"+ schematicName + ".iff"); - setObjVar(obj, "loot_schematic.uses", numUses); - setObjVar(obj, "loot_schematic.skill_req", skillRequired); - attachScript(obj, "item.loot_schematic.loot_schematic"); - setName(obj, new string_id("craft_weapon_ingredients_n", "sch_"+ schematicNameKey)); - return obj; - } - - - public static float setHeavyWeaponAoeSplashPercent(obj_id weapon) throws InterruptedException - { - if (getWeaponType(weapon) == WEAPON_TYPE_HEAVY) - { - int weaponType = heavyweapons.getHeavyWeaponType(weapon); - range_info rangeData = getWeaponRangeInfo(weapon); - switch(weaponType) - { - case heavyweapons.TYPE_LAUNCHER_PISTOL: - case heavyweapons.TYPE_LAVA_CANNON: - case heavyweapons.TYPE_FLAME_THROWER: - case heavyweapons.TYPE_HEAVY_FLAME_THROWER: - case heavyweapons.TYPE_HEAVY_PARTICLE_BEAM: - case heavyweapons.TYPE_HEAVY_ACID_BEAM: - case heavyweapons.TYPE_LIGHTNING_BEAM_CANON: - float rangeRatio = rangeData.maxRange / MAX_WEAPON_RANGE; - float aoePercent = MAX_AOE_PERCENT - ((MAX_AOE_PERCENT - MIN_AOE_PERCENT) * rangeRatio); - - if (aoePercent > MAX_AOE_PERCENT) - { - aoePercent = MAX_AOE_PERCENT; - } - else if (aoePercent < MIN_AOE_PERCENT) - { - aoePercent = MIN_AOE_PERCENT; - } - setObjVar(weapon, "intAOEDamagePercent", aoePercent); - return aoePercent; - - } - } - - return 0; - } - - - public static void clickCombatWeaponConversion(obj_id weapon) throws InterruptedException - { - dictionary weaponDat = getWeaponDat(weapon); - if (weaponDat == null) - { - CustomerServiceLog("weap_conversion_bad", "POSSIBLE :BROKEN WEAPON: TRIED TO CONVERT BUT COULD NOT GET WEAPONDATA FOR "+weapon); - String template = getTemplateName(weapon); - CustomerServiceLog("weap_conversion_bad", "WEAPON TEMPLATE IS: "+template); - return; - } - - if (jedi.isLightsaber(weapon)) - { - validateLightsaberData(weapon, weaponDat); - } - else - { - if (powerup.hasPowerUpInstalled(weapon)) - { - powerup.cleanupWeaponPowerup(weapon); - } - - validateWeaponData(weapon, weaponDat); - } - - return; - } - - - public static boolean coredWeaponConversion(obj_id weapon) throws InterruptedException - { - int coreLevel = getCoreLevel(weapon); - - if (coreLevel <= 0) - { - CustomerServiceLog("weap_conversion_bad", "POSSIBLE :BROKEN WEAPON: TRIED TO CONVERT BUT COULD NOT GET WEAPONDATA FOR "+weapon); - CustomerServiceLog("weap_conversion_bad", "Core level was "+coreLevel); - return false; - } - - dictionary weaponCoreDat = getWeaponCoreData(coreLevel); - - if (weaponCoreDat == null || weaponCoreDat.isEmpty()) - { - CustomerServiceLog("weap_conversion_bad", "POSSIBLE :BROKEN WEAPON: TRIED TO CONVERT BUT COULD NOT GET WEAPONDATA FOR "+weapon); - String template = getTemplateName(weapon); - CustomerServiceLog("weap_conversion_bad", "WEAPON TEMPLATE IS: "+template); - return false; - } - int damageType = 0; - int elementalType = 0; - int elementalValue = 0; - int accuracy = 0; - float coreBonus = 0.0f; - float craftedBonus = 0.0f; - - coreBonus = getWeaponCoreQualityMin(weapon); - craftedBonus = coreBonus + getWeaponComponentBonusesMinDamage(weapon); - int tableMin = getCoreMinDamage(weapon, weaponCoreDat); - float minDamage = tableMin * craftedBonus; - - CustomerServiceLog("new_weap_conversion", "minDamage pre-VerifyDamageRangeMin on weapon "+ weapon + "("+getTemplateName(weapon)+") "+ minDamage); - minDamage = verifyDamageRangeMin(weapon, minDamage, weaponCoreDat); - CustomerServiceLog("new_weap_conversion", "minDamage post-VerifyDamageRangeMin on weapon "+ weapon + "("+getTemplateName(weapon)+") "+ minDamage); - - setWeaponMinDamage(weapon, (int)minDamage); - - coreBonus = getWeaponCoreQualityMax(weapon); - craftedBonus = coreBonus + getWeaponComponentBonusesMaxDamage(weapon); - int tableMax = getCoreMaxDamage(weapon, weaponCoreDat); - float maxDamage = tableMax * craftedBonus; - - CustomerServiceLog("new_weap_conversion", "maxDamage pre-VerifyDamageRangeMin on weapon "+ weapon + "("+getTemplateName(weapon)+") "+ maxDamage); - maxDamage = verifyDamageRangeMax(weapon, maxDamage, weaponCoreDat); - CustomerServiceLog("new_weap_conversion", "maxDamage post-VerifyDamageRangeMin on weapon "+ weapon + "("+getTemplateName(weapon)+") "+ maxDamage); - - setWeaponMaxDamage (weapon, (int)maxDamage); - - setWeaponAttackSpeed (weapon, getWeaponSpeed(weapon) / 100.0f); - - setWeaponWoundChance (weapon, getNewWeaponWoundChance(weapon)); - - accuracy = getNewWeaponAccuracy(weapon); - setWeaponAccuracy(weapon, accuracy); - - setWeaponAttackCost(weapon, getNewWeaponAttackCost(weapon)); - - damageType = getNewWeaponDamageType(weapon); - setWeaponDamageType(weapon, damageType); - - int tableElementalType = getNewWeaponTableElementType(weapon); - elementalType = (int)getNewWeaponElementalType(weapon); - - if (tableElementalType != -1) - { - elementalType = tableElementalType; - } - - craftedBonus = getNewWeaponElementalValue(weapon); - int tableValue = getNewWeaponTableElementalValue(weapon, weaponCoreDat); - elementalValue = (int)(tableValue * craftedBonus); - - if (elementalValue > 0) - { - CustomerServiceLog("new_weap_conversion", "elementalValue on prototype "+ weapon + "("+getTemplateName(weapon)+") before Appearance bonus "+ elementalValue); - elementalValue += getElementalAppearanceBonus(weapon); - CustomerServiceLog("new_weapon_crafting", "elementalValue on prototype "+ weapon + "("+getTemplateName(weapon)+") after Appearance bonus "+ elementalValue); - } - if (elementalType >= 0 && elementalValue > 0) - { - setWeaponElementalType(weapon, elementalType); - setWeaponElementalValue(weapon, elementalValue); - } - - base_class.range_info rangeData = new base_class.range_info(); - rangeData.minRange = getNewWeaponMinRange(weapon); - rangeData.maxRange = getNewWeaponMaxRange(weapon); - setObjVar(weapon, "weapon.original_max_range", rangeData.maxRange); - setWeaponRangeInfo(weapon, rangeData); - - setHeavyWeaponAoeSplashPercent(weapon); - - setConversionId(weapon,CORED_WEAPON_CONVERSION_VERSION); - - return true; - } - - - public static void staticDynamicWeaponConversion(obj_id weapon) throws InterruptedException - { - int level = 1; - - if (hasObjVar(weapon, "dynamic_item.intLevelRequired")) - { - level = getIntObjVar(weapon, "dynamic_item.intLevelRequired"); - } - - dictionary weaponData = dataTableGetRow("datatables/item/dynamic_item/root_balance_data/weapon_data.iff", level); - static_item.setupDynamicWeapon(weapon, "", level, weaponData, new dictionary(), false); - } - - - public static void validateWeaponData(obj_id weapon, dictionary weaponDat) throws InterruptedException - { - - float randomMeter = rand(0.95f, 1.00f); - int currentMinDamage = getWeaponMinDamage(weapon); - int currentMaxDamage = getWeaponMaxDamage(weapon); - int clickMasterMinDamageHigh = getMinDamageHighCap(weaponDat); - int clickMasterMaxDamageHigh = getMaxDamageHighCap(weaponDat); - int clickMasterMinDamageLow = getMinDamageLowCap(weaponDat); - int clickMasterMaxDamageLow = getMaxDamageLowCap(weaponDat); - - int finalMinDamage = currentMinDamage; - int finalMaxDamage = currentMaxDamage; - - if (finalMinDamage > clickMasterMinDamageHigh || finalMinDamage < clickMasterMinDamageLow) - { - finalMinDamage = (int)(clickMasterMinDamageHigh*randomMeter); - } - - if (finalMaxDamage > clickMasterMaxDamageHigh || finalMaxDamage < clickMasterMaxDamageLow) - { - finalMaxDamage = (int)(clickMasterMaxDamageHigh*randomMeter); - } - - setWeaponMinDamage(weapon, finalMinDamage); - setWeaponMaxDamage(weapon, finalMaxDamage); - - float clickMasterSpeed = getSpeedLow(weaponDat) / 100.0f; - setWeaponAttackSpeed(weapon, clickMasterSpeed); - - int clickMasterActionCost = getAttackCostLow(weaponDat); - setWeaponAttackCost(weapon, clickMasterActionCost); - - int clickMasterWoundChance = getWoundChanceLow(weaponDat); - setWeaponWoundChance(weapon, (float) clickMasterWoundChance); - - validateWeaponRange(weapon, weaponDat); - - validateWeaponDamageType(weapon, weaponDat); - - if (getWeaponElementalType(weapon) > 0) - { - int currentElementalDamageType = getWeaponElementalType(weapon); - int clickMasterDamageType = getElementalType(weaponDat); - int currentElementalDamage = getWeaponElementalValue(weapon); - - int minElementalDamage = getElementalValueLow(weaponDat); - int maxElementalDamage = getElementalValueHigh(weaponDat); - - if (currentElementalDamageType != clickMasterDamageType) - {; - } - { - setWeaponElementalType(weapon, clickMasterDamageType); - } - - if (currentElementalDamage < minElementalDamage || currentElementalDamage > maxElementalDamage) - { - randomMeter = rand(0.95f, 1.00f); - setWeaponElementalValue(weapon, (int)(maxElementalDamage * randomMeter) ); - } - } - else - { - int clickMasterDamageType = getElementalType(weaponDat); - - if (clickMasterDamageType > 0) - { - int clickMasterElementalDamage = ((getElementalValueLow(weaponDat) + getElementalValueHigh(weaponDat))/2); - setWeaponElementalType(weapon, clickMasterDamageType); - setWeaponElementalValue(weapon, clickMasterElementalDamage); - } - } - - setConversionId(weapon,CONVERSION_VERSION); - weapons.setWeaponData(weapon); - removeObjVar(weapon, "slicing"); - setHeavyWeaponAoeSplashPercent(weapon); - - obj_id player = utils.getContainingPlayer(weapon); - if (isIdValid(player) && isPlayer(player)) - { - String template = getTemplateName(weapon); - CustomerServiceLog("jedi_saber", "WEAPON TEMPLATE CONVERTED!: "+template); - CustomerServiceLog("jedi_saber", "Converting Weapon ("+weapon+") - OLD MIN DAMAGE:"+currentMinDamage+" - NEW MIN DAMAGE - "+finalMinDamage); - CustomerServiceLog("jedi_saber", "Converting Weapon ("+weapon+") - OLD MAX DAMAGE:"+currentMaxDamage+" - NEW MAX DAMAGE - "+finalMaxDamage); - CustomerServiceLog("jedi_saber", "Converting Weapon ("+weapon+") - NEW SPEED - "+clickMasterSpeed); - CustomerServiceLog("jedi_saber", "Converting Weapon ("+weapon+") - NEW ACTION - "+clickMasterActionCost); - } - - } - - - public static void validateLightsaberData(obj_id saber, dictionary weaponDat) throws InterruptedException - { - int baseMinDamage = getIntObjVar(saber, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_MIN_DMG); - int baseMaxDamage = getIntObjVar(saber, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_MAX_DMG); - - int clickMasterMinDamage = getMinDamageHighCap(weaponDat); - int clickMasterMaxDamage = getMaxDamageHighCap(weaponDat); - int clickMasterLowMinDamage = getMinDamageLowCap(weaponDat); - int clickMasterLowMaxDamage = getMaxDamageLowCap(weaponDat); - - int finalMinDamage = 0; - int finalMaxDamage = 0; - - finalMinDamage = (int)(clickMasterLowMinDamage +((clickMasterMinDamage - clickMasterLowMinDamage) * .99f)); - finalMaxDamage = (int)(clickMasterLowMaxDamage +((clickMasterMaxDamage - clickMasterLowMaxDamage) * .99f)); - - setObjVar(saber, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_MIN_DMG, finalMinDamage); - setObjVar(saber, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_MAX_DMG, finalMaxDamage); - - float clickMasterSpeed = getSpeedLow(weaponDat) / 100.0f; - setWeaponAttackSpeed(saber, clickMasterSpeed); - setObjVar(saber, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_SPEED, clickMasterSpeed); - - int clickMasterActionCost = getAttackCostLow(weaponDat); - setObjVar(saber, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_ATTACK_COST, clickMasterActionCost); - - removeObjVar(saber, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_FORCE); - removeObjVar(saber, jedi.VAR_SABER_BASE + "."+ jedi.VAR_FORCE); - - int clickMasterWoundChance = getWoundChanceLow(weaponDat); - setObjVar(saber, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_WOUND, clickMasterWoundChance); - - validateWeaponRange(saber, weaponDat); - - setConversionId(saber,CONVERSION_VERSION); - weapons.setWeaponData(saber); - - String template = getTemplateName(saber); - CustomerServiceLog("jedi_saber", "LIGHTSABER TEMPLATE CONVERTED!: "+template); - CustomerServiceLog("jedi_saber", "Converting LightSaber ("+saber+") - OLD MIN DAMAGE:"+baseMinDamage+" - NEW MIN DAMAGE - "+finalMinDamage); - CustomerServiceLog("jedi_saber", "Converting LightSaber ("+saber+") - OLD MAX DAMAGE:"+baseMaxDamage+" - NEW MAX DAMAGE - "+finalMaxDamage); - CustomerServiceLog("jedi_saber", "Converting LightSaber ("+saber+") - NEW SPEED - "+clickMasterSpeed); - CustomerServiceLog("jedi_saber", "Converting LightSaber ("+saber+") - NEW ACTION - "+clickMasterActionCost); - - messageTo(saber, "handleResetSaberStats", null, 2.0f, false); - - } - - - public static void validateWeaponRange(obj_id weapon) throws InterruptedException - { - - if (hasObjVar(weapon, OBJVAR_NEW_WP)) - { - range_info rangeData = getWeaponRangeInfo(weapon); - - boolean rangeAltered = false; - float currentMinRange = rangeData.minRange; - float currentMaxRange = rangeData.maxRange; - - int minRange = getNewWeaponMinRange(weapon); - int maxRange = getNewWeaponMaxRange(weapon); - - if (currentMinRange > minRange) - { - rangeData.minRange=minRange; - rangeAltered = true; - } - - if (currentMaxRange != maxRange) - { - rangeData.maxRange=maxRange; - rangeAltered = true; - } - - if (rangeAltered) - { - setWeaponRangeInfo(weapon, rangeData); - } - } - else - { - validateWeaponRange(weapon, getWeaponDat(weapon)); - } - } - - - public static void validateWeaponRange(obj_id weapon, dictionary weaponDat) throws InterruptedException - { - - if (weaponDat == null) - { - return; - } - - range_info rangeData = getWeaponRangeInfo(weapon); - - boolean rangeAltered = false; - float currentMinRange = rangeData.minRange; - float currentMaxRange = rangeData.maxRange; - - int minRange = getMinRangeDistance(weaponDat); - int maxRange = getMaxRangeDistance(weaponDat); - - if (currentMinRange > minRange) - { - rangeData.minRange=minRange; - rangeAltered = true; - } - - if (currentMaxRange != maxRange) - { - rangeData.maxRange=maxRange; - rangeAltered = true; - } - - if (rangeAltered) - { - setWeaponRangeInfo(weapon, rangeData); - } - - } - - - public static void validateWeaponFacoryCrateRange(obj_id crate, dictionary weaponDat) throws InterruptedException - { - - float baseMinDamage = getFloatObjVar(crate, "crafting_attributes.crafting:minDamage"); - float baseMaxDamage = getFloatObjVar(crate, "crafting_attributes.crafting:maxDamage"); - int clickMasterMinDamageHigh = getMinDamageHighCap(weaponDat); - int clickMasterMaxDamageHigh = getMaxDamageHighCap(weaponDat); - int clickMasterMinDamageLow = getMinDamageLowCap(weaponDat); - int clickMasterMaxDamageLow = getMaxDamageLowCap(weaponDat); - - if (baseMinDamage > clickMasterMinDamageHigh || baseMinDamage < clickMasterMinDamageLow) - { - setObjVar(crate, "crafting_attributes.crafting:minDamage", (float)(clickMasterMinDamageHigh)); - } - - if (baseMaxDamage > clickMasterMaxDamageHigh || baseMaxDamage < clickMasterMaxDamageLow) - { - setObjVar(crate, "crafting_attributes.crafting:maxDamage", (float)(clickMasterMaxDamageHigh)); - } - - int clickMasterSpeed = getSpeedLow(weaponDat); - setObjVar(crate, "crafting_attributes.crafting:attackSpeed", (float)(clickMasterSpeed)); - - int clickMasterActionCost = getAttackCostLow(weaponDat); - setObjVar(crate, "crafting_attributes.crafting:attackCost", (float)(clickMasterActionCost)); - - int clickMasterWoundChance = getWoundChanceLow(weaponDat); - setObjVar(crate, "crafting_attributes.crafting:woundChance", (float)(clickMasterWoundChance)); - - int clickMasterMaxRange = getMaxRangeDistance(weaponDat); - setObjVar(crate, "crafting_attributes.crafting:maxRange", (float)(clickMasterMaxRange)); - - float currentDamageType = getFloatObjVar(crate, "crafting_attributes.crafting:damageType"); - int clickMasterDamageType = getDamageType(weaponDat); - if (currentDamageType != clickMasterDamageType) - {; - } - { - setObjVar(crate, "crafting_attributes.crafting:damageType", (float)(clickMasterDamageType)); - } - - float weaponElementalType = getFloatObjVar(crate, "crafting_attributes.crafting:elementalType"); - - if (weaponElementalType > 0) - { - - int clickMasterElementalDamageType = getElementalType(weaponDat); - float currentElementalDamage = getFloatObjVar(crate, "crafting_attributes.crafting:elementalValue"); - int clickMasterElementalDamage = ((getElementalValueLow(weaponDat) + getElementalValueHigh(weaponDat))/2); - - if (weaponElementalType != clickMasterElementalDamageType) - {; - } - { - setObjVar(crate, "crafting_attributes.crafting:elementalType", (float)(clickMasterElementalDamageType)); - } - - if (currentElementalDamage > clickMasterElementalDamage) - { - setObjVar(crate, "crafting_attributes.crafting:elementalValue", (float)(clickMasterElementalDamage)); - } - } - - setConversionId(crate,CONVERSION_VERSION); - recomputeCrateAttributes(crate); - } - - - public static boolean isVersionCurrent(obj_id object) throws InterruptedException - { - int currentVersion = getConversionId(object); - int masterVersion = CONVERSION_VERSION; - - if (currentVersion == masterVersion) - { - return true; - } - else - { - return false; - } - } - - - public static void validateWeaponFactoryCrateFromSchematic(obj_id crate) throws InterruptedException - { - int draftSchematicObjectTemplateCrc = getIntObjVar(crate, "draftSchematic"); - if (draftSchematicObjectTemplateCrc != 0) - { - String draftSchematicObjectTemplate = getObjectTemplateName(draftSchematicObjectTemplateCrc); - if (draftSchematicObjectTemplate != null && !draftSchematicObjectTemplate.equals("")) - { - String weaponObjectTemplate = getTemplateCreatedFromSchematic(draftSchematicObjectTemplate); - if (weaponObjectTemplate != null && !weaponObjectTemplate.equals("")) - { - dictionary weaponDat = getWeaponDat(weaponObjectTemplate); - if (weaponDat == null) - { - return; - } - else - { - validateWeaponFacoryCrateRange(crate, weaponDat); - } - } - } - } - } - - - public static void initalizeWeaponFactoryCrateManufacturingSchematics(obj_id self) throws InterruptedException - { - if (!weapons.isVersionCurrent(self)) - { - - if (isGameObjectTypeOf(getGameObjectType(self), GOT_misc_factory_crate)) - { - weapons.validateWeaponFactoryCrateFromSchematic(self); - } - - if (isGameObjectTypeOf(getGameObjectType(self), GOT_data_manufacturing_schematic)) - { - - if (!hasObjVar(self, craftinglib.OBJVAR_IN_CRAFTING_SESSION)) - { - destroyObject(self); - - } - } - } - } - - - public static weapon_data getNewWeaponData(obj_id objWeapon) throws InterruptedException - { - if (!utils.hasScriptVar(objWeapon, "dctWeaponStats")) - { - return null; - } - dictionary dctWeaponStats = utils.getDictionaryScriptVar(objWeapon, "dctWeaponStats"); - return fillWeaponData(objWeapon, dctWeaponStats); - } - - - public static weapon_data fillWeaponData(obj_id weapon, combat_data dat) throws InterruptedException - { - weapon_data weaponData = new weapon_data(); - weaponData.id = weapon; - weaponData.minDamage = dat.overloadWeaponMinDamage; - weaponData.maxDamage= dat.overloadWeaponMaxDamage; - weaponData.maxRange= dat.overloadWeaponMaxRange; - - if (!dat.specialLine.equals("no_proc")) - { - weaponData.weaponType = dat.overloadWeaponType; - weaponData.weaponCategory = dat.overloadWeaponCategory; - } - else - { - weapon_data default_data = getWeaponData(weapon); - weaponData.weaponType = default_data.weaponType; - weaponData.weaponCategory = default_data.weaponCategory; - } - weaponData.damageType = dat.overloadWeaponDamageType; - weaponData.elementalType= dat.overloadWeaponElementalType; - weaponData.elementalValue= dat.overloadWeaponElementalValue; - weaponData.attackSpeed = dat.overloadWeaponAttackSpeed; - weaponData.damageRadius= dat.overloadWeaponDamageRadius; - return weaponData; - } - - - public static weapon_data fillWeaponData(obj_id objWeapon, dictionary dctWeaponStats) throws InterruptedException - { - weapon_data weaponData = new weapon_data(); - weaponData.id = objWeapon; - weaponData.minDamage = dctWeaponStats.getInt("minDamage"); - weaponData.maxDamage= dctWeaponStats.getInt("maxDamage"); - weaponData.maxRange= dctWeaponStats.getFloat("maxRange"); - - weaponData.weaponType = dctWeaponStats.getInt("weaponType"); - weaponData.weaponCategory = dctWeaponStats.getInt("weaponCategory"); - weaponData.damageType = dctWeaponStats.getInt("damageType"); - weaponData.elementalType= dctWeaponStats.getInt("elementalType"); - weaponData.elementalValue= dctWeaponStats.getInt("elementalValue"); - weaponData.attackSpeed = dctWeaponStats.getFloat("attackSpeed"); - weaponData.damageRadius= dctWeaponStats.getFloat("damageRadius"); - return weaponData; - } - - - public static void setWeaponData(obj_id objWeapon) throws InterruptedException - { - dictionary dctWeaponStats = new dictionary(); - dctWeaponStats.put("id", objWeapon); - dctWeaponStats.put("minDamage", getWeaponMinDamage(objWeapon)); - dctWeaponStats.put("maxDamage", getWeaponMaxDamage(objWeapon)); - dctWeaponStats.put("maxRange", getMaxRange(objWeapon)); - - dctWeaponStats.put("weaponType", getWeaponType(objWeapon)); - dctWeaponStats.put("weaponCategory", combat.getWeaponCategory(getWeaponType(objWeapon))); - dctWeaponStats.put("damageType", getWeaponDamageType(objWeapon)); - dctWeaponStats.put("elementalType", getWeaponElementalType(objWeapon)); - dctWeaponStats.put("elementalValue",getWeaponElementalValue(objWeapon)); - dctWeaponStats.put("attackSpeed", getWeaponAttackSpeed(objWeapon)); - dctWeaponStats.put("damageRadius", getWeaponDamageRadius(objWeapon)); - utils.setScriptVar(objWeapon, "dctWeaponStats", dctWeaponStats); - } - - - public static void setWeaponData(obj_id objWeapon, int intMinDamage, int intMaxDamage, float fltMaxRange, int intWeaponType, int intDamageType, int intElementalType, int intElementalValue, float fltAttackSpeed, float fltDamageRadius) throws InterruptedException - { - - dictionary dctWeaponStats = new dictionary(); - dctWeaponStats.put("id", objWeapon); - dctWeaponStats.put("minDamage", intMinDamage); - dctWeaponStats.put("maxDamage", intMaxDamage); - dctWeaponStats.put("maxRange", fltMaxRange); - - dctWeaponStats.put("weaponType", intWeaponType); - dctWeaponStats.put("weaponCategory", combat.getWeaponCategory(intWeaponType)); - dctWeaponStats.put("damageType", intDamageType); - dctWeaponStats.put("elementalType", intElementalType); - dctWeaponStats.put("elementalValue",intElementalValue); - dctWeaponStats.put("attackSpeed", fltAttackSpeed); - dctWeaponStats.put("damageRadius", fltDamageRadius); - utils.setScriptVar(objWeapon, "dctWeaponStats", dctWeaponStats); - return; - - } - - - public static void adjustWeaponRangeForExpertise(obj_id player, obj_id self, boolean modify) throws InterruptedException - { - if (!hasObjVar(self, "weapon.original_max_range")) - { - return; - } - - range_info rangeData = getWeaponRangeInfo(self); - float originalRange = getFloatObjVar(self, "weapon.original_max_range"); - - if (modify) - { - int weaponType = getWeaponType(self); - float rangeMod = getSkillStatisticModifier(player, "expertise_range_bonus_all"); - rangeMod += getSkillStatisticModifier(player, "expertise_range_bonus_"+ combat.getWeaponStringType(weaponType)); - - if (combat.isRangedWeapon(self) || combat.isHeavyWeapon(self)) - { - rangeMod +=getSkillStatisticModifier(player, "expertise_range_bonus_ranged"); - } - if (combat.isMeleeWeapon(self)) - { - rangeMod +=getSkillStatisticModifier(player, "expertise_range_bonus_melee"); - } - - rangeMod += getSkillStatisticModifier(player, "expertise_sm_rank_range_bonus"); - - float adjustedMaxRange = rangeMod + originalRange; - - if (adjustedMaxRange > 64) - { - adjustedMaxRange = 64; - } - - rangeData.maxRange = adjustedMaxRange; - } - else - { - rangeData.maxRange = originalRange; - } - - setWeaponRangeInfo(self, rangeData); - setWeaponData(self); - } - - - public static void validateWeaponDamageType(obj_id weapon) throws InterruptedException - { - - if (hasObjVar(weapon, OBJVAR_NEW_WP)) - { - - int currentDamageType = getWeaponDamageType(weapon); - int damageType = getNewWeaponDamageType(weapon); - if (currentDamageType != damageType) - {; - } - { - setWeaponDamageType(weapon, damageType); - } - } - else - { - validateWeaponDamageType(weapon, getWeaponDat(weapon)); - } - } - - - public static void validateWeaponDamageType(obj_id weapon, dictionary weaponDat) throws InterruptedException - { - - if (weaponDat == null) - { - return; - } - - int currentDamageType = getWeaponDamageType(weapon); - int damageType = getDamageType(weaponDat); - if (currentDamageType != damageType) - {; - } - { - setWeaponDamageType(weapon, damageType); - } - - } - - - public static int getCoreLevel(obj_id prototype) throws InterruptedException - { - if (hasObjVar(prototype, OBJVAR_WP_LEVEL)) - { - return getIntObjVar(prototype, OBJVAR_WP_LEVEL); - } - else - { - return (int)getFloatObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "coreLevel"); - } - } - - - public static float getWeaponCoreQualityMin(obj_id prototype) throws InterruptedException - { - return getFloatObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MIN); - } - - - public static float getWeaponCoreQualityMax(obj_id prototype) throws InterruptedException - { - return getFloatObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MAX); - } - - - public static float getNewWeaponElementalType(obj_id prototype) throws InterruptedException - { - if (hasObjVar(prototype, OBJVAR_ELEMENTAL_TYPE)) - { - return getFloatObjVar(prototype, OBJVAR_ELEMENTAL_TYPE); - } - - return -1; - } - - - public static float getNewWeaponElementalValue(obj_id prototype) throws InterruptedException - { - return getFloatObjVar(prototype, OBJVAR_ELEMENTAL_VALUE); - } - - - public static float getWeaponGasQualityMin(obj_id prototype) throws InterruptedException - { - return getFloatObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MIN); - } - - - public static float getWeaponGasQualityMax(obj_id prototype) throws InterruptedException - { - return getFloatObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MAX); - } - - - public static int getElementalAppearanceBonus(obj_id prototype) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return 0; - } - - String template = getTemplateName(prototype); - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_BONUS_TABLE); - if (row < 0) - { - return 0; - } - - int appBonus = dataTableGetInt(WEAPON_APP_BONUS_TABLE, row, "ele_bonus"); - - return appBonus; - } - - - public static int getCoreMinDamage(obj_id prototype, dictionary weaponDat) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return -1; - } - - if (weaponDat == null || weaponDat.isEmpty()) - { - return -1; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getCoreMinDamage::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return -1; - } - - int wpType = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_TYPE); - - String weaponType = WEAPON_TYPES[wpType]; - int minDamage = weaponDat.getInt(weaponType + "_min_damage"); - return minDamage; - } - - - public static int getCoreMaxDamage(obj_id prototype, dictionary weaponDat) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return -1; - } - - if (weaponDat == null || weaponDat.isEmpty()) - { - return -1; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getCoreMaxDamage::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return -1; - } - - int wpType = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_TYPE); - - String weaponType = WEAPON_TYPES[wpType]; - - int maxDamage = weaponDat.getInt(weaponType + "_max_damage"); - - return maxDamage; - } - - - public static int getWeaponSpeed(obj_id prototype) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return 1; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getWeaponSpeed::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return 1; - } - - int speed = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_SPEED); - - return speed; - } - - - public static int getNewWeaponWoundChance(obj_id prototype) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return 0; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getNewWeaponWoundChance::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return 0; - } - - int woundChance = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_WOUND); - - return woundChance; - } - - - public static int getNewWeaponAttackCost(obj_id prototype) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return 0; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getNewWeaponAttackCost::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return 0; - } - - int attackCost = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_COST); - - return attackCost; - } - - - public static int getNewWeaponAccuracy(obj_id prototype) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return 0; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getNewWeaponAccuracy::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return 0; - } - - int wpnAcc = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_ACC); - - return wpnAcc; - } - - - public static int getNewWeaponTableElementType(obj_id prototype) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return -1; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getNewWeaponTableElementType::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return -1; - } - - int elementType = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_ELEMENT_TYPE); - - return elementType; - } - - - public static int getNewWeaponTableElementalValue(obj_id prototype, dictionary weaponDat) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return -1; - } - - if (weaponDat == null || weaponDat.isEmpty()) - { - return -1; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getNewWeaponTableElementalValue::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return -1; - } - - int wpType = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_TYPE); - - String weaponType = WEAPON_TYPES[wpType]; - - int elementalValue = weaponDat.getInt("elemental_"+ weaponType + "_average_damage"); - - return elementalValue; - } - - - public static int getNewWeaponDamageType(obj_id prototype) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return -1; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getNewWeaponDamageType::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return -1; - } - - int damageType = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_DAMAGE_TYPE); - - return damageType; - } - - - public static int getNewWeaponMaxRange(obj_id prototype) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return -1; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getNewWeaponMaxRange::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return -1; - } - - int maxRange = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_MAX_RANGE); - - return maxRange; - } - - - public static int getNewWeaponMinRange(obj_id prototype) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return -1; - } - - String template = getTemplateName(prototype); - - int row = dataTableSearchColumnForString(template, WEAPON_APP_TEMPLATE, WEAPON_APP_TABLE); - - if (row < 0) - { - CustomerServiceLog("weaponsCraftingError", "getNewWeaponMinRange::Could not find template("+template+") in weapon appearance table for prototype "+ prototype); - return -1; - } - - int minRange = dataTableGetInt(WEAPON_APP_TABLE, row, WEAPON_APP_MIN_RANGE); - - return minRange; - } - - - public static boolean performSocketing(obj_id prototype, String[] expMods) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return false; - } - - if (expMods == null || expMods.length < 0) - { - return false; - } - - obj_id player = getOwner(prototype); - int[] mods = getEnhancedSkillStatisticModifiers(player, expMods); - - if (mods != null) - { - int sockets = 0; - int experimentModTotal = 0; - for (int j = 0; j < mods.length; ++j) - { - testAbortScript(); - experimentModTotal += mods[j]; - } - - if (experimentModTotal > craftinglib.socketThreshold) - { - - int chances = 1 + (experimentModTotal - craftinglib.socketThreshold) / craftinglib.socketDelta; - - for (int j = 0; j < chances; ++j) - { - testAbortScript(); - if (rand(1, 100) > craftinglib.socketChance) - { - ++sockets; - } - } - - if (sockets > craftinglib.maxSockets) - { - sockets = craftinglib.maxSockets; - } - - if (sockets > 0) - { - setCondition(prototype, CONDITION_MAGIC_ITEM); - } - } - - setSkillModSockets(prototype, sockets); - } - return true; - } - - public static String getDamageTypeString(int type) throws InterruptedException - { - boolean initializedDamageTypeNames = false; - if (!initializedDamageTypeNames) - { - initializedDamageTypeNames = true; - int next = 0; - DAMAGE_TYPE_NAMES[next++] = "kinetic"; - DAMAGE_TYPE_NAMES[next++] = "energy"; - DAMAGE_TYPE_NAMES[next++] = "blast"; - DAMAGE_TYPE_NAMES[next++] = "stun"; - DAMAGE_TYPE_NAMES[next++] = "restraint"; - DAMAGE_TYPE_NAMES[next++] = "elemental_heat"; - DAMAGE_TYPE_NAMES[next++] = "elemental_cold"; - DAMAGE_TYPE_NAMES[next++] = "elemental_acid"; - DAMAGE_TYPE_NAMES[next++] = "elemental_electrical"; - DAMAGE_TYPE_NAMES[next++] = "environmental_heat"; - DAMAGE_TYPE_NAMES[next++] = "environmental_cold"; - DAMAGE_TYPE_NAMES[next++] = "environmental_acid"; - DAMAGE_TYPE_NAMES[next++] = "environmental_electrical"; - } - int i = 0; - int c = 1; - while (c < type) - { - testAbortScript(); - c *= 2; - i++; - } - return DAMAGE_TYPE_NAMES[i]; - } - - - public static boolean storeWeaponCraftingValues(obj_id prototype, obj_id schematicId, draft_schematic schematic) throws InterruptedException - { - draft_schematic.slot[] slots = schematic.getSlots(); - draft_schematic.attribute[] objectAttribs = schematic.getAttribs(); - draft_schematic.attribute[] experimentalAttribs = schematic.getExperimentalAttribs(); - - for (int i = 0; i < slots.length; ++i) - { - testAbortScript(); - obj_id componentId = slots[i].ingredients[0].ingredient; - if (!isIdValid(componentId) || !exists(componentId)) - { - - componentId = schematicId; - if (!isIdValid(componentId) || !exists(componentId)) - { - continue; - } - } - - if (hasObjVar(componentId, "reverse_engineering.reverse_engineering_modifier")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar reverse_engineering.reverse_engineering_modifier"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting RE Bit data now on prototype "+ prototype); - - String reStatMod = getStringObjVar(componentId, "reverse_engineering.reverse_engineering_modifier"); - int ratio = getIntObjVar(componentId, "reverse_engineering.reverse_engineering_ratio"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ratio "+ ratio + " on prototype "+ prototype); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::reStatMod "+ reStatMod + " on prototype "+ prototype); - - setObjVar(prototype, craftinglib.OBJVAR_RE_RATIO, ratio); - setObjVar(prototype, craftinglib.OBJVAR_RE_STAT_MODIFIED, reStatMod); - } - - if (hasObjVar(componentId, "reverse_engineering.reverse_engineering_power")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar reverse_engineering.reverse_engineering_power"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting RE Bit data now on prototype "+ prototype); - - float powerMod = getIntObjVar(componentId, "reverse_engineering.reverse_engineering_power"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::powerMod before modification of 40% "+ powerMod + " on prototype "+ prototype); - - powerMod *= craftinglib.RE_POWER_MODIFIER; - - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::powerMod after modification of 40% "+ powerMod + " on prototype "+ prototype); - - setObjVar(prototype, craftinglib.OBJVAR_RE_VALUE, powerMod); - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "coreQualityLow")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar"+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityLow"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting coreQualityLow data now on prototype "+ prototype); - - float coreQualityLow = getFloatObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityLow"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::coreQualityLow "+ coreQualityLow + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MIN, coreQualityLow); - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "coreQualityHigh")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar"+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityHigh"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting coreQualityHigh data now on prototype "+ prototype); - - float coreQualityHigh = getFloatObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityHigh"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::coreQualityHigh "+ coreQualityHigh + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MAX, coreQualityHigh); - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "appearanceBonusLow")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar"+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "appearanceBonusLow"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting coreQuality data now on prototype "+ prototype); - - float appBonus = getFloatObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "appearanceBonusLow"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::appearanceBonusLow "+ appBonus + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_APPEARANCE_BONUS_MIN, appBonus); - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "appearanceBonusHigh")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar"+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "appearanceBonusHigh"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting coreQuality data now on prototype "+ prototype); - - float appBonus = getFloatObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "appearanceBonusHigh"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::appearanceBonusHigh "+ appBonus+ " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_APPEARANCE_BONUS_MAX, appBonus); - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "gasQualityLow")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "gasQualityLow"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting gasQualityLow data now on prototype "+ prototype); - if (!hasObjVar(componentId, OBJVAR_MODIFIER_GAS_QUALITY_MIN)) - { - float gasQualityLow = getIntObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "gasQualityLow"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::gasQualityLow "+ gasQualityLow+ " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MIN, gasQualityLow); - } - else - { - float gasQualityLow = getIntObjVar(componentId, OBJVAR_MODIFIER_GAS_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::gasQualityLow "+ gasQualityLow + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MIN, gasQualityLow); - } - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "gasQualityHigh")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "gasQualityHigh"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting gasQualityHigh data now on prototype "+ prototype); - if (!hasObjVar(componentId, OBJVAR_MODIFIER_GAS_QUALITY_MAX)) - { - float gasQualityHigh = getIntObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "gasQualityHigh"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::gasQualityHigh "+ gasQualityHigh + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MAX, gasQualityHigh); - } - else - { - float gasQualityHigh = getIntObjVar(componentId, OBJVAR_MODIFIER_GAS_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::gasQualityHigh "+ gasQualityHigh + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MAX, gasQualityHigh); - } - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "meleeComponentQualityLow")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "meleeComponentQualityLow"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting meleeComponentQualityLow data now on prototype "+ prototype); - if (!hasObjVar(componentId, OBJVAR_MODIFIER_MELEE_QUALITY_MIN)) - { - float meleeQuality = getIntObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "meleeComponentQualityLow"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::meleeComponentQualityLow "+ meleeQuality + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MIN, meleeQuality); - } - else - { - float meleeQuality = getIntObjVar(componentId, OBJVAR_MODIFIER_MELEE_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::meleeComponentQualityLow "+ meleeQuality + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MIN, meleeQuality); - } - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "meleeComponentQualityHigh")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "meleeComponentQualityHigh"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting meleeComponentQualityHigh data now on prototype "+ prototype); - if (!hasObjVar(componentId, OBJVAR_MODIFIER_MELEE_QUALITY_MAX)) - { - float meleeQuality = getIntObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "meleeComponentQualityHigh"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::meleeComponentQualityHigh "+ meleeQuality + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MAX, meleeQuality); - } - else - { - float meleeQuality = getIntObjVar(componentId, OBJVAR_MODIFIER_MELEE_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::meleeComponentQualityHigh "+ meleeQuality + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MAX, meleeQuality); - } - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "elementalValue")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "elementalValue"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting elementalValue data now on prototype "+ prototype); - - float elementalValue = getFloatObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "elementalValue"); - if (elementalValue >= 0.0f) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::elementalValue "+ elementalValue + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_ELEMENTAL_VALUE, elementalValue); - } - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "elementalType")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "elementalType"); - - float elementalType = getFloatObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "elementalType"); - if (elementalType >= 0) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting elementalType data now on prototype "+ prototype); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::elementalType "+ elementalType + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_ELEMENTAL_TYPE, elementalType); - } - } - - if (hasObjVar(componentId, craftinglib.OBJVAR_RE_STAT_MODIFIED)) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.OBJVAR_RE_STAT_MODIFIED); - - String statModified = getStringObjVar(componentId, craftinglib.OBJVAR_RE_STAT_MODIFIED); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting statModified data now on prototype "+ prototype); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::statModified "+ statModified + " on prototype "+ prototype); - setObjVar(prototype, craftinglib.OBJVAR_RE_STAT_MODIFIED, statModified); - - int ratio = getIntObjVar(componentId, craftinglib.OBJVAR_RE_RATIO); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting ratio data now on prototype "+ prototype); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ratio "+ ratio + " on prototype "+ prototype); - setObjVar(prototype, craftinglib.OBJVAR_RE_RATIO, ratio); - } - - if (hasObjVar(componentId, craftinglib.OBJVAR_RE_VALUE)) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.OBJVAR_RE_VALUE); - - float powerBit = getFloatObjVar(componentId, craftinglib.OBJVAR_RE_VALUE); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting powerBit data now on prototype "+ prototype); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::powerBit "+ powerBit + " on prototype "+ prototype); - setObjVar(prototype, craftinglib.OBJVAR_RE_VALUE, powerBit); - } - - if (hasObjVar(componentId, OBJVAR_WP_CORE_QUALITY_MIN)) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ OBJVAR_WP_CORE_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting coreQualityLow data now on prototype "+ prototype); - - float coreQuality = getFloatObjVar(componentId, OBJVAR_WP_CORE_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::coreQualityLow "+ coreQuality + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MIN, coreQuality); - } - - if (hasObjVar(componentId, OBJVAR_WP_CORE_QUALITY_MAX)) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ OBJVAR_WP_CORE_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting coreQualityHigh data now on prototype "+ prototype); - - float coreQuality = getFloatObjVar(componentId, OBJVAR_WP_CORE_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::coreQualityHigh "+ coreQuality + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MAX, coreQuality); - } - - if (hasObjVar(componentId, OBJVAR_MODIFIER_GAS_QUALITY_MIN)) - { - float gasQuality = getFloatObjVar(componentId, OBJVAR_MODIFIER_GAS_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ OBJVAR_MODIFIER_GAS_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting gasQualityLow data now to "+ gasQuality + " on prototype "+ prototype); - - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MIN, gasQuality); - } - - if (hasObjVar(componentId, OBJVAR_MODIFIER_GAS_QUALITY_MAX)) - { - float gasQuality = getFloatObjVar(componentId, OBJVAR_MODIFIER_GAS_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ OBJVAR_MODIFIER_GAS_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting gasQualityHigh data now to "+ gasQuality + " on prototype "+ prototype); - - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MAX, gasQuality); - } - - if (hasObjVar(componentId, OBJVAR_ELEMENTAL_VALUE)) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ OBJVAR_ELEMENTAL_VALUE); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting elementalValue data now on prototype "+ prototype); - - float elementalValue = getFloatObjVar(componentId, OBJVAR_ELEMENTAL_VALUE); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::elementalValue "+ elementalValue + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_ELEMENTAL_VALUE, elementalValue); - } - - if (hasObjVar(componentId, OBJVAR_ELEMENTAL_TYPE)) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ OBJVAR_ELEMENTAL_TYPE); - - float elementalType = getFloatObjVar(componentId, OBJVAR_ELEMENTAL_TYPE); - if (elementalType >= 0) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting elementalType data now on prototype "+ prototype); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::elementalType "+ elementalType + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_ELEMENTAL_TYPE, elementalType); - } - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "coreLevel")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreLevel"); - - int corelevel = (int)getFloatObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreLevel"); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting corelevel data now on prototype "+ prototype); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::corelevel "+ corelevel + " on prototype "+ prototype); - setObjVar(prototype, OBJVAR_WP_LEVEL, corelevel); - } - - if (hasObjVar(componentId, weapons.OBJVAR_MODIFIER_COMPONENT_BONUS_MIN) && !hasObjVar(prototype, OBJVAR_NEW_WP_WEAPON)) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::componentBonus::ingredient "+ componentId + " has the objvar "+ weapons.OBJVAR_MODIFIER_COMPONENT_BONUS_MIN); - float previousBonus = getFloatObjVar(prototype, weapons.OBJVAR_MODIFIER_COMPONENT_BONUS_MIN); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::componentBonus::previousBonusMin "+ previousBonus + " from prototype "+ prototype); - float componentBonus = getFloatObjVar(componentId, weapons.OBJVAR_MODIFIER_COMPONENT_BONUS_MIN); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::componentBonus::componentBonusMin "+ componentBonus + " from slotObject "+ componentId); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::componentBonus::setting componentBonus data now on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MIN, (previousBonus + componentBonus)); - } - - if (hasObjVar(componentId, weapons.OBJVAR_MODIFIER_COMPONENT_BONUS_MAX) && !hasObjVar(prototype, OBJVAR_NEW_WP_WEAPON)) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::componentBonus::ingredient "+ componentId + " has the objvar "+ weapons.OBJVAR_MODIFIER_COMPONENT_BONUS_MAX); - - float previousBonus = getFloatObjVar(prototype, weapons.OBJVAR_MODIFIER_COMPONENT_BONUS_MAX); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::componentBonus::previousBonusMax "+ previousBonus + " from prototype "+ prototype); - float componentBonus = getFloatObjVar(componentId, weapons.OBJVAR_MODIFIER_COMPONENT_BONUS_MAX); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ccomponentBonus::omponentBonusMax "+ componentBonus + " from slotObject "+ componentId); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::componentBonus::setting componentBonus data now on prototype "+ prototype); - setObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MAX, (previousBonus + componentBonus)); - } - - if (hasObjVar(componentId, OBJVAR_MODIFIER_MELEE_QUALITY_MIN)) - { - float meleeQuality = getFloatObjVar(componentId, OBJVAR_MODIFIER_MELEE_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ OBJVAR_MODIFIER_MELEE_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting meleeQuality_min data now to "+ meleeQuality + " on prototype "+ prototype); - - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MIN, meleeQuality); - } - - if (hasObjVar(componentId, OBJVAR_MODIFIER_MELEE_QUALITY_MAX)) - { - float meleeQuality = getFloatObjVar(componentId, OBJVAR_MODIFIER_MELEE_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ OBJVAR_MODIFIER_MELEE_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting meleeQuality_max data now to "+ meleeQuality + " on prototype "+ prototype); - - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MAX, meleeQuality); - } - - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "combat_critical_ranged") || hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "combat_critical_melee")) - { - if (isRangedCore(prototype) || isMeleeCore(prototype) || isHeavyCore(prototype)) - { - int critBonus = 0; - if (hasObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "combat_critical_ranged")) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "combat_critical_ranged"); - critBonus = getIntObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "combat_critical_ranged"); - setObjVar(prototype, OBJVAR_CRIT_BONUS_RANGED, critBonus); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting critBonus data now to "+ critBonus + " on prototype "+ prototype); - setCategorizedSkillModBonus(prototype, "weapon", "combat_critical_ranged", critBonus); - } - else - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "combat_critical_melee"); - critBonus = getIntObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "combat_critical_melee"); - setObjVar(prototype, OBJVAR_CRIT_BONUS_MELEE, critBonus); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting critBonus data now to "+ critBonus + " on prototype "+ prototype); - setCategorizedSkillModBonus(prototype, "weapon", "combat_critical_melee", critBonus); - } - } - } - - if (hasObjVar(componentId, "attribute.bonus")) - { - LOG("sissynoid", "attribute.bonus found"); - - int[] attribsModified = getAttributeBonuses(componentId); - - if (attribsModified != null && attribsModified.length > 0) - { - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::ingredient "+ componentId + " has an attribute bonus."); - int[] attribBonus = new int[NUM_ATTRIBUTES]; - for (int j = 0; j < attribsModified.length; ++j) - { - testAbortScript(); - if (attribsModified[j] > 0) - { - attribBonus[j] = attribsModified[j]; - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting Attribute Bonus "+ ATTRIBUTES[j] + " To "+ attribsModified[j]); - } - } - setAttributeBonuses(prototype, attribBonus); - } - - if (hasObjVar(componentId, "attribute.bonus") && hasObjVar(prototype, "armor.general_protection")) - { - CustomerServiceLog("new_weapon_crafting", "Cybernetics: Component("+ componentId +") is being added to a Cybernetic("+ prototype +") that has an Armor Core; Armor Value Reduction will occur by design."); - LOG("sissynoid", "Cybernetic has Armor Core and Modules - Nerf the Core: prototype: "+ prototype); - setObjVar(prototype, "modifyCyberneticArmorValue", true); - } - } - - if (hasObjVar(componentId, "cybernetic.special_protection")) - { - LOG("sissynoid", "Cybernetic Protection Module found!"); - int protectionType = getIntObjVar(componentId, "cybernetic.special_protection"); - setObjVar(prototype, "cybernetic.special_protection.type", protectionType); - float protectionValue = getFloatObjVar(componentId, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "cybernetic_electrical_resist_module"); - setObjVar(prototype, "cybernetic.special_protection.value", protectionValue); - CustomerServiceLog("new_weapon_crafting", "Cybernetics: Component("+ componentId +") has Special Protection - Adding these to the Cybernetic("+ prototype +"): protection type: ("+ protectionType + ") and Value: ("+ protectionValue + ")."); - LOG("sissynoid", "WEAPON SCRIPTLIB: protection module type: "+ protectionType + " and Value: "+ protectionValue); - } - - if (hasObjVar(componentId, OBJVAR_CRIT_BONUS_MELEE) || hasObjVar(componentId, OBJVAR_CRIT_BONUS_RANGED)) - { - if (hasObjVar(componentId, OBJVAR_CRIT_BONUS_MELEE)) - { - int critBonus = getIntObjVar(componentId, OBJVAR_CRIT_BONUS_MELEE); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting critBonus data now to "+ critBonus + " on prototype "+ prototype); - setCategorizedSkillModBonus(prototype, "weapon", "combat_critical_melee", critBonus); - setObjVar(prototype, OBJVAR_CRIT_BONUS_MELEE, critBonus); - } - if (hasObjVar(componentId, OBJVAR_CRIT_BONUS_RANGED)) - { - int critBonus = getIntObjVar(componentId, OBJVAR_CRIT_BONUS_RANGED); - CustomerServiceLog("new_weapon_crafting", "storeWeaponCraftingValues::setting critBonus data now to "+ critBonus + " on prototype "+ prototype); - setCategorizedSkillModBonus(prototype, "weapon", "combat_critical_ranged", critBonus); - setObjVar(prototype, OBJVAR_CRIT_BONUS_RANGED, critBonus); - } - } - } - return true; - } - - - public static boolean setComponentObjVars(obj_id prototype, draft_schematic.attribute[] itemAttributes) throws InterruptedException - { - if (!isIdValid(prototype) || !exists(prototype)) - { - return false; - } - - for (int i = 0; i < itemAttributes.length; ++i) - { - testAbortScript(); - float attribValue = itemAttributes[i].currentValue; - - if (itemAttributes[i].name.getAsciiId().equals("gasQualityLow")) - { - - if (hasObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MIN)) - { - if (!hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "gasQualityLow")) - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") dont have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "gasQualityLow"); - attribValue = getFloatObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new gasQualityLow value is "+ attribValue); - } - else - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "gasQualityLow"); - attribValue /= NEW_COMPONENT_MODIFIER; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new gasQualityLow value is "+ attribValue); - } - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MIN, attribValue); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::gasQualityLow on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MIN, attribValue); - } - else if (hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "gasQualityLow")) - { - attribValue = getFloatObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "gasQualityLow"); - - attribValue /= NEW_COMPONENT_MODIFIER; - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::gasQualityLow on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MIN, attribValue); - } - } - - if (itemAttributes[i].name.getAsciiId().equals("gasQualityHigh")) - { - - if (hasObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MAX)) - { - if (!hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "gasQualityHigh")) - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") dont have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "gasQualityHigh"); - attribValue = getFloatObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new gasQualityHigh value is "+ attribValue); - } - else - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "gasQualityHigh"); - attribValue /= NEW_COMPONENT_MODIFIER; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new gasQualityHigh value is "+ attribValue); - } - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MAX, attribValue); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::gasQualityHigh on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MAX, attribValue); - } - else if (hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "gasQualityHigh")) - { - attribValue = getFloatObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "gasQualityHigh"); - - attribValue /= NEW_COMPONENT_MODIFIER; - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::gasQualityLow on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_GAS_QUALITY_MAX, attribValue); - } - } - - if (itemAttributes[i].name.getAsciiId().equals("componentBonusLow")) - { - if (hasObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MIN)) - { - if (!hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "componentBonusLow")) - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") dont have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "componentBonusLow"); - attribValue = getFloatObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MIN); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new componentBonusLow value is "+ attribValue); - } - else - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "componentBonusLow"); - attribValue /= NEW_COMPONENT_MODIFIER; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new componentBonusLow value is "+ attribValue); - } - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - setObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MIN, attribValue); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::componentBonusLow on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MIN, attribValue); - } - else if (hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "componentBonusLow")) - { - attribValue = getFloatObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "componentBonusLow"); - - attribValue /= NEW_COMPONENT_MODIFIER; - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::gasQualityHigh on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MIN, attribValue); - } - } - - if (itemAttributes[i].name.getAsciiId().equals("componentBonusHigh")) - { - if (hasObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MAX)) - { - if (!hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "componentBonusHigh")) - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") dont have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "componentBonusHigh"); - attribValue = getFloatObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MAX); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new componentBonusHigh value is "+ attribValue); - } - else - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "componentBonusHigh"); - attribValue /= NEW_COMPONENT_MODIFIER; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new componentBonusHigh value is "+ attribValue); - } - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - setObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MAX, attribValue); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::componentBonusHigh on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MAX, attribValue); - } - else if (hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "componentBonusHigh")) - { - attribValue = getFloatObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "componentBonusHigh"); - - attribValue /= NEW_COMPONENT_MODIFIER; - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::gasQualityLow on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_COMPONENT_BONUS_MAX, attribValue); - } - } - - if (itemAttributes[i].name.getAsciiId().equals("meleeComponentQualityLow")) - { - if (hasObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MIN)) - { - if (!hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "meleeComponentQualityLow")) - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") dont have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "meleeComponentQualityLow"); - attribValue = getFloatObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new meleeComponentQualityLow value is "+ attribValue); - } - else - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "meleeComponentQualityLow"); - attribValue /= NEW_COMPONENT_MODIFIER; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new meleeComponentQualityLow value is "+ attribValue); - } - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MIN, attribValue); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::meleeComponentQualityLow on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MIN, attribValue); - } - else if (hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "meleeComponentQualityLow")) - { - attribValue = getFloatObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "meleeComponentQualityLow"); - - attribValue /= NEW_COMPONENT_MODIFIER; - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::gasQualityLow on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MIN, attribValue); - } - } - - if (itemAttributes[i].name.getAsciiId().equals("meleeComponentQualityHigh")) - { - if (hasObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MAX)) - { - if (!hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "meleeComponentQualityHigh")) - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") dont have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "meleeComponentQualityHigh"); - attribValue = getFloatObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new meleeComponentQualityHigh value is "+ attribValue); - } - else - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "meleeComponentQualityHigh"); - attribValue /= NEW_COMPONENT_MODIFIER; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new meleeComponentQualityHigh value is "+ attribValue); - } - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MAX, attribValue); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::meleeComponentQualityHigh on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MAX, attribValue); - } - else if (hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "meleeComponentQualityHigh")) - { - attribValue = getFloatObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "meleeComponentQualityHigh"); - - attribValue /= NEW_COMPONENT_MODIFIER; - - if (attribValue > NEW_COMPONENT_CAP) - { - attribValue = NEW_COMPONENT_CAP; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::gasQualityLow on prototype("+prototype+")was higher than the cap of "+ NEW_COMPONENT_CAP + ", so we lowered it to the cap."); - } - - setObjVar(prototype, OBJVAR_MODIFIER_MELEE_QUALITY_MAX, attribValue); - } - } - if (itemAttributes[i].name.getAsciiId().equals("coreQualityLow")) - { - - if (hasObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MIN)) - { - if (!hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "coreQualityLow")) - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") dont have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityLow"); - attribValue = getFloatObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MIN); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new gasQualityLow value is "+ attribValue); - } - else - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityLow"); - attribValue /= WP_CORE_MODIFIER; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new coreQualityLow value is "+ attribValue); - } - - setObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MIN, attribValue); - setObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityLow", attribValue); - } - else if (hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "coreQualityLow")) - { - attribValue = getFloatObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityLow"); - - attribValue /= WP_CORE_MODIFIER; - - setObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MIN, attribValue); - } - } - - if (itemAttributes[i].name.getAsciiId().equals("coreQualityHigh")) - { - - if (hasObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MAX)) - { - if (!hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "coreQualityHigh")) - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") dont have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityHigh"); - attribValue = getFloatObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MAX); - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new gasQualityHigh value is "+ attribValue); - } - else - { - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::we("+prototype+") have the objvar "+ craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityHigh"); - attribValue /= WP_CORE_MODIFIER; - CustomerServiceLog("new_weapon_crafting", "setComponentObjVars::new coreQualityHigh value is "+ attribValue); - } - - setObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MAX, attribValue); - setObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityHigh", attribValue); - } - else if (hasObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "coreQualityHigh")) - { - attribValue = getFloatObjVar(prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityHigh"); - - attribValue /= WP_CORE_MODIFIER; - - setObjVar(prototype, OBJVAR_WP_CORE_QUALITY_MAX, attribValue); - } - } - - } - return true; - } - - - public static boolean isCoredWeapon(obj_id weapon) throws InterruptedException - { - if (!isIdValid(weapon) || !exists(weapon)) - { - return false; - } - - return hasObjVar(weapon, OBJVAR_NEW_WP_WEAPON); - } - - - public static float getWeaponComponentBonusesMinDamage(obj_id weapon) throws InterruptedException - { - if (!isIdValid(weapon) || !exists(weapon)) - { - return 0.0f; - } - - float craftBonuses = 0.0f; - - if (hasObjVar(weapon, OBJVAR_MODIFIER_GAS_QUALITY_MIN)) - { - - craftBonuses += getFloatObjVar(weapon, OBJVAR_MODIFIER_GAS_QUALITY_MIN); - } - else - { - - craftBonuses += getFloatObjVar(weapon, OBJVAR_MODIFIER_MELEE_QUALITY_MIN); - } - - if (hasObjVar(weapon, OBJVAR_MODIFIER_COMPONENT_BONUS_MIN)) - { - - craftBonuses += getFloatObjVar(weapon, OBJVAR_MODIFIER_COMPONENT_BONUS_MIN); - } - - if (hasObjVar(weapon, OBJVAR_MODIFIER_APPEARANCE_BONUS_MIN)) - { - - craftBonuses += getFloatObjVar(weapon, OBJVAR_MODIFIER_APPEARANCE_BONUS_MIN); - } - - return craftBonuses; - } - - - public static float getWeaponComponentBonusesMaxDamage(obj_id weapon) throws InterruptedException - { - if (!isIdValid(weapon) || !exists(weapon)) - { - return 0.0f; - } - - float craftBonuses = 0.0f; - - if (hasObjVar(weapon, OBJVAR_MODIFIER_GAS_QUALITY_MAX)) - { - - craftBonuses += getFloatObjVar(weapon, OBJVAR_MODIFIER_GAS_QUALITY_MAX); - } - else - { - - craftBonuses += getFloatObjVar(weapon, OBJVAR_MODIFIER_MELEE_QUALITY_MAX); - } - - if (hasObjVar(weapon, OBJVAR_MODIFIER_COMPONENT_BONUS_MAX)) - { - - craftBonuses += getFloatObjVar(weapon, OBJVAR_MODIFIER_COMPONENT_BONUS_MAX); - } - - if (hasObjVar(weapon, OBJVAR_MODIFIER_APPEARANCE_BONUS_MAX)) - { - - craftBonuses += getFloatObjVar(weapon, OBJVAR_MODIFIER_APPEARANCE_BONUS_MAX); - } - - return craftBonuses; - } - - - public static boolean isRangedCore(obj_id core) throws InterruptedException - { - if (!isIdValid(core) || !exists(core)) - { - return false; - } - - String template = getTemplateName(core); - - if (template.equals("object/tangible/component/weapon/core/weapon_core_ranged_base.iff")) - { - return true; - } - else if (template.equals("object/tangible/component/weapon/core/weapon_core_ranged_advanced.iff")) - { - return true; - } - else if (template.equals("object/tangible/component/weapon/core/weapon_core_ranged_basic.iff")) - { - return true; - } - else if (template.equals("object/tangible/component/weapon/core/weapon_core_ranged_standard.iff")) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isHeavyCore(obj_id core) throws InterruptedException - { - if (!isIdValid(core) || !exists(core)) - { - return false; - } - - String template = getTemplateName(core); - - if (template.equals("object/tangible/component/weapon/core/weapon_core_heavy_base.iff")) - { - return true; - } - else if (template.equals("object/tangible/component/weapon/core/weapon_core_heavy_advanced.iff")) - { - return true; - } - else if (template.equals("object/tangible/component/weapon/core/weapon_core_heavy_standard.iff")) - { - return true; - } - else - { - return false; - } - } - - - public static boolean isMeleeCore(obj_id core) throws InterruptedException - { - if (!isIdValid(core) || !exists(core)) - { - return false; - } - - String template = getTemplateName(core); - - if (template.equals("object/tangible/component/weapon/core/weapon_core_melee_base.iff")) - { - return true; - } - else if (template.equals("object/tangible/component/weapon/core/weapon_core_melee_basic.iff")) - { - return true; - } - else if (template.equals("object/tangible/component/weapon/core/weapon_core_melee_standard.iff")) - { - return true; - } - else if (template.equals("object/tangible/component/weapon/core/weapon_core_melee_advanced.iff")) - { - return true; - } - else - { - return false; - } - } - - - public static float verifyDamageRangeMin(obj_id weapon, float currentDamage, dictionary coreData) throws InterruptedException - { - if (!isIdValid(weapon) || !exists(weapon)) - { - return 0.0f; - } - - if (coreData == null || coreData.isEmpty()) - { - return 0.0f; - } - - int tableMin = getCoreMinDamage(weapon, coreData); - - float tableMinCap = tableMin * NEW_WP_DAMAGE_CAP; - - if (currentDamage > tableMinCap) - { - return tableMinCap; - } - - return currentDamage; - } - - - public static float verifyDamageRangeMax(obj_id weapon, float currentDamage, dictionary coreData) throws InterruptedException - { - if (!isIdValid(weapon) || !exists(weapon)) - { - return 0.0f; - } - - if (coreData == null || coreData.isEmpty()) - { - return 0.0f; - } - - int tableMax = getCoreMaxDamage(weapon, coreData); - - float tableMaxCap = tableMax * NEW_WP_DAMAGE_CAP; - - if (currentDamage > tableMaxCap) - { - return tableMaxCap; - } - - return currentDamage; - } - - - public static boolean isProfWheelSchemWeapon(obj_id weapon) throws InterruptedException - { - - LOG("dismantle","isProfWheelSchemWeapon"); - - if (!isIdValid(weapon) || !exists(weapon)) - { - CustomerServiceLog("new_weapon_conversion", "Invalid ids passed in"); - return true; - } - - String template = getTemplateName(weapon); - LOG("dismantle","template: "+template); - - if (template == null || template.equals("")) - { - CustomerServiceLog("new_weapon_conversion", "Couldnt find a valid object template for weapon("+weapon+")"); - return true; - } - - String schemGroupTable = "datatables/crafting/schematic_group.iff"; - LOG("dismantle","schemGroupTable: "+schemGroupTable); - - int row = dataTableSearchColumnForString(template, "crafted_object_template", WEAPON_APP_BONUS_TABLE); - LOG("dismantle","row: "+row); - - if (row < 0) - { - CustomerServiceLog("new_weapon_conversion", "Couldnt find a valid draft schematic in appearance table for template("+template+") on weapon("+weapon+")"); - return true; - } - - String schemName = dataTableGetString(WEAPON_APP_BONUS_TABLE, row, "schematic_name"); - LOG("dismantle","schemName: "+schemName); - if (schemName == null || schemName.equals("")) - { - CustomerServiceLog("new_weapon_conversion", "bad schematic name when searcing in weapons appearance table for template("+template+") on weapon("+weapon+")"); - return true; - } - - schemName = "object/draft_schematic/weapon/appearance/"+ schemName + ".iff"; - LOG("dismantle","schemName: "+schemName); - - row = dataTableSearchColumnForString(schemName, "SchematicName", schemGroupTable); - LOG("dismantle","row: "+row); - - if (row >= 0) - { - CustomerServiceLog("new_weapon_conversion", "Schematic found in profession wheel for schematic("+schemName+") on template("+template+") on weapon("+weapon+")"); - return true; - } - - CustomerServiceLog("new_weapon_conversion", "Schematic NOT found in profession wheel for schematic("+schemName+") on template("+template+") on weapon("+weapon+")"); - return false; - } - - - public static boolean turnWeaponIntoSchem(obj_id player, obj_id weapon) throws InterruptedException - { - if (!isIdValid(weapon) || !exists(weapon)) - { - return false; - } - - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - String template = getTemplateName(weapon); - - int row = dataTableSearchColumnForString(template, "crafted_object_template", WEAPON_APP_BONUS_TABLE); - - if (row < 0) - { - return false; - } - - String schemName = dataTableGetString(WEAPON_APP_BONUS_TABLE, row, "schematic_name"); - - if (schemName == null || schemName.equals("")) - { - return false; - } - - String limitedUseTemplate = "object/tangible/loot/loot_schematic/deconstructed_weapon_schematic.iff"; - - obj_id pInv = utils.getInventoryContainer(player); - - obj_id newSchem = createObjectOverloaded(limitedUseTemplate, pInv); - CustomerServiceLog("new_weapon_conversion", "New schematic("+schemName+") converted from weapon("+weapon+") for player "+getFirstName(player)+"("+player+")"); - - if (!isIdValid(newSchem) || !exists(newSchem)) - { - return false; - } - - setName(newSchem, utils.packStringId(getNameFromTemplate(template))); - setObjVar(newSchem, "loot_schematic.schematic", "object/draft_schematic/weapon/appearance/"+ schemName + ".iff"); - setObjVar(newSchem, "loot_schematic.uses", 1); - setObjVar(newSchem, "loot_schematic.skill_req", "class_munitions_phase1_master"); - - obj_id bioLink = getBioLink(weapon); - if (isIdValid(bioLink)) - { - setBioLink(newSchem, bioLink); - } - - if (utils.isItemNoDrop(weapon)) - { - setBioLink(newSchem, player); - } - - attachScript(newSchem, "item.loot_schematic.loot_schematic"); - CustomerServiceLog("new_weapon_conversion", "Weapon("+weapon+") about to be destroyed on player "+getFirstName(player)+"("+player+") because it was converted into schematic "+schemName+"("+newSchem+")"); - - return true; - } - - - public static boolean validateDamage(obj_id player, obj_id item) throws InterruptedException - { - if (!isCoredWeapon(item)) - { - return false; - } - - float coreBonus = 0.0f; - float craftedBonus = 0.0f; - - int coreLevel = getCoreLevel(item); - if (coreLevel <= 0) - { - return false; - } - - dictionary weaponCoreDat = getWeaponCoreData(coreLevel); - if (weaponCoreDat == null || weaponCoreDat.isEmpty()) - { - return false; - } - - coreBonus = getWeaponCoreQualityMin(item); - craftedBonus = coreBonus + getWeaponComponentBonusesMinDamage(item); - int tableMin = weaponCoreDat.getInt("pistol_min_damage"); - float minDamage = tableMin * craftedBonus; - - coreBonus = getWeaponCoreQualityMax(item); - craftedBonus = coreBonus + getWeaponComponentBonusesMaxDamage(item); - int tableMax = weaponCoreDat.getInt("pistol_max_damage"); - float maxDamage = tableMax * craftedBonus; - - if (minDamage > maxDamage) - { - CustomerServiceLog("new_weapon_crafting", "player "+getFirstName(player)+"("+player+") crafted an invalid weapon item, their min damage("+minDamage+") was higher than their max("+maxDamage+")"); - CustomerServiceLog("new_weapon_crafting", "player "+getFirstName(player)+"("+player+") Their coreQuality min has been reset to coreQuality max - 1%"); - sendSystemMessage(player, SID_MIN_DAMAGE_GREATER_THAN_MAX); - if (hasObjVar(item, OBJVAR_WP_CORE_QUALITY_MIN) && hasObjVar(item, OBJVAR_WP_CORE_QUALITY_MAX)) - { - float coreMax = getFloatObjVar(item, OBJVAR_WP_CORE_QUALITY_MAX); - setObjVar(item, OBJVAR_WP_CORE_QUALITY_MIN, (coreMax - 0.01f)); - } - - if (hasObjVar(item, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "coreQualityLow") && hasObjVar(item, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "." + "coreQualityHigh")) - { - float coreMax = getFloatObjVar(item, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityHigh"); - setObjVar(item, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ "coreQualityLow", (coreMax - 0.01f)); - } - - coredWeaponConversion(item); - } - return true; - } - - - public static boolean setSchematicVariablesFromSchematic(obj_id schematic, obj_id prototype) throws InterruptedException - { - boolean objvarsCopied = false; - if (hasObjVar(prototype, OBJVAR_NEW_WP)) - { - copyObjVar(prototype, schematic, OBJVAR_NEW_WP); - objvarsCopied = true; - } - return objvarsCopied; - - } - - - public static boolean setSchematicVariablesFromProtoType(obj_id schematic, obj_id prototype) throws InterruptedException - { - boolean objvarsCopied = false; - if (hasObjVar(schematic, OBJVAR_NEW_WP)) - { - copyObjVar(schematic, prototype, OBJVAR_NEW_WP); - objvarsCopied = true; - } - return objvarsCopied; - - } - - - public static boolean checkForIllegalStorytellerWeapon(obj_id player, obj_id weapon) throws InterruptedException - { - if (isIdValid(player) && isIdValid(weapon)) - { - if (isPlayer(player)) - { - if (isWeapon(weapon) && getWeaponAttackSpeed(weapon) >= 2.0f) - { - return true; - } - } - } - return false; - } - - - public static void handleIllegalStorytellerWeapon(obj_id player, obj_id weapon, String source) throws InterruptedException - { - if (isIdValid(player) && isIdValid(weapon)) - { - String weaponTemplate = getTemplateName(weapon); - if (weaponTemplate.indexOf("grenade") <= -1 && !utils.hasScriptVar(weapon, "illegalStorytellerWeapon")) - { - String msg = "Weapon gained from a storyteller NPC via an exploit was detected in "+source+". Player ("+player+") and weapon | "+ getName(weapon) + " | "+ weaponTemplate +" | ("+weapon+")."; - CustomerServiceLog("storyteller_weapon_exploit", msg); - CustomerServiceLog("storyteller_weapon_exploit", logWeaponStats(weapon)); - - obj_id playerInv = utils.getInventoryContainer(player); - if (isIdValid(playerInv)) - { - - } - } - } - return; - } - - - public static String logWeaponStats(obj_id weapon) throws InterruptedException - { - String logMsg = "Storyteller Exploited Weapon Stats: "; - - String weaponTemplate = getTemplateName(weapon); - logMsg += localize(getNameFromTemplate(weaponTemplate)) + "("+ weaponTemplate + ") - "; - - combat_engine.weapon_data weaponData = getWeaponData(weapon); - - logMsg += "Spd ("+ weaponData.attackSpeed + "), "; - logMsg += "Dmg ("+ weaponData.minDamage + "-"+ weaponData.maxDamage + "), "; - - logMsg += "DmgType ("; - if ((weaponData.damageType & DAMAGE_KINETIC) != 0) - { - logMsg += "KINETIC, "; - } - if ((weaponData.damageType & DAMAGE_ENERGY) != 0) - { - logMsg += "ENERGY, "; - } - if ((weaponData.damageType & DAMAGE_BLAST) != 0) - { - logMsg += "BLAST, "; - } - if ((weaponData.damageType & DAMAGE_STUN) != 0) - { - logMsg += "STUN, "; - } - if ((weaponData.damageType & DAMAGE_RESTRAINT) != 0) - { - logMsg += "RESTRAINT, "; - } - if ((weaponData.damageType & DAMAGE_ELEMENTAL_HEAT) != 0) - { - logMsg += "ELEMENTAL_HEAT, "; - } - if ((weaponData.damageType & DAMAGE_ELEMENTAL_COLD) != 0) - { - logMsg += "ELEMENTAL_COLD, "; - } - if ((weaponData.damageType & DAMAGE_ELEMENTAL_ACID) != 0) - { - logMsg += "ELEMENTAL_ACID, "; - } - if ((weaponData.damageType & DAMAGE_ELEMENTAL_ELECTRICAL) != 0) - { - logMsg += "ELEMENTAL_ELECTRICAL, "; - } - if ((weaponData.damageType & DAMAGE_ENVIRONMENTAL_HEAT) != 0) - { - logMsg += "ENVIRONMENTAL_HEAT, "; - } - if ((weaponData.damageType & DAMAGE_ENVIRONMENTAL_COLD) != 0) - { - logMsg += "ENVIRONMENTAL_COLD, "; - } - if ((weaponData.damageType & DAMAGE_ENVIRONMENTAL_ACID) != 0) - { - logMsg += "ENVIRONMENTAL_ACID, "; - } - if ((weaponData.damageType & DAMAGE_ENVIRONMENTAL_ELECTRICAL) != 0) - { - logMsg += "ENVIRONMENTAL_ELECTRICAL, "; - } - logMsg += "), "; - - logMsg += "Range ("+ weaponData.minRange + ", "+ weaponData.maxRange + "), "; - logMsg += "Cost ("+ weaponData.attackCost + ")"; - logMsg += "Wound ("+ weaponData.woundChance + ")"; - logMsg += "Accuracy ("+ weaponData.accuracy + ")"; - - return logMsg; - } -} diff --git a/sku.0/sys.server/compiled/game/script/library/xp.java b/sku.0/sys.server/compiled/game/script/library/xp.java deleted file mode 100644 index b195dfc73..000000000 --- a/sku.0/sys.server/compiled/game/script/library/xp.java +++ /dev/null @@ -1,2890 +0,0 @@ -package script.library; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.lang.Math; -import java.util.*; -import script.library.beast_lib; -import script.library.buff; -import script.library.collection; -import script.library.combat; -import script.library.gcw; -import script.library.group; -import script.library.performance; -import script.library.pet_lib; -import script.library.space_flags; -import script.library.utils; - - -public class xp extends script.base_script -{ - public xp() - { - } - public static final float COMBAT_GENERAL_EXCHANGE_RATE = 0.10f; - public static final float JEDI_GENERAL_EXCHANGE_RATE = 0.18f; - public static final float SOCIAL_ENTERTAINER_EXCHANGE_RATE = 1.0f; - public static final float CRAFTING_MERCHANT_EXCHANGE_RATE = 0.25f; - - public static final float SQUADLEADER_XP_RATIO = 1.0f; - public static final float SOCIAL_COMBAT_XP_MOD = 1.0f; - - public static final String VAR_SQUADLEADER_BASE = "squadleader"; - public static final String VAR_SQUADLEADER_XP = VAR_SQUADLEADER_BASE + ".xp"; - public static final String VAR_SQUADLEADER_AT_CAP = VAR_SQUADLEADER_BASE + ".atCap"; - public static final String VAR_SQUADLEADER_GROUP_SIZE = VAR_SQUADLEADER_BASE + ".groupSize"; - - public static final String XP = "xp"; - - public static final String WEAPON_TYPE = "weaponType"; - - public static final String GRANT_XP_RESULT_VALUE = "delta"; - public static final String GRANT_XP_RETURN_DATA = "data"; - - public static final float FACTIONAL_WINNING_XP_BONUS = 1.15f; - - public static final String SCOUT = "scout"; - public static final String TRAPPING = "trapping"; - public static final String BOUNTYHUNTER = "bountyhunter"; - public static final String SMUGGLER = "smuggler"; - public static final String SQUADLEADER = "squadleader"; - - public static final String SLICING = "slicing"; - - public static final String IMAGEDESIGNER = "imagedesigner"; - public static final String RANGER = "ranger"; - - public static final String FARMER = "farmer"; - public static final String INDUSTRIALIST = "industralist"; - public static final String BIO_ENGINEER = "bio_engineer"; - public static final String BIO_ENGINEER_DNA_HARVESTING = "bio_engineer_dna_harvesting"; - - public static final String HARVEST_ORGANIC = "resource_harvesting_organic"; - public static final String HARVEST_INORGANIC = "resource_harvesting_inorganic"; - - public static final String CRAFTING_GENERAL = "crafting_general"; - public static final String CRAFTING_FOOD_GENERAL = "crafting_food_general"; - public static final String CRAFTING_MEDICINE_GENERAL = "crafting_medical_general"; - public static final String CRAFTING_CLOTHING_ARMOR = "crafting_clothing_armor"; - public static final String CRAFTING_CLOTHING_GENERAL = "crafting_clothing_general"; - public static final String CRAFTING_WEAPONS_GENERAL = "crafting_weapons_general"; - public static final String CRAFTING_WEAPONS_MELEE = "crafting_weapons_melee"; - public static final String CRAFTING_WEAPONS_RANGED = "crafting_weapons_ranged"; - public static final String CRAFTING_WEAPONS_MUNITION = "crafting_weapons_munition"; - public static final String CRAFTING_STRUCTURE_GENERAL = "crafting_structure_general"; - public static final String CRAFTING_DROID_GENERAL = "crafting_droid_general"; - public static final String CRAFTING_SHIPWRIGHT = "shipwright"; - - public static final String MERCHANT = "merchant"; - - public static final String CRAFTING_BIO_ENGINEER_CREATURE = "crafting_bio_engineer_creature"; - public static final String CRAFTING_BIO_ENGINEER_TISSUE = "crafting_bio_engineer_tissue"; - - public static final String COMBAT_JEDI_ONEHANDLIGHTSABER = "combat_meleespecialize_onehandlightsaber"; - public static final String COMBAT_JEDI_TWOHANDLIGHTSABER = "combat_meleespecialize_twohandlightsaber"; - public static final String COMBAT_JEDI_POLEARMLIGHTSABER = "combat_meleespecialize_polearmlightsaber"; - public static final String COMBAT_JEDI_FORCE_POWER = "jedi_force"; - public static final String JEDI_GENERAL = "jedi_general"; - - public static final String COMBAT_GENERAL = "combat_general"; - - public static final String COMBAT_MELEESPECIALIZE_UNARMED = "combat_meleespecialize_unarmed"; - public static final String COMBAT_MELEESPECIALIZE_ONEHAND = "combat_meleespecialize_onehand"; - public static final String COMBAT_MELEESPECIALIZE_TWOHAND = "combat_meleespecialize_twohand"; - public static final String COMBAT_MELEESPECIALIZE_POLEARM = "combat_meleespecialize_polearm"; - - public static final String COMBAT_RANGEDSPECIALIZE_RIFLE = "combat_rangedspecialize_rifle"; - public static final String COMBAT_RANGEDSPECIALIZE_PISTOL = "combat_rangedspecialize_pistol"; - public static final String COMBAT_RANGEDSPECIALIZE_CARBINE = "combat_rangedspecialize_carbine"; - public static final String COMBAT_RANGEDSPECIALIZE_HEAVY = "combat_rangedspecialize_heavy"; - - public static final String COMBAT_THROWN = "combat_thrown"; - public static final String COMBAT_GRENADE = "combat_grenade"; - - public static final String CREATUREHANDLER = "creaturehandler"; - public static final String COMBATMEDIC = "combatmedic"; - public static final String MEDICAL = "medical"; - - public static final String SPACE_COMBAT_GENERAL = "space_combat_general"; - public static final String SPACE_PRESTIGE_IMPERIAL = "prestige_imperial"; - public static final String SPACE_PRESTIGE_REBEL = "prestige_rebel"; - public static final String SPACE_PRESTIGE_PILOT = "prestige_pilot"; - - public static final String MUSIC = "music"; - public static final String DANCE = "dance"; - public static final String JUGGLING = "juggling"; - public static final String ENTERTAINER = "entertainer"; - - public static final String QUEST_SOCIAL = "quest_social"; - public static final String QUEST_COMBAT = "quest_combat"; - public static final String QUEST_CRAFTING = "quest_crafting"; - public static final String QUEST_GENERAL = "quest_general"; - - public static final String APPRENTICESHIP = "apprenticeship"; - - public static final String PERMISSIONS_ONLY = "permissions_only"; - public static final String RAW_COMBAT = "raw_combat"; - public static final String PARTIAL_COMBAT = "partial_combat"; - public static final String PET_DAMAGE = "pet_damage"; - - public static final String POLITICAL = "political"; - - public static final String UNKNOWN = "unknown"; - - public static final String STF_XP_N = "exp_n"; - - public static final string_id SID_SCOUT = new string_id(STF_XP_N, SCOUT); - - public static final string_id SID_HARVEST_ORGANIC = new string_id(STF_XP_N, HARVEST_ORGANIC); - public static final string_id SID_HARVEST_INORGANIC = new string_id(STF_XP_N, HARVEST_INORGANIC); - - public static final string_id PROSE_GRANT_XP = new string_id("base_player", "prose_grant_xp"); - public static final string_id PROSE_GRANT_GROUP_XP = new string_id("base_player", "prose_grant_group_xp"); - public static final string_id PROSE_GRANT_BUFF_XP = new string_id("base_player", "prose_grant_buff_xp"); - public static final string_id PROSE_GRANT_GROUP_BUFF_XP = new string_id("base_player", "prose_grant_group_buff_xp"); - public static final string_id PROSE_REVOKE_XP = new string_id("base_player", "prose_revoke_xp"); - public static final string_id PROSE_GRANT_XP_BONUS = new string_id("base_player", "prose_grant_xp_bonus"); - - public static final string_id PROSE_GRANT_XP1 = new string_id("base_player", "prose_grant_xp1"); - public static final string_id PROSE_REVOKE_XP1 = new string_id("base_player", "prose_revoke_xp1"); - - public static final String VAR_CREDIT_FOR_KILLS = "creditForKills"; - public static final String VAR_NPC_DAMAGE = VAR_CREDIT_FOR_KILLS + ".npcDamage"; - public static final String VAR_ATTACKER_LIST = VAR_CREDIT_FOR_KILLS + ".attackerList"; - public static final String VAR_DAMAGE_TALLY = VAR_CREDIT_FOR_KILLS + ".damageTally"; - public static final String VAR_DAMAGE_COUNT = VAR_CREDIT_FOR_KILLS + ".damageCount"; - public static final String VAR_COMBAT_TIMESTAMP = VAR_CREDIT_FOR_KILLS + ".timestamp"; - - public static final int MAX_PLAYERS = 30; - public static final int MAX_DISTANCE = 190; - public static final double PRIM_KILL_PERCENT = .2; - public static final double PERCENT_ADJUSTER = .0; - public static final double PLAYER_RATIO_ADJUST = .1; - public static final float COMBAT_XP_EXCHANGE = .10f; - - public static final float MAX_NPC_DAMAGE_PERCENT = 0.65f; - public static final float PERCENT_DAMAGE_BAR_BASE = 0.00f; - - public static final float GROUP_XP_BONUS = 0.35f; - public static final float GROUP_XP_DIVIDER = 0.6f; - public static final int MAX_GROUP_BONUS_COUNT = 8; - - public static final float TRADER_XP_MOD = 7.6f; - public static final float ENTERTAINER_XP_MOD = 3.4f; - - public static final String VAR_COMBAT_RESULTS = "combatResults"; - public static final String VAR_TOP_DAMAGE = VAR_COMBAT_RESULTS + ".top_damage"; - public static final String VAR_TOP_GROUP = VAR_COMBAT_RESULTS + ".top_group"; - - public static final String VAR_TOP_DAMAGERS = VAR_COMBAT_RESULTS + ".top_damagers"; - public static final String VAR_LANDED_DEATHBLOW = VAR_COMBAT_RESULTS + ".landed_deathblow"; - - public static final String HANDLER_XP_DELEGATED = "xpDelegated"; - - public static final String TBL_SKILL = "datatables/skill/skills.iff"; - public static final String TBL_SPECIES_XP = "datatables/xp/species.iff"; - public static final String TBL_PLAYER_LEVEL_XP = "datatables/player/player_level.iff"; - - public static final String CREATURES_TABLE = "datatables/mob/creatures.iff"; - - public static final string_id SID_INSPIRE_BONUS = new string_id("performance", "perform_inspire_xp_bonus"); - - public static final string_id SID_FLYTEXT_XP = new string_id("base_player", "prose_flytext_xp"); - public static final string_id SID_FLYTEXT_XP_GROUP = new string_id("base_player", "prose_flytext_xp_group"); - - public static final int TRIAL_LEVEL_CAP = 25; - public static final string_id SID_FREE_TRIAL_LEVEL_CAP = new string_id("base_player", "free_trial_level_cap"); - - - public static int grant(obj_id target, String xp_type, int amt) throws InterruptedException - { - return grant(target, xp_type, amt, true, null, null, null); - } - - - public static int grant(obj_id target, String xp_type, int amt, String callback) throws InterruptedException - { - return grant(target, xp_type, amt, true, callback, new dictionary(), getSelf()); - } - - - public static int grant(obj_id target, String xp_type, int amt, String callback, dictionary callbackData) throws InterruptedException - { - return grant(target, xp_type, amt, true, callback, callbackData, getSelf()); - } - - - public static int grant(obj_id target, String xp_type, int amt, String callback, dictionary callbackData, obj_id callbackId) throws InterruptedException - { - return grant(target, xp_type, amt, true, callback, callbackData, callbackId); - } - - - public static int grant(obj_id target, String xp_type, int amt, boolean verbose) throws InterruptedException - { - return grant(target, xp_type, amt, verbose, null, null, null); - } - - - public static int grant(obj_id target, String xp_type, int amt, boolean verbose, String callback, dictionary callbackData) throws InterruptedException - { - return grant(target, xp_type, amt, verbose, callback, callbackData, getSelf()); - } - - - public static int grant(obj_id target, String xp_type, int amt, boolean verbose, String callback, dictionary callbackData, obj_id callbackId) throws InterruptedException - { - - if (!isIdValid(target) || (xp_type == null) || (xp_type.equals(""))) - { - return 0; - } - - if (xp_type.indexOf(" ") > -1) - { - return 0; - } - - amt = applySpeciesXpModifier(target, xp_type, amt); - - amt = applyInspirationBuffXpModifier(target, xp_type, amt); - - if (amt == 0) - { - return 0; - } - - if (grantUnmodifiedExperience(target, xp_type, amt, verbose, callback, callbackData, callbackId)) - { - return amt; - } - else - { - return 0; - } - } - - - public static boolean grantUnmodifiedExperience(obj_id target, String xp_type, int amt) throws InterruptedException - { - return grantUnmodifiedExperience(target, xp_type, amt, true, null, null, null); - } - - - public static boolean grantUnmodifiedExperience(obj_id target, String xp_type, int amt, boolean verbose) throws InterruptedException - { - return grantUnmodifiedExperience(target, xp_type, amt, verbose, null, null, null); - } - - - public static boolean grantUnmodifiedExperience(obj_id target, String xp_type, int amt, String callback) throws InterruptedException - { - return grantUnmodifiedExperience(target, xp_type, amt, true, callback, new dictionary(), getSelf()); - } - - - public static boolean grantUnmodifiedExperience(obj_id target, String xp_type, int amt, String callback, dictionary callbackData) throws InterruptedException - { - return grantUnmodifiedExperience(target, xp_type, amt, true, callback, callbackData, getSelf()); - } - - - public static boolean grantUnmodifiedExperience(obj_id target, String xp_type, int amt, String callback, dictionary callbackData, obj_id callbackId) throws InterruptedException - { - return grantUnmodifiedExperience(target, xp_type, amt, true, callback, callbackData, callbackId); - } - - - public static boolean grantUnmodifiedExperience(obj_id target, String xp_type, int amt, boolean verbose, String callback, dictionary callbackData, obj_id callbackId) throws InterruptedException - { - - if (!isIdValid(target) || (xp_type == null) || (xp_type.equals(""))) - { - return false; - } - - if (xp_type.indexOf(" ") > -1) - { - return false; - } - - dictionary params = new dictionary(); - - params.put("xp_type", xp_type); - params.put("amt", amt); - - if (callback != null && callback.length() > 0) - { - params.put("fromId", callbackId); - params.put("fromCallback", callback); - if (callbackData == null) - { - callbackData = new dictionary(); - } - params.put("fromCallbackData", callbackData); - } - - messageTo(target, "grantUnmodifiedExperienceOnSelf", params, 0.1f, !target.isAuthoritative()); - - if (verbose) - { - displayXpMsg(target, xp_type, amt); - } - - int currentXp = getExperiencePoints(target, xp_type); - int xpCap = getExperienceCap(target, xp_type); - - return currentXp < xpCap; - } - - - public static boolean _grantUnmodifiedExperience(obj_id target, String xp_type, int amt, String callback, dictionary callbackData, obj_id callbackId) throws InterruptedException - { - - int delta = 0; - int prior = getExperiencePoints(target, xp_type); - - boolean result = false; - - if (grantExperiencePoints(target, xp_type, amt) != XP_ERROR) - { - result = true; - - int current = getExperiencePoints(target, xp_type); - - delta = current - prior; - - if (skill_template.isQualifiedForWorkingSkill(target)) - { - skill_template.earnWorkingSkill(target); - } - - metrics.doXpRateMetrics(target, xp_type, amt); - } - - if (isIdValid(callbackId)) - { - dictionary returnParams = new dictionary(); - - returnParams.put(GRANT_XP_RESULT_VALUE, delta); - if (callbackData != null) - { - returnParams.put(GRANT_XP_RETURN_DATA, callbackData); - } - messageTo(callbackId, callback, returnParams, 0.1f, !callbackId.isAuthoritative()); - } - - return result; - } - - - public static boolean grantCraftingXpChance(obj_id item, obj_id user, int chance) throws InterruptedException - { - - if (!isIdValid(item)) - { - return false; - } - - removeObjVar(item, "crafting.creator.xp"); - removeObjVar(item, "crafting.creator.pxp"); - - return true; - } - - - public static int applySpeciesXpModifier(obj_id target, String xp_type, int amt) throws InterruptedException - { - - xp_type = toLower(xp_type); - int mod_xp = (int) (amt * getSpeciesXpModifier(target, xp_type)); - - if (utils.hasScriptVar(target, "buff.dish_ormachek.value")) - { - float xp_mod = utils.getFloatScriptVar(target, "buff.dish_ormachek.value"); - float f_mod = 1f + (xp_mod / 100f); - - int dur = 20; - - if (utils.hasScriptVar(target, "buff.dish_ormachek.duration")) - { - dur = (int) utils.getFloatScriptVar(target, "buff.dish_ormachek.duration"); - } - - dur--; - if (dur <= 0) - { - buff.removeBuff(target, "dish_ormachek"); - } - else - { - utils.setScriptVar(target, "buff.dish_ormachek.duration", dur); - } - - mod_xp = (int) (mod_xp * f_mod); - } - - return mod_xp; - } - - - public static int applyGroupXpModifier(obj_id target, int amt) throws InterruptedException - { - - float mod = 1f; - int modAmt = amt; - - if (amt > 0) - { - obj_id gid = getGroupObject(target); - int activeGroupSize = getActiveGroupSize(gid); - - if (activeGroupSize <= 2) - { - return modAmt; - } - - mod = getGroupXpModifier(target, activeGroupSize); - modAmt = Math.round(amt * mod); - - modAmt = (int) (modAmt / (1 + ((activeGroupSize - 1) * GROUP_XP_DIVIDER))); - - } - - utils.setScriptVar(target, "combat.xp.groupBonus", mod); - - return modAmt; - } - - - public static int applyInspirationBuffXpModifier(obj_id target, String xp_type, int amt) throws InterruptedException - { - - if (amt > 0) - { - float mod = getInspirationBuffXpModifier(target, xp_type); - float modAmt = (float) amt * mod; - - return Math.round(modAmt); - } - else - { - return amt; - } - } - - - public static float getGroupXpModifier(obj_id target, int activeGroupSize) throws InterruptedException - { - - float bonusMod = 1f; - - float groupXPBonus = GROUP_XP_BONUS; - - if (activeGroupSize > 1) - { - bonusMod += groupXPBonus * activeGroupSize; - } - - return bonusMod; - } - - - public static float getSpeciesXpModifier(obj_id target, String xp_type) throws InterruptedException - { - - if (!isIdValid(target) || xp_type == null || xp_type.equals("")) - { - return 1f; - } - - int species = getSpecies(target); - - String[] xpMods = dataTableGetStringColumn(TBL_SPECIES_XP, species); - - if (xpMods != null && xpMods.length > 0) - { - for (int i = 0; i < xpMods.length; i++) - { - testAbortScript(); - if (xpMods[i].startsWith(xp_type)) - { - String[]s = split(xpMods[i], ':'); - - if ((s != null) && (s.length == 2)) - { - int val = utils.stringToInt(s[1]); - - if (val != -1) - { - return (100f + val) / 100f; - } - } - } - } - } - - return 1f; - } - - - public static float getInspirationBuffXpModifier(obj_id target, String xp_type) throws InterruptedException - { - - float mod = 1f; - - if (utils.hasScriptVar(target, "buff.xpBonus.types")) - { - String[] xpList = utils.getStringArrayScriptVar(target, "buff.xpBonus.types"); - - if (xpList != null && xpList.length > 0) - { - for (int i = 0; i < xpList.length; i++) - { - testAbortScript(); - if (xpList[i].equals(xp_type)) - { - mod += utils.getFloatScriptVar(target, "buff.xpBonus.value"); - } - } - } - } - - if (utils.hasScriptVar(target, "buff.xpBonusGeneral.types")) - { - String[] xpList = utils.getStringArrayScriptVar(target, "buff.xpBonusGeneral.types"); - - if (xpList != null && xpList.length > 0) - { - for (int i = 0; i < xpList.length; i++) - { - testAbortScript(); - if (xpList[i].equals(xp_type)) - { - mod += utils.getFloatScriptVar(target, "buff.xpBonusGeneral.value"); - } - } - } - } - - return mod; - } - - - public static void grantSquadLeaderXp(obj_id player, int amt) throws InterruptedException - { - if (!isIdValid(player) || !player.isLoaded() || amt < 1 || !hasSkill(player, "class_officer_phase1_novice")) - { - return; - } - - dictionary resultData = new dictionary(); - - resultData.put("player", player); - resultData.put("amt", amt); - grant(player, SQUADLEADER, amt, false, "grantSquadLeaderXpResult", resultData, player); - - return; - } - - - public static void grantSquadLeaderXpResult(obj_id player, int granted, int amt) throws InterruptedException - { - if (granted > 0) - { - int slxp = utils.getIntScriptVar(player, VAR_SQUADLEADER_XP); - - slxp += granted; - utils.setScriptVar(player, VAR_SQUADLEADER_XP, slxp); - - if (granted < amt) - { - utils.setScriptVar(player, VAR_SQUADLEADER_AT_CAP, true); - } - - notifySquadLeaderXp(player); - } - } - - - public static void notifySquadLeaderXp(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !player.isLoaded()) - { - return; - } - - string_id sid_xp = new string_id(STF_XP_N, SQUADLEADER); - - int slxp = utils.getIntScriptVar(player, VAR_SQUADLEADER_XP); - - if (slxp > 0) - { - prose_package pp = getXpProsePackage(SQUADLEADER, slxp); - - if (pp != null) - { - sendSystemMessageProse(player, pp); - } - } - - if (utils.hasScriptVar(player, VAR_SQUADLEADER_AT_CAP)) - { - prose_package ppAtCap = prose.getPackage(new string_id("base_player", "prose_hit_xp_cap"), sid_xp); - - sendSystemMessageProse(player, ppAtCap); - } - - utils.removeScriptVarTree(player, VAR_SQUADLEADER_BASE); - } - - - public static int getRawCombatXP(obj_id player, obj_id npc) throws InterruptedException - { - - if (isMob(npc) && (isPlayer(npc) || isIdValid(getMaster(npc)))) - { - return 0; - } - - float baseCombatXP = getLevelBasedXP(player, npc); - - return Math.round(baseCombatXP); - } - - - public static int getActiveGroupSize(obj_id gid) throws InterruptedException - { - if (!group.isGroupObject(gid)) - { - return 1; - } - - obj_id[] members = getGroupMemberIds(gid); - - if (members == null || members.length == 0) - { - return 1; - } - - int count = 0; - - for (int i = 0; i < members.length; i++) - { - testAbortScript(); - if (members[i].isLoaded() && isPlayer(members[i])) - { - count++; - } - - if (count >= MAX_GROUP_BONUS_COUNT) - { - break; - } - } - - return count; - } - - - public static int getLevelBasedXP(obj_id player, obj_id npc) throws InterruptedException - { - int level = getLevel(player); - int levelDiff = combat.getAiLevelDiff(npc, player); - - if (levelDiff > 0) - { - level += levelDiff; - } - - int xp = getLevelBasedXP(level); - - if (!isMob(npc)) - { - xp = getIntObjVar(npc, "combat.intCombatXP"); - } - - float bonus = 0f; - - if (aiIsKiller(npc) || aiIsAggressive(npc) || aiIsAssist(npc)) - { - bonus += 0.05f; - } - - xp += (int) (xp * bonus); - - if (levelDiff < 0) - { - - float maxLevelDiff = 10f; - - if (level > 20) - { - maxLevelDiff += (int) ((level - 20) / 6); - } - - xp += (int) (xp * (levelDiff / maxLevelDiff)); - - if (xp < 1) - { - xp = 1; - } - } - - return xp; - } - - - public static int getLevelBasedXP(int level) throws InterruptedException - { - if (level < 1) - { - level = 1; - } - - return dataTableGetInt("datatables/mob/stat_balance.iff", level - 1, "XP"); - } - - - public static String getWeaponXpType(int weapon_type) throws InterruptedException - { - String xp_type = "unknown_xp"; - - switch (weapon_type) - { - case WEAPON_TYPE_RIFLE: - xp_type = COMBAT_RANGEDSPECIALIZE_RIFLE; - break; - case WEAPON_TYPE_LIGHT_RIFLE: - xp_type = COMBAT_RANGEDSPECIALIZE_CARBINE; - break; - case WEAPON_TYPE_PISTOL: - xp_type = COMBAT_RANGEDSPECIALIZE_PISTOL; - break; - case WEAPON_TYPE_HEAVY: - case WEAPON_TYPE_GROUND_TARGETTING: - case WEAPON_TYPE_DIRECTIONAL: - xp_type = COMBAT_RANGEDSPECIALIZE_RIFLE; - break; - case WEAPON_TYPE_1HAND_MELEE: - xp_type = COMBAT_MELEESPECIALIZE_ONEHAND; - break; - case WEAPON_TYPE_2HAND_MELEE: - xp_type = COMBAT_MELEESPECIALIZE_TWOHAND; - break; - case WEAPON_TYPE_UNARMED: - xp_type = COMBAT_MELEESPECIALIZE_UNARMED; - break; - case WEAPON_TYPE_POLEARM: - xp_type = COMBAT_MELEESPECIALIZE_POLEARM; - break; - case WEAPON_TYPE_THROWN: - xp_type = COMBAT_GRENADE; - break; - case WEAPON_TYPE_WT_1HAND_LIGHTSABER: - xp_type = COMBAT_MELEESPECIALIZE_ONEHAND; - break; - case WEAPON_TYPE_WT_2HAND_LIGHTSABER: - xp_type = COMBAT_MELEESPECIALIZE_TWOHAND; - break; - case WEAPON_TYPE_WT_POLEARM_LIGHTSABER: - xp_type = COMBAT_MELEESPECIALIZE_POLEARM; - break; - case combat.WEAPON_TYPE_FORCE_POWER: - xp_type = COMBAT_MELEESPECIALIZE_UNARMED; - break; - default: - xp_type = UNKNOWN; - break; - } - - return xp_type; - } - - - public static String getWeaponStringFromXPType(String strXPType) throws InterruptedException - { - if (strXPType.equals(COMBAT_RANGEDSPECIALIZE_RIFLE)) - { - return "rifle"; - } - else if (strXPType.equals(COMBAT_RANGEDSPECIALIZE_CARBINE)) - { - return "carbine"; - } - - else if (strXPType.equals(COMBAT_RANGEDSPECIALIZE_PISTOL)) - { - return "pistol"; - } - - else if (strXPType.equals(COMBAT_RANGEDSPECIALIZE_HEAVY)) - { - return "heavy"; - } - - else if (strXPType.equals(COMBAT_MELEESPECIALIZE_ONEHAND)) - { - return "onehandmelee"; - } - - else if (strXPType.equals(COMBAT_MELEESPECIALIZE_TWOHAND)) - { - return "twohandmelee"; - } - - else if (strXPType.equals(COMBAT_MELEESPECIALIZE_UNARMED)) - { - return "unarmed"; - } - else if (strXPType.equals(COMBAT_MELEESPECIALIZE_POLEARM)) - { - return "polearm"; - } - else if (strXPType.equals(COMBAT_JEDI_ONEHANDLIGHTSABER)) - { - return "onehandmelee"; - } - else if (strXPType.equals(COMBAT_JEDI_TWOHANDLIGHTSABER)) - { - return "twohandmelee"; - } - - else if (strXPType.equals(COMBAT_JEDI_POLEARMLIGHTSABER)) - { - return "polearm"; - } - return ""; - } - - - public static boolean setupCreditForKills() throws InterruptedException - { - return true; - } - - - public static boolean cleanupCreditForKills() throws InterruptedException - { - obj_id self = getSelf(); - - utils.removeScriptVarTree(self, VAR_CREDIT_FOR_KILLS); - return true; - } - - - public static void updateCombatXpList(obj_id target, obj_id attacker, obj_id wpn, int dam) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(attacker) || !isIdValid(wpn)) - { - return; - } - - int weapon_type = getWeaponType(wpn); - - String strTemplateName = getTemplateName(wpn); - - if (strTemplateName == null || strTemplateName.equals("")) - { - LOG("DESIGNER_FATAL", "xp.updateCombatXpList: unable to getTemplateName(wpn) -> "+ wpn + ":"+ getName(wpn)); - return; - } - else - { - if (hasObjVar(wpn, WEAPON_TYPE)) - { - weapon_type = getIntObjVar(wpn, WEAPON_TYPE); - } - } - - String xp_type = getWeaponXpType(weapon_type); - - if (xp_type == null || xp_type.equals("")) - { - LOG("DESIGNER_FATAL", "xp.updateCombatXpList: unable to getWeaponXpType(wpn) -> "+ wpn + ":"+ getName(wpn)); - return; - } - - updateCombatXpList(target, attacker, xp_type, dam); - } - - - public static void updateCombatXpList(obj_id target, obj_id attacker, String xp_type, int dam) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(attacker) || xp_type == null || xp_type.equals("")) - { - return; - } - - if (!utils.hasScriptVar(target, VAR_COMBAT_TIMESTAMP)) - { - utils.setScriptVar(target, VAR_COMBAT_TIMESTAMP, getGameTime()); - } - - int tally = utils.getIntScriptVar(target, VAR_DAMAGE_TALLY); - int newTally = dam + tally; - - utils.setScriptVar(target, VAR_DAMAGE_TALLY, newTally); - - int hitCount = utils.getIntScriptVar(target, VAR_DAMAGE_COUNT); - - hitCount++; - utils.setScriptVar(target, VAR_DAMAGE_COUNT, hitCount); - - if (!isPlayer(attacker) && !pet_lib.isPet(attacker) && !beast_lib.isBeast(attacker) && ai_lib.getDifficultyClass(target) != ai_lib.DIFFICULTY_BOSS) - { - int npcDamage = utils.getIntScriptVar(target, VAR_NPC_DAMAGE); - - npcDamage += dam; - utils.setScriptVar(target, VAR_NPC_DAMAGE, npcDamage); - return; - } - - if (dam > 0) - { - Vector attackerList = utils.getResizeableObjIdBatchScriptVar(target, VAR_ATTACKER_LIST + ".attackers"); - - if (attackerList != null && attackerList.size() > 0) - { - if (utils.getElementPositionInArray(attackerList, attacker) == -1) - { - attackerList = utils.addElement(attackerList, attacker); - utils.setBatchScriptVar(target, VAR_ATTACKER_LIST + ".attackers", attackerList); - } - } - else - { - attackerList = utils.addElement(attackerList, attacker); - utils.setBatchScriptVar(target, VAR_ATTACKER_LIST + ".attackers", attackerList); - } - - String basePath = VAR_ATTACKER_LIST + "."+ attacker; - String damPath = basePath + ".damage"; - - int totalDamage = dam + utils.getIntScriptVar(target, damPath); - - utils.setScriptVar(target, damPath, totalDamage); - - String xpListBasePath = basePath + ".xp"; - String xpListPath = xpListBasePath + ".types"; - Vector xpTypes = utils.getResizeableStringBatchScriptVar(target, xpListPath); - - if (xpTypes != null && xpTypes.size() > 0) - { - if (utils.getElementPositionInArray(xpTypes, xp_type) == -1) - { - xpTypes = utils.addElement(xpTypes, xp_type); - utils.setBatchScriptVar(target, xpListPath, xpTypes); - } - } - else - { - xpTypes = utils.addElement(xpTypes, xp_type); - utils.setBatchScriptVar(target, xpListPath, xpTypes); - } - - String xpTypePath = xpListBasePath + "."+ xp_type; - int xpTally = dam + utils.getIntScriptVar(target, xpTypePath); - - utils.setScriptVar(target, xpTypePath, xpTally); - - } - } - - - public static void removeXpListCombatant(obj_id target, obj_id combatant) throws InterruptedException - { - if (!isIdValid(target) || !isIdValid(combatant)) - { - return; - } - - Vector attackerList = utils.getResizeableObjIdBatchScriptVar(target, VAR_ATTACKER_LIST + ".attackers"); - - if (attackerList == null || attackerList.size() == 0) - { - return; - } - - int idx = utils.getElementPositionInArray(attackerList, combatant); - - if (idx == -1) - { - return; - } - - attackerList = utils.removeElementAt(attackerList, idx); - - if (attackerList == null || attackerList.size() == 0) - { - return; - } - - utils.setBatchScriptVar(target, VAR_ATTACKER_LIST + ".attackers", attackerList); - utils.removeScriptVarTree(target, VAR_ATTACKER_LIST + "."+ combatant); - } - - - public static void assessCombatResults(obj_id target) throws InterruptedException - { - if (!isIdValid(target)) - { - return; - } - - if (!utils.hasScriptVar(target, VAR_ATTACKER_LIST + ".attackers")) - { - return; - } - - if (utils.hasScriptVar(target, "storytellerid") || utils.hasObjVar(target, "storytellerid")) - { - return; - } - - int npcDamage = utils.getIntScriptVar(target, VAR_NPC_DAMAGE); - int tally = utils.getIntScriptVar(target, VAR_DAMAGE_TALLY); - float npcDamagePercent = npcDamage / (float)tally; - - if (npcDamagePercent > MAX_NPC_DAMAGE_PERCENT) - { - return; - } - - obj_id[] attackerList = utils.getObjIdBatchScriptVar(target, VAR_ATTACKER_LIST + ".attackers"); - - if (attackerList == null || attackerList.length == 0) - { - return; - } - - attackerList = utils.validateObjIdArray(attackerList); - - obj_var[] damArray = new obj_var[attackerList.length]; - - for (int i = 0; i < attackerList.length; i++) - { - testAbortScript(); - damArray[i] = new obj_var(attackerList[i].toString(), utils.getIntScriptVar(target, VAR_ATTACKER_LIST + "." + attackerList[i] + ".damage")); - } - - if (damArray == null || damArray.length == 0) - { - return; - } - - obj_var[] killers = list.quickSort(0, attackerList.length - 1, damArray); - - if ((killers == null) || (killers.length == 0)) - { - return; - } - - obj_id[] topDamagers = getTopIndividualAttacker(killers); - - if (topDamagers != null && topDamagers.length > 0) - { - setObjVar(target, VAR_TOP_DAMAGERS, topDamagers); - } - - dictionary groupDamage = new dictionary(); - int topDamage = Integer.MIN_VALUE; - int gDam = 0; - - for (int i = 0; i < killers.length; i++) - { - testAbortScript(); - obj_var attackerDamageVar = killers[i]; - obj_id attacker = utils.stringToObjId(attackerDamageVar.getName()); - - if (isIdValid(attacker)) - { - int attackerDamage = attackerDamageVar.getIntData(); - - gDam = updateGroupDamageDictionary(groupDamage, attacker, attackerDamage, target); - - if (gDam > topDamage) - { - topDamage = gDam; - } - } - } - - Vector primaryKillers = new Vector(); - primaryKillers.setSize(0); - - java.util.Enumeration keys = groupDamage.keys(); - - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)(keys.nextElement()); - int val = groupDamage.getInt(key); - - if (val >= topDamage) - { - obj_id tmpId = utils.stringToObjId(key); - - if (isIdValid(tmpId)) - { - primaryKillers = utils.addElement(primaryKillers, tmpId); - - if (!group.isGroupObject(tmpId)) - { - incrementKillMeter(tmpId, 1); - } - } - } - } - - if ((primaryKillers == null) || (primaryKillers.size() == 0)) - { - return; - } - - int winnerIdx = rand(0, primaryKillers.size() - 1); - obj_id winner = ((obj_id)(primaryKillers.get(winnerIdx))); - - if (!group.isGroupObject(winner) && !isPlayer(winner) && isMob(winner)) - { - obj_id winnerMaster = getMaster(winner); - - if (!isIdNull(winnerMaster) && isIdValid(winnerMaster)) - { - winner = winnerMaster; - } - } - - if (group.isGroupObject(winner)) - { - for (int i = 0; i < killers.length; i++) - { - testAbortScript(); - obj_var attackerDamageVar = killers[i]; - obj_id attacker = utils.stringToObjId(attackerDamageVar.getName()); - - if (isIdValid(attacker)) - { - if (getGroupObject(attacker) == winner) - { - incrementKillMeter(attacker, 1); - } - } - } - } - - setObjVar(target, VAR_TOP_DAMAGE, topDamage); - setObjVar(target, VAR_TOP_GROUP, winner); - - grantQuestKillCredit(winner, target); - - if (!hasObjVar(target, "combat.zeroXP")) - { - obj_id[] killerList = new obj_id[0]; - if (primaryKillers != null) - { - killerList = new obj_id[primaryKillers.size()]; - primaryKillers.toArray(killerList); - } - - killers = grantCombatXp(target, killers); - - obj_id[] playerList = getPlayersFromKillerList(killerList); - pet_lib.addToHarvestDroidArray(target, playerList); - - if (killers == null || killers.length == 0) - { - setObjVar(target, VAR_TOP_DAMAGE, 0); - setObjVar(target, VAR_TOP_GROUP, obj_id.NULL_ID); - - obj_id[] placeHolder = new obj_id[1]; - placeHolder[0] = obj_id.NULL_ID; - setObjVar(target, scenario.VAR_PRIMARY_KILLERS, placeHolder); - return; - } - } - - setObjVar(target, scenario.VAR_PRIMARY_KILLERS, primaryKillers, resizeableArrayTypeobj_id); - } - - - public static obj_id[] getPlayersFromKillerList(obj_id[] killerList) throws InterruptedException - { - Vector players = new Vector(); - players.setSize(0); - - for (int i = 0; i < killerList.length; i++) - { - testAbortScript(); - if (group.isGroupObject(killerList[i])) - { - obj_id[]groupMembers = utils.getGroupMemberIds(killerList[i]); - - for (int k = 0; k < groupMembers.length; k++) - { - testAbortScript(); - if (isIdValid(groupMembers[k]) && exists(groupMembers[k])) - { - if (pet_lib.isPet(groupMembers[k])) - { - utils.addElement(players, getMaster(groupMembers[k])); - } - else - { - utils.addElement(players, groupMembers[k]); - } - } - } - } - else - { - if (pet_lib.isPet(killerList[i])) - { - utils.addElement(players, getMaster(killerList[i])); - } - else - { - utils.addElement(players, killerList[i]); - } - } - } - - if (players != null) - { - killerList = new obj_id[players.size()]; - players.toArray(killerList); - } - - return killerList; - } - - - public static void grantQuestKillCredit(obj_id winner, obj_id target) throws InterruptedException - { - obj_id[] killList; - - if (group.isGroupObject(winner)) - { - killList = getGroupMemberIds(winner); - } - else - { - killList = new obj_id[1]; - killList[0] = winner; - } - - if (killList.length < 1) - { - return; - } - - dictionary params = new dictionary(); - String creatureName = getCreatureName(target); - - if (creatureName == null || creatureName.equals("")) - { - return; - } - - params.put("creatureName", creatureName); - params.put("location", getLocation(target)); - params.put("socialGroup", ai_lib.getSocialGroup(target)); - - params.put("col_faction", dataTableGetString(CREATURES_TABLE, creatureName, "col_faction")); - params.put("difficultyClass", dataTableGetInt(CREATURES_TABLE, creatureName, "difficultyClass")); - - params.put("target", target); - - if (hasObjVar(target, "quest_spawner.spawned_by")) - { - params.put("spawnedBy", getObjIdObjVar(target, "quest_spawner.spawned_by")); - } - - for (int i = 0; i < killList.length; i++) - { - testAbortScript(); - if (!hasObjVar(target, "soloCollection")) - { - - if (!exists(killList[i]) || !isIdValid(killList[i])) - { - continue; - } - - float distance = getDistance(target, killList[i]); - - if (distance < 128.0f && distance >= 0.0f) - { - - messageTo(killList[i], "receiveCreditForKill", params, 0.0f, false); - } - } - - else - { - obj_id collectionOwner = getObjIdObjVar(target, "soloCollection"); - - if (!exists(collectionOwner) || !isIdValid(collectionOwner)) - { - continue; - } - - float distance = getDistance(target, collectionOwner); - - if (distance < 128.0f && distance >= 0.0f) - { - - messageTo(collectionOwner, "receiveCreditForKill", params, 0.0f, false); - } - } - } - } - - - public static int updateGroupDamageDictionary(dictionary groupDamage, obj_id attacker, int attackerDamage, obj_id target) throws InterruptedException - { - if (!isIdValid(attacker) || !isIdValid(target) || attackerDamage < 1) - { - return attackerDamage; - } - - if (beast_lib.isBeast(attacker)) - { - obj_id master = getMaster(attacker); - - if (isIdValid(master) && exists(master)) - { - attacker = master; - } - } - - obj_id attackerGroupId = getGroupObject(attacker); - - if (!isIdValid(attackerGroupId)) - { - int currentPersonalDamage = groupDamage.getInt(attacker.toString()); - int totalPersonalDamage = currentPersonalDamage + attackerDamage; - - groupDamage.put(attacker.toString(), totalPersonalDamage); - - return totalPersonalDamage; - } - else - { - int currentGroupDamage = groupDamage.getInt(attackerGroupId.toString()); - int totalGroupDamage = currentGroupDamage + attackerDamage; - - groupDamage.put(attackerGroupId.toString(), totalGroupDamage); - - return totalGroupDamage; - } - } - - - public static obj_var[] grantCombatXp(obj_id target, obj_var[] killers) throws InterruptedException - { - - if (!isIdValid(target) || killers == null || killers.length == 0) - { - return null; - } - - Vector ret = new Vector(); - ret.setSize(0); - - double damageTally = (double)getIntObjVar(target, VAR_TOP_DAMAGE); - - if (damageTally < 0) - { - debugServerConsoleMsg(target, "xp::grantCombatXp: damageTally("+ damageTally + ") < 0!! WTF happened in combat?"); - return null; - } - - obj_id killCredit = getObjIdObjVar(target, VAR_TOP_GROUP); - - obj_id[] killList; - - if (group.isGroupObject(killCredit)) - { - killList = getGroupMemberIds(killCredit); - } - else - { - killList = new obj_id[1]; - killList[0] = killCredit; - } - - metrics.doKillMetrics(killCredit, target); - - String faction = factions.getFaction(target); - int levelAmount = getLevel(target) * 10; - - obj_id[] allKillers = new obj_id[killers.length]; - - for (int i = 0; i < killers.length; i++) - { - testAbortScript(); - allKillers[i] = utils.stringToObjId(killers[i].getName()); - } - - for (int i = 0; i < killers.length; i++) - { - testAbortScript(); - obj_var killerVar = killers[i]; - - obj_id killer = allKillers[i]; - - obj_id master = obj_id.NULL_ID; - - if (beast_lib.isBeast(killer) && !ai_lib.aiIsDead(killer)) - { - master = getMaster(killer); - - if (!master.isLoaded() || master.isBeingDestroyed()) - { - master = null; - } - } - - if (!utils.isObjIdInArray(killList, killer)) - { - if (isIdValid(master)) - { - if (!utils.isObjIdInArray(killList, master)) - { - continue; - } - } - } - - obj_id gcw_gain_object = null; - - if (isIdValid(master)) - { - if (!utils.isObjIdInArray(allKillers, master)) - { - gcw_gain_object = master; - } - - } - else - { - gcw_gain_object = killer; - } - - if (isIdValid(gcw_gain_object) && !hasObjVar(target, gcw.GCW_POINT_OVERRIDE)) - { - gcw.grantModifiedGcwPoints(target, gcw_gain_object, false, gcw.GCW_POINT_TYPE_GROUND_PVE, getName(target)); - } - int dam = killerVar.getIntData(); - - checkAndUpdateHuntingMissions(killer, target); - - if (isIdValid(killer) && killer.isLoaded() && !killer.isBeingDestroyed() && killer != target) - { - int xpTotal = getRawCombatXP(killer, target); - - xpTotal = applyGroupXpModifier(killer, xpTotal); - - if (isPlayer(killer) && beast_lib.isBeastMaster(killer)) - { - obj_id beast = beast_lib.getBeastOnPlayer(killer); - - if (beast_lib.isValidBeast(beast) && getDistance(killer, beast) < MAX_DISTANCE && xpTotal > 1) - { - if (utils.isObjIdInArray(killList, killer) || utils.isObjIdInArray(killList, beast)) - { - beast_lib.grantBeastExperience(beast); - - dictionary params = new dictionary(); - - params.put("targetId", target); - obj_id beastBCD = beast_lib.getBeastBCD(beast); - - messageTo(beastBCD, "beastKilledSomething", params, 1, false); - } - } - } - else - { - if (beast_lib.isBeast(killer) && beast_lib.isValidPlayer(master) && beast_lib.canBeastGetLevelBasedXP(killer, target)) - { - - if (utils.isObjIdInArray(allKillers, master)) - { - continue; - } - else - { - beast_lib.grantBeastExperience(killer); - - dictionary params = new dictionary(); - - params.put("targetId", target); - obj_id beastBCD = beast_lib.getBeastBCD(killer); - - messageTo(beastBCD, "beastKilledSomething", params, 1, false); - } - } - } - - if (!isPlayer(killer)) - { - if ((beast_lib.isBeast(killer) || pet_lib.isPet(killer)) && !ai_lib.aiIsDead(killer) && isIdValid(master)) - { - - xpTotal = getRawCombatXP(master, target); - - ret = utils.addElement(ret, killerVar); - - if (!utils.isObjIdInArray(allKillers, master) && utils.isObjIdInArray(allKillers, killer)) - { - grantCombatStyleXp(master, COMBAT_GENERAL, xpTotal); - - displayXpFlyText(master, master, xpTotal); - displayXpMsg(master, null, xpTotal); - - double percentDamage = ((double) dam / damageTally) + PERCENT_ADJUSTER; - factions.grantCombatFaction(master, target, percentDamage); - } - } - } - else if (utils.isObjIdInArray(killList, killer)) - { - - double percentDamage = ((double) dam / damageTally) + PERCENT_ADJUSTER; - - if (getDistance(killer, target) < MAX_DISTANCE) - { - grantCombatXpPerAttackType(killer, target, xpTotal); - - factions.grantCombatFaction(killer, target, percentDamage); - - if (faction != null) - { - factions.adjustSocialStanding(killer, faction, -levelAmount); - } - - ret = utils.addElement(ret, killerVar); - } - } - - utils.removeScriptVar(killer, "combat.xp.groupBonus"); - } - } - - if (ret == null || ret.size() == 0) - { - return null; - } - - return (obj_var[])ret.toArray(new obj_var[0]); - } - - - public static void grantCombatXpPerAttackType(obj_id player, obj_id target, int totalXp) throws InterruptedException - { - - if (!isIdValid(player) || (!isPlayer(player)) || !isIdValid(target) || totalXp < 1) - { - return; - } - - String basePath = VAR_ATTACKER_LIST + "."+ player; - String xpListBasePath = basePath + ".xp"; - String xpListPath = xpListBasePath + ".types"; - - if (!utils.hasScriptVar(target, xpListPath)) - { - return; - } - - String[]xpTypes = utils.getStringBatchScriptVar(target, xpListPath); - - if (xpTypes == null || xpTypes.length == 0) - { - return; - } - - if (hasScript(player, "theme_park.new_player.new_player") || hasObjVar(player, "handlePlayerCombatKill")) - { - dictionary webster = new dictionary(); - - webster.put("xpTypes", xpTypes); - webster.put("target", target); - - messageTo(player, "handlePlayerCombatKill", webster, 1, false); - } - - dictionary d = new dictionary(); - - String damPath = basePath + ".damage"; - int tally = utils.getIntScriptVar(target, damPath); - - tally -= utils.getIntScriptVar(target, xpListBasePath + "."+ PERMISSIONS_ONLY); - - if (tally < 1) - { - return; - } - - int raw = 0; - int bonusCombatXp = 0; - int jediXp = 0; - int generalXp = 0; - int totalXpGranted = 0; - - for (int i = 0; i < xpTypes.length; i++) - { - testAbortScript(); - int val = utils.getIntScriptVar(target, xpListBasePath + "."+ xpTypes[i]); - float xpPercent = ((float) (val) / (float) (tally)); - - int intNewTotal = totalXp; - - if (xpTypes[i].equals(RAW_COMBAT)) - { - intNewTotal = (int) (intNewTotal * xpPercent); - bonusCombatXp += intNewTotal; - } - else if (xpTypes[i].equals(PARTIAL_COMBAT)) - { - intNewTotal = (int) (intNewTotal * xpPercent); - intNewTotal = (int) (intNewTotal * COMBAT_GENERAL_EXCHANGE_RATE); - bonusCombatXp += intNewTotal; - } - else if (xpTypes[i].equals(COMBAT_GENERAL)) - { - int amt = (int) (intNewTotal * xpPercent); - - if (amt < 1) - { - amt = 1; - } - - generalXp += amt; - } - else if (isCombatXpType(xpTypes[i])) - { - int amt = (int) (intNewTotal * xpPercent); - - if (amt < 1) - { - amt = 1; - } - - if ((xpTypes[i].equals(COMBAT_JEDI_ONEHANDLIGHTSABER) || xpTypes[i].equals(COMBAT_JEDI_TWOHANDLIGHTSABER) || xpTypes[i].equals(COMBAT_JEDI_POLEARMLIGHTSABER) || xpTypes[i].equals(COMBAT_JEDI_FORCE_POWER) || xpTypes[i].equals(JEDI_GENERAL))) - { - if (isJedi(player)) - { - jediXp += amt; - } - } - else - { - raw += amt; - - if (!xpTypes[i].equals(COMBAT_THROWN)) - { - totalXpGranted += grantCombatStyleXp(player, xpTypes[i], amt); - } - } - } - else if (!xpTypes[i].equals(UNKNOWN) && !xpTypes[i].equals(PERMISSIONS_ONLY) && !xpTypes[i].equals(PET_DAMAGE)) - { - int amt = (int) (intNewTotal * xpPercent); - - if (amt < 1) - { - amt = 1; - } - - totalXpGranted += grantCombatStyleXp(player, xpTypes[i], amt); - } - } - - if (isJedi(player)) - { - jediXp *= JEDI_GENERAL_EXCHANGE_RATE; - totalXpGranted += grantCombatStyleXp(player, JEDI_GENERAL, jediXp); - LOG("jedi", "Granting "+ jediXp + " to "+ player + " type is "+ JEDI_GENERAL); - } - else - { - generalXp += (int) (raw * COMBAT_GENERAL_EXCHANGE_RATE); - - if (generalXp < 0) - { - generalXp = 0; - } - - if (bonusCombatXp > 0) - { - generalXp += bonusCombatXp; - } - - if (generalXp > 0) - { - totalXpGranted += grantCombatStyleXp(player, COMBAT_GENERAL, generalXp); - } - } - - displayXpFlyText(player, player, totalXpGranted); - displayXpMsg(player, null, totalXpGranted); - } - - - public static int grantSocialStyleXp(obj_id player, String xpType, int amount) throws InterruptedException - { - amount = Math.round(amount * ENTERTAINER_XP_MOD); - - String templateXp = skill_template.getTemplateSkillXpType(player, false); - - if (templateXp != null) - { - if (isSocialXpType(templateXp)) - { - amount = grant(player, templateXp, amount, false); - } - else - { - amount = 0; - } - } - else - { - amount = 0; - } - - return amount; - } - - - public static int grantCraftingQuestXp(obj_id player, int amount) throws InterruptedException - { - - String templateXp = skill_template.getTemplateSkillXpType(player, false); - - if (templateXp != null) - { - if (isCraftingXpType(templateXp)) - { - amount = grant(player, templateXp, amount, false); - } - else - { - - amount = 0; - } - } - else - { - amount = 0; - } - - return amount; - } - - - public static int grantCraftingStyleXp(obj_id player, String xpType, int amount) throws InterruptedException - { - - amount = Math.round(amount * TRADER_XP_MOD); - - int merchantXP = (int) (amount * CRAFTING_MERCHANT_EXCHANGE_RATE); - float xpRatio = skill_template.NON_TEMPLATE_XP_RATIO; - - if (xpType.equals(QUEST_CRAFTING)) - { - merchantXP = 0; - xpRatio = skill_template.QUEST_XP_RATIO; - } - - String templateXp = skill_template.getTemplateSkillXpType(player, false); - - if (templateXp != null) - { - if (isCraftingXpType(templateXp)) - { - if (!xpType.equals(templateXp)) - { - amount = (int) (amount * xpRatio); - } - - if (!templateXp.equals(MERCHANT)) - { - merchantXP = (int) (merchantXP * xpRatio); - } - - amount += merchantXP; - amount = grant(player, templateXp, amount, false); - } - else - { - - amount = 0; - } - } - else - { - amount = 0; - } - - return amount; - } - - - public static int grantCombatStyleXp(obj_id player, String xpType, int amount) throws InterruptedException - { - - float xpRatio = skill_template.NON_TEMPLATE_XP_RATIO; - - if (xpType.equals(QUEST_COMBAT)) - { - xpRatio = skill_template.QUEST_XP_RATIO; - } - - String templateXp = skill_template.getTemplateSkillXpType(player, false); - - if (templateXp != null) - { - if (isCombatXpType(templateXp)) - { - if (!xpType.equals(templateXp)) - { - amount = (int) (amount * xpRatio); - } - - amount = grant(player, templateXp, amount, false); - } - else - { - - amount = 0; - } - } - else - { - amount = 0; - } - - return amount; - } - - - public static void displayXpMsg(obj_id player, String xpType, int amt) throws InterruptedException - { - - if (xpType == null) - { - xpType = skill_template.getTemplateSkillXpType(player, true); - } - - if (xpType == null || xpType.equals("")) - { - return; - } - - if (xpType.equals(skill_template.NO_TEMPLATE_STARTING)) - { - return; - } - - int currentXp = getExperiencePoints(player, xpType); - int xpCap = getExperienceCap(player, xpType); - - if (currentXp < xpCap) - { - float grpMod = 1f; - - if (utils.hasScriptVar(player, "combat.xp.groupBonus")) - { - grpMod = utils.getFloatScriptVar(player, "combat.xp.groupBonus"); - } - float inspMod = getInspirationBuffXpModifier(player, xpType); - - prose_package pp = xp.getXpProsePackage(xpType, amt, grpMod, inspMod); - - if (pp != null) - { - - if (isSpaceScene()) - { - sendQuestSystemMessage(player, pp); - } - } - - if (currentXp + amt >= xpCap) - { - prose_package ppAtCap = prose.getPackage(new string_id("base_player", "prose_hit_xp_cap"), new string_id(STF_XP_N, xpType)); - - if (isSpaceScene()) - { - sendQuestSystemMessage(player, ppAtCap); - } - } - } - } - - - public static void displayXpFlyText(obj_id player, obj_id target, int amount) throws InterruptedException - { - if (isFreeTrialAccount(player)) - { - int playerLevel = getLevel(player); - - if (playerLevel >= TRIAL_LEVEL_CAP) - { - debugSpeakMsg(player, "I am a greater than or equal to level "+ xp.TRIAL_LEVEL_CAP); - prose_package pp = new prose_package(); - prose.setDI(pp, xp.TRIAL_LEVEL_CAP); - prose.setStringId(pp, SID_FREE_TRIAL_LEVEL_CAP); - sendSystemMessageProse(player, pp); - return; - } - } - - if (amount == 0) - { - return; - } - - if (npe.hasReachedMaxTutorialLevel(player)) - { - return; - } - - prose_package pp = null; - - pp = prose.getPackage(SID_FLYTEXT_XP, amount); - - float groupModPct = 1.0f; - - if (utils.hasScriptVar(player, "combat.xp.groupBonus")) - { - float groupBonus = utils.getFloatScriptVar(player, "combat.xp.groupBonus"); - - groupModPct = getGroupXpModifierPercentageOfMax(groupBonus); - } - - float flyScale = getCombatXpFlyScale(groupModPct); - color flyColor = getCombatXpFlyColor(groupModPct); - - showFlyTextPrivate(target, player, pp, flyScale, flyColor); - } - - - public static float getGroupXpModifierPercentageOfMax(float groupMod) throws InterruptedException - { - float groupModPct = 0; - - final float maxGroupMod = GROUP_XP_BONUS * MAX_GROUP_BONUS_COUNT; - - if (maxGroupMod > 0) - { - groupModPct = (groupMod - 1) / maxGroupMod; - } - if (groupModPct > 1) - { - groupModPct = 1; - } - - return groupModPct; - } - - - public static float getCombatXpFlyScale(float groupModPct) throws InterruptedException - { - final float minScale = 1.5f; - final float maxScale = 2.5f; - final float scaleRange = maxScale - minScale; - - float scale = minScale + (scaleRange * groupModPct); - - return scale; - } - - - public static color getCombatXpFlyColor(float groupModPct) throws InterruptedException - { - final color minColor = new color(140, 15, 210, 255); - final color maxColor = new color(180, 60, 240, 255); - final int redRange = maxColor.getR() - minColor.getR(); - final int greenRange = maxColor.getG() - minColor.getG(); - final int blueRange = maxColor.getB() - minColor.getB(); - - int red = minColor.getR() + (int) (redRange * groupModPct); - int green = minColor.getG() + (int) (greenRange * groupModPct); - int blue = minColor.getB() + (int) (blueRange * groupModPct); - - if (red > maxColor.getR()) - { - red = maxColor.getR(); - } - if (green > maxColor.getG()) - { - green = maxColor.getG(); - } - if (blue > maxColor.getB()) - { - blue = maxColor.getB(); - } - - return new color(red, green, blue, 255); - } - - - public static boolean isCombatXpType(String xpType) throws InterruptedException - { - if (xpType.equals(COMBAT_GENERAL)) - { - return true; - } - if (xpType.equals(COMBAT_RANGEDSPECIALIZE_RIFLE)) - { - return true; - } - if (xpType.equals(COMBAT_RANGEDSPECIALIZE_CARBINE)) - { - return true; - } - if (xpType.equals(COMBAT_RANGEDSPECIALIZE_PISTOL)) - { - return true; - } - if (xpType.equals(COMBAT_RANGEDSPECIALIZE_HEAVY)) - { - return true; - } - if (xpType.equals(COMBAT_MELEESPECIALIZE_ONEHAND)) - { - return true; - } - if (xpType.equals(COMBAT_MELEESPECIALIZE_TWOHAND)) - { - return true; - } - if (xpType.equals(COMBAT_MELEESPECIALIZE_UNARMED)) - { - return true; - } - if (xpType.equals(COMBAT_MELEESPECIALIZE_POLEARM)) - { - return true; - } - if (xpType.equals(COMBAT_THROWN)) - { - return true; - } - if (xpType.equals(COMBAT_GRENADE)) - { - return true; - } - if (xpType.equals(JEDI_GENERAL)) - { - return true; - } - if (xpType.equals(COMBAT_JEDI_ONEHANDLIGHTSABER)) - { - return true; - } - if (xpType.equals(COMBAT_JEDI_TWOHANDLIGHTSABER)) - { - return true; - } - if (xpType.equals(COMBAT_JEDI_POLEARMLIGHTSABER)) - { - return true; - } - if (xpType.equals(COMBAT_JEDI_FORCE_POWER)) - { - return true; - } - if (xpType.equals(MEDICAL)) - { - return true; - } - if (xpType.equals(COMBATMEDIC)) - { - return true; - } - if (xpType.equals(CREATUREHANDLER)) - { - return true; - } - if (xpType.equals(QUEST_COMBAT)) - { - return true; - } - if (xpType.equals(QUEST_GENERAL)) - { - return true; - } - return false; - } - - - public static boolean isSocialXpType(String xpType) throws InterruptedException - { - if (xpType.equals(MUSIC)) - { - return true; - } - if (xpType.equals(DANCE)) - { - return true; - } - if (xpType.equals(JUGGLING)) - { - return true; - } - if (xpType.equals(ENTERTAINER)) - { - return true; - } - if (xpType.equals(IMAGEDESIGNER)) - { - return true; - } - if (xpType.equals(QUEST_SOCIAL)) - { - return true; - } - if (xpType.equals(QUEST_COMBAT)) - { - return true; - } - if (xpType.equals(QUEST_GENERAL)) - { - return true; - } - return false; - } - - - public static boolean isCraftingXpType(String xpType) throws InterruptedException - { - if (xpType.equals(HARVEST_INORGANIC)) - { - return true; - } - if (xpType.equals(CRAFTING_GENERAL)) - { - return true; - } - if (xpType.equals(CRAFTING_FOOD_GENERAL)) - { - return true; - } - if (xpType.equals(CRAFTING_MEDICINE_GENERAL)) - { - return true; - } - if (xpType.equals(CRAFTING_CLOTHING_ARMOR)) - { - return true; - } - if (xpType.equals(CRAFTING_CLOTHING_GENERAL)) - { - return true; - } - if (xpType.equals(CRAFTING_WEAPONS_GENERAL)) - { - return true; - } - if (xpType.equals(CRAFTING_WEAPONS_MELEE)) - { - return true; - } - if (xpType.equals(CRAFTING_WEAPONS_RANGED)) - { - return true; - } - if (xpType.equals(CRAFTING_WEAPONS_MUNITION)) - { - return true; - } - if (xpType.equals(CRAFTING_STRUCTURE_GENERAL)) - { - return true; - } - if (xpType.equals(CRAFTING_DROID_GENERAL)) - { - return true; - } - if (xpType.equals(CRAFTING_SHIPWRIGHT)) - { - return true; - } - if (xpType.equals(MERCHANT)) - { - return true; - } - if (xpType.equals(QUEST_CRAFTING)) - { - return true; - } - if (xpType.equals(QUEST_GENERAL)) - { - return true; - } - if (xpType.equals("crafting")) - { - return true; - } - return false; - } - - - public static String[] getXpTypes(obj_id self) throws InterruptedException - { - Vector xpTypes = new Vector(); - xpTypes.setSize(0); - - if (dataTableOpen(TBL_SKILL)) - { - String[]colXpType = dataTableGetStringColumnNoDefaults(TBL_SKILL, "XP_TYPE"); - - if ((colXpType == null) || (colXpType.length == 0)) - { - - return null; - } - - for (int i = 0; i < colXpType.length; i++) - { - testAbortScript(); - String type = colXpType[i]; - - if (type != null && !type.equals("") && !type.equals("unobtainable") && !type.equals("jedi")) - { - - if (utils.getElementPositionInArray(xpTypes, type) == -1) - { - xpTypes = utils.addElement(xpTypes, type); - } - } - } - } - - return (String[])xpTypes.toArray(new String[0]); - } - - - public static void checkAndUpdateHuntingMissions(obj_id objPlayer, obj_id objCreature) throws InterruptedException - { - if (!isMob(objCreature)) - { - - return; - } - - LOG("missions", "checking for "+ objPlayer); - obj_id[]objMissions = getMissionObjects(objPlayer); - - if (objMissions == null) - { - LOG("missions", "null missions"); - return; - } - - for (int intI = 0; intI < objMissions.length; intI++) - { - testAbortScript(); - String strMissionType = getMissionType(objMissions[intI]); - - LOG("missions", "type is "+ strMissionType); - - if (strMissionType.equals("hunting")) - { - String strCreatureToKill = getStringObjVar(objMissions[intI], "strCreatureToKill"); - final String strCreatureType = getCreatureName(objCreature); - - LOG("missions", "creature to kill is "+ strCreatureToKill); - LOG("missions", "creature type is "+ strCreatureType); - - if (strCreatureType.equals(strCreatureToKill)) - { - - int intQuantityToKill = getIntObjVar(objMissions[intI], "intQuantityToKill"); - - intQuantityToKill = intQuantityToKill - 1; - - if (intQuantityToKill <= 0) - { - messageTo(objMissions[intI], "huntingSuccess", null, 0, true); - } - else - { - LOG("missions", "Quanitty Ledft is "+ intQuantityToKill); - setObjVar(objMissions[intI], "intQuantityToKill", intQuantityToKill); - string_id strName = new string_id("mob/creature_names", strCreatureType); - prose_package ppKillsLeft = prose.getPackage(new string_id("mission/mission_generic", "hunting_kills_remaining"), strName, intQuantityToKill); - - sendSystemMessageProse(objPlayer, ppKillsLeft); - return; - } - } - - } - } - return; - } - - - public static obj_id[] getTopIndividualAttacker(obj_var[] killers) throws InterruptedException - { - Vector tempArray = new Vector(); - tempArray.setSize(0); - - if (killers == null || killers.length <= 0) - { - return null; - } - - obj_var alpha = killers[0]; - obj_id alphaObjId = utils.stringToObjId(alpha.getName()); - - if (killers.length == 1) - { - tempArray = utils.addElement(tempArray, alphaObjId); - } - else - { - int alphaValue = alpha.getIntData(); - - obj_var omega = killers[killers.length - 1]; - obj_id omegaObjId = utils.stringToObjId(omega.getName()); - int omegaValue = omega.getIntData(); - - if (alphaValue > omegaValue) - { - tempArray = utils.addElement(tempArray, alphaObjId); - - for (int a = 1; a < killers.length; a++) - { - testAbortScript(); - obj_var next = killers[a]; - int nextValue = next.getIntData(); - - if (nextValue == alphaValue) - { - tempArray = utils.addElement(tempArray, utils.stringToObjId(next.getName())); - } - else - { - break; - } - } - } - else if (alphaValue < omegaValue) - { - tempArray = utils.addElement(tempArray, omegaObjId); - - for (int om = (killers.length - 2); om >= 0; om--) - { - testAbortScript(); - obj_var next = killers[om]; - int nextValue = next.getIntData(); - - if (nextValue == omegaValue) - { - tempArray = utils.addElement(tempArray, utils.stringToObjId(next.getName())); - } - else - { - break; - } - } - } - } - - obj_id[] topAttacker = utils.toStaticObjIdArray(tempArray); - - return topAttacker; - } - - - public static boolean displayForceSensitiveXP(obj_id player, String type) throws InterruptedException - { - if (!isIdValid(player)) - { - LOG("force_sensitive", "xp.convertForceSensitiveXP -- player is invalid."); - return false; - } - - if (type == null) - { - LOG("force_sensitive", "xp.convertForceSensitiveXP -- type is null."); - return false; - } - - int index = dataTableSearchColumnForString(type, "fs_type", "datatables/quest/force_sensitive/xp_conversion.iff"); - - if (index < 0) - { - LOG("force_sensitive", "xp.convertForceSensitiveXP -- can't find type "+ type + " in xp datatable."); - return false; - } - - Vector valid_xp_types = new Vector(); - valid_xp_types.setSize(0); - - for (int i = index; i < dataTableGetNumRows("datatables/quest/force_sensitive/xp_conversion.iff"); i++) - { - testAbortScript(); - dictionary row = dataTableGetRow("datatables/quest/force_sensitive/xp_conversion.iff", i); - String fs_type = row.getString("fs_type"); - - if (fs_type == null || !fs_type.equals(type)) - { - break; - } - - String xp_type = row.getString("xp_type"); - - if (xp_type != null && xp_type.length() > 0) - { - - if (getExperiencePoints(player, xp_type) > 0) - { - valid_xp_types.add(xp_type); - } - } - } - - if (valid_xp_types.size() > 0) - { - String[]dsrc = new String[valid_xp_types.size()]; - utils.setScriptVar(player, "force_sensitive.xp_convert", valid_xp_types); - utils.setScriptVar(player, "force_sensitive.xp_convert_type", type); - - for (int i = 0; i < valid_xp_types.size(); i++) - { - testAbortScript(); - dsrc[i] = "@exp_n:" + ((String)(valid_xp_types.get(i))); - } - - if (!hasScript(player, "quest.force_sensitive.fs_xp_convert")) - { - attachScript(player, "quest.force_sensitive.fs_xp_convert"); - } - - String type_name = localize(new string_id("exp_n", "fs_"+ type)); - - int pid = sui.listbox(player, player, "Select the experience you wish to convert to "+ type_name + ".", sui.OK_CANCEL, "Experience Conversion", dsrc, "msgFSXPConvertSelected"); - - utils.setScriptVar(player, "force_sensitive.sui_pid", pid); - } - else - { - sendSystemMessage(player, new string_id("quest/force_sensitive/utils", "convert_not_enough_for_conversion")); - } - - return true; - } - - - public static prose_package getXpProsePackage(String xpType, int xpAmt) throws InterruptedException - { - return getXpProsePackage(xpType, xpAmt, 1f, 1f); - } - - - public static prose_package getXpProsePackage(String xpType, int xpAmt, float grpMod, float inspMod) throws InterruptedException - { - prose_package pp = new prose_package(); - - string_id sid_xp = new string_id(STF_XP_N, xpType); - - prose.setTO(pp, sid_xp); - - float grpBonus = (grpMod * 100) - 100; - float inspBonus = (inspMod * 100) - 100; - - String grpBonusString = (new Integer(Math.round(grpBonus))).toString(); - String inspBonusString = (new Integer(Math.round(inspBonus))).toString(); - - prose.setDI(pp, Math.abs(xpAmt)); - - if (xpAmt >= 0) - { - if (inspBonus > 0) - { - if (grpBonus > 0) - { - prose.setStringId(pp, PROSE_GRANT_GROUP_BUFF_XP); - prose.setTT(pp, grpBonusString); - prose.setTU(pp, inspBonusString); - } - else - { - prose.setStringId(pp, PROSE_GRANT_BUFF_XP); - prose.setTT(pp, inspBonusString); - } - } - else - { - if (grpBonus > 0) - { - prose.setStringId(pp, PROSE_GRANT_GROUP_XP); - prose.setTT(pp, grpBonusString); - } - else - { - if (xpAmt == 1) - { - prose.setStringId(pp, PROSE_GRANT_XP1); - } - else - { - prose.setStringId(pp, PROSE_GRANT_XP); - } - } - } - } - else - { - if (xpAmt == 1) - { - prose.setStringId(pp, PROSE_REVOKE_XP1); - } - else - { - prose.setStringId(pp, PROSE_REVOKE_XP); - } - } - - return pp; - } - - - public static int grantXpByTemplate(obj_id player, int amount) throws InterruptedException - { - - String template = getSkillTemplate(player); - - String xpType = xp.QUEST_COMBAT; - - if (!isIdValid(player) || template == null) - { - return 0; - } - - if (template.startsWith("trader")) - { - grantCraftingStyleXp(player, xp.QUEST_CRAFTING, amount); - xpType = xp.QUEST_CRAFTING; - } - else if (template.startsWith("entertainer")) - { - grantSocialStyleXp(player, xp.QUEST_SOCIAL, amount); - xpType = xp.QUEST_SOCIAL; - } - else - { - grantCombatStyleXp(player, xp.QUEST_COMBAT, amount); - xpType = xp.QUEST_COMBAT; - } - - xp.displayXpFlyText(player, player, amount); - xp.displayXpMsg(player, xpType, amount); - - return amount; - } - - - public static int grantUnmodifiedXpByTemplate(obj_id player, int amount) throws InterruptedException - { - - String template = getSkillTemplate(player); - - String xpType = xp.QUEST_COMBAT; - - if (!isIdValid(player) || template == null) - { - return 0; - } - - if (template.startsWith("trader")) - { - xpType = xp.QUEST_CRAFTING; - } - else if (template.startsWith("entertainer")) - { - xpType = xp.QUEST_SOCIAL; - } - else - { - xpType = xp.QUEST_COMBAT; - } - - String templateXp = skill_template.getTemplateSkillXpType(player, false); - - if (templateXp != null && amount > 0) - { - amount = grant(player, templateXp, amount, false); - } - - xp.displayXpFlyText(player, player, amount); - xp.displayXpMsg(player, xpType, amount); - - return amount; - } - - - public static int grantUnmodifiedXPPercentageOfLevel(obj_id player, float percentage) throws InterruptedException - { - int playerLevel = getLevel(player); - if (playerLevel < 90) - { - int xpForCurrentLevel = dataTableGetInt(xp.TBL_PLAYER_LEVEL_XP, playerLevel - 1, "xp_required"); - int xpForNextLevel = dataTableGetInt(xp.TBL_PLAYER_LEVEL_XP, playerLevel, "xp_required"); - - float xpGrantedFloat = (xpForNextLevel - xpForCurrentLevel)*percentage/100; - int xpGranted = (int)xpGrantedFloat; - - if (grantUnmodifiedXpByTemplate(player, xpGranted) > 0) - { - return xpGranted; - } - } - - return 0; - } - - - public static void applyHealingCredit(obj_id self) throws InterruptedException - { - deltadictionary scriptVars = self.getScriptVars(); - Vector healers = scriptVars.getResizeableObjIdArray("healers"); - if (healers != null) - { - Iterator i = healers.iterator(); - dictionary params = new dictionary(); - params.put("target", self); - while (i.hasNext()) - { - testAbortScript(); - obj_id healer = (obj_id)i.next(); - if (isIdValid(healer)) - { - messageTo(healer, "receiveCreditForCombatHealing", params, 0.0f, false); - } - } - } - } - - - public static void grantMissionXp(obj_id player, int missionLevel) throws InterruptedException - { - if (isIdValid(player) && missionLevel > 0) - { - int xpToGrantForRealsies = getMissionXpAmount(player, missionLevel); - - if (xpToGrantForRealsies > 0) - { - - grantCombatStyleXp(player, COMBAT_GENERAL, xpToGrantForRealsies); - displayXpFlyText(player, player, xpToGrantForRealsies); - - int huySaidToUseTTForTheSecondNumber = ((missions.DAILY_MISSION_XP_REWARD - missions.getPlayerDailyCount(player)) -1); - - prose_package pp = new prose_package(); - prose.setStringId(pp, missions.DAILY_REWARD_XP); - prose.setDI(pp, xpToGrantForRealsies); - prose.setTT(pp, ""+huySaidToUseTTForTheSecondNumber); - sendSystemMessageProse(player, pp); - - } - } - } - - - public static int getMissionXpAmount(obj_id player, int missionLevel) throws InterruptedException - { - int xpToGrant = 0; - int playerLevel = getLevel(player); - int xpForCurrentLevel = dataTableGetInt(TBL_PLAYER_LEVEL_XP, playerLevel - 1, "xp_required"); - int xpForNextLevel = dataTableGetInt(TBL_PLAYER_LEVEL_XP, playerLevel, "xp_required"); - int levelDivisor = 0; - - int levelDelta = Math.abs(missionLevel - playerLevel); - - LOG("NewMission", "getMissionXpAmountLevelDelta: "+ levelDelta); - - if (xpForNextLevel <= 0) - { - return xpToGrant; - } - - int xpForLevel = xpForNextLevel - xpForCurrentLevel; - - if (levelDelta > 15) - { - levelDivisor += levelDelta; - } - - if (xpForLevel > 0) - { - - int missionXpDivisor = missions.DAILY_MISSION_XP_LOW; - - if (playerLevel >= 70) - { - missionXpDivisor = missions.DAILY_MISSION_XP_MEDIUM; - } - - if (playerLevel >= 80) - { - missionXpDivisor = missions.DAILY_MISSION_XP_HIGH; - } - - missionXpDivisor += levelDivisor; - - if (missionXpDivisor > 0) - { - xpToGrant = xpForLevel / missionXpDivisor; - - int sanityXpAmount = xpForLevel / missions.DAILY_MISSION_XP_SANITY; - if (xpToGrant > sanityXpAmount) - { - xpToGrant = sanityXpAmount; - } - } - } - return xpToGrant; - } - - - public static int grantCollectionXP(obj_id player, String collectionName) throws InterruptedException - { - float xpToGrant = 0; - - int playerLevel = getLevel(player); - if (playerLevel == 90) - { - return 0; - } - - int xpForCurrentLevel = dataTableGetInt(TBL_PLAYER_LEVEL_XP, playerLevel - 1, "xp_required"); - int xpForNextLevel = dataTableGetInt(TBL_PLAYER_LEVEL_XP, playerLevel, "xp_required"); - - float xpForLevel = xpForNextLevel - xpForCurrentLevel; - - float xpModifier = dataTableGetFloat(collection.COLLECTION_REWARD_TABLE, collectionName, "xpModifier"); - - long repeatSlotValue = getCollectionSlotValue(player, collectionName + "_tracker") - 1; - if (repeatSlotValue > 0) - { - float repeatXpModifier = repeatCollectionXpModifier(player, repeatSlotValue); - xpToGrant = xpModifier * xpForLevel * repeatXpModifier; - return (int)xpToGrant; - } - - xpToGrant = xpModifier * xpForLevel; - - return (int)xpToGrant; - } - - - public static int grantCollectionSpaceXP(obj_id player, String collectionName) throws InterruptedException - { - if (!isValidId(player)) - { - return 0; - } - - if (!space_skill.hasSpaceSkills(player)) - { - return 0; - } - - String profPrefix = space_flags.getProfessionPrefix(player); - if (profPrefix == null || profPrefix.equals("")) - { - return 0; - } - - float xpToGrant = 0.0f; - int xpForCurrentLevel = -1; - int xpForNextLevel = -1; - - if (space_flags.hasCompletedTierFour(player)) - { - String tierFourSkill = profPrefix+space_flags.SKILL_NAMES[space_flags.TIER4_INDEXSTART]; - String masterSkill = profPrefix+"_master"; - xpForCurrentLevel = dataTableGetInt(TBL_SKILL, tierFourSkill, "XP_COST"); - xpForNextLevel = dataTableGetInt(TBL_SKILL, masterSkill, "XP_COST"); - } - else if (space_flags.hasCompletedTierThree(player)) - { - String tierThreeSkill = profPrefix+space_flags.SKILL_NAMES[space_flags.TIER3_INDEXSTART]; - String tierFourSkill = profPrefix+space_flags.SKILL_NAMES[space_flags.TIER4_INDEXSTART]; - xpForCurrentLevel = dataTableGetInt(TBL_SKILL, tierThreeSkill, "XP_COST"); - xpForNextLevel = dataTableGetInt(TBL_SKILL, tierFourSkill, "XP_COST"); - } - else if (space_flags.hasCompletedTierTwo(player)) - { - String tierTwoSkill = profPrefix+space_flags.SKILL_NAMES[space_flags.TIER2_INDEXSTART]; - String tierThreeSkill = profPrefix+space_flags.SKILL_NAMES[space_flags.TIER3_INDEXSTART]; - xpForCurrentLevel = dataTableGetInt(TBL_SKILL, tierTwoSkill, "XP_COST"); - xpForNextLevel = dataTableGetInt(TBL_SKILL, tierThreeSkill, "XP_COST"); - - } - else if (space_flags.hasCompletedTierOne(player)) - { - String tierOneSkill = profPrefix+space_flags.SKILL_NAMES[space_flags.TIER1_INDEXSTART]; - String tierTwoSkill = profPrefix+space_flags.SKILL_NAMES[space_flags.TIER2_INDEXSTART]; - xpForCurrentLevel = dataTableGetInt(TBL_SKILL, tierOneSkill, "XP_COST"); - xpForNextLevel = dataTableGetInt(TBL_SKILL, tierTwoSkill, "XP_COST"); - } - else - { - String tierOneSkill = profPrefix+space_flags.SKILL_NAMES[space_flags.TIER1_INDEXSTART]; - xpForCurrentLevel = 0; - xpForNextLevel = dataTableGetInt(TBL_SKILL, tierOneSkill, "XP_COST"); - } - - if (xpForCurrentLevel == -1 || xpForNextLevel == -1) - { - return 0; - } - - float xpForLevel = xpForNextLevel - xpForCurrentLevel; - float xpModifier = dataTableGetFloat(collection.COLLECTION_REWARD_TABLE, collectionName, "xpModifier"); - - long repeatSlotValue = getCollectionSlotValue(player, collectionName + "_tracker") - 1; - if (repeatSlotValue > 0) - { - float repeatXpModifier = repeatCollectionXpModifier(player, repeatSlotValue); - xpToGrant = xpModifier * xpForLevel * repeatXpModifier; - return (int)xpToGrant; - } - - xpToGrant = xpModifier * xpForLevel; - return (int)xpToGrant; - } - - - public static float repeatCollectionXpModifier(obj_id player, long repeatSlotValue) throws InterruptedException - { - float repeatMultiplier = 0.0f; - - float adjustedRepeatSlotValue = (float)repeatSlotValue / 10.0f; - repeatMultiplier = 1.0f - adjustedRepeatSlotValue; - if (repeatMultiplier < 0.1f) - { - - repeatMultiplier = 0.1f; - } - return repeatMultiplier; - } -} diff --git a/sku.0/sys.server/compiled/game/script/make_debug b/sku.0/sys.server/compiled/game/script/make_debug deleted file mode 100644 index b84838db1..000000000 --- a/sku.0/sys.server/compiled/game/script/make_debug +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -DATAPATH=../../../../../../data/sku.0/sys.server/compiled/game - -FILES=$* - -if [[ $1 == "" ]]; then - FILES=`ls *.java`; -fi; - -for file in $FILES; do - noext=$(echo $file | cut -f 1 -d .) - p4 edit $DATAPATH/script/${noext}*.class | grep -v "currently opened for edit" -done - -javac -g -sourcepath . -classpath $DATAPATH -d $DATAPATH $FILES - -for file in $FILES; do - noext=$(echo $file | cut -f 1 -d .) - p4 add $DATAPATH/script/${noext}*.class | grep -v "add of existing file" | grep -v "can't add (already opened for edit)" -done diff --git a/sku.0/sys.server/compiled/game/script/make_debug.btm b/sku.0/sys.server/compiled/game/script/make_debug.btm deleted file mode 100644 index 162b722db..000000000 --- a/sku.0/sys.server/compiled/game/script/make_debug.btm +++ /dev/null @@ -1,23 +0,0 @@ -@set javacfound = 0 -@rem for %x in (%path) do (@echo %x\javac.exe) - -@rem @echo javacfound = %javacfound - -@set DATAPATH=..\..\..\..\..\..\data\sku.0\sys.server\compiled\game - -@rem @if not exist %DATAPATH md %DATAPATH - -@if "%1" == "" goto all - -@for %x in (%1) ( - @javac.exe -g -sourcepath ..\. -classpath %DATAPATH -d %DATAPATH %x -) -@goto end - -:all -@for %x in (*.java) ( - @javac.exe -g -sourcepath ..\. -classpath %DATAPATH -d %DATAPATH %x - @if ERRORLEVEL != 0 (@goto end) -) - -:end diff --git a/sku.0/sys.server/compiled/game/script/make_release b/sku.0/sys.server/compiled/game/script/make_release deleted file mode 100644 index 4c69b7e7f..000000000 --- a/sku.0/sys.server/compiled/game/script/make_release +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/bash -DATAPATH=../../../../../../../../data/sku.0/sys.server/plt.shared/loc.shared/compiled/game - -FILES=$1 - -if [[ $1 == "" ]]; then - FILES=`find -name "*.java"`; -fi; - -javac -g -sourcepath . -classpath $DATAPATH -d $DATAPATH $FILES diff --git a/sku.0/sys.server/compiled/game/script/make_release.btm b/sku.0/sys.server/compiled/game/script/make_release.btm deleted file mode 100644 index a24230221..000000000 --- a/sku.0/sys.server/compiled/game/script/make_release.btm +++ /dev/null @@ -1,18 +0,0 @@ -@set javacfound = 0 -@for %x in (%path) do (@echo %x\javac.exe) - -@rem @echo javacfound = %javacfound - -@set DATAPATH=..\..\..\..\..\..\data\sku.0\sys.server\compiled\game - -@rem @if not exist %DATAPATH md %DATAPATH - -@if "%1" == "" goto all - -@for %x in (%1) do (javac.exe -g:none -O -sourcepath ..\. -classpath %DATAPATH -d %DATAPATH %x) -@goto end - -:all -@for %x in (*.java) do (javac.exe -g:none -O -sourcepath ..\. -classpath %DATAPATH -d %DATAPATH %x) - -:end diff --git a/sku.0/sys.server/compiled/game/script/make_script b/sku.0/sys.server/compiled/game/script/make_script deleted file mode 100644 index eef34348b..000000000 --- a/sku.0/sys.server/compiled/game/script/make_script +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -echo $* - -PYTHON=c:/python20/python -COMPILER=c:/projects/swg/ep3/exe/shared/script_prep.pyc -FILES=$* - -if [ -z "$1" ]; then - FILES=`ls *.script *.scriptlib`; -fi; - -for file in $FILES; do - datafileNoExt=$(echo $file | perl -p -e 's,/dsrc/,/data/,g' | perl -p -e 's,[.]script.*,,g') - p4 edit ${datafileNoExt}*.class | grep -v "currently opened for edit" - ${PYTHON} ${COMPILER} -dDEBUG ${file} -done - -for file in $FILES; do - datafileNoExt=$(echo $file | perl -p -e 's,/dsrc/,/data/,g' | perl -p -e 's,[.]script.*,,g') - p4 add ${datafileNoExt}*.class | grep -v "add of existing file" | grep -v "can't add (already opened for edit)" -done diff --git a/sku.0/sys.server/compiled/game/script/makedata.btm b/sku.0/sys.server/compiled/game/script/makedata.btm deleted file mode 100644 index 3065e290e..000000000 --- a/sku.0/sys.server/compiled/game/script/makedata.btm +++ /dev/null @@ -1,24 +0,0 @@ - -echo on -if %ROOTSWGDIRECTORY=="" goto errorHandler - -perl %ROOTSWGDIRECTORY\all\tools\mocha\mochac.pl -p -s %1 - -if %? != 0 goto errorCompile - -echo off - -if not exist %ROOTSWGDIRECTORY\all\tools\design\designtools.cfg goto errorHandler -set RELOADTARGET=%ROOTSWGDIRECTORY\all\tools\design\universalreload.btm - -call %RELOADTARGET %1 - -quit -:errorHandler -@echo off -echo You are missing a config file in your swg/all/tools/design directory. -echo You should have a designtools.cfg in that directory. -quit - -:errorCompile -Scripts failed to compile. Exit makedata.btm. \ No newline at end of file diff --git a/sku.0/sys.server/compiled/game/script/makescriptd.btm b/sku.0/sys.server/compiled/game/script/makescriptd.btm deleted file mode 100644 index 8eda19ba2..000000000 --- a/sku.0/sys.server/compiled/game/script/makescriptd.btm +++ /dev/null @@ -1,20 +0,0 @@ -@echo off - -set dsrcIndex=%@index[%1,dsrc] - -if %dsrcIndex lt 0 goto exit - -set /a dsrcIndex=%dsrcIndex-1 -set i=0 -do until %@left[1,%temp] eq ^\ - set /a i=%i+1 - set /a start=%dsrcIndex-%i - if %start eq 0 quit - set temp=%@instr[%start,%i,%1] -enddo - -python.exe d:\work\swg%temp\exe\shared\script_prep.pyc -dDEBUG %1 - - -:exit -quit diff --git a/sku.0/sys.server/compiled/game/script/makescriptj.btm b/sku.0/sys.server/compiled/game/script/makescriptj.btm deleted file mode 100644 index 82bae27f4..000000000 --- a/sku.0/sys.server/compiled/game/script/makescriptj.btm +++ /dev/null @@ -1,20 +0,0 @@ -@echo off - -set dsrcIndex=%@index[%1,dsrc] - -if %dsrcIndex lt 0 goto exit - -set /a dsrcIndex=%dsrcIndex-1 -set i=0 -do until %@left[1,%temp] eq ^\ - set /a i=%i+1 - set /a start=%dsrcIndex-%i - if %start eq 0 quit - set temp=%@instr[%start,%i,%1] -enddo - -python.exe j:\swg%temp\exe\shared\script_prep.pyc -dDEBUG %1 - - -:exit -quit diff --git a/sku.0/sys.server/compiled/game/script/npc/converse/junk_dealer.java b/sku.0/sys.server/compiled/game/script/npc/converse/junk_dealer.java deleted file mode 100644 index 21153b9b1..000000000 --- a/sku.0/sys.server/compiled/game/script/npc/converse/junk_dealer.java +++ /dev/null @@ -1,226 +0,0 @@ -package script.npc.converse; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.sui; -import script.library.chat; -import script.library.group; -import script.library.prose; -import script.library.money; -import script.library.ai_lib; -import script.library.utils; -import script.library.luck; -import script.library.static_item; -import script.library.smuggler; - - -public class junk_dealer extends script.base_script -{ - public junk_dealer() - { - } - public static final boolean LOGGING_ON = true; - public static final String LOGNAME = "junk_log"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); - - String creatureName = getCreatureName(self); - if (creatureName.equals("junk_jawa")) - { - - return SCRIPT_CONTINUE; - } - if (!creatureName.equals("junk_dealer_smuggler")) - { - attachScript(self, "conversation.junk_dealer_generic"); - } - else - { - attachScript(self, "conversation.junk_dealer_smuggler"); - } - - return SCRIPT_CONTINUE; - } - - - public int startDealing(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = params.getObjId("player"); - - if (utils.outOfRange(self, player, 10.0f, true)) - { - return SCRIPT_CONTINUE; - } - - smuggler.showSellJunkSui(player, self, false, false); - - return SCRIPT_CONTINUE; - } - - - public int handleSellJunkSui(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (utils.outOfRange(self, player, 10.0f, true)) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, "fence", false); - messageTo(player, "handleSellJunkSui", params, 0.0f, false); - return SCRIPT_CONTINUE; - } - - - public int handleSoldJunk(obj_id self, dictionary params) throws InterruptedException - { - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId(money.DICT_TARGET_ID); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (utils.outOfRange(self, player, 10.0f, true)) - { - return SCRIPT_CONTINUE; - } - - blog("junk_dealer.handleSoldJunk() - setting fence to false"); - params.put("fence",false); - messageTo(player, "handleSoldJunk", params, 0.0f, false); - return SCRIPT_CONTINUE; - } - - - public int startBuyBack(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = params.getObjId("player"); - - if (utils.outOfRange(self, player, 10.0f, true)) - { - return SCRIPT_CONTINUE; - } - - smuggler.showBuyBackSui(player, self); - - return SCRIPT_CONTINUE; - } - - - public int startFlaggingItemsNoSale(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = params.getObjId("player"); - - if (utils.outOfRange(self, player, 10.0f, true)) - { - return SCRIPT_CONTINUE; - } - - smuggler.flagJunkSaleSui(player, self); - - return SCRIPT_CONTINUE; - } - - - public int handleBuyBackSui(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (utils.outOfRange(self, player, 10.0f, true)) - { - return SCRIPT_CONTINUE; - } - params.put("dealer",self); - messageTo(player, "handleBuyBackSui", params, 0.0f, false); - return SCRIPT_CONTINUE; - } - - - public int handleTheBuyBack(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId(money.DICT_PLAYER_ID); - if (!isIdValid(player)) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer.handleTheBuyBack() - Failed to sell back object because player was invalid."); - return SCRIPT_CONTINUE; - } - - if (utils.outOfRange(self, player, 10.0f, true)) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer.handleTheBuyBack() - Player: "+player+" cannot buy back an item because they walked too far from the Junk Dealer: "+self); - return SCRIPT_CONTINUE; - } - - blog("junk_dealer.handleTheBuyBack() - sending params to player."); - params.put("dealer",self); - messageTo(player, "handleTheBuyBack", params, 0.0f, false); - return SCRIPT_CONTINUE; - } - - - public int handleFlagJunkSui(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - if (utils.outOfRange(self, player, 10.0f, true)) - { - return SCRIPT_CONTINUE; - } - - blog("junk_dealer.handleFlagJunkSui() - sending params to player."); - params.put("dealer",self); - messageTo(player, "handleFlagJunkSui", params, 0.0f, false); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String txt) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(LOGNAME, txt); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/npc/faction_recruiter/biolink_item.java b/sku.0/sys.server/compiled/game/script/npc/faction_recruiter/biolink_item.java deleted file mode 100644 index 7d4802ec5..000000000 --- a/sku.0/sys.server/compiled/game/script/npc/faction_recruiter/biolink_item.java +++ /dev/null @@ -1,236 +0,0 @@ -package script.npc.faction_recruiter; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.factions; -import script.library.faction_perk; -import script.library.sui; -import script.library.utils; -import script.library.combat; - - -public class biolink_item extends script.base_script -{ - public biolink_item() - { - } - public static final String VAR_TEMP_BASE = "biotemp"; - public static final String VAR_TEMP_EQUIP_FLAG = "biotemp.equip"; - - public static final string_id SID_POINTS_NEEDED_FOR_BIO_LINK = new string_id("base_player", "faction_points_needed_for_bio_link"); - public static final string_id SID_ITEM_BIO_LINKED = new string_id("base_player", "item_bio_linked"); - public static final string_id SID_MUST_EQUIP_FROM_INVENTORY = new string_id("base_player", "must_equip_from_inventory"); - public static final string_id SID_MUST_BIO_LINK_FROM_INVENTORY = new string_id("base_player", "must_bio_link_from_inventory"); - public static final string_id SID_BIO_LINK_WRONG_OVERT_FACTION = new string_id("base_player", "bio_link_wrong_overt_faction"); - public static final string_id SID_BIO_LINK_WRONG_FACTION = new string_id("base_player", "bio_link_wrong_faction"); - public static final string_id SID_BIO_LINK = new string_id("ui_radial", "bio_link"); - public static final string_id SID_BIO_LINK_MSG_PROMPT = new string_id("sui", "bio_link_item_prompt"); - public static final string_id SID_SPEND_FACTION_POINTS_PROMPT = new string_id("sui", "spend_faction_points"); - public static final string_id SID_BIO_LINK_MSG_TITLE = new string_id("sui", "bio_link_item_title"); - public static final string_id SID_SPECIES_CANNOT_EQUIP = new string_id("base_player", "species_cannot_equip"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setBioLink(self, null); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == null) - { - setBioLink(self, null); - } - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - CustomerServiceLog("Faction", "WARNING: factions::OnAboutToBeTransferred -- "+ self + " biolink_item script."); - - obj_id biolink = getBioLink(self); - if (biolink == null) - { - setBioLink(self, null); - biolink = utils.OBJ_ID_BIO_LINK_PENDING; - } - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING && (isPlayer(destContainer) || isAPlayerAppearanceInventoryContainer(destContainer) )) - { - - obj_id containerPlayer = utils.getContainingPlayer(self); - obj_id appearanceInv = getAppearanceInventory(containerPlayer); - - if (containerPlayer != destContainer && destContainer != appearanceInv) - { - sendSystemMessage(containerPlayer, SID_MUST_EQUIP_FROM_INVENTORY); - return SCRIPT_OVERRIDE; - } - - obj_id player = null; - - if (containerPlayer == destContainer) - { - player = containerPlayer; - } - else - { - player = getContainedBy(destContainer); - } - - utils.setScriptVar(self, "destContainer", destContainer); - - if (!factions.canUseFactionItem(player, self)) - { - return SCRIPT_OVERRIDE; - } - - int pid = sui.msgbox(self, player, "@"+ SID_BIO_LINK_MSG_PROMPT, sui.YES_NO, "@"+ SID_BIO_LINK_MSG_TITLE, "handleEquipBioLinkSui"); - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - - obj_id biolink = getBioLink(self); - if (biolink == utils.OBJ_ID_BIO_LINK_PENDING) - { - - if (isIdValid(player) && utils.getContainingPlayer(self) == player) - { - - if (!hasObjVar(self, factions.VAR_FACTION) || factions.canUseFactionItem(player, self)) - { - item.addRootMenu(menu_info_types.BIO_LINK, SID_BIO_LINK); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item == menu_info_types.BIO_LINK) - { - if (!_bioLinkItem(self, player, false, true)) - { - return SCRIPT_OVERRIDE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleEquipBioLinkSui(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - _bioLinkItem(self, player, true, true); - return SCRIPT_CONTINUE; - } - - - public int handleSpendFactionPointsSui(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - if (bp != sui.BP_CANCEL) - { - obj_id player = sui.getPlayerId(params); - _bioLinkItem(self, player, false, false); - } - utils.removeScriptVar(self, VAR_TEMP_BASE); - return SCRIPT_CONTINUE; - } - - - public boolean _bioLinkItem(obj_id self, obj_id player, boolean equipAfterLink, boolean queryPlayer) throws InterruptedException - { - if (!isIdValid(self) || !isIdValid(player)) - { - CustomerServiceLog("Faction", "WARNING: biolink_item._bioLinkItem called with invalid player (%TU) or item ("+ self + ")", player); - return false; - } - - obj_id biolink = getBioLink(self); - if (biolink != utils.OBJ_ID_BIO_LINK_PENDING) - { - CustomerServiceLog("Faction", "WARNING: Player %TU trying to bio-link item "+ self + " that has link id "+ biolink, player); - return false; - } - - if (utils.getContainingPlayer(self) != player) - { - sendSystemMessage(player, SID_MUST_BIO_LINK_FROM_INVENTORY); - return false; - } - - String template = getTemplateName(self); - if ((template.startsWith("object/tangible/wearables/") ) && (!canEquipWearable(player, self) )) - { - sendSystemMessage(player, SID_SPECIES_CANNOT_EQUIP); - return false; - } - - if (isWeapon(self)) - { - if (!combat.hasCertification(player, self)) - { - sendSystemMessage(player, SID_SPECIES_CANNOT_EQUIP); - return false; - } - } - - if (hasObjVar(self, factions.VAR_FACTION) && !factions.canUseFactionItem(player, self)) - { - string_id errMsg = SID_BIO_LINK_WRONG_FACTION; - prose_package pp = new prose_package(); - pp.stringId = errMsg; - pp.target.nameId = factions.getLocalizedFactionName(getStringObjVar(self, factions.VAR_FACTION)); - sendSystemMessageProse(player, pp); - return false; - } - - setBioLink(self, player); - prose_package pp = new prose_package(); - pp.stringId = SID_ITEM_BIO_LINKED; - sendSystemMessageProse(player, pp); - sendDirtyObjectMenuNotification(self); - - obj_id container = player; - if (utils.hasScriptVar(self, "destContainer")) - { - container = utils.getObjIdScriptVar(self,"destContainer"); - } - - if (equipAfterLink) - { - equip(self, container); - } - - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/npc/faction_recruiter/faction_item.java b/sku.0/sys.server/compiled/game/script/npc/faction_recruiter/faction_item.java deleted file mode 100644 index a2f790e0c..000000000 --- a/sku.0/sys.server/compiled/game/script/npc/faction_recruiter/faction_item.java +++ /dev/null @@ -1,75 +0,0 @@ -package script.npc.faction_recruiter; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.factions; -import script.library.utils; - - -public class faction_item extends script.base_script -{ - public faction_item() - { - } - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - - if (isPlayer(destContainer)) - { - if (!factions.canUseFactionItem(destContainer, self)) - { - return SCRIPT_OVERRIDE; - } - } - - if (isAPlayerAppearanceInventoryContainer(destContainer)) - { - obj_id owner = getContainedBy(destContainer); - if (!isIdValid(owner)) - { - return SCRIPT_OVERRIDE; - } - - CustomerServiceLog("faction", "OnAboutToBeTransferred: isAPlayerAppearanceInventoryContainer: Object: "+self+" is about to be transferred to player: "+owner+"."); - - if (!factions.canUseFactionItem(owner, self)) - { - return SCRIPT_OVERRIDE; - } - } - - return SCRIPT_CONTINUE; - } - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (hasObjVar(self, "faction_recruiter.faction")) - { - names[idx] = "faction_restriction"; - String attrib = getStringObjVar(self, "faction_recruiter.faction"); - attribs[idx] = attrib; - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - return super.OnGetAttributes(self, player, names, attribs); - } - -} diff --git a/sku.0/sys.server/compiled/game/script/npc/faction_recruiter/faction_recruiter.java b/sku.0/sys.server/compiled/game/script/npc/faction_recruiter/faction_recruiter.java deleted file mode 100644 index f2a2cc8ac..000000000 --- a/sku.0/sys.server/compiled/game/script/npc/faction_recruiter/faction_recruiter.java +++ /dev/null @@ -1,975 +0,0 @@ -package script.npc.faction_recruiter; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.faction_perk; -import script.library.factions; -import script.library.chat; -import script.library.gcw; -import script.library.prose; -import script.library.utils; -import script.library.money; -import script.library.sui; -import script.library.badge; -import script.library.xp; -import java.util.Vector; -import java.util.Arrays; - - -public class faction_recruiter extends script.base_script -{ - public faction_recruiter() - { - } - public static final String DATATABLE_ALLOWED_XP_TYPES = "datatables/npc/faction_recruiter/allowed_xp_types.iff"; - - public static final String CONVERSE_FACTION_PERKS = "faction_perks"; - public static final string_id SID_GREETING = new string_id("faction_recruiter", "greeting"); - public static final string_id SID_GREETING_PROSE = new string_id("faction_recruiter", "greeting_prose"); - public static final string_id SID_GREETING_MEMBER = new string_id("faction_recruiter", "greeting_member"); - public static final string_id SID_GREETING_HATE = new string_id("faction_recruiter", "greeting_hate"); - public static final string_id SID_NOT_MEMBER = new string_id("faction_recruiter", "not_member"); - public static final string_id SID_INVALID_RESPONSE = new string_id("faction_recruiter", "invalid_response"); - public static final string_id SID_JOIN_FACTION_CONFIRM = new string_id("faction_recruiter", "join_faction_confirm"); - public static final string_id SID_JOIN_FACTION_DENIED = new string_id("faction_recruiter", "join_faction_denied"); - public static final string_id SID_JOIN_FACTION_PLAYER_NO = new string_id("faction_recruiter", "join_faction_player_no"); - public static final string_id SID_WELCOME_TO_FACTION = new string_id("faction_recruiter", "welcome_to_faction"); - public static final string_id SID_SHOW_OPTIONS = new string_id("faction_recruiter", "show_options"); - public static final string_id SID_RESIGN_FACTION_CONFIRM = new string_id("faction_recruiter", "resign_faction_confirm"); - public static final string_id SID_RESIGN_FACTION_NO = new string_id("faction_recruiter", "resign_faction_no"); - public static final string_id SID_RESIGN_FACTION_YES = new string_id("faction_recruiter", "resign_faction_yes"); - public static final string_id SID_GO_DECLARED_CONFIRM = new string_id("faction_recruiter", "go_declared_confirm"); - public static final string_id SID_GO_COVERT_CONFIRM = new string_id("faction_recruiter", "go_covert_confirm"); - public static final string_id SID_GO_DECLARED_YES = new string_id("faction_recruiter", "go_declared_yes"); - public static final string_id SID_GO_COVERT_YES = new string_id("faction_recruiter", "go_covert_yes"); - public static final string_id SID_SKILL_TRAINING_SELECT = new string_id("faction_recruiter", "skill_training_select"); - public static final string_id SID_SHOW_ITEM_CATEGORIES = new string_id("faction_recruiter", "show_item_categories"); - public static final string_id SID_SHOW_ITEMS = new string_id("faction_recruiter", "show_items"); - public static final string_id SID_NO_ITEMS_AVAILABLE = new string_id("faction_recruiter", "no_items_available"); - public static final string_id SID_NOT_ENOUGH_FOR_PROMOTION = new string_id("faction_recruiter", "not_enough_for_promotion"); - public static final string_id SID_PROMOTION_CONFIRM = new string_id("faction_recruiter", "promotion_confirm"); - public static final string_id SID_PROMOTION_MAX_RANK = new string_id("faction_recruiter", "promotion_max_rank"); - public static final string_id SID_RESIGNATION_RECINDED = new string_id("faction_recruiter", "resignation_recinded"); - public static final string_id SID_ENEMY_PILOT = new string_id("faction_recruiter", "enemy_pilot"); - - public static final string_id SID_JOIN_FACTION = new string_id("faction_recruiter", "response_join_faction"); - public static final string_id SID_CHANGE_FACTION = new string_id("faction_recruiter", "response_change_faction"); - public static final string_id SID_NOTHING = new string_id("faction_recruiter", "response_nothing"); - public static final string_id SID_YES_TO_JOIN = new string_id("faction_recruiter", "response_yes_to_join"); - public static final string_id SID_NO_TO_JOIN = new string_id("faction_recruiter", "response_no_to_join"); - public static final string_id SID_YES_TO_SEE_OPTIONS = new string_id("faction_recruiter", "response_yes_to_see_options"); - public static final string_id SID_NO_TO_SEE_OPTIONS = new string_id("faction_recruiter", "response_no_to_see_options"); - public static final string_id SID_YES_TO_RESIGN = new string_id("faction_recruiter", "response_yes_to_resign"); - public static final string_id SID_NO_TO_RESIGN = new string_id("faction_recruiter", "response_no_to_resign"); - public static final string_id SID_YES_TO_GO_DECLARED = new string_id("faction_recruiter", "response_yes_to_go_declared"); - public static final string_id SID_NO_TO_GO_DECLARED = new string_id("faction_recruiter", "response_no_to_go_declared"); - public static final string_id SID_YES_TO_GO_COVERT = new string_id("faction_recruiter", "response_yes_to_go_covert"); - public static final string_id SID_NO_TO_GO_COVERT = new string_id("faction_recruiter", "response_no_to_go_covert"); - public static final string_id SID_YES_TO_PROMOTION = new string_id("faction_recruiter", "response_yes_to_promotion"); - public static final string_id SID_NO_TO_PROMOTION = new string_id("faction_recruiter", "response_no_to_promotion"); - public static final string_id SID_PROMOTION_COMPLETE = new string_id("faction_recruiter", "response_promotion_complete"); - - public static final string_id SID_SELL_SECRETS = new string_id("faction_recruiter", "sell_secrets"); - public static final string_id SID_NO_SECRETS[] = - { - new string_id("faction_recruiter", "no_secrets_1"), - new string_id("faction_recruiter", "no_secrets_2"), - new string_id("faction_recruiter", "no_secrets_3") - }; - public static final string_id SID_INTERESTED_SECRETS_REB[]= - { - new string_id("faction_recruiter", "interested_secrets_reb_1"), - new string_id("faction_recruiter", "interested_secrets_reb_2"), - new string_id("faction_recruiter", "interested_secrets_reb_3") - }; - public static final string_id SID_INTERESTED_SECRETS_IMP[]= - { - new string_id("faction_recruiter", "interested_secrets_imp_1"), - new string_id("faction_recruiter", "interested_secrets_imp_2"), - new string_id("faction_recruiter", "interested_secrets_imp_3") - }; - public static final string_id SID_NEVERMIND = new string_id("faction_recruiter", "nevermind"); - public static final string_id SID_HERE_YOU_GO = new string_id("faction_recruiter", "here_you_go"); - public static final string_id SID_GET_LOST = new string_id("faction_recruiter", "get_lost"); - public static final string_id SID_GOOD_STUFF[] = - { - new string_id("faction_recruiter", "good_stuff_1"), - new string_id("faction_recruiter", "good_stuff_2"), - new string_id("faction_recruiter", "good_stuff_3") - }; - public static final string_id SID_BAD_STUFF[] = - { - new string_id("faction_recruiter", "bad_stuff_1"), - new string_id("faction_recruiter", "bad_stuff_2") - }; - public static final string_id SID_BUY_FACTION = new string_id("faction_recruiter", "buy_faction"); - public static final string_id SID_NO_FACTION_REB = new string_id("faction_recruiter", "no_faction_reb"); - public static final string_id SID_NO_FACTION_IMP = new string_id("faction_recruiter", "no_faction_imp"); - public static final string_id SID_NO_FACTION = new string_id("faction_recruiter", "no_faction"); - public static final string_id SID_YES_FACTION[] = - { - new string_id("faction_recruiter", "yes_faction_onek"), - new string_id("faction_recruiter", "yes_faction_tenk") - }; - public static final string_id SID_INTERESTED_FACTION_REB = new string_id("faction_recruiter", "interested_faction_reb"); - public static final string_id SID_INTERESTED_FACTION_IMP = new string_id("faction_recruiter", "interested_faction_imp"); - public static final string_id SID_GET_LOST_FACTION = new string_id("faction_recruiter", "get_lost_faction"); - public static final string_id SID_TOO_MUCH_FACTION = new string_id("faction_recruiter", "too_much_faction"); - public static final string_id SID_CHECKING_CREDIT = new string_id("faction_recruiter", "checking_credit"); - public static final string_id SID_BRIBE_FAIL = new string_id("faction_recruiter", "bribe_fail"); - public static final string_id SID_BRIBE_SUCCESS = new string_id("faction_recruiter", "bribe_success"); - - public static final string_id SID_RESIGN_FROM_FACTION = new string_id("faction_recruiter", "option_resign_from_faction"); - public static final string_id SID_RESCIND_RESIGNATION = new string_id("faction_recruiter", "option_recind_resignation"); - - public static final string_id SID_GO_DECLARED = new string_id("faction_recruiter", "option_go_declared"); - public static final string_id SID_GO_COVERT = new string_id("faction_recruiter", "option_go_covert"); - public static final string_id SID_SKILL_TRAINING = new string_id("faction_recruiter", "option_skill_training"); - public static final string_id SID_PURCHASE_ITEMS = new string_id("faction_recruiter", "option_purchase_items"); - public static final string_id SID_PURCHASE_FURNITURE = new string_id("faction_recruiter", "option_purchase_furniture"); - public static final string_id SID_PURCHASE_UNIFORMS = new string_id("faction_recruiter", "option_purchase_uniforms"); - public static final string_id SID_PURCHASE_WEAPONS_ARMOR = new string_id("faction_recruiter", "option_purchase_weapons_armor"); - public static final string_id SID_PURCHASE_INSTALLATION = new string_id("faction_recruiter", "option_purchase_installation"); - public static final string_id SID_PURCHASE_SCHEMATICS = new string_id("faction_recruiter", "option_purchase_schematics"); - public static final string_id SID_HIRELINGS = new string_id("faction_recruiter", "option_hirelings"); - public static final string_id SID_FACTION_ORDERS = new string_id("faction_recruiter", "option_faction_orders"); - public static final string_id SID_PROMOTION = new string_id("faction_recruiter", "option_promotion"); - - public static final string_id PROSE_REWARD = new string_id("faction_recruiter", "prose_reward"); - - public static final string_id SID_YOU_LACK_FACTION = new string_id("faction_recruiter", "you_lack_faction"); - public static final string_id SID_ALREADY_AT_CAP = new string_id("faction_recruiter", "already_at_cap"); - - public static final string_id SID_SUI_EXPERIENCE_TRAINING_TITLE = new string_id("faction_recruiter", "sui_experience_training_title"); - public static final string_id SID_SUI_EXPERIENCE_TRAINING_PROMPT = new string_id("faction_recruiter", "sui_experience_training_prompt"); - public static final string_id SID_SUI_EXPERIENCE_TRAINING_HEADER = new string_id("faction_recruiter", "sui_experience_training_header"); - - public static final String VAR_FACTION = "faction_recruiter.faction"; - public static final String VAR_PROGRESS = "faction_recruiter.progress"; - - public static final String VAR_GOING_COVERT = "faction_recruiter.going_covert"; - public static final String VAR_AVAILABLE_ITEMS = "faction_recruiter.available_items"; - public static final String VAR_GOING_OVERT_FACTION_ID = "faction_recruiter.factionId"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - - if (hasObjVar(self, VAR_FACTION)) - { - - if (!hasScript(self, "systems.gcw.gcw_data_updater")) - { - attachScript(self, "systems.gcw.gcw_data_updater"); - } - if (hasScript(self, "conversation.faction_recruiter_general")) - { - detachScript(self, "conversation.faction_recruiter_general"); - } - - String faction = getStringObjVar(self, VAR_FACTION); - - String strScript = "conversation.faction_recruiter_"+toLower(faction); - if (!hasScript(self, strScript)) - { - attachScript(self, strScript); - } - - int faction_id = getFactionId(faction); - - if (faction_id == 0) - { - LOG("LOG_CHANNEL", "faction_recruiter::OnAttach ("+ self + ") -- an NPC with no faction cannot be a recruiter"); - detachScript(self, faction_perk.SCRIPT_FACTION_RECRUITER); - } - else if (faction_id != getFactionId(factions.FACTION_REBEL) && faction_id != getFactionId(factions.FACTION_IMPERIAL)) - { - LOG("LOG_CHANNEL", "faction_recruiter::OnAttach ("+ self + ") -- a faction recruiter must be either of Rebel or Imperial faction."); - detachScript(self, faction_perk.SCRIPT_FACTION_RECRUITER); - } - else - { - pvpSetAlignedFaction(self, faction_id); - pvpMakeDeclared(self); - - if (faction_id == getFactionId(factions.FACTION_REBEL)) - { - setObjVar(self, "item.vendor.vendor_table", "gcw_rebel_recruiter_vendor"); - setObjVar(self, "item.token.type", gcw.GCW_REBEL_TOKEN); - attachScript(self, "npc.vendor.vendor"); - } - else if (faction_id == getFactionId(factions.FACTION_IMPERIAL)) - { - setObjVar(self, "item.vendor.vendor_table", "gcw_imperial_recruiter_vendor"); - setObjVar(self, "item.token.type", gcw.GCW_IMPERIAL_TOKEN); - attachScript(self, "npc.vendor.vendor"); - } - } - } - requestPreloadCompleteTrigger(self); - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (!hasScript(self, "systems.gcw.gcw_data_updater")) - { - attachScript(self, "systems.gcw.gcw_data_updater"); - } - if (hasScript(self, "conversation.faction_recruiter_general")) - { - detachScript(self, "conversation.faction_recruiter_general"); - } - String faction = getStringObjVar(self, VAR_FACTION); - - if ((!isMob(self)) || (isPlayer(self))) - { - detachScript(self, faction_perk.SCRIPT_FACTION_RECRUITER); - } - - String strScript = "conversation.faction_recruiter_"+toLower(faction); - if (!hasScript(self, strScript)) - { - attachScript(self, strScript); - } - - int rec_faction_id = pvpGetAlignedFaction(self); - if (rec_faction_id == 0) - { - if (hasObjVar(self, VAR_FACTION)) - { - int faction_id = getFactionId(faction); - - if (faction_id == 0) - { - LOG("LOG_CHANNEL", "faction_recruiter::OnInitialize ("+ self + ") -- an NPC with no faction cannot be a recruiter"); - detachScript(self, faction_perk.SCRIPT_FACTION_RECRUITER); - } - else if (faction_id != getFactionId(factions.FACTION_REBEL) && faction_id != getFactionId(factions.FACTION_IMPERIAL)) - { - LOG("LOG_CHANNEL", "faction_recruiter::OnInitialize ("+ self + ") -- a faction recruiter must be either of Rebel or Imperial faction."); - detachScript(self, faction_perk.SCRIPT_FACTION_RECRUITER); - } - else - { - pvpSetAlignedFaction(self, faction_id); - pvpMakeDeclared(self); - } - } - else - { - detachScript(self, faction_perk.SCRIPT_FACTION_RECRUITER); - } - } - - requestPreloadCompleteTrigger(self); - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - detachScript(self, faction_perk.SCRIPT_FACTION_RECRUITER); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - int mnu = mi.addRootMenu (menu_info_types.CONVERSE_START, null); - menu_info_data mdata = mi.getMenuItemById(mnu); - mdata.setServerNotify(false); - return SCRIPT_CONTINUE; - } - - - public int payBribe(obj_id self, dictionary params) throws InterruptedException - { - int rec_faction_id = pvpGetAlignedFaction(self); - String rec_faction = factions.getFactionNameByHashCode(rec_faction_id); - - obj_id player = params.getObjId( money.DICT_PLAYER_ID ); - int code = params.getInt( money.DICT_CODE ); - int amt = params.getInt( money.DICT_AMOUNT ); - if (code == money.RET_FAIL) - { - chat.chat( self, chat.CHAT_SAY, chat.MOOD_ANGRY, SID_BRIBE_FAIL ); - } - else - { - chat.chat( self, chat.CHAT_SAY, chat.MOOD_HAPPY, SID_BRIBE_SUCCESS ); - - if (amt == 20000) - { - factions.addFactionStanding( player, rec_faction, 250.f ); - } - else - { - factions.addFactionStanding( player, rec_faction, 1250.f ); - } - } - - obj_id topMost = getTopMostContainer(self); - if (isIdValid(topMost)) - { - int topGOT = getGameObjectType(topMost); - if (topGOT == GOT_building_factional) - { - money.bankTo(self, topMost, amt); - } - } - return SCRIPT_CONTINUE; - } - - - public prose_package createProsePackage(string_id sid, obj_id actor, obj_id target, String str, int number) throws InterruptedException - { - prose_package pp = new prose_package(); - pp.stringId = sid; - pp.actor.set(actor); - pp.target.set(target); - pp.other.set(str); - pp.digitInteger = number; - - return pp; - } - - - public int getFactionId(String faction) throws InterruptedException - { - if (faction == null) - { - return -1; - } - - int faction_num = factions.getFactionNumber(faction); - if (faction_num == -1) - { - return 0; - } - - int faction_id = dataTableGetInt("datatables/faction/faction.iff", faction_num, "pvpFaction"); - - return faction_id; - } - - - public String getProgressObjVarName(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - return null; - } - - return VAR_PROGRESS + "." + player.toString(); - } - - - public string_id[] getConversationResponses(obj_id player, obj_id npc, int progress) throws InterruptedException - { - LOG("LOG_CHANNEL", "faction_recruiter::getConversationResponses -- "+ progress); - - Vector responses = new Vector(); - responses.setSize(0); - int pvp_type = pvpGetType(player); - - obj_id self = getSelf(); - int faction_id = pvpGetAlignedFaction(self); - String faction = factions.getFactionNameByHashCode(faction_id); - - if (pvpGetAlignedFaction(player) == pvpGetAlignedFaction(npc) && hasObjVar(player, factions.VAR_RESIGNING)) - { - responses = utils.addElement(null, SID_RESCIND_RESIGNATION); - return (string_id[])responses.toArray(new string_id[0]); - } - - if (pvpGetType( player ) == PVPTYPE_NEUTRAL && progress == 3) - { - progress = 1; - } - - switch (progress) - { - case 1: - responses = utils.addElement(responses, SID_JOIN_FACTION); - break; - - case 3: - - responses = utils.addElement(responses, SID_PROMOTION); - - if (pvp_type == PVPTYPE_COVERT) - { - - responses = utils.addElement(responses, SID_GO_DECLARED); - } - else if (pvp_type == PVPTYPE_DECLARED) - { - - if (!hasObjVar(player, VAR_GOING_COVERT)) - { - responses = utils.addElement(responses, SID_GO_COVERT); - } - - responses = utils.addElement(responses, SID_HIRELINGS); - - } - - responses = utils.addElement(responses, SID_PURCHASE_ITEMS); - - responses = utils.addElement(responses, SID_SKILL_TRAINING); - - responses = utils.addElement(responses, SID_RESIGN_FROM_FACTION); - - break; - - case 4: - responses = utils.addElement(responses, SID_YES_TO_JOIN); - responses = utils.addElement(responses, SID_NO_TO_JOIN); - break; - - case 5: - responses = utils.addElement(responses, SID_YES_TO_SEE_OPTIONS); - responses = utils.addElement(responses, SID_NO_TO_SEE_OPTIONS); - break; - - case 6: - responses = utils.addElement(responses, SID_YES_TO_RESIGN); - responses = utils.addElement(responses, SID_NO_TO_RESIGN); - break; - - case 7: - responses = utils.addElement(responses, SID_YES_TO_GO_DECLARED); - responses = utils.addElement(responses, SID_NO_TO_GO_DECLARED); - break; - - case 8: - responses = utils.addElement(responses, SID_YES_TO_GO_COVERT); - responses = utils.addElement(responses, SID_NO_TO_GO_COVERT); - break; - - case 9: - responses = utils.addElement(responses, SID_PURCHASE_FURNITURE); - responses = utils.addElement(responses, SID_PURCHASE_WEAPONS_ARMOR); - responses = utils.addElement(responses, SID_PURCHASE_SCHEMATICS); - - if (pvp_type == PVPTYPE_DECLARED) - { - responses = utils.addElement(responses, SID_PURCHASE_INSTALLATION); - - if (!toLower(faction).equals("rebel")) - { - responses = utils.addElement(responses, SID_PURCHASE_UNIFORMS); - } - } - - break; - - case 10: - responses = utils.addElement(responses, SID_YES_TO_PROMOTION); - responses = utils.addElement(responses, SID_NO_TO_PROMOTION); - break; - - default: - responses = utils.addElement(responses, SID_NOTHING); - break; - } - - if (hasSkill( player, "class_smuggler_phase3_novice" )) - { - responses = utils.addElement( responses, SID_SELL_SECRETS ); - } - if (hasSkill( player, "class_smuggler_phase4_novice" )) - { - responses = utils.addElement( responses, SID_BUY_FACTION ); - } - - return (string_id[])responses.toArray(new string_id[0]); - } - - - public prose_package[] getProseConversationResponses(obj_id player, obj_id npc, String prose_string, int prose_digit, int progress) throws InterruptedException - { - LOG("LOG_CHANNEL", "faction_recruiter::getProseConversationResponses -- "+ progress); - - prose_package[] responses = new prose_package[0]; - - switch(progress) - { - case 2: - int faction_id = pvpGetAlignedFaction(npc); - String faction = factions.getFactionNameByHashCode(faction_id); - prose_package pp = prose.getPackage(SID_CHANGE_FACTION, faction); - responses = assemblePackageArray(responses, pp); - break; - } - - return responses; - } - - - public prose_package[] assemblePackageArray(prose_package[] array, prose_package element) throws InterruptedException - { - if (element == null) - { - return new prose_package[0]; - } - - if (array == null) - { - return assemblePackageArray(new prose_package[0], element); - } - - Vector vector = new Vector(Arrays.asList(array)); - vector.add(element); - - array = new prose_package[vector.size()]; - vector.toArray(array); - return array; - } - - - public int[] convertSecondsTime(int time) throws InterruptedException - { - if (time < 1) - { - return null; - } - - int mod_day = time % 86400; - int mod_hour = mod_day % 3600; - - int days = time / 86400; - int hours = mod_day / 3600; - int minutes = mod_hour / 60; - int seconds = mod_hour % 60; - - int[] converted_time = - { - days, hours, minutes, seconds - }; - - return converted_time; - } - - - public void invalidResponse(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - LOG("LOG_CHANNEL", "faction_recruiter::isFactionMember -- player is null"); - return; - } - - string_id[] responses = new string_id[0]; - npcSpeak(player, SID_INVALID_RESPONSE); - npcSetConversationResponses(player, responses); - - return; - } - - - public boolean displayTrainingSUI(obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - LOG("LOG_CHANNEL", "faction_recruiter::displayTrainingSUI -- player is null"); - return false; - } - - obj_id self = getSelf(); - - if (utils.hasScriptVar(self, player + ".training.pid")) - { - int oldpid = utils.getIntScriptVar(self, player + ".training.pid"); - sui.closeSUI(player, oldpid); - utils.removeScriptVarTree(self, player+".training"); - } - - String[] xp_types = dataTableGetStringColumn(DATATABLE_ALLOWED_XP_TYPES, "xp_type"); - if (xp_types == null || xp_types.length == 0) - { - return false; - } - - Vector names = new Vector(); - names.setSize(0); - for (int i = 0; i < xp_types.length; i++) - { - testAbortScript(); - names = utils.addElement(names, "@exp_n:"+xp_types[i]); - } - - if (names == null || names.size() == 0) - { - return false; - } - - int pid = sui.listbox(self, player, "@faction_recruiter:select_skill_type", sui.OK_CANCEL, "@faction_recruiter:faction_training", names, "msgFactionTrainingTypeSelected"); - if (pid > 0) - { - utils.setScriptVar(self, player + ".training.pid", pid); - } - - return true; - } - - - public int msgFactionItemPurchaseSelected(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = sui.getPlayerId(params); - if (!sui.outOfRange(self , player, 10.0f, true)) - { - faction_perk.factionItemPurchased(params); - } - return SCRIPT_CONTINUE; - } - - - public int msgFactionItemRankSelected(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - String scriptvar_path = "recruiter.item_rank."+ player; - String oldPidVar = scriptvar_path + ".pid"; - String ranksVar = scriptvar_path + ".ranks"; - - if (utils.hasScriptVar(self, oldPidVar)) - { - utils.removeScriptVar(self, oldPidVar); - } - - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int rankSelected = pvpGetCurrentGcwRank(player) - idx; - - int playerFactionId = pvpGetAlignedFaction(player); - String playerGcwFaction = factions.getFactionNameByHashCode(playerFactionId); - faction_perk.displayItemPurchaseSUI(player, rankSelected, playerGcwFaction, self); - - return SCRIPT_CONTINUE; - } - - - public int OnGiveItem(obj_id self, obj_id item, obj_id player) throws InterruptedException - { - if (hasScript( item, "systems.encoded_disk.base.message_assembled" )) - { - String entryName = getStringObjVar( item, "scenarioName"); - int faction_id = pvpGetAlignedFaction(self); - String faction = toLower(factions.getFactionNameByHashCode(faction_id)); - - String entry = "response_"+ entryName + "_"+ faction; - string_id res = new string_id( "encoded_disk/message_fragment", entry ); - String response = getString( res ); - if (response == null || response.equals("")) - { - return SCRIPT_CONTINUE; - } - - chat.chat( self, chat.CHAT_SAY, chat.MOOD_DISCREET, res ); - - int amt = rand( 500, 1500 ); - dictionary outparams = new dictionary(); - outparams.put( "amt", amt ); - outparams.put( "player", player ); - transferBankCreditsFromNamedAccount( money.ACCT_NPC_LOOT, self, amt, "fromAccountPass", "xferFail", outparams ); - utils.moneyInMetric(self, money.ACCT_NPC_LOOT, amt); - - int badgeIndex = getIntObjVar( item, "badgeIndex"); - String badgeName = getCollectionSlotName(badgeIndex); - if ((badgeIndex > 0) && (badgeName != null) && (badgeName.length() > 0)) - { - if (!badge.hasBadge( player, badgeName )) - { - - int factionReward = getIntObjVar( item, "factionReward"); - if (factionReward > 0) - { - - factions.awardFactionStanding( player, factions.getFactionNameByHashCode(faction_id), factionReward ); - } - - badge.grantBadge( player, badgeName ); - - logBalance( "eventReward;"+ faction + ";"+ player + ";"+ entryName ); - } - } - - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int xferFail(obj_id self, dictionary params) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int fromAccountPass(obj_id self, dictionary params) throws InterruptedException - { - - int amt = params.getInt( "amt"); - if (amt > 0) - { - withdrawCashFromBank( self, amt, "xferPass", "xferFail", params ); - } - - return SCRIPT_CONTINUE; - } - - - public int xferPass(obj_id self, dictionary params) throws InterruptedException - { - - int cash = getCashBalance( self ); - if (cash <= 0) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId( "player"); - transferCashTo( self, player, cash, "gaveReward", "xferFail", params ); - - return SCRIPT_CONTINUE; - } - - - public int gaveReward(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId( "player"); - int amt = params.getInt( "amt"); - prose_package pp = prose.getPackage( PROSE_REWARD, self, player, amt ); - sendSystemMessageProse( player, pp ); - - return SCRIPT_CONTINUE; - } - - - public int msgFactionTrainingTypeSelected(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - utils.removeScriptVar(self, player + ".training.pid"); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - return SCRIPT_CONTINUE; - } - - dictionary row = dataTableGetRow(factions.DATATABLE_ALLOWED_XP_TYPES, idx); - if (row == null || row.isEmpty()) - { - sendSystemMessage(player, factions.SID_INVALID_TRAINING_TYPE); - return SCRIPT_CONTINUE; - } - - String faction = factions.getFaction(self); - - int available = factions.getAvailableFactionPoints(player, faction); - if (available < 1) - { - sendSystemMessage(player, SID_YOU_LACK_FACTION); - return SCRIPT_CONTINUE; - } - - String xp_type = row.getString("xp_type"); - if (xp_type == null || xp_type.equals("")) - { - return SCRIPT_CONTINUE; - } - - string_id xp_name = new string_id("exp_n",xp_type); - if (xp_name == null) - { - return SCRIPT_CONTINUE; - } - - int ratioFrom = row.getInt("ratioFrom"); - int ratioTo = row.getInt("ratioTo"); - if (ratioFrom <= 0 || ratioTo <= 0) - { - return SCRIPT_CONTINUE; - } - - String title = utils.packStringId(SID_SUI_EXPERIENCE_TRAINING_TITLE); - prose_package ppSuiExpTrain = prose.getPackage(SID_SUI_EXPERIENCE_TRAINING_PROMPT); - prose.setTT(ppSuiExpTrain, xp_name); - prose.setDI(ppSuiExpTrain, ratioFrom); - if (ratioTo == 1) - { - prose.setTO(ppSuiExpTrain, ""); - } - else - { - prose.setTO(ppSuiExpTrain, ""+ ratioTo); - } - String prompt = " \0"+ packOutOfBandProsePackage(null, ppSuiExpTrain); - - int pid = sui.transfer(self, player, prompt, title, utils.packStringId(SID_SUI_EXPERIENCE_TRAINING_HEADER), available, "Experience", 0, "msgFactionTrainingAmountSelected", ratioFrom, ratioTo); - if (pid > -1) - { - utils.setScriptVar(self, player + ".training.pid", pid); - utils.setScriptVar(self, player + ".training.idx", idx); - - float ratio = ratioFrom/ratioTo; - utils.setScriptVar(self, player + ".training.ratio", ratio); - } - - return SCRIPT_CONTINUE; - } - - - public int msgFactionTrainingAmountSelected(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int idx = utils.getIntScriptVar(self, player + ".training.idx"); - float ratio = utils.getFloatScriptVar(self, player+".training.ratio"); - utils.removeScriptVarTree(self, player + ".training"); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int amt = sui.getTransferInputTo(params); - if (amt < 1) - { - return SCRIPT_CONTINUE; - } - - String xp_type = dataTableGetString(factions.DATATABLE_ALLOWED_XP_TYPES, idx, "xp_type"); - if (xp_type == null || xp_type.equals("")) - { - return SCRIPT_CONTINUE; - } - - String faction = factions.getFaction(self); - - int cost = Math.round(amt/ratio); - int available = factions.getAvailableFactionPoints(player, faction); - if (cost > available) - { - prose_package pp = prose.getPackage(factions.SID_NOT_ENOUGH_STANDING_SPEND, faction, (int)factions.FACTION_RATING_DECLARABLE_MIN); - sendSystemMessageProse(player, pp); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("faction_perk", "("+ player + ")"+ getName(player) + " is attempting to purchase "+ amt + " "+ xp_type + " xp @ cost of "+ cost + " "+ faction + " fp"); - - dictionary resultData = new dictionary(); - resultData.put("player", player); - resultData.put("xp_type", xp_type); - resultData.put("amt", amt); - resultData.put("ratio", ratio); - resultData.put("faction", faction); - if (!xp.grantUnmodifiedExperience(player, xp_type, amt, "msgFactionTrainingAmountSelectedXpResult", resultData)) - { - CustomerServiceLog("faction_perk", "("+ player + ")"+ getName(player) + " xp purchase aborted! already at xp cap for type: "+ xp_type +"!"); - - string_id xp_name = new string_id("exp_n",xp_type); - if (xp_name == null) - { - return SCRIPT_CONTINUE; - } - prose_package ppAtCap = prose.getPackage(SID_ALREADY_AT_CAP); - prose.setTO(ppAtCap, xp_name); - sendSystemMessageProse(player, ppAtCap); - } - return SCRIPT_CONTINUE; - } - - - public int msgFactionTrainingAmountSelectedXpResult(obj_id self, dictionary params) throws InterruptedException - { - int granted = params.getInt(xp.GRANT_XP_RESULT_VALUE); - dictionary data = params.getDictionary(xp.GRANT_XP_RETURN_DATA); - obj_id player = data.getObjId("player"); - String xp_type = data.getString("xp_type"); - int amt = data.getInt("amt"); - float ratio = data.getFloat("ratio"); - String faction = data.getString("faction"); - - if (granted <= 0) - { - CustomerServiceLog("faction_perk", "("+ player + ")"+ getName(player) + " xp purchase aborted! already at xp cap for type: "+ xp_type +"!"); - - string_id xp_name = new string_id("exp_n",xp_type); - if (xp_name == null) - { - return SCRIPT_CONTINUE; - } - prose_package ppAtCap = prose.getPackage(SID_ALREADY_AT_CAP); - prose.setTO(ppAtCap, xp_name); - sendSystemMessageProse(player, ppAtCap); - return SCRIPT_CONTINUE; - } - - int cost = Math.round(amt/ratio); - if (granted != amt) - { - - cost = Math.round(granted/ratio); - } - - if (factions.addFactionStanding(player, faction, -cost)) - { - CustomerServiceLog("faction_perk", "("+ player + ")"+ getName(player) + " fp->xp purchase complete: "+cost+"fp->"+granted+"xp of "+xp_type); - } - else - { - CustomerServiceLog("faction_perk", "("+ player + ")"+ getName(player) + " fp->xp purchase failed! revoking xp"); - grantExperiencePoints(player, xp_type, -amt); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_01.java b/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_01.java deleted file mode 100644 index e54e7fa8c..000000000 --- a/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_01.java +++ /dev/null @@ -1,94 +0,0 @@ -package script.npc.jawa_traders; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.factions; -import script.library.chat; -import script.library.utils; -import script.library.ai_lib; -import script.library.locations; -import script.library.money; -import script.library.quests; -import script.library.skill; -import script.library.sui; -import script.library.prose; -import script.library.luck; -import script.library.static_item; -import script.library.smuggler; - - -public class jawa_trader_01 extends script.base_script -{ - public jawa_trader_01() - { - } - public static final String FACETO_VOLUME_NAME = "faceToTriggerVolume"; - public static final String CONVO = "jawa_trader"; - - public static final String TBL = "datatables/npc/junk_dealer/junk_dealer.iff"; - - public static final String SCRIPTVAR_JUNK_SUI = "relicdealer.biogenic.sui"; - public static final String SCRIPTVAR_JUNK_IDS = "relicdealer.biogenic.ids"; - public static final String SCRIPTVAR_SOLD = "soldAsJunk"; - - public static final String STF = "loot_dealer"; - - public static final string_id PROSE_NO_BUY = new string_id(STF, "prose_no_buy"); - public static final string_id PROSE_NO_BUY_ALL = new string_id(STF, "prose_no_buy_all"); - public static final string_id PROSE_SOLD_JUNK = new string_id(STF, "prose_sold_junk"); - public static final string_id PROSE_NO_SALE = new string_id(STF, "prose_no_sale"); - public static final string_id PROSE_SOLD_ALL_JUNK = new string_id(STF, "prose_sold_all_junk"); - public static final string_id PROSE_NO_ALL_SALE = new string_id(STF, "prose_no_all_sale"); - public static final string_id PROSE_JUNK_SOLD = new string_id(STF, "prose_junk_sold"); - - public static final string_id MENU_SELL = new string_id("junk_dealer", "mnu_sell_junk"); - public static final String SELL_TITLE = "@"+ STF + ":sell_title"; - public static final String SELL_PROMPT = "@"+ STF + ":sell_prompt"; - public static final String NO_ITEMS_PROMPT = "@"+ STF + ":no_items"; - public static final String BTN_SELL = "@"+ STF + ":btn_sell"; - public static final String BTN_SELL_ALL = "@"+ STF + ":btn_sell_all"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL ); - setInvulnerable (self, true); - createTriggerVolume( FACETO_VOLUME_NAME, 8.0f, true ); - setName ( self, "Ribbo Qua`lu (a Jawa Trader)"); - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - if (!isPlayer( breacher )) - { - - return SCRIPT_CONTINUE; - } - - if (!volumeName.equals(FACETO_VOLUME_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (isInNpcConversation(self)) - { - return SCRIPT_CONTINUE; - } - - if (canSee( self, breacher )) - { - faceTo( self, breacher ); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_02.java b/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_02.java deleted file mode 100644 index bd20e333e..000000000 --- a/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_02.java +++ /dev/null @@ -1,94 +0,0 @@ -package script.npc.jawa_traders; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.factions; -import script.library.chat; -import script.library.utils; -import script.library.ai_lib; -import script.library.locations; -import script.library.money; -import script.library.quests; -import script.library.skill; -import script.library.sui; -import script.library.prose; -import script.library.luck; -import script.library.static_item; -import script.library.smuggler; - - -public class jawa_trader_02 extends script.base_script -{ - public jawa_trader_02() - { - } - public static final String FACETO_VOLUME_NAME = "faceToTriggerVolume"; - public static final String CONVO = "jawa_trader"; - - public static final String TBL = "datatables/npc/junk_dealer/junk_dealer.iff"; - - public static final String SCRIPTVAR_JUNK_SUI = "relicdealer.biogenic.sui"; - public static final String SCRIPTVAR_JUNK_IDS = "relicdealer.biogenic.ids"; - public static final String SCRIPTVAR_SOLD = "soldAsJunk"; - - public static final String STF = "loot_dealer"; - - public static final string_id PROSE_NO_BUY = new string_id(STF, "prose_no_buy"); - public static final string_id PROSE_NO_BUY_ALL = new string_id(STF, "prose_no_buy_all"); - public static final string_id PROSE_SOLD_JUNK = new string_id(STF, "prose_sold_junk"); - public static final string_id PROSE_NO_SALE = new string_id(STF, "prose_no_sale"); - public static final string_id PROSE_SOLD_ALL_JUNK = new string_id(STF, "prose_sold_all_junk"); - public static final string_id PROSE_NO_ALL_SALE = new string_id(STF, "prose_no_all_sale"); - public static final string_id PROSE_JUNK_SOLD = new string_id(STF, "prose_junk_sold"); - - public static final string_id MENU_SELL = new string_id("junk_dealer", "mnu_sell_junk"); - public static final String SELL_TITLE = "@"+ STF + ":sell_title"; - public static final String SELL_PROMPT = "@"+ STF + ":sell_prompt"; - public static final String NO_ITEMS_PROMPT = "@"+ STF + ":no_items"; - public static final String BTN_SELL = "@"+ STF + ":btn_sell"; - public static final String BTN_SELL_ALL = "@"+ STF + ":btn_sell_all"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL ); - setInvulnerable (self, true); - createTriggerVolume( FACETO_VOLUME_NAME, 8.0f, true ); - setName ( self, "Nolar Fe`li (a Jawa Trader)"); - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - if (!isPlayer( breacher )) - { - - return SCRIPT_CONTINUE; - } - - if (!volumeName.equals(FACETO_VOLUME_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (isInNpcConversation(self)) - { - return SCRIPT_CONTINUE; - } - - if (canSee( self, breacher )) - { - faceTo( self, breacher ); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_03.java b/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_03.java deleted file mode 100644 index eec946393..000000000 --- a/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_03.java +++ /dev/null @@ -1,95 +0,0 @@ -package script.npc.jawa_traders; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.factions; -import script.library.chat; -import script.library.utils; -import script.library.ai_lib; -import script.library.locations; -import script.library.money; -import script.library.quests; -import script.library.skill; -import script.library.sui; -import script.library.prose; -import script.library.luck; -import script.library.static_item; -import script.library.smuggler; - - -public class jawa_trader_03 extends script.base_script -{ - public jawa_trader_03() - { - } - public static final String FACETO_VOLUME_NAME = "faceToTriggerVolume"; - public static final String CONVO = "jawa_trader"; - - public static final String TBL = "datatables/npc/junk_dealer/junk_dealer.iff"; - - public static final String SCRIPTVAR_JUNK_SUI = "relicdealer.biogenic.sui"; - public static final String SCRIPTVAR_JUNK_IDS = "relicdealer.biogenic.ids"; - public static final String SCRIPTVAR_SOLD = "soldAsJunk"; - - public static final String STF = "loot_dealer"; - - public static final string_id PROSE_NO_BUY = new string_id(STF, "prose_no_buy"); - public static final string_id PROSE_NO_BUY_ALL = new string_id(STF, "prose_no_buy_all"); - public static final string_id PROSE_SOLD_JUNK = new string_id(STF, "prose_sold_junk"); - public static final string_id PROSE_NO_SALE = new string_id(STF, "prose_no_sale"); - public static final string_id PROSE_SOLD_ALL_JUNK = new string_id(STF, "prose_sold_all_junk"); - public static final string_id PROSE_NO_ALL_SALE = new string_id(STF, "prose_no_all_sale"); - public static final string_id PROSE_JUNK_SOLD = new string_id(STF, "prose_junk_sold"); - - public static final string_id MENU_SELL = new string_id("junk_dealer", "mnu_sell_junk"); - public static final String SELL_TITLE = "@"+ STF + ":sell_title"; - public static final String SELL_PROMPT = "@"+ STF + ":sell_prompt"; - public static final String NO_ITEMS_PROMPT = "@"+ STF + ":no_items"; - public static final String BTN_SELL = "@"+ STF + ":btn_sell"; - public static final String BTN_SELL_ALL = "@"+ STF + ":btn_sell_all"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL ); - setInvulnerable (self, true); - createTriggerVolume( FACETO_VOLUME_NAME, 8.0f, true ); - setName ( self, "Meso Laloo (a Jawa Trader)"); - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - if (!isPlayer( breacher )) - { - - return SCRIPT_CONTINUE; - } - - if (!volumeName.equals(FACETO_VOLUME_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (isInNpcConversation(self)) - { - return SCRIPT_CONTINUE; - } - - if (canSee( self, breacher )) - { - faceTo( self, breacher ); - } - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_bounty.java b/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_bounty.java deleted file mode 100644 index 42a0aae99..000000000 --- a/sku.0/sys.server/compiled/game/script/npc/jawa_traders/jawa_trader_bounty.java +++ /dev/null @@ -1,94 +0,0 @@ -package script.npc.jawa_traders; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.factions; -import script.library.chat; -import script.library.utils; -import script.library.ai_lib; -import script.library.locations; -import script.library.money; -import script.library.quests; -import script.library.skill; -import script.library.sui; -import script.library.prose; -import script.library.luck; -import script.library.static_item; -import script.library.smuggler; - - -public class jawa_trader_bounty extends script.base_script -{ - public jawa_trader_bounty() - { - } - public static final String FACETO_VOLUME_NAME = "faceToTriggerVolume"; - public static final String CONVO = "jawa_trader"; - - public static final String TBL = "datatables/npc/junk_dealer/junk_dealer.iff"; - - public static final String SCRIPTVAR_JUNK_SUI = "relicdealer.biogenic.sui"; - public static final String SCRIPTVAR_JUNK_IDS = "relicdealer.biogenic.ids"; - public static final String SCRIPTVAR_SOLD = "soldAsJunk"; - - public static final String STF = "loot_dealer"; - - public static final string_id PROSE_NO_BUY = new string_id(STF, "prose_no_buy"); - public static final string_id PROSE_NO_BUY_ALL = new string_id(STF, "prose_no_buy_all"); - public static final string_id PROSE_SOLD_JUNK = new string_id(STF, "prose_sold_junk"); - public static final string_id PROSE_NO_SALE = new string_id(STF, "prose_no_sale"); - public static final string_id PROSE_SOLD_ALL_JUNK = new string_id(STF, "prose_sold_all_junk"); - public static final string_id PROSE_NO_ALL_SALE = new string_id(STF, "prose_no_all_sale"); - public static final string_id PROSE_JUNK_SOLD = new string_id(STF, "prose_junk_sold"); - - public static final string_id MENU_SELL = new string_id("junk_dealer", "mnu_sell_junk"); - public static final String SELL_TITLE = "@"+ STF + ":sell_title"; - public static final String SELL_PROMPT = "@"+ STF + ":sell_prompt"; - public static final String NO_ITEMS_PROMPT = "@"+ STF + ":no_items"; - public static final String BTN_SELL = "@"+ STF + ":btn_sell"; - public static final String BTN_SELL_ALL = "@"+ STF + ":btn_sell_all"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL ); - setInvulnerable (self, true); - createTriggerVolume( FACETO_VOLUME_NAME, 8.0f, true ); - setName ( self, "Hibli Bet`ario (a Jawa Trader)"); - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - if (!isPlayer( breacher )) - { - - return SCRIPT_CONTINUE; - } - - if (!volumeName.equals(FACETO_VOLUME_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (isInNpcConversation(self)) - { - return SCRIPT_CONTINUE; - } - - if (canSee( self, breacher )) - { - faceTo( self, breacher ); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/npc/vendor/object_for_sale.java b/sku.0/sys.server/compiled/game/script/npc/vendor/object_for_sale.java deleted file mode 100644 index 133703445..000000000 --- a/sku.0/sys.server/compiled/game/script/npc/vendor/object_for_sale.java +++ /dev/null @@ -1,497 +0,0 @@ -package script.npc.vendor; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.factions; -import script.library.money; -import script.library.prose; -import script.library.static_item; -import script.library.township; -import script.library.trial; -import script.library.utils; - - -public class object_for_sale extends script.base_script -{ - public object_for_sale() - { - } - public static final String VENDOR_TOKEN_TYPE = "item.token.type"; - public static final string_id SID_INV_FULL = new string_id("spam", "npc_vendor_player_inv_full"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, township.OBJECT_FOR_SALE_ON_VENDOR, true); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item == menu_info_types.ITEM_PUBLIC_CONTAINER_USE1) - { - if (hasObjVar(self, "faction_recruiter.faction")) - { - - if (!factions.isInFriendlyFaction(player, self)) - { - sendSystemMessage(player, new string_id("spam", "wrong_faction")); - return SCRIPT_OVERRIDE; - } - } - if (!confirmInventory(self, player)) - { - return SCRIPT_OVERRIDE; - } - - if (confirmFunds(self, player)) - { - processItemPurchase(self, player); - } - else - { - sendSystemMessage(player, new string_id("spam", "buildabuff_nsf_buffee")); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - if (names == null || attribs == null || names.length != attribs.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - final int firstFreeIndex = getFirstFreeIndex(names); - if (firstFreeIndex >= 0 && firstFreeIndex < names.length) - { - names[firstFreeIndex] = utils.packStringId( new string_id ( "set_bonus", "vendor_cost")); - attribs[firstFreeIndex] = createPureConcatenatedJoy(self); - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public String createPureConcatenatedJoy(obj_id self) throws InterruptedException - { - - String pureConcatenatedJoy = getString(new string_id("set_bonus", "vendor_sale_object_justify_line")); - - int creditCost = 0; - int tokenArrayLength = 0; - - creditCost = getIntObjVar(self, "item.object_for_sale.cash_cost"); - int[] tokenCost = getIntArrayObjVar(self, "item.object_for_sale.token_cost"); - - if (!hasObjVar(self, VENDOR_TOKEN_TYPE)) - { - - if (tokenCost.length > trial.HEROIC_TOKENS.length) - { - tokenArrayLength = trial.HEROIC_TOKENS.length; - } - else if (tokenCost.length > 0) - { - tokenArrayLength = tokenCost.length; - } - - for (int i = 0; i < tokenArrayLength; i++) - { - testAbortScript(); - if (tokenCost[i] > 0) - { - pureConcatenatedJoy += "["+tokenCost[i] + "] "+ getString(new string_id("static_item_n", trial.HEROIC_TOKENS[i])) +"\n"; - } - } - } - - else - { - String tokenList = getStringObjVar(self, VENDOR_TOKEN_TYPE); - String[] differentTokens = split(tokenList, ','); - - if (tokenCost.length > differentTokens.length) - { - tokenArrayLength = differentTokens.length; - } - else if (tokenCost.length > 0) - { - tokenArrayLength = tokenCost.length; - } - - for (int i = 0; i < tokenArrayLength; i++) - { - testAbortScript(); - if (tokenCost[i] > 0) - { - pureConcatenatedJoy += "["+tokenCost[i] + "] "+ getString(new string_id("static_item_n", differentTokens[i])) +"\n"; - } - } - } - - if (creditCost > 0) - { - pureConcatenatedJoy += creditCost + getString(new string_id("set_bonus", "vendor_credits")); - } - - return pureConcatenatedJoy; - } - - - public boolean confirmInventory(obj_id self, obj_id player) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - - if (!isValidId(pInv) || !exists(pInv)) - { - return false; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessage(player, SID_INV_FULL); - return false; - } - return true; - } - - - public boolean confirmFunds(obj_id self, obj_id player) throws InterruptedException - { - boolean canPay = false; - boolean hasTheCredits = false; - boolean hasTheTokens = false; - boolean foundTokenHolderBox = false; - - obj_id[] inventoryContents = getInventoryAndEquipment(player); - - int creditCost = getIntObjVar(self, "item.object_for_sale.cash_cost"); - int[] tokenCostInThisFunction = getIntArrayObjVar(self, "item.object_for_sale.token_cost"); - - if (creditCost < 1) - { - hasTheCredits = true; - } - - if (creditCost >= 1) - { - if (money.hasFunds(player, money.MT_TOTAL, creditCost)) - { - hasTheCredits = true; - } - } - - int owedTokenCount = 0; - boolean owesTokens = false; - for (int o = 0; o < tokenCostInThisFunction.length; o++) - { - testAbortScript(); - owedTokenCount += tokenCostInThisFunction[o]; - } - - if (owedTokenCount > 0) - { - owesTokens = true; - } - - if (owesTokens) - { - for (int i = 0; i < inventoryContents.length; i++) - { - testAbortScript(); - String itemName = getStaticItemName(inventoryContents[i]); - if (itemName != null && !itemName.equals("")) - { - - if (hasObjVar(self, VENDOR_TOKEN_TYPE)) - { - String tokenList = getStringObjVar(self, VENDOR_TOKEN_TYPE); - String[] differentTokens = split(tokenList, ','); - - for (int j = 0; j < differentTokens.length; j++) - { - testAbortScript(); - if (itemName.equals(differentTokens[j]) && tokenCostInThisFunction[j] > 0) - { - if (getCount(inventoryContents[i]) > 1) - { - - for (int m = 0; m < getCount(inventoryContents[i]); m++) - { - testAbortScript(); - if (tokenCostInThisFunction[j] > 0) - { - tokenCostInThisFunction[j]--; - } - } - } - else - { - tokenCostInThisFunction[j]--; - } - } - } - } - else - { - - for (int j = 0; j < trial.HEROIC_TOKENS.length; j++) - { - testAbortScript(); - if (itemName.equals(trial.HEROIC_TOKENS[j]) && tokenCostInThisFunction[j] > 0) - { - if (getCount(inventoryContents[i]) > 1) - { - - for (int m = 0; m < getCount(inventoryContents[i]); m++) - { - testAbortScript(); - if (tokenCostInThisFunction[j] > 0) - { - tokenCostInThisFunction[j]--; - } - } - } - else - { - tokenCostInThisFunction[j]--; - } - } - } - - if (!foundTokenHolderBox && itemName.equals("item_heroic_token_box_01_01")) - { - foundTokenHolderBox = true; - - if (hasObjVar(inventoryContents[i], "item.set.tokens_held")) - { - int[] virtualTokens = getIntArrayObjVar(inventoryContents[i], "item.set.tokens_held"); - for (int k = 0; k < trial.HEROIC_TOKENS.length; k++) - { - testAbortScript(); - if (tokenCostInThisFunction[k] > 0 && virtualTokens[k] > 0) - { - - int paymentIterations = tokenCostInThisFunction[k]; - for (int l = 0; l < paymentIterations; l++) - { - testAbortScript(); - if (virtualTokens[k] > 0) - { - virtualTokens[k]--; - tokenCostInThisFunction[k]--; - } - } - } - } - } - } - } - } - } - } - - int outstandingTokensOwed = 0; - for (int n = 0; n < tokenCostInThisFunction.length; n++) - { - testAbortScript(); - outstandingTokensOwed += tokenCostInThisFunction[n]; - } - - if (outstandingTokensOwed == 0) - { - hasTheTokens = true; - } - - return hasTheCredits && hasTheTokens; - } - - - public void processItemPurchase(obj_id self, obj_id player) throws InterruptedException - { - obj_id inventory = utils.getInventoryContainer(player); - obj_id[] inventoryContents = getInventoryAndEquipment(player); - - int creditCost = getIntObjVar(self, "item.object_for_sale.cash_cost"); - int[] tokenCostForReals = getIntArrayObjVar(self, "item.object_for_sale.token_cost"); - - String myName = static_item.getStaticItemName(self); - - obj_id purchasedItem = static_item.createNewItemFunction(myName, inventory); - - if (hasScript(purchasedItem, "npc.faction_recruiter.biolink_item")) - { - setBioLink(purchasedItem, player); - } - - CustomerServiceLog("Heroic-Token: ", "player "+ getFirstName(player) + "("+ player + ") purchased item "+ myName + "("+ purchasedItem + ")"); - - if (!exists(purchasedItem)) - { - sendSystemMessage(player, new string_id("set_bonus", "vendor_cant_purchase")); - return; - } - - String readableName = getString(parseNameToStringId(getName(self), self)); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("set_bonus", "vendor_item_purchased")); - pp = prose.setTT(pp, readableName); - sendSystemMessageProse(player, pp); - - if (creditCost >= 1) - { - - obj_id containedBy = getContainedBy(getContainedBy(getContainedBy(self))); - money.requestPayment(player, containedBy, creditCost, "no_handler", null, false); - } - - boolean foundTokenHolderBox = false; - - for (int i = 0; i < inventoryContents.length; i++) - { - testAbortScript(); - String itemName = getStaticItemName(inventoryContents[i]); - if (itemName != null && !itemName.equals("")) - { - - if (hasObjVar(self, VENDOR_TOKEN_TYPE)) - { - String tokenList = getStringObjVar(self, VENDOR_TOKEN_TYPE); - String[] differentTokens = split(tokenList, ','); - - for (int j = 0; j < differentTokens.length; j++) - { - testAbortScript(); - if (itemName.equals(differentTokens[j]) && tokenCostForReals[j] > 0) - { - if (getCount(inventoryContents[i]) > 1) - { - int numInStack = getCount(inventoryContents[i]); - - for (int m = 0; m < numInStack-1; m++) - { - testAbortScript(); - if (tokenCostForReals[j] > 0) - { - tokenCostForReals[j]--; - setCount(inventoryContents[i], getCount(inventoryContents[i]) - 1); - } - } - - } - - if (getCount(inventoryContents[i]) <= 1 && tokenCostForReals[j] > 0) - { - destroyObject(inventoryContents[i]); - tokenCostForReals[j]--; - } - } - } - } - else - { - - for (int j = 0; j < trial.HEROIC_TOKENS.length; j++) - { - testAbortScript(); - if (itemName.equals(trial.HEROIC_TOKENS[j]) && tokenCostForReals[j] > 0) - { - if (getCount(inventoryContents[i]) > 1) - { - int numInStack = getCount(inventoryContents[i]); - - for (int m = 0; m < numInStack-1; m++) - { - testAbortScript(); - if (tokenCostForReals[j] > 0) - { - tokenCostForReals[j]--; - setCount(inventoryContents[i], getCount(inventoryContents[i]) - 1); - } - } - - } - - if (getCount(inventoryContents[i]) <= 1 && tokenCostForReals[j] > 0) - { - destroyObject(inventoryContents[i]); - tokenCostForReals[j]--; - } - } - } - - if (!foundTokenHolderBox && itemName.equals("item_heroic_token_box_01_01")) - { - foundTokenHolderBox = true; - - if (hasObjVar(inventoryContents[i], "item.set.tokens_held")) - { - int[] virtualTokens = getIntArrayObjVar(inventoryContents[i], "item.set.tokens_held"); - for (int k = 0; k < trial.HEROIC_TOKENS.length; k++) - { - testAbortScript(); - if (tokenCostForReals[k] > 0 && virtualTokens[k] > 0) - { - - int paymentCounter = tokenCostForReals[k]; - for (int l = 0; l < paymentCounter; l++) - { - testAbortScript(); - if (virtualTokens[k] > 0) - { - virtualTokens[k]--; - tokenCostForReals[k]--; - } - } - } - } - setObjVar(inventoryContents[i], "item.set.tokens_held", virtualTokens); - } - } - } - - } - } - - return; - } - - - public string_id parseNameToStringId(String itemName, obj_id item) throws InterruptedException - { - String[] parsedString = split(itemName, ':'); - - string_id itemNameSID; - - if (static_item.isStaticItem(item)) - { - itemNameSID = static_item.getStaticItemStringIdName(item); - } - - else if (parsedString.length > 1) - { - String stfFile = parsedString[0]; - String reference = parsedString[1]; - itemNameSID = new string_id(stfFile, reference); - } - else - { - String stfFile = parsedString[0]; - itemNameSID = new string_id(stfFile, " "); - } - - return itemNameSID; - - } -} diff --git a/sku.0/sys.server/compiled/game/script/object/autostack.java b/sku.0/sys.server/compiled/game/script/object/autostack.java deleted file mode 100644 index 67424b0ae..000000000 --- a/sku.0/sys.server/compiled/game/script/object/autostack.java +++ /dev/null @@ -1,365 +0,0 @@ -package script.object; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.loot; -import script.library.utils; -import script.library.sui; -import script.library.static_item; - - -public class autostack extends script.base_script -{ - public autostack() - { - } - public static final boolean BLOGGING_ON = false; - public static final String BLOGGING_CATEGORY = "auto_stack"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - - messageTo(self, "msgStackItem", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public int OnTransferred(obj_id self, obj_id sourceContainer, obj_id destContainer, obj_id transferer) throws InterruptedException - { - - if (getGameObjectType(destContainer) != GOT_misc_factory_crate) - { - blog("Sending Stack messageTo msgStackItem"); - messageTo(self, "msgStackItem", null, 1, false); - - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!canRestack(self)) - { - return SCRIPT_CONTINUE; - } - - if (getCount(self) > 1) - { - mi.addRootMenu (menu_info_types.SERVER_MENU49, new string_id("autostack","unstack")); - menu_info_data mid = mi.getMenuItemByType(menu_info_types.SERVER_MENU49); - if (mid == null) - { - return SCRIPT_CONTINUE; - } - else - { - mid.setServerNotify(true); - } - } - - mi.addRootMenu (menu_info_types.SERVER_MENU50, new string_id("autostack","stack")); - menu_info_data mid = mi.getMenuItemByType(menu_info_types.SERVER_MENU50); - if (mid == null) - { - return SCRIPT_CONTINUE; - } - else - { - mid.setServerNotify(true); - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!canRestack(self)) - { - return SCRIPT_CONTINUE; - } - - if (getCount(self) > 1) - { - if (item == menu_info_types.SERVER_MENU49) - { - unstackIt(self, player); - } - } - - if (item == menu_info_types.SERVER_MENU50) - { - utils.removeScriptVar( player, "autostack.ignoreitems"); - restackIt( self ); - } - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int free = getFirstFreeIndex(names); - if (free == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - int numInStack = getCount(self); - names[free] = "num_in_stack"; - attribs[free] = "" + numInStack; - return super.OnGetAttributes(self, player, names, attribs); - } - - - public boolean canRestack(obj_id self) throws InterruptedException - { - blog("canRestack init"); - if (isInSecureTrade(self)) - { - blog("isInSecureTrade"); - return false; - } - - obj_id containerObject = utils.getContainingPlayer(self); - if (!isIdValid(containerObject)) - { - if (!isContainerValidForStacking(self)) - { - return false; - } - - blog("containerObject is okay to use"); - containerObject = getContainedBy(self); - } - - blog("containerObject is valid"); - return true; - } - - - public void restackIt(obj_id self) throws InterruptedException - { - blog("restackIt init"); - - if (!isIdValid(self) || !exists(self)) - { - return; - } - - blog("restackIt validation complete"); - - if (isInSecureTrade(self)) - { - return; - } - - blog("restackIt - not isInSecureTrade"); - - obj_id containerObject = utils.getContainingPlayer(self); - if (!isIdValid(containerObject)) - { - blog("restackIt - not a player container"); - if (!isContainerValidForStacking(self)) - { - return; - } - - blog("restackIt - containerObject = getContainedBy"); - containerObject = getContainedBy(self); - } - - blog("restackIt - containerObject = valid"); - if (utils.hasScriptVar(containerObject, "autostack.ignoreitems")) - { - return; - } - obj_id item = loot.findItemToStack(self); - - if (isIdValid(item) && !isInSecureTrade(item)) - { - if (utils.hasScriptVar(self, "unstacking") || utils.hasScriptVar(item, "unstacking")) - { - return; - } - - if (item != self) - { - loot.stackItem(self, item); - if (!hasScript(item, "object.autostack")) - { - attachScript(item, "object.autostack"); - } - } - } - } - - - public void unstackIt(obj_id self, obj_id player) throws InterruptedException - { - if (!isInSecureTrade(self)) - { - if (getCount( self ) == 2) - { - createNewStack( player, self, 1, 2); - utils.setScriptVar(self, "unstacking", 1); - messageTo(self, "clearUnstackingScriptVar", null, 3, false); - - } - else - { - sui.inputbox(self, player, "@autostack:stacksize", "msgUnstackItem"); - } - } - } - - - public int msgStackItem(obj_id self, dictionary params) throws InterruptedException - { - blog("msgStackItem init"); - restackIt( self ); - return SCRIPT_CONTINUE; - } - - - public int clearUnstackingScriptVar(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar(self, "unstacking"); - return SCRIPT_CONTINUE; - } - - - public int msgUnstackItem(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!canRestack(self)) - { - return SCRIPT_CONTINUE; - } - - String amount_str = sui.getInputBoxText(params); - if (amount_str == null || amount_str.equals("")) - { - - return SCRIPT_CONTINUE; - } - - int oldStackSize = getCount( self ); - int newStackSize = utils.stringToInt(amount_str); - if (newStackSize == 0) - { - sendSystemMessage( player, new string_id( "autostack", "zero_size")); - return SCRIPT_CONTINUE; - } - else if (newStackSize < 0) - { - sendSystemMessage( player, new string_id( "autostack", "number_format_wrong")); - return SCRIPT_CONTINUE; - } - else if (newStackSize > oldStackSize) - { - sendSystemMessage( player, new string_id( "autostack", "too_big")); - return SCRIPT_CONTINUE; - } - else if (newStackSize == oldStackSize) - { - return SCRIPT_CONTINUE; - } - - createNewStack( player, self, newStackSize, oldStackSize ); - utils.setScriptVar(self, "unstacking", 1); - messageTo(self, "clearUnstackingScriptVar", null, 3, false); - - return SCRIPT_CONTINUE; - } - - - public void createNewStack(obj_id player, obj_id item, int newStackSize, int oldStackSize) throws InterruptedException - { - obj_id container = getContainedBy(item); - if (!isIdValid(container)) - { - sendSystemMessage( player, new string_id( "autostack", "bad_container")); - return; - } - - if (getVolumeFree(container) <= 0) - { - sendSystemMessage( player, new string_id( "autostack", "full_container")); - return; - } - - utils.setScriptVar( player, "autostack.ignoreitems", true ); - - obj_id newItem = null; - - if (static_item.isStaticItem (item)) - { - newItem = static_item.createNewItemFunction( getStaticItemName(item), container); - } - else - { - newItem = createObject( item, container, ""); - } - - if (!isIdValid( newItem )) - { - sendSystemMessage( player, new string_id( "autostack", "unknown_failure")); - utils.removeScriptVar( player, "autostack.ignoreitems"); - return; - } - setCount( item, (oldStackSize - newStackSize) ); - setCount( newItem, newStackSize ); - utils.removeScriptVar( player, "autostack.ignoreitems"); - } - - - public boolean isContainerValidForStacking(obj_id self) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - - String containerTemplate = getTemplateName(getContainedBy(self)); - blog("isContainerValidForStacking containerTemplate: "+containerTemplate); - - if (isGameObjectTypeOf(getContainedBy(self), GOT_misc_container_wearable)) - { - return true; - } - else if (isGameObjectTypeOf(getContainedBy(self), GOT_misc_container)) - { - if (containerTemplate.startsWith("object/tangible/furniture/") || containerTemplate.startsWith("object/tangible/poi/object/")) - { - return true; - } - - return false; - } - return false; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (!BLOGGING_ON) - { - return false; - } - else if (msg == null || msg.equals("")) - { - return false; - } - - LOG(BLOGGING_CATEGORY, msg); - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/planet/planet_base.java b/sku.0/sys.server/compiled/game/script/planet/planet_base.java deleted file mode 100644 index e1b5dda54..000000000 --- a/sku.0/sys.server/compiled/game/script/planet/planet_base.java +++ /dev/null @@ -1,271 +0,0 @@ -package script.planet; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.cloninglib; -import script.library.gcw; -import script.library.regions; -import script.library.scheduled_drop; -import script.library.utils; - - -public class planet_base extends script.base_script -{ - public planet_base() - { - } - - public int OnUniverseComplete(obj_id self) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "planet_base.OnUniverseComplete: trigger initialized."); - - dictionary dctParams = new dictionary(); - messageTo(self, "doSpawnSetup", dctParams, 60, true); - - return SCRIPT_CONTINUE; - } - - - public int doSpawnSetup(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("holidayEvent", "planet_base.doSpawnSetup: messageHandler initialized."); - - String strPlanet = getNameForPlanetObject(self); - - if (strPlanet == null) - { - CustomerServiceLog("holidayEvent", "planet_base.doSpawnSetup: Planet name for this object is NULL. Notify SWG Development."); - - debugServerConsoleMsg(self, "Man you're so fucked. Your scenename is null. Go get justin!"); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("holidayEvent", "planet_base.doSpawnSetup: Planet name for this object is: "+strPlanet); - - debugServerConsoleMsg(self, "************************************BASE PLANET INITIALIZATION***************************************"); - debugServerConsoleMsg(self, "onInitialize, my current scene is "+strPlanet); - debugServerConsoleMsg(self, "************************************BASE PLANET INITIALIZATION***************************************"); - - if (!strPlanet.equals("tutorial") && !hasScript(self, "systems.spawning.spawn_master")) - { - CustomerServiceLog("holidayEvent", "planet_base.doSpawnSetup: Non-tutorial Planet detected. Attaching systems.spawning.spawn_master"); - - debugServerConsoleMsg(self, "************************************SPAWN ERROR****************************************************"); - debugServerConsoleMsg(self, "No spawnmaster script found! Attaching one!"); - debugServerConsoleMsg(self, "************************************SPAWN ERROR****************************************************"); - attachScript(self, "systems.spawning.spawn_master"); - } - - CustomerServiceLog("holidayEvent", "planet_base.doSpawnSetup: doSpawnSetup complete."); - obj_id tatooinePlanet = getPlanetByName("tatooine"); - if (isIdValid(tatooinePlanet) && exists(tatooinePlanet)) - { - CustomerServiceLog("holidayEvent", "planet_base.doSpawnSetup: Tatooine Planet detected obj_id: "+tatooinePlanet); - if (!hasScript(tatooinePlanet, "event.planet_event_handler")) - { - CustomerServiceLog("holidayEvent", "planet_base.doSpawnSetup: Tatooine Planet detected. Script Not Attached. Attaching event.planet_event_handler"); - attachScript (tatooinePlanet, "event.planet_event_handler"); - } - scheduled_drop.instantiatePromotionsOnCluster(); - } - else - { - CustomerServiceLog("holidayEvent", "planet_base.doSpawnSetup: Tatooine Planet not found!! Notify development."); - } - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - - String strPlanet = getCurrentSceneName(); - if (strPlanet == null) - { - - debugServerConsoleMsg(self, "Man you're so fucked. Your scenename is null. Go get justin!"); - return SCRIPT_CONTINUE; - } - - String strRegionScript; - - strRegionScript = "systems.spawning.spawn_regions."; - - debugServerConsoleMsg(self, "region script name is "+strRegionScript+"regions_"+strPlanet); - - detachScript(self, strRegionScript+"regions_"+strPlanet); - - return SCRIPT_CONTINUE; - - } - - - public int registerCloningFacility(obj_id self, dictionary params) throws InterruptedException - { - obj_id facilityId = params.getObjId("id"); - String cloneName = params.getString("name"); - String areaName = params.getString("buildout"); - obj_id areaId = params.getObjId("areaId"); - location facilityLoc = params.getLocation("loc"); - location facilityRespawn = params.getLocation("respawn"); - int cloneType = params.getInt("type"); - - Vector idList = utils.getResizeableObjIdArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_ID); - Vector nameList = utils.getResizeableStringArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_NAME); - Vector areaList = utils.getResizeableStringArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_AREA); - Vector areaIdList = utils.getResizeableObjIdArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_AREA_ID); - Vector locList = utils.getResizeableLocationArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_LOC); - Vector respawnList = utils.getResizeableLocationArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_RESPAWN); - Vector cloneTypeList = utils.getResizeableIntArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_TYPE); - - if (idList == null || areaList == null || areaIdList == null || locList == null || respawnList == null || cloneTypeList == null) - { - idList = utils.addElement(null, facilityId); - nameList = utils.addElement(null, cloneName); - areaList = utils.addElement(null, areaName); - areaIdList = utils.addElement(null, areaId); - locList = utils.addElement(null, facilityLoc); - respawnList = utils.addElement(null, facilityRespawn); - cloneTypeList = utils.addElement(null, cloneType); - } - else - { - int pos = utils.getElementPositionInArray(idList, facilityId); - if (pos >= 0) - { - nameList.set(pos, cloneName); - areaList.set(pos, areaName); - areaIdList.set(pos, areaId); - locList.set(pos, facilityLoc); - respawnList.set(pos, facilityRespawn); - cloneTypeList.set(pos, new Integer(cloneType)); - } - else - { - idList = utils.addElement(idList, facilityId); - nameList = utils.addElement(nameList, cloneName); - areaList = utils.addElement(areaList, areaName); - areaIdList = utils.addElement(areaIdList, areaId); - locList = utils.addElement(locList, facilityLoc); - respawnList = utils.addElement(respawnList, facilityRespawn); - cloneTypeList = utils.addElement(cloneTypeList, cloneType); - } - } - - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_ID, idList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_NAME, nameList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_AREA, areaList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_AREA_ID, areaIdList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_LOC, locList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_RESPAWN, respawnList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_TYPE, cloneTypeList); - - return SCRIPT_CONTINUE; - } - - - public int unregisterCloningFacility(obj_id self, dictionary params) throws InterruptedException - { - obj_id facilityId = params.getObjId("id"); - - Vector idList = utils.getResizeableObjIdArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_ID); - Vector nameList = utils.getResizeableStringArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_NAME); - Vector areaList = utils.getResizeableStringArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_AREA); - Vector areaIdList = utils.getResizeableObjIdArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_AREA_ID); - Vector locList = utils.getResizeableLocationArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_LOC); - Vector respawnList = utils.getResizeableLocationArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_RESPAWN); - Vector cloneTypeList = utils.getResizeableIntArrayScriptVar(self, cloninglib.VAR_PLANET_CLONE_TYPE); - - if (idList != null && nameList != null && areaList != null && areaIdList != null && locList != null && respawnList != null && cloneTypeList != null) - { - int pos = utils.getElementPositionInArray(idList, facilityId); - if (pos >= 0) - { - idList = utils.removeElementAt(idList, pos); - nameList = utils.removeElementAt(nameList, pos); - areaList = utils.removeElementAt(areaList, pos); - areaIdList = utils.removeElementAt(areaIdList, pos); - locList = utils.removeElementAt(locList, pos); - respawnList = utils.removeElementAt(respawnList, pos); - cloneTypeList = utils.removeElementAt(cloneTypeList, pos); - - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_ID, idList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_NAME, nameList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_AREA, areaList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_AREA_ID, areaIdList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_LOC, locList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_RESPAWN, respawnList); - utils.setScriptVar(self, cloninglib.VAR_PLANET_CLONE_TYPE, cloneTypeList); - } - } - - return SCRIPT_CONTINUE; - } - - - public int gcwInvasionTracker(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - LOG("dologging", "planet_base gcwInvasionTracker"); - - String city = params.getString("city"); - int lastPulse = utils.getIntScriptVar(self, "gcw.time."+ city); - int gameTime = getGameTime(); - - if (gameTime - lastPulse > gcw.GCW_PULSE_TIMER) - { - obj_id citySequencer = params.getObjId("sequencer"); - - if (isIdValid(citySequencer)) - { - LOG("dologging", "planet_base gcwInvasionTracker citySequencer: "+ citySequencer); - - utils.setScriptVar(self, "gcw.time."+ city, gameTime); - utils.setScriptVar(self, "gcw.object."+ city, citySequencer); - utils.setScriptVar(self, "gcw.calendar_time."+ city, getCalendarTime()); - messageTo(citySequencer, "beginInvasion", null, 1.0f, false); - } - } - - messageTo(self, "gcwInvasionTracker", params, 300.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int gcwGetInvasionObject(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - dictionary newParams = new dictionary(); - - String cityName = params.getString("city"); - obj_id whoToMessage = params.getObjId("object"); - String message = params.getString("messageHandler"); - - if (utils.hasScriptVar(self, "gcw.object." + cityName)) - { - obj_id invasionObject = utils.getObjIdScriptVar(self, "gcw.object."+ cityName); - - newParams.put("invasionObject", invasionObject); - - messageTo(whoToMessage, message, newParams, 1.0f, false); - } - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/player/base/base_player.java b/sku.0/sys.server/compiled/game/script/player/base/base_player.java deleted file mode 100644 index ae89a8e0d..000000000 --- a/sku.0/sys.server/compiled/game/script/player/base/base_player.java +++ /dev/null @@ -1,15557 +0,0 @@ -package script.player.base; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.ai.ai_combat; -import java.lang.Math; -import java.util.Iterator; -import java.util.Set; -import script.library.ai_lib; -import script.library.anims; -import script.library.armor; -import script.library.badge; -import script.library.beast_lib; -import script.library.bio_engineer; -import script.library.bounty_hunter; -import script.library.buff; -import script.library.callable; -import script.library.chat; -import script.library.city; -import script.library.cloninglib; -import script.library.colors; -import script.library.colors_hex; -import script.library.collection; -import script.library.combat; -import script.library.consumable; -import script.library.corpse; -import script.library.cts; -import script.library.dot; -import script.library.dump; -import script.library.expertise; -import script.library.event_perk; -import script.library.factions; -import script.library.features; -import script.library.food; -import script.library.force_rank; -import script.library.force_rank; -import script.library.fs_quests; -import script.library.gm; -import script.library.gmlib; -import script.library.groundquests; -import script.library.group; -import script.library.gcw; -import script.library.guild; -import script.library.healing; -import script.library.hq; -import script.library.hue; -import script.library.instance; -import script.library.jedi; -import script.library.jedi_trials; -import script.library.list; -import script.library.locations; -import script.library.loot; -import script.library.luck; -import script.library.meditation; -import script.library.metrics; -import script.library.money; -import script.library.movement; -import script.library.npe; -import script.library.pclib; -import script.library.performance; -import script.library.permissions; -import script.library.pet_lib; -import script.library.pgc_quests; -import script.library.player_stomach; -import script.library.player_structure; -import script.library.proc; -import script.library.prose; -import script.library.pvp; -import script.library.regions; -import script.library.resource; -import script.library.respec; -import script.library.scout; -import script.library.skill; -import script.library.skill_template; -import script.library.slicing; -import script.library.smuggler; -import script.library.space_combat; -import script.library.space_crafting; -import script.library.space_dungeon; -import script.library.space_dungeon_data; -import script.library.space_flags; -import script.library.space_quest; -import script.library.space_skill; -import script.library.space_transition; -import script.library.space_utils; -import script.library.squad_leader; -import script.library.static_item; -import script.library.stealth; -import script.library.storyteller; -import script.library.structure; -import script.library.sui; -import script.library.temp_schematic; -import script.library.township; -import script.library.trace; -import script.library.travel; -import script.library.trial; -import script.library.utils; -import script.library.vehicle; -import script.library.vendor_lib; -import script.library.veteran_deprecated; -import script.library.weapons; -import script.library.xp; -import script.library.restuss_event; -import script.library.session; -import script.library.incubator; -import script.library.missions; -import script.library.reverse_engineering; - -import java.util.Arrays; -import java.util.Vector; -import java.util.Enumeration; - - -public class base_player extends script.base_script -{ - public base_player() - { - } - public static final int TIME_DEATH = 5; - - public static final float RANGE_COUP_DE_GRACE = 3.0f; - - public static final String JEDI_CLOAK_TEMPLATE = "object/tangible/wearable/robe/robe_s05.iff"; - - public static final String MSG_REVIVE_TITLE = "@base_player:revive_title"; - public static final String MSG_REVIVE_MSG = "@base_player:revive_msg"; - - public static final String MSG_REVIVE_CLOSEST_INSURED = "@base_player:revive_closest_insured"; - public static final String MSG_REVIVE_CLOSEST_UNINSURED = "@base_player:revive_closest_uninsured"; - public static final String MSG_REVIVE_BIND_INSURED = "@base_player:revive_bind_insured"; - public static final String MSG_REVIVE_BIND_UNINSURED = "@base_player:revive_bind_uninsured"; - - public static final String MSG_REVIVE_CLOSEST = "@base_player:revive_closest"; - public static final String MSG_REVIVE_BIND = "@base_player:revive_bind"; - - public static final string_id SID_VICTIM_INCAPACITATED = new string_id("base_player", "victim_incapacitated"); - public static final string_id SID_KILLER_TARGET_INCAPACITATED = new string_id("base_player", "killer_target_incapacitated"); - - public static final string_id PROSE_VICTIM_INCAP = new string_id("base_player", "prose_victim_incap"); - public static final string_id PROSE_TARGET_INCAP = new string_id("base_player", "prose_target_incap"); - - public static final string_id SID_COUP_DE_GRACE = new string_id("base_player", "death_blow"); - public static final string_id SID_REVIVE = new string_id("base_player", "revive_player"); - public static final string_id SID_RESUSCITATE = new string_id("base_player", "resuscitate_player"); - - public static final string_id SID_TARGET_OUT_OF_RANGE = new string_id("error_message","target_out_of_range"); - public static final string_id SID_TARGET_NOT_ATTACKABLE = new string_id("error_message","target_not_attackable"); - - public static final string_id SID_SYNTAX_UNCONSENT = new string_id("error_message","syntax_unconsent"); - - public static final string_id SID_CONSENT_TO_EMPTY = new string_id("error_message","consent_to_empty"); - public static final string_id SID_CONSENT_FROM_EMPTY = new string_id("error_message","consent_from_empty"); - - public static final string_id SID_HAVE_CONSENT_TRUE = new string_id("base_player","haveconsent_true"); - public static final string_id SID_HAVE_CONSENT_FALSE = new string_id("base_player","haveconsent_false"); - - public static final string_id SID_CONSENT_SUCCESSFUL = new string_id("base_player","consent_successful"); - public static final string_id SID_UNCONSENT_SUCCESSFUL = new string_id("base_player","unconsent_successful"); - - public static final string_id SID_CONSENT_TO_LISTBOX_PROMPT = new string_id("base_player","consent_to_listbox_prompt"); - public static final string_id SID_CONSENT_TO_LISTBOX_TITLE = new string_id("base_player","consent_to_listbox_title"); - - public static final string_id SID_CONSENT_FROM_LISTBOX_PROMPT = new string_id("base_player","consent_from_listbox_prompt"); - public static final string_id SID_CONSENT_FROM_LISTBOX_TITLE = new string_id("base_player","consent_from_listbox_title"); - - public static final string_id SID_UNCONSENT_LISTBOX_PROMPT = new string_id("base_player","unconsent_listbox_prompt"); - public static final string_id SID_UNCONSENT_LISTBOX_TITLE = new string_id("base_player","unconsent_listbox_title"); - - public static final string_id PROSE_GOT_CONSENT = new string_id("base_player","prose_got_consent"); - public static final string_id PROSE_LOST_CONSENT = new string_id("base_player","prose_lost_consent"); - - public static final string_id SID_CORPSE_EXPIRED = new string_id("base_player","corpse_expired"); - - public static final string_id SID_PERM_NO_MOVE = new string_id("error_message","perm_no_move"); - - public static final string_id SID_CMD_OPEN_FAIL = new string_id("error_message","prose_open_fail"); - - public static final string_id SID_CMD_NO_EFFECT = new string_id("error_message","cmd_no_effect"); - public static final string_id SID_CMD_NO_EFFECT_ON_TARGET = new string_id("error_message","cmd_no_effect_on_target"); - - public static final string_id SID_NO_UNINSURED_INSURABLES = new string_id("error_message","no_uninsured_insurables"); - public static final string_id SID_BAD_INSURE_REQUEST = new string_id("error_message","bad_insure_request"); - - public static final string_id SID_INSURE_FAIL = new string_id("error_message","insure_fail"); - public static final string_id PROSE_INSURE_FAIL = new string_id("error_message","prose_insure_fail"); - - public static final string_id SID_CLONE_FAIL = new string_id("error_message","clone_fail"); - public static final string_id SID_CLONE_FAIL_SELECTION = new string_id("base_player", "clone_fail_no_selection"); - - public static final string_id SID_TARGET_MUST_BE_PLAYER = new string_id("error_message","target_must_be_player"); - - public static final string_id SID_ERROR_INVITE_RANGE = new string_id("error_message","error_invite_range"); - public static final string_id PROSE_INVITE_RANGE = new string_id("error_message","prose_invite_range"); - - public static final string_id SID_INSTANCE_REVIVE = new string_id("base_player", "instance_revive"); - public static final string_id SID_INSTANCE_REVIVE_TITLE = new string_id("base_player", "instance_revive_title"); - - public static final String HANDLER_PLAYER_REVIVE = "handlePlayerRevive"; - - public static final String HANDLER_UNCONSENT_MENU = "handleUnconsentMenu"; - - public static final String HANDLER_CASH_LOOTED = "handleCashLooted"; - - public static final string_id PROSE_COIN_LOOT = new string_id("base_player","prose_coin_loot"); - public static final string_id PROSE_COIN_LOOT_NO_TARGET = new string_id("base_player","prose_coin_loot_no_target"); - public static final string_id PROSE_COIN_LOOT_FAILED = new string_id("error_message","prose_coin_loot_fail"); - public static final int LOGOUT_TIME = 30; - public static final int LOGOUT_COUNT_INTERVAL = 5; - - public static final string_id SID_SYS_SCENTMASK_NOSKILL = new string_id("skl_use","sys_scentmask_noskill"); - public static final string_id SID_SYS_SCENTMASK_START = new string_id("skl_use","sys_scentmask_start"); - public static final string_id SID_SYS_SCENTMASK_STOP = new string_id("skl_use","sys_scentmask_stop"); - public static final string_id SID_SYS_SCENTMASK_FAIL = new string_id("skl_use","sys_scentmask_fail"); - public static final string_id SID_SYS_SCENTMASK_ALREADY = new string_id("skl_use","sys_scentmask_already"); - public static final string_id SID_SYS_SCENTMASK_DELAY = new string_id("skl_use","sys_scentmask_delay"); - public static final string_id SID_SYS_SCENTMASK_CONCEALED = new string_id("skl_use","sys_scentmask_concealed"); - - public static final string_id SID_SYS_CONCEAL_NOSKILL = new string_id("skl_use","sys_conceal_noskill"); - public static final string_id SID_SYS_CONCEAL_START = new string_id("skl_use","sys_conceal_start"); - public static final string_id SID_SYS_CONCEAL_STOP = new string_id("skl_use","sys_conceal_stop"); - public static final string_id SID_SYS_CONCEAL_FAIL = new string_id("skl_use","sys_conceal_fail"); - public static final string_id SID_SYS_CONCEAL_CANT = new string_id("skl_use","sys_conceal_cant"); - public static final string_id SID_SYS_CONCEAL_NOTPLAYER = new string_id("skl_use","sys_conceal_notplayer"); - public static final string_id SID_SYS_TARGET_CONCEALED = new string_id("skl_use","sys_target_concealed"); - public static final string_id SID_SYS_CONCEAL_REMOVE = new string_id("skl_use","sys_conceal_remove"); - public static final string_id SID_SYS_CONCEAL_NOKIT = new string_id("skl_use","sys_conceal_nokit"); - public static final string_id SID_SYS_CONCEAL_SCENTMASKED = new string_id("skl_use","sys_conceal_scentmasked"); - public static final string_id SID_SYS_CONCEAL_APPLY = new string_id("skl_use","sys_conceal_apply"); - public static final string_id SID_SYS_CONCEAL_DELAY = new string_id("skl_use","sys_conceal_delay"); - - public static final string_id SID_SYS_SCAN_NOTHING = new string_id("skl_use","sys_scan_nothing"); - public static final string_id SID_SYS_SCAN_BEGIN = new string_id("skl_use","sys_scan_begin"); - public static final string_id SID_SYS_SCAN_ALREADY = new string_id("skl_use","sys_scan_already"); - public static final string_id SID_SYS_SCAN_INSIDE = new string_id("skl_use","sys_scan_inside"); - public static final string_id SID_SYS_SCAN_MOVED = new string_id("skl_use","sys_scan_moved"); - public static final string_id SID_SYS_SCAN_COMBAT = new string_id("skl_use","sys_scan_combat"); - - public static final string_id SID_SURVEY_WAYPOINT_NAME = new string_id("skl_use", "survey_waypoint_name"); - public static final string_id SID_SURVEY_WAYPOINT = new string_id("survey", "survey_waypoint"); - public static final string_id SID_SAMPLE_CANCEL = new string_id("survey", "sample_cancel"); - public static final string_id SID_SAMPLE_CANCEL_ATTACK = new string_id("survey", "sample_cancel_attack"); - public static final string_id SID_NODE_WAYPOINT = new string_id("survey", "node_waypoint"); - public static final string_id SID_GAMBLE_NO_ACTION = new string_id("survey", "gamble_no_action"); - - public static final string_id SID_TRAP_CANCEL = new string_id("trap/trap", "sys_traplay_cancel"); - public static final string_id SID_TRAP_CANCEL_ATTACK = new string_id("trap/trap", "sys_traplay_cancel_attack"); - public static final string_id SID_TRAP_COUNT = new string_id("trap/trap", "sys_traplay_count"); - - public static final string_id SID_SYS_EJECT_REQUEST = new string_id("error_message", "sys_eject_request"); - public static final string_id SID_SYS_EJECT_FAIL_MOVE = new string_id("error_message", "sys_eject_fail_move"); - public static final string_id SID_SYS_EJECT_FAIL_CONTAINED = new string_id("error_message", "sys_eject_fail_contained"); - public static final string_id SID_SYS_EJECT_FAIL_PROXIMITY = new string_id("error_message", "sys_eject_fail_proximity"); - public static final string_id SID_SYS_EJECT_FAIL_GROUND = new string_id("error_message", "sys_eject_fail_ground"); - public static final string_id SID_SYS_EJECT_SUCCESS = new string_id("error_message", "sys_eject_success"); - public static final string_id SID_SYS_EJECT_DUNGEON = new string_id("error_messaage", "sys_eject_dungeon_pp"); - - public static final string_id SID_NOT_MILITIA = new string_id("city/city", "not_militia"); - public static final string_id SID_CITY_WARNED = new string_id("city/city", "city_warned"); - public static final string_id SID_CITY_WARN_DONE = new string_id("city/city", "city_warn_done"); - public static final string_id SID_ALREADY_WARNED = new string_id("city/city", "already_warned"); - public static final string_id SID_CITY_BANNED = new string_id("city/city", "city_banned"); - public static final string_id SID_CITY_BAN_DONE = new string_id("city/city", "city_ban_done"); - public static final string_id SID_CITY_PARDONED = new string_id("city/city", "city_pardoned"); - public static final string_id SID_CITY_PARDON_DONE = new string_id("city/city", "city_pardon_done"); - public static final string_id SID_LEAVE_CITY = new string_id("city/city", "city_leave_city"); - public static final string_id SID_ENTER_CITY = new string_id("city/city", "city_enter_city"); - public static final string_id SID_CITY_WARNING = new string_id("city/city", "city_warning"); - public static final string_id SID_CITY_WARNING_TARGET = new string_id("city/city", "city_warning_target"); - public static final string_id SID_NOT_CITIZEN_BAN = new string_id("city/city", "not_citizen_ban"); - public static final string_id SID_NOT_CSR_BAN = new string_id("city/city", "not_csr_ban"); - public static final string_id SID_CSR_BAN_ATTEMPT_MSG = new string_id("city/city", "csr_ban_attempt_msg"); - - public static final string_id SID_RIGHTS_GRANTED = new string_id("city/city", "rights_granted"); - public static final string_id SID_GRANT_RIGHTS_FAIL = new string_id("city/city", "grant_rights_fail"); - public static final string_id SID_RIGHTS_GRANTED_SELF = new string_id("city/city", "rights_granted_self"); - public static final String CITY_MISSION_TERMINALS = "datatables/city/mission_terminals.iff"; - public static final string_id SID_NO_MORE_MT = new string_id("city/city", "no_more_mt"); - public static final String CITY_SKILL_TRAINERS = "datatables/city/skill_trainers.iff"; - public static final string_id SID_NO_MORE_TRAINERS = new string_id("city/city", "no_more_trainers"); - public static final string_id SID_CITY_NO_MONEY = new string_id("city/city", "action_no_money"); - public static final string_id SID_NO_FACTIONAL = new string_id("city/city", "no_factional"); - public static final string_id SID_RIGHTS_REVOKED = new string_id("city/city", "rights_revoked"); - public static final string_id SID_RIGHTS_REVOKED_OTHER = new string_id("city/city", "rights_revoked_other"); - public static final string_id SID_CIVIC_ONLY = new string_id("city/city", "civic_only"); - - public static final String[] ZONING_RIGHTS_ARRAY = new String[] - { - "@city/city:full_zoning_rights", - "@city/city:st_zoning_rights", - }; - public static final string_id SID_ST_RIGHTS_GRANTED = new string_id("city/city", "st_rights_granted"); - public static final string_id SID_ST_GRANT_RIGHTS_FAIL = new string_id("city/city", "st_grant_rights_fail"); - public static final string_id SID_ST_RIGHTS_GRANTED_SELF = new string_id("city/city", "st_rights_granted_self"); - public static final string_id SID_ST_RIGHTS_REVOKED = new string_id("city/city", "st_rights_revoked"); - public static final string_id SID_ST_RIGHTS_REVOKED_OTHER = new string_id("city/city", "st_rights_revoked_other"); - public static final string_id SID_NOT_IN_CITY_LIMITS = new string_id("city/city", "not_in_city_limits"); - - public static final String NOVICE_MARKSMAN = "combat_marksman_novice"; - public static final String NOVICE_BRAWLER = "combat_brawler_novice"; - public static final String NOVICE_MEDIC = "science_medic_novice"; - public static final String NOVICE_ARTISAN = "crafting_artisan_novice"; - public static final String NOVICE_ENTERTAINER = "social_entertainer_novice"; - public static final String NOVICE_SCOUT = "outdoors_scout_novice"; - - public static final string_id SID_INVITE_TO_RIDE = new string_id("base_player", "invite_to_ride"); - public static final string_id SID_CANNOT_OFFER_RIDE_TO = new string_id("base_player", "cannot_offer_ride_to"); - public static final string_id SID_OFFER_RIDE_TO = new string_id("base_player", "offer_ride_to"); - public static final string_id SID_UNABLE_TO_ACCEPT_RIDE = new string_id("base_player", "unable_to_accept_ride"); - public static final string_id SID_ACCEPTED_RIDE = new string_id("base_player", "accepted_ride"); - public static final string_id SID_DECLINED_RIDE = new string_id("base_player", "declined_ride"); - public static final string_id SID_NO_ROOM_FOR_PASSENGER = new string_id("base_player", "no_room_for_passenger"); - - public static final string_id SID_SPICE_DOWNER_DURATION_REDUCED = new string_id("base_player", "spice_downer_duration_reduced"); - public static final string_id SID_SPICE_DOWNER_DURATION_NEGATED = new string_id("base_player", "spice_downer_duration_negated"); - public static final string_id SID_INCAPACITATION_DURATION_REDUCED = new string_id("base_player", "incapacitation_duration_reduced"); - - public static final String NEW_PLAYER_QUESTS_SCRIPT = "theme_park.new_player.new_player"; - - public static final String SPACE_CERTIFICATION = "private_cert_space"; - - public static final string_id SID_CAN_PLACE_ONE_BASE = new string_id("faction_perk", "faction_base_refunded_one"); - public static final String COUPE_DE_GRACE_TARGET = "coupeDeGraceTarget"; - public static final String[] ATTRIBUTES = - { - "HEALTH", - "CONSTITUTION", - "ACTION", - "STAMINA", - "MIND", - "WILLPOWER" - }; - - public static final int TRANSFER_SHIPS = 1; - public static final int TRANSFER_DROIDS = 1; - - public static final string_id SID_CANT_MILK_MOUNTED = new string_id("skl_use","milk_mounted"); - public static final string_id SID_CANT_MILK = new string_id("skl_use","milk_cant"); - public static final string_id SID_CANT_MILK_COMBAT = new string_id("skl_use", "milk_combat"); - public static final string_id SID_NO_MILK = new string_id("skl_use", "milk_none"); - public static final string_id SID_NO_ALLOW_MILK = new string_id("skl_use", "milk_unmilkeable"); - public static final string_id MILK_TOO_FAR_START = new string_id("skl_use", "milk_too_far_start"); - public static final string_id MILK_NO_TARGET = new string_id("skl_use", "milk_no_target"); - - public static final String CTS_LOT_COUNT = "cts.lotcount"; - - public static final String PVP_SKILL_1 = "retaliation_ability"; - public static final String PVP_SKILL_2 = "adrenaline_ability"; - public static final String PVP_SKILL_3 = "unstoppable_ability"; - public static final String PVP_SKILL_4 = "last_man_ability"; - public static final String PVP_SKILL_5 = "aura_buff_self"; - public static final String PVP_SKILL_6 = "airstrike_ability"; - - public static final string_id COVERCHARGE_DANCER_MESSAGE = new string_id("base_player", "covercharge_dancer_message"); - - public static final string_id SID_FOUND_NOTHING = new string_id("lair_n", "found_nothing"); - public static final string_id TOO_FAR_FROM_LAIR = new string_id("lair_n", "too_far_from_lair"); - public static final string_id LAIR_NOT_TARGETED = new string_id("lair_n", "lair_not_targeted"); - - public static final string_id SHAPECHANGE = new string_id("spam", "shapechange_combat"); - - public static final String[] WAYPOINT_GROUND_PLANETS_EXTERNAL = - { - "tatooine", - "naboo", - "corellia", - "rori", - "talus", - "yavin4", - "endor", - "lok", - "dantooine", - "dathomir", - "kachirho", - "etyyy", - "khowir", - "mustafar", - }; - - public static final String[] WAYPOINT_GROUND_PLANETS_INTERNAL = - { - "tatooine", - "naboo", - "corellia", - "rori", - "talus", - "yavin4", - "endor", - "lok", - "dantooine", - "dathomir", - "kashyyyk_main", - "kashyyyk_hunting", - "kashyyyk_dead_forest", - "mustafar", - }; - - public static final vector[] WAYPOINT_GROUND_PLANETS_BUILDOUT_COORDS = - { - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - new vector(0.0f, 0.0f, 0.0f), - new vector(0.0f, 0.0f, 0.0f), - new vector(0.0f, 0.0f, 0.0f), - new vector(-2304.0f, 0.0f, 2848.0f), - }; - - public static final String[] WAYPOINT_SPACE_ZONES_EXTERNAL = - { - "space_tatooine", - "space_naboo", - "space_corellia", - "space_deep", - "space_kessel", - "space_yavin4", - "space_endor", - "space_lok", - "space_dantooine", - "space_dathomir", - "space_kashyyyk", - "space_nova_orion", - }; - - public static final String[] WAYPOINT_SPACE_ZONES_INTERNAL = - { - "space_tatooine", - "space_naboo", - "space_corellia", - "space_heavy1", - "space_light1", - "space_yavin4", - "space_endor", - "space_lok", - "space_dantooine", - "space_dathomir", - "space_kashyyyk", - "space_nova_orion", - }; - - public static final boolean LOGGING_ON = true; - public static final String LOGNAME = "junk_log"; - - - public int OnCustomizeFinished(obj_id self, obj_id object, String params) throws InterruptedException - { - if (utils.hasScriptVar(self, "armor_colorize.tool_oid") || utils.hasScriptVar(self, "structure_colorize.tool_oid")) - { - obj_id tool = obj_id.NULL_ID; - if (utils.hasScriptVar(self, "armor_colorize.tool_oid")) - { - tool = utils.getObjIdScriptVar(self, "armor_colorize.tool_oid"); - } - else if (utils.hasScriptVar(self, "structure_colorize.tool_oid")) - { - tool = utils.getObjIdScriptVar(self, "structure_colorize.tool_oid"); - } - - if (!isValidId(tool) || !exists(tool)) - { - return SCRIPT_CONTINUE; - } - - colorizeObject(self, object, tool, params); - - } - if (utils.hasScriptVar(self, vendor_lib.GREETER_PLAYTERCOLOR_SCRVAR)) - { - vendor_lib.colorizeGreeterFromWidget(self, object, params); - } - - if (utils.hasScriptVar(self, "veteranRewardItemColor.color_setting")) - { - utils.colorizeItemFromWidget(self, object, params); - } - - return SCRIPT_CONTINUE; - } - - - public int OnEnteredCombat(obj_id self) throws InterruptedException - { - int shapechange = buff.getBuffOnTargetFromGroup(self, "shapechange"); - - if (shapechange != 0) - { - buff.removeBuff(self, shapechange); - sendSystemMessage(self, SHAPECHANGE); - } - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - final String[] NEWBIE_PROFICIENCIES = - { - "knife_stone","knife_survival","lance_staff_wood_s1","axe_heavy","rifle_cdef","pistol_cdef","carbine_cdef" - }; - setObjVar(self, pclib.VAR_NEWBIE_DEATH, 1); - - skill.setPlayerStatsForLevel(self, 1); - return SCRIPT_CONTINUE; - } - - - public int OnSkillAboutToBeRevoked(obj_id self, String skill) throws InterruptedException - { - - if (toLower(skill).startsWith("pilot")) - { - - int godLevel = -1; - - if (isGod(self)) - { - godLevel = getGodLevel(self); - } - - if (!utils.hasScriptVar(self, "revokePilotSkill") && (godLevel < 50)) - { - space_skill.retireWarning(self, skill); - return SCRIPT_OVERRIDE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnCombatLevelChanged(obj_id self, int oldCombatLevel, int newCombatLevel) throws InterruptedException - { - if (newCombatLevel <= 1 || oldCombatLevel >= newCombatLevel) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "respec.conceal")) - { - skill.doPlayerLeveling(self, oldCombatLevel, newCombatLevel); - } - else - { - skill.setPlayerStatsForLevel(self, newCombatLevel); - utils.removeScriptVar(self, "respec.conceal"); - } - - if ((utils.isProfession(self, utils.TRADER )) &&(!hasSkill(self, "class_trader"))) - { - grantSkill(self, "class_trader"); - } - - if ((!hasSkill(self, "expertise"))&&(newCombatLevel == 10)) - { - expertise.autoAllocateExpertiseByLevel(self, true); - } - - recomputeCommandSeries(self); - - skill.sendlevelUpStatChangeSystemMessages(self, oldCombatLevel, newCombatLevel); - - return SCRIPT_CONTINUE; - } - - - public int updateGCWStanding(obj_id self, dictionary params) throws InterruptedException - { - int intScore = params.getInt("intScore"); - - gcw.checkAndUpdateGCWStanding(self, intScore); - return SCRIPT_CONTINUE; - - } - - - public int OnSkillRevoked(obj_id self, String strSkill) throws InterruptedException - { - - if (strSkill.equals( "pilot_rebel_navy_novice" ) || strSkill.equals( "pilot_imperial_navy_novice" ) || strSkill.equals( "pilot_neutral_novice" )) - { - space_flags.clearSpaceTrack( self ); - space_skill.revokeExperienceForRetire(self, strSkill); - if (space_quest.hasQuest( self )) - { - obj_id datapad = utils.getPlayerDatapad( self ); - if (isIdValid( datapad )) - { - obj_id[] dpobjs = getContents( datapad ); - for (int i=0; i 0) - { - - if (getJediState(self) == JEDI_STATE_NONE) - { - setJediState(self, JEDI_STATE_FORCE_SENSITIVE); - } - } - - if (hasSkill(self, "jedi_padawan_novice")) - { - setSkillTemplate(self, "a"); - attachScript(self, "player.player_jedi_conversion"); - } - - if (!isJedi(self)) - { - if (hasObjVar(self, "jedi.postponeGrant")) - { - if (!jedi.postponeGrantJedi()) - { - - LOG("jedi", "MAKING "+ self + " A JEDI FROM ON_INITIALIZE"); - messageTo(self, "makeJedi", null, 0.1f, false); - } - } - else if (hasObjVar(self, "jedi.timeStamp")) - { - - LOG("jedi", "MAKING "+ self + " A JEDI FROM ON_INITIALIZE"); - messageTo(self, "makeJedi", null, 0.1f, false); - } - } - - skill.fixTerrainNegotiationMods(self); - - if (isIdValid(getHouseId(self))) - { - skill.grantAllPoliticianSkills(self); - } - else - { - int currentCity = getCitizenOfCityId(self); - obj_id currentCityMayor = cityGetLeader(currentCity); - if (self == currentCityMayor) - { - skill.grantAllPoliticianSkills(self); - } - } - - int vehicleBuff = buff.getBuffOnTargetFromGroup(self, "vehicle"); - if (vehicleBuff != 0) - { - buff.removeBuff(self, vehicleBuff); - } - - if (buff.hasBuff(self, "forceRun")) - { - buff.removeBuff(self, "forceRun"); - } - if (buff.hasBuff(self, "forceRun_1")) - { - buff.removeBuff(self, "forceRun_1"); - } - if (buff.hasBuff(self, "forceRun_2")) - { - buff.removeBuff(self, "forceRun_2"); - } - - jedi.jediSaberPearlRestore(self); - - if (!hasSkill(self, "social_language_wookiee_comprehend")) - { - grantSkill(self, "social_language_wookiee_comprehend"); - } - - if (!group.isGrouped(self)) - { - int[] buffList = buff.getGroupBuffEffects(self); - if (buffList != null && buffList.length > 0) - { - buff.removeGroupBuffEffect(self, buffList); - } - } - - if (features.isSpaceEdition(self)) - { - grantCommand(self, SPACE_CERTIFICATION); - } - else - { - revokeCommand(self, SPACE_CERTIFICATION); - } - - removeObjVar( self, pclib.VAR_SAFE_LOGOUT ); - recalculateLevel( self ); - - removeObjVar(self, "clickRespec"); - removeObjVar(self, "npcRespec"); - - detachScript( self, group.SCRIPT_GROUP_MEMBER ); - - if (!hasScript(self, dot.SCRIPT_PLAYER_DOT)) - { - setState( self, STATE_BLEEDING, false ); - setState( self, STATE_POISONED, false ); - setState( self, STATE_DISEASED, false ); - setState( self, STATE_ON_FIRE, false ); - } - - if (buff.hasBuff(self, "healOverTime")) - { - buff.removeBuff(self, "healOverTime"); - } - - chat.resetTempAnimationMood( self ); - - if (hasObjVar(self, cloninglib.VAR_BIND_FACILITY_TEMPLATE)) - { - obj_id facilityId = getObjIdObjVar(self, cloninglib.VAR_BIND_FACILITY); - dictionary data = new dictionary(); - data.put("requester", self); - messageTo(facilityId, "requestCloningData", data, 0, false); - } - - if (hasObjVar(self, "coa3")) - { - removeObjVar(self, "coa3"); - } - - utils.validatePlayerHairStyle(self); - - badge.grantThemeParkBadges(self); - - if (hasSchematic(self, getObjectTemplateCrc("object/draft_schematic/weapon/razor_knuckler.iff"))) - { - temp_schematic.revoke(self, "object/draft_schematic/weapon/razor_knuckler.iff"); - } - - if (bounty_hunter.hasMaxBountyMissionsOnTarget(self)) - { - messageTo(self, "handleBountyMissionTimeout", null, 30.0f, true); - } - - int totalMoney = getTotalMoney(self); - utils.setScriptVar(self, "profit", totalMoney); - - String balanceThreshold = getConfigSetting("GameServer", "wealthLoggingThreshold"); - if (balanceThreshold == null || balanceThreshold.equals("")) - { - - balanceThreshold = "10000000"; - } - if (utils.stringToInt(balanceThreshold) > -1) - { - - if (totalMoney > utils.stringToInt(balanceThreshold)) - { - - CustomerServiceLog("Wealth", "Extraordinary Wealth: "+ getName(self) + " ("+ self + ") logged in with "+ totalMoney + " credits"); - } - } - - utils.unequipAndNotifyUncerted(self); - utils.checkInventoryForSnowflakeItemSwaps(self); - if (hasObjVar(self, "item_reimbursement_list")) - { - String[] strReimbursementList = getStringArrayObjVar(self, "item_reimbursement_list"); - removeObjVar(self,"item_reimbursement_list"); - for (int intI = 0; intI < strReimbursementList.length; intI++) - { - testAbortScript(); - obj_id objTest = createObjectInInventoryAllowOverload(strReimbursementList[intI], self); - if (isIdValid(objTest)) - { - - if (armor.isArmorComponent(objTest)) - { - if (!isGameObjectTypeOf(objTest, GOT_armor_foot) && !isGameObjectTypeOf(objTest, GOT_armor_hand)) - { - - final String[] ARMOR_SET = - { - - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_leggings.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_helmet.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_gloves.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_chest_plate.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_bracer_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_bracer_l.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_boots.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_bicep_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_bicep_l.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_imperial_s01_belt.iff", - - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_leggings.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_helmet.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_gloves.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_chest_plate.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_bracer_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_bracer_l.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_boots.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_bicep_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_bicep_l.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_rebel_s01_belt.iff", - - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_leggings.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_helmet.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_gloves.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_chest_plate.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_bracer_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_bracer_l.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_boots.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_bicep_r.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_bicep_l.iff", - "object/tangible/wearables/armor/clone_trooper/armor_clone_trooper_neutral_s01_belt.iff" - }; - - for (int intJ = 0; intJ < ARMOR_SET.length; intJ++) - { - testAbortScript(); - if (strReimbursementList[intI].equals(ARMOR_SET[intJ])) - { - armor.setArmorDataPercent(objTest, 2, 1, 0.94f, 0.95f); - break; - } - } - } - } - - CustomerServiceLog("item_reimbursement", "Created item of type "+strReimbursementList[intI]+" and Id of "+objTest+ " in the inventory of %TU", self); - } - else - { - CustomerServiceLog("item_reimbursement", "Failed to reimburse item of type "+strReimbursementList[intI]+" in the inventory of %TU", self); - } - } - } - - int fatigue = getShockWound(self); - if (fatigue > 0) - { - setShockWound(self, 0); - } - - obj_var_list buffList = getObjVarList(self, "clickItem"); - if (buffList != null) - { - int count = buffList.getNumItems(); - int curTime = getGameTime(); - for (int i = 0; i < count; i++) - { - testAbortScript(); - obj_var item = buffList.getObjVar(i); - int reuseTime = item.getIntData(); - - if (reuseTime < curTime) - { - String cooldownGroup = item.getName(); - removeObjVar(self, "clickItem."+cooldownGroup); - } - } - } - - if (!hasScript( self, "player.live_conversions" )) - { - attachScript( self, "player.live_conversions"); - } - - if (!hasScript(self, "systems.skills.stealth.player_stealth")) - { - attachScript( self, "systems.skills.stealth.player_stealth"); - } - - skill_template.validateWorkingSkill(self); - skill.setPlayerStatsForLevel(self, getLevel(self)); - - LOG("base_player - OnInitialize", "calling armor.recalculateArmorForPlayer(self); with a 'self' of: "+self); - armor.recalculateArmorForPlayer(self); - - obj_id objWeapon = getDefaultWeapon(self); - String strTemplate = getTemplateName(objWeapon); - if (isIdValid(objWeapon) && strTemplate.equals("object/weapon/melee/unarmed/unarmed_default_player.iff")) - { - if (!hasScript(objWeapon, "systems.combat.combat_weapon")) - { - attachScript(objWeapon, "systems.combat.combat_weapon"); - messageTo(objWeapon, "weaponConversion", null, 2, false); - } - - float fltWeaponSpeed = getWeaponAttackSpeed(objWeapon); - if (fltWeaponSpeed != .50f) - { - setWeaponAttackSpeed(objWeapon, .50f); - } - } - - expertise.cacheExpertiseProcReacList(self); - proc.buildCurrentProcList(self); - proc.buildCurrentReacList(self); - - givePublishGift(self); - - sendSmugglerSystemBootstrap(self); - - recomputeCommandSeries(self); - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - missions.initializeDailyOnLogin(self); - - int lastDecayTime = getIntObjVar(self, "bounty.decayTime"); - int currentTime = getCalendarTime(); - - if (lastDecayTime == 0) - { - setObjVar(self, "bounty.decayTime", currentTime); - } - else - { - int bounty = getIntObjVar(self, "bounty.amount"); - - if (currentTime - lastDecayTime > 604800) - { - setObjVar(self, "bounty.decayTime", currentTime); - - if (bounty < 10000) - { - removeObjVar(self, "bounty.amount"); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleRetireWarning(obj_id self, dictionary params) throws InterruptedException - { - - int btn = sui.getIntButtonPressed(params); - - if (btn == sui.BP_CANCEL) - { - - location loc = utils.getLocationScriptVar(self, "revokePilotSkillWarningLoc"); - String wp_name = utils.getStringScriptVar(self, "revokePilotSkillWarningWpName"); - - if (loc == null) - { - return SCRIPT_CONTINUE; - } - - obj_id wp = createWaypointInDatapad(self, loc); - setWaypointName(wp, wp_name); - setWaypointColor(wp, "blue"); - setWaypointActive(wp, true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnPvpRankingChanged(obj_id self, int oldRank, int newRank) throws InterruptedException - { - String faction = ""; - boolean isImperial = false; - - if (factions.isImperial(self)) - { - faction = "pvp_imperial_"; - isImperial = true; - } - - if (factions.isRebel(self)) - { - faction = "pvp_rebel_"; - } - - if (faction.equals("")) - { - factions.removeAllPvpSkills (self); - CustomerServiceLog("pvp_rank_error", "Player %TU somehow changed PvP rank without being Rebel or Imperial, removing all PvP skills.", self); - return SCRIPT_CONTINUE; - } - - if (oldRank <= 6 && newRank > 6) - { - skill.grantSkill(self, faction + PVP_SKILL_1); - - if (isImperial) - { - badge.grantBadge(self, "pvp_imperial_lieutenant"); - } - else - { - badge.grantBadge(self, "pvp_rebel_lieutenant"); - } - } - - if (oldRank <= 7 && newRank > 7) - { - skill.grantSkill(self, faction + PVP_SKILL_2); - - if (isImperial) - { - badge.grantBadge(self, "pvp_imperial_captain"); - } - else - { - badge.grantBadge(self, "pvp_rebel_captain"); - } - } - - if (oldRank <= 8 && newRank > 8) - { - skill.grantSkill(self, faction + PVP_SKILL_3); - - if (isImperial) - { - badge.grantBadge(self, "pvp_imperial_major"); - } - else - { - badge.grantBadge(self, "pvp_rebel_major"); - } - } - - if (oldRank <= 9 && newRank > 9) - { - skill.grantSkill(self, faction + PVP_SKILL_4); - - if (isImperial) - { - badge.grantBadge(self, "pvp_imperial_lt_colonel"); - } - else - { - badge.grantBadge(self, "pvp_rebel_commander"); - } - } - - if (oldRank <= 10 && newRank > 10) - { - skill.grantSkill(self, faction + PVP_SKILL_5); - - if (isImperial) - { - badge.grantBadge(self, "pvp_imperial_colonel"); - } - else - { - badge.grantBadge(self, "pvp_rebel_colonel"); - } - } - - if (oldRank <= 11 && newRank > 11) - { - skill.grantSkill(self, faction + PVP_SKILL_6); - - if (isImperial) - { - badge.grantBadge(self, "pvp_imperial_general"); - } - else - { - badge.grantBadge(self, "pvp_rebel_general"); - } - } - - if (oldRank == 12 && newRank <= 11) - { - skill.revokeSkill(self, faction + PVP_SKILL_6); - - if (newRank == 10) - { - skill.revokeSkill(self, faction + PVP_SKILL_5); - } - if (newRank == 9) - { - skill.revokeSkill(self, faction + PVP_SKILL_4); - skill.revokeSkill(self, faction + PVP_SKILL_5); - } - if (newRank == 8) - { - skill.revokeSkill(self, faction + PVP_SKILL_3); - skill.revokeSkill(self, faction + PVP_SKILL_4); - skill.revokeSkill(self, faction + PVP_SKILL_5); - } - if (newRank == 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_2); - skill.revokeSkill(self, faction + PVP_SKILL_3); - skill.revokeSkill(self, faction + PVP_SKILL_4); - skill.revokeSkill(self, faction + PVP_SKILL_5); - } - if (newRank < 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_1); - skill.revokeSkill(self, faction + PVP_SKILL_2); - skill.revokeSkill(self, faction + PVP_SKILL_3); - skill.revokeSkill(self, faction + PVP_SKILL_4); - skill.revokeSkill(self, faction + PVP_SKILL_5); - } - } - - if (oldRank == 11 && newRank <= 10) - { - skill.revokeSkill(self, faction + PVP_SKILL_5); - - if (newRank == 9) - { - skill.revokeSkill(self, faction + PVP_SKILL_4); - } - if (newRank == 8) - { - skill.revokeSkill(self, faction + PVP_SKILL_3); - skill.revokeSkill(self, faction + PVP_SKILL_4); - } - if (newRank == 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_2); - skill.revokeSkill(self, faction + PVP_SKILL_3); - skill.revokeSkill(self, faction + PVP_SKILL_4); - } - if (newRank < 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_1); - skill.revokeSkill(self, faction + PVP_SKILL_2); - skill.revokeSkill(self, faction + PVP_SKILL_3); - skill.revokeSkill(self, faction + PVP_SKILL_4); - } - } - - if (oldRank == 10 && newRank <= 9) - { - skill.revokeSkill(self, faction + PVP_SKILL_4); - - if (newRank == 8) - { - skill.revokeSkill(self, faction + PVP_SKILL_3); - } - if (newRank == 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_2); - skill.revokeSkill(self, faction + PVP_SKILL_3); - } - if (newRank < 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_1); - skill.revokeSkill(self, faction + PVP_SKILL_2); - skill.revokeSkill(self, faction + PVP_SKILL_3); - } - } - - if (oldRank == 9 && newRank <= 8) - { - skill.revokeSkill(self, faction + PVP_SKILL_3); - - if (newRank == 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_2); - } - if (newRank < 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_1); - skill.revokeSkill(self, faction + PVP_SKILL_2); - } - } - - if (oldRank == 8 && newRank <= 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_2); - - if (newRank < 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_1); - } - } - - if (oldRank == 7 && newRank < 7) - { - skill.revokeSkill(self, faction + PVP_SKILL_1); - } - - return SCRIPT_CONTINUE; - } - - - public int OnEnvironmentalDeath(obj_id self) throws InterruptedException - { - - if (!hasObjVar(self, pclib.VAR_BEEN_COUPDEGRACED)) - { - setObjVar(self, pclib.VAR_DEATHBLOW_KILLER, self); - setObjVar(self, pclib.VAR_DEATHBLOW_STAMP, getGameTime()); - } - - messageTo(self, pclib.HANDLER_PLAYER_DEATH, null, 0, false); - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - if (performCriticalHeal(self)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - - utils.setScriptVar(self, "lastKiller", killer); - - if (hasScript(killer, "ai.smuggler_spawn_enemy")) - { - int exceptionSmuggler = 0; - if (hasObjVar(self, "quest.owner")) - { - obj_id smuggler = (getObjIdObjVar(self, "quest.owner")); - if (self != smuggler) - { - exceptionSmuggler = 1; - } - } - - if (exceptionSmuggler == 0) - { - - groundquests.sendSignal(self, "smugglerEnemyIncap"); - messageTo(killer, "smugglerKilled", null, 1f, false); - } - } - - if (callable.hasAnyCallable(self)) - { - obj_id objCallable = callable.getCallable(self, callable.CALLABLE_TYPE_RIDEABLE); - if (exists(objCallable) && isIdValid(objCallable)) - { - callable.storeCallable(self, objCallable); - } - } - - int vehicleBuff = buff.getBuffOnTargetFromGroup(self, "vehicle"); - if (vehicleBuff != 0) - { - buff.removeBuff(self, vehicleBuff); - } - - if (buff.hasBuff(self, "incapWeaken")) - { - pclib.killPlayer(self, killer, true); - return SCRIPT_CONTINUE; - } - else - { - buff.applyBuff(self, "incapWeaken"); - } - - int recapacitateTimer = 10; - - float recapacitateModified = ((float)getEnhancedSkillStatisticModifierUncapped(self, "resistance_incapacitation")); - if (recapacitateModified > 0) - { - recapacitateTimer -= recapacitateModified; - if (recapacitateTimer <= 2) - { - recapacitateTimer = 2; - } - sendSystemMessage(self, SID_INCAPACITATION_DURATION_REDUCED); - } - - CustomerServiceLog("player_death", "Player %TU is incapacitated by %TT", self, killer); - - if (!isIdValid(killer)) - { - killer = self; - } - - if (killer == self) - { - sendSystemMessage(self, SID_VICTIM_INCAPACITATED); - } - else - { - prose_package ppToVictim = prose.getPackage(PROSE_VICTIM_INCAP, killer); - sendSystemMessageProse(self, ppToVictim); - } - - if (killer != self) - { - prose_package ppToKiller = prose.getPackage(PROSE_TARGET_INCAP, self); - sendSystemMessageProse(killer, ppToKiller); - } - - utils.removeScriptVar(self, COUPE_DE_GRACE_TARGET); - - utils.setScriptVar(self, "incap.timeStamp", (getGameTime() + recapacitateTimer)); - setCount(self, recapacitateTimer); - - setHealth( self, 0); - combat.doCombatDebuffs(self); - messageTo(self, "recapacitationDelay", null, recapacitateTimer, false); - - clearAllAiEnemyFlags( self ); - dot.removeAllDots(self); - - if (stealth.hasInvisibleBuff(self)) - { - stealth.checkForAndMakeVisible(self); - } - - return SCRIPT_CONTINUE; - } - - - public void clearAllAiEnemyFlags(obj_id self) throws InterruptedException - { - obj_id allEnemies[] = pvpGetPersonalEnemyIds(self); - if (allEnemies == null) - { - return; - } - - for (int i = 0; i < allEnemies.length; ++i) - { - testAbortScript(); - if (isIdValid(allEnemies[i]) && allEnemies[i].isLoaded() && (!isPlayer(allEnemies[i]))) - { - pvpRemoveTempEnemyFlags(self, allEnemies[i]); - pvpRemoveTempEnemyFlags(allEnemies[i], self); - } - } - } - - - public int recapacitationDelay(obj_id self, dictionary params) throws InterruptedException - { - if (getPosture(self) != POSTURE_INCAPACITATED) - { - return SCRIPT_CONTINUE; - } - - if (!combat.clearCombatDebuffs(self)) - { - - messageTo(self, "recapacitationDelay", null, 1, false); - return SCRIPT_CONTINUE; - } - - setHealth( self, 1); - - return SCRIPT_CONTINUE; - } - - - public int requestMissionLocations(obj_id self, dictionary params) throws InterruptedException - { - - obj_id groupObject = getGroupObject(self); - if ((isIdValid(groupObject)) && (params != null) && (params.containsKey("requestMissionLocationsNumber"))) - { - - obj_id[] missions = getMissionObjects(self); - Vector missionLocation = new Vector(); - missionLocation.setSize(0); - - if ((missions != null) && (missions.length > 0)) - { - - int missionIndex = 0; - - for (missionIndex = 0; missionIndex < missions.length; ++missionIndex) - { - testAbortScript(); - if (isIdValid(missions[missionIndex])) - { - - if (getMissionStatus(missions[missionIndex]) > 0) - { - - utils.addElement(missionLocation, getMissionStartLocation(missions[missionIndex])); - } - } - } - } - - dictionary response = new dictionary(); - response.put("requestMissionLocationsNumber", params.getInt("requestMissionLocationsNumber")); - response.put("sender", self); - response.put("senderLocation", getLocation(self)); - - if (missionLocation.size() > 0) - { - response.put("missionLocation", missionLocation); - } - - messageTo(groupObject, "missionLocationResponse", response, 0, false); - } - - group.destroyGroupWaypoint(self); - - return SCRIPT_CONTINUE; - } - - - public int OnAddedToGroup(obj_id self, obj_id groupId) throws InterruptedException - { - if (!hasScript(self, group.SCRIPT_GROUP_MEMBER)) - { - attachScript(self, group.SCRIPT_GROUP_MEMBER); - } - - if (beast_lib.getBeastOnPlayer(self) != null) - { - obj_id beast = beast_lib.getBeastOnPlayer(self); - obj_id beastBCD = beast_lib.getBeastBCD(beast); - messageTo (beastBCD, "ownerGrouped", null, 1, false); - } - - return SCRIPT_CONTINUE; - } - - - public int OnRemovedFromGroup(obj_id self, obj_id groupId) throws InterruptedException - { - if (utils.hasScriptVar(self, "currentHolo")) - { - performance.holographicCleanup(self); - } - - squad_leader.clearRallyPoint(self); - - detachScript(self, group.SCRIPT_GROUP_MEMBER); - - return SCRIPT_CONTINUE; - } - - - public int OnGroupLeaderChanged(obj_id self, obj_id groupId, obj_id newLeader, obj_id oldLeader) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnGroupDisbanded(obj_id self, obj_id group) throws InterruptedException - { - squad_leader.clearRallyPoint(self); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - removeObjVar( self, "noTrade"); - - menu_info_data mid = mi.getMenuItemByType(menu_info_types.COMBAT_DEATH_BLOW); - if (mid == null) - { - int myPosture = getPosture(self); - if (myPosture == POSTURE_INCAPACITATED) - { - if (pvpCanAttack(player, self)) - { - mi.addRootMenu (menu_info_types.COMBAT_DEATH_BLOW, new string_id("","")); - } - } - else if (myPosture == POSTURE_DEAD) - { - if ((group.inSameGroup(self, player) || pclib.hasConsent(player, self))) - { - if (hasCommand(player, "revivePlayer")) - { - int reviveRoot = mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_REVIVE); - - if (hasCommand(player, "resuscitatePlayer")) - { - mi.addSubMenu(reviveRoot, menu_info_types.SERVER_MENU9, SID_RESUSCITATE); - } - } - else if (hasCommand(player, "resuscitatePlayer")) - { - mi.addRootMenu(menu_info_types.SERVER_MENU9, SID_RESUSCITATE); - } - } - } - } - else - { - mid.setServerNotify(true); - } - - { - - obj_id listenTarget = getPerformanceListenTarget(player); - if (isIdValid(listenTarget) && group.inSameGroup(listenTarget, self)) - { - mi.addRootMenu(menu_info_types.SERVER_PERFORMANCE_LISTEN_STOP, performance.SID_RADIAL_PERFORMANCE_LISTEN_STOP); - } - - if (hasScript(self, performance.MUSIC_HEARTBEAT_SCRIPT) && (!isIdValid(listenTarget) || !group.inSameGroup(self, listenTarget))) - { - mi.addRootMenu(menu_info_types.SERVER_PERFORMANCE_LISTEN, performance.SID_RADIAL_PERFORMANCE_LISTEN); - } - - obj_id watchTarget = getPerformanceWatchTarget(player); - - if (watchTarget == self) - { - mi.addRootMenu(menu_info_types.SERVER_PERFORMANCE_WATCH_STOP, performance.SID_RADIAL_PERFORMANCE_WATCH_STOP); - } - else - { - - if (hasScript(self, performance.DANCE_HEARTBEAT_SCRIPT)) - { - mi.addRootMenu(menu_info_types.SERVER_PERFORMANCE_WATCH, performance.SID_RADIAL_PERFORMANCE_WATCH); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item == menu_info_types.COMBAT_DEATH_BLOW) - { - - } - else if (item == menu_info_types.SERVER_MENU9) - { - queueCommand(player, (-1360827551), self, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_MENU1) - { - queueCommand(player, (-915040138), self, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_PERFORMANCE_LISTEN) - { - - dictionary params = new dictionary(); - params.put("target", self); - messageTo(player, "handleListenRadialCmd", params, 0, false); - - sendDirtyObjectMenuNotification(self); - } - else if (item == menu_info_types.SERVER_PERFORMANCE_WATCH) - { - - dictionary params = new dictionary(); - params.put("target", self); - messageTo(player, "handleWatchRadialCmd", params, 0, false); - - sendDirtyObjectMenuNotification(self); - } - else if (item == menu_info_types.SERVER_PERFORMANCE_LISTEN_STOP) - { - - dictionary params = new dictionary(); - messageTo(player, "handleListenRadialCmd", params, 0, false); - - sendDirtyObjectMenuNotification(self); - } - else if (item == menu_info_types.SERVER_PERFORMANCE_WATCH_STOP) - { - - dictionary params = new dictionary(); - messageTo(player, "handleWatchRadialCmd", params, 0, false); - - sendDirtyObjectMenuNotification(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnMadeAuthoritative(obj_id self) throws InterruptedException - { - - String flag = getConfigSetting("GameServer", "skipTutorial"); - if (flag != null && (flag.equals("true") || flag.equals("1"))) - { - setObjVar(self, "skipTutorial", 1); - } - return SCRIPT_CONTINUE; - } - - - public int OnLogin(obj_id self) throws InterruptedException - { - - boolean ctsDisconnectRequested = false; - if (hasObjVar(self, "disableLoginCtsInProgress")) - { - int timeOut = getIntObjVar(self, "disableLoginCtsInProgress"); - if (timeOut > getGameTime()) - { - ctsDisconnectRequested = true; - messageTo(self, "disconnectPlayerCtsCompletedOrInProgress", null, 0.1f, false); - CustomerServiceLog("Login", "dropping character ("+ self + ": "+ getName(self) + ") because of CTS completed or in progress"); - } - else - { - removeObjVar(self, "disableLoginCtsInProgress"); - } - } - - if (!ctsDisconnectRequested && hasObjVar(self, "disableLoginCtsCompleted") && !isUsingAdminLogin(self)) - { - ctsDisconnectRequested = true; - messageTo(self, "disconnectPlayerCtsCompletedOrInProgress", null, 0.1f, false); - CustomerServiceLog("Login", "dropping character ("+ self + ": "+ getName(self) + ") because of CTS completed or in progress"); - } - - if (!utils.hasScriptVar(self, "galaxyMessage.showmessage")) - { - obj_id planetId = getPlanetByName("tatooine"); - if (!isIdNull(planetId)) - { - utils.setScriptVar(self, "galaxyMessage.showmessage", true); - if (hasObjVar(planetId, "galaxyMessage")) - { - String strGalaxyMessage = "\\#FF0000"+utils.getStringObjVar(planetId, "galaxyMessage")+"\\#FFFFFF"; - sendConsoleMessage(self, strGalaxyMessage); - } - else - { - String strGalaxyMessage = "\\#FF0000"+"Welcome to Star Wars Galaxies"+"\\#FFFFFF"; - sendConsoleMessage(self, strGalaxyMessage); - } - - boolean warden = isWarden(self); - if (warden || (getGodLevel(self) >= 10)) - { - String strGalaxyMessage = "\\#FF0000"; - if (!warden) - { - strGalaxyMessage += "Displaying warden MOTD to you even though you are not a warden, because you are of the appropriate god level:\n"; - } - - if (hasObjVar(planetId, "galaxyWardenMessage")) - { - strGalaxyMessage += utils.getStringObjVar(planetId, "galaxyWardenMessage"); - } - else - { - strGalaxyMessage += "Welcome warden"; - } - - strGalaxyMessage += "\\#FFFFFF"; - sendConsoleMessage(self, strGalaxyMessage); - } - } - } - - removeObjVar( self, "noTrade"); - - if (hasObjVar (self, "comingFromTutorial")) - { - removeObjVar (self, "comingFromTutorial"); - attachScript (self, "theme_park.newbie_tutorial.new_player_ribbon"); - } - - if (!hasObjVar( self, "combatLevel") && hasObjVar( self, "clickRespec.combatLevel")) - { - setObjVar(self, "combatLevel", getIntObjVar(self,"clickRespec.combatLevel")); - removeObjVar(self,"clickRespec.combatLevel"); - } - - if (getConfigSetting("GameServer", "combatUpgradeReward") != null) - { - if (!hasScript( self, "cureward.cureward" )) - { - attachScript( self, "cureward.cureward"); - } - } - - obj_id bldg = getTopMostContainer( self ); - if (isIdValid(bldg)) - { - dictionary parms = new dictionary(); - parms.put( "player", self ); - messageTo( bldg, "handlePlayerLogin", parms, 0, false ); - - String bldgName = getTemplateName (bldg); - String setting = getConfigSetting("Dungeon", "Death_Watch"); - - if (bldgName.equals("object/building/general/bunker_allum_mine.iff")) - { - if (setting == null || setting.equals("false") || setting.equals("0")) - { - CustomerServiceLog("DUNGEON_DeathWatchBunker", "*Death Watch Unauthorized Entry: %TU entered the death watch bunker while it was turned off.", self); - } - } - - if (hasObjVar(bldg, "player_structure.condemned")) - { - player_structure.doCondemnedSui(bldg, self); - expelFromBuilding(self); - } - - } - - chatEnterRoom("SWG.system"); - - chatEnterRoom("SWG."+ getGalaxyName() + ".system"); - - chatEnterRoom("SWG."+ getGalaxyName() + "."+ getCurrentSceneName() + ".system"); - - float curScale = getScale(self); - int gender = getGender(self); - int intSpecies = getSpecies(self); - String species = utils.getPlayerSpeciesName(intSpecies); - - float min = 1.0f; - float max = 1.0f; - - if (gender == GENDER_MALE) - { - min = dataTableGetFloat("datatables/player/racial_scale.iff", species, "MALE_MIN"); - max = dataTableGetFloat("datatables/player/racial_scale.iff", species, "MALE_MAX"); - } - else - { - min = dataTableGetFloat("datatables/player/racial_scale.iff", species, "FEMALE_MIN"); - max = dataTableGetFloat("datatables/player/racial_scale.iff", species, "FEMALE_MAX"); - } - - if (min > 0 && max > 0) - { - if (curScale < min) - { - setScale(self, min); - } - else if (curScale > max) - { - setScale(self, max); - } - } - - if (getState(self, STATE_MASK_SCENT) == 1) - { - if (utils.hasScriptVar( self, "scentmask.camokit" )) - { - String kitPlanet = utils.getStringScriptVar(self, "scentmask.camokit"); - String planetName = getCurrentSceneName(); - if (planetName.startsWith("kashyyyk")) - { - planetName = "kashyyyk"; - } - if (!kitPlanet.equals(planetName)) - { - messageTo(self, "removeScentMaskNoNotify", null, 0, false); - } - - } - else - { - messageTo(self, "removeScentMaskNoNotify", null, 0, false); - } - } - if (hasSkill(self, "demo_combat")) - { - revokeSkill(self, "demo_combat"); - } - - boolean needsPrerequisites = true; - int attempts = 0; - while (needsPrerequisites && attempts < 100) - { - testAbortScript(); - ++attempts; - needsPrerequisites = false; - String[] skillList = getSkillListingForPlayer(self); - if (skillList != null) - { - int i = 0; - for (i = 0; i < skillList.length; ++i) - { - testAbortScript(); - String[] prereqs = getSkillPrerequisiteSkills(skillList[i]); - if (prereqs != null) - { - int j = 0; - for (j = 0; j < prereqs.length; ++j) - { - testAbortScript(); - if (! hasSkill(self, prereqs[j])) - { - grantSkill(self, prereqs[j]); - needsPrerequisites = true; - } - } - } - } - } - } - - if (hasObjVar( self, player_structure.VAR_RESIDENCE_BUILDING )) - { - setHouseId( self, getObjIdObjVar( self, player_structure.VAR_RESIDENCE_BUILDING ) ); - removeObjVar( self, player_structure.VAR_RESIDENCE_BUILDING ); - } - - slicing.clearSlicing( self ); - - hq.ejectEnemyFactionOnLogin( self ); - - if (!isIdValid(getGroupObject(self))) - { - obj_id groupWaypoint = getObjIdObjVar(self, "groupWaypoint"); - if (isIdValid(groupWaypoint)) - { - destroyWaypointInDatapad(groupWaypoint, self); - removeObjVar(self, "groupWaypoint"); - } - } - - veteran_deprecated.updateVeteranTime(self); - - if (hasObjVar(self, "renamePerformed")) - { - String old_name = getStringObjVar(self, "renamePerformed"); - removeObjVar(self, "renamePerformed"); - if (old_name != null) - { - if (force_rank.isForceRanked(self)) - { - - force_rank.renameRankMember(self, old_name); - } - } - } - - meditation.endMeditation(self, false); - - if (isIdValid(getGroupObject(self)) && (!hasScript(self, group.SCRIPT_GROUP_MEMBER))) - { - attachScript(self, group.SCRIPT_GROUP_MEMBER); - } - - utils.removeScriptVar(self, COUPE_DE_GRACE_TARGET); - - if (!isInTutorialArea(self)) - { - space_dungeon.verifyPlayerSession(self); - space_dungeon.validateInstanceControllerId(self); - } - - int campXp = getExperiencePoints(self, "camp"); - if (campXp > 0) - { - grantExperiencePoints(self, "scout", campXp ); - grantExperiencePoints(self, "camp", 0-campXp ); - } - - if (!utils.hasScriptVar(self,"bountyConsistencyCheck")) - { - - Vector playerBountyMissionTargetId = new Vector(); - playerBountyMissionTargetId.setSize(0); - - obj_id[] objMissions = getMissionObjects(self); - if (objMissions != null) - { - for (int i = 0; i < objMissions.length; ++i) - { - testAbortScript(); - String missionType = getMissionType(objMissions[i]); - if (missionType.equals("bounty")) - { - if (hasObjVar(objMissions[i], "objTarget")) - { - playerBountyMissionTargetId = utils.addElement(playerBountyMissionTargetId, getObjIdObjVar(objMissions[i], "objTarget")); - } - } - } - } - - obj_id[] bounties = getBountyHunterBounties(self); - if (bounties == null) - { - bounties = new obj_id[0]; - } - - boolean foundMatch = false; - for (int i = 0; i < playerBountyMissionTargetId.size(); ++i) - { - testAbortScript(); - foundMatch = false; - - for (int j = 0; j < bounties.length; ++j) - { - testAbortScript(); - if (((obj_id)(playerBountyMissionTargetId.get(i))) == bounties[j]) - { - foundMatch = true; - break; - } - } - - if (!foundMatch) - { - CustomerServiceLog("bounty_inconsistency", self + " ("+ getName(self) + ") has a bounty mission for "+ ((obj_id)(playerBountyMissionTargetId.get(i))) + " ("+ getPlayerName(((obj_id)(playerBountyMissionTargetId.get(i)))) + ") but doesn't have a corresponding bounty"); - - dictionary d = new dictionary(); - d.put("target", ((obj_id)(playerBountyMissionTargetId.get(i)))); - messageTo(self, "handleBountyMissionIncomplete", d, 10.0f, false); - } - } - - for (int k = 0; k < bounties.length; ++k) - { - testAbortScript(); - foundMatch = false; - - for (int l = 0; l < playerBountyMissionTargetId.size(); ++l) - { - testAbortScript(); - if (((obj_id)(playerBountyMissionTargetId.get(l))) == bounties[k]) - { - foundMatch = true; - break; - } - } - - if (!foundMatch) - { - CustomerServiceLog("bounty_inconsistency", self + " ("+ getName(self) + ") has a bounty for "+ bounties[k] + " ("+ getPlayerName(bounties[k]) + ") but doesn't have a corresponding bounty misssion"); - - removeJediBounty(bounties[k], self); - } - } - - utils.setScriptVar(self,"bountyConsistencyCheck",1); - } - - if (!utils.hasScriptVar(self,"shipShieldOneTimeRebalance")) - { - obj_id[] objPcds = space_transition.findShipControlDevicesForPlayer(self); - if (objPcds != null && objPcds.length > 0) - { - for (int i = 0; i < objPcds.length; ++i) - { - testAbortScript(); - obj_id objShip = space_transition.getShipFromShipControlDevice(objPcds[i]); - if (isIdValid(objShip)) - { - space_combat.simpleShieldRatioRebalance(objShip); - } - } - } - - utils.setScriptVar(self,"shipShieldOneTimeRebalance",1); - } - - armor.calculateWornArmor(self); - - squad_leader.validateRallyPoint(self); - - if (!utils.hasScriptVar(self, "waitingOnCloneRespawn")) - { - int posture = getPosture(self); - if (posture == POSTURE_DEAD) - { - if (!hasObjVar(self, pclib.VAR_BEEN_COUPDEGRACED)) - { - setObjVar(self, pclib.VAR_DEATHBLOW_KILLER, self); - setObjVar(self, pclib.VAR_DEATHBLOW_STAMP, getGameTime()); - } - - messageTo(self, pclib.HANDLER_PLAYER_DEATH, null, 5, false); - } - else - { - if (hasObjVar(self, pclib.VAR_BEEN_COUPDEGRACED)) - { - removeObjVar(self, pclib.VAR_BEEN_COUPDEGRACED); - } - } - } - else - { - - messageTo(self, "handleCloneRespawn", null, 1f, false); - } - - if (groundquests.hasCompletedQuest(self, "ep3_avatar_self_destruct")) - { - badge.grantBadge(self, "bdg_kash_avatar_zssik"); - } - - if (!utils.hasScriptVar(self, "performance.buildabuff.buffComponentKeys") && buff.hasBuff(self, "buildabuff_inspiration")) - { - buff.removeBuff(self, "buildabuff_inspiration"); - } - - if (getLocation(self).area == "dungeon1") - { - if (trial.getTop(self) == self) - { - warpPlayer( self, "tatooine", 0, 0, 0, null, 0, 0, 0, null, false ); - } - } - - if (utils.isProfession(self, utils.FORCE_SENSITIVE) && getLevel(self) > 3) - { - if (!buff.isInStance(self) && !buff.isInFocus(self)) - { - messageTo(self, "applyJediStance", null, 1.0f, false); - } - } - - if (utils.isProfession(self, utils.SMUGGLER)) - { - messageTo(self, "applySmugglingBonuses", null, 1.0f, false); - } - - int cityId = getCitizenOfCityId(self); - if (cityId > 0 && !utils.hasScriptVar(self, "recieved_city_motd")) - { - obj_id cityHall = cityGetCityHall(cityId); - dictionary outparams = new dictionary(); - outparams.put("player", self); - messageTo(cityHall, "msgCheckMyCityMotd", outparams, 0, false); - } - - return SCRIPT_CONTINUE; - } - - - public int disconnectPlayerCtsCompletedOrInProgress(obj_id self, dictionary params) throws InterruptedException - { - setObjVar(self, "safeLogout", 1); - disconnectPlayer(self); - return SCRIPT_CONTINUE; - } - - - public int ctsCompletedForCharacter(obj_id self, dictionary params) throws InterruptedException - { - - if (utils.hasScriptVar(self, cts.SCRIPTVAR_CTS_ITEM_ID)) - { - final obj_id ctsItem = utils.getObjIdScriptVar(self, cts.SCRIPTVAR_CTS_ITEM_ID); - if (isIdValid(ctsItem)) - { - CustomerServiceLog("CharacterTransfer", "destroying item "+ ctsItem + " used for ingame CTS by character "+ self); - destroyObject(ctsItem); - } - } - - setObjVar(self, "disableLoginCtsCompleted", getCalendarTime()); - messageTo(self, "disconnectPlayerCtsCompletedOrInProgress", null, 0.1f, false); - return SCRIPT_CONTINUE; - } - - - public int applyJediStance(obj_id self, dictionary params) throws InterruptedException - { - if (hasSkill(self, "expertise_fs_path_cautious_nature_1")) - { - buff.applyBuff(self, self, jedi.JEDI_STANCE); - } - else - { - buff.applyBuff(self, self, jedi.JEDI_FOCUS); - } - - return SCRIPT_CONTINUE; - } - - - public int applySmugglingBonuses(obj_id self, dictionary params) throws InterruptedException - { - removeSmugglingBuffs(self); - - messageTo(self, "addSmugglingBuffs", null, 1.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int addSmugglingBuffs(obj_id self, dictionary params) throws InterruptedException - { - int smUnderworld = (int)getSkillStatisticModifier(self, "expertise_underworld_boss_bonus"); - int rangeBonus = (int)getSkillStatisticModifier(self, "expertise_sm_rank_range_buff"); - int damageBonus = (int)getSkillStatisticModifier(self, "expertise_sm_rank_damage_buff"); - - float underworldFaction = factions.getFactionStanding(self, "underworld"); - - int smugglerTier = smuggler.getSmugglerRank(underworldFaction); - - switch(smugglerTier) - { - case 1: - if (smUnderworld > 0) - { - buff.applyBuff(self, "sm_underworld_boss_1"); - } - if (rangeBonus > 0) - { - buff.applyBuff(self, "sm_underworld_range_1"); - } - if (damageBonus > 0) - { - buff.applyBuff(self, "sm_underworld_damage_1"); - } - break; - case 2: - if (smUnderworld > 0) - { - buff.applyBuff(self, "sm_underworld_boss_2"); - } - if (rangeBonus > 0) - { - buff.applyBuff(self, "sm_underworld_range_2"); - } - if (damageBonus > 0) - { - buff.applyBuff(self, "sm_underworld_damage_2"); - } - break; - case 3: - if (smUnderworld > 0) - { - buff.applyBuff(self, "sm_underworld_boss_3"); - } - if (rangeBonus > 0) - { - buff.applyBuff(self, "sm_underworld_range_3"); - } - if (damageBonus > 0) - { - buff.applyBuff(self, "sm_underworld_damage_3"); - } - break; - default: break; - } - - messageTo(self, "recalcArmor", null, 1, false); - messageTo(self, "recalcWeaponRange", null, 1, false); - - return SCRIPT_CONTINUE; - } - - - public int recalcWeaponRange(obj_id self, dictionary params) throws InterruptedException - { - obj_id tempWeapon = getObjectInSlot(self, "hold_r"); - - if (isIdValid(tempWeapon)) - { - weapons.adjustWeaponRangeForExpertise(self, tempWeapon, true); - } - - return SCRIPT_CONTINUE; - } - - - public void removeSmugglingBuffs(obj_id who) throws InterruptedException - { - buff.removeBuff(who, "sm_underworld_boss_1"); - buff.removeBuff(who, "sm_underworld_boss_2"); - buff.removeBuff(who, "sm_underworld_boss_3"); - buff.removeBuff(who, "sm_underworld_range_1"); - buff.removeBuff(who, "sm_underworld_range_2"); - buff.removeBuff(who, "sm_underworld_range_3"); - buff.removeBuff(who, "sm_underworld_damage_1"); - buff.removeBuff(who, "sm_underworld_damage_2"); - buff.removeBuff(who, "sm_underworld_damage_3"); - - messageTo(who, "recalcArmor", null, 1, false); - messageTo(who, "recalcWeaponRange", null, 1, false); - } - - - public int removeSmugglingBonuses(obj_id self, dictionary params) throws InterruptedException - { - removeSmugglingBuffs(self); - - return SCRIPT_CONTINUE; - } - - - public int handlerRemoveGroupBuffEffect(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - int[] buffList = params.getIntArray("buffList"); - - if (buffList == null || buffList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - buff.removeGroupBuffEffect(self, buffList); - - return SCRIPT_CONTINUE; - } - - - public int OnNewbieTutorialResponse(obj_id self, String action) throws InterruptedException - { - if (action.equals("clientReady")) - { - - int playerState = getState(self, STATE_DISGUISE); - - if (playerState > 0) - { - int shapechange = buff.getBuffOnTargetFromGroup(self, "shapechange"); - - if (shapechange == 0) - { - revertObjectAppearance(self); - } - } - - location myLoc = getLocation(self); - - if (hasTriggerVolume(self, "group_buff_breach")) - { - obj_id groupId = getGroupObject(self); - - if (isIdValid(groupId)) - { - - obj_id[] groupMembers = getGroupMemberIds(groupId); - - if (groupMembers != null && groupMembers.length > 0) - { - - int[] buffList = buff.getOwnedGroupBuffs(self); - dictionary dict = new dictionary(); - dict.put("buffList", buffList); - - for (int i = 0; i < groupMembers.length; ++i) - { - testAbortScript(); - - location playerLoc = getLocation(groupMembers[i]); - - if (playerLoc == null) - { - messageTo(groupMembers[i], "handlerRemoveGroupBuffEffect", dict, 1, false); - continue; - } - - if (!myLoc.area.equals(playerLoc.area)) - { - messageTo(groupMembers[i], "handlerRemoveGroupBuffEffect", dict, 1, false); - continue; - } - - float distance = getDistance(myLoc, playerLoc); - - if (distance > 110.0f) - { - messageTo(groupMembers[i], "handlerRemoveGroupBuffEffect", dict, 1, false); - continue; - } - } - } - } - } - - int[] allBuffs = buff.getAllBuffs(self); - - if (allBuffs != null && allBuffs.length > 0) - { - for (int i = 0; i < allBuffs.length; ++i) - { - testAbortScript(); - if (buff.isAuraBuff(allBuffs[i])) - { - obj_id caster = buff.getBuffCaster(self, allBuffs[i]); - - if (!isIdValid(caster) || !exists(caster)) - { - buff.removeBuff(self, allBuffs[i]); - continue; - } - - location casterLoc = getLocation(caster); - - if (!myLoc.area.equals(casterLoc.area)) - { - buff.removeBuff(self, allBuffs[i]); - continue; - } - - float distance = getDistance(myLoc, casterLoc); - - if (distance > 110.0f) - { - buff.removeBuff(self, allBuffs[i]); - continue; - } - } - } - } - - String halloweenRunning = getConfigSetting("GameServer", "halloween"); - - if (halloweenRunning == null) - { - if (hasObjVar(self, event_perk.COUNTER_TIMESTAMP)) - { - removeObjVar(self, event_perk.COUNTER_TIMESTAMP); - } - - if (hasObjVar(self, event_perk.COUNTER)) - { - removeObjVar(self, event_perk.COUNTER); - } - - if (hasObjVar(self, event_perk.COUNTER_RESTARTTIME)) - { - removeObjVar(self, event_perk.COUNTER_RESTARTTIME); - } - } - - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - - if (lifedayRunning == null) - { - if (hasObjVar(self, "lifeday")) - { - removeObjVar(self, "lifeday"); - } - } - if (lifedayRunning != null) - { - if (lifeDayNewDay(self)) - { - if (hasObjVar(self, "lifeday")) - { - removeObjVar(self, "lifeday"); - } - - if (buff.hasBuff(self, "event_lifeday_imperial_competitive")) - { - buff.removeBuff(self, "event_lifeday_imperial_competitive"); - } - if (buff.hasBuff(self, "event_lifeday_rebel_competitive")) - { - buff.removeBuff(self, "event_lifeday_rebel_competitive"); - } - if (buff.hasBuff(self, "event_lifeday_imperial_present_counter")) - { - buff.removeBuff(self, "event_lifeday_imperial_present_counter"); - } - if (buff.hasBuff(self, "event_lifeday_rebel_tree_counter")) - { - buff.removeBuff(self, "event_lifeday_rebel_tree_counter"); - } - } - } - - if (hasScript(self, "systems.respec.click_combat_respec")) - { - detachScript(self, "systems.respec.click_combat_respec"); - } - - String skillTemplate = getSkillTemplate(self); - String workingSkill = getWorkingSkill(self); - if (skillTemplate == null || skillTemplate.equals("") || skillTemplate.equals("a")) - { - int combatLevel = respec.getOldCombatLevel(self); - obj_id respecDevice = utils.getStaticItemInBankOrInventory(self, "item_respec_token_01_01"); - - if (hasObjVar(self, "combatLevel")) - { - combatLevel = getIntObjVar(self, "combatLevel"); - } - - else - { - if (isIdValid(respecDevice)) - { - combatLevel = getIntObjVar(respecDevice, "combatLevel"); - } - } - - if (combatLevel > 80) - { - combatLevel = 80; - } - - setObjVar( self, "combatLevel", combatLevel); - - setObjVar( self, "clickRespec.combatLevel", combatLevel); - setObjVar( self, "clickRespec.npeRespec", 1); - - if (!isIdValid(respecDevice)) - { - respecDevice = static_item.createNewItemFunction("item_respec_token_01_01", self); - if (isIdValid(respecDevice)) - { - setObjVar(respecDevice, "combatLevel", combatLevel); - setObjVar(respecDevice, "highestLevel", true ); - } - } - - attachScript(self, "systems.respec.click_combat_respec"); - - messageTo(self, "delayRespecInstructions", null, 1, false); - } - - if (hasObjVar(self, "npe.skippingTutorial")) - { - location origin = getLocation (self); - location fighting = new location (3521f, 0.0f, -4821f, origin.area); - location crafty = new location (3309.0f, 6.0f, -4785.0f, origin.area); - String profession = getSkillTemplate (self); - - obj_id objInv = utils.getInventoryContainer(self); - - String questNewbieStart = "quest/speeder_quest"; - String questNewbieStartBH = "quest/speeder_quest"; - String questCrafterEntertainer = "quest/tatooine_eisley_noncombat"; - - int crafter = profession.indexOf ("trader"); - int entertainer = profession.indexOf ("entertainer"); - int bountyhunter = profession.indexOf ("bounty_hunter"); - if (crafter > -1 || entertainer > -1) - { - if (!groundquests.isQuestActiveOrComplete(self, questCrafterEntertainer)) - { - - groundquests.grantQuest(self, questCrafterEntertainer); - } - } - else if (bountyhunter > -1) - { - if (groundquests.hasCompletedQuest (self, questNewbieStartBH) || groundquests.isQuestActive (self, questNewbieStartBH)) - { - detachScript (self, "npe.handoff_to_tatooine"); - } - else - { - groundquests.requestGrantQuest (self, questNewbieStartBH); - } - - } - else - { - if (groundquests.hasCompletedQuest (self, questNewbieStart) || groundquests.isQuestActive (self, questNewbieStart)) - { - detachScript (self, "npe.handoff_to_tatooine"); - } - else - { - groundquests.requestGrantQuest (self, questNewbieStart); - } - - } - - if (crafter > -1) - { - messageTo(self, "handleSurveyToolbarSetup", null, 5, false); - } - - static_item.createNewItemFunction("item_npe_uniform_crate_01_01", objInv); - - npe.giveProfessionWeapon(self); - - removeObjVar(self, "npe.skippingTutorial"); - - int combatLevel = getLevel( self ); - if (combatLevel < 5) - { - respec.autoLevelPlayer(self, 5, false); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnCSCreateItem(obj_id self, obj_id container, String staticItemName) throws InterruptedException - { - gmlib.generateStaticItem( container, staticItemName ); - return SCRIPT_CONTINUE; - } - - - public int delayRespecInstructions(obj_id self, dictionary params) throws InterruptedException - { - int pid = createSUIPage( sui.SUI_MSGBOX, self, self, "noHandler"); - setSUIProperty(pid, "this", "Size", "475,575"); - setSUIProperty(pid, "this", "Location", "100,100"); - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, "@click_respec:respec_title"); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, "@click_respec:respec_message"); - sui.msgboxButtonSetup(pid, sui.OK_ONLY); - showSUIPage(pid); - flushSUIPage(pid); - - return SCRIPT_CONTINUE; - } - - - public int OnRemovingFromWorld(obj_id self) throws InterruptedException - { - removeObjVar( self, "conversation"); - return SCRIPT_CONTINUE; - } - - - public int handleLoginLocResolved(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("LOGIN_LOC", "("+self+":"+getPlayerObject(self)+") "+getName(self)+": warp callback entered @ loc="+getLocation(self).toString()+" world_loc="+getWorldLocation(self).toString()); - - String prompt = "Due to a system error involving invalid login coordinates, an attempt has been made to warp you to a local starport."; - prompt += " We apologize for the inconvenience."; - - sui.msgbox(self, prompt); - return SCRIPT_CONTINUE; - } - - - public int handleStatProfileSUI(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "screwedStats.opt")) - { - return SCRIPT_CONTINUE; - } - - String[] opt = utils.getStringArrayScriptVar(self, "screwedStats.opt"); - utils.removeScriptVar(self, "screwedStats.opt"); - - int idx = sui.getListboxSelectedRow(params); - if (idx == -1 || idx == 0) - { - sendSystemMessageTestingOnly(self, "You will be asked the previous question on each log-in until the problem is rectified."); - return SCRIPT_CONTINUE; - } - - if (opt == null || opt.length == 0) - { - return SCRIPT_CONTINUE; - } - - if (idx < 1 || idx >= opt.length) - { - return SCRIPT_CONTINUE; - } - - dictionary racial_mods = null; - String template = utils.getTemplateFilenameNoPath(self); - if (template != null && !template.equals("")) - { - if (template.endsWith(".iff")) - { - template = template.substring(0, template.length() - 4); - } - - String racial_tbl = "datatables/creation/racial_mods.iff"; - int templateRow = 0; - if (getGender(self) == GENDER_MALE) - { - templateRow = dataTableSearchColumnForString(template, 0, racial_tbl); - } - else - { - templateRow = dataTableSearchColumnForString(template, 1, racial_tbl); - } - - racial_mods = dataTableGetRow(racial_tbl, templateRow); - } - - if (racial_mods == null || racial_mods.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - String profile = opt[idx]; - if (profile == null || profile.equals("") || profile.equals("none")) - { - return SCRIPT_CONTINUE; - } - - dictionary prof_mods = dataTableGetRow("datatables/creation/profession_mods.iff", profile); - for (int x = 0; x < NUM_ATTRIBUTES; x++) - { - testAbortScript(); - String aname = ""; - switch ( x ) - { - case 0: - aname = "health"; - break; - case 1: - aname = "constitution"; - break; - case 2: - aname = "action"; - break; - case 3: - aname = "stamina"; - break; - case 4: - aname = "mind"; - break; - case 5: - aname = "willpower"; - break; - } - - int newval = racial_mods.getInt(aname) + prof_mods.getInt(aname); - setMaxAttrib(self, x, newval); - } - - healing.fullHeal(self); - - String prompt = " We apologize for any inconveniences this may cause."; - - sui.msgbox(self, prompt); - return SCRIPT_CONTINUE; - } - - - public int OnLogout(obj_id self) throws InterruptedException - { - if (hasObjVar(self, pclib.VAR_CONSENT_FROM_ID)) - { - pclib.relinquishConsents(self); - } - - self.getScriptVars().remove(veteran_deprecated.SCRIPTVAR_VETERAN_LOGGED_IN); - - obj_id objBuilding = getTopMostContainer(self); - if (isIdValid(objBuilding) && objBuilding != self) - { - if (hasScript(objBuilding, "planet_map.active_registered")) - { - dictionary dctParams = new dictionary(); - dctParams.put("objItem", self); - messageTo(objBuilding, "removeRegistrant", dctParams, 0, false); - } - - location buildingEjectionPoint = getBuildingEjectLocation(objBuilding); - if (buildingEjectionPoint != null) - { - setObjVar(self, "building_ejection_point", buildingEjectionPoint); - } - } - else - { - removeObjVar(self, "building_ejection_point"); - } - - if (utils.hasScriptVar(self, "battlefield.queue")) - { - String battlefieldName = utils.getStringScriptVar(self, "battlefield.queue"); - obj_id controller = null; - - if (battlefieldName != null || battlefieldName.length() > 0) - { - controller = utils.getObjIdScriptVar(self, "battlefield."+ battlefieldName); - } - - if (isIdValid(controller)) - { - dictionary params = new dictionary(); - - params.put("player", self); - - if (factions.isRebel(self)) - { - params.put("faction", factions.FACTION_FLAG_REBEL); - } - else if (factions.isImperial(self)) - { - params.put("faction", factions.FACTION_FLAG_IMPERIAL); - } - - messageTo(controller, "removePlayerFromQueue", params, 1.0f, false); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnUnloadedFromMemory(obj_id self) throws InterruptedException - { - chatExitRoom("SWG.system"); - - chatExitRoom("SWG."+ getGalaxyName() + ".system"); - - chatExitRoom("SWG."+ getGalaxyName() + "."+ getCurrentSceneName() + ".system"); - - return SCRIPT_CONTINUE; - } - - - public int OnImmediateLogout(obj_id self) throws InterruptedException - { - self.getScriptVars().remove(veteran_deprecated.SCRIPTVAR_VETERAN_LOGGED_IN); - - if (utils.hasScriptVar(self, "profit")) - { - - int startMoney = utils.getIntScriptVar(self, "profit"); - int endMoney = getTotalMoney(self); - - utils.removeScriptVar(self, "profit"); - - String profitThreshold = getConfigSetting("GameServer", "profitLoggingThreshold"); - if (profitThreshold == null || profitThreshold.equals("")) - { - - profitThreshold = "500000"; - } - if (utils.stringToInt(profitThreshold) > -1) - { - - if ((endMoney - startMoney) > utils.stringToInt(profitThreshold)) - { - - CustomerServiceLog("Wealth", "Extraordinary Profit: "+ getName(self) + " ("+ self + ") logged in with "+ startMoney + " credits and logged out with "+ endMoney + " credits, for a profit of "+ (endMoney - startMoney) + " credits"); - } - } - } - - if (guild.hasWindowPid(self)) - { - guild.removeWindowPid(self); - } - - int vehicleBuff = buff.getBuffOnTargetFromGroup(self, "vehicle"); - if (vehicleBuff != 0) - { - buff.removeBuff(self, vehicleBuff); - } - - if (callable.hasAnyCallable(self)) - { - callable.storeCallables(self); - } - - removeObjVar(self, "surveying.sampleLocation"); - - if (hasObjVar(self, "safeLogout")) - { - if (getIntObjVar(self, "safeLogout") == 1) - { - return SCRIPT_CONTINUE; - } - - } - obj_id building = getTopMostContainer(self); - - if (isIdValid(building)) - { - if (hasObjVar(building, "safeLogout") && getIntObjVar(building, "safeLogout") == 1) - { - return SCRIPT_CONTINUE; - } - - if (hasScript(building, force_rank.SCRIPT_ENCLAVE_CONTROLLER)) - { - if (!force_rank.isPlayersEnclave(building, self)) - { - expelFromBuilding(self); - } - } - } - - return SCRIPT_OVERRIDE; - } - - - public int OnAboutToReceiveItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - int got = getGameObjectType(item); - - if (isGameObjectTypeOf(got, GOT_misc_container_wearable)) - { - obj_id belt = getObjectInSlot(self, "utility_belt"); - if (isIdValid(belt) && isGameObjectTypeOf(belt, GOT_misc_container_wearable)) - { - - obj_id inv = utils.getInventoryContainer(self); - putInOverloaded(belt, inv); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnReceivedItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - int got = getGameObjectType(item); - if (isGameObjectTypeOf(got, GOT_armor) && !isGameObjectTypeOf(got, GOT_armor_psg)) - { - armor.calculateWornArmor(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnLostItem(obj_id self, obj_id destContainer, obj_id transferer, obj_id item) throws InterruptedException - { - int got = getGameObjectType(item); - if (isGameObjectTypeOf(got, GOT_armor) && !isGameObjectTypeOf(got, GOT_armor_psg)) - { - armor.calculateWornArmor(self); - } - - if (isGameObjectTypeOf(got, GOT_weapon)) - { - combat.cacheCombatData(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnTransferred(obj_id self, obj_id src, obj_id dest, obj_id transferer) throws InterruptedException - { - if ((pet_lib.isMount(src)) || (pet_lib.isMount(dest)) || (vehicle.isVehicle(src)) || (vehicle.isVehicle(dest))) - { - movement.refresh(self); - } - - return SCRIPT_CONTINUE; - } - - - public int handleEjection(obj_id self, dictionary params) throws InterruptedException - { - obj_id sender = null; - if (params == null || params.isEmpty()) - { - sender = getTopMostContainer(self); - } - else - { - sender = params.getObjId("sender"); - } - - if (!isIdValid(sender)) - { - return SCRIPT_CONTINUE; - } - - location there = getBuildingEjectLocation(sender); - if (there == null) - { - return SCRIPT_CONTINUE; - } - - pclib.sendToAnyLocation(self, there, null); - return SCRIPT_CONTINUE; - } - - - public int cmdEject(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - dictionary outparams = new dictionary(); - outparams.put( "loc", getLocation( self ) ); - messageTo( self, "handleDelayedEjection", outparams, 10.f, false ); - - sendSystemMessage( self, SID_SYS_EJECT_REQUEST ); - - return SCRIPT_CONTINUE; - } - - - public int handleDelayedEjection(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - if (getLocation(self).area == "tutorial") - { - return SCRIPT_CONTINUE; - } - - location loc = params.getLocation( "loc"); - location curloc = getLocation( self ); - if (getDistance( loc, curloc ) > 1f) - { - - sendSystemMessage( self, SID_SYS_EJECT_FAIL_MOVE ); - return SCRIPT_CONTINUE; - } - - obj_id instanceController = instance.getAreaInstanceController(self); - - if (isIdValid(instanceController)) - { - String instanceName = instance.getInstanceName(instanceController); - instance.requestExitPlayer(instanceName, self); - return SCRIPT_CONTINUE; - } - - { - obj_id dungeon_id = space_dungeon.getDungeonIdForPlayer(self); - if (isValidId(dungeon_id) && exists(dungeon_id)) - { - return SCRIPT_CONTINUE; - - } - } - - obj_id container = getTopMostContainer( self ); - obj_id building = null; - if (isIdValid(container)) - { - if (isGameObjectTypeOf( container, GOT_building ) && hasScript( container, "structure.permanent_structure" )) - { - ejectPlayerFromBuilding(self, container); - } - return SCRIPT_CONTINUE; - } - - obj_id[] near = getNonCreaturesInRange( getWorldLocation(self), 128f ); - - location here = getWorldLocation(self); - - obj_id closest = null; - float maxdist = 9999.f; - for (int i=0; i 0) - { - if (transferBankCreditsFromNamedAccount(money.ACCT_NPC_LOOT, self, cash, null, null, null)) - { - utils.moneyInMetric(corpseId, money.ACCT_NPC_LOOT, cash); - - withdrawCashFromBank(self, cash, corpse.HANDLER_COINS_LOOTED, corpse.HANDLER_COINLOOT_FAILED, params); - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleUnconsentMenu(obj_id self, dictionary params) throws InterruptedException - { - int btnPressed = sui.getIntButtonPressed(params); - switch(btnPressed) - { - case sui.BP_CANCEL: - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, pclib.VAR_CONSENT_TO_ID)) - { - obj_id[] consentTo = getObjIdArrayObjVar(self, pclib.VAR_CONSENT_TO_ID); - if ((consentTo == null) || (consentTo.length == 0)) - { - - } - else - { - obj_id target = consentTo[idx]; - queueCommand(self, (-1562441686), null, getPlayerFullName(target), COMMAND_PRIORITY_DEFAULT); - return SCRIPT_CONTINUE; - } - } - - sendSystemMessage(self, SID_CONSENT_TO_EMPTY); - return SCRIPT_CONTINUE; - } - - - public int handleConsentToLogout(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_OVERRIDE; - } - - obj_id consented = params.getObjId(corpse.DICT_PLAYER_ID); - obj_id[] corpses = getObjIdArrayObjVar(self, pclib.VAR_CORPSE_ID); - if (corpses != null) - { - corpse.revokeCorpseConsent(corpses, consented); - } - - Vector consentToList = getResizeableObjIdArrayObjVar(self, pclib.VAR_CONSENT_TO_ID); - if (consentToList != null) - { - consentToList = utils.removeElement(consentToList, consented); - if ((consentToList == null) || (consentToList.size() == 0)) - { - removeObjVar(self, pclib.VAR_CONSENT_TO_ID); - return SCRIPT_CONTINUE; - } - - setObjVar(self, pclib.VAR_CONSENT_TO_ID, consentToList, resizeableArrayTypeobj_id); - } - - return SCRIPT_CONTINUE; - } - - - public int handleReceivedConsent(obj_id self, dictionary params) throws InterruptedException - { - obj_id consenter = params.getObjId(pclib.DICT_CONSENTER_ID); - - Vector consentFrom = getResizeableObjIdArrayObjVar(self, pclib.VAR_CONSENT_FROM_ID); - if (consentFrom == null) - { - Vector newConsentFrom = new Vector(); - newConsentFrom.setSize(0); - consentFrom = newConsentFrom; - } - else - { - if (utils.getElementPositionInArray(consentFrom, consenter) > -1) - { - return SCRIPT_CONTINUE; - } - } - - consentFrom = utils.addElement(consentFrom, consenter); - - setObjVar(self, pclib.VAR_CONSENT_FROM_ID, consentFrom, resizeableArrayTypeobj_id); - - prose_package pp = prose.getPackage(PROSE_GOT_CONSENT, getPlayerFullName(consenter)); - sendSystemMessageProse(self, pp); - - return SCRIPT_CONTINUE; - } - - - public int handleReceivedUnconsent(obj_id self, dictionary params) throws InterruptedException - { - obj_id consenter = params.getObjId(pclib.DICT_CONSENTER_ID); - - Vector consentFrom = getResizeableObjIdArrayObjVar(self, pclib.VAR_CONSENT_FROM_ID); - if (consentFrom != null) - { - int idx = utils.getElementPositionInArray(consentFrom, consenter); - if (idx > -1) - { - consentFrom = utils.removeElementAt(consentFrom, idx); - - if ((consentFrom == null) || (consentFrom.size() == 0)) - { - removeObjVar(self, pclib.VAR_CONSENT_FROM_BASE); - } - else - { - setObjVar(self, pclib.VAR_CONSENT_FROM_ID, consentFrom, resizeableArrayTypeobj_id); - } - - prose_package pp = prose.getPackage(PROSE_LOST_CONSENT, getPlayerFullName(consenter)); - sendSystemMessageProse(self, pp); - } - } - return SCRIPT_CONTINUE; - } - - - public int handleCorpseCoinLoot(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id corpseId = params.getObjId(corpse.DICT_CORPSE_ID); - int cash = params.getInt(corpse.DICT_COINS); - - if (isIdValid(corpseId)) - { - obj_id nullId = null; - queueCommand(self, (-1939113026), null, Integer.toString(cash), COMMAND_PRIORITY_DEFAULT); - - obj_id gid = getGroupObject(self); - if (isIdValid(gid)) - { - group.notifyCoinLoot(gid, self, corpseId, cash); - } - else - { - prose_package pp = prose.getPackage(PROSE_COIN_LOOT_NO_TARGET, null, nullId, cash); - sendSystemMessageProse(self, pp); - } - CustomerServiceLog("Loot", "("+ self + ") "+ getName(self) + " looted "+ cash + " credits from ("+ corpseId + ") "+ getName(corpseId)); - - obj_id cInv = utils.getInventoryContainer(corpseId); - if (isIdValid(cInv)) - { - obj_id[] corpseContents = corpse.getValidLootContents(getContents(cInv)); - if (corpseContents == null || corpseContents.length <= 0) - { - messageTo(corpseId, "handleCorpseExpire", null, 2, true); - return SCRIPT_CONTINUE; - } - else - { - return SCRIPT_CONTINUE; - } - } - - messageTo(corpseId, "handleCorpseExpire", null, 2, true); - } - - return SCRIPT_CONTINUE; - } - - - public int handleCorpseCoinLootFailed(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - obj_id corpseId = params.getObjId(corpse.DICT_CORPSE_ID); - int cash = params.getInt(corpse.DICT_COINS); - - prose_package pp = prose.getPackage(PROSE_COIN_LOOT_FAILED, null, corpseId, cash); - sendSystemMessageProse(self, pp); - - int got = getGameObjectType(corpseId); - if (got == GOT_corpse) - { - CustomerServiceLog("Death", "("+ self + ") "+ getName(self) + " FAILED to loot "+ cash + " credits from ("+ corpseId + ") "+ getName(corpseId)); - } - else - { - CustomerServiceLog("Loot", "("+ self + ") "+ getName(self) + " FAILED to loot "+ cash + " credits from ("+ corpseId + ") "+ getName(corpseId)); - } - - return SCRIPT_CONTINUE; - } - - - public int handleCorpseExpire(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_OVERRIDE; - } - - obj_id corpseId = params.getObjId(corpse.DICT_CORPSE_ID); - if (isIdValid(corpseId)) - { - obj_id[] corpses = getObjIdArrayObjVar(self, pclib.VAR_CORPSE_ID); - if (utils.getElementPositionInArray(corpses, corpseId) > -1) - { - sendSystemMessage(self, SID_CORPSE_EXPIRED); - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleCorpseWaypointUpdate(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_OVERRIDE; - } - - obj_id waypoint = params.getObjId(corpse.DICT_CORPSE_WAYPOINT); - location loc = params.getLocation(corpse.DICT_CORPSE_LOC); - - setWaypointLocation(waypoint, loc); - return SCRIPT_CONTINUE; - } - - - public int handleCorpseCleanup(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - - return SCRIPT_OVERRIDE; - } - - obj_id corpseId = params.getObjId(corpse.DICT_CORPSE_ID); - obj_id waypoint = params.getObjId(corpse.DICT_CORPSE_WAYPOINT); - - destroyWaypointInDatapad(waypoint, self); - - Vector corpses = utils.getResizeableObjIdBatchObjVar(self, pclib.VAR_CORPSE_ID); - Vector killers = utils.getResizeableObjIdBatchObjVar(self, pclib.VAR_CORPSE_KILLER); - Vector stamps = utils.getResizeableIntBatchObjVar(self, pclib.VAR_CORPSE_STAMP); - - if ((corpses == null) || (killers == null)) - { - - return SCRIPT_OVERRIDE; - } - - int idx = utils.getElementPositionInArray(corpses, corpseId); - if (idx > -1) - { - corpses = utils.removeElementAt(corpses, idx); - killers = utils.removeElementAt(killers, idx); - stamps = utils.removeElementAt(stamps, idx); - if ((corpses == null) || (corpses.size() == 0)) - { - removeObjVar(self, pclib.VAR_CORPSE_BASE); - } - else - { - utils.setResizeableBatchObjVar(self, pclib.VAR_CORPSE_ID, corpses); - utils.setResizeableBatchObjVar(self, pclib.VAR_CORPSE_KILLER, killers); - utils.setResizeableBatchObjVar(self, pclib.VAR_CORPSE_STAMP, stamps); - } - } - else - { - - } - - return SCRIPT_CONTINUE; - } - - - public int handleIncapCounterDeath(obj_id self, dictionary params) throws InterruptedException - { - int posture = getPosture(self); - obj_id objKiller = params.getObjId("objKiller"); - if (posture == POSTURE_INCAPACITATED && !hasObjVar(self, pclib.VAR_BEEN_COUPDEGRACED)) - { - pclib.coupDeGrace(self, objKiller, false); - } - - return SCRIPT_CONTINUE; - } - - - public int reportJediDeathCount(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int handleJediDeathCount(obj_id self, dictionary params) throws InterruptedException - { - if (isJedi(self)) - { - int jediDeaths = getIntObjVar(self, jedi.VAR_JEDI_DEATHS); - - string_id msg = new string_id("jedi_spam", "jedi_death"); - prose_package proseMsg = prose.getPackage(msg, jediDeaths); - - sendSystemMessageProse(self, proseMsg); - } - - return SCRIPT_CONTINUE; - } - - - public int decayJediDeath(obj_id self, dictionary params) throws InterruptedException - { - - int jediDeaths = getIntObjVar(self, jedi.VAR_JEDI_DEATHS); - jediDeaths--; - if (jediDeaths < 0) - { - jediDeaths = 0; - } - - setObjVar(self, jedi.VAR_JEDI_DEATHS, jediDeaths); - - if (isGod(self)) - { - string_id msg = new string_id("jedi_spam", "jedi_death_decay"); - prose_package proseMsg = prose.getPackage(msg, jediDeaths); - sendSystemMessageProse(self, proseMsg); - } - - return SCRIPT_CONTINUE; - } - - - public int handleHealOverTimeTick(obj_id self, dictionary params) throws InterruptedException - { - float duration = params.getFloat("duration"); - float tick = params.getFloat("tick"); - int heal = params.getInt("heal"); - int hot_id = params.getInt("id"); - int isCombat = params.getInt("combat"); - obj_id medic = params.getObjId("medic"); - - if (isDead(self)) - { - if (buff.hasBuff(self, "healOverTime")) - { - buff.removeBuff(self, "healOverTime"); - } - - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, healing.VAR_PLAYER_HOT_ID)) - { - if (buff.hasBuff(self, "healOverTime")) - { - buff.removeBuff(self, "healOverTime"); - } - - return SCRIPT_CONTINUE; - } - - int player_id = utils.getIntScriptVar(self, healing.VAR_PLAYER_HOT_ID); - - if (hot_id != player_id) - { - return SCRIPT_CONTINUE; - } - - if (!isIncapacitated(self)) - { - int delta = healing.healDamage(medic, self, HEALTH, heal); - - if (isCombat == 1 && isIdValid(medic)) - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("healing", "heal_fly")); - pp = prose.setDI(pp, delta); - pp = prose.setTO(pp, ATTRIBUTES[HEALTH]); - showFlyTextPrivateProseWithFlags(self, self, pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - - if (medic != self) - { - showFlyTextPrivateProseWithFlags(self, medic, pp, 2.0f, colors.SEAGREEN, FLY_TEXT_FLAG_IS_HEAL); - } - - pp = prose.setStringId(pp, healing.SID_PERFORM_HEAL_DAMAGE_SUCCESS); - pp = prose.setTT(pp, medic); - pp = prose.setTO(pp, self); - pp = prose.setDI(pp, delta); - healing.sendMedicalSpam(medic, self, pp, true, true, true, COMBAT_RESULT_MEDICAL); - - delta = (int)(delta*healing.HEAL_OVER_TIME_AGGRO_REDUCER); - healing._addMedicalHate(medic, self, delta); - } - } - - duration -= tick; - if (duration <= 0.0f) - { - if (buff.hasBuff(self, "healOverTime")) - { - buff.removeBuff(self, "healOverTime"); - } - - return SCRIPT_CONTINUE; - } - - dictionary d = new dictionary(); - d.put("duration", duration); - d.put("tick", tick); - d.put("heal", heal); - d.put("id", hot_id); - d.put("combat", isCombat); - d.put("medic", medic); - - if (tick >= 0) - { - messageTo(self, healing.MSG_HEAL_OVER_TIME, d, tick, false); - } - - return SCRIPT_CONTINUE; - } - - - public int handlePlayerDeath(obj_id self, dictionary params) throws InterruptedException - { - - groundquests.sendSignal(self, "smugglerEnemyIncap"); - - if (utils.hasScriptVar(self, pclib.VAR_SUI_CLONE)) - { - int oldpid = utils.getIntScriptVar(self, pclib.VAR_SUI_CLONE); - forceCloseSUIPage(oldpid); - - utils.removeScriptVar(self, pclib.VAR_SUI_CLONE); - } - - if (!isDead(self)) - { - return SCRIPT_CONTINUE; - } - pvpRemoveAllTempEnemyFlags(self); - - clearBuffIcon(self, "food"); - - if (isPvpRelatedDeath(self)) - { - utils.setScriptVar(self, "buffDecay", 1); - buff.decayAllBuffsFromPvpDeath(self); - } - else - { - buff.removeAllBuffs(self, true); - } - - if (!hasObjVar(self, pclib.VAR_BEEN_COUPDEGRACED)) - { - return SCRIPT_CONTINUE; - } - - Vector options = new Vector(); - options.setSize(0); - Vector cloneLocs = new Vector(); - cloneLocs.setSize(0); - Vector spawnLocs = new Vector(); - spawnLocs.setSize(0); - Vector damage = new Vector(); - damage.setSize(0); - - boolean isNewbieDeath = false; - - location deathLoc = pclib.getEffectiveDeathLocation(self); - String planetName = deathLoc.area; - obj_id planet = getPlanetByName(planetName); - - location worldLoc = getWorldLocation(self); - String areaName = getBuildoutAreaName(worldLoc.x, worldLoc.z); - - obj_id bound = getObjIdObjVar(self, cloninglib.VAR_BIND_FACILITY); - boolean isBindListed = false; - - obj_id controller = utils.getObjIdScriptVar(self, "battlefield.active"); - - if (isIdValid(controller) && exists(controller)) - { - location cloneLoc = null; - String cloneName = "Clone Center"; - String battlefieldName = utils.getStringObjVar(controller, "battlefieldName"); - - if (factions.isRebel(self)) - { - cloneLoc = utils.getLocationScriptVar(controller, "battlefieldRebelSpawn"); - cloneName = "Rebel Cloning Center - "+ localize(new string_id("spam", battlefieldName)); - } - else if (factions.isImperial(self)) - { - cloneLoc = utils.getLocationScriptVar(controller, "battlefieldImperialSpawn"); - cloneName = "Imperial Cloning Center - "+ localize(new string_id("spam", battlefieldName)); - } - - options = utils.addElement(options, cloneName); - cloneLocs = utils.addElement(cloneLocs, cloneLoc); - spawnLocs = utils.addElement(spawnLocs, cloneLoc); - } - else - { - if (cloninglib.canUseBindFacility(planetName, areaName)) - { - String bindName = "@base_player:clone_location_registered_select_begin "; - - if (hasObjVar(self, cloninglib.VAR_BIND_BASE)) - { - String cloneName = getStringObjVar(self, cloninglib.VAR_BIND_CITY_NAME); - location bindLoc = getLocationObjVar(self, cloninglib.VAR_BIND_LOCATION); - location spawnLoc = getLocationObjVar(self, cloninglib.VAR_BIND_SPAWN_LOC); - - if (bindLoc != null) - { - if (isIdValid(bound)) - { - if (city.isCityBanned(self, bound)) - { - bindName += " @base_player:clone_location_city_banned"; - bindLoc = null; - spawnLoc = null; - } - else - { - bindName += cloneName; - } - } - else - { - bindName += "@base_player:clone_location_unknown"; - bindLoc = null; - spawnLoc = null; - } - } - else - { - bindName += "@base_player:clone_location_none"; - bindLoc = null; - spawnLoc = null; - } - - bindName += " @base_player:clone_location_registered_select_end"; - options = utils.addElement(options, bindName); - cloneLocs = utils.addElement(cloneLocs, bindLoc); - spawnLocs = utils.addElement(spawnLocs, spawnLoc); - - if (pvp.isPvpDeath(self) || isNewbieDeath) - { - damage = utils.addElement(damage, 0); - } - else - { - damage = utils.addElement(damage, cloninglib.CLONE_DAMAGE_LOW); - } - isBindListed = true; - } - } - - if (isIdValid(planet)) - { - if (utils.hasScriptVar(planet, cloninglib.VAR_PLANET_CLONE_LOC)) - { - Vector cloneList = cloninglib.getAvailableCloningFacilities(self); - int playerFaction = factions.getFactionFlag(self); - obj_id tatooinePlanet = getPlanetByName("tatooine"); - - for (int i = 0; i < cloneList.size(); i++) - { - testAbortScript(); - dictionary cloneData = (dictionary)(cloneList.get(i)); - - obj_id facility = cloneData.getObjId("faciltyId"); - String cloneName = cloneData.getString("cloneName"); - location cloneLoc = cloneData.getLocation("facilityLoc"); - location spawnLoc = cloneData.getLocation("spawnLoc"); - - if (facility == bound && !isBindListed) - { - cloneName = "@base_player:clone_location_registered_select_begin "+ - getStringObjVar(self, cloninglib.VAR_BIND_CITY_NAME)+ - " @base_player:clone_location_registered_select_end"; - - isBindListed = true; - } - - if (cloneName.equals("@naboo_region_names:theed") && cloneLoc.z > 4100) - { - cloneName+= "_north"; - } - - if (playerFaction == factions.FACTION_FLAG_IMPERIAL || playerFaction == factions.FACTION_FLAG_REBEL) - { - if (cloneName.equals("@tatooine_region_names:bestine") && utils.hasScriptVar(tatooinePlanet, "gcw.invasionRunning.bestine")) - { - int factionDefending = utils.getIntScriptVar(tatooinePlanet, "gcw.factionDefending.bestine"); - - if (( (factionDefending == factions.FACTION_FLAG_IMPERIAL || factionDefending == factions.FACTION_FLAG_REBEL) && playerFaction != factionDefending)) - { - continue; - } - } - - if (cloneName.equals("@talus_region_names:dearic") && utils.hasScriptVar(tatooinePlanet, "gcw.invasionRunning.dearic")) - { - int factionDefending = utils.getIntScriptVar(tatooinePlanet, "gcw.factionDefending.dearic"); - - if (( (factionDefending == factions.FACTION_FLAG_IMPERIAL || factionDefending == factions.FACTION_FLAG_REBEL) && playerFaction != factionDefending)) - { - continue; - } - } - - if (cloneName.equals("@naboo_region_names:keren") && utils.hasScriptVar(tatooinePlanet, "gcw.invasionRunning.keren")) - { - int factionDefending = utils.getIntScriptVar(tatooinePlanet, "gcw.factionDefending.keren"); - - if (( (factionDefending == factions.FACTION_FLAG_IMPERIAL || factionDefending == factions.FACTION_FLAG_REBEL) && playerFaction != factionDefending)) - { - continue; - } - } - } - - options = utils.addElement(options, cloneName); - cloneLocs = utils.addElement(cloneLocs, cloneLoc); - spawnLocs = utils.addElement(spawnLocs, spawnLoc); - } - } - } - } - - if (options == null || options.size() < 1) - { - - } - - int suiClone = createCloningSui(self, options); - - if (suiClone == -1) - { - debugServerConsoleMsg(self, "PLAYER DEATH ERROR: unable to create sui for player = "+ self); - debugServerConsoleMsg(self, "* reviving player at cuttent location..."); - - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, pclib.VAR_SUI_CLONE, suiClone); - utils.setScriptVar(self, pclib.VAR_REVIVE_OPTIONS, options); - utils.setScriptVar(self, pclib.VAR_REVIVE_CLONE, cloneLocs); - utils.setScriptVar(self, pclib.VAR_REVIVE_SPAWN, spawnLocs); - - dictionary hrem = new dictionary(); - hrem.put("time", healing.REVIVE_TIMER); - hrem.put("sui", suiClone); - utils.setScriptVar(self, combat.DIED_RECENTLY, true); - messageTo(self, "clearRecentDeathScriptVar", null, combat.RECENT_DEATH_EXPIRATION, false); - messageTo(self, "handleReviveExpirationMessage", hrem, 0.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int createCloningSui(obj_id player, Vector list) throws InterruptedException - { - String title = MSG_REVIVE_TITLE; - String prompt = buildCloningPrompt(player, -1); - - int pid = createSUIPage(sui.SUI_LISTBOX, player, player, HANDLER_PLAYER_REVIVE); - - setSUIProperty(pid, sui.LISTBOX_TITLE, sui.PROP_TEXT, title); - setSUIProperty(pid, sui.LISTBOX_PROMPT, sui.PROP_TEXT, prompt); - - sui.listboxButtonSetup(pid, sui.OK_ONLY); - - clearSUIDataSource(pid, sui.LISTBOX_DATASOURCE); - - for (int i = 0; i < list.size(); i++) - { - testAbortScript(); - addSUIDataItem(pid, sui.LISTBOX_DATASOURCE, ""+ i); - setSUIProperty(pid, sui.LISTBOX_DATASOURCE + "."+ i, sui.PROP_TEXT, ((String)(list.get(i)))); - } - - subscribeToSUIEvent(pid, sui_event_type.SET_onGenericSelection, sui.LISTBOX_LIST, "handleCloneSuiUpdate"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onGenericSelection, sui.LISTBOX_LIST, sui.LISTBOX_LIST, sui.PROP_SELECTEDROW); - - subscribeToSUIProperty(pid, sui.LISTBOX_LIST, sui.PROP_SELECTEDROW); - subscribeToSUIProperty(pid, sui.LISTBOX_TITLE, sui.PROP_TEXT); - - showSUIPage(pid); - flushSUIPage(pid); - - return pid; - } - - - public int handleCloneSuiUpdate(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - int pid = utils.getIntScriptVar(self, pclib.VAR_SUI_CLONE); - int idx = sui.getListboxSelectedRow(params); - - String prompt = buildCloningPrompt(self, idx); - - setSUIProperty(pid, sui.LISTBOX_PROMPT, sui.PROP_TEXT, prompt); - flushSUIPage(pid); - - return SCRIPT_CONTINUE; - } - - - public String buildCloningPrompt(obj_id player, int index) throws InterruptedException - { - String[] options = utils.getStringArrayScriptVar(player, pclib.VAR_REVIVE_OPTIONS); - location[] cloneLocs = utils.getLocationArrayScriptVar(player, pclib.VAR_REVIVE_CLONE); - - String prompt = "@base_player:clone_prompt_header "; - - if (index > -1) - { - prompt += "\n\n @base_player:clone_prompt_data "; - prompt += "\n @base_player:clone_prompt_location "+options[index]; - prompt += "\n @base_player:clone_prompt_distance "+distanceToString(getDistance(player, cloneLocs[index])); - } - - return prompt; - } - - - public String distanceToString(float dist) throws InterruptedException - { - String text; - - if (dist < 0) - { - text = "@base_player:clone_location_unknown"; - } - else if (dist < 1000) - { - text = ""+(int)dist+"m"; - } - else - { - text = ""+(int)(dist/1000f)+"km"; - } - - return text; - } - - - public int handleCloningDataUpdate(obj_id self, dictionary params) throws InterruptedException - { - obj_id facilityId = params.getObjId("faciltyId"); - location facilityLoc = params.getLocation("facilityLoc"); - location spawnLoc = params.getLocation("spawnLoc"); - String cloneName = params.getString("cloneName"); - - setObjVar(self, cloninglib.VAR_BIND_FACILITY, facilityId); - setObjVar(self, cloninglib.VAR_BIND_LOCATION, facilityLoc); - setObjVar(self, cloninglib.VAR_BIND_SPAWN_LOC, spawnLoc); - setObjVar(self, cloninglib.VAR_BIND_CITY_NAME, cloneName); - - removeObjVar(self, cloninglib.VAR_BIND_FACILITY_TEMPLATE); - removeObjVar(self, cloninglib.VAR_BIND_FACILITY_CELL); - - return SCRIPT_CONTINUE; - } - - - public int clearRecentDeathScriptVar(obj_id self, dictionary params) throws InterruptedException - { - if (utils.hasScriptVar(self, combat.DIED_RECENTLY)) - { - utils.removeScriptVar(self, combat.DIED_RECENTLY); - } - return SCRIPT_CONTINUE; - } - - - public int handleReviveExpirationMessage(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, pclib.VAR_SUI_CLONE)) - { - return SCRIPT_CONTINUE; - } - - int remaining_time = params.getInt("time"); - int sui_id = params.getInt("sui"); - int next_msg_time = 600; - - int sui_var = utils.getIntScriptVar(self, pclib.VAR_SUI_CLONE); - if (sui_id != sui_var) - { - return SCRIPT_CONTINUE; - } - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("base_player", "revive_exp_msg")); - - if (remaining_time <= 0) - { - sendSystemMessage(self, new string_id("base_player", "revive_expired")); - forceCloseSUIPage(sui_id); - - if (space_dungeon.isCloningInstance(self)) - { - space_dungeon.handleInstanceClone(self); - return SCRIPT_CONTINUE; - } - - location[] cloneLocs = utils.getLocationArrayScriptVar(self, pclib.VAR_REVIVE_CLONE); - location[] spawnLocs = utils.getLocationArrayScriptVar(self, pclib.VAR_REVIVE_SPAWN); - - location clone = cloneLocs[0]; - location spawn = spawnLocs[0]; - - if (!pclib.playerRevive(self, clone, spawn, 0)) - { - messageTo(self, pclib.HANDLER_CLONE_RESPAWN, null, 1, true); - } - - return SCRIPT_CONTINUE; - } - else if (remaining_time <= 60) - { - pp = prose.setStringId(pp, new string_id("base_player", "revive_exp_msg_last")); - next_msg_time = remaining_time; - } - else if (remaining_time <= 300) - { - next_msg_time = 120; - } - else if (remaining_time <= 600) - { - next_msg_time = 300; - } - - pp = prose.setTT(pp, player_structure.assembleTimeRemaining(player_structure.convertSecondsTime(remaining_time))); - sendSystemMessageProse(self, pp); - - remaining_time -= next_msg_time; - - dictionary d = new dictionary(); - d.put("time", remaining_time); - d.put("sui", sui_id); - - messageTo(self, "handleReviveExpirationMessage", d, (float)next_msg_time, false); - - return SCRIPT_CONTINUE; - } - - - public int handleInstanceClonePause(obj_id self, dictionary params) throws InterruptedException - { - String prompt = "@"+SID_INSTANCE_REVIVE; - String title = "@"+SID_INSTANCE_REVIVE_TITLE; - int pid = sui.msgbox(self, self, prompt, sui.OK_ONLY, title, "handleInstanceCloneSelection"); - showSUIPage(pid); - - utils.setScriptVar(self, pclib.VAR_SUI_CLONE, pid); - dictionary hrem = new dictionary(); - hrem.put("time", healing.REVIVE_TIMER); - hrem.put("sui", pid); - messageTo(self, "handleReviveExpirationMessage", hrem, 0.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int handleInstanceCloneSelection(obj_id self, dictionary params) throws InterruptedException - { - int posture = getPosture(self); - if (posture != POSTURE_DEAD) - { - return SCRIPT_CONTINUE; - } - - space_dungeon.handleInstanceClone(self); - - return SCRIPT_CONTINUE; - } - - - public int showReviveSUI(obj_id self, dictionary params) throws InterruptedException - { - if (utils.hasScriptVar(self, "reviveSUI.pid")) - { - int oldpid = utils.getIntScriptVar(self, "reviveSUI.pid"); - sui.closeSUI(self, oldpid); - utils.removeScriptVar(self, "reviveSUI.pid"); - } - - obj_id medic = params.getObjId("medic"); - int weak = params.getInt("weak"); - - string_id reviveSUITitleSID = new string_id("spam", "revive_sui_title"); - prose_package ppPrompt = new prose_package(); - ppPrompt = prose.setStringId(ppPrompt, new string_id("spam", "revive_sui_prompt")); - ppPrompt = prose.setTT(ppPrompt, medic); - - if (weak == 0) - { - reviveSUITitleSID = new string_id("spam", "revive_sui_title_weak"); - ppPrompt = prose.setStringId(ppPrompt, new string_id("spam", "revive_sui_prompt_weak")); - } - - String title = "@"+ reviveSUITitleSID; - - utils.setScriptVar(self, "reviveSUI.medic", medic); - utils.setScriptVar(self, "reviveSUI.weak", weak); - - int pid = sui.msgbox(self, self, ppPrompt, sui.YES_NO, title, "handleReviveSUI"); - utils.setScriptVar(self, "reviveSUI.pid", pid); - - showSUIPage(pid); - - params.put("pid", pid); - messageTo(self, "handleReviveSUITimeout", params, 120, false); - - return SCRIPT_CONTINUE; - } - - - public int handleReviveSUITimeout(obj_id self, dictionary params) throws InterruptedException - { - int pidThisMessageRefersToo = params.getInt("pid"); - - if (utils.hasScriptVar(self, "reviveSUI.pid")) - { - int storedPid = utils.getIntScriptVar(self, "reviveSUI.pid"); - - if (storedPid == pidThisMessageRefersToo) - { - sui.closeSUI(self, storedPid); - utils.removeScriptVar(self, "reviveSUI.pid"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleReviveSUI(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - obj_id medic = utils.getObjIdScriptVar(self, "reviveSUI.medic"); - int weak = utils.getIntScriptVar(self, "reviveSUI.weak"); - - if (bp == sui.BP_OK) - { - pclib.clearEffectsForDeath(self); - int maxHealth = getWoundedMaxAttrib(self, HEALTH); - int maxAction = getWoundedMaxAttrib(self, ACTION); - - int actionVal = weak * (maxAction/2); - int toHeal = (maxHealth / 3) + 1; - - if (weak == 0) - { - toHeal = (maxHealth / 10) + 1; - } - - setAttrib(self, HEALTH, toHeal); - setAttrib(self, ACTION, actionVal); - setAttrib(self, MIND, 0); - - utils.removeScriptVar(self, "reviveSUI.weak"); - utils.removeScriptVar(self, "reviveSUI.pid"); - messageTo(self, "handlePlayerResuscitated", null, 0, true); - } - else - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "revive_attempt_denied") ); - pp = prose.setTO(pp, self); - sendSystemMessageProse(medic, pp); - - utils.removeScriptVar(self, "reviveSUI.weak"); - utils.removeScriptVar(self, "reviveSUI.medic"); - utils.removeScriptVar(self, "reviveSUI.pid"); - } - - return SCRIPT_CONTINUE; - } - - - public int handlePlayerRevive(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, pclib.VAR_SUI_CLONE)) - { - return SCRIPT_CONTINUE; - } - - utils.removeScriptVar(self, pclib.VAR_SUI_CLONE); - - location clone = null; - location spawn = null; - int damage = cloninglib.CLONE_DAMAGE_HIGH; - int idx = -1; - - int delayedClone = 0; - - if (params != null) - { - idx = sui.getListboxSelectedRow(params); - - if (idx > -1) - { - location[] cloneLocs = utils.getLocationArrayScriptVar(self, pclib.VAR_REVIVE_CLONE); - location[] spawnLocs = utils.getLocationArrayScriptVar(self, pclib.VAR_REVIVE_SPAWN); - - clone = cloneLocs[idx]; - spawn = spawnLocs[idx]; - - location deathLoc = getLocation(self); - - region[] respawnRegions = getRegionsWithPvPAtPoint(deathLoc, regions.PVP_REGION_TYPE_ADVANCED); - - if ((respawnRegions != null && respawnRegions.length > 0) || utils.hasScriptVar(self, "battlefield.active")) - { - delayedClone = 15; - utils.setScriptVar(self, "no_cloning_sickness", 1); - } - } - else - { - sendSystemMessage(self, SID_CLONE_FAIL_SELECTION); - } - } - - if ((clone != null && clone.compareTo(new location()) != 0 && spawn != null && spawn.compareTo(new location()) != 0)) - { - if (delayedClone > 0) - { - int gameTime = getGameTime(); - int timeRemaining = delayedClone - (gameTime % delayedClone); - - int pid = sui.countdownTimerSUI(self, self, "waitingToClone", new string_id("gcw", "static_base_waiting_to_clone"), (delayedClone - timeRemaining), delayedClone, "handleDelayedCloneCancel"); - - if (pid > -1) - { - dictionary d = new dictionary(); - d.put("clone", clone); - d.put("spawn", spawn); - d.put("damage", damage); - d.put("id", pid); - - messageTo(self, "handleDelayedClone", d, timeRemaining, true); - - utils.setScriptVar(self, "waiting_to_clone", pid); - - return SCRIPT_CONTINUE; - } - } - else if (pclib.playerRevive(self, clone, spawn, 0)) - { - return SCRIPT_CONTINUE; - } - } - - messageTo(self, pclib.HANDLER_PLAYER_DEATH, null, 0, false); - - return SCRIPT_CONTINUE; - } - - - public int handleDelayedClone(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "waiting_to_clone")) - { - return SCRIPT_CONTINUE; - } - - int pid = utils.getIntScriptVar(self, "waiting_to_clone"); - - int id = params.getInt("id"); - if (pid != id) - { - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - - location clone = params.getLocation("clone"); - location spawn = params.getLocation("spawn"); - int damage = params.getInt("damage"); - - if ((clone != null && clone.compareTo(new location()) != 0 && spawn != null && spawn.compareTo(new location()) != 0)) - { - pclib.playerRevive(self, clone, spawn, damage); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDelayedCloneCancel(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "waiting_to_clone")) - { - return SCRIPT_CONTINUE; - } - - utils.removeScriptVar(self, "waiting_to_clone"); - - messageTo(self, pclib.HANDLER_PLAYER_DEATH, null, 0.0f, true); - - return SCRIPT_CONTINUE; - } - - - public int handleCloneRespawn(obj_id self, dictionary params) throws InterruptedException - { - - utils.removeScriptVar(self, pclib.VAR_SUI_CLONE); - utils.removeScriptVar(self, pclib.VAR_REVIVE_OPTIONS); - utils.removeScriptVar(self, pclib.VAR_REVIVE_CLONE); - utils.removeScriptVar(self, pclib.VAR_REVIVE_SPAWN); - - utils.removeScriptVar(self, "waitingOnCloneRespawn"); - - removeObjVar(self, pclib.VAR_BEEN_COUPDEGRACED); - - pvpRemoveAllTempEnemyFlags(self); - - int intGuildId = getGuildId(self); - if (intGuildId != 0) - { - int[] enemies_A_to_B = guildGetEnemies(intGuildId); - if (enemies_A_to_B != null && enemies_A_to_B.length > 0) - { - int[] enemies_B_to_A = getGuildsAtWarWith(intGuildId); - if (enemies_B_to_A != null && enemies_B_to_A.length > 0) - { - for (int i = 0; i < enemies_A_to_B.length; ++i) - { - testAbortScript(); - if (guild.findIntTableOffset(enemies_B_to_A, enemies_A_to_B[i]) != -1) - { - pvpSetGuildWarCoolDownPeriodEnemyFlag(self); - break; - } - } - } - } - } - - pclib.checkCovertRespawn(self); - - pclib.clearEffectsForDeath(self); - - utils.removeScriptVar(self, "jedi.rankedDeath"); - - if (hasObjVar(self, "fullHealClone")) - { - removeObjVar(self, "fullHealClone"); - healing.healClone(self, false); - } - else - { - healing.healClone(self, true); - } - - setPosture(self, POSTURE_UPRIGHT); - utils.removeScriptVar(self, "pvp_death"); - - queueCommand(self, (-1465754503), self, "", COMMAND_PRIORITY_IMMEDIATE); - - playClientEffectObj(self, "clienteffect/player_clone_compile.cef", self, null); - - if (!utils.hasScriptVar(self, "no_cloning_sickness") && !instance.isInInstanceArea(self)) - { - buff.applyBuff(self, "cloning_sickness"); - } - else if (utils.hasScriptVar(self, "no_cloning_sickness")) - { - utils.removeScriptVar(self, "no_cloning_sickness"); - } - - if (0 == pvpGetAlignedFaction(self)) - { - int currentMercenaryFaction = pvpNeutralGetMercenaryFaction(self); - if ((0 != currentMercenaryFaction) && pvpNeutralIsMercenaryDeclared(self)) - { - pvpNeutralSetMercenaryFaction(self, currentMercenaryFaction, false); - } - } - - CustomerServiceLog("Death", "("+ self + ") "+ getName(self) + " has clone respawned at "+ getLocation(self).toString()); - - return SCRIPT_CONTINUE; - } - - - public int handlePlayerResuscitated(obj_id self, dictionary params) throws InterruptedException - { - int suiClone = utils.getIntScriptVar(self, pclib.VAR_SUI_CLONE); - LOG("resuscitate","self = "+ self + ": clone sui = "+ suiClone); - if (suiClone > -1) - { - LOG("resuscitate","attempting to force closure of clone sui: sui #"+ suiClone); - forceCloseSUIPage(suiClone); - } - - utils.removeScriptVar(self, pclib.VAR_SUI_CLONE); - utils.removeScriptVar(self, pclib.VAR_REVIVE_OPTIONS); - pvpRemoveAllTempEnemyFlags(self); - - removeObjVar(self, pclib.VAR_BEEN_COUPDEGRACED); - - obj_id medic = utils.getObjIdScriptVar(self, "reviveSUI.medic"); - utils.removeScriptVar(self, "reviveSUI.medic"); - - if (isIdValid(medic)) - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, healing.SID_PERFORM_REVIVE_SUCCESS); - pp = prose.setTT(pp, medic); - pp = prose.setTO(pp, self); - sendSystemMessageProse(medic, pp); - sendSystemMessageProse(self, pp); - } - else - { - sendSystemMessage(self, new string_id("healing", "perform_revive_success_self_only")); - } - - if (hasObjVar(self, "outbreak.usedGate")) - { - buff.applyBuff(self, "death_troopers_no_vehicle"); - } - - setPosture(self, POSTURE_UPRIGHT); - utils.removeScriptVar(self, "pvp_death"); - - CustomerServiceLog("Death", "("+ self + ") "+ getName(self) + " has been resuscitated at "+ getLocation(self).toString()); - - return SCRIPT_CONTINUE; - } - - - public int handleReviveStand(obj_id self, dictionary params) throws InterruptedException - { - setPosture(self, POSTURE_UPRIGHT); - return SCRIPT_CONTINUE; - } - - - public int handleInstanceRessurect(obj_id self, dictionary params) throws InterruptedException - { - pclib.resurrectPlayer(self, true); - return SCRIPT_CONTINUE; - } - - public int handleDecayReport(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVarTree(self, "decayReport"); - return SCRIPT_CONTINUE; - } - - - public int handleRepairItems(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] repairList = params.getObjIdArray("items"); - cloninglib.repairItems(self, repairList); - - return SCRIPT_CONTINUE; - } - - - public int handleChatPersistentMessage(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_OVERRIDE; - } - - String from = params.getString("from"); - if (from == null) - { - return SCRIPT_OVERRIDE; - } - - String subject = params.getString("subject"); - if (subject == null) - { - return SCRIPT_OVERRIDE; - } - - String message = params.getString("message"); - if (message == null) - { - return SCRIPT_OVERRIDE; - } - - String outOfBand = params.getString("outofband"); - - String avatarName = getChatName(self); - if (avatarName == null) - { - return SCRIPT_OVERRIDE; - } - - chatSendPersistentMessage(from, avatarName, subject, message, outOfBand); - return SCRIPT_CONTINUE; - } - - - public int gmRevive(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - target = self; - params = toLower(params); - if (params.equals("-target")) - { - target = getLookAtTarget(self); - } - - if (isIdValid(target)) - { - obj_id targetCreature = null; - obj_id targetShip = null; - int got = getGameObjectType(target); - if (isGameObjectTypeOf(got, GOT_ship)) - { - targetShip = target; - targetCreature = getShipPilot(target); - } - else if (isGameObjectTypeOf(got, GOT_creature)) - { - targetShip = getPilotedShip(target); - targetCreature = target; - } - - if (!isIdValid(targetShip) && !isIdValid(targetCreature)) - { - sendSystemMessageTestingOnly(self, "The /gmRevive command may only be used on creature or ship type objects"); - return SCRIPT_CONTINUE; - } - - if (isIdValid(targetShip)) - { - - space_crafting.repairDamage(targetCreature, targetShip, 1.f, 0.f); - - if (isShipSlotInstalled(targetShip, ship_chassis_slot_type.SCST_shield_0)) - { - setShipShieldHitpointsFrontCurrent(targetShip, getShipShieldHitpointsFrontMaximum(targetShip)); - setShipShieldHitpointsBackCurrent(targetShip, getShipShieldHitpointsBackMaximum(targetShip)); - } - - if (isIdValid(targetCreature)) - { - sendSystemMessageTestingOnly(targetCreature, "Ship Repaired."); - } - - CustomerServiceLog("Death", "("+ targetShip + ") "+ getName(targetShip) + " has been /gmRevive'd at "+ getLocation(self).toString() + " by ("+ self + ") "+ getName(self)); - } - - if (isIdValid(targetCreature)) - { - - obj_id mountId = getMountId(targetCreature); - if (isIdValid(mountId)) - { - utils.dismountRiderJetpackCheck(targetCreature); - } - - if (isJedi(targetCreature)) - { - setForcePower(targetCreature, getMaxForcePower(targetCreature)); - sendSystemMessageTestingOnly(targetCreature, "Force Power Maxed"); - } - if (pclib.resurrectPlayer(targetCreature)) - { - sendSystemMessageTestingOnly(targetCreature, "You have been restored..."); - - if (isPlayer(targetCreature)) - { - pclib.clearCombatData(targetCreature); - buff.removeAllBuffs(targetCreature, true); - - removeObjVar(targetCreature, "combat.intIncapacitationCount"); - - setPosture(targetCreature, POSTURE_UPRIGHT); - queueCommand(targetCreature, (-1465754503), targetCreature, "", COMMAND_PRIORITY_IMMEDIATE); - queueCommand(targetCreature, (-562996732), targetCreature, "", COMMAND_PRIORITY_IMMEDIATE); - utils.removeScriptVar(targetCreature, "pvp_death"); - - sendSystemMessageTestingOnly(self, "You have /gmRevived "+getName(targetCreature)); - } - } - } - - CustomerServiceLog("Death", "("+ targetCreature + ") "+ getName(targetCreature) + " has been /gmRevive'd at "+ getLocation(self).toString() + " by ("+ self + ") "+ getName(self)); - } - - return SCRIPT_CONTINUE; - } - - - public int cmdEat(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) && exists(target)) - { - return SCRIPT_OVERRIDE; - } - - consumable.consumeItem(self, target); - return SCRIPT_CONTINUE; - } - - - public int cmdUseSkillBuff(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - LOG("skillBuff", "cmdUseSkillBuff"); - if (!isIdValid(target) && exists(target)) - { - return SCRIPT_OVERRIDE; - } - - dictionary childparams = new dictionary(); - childparams.put("player", self); - messageTo( target, "handleUseSkillBuff", childparams, 1f, true ); - return SCRIPT_CONTINUE; - } - - - public int cmdTip(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if ((params == null) || (params.equals(""))) - { - showTipSyntax(self); - return SCRIPT_CONTINUE; - } - - location here = getLocation(self); - if ((here.area).equals("tutorial")) - { - sendSystemMessageTestingOnly( self, "You cannot use this command from within the tutorial."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog( "Trade", "Tip Invoked -- Self: "+ self + " Target: "+ target + " Params: "+ params ); - - if (params.equals("clear")) - { - CustomerServiceLog( "Trade", " Tip -- Self: "+ self + " "+ getName(self) + " -- User requested tip data clear."); - sendSystemMessage( self, pclib.SID_TIP_CLEAR ); - pclib.cleanupTipSui( self ); - - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, pclib.VAR_TIP_SUI)) - { - int suiConfirm = utils.getIntScriptVar( self, pclib.VAR_TIP_SUI ); - forceCloseSUIPage( suiConfirm ); - - obj_id oldTarget = utils.getObjIdScriptVar( self, pclib.VAR_TIP_TARGET ); - if (isIdValid(oldTarget) && exists(oldTarget) && oldTarget.isLoaded()) - { - prose_package tipAbort = prose.getPackage( pclib.PROSE_TIP_ABORT, oldTarget ); - sendSystemMessageProse( self, tipAbort ); - } - else - { - sendSystemMessage( self, pclib.SID_TIP_ABORT ); - } - - CustomerServiceLog( "Trade", " Tip -- Self: "+ self + " "+ getName(self) + " -- Cancelled prior tip due to new tip attempt."); - pclib.cleanupTipSui( self ); - } - - if (target == self) - { - CustomerServiceLog( "Trade", " Tip -- Self: "+ self + " "+ getName(self) + " -- Tip aborted: (target == self)"); - sendSystemMessageTestingOnly( self, "You can't use yourself as a target for /tip!"); - return SCRIPT_CONTINUE; - } - - boolean useCash = true; - if (params.indexOf("bank") > -1) - { - params = gm.removeKeyword( params, "bank"); - useCash = false; - } - - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - int amt = 0; - String name = null; - int cnt = st.countTokens(); - switch ( cnt ) - { - case 1: - if (!isIdValid(target)) - { - showTipSyntax(self); - return SCRIPT_CONTINUE; - } - break; - - case 2: - name = st.nextToken(); - break; - - default: - showTipSyntax(self); - return SCRIPT_CONTINUE; - } - boolean areMoreTokens = st.hasMoreTokens(); - if (areMoreTokens) - { - String sAmt = st.nextToken(); - amt = utils.stringToInt(sAmt); - if (amt < 1) - { - prose_package invalidParam = prose.getPackage( pclib.PROSE_INVALID_TIP_PARAM, sAmt ); - sendSystemMessageProse( self, invalidParam ); - return SCRIPT_CONTINUE; - } - - if ((name == null) || (name.equals(""))) - { - pclib.giveTip( self, target, getName(target), amt, useCash ); - } - else - { - obj_id playerId = getPlayerIdFromFirstName( name ); - if (isIdValid(playerId)) - { - pclib.giveTip( self, playerId, name, amt, useCash ); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int cmdTipFail(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "/TIP command failed in command table..."); - return SCRIPT_CONTINUE; - } - - - public int cmdCheckForceStatus(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int handleWireConfirm(obj_id self, dictionary params) throws InterruptedException - { - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " -- Tip aborted: Bank-to-Bank transfer canceled by player's request."); - pclib.cleanupTipSui( self ); - return SCRIPT_CONTINUE; - } - - obj_id target = utils.getObjIdScriptVar( self, pclib.VAR_TIP_TARGET ); - if (!isIdValid(target)) - { - sendSystemMessage( self, pclib.SID_TIP_ERROR ); - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " Target: "+ target + " -- Tip aborted: Target was invalid after tip fee dialog was accepted."); - pclib.cleanupTipSui( self ); - return SCRIPT_CONTINUE; - } - - int amt = utils.getIntScriptVar( self, pclib.VAR_TIP_AMT ); - int fee = (int)(amt * pclib.TIP_WIRE_SURCHARGE); - if (fee < 1) - { - fee = 1; - } - int total = amt + fee; - - String targetName = utils.getStringScriptVar( self, pclib.VAR_TIP_TARGET_NAME ); - if (getBankBalance(self) < total) - { - - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " Target: "+ target + " -- Tip aborted: Player couldn't afford the wire fee."); - - prose_package nsfWire = prose.getPackage( pclib.PROSE_TIP_NSF_WIRE, self, getName(self), null, target, targetName, null, null, null, null, total, 0f ); - sendSystemMessageProse( self, nsfWire ); - } - else - { - dictionary d = new dictionary(); - d.put("target", target); - d.put("amt", amt); - d.put("useCash", false); - d.put("targetName", targetName); - - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " Target: "+ target + " -- Transferring wire bank money to escrow account! Amt: "+ amt ); - transferBankCreditsToNamedAccount( self, money.ACCT_TIP_ESCROW, amt, "handleTipSuccess", "handleTipFail", d ); - - if (utils.isFreeTrial(self, target)) - { - pclib.doTipLogging(self, target, amt); - } - - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " Target: "+ target + " -- Transferring wire bank fee to surcharge account! Amt: "+ fee ); - transferBankCreditsToNamedAccount( self, money.ACCT_TIP_SURCHARGE, fee, "noHandler", "noHandler", d ); - - utils.moneyOutMetric( self, money.ACCT_TIP_SURCHARGE, fee ); - } - - pclib.cleanupTipSui( self ); - - return SCRIPT_CONTINUE; - } - - - public int handleTipSuccess(obj_id self, dictionary params) throws InterruptedException - { - String myName = getName(self); - obj_id po = getPlayerObject(self); - - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " -- Handling a successful transfer."); - - obj_id target = params.getObjId("target"); - if (params == null || params.isEmpty() || !isIdValid(target)) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " -- Error! Can't handle successful tip transfer! The target data is invalid."); - return SCRIPT_CONTINUE; - } - - int amt = params.getInt("amt"); - boolean useCash = params.getBoolean("useCash"); - String targetName = params.getString("targetName"); - params.put( "actor", self ); - params.put( "actorName", myName ); - obj_id tpo = getPlayerObject( target ); - - if (useCash) - { - - prose_package toSelf = prose.getPackage( pclib.PROSE_TIP_PASS_SELF, target, amt ); - sendSystemMessageProse( self, toSelf ); - prose_package toTarget = prose.getPackage( pclib.PROSE_TIP_PASS_TARGET, self, amt ); - sendSystemMessageProse( target, toTarget ); - - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " Target: "+ target + " "+ getName(target) + " -- Cash tip transfer successfully completed. Amt: "+ amt ); - } - else - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " Target: "+ target + " "+ getName(target) + " -- Bank->Escrow wire transfer complete. Telling target to request escrow funds. Amt: "+ amt ); - messageTo( target, "handleTipEscrowRequest", params, 1f, true ); - prose_package bankToEscrow = prose.getPackage( new string_id( "base_player", "bank_to_escrow"), targetName, amt ); - sendSystemMessageProse( self, bankToEscrow ); - } - - return SCRIPT_CONTINUE; - } - - - public int handleTipEscrowRequest(obj_id self, dictionary params) throws InterruptedException - { - int amt = params.getInt("amt"); - obj_id player = params.getObjId("actor"); - String playerName = params.getString("actorName"); - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ playerName + " Target: "+ self + " "+ getName(self) + " -- Target is now requesting funds from the escrow account. Amt: "+ amt ); - - if (amt >= 1 && amt <= 1000000) - { - boolean success = transferBankCreditsFromNamedAccount( money.ACCT_TIP_ESCROW, self, amt, "handleTipEscrowPass", "handleTipEscrowFail", params ); - if (!success) - { - - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ playerName + " Target: "+ self + " -- Tip aborted: Unable to transfer money from bank to escrow. Amt: "+ amt ); - - refundEscrow( player, playerName, self, getName(self), amt ); - } - } - else - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ playerName + " Target: "+ self + " "+ getName(self) + " -- Target was unable to request tip funds from escrow because the amount is invalid! Amt: "+ amt ); - } - - return SCRIPT_CONTINUE; - } - - - public int handleTipEscrowPass(obj_id self, dictionary params) throws InterruptedException - { - obj_id actor = params.getObjId("actor"); - String actorName = params.getString("actorName"); - - obj_id target = params.getObjId("target"); - String targetName = params.getString("targetName"); - - if (!isIdValid(actor) || !isIdValid(target) || targetName == null || actorName == null) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ actor + " "+ actorName + " Target: "+ target + " "+ getName(target) + " -- Unable to handle successful transfer Escrow->Bank because of bad parameters."); - return SCRIPT_CONTINUE; - } - - int amt = params.getInt("amt"); - boolean useCash = params.getBoolean("useCash"); - - CustomerServiceLog( "Trade", " Tip -- Player: "+ actor + " "+ actorName + " Target: "+ target + " "+ getName(target) + " -- Target successfully withdrew the money from escrow. Wire transfer complete. Amt: "+ amt ); - - prose_package bodyToTarget = prose.getPackage( pclib.PROSE_WIRE_MAIL_TARGET, actorName, amt ); - utils.sendMail( pclib.SID_WIRE_MAIL_SUBJECT, bodyToTarget, targetName, "@money/acct_n:bank"); - prose_package bodyToSelf = prose.getPackage( pclib.PROSE_WIRE_MAIL_SELF, targetName, amt ); - utils.sendMail( pclib.SID_WIRE_MAIL_SUBJECT, bodyToSelf, actorName, targetName ); - - return SCRIPT_CONTINUE; - } - - - public int handleTipEscrowFail(obj_id self, dictionary params) throws InterruptedException - { - obj_id actor = params.getObjId("actor"); - String actorName = params.getString("actorName"); - - obj_id target = params.getObjId("target"); - String targetName = params.getString("targetName"); - - if (!isIdValid(actor) || !isIdValid(target) || targetName == null || actorName == null) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ actor + " "+ actorName + " Target: "+ target + " "+ getName(target) + " -- Unable to handle FAILED transfer Escrow->Bank because of bad parameters."); - return SCRIPT_CONTINUE; - } - - int amt = params.getInt("amt"); - boolean useCash = params.getBoolean("useCash"); - - CustomerServiceLog( "Trade", " Tip -- Player: "+ actor + " "+ actorName + " Target: "+ target + " "+ getName(target) + " -- Target failed to withdraw the money from escrow! Wire transfer FAILED! Attempting to refund. Amt: "+ amt ); - - prose_package escrowFailed = prose.getPackage( new string_id("base_player", "escrow_withdraw_failed"), actorName, amt ); - utils.sendMail( pclib.SID_WIRE_MAIL_SUBJECT, escrowFailed, targetName, actorName ); - - refundEscrow( actor, actorName, target, targetName, amt ); - - return SCRIPT_CONTINUE; - } - - - public void refundEscrow(obj_id player, String playerName, obj_id target, String targetName, int amt) throws InterruptedException - { - - dictionary params = new dictionary(); - params.put( "player", player ); - params.put( "playerName", playerName ); - params.put( "target", target ); - params.put( "targetName", targetName ); - params.put( "amt", amt ); - messageTo( player, "handleTipRefundRequest", params, 1f, true ); - } - - - public int handleTipRefundRequest(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId( "player"); - String playerName = params.getString( "playerName"); - obj_id target = params.getObjId( "target"); - String targetName = params.getString( "targetName"); - int amt = params.getInt( "amt"); - - if (amt < 1 || amt > 1000000) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ playerName + " Target: "+ target + " "+ targetName + " -- Unable to refund escrow because the amount is invalid! Amt:"+ amt ); - return SCRIPT_CONTINUE; - } - - boolean success = transferBankCreditsFromNamedAccount( money.ACCT_TIP_ESCROW, player, amt, "handleTipRefundPass", "handleTipRefundFail", params ); - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ playerName + " Target: "+ target + " "+ targetName + " -- Calling transferBankCreditsFromNamedAccount to transfer refund from escrow. Amt:"+ amt ); - if (!success) - { - - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ playerName + " Target: "+ target + " "+ targetName + " -- transferBankCreditsFromNamedAccount failed immediately while attempting to refund escrow! Amt:"+ amt ); - notifyFailedRefund( player, playerName, target, targetName, amt ); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int handleTipRefundPass(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId( "player"); - String playerName = params.getString( "playerName"); - obj_id target = params.getObjId( "target"); - String targetName = params.getString( "targetName"); - int amt = params.getInt( "amt"); - - prose_package refundToSelf = prose.getPackage( new string_id("base_player","received_escrow_refund"), targetName, amt ); - utils.sendMail( pclib.SID_WIRE_MAIL_SUBJECT, refundToSelf, playerName, targetName ); - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ playerName + " Target: "+ target + " "+ targetName + " -- Refund successfully delivered. Amt:"+ amt ); - - return SCRIPT_CONTINUE; - } - - - public int handleTipRefundFail(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId( "player"); - String playerName = params.getString( "playerName"); - obj_id target = params.getObjId( "target"); - String targetName = params.getString( "targetName"); - int amt = params.getInt( "amt"); - - notifyFailedRefund( player, playerName, target, targetName, amt ); - - return SCRIPT_CONTINUE; - } - - - public void notifyFailedRefund(obj_id player, String playerName, obj_id target, String targetName, int amt) throws InterruptedException - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ player + " "+ playerName + " Target: "+ target + " "+ targetName + " -- Failed to refund player from escrow account! Amt:"+ amt ); - prose_package refundToSelf = prose.getPackage( new string_id("base_player","failed_escrow_refund"), targetName, amt ); - utils.sendMail( pclib.SID_WIRE_MAIL_SUBJECT, refundToSelf, playerName, targetName ); - } - - - public int handleTipFail(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " -- Tip cash transfer or bank wire escrow transfer failed!"); - - utils.removeScriptVar( self, pclib.VAR_TIP_SUI ); - utils.removeScriptVar( self, pclib.VAR_TIP_TARGET ); - utils.removeScriptVar( self, pclib.VAR_TIP_AMT ); - - obj_id target = params.getObjId("target"); - if (!isIdValid(target)) - { - return SCRIPT_CONTINUE; - } - - if (!exists(target) || !target.isLoaded()) - { - sendSystemMessage( self, pclib.SID_TIP_ERROR ); - return SCRIPT_CONTINUE; - } - - int amt = params.getInt("amt"); - boolean useCash = params.getBoolean("useCash"); - if (useCash) - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " Target: "+ target + " "+ getName(target) + " -- Cash transfer failed in transferCashTo! Amt: "+ amt ); - prose_package nsfCash = prose.getPackage( pclib.PROSE_TIP_NSF_CASH, target, amt ); - sendSystemMessageProse( self, nsfCash ); - } - else - { - CustomerServiceLog( "Trade", " Tip -- Player: "+ self + " "+ getName(self) + " Target: "+ target + " "+ getName(target) + " -- Bank->Escrow transfer failed in transferBankCreditsToNamedAccount! Amt: "+ amt ); - prose_package nsfBank = prose.getPackage( pclib.PROSE_TIP_NSF_BANK, target, amt ); - sendSystemMessageProse( self, nsfBank ); - } - - return SCRIPT_CONTINUE; - } - - - public void showTipSyntax(obj_id self) throws InterruptedException - { - sendSystemMessage(self, pclib.SID_TIP_SYNTAX); - } - - - public int cmdOpenFail(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target)) - { - return SCRIPT_OVERRIDE; - } - - prose_package pp = prose.getPackage(SID_CMD_OPEN_FAIL, target); - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - - public int cmdLoot(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id player = self; - - if (!isIdValid(target)) - { - return SCRIPT_CONTINUE; - } - - if (!isMob(target)) - { - return SCRIPT_CONTINUE; - } - - if (!isIncapacitated(target)) - { - return SCRIPT_CONTINUE; - } - - if (isIncapacitated(self)) - { - return SCRIPT_CONTINUE; - } - - if (pet_lib.isPet (target)) - { - return SCRIPT_CONTINUE; - } - - int got = getGameObjectType(target); - if (got == GOT_corpse) - { - queueCommand(self, (1421655546), target, "", COMMAND_PRIORITY_DEFAULT); - return SCRIPT_CONTINUE; - } - - if (isMob(target) && !isPlayer (target)) - { - if (group.isGrouped(self)) - { - obj_id team = getGroupObject (self); - int lootRule = getGroupLootRule(team); - - if (lootRule == 3) - { - if (hasObjVar (target, "autoLootComplete" )) - { - obj_id corpseInv = utils.getInventoryContainer(target); - queueCommand(player, (1880585606), corpseInv, "", COMMAND_PRIORITY_DEFAULT); - } - - obj_id[] objMembersWhoExist = utils.getLocalGroupMemberIds(team); - int teamNumber = objMembersWhoExist.length; - - if (teamNumber > 0) - { - int which = rand(0, teamNumber-1); - player = objMembersWhoExist[which]; - } - } - - if (loot.doGroupLootAllCheck(self, target)) - { - loot.lootAiCorpse(player, target); - } - return SCRIPT_CONTINUE; - } - loot.lootAiCorpse(self, target); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int cmdLootPlayer(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!utils.isOwner(target, self) && !isGod(self)) - { - return SCRIPT_OVERRIDE; - } - - int got = getGameObjectType(target); - if (got != GOT_corpse) - { - return SCRIPT_OVERRIDE; - } - - corpse.lootPlayerCorpse(self, target); - return SCRIPT_CONTINUE; - } - - - public int cmdActivateClone(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (params.equals("now")) - { - - if (isGod(self)) - { - if (utils.hasScriptVar(self, pclib.VAR_SUI_CLONE)) - { - int cloneSui = utils.getIntScriptVar(self, pclib.VAR_SUI_CLONE); - utils.removeScriptVar(self, pclib.VAR_SUI_CLONE); - forceCloseSUIPage(cloneSui); - } - - if (!pclib.playerRevive(self)) - { - - sendSystemMessageTestingOnly(self, "You may only use this command to force a clone spawn if you are dead."); - } - - return SCRIPT_CONTINUE; - } - } - - if (utils.hasScriptVar(self, pclib.VAR_SUI_CLONE)) - { - sendSystemMessageTestingOnly(self, "You already have a cloning options menu open!"); - return SCRIPT_CONTINUE; - } - - if (!isDead(self)) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, pclib.HANDLER_PLAYER_DEATH, null, 0, false); - - return SCRIPT_CONTINUE; - } - - - public int cmdActivateCloneFail(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - sendSystemMessageTestingOnly(self, "You may only use this command to activate the cloning options menu if you are dead."); - return SCRIPT_CONTINUE; - } - - - public int cmdSetBind(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!isIdValid(target)) - { - return SCRIPT_CONTINUE; - } - - int got = getGameObjectType(target); - if (got != GOT_terminal_cloning) - { - return SCRIPT_CONTINUE; - } - - cloninglib.requestBind(self, target); - return SCRIPT_CONTINUE; - } - - - public boolean canDeathBlow(obj_id killer, obj_id victim) throws InterruptedException - { - - if ((!isIdValid(victim)) || (!isPlayer(victim))) - { - debugServerConsoleMsg(killer, "cmdCoupDeGrace: ("+ victim + ")target is not player or is not incapacitated!!"); - combat.sendCombatSpamMessage(killer, new string_id("cbt_spam", "invalid_target")); - showFlyTextPrivate(killer, killer, new string_id("combat_effects", "target_invalid_fly"), 1.5f, colors.WHITE); - return false; - } - - if (!pvpCanAttack(killer, victim)) - { - showFlyTextPrivate(killer, killer, new string_id("combat_effects", "target_invalid_fly"), 1.5f, colors.WHITE); - combat.sendCombatSpamMessage(killer, new string_id("cbt_spam", "invalid_pvp_target")); - return false; - } - - if (isIncapacitated(victim)) - { - if (hasObjVar(victim, pclib.VAR_BEEN_COUPDEGRACED)) - { - combat.sendCombatSpamMessage(killer, new string_id("cbt_spam", "invalid_target")); - showFlyTextPrivate(killer, killer, new string_id("combat_effects", "target_invalid_fly"), 1.5f, colors.WHITE); - return false; - } - location myPos = getLocation(killer); - location targetPos = getLocation(victim); - if (myPos != null && targetPos != null) - { - float distance = myPos.distance(targetPos); - float maxDistance = getCommandMaxRange((1917386623)); - debugServerConsoleMsg(null, "Deathblow distance to target "); - if (distance < maxDistance) - { - - stealth.checkForAndMakeVisibleNoRecourse(killer); - - if (isIncapacitated(killer) || isDead(killer)) - { - return false; - } - - if (getState(killer, STATE_FEIGN_DEATH) == 1) - { - return false; - } - - int killerPosture = getPosture( killer ); - if (killerPosture == POSTURE_KNOCKED_DOWN) - { - return false; - } - - return true; - } - else - { - showFlyTextPrivate(killer, killer, new string_id("combat_effects", "range_too_far"), 1.5f, colors.MEDIUMTURQUOISE); - combat.sendCombatSpamMessage(killer, new string_id("cbt_spam", "out_of_range_far"), COMBAT_RESULT_OUT_OF_RANGE); - - CustomerServiceLog("Pvp", "Player %TU received deathblow message for target %TT, but has moved too "+ - "far away ("+ distance + ")", killer, victim); - } - } - else - { - combat.sendCombatSpamMessage(killer, new string_id("cbt_spam", "invalid_target")); - - showFlyTextPrivate(killer, killer, new string_id("combat_effects", "target_invalid_fly"), 1.5f, colors.WHITE); - CustomerServiceLog("Pvp", "Player %TU received deathblow message for target %TT, but we could "+ - "not get the player's positions", killer, victim); - } - } - else - { - combat.sendCombatSpamMessage(killer, new string_id("cbt_spam", "invalid_target")); - showFlyTextPrivate(killer, killer, new string_id("combat_effects", "target_invalid_fly"), 1.5f, colors.WHITE); - } - - return false; - } - - - public int cmdCoupDeGrace(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (canDeathBlow(self, target)) - { - pclib.coupDeGrace(target, self); - } - else - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int handleCoupDeGrace(obj_id self, dictionary params) throws InterruptedException - { - if (utils.hasScriptVar(self, COUPE_DE_GRACE_TARGET)) - { - obj_id target = utils.getObjIdScriptVar(self, COUPE_DE_GRACE_TARGET); - utils.removeScriptVar(self, COUPE_DE_GRACE_TARGET); - debugServerConsoleMsg(null, "Performing deathblow on "+ target); - if (isIdValid(target)) - { - - if (isIncapacitated(target)) - { - - location myPos = getLocation(self); - location targetPos = getLocation(target); - if (myPos != null && targetPos != null) - { - float distance = myPos.distance(targetPos); - float maxDistance = getCommandMaxRange((1917386623)); - debugServerConsoleMsg(null, "Deathblow distance to target "); - if (distance < maxDistance) - { - CustomerServiceLog("Pvp", "Player %TU received deathblow message for target %TT, and is performing the blow"); - pclib.coupDeGrace(target, self); - } - else - { - - CustomerServiceLog("Pvp", "Player %TU received deathblow message for target %TT, but has moved too "+ - "far away ("+ distance + ")", self, target); - } - } - else - { - CustomerServiceLog("Pvp", "Player %TU received deathblow message for target %TT, but we could "+ - "not get the player's positions", self, target); - } - } - else - { - CustomerServiceLog("Pvp", "Player %TU received deathblow message, but target %TT is no longer incapped ", self, target); - } - } - else - { - CustomerServiceLog("Pvp", "Player %TU received deathblow message, but has invalid deathblow scriptvar "+ target, self); - } - } - else - { - CustomerServiceLog("Pvp", "Player %TU received deathblow message, but has no deathblow scriptvar ", self); - } - if (!isIncapacitated(self)) - { - setCount(self, 0); - } - setState(self, STATE_PERFORM_DEATHBLOW, false); - return SCRIPT_CONTINUE; - } - - - public int cmdCorpse(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (-304150016), target, "", COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - - } - - - public int cmdConsent(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (params.equals("")) - { - target = getLookAtTarget(self); - - if (isIdValid(target) && isPlayer(target)) - { - pclib.consent(self, target); - } - else - { - if (hasObjVar(self, pclib.VAR_CONSENT_TO_ID)) - { - obj_id[] consentTo = getObjIdArrayObjVar(self, pclib.VAR_CONSENT_TO_ID); - if ((consentTo == null) || (consentTo.length == 0)) - { - sendSystemMessage(self, SID_CONSENT_TO_EMPTY); - return SCRIPT_OVERRIDE; - } - - Vector consentToName = new Vector(); - consentToName.setSize(0); - for (int i = 0; i < consentTo.length; ++i) - { - testAbortScript(); - consentToName = utils.addElement(consentToName, getPlayerFullName(consentTo[i])); - } - - sui.listbox(self, "@"+ SID_CONSENT_TO_LISTBOX_PROMPT, "@"+ SID_CONSENT_TO_LISTBOX_TITLE, consentToName); - - return SCRIPT_CONTINUE; - } - sendSystemMessage(self, SID_CONSENT_TO_EMPTY); - return SCRIPT_CONTINUE; - } - } - else - { - - if (params.startsWith(">")) - { - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - params = params.substring(1); - } - - if (params.indexOf(",") > 0) - { - - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - do - { - testAbortScript(); - String arg = st.nextToken(); - if (arg.startsWith(">")) - { - arg = arg.substring(1); - } - - obj_id playerId = getPlayerIdFromFirstName(arg); - if (isIdValid(playerId)) - { - pclib.consent(self, playerId); - } - - } - while (st.hasMoreTokens()); - } - else - { - obj_id playerId = getPlayerIdFromFirstName(params); - if (isIdValid(playerId)) - { - pclib.consent(self, playerId); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int cmdUnconsent(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (params.equals("")) - { - target = getLookAtTarget(self); - - if (isIdValid(target) && isPlayer(target)) - { - pclib.unconsent(self, target); - } - else - { - if (hasObjVar(self, pclib.VAR_CONSENT_TO_ID)) - { - obj_id[] consentTo = getObjIdArrayObjVar(self, pclib.VAR_CONSENT_TO_ID); - if ((consentTo == null) || (consentTo.length == 0)) - { - sendSystemMessage(self, SID_CONSENT_TO_EMPTY); - return SCRIPT_OVERRIDE; - } - - Vector consentToName = new Vector(); - consentToName.setSize(0); - for (int i = 0; i < consentTo.length; ++i) - { - testAbortScript(); - consentToName = utils.addElement(consentToName, getPlayerFullName(consentTo[i])); - } - - sui.listbox(self, self, "@"+ SID_UNCONSENT_LISTBOX_PROMPT, sui.OK_CANCEL, "@"+ SID_UNCONSENT_LISTBOX_TITLE, consentToName, HANDLER_UNCONSENT_MENU); - - return SCRIPT_CONTINUE; - } - sendSystemMessage(self, SID_CONSENT_TO_EMPTY); - return SCRIPT_CONTINUE; - } - } - else - { - - if (params.startsWith(">")) - { - params = params.substring(1); - } - - if (params.indexOf(",") > 0) - { - - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - do - { - testAbortScript(); - String arg = st.nextToken(); - if (arg.startsWith(">")) - { - arg = arg.substring(1); - } - - obj_id playerId = getPlayerIdFromFirstName(arg); - if (isIdValid(playerId)) - { - pclib.unconsent(self, playerId); - } - - } - while (st.hasMoreTokens()); - } - else - { - obj_id playerId = getPlayerIdFromFirstName(params); - if (isIdValid(playerId)) - { - pclib.unconsent(self, playerId); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int cmdHaveConsent(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (params.equals("")) - { - target = getLookAtTarget(self); - - if (isIdValid(target) && isPlayer(target)) - { - pclib.hasConsent(self, target, true); - } - else - { - if (hasObjVar(self, pclib.VAR_CONSENT_FROM_ID)) - { - obj_id[] consentFrom = getObjIdArrayObjVar(self, pclib.VAR_CONSENT_FROM_ID); - if ((consentFrom == null) || (consentFrom.length == 0)) - { - sendSystemMessage(self, SID_CONSENT_TO_EMPTY); - return SCRIPT_OVERRIDE; - } - - Vector consentFromName = new Vector(); - consentFromName.setSize(0); - for (int i = 0; i < consentFrom.length; ++i) - { - testAbortScript(); - consentFromName = utils.addElement(consentFromName, getPlayerFullName(consentFrom[i])); - } - - sui.listbox(self, "@"+ SID_CONSENT_FROM_LISTBOX_PROMPT, "@"+ SID_CONSENT_FROM_LISTBOX_TITLE, consentFromName); - - return SCRIPT_CONTINUE; - } - sendSystemMessage(self, SID_CONSENT_FROM_EMPTY); - return SCRIPT_CONTINUE; - } - } - else - { - - if (params.startsWith(">")) - { - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - params = params.substring(1); - } - - if (params.indexOf(",") > 0) - { - - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - do - { - testAbortScript(); - String arg = st.nextToken(); - if (arg.startsWith(">")) - { - arg = arg.substring(1); - } - - obj_id playerId = getPlayerIdFromFirstName(arg); - if (isIdValid(playerId)) - { - pclib.hasConsent(self, playerId, true); - } - - } - while (st.hasMoreTokens()); - } - else - { - - obj_id playerId = getPlayerIdFromFirstName(params); - if (isIdValid(playerId)) - { - pclib.hasConsent(self, playerId, true); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int startTraceLogging(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - enableTraceLogging(); - return SCRIPT_CONTINUE; - - } - - - public int stopTraceLogging(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - disableTraceLogging(); - return SCRIPT_CONTINUE; - - } - - - public int createCreature(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - String strCreatureType = params; - location locSpawnLocation = getLocation(self); - - return SCRIPT_CONTINUE; - } - - - public int createNPC(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - String strNPCType = params; - location locSpawnLocation = getLocation(self); - - return SCRIPT_CONTINUE; - } - - - public int cmdStartLogout(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!hasScript(self, "player.player_logout")) - { - attachScript(self, "player.player_logout"); - dictionary d = new dictionary(); - if (isGod(self)) - { - d.put("timeLeft", 1); - } - else - { - d.put("timeLeft", LOGOUT_TIME); - } - d.put("countInterval", LOGOUT_COUNT_INTERVAL); - messageTo(self, "OnLogoutPulse", d, 0.1f, false); - } - return SCRIPT_CONTINUE; - } - - - public int maskscent(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - return SCRIPT_CONTINUE; - - } - - - public int failMaskscent(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - sendSystemMessage( self, SID_SYS_SCENTMASK_FAIL ); - - return SCRIPT_CONTINUE; - } - - - public int milkCreature(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id playerCurrentMount = getMountId(self); - - obj_id intendedTarget = getIntendedTarget(self); - obj_id lookAtTarget = getLookAtTarget(self); - - String milkType_lookAt = ai_lib.getMilkType(lookAtTarget); - String milkType_intended = ai_lib.getMilkType(intendedTarget); - if (milkType_lookAt != null && !milkType_lookAt.equals("none")) - { - target = lookAtTarget; - } - else if (milkType_intended != null && !milkType_intended.equals("none")) - { - target = intendedTarget; - } - - else if (!isIdValid(lookAtTarget) && !isIdValid(intendedTarget)) - { - sendSystemMessage(self, MILK_NO_TARGET); - return SCRIPT_OVERRIDE; - } - else - { - sendSystemMessage(self, SID_NO_ALLOW_MILK); - return SCRIPT_OVERRIDE; - } - - if (vehicle.isVehicle(target) || (ai_lib.aiGetNiche(target) == NICHE_DROID) || (ai_lib.aiGetNiche(target) == NICHE_ANDROID)) - { - sendSystemMessage(self, SID_NO_ALLOW_MILK); - return SCRIPT_OVERRIDE; - } - if (isIdValid(playerCurrentMount)) - { - sendSystemMessage(self, SID_CANT_MILK_MOUNTED); - return SCRIPT_OVERRIDE; - } - if (pet_lib.isPet(target)) - { - sendSystemMessage(self, SID_CANT_MILK); - return SCRIPT_OVERRIDE; - } - - float distStart = utils.getDistance2D(self, target); - if ((distStart < -3) || (distStart > 3)) - { - sendSystemMessage(self, MILK_TOO_FAR_START); - return SCRIPT_OVERRIDE; - } - if (!ai_lib.isAiDead(target) && !hasScript(target, "ai.pet_advance") && !ai_lib.isInCombat(target)) - { - dictionary dict = new dictionary(); - dict.put("player", self); - messageTo(target, "attemptMilkHandler", dict, 0, false); - } - return SCRIPT_OVERRIDE; - } - - - public int searchLair(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - obj_id intendedTarget = getIntendedTarget(self); - obj_id lookAtTarget = getLookAtTarget(self); - - int GOT_type_intended = getGameObjectType(intendedTarget); - int GOT_type_look = getGameObjectType(lookAtTarget); - if (GOT_type_intended == GOT_lair) - { - target = intendedTarget; - } - else if (GOT_type_look == GOT_lair) - { - target = lookAtTarget; - } - else - { - sendSystemMessage(self, LAIR_NOT_TARGETED); - return SCRIPT_OVERRIDE; - } - float maxDistance = 10f; - float distanceToLair = utils.getDistance2D(self, target); - - if (hasScript(target, "theme_park.dungeon.mustafar_trials.valley_battleground.battlefield_destructable")) - { - return SCRIPT_OVERRIDE; - } - - if (distanceToLair > maxDistance) - { - sendSystemMessage(self, TOO_FAR_FROM_LAIR ); - return SCRIPT_OVERRIDE; - } - else - { - if (!utils.hasScriptVar( target, "lair.searched" ) && !isIncapacitated( self )) - { - - collection.collectionResource(self, "egg"); - - dictionary dict = new dictionary(); - dict.put("player", self); - messageTo(target, "searchLair", dict, 0, false); - } - else - { - sendSystemMessage(self, SID_FOUND_NOTHING ); - } - } - return SCRIPT_CONTINUE; - } - - - public int removeScentMask(obj_id self, dictionary params) throws InterruptedException - { - - int scentMasked = getState( self, STATE_MASK_SCENT ); - if (scentMasked == 0) - { - buff.removeBuff(self, "mask_scent"); - return SCRIPT_CONTINUE; - } - - int scount = params.getInt( "count"); - int count = utils.getIntScriptVar( self, "scentmask.count"); - if (count != scount) - { - return SCRIPT_CONTINUE; - } - - setState( self, STATE_MASK_SCENT, false ); - buff.removeBuff(self, "mask_scent"); - sendSystemMessage( self, SID_SYS_SCENTMASK_STOP ); - - return SCRIPT_CONTINUE; - } - - - public int removeScentMaskNoNotify(obj_id self, dictionary params) throws InterruptedException - { - return SCRIPT_CONTINUE; - - } - - - public int concealEnable(obj_id self, dictionary params) throws InterruptedException - { - return SCRIPT_CONTINUE; - - } - - - public int failConceal(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int removeConceal(obj_id self, dictionary params) throws InterruptedException - { - return SCRIPT_CONTINUE; - - } - - - public boolean itemIsRare(obj_id self, int skillMod) throws InterruptedException - { - - boolean rare = false; - if (skillMod >= 65) - { - int difficultyCheck = (skillMod-50) + 30; - int dieRoll = rand( 1, 100 ); - if (dieRoll > difficultyCheck) - { - - dieRoll = rand( 1, 4 ); - if (dieRoll == 1) - { - rare = true; - } - } - } - return rare; - } - - - public int sysGroup(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (hasSkill( self, "class_officer_phase1_master" )) - { - squad_leader.sendSquadLeaderCommand( self, params ); - } - - return SCRIPT_CONTINUE; - } - - - public int groupWaypoint(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (hasSkill( self, "class_officer_phase1_master" )) - { - - if (params.equals("a") || params.equals("c")) - { - squad_leader.sendSquadWaypoint(self, getLocation(self)); - } - else - { - - location wayLoc = combat.getCommandGroundTargetLocation(params); - squad_leader.sendSquadWaypoint(self, wayLoc); - } - } - - return SCRIPT_CONTINUE; - } - - - public int createOfficerGroupWaypoint(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - location wayLoc = params.getLocation("wayLoc"); - - obj_id groupWaypoint = createWaypointInDatapad(self, wayLoc); - setWaypointColor(groupWaypoint, "green"); - setWaypointName(groupWaypoint, "Group Waypoint"); - setWaypointActive(groupWaypoint, true); - - dictionary dict = new dictionary(); - dict.put("groupWaypoint", groupWaypoint); - - messageTo(self, "removeOfficerGroupWaypoint", dict, 600, false); - - return SCRIPT_CONTINUE; - - } - - - public int removeOfficerGroupWaypoint(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id groupWaypoint = params.getObjId("groupWaypoint"); - - if (!isIdValid(groupWaypoint) || !exists(groupWaypoint)) - { - return SCRIPT_CONTINUE; - } - - destroyWaypointInDatapad(groupWaypoint, self); - - return SCRIPT_CONTINUE; - } - - - public int OnSurveyDataReceived(obj_id self, float[] xVals, float[] zVals, float[] efficiencies) throws InterruptedException - { - if (efficiencies == null) - { - return SCRIPT_CONTINUE; - } - - int highest = -1; - float highVal = 0.f; - for (int i=0; i highVal) - { - highest = i; - highVal = efficiencies[i]; - } - } - - if ((highest > -1) && (highVal > 0.1)) - { - - location point = new location(); - point.x = xVals[highest]; - point.y = 0; - point.z = zVals[highest]; - - obj_id waypoint = getSurveyWaypoint( self ); - boolean newWpCreated = false; - if (!isIdValid(waypoint)) - { - waypoint = createWaypointInDatapad( self, point ); - newWpCreated = true; - } - - if (isIdValid(waypoint)) - { - setWaypointVisible( waypoint, true ); - setWaypointActive( waypoint, true ); - setWaypointLocation( waypoint, point ); - setWaypointName( waypoint, "Resource Survey"); - - if (newWpCreated) - { - setWaypointColor( waypoint, "orange"); - } - - setObjVar( self, "survey_waypoint", waypoint ); - } - - sendSystemMessage( self, SID_SURVEY_WAYPOINT ); - } - - return SCRIPT_CONTINUE; - } - - - public obj_id getSurveyWaypoint(obj_id self) throws InterruptedException - { - - obj_id[] data = getWaypointsInDatapad( self ); - if (data != null) - { - for (int i=0; i halfWidth) - { - displayCoordX = halfWidth; - } - else if (displayCoordX < -halfWidth) - { - displayCoordX = -halfWidth; - } - - final float halfHeight = baInfo[1]/2; - if (displayCoordZ > halfHeight) - { - displayCoordZ = halfHeight; - } - else if (displayCoordZ < -halfHeight) - { - displayCoordZ = -halfHeight; - } - - spot.x = displayCoordX + baInfo[2]; - spot.z = displayCoordZ + baInfo[3]; - } - } - } - } - - if (spot == null) - { - sendSystemMessageTestingOnly(self, "Waypoint: The system was unable to parse a valid waypoint location."); - } - else - { - obj_id wp = createWaypointInDatapadWithLimits(self, spot); - if (isIdValid(wp)) - { - if (!wpDifferentPlanet) - { - setWaypointActive(wp, true); - } - - setWaypointVisible(wp, true); - - String wpName = null; - for (int i = parsedIndex; i < parsedParams.size(); ++i) - { - testAbortScript(); - if (wpName == null) - { - wpName = ((String)(parsedParams.get(i))); - } - else - { - wpName += " "; - wpName += ((String)(parsedParams.get(i))); - } - } - - if (wpName == null) - { - wpName = "Waypoint"; - } - - setWaypointName(wp, wpName); - - if (wpColor != null && !wpColor.equals("")) - { - setWaypointColor(wp, wpColor); - } - - if (!wpDifferentPlanet) - { - if (isIdValid(intendedTarget)) - { - sendSystemMessageTestingOnly(self, "Waypoint: New waypoint \""+ wpName + "\" created for intended target location ("+ (int)displayCoordX + ", "+ (int)spot.y + ", "+ (int)displayCoordZ + ")"); - } - else if (isIdValid(lookAtTarget)) - { - sendSystemMessageTestingOnly(self, "Waypoint: New waypoint \""+ wpName + "\" created for look at target location ("+ (int)displayCoordX + ", "+ (int)spot.y + ", "+ (int)displayCoordZ + ")"); - } - else - { - sendSystemMessageTestingOnly(self, "Waypoint: New waypoint \""+ wpName + "\" created for location ("+ (int)displayCoordX + ", "+ (int)spot.y + ", "+ (int)displayCoordZ + ")"); - } - } - else - { - final String localizedPlanetName = localize(new string_id("planet_n", spot.area)); - sendSystemMessageTestingOnly(self, "Waypoint: New waypoint \""+ wpName + "\" created for location "+ localizedPlanetName + " ("+ (int)displayCoordX + ", "+ (int)spot.y + ", "+ (int)displayCoordZ + ")"); - } - } - else - { - string_id errorMessage = new string_id("base_player", "too_many_waypoints"); - sendSystemMessage(self, errorMessage); - } - } - - return SCRIPT_CONTINUE; - } - - - public int cmdSpaceWaypoint(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - String wpColor = null; - float displayCoordX = 0.0f; - float displayCoordZ = 0.0f; - boolean wpDifferentPlanet = false; - - int parsedIndex = 0; - Vector parsedParams = new Vector(); - parsedParams.setSize(0); - if (params != null && !params.equals("")) - { - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - while (st.hasMoreTokens()) - { - testAbortScript(); - String token = st.nextToken(); - if (wpColor == null) - { - for (int i = 0; i < utils.WAYPOINT_COLORS.length; ++i) - { - testAbortScript(); - if (token.toLowerCase().equals(utils.WAYPOINT_COLORS[i])) - { - wpColor = utils.WAYPOINT_COLORS[i]; - break; - } - } - - if (wpColor == null) - { - utils.addElement(parsedParams, token); - } - } - else - { - utils.addElement(parsedParams, token); - } - } - } - - location spot = null; - if (parsedParams == null || (parsedParams.size() <= 0)) - { - if (!isIdValid(target)) - { - target = space_transition.getContainingShip(self); - } - else - { - obj_id objContainer = getTopMostContainer(target); - if (isIdValid(objContainer)) - { - target = objContainer; - } - } - - spot = getWorldLocation(target); - - if (spot != null) - { - displayCoordX = spot.x; - displayCoordZ = spot.z; - } - } - else - { - String wpGroundPlanet = null; - vector wpGroundPLanetBuildoutCoords = null; - String wpSpaceZone = null; - float wpCoord1 = Float.NEGATIVE_INFINITY; - float wpCoord2 = Float.NEGATIVE_INFINITY; - float wpCoord3 = Float.NEGATIVE_INFINITY; - - wpCoord1 = utils.stringToFloat(((String)(parsedParams.get(parsedIndex)))); - if (wpCoord1 == Float.NEGATIVE_INFINITY) - { - - String planet = ((String)(parsedParams.get(parsedIndex))).toLowerCase(); - for (int i = 0; i < WAYPOINT_GROUND_PLANETS_EXTERNAL.length; ++i) - { - testAbortScript(); - if ((planet.equals(WAYPOINT_GROUND_PLANETS_EXTERNAL[i])) && (i < WAYPOINT_GROUND_PLANETS_INTERNAL.length)) - { - wpGroundPlanet = WAYPOINT_GROUND_PLANETS_INTERNAL[i]; - - if (i < WAYPOINT_GROUND_PLANETS_BUILDOUT_COORDS.length) - { - wpGroundPLanetBuildoutCoords = WAYPOINT_GROUND_PLANETS_BUILDOUT_COORDS[i]; - } - - ++parsedIndex; - break; - } - } - - if (wpGroundPlanet == null) - { - for (int i = 0; i < WAYPOINT_SPACE_ZONES_EXTERNAL.length; ++i) - { - testAbortScript(); - if ((planet.equals(WAYPOINT_SPACE_ZONES_EXTERNAL[i])) && (i < WAYPOINT_SPACE_ZONES_INTERNAL.length)) - { - wpSpaceZone = WAYPOINT_SPACE_ZONES_INTERNAL[i]; - - ++parsedIndex; - break; - } - } - } - - if (((wpGroundPlanet != null) || (wpSpaceZone != null)) && (parsedIndex < parsedParams.size())) - { - wpCoord1 = utils.stringToFloat(((String)(parsedParams.get(parsedIndex)))); - } - } - - if (wpCoord1 != Float.NEGATIVE_INFINITY) - { - ++parsedIndex; - if (parsedIndex < parsedParams.size()) - { - wpCoord2 = utils.stringToFloat(((String)(parsedParams.get(parsedIndex)))); - if (wpCoord2 != Float.NEGATIVE_INFINITY) - { - ++parsedIndex; - if (parsedIndex < parsedParams.size()) - { - wpCoord3 = utils.stringToFloat(((String)(parsedParams.get(parsedIndex)))); - if (wpCoord3 != Float.NEGATIVE_INFINITY) - { - ++parsedIndex; - } - else if (wpGroundPlanet == null) - { - wpCoord1 = Float.NEGATIVE_INFINITY; - wpCoord2 = Float.NEGATIVE_INFINITY; - --parsedIndex; - --parsedIndex; - } - } - else if (wpGroundPlanet == null) - { - wpCoord1 = Float.NEGATIVE_INFINITY; - wpCoord2 = Float.NEGATIVE_INFINITY; - --parsedIndex; - --parsedIndex; - } - } - else - { - wpCoord1 = Float.NEGATIVE_INFINITY; - --parsedIndex; - } - } - else - { - wpCoord1 = Float.NEGATIVE_INFINITY; - --parsedIndex; - } - } - - if ((wpGroundPlanet != null) && ((wpCoord1 == Float.NEGATIVE_INFINITY) || (wpCoord2 == Float.NEGATIVE_INFINITY))) - { - - wpGroundPlanet = null; - wpCoord1 = Float.NEGATIVE_INFINITY; - wpCoord2 = Float.NEGATIVE_INFINITY; - wpCoord3 = Float.NEGATIVE_INFINITY; - parsedIndex = 0; - } - - if ((wpSpaceZone != null) && ((wpCoord1 == Float.NEGATIVE_INFINITY) || (wpCoord2 == Float.NEGATIVE_INFINITY) || (wpCoord3 == Float.NEGATIVE_INFINITY))) - { - - wpSpaceZone = null; - wpCoord1 = Float.NEGATIVE_INFINITY; - wpCoord2 = Float.NEGATIVE_INFINITY; - wpCoord3 = Float.NEGATIVE_INFINITY; - parsedIndex = 0; - } - - if (wpCoord1 == Float.NEGATIVE_INFINITY) - { - if (!isIdValid(target)) - { - target = space_transition.getContainingShip(self); - } - else - { - obj_id objContainer = getTopMostContainer(target); - if (isIdValid(objContainer)) - { - target = objContainer; - } - } - - spot = getWorldLocation(target); - - if (spot != null) - { - displayCoordX = spot.x; - displayCoordZ = spot.z; - } - } - else - { - if (wpCoord3 == Float.NEGATIVE_INFINITY) - { - spot = new location(wpCoord1, 0.0f, wpCoord2); - } - else - { - spot = new location(wpCoord1, wpCoord2, wpCoord3); - } - - if (spot != null) - { - displayCoordX = spot.x; - displayCoordZ = spot.z; - - if ((wpGroundPlanet != null) && (!wpGroundPlanet.equals(spot.area))) - { - if (wpGroundPLanetBuildoutCoords != null) - { - float[] baInfo = getBuildoutAreaSizeAndCenter(wpGroundPLanetBuildoutCoords.x, wpGroundPLanetBuildoutCoords.z, wpGroundPlanet, true, true); - - if ((baInfo != null) && (baInfo.length == 4)) - { - final float halfWidth = baInfo[0]/2; - if (displayCoordX > halfWidth) - { - displayCoordX = halfWidth; - } - else if (displayCoordX < -halfWidth) - { - displayCoordX = -halfWidth; - } - - final float halfHeight = baInfo[1]/2; - if (displayCoordZ > halfHeight) - { - displayCoordZ = halfHeight; - } - else if (displayCoordZ < -halfHeight) - { - displayCoordZ = -halfHeight; - } - - spot.x = displayCoordX + baInfo[2]; - spot.z = displayCoordZ + baInfo[3]; - } - } - - wpDifferentPlanet = true; - spot.area = wpGroundPlanet; - } - else if ((wpSpaceZone != null) && (!wpSpaceZone.equals(spot.area))) - { - wpDifferentPlanet = true; - spot.area = wpSpaceZone; - } - } - } - } - - if (spot == null) - { - sendSystemMessageTestingOnly(self, "Waypoint: The system was unable to parse a valid waypoint location."); - } - else - { - obj_id wp = createWaypointInDatapadWithLimits(self, spot); - if (isIdValid(wp)) - { - if (!wpDifferentPlanet) - { - setWaypointActive(wp, true); - } - - setWaypointVisible(wp, true); - - String wpName = null; - for (int i = parsedIndex; i < parsedParams.size(); ++i) - { - testAbortScript(); - if (wpName == null) - { - wpName = ((String)(parsedParams.get(i))); - } - else - { - wpName += " "; - wpName += ((String)(parsedParams.get(i))); - } - } - - if (wpName == null) - { - wpName = "Waypoint"; - } - - setWaypointName(wp, wpName); - - if ((wpColor == null) && !wpDifferentPlanet) - { - wpColor = "space"; - } - - if (wpColor != null && !wpColor.equals("")) - { - setWaypointColor(wp, wpColor); - } - - if (!wpDifferentPlanet) - { - sendSystemMessageTestingOnly(self, "Waypoint: New waypoint \""+ wpName + "\" created for location ("+ (int)displayCoordX + ", "+ (int)spot.y + ", "+ (int)displayCoordZ + ")"); - } - else - { - final String localizedPlanetName = localize(new string_id("planet_n", spot.area)); - sendSystemMessageTestingOnly(self, "Waypoint: New waypoint \""+ wpName + "\" created for location "+ localizedPlanetName + " ("+ (int)displayCoordX + ", "+ (int)spot.y + ", "+ (int)displayCoordZ + ")"); - } - } - else - { - string_id errorMessage = new string_id("base_player", "too_many_waypoints"); - sendSystemMessage(self, errorMessage); - } - } - - return SCRIPT_CONTINUE; - } - - - public int cmdClearQueue(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueClear(self); - - return SCRIPT_CONTINUE; - } - - - public int getPrototype(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(target, "crafting.tool")) - { - return SCRIPT_CONTINUE; - } - - messageTo(target, "getPrototype", null, 0, false); - return SCRIPT_CONTINUE; - } - - - public int cmdCityban(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (target == self) - { - return SCRIPT_CONTINUE; - } - - if (!isPlayer( target )) - { - return SCRIPT_CONTINUE; - } - - int city_id = city.checkCity( self, true ); - if (city_id == 0) - { - return SCRIPT_CONTINUE; - } - - obj_id mayor = cityGetLeader( city_id ); - if (!city.isMilitiaOfCity( self, city_id ) && (self != mayor)) - { - sendSystemMessage( self, SID_NOT_MILITIA ); - return SCRIPT_CONTINUE; - } - - if (isGod(target) || hasObjVar(target, "gm")) - { - - sendSystemMessage(self, SID_NOT_CSR_BAN); - - prose_package pp = prose.getPackage(SID_CSR_BAN_ATTEMPT_MSG, getFirstName(self), cityGetName(city_id)); - sendSystemMessageProse(target, pp); - - return SCRIPT_CONTINUE; - } - - if (target == mayor) - { - return SCRIPT_CONTINUE; - } - - if (city.isCitizenOfCity( target, city_id )) - { - sendSystemMessage( self, SID_NOT_CITIZEN_BAN ); - return SCRIPT_CONTINUE; - } - - sendSystemMessage( target, SID_CITY_BANNED ); - int[] banCities = getIntArrayObjVar( target, "city.banlist"); - if (banCities == null) - { - int[] newBanCities = new int[1]; - newBanCities[0] = city_id; - - setObjVar( target, "city.banlist", newBanCities ); - } - else - { - - for (int i=0; i maxmt) - { - sendSystemMessage( self, SID_NO_MORE_MT ); - return SCRIPT_CONTINUE; - } - - int factional = dataTableGetInt( CITY_MISSION_TERMINALS, idx-1, "FACTION"); - if ((factional == 1) && !hasSkill( self, "social_politician_martial_04" )) - { - sendSystemMessage( self, SID_NO_FACTIONAL ); - return SCRIPT_CONTINUE; - } - - obj_id structure = getTopMostContainer( self ); - if (isIdValid(structure) && (structure != self)) - { - - if (!player_structure.isCivic( structure )) - { - sendSystemMessage( self, SID_CIVIC_ONLY ); - return SCRIPT_CONTINUE; - } - } - - int cost = 1000; - - dictionary payparams = new dictionary(); - payparams.put( "city_id", city_id ); - payparams.put( "cost", cost ); - payparams.put( "idx", idx ); - transferBankCreditsToNamedAccount( cityGetCityHall( city_id ), money.ACCT_CITY, cost, "handleMTFeeSuccess", "handleMTFeeFail", payparams ); - - return SCRIPT_CONTINUE; - } - - - public int handleMTFeeSuccess(obj_id self, dictionary params) throws InterruptedException - { - int city_id = params.getInt( "city_id"); - int idx = params.getInt( "idx"); - String[] terminalTemplates = dataTableGetStringColumn( CITY_MISSION_TERMINALS, "TEMPLATE"); - city.addMissionTerminal( city_id, self, terminalTemplates[idx-1] ); - - return SCRIPT_CONTINUE; - } - - - public int handleMTFeeFail(obj_id self, dictionary params) throws InterruptedException - { - int cost = params.getInt( "cost"); - prose_package pp = prose.getPackage( SID_CITY_NO_MONEY, cost ); - sendSystemMessageProse( self, pp ); - - return SCRIPT_CONTINUE; - } - - - public int handleSTFeeSuccess(obj_id self, dictionary params) throws InterruptedException - { - int city_id = params.getInt( "city_id"); - int idx = params.getInt( "idx"); - String[] trainerTemplates = dataTableGetStringColumn( CITY_SKILL_TRAINERS, "TEMPLATE"); - city.addSkillTrainer( city_id, self, trainerTemplates[idx-1] ); - - return SCRIPT_CONTINUE; - } - - - public int handleSTFeeFail(obj_id self, dictionary params) throws InterruptedException - { - int cost = params.getInt( "cost"); - prose_package pp = prose.getPackage( SID_CITY_NO_MONEY, cost ); - sendSystemMessageProse( self, pp ); - - return SCRIPT_CONTINUE; - } - - - public int cmdCityInfo(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - int[] cities = getAllCityIds(); - if ((cities == null) || (cities.length == 0)) - { - sendSystemMessage( self, new string_id( "city/city", "csr_no_cities") ); - return SCRIPT_CONTINUE; - } - - String[] planets = - { - "corellia", "dantooine", "lok", "naboo", "rori", "talus", "tatooine" - }; - java.util.Map counts = new java.util.HashMap(); - - String[] cityPlanet = new String[cities.length]; - String[] cityName = new String[cities.length]; - for (int i=0; i= results.length="+ results.length + ", not enough buffer space to pack the dictionary! character transfer will FAIL"); - return SCRIPT_OVERRIDE; - } - } - else - { - CustomerServiceLog("CharacterTransfer", "OnStartCharacterUpload(withItems="+ withItems + ") runScripts(\"OnUploadCharacter\") returned SCRIPT_OVERRIDE, character transfer will FAIL"); - final string_id mailTransferFailedScriptError = new string_id("character_transfer", "failed_internal_script_error"); - final string_id mailTransferFailedSubject = new string_id("character_transfer", "failed_subject"); - utils.sendMail(mailTransferFailedScriptError, mailTransferFailedScriptError, self, "System"); - - resultSize.set(0); - return SCRIPT_OVERRIDE; - } - } - catch(Throwable t) - { - CustomerServiceLog("CharacterTransfer", "OnStartCharacterUpload(withItems="+ withItems + ") : an exception was thrown, character transfer will FAIL : "+ t); - final string_id mailTransferFailedScriptError = new string_id("character_transfer", "failed_internal_script_error"); - final string_id mailTransferFailedSubject = new string_id("character_transfer", "failed_subject"); - utils.sendMail(mailTransferFailedScriptError, mailTransferFailedScriptError, self, "System"); - - result = null; - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public boolean ctsCheckAndLogUniqueStaticItemAlreadyExists(obj_id container, dictionary itemDictionary) throws InterruptedException - { - if (isIdNull(container) || (itemDictionary == null)) - { - return false; - } - - if (itemDictionary.containsKey("staticItemName")) - { - String staticItemName = itemDictionary.getString("staticItemName"); - if (staticItemName == null) - { - return false; - } - - if (!static_item.isUniqueStaticItem(staticItemName)) - { - return false; - } - - obj_id containerOwnerId = getOwner(container); - if (isIdNull(containerOwnerId)) - { - return false; - } - - if (!isPlayer(containerOwnerId)) - { - return false; - } - - if (utils.playerHasStaticItemInBankOrInventory(containerOwnerId, staticItemName)) - { - CustomerServiceLog("CharacterTransfer", "unique static item "+ staticItemName + " already exists"); - return true; - } - - if (utils.playerHasStaticItemInAppearanceInventory(containerOwnerId, staticItemName)) - { - CustomerServiceLog("CharacterTransfer", "unique static item "+ staticItemName + " already exists"); - return true; - } - } - - return false; - } - - - public boolean ctsHasExceededResourceTransferLimit(int crateCountLimit, int currentCrateCount, long unitCountLimit, long currentUnitCount) throws InterruptedException - { - if ((crateCountLimit > 0) && (currentCrateCount >= crateCountLimit)) - { - return true; - } - - if ((unitCountLimit > 0L) && (currentUnitCount >= unitCountLimit)) - { - return true; - } - - return false; - } - - - public obj_id unpackItem(obj_id container, dictionary itemDictionary) throws InterruptedException - { - obj_id newItem = null; - - try - { - obj_id self = getSelf(); - if (!isIdValid(self)) - { - return null; - } - - LIVE_LOG("CharacterTransfer", "unpackItem("+ container + ", "+ itemDictionary + ")"); - - if (! itemDictionary.containsKey("objectTemplateCrc")) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : could not retrieve object template crc from item dictionary. TRANSFER FAILED"); - return null; - } - int objectTemplateCrc = itemDictionary.getInt("objectTemplateCrc"); - - String objectTemplateName = "UNKNOWN ITEM"; - if (itemDictionary.containsKey("objectTemplateName")) - { - objectTemplateName = itemDictionary.getString("objectTemplateName"); - } - - boolean isEquipped = false; - if (itemDictionary.containsKey("isEquipped")) - { - isEquipped = itemDictionary.getBoolean("isEquipped"); - } - - boolean isAppearanceEquipped = false; - if (itemDictionary.containsKey("isAppearanceEquipped")) - { - isAppearanceEquipped = itemDictionary.getBoolean("isAppearanceEquipped"); - } - - if (itemDictionary.containsKey("staticItemName")) - { - String staticItemName = itemDictionary.getString("staticItemName"); - newItem = static_item.createNewItemFunction(staticItemName, container); - CustomerServiceLog("CharacterTransfer", "unpackItem() : createNewItemFunction("+ staticItemName + ", "+ container + ") = "+ newItem); - } - else if (itemDictionary.containsKey("msoDraftSchematicCrc")) - { - int schematicCrc = itemDictionary.getInt("msoDraftSchematicCrc"); - newItem = createSchematic(schematicCrc, container); - CustomerServiceLog("CharacterTransfer", "unpackItem() : createSchematic("+ schematicCrc + ", "+ container + ") = "+ newItem); - } - else if (itemDictionary.containsKey("schematicTemplateCrc")) - { - - return null; - } - else - { - if (isEquipped || isAppearanceEquipped) - { - - newItem = createObjectInInventoryAllowOverload(objectTemplateCrc, self); - CustomerServiceLog("CharacterTransfer", "unpackItem() : createObjectInInventoryAllowOverload("+ objectTemplateCrc + "="+ objectTemplateName + ", "+ self + ") = "+ newItem); - } - else if (itemDictionary.containsKey("bypassVolumeCheck")) - { - newItem = createObjectInInventoryAllowOverload(objectTemplateCrc, self); - } - else - { - int containerType = getContainerType(container); - if (containerType == 2) - { - newItem = createObjectOverloaded(objectTemplateCrc, container); - } - else - { - newItem = createObject(objectTemplateCrc, container, ""); - } - CustomerServiceLog("CharacterTransfer", "unpackItem() : createObjectOverloaded("+ objectTemplateCrc + "="+ objectTemplateName + ", "+ container + ") = "+ newItem); - } - } - - if (!isIdValid(newItem)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to create object in container "+ container + ": "+ itemDictionary); - return null; - } - else - { - setOwner(newItem, self); - - utils.setLocalVar(newItem, "ctsBeingUnpacked", true); - } - - if (! itemDictionary.containsKey("packedObjvars")) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to retrieve packedObjvars from item dictionary: "+ itemDictionary); - return null; - } - - String packedObjvars = itemDictionary.getString("packedObjvars"); - if (packedObjvars == null) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to get a non-null packedObjvars value from item dictionary: "+ itemDictionary); - return null; - } - - setPackedObjvars(newItem, packedObjvars); - - int objectType = getGameObjectType(newItem); - if (!static_item.isStaticItem(newItem)) - { - - if (itemDictionary.containsKey("attribute_types") && itemDictionary.containsKey("attribute_values")) - { - int[] itemAttribTypes = itemDictionary.getIntArray("attribute_types"); - int[] itemAttribValues = itemDictionary.getIntArray("attribute_values"); - if (itemAttribTypes != null && itemAttribValues != null) - { - attribute[] itemAttribs = new attribute[itemAttribTypes.length]; - int itemAttribsIter; - for (itemAttribsIter = 0; itemAttribsIter < itemAttribTypes.length; ++itemAttribsIter) - { - testAbortScript(); - itemAttribs[itemAttribsIter] = new attribute(itemAttribTypes[itemAttribsIter], itemAttribValues[itemAttribsIter]); - } - if (!setMaxAttribs(newItem, itemAttribs)) - { - CustomerServiceLog("CharacterTransfer", "setMaxAttribs( "+ newItem + ", ...) FAILED"); - } - if (!setAttribs(newItem, itemAttribs)) - { - CustomerServiceLog("CharacterTransfer", "setAttribs( "+ newItem + ", ...) FAILED"); - } - } - } - - if (itemDictionary.containsKey("maxHitpoints")) - { - int maxHitpoints = itemDictionary.getInt("maxHitpoints"); - if (!setMaxHitpoints(newItem, maxHitpoints)) - { - CustomerServiceLog("CharacterTransfer", "setMaxHitpoints( "+ newItem + ", "+ maxHitpoints + ") FAILED"); - } - } - - if (itemDictionary.containsKey("hitpoints")) - { - int hitpoints = itemDictionary.getInt("hitpoints"); - if (!setInvulnerableHitpoints(newItem, hitpoints)) - { - CustomerServiceLog("CharacterTransfer", "setInvulnerableHitpoints( "+ newItem + ", "+ hitpoints + ") FAILED"); - } - } - - if (itemDictionary.containsKey("conditionFlags")) - { - int conditionFlags = itemDictionary.getInt("conditionFlags"); - if (!setCondition(newItem, conditionFlags)) - { - CustomerServiceLog("CharacterTransfer", "setCondition( "+ newItem + ", "+ conditionFlags + ") FAILED"); - } - } - - if (itemDictionary.containsKey("scripts")) - { - String[] itemScripts = itemDictionary.getStringArray("scripts"); - if (itemScripts != null && itemScripts.length > 0) - { - int scriptIter; - for (scriptIter = 0; scriptIter < itemScripts.length; ++scriptIter) - { - testAbortScript(); - if (!hasScript(newItem, itemScripts[scriptIter])) - { - attachScript(newItem, itemScripts[scriptIter]); - } - } - } - } - - if (itemDictionary.containsKey("objectName")) - { - String objectName = itemDictionary.getString("objectName"); - setName(newItem, objectName); - } - - if (itemDictionary.containsKey("isWeaponItem")) - { - boolean isWeaponItem = itemDictionary.getBoolean("isWeaponItem"); - if (isWeaponItem) - { - - if (itemDictionary.containsKey("currentVersion")) - { - - int currentVersion = itemDictionary.getInt("currentVersion"); - setConversionId(newItem, currentVersion); - } - - int minDamage = itemDictionary.getInt("minDamage"); - if (!setWeaponMinDamage(newItem, minDamage)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponMinDamage( "+ newItem + ", "+ minDamage + ") FAILED"); - } - - int maxDamage = itemDictionary.getInt("maxDamage"); - if (!setWeaponMaxDamage(newItem, maxDamage)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponMaxDamage( "+ newItem + ", "+ maxDamage + ") FAILED"); - } - - float attackSpeed = itemDictionary.getFloat("attackSpeed"); - if (!setWeaponAttackSpeed(newItem, attackSpeed)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponAttackSpeed( "+ newItem + ", "+ attackSpeed + ") FAILED"); - } - - range_info rangeInfo = new range_info(); - rangeInfo.minRange = itemDictionary.getFloat("rangeInfoMinRange"); - rangeInfo.maxRange = itemDictionary.getFloat("rangeInfoMaxRange"); - if (!setWeaponRangeInfo(newItem, rangeInfo)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponRangeInfo( "+ newItem + ", "+ rangeInfo + ") FAILED"); - } - - float woundChance = itemDictionary.getFloat("woundChance"); - if (!setWeaponWoundChance(newItem, woundChance)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponWoundChance( "+ newItem + ", "+ woundChance + ") FAILED"); - } - - float damageRadius = itemDictionary.getFloat("damageRadius"); - if (!setWeaponDamageRadius(newItem, damageRadius)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponDamageRadius( "+ newItem + ", "+ damageRadius + ") FAILED"); - } - - int accuracy = itemDictionary.getInt("accuracy"); - if (!setWeaponAccuracy(newItem, accuracy)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponAccuracy( "+ newItem + ", "+ accuracy + ") FAILED"); - } - - int elementalType = itemDictionary.getInt("elementalType"); - if (!setWeaponElementalType(newItem, elementalType)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponElemetalType( "+ newItem + ", "+ elementalType + ") FAILED"); - } - - int elementalValue = itemDictionary.getInt("elementalValue"); - if (!setWeaponElementalValue(newItem, elementalValue)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponElemetalValue( "+ newItem + ", "+ elementalValue + ") FAILED"); - } - - int damageType = itemDictionary.getInt("damageType"); - if (!setWeaponDamageType(newItem, damageType)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponDamageType( "+ newItem + ", "+ damageType + ") FAILED"); - } - - int attackCost = itemDictionary.getInt("attackCost"); - if (!setWeaponAttackCost(newItem, attackCost)) - { - CustomerServiceLog("CharacterTransfer", "setWeaponAttackCost( "+ newItem + ", "+ attackCost + ") FAILED"); - } - - weapons.setWeaponData(newItem); - } - } - - if (itemDictionary.containsKey("colorData")) - { - dictionary colorData = itemDictionary.getDictionary("colorData"); - hue.setPalcolorData(newItem, colorData); - } - - if (itemDictionary.containsKey("customAppearance")) - { - byte[] customAppearance = itemDictionary.getByteArray("customAppearance"); - setAutoVariableFromByteStream(newItem, "customAppearance", customAppearance); - } - - if (itemDictionary.containsKey("appearanceData")) - { - byte[] appearanceData = itemDictionary.getByteArray("appearanceData"); - setAutoVariableFromByteStream(newItem, "appearanceData", appearanceData); - } - } - - if (hasCondition(newItem, CONDITION_LOCKED)) - { - clearUserAccessList(newItem); - clearGuildAccessList(newItem); - addUserToAccessList(newItem, self); - - if (hasObjVar(newItem, "lock_owner")) - { - setObjVar(newItem, "lock_owner", self); - } - if (hasObjVar(newItem, "lock_owner_name")) - { - setObjVar(newItem, "lock_owner_name", getName(self)); - } - } - - if (itemDictionary.containsKey("count")) - { - int count = itemDictionary.getInt("count"); - if (!setCount(newItem, count)) - { - CustomerServiceLog("CharacterTransfer", "setCount( "+ newItem + ", "+ count + ") FAILED"); - } - } - - if (itemDictionary.containsKey("bankBalance")) - { - byte[] bankBalance = itemDictionary.getByteArray("bankBalance"); - setAutoVariableFromByteStream(newItem, "bankBalance", bankBalance); - } - - if (isGameObjectTypeOf(objectType, GOT_ship)) - { - - if ((objectTemplateName != null) && (objectTemplateName.endsWith("player_sorosuub_space_yacht.iff"))) - { - - } - else - { - - space_crafting.uninstallAll(newItem); - } - - float mass = itemDictionary.getFloat("ship_mass"); - float maxHp = itemDictionary.getFloat("ship_hp"); - float currentHp = itemDictionary.getFloat("ship_current_hp"); - - setChassisComponentMassMaximum(newItem, mass); - setShipMaximumChassisHitPoints(newItem, maxHp); - setShipCurrentChassisHitPoints(newItem, currentHp); - - if (itemDictionary.containsKey("droid_control_device")) - { - obj_id objDroidControlDevice = itemDictionary.getObjId("droid_control_device"); - if (isIdValid(objDroidControlDevice)) - { - utils.setLocalVar(newItem, "droid_control_device", objDroidControlDevice); - } - } - - if (itemDictionary.containsKey("shipComponents")) - { - - obj_id datapad = getContainedBy(container); - obj_id player = getOwner(datapad); - - if (isIdValid(player)) - { - dictionary componentsDictionary = itemDictionary.getDictionary("shipComponents"); - if (componentsDictionary != null) - { - Set keySet = componentsDictionary.keySet(); - Integer[] slots = new Integer[keySet.size()]; - keySet.toArray(slots); - for (int i = 0; i < slots.length; ++i) - { - testAbortScript(); - - Integer slot = slots[i]; - - dictionary componentDictionary = componentsDictionary.getDictionary(slot); - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(player, componentDictionary)) - { - continue; - } - - componentDictionary.put("bypassVolumeCheck", 1); - obj_id newComponent = unpackItem(player, componentsDictionary.getDictionary(slot)); - - if (isIdValid(newComponent)) - { - shipInstallComponent(player, newItem, slot.intValue(), newComponent); - } - } - } - } - } - } - - if (itemDictionary.containsKey("isCrystalOwner")) - { - - if (hasObjVar(self, "preserve_existing_lightsaber_crystal_owner_objvar")) - { - String namePrefix = getStringObjVar(self, "preserve_existing_lightsaber_crystal_owner_objvar"); - if ((namePrefix != null) && (namePrefix.length() > 0) && !namePrefix.equals("none")) - { - String existingName = getStringObjVar(newItem, jedi.VAR_CRYSTAL_OWNER_NAME); - if ((existingName != null) && (existingName.length() > 0)) - { - setObjVar(newItem, jedi.VAR_CRYSTAL_OWNER_NAME, namePrefix + existingName); - } - } - - setObjVar(newItem, jedi.VAR_CRYSTAL_OWNER_ID, 0); - } - else - { - if (itemDictionary.getBoolean("isCrystalOwner")) - { - setObjVar(newItem, jedi.VAR_CRYSTAL_OWNER_ID, self); - setObjVar(newItem, jedi.VAR_CRYSTAL_OWNER_NAME, getName(self)); - } - else - { - setObjVar(newItem, jedi.VAR_CRYSTAL_OWNER_ID, 0); - setObjVar(newItem, jedi.VAR_CRYSTAL_OWNER_NAME, "None"); - } - } - - String name = getEncodedName(newItem); - if (name.startsWith("@")) - { - name = localize(getNameStringId(newItem)); - } - name = "\\"+colors_hex.GREEN+""+name + " (tuned)\\#."; - setName(newItem, name); - } - - if (itemDictionary.containsKey("biolink")) - { - obj_id biolink = itemDictionary.getObjId("biolink"); - if (itemDictionary.getBoolean("isBiolinkOwner")) - { - biolink = self; - } - if (!setBioLink(newItem, biolink)) - { - CustomerServiceLog("CharacterTransfer", "setBioLink( "+ newItem + ", "+ biolink + ") FAILED"); - } - } - - if (isGameObjectTypeOf(objectType, GOT_resource_container)) - { - - if (objectType != GOT_resource_container_pseudo) - { - if (itemDictionary.containsKey("resourceQuantity") && itemDictionary.containsKey("resourceData")) - { - int quantity = itemDictionary.getInt("resourceQuantity"); - String resourceData = itemDictionary.getString("resourceData"); - - CustomerServiceLog("CharacterTransfer", "unpackItem() : created resource container "+ newItem + ": resourceQuantity="+ quantity + ", resourceData="+ resourceData); - - setResourceCtsData(newItem, quantity, resourceData); - } - } - else - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : created pseudo resource container "+ newItem); - } - } - - if (objectType == GOT_misc_factory_crate) - { - recomputeCrateAttributes(newItem); - } - - if ((objectType == GOT_data_manufacturing_schematic) && itemDictionary.containsKey("msoCtsPackUnpack")) - { - byte[] data = itemDictionary.getByteArray("msoCtsPackUnpack"); - setAutoVariableFromByteStream(newItem, "msoCtsPackUnpack", data); - - if (itemDictionary.containsKey("msoConversionId")) - { - setConversionId(newItem, itemDictionary.getInt("msoConversionId")); - } - } - - if (objectType == GOT_data_mission_object) - { - if (itemDictionary.containsKey("moCtsPackUnpack")) - { - byte[] data = itemDictionary.getByteArray("moCtsPackUnpack"); - setAutoVariableFromByteStream(newItem, "moCtsPackUnpack", data); - } - - if (itemDictionary.containsKey("missionAge")) - { - int timeCreated = (getGameTime() - itemDictionary.getInt("missionAge")); - if (timeCreated <= 0) - { - timeCreated = 1; - } - - setObjVar(newItem, "time_created", timeCreated); - } - } - - if (objectType == GOT_chronicles_quest_holocron || objectType == GOT_chronicles_quest_holocron_recipe) - { - if (itemDictionary.containsKey("PGCPacked")) - { - byte[] data = itemDictionary.getByteArray("PGCPacked"); - setAutoVariableFromByteStream(newItem, "PGCPacked", data); - } - - if (objectType == GOT_chronicles_quest_holocron_recipe) - { - - setPlayerQuestCreator(newItem, self); - setObjVar(newItem, pgc_quests.PCG_QUEST_CREATOR_ID_OBJVAR, self); - setObjVar(newItem, pgc_quests.PCG_QUEST_CREATOR_STATIONID_OBJVAR, getPlayerStationId(self)); - setObjVar(newItem, pgc_quests.PCG_QUEST_CREATOR_NAME_OBJVAR, getName(self)); - } - } - - if ((objectTemplateCrc == (2082993503)) && (hasObjVar(newItem, incubator.RESOURCE_POWER_NAME))) - { - if (itemDictionary.containsKey("incubatorResourceData")) - { - byte[] data = itemDictionary.getByteArray("incubatorResourceData"); - setAutoVariableFromByteStream(newItem, "incubatorResourceData", data); - } - } - - if (objectType == GOT_installation_factory) - { - - setObjVar(newItem, player_structure.VAR_OWNER, getPlayerName(self)); - - String[] admin_list = new String[1]; - admin_list[0] = self.toString(); - setObjVar(newItem, player_structure.VAR_ADMIN_LIST, admin_list); - - setObjVar(newItem, player_structure.VAR_HOPPER_LIST, admin_list); - - removeObjVar(newItem, player_structure.VAR_ENTER_LIST); - removeObjVar(newItem, player_structure.VAR_BAN_LIST); - - removeObjVar(newItem, player_structure.VAR_VENDOR_LIST); - - removeObjVar(newItem, "city_id"); - - removeObjVar(newItem, player_structure.VAR_IS_GUILD_HALL); - - if (itemDictionary.containsKey("powerValue")) - { - byte[] powerValue = itemDictionary.getByteArray("powerValue"); - setAutoVariableFromByteStream(newItem, "powerValue", powerValue); - } - - if (itemDictionary.containsKey("powerRate")) - { - byte[] powerRate = itemDictionary.getByteArray("powerRate"); - setAutoVariableFromByteStream(newItem, "powerRate", powerRate); - } - - if (itemDictionary.containsKey("manf_schematic")) - { - dictionary dictManfSchematic = itemDictionary.getDictionary("manf_schematic"); - if (dictManfSchematic != null) - { - - obj_id manfSchematic = unpackItem(utils.getPlayerDatapad(self), dictManfSchematic); - if (isIdValid(manfSchematic)) - { - transferManufactureSchematicToStation(manfSchematic, newItem); - } - } - } - - if (itemDictionary.containsKey("ingr_hopper_contents")) - { - dictionary dictIngrHopperContents = itemDictionary.getDictionary("ingr_hopper_contents"); - if (dictIngrHopperContents != null) - { - obj_id ingrHopper = getObjectInSlot(newItem, "ingredient_hopper"); - if (isIdValid(ingrHopper)) - { - Set keySet = dictIngrHopperContents.keySet(); - Iterator contentsIterator = keySet.iterator(); - while (contentsIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)contentsIterator.next(); - - dictionary containedItemDict = dictIngrHopperContents.getDictionary(key); - if (containedItemDict == null) - { - continue; - } - - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(ingrHopper, containedItemDict)) - { - continue; - } - - unpackItem(ingrHopper, containedItemDict); - } - } - } - } - - if (itemDictionary.containsKey("output_hopper_contents")) - { - dictionary dictOutputHopperContents = itemDictionary.getDictionary("output_hopper_contents"); - if (dictOutputHopperContents != null) - { - obj_id outputHopper = getObjectInSlot(newItem, "output_hopper"); - if (isIdValid(outputHopper)) - { - Set keySet = dictOutputHopperContents.keySet(); - Iterator contentsIterator = keySet.iterator(); - while (contentsIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)contentsIterator.next(); - - dictionary containedItemDict = dictOutputHopperContents.getDictionary(key); - if (containedItemDict == null) - { - continue; - } - - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(outputHopper, containedItemDict)) - { - continue; - } - - unpackItem(outputHopper, containedItemDict); - } - } - } - } - } - - if (objectType == GOT_misc_crafting_station) - { - - if (itemDictionary.containsKey("input_hopper_contents")) - { - dictionary dictInputHopperContents = itemDictionary.getDictionary("input_hopper_contents"); - if (dictInputHopperContents != null) - { - obj_id inputHopper = getObjectInSlot(newItem, "ingredient_hopper"); - if (isIdValid(inputHopper)) - { - Set keySet = dictInputHopperContents.keySet(); - Iterator contentsIterator = keySet.iterator(); - while (contentsIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)contentsIterator.next(); - - dictionary containedItemDict = dictInputHopperContents.getDictionary(key); - if (containedItemDict == null) - { - continue; - } - - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(inputHopper, containedItemDict)) - { - continue; - } - - unpackItem(inputHopper, containedItemDict); - } - } - } - } - } - - if (itemDictionary.containsKey("isBlueprintDesigner")) - { - if (itemDictionary.getBoolean("isBlueprintDesigner")) - { - setObjVar(newItem, storyteller.BLUEPRINT_AUTHOR_OBJVAR, self); - } - else - { - CustomerServiceLog("CharacterTransfer", "Player is not blueprint's designer: player = "+ self + "; blueprint = "+ newItem); - } - } - - if (isGameObjectTypeOf(objectType, GOT_building)) - { - - if (itemDictionary.containsKey("lotOverlimitStructureId")) - { - obj_id lotOverlimitStructureOnCharacter = getObjIdObjVar(self, "lotOverlimit.structure_id"); - if (isIdValid(lotOverlimitStructureOnCharacter)) - { - obj_id lotOverlimitStructure = itemDictionary.getObjId("lotOverlimitStructureId"); - if (isIdValid(lotOverlimitStructure) && (lotOverlimitStructure == lotOverlimitStructureOnCharacter)) - { - setObjVar(self, "lotOverlimit.structure_id", newItem); - setObjVar(self, "lotOverlimit.structure_location", "Datapad"); - } - } - } - } - - if (itemDictionary.containsKey("house_contents")) - { - - setObjVar(newItem, player_structure.VAR_OWNER, getPlayerName(self)); - - String[] admin_list = new String[1]; - admin_list[0] = self.toString(); - setObjVar(newItem, player_structure.VAR_ADMIN_LIST, admin_list); - - removeObjVar(newItem, player_structure.VAR_ENTER_LIST); - removeObjVar(newItem, player_structure.VAR_BAN_LIST); - - removeObjVar(newItem, player_structure.VAR_VENDOR_LIST); - - removeObjVar(newItem, player_structure.VAR_HOPPER_LIST); - - removeObjVar(newItem, player_structure.VAR_IS_GUILD_HALL); - - dictionary contentsDict = itemDictionary.getDictionary("house_contents"); - Set keySet = contentsDict.keySet(); - Iterator contentsIterator = keySet.iterator(); - while (contentsIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)contentsIterator.next(); - if (isIdNull(key)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() FAILED: key "+ key + " not valid in house contents dictionary: "+ contentsDict); - return null; - } - dictionary containedItemDict = contentsDict.getDictionary(key); - if (containedItemDict == null) - { - continue; - } - - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(utils.getInventoryContainer(self), containedItemDict)) - { - continue; - } - - containedItemDict.put("bypassVolumeCheck", 1); - obj_id house_item = unpackItem(utils.getInventoryContainer(self), containedItemDict); - if (isIdValid(house_item)) - { - location loc = containedItemDict.getLocation("house_cell_loc"); - - String cell_name = containedItemDict.getString("house_cell"); - obj_id cellid = getCellId(newItem, cell_name); - if (isIdValid(cellid)) - { - loc.cell = cellid; - setLocation(house_item, loc); - } - - float[] quaternion = containedItemDict.getFloatArray("quaternion"); - if ((quaternion != null) && (quaternion.length == 4)) - { - setQuaternion(house_item, quaternion[0], quaternion[1], quaternion[2], quaternion[3]); - } - - requestSendPositionUpdate(house_item); - } - } - - if (isGameObjectTypeOf(objectType, GOT_building)) - { - loadBuildingContents(self, newItem); - } - } - - if ((objectType == GOT_installation_factory) || isGameObjectTypeOf(objectType, GOT_building)) - { - if (hasObjVar(newItem, player_structure.VAR_LAST_MAINTANENCE)) - { - setObjVar(newItem, player_structure.VAR_LAST_MAINTANENCE, getGameTime()); - } - } - - int containerType = itemDictionary.getInt("containerType"); - - if (containerType > 0 || jedi.isLightsaber(newItem) || isGameObjectTypeOf(objectType, GOT_data_ship_control_device)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : unpacking contents of container "+ newItem + "(type "+ containerType + ")"); - - if (itemDictionary.containsKey("contents")) - { - - if ((objectTemplateName.equals("object/intangible/ship/navicomputer_1.iff") || objectTemplateName.equals("object/intangible/ship/navicomputer_2.iff") || objectTemplateName.equals("object/intangible/ship/navicomputer_3.iff") || objectTemplateName.equals("object/intangible/ship/navicomputer_4.iff") || objectTemplateName.equals("object/intangible/ship/navicomputer_5.iff") || objectTemplateName.equals("object/intangible/ship/navicomputer_6.iff"))) - { - obj_id datapad = utils.getDatapad(newItem); - if (isIdValid(datapad)) - { - destroyObject(datapad); - } - } - - dictionary contentsDict = itemDictionary.getDictionary("contents"); - Set keySet = contentsDict.keySet(); - Iterator contentsIterator = keySet.iterator(); - while (contentsIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)contentsIterator.next(); - if (isIdNull(key)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() FAILED: key "+ key + " not valid in container contents dictionary: "+ contentsDict); - return null; - } - - dictionary containedItemDict = contentsDict.getDictionary(key); - - obj_id unpackedItem = null; - obj_id saberInv = null; - - if (jedi.isLightsaber(newItem)) - { - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(container, containedItemDict)) - { - continue; - } - - saberInv = getObjectInSlot(newItem, "saber_inv"); - unpackedItem = unpackItem(container, containedItemDict); - } - else - { - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(newItem, containedItemDict)) - { - continue; - } - - unpackedItem = unpackItem(newItem, containedItemDict); - } - - if (!isIdValid(unpackedItem)) - { - if (isIdNull(unpackedItem)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : unpackItem() returned NULL id for item: "+ containedItemDict); - return null; - } - else - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : unpackItem() returned invalid id "+ unpackedItem + " for item: "+ containedItemDict); - continue; - } - } - - if (isIdValid(saberInv)) - { - if (jedi.hasColorCrystal(newItem) && jedi.isColorCrystal(unpackedItem)) - { - removeObjVar(newItem, jedi.VAR_SABER_BASE + "."+ jedi.VAR_COLOR); - } - if (!putIn(unpackedItem, saberInv)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to move lightsaber crystal "+ unpackedItem + " into saber "+ saberInv); - } - } - } - } - - if (objectType == GOT_misc_factory_crate) - { - boolean factoryCrateHasCreator = false; - if (itemDictionary.containsKey("factoryCrateHasCreator")) - { - factoryCrateHasCreator = itemDictionary.getBoolean("factoryCrateHasCreator"); - } - - boolean factoryCrateCreatorIsSelf = false; - if (itemDictionary.containsKey("factoryCrateCreatorIsSelf")) - { - factoryCrateCreatorIsSelf = itemDictionary.getBoolean("factoryCrateCreatorIsSelf"); - } - - obj_id factoryCrateCreator = (factoryCrateCreatorIsSelf ? self : obj_id.getObjId(10000000)); - - if (factoryCrateHasCreator) - { - setCrafter(newItem, factoryCrateCreator); - } - - obj_id[] factoryCrateContents = getContents(newItem); - if ((factoryCrateContents != null) && (factoryCrateContents.length > 0)) - { - for (int i = 0; i < factoryCrateContents.length; ++i) - { - testAbortScript(); - setCrafter(factoryCrateContents[i], factoryCrateCreator); - } - } - } - } - - if (isEquipped) - { - if (equip(newItem, self)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : equipped item ("+ newItem + ")"); - } - else - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to equip item ("+ newItem + ")"); - } - } - if (isAppearanceEquipped) - { - obj_id appearanceInventory = getAppearanceInventory(self); - if (!isIdValid(appearanceInventory)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : Failed to equip appearance item ("+ newItem +"). Character has no valid appearance inventory."); - return null; - } - - if (putIn(newItem, appearanceInventory)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : equipped appearance item ("+ newItem + ")"); - } - else - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to equip appearance item ("+ newItem + ")"); - } - - } - if (isGameObjectTypeOf(objectType, GOT_data_ship_control_device)) - { - - obj_id ship = space_transition.getShipFromShipControlDevice(newItem); - setObjVar(newItem, "ship", ship); - setObjVar(ship, "shipControlDevice", newItem); - if (!isIdValid(ship)) - { - return null; - } - } - - } - catch(Throwable t) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() FAILED : container="+ container + ", itemDictionary="+ itemDictionary + " EXCEPTION: "+ t); - return null; - } - - utils.removeLocalVar(newItem, "ctsBeingUnpacked"); - return newItem; - } - - - public obj_id unpackWaypoint(dictionary waypointDictionary) throws InterruptedException - { - obj_id self = getSelf(); - - if (!isIdValid(self)) - { - return null; - } - obj_id newWaypoint = null; - location loc = waypointDictionary.getLocation("location"); - - if (!isIdNull(loc.cell)) - { - - return null; - } - - location newloc = new location(loc.x, loc.y, loc.z, loc.area); - String name = waypointDictionary.getString("name"); - newWaypoint = createWaypointInDatapad(self, newloc); - setWaypointName(newWaypoint, name); - return newWaypoint; - } - - - public boolean itemIsAllowedToTransfer(obj_id item, obj_id player) throws InterruptedException - { - if (!isValidId(item) || !isValidId(player)) - { - return false; - } - - if (utils.hasScriptVar(player, cts.SCRIPTVAR_CTS_ITEM_ID)) - { - final obj_id ctsItem = utils.getObjIdScriptVar(player, cts.SCRIPTVAR_CTS_ITEM_ID); - if (isValidId(ctsItem) && (ctsItem == item)) - { - return false; - } - } - - return true; - } - - - public dictionary packWaypoint(obj_id waypoint) throws InterruptedException - { - obj_id self = getSelf(); - dictionary waypointDictionary = null; - try - { - waypointDictionary = new dictionary(); - if (!isValidId(waypoint)) - { - return null; - } - - location loc = getWaypointLocation(waypoint); - waypointDictionary.put("location", loc); - - String name = getWaypointName(waypoint); - waypointDictionary.put("name", name); - - } - catch(Throwable t) - { - return null; - } - return waypointDictionary; - } - - - public void doItemPrepack(obj_id item) throws InterruptedException - { - if (!isValidId(item)) - { - return; - } - - { - dictionary d = new dictionary(); - int result = script_entry.callMessageHandlers("OnPack", item, d); - if (result != SCRIPT_CONTINUE) - { - utils.setScriptVar(item, "do_not_pack", 1); - return; - } - } - obj_id[] contents = null; - - contents = getContents(item); - if (contents != null) - { - for (int i = 0; i < contents.length; ++i) - { - testAbortScript(); - doItemPrepack( contents[i] ); - } - } - } - - - public dictionary packItem(obj_id item, int objectType, boolean allowOverride, int resourceCrateCountLimit, int[] resourceCurrentCrateCount, long resourceUnitCountLimit, long[] resourceCurrentUnitCount) throws InterruptedException - { - - dictionary itemDictionary = null; - - try - { - final obj_id self = getSelf(); - - if (getName(item).equalsIgnoreCase( "object/cell/cell.iff")) - { - return null; - } - - if (hasCondition(item, CONDITION_VENDOR)) - { - return null; - } - - if (utils.hasScriptVar(item, "do_not_pack")) - { - return null; - } - - String name = getName(item); - String objectTypeName = getGameObjectTypeName(objectType); - String objectTemplateName = getTemplateName(item); - int objectTemplateCrc = getObjectTemplateCrc(objectTemplateName); - - if (objectType == GOT_misc_factory_crate) - { - int factoryCrateCount = getCount(item); - if (factoryCrateCount <= 0) - { - CustomerServiceLog("CharacterTransfer", "packItem("+ item + ") skipping factory crate because it has a count of "+ factoryCrateCount); - return null; - } - - obj_id[] factoryCrateContents = getContents(item); - if ((factoryCrateContents == null) || (factoryCrateContents.length <= 0)) - { - CustomerServiceLog("CharacterTransfer", "packItem("+ item + ") skipping factory crate because it is empty"); - return null; - } - - String crateItemTemplateName = getTemplateName(factoryCrateContents[0]); - - if (crateItemTemplateName == null || crateItemTemplateName.length() <= 0) - { - CustomerServiceLog("CharacterTransfer", "packItem("+ item + ") skipping factory crate because its contents returned a null string as a template name."); - return null; - } - - if ((crateItemTemplateName.equals("object/tangible/food/crafted/dessert_felbar.iff") || crateItemTemplateName.equals("object/tangible/food/crafted/dessert_blap_biscuit.iff") || crateItemTemplateName.equals("object/tangible/food/crafted/dessert_pastebread.iff") || crateItemTemplateName.equals("object/tangible/food/crafted/dessert_sweesonberry_rolls.iff"))) - { - CustomerServiceLog("CharacterTransfer", "packItem("+ item + ") skipping factory crate because it contained old pet food("+crateItemTemplateName+"), that is supposed to be deleted."); - return null; - } - - } - - itemDictionary = new dictionary(); - itemDictionary.put("objectTemplateCrc", objectTemplateCrc); - itemDictionary.put("objectTemplateName", objectTemplateName); - - String packedObjvars = getPackedObjvars(item); - itemDictionary.put("packedObjvars", packedObjvars); - - String staticItemName = getStaticItemName(item); - if (static_item.isStaticItem(item) && !staticItemName.equals("item_respec_token_01_01")) - { - itemDictionary.put("staticItemName", staticItemName); - CustomerServiceLog("CharacterTransfer", "packItem("+ item + ", "+ allowOverride + ") staticItemName="+ staticItemName); - } - else - { - CustomerServiceLog("CharacterTransfer", "packItem("+ item + ", "+ allowOverride + ") objectTemplateName="+ objectTemplateName + ", name="+ name); - - String[] itemScripts = getScriptList(item); - if (itemScripts != null && itemScripts.length > 0) - { - - for (int i = 0; i < itemScripts.length; ++i) - { - testAbortScript(); - if (itemScripts[i].startsWith("script.")) - { - itemScripts[i] = itemScripts[i].substring(7); - } - - } - itemDictionary.put("scripts", itemScripts); - } - - String objectName = getAssignedName(item); - - if (objectName == null || objectName.equals("")) - { - objectName = utils.packStringId(getNameStringId(item)); - } - if (objectName == null) - { - objectName = ""; - } - - itemDictionary.put("objectName", objectName); - - dictionary colorData = hue.getPalcolorData(item); - if (colorData != null) - { - itemDictionary.put("colorData", colorData); - } - - if (isTangible(item)) - { - byte[] customAppearance = getByteStreamFromAutoVariable(item, "customAppearance"); - if (customAppearance != null && customAppearance.length > 0) - { - itemDictionary.put("customAppearance", customAppearance); - } - - byte[] appearanceData = getByteStreamFromAutoVariable(item, "appearanceData"); - if (appearanceData != null && appearanceData.length > 0) - { - itemDictionary.put("appearanceData", appearanceData); - } - - if (isMob(item)) - { - CustomerServiceLog("CharacterTransfer", "packItem() : getAttribs("+ item + ") on a creature object"); - - attribute[] itemAttribs = getAttribs(item); - if (itemAttribs != null) - { - - int[] itemAttribTypes = new int[itemAttribs.length]; - int[] itemAttribValues = new int[itemAttribs.length]; - - int itemAttribsIter; - CustomerServiceLog("CharacterTransfer", "packItem() : retrieving "+ itemAttribs.length + " attributes"); - for (itemAttribsIter = 0; itemAttribsIter < itemAttribs.length; ++itemAttribsIter) - { - testAbortScript(); - itemAttribTypes[itemAttribsIter] = itemAttribs[itemAttribsIter].getType(); - itemAttribValues[itemAttribsIter] = getUnmodifiedMaxAttrib(item, itemAttribsIter); - CustomerServiceLog("CharacterTransfer", "packItem() : itemAttribTypes["+ itemAttribsIter + "] = "+ itemAttribTypes[itemAttribsIter] + ", itemAttribsValues["+ itemAttribsIter + "] = "+ itemAttribValues[itemAttribsIter]); - } - - itemDictionary.put("attribute_types", itemAttribTypes); - itemDictionary.put("attribute_values", itemAttribValues); - } - else - { - CustomerServiceLog("CharacterTransfer", "packItem() FAILED: getAttribs("+ item + ") = null."); - return null; - } - } - - else - { - - int maxHitpoints = getMaxHitpoints(item); - if (maxHitpoints != ATTRIB_ERROR) - { - itemDictionary.put("maxHitpoints", maxHitpoints); - } - else - { - CustomerServiceLog("CharacterTransfer", "packItem() FAILED: getMaxHitpoints("+ item + ") failed!"); - return null; - } - - int hitpoints = getHitpoints(item); - if (hitpoints != ATTRIB_ERROR) - { - itemDictionary.put("hitpoints", hitpoints); - } - else - { - CustomerServiceLog("CharacterTransfer", "packItem() FAILED: getHitpoints("+ item + ") failed!"); - return null; - } - - itemDictionary.put("conditionFlags", getCondition(item)); - - boolean isWeaponItem = isWeapon(item); - itemDictionary.put("isWeaponItem", isWeaponItem); - if (isWeaponItem) - { - - int currentVersion = getConversionId(item); - if (currentVersion > 0) - { - - itemDictionary.put("currentVersion", currentVersion); - } - int minDamage = getWeaponMinDamage(item); - itemDictionary.put("minDamage", minDamage); - - int maxDamage = getWeaponMaxDamage(item); - itemDictionary.put("maxDamage", maxDamage); - - float attackSpeed = getWeaponAttackSpeed(item); - itemDictionary.put("attackSpeed", attackSpeed); - - range_info rangeInfo = getWeaponRangeInfo(item); - itemDictionary.put("rangeInfoMinRange", rangeInfo.minRange); - itemDictionary.put("rangeInfoMaxRange", rangeInfo.maxRange); - - float woundChance = getWeaponWoundChance(item); - itemDictionary.put("woundChance", woundChance); - - float damageRadius = getWeaponDamageRadius(item); - itemDictionary.put("damageRadius", damageRadius); - - int accuracy = getWeaponAccuracy(item); - itemDictionary.put("accuracy", accuracy); - - int elementalType = getWeaponElementalType(item); - itemDictionary.put("elementalType", elementalType); - - int elementalValue = getWeaponElementalValue(item); - itemDictionary.put("elementalValue", elementalValue); - - int damageType = getWeaponDamageType(item); - itemDictionary.put("damageType", damageType); - - int attackCost = getWeaponAttackCost(item); - itemDictionary.put("attackCost", attackCost); - } - } - } - } - - int count = getCount(item); - if (count > 0) - { - itemDictionary.put("count", count); - } - - if (getBankBalance(item) > 0) - { - byte[] bankBalance = getByteStreamFromAutoVariable(item, "bankBalance"); - if (bankBalance != null && bankBalance.length > 0) - { - itemDictionary.put("bankBalance", bankBalance); - } - } - - if (hasScript(item, "systems.jedi.jedi_saber_component")) - { - if (jedi.isCrystalTuned(item)) - { - if (jedi.isCrystalOwner(self,item)) - { - itemDictionary.put("isCrystalOwner", true); - } - else - { - itemDictionary.put("isCrystalOwner", false); - } - } - } - - obj_id biolink = getBioLink(item); - if (isIdValid(biolink)) - { - itemDictionary.put("biolink", biolink); - if (biolink == self) - { - itemDictionary.put("isBiolinkOwner", true); - } - else - { - itemDictionary.put("isBiolinkOwner", false); - } - } - - if (hasObjVar(item, storyteller.BLUEPRINT_AUTHOR_OBJVAR)) - { - obj_id blueprintDesigner = getObjIdObjVar(item, storyteller.BLUEPRINT_AUTHOR_OBJVAR); - if (isIdValid(blueprintDesigner)) - { - if (blueprintDesigner == self) - { - itemDictionary.put("isBlueprintDesigner", true); - } - else - { - itemDictionary.put("isBlueprintDesigner", false); - } - } - } - - if (getContainedBy(item) == self) - { - itemDictionary.put("isEquipped", true); - } - else - { - itemDictionary.put("isEquipped", false); - } - - obj_id appearanceInventory = getAppearanceInventory(self); - if (isIdValid(appearanceInventory) && getContainedBy(item) == appearanceInventory) - { - itemDictionary.put("isAppearanceEquipped", true); - } - else - { - itemDictionary.put("isAppearanceEquipped", false); - } - - if (isGameObjectTypeOf(objectType, GOT_resource_container)) - { - - if (objectType != GOT_resource_container_pseudo) - { - int quantity = getResourceContainerQuantity(item); - if (quantity <= 0) - { - return null; - } - - String resourceData = getResourceCtsData(item); - if ((resourceData == null) || (resourceData.length() <= 0)) - { - return null; - } - - if ((resourceUnitCountLimit > 0L) && ((resourceCurrentUnitCount[0] + quantity) > resourceUnitCountLimit)) - { - quantity = (int)(resourceUnitCountLimit - resourceCurrentUnitCount[0]); - - if (quantity <= 0) - { - return null; - } - } - - resourceCurrentCrateCount[0] = resourceCurrentCrateCount[0] + 1; - resourceCurrentUnitCount[0] = resourceCurrentUnitCount[0] + quantity; - - CustomerServiceLog("CharacterTransfer", "packItem("+ item + ") packed resource container ("+ resourceCurrentCrateCount[0] + "/"+ resourceCrateCountLimit + ") ("+ resourceCurrentUnitCount[0] + "/"+ resourceUnitCountLimit + "): resourceQuantity="+ quantity + ", resourceData="+ resourceData); - - itemDictionary.put("resourceQuantity", quantity); - itemDictionary.put("resourceData", resourceData); - } - else - { - - resourceCurrentCrateCount[0] = resourceCurrentCrateCount[0] + 1; - - CustomerServiceLog("CharacterTransfer", "packItem("+ item + ") packed pseudo resource container ("+ resourceCurrentCrateCount[0] + "/"+ resourceCrateCountLimit + ") ("+ resourceCurrentUnitCount[0] + "/"+ resourceUnitCountLimit + ")"); - } - } - - if (objectType == GOT_misc_factory_crate) - { - obj_id factoryCrateCreator = getCrafter(item); - if (isIdValid(factoryCrateCreator)) - { - itemDictionary.put("factoryCrateHasCreator", true); - - if (factoryCrateCreator == self) - { - itemDictionary.put("factoryCrateCreatorIsSelf", true); - } - else - { - itemDictionary.put("factoryCrateCreatorIsSelf", false); - } - } - else - { - itemDictionary.put("factoryCrateHasCreator", false); - } - } - - if (objectType == GOT_data_manufacturing_schematic) - { - byte[] data = getByteStreamFromAutoVariable(item, "msoCtsPackUnpack"); - if (data != null && data.length > 0) - { - itemDictionary.put("msoCtsPackUnpack", data); - } - - itemDictionary.put("msoDraftSchematicCrc", getDraftSchematicCrc(item)); - - int conversionId = getConversionId(item); - if (conversionId > 0) - { - itemDictionary.put("msoConversionId", conversionId); - } - } - - if (objectType == GOT_data_mission_object) - { - byte[] data = getByteStreamFromAutoVariable(item, "moCtsPackUnpack"); - if (data != null && data.length > 0) - { - itemDictionary.put("moCtsPackUnpack", data); - } - - if (hasObjVar(item, "time_created")) - { - int secondsSinceCreated = (getGameTime() - getIntObjVar(item, "time_created")); - if (secondsSinceCreated < 0) - { - secondsSinceCreated = 0; - } - - itemDictionary.put("missionAge", secondsSinceCreated); - } - } - - if (objectType == GOT_chronicles_quest_holocron || objectType == GOT_chronicles_quest_holocron_recipe) - { - byte[] data = getByteStreamFromAutoVariable(item, "PGCPacked"); - if (data != null && data.length > 0) - { - itemDictionary.put("PGCPacked", data); - } - - } - - if ((objectTemplateCrc == (2082993503)) && (hasObjVar(item, incubator.RESOURCE_POWER_NAME))) - { - byte[] data = getByteStreamFromAutoVariable(item, "incubatorResourceData"); - if (data != null && data.length > 0) - { - itemDictionary.put("incubatorResourceData", data); - } - } - - if (isGameObjectTypeOf(objectType, GOT_ship)) - { - float mass = getChassisComponentMassMaximum(item); - float hp = getShipMaximumChassisHitPoints(item); - float currentHp = getShipCurrentChassisHitPoints(item); - - itemDictionary.put("ship_mass", mass); - itemDictionary.put("ship_hp", hp); - itemDictionary.put("ship_current_hp", currentHp); - - obj_id objDroidControlDevice = getDroidControlDeviceForShip(item); - if (isIdValid(objDroidControlDevice)) - { - itemDictionary.put("droid_control_device", objDroidControlDevice); - } - - if ((objectTemplateName != null) && (objectTemplateName.endsWith("player_sorosuub_space_yacht.iff"))) - { - - } - else - { - dictionary shipDict = new dictionary(); - - int[] shipSlots = getShipChassisSlots(item); - - for (int i = 0; i < shipSlots.length; ++i) - { - testAbortScript(); - if (isShipSlotInstalled(item, shipSlots[i])) - { - - obj_id component = shipUninstallComponentAllowOverload(getOwner(item), item, shipSlots[i], utils.getInventoryContainer(self)); - - if (isIdValid(component)) - { - int ot = getGameObjectType(component); - if (itemIsAllowedToTransfer(component, self) && (!isGameObjectTypeOf(ot, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary component_dict = packItem(component, ot, true, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (component_dict != null) - { - shipDict.put(new Integer(shipSlots[i]), component_dict); - } - } - } - - shipInstallComponent(getOwner(item), item, shipSlots[i], component); - } - } - itemDictionary.put("shipComponents", shipDict); - } - } - - if (objectType == GOT_installation_factory) - { - - byte[] powerValue = getByteStreamFromAutoVariable(item, "powerValue"); - if (powerValue != null && powerValue.length > 0) - { - itemDictionary.put("powerValue", powerValue); - } - - byte[] powerRate = getByteStreamFromAutoVariable(item, "powerRate"); - if (powerRate != null && powerRate.length > 0) - { - itemDictionary.put("powerRate", powerRate); - } - - obj_id manfSchematic = getObjectInSlot(item, "manf_schematic"); - if (isIdValid(manfSchematic)) - { - int ot = getGameObjectType(manfSchematic); - if (itemIsAllowedToTransfer(manfSchematic, self) && (!isGameObjectTypeOf(ot, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary dictManfSchematic = packItem(manfSchematic, ot, true, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (dictManfSchematic != null) - { - itemDictionary.put("manf_schematic", dictManfSchematic); - } - } - } - - obj_id ingrHopper = getObjectInSlot(item, "ingredient_hopper"); - if (isIdValid(ingrHopper)) - { - obj_id ingrHopperContents[] = getContents(ingrHopper); - if (ingrHopperContents != null && ingrHopperContents.length > 0) - { - dictionary dictIngrHopperContents = new dictionary(); - - for (int i = 0; i < ingrHopperContents.length; ++i) - { - testAbortScript(); - obj_id ingrHopperContent = ingrHopperContents[i]; - - if (!isObjectPersisted(ingrHopperContent)) - { - continue; - } - - int ot = getGameObjectType(ingrHopperContent); - if (itemIsAllowedToTransfer(ingrHopperContent, self) && (!isGameObjectTypeOf(ot, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary dictIngrHopperContent = packItem(ingrHopperContent, ot, true, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (dictIngrHopperContent != null) - { - dictIngrHopperContents.put(ingrHopperContent, dictIngrHopperContent); - } - } - } - - itemDictionary.put("ingr_hopper_contents", dictIngrHopperContents); - } - } - - obj_id outputHopper = getObjectInSlot(item, "output_hopper"); - if (isIdValid(outputHopper)) - { - obj_id outputHopperContents[] = getContents(outputHopper); - if (outputHopperContents != null && outputHopperContents.length > 0) - { - dictionary dictOutputHopperContents = new dictionary(); - - for (int i = 0; i < outputHopperContents.length; ++i) - { - testAbortScript(); - obj_id outputHopperContent = outputHopperContents[i]; - - if (!isObjectPersisted(outputHopperContent)) - { - continue; - } - - int ot = getGameObjectType(outputHopperContent); - if (itemIsAllowedToTransfer(outputHopperContent, self) && (!isGameObjectTypeOf(ot, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary dictOutputHopperContent = packItem(outputHopperContent, ot, true, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (dictOutputHopperContent != null) - { - dictOutputHopperContents.put(outputHopperContent, dictOutputHopperContent); - } - } - } - - itemDictionary.put("output_hopper_contents", dictOutputHopperContents); - } - } - } - - if (objectType == GOT_misc_crafting_station) - { - - obj_id inputHopper = getObjectInSlot(item, "ingredient_hopper"); - if (isIdValid(inputHopper)) - { - obj_id inputHopperContents[] = getContents(inputHopper); - if (inputHopperContents != null && inputHopperContents.length > 0) - { - dictionary dictInputHopperContents = new dictionary(); - - for (int i = 0; i < inputHopperContents.length; ++i) - { - testAbortScript(); - obj_id inputHopperContent = inputHopperContents[i]; - - if (!isObjectPersisted(inputHopperContent)) - { - continue; - } - - int ot = getGameObjectType(inputHopperContent); - if (itemIsAllowedToTransfer(inputHopperContent, self) && (!isGameObjectTypeOf(ot, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary dictInputHopperContent = packItem(inputHopperContent, ot, true, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (dictInputHopperContent != null) - { - dictInputHopperContents.put(inputHopperContent, dictInputHopperContent); - } - } - } - - itemDictionary.put("input_hopper_contents", dictInputHopperContents); - } - } - } - - { - if (isGameObjectTypeOf(objectType, GOT_building) || space_utils.isPobType(objectTemplateName)) - { - if (isGameObjectTypeOf(objectType, GOT_building)) - { - - obj_id lotOverlimitStructure = getObjIdObjVar(self, "lotOverlimit.structure_id"); - if (isIdValid(lotOverlimitStructure) && (lotOverlimitStructure == item)) - { - itemDictionary.put("lotOverlimitStructureId", item); - } - } - - String[] cells = getCellNames(item); - if (cells != null) - { - dictionary house_contents = new dictionary(); - for (int i = 0; i < cells.length; i++) - { - testAbortScript(); - obj_id cellid = getCellId(item, cells[i]); - obj_id contents[] = getContents(cellid); - if (contents != null && contents.length > 0) - { - for (int j=0; j 0) - { - dictionary container = new dictionary(); - - int i = 0; - for (i = 0; i < contents.length; ++i) - { - testAbortScript(); - if (guild.STR_GUILD_REMOTE_DEVICE.equals(getTemplateName(contents[i]))) - { - continue; - } - - int ot = getGameObjectType(contents[i]); - if (itemIsAllowedToTransfer(contents[i], self) && (!isGameObjectTypeOf(ot, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary containedItem = packItem(contents[i], ot, allowOverride, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (containedItem != null) - { - container.put(contents[i], containedItem); - - if (objectType == GOT_misc_factory_crate) - { - break; - } - } - else - { - if (! allowOverride) - { - return null; - } - } - } - } - itemDictionary.put("contents", container); - } - } - catch(Throwable t) - { - CustomerServiceLog("CharacterTransfer", "packItem() FAILED: item="+ item + ", allowOverride="+ allowOverride + ", itemDictionary= "+ itemDictionary + " EXCEPTION: "+ t); - return null; - } - - return itemDictionary; - } - - - public int OnUploadCharacter(obj_id self, dictionary characterData) throws InterruptedException - { - int resourceCrateCountLimit = 0; - String config = getConfigSetting("GameServer", "ctsResourceCrateCountLimit"); - if (config != null) - { - resourceCrateCountLimit = utils.stringToInt(config); - } - - int[] resourceCurrentCrateCount = new int[1]; - resourceCurrentCrateCount[0] = 0; - - long resourceUnitCountLimit = 0L; - config = getConfigSetting("GameServer", "ctsResourceUnitCountLimit"); - if (config != null) - { - resourceUnitCountLimit = utils.stringToLong(config); - } - - long[] resourceCurrentUnitCount = new long[1]; - resourceCurrentUnitCount[0] = 0L; - - try - { - final boolean withItems = characterData.getBoolean("withItems"); - final boolean allowOverride = characterData.getBoolean("allowOverride"); - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter(withItems="+ withItems + ", allowOverride="+ allowOverride + ") begin"); - - if (hasObjVar(self, "disableLoginCtsInProgress")) - { - int timeOut = getIntObjVar(self, "disableLoginCtsInProgress"); - if (timeOut > getGameTime()) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : FAILED because of CTS completed or in progress for character"); - return SCRIPT_OVERRIDE; - } - else - { - removeObjVar(self, "disableLoginCtsInProgress"); - } - } - - if (hasObjVar(self, "disableLoginCtsCompleted")) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : FAILED because of CTS completed or in progress for character"); - return SCRIPT_OVERRIDE; - } - - String skillTemplate = getSkillTemplate(self); - if (skillTemplate == null || skillTemplate.equals("") || skillTemplate.equals("a")) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : skillTemplate not set! (pre-NGE source characters must choose profession prior to transfer) TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - characterData.put("skillTemplate", skillTemplate); - - int combatLevel = getLevel(self); - characterData.put("combatLevel", combatLevel); - - String workingSkill = getWorkingSkill(self); - if (workingSkill == null || workingSkill.equals("")) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : workingSkill not set! (pre-NGE source characters must choose profession prior to transfer) TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - characterData.put("workingSkill", workingSkill); - - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : skillTemplate == "+ skillTemplate + ", workingSkill == "+ workingSkill + ", combatLevel == "+ combatLevel); - - characterData.put("commands", getCommandListingForPlayer(self)); - characterData.put("skills", getSkillListingForPlayer(self)); - - final String[] strObjVarLists = - { - "badge", - factions.FACTION, - groundquests.questBaseObjVar, - "live_conversions", - space_flags.IMPERIAL_CORELLIA, - space_flags.IMPERIAL_NABOO, - space_flags.IMPERIAL_TATOOINE, - space_flags.PRIVATEER_CORELLIA, - space_flags.PRIVATEER_NABOO, - space_flags.PRIVATEER_TATOOINE, - space_flags.REBEL_CORELLIA, - space_flags.REBEL_NABOO, - space_flags.REBEL_TATOOINE, - space_quest.QUEST_STATUS, - township.OBJVAR_NOVA_ORION_FACTION, - pgc_quests.PGC_GRANTED_ROADMAP_REWARDS_OBJVAR, - "spaceTrackFlagListName", - "veteran_rewards", - "_notskill.schematics", - "_notskill.mods", - "respec_voucher", - "mand.acknowledge", - respec.EXPERTISE_VERSION_OBJVAR, - "publish_gift", - "legacy", - temp_schematic.VAR_TEMP_SCHEMATIC_BASE, - "cts", - "ctsHistory", - utils.CTS_OBJVAR_HISTORY, - "hoth.flawless_reward", - "instance_player_protected_data", - "bornOnGalaxyTitleSet", - "beast_master", - "playerRespec", - "respecsBought", - player_structure.HOUSE_PACKUP_ARRAY_OBJVAR, - "space.dantooine_landing_permission", - "lotOverlimit", - "renameCharacterRequest.requestTime", - "galactic_reserve", - "preserve_existing_lightsaber_crystal_owner_objvar", - "testing_only_force_cts_failure_testing_only", - }; - - dictionary experiencePoints = getExperiencePoints(self); - if (experiencePoints != null) - { - characterData.put("experience_points", experiencePoints); - } - - characterData.put("pvp_type", pvpGetType(self)); - characterData.put("pvp_aligned_faction", pvpGetAlignedFaction(self)); - - characterData.put("gcw_current_point", pvpGetCurrentGcwPoints(self)); - characterData.put("gcw_current_rating", pvpGetCurrentGcwRating(self)); - characterData.put("gcw_current_pvp_kill", pvpGetCurrentPvpKills(self)); - characterData.put("gcw_lifetime_point", pvpGetLifetimeGcwPoints(self)); - characterData.put("gcw_max_imperial_rating", pvpGetMaxGcwImperialRating(self)); - characterData.put("gcw_max_rebel_rating", pvpGetMaxGcwRebelRating(self)); - characterData.put("gcw_lifetime_pvp_kill", pvpGetLifetimePvpKills(self)); - characterData.put("gcw_next_rating_calc_time", pvpGetNextGcwRatingCalcTime(self)); - - characterData.put("source_character_oid", self); - characterData.put("source_character_name", getName(self)); - characterData.put("source_cluster", getClusterName()); - - if (hasObjVar(self, "freeCtsTransactionRuleName")) - { - characterData.put("freeCtsTransactionRuleName", getStringObjVar(self, "freeCtsTransactionRuleName")); - } - - obj_id playerObject = getPlayerObject(self); - if (isIdValid(playerObject)) - { - byte[] quests = getByteStreamFromAutoVariable(playerObject, "quests"); - if (quests != null && quests.length > 0) - { - characterData.put("quests", quests); - } - - byte[] activeQuests = getByteStreamFromAutoVariable(playerObject, "activeQuests"); - if (activeQuests != null && activeQuests.length > 0) - { - characterData.put("activeQuests", activeQuests); - } - - byte[] completedQuests = getByteStreamFromAutoVariable(playerObject, "completedQuests"); - if (completedQuests != null && completedQuests.length > 0) - { - characterData.put("completedQuests", completedQuests); - } - - byte[] currentQuest = getByteStreamFromAutoVariable(playerObject, "currentQuest"); - if (currentQuest != null && currentQuest.length > 0) - { - characterData.put("currentQuest", currentQuest); - } - - byte[] bornDate = getByteStreamFromAutoVariable(playerObject, "bornDate"); - if (bornDate != null && bornDate.length > 0) - { - characterData.put("bornDate", bornDate); - } - - byte[] playedTime = getByteStreamFromAutoVariable(playerObject, "playedTime"); - if (playedTime != null && playedTime.length > 0) - { - characterData.put("playedTime", playedTime); - } - - byte[] food = getByteStreamFromAutoVariable(playerObject, "food"); - if (food != null && food.length > 0) - { - characterData.put("food", food); - } - - byte[] maxFood = getByteStreamFromAutoVariable(playerObject, "maxFood"); - if (maxFood != null && maxFood.length > 0) - { - characterData.put("maxFood", maxFood); - } - - byte[] drink = getByteStreamFromAutoVariable(playerObject, "drink"); - if (drink != null && drink.length > 0) - { - characterData.put("drink", drink); - } - - byte[] maxDrink = getByteStreamFromAutoVariable(playerObject, "maxDrink"); - if (maxDrink != null && maxDrink.length > 0) - { - characterData.put("maxDrink", maxDrink); - } - - byte[] meds = getByteStreamFromAutoVariable(playerObject, "meds"); - if (meds != null && meds.length > 0) - { - characterData.put("meds", meds); - } - - byte[] maxMeds = getByteStreamFromAutoVariable(playerObject, "maxMeds"); - if (maxMeds != null && maxMeds.length > 0) - { - characterData.put("maxMeds", maxMeds); - } - - byte[] matchMakingPersonalProfileId = getByteStreamFromAutoVariable(playerObject, "matchMakingPersonalProfileId"); - if (matchMakingPersonalProfileId != null && matchMakingPersonalProfileId.length > 0) - { - characterData.put("matchMakingPersonalProfileId", matchMakingPersonalProfileId); - } - - byte[] matchMakingCharacterProfileId = getByteStreamFromAutoVariable(playerObject, "matchMakingCharacterProfileId"); - if (matchMakingCharacterProfileId != null && matchMakingCharacterProfileId.length > 0) - { - characterData.put("matchMakingCharacterProfileId", matchMakingCharacterProfileId); - } - - byte[] playerObjectWorkingSkill = getByteStreamFromAutoVariable(playerObject, "workingSkill"); - if (playerObjectWorkingSkill != null && playerObjectWorkingSkill.length > 0) - { - characterData.put("workingSkill", playerObjectWorkingSkill); - } - - byte[] playerObjectSkillTemplate = getByteStreamFromAutoVariable(playerObject, "skillTemplate"); - if (playerObjectSkillTemplate != null && playerObjectSkillTemplate.length > 0) - { - characterData.put("skillTemplate", playerObjectSkillTemplate); - } - - byte[] collections = getByteStreamFromAutoVariable(playerObject, "collections"); - if (collections != null && collections.length > 0) - { - characterData.put("collections", collections); - } - - byte[] collections2 = getByteStreamFromAutoVariable(playerObject, "collections2"); - if (collections2 != null && collections2.length > 0) - { - characterData.put("collections2", collections2); - } - } - - int[] quests = questGetAllActiveQuestIds(self); - dictionary questWaypoints = new dictionary(); - for (int i = 0; i < quests.length; ++i) - { - testAbortScript(); - int questCrc = quests[i]; - for (int taskId = 0; taskId < 16; ++taskId) - { - testAbortScript(); - obj_id waypoint = groundquests.getObjIdForWaypoint(questCrc, taskId, self); - obj_id entryWaypoint = groundquests.getObjIdForEntranceWaypoint(questCrc, taskId, self); - if (isIdValid(waypoint)) - { - questWaypoints.put(waypoint, 1); - } - if (isIdValid(entryWaypoint)) - { - questWaypoints.put(entryWaypoint, 1); - } - } - - } - - dictionary staticQuestWaypoints = new dictionary(); - String[] questIDs = dataTableGetStringColumnNoDefaults("datatables/npc/static_quest/all_quest_names.iff", "quest_ids"); - if ((questIDs != null) && (questIDs.length > 0)) - { - for (int i = 0; i < questIDs.length; ++i) - { - testAbortScript(); - if (hasObjVar(self, questIDs[i] + ".waypoint")) - { - obj_id waypoint = getObjIdObjVar(self, questIDs[i] + ".waypoint"); - if (isIdValid(waypoint)) - { - staticQuestWaypoints.put(waypoint, 1); - } - } - - if (hasObjVar(self, questIDs[i] + ".waypointhome")) - { - obj_id waypoint = getObjIdObjVar(self, questIDs[i] + ".waypointhome"); - if (isIdValid(waypoint)) - { - staticQuestWaypoints.put(waypoint, 1); - } - } - } - } - - obj_id[] waypoints = getWaypointsInDatapad(self); - if (waypoints != null && waypoints.length > 0) - { - dictionary waypointDictionaries = new dictionary(); - for (int i = 0; i < waypoints.length; ++i) - { - testAbortScript(); - if (questWaypoints.containsKey(waypoints[i])) - { - continue; - } - - if (staticQuestWaypoints.containsKey(waypoints[i])) - { - continue; - } - - waypointDictionaries.put(waypoints[i], packWaypoint(waypoints[i])); - } - characterData.put("waypoints", waypointDictionaries); - } - - if (withItems == true) - { - - int moneyFromCash = getCashBalance(self); - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter : packing "+ moneyFromCash + " credits from cash"); - characterData.put("moneyFromCash", moneyFromCash); - - int moneyFromBank = getBankBalance(self); - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter : packing "+ moneyFromBank + " credits from bank"); - characterData.put("moneyFromBank", moneyFromBank); - - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : packing inventory items"); - dictionary inventoryDictionary = new dictionary(); - obj_id[] inventoryItems = getInventoryAndEquipment(self); - obj_id playerInventory = getObjectInSlot(self, "inventory"); - if (inventoryItems != null && inventoryItems.length > 0) - { - int inventoryIter = 0; - for (inventoryIter = 0; inventoryIter < inventoryItems.length; ++inventoryIter) - { - testAbortScript(); - doItemPrepack(inventoryItems[inventoryIter]); - } - for (inventoryIter = 0; inventoryIter < inventoryItems.length; ++inventoryIter) - { - testAbortScript(); - if (!isValidId(inventoryItems[inventoryIter])) - { - continue; - } - - if (hasScript(inventoryItems[inventoryIter], "event.housepackup.cts_greeter")) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : SKIPPING pack of inventory item "+ inventoryItems[inventoryIter] + ". This item was a unique object for Free CTS and cannot be transfered to another server."); - continue; - } - - if (getContainedBy(inventoryItems[inventoryIter]) != self && getContainedBy(inventoryItems[inventoryIter]) != playerInventory) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : SKIPPING pack of inventory item "+ inventoryItems[inventoryIter] + " due to incorrect containment"); - continue; - } - if (hasCondition(inventoryItems[inventoryIter], CONDITION_VENDOR)) - { - continue; - } - - int ot = getGameObjectType(inventoryItems[inventoryIter]); - if (itemIsAllowedToTransfer(inventoryItems[inventoryIter], self) && (!isGameObjectTypeOf(ot, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary itemDictionary = packItem(inventoryItems[inventoryIter], ot, allowOverride, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (itemDictionary != null) - { - inventoryDictionary.put(inventoryItems[inventoryIter], itemDictionary); - } - else - { - if (! allowOverride) - { - return SCRIPT_OVERRIDE; - } - } - } - } - } - characterData.put("inventoryDictionary", inventoryDictionary); - LIVE_LOG("CharacterTransfer", "OnUploadCharacter() : inventory items packed ("+ inventoryDictionary.toString() + ")"); - - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : packing bank items"); - dictionary bankDictionary = new dictionary(); - obj_id playerBank = utils.getPlayerBank(self); - if (isIdValid(playerBank)) - { - obj_id[] bankItems = getContents(playerBank); - if (bankItems != null && bankItems.length > 0) - { - int bankIter = 0; - for (bankIter = 0; bankIter < bankItems.length; ++bankIter) - { - testAbortScript(); - doItemPrepack(bankItems[bankIter]); - } - for (bankIter = 0; bankIter < bankItems.length; ++bankIter) - { - testAbortScript(); - if (!isValidId(bankItems[bankIter])) - { - continue; - } - if (getContainedBy(bankItems[bankIter]) != self && getContainedBy(bankItems[bankIter]) != playerBank) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : SKIPPING pack of bank item "+ bankItems[bankIter] + " due to incorrect containment"); - continue; - } - if (hasCondition(bankItems[bankIter], CONDITION_VENDOR)) - { - continue; - } - - int ot = getGameObjectType(bankItems[bankIter]); - if (itemIsAllowedToTransfer(bankItems[bankIter], self) && (!isGameObjectTypeOf(ot, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary itemDictionary = packItem(bankItems[bankIter], ot, allowOverride, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (itemDictionary != null) - { - bankDictionary.put(bankItems[bankIter], itemDictionary); - } - else - { - if (! allowOverride) - { - return SCRIPT_OVERRIDE; - } - } - } - } - } - characterData.put("bankDictionary", bankDictionary); - LIVE_LOG("CharacterTransfer", "OnUploadCharacter() : bank items packed ("+ bankDictionary.toString() + ")"); - } - else - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : FAILED to pack bank items. bank object is not valid. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : packing datapad items"); - dictionary datapadDictionary = new dictionary(); - obj_id playerDatapad = utils.getPlayerDatapad(self); - if (isIdValid(playerDatapad)) - { - obj_id[] datapadItems = getContents(playerDatapad); - if (datapadItems != null && datapadItems.length > 0) - { - int datapadIter = 0; - for (datapadIter = 0; datapadIter < datapadItems.length; ++datapadIter) - { - testAbortScript(); - doItemPrepack(datapadItems[datapadIter]); - } - for (datapadIter = 0; datapadIter < datapadItems.length; ++datapadIter) - { - testAbortScript(); - if (!isValidId(datapadItems[datapadIter])) - { - continue; - } - if (getContainedBy(datapadItems[datapadIter]) != self && getContainedBy(datapadItems[datapadIter]) != playerDatapad) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : SKIPPING pack of datapad item "+ datapadItems[datapadIter] + " due to incorrect containment"); - continue; - } - if (guild.STR_GUILD_REMOTE_DEVICE.equals(getTemplateName(datapadItems[datapadIter]))) - { - continue; - } - if (hasCondition(datapadItems[datapadIter], CONDITION_VENDOR)) - { - continue; - } - - int objtype = getGameObjectType(datapadItems[datapadIter]); - - if (isGameObjectTypeOf(objtype, GOT_data_house_control_device)) - { - - } - if (isGameObjectTypeOf(objtype, GOT_data_ship_control_device) && (TRANSFER_SHIPS == 0)) - { - continue; - } - if (isGameObjectTypeOf(objtype, GOT_data_droid_control_device) && (TRANSFER_DROIDS == 0)) - { - continue; - } - if (isGameObjectTypeOf(objtype, GOT_data_manufacturing_schematic)) - { - - } - if (isGameObjectTypeOf(objtype, GOT_data_vendor_control_device)) - { - continue; - } - if (objtype == GOT_data_mission_object) - { - - String missionType = getMissionType(datapadItems[datapadIter]); - if ((missionType != null) && missionType.equals("bounty")) - { - continue; - } - } - - if (itemIsAllowedToTransfer(datapadItems[datapadIter], self) && (!isGameObjectTypeOf(objtype, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary itemDictionary = packItem(datapadItems[datapadIter], objtype, allowOverride, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (itemDictionary != null) - { - datapadDictionary.put(datapadItems[datapadIter], itemDictionary); - } - else - { - if (! allowOverride) - { - return SCRIPT_OVERRIDE; - } - } - } - } - } - - characterData.put("datapadDictionary", datapadDictionary); - LIVE_LOG("CharacterTransfer", "OnUploadCharacter() : datapad items packed ("+ datapadDictionary.toString() + ")"); - - } - else - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : FAILED to pack datapad items. datapad object is not valid. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : packing appearance buy back items"); - dictionary buyBackDictionary = new dictionary(); - obj_id buyBackContainer = getObjIdObjVar(self, smuggler.BUYBACK_CONTAINER_VAR); - if (!isIdValid(buyBackContainer)) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : FAILED to find a buy back container object."); - } - else - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : SUCCESS finding a buy back container object."); - obj_id[] buyBackItems = getContents(buyBackContainer); - if (buyBackItems != null && buyBackItems.length > 0) - { - int buyBackIter = 0; - for (buyBackIter = 0; buyBackIter < buyBackItems.length; ++buyBackIter) - { - testAbortScript(); - doItemPrepack(buyBackItems[buyBackIter]); - } - for (buyBackIter = 0; buyBackIter < buyBackItems.length; ++buyBackIter) - { - testAbortScript(); - if (!isValidId(buyBackItems[buyBackIter])) - { - continue; - } - if (getContainedBy(buyBackItems[buyBackIter]) != self && getContainedBy(buyBackItems[buyBackIter]) != buyBackContainer) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : SKIPPING pack of buy back item "+ buyBackItems[buyBackIter] + " due to incorrect containment"); - continue; - } - int objtype = getGameObjectType(buyBackItems[buyBackIter]); - - if (isGameObjectTypeOf(objtype, GOT_data_ship_control_device) && (TRANSFER_SHIPS == 0)) - { - continue; - } - if (itemIsAllowedToTransfer(buyBackItems[buyBackIter], self) && (!isGameObjectTypeOf(objtype, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary itemDictionary = packItem(buyBackItems[buyBackIter], objtype, allowOverride, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (itemDictionary != null) - { - buyBackDictionary.put(buyBackItems[buyBackIter], itemDictionary); - } - else - { - if (! allowOverride) - { - return SCRIPT_OVERRIDE; - } - } - } - } - } - - characterData.put("buyBackDictionary", buyBackDictionary); - LIVE_LOG("CharacterTransfer", "OnUploadCharacter() : buy back items packed ("+ buyBackDictionary.toString() + ")"); - } - - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : packing hangar items"); - dictionary hangarDictionary = new dictionary(); - obj_id playerHangar = utils.getPlayerHangar(self); - if (isIdValid(playerHangar)) - { - obj_id[] hangarItems = getContents(playerHangar); - if (hangarItems != null && hangarItems.length > 0) - { - int hangarIter = 0; - for (hangarIter = 0; hangarIter < hangarItems.length; ++hangarIter) - { - testAbortScript(); - doItemPrepack(hangarItems[hangarIter]); - } - for (hangarIter = 0; hangarIter < hangarItems.length; ++hangarIter) - { - testAbortScript(); - if (!isValidId(hangarItems[hangarIter])) - { - continue; - } - if (getContainedBy(hangarItems[hangarIter]) != self && getContainedBy(hangarItems[hangarIter]) != playerHangar) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : SKIPPING pack of hangar item "+ hangarItems[hangarIter] + " due to incorrect containment"); - continue; - } - int objtype = getGameObjectType(hangarItems[hangarIter]); - - if (isGameObjectTypeOf(objtype, GOT_data_ship_control_device) && (TRANSFER_SHIPS == 0)) - { - continue; - } - if (itemIsAllowedToTransfer(hangarItems[hangarIter], self) && (!isGameObjectTypeOf(objtype, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary itemDictionary = packItem(hangarItems[hangarIter], objtype, allowOverride, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (itemDictionary != null) - { - hangarDictionary.put(hangarItems[hangarIter], itemDictionary); - } - else - { - if (! allowOverride) - { - return SCRIPT_OVERRIDE; - } - } - } - } - } - - characterData.put("hangarDictionary", hangarDictionary); - LIVE_LOG("CharacterTransfer", "OnUploadCharacter() : hangar items packed ("+ hangarDictionary.toString() + ")"); - - } - else - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : FAILED to pack hangar items. hangar object is not valid. The player doesnt have a hangar object, transfer continuing."); - } - - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : packing appearance inventory items"); - dictionary appearanceDictionary = new dictionary(); - obj_id playerAppearance = getAppearanceInventory(self); - if (isIdValid(playerAppearance)) - { - obj_id[] appearanceItems = getContents(playerAppearance); - if (appearanceItems != null && appearanceItems.length > 0) - { - int appearanceIter = 0; - for (appearanceIter = 0; appearanceIter < appearanceItems.length; ++appearanceIter) - { - testAbortScript(); - doItemPrepack(appearanceItems[appearanceIter]); - } - for (appearanceIter = 0; appearanceIter < appearanceItems.length; ++appearanceIter) - { - testAbortScript(); - if (!isValidId(appearanceItems[appearanceIter])) - { - continue; - } - - int objtype = getGameObjectType(appearanceItems[appearanceIter]); - - if (itemIsAllowedToTransfer(appearanceItems[appearanceIter], self) && (!isGameObjectTypeOf(objtype, GOT_resource_container) || !ctsHasExceededResourceTransferLimit(resourceCrateCountLimit, resourceCurrentCrateCount[0], resourceUnitCountLimit, resourceCurrentUnitCount[0]))) - { - dictionary itemDictionary = packItem(appearanceItems[appearanceIter], objtype, allowOverride, resourceCrateCountLimit, resourceCurrentCrateCount, resourceUnitCountLimit, resourceCurrentUnitCount); - if (itemDictionary != null) - { - appearanceDictionary.put(appearanceItems[appearanceIter], itemDictionary); - } - else - { - if (! allowOverride) - { - return SCRIPT_OVERRIDE; - } - } - } - } - } - - characterData.put("appearanceDictionary", appearanceDictionary); - LIVE_LOG("CharacterTransfer", "OnUploadCharacter() : appearance inventory items packed ("+ appearanceDictionary.toString() + ")"); - - } - else - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : FAILED to pack appearance inventory items. appearance inventory object is not valid. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - } - - if (hasScript(self, "space.quest_logic.player_spacequest")) - { - characterData.put("attachSpacequestScript", true); - } - - String[] strObjVars = new String[strObjVarLists.length]; - for (int intI = 0; intI < strObjVarLists.length; intI++) - { - testAbortScript(); - String strObjVar = getPackedObjvars(self, strObjVarLists[intI]); - strObjVars[intI] = strObjVar; - } - characterData.put("strObjVars", strObjVars); - } - catch(Throwable t) - { - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() : an exception was thrown! characterData("+ characterData + ") TRANSFER FAILED : "+ t); - return SCRIPT_OVERRIDE; - } - - removeObjVar(self, "cts"); - CustomerServiceLog("CharacterTransfer", "OnUploadCharacter() complete"); - - setObjVar(self, "disableLoginCtsInProgress", (getGameTime() + 600)); - messageTo(self, "disconnectPlayerCtsCompletedOrInProgress", null, 0.1f, false); - - return SCRIPT_CONTINUE; - } - - public static final String[][] STARTING_CLOTHES = - { - - { - "object/tangible/wearables/shirt/shirt_s14.iff", - "object/tangible/wearables/jacket/jacket_s16.iff", - "object/tangible/wearables/pants/pants_s14.iff", - "object/tangible/wearables/boots/boots_s05.iff" - } - , - - { - "object/tangible/wearables/shirt/shirt_s27.iff", - "object/tangible/wearables/pants/pants_s07.iff", - "object/tangible/wearables/boots/boots_s05.iff", - "object/tangible/wearables/gloves/gloves_s03.iff" - } - , - - { - "object/tangible/wearables/shirt/shirt_s27.iff", - "object/tangible/wearables/pants/pants_s07.iff", - "object/tangible/wearables/boots/boots_s05.iff", - "object/tangible/wearables/gloves/gloves_s02.iff" - } - , - { - "object/tangible/wearables/shirt/shirt_s14.iff", - "object/tangible/wearables/jacket/jacket_s16.iff", - "object/tangible/wearables/pants/pants_s14.iff" - } - , - - { - "object/tangible/wearables/shirt/shirt_s27.iff", - "object/tangible/wearables/pants/pants_s07.iff", - "object/tangible/wearables/gloves/gloves_s03.iff", - } - }; - - - public void createStartingEquipment(obj_id objPlayer) throws InterruptedException - { - obj_id playerInv = utils.getInventoryContainer(objPlayer); - - int gender = getGender(objPlayer); - int species = getSpecies(objPlayer); - int idx = -1; - if (gender == GENDER_MALE) - { - if ((species == SPECIES_HUMAN || species == SPECIES_ZABRAK || species == SPECIES_BOTHAN || species == SPECIES_MON_CALAMARI || species == SPECIES_RODIAN || species == SPECIES_TWILEK)) - { - idx = 0; - } - - if (species == SPECIES_TRANDOSHAN) - { - idx = 3; - } - } - else - { - if ((species == SPECIES_HUMAN || species == SPECIES_ZABRAK || species == SPECIES_BOTHAN || species == SPECIES_RODIAN || species == SPECIES_TWILEK)) - { - idx = 1; - } - - if (species == SPECIES_MON_CALAMARI) - { - idx = 2; - } - - if (species == SPECIES_TRANDOSHAN) - { - idx = 4; - } - } - if (idx >= 0) - { - for (int i = 0; i < STARTING_CLOTHES[idx].length; i++) - { - testAbortScript(); - obj_id newItem = createObject( STARTING_CLOTHES[idx][i], playerInv, ""); - if (isIdValid( newItem)) - { - equip(newItem, playerInv); - } - } - } - } - - - public int OnDownloadCharacter(obj_id self, byte[] packedData) throws InterruptedException - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() begin"); - try - { - if (hasObjVar(self, "hasTransferred")) - { - return SCRIPT_OVERRIDE; - } - - utils.setLocalVar(self, "ctsBeingUnpacked", true); - - setObjVar(self, "hasTransferred", 1); - - dictionary characterData = dictionary.unpack(packedData); - - if (characterData != null) - { - String skillTemplate = characterData.getString("skillTemplate"); - String workingSkill = characterData.getString("workingSkill"); - int combatLevel = characterData.getInt("combatLevel"); - - CustomerServiceLog("CharacterTransfer", "setSkillTemplate("+ self + ", "+ skillTemplate + ") (combatLevel == "+ combatLevel + ", workingSkill == "+ workingSkill + ")"); - setObjVar(self, "clickRespec.combatLevel", combatLevel); - setObjVar(self, "clickRespec.workingSkill", workingSkill); - setObjVar(self, "clickRespec.cts", true); - setSkillTemplate(self, skillTemplate); - - String[] skills = characterData.getStringArray("skills"); - for (int i = 0; i < skills.length; ++i) - { - testAbortScript(); - if (!hasSkill(self, skills[i])) - { - if (grantSkill(self, skills[i])) - { - CustomerServiceLog("CharacterTransfer", "grantSkill("+ self + ", "+ skills[i] + ")"); - } - else - { - CustomerServiceLog("CharacterTransfer", "grantSkill("+ self + ", "+ skills[i] + ") FAILED"); - return SCRIPT_OVERRIDE; - } - } - } - - String[] commands = characterData.getStringArray("commands"); - for (int i = 0; i < commands.length; ++i) - { - testAbortScript(); - if (!hasCommand(self, commands[i])) - { - if (grantCommand(self, commands[i])) - { - CustomerServiceLog("CharacterTransfer", "grantCommand("+ self + ", "+ commands[i] + ")"); - } - else - { - CustomerServiceLog("CharacterTransfer", "grantCommand("+ self + ", "+ commands[i] + ") FAILED"); - return SCRIPT_OVERRIDE; - } - } - } - - dictionary experiencePoints = characterData.getDictionary("experience_points"); - if (experiencePoints != null) - { - Set keySet = experiencePoints.keySet(); - Iterator expIterator = keySet.iterator(); - while (expIterator.hasNext()) - { - testAbortScript(); - String expType = (String)expIterator.next(); - if (expType != null) - { - int expValue = experiencePoints.getInt(expType); - if (getExperiencePoints(self, expType) != expValue) - { - int result = grantExperiencePoints(self, expType, expValue); - if (result == XP_ERROR) - { - CustomerServiceLog("CharacterTransfer", "grantExperiencePoints("+ self + ", "+ expType + ", "+ expValue + ") FAILED"); - return SCRIPT_OVERRIDE; - } - else - { - CustomerServiceLog("CharacterTransfer", "grantExperiencePoints("+ self + ", "+ expType + ", "+ expValue + ") (non-roadmap exp)"); - } - } - } - } - } - - String[] strObjVars = characterData.getStringArray("strObjVars"); - for (int intI = 0; intI < strObjVars.length; intI++) - { - testAbortScript(); - setPackedObjvars(self, strObjVars[intI]); - } - - removeObjVar(self, "galactic_reserve_cooldown"); - - if (hasObjVar(self, CTS_LOT_COUNT)) - { - int lot_count = getIntObjVar(self, CTS_LOT_COUNT); - CustomerServiceLog("CharacterTransfer", "adjusting lot count("+ self + ", "+ lot_count + ")"); - player_structure.adjustLotCount(getPlayerObject(self), lot_count); - } - - int sourceCharacterAlignedFaction = characterData.getInt("pvp_aligned_faction"); - int sourceCharacterPvpType = characterData.getInt("pvp_type"); - switch (sourceCharacterPvpType) - { - case PVPTYPE_NEUTRAL: - - if (sourceCharacterAlignedFaction == 0) - { - pvpMakeNeutral(self); - } - break; - case PVPTYPE_COVERT: - pvpMakeCovert(self); - break; - case PVPTYPE_DECLARED: - pvpMakeDeclared(self); - break; - } - - pvpSetAlignedFaction(self, sourceCharacterAlignedFaction); - - if ((sourceCharacterAlignedFaction != 0) && (sourceCharacterPvpType == PVPTYPE_NEUTRAL)) - { - pvpMakeOnLeave(self); - } - - ctsUseOnlySetGcwInfo(self, characterData.getInt("gcw_current_point"), characterData.getInt("gcw_current_rating"), characterData.getInt("gcw_current_pvp_kill"), characterData.getLong("gcw_lifetime_point"), characterData.getInt("gcw_max_imperial_rating"), characterData.getInt("gcw_max_rebel_rating"), characterData.getInt("gcw_lifetime_pvp_kill"), characterData.getInt("gcw_next_rating_calc_time")); - - obj_id[] old_waypoints = getWaypointsInDatapad(self); - if (old_waypoints != null && old_waypoints.length > 0) - { - for (int i = 0; i < old_waypoints.length; ++i) - { - testAbortScript(); - destroyWaypointInDatapad(old_waypoints[i], self); - } - } - dictionary waypoints = characterData.getDictionary("waypoints"); - if (waypoints != null) - { - Set keySet = waypoints.keySet(); - Iterator waypointIterator = keySet.iterator(); - while (waypointIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)waypointIterator.next(); - dictionary waypointDict = waypoints.getDictionary(key); - unpackWaypoint(waypointDict); - } - } - - obj_id playerObject = getPlayerObject(self); - if (isIdValid(playerObject)) - { - if (characterData.containsKey("quests")) - { - byte[] quests = characterData.getByteArray("quests"); - setAutoVariableFromByteStream(playerObject, "quests", quests); - } - - if (characterData.containsKey("activeQuests")) - { - byte[] activeQuests = characterData.getByteArray("activeQuests"); - setAutoVariableFromByteStream(playerObject, "activeQuests", activeQuests); - } - - if (characterData.containsKey("completedQuests")) - { - byte[] completedQuests = characterData.getByteArray("completedQuests"); - setAutoVariableFromByteStream(playerObject, "completedQuests", completedQuests); - } - - if (characterData.containsKey("currentQuest")) - { - byte[] currentQuest = characterData.getByteArray("currentQuest"); - setAutoVariableFromByteStream(playerObject, "currentQuest", currentQuest); - } - - groundquests.reattachQuestScripts(self); - - if (characterData.containsKey("bornDate")) - { - byte[] bornDate = characterData.getByteArray("bornDate"); - setAutoVariableFromByteStream(playerObject, "bornDate", bornDate); - } - - if (characterData.containsKey("playedTime")) - { - byte[] playedTime = characterData.getByteArray("playedTime"); - setAutoVariableFromByteStream(playerObject, "playedTime", playedTime); - } - - if (characterData.containsKey("food")) - { - byte[] food = characterData.getByteArray("food"); - setAutoVariableFromByteStream(playerObject, "food", food); - } - - if (characterData.containsKey("maxFood")) - { - byte[] maxFood = characterData.getByteArray("maxFood"); - setAutoVariableFromByteStream(playerObject, "maxFood", maxFood); - } - - if (characterData.containsKey("drink")) - { - byte[] drink = characterData.getByteArray("drink"); - setAutoVariableFromByteStream(playerObject, "drink", drink); - } - - if (characterData.containsKey("maxDrink")) - { - byte[] maxDrink = characterData.getByteArray("maxDrink"); - setAutoVariableFromByteStream(playerObject, "maxDrink", maxDrink); - } - - if (characterData.containsKey("meds")) - { - byte[] meds = characterData.getByteArray("meds"); - setAutoVariableFromByteStream(playerObject, "meds", meds); - } - - if (characterData.containsKey("maxMeds")) - { - byte[] maxMeds = characterData.getByteArray("maxMeds"); - setAutoVariableFromByteStream(playerObject, "maxMeds", maxMeds); - } - - if (characterData.containsKey("matchMakingPersonalProfileId")) - { - byte[] matchMakingPersonalProfileId = characterData.getByteArray("matchMakingPersonalProfileId"); - setAutoVariableFromByteStream(playerObject, "matchMakingPersonalProfileId", matchMakingPersonalProfileId); - } - - if (characterData.containsKey("matchMakingCharacterProfileId")) - { - byte[] matchMakingCharacterProfileId = characterData.getByteArray("matchMakingCharacterProfileId"); - setAutoVariableFromByteStream(playerObject, "matchMakingCharacterProfileId", matchMakingCharacterProfileId); - } - - if (characterData.containsKey("workingSkill")) - { - byte[] playerObjectWorkingSkill = characterData.getByteArray("workingSkill"); - setAutoVariableFromByteStream(playerObject, "workingSkill", playerObjectWorkingSkill); - } - - if (characterData.containsKey("skillTemplate")) - { - byte[] playerObjectSkillTemplate = characterData.getByteArray("skillTemplate"); - setAutoVariableFromByteStream(playerObject, "skillTemplate", playerObjectSkillTemplate); - } - - if (characterData.containsKey("collections")) - { - byte[] collections = characterData.getByteArray("collections"); - setAutoVariableFromByteStream(playerObject, "collections", collections); - } - - if (characterData.containsKey("collections2")) - { - byte[] collections2 = characterData.getByteArray("collections2"); - setAutoVariableFromByteStream(playerObject, "collections2", collections2); - } - - if (characterData.containsKey("source_cluster")) - { - - String sourceCluster = characterData.getString("source_cluster"); - - if (characterData.containsKey("source_character_oid") && characterData.containsKey("source_character_name")) - { - int ctsHistoryIndex = 1; - while (true) - { - testAbortScript(); - if (!hasObjVar(self, "ctsHistory." + ctsHistoryIndex)) - { - setObjVar(self, "ctsHistory."+ ctsHistoryIndex, ""+ getCalendarTime() + " "+ sourceCluster + " "+ characterData.getObjId("source_character_oid") + " "+ characterData.getString("source_character_name")); - break; - } - - ++ctsHistoryIndex; - } - } - - String currentCluster = getClusterName(); - boolean grantCtsTitle = !sourceCluster.equals(currentCluster); - - sourceCluster = toLower(sourceCluster); - sourceCluster = sourceCluster.replace('-', '_'); - - if (grantCtsTitle) - { - modifyCollectionSlotValue(self, "cts_from_"+ sourceCluster, 1L); - } - - if (characterData.containsKey("freeCtsTransactionRuleName")) - { - setObjVar(self, characterData.getString("freeCtsTransactionRuleName") + "."+ sourceCluster, currentCluster); - } - } - - int[] quests = questGetAllActiveQuestIds(self); - for (int i = 0; i < quests.length; ++i) - { - testAbortScript(); - int questId = quests[i]; - - for (int taskId = 0; taskId < 16; ++taskId) - { - testAbortScript(); - if (questIsTaskActive(questId, taskId, self)) - { - groundquests.refreshQuestWaypoints(questId, taskId, true, self); - } - } - } - } - - boolean withItems = characterData.getBoolean("withItems"); - if (withItems == true) - { - - obj_id[] existingItems = getInventoryAndEquipment(self); - obj_id inv = utils.getInventoryContainer(self); - - if (existingItems != null) - { - int existingIter; - for (existingIter = 0; existingIter < existingItems.length; ++existingIter) - { - testAbortScript(); - if (existingItems[existingIter] != self && existingItems[existingIter] != inv) - { - LIVE_LOG("CharacterTransfer", "OnDownloadCharacter() : destroying unwanted pre-existing destination item : "+ getTemplateName(existingItems[existingIter])); - destroyObject(existingItems[existingIter]); - } - } - } - - int maxMoneyTransferAmount = 100000000; - { - int tempMaxMoneyTransferAmount = utils.stringToInt( getConfigSetting("GameServer", "maxMoneyTransfer") ); - if (tempMaxMoneyTransferAmount > 0) - { - maxMoneyTransferAmount = tempMaxMoneyTransferAmount; - } - } - - if (characterData.containsKey("moneyFromCash")) - { - int moneyFromCash = characterData.getInt("moneyFromCash"); - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : unpacking "+ moneyFromCash + " credits to cash"); - - while (moneyFromCash > 0) - { - testAbortScript(); - int transferAmount = utils.clipRange(moneyFromCash, 0, maxMoneyTransferAmount); - - if (!transferBankCreditsFromNamedAccount("characterTransfer", self, transferAmount, null, null, null)) - { - CustomerServiceLog("CharacterTransfer", "transferBankCreditsFromNamedAccount(characterTransfer, "+ self + ", "+ transferAmount + ", null, null, null) FAILED"); - break; - } - else - { - - if (!withdrawCashFromBank(self, transferAmount, null, null, null)) - { - CustomerServiceLog("CharacterTransfer", "withdrawCashFromBank(characterTransfer, "+ self + ", "+ transferAmount + ", null, null, null) FAILED"); - break; - } - - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : +"+ transferAmount + " credits to cash"); - } - - moneyFromCash -= maxMoneyTransferAmount; - } - } - - if (characterData.containsKey("moneyFromBank")) - { - int moneyFromBank = characterData.getInt("moneyFromBank"); - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : unpacking "+ moneyFromBank + " credits to bank"); - - while (moneyFromBank > 0) - { - testAbortScript(); - int transferAmount = utils.clipRange(moneyFromBank, 0, maxMoneyTransferAmount); - - if (!transferBankCreditsFromNamedAccount("characterTransfer", self, transferAmount, null, null, null)) - { - CustomerServiceLog("CharacterTransfer", "transferBankCreditsFromNamedAccount(characterTransfer, "+ self + ", "+ transferAmount + ", null, null, null) FAILED"); - break; - } - - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : +"+ transferAmount + " credits to bank"); - - moneyFromBank -= maxMoneyTransferAmount; - } - } - - obj_id playerInventory = utils.getInventoryContainer(self); - obj_id playerBank = utils.getPlayerBank(self); - - utils.setScriptVar(self, "autostack.ignoreitems", true); - - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : unpacking inventory items"); - dictionary inventoryDictionary = characterData.getDictionary("inventoryDictionary"); - if (inventoryDictionary == null) - { - return SCRIPT_OVERRIDE; - } - else - { - Set keySet = inventoryDictionary.keySet(); - Iterator inventoryIterator = keySet.iterator(); - while (inventoryIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)inventoryIterator.next(); - if (isIdNull(key)) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : could not retrieve a key from the inventory dictionary iterator. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - dictionary itemDictionary = inventoryDictionary.getDictionary(key); - - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(playerInventory, itemDictionary)) - { - continue; - } - - obj_id unpackedItem = unpackItem(playerInventory, itemDictionary); - if (!isIdValid(unpackedItem)) - { - if (isIdNull(unpackedItem)) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : unpackItem() returned NULL id for item: "+ itemDictionary); - return SCRIPT_OVERRIDE; - } - else - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : unpackItem() returned invalid id "+ unpackedItem + " for item: "+ itemDictionary); - continue; - } - } - } - } - - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : unpacking bank items"); - dictionary bankDictionary = characterData.getDictionary("bankDictionary"); - if (bankDictionary == null) - { - return SCRIPT_OVERRIDE; - } - else - { - Set keySet = bankDictionary.keySet(); - Iterator bankIterator = keySet.iterator(); - while (bankIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)bankIterator.next(); - if (isIdNull(key)) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : could not retrieve a key from the bank dictionary iterator. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - dictionary itemDictionary = bankDictionary.getDictionary(key); - - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(playerInventory, itemDictionary)) - { - continue; - } - - obj_id unpackedItem = unpackItem(playerInventory, itemDictionary); - if (!isIdValid(unpackedItem)) - { - if (isIdNull(unpackedItem)) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : unpackItem() returned NULL id for item: "+ itemDictionary); - return SCRIPT_OVERRIDE; - } - else - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : unpackItem() returned invalid id "+ unpackedItem + " for item: "+ itemDictionary); - continue; - } - } - - if (putIn(unpackedItem, playerBank)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : moved item "+ unpackedItem + " into bank "+ playerBank); - } - else - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to move item "+ unpackedItem + " into bank "+ playerBank); - } - } - } - - obj_id playerDatapad = utils.getPlayerDatapad(self); - obj_id datapadObjects[] = getContents(playerDatapad); - for (int oldDatapad = 0; oldDatapad < datapadObjects.length; ++oldDatapad) - { - testAbortScript(); - destroyObject(datapadObjects[oldDatapad]); - } - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : unpacking datapad items"); - dictionary datapadDictionary = characterData.getDictionary("datapadDictionary"); - if (datapadDictionary == null) - { - return SCRIPT_OVERRIDE; - } - else - { - - dictionary datapadItemOidTranslation = new dictionary(); - - Vector shipsWithDroidControlDevice = new Vector(); - shipsWithDroidControlDevice.setSize(0); - - Set keySet = datapadDictionary.keySet(); - Iterator datapadIterator = keySet.iterator(); - while (datapadIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)datapadIterator.next(); - if (isIdNull(key)) - { - - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : could not retrieve a key from the datapad dictionary iterator. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - dictionary itemDictionary = datapadDictionary.getDictionary(key); - - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(playerDatapad, itemDictionary)) - { - continue; - } - - obj_id unpackedItem = unpackItem(playerDatapad, itemDictionary); - if (!isIdValid(unpackedItem)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to unpack datapad item (original oid "+ key + ") into datapad "+ playerDatapad); - } - else - { - - datapadItemOidTranslation.put(key, unpackedItem); - - if (utils.hasScript(unpackedItem, "space.ship_control_device.ship_control_device")) - { - obj_id ship = space_transition.getShipFromShipControlDevice(unpackedItem); - if (isIdValid(ship) && utils.hasLocalVar(ship, "droid_control_device")) - { - utils.addElement(shipsWithDroidControlDevice, ship); - } - } - } - } - - for (int i = 0; i < shipsWithDroidControlDevice.size(); ++i) - { - testAbortScript(); - obj_id originalDroidControlDevice = utils.getObjIdLocalVar(((obj_id)(shipsWithDroidControlDevice.get(i))), "droid_control_device"); - if (isIdValid(originalDroidControlDevice) && datapadItemOidTranslation.containsKey(originalDroidControlDevice)) - { - obj_id newDroidControlDevice = datapadItemOidTranslation.getObjId(originalDroidControlDevice); - if (isIdValid(newDroidControlDevice)) - { - associateDroidControlDeviceWithShip(((obj_id)(shipsWithDroidControlDevice.get(i))), newDroidControlDevice); - } - } - } - } - - obj_id buyBackContainer = getObjIdObjVar(self, smuggler.BUYBACK_CONTAINER_VAR); - if (isIdValid(buyBackContainer)) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : source character had an existing buy back container: "+buyBackContainer); - - obj_id buyBackObjects[] = getContents(buyBackContainer); - if (buyBackObjects != null && buyBackObjects.length > 0) - { - for (int oldContainer = 0; oldContainer < buyBackObjects.length; ++oldContainer) - { - testAbortScript(); - destroyObject(buyBackObjects[oldContainer]); - } - } - } - - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : unpacking buy back items"); - dictionary buyBackDictionary = characterData.getDictionary("buyBackDictionary"); - if (buyBackDictionary == null || buyBackDictionary.isEmpty()) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : source character did not have a buy back dictionary data!!"); - } - else - { - - if (!isIdValid(buyBackContainer)) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : source character did not have a valid buy back container."); - buyBackContainer = smuggler.getBuyBackContainerObjVar(self); - } - - if (!isIdValid(buyBackContainer)) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : source character could not create buy back container. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - Set keySet = buyBackDictionary.keySet(); - Iterator buyBackIterator = keySet.iterator(); - while (buyBackIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)buyBackIterator.next(); - if (isIdNull(key)) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : could not retrieve a key from the buy back dictionary iterator. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - dictionary itemDictionary = buyBackDictionary.getDictionary(key); - obj_id unpackedItem = unpackItem(buyBackContainer, itemDictionary); - if (!isIdValid(unpackedItem)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to unpack buy back item (original oid "+ key + ") into buy back container "+ buyBackContainer); - } - - } - } - - obj_id playerHangar = utils.getPlayerHangar(self); - - if (isIdValid(playerHangar)) - { - obj_id hangarObjects[] = getContents(playerHangar); - for (int oldHangar = 0; oldHangar < hangarObjects.length; ++oldHangar) - { - testAbortScript(); - destroyObject(hangarObjects[oldHangar]); - } - } - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : unpacking hangar items"); - dictionary hangarDictionary = characterData.getDictionary("hangarDictionary"); - if (hangarDictionary == null || hangarDictionary.isEmpty()) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : source character did not have a hangar object."); - } - else - { - - if (!isIdValid(playerHangar)) - { - playerHangar = createObject("object/tangible/datapad/character_hangar_datapad.iff", self, "hangar"); - } - - if (!isIdValid(playerHangar)) - { - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : source character could not create hangar. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - setObjVar(self, player_structure.OBJVAR_HANGAR_CREATED, playerHangar); - - persistObject(playerHangar); - - dictionary hangarItemOidTranslation = new dictionary(); - - Vector shipsWithDroidControlDevice = new Vector(); - shipsWithDroidControlDevice.setSize(0); - - Set keySet = hangarDictionary.keySet(); - Iterator hangarIterator = keySet.iterator(); - while (hangarIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)hangarIterator.next(); - if (isIdNull(key)) - { - - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : could not retrieve a key from the hangar dictionary iterator. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - dictionary itemDictionary = hangarDictionary.getDictionary(key); - - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(playerDatapad, itemDictionary)) - { - continue; - } - - obj_id unpackedItem = unpackItem(playerHangar, itemDictionary); - if (!isIdValid(unpackedItem)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to unpack hangar item (original oid "+ key + ") into hangar "+ playerHangar); - } - else - { - - hangarItemOidTranslation.put(key, unpackedItem); - - if (utils.hasScript(unpackedItem, "space.ship_control_device.ship_control_device")) - { - obj_id ship = space_transition.getShipFromShipControlDevice(unpackedItem); - if (isIdValid(ship) && utils.hasLocalVar(ship, "droid_control_device")) - { - utils.addElement(shipsWithDroidControlDevice, ship); - } - } - } - } - - for (int i = 0; i < shipsWithDroidControlDevice.size(); ++i) - { - testAbortScript(); - obj_id originalDroidControlDevice = utils.getObjIdLocalVar(((obj_id)(shipsWithDroidControlDevice.get(i))), "droid_control_device"); - if (isIdValid(originalDroidControlDevice) && hangarItemOidTranslation.containsKey(originalDroidControlDevice)) - { - obj_id newDroidControlDevice = hangarItemOidTranslation.getObjId(originalDroidControlDevice); - if (isIdValid(newDroidControlDevice)) - { - associateDroidControlDeviceWithShip(((obj_id)(shipsWithDroidControlDevice.get(i))), newDroidControlDevice); - } - } - } - } - - obj_id playerAppearance = getAppearanceInventory(self); - obj_id appearanceObjects[] = getContents(playerAppearance); - for (int oldAppearance = 0; oldAppearance < appearanceObjects.length; ++oldAppearance) - { - testAbortScript(); - destroyObject(appearanceObjects[oldAppearance]); - } - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter : unpacking appearance inventory items"); - dictionary appearanceDictionary = characterData.getDictionary("appearanceDictionary"); - if (appearanceDictionary == null) - { - return SCRIPT_OVERRIDE; - } - else - { - Set keySet = appearanceDictionary.keySet(); - Iterator appearanceIterator = keySet.iterator(); - while (appearanceIterator.hasNext()) - { - testAbortScript(); - obj_id key = (obj_id)appearanceIterator.next(); - if (isIdNull(key)) - { - - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : could not retrieve a key from the appearance dictionary iterator. TRANSFER FAILED"); - return SCRIPT_OVERRIDE; - } - - dictionary itemDictionary = appearanceDictionary.getDictionary(key); - - if (ctsCheckAndLogUniqueStaticItemAlreadyExists(playerAppearance, itemDictionary)) - { - continue; - } - - obj_id unpackedItem = unpackItem(playerInventory, itemDictionary); - if (!isIdValid(unpackedItem)) - { - CustomerServiceLog("CharacterTransfer", "unpackItem() : FAILED to unpack appearance inventory item (original oid "+ key + ") into appearance inventory "+ playerAppearance); - } - } - - } - - utils.removeScriptVar(self, "autostack.ignoreitems"); - - } - else - { - - obj_id inventory = getObjectInSlot( self, "inventory"); - if (isIdValid(inventory)) - { - weapons.createWeapon("object/weapon/ranged/pistol/pistol_cdef.iff", inventory, 0.90f); - createObject("object/tangible/survey_tool/survey_tool_mineral.iff", inventory, ""); - weapons.createWeapon("object/weapon/melee/knife/knife_survival.iff", inventory, 0.90f); - createObject("object/tangible/crafting/station/generic_tool.iff", inventory, ""); - if (utils.isProfession(self, utils.ENTERTAINER)) - { - createObject("object/tangible/instrument/slitherhorn.iff", inventory, ""); - } - createStartingEquipment(self); - } - } - - if (characterData.containsKey("attachSpacequestScript") && characterData.getBoolean("attachSpacequestScript")) - { - attachScript(self, "space.quest_logic.player_spacequest"); - } - } - else - { - return SCRIPT_OVERRIDE; - } - } - catch(Throwable t) - { - removeObjVar(self, "cts"); - utils.removeLocalVar(self, "ctsBeingUnpacked"); - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() : an exception was thrown! TRANSFER FAILED : "+ t); - return SCRIPT_OVERRIDE; - } - - CustomerServiceLog("CharacterTransfer", "OnDownloadCharacter() complete"); - - removeObjVar(self, "cts"); - removeObjVar(self, "preserve_existing_lightsaber_crystal_owner_objvar"); - utils.removeLocalVar(self, "ctsBeingUnpacked"); - return SCRIPT_CONTINUE; - } - - - public int OnSkillModDone(obj_id self, String modName, boolean isDead) throws InterruptedException - { - if (modName == null) - { - return SCRIPT_CONTINUE; - } - - if (modName.indexOf( "food_" ) == 0) - { - - utils.removeScriptVar( self, modName ); - - } - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - return SCRIPT_CONTINUE; - } - - - public int removeDelayedFoodEffect(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - String type = params.getString( "type"); - if (!utils.hasScriptVar( self, "food."+type+".dur" )) - { - return SCRIPT_CONTINUE; - } - int time = utils.getIntScriptVar( self, "food."+type+".time"); - if (getGameTime() - time < 1799) - { - return SCRIPT_CONTINUE; - } - - utils.removeScriptVarTree( self, "food."+type ); - - return SCRIPT_CONTINUE; - } - - - public int removeDurationFoodEffect(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - String type = params.getString( "type"); - if (!utils.hasScriptVar( self, "food."+type+".dur" )) - { - return SCRIPT_CONTINUE; - } - int time = utils.getIntScriptVar( self, "food."+type+".time"); - if (getGameTime() - time < 1799) - { - return SCRIPT_CONTINUE; - } - - utils.removeScriptVarTree( self, "food."+type ); - - return SCRIPT_CONTINUE; - } - - - public int handleSpiceDownerEffect(obj_id self, dictionary params) throws InterruptedException - { - if (buff.hasBuff(self, "spice_downer")) - { - buff.removeBuff(self, "spice_downer"); - } - - float duration = buff.getDuration("spice_downer"); - - float downerModified = ((float)getEnhancedSkillStatisticModifierUncapped(self, "resistance_spice_downer")); - if (downerModified > 0) - { - duration -= downerModified; - if (duration <= 0) - { - sendSystemMessage(self, SID_SPICE_DOWNER_DURATION_NEGATED); - return SCRIPT_CONTINUE; - } - sendSystemMessage(self, SID_SPICE_DOWNER_DURATION_REDUCED); - } - - if (buff.applyBuff(self, "spice_downer", duration)) - { - doAnimationAction(self, anims.PLAYER_HEAVY_COUGH_VOMIT); - } - - return SCRIPT_CONTINUE; - } - - - public int handleGenericDownerEffect(obj_id self, dictionary params) throws InterruptedException - { - if (buff.hasBuff(self, "generic_downer")) - { - buff.removeBuff(self, "generic_downer"); - } - - float duration = buff.getDuration("generic_downer"); - - if (buff.applyBuff(self, "generic_downer", duration)) - { - doAnimationAction(self, anims.PLAYER_HEAVY_COUGH_VOMIT); - } - - return SCRIPT_CONTINUE; - } - - - public int OnStomachUpdate(obj_id self) throws InterruptedException - { - player_stomach.getStomach( self, 0 ); - player_stomach.getStomach( self, 1 ); - return SCRIPT_CONTINUE; - } - - - public int grantUnmodifiedExperienceOnSelf(obj_id self, dictionary params) throws InterruptedException - { - - if (npe.hasReachedMaxTutorialLevel(self)) - { - int hadNotif = utils.getIntScriptVar(self, "npe.level_capped"); - if (hadNotif == 0) - { - string_id chat = new string_id("npe", "pop_level_cap"); - obj_id building = getTopMostContainer(self); - obj_id droid = utils.getObjIdScriptVar(building, "objDroidInvis"); - npe.commTutorialPlayer(droid, self, 10, chat, "sound/dro_r2_3_danger.snd", "object/mobile/r2.iff"); - utils.setScriptVar(self, "npe.level_capped", 1); - } - return SCRIPT_CONTINUE; - } - int playerLevel = getLevel(self); - if (isFreeTrialAccount(self)) - { - if (playerLevel >= xp.TRIAL_LEVEL_CAP) - { - return SCRIPT_CONTINUE; - } - } - - String xp_type = params.getString("xp_type"); - int amt = params.getInt("amt"); - String fromCallback = params.getString("fromCallback"); - dictionary fromCallbackData = params.getDictionary("fromCallbackData"); - obj_id fromId = params.getObjId("fromId"); - - if (luck.isLucky(self, 0.001f)) - { - float bonus = amt * 0.1f; - if (bonus < 1.0f) - { - bonus = 1.0f; - } - - amt += bonus; - } - - xp._grantUnmodifiedExperience(self, xp_type, amt, fromCallback, fromCallbackData, fromId); - - return SCRIPT_CONTINUE; - } - - - public int grantSquadLeaderXpResult(obj_id self, dictionary params) throws InterruptedException - { - int granted = params.getInt(xp.GRANT_XP_RESULT_VALUE); - dictionary data = params.getDictionary(xp.GRANT_XP_RETURN_DATA); - obj_id player = data.getObjId("player"); - int amt = data.getInt("amt"); - xp.grantSquadLeaderXpResult(player, granted, amt); - return SCRIPT_CONTINUE; - } - - - public int cmdSetExperienceResult(obj_id self, dictionary params) throws InterruptedException - { - if (isGod(self)) - { - int granted = params.getInt(xp.GRANT_XP_RESULT_VALUE); - dictionary data = params.getDictionary(xp.GRANT_XP_RETURN_DATA); - obj_id target = data.getObjId("target"); - String xp_type = data.getString("xp_type"); - sendSystemMessageTestingOnly(self, "/setExperience: granted ("+ target + ")"+ utils.getStringName(target) + " "+ granted + "pts of "+ getString(new string_id("exp_n",xp_type)) + " ("+ xp_type + ") experience"); - } - return SCRIPT_CONTINUE; - } - - - public int OnPerformEmote(obj_id self, String emote) throws InterruptedException - { - int[] emotes = dataTableGetIntColumn(veteran_deprecated.EMOTES_DATATABLE, veteran_deprecated.EMOTES_COLUMN_EMOTE); - if (emotes == null) - { - return SCRIPT_CONTINUE; - } - - int emoteCrc = getStringCrc(emote); - for (int i = 0; i < emotes.length; ++i) - { - testAbortScript(); - if (emoteCrc == emotes[i]) - { - - int[] playerEmotes = getIntArrayObjVar(self, veteran_deprecated.OBJVAR_VETERAN_EMOTES); - if (playerEmotes != null) - { - int emoteGroup = dataTableGetInt(veteran_deprecated.EMOTES_DATATABLE, i, veteran_deprecated.EMOTES_COLUMN_GROUP); - for (int j = 0; j < playerEmotes.length; ++j) - { - testAbortScript(); - if (emoteGroup == playerEmotes[j]) - { - - return SCRIPT_CONTINUE; - } - } - } - - return SCRIPT_OVERRIDE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int cmdGetVeteranRewardTime(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!"true".equals(getConfigSetting("GameServer", "enableVeteranRewards"))) - { - return SCRIPT_CONTINUE; - } - - if (isGod(self)) - { - if (!isIdValid(target)) - { - target = self; - } - if (veteran_deprecated.checkVeteranTarget(target)) - { - int veteranTime = getIntObjVar(target, veteran_deprecated.OBJVAR_TIME_ACTIVE); - prose_package pp = new prose_package(); - pp.stringId = veteran_deprecated.SID_VETERAN_TIME_ACTIVE; - pp.target.id = target; - pp.digitInteger = veteranTime; - sendSystemMessageProse(self, pp); - } - } - else - { - if (hasObjVar(self, veteran_deprecated.OBJVAR_TIME_ACTIVE)) - { - int veteranTime = getIntObjVar(self, veteran_deprecated.OBJVAR_TIME_ACTIVE); - prose_package pp = new prose_package(); - pp.stringId = veteran_deprecated.SID_VETERAN_SELF_TIME_ACTIVE; - pp.digitInteger = veteranTime; - sendSystemMessageProse(self, pp); - } - else - { - sendSystemMessage(self, veteran_deprecated.SID_SYSTEM_INACTIVE); - } - } - return SCRIPT_CONTINUE; - } - - - public int cmdListVeteranRewards(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!"true".equals(getConfigSetting("GameServer", "enableVeteranRewards"))) - { - return SCRIPT_CONTINUE; - } - - if (!isGod(self) && !hasObjVar(self, veteran_deprecated.OBJVAR_TIME_ACTIVE)) - { - - sendSystemMessage(self, veteran_deprecated.SID_SYSTEM_INACTIVE); - return SCRIPT_CONTINUE; - } - - int[] templateCrcs = dataTableGetIntColumn(veteran_deprecated.REWARDS_DATATABLE, veteran_deprecated.REWARDS_COLUMN_TEMPLATE); - if (templateCrcs == null) - { - return SCRIPT_CONTINUE; - } - int[] milestones = dataTableGetIntColumn(veteran_deprecated.REWARDS_DATATABLE, veteran_deprecated.REWARDS_COLUMN_MILESTONE); - if (milestones == null) - { - return SCRIPT_CONTINUE; - } - string_id[] nameIds = getNamesFromTemplates(templateCrcs); - if (nameIds == null) - { - return SCRIPT_CONTINUE; - } - - if (milestones.length != nameIds.length) - { - return SCRIPT_CONTINUE; - } - - String[] milestonesText = new String[nameIds.length]; - String daysText = getString(veteran_deprecated.SID_DAYS); - for (int i = 0; i < nameIds.length; ++i) - { - testAbortScript(); - if (nameIds[i] != null) - { - milestonesText[i] = "@" + nameIds[i] + " :\\>200" + (milestones[i] * veteran_deprecated.DAYS_PER_MILESTONE) + daysText; - } - else - { - milestonesText[i] = ""; - } - } - - int pid = sui.listbox(self, "", milestonesText); - if (pid < 0) - { - CustomerServiceLog("veteran", "Could not create sui reward list, error = "+ pid); - } - - return SCRIPT_CONTINUE; - } - - - public int handleVeteranMilestoneSelected(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - veteran_deprecated.cleanupPlayerData(self); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - veteran_deprecated.cleanupPlayerData(self); - return SCRIPT_CONTINUE; - } - - int rowSelected = sui.getListboxSelectedRow(params); - int[] milestones = self.getScriptVars().getIntArray(veteran_deprecated.SCRIPTVAR_AVAILABLE_MILESTONES); - if (milestones == null || milestones.length < 1 || rowSelected < 0) - { - veteran_deprecated.cleanupPlayerData(self); - sendSystemMessage(self, veteran_deprecated.SID_BAD_MILESTONE); - return SCRIPT_CONTINUE; - } - - rowSelected = 1; - - for (int i = 0; i < milestones.length; ++i) - { - testAbortScript(); - if ((rowSelected + 1) == milestones[i]) - { - veteran_deprecated.requestVeteranRewards(self, milestones[i]); - return SCRIPT_CONTINUE; - } - } - - veteran_deprecated.cleanupPlayerData(self); - sendSystemMessage(self, veteran_deprecated.SID_BAD_MILESTONE); - return SCRIPT_CONTINUE; - } - - - public int handleVeteranRewardSelected(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - veteran_deprecated.cleanupPlayerData(self); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - veteran_deprecated.cleanupPlayerData(self); - return SCRIPT_CONTINUE; - } - - int rowSelected = sui.getListboxSelectedRow(params); - if (rowSelected < 0) - { - veteran_deprecated.cleanupPlayerData(self); - sendSystemMessage(self, veteran_deprecated.SID_BAD_REWARD); - return SCRIPT_CONTINUE; - } - - int result = veteran_deprecated.givePlayerReward(self, rowSelected, true); - if (result == veteran_deprecated.GIVE_PLAYER_REWARD_SUCCESS) - { - veteran_deprecated.cleanupPlayerData(self); - sendSystemMessage(self, veteran_deprecated.SID_REWARD_GIVEN); - } - else if (result == veteran_deprecated.GIVE_PLAYER_REWARD_FAILED) - { - veteran_deprecated.cleanupPlayerData(self); - sendSystemMessage(self, veteran_deprecated.SID_REWARD_ERROR); - } - else - { - - } - - return SCRIPT_CONTINUE; - } - - - public int handleVeteranRewardConfirmed(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - veteran_deprecated.cleanupPlayerData(self); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - - if (!self.getScriptVars().hasKey(veteran_deprecated.SCRIPTVAR_SELECTED_MILESTONE)) - { - veteran_deprecated.cleanupPlayerData(self); - } - else - { - self.getScriptVars().remove(veteran_deprecated.SCRIPTVAR_SELECTED_REWARD); - int milestone = self.getScriptVars().getInt(veteran_deprecated.SCRIPTVAR_SELECTED_MILESTONE); - veteran_deprecated.requestVeteranRewards(self, milestone); - } - - return SCRIPT_CONTINUE; - } - - if (!self.getScriptVars().hasKey(veteran_deprecated.SCRIPTVAR_SELECTED_REWARD)) - { - CustomerServiceLog("veteran", "handleVeteranRewardConfirmed could not find SCRIPTVAR_SELECTED_REWARD for player %TU", self); - veteran_deprecated.cleanupPlayerData(self); - return SCRIPT_CONTINUE; - } - - int rewardIndex = self.getScriptVars().getInt(veteran_deprecated.SCRIPTVAR_SELECTED_REWARD); - int result = veteran_deprecated.givePlayerReward(self, rewardIndex, false); - if (result == veteran_deprecated.GIVE_PLAYER_REWARD_SUCCESS) - { - veteran_deprecated.cleanupPlayerData(self); - sendSystemMessage(self, veteran_deprecated.SID_REWARD_GIVEN); - } - else - { - veteran_deprecated.cleanupPlayerData(self); - sendSystemMessage(self, veteran_deprecated.SID_REWARD_ERROR); - } - - return SCRIPT_CONTINUE; - } - - - public int cmdFlashSpeeder(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - String config = getConfigSetting("GameServer", "flashSpeederReward"); - if (config == null || !config.equals("true")) - { - return SCRIPT_CONTINUE; - } - - int sub_bits = getGameFeatureBits(self); - if (hasObjVar(self, "flash_speeder.eligible")) - { - sub_bits = getIntObjVar(self, "flash_speeder.eligible"); - } - - if (features.isSpaceEdition(self) && utils.checkBit(sub_bits, 3) || features.isJPCollectorEdition(self)) - { - if (!hasObjVar(self, "flash_speeder.granted")) - { - obj_id inv = getObjectInSlot(self, "inventory"); - int free_space = getVolumeFree(inv); - if (free_space < 1) - { - sendSystemMessage(self, new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "flash_speeder_no_inv_space")); - return SCRIPT_CONTINUE; - } - - if (veteran_deprecated.checkFlashSpeederReward(self)) - { - sendSystemMessage(self, new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "flash_speeder_granted")); - } - else - { - sendSystemMessage(self, new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "flash_speeder_grant_failed")); - } - } - else - { - - sui.msgbox(self, self, "@"+ veteran_deprecated.VETERAN_STRING_TABLE + ":flash_speeder_replace_prompt", sui.YES_NO, "msgFlashSpeederConfirmed"); - } - } - else - { - sendSystemMessage(self, new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "flash_speeder_not_eligible")); - } - - return SCRIPT_CONTINUE; - } - - - public int msgFlashSpeederConfirmed(obj_id self, dictionary params) throws InterruptedException - { - String button = params.getString("buttonPressed"); - if (button.equals("Cancel")) - { - return SCRIPT_CONTINUE; - } - - if (getTotalMoney(self) < veteran_deprecated.FLASH_SPEEDER_COST) - { - sendSystemMessage(self, new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "flash_speeder_no_credits")); - return SCRIPT_CONTINUE; - } - - obj_id inv = getObjectInSlot(self, "inventory"); - int free_space = getVolumeFree(inv); - if (free_space < 1) - { - sendSystemMessage(self, new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "flash_speeder_no_inv_space")); - return SCRIPT_CONTINUE; - } - - money.pay(self, money.ACCT_VEHICLE_REPAIRS, veteran_deprecated.FLASH_SPEEDER_COST, "msgFlashSpeederPaid", null); - - return SCRIPT_CONTINUE; - } - - - public int msgFlashSpeederPaid(obj_id self, dictionary params) throws InterruptedException - { - int result = money.getReturnCode(params); - if (result == money.RET_SUCCESS) - { - createObjectInInventoryAllowOverload("object/tangible/deed/vehicle_deed/speederbike_flash_deed.iff", self); - CustomerServiceLog("flash_speeder", "%TU has purchased a new JtL pre-order Flash Speeder.", self); - sendSystemMessage(self, new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "flash_speeder_granted")); - } - else - { - sendSystemMessage(self, new string_id(veteran_deprecated.VETERAN_STRING_TABLE, "flash_speeder_grant_failed")); - } - - return SCRIPT_CONTINUE; - } - - - public int playDelayedClientEffect(obj_id self, dictionary params) throws InterruptedException - { - String clientEffect = params.getString("effect"); - obj_id target = params.getObjId("target"); - - playClientEffectObj(target, clientEffect, target, ""); - - return SCRIPT_CONTINUE; - } - - - public int clearScriptVar(obj_id self, dictionary params) throws InterruptedException - { - String scriptVarName = params.getString("name"); - - utils.removeScriptVar(self, scriptVarName); - - return SCRIPT_CONTINUE; - } - - - public int OnEnterRegion(obj_id self, String planetName, String regionName) throws InterruptedException - { - obj_id pvpRegionController = gcw.getPvpRegionControllerIdByName(self, regionName); - - if (isIdValid(pvpRegionController) && exists(pvpRegionController)) - { - gcw.notifyPvpRegionControllerOfPlayerEnter(pvpRegionController, self); - } - - if (regionName.equals(restuss_event.PVP_REGION_NAME)) - { - - if ((!factions.isImperial(self) && !factions.isRebel(self)) || !factions.isCovert(self) || getLevel(self) < 75) - { - if (getLevel(self) < 75) - { - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_level_low")); - } - else - { - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_not_allowed")); - } - - int attempts = 0; - String enterAttempt = "enterRestussAttempt"; - - if (utils.hasScriptVar(self, enterAttempt)) - { - attempts = utils.getIntScriptVar(self, enterAttempt); - } - - if (attempts > 5) - { - utils.removeScriptVar(self, enterAttempt); - warpPlayer(self, "rori", 5305, 80, 6188, null, 0, 0, 0); - return SCRIPT_CONTINUE; - } - - attempts++; - - utils.setScriptVar(self, enterAttempt, attempts); - return SCRIPT_OVERRIDE; - } - - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_entered")); - - pvpMakeDeclared(self); - utils.setScriptVar(self, factions.IN_ADHOC_PVP_AREA, true); - return SCRIPT_CONTINUE; - } - else if (regionName.startsWith(gcw.PVP_BATTLEFIELD_REGION)) - { - - obj_id controllerOnPlayer = utils.getObjIdScriptVar(self, "battlefield.active"); - - if (!isIdValid(controllerOnPlayer)) - { - - if (utils.hasObjIdBatchScriptVar(pvpRegionController, "battlefield.active_players")) - { - - obj_id[] allPlayers = utils.getObjIdBatchScriptVar(pvpRegionController, "battlefield.active_players"); - if (allPlayers != null && allPlayers.length > 0) - { - boolean found = false; - - for (int i = 0; i < allPlayers.length; ++i) - { - testAbortScript(); - - if (allPlayers[i] == self) - { - utils.setScriptVar(self, "battlefield.active", pvpRegionController); - found = true; - pvp.bfLog(pvpRegionController, "Player "+ getName(self) + "("+self+") Entered the Battlefield and was missing the 'battlefield.active_players' scriptvar. Player was just found and the scriptvar was added."); - break; - } - } - - if (!found) - { - pvp.bfLog(pvpRegionController, "Player "+ getName(self) + "("+self+") Entered the Battlefield and was missing the 'battlefield.active_players' scriptvar. After reviewing the list of players allowed, they were not found. They need to be removed from the Battlefield"); - - } - - } - } - } - - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_entered")); - - pvpMakeDeclared(self); - utils.setScriptVar(self, factions.IN_ADHOC_PVP_AREA, true); - - buff.applyBuff(self, "battlefield_radar_invisibility"); - } - else if (regionName.startsWith(gcw.PVP_PUSHBACK_REGION)) - { - - if (((!factions.isImperial(self) && !factions.isRebel(self)) || getLevel(self) < 75) && !isGod(self)) - { - if (getLevel(self) < 75) - { - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_level_low")); - } - else - { - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_not_allowed")); - } - - String enterAttempt = "enterBattlefieldAttempt"; - int attempts = utils.getIntScriptVar(self, enterAttempt); - - if (attempts > 5) - { - utils.removeScriptVar(self, enterAttempt); - } - else - { - attempts++; - - utils.setScriptVar(self, enterAttempt, attempts); - - playMusic(self, "sound/wall_of_mist_barrier_os.snd"); - - return SCRIPT_OVERRIDE; - } - } - - obj_id controller = gcw.getPushbackControllerByPlayer(self); - - if (isIdValid(controller)) - { - dictionary params = new dictionary(); - - params.put("player", self); - - messageTo(controller, "validateTeamPlayer", params, 1.0f, false); - } - - return SCRIPT_CONTINUE; - } - - else if (regionName.equals("dathomir_fs_village_unpassable")) - { - String config = getConfigSetting("GameServer", "fsWallOfMistEnabled"); - if (config != null) - { - if (config.equals("false")) - { - return SCRIPT_CONTINUE; - } - } - - if (!township.isTownshipEligible(self) || ai_lib.isInCombat( self )) - { - boolean playEffect = false; - int gameTime = getGameTime(); - - if (utils.hasScriptVar(self, "lastTownshipUnpassable")) - { - int lastNotice = utils.getIntScriptVar(self, "lastTownshipUnpassable"); - if (gameTime - 30 > lastNotice) - { - playEffect = true; - } - } - else - { - playEffect = true; - } - - if (playEffect) - { - playMusic(self, "sound/wall_of_mist_barrier_os.snd"); - - string_id sid = null; - if (! fs_quests.isVillageEligible(self)) - { - sid = new string_id("base_player", "fs_village_unavailable"); - } - else if (ai_lib.isInCombat(self)) - { - sid = new string_id("base_player", "fs_village_no_combat"); - } - - if (sid != null) - { - sendSystemMessage(self, sid); - } - - utils.setScriptVar(self, "lastFsUnpassable", gameTime); - } - - return SCRIPT_OVERRIDE; - } - } - else if (regionName.equals("@dathomir_region_names:black_mesa") && hasObjVar(self, "outbreak.usedGate")) - { - buff.applyBuff(self, "death_troopers_no_vehicle"); - } - else if (( regionName.equals("outbreak_infected_area_01") || regionName.equals("outbreak_infected_area_02") || regionName.equals("outbreak_infected_area_03") || regionName.equals("outbreak_infected_area_04") )) - { - if (!isGod(self)) - { - if (needsBlackwingLightInfection(self)) - { - - messageTo(self, "death_troopers_apply_virus", null, 3.0f, false); - } - - if (!buff.hasBuff(self, "death_troopers_no_vehicle")) - { - buff.applyBuff(self, "death_troopers_no_vehicle"); - } - - obj_id currentMount = getMountId(self); - if (isIdValid(currentMount)) - { - sendSystemMessage(self, new string_id("base_player", "dismounting")); - utils.dismountRiderJetpackCheck(self); - if (exists(currentMount)) - { - obj_id petControlDevice = callable.getCallableCD(currentMount); - vehicle.storeVehicle(petControlDevice, self); - } - } - } - } - else - { - region enteredRegion = getRegion(planetName, regionName); - - if (enteredRegion != null && enteredRegion.getPvPType() == regions.PVP_REGION_TYPE_ADVANCED) - { - if ((!factions.isImperial(self) && !factions.isRebel(self)) || !factions.isCovert(self)) - { - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_not_allowed")); - return SCRIPT_OVERRIDE; - } - - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_entered")); - - if (hasObjVar(self, "intChangingFactionStatus")) - { - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_faction_type_change_cancel")); - } - - pvpMakeDeclared(self); - utils.setScriptVar(self, factions.IN_ADHOC_PVP_AREA, true); - return SCRIPT_CONTINUE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnExitRegion(obj_id self, String planetName, String regionName) throws InterruptedException - { - - if (regionName.startsWith(gcw.PVP_BATTLEFIELD_REGION) && !utils.hasScriptVar(self, "battlefield.kicked_out")) - { - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_leaving_battlefield")); - - if (buff.hasBuff(self, "battlefield_communication_run")) - { - return SCRIPT_OVERRIDE; - } - } - - if (regionName.startsWith(gcw.PVP_BATTLEFIELD_REGION)) - { - buff.removeBuff(self, "battlefield_radar_invisibility"); - utils.removeScriptVar(self, factions.IN_ADHOC_PVP_AREA); - } - - if (regionName.startsWith(gcw.PVP_PUSHBACK_REGION)) - { - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_leaving_pushback")); - } - - if (utils.hasScriptVar(self, "battlefield.kicked_out")) - { - utils.removeScriptVar(self, "battlefield.kicked_out"); - } - - if (regionName.equals(restuss_event.PVP_REGION_NAME)) - { - sendSystemMessage(self, restuss_event.SID_PVP_EXIT_MESSAGE); - if (utils.hasScriptVar(self, factions.IN_ADHOC_PVP_AREA)) - { - utils.removeScriptVar(self, factions.IN_ADHOC_PVP_AREA); - } - - return SCRIPT_CONTINUE; - } - else if (regionName.equals("@dathomir_region_names:black_mesa")) - { - if (isGod(self)) - { - sendSystemMessage(self, "[GodMode] Now Leaving the Infected Zone. We hope you enjoyed your visit.", ""); - } - - obj_id building = getTopMostContainer(self); - if (isIdValid(building) && getTemplateName(building).equals("object/building/dathomir/imperial_blackwing_facility.iff")) - { - - if (isGod(self)) - { - sendSystemMessage(self, "[GodMode] Please disregard that previous message as you are clearly still within the Blackwing facility. Be sure to enjoy your infection while you are here.", ""); - } - } - else - { - buff.removeBuff(self, "death_troopers_infection_1"); - buff.removeBuff(self, "death_troopers_infection_2"); - buff.removeBuff(self, "death_troopers_infection_3"); - buff.removeBuff(self, "death_troopers_no_vehicle"); - } - } - else - { - region exitedRegion = getRegion(planetName, regionName); - if (exitedRegion != null && exitedRegion.getPvPType() == regions.PVP_REGION_TYPE_ADVANCED) - { - - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_exited")); - - if (utils.hasScriptVar(self, factions.IN_ADHOC_PVP_AREA)) - { - utils.removeScriptVar(self, factions.IN_ADHOC_PVP_AREA); - } - - return SCRIPT_CONTINUE; - } - } - - return SCRIPT_CONTINUE; - } - - - public boolean setupNovicePilotSkill(obj_id self, String skillName) throws InterruptedException - { - - if (!skillName.startsWith("pilot_")) - { - return true; - } - - if (skillName.equals("pilot_imperial_navy_novice" )) - { - int intAlignedFaction = pvpGetAlignedFaction(self); - if (intAlignedFaction==(370444368)) - { - sendSystemMessage( self, new string_id( "faction_recruiter", "no_rebel_imp_pilots")); - if (!isGod(self)) - { - return false; - } - else - { - sendSystemMessageTestingOnly( self, "GODMODE MSG: You can only acquire this skill BECAUSE you are in god mode"); - } - } - else - { - pvpSetAlignedFaction(self, (-615855020) ); - if (pvpGetType( self ) == PVPTYPE_NEUTRAL) - { - if (!factions.isOnLeave(self)) - { - pvpMakeCovert(self); - } - } - else - { - - } - } - } - else if (skillName.equals("pilot_rebel_navy_novice" )) - { - int intAlignedFaction = pvpGetAlignedFaction(self); - if (intAlignedFaction==(-615855020)) - { - sendSystemMessage( self, new string_id( "faction_recruiter", "no_imp_rebel_pilots")); - if (!isGod(self)) - { - return false; - } - else - { - sendSystemMessageTestingOnly( self, "GODMODE MSG: You can only acquire this skill BECAUSE you are in god mode"); - } - } - else - { - pvpSetAlignedFaction(self, (370444368) ); - if (pvpGetType( self ) == PVPTYPE_NEUTRAL) - { - if (!factions.isOnLeave(self)) - { - pvpMakeCovert(self); - } - } - else - { - - } - } - } - if (!hasObjVar( self, space_flags.SPACE_TRACK_FLAG )) - { - - if (skillName.equals("pilot_imperial_navy_novice")) - { - space_flags.setSpaceTrack( self, space_flags.IMPERIAL_TATOOINE ); - } - else if (skillName.equals("pilot_rebel_navy_novice")) - { - space_flags.setSpaceTrack( self, space_flags.REBEL_TATOOINE ); - } - else - { - space_flags.setSpaceTrack( self, space_flags.PRIVATEER_TATOOINE ); - } - } - return true; - } - - - public boolean allowedBySpaceExpansion(obj_id self, String skillName) throws InterruptedException - { - if (skillName.startsWith("pilot_") || skillName.startsWith("crafting_shipwright_" )) - { - if (!features.isSpaceEdition( self )) - { - - sendSystemMessage( self, new string_id( "skl_use", "need_space_expansion") ); - return false; - } - } - return true; - } - - - public int gmForceCommand(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if ((params == null)||(params.equals(""))) - { - sendSystemMessageTestingOnly(self, "Incorrect syntax. Syntax is /gmForceCommand . You can use 0 instead of a valid object_id if needed. Params are optionsl"); - return SCRIPT_CONTINUE; - } - if (!isIdValid(target)) - { - target = getLookAtTarget(self); - } - - if (!isIdValid(target)) - { - sendSystemMessageTestingOnly(self, "You must target the player you wish to call this command on"); - return SCRIPT_CONTINUE; - - } - String[] strText = split(params, ','); - if (strText.length < 2) - { - sendSystemMessageTestingOnly(self, "Incorrect syntax. Syntax is /gmForceCommand . You can use 0 instead of a valid object_id if needed. Params are optionsl"); - return SCRIPT_CONTINUE; - } - String strCommand = strText[0]; - if (strCommand.equals("gmForceCommand")) - { - sendSystemMessageTestingOnly(self, "You are not permitted to use this command to force this command. Don't do that"); - return SCRIPT_CONTINUE; - } - - String strCommandTarget = strText[1]; - String strParams = ""; - - if (strText.length == 3) - { - strParams = strText[2]; - } - - Long lngId; - try - { - lngId = new Long(strCommandTarget); - } - catch (NumberFormatException err) - { - sendSystemMessageTestingOnly(self, strCommandTarget+" is not a valid number to use. Please retry."); - return SCRIPT_CONTINUE; - } - obj_id objCommandTarget = obj_id.getObjId(lngId.longValue()); - if (isIdValid(objCommandTarget)&&(!exists(objCommandTarget))) - { - sendSystemMessageTestingOnly(self, "That command target does not exist and it is not 0. Object id was "+objCommandTarget); - return SCRIPT_CONTINUE; - - } - - dictionary dctParams = new dictionary(); - dctParams.put("objTarget", objCommandTarget); - int intCommand = getStringCrc(strCommand); - dctParams.put("intCommand", intCommand); - dctParams.put("strParams", strParams); - messageTo(target, "doForcedGmCommand", dctParams, 0, false); - sendSystemMessageTestingOnly(self, "Forcing "+target+" to do command "+ strCommand+" to target "+objCommandTarget+" with Parameters "+strParams); - return SCRIPT_CONTINUE; - } - - - public int doForcedGmCommand(obj_id self, dictionary params) throws InterruptedException - { - int intCommand = params.getInt("intCommand"); - obj_id objTarget = params.getObjId("objTarget"); - String strParams = params.getString("strParams"); - queueCommand(self, intCommand, objTarget, strParams, COMMAND_PRIORITY_DEFAULT); - sendSystemMessageTestingOnly(self, "A GM Forced you to do a command"); - return SCRIPT_CONTINUE; - } - - - public int factionBaseLotRefund(obj_id self, dictionary params) throws InterruptedException - { - int baseLotRefund = params.getInt( "baseLotRefund"); - obj_id playerObject = getPlayerObject(self); - - adjustLotCount( playerObject, (baseLotRefund * -1) ); - - float baseFactionRefund = params.getFloat("baseFactionRefund"); - int baseFaction = params.getInt("baseFaction"); - factions.addFactionStanding( self, baseFaction, baseFactionRefund ); - - if ((int)(baseFactionRefund) > 0) - { - int intBaseFactionRefund = (int)(baseFactionRefund); - sendSystemMessageProse(self, prose.getPackage(new string_id ("faction_perk", "old_fbase_refunded"), baseLotRefund, intBaseFactionRefund)); - } - else - { - sendSystemMessageProse(self, prose.getPackage(new string_id ("faction_perk", "new_old_fbase_refunded"), baseLotRefund)); - } - - return SCRIPT_CONTINUE; - } - - - public int transferMoneyToNamedAccount(obj_id self, dictionary params) throws InterruptedException - { - transferBankCreditsToNamedAccount(self, params.getString("account"), params.getInt("amount"), "transferMoneyToNamedAccount_successCallback", "transferMoneyToNamedAccount_failCallback", params); - return SCRIPT_CONTINUE; - } - - - public int transferMoneyToNamedAccount_successCallback(obj_id self, dictionary params) throws InterruptedException - { - messageTo(params.getObjId("replyTo"), params.getString("successCallback"), params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int transferMoneyToNamedAccount_failCallback(obj_id self, dictionary params) throws InterruptedException - { - messageTo(params.getObjId("replyTo"), params.getString("failCallback"), params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int sendSystemMessageProseAuthoritative(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - debugSpeakMsg (self, "sendSystemMessageProseAuthoritative called with no params"); - return SCRIPT_CONTINUE; - } - - String stf = params.getString("stf"); - String message = params.getString("message"); - obj_id TO = params.getObjId("TO"); - obj_id TT = params.getObjId("TT"); - - prose_package pp = new prose_package(); - string_id msg = new string_id (stf, message); - pp = prose.setStringId(pp, msg); - pp = prose.setTO(pp, TO); - pp = prose.setTT(pp, TT); - - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - - public int OnRecapacitated(obj_id self) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", self); - broadcastMessage("handleSawRecapacitation", params); - - final int aggroImmuneDuration = 12; - setAggroImmuneDuration(self, aggroImmuneDuration); - debugSpeakMsgc(aiLoggingEnabled(self), self, "AggroImmune("+ aggroImmuneDuration + "s)"); - utils.removeScriptVar(self, "incap.timeStamp"); - combat.clearCombatDebuffs(self); - - static_item.validateWornEffects(self); - - reverse_engineering.checkPowerUpReApply(self); - - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - if (utils.isProfession(self, utils.SMUGGLER)) - { - messageTo(self, "applySmugglingBonuses", null, 1.0f, false); - } - - if (utils.isProfession(self, utils.FORCE_SENSITIVE) && getLevel(self) > 3) - { - if (!buff.isInStance(self) && !buff.isInFocus(self)) - { - messageTo(self, "applyJediStance", null, 1.0f, false); - } - } - - if (factions.isInAdhocPvpArea(self)) - { - pvpMakeDeclared(self); - } - - return SCRIPT_CONTINUE; - } - - - public int handleInstanceTimeRemainingMessage(obj_id self, dictionary params) throws InterruptedException - { - String message = params.getString("message"); - sendSystemMessageTestingOnly(self, message); - return SCRIPT_CONTINUE; - } - - - public int setRespecVersion(obj_id self, dictionary params) throws InterruptedException - { - respec.setRespecVersion(self); - return SCRIPT_CONTINUE; - } - - - public int receiveCreditForKill(obj_id self, dictionary params) throws InterruptedException - { - String creatureName = params.getString("creatureName"); - if (creatureName != null && !creatureName.equals("")) - { - location creatureLoc = params.getLocation("location"); - location playerLoc = getLocation(self); - - if (!playerLoc.area.equals(creatureLoc.area)) - { - return SCRIPT_CONTINUE; - } - - String col_faction = params.getString("col_faction"); - int col_difficulty = params.getInt("difficultyClass"); - if (col_faction != null && !col_faction.equals("")) - { - - String[] col_factionArray = split(col_faction, ','); - for (int i = 0; i < col_factionArray.length; i++) - { - testAbortScript(); - if (col_faction.equals("rebel")) - { - if (col_difficulty == 0) - { - modifyCollectionSlotValue(self, "kill_rebel_01", 1); - } - else - { - modifyCollectionSlotValue(self, "kill_rebel_boss_01", 1); - } - - } - if (col_faction.equals("imperial")) - { - if (col_difficulty == 0) - { - modifyCollectionSlotValue(self, "kill_imperial_01", 1); - } - else - { - modifyCollectionSlotValue(self, "kill_imperial_boss_01", 1); - } - } - } - } - - if (getDistance( getLocation(self), creatureLoc ) <= xp.MAX_DISTANCE) - { - badge.checkForCombatTargetBadge(self, creatureName); - - String[] slotNames = getAllCollectionSlotsInCategory("kill_"+ creatureName); - - if (slotNames == null || slotNames.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < slotNames.length; ++i) - { - testAbortScript(); - if (!hasCompletedCollectionSlot(self, slotNames[i])) - { - modifyCollectionSlotValue(self, slotNames[i], 1); - } - } - } - - obj_id target = params.getObjId("target"); - - if (isValidId(target)) - { - if (hasObjVar(target, gcw.GCW_PARTICIPATION_FLAG)) - { - obj_id parent = trial.getParent(target); - if (isIdValid(parent)) - { - trial.addNonInstanceFactionParticipant(self, parent); - } - } - } - } - - if (utils.hasScriptVar(self,"currentBounty") && utils.hasScriptVar(self,"currentBountyValue")) - { - obj_id target = params.getObjId("target"); - obj_id storedTarget = utils.getObjIdScriptVar(self,"currentBounty"); - - if (storedTarget == target) - { - int amount = utils.getIntScriptVar(self, "currentBountyValue"); - bounty_hunter.awardBounty(self, creatureName,amount); - } - } - - return SCRIPT_CONTINUE; - } - - - public int HandleSetCoverCharge(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - String strAmount = sui.getInputBoxText(params); - int amount = utils.stringToInt(strAmount); - - if (amount > 0) - { - performance.covercharge(self, amount); - } - - return SCRIPT_CONTINUE; - } - - - public int HandleCoverCharge(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - obj_id audience = sui.getPlayerId(params); - int charge = utils.getIntScriptVar(audience, performance.VAR_PERFORM_PAY_WAIT); - if (bp == 0) - { - if (money.hasFunds(audience, money.MT_TOTAL, charge)) - { - utils.removeScriptVar(audience, performance.VAR_PERFORM_PAY_WAIT); - utils.setScriptVar(audience, performance.VAR_PERFORM_PAY_AGREE, charge); - money.pay(audience, money.ACCT_PERFORM_ESCROW, charge, "handlePayment", null); - - if (utils.hasScriptVar(audience, "dancerID")) - { - obj_id targetDancer = utils.getObjIdScriptVar(audience, "dancerID"); - - String audienceName = getFirstName(audience); - if ((audienceName == null) || (audienceName.equals(""))) - { - audienceName = getPlayerName(audience); - } - prose_package dancerProse = new prose_package(); - prose.setTU(dancerProse, audienceName); - prose.setDI(dancerProse, charge); - prose.setStringId(dancerProse, COVERCHARGE_DANCER_MESSAGE); - sendSystemMessageProse(targetDancer, dancerProse); - - utils.removeScriptVar(audience, "dancerID"); - } - } - else - { - sendSystemMessage(audience, performance.SID_CC_NO_FUNDS); - utils.removeScriptVar(audience, performance.VAR_PERFORM_PAY_WAIT); - performance.stopListen(audience); - performance.stopWatch(audience); - - if (utils.hasScriptVar(audience, "dancerID")) - { - utils.removeScriptVar(audience, "dancerID"); - } - - } - } - else - { - utils.removeScriptVar(audience, performance.VAR_PERFORM_PAY_WAIT); - utils.setScriptVar(audience, performance.VAR_PERFORM_PAY_DISAGREE, charge); - performance.stopListen(audience); - performance.stopWatch(audience); - - if (utils.hasScriptVar(audience, "dancerID")) - { - utils.removeScriptVar(audience, "dancerID"); - } - } - return SCRIPT_CONTINUE; - } - - - public int messageUpdateMissionCriticalObjects(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] addObjects = params.getObjIdArray("addObjects"); - obj_id[] removeObjects = params.getObjIdArray("removeObjects"); - - if (addObjects != null && addObjects.length > 0) - { - for (int i=0; i 0) - { - for (int i=0; i 0 && listOfQuestsThatMustBeCompleted != null && listOfQuestsThatMustBeCompleted.length() > 0) - { - - String[] completedQuestList = split(listOfQuestsThatMustBeCompleted, ','); - - boolean grantQuest = completedQuestList.length > 0; - - for (int i = 0; i < completedQuestList.length && grantQuest; ++i) - { - testAbortScript(); - String quest = completedQuestList[i]; - if (!groundquests.isValidQuestName(quest) || !groundquests.hasCompletedQuest(self, quest)) - { - grantQuest = false; - } - } - - if (groundquests.isValidQuestName(conditionalQuestToGrant) && grantQuest) - { - groundquests.requestGrantQuest(self, conditionalQuestToGrant); - } - } - - if (groundquests.isQuestVisible(questCrc)) - { - play2dNonLoopingSound(self, groundquests.MUSIC_QUEST_COMPLETED); - } - - String questString = questGetQuestName(questCrc); - int tableRow = dataTableSearchColumnForString(questString, "questName", collection.QUEST__COMPLETED_COLLECTIONS); - - if (tableRow > -1) - { - collection.grantQuestBasedCollections(questString, self); - } - - smuggler.removeFromBountyTerminal(self, questCrc, false); - - return SCRIPT_CONTINUE; - } - - - public int OnQuestCleared(obj_id self, int questCrc) throws InterruptedException - { - String factionName = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestPenaltyFactionName); - int factionAmount = groundquests.getQuestIntDataEntry(questCrc, groundquests.dataTableColumnQuestPenaltyFactionAmount); - - LOG("QUEST", "Quest "+ questCrc + " cleared!"); - - groundquests.applyQuestPenalty(self, factionName, factionAmount); - smuggler.removeFromBountyTerminal(self, questCrc, true); - - return SCRIPT_CONTINUE; - } - - - public int OnRequestStaticItemData(obj_id self, String itemName) throws InterruptedException - { - dictionary itemData = static_item.getMergedItemDictionary(itemName); - - if (itemData != null) - { - String[] keysStringVector = itemData.keysStringVector(); - String[] valuesStringVector = itemData.valuesStringVector(); - sendStaticItemDataToPlayer(self, keysStringVector, valuesStringVector); - } - - return SCRIPT_CONTINUE; - } - - - public int handleClientLogin(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - int[] quests = questGetAllActiveQuestIds(self); - for (int i = 0; i < quests.length; ++i) - { - testAbortScript(); - int questCrc = quests[i]; - - Vector objectsToTellClientAbout = new Vector(); - objectsToTellClientAbout.setSize(0); - String item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardLootName); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardLootName2); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardLootName3); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName2); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName3); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName4); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName5); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName6); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName7); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName8); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName9); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - item = groundquests.getQuestStringDataEntry(questCrc, groundquests.dataTableColumnQuestRewardExclusiveLootName10); - if (item != null) - { - utils.addElement(objectsToTellClientAbout, item); - } - - for (int j = 0; j < objectsToTellClientAbout.size(); ++j) - { - testAbortScript(); - String itemName = ((String)(objectsToTellClientAbout.get(j))); - if (itemName != null && !itemName.equals("")) - { - dictionary itemData = static_item.getMergedItemDictionary(itemName); - if (itemData != null) - { - String[] keysStringVector = itemData.keysStringVector(); - String[] valuesStringVector = itemData.valuesStringVector(); - sendStaticItemDataToPlayer(self, keysStringVector, valuesStringVector); - } - } - } - } - - obj_id building = getTopMostContainer(self); - if (isIdValid(building) && getTemplateName(building).equals("object/building/dathomir/imperial_blackwing_facility.iff")) - { - if (needsBlackwingLightInfection(self)) - { - buff.applyBuff(self, "death_troopers_infection_1"); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnGetStaticItemsAttributes(obj_id self, String staticItemName, String[] names, String[] attribs) throws InterruptedException - { - if ((names == null) || (attribs == null) || (names.length != attribs.length)) - { - return SCRIPT_CONTINUE; - } - static_item.getAttributes(self, staticItemName, names, attribs); - - return SCRIPT_CONTINUE; - } - - - public int handleSmugglerFenceAbility(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - smuggler.showSellJunkSui(self, self, true, true); - return SCRIPT_CONTINUE; - } - - - public int handleSellJunkSui(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - int bp = sui.getIntButtonPressed(params); - - obj_id[] junk = utils.getObjIdBatchScriptVar(player, smuggler.SCRIPTVAR_JUNK_IDS); - - boolean reshowSui = true; - if (junk.length < 1) - { - reshowSui = false; - } - - boolean fence = utils.getBooleanScriptVar(self, "fence"); - - smuggler.cleanupSellJunkSui(player); - - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - else if (bp == sui.BP_REVERT) - { - if (idx >= 0 && idx <= junk.length - 1) - { - if ((junk != null) || (junk.length > 0)) - { - openExamineWindow(player, junk[idx]); - } - } - - if (fence) - { - smuggler.showSellJunkSui(player, self, true, false); - } - else - { - smuggler.showSellJunkSui(player, self, false, false); - } - return SCRIPT_CONTINUE; - } - else - { - - if (idx < 0) - { - if (reshowSui) - { - smuggler.showSellJunkSui(self, self, true, true); - } - - return SCRIPT_CONTINUE; - } - - if ((junk == null) || (junk.length == 0)) - { - return SCRIPT_CONTINUE; - } - - if (idx > junk.length - 1) - { - if (reshowSui) - { - smuggler.showSellJunkSui(self, self, true, true); - } - - return SCRIPT_CONTINUE; - } - - smuggler.sellJunkItem(player, junk[idx], fence, reshowSui); - } - return SCRIPT_CONTINUE; - } - - - public int handleSoldJunk(obj_id self, dictionary params) throws InterruptedException - { - blog("base_player.handleSoldJunk() - init"); - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId(money.DICT_TARGET_ID); - if (!isIdValid(player)) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer.handleSoldJunk() - Player: "+self+" cannot sell an item because the junk dealer failed to send a valid obj_id."); - return SCRIPT_CONTINUE; - } - - obj_id item = params.getObjId("item"); - if (!isIdValid(item)) - { - CustomerServiceLog("Junk_Dealer: ", "junk_dealer.handleSoldJunk() - Player: "+self+" cannot sell an item because the item was found to be invalid."); - return SCRIPT_CONTINUE; - } - - boolean fence = params.getBoolean("fence"); - blog("base_player.handleSoldJunk() - fence: "+fence); - - int retCode = params.getInt(money.DICT_CODE); - - if (retCode == money.RET_FAIL) - { - prose_package ppNoSale = prose.getPackage(smuggler.PROSE_NO_SALE, self, item); - if (fence) - { - ppNoSale = prose.getPackage(smuggler.PROSE_NO_SALE_FENCE, self, item); - } - sendSystemMessageProse(player, ppNoSale); - - return SCRIPT_CONTINUE; - } - - int price = params.getInt("price"); - - prose_package ppSoldJunk = prose.getPackage(smuggler.PROSE_SOLD_JUNK, item, price); - if (fence) - { - ppSoldJunk = prose.getPackage(smuggler.PROSE_SOLD_JUNK_FENCE, item, price); - } - sendSystemMessageProse(player, ppSoldJunk); - - setObjVar(item, smuggler.BUYBACK_OBJ_SOLD, getGameTime()); - smuggler.moveBuyBackObjectIntoContainer(player, item, price); - - CustomerServiceLog("Junk_Dealer: ", "junk_dealer.handleSoldJunk() - Player: "+self+" has sold item: "+item+" and the item has been marked sold. The item is about to be moved to the buy back container."); - - boolean reshowSui = params.getBoolean("reshowSui"); - - if (reshowSui && fence) - { - smuggler.showSellJunkSui(player, self, true, false); - } - else if (reshowSui && !fence) - { - smuggler.showSellJunkSui(player, self, false, false); - } - return SCRIPT_CONTINUE; - } - - - public int OnSkillModsChanged(obj_id self, String[] modNames, int[] modValues) throws InterruptedException - { - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - for (int intI = 0; intI < modNames.length; intI++) - { - testAbortScript(); - if ((modNames[intI].startsWith("constitution"))||(modNames[intI].startsWith("stamina"))) - { - skill.recalcPlayerPools(self, false); - return SCRIPT_CONTINUE; - } - - if (modNames[intI].startsWith("movement_resist")) - { - messageTo(self, "check_movement_immunity", null, 0.1f, false); - } - } - return SCRIPT_CONTINUE; - } - - - public int handlePlayerBountyEngagement(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = params.getObjId("target"); - - pvpSetPermanentPersonalEnemyFlag(self, target); - - messageTo(self, "handlePlayerBountyTimeout", params, bounty_hunter.BOUNTY_COLLECT_TIME_LIMIT, true); - - return SCRIPT_CONTINUE; - } - - - public int handlePlayerBountyTimeout(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = params.getObjId("target"); - int id = params.getInt("id"); - - if (utils.hasScriptVar(self, "bounty.id")) - { - int bounty_id = utils.getIntScriptVar(self, "bounty.id"); - - if (bounty_id != id) - { - return SCRIPT_CONTINUE; - } - } - - if (pvpHasPersonalEnemyFlag(self, target)) - { - pvpRemovePersonalEnemyFlags(self, target); - sendSystemMessage(self, new string_id("bounty_hunter", "time_expired")); - } - - utils.removeScriptVarTree(self, "bounty"); - - return SCRIPT_CONTINUE; - } - - - public int handleAwardedBountyCheck(obj_id self, dictionary params) throws InterruptedException - { - - if (utils.hasScriptVar(self,"currentBounty")) - { - utils.removeScriptVar(self,"currentBounty"); - } - if (utils.hasScriptVar(self,"currentBountyValue")) - { - utils.removeScriptVar(self,"currentBountyValue"); - } - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId(money.DICT_TARGET_ID); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int retCode = params.getInt(money.DICT_CODE); - - if (retCode == money.RET_FAIL) - { - - prose_package pp = new prose_package (); - pp.stringId = new string_id ("bounty_hunter", "no_reward_possible"); - sendSystemMessageProse( player, pp ); - return SCRIPT_CONTINUE; - } - - int amount = params.getInt("amount"); - String creatureName = params.getString("creatureName"); - - prose_package pp = new prose_package (); - pp.stringId = new string_id ("bounty_hunter", "reward"); - pp.digitInteger = amount; - pp.other.set (creatureName); - sendSystemMessageProse( player, pp ); - - return SCRIPT_CONTINUE; - } - - - public int handleAwardedPlayerBounty(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = params.getObjId("target"); - int amount = params.getInt("bounty"); - - int retCode = params.getInt(money.DICT_CODE); - if (retCode == money.RET_FAIL) - { - sendSystemMessage(self, new string_id("bounty_hunter", "player_bounty_reward_fail")); - CustomerServiceLog("bounty", "%TU has defeated %TT but an error occured during the bounty ("+ amount + " credits) payout!", self, target); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("bounty", "%TU has defeated %TT and collected a bounty worth "+ amount + " credits", self, target); - - return SCRIPT_CONTINUE; - } - - - public int handleSurveyToolbarSetup(obj_id self, dictionary params) throws InterruptedException - { - obj_id objInv = utils.getInventoryContainer(self); - createObject("object/tangible/survey_tool/survey_tool_mineral.iff", objInv, ""); - newbieTutorialSetToolbarElement(self, 10, "/survey"); - - return SCRIPT_CONTINUE; - - } - - - public int factionBaseUnitRefund(obj_id self, dictionary params) throws InterruptedException - { - - debugServerConsoleMsg( null, "+++ base_player.factionBaseUnitRefund +++ entered message handler"); - - if (hasObjVar(self,"factionBaseCount" )) - { - - int factionBaseCount = getIntObjVar(self,"factionBaseCount"); - int updatedFactionBaseCount = factionBaseCount-1; - - if (updatedFactionBaseCount > 0) - { - setObjVar(self,"factionBaseCount",updatedFactionBaseCount); - } - else - { - removeObjVar(self,"factionBaseCount"); - } - - if (updatedFactionBaseCount == player_structure.MAX_BASE_COUNT -1) - { - sendSystemMessage(self, SID_CAN_PLACE_ONE_BASE); - } - else - { - sendSystemMessageProse(self, prose.getPackage(new string_id ("faction_perk", "faction_base_unit_refunded"), (player_structure.MAX_BASE_COUNT-updatedFactionBaseCount))); - } - - } - - return SCRIPT_CONTINUE; - } - - - public int OnSkillTemplateChanged(obj_id self, String skillTemplateName, boolean clientSelected) throws InterruptedException - { - if (skillTemplateName == null || skillTemplateName.equals("") || skillTemplateName.equals("a")) - { - if (hasObjVar(self, "clickRespec.tokenId")) - { - removeObjVar(self, "clickRespec.tokenId"); - } - - if (hasObjVar(self, "npcRespec.inProgress")) - { - removeObjVar(self, "npcRespec.inProgress"); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar( self, "clickRespec") && !hasObjVar(self, "npcRespec.inProgress")) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "npcRespec.inProgress")) - { - respec.handleNpcRespec(self, skillTemplateName); - - respec.setRespecVersion(self); - - return SCRIPT_CONTINUE; - } - else if (hasObjVar(self, "clickRespec.tokenId")) - { - obj_id token = getObjIdObjVar(self, "clickRespec.tokenId"); - - if (hasObjVar(self,"clickRespec.oldTemplate")) - { - String oldTemplate = getStringObjVar(self, "clickRespec.oldTemplate"); - - if (oldTemplate.equals(getSkillTemplate(self))) - { - removeObjVar( self, "clickRespec"); - detachScript(self, "systems.respec.click_combat_respec"); - return SCRIPT_CONTINUE; - } - - static_item.decrementStaticItem(token); - - removeObjVar( self, "clickRespec.tokenId"); - } - - } - - boolean withItems = true; - if (hasObjVar(self, "clickRespec.cts")) - { - withItems = false; - } - - respec.earnProfessionSkills(self, skillTemplateName, withItems); - - return SCRIPT_CONTINUE; - } - - - public void givePublishGift(obj_id self) throws InterruptedException - { - final String OBJVAR_PUBLISH_GIFT = "publish_gift"; - final String GIFT_DATATABLE = "datatables/veteran_rewards/publish_gift.iff"; - - int currentBD = getCurrentBirthDate(); - int playerBD = getPlayerBirthDate(self); - - if (playerBD < 0) - { - return; - } - - if ((currentBD - playerBD) < 10) - { - return; - } - - if (isInTutorialArea(self)) - { - return; - } - - int old_publish = -1; - if (hasObjVar(self, OBJVAR_PUBLISH_GIFT)) - { - old_publish = getIntObjVar(self, OBJVAR_PUBLISH_GIFT); - } - - int[] publish_numbers = dataTableGetIntColumn(GIFT_DATATABLE, "PUBLISH"); - if (publish_numbers == null || publish_numbers.length == 0) - { - return; - } - - int last_publish = -1; - Vector gifts = new Vector(); - - for (int i=0; i < publish_numbers.length; i++) - { - testAbortScript(); - if (publish_numbers[i] > last_publish) - { - last_publish = publish_numbers[i]; - - gifts = new Vector(); - gifts.addElement(dataTableGetString(GIFT_DATATABLE, i, "ITEM")); - } - else if (publish_numbers[i] == last_publish) - { - gifts.addElement(dataTableGetString(GIFT_DATATABLE, i, "ITEM")); - } - } - - if (gifts == null || gifts.size() == 0) - { - return; - } - - if (old_publish >= last_publish) - { - return; - } - - obj_id inv = utils.getInventoryContainer(self); - Vector objects = new Vector(); - - boolean noGift = false; - - for (int i=0; i < gifts.size(); i++) - { - testAbortScript(); - String item = (String)gifts.get(i); - - if (item.equals("none")) - { - noGift = true; - continue; - } - - obj_id new_gift = static_item.createNewItemFunction(item, inv); - - if (isIdValid(new_gift)) - { - objects.addElement(new_gift); - CustomerServiceLog("grantGift", "%TU has received the gift(s) for Publish "+ last_publish + ". Item given was "+ item + ". Item OID was "+ new_gift, self); - } - } - - obj_id[] object_array = utils.toStaticObjIdArray(objects); - - if ((object_array == null || object_array.length == 0)) - { - if (noGift) - { - setObjVar(self, OBJVAR_PUBLISH_GIFT, last_publish); - } - - return; - } - - sendSystemMessage(self, new string_id("base_player", "received_gift")); - - setObjVar(self, OBJVAR_PUBLISH_GIFT, last_publish); - - showLootBox(self, object_array); - - } - - - public void respecNewEntertainerSkills(obj_id self) throws InterruptedException - { - String template = getSkillTemplate(self); - - if (template == null) - { - return; - } - - if (!template.equals("entertainer_2a")) - { - return; - } - - String oldSkills = dataTableGetString(skill_template.TEMPLATE_TABLE, "entertainer_2a", "template"); - String[] oldSkillList = split(oldSkills, ','); - - if (oldSkillList == null || oldSkillList.length == 0) - { - return; - } - - int oldSkillCount = 0; - float oldSkillPct = 0.0f; - - for (int i = 0; i < oldSkillList.length; i++) - { - testAbortScript(); - if (hasSkill(self, oldSkillList[i])) - { - oldSkillCount++; - } - } - - oldSkillPct = (float)oldSkillCount / (float)oldSkillList.length; - - skill.revokeAllProfessionSkills(self); - - dictionary d = new dictionary(); - d.put("oldSkillPct", oldSkillPct); - - messageTo(self, "finishEntertainerRespec", d, 1.0f, true); - } - - - public void respecNewCrafterSkills(obj_id self) throws InterruptedException - { - String template = getSkillTemplate(self); - - if (template == null) - { - return; - } - - if (!template.startsWith("trader_1")) - { - return; - } - - float pctDone = respec.getPercentageCompletion(self, template); - - String newTemplate = getCorrectTraderTemplate(template); - - skill.revokeAllProfessionSkills(self); - - setSkillTemplate(self, newTemplate); - respec.setPercentageCompletion(self, newTemplate, pctDone, true); - - skill.recalcPlayerPools(self, true); - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - } - - - public String getCorrectTraderTemplate(String template) throws InterruptedException - { - if (template.endsWith("1a")) - { - return "trader_0a"; - } - - if (template.endsWith("1b")) - { - return "trader_0b"; - } - - if (template.endsWith("1c")) - { - return "trader_0c"; - } - - if (template.endsWith("1d")) - { - return "trader_0d"; - } - - return "trader_0a"; - } - - public int finishEntertainerRespec(obj_id self, dictionary params) throws InterruptedException - { - float oldSkillPct = params.getFloat("oldSkillPct"); - - String newSkills = dataTableGetString(skill_template.TEMPLATE_TABLE, "entertainer_1a", "template"); - String[] newSkillList = split(newSkills, ','); - - int newSkillCount = (int)Math.ceil(oldSkillPct * (float)newSkillList.length); - - setSkillTemplate(self, "entertainer_1a"); - - for (int i = 0; i < newSkillCount; i++) - { - testAbortScript(); - skill.grantSkillToPlayer(self, newSkillList[i]); - } - - if (newSkillCount < newSkillList.length) - { - setWorkingSkill(self, newSkillList[newSkillCount]); - } - - skill.recalcPlayerPools(self, true); - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - return SCRIPT_CONTINUE; - } - - - public int handleSetBounty(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "setbounty.killer")) - { - return SCRIPT_CONTINUE; - } - - obj_id killer = utils.getObjIdScriptVar(self, "setbounty.killer"); - utils.removeScriptVar(self, "setbounty.killer"); - - int amount = utils.stringToInt(sui.getInputBoxText(params)); - - if (amount < 0) - { - sendSystemMessage(self, new string_id("bounty_hunter", "setbounty_invalid_number")); - bounty_hunter.showSetBountySUI(self, killer); - - return SCRIPT_CONTINUE; - } - - if (amount > bounty_hunter.MAX_BOUNTY_SET) - { - sendSystemMessage(self, new string_id("bounty_hunter", "setbounty_cap")); - amount = bounty_hunter.MAX_BOUNTY_SET; - } - - if (amount < bounty_hunter.MIN_BOUNTY_SET) - { - sendSystemMessage(self, new string_id("bounty_hunter", "setbounty_too_little")); - bounty_hunter.showSetBountySUI(self, killer); - - return SCRIPT_CONTINUE; - } - - if (hasObjVar(killer, "bounty.amount")) - { - int bounty = getIntObjVar(killer, "bounty.amount"); - if (bounty >= bounty_hunter.MAX_BOUNTY) - { - sendSystemMessage(self, new string_id("bounty_hunter", "max_bounty")); - return SCRIPT_CONTINUE; - } - else if ((bounty + amount) > bounty_hunter.MAX_BOUNTY) - { - amount = (bounty + amount) - bounty_hunter.MAX_BOUNTY; - } - } - - int total = getTotalMoney(self); - - if (amount > total) - { - sendSystemMessage(self, new string_id("bounty_hunter", "setbounty_too_much")); - bounty_hunter.showSetBountySUI(self, killer); - - return SCRIPT_CONTINUE; - } - - dictionary d = new dictionary(); - d.put("killer", killer); - d.put("amt", amount); - - money.pay(self, money.ACCT_BOUNTY, amount, "handleSetBountyTransaction", d, true); - - return SCRIPT_CONTINUE; - } - - - public int handleSetBountyTransaction(obj_id self, dictionary params) throws InterruptedException - { - int code = money.getReturnCode(params); - - if (code == money.RET_FAIL) - { - return SCRIPT_CONTINUE; - } - - obj_id killer = params.getObjId("killer"); - int amount = params.getInt("amt"); - - int bounty = 0; - - if (hasObjVar(killer, "bounty.amount")) - { - bounty = getIntObjVar(killer, "bounty.amount"); - } - - bounty += amount; - - if (bounty >= 10000) - { - setJediBountyValue(killer, bounty); - } - - setObjVar(killer, "bounty.amount", bounty); - - CustomerServiceLog("bounty", "%TU has taken a bounty of "+ amount + " credits out on %TT", self, killer); - - return SCRIPT_CONTINUE; - } - - - public int handleBountyMissionIncomplete(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = params.getObjId("target"); - - removeJediBounty(target, self); - - obj_id mission = bounty_hunter.getBountyMission(self, target); - - if (isIdValid(mission)) - { - sendSystemMessage(self, new string_id("bounty_hunter", "bounty_incomplete")); - endMission(mission); - } - - return SCRIPT_CONTINUE; - } - - - public int handleUpdateBountyMissionTime(obj_id self, dictionary params) throws InterruptedException - { - int gameTime = params.getInt("gameTime"); - int lastMission = 0; - - if (hasObjVar(self, "bounty.lastMissionTime")) - { - lastMission = getIntObjVar(self, "bounty.lastMissionTime"); - } - - if (lastMission < gameTime) - { - setObjVar(self, "bounty.lastMissionTime", gameTime); - } - - return SCRIPT_CONTINUE; - } - - - public int handleBountyMissionTimeout(obj_id self, dictionary params) throws InterruptedException - { - int gameTime = getGameTime(); - int lastMission = 0; - - if (hasObjVar(self, "bounty.lastMissionTime")) - { - lastMission = getIntObjVar(self, "bounty.lastMissionTime"); - } - - if ((gameTime - lastMission) > bounty_hunter.BOUNTY_MISSION_TIME_LIMIT) - { - obj_id[] hunters = getJediBounties(self); - - if (hunters != null && hunters.length > 0) - { - for (int i = 0; i < hunters.length; i++) - { - testAbortScript(); - dictionary d = new dictionary(); - d.put("target", self); - - messageTo(hunters[i], "handleBountyMissionIncomplete", d, 0.0f, true); - } - } - - removeAllJediBounties(self); - removeObjVar(self, "bounty.lastMissionTime"); - } - - return SCRIPT_CONTINUE; - } - - - public boolean performCriticalHeal(obj_id self) throws InterruptedException - { - int[] buffs = buff.getAllBuffs(self); - - if (buffs == null || buffs.length == 0) - { - return false; - } - - for (int i = 0; i= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - if (utils.hasScriptVar(self, "storytellerAssistantName")) - { - String storytellerAssistantName = utils.getStringScriptVar(self, "storytellerAssistantName"); - names[idx] = "storyteller_assistant_name"; - attribs[idx] = storytellerAssistantName; - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - return super.OnGetAttributes(self, player, names, attribs); - - } - - - public int cmdGetGalaxyMessage(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id planetId = getPlanetByName("tatooine"); - if (!isIdNull(planetId)) - { - if (hasObjVar(planetId, "galaxyMessage")) - { - String strGalaxyMessage = "\\#FF0000"+utils.getStringObjVar(planetId, "galaxyMessage")+"\\#FFFFFF"; - sendConsoleMessage(self, strGalaxyMessage); - } - else - { - String strGalaxyMessage = "\\#FF0000"+"Welcome to Star Wars Galaxies"+"\\#FFFFFF"; - sendConsoleMessage(self, strGalaxyMessage); - } - - boolean warden = isWarden(self); - if (warden || (getGodLevel(self) >= 10)) - { - String strGalaxyMessage = "\\#FF0000"; - if (!warden) - { - strGalaxyMessage += "Displaying warden MOTD to you even though you are not a warden, because you are of the appropriate god level:\n"; - } - - if (hasObjVar(planetId, "galaxyWardenMessage")) - { - strGalaxyMessage += utils.getStringObjVar(planetId, "galaxyWardenMessage"); - } - else - { - strGalaxyMessage += "Welcome warden"; - } - - strGalaxyMessage += "\\#FFFFFF"; - sendConsoleMessage(self, strGalaxyMessage); - } - } - else - { - sendConsoleMessage(self, "Welcome to Star Wars Galaxies"); - } - return SCRIPT_CONTINUE; - } - - - public int myCityMotdResponse(obj_id self, dictionary params) throws InterruptedException - { - String city_motd = params.getString("city_motd"); - if (city_motd != null && city_motd.length() > 0) - { - sendConsoleMessage(self, city_motd + "\\#DFDFDF"); - } - - utils.setScriptVar(self, "recieved_city_motd", 1); - return SCRIPT_CONTINUE; - } - - - public int stampDungeonArea(obj_id self, dictionary params) throws InterruptedException - { - String dungeon_area = params.getString("buildout_area"); - if (dungeon_area.equals("invalid")) - { - return SCRIPT_CONTINUE; - } - - int buildout_row = params.getInt("buildout_row"); - if (buildout_row == -1) - { - return SCRIPT_CONTINUE; - } - - setObjVar(self, space_dungeon.VAR_BUILDOUT_AREA, dungeon_area); - setObjVar(self, space_dungeon.VAR_BUILDOUT_ROW, buildout_row); - return SCRIPT_CONTINUE; - } - - - public int removeDungeonArea(obj_id self, dictionary params) throws InterruptedException - { - String dungeon_area = params.getString("buildout_area"); - if (dungeon_area.equals("invalid")) - { - return SCRIPT_CONTINUE; - } - - int buildout_row = params.getInt("buildout_row"); - if (buildout_row == -1) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, space_dungeon.VAR_BUILDOUT_AREA) || getStringObjVar(self, space_dungeon.VAR_BUILDOUT_AREA) != dungeon_area) - { - return SCRIPT_CONTINUE; - } - - removeObjVar(self, space_dungeon.VAR_BUILDOUT_AREA); - removeObjVar(self, space_dungeon.VAR_BUILDOUT_ROW); - - return SCRIPT_CONTINUE; - } - - - public int handleStopDanceMessage(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar(self, "stopDanceMessage"); - return SCRIPT_CONTINUE; - } - - - public int onGuildCreateTerminalDataObject(obj_id self, dictionary params) throws InterruptedException - { - - boolean hasTerminal = utils.playerHasItemByTemplateInDataPad(self, guild.STR_GUILD_REMOTE_DEVICE); - - if (!hasTerminal) - { - obj_id pDataPad = utils.getPlayerDatapad(self); - createObjectOverloaded(guild.STR_GUILD_REMOTE_DEVICE, utils.getPlayerDatapad(self)); - - string_id stringMessage = new string_id("guild", "datapad_terminal_created"); - - sendSystemMessage(self, stringMessage); - } - return SCRIPT_CONTINUE; - } - - - public int applyMountBuff(obj_id self, dictionary params) throws InterruptedException - { - obj_id playerCurrentMount = getMountId(self); - if (isIdValid(playerCurrentMount)) - { - vehicle.applyVehicleBuffs(self, playerCurrentMount); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDailyMissionReset(obj_id self, dictionary params) throws InterruptedException - { - missions.clearDailyObjVars(self); - - return SCRIPT_CONTINUE; - } - - - public int cmdMeditate(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (getPosture(self) != POSTURE_SITTING) - { - sendSystemMessage(self, new string_id("jedi_spam", "meditate_not_sitting")); - return SCRIPT_CONTINUE; - } - - stealth.checkForAndMakeVisibleNoRecourse(self); - - if (getState(self, STATE_MEDITATE) == 1) - { - sendSystemMessage(self, new string_id("jedi_spam", "already_in_meditative_state")); - return SCRIPT_CONTINUE; - } - - meditation.startMeditation(self); - - return SCRIPT_CONTINUE; - } - - public int cmdMeditateFail(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - sendSystemMessage(self, meditation.SID_MED_FAIL); - return SCRIPT_CONTINUE; - } - - - public int handleMeditationTick(obj_id self, dictionary params) throws InterruptedException - { - if (!meditation.isMeditating(self)) - { - meditation.endMeditation(self, false); - return SCRIPT_CONTINUE; - } - - if (!trial.verifySession(self, params, meditation.HANDLER_MEDITATION_TICK)) - { - return SCRIPT_CONTINUE; - } - - if (utils.isProfession(self, utils.FORCE_SENSITIVE)) - { - - int value = 0; - - if (utils.hasScriptVar(self, meditation.VAR_MEDITATION_BASE)) - { - value = utils.getIntScriptVar(self, meditation.VAR_MEDITATION_BASE); - value++; - - if (value >= 3) - { - - stealth.checkForAndMakeVisibleNoRecourse(self); - - String meditateBuff = meditation.MEDITATE_BUFFS[rand(0, meditation.MEDITATE_BUFFS.length-1)]; - - buff.applyBuff(self, meditateBuff); - value = 0; - } - - } - - utils.setScriptVar(self, meditation.VAR_MEDITATION_BASE, value); - } - - messageTo(self, meditation.HANDLER_MEDITATION_TICK, trial.getSessionDict(self, meditation.HANDLER_MEDITATION_TICK), 10f, false); - - return SCRIPT_CONTINUE; - } - - - public int msgCoupDeGraceAuthoritativeCheck(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "death.beingCoupDeGraced")) - { - return SCRIPT_CONTINUE; - } - - if (params == null || params.isEmpty()) - { - utils.removeScriptVar(self, "death.beingCoupDeGraced"); - return SCRIPT_CONTINUE; - } - - int numberOfTries = params.getInt("numberOfTries"); - - obj_id victim = params.getObjId("victim"); - obj_id killer = params.getObjId("killer"); - boolean playAnim = params.getBoolean("playAnim"); - boolean usePVPRules = params.getBoolean("usePVPRules"); - - if (victim.isAuthoritative() && killer.isAuthoritative()) - { - utils.removeScriptVar(self, "death.beingCoupDeGraced"); - pclib.coupDeGrace(victim, killer, playAnim, usePVPRules); - } - else - { - - if (numberOfTries >= 5) - { - CustomerServiceLog("player_death", "coupDeGrace:Player %TU was Death Blowed by %TT, "+ numberOfTries + " attempts have been made to force them onto the same process, and has failed. %TU may be perma-incapped", victim, killer); - utils.removeScriptVar(self, "death.beingCoupDeGraced"); - return SCRIPT_CONTINUE; - } - - params.put("numberOfTries", ++numberOfTries); - messageTo(victim, "msgCoupDeGraceAuthoritativeCheck", params, 2, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean lifeDayNewDay(obj_id player) throws InterruptedException - { - if (hasObjVar(player, "lifeday.time_stamp")) - { - int now = getCalendarTime(); - int then = getIntObjVar(player, "lifeday.time_stamp"); - - if (now > then) - { - return true; - } - else - { - return false; - } - } - return true; - } - - - public boolean colorizeObject(obj_id self, obj_id object, obj_id tool, String params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(object) || !exists(object)) - { - return false; - } - if (!isValidId(tool) || !exists(tool)) - { - return false; - } - if (params == null || params.equals("")) - { - return false; - } - - if (params == null || params.equals("")) - { - messageTo(tool, "cancelTool", null, 0, false); - return false; - } - - String[] colorArray = split(params, ' '); - if (colorArray == null || colorArray.length <= 0) - { - return false; - } - - for (int i = 0; i < colorArray.length; i+=2) - { - testAbortScript(); - if (colorArray[i] == null || colorArray[i].equals("")) - { - break; - } - hue.setColor(object, colorArray[i], utils.stringToInt(colorArray[i+1])); - } - - messageTo(tool, "decrementTool", null, 0, false); - return true; - } - - - public boolean isPvpRelatedDeath(obj_id player) throws InterruptedException - { - if (!utils.hasScriptVar(player, "lastKiller")) - { - return false; - } - - obj_id lastKillerOID = utils.getObjIdScriptVar(player, "lastKiller"); - - utils.removeScriptVar(player, "lastKiller"); - - if (!isIdValid(lastKillerOID)) - { - return false; - } - - if (isPlayer(lastKillerOID)) - { - return true; - } - - if ((pet_lib.isPet(lastKillerOID) || pet_lib.isDroidPet(lastKillerOID) || pet_lib.isNpcPet(lastKillerOID) || pet_lib.isCombatDroid(lastKillerOID) || beast_lib.isBeast(lastKillerOID))) - { - obj_id master = getMaster(lastKillerOID); - if (isIdValid(master) && isPlayer(master)) - { - return true; - } - } - - return false; - } - - - public boolean needsBlackwingLightInfection(obj_id self) throws InterruptedException - { - if (( !buff.hasBuff(self, "death_troopers_infection_1") && !buff.hasBuff(self, "death_troopers_infection_2") && !buff.hasBuff(self, "death_troopers_infection_3") && !buff.hasBuff(self, "death_troopers_inoculation") )) - { - return true; - } - - return false; - } - - - public int death_troopers_apply_virus(obj_id self, dictionary params) throws InterruptedException - { - if (needsBlackwingLightInfection(self) && locations.isInRegion(self, "@dathomir_region_names:black_mesa")) - { - buff.applyBuff(self, "death_troopers_infection_1"); - } - - return SCRIPT_CONTINUE; - } - - - public int handleBuyBackSui(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.equals("")) - { - CustomerServiceLog("Junk_Dealer: ", "base_player.handleBuyBackSui() - Player: "+self+" attempted to get a list of buy back items but the message handler received not data."); - return SCRIPT_CONTINUE; - } - - obj_id junkDealer = params.getObjId("dealer"); - - if (!isIdValid(junkDealer)) - { - return SCRIPT_CONTINUE; - } - - if (utils.outOfRange(junkDealer, self, 10.0f, true)) - { - CustomerServiceLog("Junk_Dealer: ", "base_player.handleBuyBackSui() - Player: "+self+" attempted to get a list of buy back items but the action failed. The player was too far away from the TERMINAL."); - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - int bp = sui.getIntButtonPressed(params); - - obj_id[] junk = utils.getObjIdBatchScriptVar(self, smuggler.SCRIPTVAR_JUNK_IDS); - - smuggler.cleanupSellJunkSui(self); - - if (bp == sui.BP_CANCEL) - { - - return SCRIPT_CONTINUE; - } - - else if (bp == sui.BP_REVERT) - { - if (idx >= 0 && idx <= junk.length - 1) - { - if ((junk != null) || (junk.length > 0)) - { - openExamineWindow(self, junk[idx]); - } - } - - obj_id[] buyBackItems = smuggler.getBuyBackItemsInContainer(self); - if (buyBackItems != null && buyBackItems.length > 0) - { - smuggler.showBuyBackSui(self, junkDealer); - } - return SCRIPT_CONTINUE; - } - - else - { - - if (idx < 0) - { - return SCRIPT_CONTINUE; - } - - if ((junk == null) || (junk.length == 0)) - { - return SCRIPT_CONTINUE; - } - - if (idx > junk.length - 1) - { - return SCRIPT_CONTINUE; - } - - smuggler.buyBackJunkItem(self, junkDealer, junk[idx], true); - } - - return SCRIPT_CONTINUE; - } - - - public int handleTheBuyBack(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.equals("")) - { - CustomerServiceLog("Junk_Dealer: ", "base_player.handleBuyBackSui() - Player: "+self+" attempted to get a list of buy back items but the message handler received not data."); - return SCRIPT_CONTINUE; - } - - obj_id junkDealer = params.getObjId("dealer"); - - if (!isIdValid(junkDealer)) - { - return SCRIPT_CONTINUE; - } - - if (utils.outOfRange(junkDealer, self, 10.0f, true)) - { - CustomerServiceLog("Junk_Dealer: ", "base_player.handleBuyBackSui() - Player: "+self+" attempted to get a list of buy back items but the action failed. The player was too far away from the TERMINAL."); - return SCRIPT_CONTINUE; - } - - obj_id item = params.getObjId("item"); - if (!isIdValid(item)) - { - CustomerServiceLog("Junk_Dealer: ", "base_player.handleTheBuyBack() - Player (OID: "+ self + ") could not sell item because the item parameter was invalid."); - return SCRIPT_CONTINUE; - } - - int price = params.getInt("price"); - if (price <= 0) - { - CustomerServiceLog("Junk_Dealer: ", "base_player.handleTheBuyBack() - Player (OID: "+ self + ") could not sell item because the price on the item was invalid."); - return SCRIPT_CONTINUE; - } - - int retCode = params.getInt(money.DICT_CODE); - - if (retCode == money.RET_FAIL) - { - - prose_package ppNoSale = prose.getPackage(smuggler.PROSE_NO_BUY_BACK, item); - sendSystemMessageProse(self, ppNoSale); - CustomerServiceLog("Junk_Dealer: ", "base_player.handleTheBuyBack() - Player (OID: "+ self + ") could not sell item ("+ item + ") for ("+ price + ") because the player did not have the credits."); - return SCRIPT_CONTINUE; - } - - prose_package ppSoldJunk = prose.getPackage(smuggler.PROSE_PURCHASED_JUNK, item, price); - sendSystemMessageProse(self, ppSoldJunk);; - CustomerServiceLog("Junk_Dealer: ", "base_player.handleTheBuyBack() - Player (OID: "+ self + ") has paid: "+price+" for a buy back item and is about to retrieve that item: "+item+" from their buy back container."); - - smuggler.moveBuyBackObjectIntoInventory(self, item); - - obj_id[] buyBackItems = smuggler.getBuyBackItemsInContainer(self); - if (buyBackItems != null && buyBackItems.length > 0) - { - smuggler.showBuyBackSui(self, junkDealer); - } - return SCRIPT_CONTINUE; - } - - - public int handleFlagJunkSui(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.equals("")) - { - CustomerServiceLog("Junk_Dealer: ", "base_player.handleBuyBackSui() - Player: "+self+" attempted to get a list of buy back items but the message handler received not data."); - return SCRIPT_CONTINUE; - } - - obj_id junkDealer = params.getObjId("dealer"); - - if (!isIdValid(junkDealer)) - { - return SCRIPT_CONTINUE; - } - - if (utils.outOfRange(junkDealer, self, 10.0f, true)) - { - CustomerServiceLog("Junk_Dealer: ", "base_player.handleBuyBackSui() - Player: "+self+" attempted to get a list of buy back items but the action failed. The player was too far away from the TERMINAL."); - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - int bp = sui.getIntButtonPressed(params); - - obj_id[] junk = utils.getObjIdBatchScriptVar(self, smuggler.SCRIPTVAR_JUNK_IDS); - - boolean reshowSui = true; - if (junk.length < 1) - { - reshowSui = false; - } - - smuggler.cleanupSellJunkSui(self); - - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - else if (bp == sui.BP_REVERT) - { - if (idx >= 0 && idx <= junk.length - 1) - { - if ((junk != null) || (junk.length > 0)) - { - openExamineWindow(self, junk[idx]); - smuggler.flagJunkSaleSui(self, junkDealer); - } - } - return SCRIPT_CONTINUE; - } - else - { - - if (idx < 0) - { - if (junk != null && junk.length > 0) - { - smuggler.flagJunkSaleSui(self, junkDealer); - } - - return SCRIPT_CONTINUE; - } - - if (idx > junk.length - 1) - { - if (junk != null && junk.length > 0) - { - smuggler.flagJunkSaleSui(self, junkDealer); - } - return SCRIPT_CONTINUE; - } - - if (hasObjVar(junk[idx], smuggler.JUNK_DEALKER_NO_SALE_FLAG)) - { - removeObjVar(junk[idx], smuggler.JUNK_DEALKER_NO_SALE_FLAG); - } - else - { - setObjVar(junk[idx], smuggler.JUNK_DEALKER_NO_SALE_FLAG, getGameTime()); - } - smuggler.flagJunkSaleSui(self, junkDealer); - } - return SCRIPT_CONTINUE; - } - - - public boolean blog(String txt) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(LOGNAME, txt); - } - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/player/live_conversions.java b/sku.0/sys.server/compiled/game/script/player/live_conversions.java deleted file mode 100644 index 03e0ff04c..000000000 --- a/sku.0/sys.server/compiled/game/script/player/live_conversions.java +++ /dev/null @@ -1,1236 +0,0 @@ -package script.player; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.badge; -import script.library.buff; -import script.library.craftinglib; -import script.library.dot; -import script.library.factions; -import script.library.groundquests; -import script.library.guild; -import script.library.pclib; -import script.library.player_structure; -import script.library.respec; -import script.library.skill; -import script.library.skill_template; -import script.library.space_flags; -import script.library.static_item; -import script.library.sui; -import script.library.utils; -import script.library.weapons; - - -public class live_conversions extends script.base_script -{ - public live_conversions() - { - } - public static final int FLAG_ARRAY_SIZE = 2; - public static final int FLAG_MAX_BITS = FLAG_ARRAY_SIZE * 32; - - public static final int FEMALE_PILOT_MEDAL_FLAG = 0; - public static final int NOT_USED = 1; - public static final int UNARMED_DAMAGE_SET = 2; - public static final int POLITICIAN_CONVERSION = 3; - public static final int ELDER_BUFF_GRANT = 4; - public static final int SKILL_VALIDATION = 5; - public static final int MASTER_BADGE_CORRECTIONS = 6; - public static final int ENT_TRADER_FREE_SKILL_FLAG = 7; - public static final int SKILL_VALIDATION_2 = 8; - - public static final int FORCED_RESPEC_VERSION = 2; - - public static final String VAR_FLAGS = "live_conversions"; - public static final string_id EXPERTISE_RESET_FROM_CHANGES = new string_id("spam","expertise_reset_from_changes"); - public static final string_id JABBAS_COMLINK = new string_id("spam","jabbas_comlink_system_message"); - - public static final String UPDATE_COLLECTION_DATATABLE = "datatables/collection/collection_live_conversion.iff"; - public static final String UPDATE_COLLECTION_NAME_COLUMN = "completed_collections"; - public static final String UPDATE_COLLECTION_SLOT_TO_GRANT = "slot_to_grant"; - public static final String UPDATE_COLLECTION_INCREMENT_AMOUNT = "increment_amount"; - - public static final String FORCE_RESPEC_OBJVAR = "configEnforcedRespecVersion"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - runOncePerSessionConversions( self ); - runOncePerTravelConversions( self ); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - runOncePerSessionConversions( self ); - return SCRIPT_CONTINUE; - } - - - public int OnLogin(obj_id self) throws InterruptedException - { - runOncePerTravelConversions( self ); - return SCRIPT_CONTINUE; - } - - - public int OnNewbieTutorialResponse(obj_id self, String action) throws InterruptedException - { - if (action.equals("clientReady")) - { - updateBountyHunterMissions(self); - updateChangedQuests(self); - updateCollectionSlots(self); - } - return SCRIPT_CONTINUE; - } - - - public void runOncePerSessionConversions(obj_id player) throws InterruptedException - { - grantFemaleMasterPilotMedals( player ); - clearDotEffectObjvars( player ); - fixConsentList( player ); - setUnarmedDamageRanges( player ); - doPoliticianSkillConversion( player ); - grantElderBuff( player ); - validateSkills( player ); - correctMasterBadges(player); - correctEv9D9Quest(player); - correctNabooKickQuests(player); - correctSyrenQuests(player); - checkForContentPathContinuation(player); - updateResidencyLinks(player); - updateLotOverLimitStructureLocation(player); - updateGuildTerminals(player); - validateExpertises(player); - expertiseRespecCheck(player); - updatePermanentSchematics(player); - updateHothFlawless(player); - utils.updateCTSObjVars(player); - respec.checkRespecDecay(player); - updateRenameCharacterComplete(player); - forceRespecBasedOnConfig(player); - givePlayersDeathTroopersOutbreakQuest(player); - givePlayersDeathTroopersPrologQuestComlink(player); - - addPlayerScripts(player); - } - - - public void runOncePerTravelConversions(obj_id player) throws InterruptedException - { - if (buff.hasBuff(player, "crystal_buff")) - { - buff.removeBuff(player, "crystal_buff"); - } - } - - - public void setConversionFlag(obj_id player, int flag) throws InterruptedException - { - if ((!isIdValid(player)) || (flag < 0) || (flag > FLAG_MAX_BITS)) - { - return; - } - - if (hasConversionFlag(player, flag)) - { - return; - } - - int arrayIdx = flag / 32; - int bitIdx = flag % 32; - - int[] flags = getFlags( player ); - if (flags == null) - { - flags = new int[FLAG_ARRAY_SIZE]; - } - - if (!utils.checkBit(flags[arrayIdx], bitIdx)) - { - flags[arrayIdx] = utils.setBit(flags[arrayIdx], bitIdx); - setFlags(player, flags); - } - } - - - public boolean hasConversionFlag(obj_id player, int flag) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - int[] flags = getFlags( player ); - if (flags == null) - { - return false; - } - - int arrayIdx = flag / 32; - int bitIdx = flag % 32; - - return utils.checkBit(flags[arrayIdx], bitIdx); - } - - - public void clearConversionFlag(obj_id player, int flag) throws InterruptedException - { - if ((!isIdValid(player)) || (flag < 0) || (flag > FLAG_MAX_BITS)) - { - return; - } - - if (!hasObjVar(player, VAR_FLAGS)) - { - return; - } - - int arrayIdx = flag / 32; - int bitIdx = flag % 32; - - int[] flags = getFlags( player ); - if (flags == null) - { - return; - } - - if (utils.checkBit(flags[arrayIdx], bitIdx)) - { - flags[arrayIdx] = utils.clearBit(flags[arrayIdx], bitIdx); - setFlags(player, flags); - } - } - - - public int[] getFlags(obj_id player) throws InterruptedException - { - int[] flags = getIntArrayObjVar(player, VAR_FLAGS); - if (flags == null || flags.length == 0) - { - return null; - } - - if (flags.length < FLAG_ARRAY_SIZE) - { - - int[] updatedFlagArray = new int[FLAG_ARRAY_SIZE]; - flags = utils.copyArray( flags, updatedFlagArray ); - setFlags(player, flags); - } - - return flags; - } - - - public void setFlags(obj_id player, int[] flags) throws InterruptedException - { - setObjVar(player, VAR_FLAGS, flags); - } - - public static final int NEUTRAL = 0; - public static final int REBEL = 1; - public static final int IMPERIAL = 2; - - public void grantFemaleMasterPilotMedals(obj_id player) throws InterruptedException - { - if (hasConversionFlag( player, FEMALE_PILOT_MEDAL_FLAG )) - { - return; - } - - if (getGender(player) != GENDER_MALE && getSpecies(player) != SPECIES_ITHORIAN) - { - - if (badge.hasBadge( player, "pilot_rebel_navy_naboo")) - { - createFemaleMasterMedal( player, REBEL ); - } - - if (badge.hasBadge( player, "pilot_rebel_navy_corellia")) - { - createFemaleMasterMedal( player, REBEL ); - } - - if (badge.hasBadge( player, "pilot_rebel_navy_tatooine")) - { - createFemaleMasterMedal( player, REBEL ); - } - - if (badge.hasBadge( player, "pilot_imperial_navy_naboo")) - { - createFemaleMasterMedal( player, IMPERIAL ); - } - - if (badge.hasBadge( player, "pilot_imperial_navy_corellia")) - { - createFemaleMasterMedal( player, IMPERIAL ); - } - - if (badge.hasBadge( player, "pilot_imperial_navy_tatooine")) - { - createFemaleMasterMedal( player, IMPERIAL ); - } - - if (badge.hasBadge( player, "pilot_neutral_naboo")) - { - createFemaleMasterMedal( player, NEUTRAL ); - } - - if (badge.hasBadge( player, "pilot_neutral_corellia")) - { - createFemaleMasterMedal( player, NEUTRAL ); - } - - if (badge.hasBadge( player, "pilot_neutral_tatooine")) - { - createFemaleMasterMedal( player, NEUTRAL ); - } - - if (hasSkill( player, "pilot_imperial_navy_master" ) || hasSkill( player, "pilot_neutral_master" ) || hasSkill( player, "pilot_rebel_navy_master" )) - { - space_flags.setSpaceFlag(player, "master_pilot_medal_recieved", true); - } - - } - - setConversionFlag( player, FEMALE_PILOT_MEDAL_FLAG ); - } - - - public void createFemaleMasterMedal(obj_id player, int type) throws InterruptedException - { - switch ( type ) - { - case NEUTRAL : - createObjectInInventoryAllowOverload("object/tangible/wearables/necklace/necklace_ace_pilot_neutral.iff", player); - break; - case IMPERIAL : - createObjectInInventoryAllowOverload("object/tangible/wearables/necklace/necklace_ace_pilot_empire.iff", player); - break; - case REBEL : - createObjectInInventoryAllowOverload("object/tangible/wearables/necklace/necklace_ace_pilot_rebel.iff", player); - break; - } - } - - - public void clearDotEffectObjvars(obj_id player) throws InterruptedException - { - removeObjVar( player, dot.VAR_DOT_ROOT ); - removeObjVar( player, "slowDotTime"); - } - - - public void fixConsentList(obj_id player) throws InterruptedException - { - - if (hasObjVar(player, pclib.VAR_CONSENT_TO_NAME)) - { - obj_id[] consentTo = getObjIdArrayObjVar(player, pclib.VAR_CONSENT_TO_ID); - if (consentTo != null) - { - Vector newConsentTo = new Vector(); - newConsentTo.setSize(0); - for (int i = 0; i < consentTo.length; ++i) - { - testAbortScript(); - if (isPlayer(consentTo[i])) - { - newConsentTo = utils.addElement(newConsentTo, consentTo[i]); - } - } - - if (newConsentTo.size() > 0) - { - setObjVar(player, pclib.VAR_CONSENT_TO_ID, newConsentTo, resizeableArrayTypeobj_id); - } - else - { - removeObjVar(player, pclib.VAR_CONSENT_TO_ID); - } - } - - removeObjVar(player, pclib.VAR_CONSENT_TO_NAME); - } - - if (hasObjVar(player, pclib.VAR_CONSENT_FROM_NAME)) - { - obj_id[] consentFrom = getObjIdArrayObjVar(player, pclib.VAR_CONSENT_FROM_ID); - if (consentFrom != null) - { - Vector newConsentFrom = new Vector(); - newConsentFrom.setSize(0); - for (int i = 0; i < consentFrom.length; ++i) - { - testAbortScript(); - if (isPlayer(consentFrom[i])) - { - newConsentFrom = utils.addElement(newConsentFrom, consentFrom[i]); - } - } - - if (newConsentFrom.size() > 0) - { - setObjVar(player, pclib.VAR_CONSENT_FROM_ID, newConsentFrom, resizeableArrayTypeobj_id); - } - else - { - removeObjVar(player, pclib.VAR_CONSENT_FROM_ID); - } - } - - removeObjVar(player, pclib.VAR_CONSENT_FROM_NAME); - } - } - - - public void setUnarmedDamageRanges(obj_id player) throws InterruptedException - { - if (hasConversionFlag( player, UNARMED_DAMAGE_SET )) - { - return; - } - - obj_id weapon = getDefaultWeapon(player); - if (!isIdValid(weapon)) - { - return; - } - - int weaponType = getWeaponType(weapon); - if (weaponType != WEAPON_TYPE_UNARMED) - { - return; - } - - int minDmg = getWeaponMinDamage(weapon); - int maxDmg = getWeaponMaxDamage(weapon); - - setWeaponMinDamage( weapon, 5 ); - setWeaponMaxDamage( weapon, 10 ); - weapons.setWeaponData(weapon); - - setConversionFlag( player, UNARMED_DAMAGE_SET ); - } - - - public void doPoliticianSkillConversion(obj_id player) throws InterruptedException - { - if (hasConversionFlag( player, POLITICIAN_CONVERSION )) - { - return; - } - - obj_id residence = player_structure.getResidence( player ); - if (isIdValid(residence)) - { - skill.grantAllPoliticianSkills( player ); - } - - setConversionFlag( player, POLITICIAN_CONVERSION ); - } - - public static final int NPE_BIRTH_DATE = 1777; - - - public void grantElderBuff(obj_id player) throws InterruptedException - { - if (hasConversionFlag( player, ELDER_BUFF_GRANT )) - { - return; - } - - int myBirthDate = getPlayerBirthDate(player); - if (myBirthDate == -1) - { - messageTo( player, "handleBirthDateCallBack", null, 10, false ); - return; - } - else if (myBirthDate <= NPE_BIRTH_DATE) - { - if (!hasCommand(player, "veteranPlayerBuff")) - { - grantCommand(player, "veteranPlayerBuff"); - } - } - setConversionFlag( player, ELDER_BUFF_GRANT ); - } - - - public int handleBirthDateCallBack(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = self; - int myBirthDate = getPlayerBirthDate(player); - if (myBirthDate == -1) - { - messageTo( self, "handleBirthDateCallBack", null, 10, false ); - return SCRIPT_CONTINUE; - } - else if (myBirthDate <= NPE_BIRTH_DATE) - { - if (!hasCommand(player, "veteranPlayerBuff")) - { - grantCommand(player, "veteranPlayerBuff"); - } - } - setConversionFlag( player, ELDER_BUFF_GRANT ); - return SCRIPT_CONTINUE; - } - - - public void validateSkills(obj_id player) throws InterruptedException - { - - if (hasConversionFlag( player, SKILL_VALIDATION) && hasConversionFlag( player, SKILL_VALIDATION_2)) - { - - return; - } - - String skillTemplate = getSkillTemplate(player); - String workingSkill = getWorkingSkill(player); - - if (skillTemplate == null || skillTemplate.equals("") || skillTemplate.equals("a")) - { - CustomerServiceLog("validateSkillCheck:", " NullTemplate: player "+ getFirstName(player) + "("+ player + ")'s skill template is either null or 'a'"); - CustomerServiceLog("validateSkillCheck:", " NullTemplate: player "+ getFirstName(player) + "("+ player + ") skillTemplate is "+ skillTemplate); - CustomerServiceLog("validateSkillCheck:", " NullTemplate: player "+ getFirstName(player) + "("+ player + ") workingSkill is "+ workingSkill); - - return; - } - - if (workingSkill == null || workingSkill.equals("")) - { - CustomerServiceLog("validateSkillCheck:", " NullWorkingSkill: player "+ getFirstName(player) + "("+ player + ")'s skill workingSkill that is null"); - - return; - } - - int skillCount = 0; - if (hasSkill( player, "class_forcesensitive_phase1_novice")) - { - ++skillCount; - } - - if (hasSkill( player, "class_bountyhunter_phase1_novice")) - { - ++skillCount; - } - - if (hasSkill( player, "class_smuggler_phase1_novice")) - { - ++skillCount; - } - - if (hasSkill( player, "class_officer_phase1_novice")) - { - ++skillCount; - } - - if (hasSkill( player, "class_spy_phase1_novice")) - { - ++skillCount; - } - - if (hasSkill( player, "class_medic_phase1_novice")) - { - ++skillCount; - } - - if (hasSkill( player, "class_entertainer_phase1_novice")) - { - ++skillCount; - } - - if (hasSkill( player, "class_domestics_phase1_novice")) - { - ++skillCount; - } - - if (hasSkill( player, "class_structures_phase1_novice")) - { - ++skillCount; - } - - if (hasSkill( player, "class_munitions_phase1_novice")) - { - ++skillCount; - } - - if (hasSkill( player, "class_engineering_phase1_novice")) - { - ++skillCount; - } - - if (skillCount > 1) - { - CustomerServiceLog("validateSkillCheck:", " player "+ getFirstName(player) + "("+ player + ") has a skillTemplate of "+ skillTemplate); - CustomerServiceLog("validateSkillCheck:", " player "+ getFirstName(player) + "("+ player + ") has a workingSkill of "+ workingSkill); - CustomerServiceLog("validateSkillCheck:", " player "+ getFirstName(player) + "("+ player + ") has a skillCount of "+ skillCount); - int combatLevel = getLevel( player ); - setObjVar( player, "clickRespec.combatLevel", combatLevel ); - - } - - setConversionFlag(player, SKILL_VALIDATION); - setConversionFlag(player, SKILL_VALIDATION_2); - return; - } - - - public void correctMasterBadges(obj_id player) throws InterruptedException - { - if (hasConversionFlag(player, MASTER_BADGE_CORRECTIONS)) - { - return; - } - - String[] allSkills = getSkillListingForPlayer(player); - if (allSkills != null && allSkills.length > 0) - { - for (int i = 0; i < allSkills.length; i++) - { - testAbortScript(); - if (allSkills[i].endsWith("_master")) - { - badge.grantMasterSkillBadge(player, allSkills[i] ); - } - } - } - - badge.checkBadgeCount(player); - - setConversionFlag(player, MASTER_BADGE_CORRECTIONS); - } - - - public void correctEv9D9Quest(obj_id player) throws InterruptedException - { - if (groundquests.isTaskActive(player, "legacy_head_runaway", "locationOfCache")) - { - if (groundquests.hasCompletedTask(player, "legacy_head_runaway", "legacy_head_runaway_e91")) - { - groundquests.sendSignal(player, "droidsAllDead"); - } - } - } - - - public void correctSyrenQuests(obj_id player) throws InterruptedException - { - if (groundquests.isQuestActive(player, "c_story1_2_imp") && groundquests.isQuestActiveOrComplete(player, "c_story1_3_imp")) - { - groundquests.completeQuest(player, "c_story1_2_imp"); - } - if (groundquests.isQuestActive(player, "c_story1_2_reb") && groundquests.isQuestActiveOrComplete(player, "c_story1_3_reb")) - { - groundquests.completeQuest(player, "c_story1_2_reb"); - } - if (groundquests.isQuestActive(player, "c_story1_2_neu") && groundquests.isQuestActiveOrComplete(player, "c_story1_3_neu")) - { - groundquests.completeQuest(player, "c_story1_2_neu"); - } - } - - - public void checkForContentPathContinuation(obj_id player) throws InterruptedException - { - String prerequisiteQuest = "talus_nashal_goto_mother"; - String pointerQuest01 = "talus_dearic_goto_dathnaeya"; - String pointerQuest02 = ""; - String nextContentPathQuest = "talus_dearic_crisis_of_allegiance"; - - if (( groundquests.hasCompletedQuest(player, prerequisiteQuest) && !groundquests.isQuestActive(player, pointerQuest01) && !groundquests.isQuestActiveOrComplete(player, nextContentPathQuest) )) - { - dictionary webster = new dictionary(); - webster.put("player", player); - webster.put("questToGrant", pointerQuest01); - messageTo(player, "handleContentPathContinuation", webster, 5, false); - } - - return; - } - - - public int handleContentPathContinuation(obj_id self, dictionary params) throws InterruptedException - { - if (params != null && !params.isEmpty()) - { - obj_id player = params.getObjId("player"); - if (isIdValid(player)) - { - String newQuestPointer = params.getString("questToGrant"); - groundquests.grantQuest(player, newQuestPointer); - } - } - return SCRIPT_CONTINUE; - } - - - public void updateBountyHunterMissions(obj_id player) throws InterruptedException - { - messageTo(player, "informantComm", null, 10.0f, false); - return; - } - - - public void updateChangedQuests(obj_id player) throws InterruptedException - { - if (utils.hasScriptVar(player, "alreadyCheckedUpdatedQuests")) - { - - return; - } - - utils.setScriptVar(player, "alreadyCheckedUpdatedQuests", true); - - String datatable = "datatables/quest/ground/updated_quests.iff"; - String oldQuestColumn = "old_version_quest_name"; - String newQuestColumn = "new_version_quest_name"; - - String[] oldQuests = dataTableGetStringColumn(datatable, oldQuestColumn); - - String updatedQuestsMessage = utils.packStringId(new string_id ("quest/groundquests", "quest_updated_msg")) + " \n"; - boolean updatedQuestsFound = false; - - if (oldQuests != null && oldQuests.length > 0) - { - for (int i = 0; i < oldQuests.length; i++) - { - testAbortScript(); - String oldQuestName = oldQuests[i]; - if (groundquests.isQuestActive(player, oldQuestName)) - { - String newQuestName = dataTableGetString(datatable, oldQuestName, newQuestColumn); - - groundquests.clearQuest(player, oldQuestName); - - if (!newQuestName.equals("delete")) - { - updatedQuestsFound = true; - groundquests.grantQuestNoAcceptUI(player, newQuestName, false); - - String questlistDatatable = "questlist"; - int newQuestId = groundquests.getQuestIdFromString(newQuestName); - String column = groundquests.datatableColumnjournalEntryTitle; - - String taskTitle = groundquests.getStringDataEntry(questlistDatatable, newQuestId, 0, column); - updatedQuestsMessage = updatedQuestsMessage + "\n \\#pcontrast1 "+ taskTitle + " \\#. "; - } - } - } - } - - if (updatedQuestsFound) - { - int pid = sui.createSUIPage( sui.SUI_MSGBOX, player, player, "noHandlerNeeded"); - - String title = utils.packStringId(new string_id ("quest/groundquests", "quest_updated_title")); - String OK_BUTTON = utils.packStringId(new string_id ("new_player", "okay_button")); - - sui.setSizeProperty(pid, 400, 200); - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, title ); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, updatedQuestsMessage); - sui.msgboxButtonSetup(pid, sui.OK_ONLY); - setSUIProperty(pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, OK_BUTTON); - sui.showSUIPage( pid ); - } - - return; - } - - - public void correctNabooKickQuests(obj_id player) throws InterruptedException - { - if (isIdValid(player)) - { - if (isPlayer(player)) - { - if (groundquests.isQuestActiveOrComplete(player, "naboo_kadaraa_tipping_the_balance_1")) - { - if (groundquests.isQuestActive(player, "legacy_naboo_kick_imp")) - { - groundquests.completeQuest(player, "legacy_naboo_kick_imp"); - } - if (groundquests.isQuestActive(player, "legacy_naboo_kick_reb")) - { - groundquests.completeQuest(player, "legacy_naboo_kick_reb"); - } - } - } - } - } - - - public void grantNextTraderAndEntertainerSkill(obj_id player) throws InterruptedException - { - - if (hasConversionFlag( player, ENT_TRADER_FREE_SKILL_FLAG )) - { - return; - } - - String template = getSkillTemplate(player); - if (template.equals("") || template == null) - { - setConversionFlag( player, ENT_TRADER_FREE_SKILL_FLAG ); - return; - } - - if (!template.startsWith("trader") && !template.startsWith("entertainer")) - { - - setConversionFlag( player, ENT_TRADER_FREE_SKILL_FLAG ); - return; - } - - if (getLevel(player) < 6) - { - setConversionFlag( player, ENT_TRADER_FREE_SKILL_FLAG ); - return; - } - - String templateSkills = dataTableGetString(skill_template.TEMPLATE_TABLE, template, "template"); - String[] skillList = split(templateSkills, ','); - - String workingSkill = getWorkingSkill(player); - skill_template.grantRoadmapItem(player); - - grantSkill(player, workingSkill); - setWorkingSkill(player, skill_template.getNextWorkingSkill(player)); - - int xpTotal = respec.getCurrentXpTotal(player); - int currentLevel = getLevel(player); - int xpForLevel = dataTableGetInt("datatables/player/player_level.iff", currentLevel -1 , "xp_required"); - - int xpDifference = xpTotal - xpForLevel; - xpDifference *= -1; - - String xpType = ""; - if (template.startsWith("trader")) - { - xpType = "crafting"; - } - - if (template.startsWith("entertainer")) - { - xpType = "entertainer"; - } - grantExperiencePoints(player, xpType, xpDifference ); - - setConversionFlag(player, ENT_TRADER_FREE_SKILL_FLAG); - } - - - public void addPlayerScripts(obj_id player) throws InterruptedException - { - if (!hasScript(player, "systems.storyteller.storyteller_commands")) - { - attachScript(player, "systems.storyteller.storyteller_commands"); - } - - if (!hasScript(player, "systems.gcw.player_pvp")) - { - attachScript(player, "systems.gcw.player_pvp"); - } - - if (!hasScript(player, "space.combat.combat_ship_player")) - { - attachScript(player, "space.combat.combat_ship_player"); - } - - if (!hasScript(player, "player.player_chat")) - { - attachScript(player, "player.player_chat"); - } - - if (!hasScript(player, "player.veteran_rewards")) - { - attachScript(player, "player.veteran_rewards"); - } - - if (!hasScript(player, "player.player_beastmaster")) - { - attachScript(player, "player.player_beastmaster"); - } - if (!hasScript(player, "player.player_guild")) - { - attachScript(player, "player.player_guild"); - } - if (!hasScript(player, "player.player_collection")) - { - attachScript(player, "player.player_collection"); - } - if (!hasScript(player, "player.player_instance")) - { - attachScript(player, "player.player_instance"); - } - if (!hasScript(player, "player.player_saga_quest")) - { - attachScript(player, "player.player_saga_quest"); - } - } - - - public void updateResidencyLinks(obj_id player) throws InterruptedException - { - obj_id structure = getHouseId(player); - if (!isIdValid(structure)) - { - return; - } - - int currentCity = getCitizenOfCityId(player); - obj_id currentCityMayor = cityGetLeader(currentCity); - if (player == currentCityMayor) - { - setHouseId(player, obj_id.NULL_ID); - messageTo(structure, "removeResidentVar", null, 0.f, true); - } - else - { - dictionary dict = new dictionary(); - dict.put("player", player); - - String playerName = getName(player); - if ((playerName != null) && (playerName.length() > 0)) - { - dict.put("playerName", playerName); - } - - messageTo(structure, "checkResidenceLinks", dict, 1, false, player, "residentLinkFalse"); - } - } - - - public void updateLotOverLimitStructureLocation(obj_id player) throws InterruptedException - { - if (getAccountNumLots(getPlayerObject(player)) <= player_structure.MAX_LOTS) - { - removeObjVar(player, "lotOverlimit"); - } - else - { - obj_id lotOverlimitStructure = getObjIdObjVar(player, "lotOverlimit.structure_id"); - if (isIdValid(lotOverlimitStructure)) - { - if (exists(lotOverlimitStructure) && !isInWorldCell(lotOverlimitStructure)) - { - setObjVar(player, "lotOverlimit.structure_location", "Datapad"); - } - - if (!hasObjVar(player, "lotOverlimit.violation_time")) - { - setObjVar(player, "lotOverlimit.violation_time", getCalendarTime()); - } - } - } - } - - - public void updateGuildTerminals(obj_id player) throws InterruptedException - { - int guildId = getGuildId(player); - obj_id pDataPad = utils.getPlayerDatapad(player); - boolean hasTerminal = utils.playerHasItemByTemplateInDataPad(player, guild.STR_GUILD_REMOTE_DEVICE); - - if (hasTerminal) - { - return; - } - - messageTo(player, "onGuildCreateTerminalDataObject", null, 0, false); - } - - - public void validateExpertises(obj_id player) throws InterruptedException - { - skill.validateExpertise(player); - return; - } - - - public boolean expertiseRespecCheck(obj_id player) throws InterruptedException - { - - int version = respec.getRespecVersion(player); - - if (version == -1) - { - - messageTo(player, "setRespecVersion", null, 2, false); - return false; - } - - int playerVersion = 0; - - if (hasObjVar(player, respec.EXPERTISE_VERSION_OBJVAR)) - { - playerVersion = getIntObjVar(player, respec.EXPERTISE_VERSION_OBJVAR); - } - - if (version != playerVersion) - { - - messageTo(player, "fullExpertiseReset", null, 2, false); - - sui.msgbox(player, EXPERTISE_RESET_FROM_CHANGES); - CustomerServiceLog("professionExpertiseReset:", " player "+ getFirstName(player) + "("+ player + ") has had their expertise reset due to profession updates."); - return true; - } - - return false; - } - - - public boolean updatePermanentSchematics(obj_id player) throws InterruptedException - { - return craftinglib.updatePermanentSchematics(player); - } - - - public int fullExpertiseReset(obj_id self, dictionary params) throws InterruptedException - { - utils.fullExpertiseReset(self, false); - return SCRIPT_CONTINUE; - } - - - public void updateCollectionSlots(obj_id player) throws InterruptedException - { - if (!isIdValid(player) && !exists(player)) - { - return; - } - - String[] collectionList = dataTableGetStringColumn(UPDATE_COLLECTION_DATATABLE, UPDATE_COLLECTION_NAME_COLUMN); - - if (collectionList != null && collectionList.length > 0) - { - for (int i = 0; i < collectionList.length; i++) - { - testAbortScript(); - - if (hasCompletedCollection(player, collectionList[i])) - { - - String slotToGrant = dataTableGetString(UPDATE_COLLECTION_DATATABLE, collectionList[i], UPDATE_COLLECTION_SLOT_TO_GRANT); - - String[] slotList = split(slotToGrant, ','); - - if (slotList != null & slotList.length > 0) - { - - for (int j = 0; j < slotList.length; j++) - { - testAbortScript(); - - if (!hasCompletedCollectionSlot(player, slotList[j])) - { - - int incrementAmount = dataTableGetInt(UPDATE_COLLECTION_DATATABLE, collectionList[i], UPDATE_COLLECTION_INCREMENT_AMOUNT); - - modifyCollectionSlotValue(player, slotList[j], incrementAmount); - - CustomerServiceLog("Collection:", " onInitialize Collection Update: player "+ getFirstName(player) + "("+ player + - ") received a Collection Slot Update on Login for Collection"+ collectionList[i] + " : Slot(s) Name: "+ slotToGrant + "."); - } - } - } - } - } - } - } - - - public void updateHothFlawless(obj_id player) throws InterruptedException - { - if (!isIdValid(player) && !exists(player)) - { - return; - } - if (hasObjVar(player, "hoth.flawless_reward")) - { - return; - } - - if (badge.hasBadge(player, "champion_of_hoth")) - { - obj_id[] rewards = new obj_id[1]; - obj_id inventory = utils.getInventoryContainer(player); - - rewards[0] = static_item.createNewItemFunction("item_hoth_flawless_painting", inventory); - showLootBox(player, rewards); - setObjVar(player, "hoth.flawless_reward", 1); - } - } - - - public void updateRenameCharacterComplete(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return; - } - - if (!hasObjVar(player, "renameCharacterRequest.requestNewName")) - { - return; - } - - final String previousRenameName = getStringObjVar(player, "renameCharacterRequest.requestNewName"); - final String currentName = getName(player); - - if ((currentName != null) && (previousRenameName != null) && previousRenameName.equals(currentName)) - { - removeObjVar(player, "renameCharacterRequest.requestNewName"); - } - } - - - public void forceRespecBasedOnConfig(obj_id player) throws InterruptedException - { - if (getConfigSetting("GameServer", "forceProfessionRespec") == null) - { - return; - } - - if (!hasObjVar(player, "character_builder")) - { - return; - } - - if (hasObjVar(player, FORCE_RESPEC_OBJVAR)) - { - int version = getIntObjVar(player, FORCE_RESPEC_OBJVAR); - if (version != FORCED_RESPEC_VERSION) - { - utils.fullExpertiseReset(player, false); - respec.revokeAllSkillsAndExperience(player); - - respec.autoLevelPlayer(player, 90, false); - setObjVar(player, FORCE_RESPEC_OBJVAR, FORCED_RESPEC_VERSION); - } - } - else - { - utils.fullExpertiseReset(player, false); - respec.revokeAllSkillsAndExperience(player); - - respec.autoLevelPlayer(player, 90, false); - setObjVar(player, FORCE_RESPEC_OBJVAR, FORCED_RESPEC_VERSION); - } - } - - - public boolean givePlayersDeathTroopersOutbreakQuest(obj_id player) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: Player: "+player+" is being checked for old prolog quest line."); - - if (!groundquests.isQuestActiveOrComplete(player, "quest_08_dathomir_outpost")) - { - return false; - } - - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: "+player+" has quest quest_08_dathomir_outpost active or completed."); - - if ((groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_rebel") || groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_imperial") || groundquests.isQuestActiveOrComplete(player, "outbreak_live_conversion_neutral") || groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_neutral") || groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_rebel") || groundquests.isQuestActiveOrComplete(player, "outbreak_switch_to_imperial"))) - { - return false; - } - - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: "+player+" does not have quest outbreak_live_conversion_rebel, imperial or neutral active or completed."); - - if (groundquests.isQuestActive(player, "quest_08_dathomir_outpost")) - { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: "+player+" has quest quest_08_dathomir_outpost currently active!"); - - if (groundquests.isTaskActive(player, "quest_08_dathomir_outpost", "travelDathomir")) - { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: "+player+" has quest quest_08_dathomir_outpost with task travelDathomir currently active! We need to complete this quest immediatly so this player is not gated!"); - - int questid = questGetQuestId("quest/quest_08_dathomir_outpost"); - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: "+player+" has quest quest_08_dathomir_outpost and that quest ID is: "+questid); - - if (questid != 0) - { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: "+player+" is having quest quest_08_dathomir_outpost completed to avoid a gate!"); - questCompleteQuest(questid, player); - } - } - else - { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: The Player: "+player+" does not have the quest quest_08_dathomir_outpost task travelDathomir currently so we are not completing the quest prematurely."); - - return false; - } - } - - if (factions.isRebel(player)) - { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: Granting Player: "+player+" the outbreak_live_conversion_rebel quest because they are currently of rebel faction."); - - groundquests.grantQuest(player, "outbreak_live_conversion_rebel"); - return true; - } - else if (factions.isImperial(player)) - { - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: Granting Player: "+player+" the outbreak_live_conversion_rebel quest because they are currently of imp faction."); - - groundquests.grantQuest(player, "outbreak_live_conversion_imperial"); - return true; - } - CustomerServiceLog("outbreak_themepark", "givePlayersDeathTroopersOutbreakQuest: Granting Player: "+player+" the outbreak_live_conversion_rebel quest because they are currently of neutral faction."); - - groundquests.grantQuest(player, "outbreak_live_conversion_neutral"); - return true; - } - - - public boolean givePlayersDeathTroopersPrologQuestComlink(obj_id player) throws InterruptedException - { - if (isFreeTrialAccount(player)) - { - return false; - } - if (isInTutorialArea(player)) - { - return false; - } - if (hasObjVar(player, "prologComlink")) - { - return false; - } - - if ((!groundquests.isQuestActiveOrComplete(player, "quest_01_comlink_call_to_adventure_neg_faction") && !groundquests.isQuestActiveOrComplete(player, "quest_01_comlink_call_to_adventure_neut_faction") && !groundquests.isQuestActiveOrComplete(player, "quest_01_comlink_call_to_adventure_pos_faction"))) - { - obj_id[] rewards = new obj_id[1]; - obj_id inventory = utils.getInventoryContainer(player); - if (!isValidId(inventory)) - { - return false; - } - - rewards[0] = static_item.createNewItemFunction("item_publish_gift_update_14_comlink", inventory); - if (!isValidId(rewards[0])) - { - return false; - } - - showLootBox(player, rewards); - } - sendSystemMessage(player, JABBAS_COMLINK); - setObjVar(player, "prologComlink", true); - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/player/player_building.java b/sku.0/sys.server/compiled/game/script/player/player_building.java deleted file mode 100644 index 7617bb392..000000000 --- a/sku.0/sys.server/compiled/game/script/player/player_building.java +++ /dev/null @@ -1,6956 +0,0 @@ -package script.player; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.lang.Math; -import script.library.ai_lib; -import script.library.callable; -import script.library.city; -import script.library.colors_hex; -import script.library.create; -import script.library.dressup; -import script.library.hq; -import script.library.incubator; -import script.library.money; -import script.library.pclib; -import script.library.performance; -import script.library.player_structure; -import script.library.prose; -import script.library.resource; -import script.library.session; -import script.library.skill; -import script.library.static_item; -import script.library.sui; -import script.library.tcg; -import script.library.trial; -import script.library.turnstile; -import script.library.utils; -import script.library.vendor_lib; -import script.library.xp; - - -public class player_building extends script.base_script -{ - public player_building() - { - } - public static final String LOGGING_CATEGORY = "vendor"; - public static final boolean LOGGING_ON = true; - - public static final String DATATABLE_HEIGHT = "datatables/structure/cell_height.iff"; - public static final String STF = "player_structure"; - - public static final String SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID = "saveRestoreDecorationSuiId"; - public static final String SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID = "saveRestoreDecorationSaveSlotId"; - public static final String SCRIPTVAR_RESTORE_DECORATION_SAVE_SLOT_CHOICE = "restoreDecorationSaveSlotChoice"; - public static final String SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS = "restoreDecorationTargetRooms"; - public static final String SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOM_INDEX = "restoreDecorationTargetRoomIndex"; - public static final String SCRIPTVAR_RESTORE_DECORATION_CURRENT_POB_ROOMS = "restoreDecorationCurrentPobRooms"; - - public static final string_id SID_TRIAL_STRUCTURE = new string_id(STF, "trial_structure"); - public static final string_id SID_TRIAL_NO_MODIFY = new string_id(STF, "trial_no_modify"); - public static final string_id SID_NO_DECLARE = new string_id(STF, "trial_no_declare"); - public static final string_id SID_NO_TRANSFER = new string_id(STF, "trial_no_transfer"); - public static final string_id SID_NO_VENDOR = new string_id(STF, "trial_no_vendor"); - public static final string_id SID_NOT_IN_BUILDING = new string_id(STF, "not_in_building"); - public static final string_id SID_CONTENTS_NOT_LOADED = new string_id(STF, "contents_not_loaded"); - public static final string_id SID_BUILDING_HAS_NOTRADE = new string_id(STF, "building_has_notrade"); - - public static final string_id SID_CANT_TRANSFER_TO_CITY_BANNED = new string_id("city/city", "cant_transfer_to_city_banned"); - - public static final string_id SID_CONSTRUCTION_COMPLETE = new string_id("player_structure", "construction_complete"); - public static final string_id SID_CONSTRUCTION_COMPLETE_LOT_LIMIT_EXCEEDED = new string_id("player_structure", "construction_complete_lot_limit_exceeded"); - - public static final string_id SID_CONSTRUCTION_COMPLETE_SUBJECT = new string_id("player_structure", "construction_complete_subject"); - public static final string_id SID_CONSTRUCTION_COMPLETE_SENDER = new string_id("player_structure", "construction_complete_sender"); - - public static final string_id SID_SYS_FULL_VENDORS = new string_id("player_structure", "full_vendors"); - public static final string_id SID_SYS_ALREADY_CREATING = new string_id("player_structure", "already_creating_vendor_greeter"); - public static final string_id SID_SYS_VENDOR_NOT_INITIALIZED = new string_id("player_structure", "need_to_initialize_vendor"); - public static final string_id SID_SYS_CREATE_FAILED = new string_id("player_structure", "create_failed"); - public static final string_id SID_SYS_CREATE_SUCCESS = new string_id("player_structure", "create_success"); - public static final string_id SID_SYS_CREATE_BAZAAR_FAILED = new string_id("player_structure", "create_bazaar_failed"); - public static final string_id SID_SYS_CREATE_BAZAAR_SUCCESS = new string_id("player_structure", "create_bazaar_success"); - public static final string_id SID_CANT_VENDOR = new string_id("player_structure", "cant_move_vendor"); - public static final string_id SID_CANT_MOVE_OBJECT = new string_id("player_structure", "cant_move_object"); - public static final string_id SID_TURNSTILE_EXPIRE = new string_id("player_structure", "turnstile_expire"); - public static final string_id SID_CAN_RECLAIM_DEED = new string_id("player_structure", "can_reclaim_deed"); - public static final string_id SID_DROID_ASSIGNED_TO_MAINTAIN = new string_id("player_structure", "droid_assigned_to_maintain"); - public static final string_id SID_SUI_AMOUNT_TO_WITHDRAW = new string_id("player_structure", "sui_amount_to_withdraw"); - public static final string_id INVENTORY_FULL_GENERIC = new string_id("player_structure", "inventory_full_generic"); - public static final string_id SID_PACKUP_TOO_FAR_AWAY = new string_id("player_structure", "too_far_away_to_pack_house"); - public static final string_id SID_HOUSE_PACKUP_FAILED = new string_id("player_structure", "house_packup_failed"); - - public static final String TBL_VENDOR_TYPES = "datatables/vendor/vendor_types.iff"; - public static final String TBL_TERMINAL_TYPES = "datatables/vendor/vendor_terminal_types.iff"; - public static final String TBL_DROID_TYPES = "datatables/vendor/vendor_droid_types.iff"; - public static final String TBL_PLAYER_TYPES = "datatables/vendor/vendor_player_types.iff"; - public static final String TBL_ALLNPC_TYPES = "datatables/vendor/vendor_allnpc_types.iff"; - public static final String TBL_SPECIAL_PLAYER_VENDOR_TYPES = "datatables/vendor/vendor_player_types_special.iff"; - - public static final String VENDOR_VAR_PREFIX = "vendor_prefix"; - public static final String CREATING_VENDOR = VENDOR_VAR_PREFIX+".creatingVendor"; - - public static final string_id SID_VENDOR_MAINT_ACCEPTED = new string_id("player_structure", "vendor_maint_accepted"); - - public static final string_id SID_OBSCENE = new string_id("player_structure", "obscene"); - - public static final string_id SID_SET_NAME_TITLE = new string_id("sui","set_name_title"); - public static final string_id SID_SET_NAME_PROMPT = new string_id("sui","set_name_prompt"); - - public static final string_id SID_ASSIGN_DROID_TITLE = new string_id("sui","assign_droid_title"); - public static final string_id SID_ASSIGN_DROID_PROMPT = new string_id("sui","assign_droid_prompt"); - - public static final string_id PROSE_SIGN_NAME_UPDATED = new string_id("player_structure","prose_sign_name_updated"); - - public static final string_id SID_DEACTIVATE_FACTORY_FOR_DELETE = new string_id("player_structure", "deactivate_factory_for_delete"); - public static final string_id SID_REMOVE_SCHEMATIC_FOR_DELETE = new string_id("player_structure", "remove_schematic_for_delete"); - public static final string_id SID_CLEAR_INPUT_HOPPER_FOR_DELETE = new string_id("player_structure", "clear_input_hopper_for_delete"); - public static final string_id SID_CLEAR_OUTPUT_HOPPER_FOR_DELETE = new string_id("player_structure", "clear_output_hopper_for_delete"); - - public static final string_id SID_CLEAR_BUILDING_FOR_DELETE = new string_id("player_structure", "clear_building_for_delete"); - public static final string_id SID_STORE_PETS_FOR_DELETE = new string_id("player_structure", "store_pets_for_delete"); - - public static final string_id SID_PENDING_DESTROY = new string_id("player_structure", "pending_destroy"); - - public static final string_id SID_CANT_PLACE_CIVIC = new string_id("player_structure", "cant_place_civic"); - public static final string_id SID_CANT_PLACE_UNIQUE = new string_id("player_structure", "cant_place_unique"); - public static final string_id SID_CANT_PLACE_JEDI = new string_id("player_structure", "cant_place_jedi"); - public static final string_id SID_CANT_PLACE_MOUNTED = new string_id("player_structure", "cant_place_mounted"); - - public static final string_id SID_WRONG_STATE = new string_id("error_message","wrong_state"); - - public static final string_id SID_PLACED_LAST_BASE = new string_id("faction_perk", "faction_base_unit_last"); - public static final string_id SID_PLACED_NEXT_TO_LAST = new string_id("faction_perk", "faction_base_one_more"); - public static final string_id SID_NO_RIGHTS = new string_id("player_structure", "no_transfer_rights"); - - public static final string_id SID_EVACUATE_FACILITY = new string_id("hq", "self_destruct_evacuate"); - - public static final string_id MOVED_CTRL_OBJ = new string_id("spam", "magic_painting_ctrl_moved"); - public static final string_id MOVED_BACKDROP_GENERATOR = new string_id("spam", "backdrop_generator_moved"); - public static final string_id MOVED_PAINTING = new string_id("spam", "magic_painting_moved"); - public static final string_id NO_MOVE_ITEM = new string_id("spam", "no_move_item"); - public static final string_id SID_UNABLE_TO_PARSE = new string_id(STF, "unable_to_parse"); - public static final string_id SID_VALID_AMOUNT = new string_id(STF, "enter_valid_over_zero"); - public static final string_id SID_RESERVE_REPORT = new string_id(STF, "reserve_report"); - public static final string_id SID_DEPOSIT_SUCCESS = new string_id(STF, "deposit_successful"); - public static final string_id SID_NOT_ENOUGH_ENERGY = new string_id(STF, "not_enough_energy"); - public static final string_id SID_POWER_DEPOSIT_INCOMPLETE = new string_id(STF, "power_deposit_incomplete"); - public static final string_id SID_ERROR_POWER_DEPOSIT = new string_id(STF, "error_power_deposit"); - public static final string_id SID_POWER_DEPOSIT_FAIL = new string_id(STF, "power_deposit_failed"); - public static final string_id SID_SELECT_POWER_AMOUNT = new string_id(STF, "select_power_amount"); - public static final string_id SID_CURRENT_POWER_AMOUNT = new string_id(STF, "current_power_value"); - public static final string_id SID_POWER_NAME = new string_id(STF, "power_name"); - public static final string_id SID_POWER_QUALITY = new string_id(STF, "power_quality"); - public static final string_id SID_NO_GEO_POWER = new string_id(STF, "incubator_no_geothermal"); - public static final string_id SID_POWER_REMOVED = new string_id(STF, "power_removed"); - - public static final string_id SID_TCG_VENDOR_CTS_WARNING = new string_id("player_vendor", "tcg_vendor_in_player_inventory"); - - public static final string_id SID_ROTATE_CONFIRM_SAVE = new string_id(STF, "rotate_confirm_save"); - public static final string_id SID_ROTATE_RESTORE_EMPTY_SLOT = new string_id(STF, "rotate_restore_empty_slot"); - - public static final string_id SID_DESTRUCTION_LOCKED = new string_id("city/city", "destruction_locked"); - - public static final int VAR_TRUE = 1; - - - public int OnPlaceStructure(obj_id self, obj_id player, obj_id deed, location position, int rotation) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::OnPlaceStructure"); - LOG("LOG_CHANNEL", "player ->"+ player + " deed ->"+ deed + " pos ->"+ position + " rotation ->"+ rotation); - - if (!isIdValid(player)) - { - LOG("LOG_CHANNEL", "player_structure::OnPlaceStructure -- player is invalid."); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(deed)) - { - LOG("LOG_CHANNEL", "player_structure::OnPlaceStructure -- deed is invalid."); - return SCRIPT_CONTINUE; - } - - obj_id owner = utils.getContainingPlayer(deed); - - if (player == owner) - { - - } - else - { - sendSystemMessage(player, new string_id(STF, "no_possession")); - - if (isIdValid(owner)) - { - CustomerServiceLog("playerStructure", "%TU tried to place a building, but no longer possesses the deed ("+ deed + ")! %TT currently has the deed.", player, owner); - } - else - { - CustomerServiceLog("playerStructure", "%TU tried to place a building, but no longer possesses the deed ("+ deed + ")!", player); - } - return SCRIPT_CONTINUE; - } - - String template = player_structure.getDeedTemplate(deed); - if (template == null) - { - LOG("LOG_CHANNEL", "player_structure::OnPlaceStructure -- Unable to find template on deed."); - return SCRIPT_CONTINUE; - } - - String fp_template = player_structure.getFootprintTemplate(template); - if (fp_template == null || fp_template.equals("")) - { - return SCRIPT_CONTINUE; - } - - float placement_height = canPlaceStructure(fp_template, position, rotation); - - LOG("LOG_CHANNEL", "placement_height ->"+ placement_height); - - if (placement_height == -9997.0f) - { - LOG("LOG_CHANNEL", player + " ->Internal code error: canPlaceStructure"); - sendSystemMessage(player, new string_id(STF, "error_canplacestructure")); - return SCRIPT_CONTINUE; - } - - if (placement_height == -9998.0f) - { - LOG("LOG_CHANNEL", player + " ->Internal script error: OnPlaceStructure"); - sendSystemMessage(player, new string_id(STF, "error_onplacestructure")); - return SCRIPT_CONTINUE; - } - - if (placement_height == -9999.0f) - { - LOG("LOG_CHANNEL", player + " ->There is no room to place the structure here."); - sendSystemMessage(player, new string_id(STF, "no_room")); - return SCRIPT_CONTINUE; - } - - if (player_structure.isCivicTemplate(template) && (template.indexOf("cityhall") == -1)) - { - - if (!canPlaceCivic(player, deed, position, template)) - { - sendSystemMessage(player, SID_CANT_PLACE_CIVIC); - return SCRIPT_CONTINUE; - } - - if (!canPlaceUnique(player, deed, position, template)) - { - sendSystemMessage(player, SID_CANT_PLACE_UNIQUE); - return SCRIPT_CONTINUE; - } - } - - if (!player_structure.canPlaceStructure(self, template, position, deed)) - { - return SCRIPT_CONTINUE; - } - - position.y = getHeightAtLocation (position.x, position.z); - - if (isGameObjectTypeOf(getGameObjectType(deed), GOT_data_house_control_device)) - { - player_structure.replacePackedStructure(deed, self, position, rotation, placement_height); - return SCRIPT_CONTINUE; - } - - obj_id structure = player_structure.createTemporaryStructure(deed, self, position, rotation, placement_height); - if (!isIdValid(structure)) - { - debugSpeakMsg(self, "OnPlaceStructure: createObject failed"); - - return SCRIPT_OVERRIDE; - } - - if (player_structure.isFactionPerkBase(template)) - { - - if (hasObjVar(player,"factionBaseCount")) - { - int factionBaseCount = getIntObjVar(player,"factionBaseCount"); - int updatedFactionBaseCount = factionBaseCount + 1; - setObjVar(player,"factionBaseCount",updatedFactionBaseCount); - if (updatedFactionBaseCount == player_structure.MAX_BASE_COUNT) - { - sendSystemMessage(self, SID_PLACED_LAST_BASE); - } - else if (updatedFactionBaseCount == player_structure.MAX_BASE_COUNT-1) - { - sendSystemMessage(self, SID_PLACED_NEXT_TO_LAST); - } - else - { - sendSystemMessageProse(self, prose.getPackage(new string_id ("faction_perk", "faction_base_unit_used"), (player_structure.MAX_BASE_COUNT-updatedFactionBaseCount))); - } - - } - else - { - setObjVar(player,"factionBaseCount",1); - sendSystemMessageProse(self, prose.getPackage(new string_id ("faction_perk", "faction_base_unit_used"), (player_structure.MAX_BASE_COUNT-1))); - - } - } - return SCRIPT_CONTINUE; - } - - - public int OnPermissionListModify(obj_id self, obj_id player, String name, String listName, String action) throws InterruptedException - { - if (utils.isFreeTrial(player)) - { - sendSystemMessage(player, SID_TRIAL_NO_MODIFY); - return SCRIPT_CONTINUE; - } - - LOG("debug", "player_building::OnPermissionListModify"); - - obj_id structure = player_structure.getStructure(self); - if ((structure == null)||(structure == obj_id.NULL_ID)) - { - LOG("LOG_CHANNEL", "You must be in a building, be near an installation, or have one targeted to do that."); - sendSystemMessage(player, new string_id(STF, "no_building")); - return SCRIPT_CONTINUE; - } - - if (name == null) - { - return SCRIPT_CONTINUE; - } - - if (name.length() > 40) - { - sendSystemMessage(player, new string_id(STF, "permission_40_char")); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isInAdminRange(structure, self)) - { - return SCRIPT_CONTINUE; - } - if (listName.equals("ENTRY")) - { - player_structure.modifyEntryList(structure, name, self); - } - - if (listName.equals("BAN")) - { - player_structure.modifyBanList(structure, name, self); - } - - if (listName.equals("ADMIN")) - { - player_structure.modifyAdminList(structure, name, self); - } - - if (listName.equals("HOPPER")) - { - player_structure.modifyHopperList(structure, name, self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnContentsLoadedForBuildingToBePacked(obj_id self, obj_id structure) throws InterruptedException - { - LOG("sissynoid", "Loading Finished - Triggered OnContentsLoadedForBuildingToBePacked"); - if (!isValidId(structure)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.canPackStructureWithVendors(self, structure)) - { - if (player_structure.isAbandoned(structure)) - { - messageTo(self, "handleFailedStructurePackup", null, 0, false); - } - if (player_structure.isCityAbandoned(structure)) - { - sendSystemMessage(self, new string_id("player_structure", "unable_to_city_pack")); - } - return SCRIPT_CONTINUE; - } - - if (player_structure.isAbandoned(structure)) - { - player_structure.finalizePackUp(self, structure); - return SCRIPT_CONTINUE; - } - - if (player_structure.isCityAbandoned(structure)) - { - player_structure.finalizeCityPackUp(self, structure); - LOG("sissynoid", "Contents are Now Loaded - Messaging packUpCityAbandonedStructure"); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnMadeAuthoritative(obj_id self) throws InterruptedException - { - LOG("sissynoid", "OnMadeAuthoritative: HouseAndPlayer have been made authoritative"); - if (utils.hasScriptVar(self, "requestedSameServerToAbandonHouse")) - { - LOG("sissynoid", "Shoud not be here!"); - obj_id house = utils.getObjIdScriptVar(self, "requestedSameServerToAbandonHouse"); - - utils.removeScriptVarTree(self, "requestedSameServerToAbandonHouse"); - utils.removeScriptVarTree(self, "timeOfLastSameServerRequest"); - - if (!player_structure.canPlayerPackAbandonedStructure(self, house)) - { - messageTo(self, "handleFailedStructurePackup", null, 0, false); - sendSystemMessage(self, new string_id("player_structure", "abandoned_structure_pack_up_try_again_later")); - return SCRIPT_CONTINUE; - } - - dictionary params = new dictionary(); - params.put("house", house); - params.put("player", self); - - messageTo(house, "packAbandonedBuilding", params, 4, false); - - if (!hasObjVar(self, "housePackup")) - { - String recipient = getPlayerName(self); - utils.sendMail(new string_id("spam", "email_title"), new string_id("spam", "email_body"), recipient, "Galactic Vacant Building Demolishing Movement"); - } - } - if (utils.hasScriptVar(self, "cityRequestedSameServerToAbandonHouse")) - { - obj_id player = self; - obj_id house = utils.getObjIdScriptVar(self, "cityRequestedSameServerToAbandonHouse"); - LOG("sissynoid", "OnMadeAuthoritative: City Packup is a Go for Structure("+ house +") by player ("+ player +")"); - utils.removeScriptVarTree(self, "cityRequestedSameServerToAbandonHouse"); - utils.removeScriptVarTree(self, "cityTimeOfLastSameServerRequest"); - - player_structure.confirmCityAbandonedAndPack(house, player); - } - return SCRIPT_CONTINUE; - } - - - public int OnPlayerVendorCountReply(obj_id self, int count) throws InterruptedException - { - if (count < 0) - { - - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - int creatingVendor = 0; - if (utils.hasScriptVar(self, CREATING_VENDOR)) - { - creatingVendor = utils.getIntScriptVar(self, CREATING_VENDOR); - } - - blog("player_building.OnPlayerVendorCountReply -- "+ creatingVendor + " / "+ count); - - if (creatingVendor == 1) - { - - setObjVar(self, "used_vendor_slots", count); - - if (getSkillStatMod(self, "manage_vendor") <= count) - { - - removeVendorVars(self); - sendSystemMessage(self, SID_SYS_FULL_VENDORS); - return SCRIPT_CONTINUE; - } - - String[] rawVendorTypes = dataTableGetStringColumn(TBL_VENDOR_TYPES, 0); - if (rawVendorTypes == null) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - int hiringMod = getSkillStatMod(self, "hiring"); - blog("player_building.OnPlayerVendorCountReply hiringMod: "+ hiringMod); - int hiringRequirement = 10; - Vector vendorTypes = new Vector(); - vendorTypes.setSize(0); - - blog("player_building.OnPlayerVendorCountReply rawVendorTypes.length: "+ rawVendorTypes.length); - - String[] possibleVendorTypes = new String[rawVendorTypes.length]; - - for (int i = 0; i < rawVendorTypes.length; i++) - { - testAbortScript(); - possibleVendorTypes[i] = "@player_structure:"+rawVendorTypes[i]; - } - - for (int i=0; i<3; i++) - { - testAbortScript(); - if (hiringMod >= hiringRequirement) - { - vendorTypes = utils.addElement(vendorTypes, possibleVendorTypes[i]); - } - hiringRequirement += 10; - } - - if (vendorTypes == null) - { - - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - sui.listbox(self, self, "@player_structure:vendor_type_d", sui.OK_CANCEL, "@player_structure:vendor_type_t", vendorTypes, "handleVendorTypeSelect", true); - } - return SCRIPT_CONTINUE; - } - - - public int rotateFurniture(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (hasScript(self, performance.MUSIC_HEARTBEAT_SCRIPT)) - { - string_id message = new string_id("player_structure", "cant_move_while_entertaining"); - sendSystemMessage(self, message); - return SCRIPT_CONTINUE; - } - - boolean canRollAndPitch = (player_structure.canRotateFurnitureInPitchRollAxes(self) || isGod(self)); - - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - if (st.countTokens() == 0) - { - if (!canRollAndPitch) - { - sendSystemMessage(self, new string_id(STF, "formet_rotratefurniture_degrees")); - } - else - { - sendSystemMessage(self, new string_id(STF, "formet_enhanced_rotratefurniture_degrees")); - } - - return SCRIPT_CONTINUE; - } - - String direction = st.nextToken().toUpperCase(); - boolean actionYaw = false; - boolean actionPitch = false; - boolean actionRoll = false; - boolean actionRandom = false; - boolean actionReset = false; - boolean actionCopy = false; - boolean actionSave = false; - boolean actionRestore = false; - boolean actionSetQuaternion = false; - if (direction.equals("YAW")) - { - actionYaw = true; - } - else if (direction.equals("PITCH")) - { - if (!canRollAndPitch) - { - sendSystemMessage(self, new string_id(STF, "formet_rotratefurniture_degrees")); - return SCRIPT_CONTINUE; - } - - actionPitch = true; - } - else if (direction.equals("ROLL")) - { - if (!canRollAndPitch) - { - sendSystemMessage(self, new string_id(STF, "formet_rotratefurniture_degrees")); - return SCRIPT_CONTINUE; - } - - actionRoll = true; - } - else if (direction.equals("RANDOM")) - { - if (!canRollAndPitch) - { - sendSystemMessage(self, new string_id(STF, "formet_rotratefurniture_degrees")); - return SCRIPT_CONTINUE; - } - - actionRandom = true; - } - else if (direction.equals("RESET")) - { - actionReset = true; - } - else if (direction.equals("COPY")) - { - actionCopy = true; - } - else if (direction.equals("SAVE")) - { - actionSave = true; - } - else if (direction.equals("RESTORE")) - { - actionRestore = true; - } - else if (direction.equals("(^-,=+_)INTERNAL_USE_ONLY_" + self + "_QUATERNION(,+-=_^)")) - { - if (!canRollAndPitch) - { - sendSystemMessage(self, new string_id(STF, "formet_rotratefurniture_degrees")); - return SCRIPT_CONTINUE; - } - - actionSetQuaternion = true; - } - else - { - if (!canRollAndPitch) - { - sendSystemMessage(self, new string_id(STF, "formet_rotratefurniture_degrees")); - } - else - { - sendSystemMessage(self, new string_id(STF, "formet_enhanced_rotratefurniture_degrees")); - } - - return SCRIPT_CONTINUE; - } - - int saveSlot = 0; - int rotation = 0; - float qw = 1.0f; - float qx = 0.0f; - float qy = 0.0f; - float qz = 0.0f; - if (actionYaw || actionPitch || actionRoll) - { - if (st.hasMoreTokens()) - { - String rot_str = st.nextToken().toUpperCase(); - if (rot_str.equals("RANDOM")) - { - actionRandom = true; - } - else - { - - try - { - rotation = Integer.parseInt(rot_str); - } - catch (NumberFormatException err) - { - sendSystemMessage(self, new string_id(STF, "rotate_params")); - return SCRIPT_CONTINUE; - } - - if (rotation < -180 || rotation > 180) - { - sendSystemMessage(self, new string_id(STF, "rotate_params")); - return SCRIPT_CONTINUE; - } - } - } - else - { - rotation = getFurnitureRotationDegree(self); - } - - if ((rotation == 0) && !actionRandom) - { - return SCRIPT_CONTINUE; - } - } - else if (actionSave || actionRestore) - { - if (st.hasMoreTokens()) - { - saveSlot = utils.stringToInt(st.nextToken()); - - if (saveSlot < 1 || saveSlot > 10) - { - sendSystemMessage(self, new string_id(STF, "rotate_save_slot_params")); - return SCRIPT_CONTINUE; - } - } - else - { - if (!canRollAndPitch) - { - sendSystemMessage(self, new string_id(STF, "formet_rotratefurniture_degrees")); - } - else - { - sendSystemMessage(self, new string_id(STF, "formet_enhanced_rotratefurniture_degrees")); - } - - return SCRIPT_CONTINUE; - } - } - else if (actionSetQuaternion) - { - if (!st.hasMoreTokens()) - { - return SCRIPT_CONTINUE; - } - qw = utils.stringToFloat(st.nextToken()); - - if (!st.hasMoreTokens()) - { - return SCRIPT_CONTINUE; - } - qx = utils.stringToFloat(st.nextToken()); - - if (!st.hasMoreTokens()) - { - return SCRIPT_CONTINUE; - } - qy = utils.stringToFloat(st.nextToken()); - - if (!st.hasMoreTokens()) - { - return SCRIPT_CONTINUE; - } - qz = utils.stringToFloat(st.nextToken()); - - if (!st.hasMoreTokens()) - { - return SCRIPT_CONTINUE; - } - } - - obj_id intendedTarget = getIntendedTarget(self); - obj_id lookAtTarget = getLookAtTarget(self); - - if (st.hasMoreTokens()) - { - target = obj_id.getObjId(Long.valueOf(st.nextToken())); - } - else - { - if (!actionCopy) - { - if (isIdValid(intendedTarget)) - { - target = intendedTarget; - } - else if (isIdValid(lookAtTarget)) - { - target = lookAtTarget; - } - } - else - { - if (isIdValid(lookAtTarget)) - { - target = lookAtTarget; - } - } - } - - if (!isIdValid(target)) - { - sendSystemMessage(self, new string_id(STF, "rotate_what")); - return SCRIPT_CONTINUE; - } - - if (actionCopy && !isIdValid(intendedTarget)) - { - sendSystemMessage(self, new string_id(STF, "rotate_move_copy_no_intended_target")); - return SCRIPT_CONTINUE; - } - - boolean isVendor = hasCondition(target, CONDITION_VENDOR); - if (isVendor && (actionPitch || actionRoll || actionCopy || actionRestore || actionSetQuaternion)) - { - sendSystemMessage(self, new string_id(STF, "cant_rotate_vendor")); - return SCRIPT_CONTINUE; - } - - if (!actionSave) - { - if (!isMoveCommandValid(self, target)) - { - return SCRIPT_CONTINUE; - } - - session.logActivity(self, session.ACTIVITY_DECORATE); - } - - if (actionYaw) - { - if (actionRandom) - { - modifyYaw(target, rand(-180, 180)); - } - else - { - modifyYaw(target, rotation); - } - } - else if (actionPitch) - { - if (actionRandom) - { - modifyPitch(target, rand(-180, 180)); - } - else - { - modifyPitch(target, rotation); - } - } - else if (actionRoll) - { - if (actionRandom) - { - modifyRoll(target, rand(-180, 180)); - } - else - { - modifyRoll(target, rotation); - } - } - else if (actionRandom) - { - modifyYaw(target, rand(-180, 180)); - - if (!isVendor) - { - modifyPitch(target, rand(-180, 180)); - modifyRoll(target, rand(-180, 180)); - } - } - else if (actionReset) - { - setQuaternion(target, 1.0f, 0.0f, 0.0f, 0.0f); - } - else if (actionCopy) - { - if (target != intendedTarget) - { - float[] quaternion = getQuaternion(intendedTarget); - if ((quaternion != null) && (quaternion.length == 4)) - { - setQuaternion(target, quaternion[0], quaternion[1], quaternion[2], quaternion[3]); - } - } - } - else if (actionSave) - { - if (saveSlot >= 1 && saveSlot <= 10) - { - float[] quaternion = getQuaternion(target); - if ((quaternion != null) && (quaternion.length == 4)) - { - setObjVar(self, "rotateFurnitureSaveSlot."+ saveSlot, quaternion); - - prose_package pp = prose.getPackage(SID_ROTATE_CONFIRM_SAVE); - prose.setDI(pp, saveSlot); - sendSystemMessageProse(self, pp); - } - } - } - else if (actionRestore) - { - if (saveSlot >= 1 && saveSlot <= 10) - { - float[] quaternion = getFloatArrayObjVar(self, "rotateFurnitureSaveSlot."+ saveSlot); - if ((quaternion != null) && (quaternion.length == 4)) - { - setQuaternion(target, quaternion[0], quaternion[1], quaternion[2], quaternion[3]); - } - else - { - prose_package pp = prose.getPackage(SID_ROTATE_RESTORE_EMPTY_SLOT); - prose.setDI(pp, saveSlot); - sendSystemMessageProse(self, pp); - } - } - } - else if (actionSetQuaternion) - { - setQuaternion(target, qw, qx, qy, qz); - } - - messageTo(target, "furniture_rotated", null, 1.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int moveFurniture(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (hasScript(self, performance.MUSIC_HEARTBEAT_SCRIPT)) - { - string_id message = new string_id("player_structure", "cant_move_while_entertaining"); - sendSystemMessage(self, message); - return SCRIPT_CONTINUE; - } - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - if (st.countTokens() == 0) - { - sendSystemMessage(self, new string_id(STF, "format_movefurniture_distance")); - return SCRIPT_CONTINUE; - } - - String direction = st.nextToken().toUpperCase(); - String dist_str = null; - - if (!direction.equals("FORWARD") && !direction.equals("BACK") && !direction.equals("LEFT") && !direction.equals("RIGHT") && !direction.equals("UP") && !direction.equals("DOWN") && !direction.equals("COPY")) - { - String targetName = getEncodedName(target).toUpperCase(); - if (targetName.startsWith("@")) - { - targetName = localize(getNameStringId(target)).toUpperCase(); - } - - if (!targetName.startsWith("FORWARD") && !targetName.startsWith("BACK") && !targetName.startsWith("LEFT") && !targetName.startsWith("RIGHT") && !targetName.startsWith("UP") && !targetName.startsWith("DOWN") && !targetName.startsWith("COPY")) - { - sendSystemMessage(self, new string_id(STF, "format_movefurniture_distance")); - return SCRIPT_CONTINUE; - } - else - { - dist_str = direction; - - if (targetName.startsWith("UP")) - { - direction = "UP"; - } - else if (targetName.startsWith("DOWN")) - { - direction = "DOWN"; - } - else if (targetName.startsWith("BACK")) - { - direction = "BACK"; - } - else if (targetName.startsWith("FORWARD")) - { - direction = "FORWARD"; - } - else if (targetName.startsWith("LEFT")) - { - direction = "LEFT"; - } - else if (targetName.startsWith("RIGHT")) - { - direction = "RIGHT"; - } - else if (targetName.startsWith("COPY")) - { - direction = "COPY"; - } - } - } - - int distance = 0; - boolean copyLocation = false; - boolean copyHeight = false; - if (st.hasMoreTokens() && dist_str == null) - { - dist_str = st.nextToken().toUpperCase(); - if (direction.equals("COPY")) - { - if (dist_str.equals("LOCATION")) - { - copyLocation = true; - } - else if (dist_str.equals("HEIGHT")) - { - copyHeight = true; - } - else - { - sendSystemMessage(self, new string_id(STF, "format_movefurniture_distance")); - return SCRIPT_CONTINUE; - } - } - else - { - int dist_int = utils.stringToInt(dist_str); - if (dist_int != -1) - { - distance = dist_int; - } - - if (distance < 1 || distance > 500) - { - sendSystemMessage(self, new string_id(STF, "movefurniture_params")); - return SCRIPT_CONTINUE; - } - } - } - else if (dist_str != null) - { - dist_str = dist_str.toUpperCase(); - if (direction.equals("COPY")) - { - if (dist_str.equals("LOCATION")) - { - copyLocation = true; - } - else if (dist_str.equals("HEIGHT")) - { - copyHeight = true; - } - else - { - sendSystemMessage(self, new string_id(STF, "format_movefurniture_distance")); - return SCRIPT_CONTINUE; - } - } - else - { - int dist_int = utils.stringToInt(dist_str); - if (dist_int != -1) - { - distance = dist_int; - } - - if (distance < 1 || distance > 500) - { - sendSystemMessage(self, new string_id(STF, "movefurniture_params")); - return SCRIPT_CONTINUE; - } - } - } - else if (direction.equals("COPY")) - { - sendSystemMessage(self, new string_id(STF, "format_movefurniture_distance")); - return SCRIPT_CONTINUE; - } - else - { - distance = 100; - } - - obj_id intendedTarget = getIntendedTarget(self); - obj_id lookAtTarget = getLookAtTarget(self); - - if (st.hasMoreTokens()) - { - target = obj_id.getObjId(Long.valueOf(st.nextToken())); - } - else - { - if (!direction.equals("COPY")) - { - if (isIdValid(intendedTarget)) - { - target = intendedTarget; - } - else if (isIdValid(lookAtTarget)) - { - target = lookAtTarget; - } - } - else - { - if (isIdValid(lookAtTarget)) - { - target = lookAtTarget; - } - } - } - - if (!isIdValid(target)) - { - sendSystemMessage(self, new string_id(STF, "move_what")); - return SCRIPT_CONTINUE; - } - - if ((direction.equals("COPY")) && !isIdValid(intendedTarget)) - { - sendSystemMessage(self, new string_id(STF, "rotate_move_copy_no_intended_target")); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(target, "unmoveable")) - { - sendSystemMessage(self, SID_CANT_MOVE_OBJECT); - return SCRIPT_CONTINUE; - } - - if (hasCondition(target, CONDITION_VENDOR)) - { - sendSystemMessage(self, SID_CANT_VENDOR); - return SCRIPT_CONTINUE; - } - - if (!isMoveCommandValid(self, target)) - { - return SCRIPT_CONTINUE; - } - - location move_loc = null; - session.logActivity(self, session.ACTIVITY_DECORATE); - if (direction.equals("FORWARD") || direction.equals("BACK") || direction.equals("LEFT") || direction.equals("RIGHT")) - { - - location loc = getLocation(target); - float facing = getYaw(self); - - if (direction.equals("LEFT")) - { - facing -= 90; - direction = "FORWARD"; - } - else if (direction.equals("RIGHT")) - { - facing += 90; - direction = "FORWARD"; - } - - float dist_scaled = (float)distance / 100.0f; - - float facing_rad = (float)Math.toRadians(facing); - float x = dist_scaled * (float) Math.sin(facing_rad); - float z = dist_scaled * (float)Math.cos(facing_rad); - - if (direction.equals("BACK")) - { - x = x * -1; - z = z * -1; - } - - LOG("LOG_CHANNEL", "x ->"+ x + " z ->"+ z + " dist ->"+ dist_scaled); - move_loc = new location (x + loc.x, loc.y, z + loc.z, loc.area, loc.cell); - LOG("LOG_CHANNEL", "move_loc ->"+ move_loc); - - if (!isValidInteriorLocation(move_loc)) - { - sendSystemMessage(self, new string_id(STF, "not_valid_location")); - return SCRIPT_CONTINUE; - } - } - else if (direction.equals("UP") || direction.equals("DOWN")) - { - - location loc = getLocation(target); - float facing = getYaw(self); - - float dist_scaled = (float)distance / 100.0f; - float y = dist_scaled; - - if (direction.equals("DOWN")) - { - y = y * -1; - } - - LOG("LOG_CHANNEL", "y ->"+ y + " dist ->"+ dist_scaled); - move_loc = new location (loc.x, y + loc.y, loc.z, loc.area, loc.cell); - LOG("LOG_CHANNEL", "move_loc ->"+ move_loc); - - obj_id building = getTopMostContainer(target); - String bldgstr = getTemplateName(building); - String cellname = getCellName(building, loc.cell); - float new_y = y + loc.y; - - if ((!utils.hasScriptVar(target, "vertical.template") || !utils.hasScriptVar(target, "vertical.cell") || !utils.hasScriptVar(target, "vertical.min_height") || !utils.hasScriptVar(target, "vertical.max_height") || !utils.getStringScriptVar(target, "vertical.template").equals(bldgstr) || !utils.getStringScriptVar(target, "vertical.cell").equals(cellname))) - { - String[] template = dataTableGetStringColumn(DATATABLE_HEIGHT, "template"); - String[] cell = dataTableGetStringColumn(DATATABLE_HEIGHT, "cell"); - float[] max_height = dataTableGetFloatColumn(DATATABLE_HEIGHT, "max_height"); - float[] min_height = dataTableGetFloatColumn(DATATABLE_HEIGHT, "min_height"); - - for (int i = 0; i < template.length; i++) - { - testAbortScript(); - if ((template[i].equals(bldgstr)) && (cell[i].equals(cellname))) - { - utils.setScriptVar (target, "vertical.template", template[i]); - utils.setScriptVar(target, "vertical.cell", cell[i]); - utils.setScriptVar(target, "vertical.min_height", min_height[i]); - utils.setScriptVar(target, "vertical.max_height", max_height[i]); - } - } - } - - if (!utils.hasScriptVar(target, "vertical.min_height") || !utils.hasScriptVar(target, "vertical.max_height")) - { - sendSystemMessage(self, new string_id(STF, "error_move_item")); - return SCRIPT_CONTINUE; - } - - if (new_y < utils.getFloatScriptVar(target, "vertical.min_height") || new_y > utils.getFloatScriptVar(target, "vertical.max_height")) - { - sendSystemMessage(self, new string_id(STF, "not_valid_location")); - return SCRIPT_CONTINUE; - } - } - else if (target != intendedTarget) - { - location sourceLoc = getLocation(intendedTarget); - move_loc = getLocation(target); - - if ((sourceLoc != null) && (move_loc != null) && (isIdValid(sourceLoc.cell)) && (isIdValid(move_loc.cell))) - { - if (sourceLoc.cell == move_loc.cell) - { - if (copyLocation) - { - move_loc.x = sourceLoc.x; - move_loc.z = sourceLoc.z; - } - else if (copyHeight) - { - move_loc.y = sourceLoc.y; - } - else - { - return SCRIPT_CONTINUE; - } - } - else - { - sendSystemMessage(self, new string_id(STF, "move_copy_objects_not_in_same_cell")); - return SCRIPT_CONTINUE; - } - } - else - { - sendSystemMessage(self, new string_id(STF, "move_copy_objects_not_in_same_cell")); - return SCRIPT_CONTINUE; - } - } - - if (move_loc != null) - { - setLocation(target, move_loc); - location new_loc = getLocation(target); - LOG("LOG_CHANNEL", "new_loc ->"+ new_loc); - - dictionary parameters = new dictionary(); - - parameters.put("newLoc", move_loc); - - messageTo(target, "furniture_moved", parameters, 1.0f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int DoRestoreItemDecorationLayout(obj_id self, obj_id item, obj_id cell, location loc, boolean restoreRotation, float qw, float qx, float qy, float qz) throws InterruptedException - { - if (!isIdValid(item) || !exists(item) || !isIdValid(cell) || !exists(cell) || (loc == null)) - { - return SCRIPT_OVERRIDE; - } - - if (hasScript(self, performance.MUSIC_HEARTBEAT_SCRIPT)) - { - string_id message = new string_id("player_structure", "cant_move_while_entertaining"); - sendSystemMessage(self, message); - return SCRIPT_OVERRIDE; - } - - if (hasObjVar(item, "unmoveable")) - { - sendSystemMessage(self, SID_CANT_MOVE_OBJECT); - return SCRIPT_OVERRIDE; - } - - if (hasCondition(item, CONDITION_VENDOR)) - { - sendSystemMessage(self, SID_CANT_VENDOR); - return SCRIPT_OVERRIDE; - } - - if (!isMoveCommandValid(self, item)) - { - return SCRIPT_OVERRIDE; - } - - session.logActivity(self, session.ACTIVITY_DECORATE); - - loc.cell = cell; - setLocation(item, loc); - - if (restoreRotation) - { - setQuaternion(item, qw, qx, qy, qz); - } - - dictionary parameters = new dictionary(); - parameters.put("newLoc", loc); - messageTo(item, "furniture_moved", parameters, 1.0f, false); - - if (restoreRotation) - { - messageTo(item, "furniture_rotated", null, 1.0f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int DoRestoreItemDecorationLayoutRotationOnly(obj_id self, obj_id item, float qw, float qx, float qy, float qz) throws InterruptedException - { - if (!isIdValid(item) || !exists(item)) - { - return SCRIPT_OVERRIDE; - } - - if (hasScript(self, performance.MUSIC_HEARTBEAT_SCRIPT)) - { - string_id message = new string_id("player_structure", "cant_move_while_entertaining"); - sendSystemMessage(self, message); - return SCRIPT_OVERRIDE; - } - - if (!isMoveCommandValid(self, item)) - { - return SCRIPT_OVERRIDE; - } - - session.logActivity(self, session.ACTIVITY_DECORATE); - - setQuaternion(item, qw, qx, qy, qz); - - messageTo(item, "furniture_rotated", null, 1.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int nameStructure(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - obj_id structure = player_structure.getStructure(self); - if (!isIdValid(structure)) - { - LOG("LOG_CHANNEL", self + " ->You must in a building or near an installation to use that command."); - sendSystemMessage(self, new string_id(STF, "command_no_building")); - return SCRIPT_CONTINUE; - } - - String template = getTemplateName(structure); - - if (player_structure.isCivic(structure)) - { - - if (!(template.indexOf("cloning_") > -1) && !(template.indexOf("garden_") > -1)) - { - return SCRIPT_CONTINUE; - } - } - - if (!player_structure.isInAdminRange(structure, self)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isOwner(structure, self)) - { - LOG("LOG_CHANNEL", "You must be the owner to rename a structure."); - sendSystemMessage(self, new string_id(STF, "rename_must_be_owner")); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(structure, hq.VAR_HQ_BASE)) - { - sendSystemMessage(self, new string_id(STF, "no_rename_hq")); - return SCRIPT_CONTINUE; - } - - obj_id nameTarget = structure; - - if (player_structure.isBuilding(structure)) - { - obj_id sign = getObjIdObjVar(structure, player_structure.VAR_SIGN_ID); - if (isIdValid(sign)) - { - nameTarget = sign; - } - } - - int i = 0; - int textlen = params.length(); - while (textlen > i && '@' == params.charAt(i)) - { - testAbortScript(); - ++i; - } - params = params.substring(i, textlen); - - if (params == null || params.length() < 1) - { - String title = utils.packStringId (SID_SET_NAME_TITLE); - String prompt = utils.packStringId (SID_SET_NAME_PROMPT); - - sui.filteredInputbox(self, self, prompt, title, "msgNameStructure", player_structure.getStructureName(structure)); - return SCRIPT_CONTINUE; - } - - if (!isAppropriateText(params)) - { - LOG("LOG_CHANNEL", self + " ->That is not a valid name."); - sendSystemMessage(self, new string_id(STF, "not_valid_name")); - return SCRIPT_CONTINUE; - } - - String abandonedText = ""; - - if (player_structure.isAbandoned(structure) || player_structure.isPreAbandoned(structure)) - { - - if (params.indexOf(player_structure.ABANDONED_TEXT) == -1) - { - if (params.length() > 100) - { - params = params.substring(0, 99); - } - - abandonedText = player_structure.ABANDONED_TEXT; - } - } - - setName(nameTarget, params + abandonedText); - - LOG("LOG_CHANNEL", nameTarget + " ->Structure renamed to '"+ params + abandonedText + "'."); - - if (nameTarget == structure) - { - sendSystemMessage(self, new string_id(STF, "structure_renamed")); - } - else - { - setObjVar(structure, player_structure.VAR_SIGN_NAME, params); - prose_package ppSignNamed = prose.getPackage(PROSE_SIGN_NAME_UPDATED, params); - sendSystemMessageProse(self, ppSignNamed); - } - - return SCRIPT_CONTINUE; - } - - - public int paWithdraw(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - obj_id structure = player_structure.getStructure(self); - if (utils.isFreeTrial(self)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isGuildHall(structure)) - { - LOG("LOG_CHANNEL", self + " ->You can only do that in a guild hall."); - sendSystemMessage(self, new string_id(STF, "only_in_guildhall")); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isInAdminRange(structure, self)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isAdmin(structure, self)) - { - LOG("LOG_CHANNEL", self + " ->You must be an administrator to remove credits from the treasury."); - sendSystemMessage(self, new string_id(STF, "withdraw_admin_only")); - return SCRIPT_CONTINUE; - } - - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - if (st.countTokens() == 0) - { - - int pid = sui.inputbox(self, self, utils.packStringId(SID_SUI_AMOUNT_TO_WITHDRAW), "msgWithdrawMaintenance"); - - return SCRIPT_CONTINUE; - } - - String amt_str = st.nextToken(); - int amt = utils.stringToInt(amt_str); - if (amt < 1) - { - LOG("LOG_CHANNEL", self + " ->The amount must be greater than zero."); - sendSystemMessage(self, new string_id(STF, "amt_greater_than_zero")); - return SCRIPT_CONTINUE; - } - - if (!money.hasFunds(structure, money.MT_TOTAL, amt)) - { - LOG("LOG_CHANNEL", self + " ->Insufficent funds for withdrawal."); - sendSystemMessage(self, new string_id(STF, "insufficient_funds_withdrawal")); - } - else - { - player_structure.withdrawMaintenance(self, structure, amt); - } - - return SCRIPT_CONTINUE; - } - - - public int itemRotateRight(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - int rotateDegrees = getFurnitureRotationDegree(self); - queueCommand(self, (-1460986552), target, "yaw -"+ rotateDegrees + " "+ target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemRotateLeft(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - int rotateDegrees = getFurnitureRotationDegree(self); - queueCommand(self, (-1460986552), target, "yaw "+ rotateDegrees + " "+ target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemRotateForward(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (player_structure.canRotateFurnitureInPitchRollAxes(self) || isGod(self)) - { - int rotateDegrees = getFurnitureRotationDegree(self); - queueCommand(self, (-1460986552), target, "pitch "+ rotateDegrees + " "+ target, COMMAND_PRIORITY_DEFAULT); - } - - return SCRIPT_CONTINUE; - } - - - public int itemRotateBackward(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (player_structure.canRotateFurnitureInPitchRollAxes(self) || isGod(self)) - { - int rotateDegrees = getFurnitureRotationDegree(self); - queueCommand(self, (-1460986552), target, "pitch -"+ rotateDegrees + " "+ target, COMMAND_PRIORITY_DEFAULT); - } - - return SCRIPT_CONTINUE; - } - - - public int itemRotateClockwise(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (player_structure.canRotateFurnitureInPitchRollAxes(self) || isGod(self)) - { - int rotateDegrees = getFurnitureRotationDegree(self); - queueCommand(self, (-1460986552), target, "roll "+ rotateDegrees + " "+ target, COMMAND_PRIORITY_DEFAULT); - } - - return SCRIPT_CONTINUE; - } - - - public int itemRotateCounterclockwise(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (player_structure.canRotateFurnitureInPitchRollAxes(self) || isGod(self)) - { - int rotateDegrees = getFurnitureRotationDegree(self); - queueCommand(self, (-1460986552), target, "roll -"+ rotateDegrees + " "+ target, COMMAND_PRIORITY_DEFAULT); - } - - return SCRIPT_CONTINUE; - } - - - public int itemRotateRandom(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (player_structure.canRotateFurnitureInPitchRollAxes(self) || isGod(self)) - { - queueCommand(self, (-1460986552), target, "random "+target, COMMAND_PRIORITY_DEFAULT); - } - - return SCRIPT_CONTINUE; - } - - - public int itemRotateRandomYaw(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (-1460986552), target, "yaw random "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemRotateRandomPitch(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (player_structure.canRotateFurnitureInPitchRollAxes(self) || isGod(self)) - { - queueCommand(self, (-1460986552), target, "pitch random "+target, COMMAND_PRIORITY_DEFAULT); - } - - return SCRIPT_CONTINUE; - } - - - public int itemRotateRandomRoll(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (player_structure.canRotateFurnitureInPitchRollAxes(self) || isGod(self)) - { - queueCommand(self, (-1460986552), target, "roll random "+target, COMMAND_PRIORITY_DEFAULT); - } - - return SCRIPT_CONTINUE; - } - - - public int itemRotateReset(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (-1460986552), target, "reset "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemRotateCopy(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (-1460986552), target, "copy "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemMoveForward(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (1265935363), target, "forward 10 "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemMoveBack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (1265935363), target, "back 10 "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemMoveLeft(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (1265935363), target, "left 10 "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemMoveRight(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (1265935363), target, "right 10 "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemMoveUp(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (1265935363), target, "up 1 "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemMoveDown(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (1265935363), target, "down 1 "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemMoveCopyLocation(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (1265935363), target, "copy location "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int itemMoveCopyHeight(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - queueCommand(self, (1265935363), target, "copy height "+target, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int cmdAddPower(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::cmdAddPower"); - if (utils.hasScriptVar(self, "addPower.pid")) - { - int oldpid = utils.getIntScriptVar(self, "addPower.pid"); - sui.closeSUI(self, oldpid); - utils.removeScriptVarTree(self, "addPower"); - } - - obj_id structure = player_structure.getStructure(self); - if (!player_structure.isOwner(structure, self)) - { - if (utils.isFreeTrial(self)) - { - sendSystemMessage(self, SID_TRIAL_STRUCTURE); - return SCRIPT_CONTINUE; - } - } - - if (!isIdValid(structure)) - { - LOG("LOG_CHANNEL", "You must be in a building, be near an installation, or have one targeted to do that."); - sendSystemMessage(self, new string_id(STF, "no_building")); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isAdmin(structure, self)) - { - LOG("LOG_CHANNEL", "You must be a building admin to do that."); - sendSystemMessage(self, new string_id(STF, "must_be_admin")); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isInAdminRange(structure, self)) - { - return SCRIPT_CONTINUE; - } - - if (player_structure.isCivic(structure)) - { - return SCRIPT_CONTINUE; - } - - if (getPowerRate(structure) <= 0) - { - sendSystemMessage(self, new string_id(STF, "no_power_needed")); - return SCRIPT_CONTINUE; - } - - int amt = 0; - if (params == null || params.equals("")) - { - - int totalEnergy = resource.getEnergyTotalOnTarget(self); - int maint_pool = getBankBalance(structure); - int pid = sui.transfer(self, self, getString(new string_id (STF, "select_power_amount")) + "\n\n"+ getString(new string_id (STF, "current_power_value")) + (int)getPowerValue(structure), "@player_structure:add_power", "@player_structure:total_energy", totalEnergy, "@player_structure:to_deposit", 0, "msgAddPower"); - if (pid > -1) - { - utils.setScriptVar(self, "addPower.pid", pid); - utils.setScriptVar(self, "addPower.target", structure); - } - return SCRIPT_CONTINUE; - } - else - { - amt = utils.stringToInt(params); - if (amt < 1) - { - sendSystemMessage(self, SID_UNABLE_TO_PARSE); - sendSystemMessage(self, SID_VALID_AMOUNT); - return SCRIPT_CONTINUE; - } - } - - int inInv = 0; - dictionary d = new dictionary(); - - obj_id[] contents = utils.getFilteredPlayerContents(self); - if ((contents == null) || (contents.length == 0)) - { - return SCRIPT_CONTINUE; - } - - for (int n = 0; n < contents.length; n++) - { - testAbortScript(); - int got = getGameObjectType(contents[n]); - if (isGameObjectTypeOf(got, GOT_resource_container)) - { - obj_id crate = contents[n]; - if (isIdValid(crate)) - { - obj_id rId = getResourceContainerResourceType(crate); - if (isIdValid(rId)) - { - if (isResourceDerivedFrom(rId, "energy") || isResourceDerivedFrom(rId, "radioactive")) - { - - int inCrate = resource.getPotentialEnergyValue(crate); - inInv += inCrate; - d.put(crate.toString(), inCrate); - } - } - } - } - } - - if (inInv < 1) - { - return SCRIPT_CONTINUE; - } - - if (amt > inInv) - { - - sendSystemMessage(self, SID_NOT_ENOUGH_ENERGY); - sendSystemMessage(self, SID_POWER_DEPOSIT_INCOMPLETE); - return SCRIPT_CONTINUE; - } - - int toTransfer = amt; - - java.util.Enumeration keys = d.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)(keys.nextElement()); - obj_id crate = utils.stringToObjId(key); - if (isIdValid(crate)) - { - int inCrate = d.getInt(key); - if (toTransfer < inCrate) - { - obj_id rId = getResourceContainerResourceType(crate); - if (isIdValid(rId)) - { - int toRemove = (int)(Math.ceil(toTransfer/resource.getEnergyPowerRatio(rId))); - removeResourceFromContainer(crate, rId, toRemove); - toTransfer -= toTransfer; - } - } - else - { - destroyObject(crate); - toTransfer -= inCrate; - } - } - - if (toTransfer < 1) - { - break; - } - } - - if (toTransfer > 0) - { - sendSystemMessage(self, SID_ERROR_POWER_DEPOSIT); - return SCRIPT_CONTINUE; - } - - float cur = player_structure.powerInstallation(structure, amt); - if (cur > -1f) - { - sendSystemMessageProse(self, prose.getPackage(new string_id (STF, "deposit_successful"), amt)); - sendSystemMessageProse(self, prose.getPackage(new string_id (STF, "reserve_report"), (int)cur)); - } - else - { - sendSystemMessage(self, SID_POWER_DEPOSIT_FAIL); - } - - return SCRIPT_CONTINUE; - } - - - public int assignDroid(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id structure = player_structure.getStructure(self); - - if (!player_structure.isOwner(structure, self)) - { - if (utils.isFreeTrial(self)) - { - sendSystemMessage(self, SID_TRIAL_STRUCTURE); - return SCRIPT_CONTINUE; - } - } - - if (!isIdValid(structure)) - { - LOG("LOG_CHANNEL", self + " ->You must in a building or near an installation to use that command."); - sendSystemMessage(self, new string_id(STF, "command_no_building")); - return SCRIPT_CONTINUE; - } - - if (player_structure.isCivic(structure)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isInAdminRange(structure, self)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isAdmin(structure, self)) - { - LOG("LOG_CHANNEL", "You must be a building admin to do that."); - sendSystemMessage(self, new string_id(STF, "must_be_admin")); - return SCRIPT_CONTINUE; - } - - obj_id[] droid_list = player_structure.getMaintenanceDroids(self); - - if (droid_list.length <= 0) - { - LOG("LOG_CHANNEL", "You do not have any maintenance capable droids."); - sendSystemMessage(self, new string_id(STF, "no_droids")); - return SCRIPT_CONTINUE; - } - - String[] list = new String[droid_list.length]; - for (int i = 0; i < list.length; i++) - { - testAbortScript(); - list[i] = getEncodedName(droid_list[i]); - } - - String title = utils.packStringId (SID_ASSIGN_DROID_TITLE); - String prompt = utils.packStringId (SID_ASSIGN_DROID_PROMPT); - - sui.listbox(self, self, prompt, sui.OK_CANCEL, title, list, "msgAssignDroid"); - - return SCRIPT_CONTINUE; - } - - - public int cmdDepositPowerIncubator(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id player = self; - obj_id station = target; - int amt = 0; - - if (!incubator.validateActiveUser(station, player)) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(player, "depositPowerIncubator.pid")) - { - int oldpid = utils.getIntScriptVar(player, "depositPowerIncubator.pid"); - sui.closeSUI(player, oldpid); - utils.removeScriptVarTree(player, "depositPowerIncubator"); - } - - if (params == null || params.equals("")) - { - dictionary energyInfo = resource.getGeoThermalEnergyInformationOnTarget(player); - int totalEnergy = energyInfo.getInt("cnt"); - int resourceQuality = energyInfo.getInt("resourceQuality"); - String resourceName = energyInfo.getString("resourceName"); - - if (resourceName == null || resourceName.equals("")) - { - return SCRIPT_CONTINUE; - } - - if (totalEnergy > 0) - { - - if (totalEnergy >= incubator.RESOURCE_POWER_AMOUNT_CAP) - { - totalEnergy = incubator.RESOURCE_POWER_AMOUNT_CAP; - } - - if (incubator.hasPower(station)) - { - int amountInStation = incubator.getStationPowerAmount(station); - int totalEnergyCap = incubator.RESOURCE_POWER_AMOUNT_CAP - amountInStation; - - if (totalEnergy >= totalEnergyCap) - { - totalEnergy = totalEnergyCap; - } - } - - if (!incubator.addPowerPreCheck(station, player, totalEnergy, resourceName)) - { - return SCRIPT_CONTINUE; - } - - int pid = sui.transfer(player, player, getString(SID_SELECT_POWER_AMOUNT) + "\n"+ getString(SID_CURRENT_POWER_AMOUNT) + incubator.getStationPowerAmount(station) +"\n"+ getString(SID_POWER_NAME) + resourceName +"\n"+ getString(SID_POWER_QUALITY) + resourceQuality , "@player_structure:add_power", "@player_structure:total_energy", totalEnergy, "@player_structure:to_deposit", 0, "msgDepositPowerIncubator"); - if (pid > -1) - { - utils.setScriptVar(self, "depositPowerIncubator.pid", pid); - utils.setScriptVar(self, "depositPowerIncubator.target", station); - - utils.setScriptVar(self, "powerIncubator.resourceName", resourceName); - } - } - else - { - - sendSystemMessage(player, SID_NO_GEO_POWER); - } - return SCRIPT_CONTINUE; - } - else - { - amt = utils.stringToInt(params); - if (amt < 1) - { - - sendSystemMessage(player, SID_UNABLE_TO_PARSE); - sendSystemMessage(player, SID_VALID_AMOUNT); - return SCRIPT_CONTINUE; - } - } - - int inInventory = 0; - int resourceQuality = 0; - dictionary resourceInfo = new dictionary(); - obj_id[] contents = utils.getFilteredPlayerContents(player); - Vector tempList = new Vector(); - tempList.setSize(0); - String resourceName = utils.getStringScriptVar(self, "powerIncubator.resourceName"); - - if (resourceName != null && !resourceName.equals("")) - { - tempList.addElement(resourceName); - } - - if ((contents == null) || (contents.length == 0) || (tempList.size() == 0)) - { - return SCRIPT_CONTINUE; - } - - for (int n = 0; n < contents.length; n++) - { - testAbortScript(); - int got = getGameObjectType(contents[n]); - if (isGameObjectTypeOf(got, GOT_resource_container)) - { - obj_id resourceCrate = contents[n]; - if (isIdValid(resourceCrate)) - { - obj_id resourceId = getResourceContainerResourceType(resourceCrate); - if (isIdValid(resourceId)) - { - if (isResourceDerivedFrom(resourceId, "energy_renewable_site_limited_geothermal")) - { - String tempResourceName = getResourceName(resourceId); - - if (tempList.contains(tempResourceName)) - { - resourceQuality = getResourceAttribute(resourceId, "res_quality"); - int inCrate = getResourceContainerQuantity(resourceCrate); - inInventory += inCrate; - resourceInfo.put(resourceCrate.toString(), inCrate); - } - } - } - } - } - } - - utils.removeScriptVarTree(player, "powerIncubator"); - - if (inInventory < 1) - { - return SCRIPT_CONTINUE; - } - - if (amt > inInventory) - { - - sendSystemMessage(player, SID_NOT_ENOUGH_ENERGY); - sendSystemMessage(player, SID_POWER_DEPOSIT_INCOMPLETE); - return SCRIPT_CONTINUE; - } - - if (!incubator.addPowerPreCheck(station, player, amt, resourceName)) - { - return SCRIPT_CONTINUE; - } - - int toTransfer = amt; - java.util.Enumeration keys = resourceInfo.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)(keys.nextElement()); - obj_id resourceCrate = utils.stringToObjId(key); - if (isIdValid(resourceCrate)) - { - int inCrate = resourceInfo.getInt(key); - if (toTransfer < inCrate) - { - obj_id resourceId = getResourceContainerResourceType(resourceCrate); - if (isIdValid(resourceId)) - { - int toRemove = toTransfer; - removeResourceFromContainer(resourceCrate, resourceId, toRemove); - toTransfer -= toTransfer; - } - } - else - { - destroyObject(resourceCrate); - toTransfer -= inCrate; - } - } - - if (toTransfer < 1) - { - break; - } - } - - if (toTransfer > 0) - { - - sendSystemMessage(player, SID_ERROR_POWER_DEPOSIT); - return SCRIPT_CONTINUE; - } - - if (incubator.addPowerIncubator(station, player, amt, resourceQuality , resourceName)) - { - - sendSystemMessageProse(player, prose.getPackage((SID_DEPOSIT_SUCCESS), amt)); - - sendSystemMessageProse(player, prose.getPackage((SID_RESERVE_REPORT), incubator.getStationPowerAmount(station))); - } - else - { - - sendSystemMessage(player, SID_POWER_DEPOSIT_FAIL); - } - - return SCRIPT_CONTINUE; - } - - - public int cmdRemovePowerIncubator(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id player = self; - obj_id station = target; - - if (!incubator.validateActiveUser(station, player)) - { - sendSystemMessage(player, incubator.SID_NOT_YOUR_INCUBATOR); - return SCRIPT_CONTINUE; - } - - if (incubator.removeAllPowerIncubator(station, player)) - { - sendSystemMessage(player, SID_POWER_REMOVED); - } - - return SCRIPT_CONTINUE; - } - - - public int placeStructureMode(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - player_structure.tryEnterPlacementMode(target, self); - return SCRIPT_CONTINUE; - } - - - public int failPlaceStructureMode(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::failPlaceStructureMode"); - - sendSystemMessage(self, SID_WRONG_STATE); - - return SCRIPT_CONTINUE; - } - - - public int setPermission(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::setPermission-- params ->"+ params + " target ->"+ target); - - obj_id structure = player_structure.getStructure(self); - - if (utils.isFreeTrial(self)) - { - sendSystemMessage(self, SID_TRIAL_NO_MODIFY); - return SCRIPT_CONTINUE; - } - - LOG("LOG_CHANNEL", "structure ->"+ structure); - if (!isIdValid(structure)) - { - LOG("LOG_CHANNEL", "You must be in a building, be near an installation, or have one targeted to do that."); - sendSystemMessage(self, new string_id(STF, "no_building")); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(structure, hq.VAR_HQ_BASE)) - { - return SCRIPT_CONTINUE; - } - - String template = getTemplateName(structure); - if (player_structure.isCivic(structure)) - { - if (!(template.indexOf("cityhall_") > -1)) - { - return SCRIPT_CONTINUE; - } - } - - if (player_structure.isHarvester(structure) || player_structure.isGenerator(structure)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isAdmin(structure, self)) - { - LOG("LOG_CHANNEL", "You must be a building admin to do that."); - string_id strSpam = new string_id("player_structure", "not_admin"); - sendSystemMessage(self, strSpam); - - return SCRIPT_CONTINUE; - } - - if (!player_structure.isInAdminRange(structure, self)) - { - return SCRIPT_CONTINUE; - } - - if (!isPlayer(target) && !isMob(target)) - { - - target = obj_id.NULL_ID; - } - - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - if (st.countTokens() == 0) - { - LOG("LOG_CHANNEL", "Format: /setPermission "); - sendSystemMessage(self, new string_id(STF, "format_setpermission_type_player")); - return SCRIPT_CONTINUE; - } - - String perm_type = st.nextToken().toUpperCase(); - - String target_str = ""; - if (st.hasMoreTokens()) - { - - target_str = st.nextToken(); - if (target_str.length() > 40) - { - sendSystemMessage(self, new string_id(STF, "permission_40_char")); - return SCRIPT_CONTINUE; - } - } - - if ((target == null)||(target == obj_id.NULL_ID)) - { - - if (target_str.equals("")) - { - target = getLookAtTarget(self); - - if (!isPlayer(target) && !isMob(target)) - { - target = obj_id.NULL_ID; - } - } - } - - LOG("LOG_CHANNEL", "perm_type ->"+ perm_type + " target ->"+ target + " target_str ->"+ target_str); - - int perm_switch = -1; - - if (perm_type.equals("ENTRY")) - { - perm_switch = 1; - } - if (perm_type.equals("BAN")) - { - perm_switch = 2; - } - if (perm_type.equals("ADMIN")) - { - perm_switch = 3; - } - - if (perm_type.equals("HOPPER")) - { - perm_switch = 5; - } - - if (player_structure.isBuilding(structure)) - { - if (perm_switch == 5) - { - LOG("LOG_CHANNEL", "Buildings do not have that permission list."); - sendSystemMessage(self, new string_id(STF, "building_no_permission_list")); - return SCRIPT_CONTINUE; - } - } - - if (player_structure.isInstallation(structure)) - { - if (perm_switch == 1 || perm_switch == 2 || perm_switch == 4) - { - LOG("LOG_CHANNEL", "Installations do not have that permission list."); - sendSystemMessage(self, new string_id(STF, "installations_no_permission_list")); - return SCRIPT_CONTINUE; - } - } - - if (isGameObjectTypeOf(getGameObjectType(structure), GOT_ship)) - { - - if (perm_switch != 3) - { - sendSystemMessage(self, new string_id(STF, "ships_no_permission_list")); - return SCRIPT_CONTINUE; - } - } - - if ((perm_switch == 3) && (getAccountNumLots(getPlayerObject(self)) > player_structure.MAX_LOTS)) - { - obj_id lotOverlimitStructure = getObjIdObjVar(self, "lotOverlimit.structure_id"); - if (isIdValid(lotOverlimitStructure) && (lotOverlimitStructure == structure)) - { - sendSystemMessage(self, new string_id(STF, "lot_overlimit_cannot_edit_admin_list")); - return SCRIPT_CONTINUE; - } - } - - if (((target == null) || (target == obj_id.NULL_ID)) && (target_str.equals(""))) - { - String[] dsrc; - String title; - String handler; - switch (perm_switch) - { - case 1: - if (isGod(self)) - { - dsrc = player_structure.getCompleteEntryList(structure); - } - else - { - dsrc = player_structure.getEntryList(structure); - } - title = getString(new string_id(STF, "entry_permissions_list")); - handler = "msgEnterPermissions"; - break; - case 2: - dsrc = player_structure.getBanList(structure); - title = getString(new string_id(STF, "ban_list")); - handler = "msgBanPermissions"; - break; - case 3: - dsrc = player_structure.getAdminListNames(structure); - title = getString(new string_id(STF, "admin_permissions_list")); - handler = "msgAdminPermissions"; - break; - case 4: - dsrc = player_structure.getVendorList(structure); - title = getString(new string_id(STF, "vendor_permissions_list")); - handler = "msgVendorPermissions"; - break; - case 5: - dsrc = player_structure.getHopperListNames(structure); - title = getString(new string_id(STF, "hopper_permissions_list")); - handler = "msgHopperPermissions"; - break; - default: - LOG("LOG_CHANNEL", "You must specify a valid permission list (Entry, Ban, Admin, Hopper)"); - sendSystemMessage(self, new string_id(STF, "must_specify_list")); - return SCRIPT_CONTINUE; - } - if (dsrc == null) - { - - dsrc = new String[0]; - } - - obj_id[] players; - if (player_structure.isBuilding(structure)) - { - - players = getPlayerCreaturesInRange(structure, 30.0f); - } - else - { - players = player_structure.getPlayersNearInstallation(structure); - } - - Vector player_names = new Vector(); - player_names.setSize(0); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - String player_name = getFirstName(players[i]); - LOG("LOG_CHANNEL", "Found "+ player_name); - int idx = utils.getElementPositionInArray(dsrc, player_name); - if (idx == -1) - { - LOG("LOG_CHANNEL", " ...Adding "+ player_name); - player_names = utils.addElement(player_names, player_name); - } - } - } - - LOG("LOG_CHANNEL", "players #->"+ player_names.size() + " self ->"+ self); - String[] player_names_array = new String[0]; - if (player_names != null) - { - player_names_array = new String[player_names.size()]; - player_names.toArray(player_names_array); - } - displayStructurePermissionData(self, dsrc, player_names_array, perm_type); - - } - else - { - - if (target_str.equals("")) - { - - switch (perm_switch) - { - case 1: - player_structure.modifyEntryList(structure, target, self); - break; - case 2: - player_structure.modifyBanList(structure, target, self); - break; - case 3: - player_structure.modifyAdminList(structure, target, self); - break; - case 4: - player_structure.modifyVendorList(structure, target, self); - break; - case 5: - player_structure.modifyHopperList(structure, target, self); - break; - default: - LOG("LOG_CHANNEL", "You must specify a valid permission list (Entry, Ban, Admin, Hopper)"); - sendSystemMessage(self, new string_id(STF, "must_specify_list")); - return SCRIPT_CONTINUE; - } - } - else - { - - switch (perm_switch) - { - case 1: - player_structure.modifyEntryList(structure, target_str, self); - break; - case 2: - player_structure.modifyBanList(structure, target_str, self); - break; - case 3: - player_structure.modifyAdminList(structure, target_str, self); - break; - case 4: - player_structure.modifyVendorList(structure, target_str, self); - break; - case 5: - player_structure.modifyHopperList(structure, target_str, self); - break; - default: - LOG("LOG_CHANNEL", "You must specify a valid permission list (Entry, Ban, Admin, Hopper)"); - sendSystemMessage(self, new string_id(STF, "must_specify_list")); - return SCRIPT_CONTINUE; - } - } - - } - return SCRIPT_CONTINUE; - } - - - public int structureStatus(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - LOG("house", "commandHandler:structureStatus"); - if (utils.hasScriptVar(self, "player_structure.status.pid")) - { - int oldpid = utils.getIntScriptVar(self, "player_structure.status.pid"); - sui.closeSUI(self, oldpid); - utils.removeScriptVarTree(self, "player_structure.status"); - } - - LOG("LOG_CHANNEL", "player_building::structureStatus"); - obj_id structure = null; - if (isIdValid(target)) - { - if (player_structure.isBuilding(target) || player_structure.isInstallation(target)) - { - structure = target; - } - else - { - structure = player_structure.getStructure(target); - } - } - if (structure == null) - { - structure = player_structure.getStructure(self); - } - - LOG("house", "structureStatus - structure = "+ structure); - if (!isIdValid(structure)) - { - LOG("LOG_CHANNEL", "You must be in a building, be near an installation, or have one targeted to do that."); - sendSystemMessage(self, new string_id(STF, "no_building")); - return SCRIPT_CONTINUE; - } - - String buildingTemplateName = getTemplateName(structure); - - int sGot = getGameObjectType(structure); - if (!player_structure.isAdmin(structure, self)) - { - boolean allowContinue = false; - - if (sGot == GOT_building_factional || sGot == GOT_installation_turret || sGot == GOT_installation_minefield) - { - int pFac = pvpGetAlignedFaction(self); - int sFac = pvpGetAlignedFaction(structure); - if (pFac == sFac) - { - allowContinue = true; - } - } - - if (!allowContinue) - { - LOG("LOG_CHANNEL", "You must be a building admin to do that."); - sendSystemMessage(self, new string_id(STF, "must_be_admin")); - return SCRIPT_CONTINUE; - } - } - - if (!player_structure.isInAdminRange(structure, self)) - { - return SCRIPT_CONTINUE; - } - - Vector dsrc = new Vector(); - dsrc.setSize(0); - String owner_name = player_structure.getStructureOwner(structure); - if (owner_name != null) - { - owner_name = toUpper(owner_name, 0); - string_id owner_prompt_text = new string_id(STF, "owner_prompt"); - dsrc = utils.addElement(dsrc, getString(owner_prompt_text) + owner_name); - } - - if (player_structure.isResidence(structure, self)) - { - string_id residency_declaration = new string_id(STF, "declared_residency"); - dsrc = utils.addElement(dsrc, getString(residency_declaration)); - } - - int civic_var = 0; - int m_rate = 0; - int m_rate_base = 0; - - if (!player_structure.isCivic(structure)) - { - - if (permissionsIsPublic(structure)) - { - string_id public_structure = new string_id(STF, "structure_public"); - dsrc = utils.addElement(dsrc, getString(public_structure)); - } - else - { - string_id private_structure = new string_id(STF, "structure_private"); - dsrc = utils.addElement(dsrc, getString(private_structure)); - } - - int condition = player_structure.getStructureCondition(structure); - int max_condition = player_structure.getMaxCondition(structure); - - int perc_condition = condition * 100 / max_condition; - - if (perc_condition == 100) - { - string_id condition_prompt_text = new string_id(STF, "condition_prompt"); - dsrc = utils.addElement(dsrc, getString(condition_prompt_text) + perc_condition + "%"); - } - else - { - int maint_rate = player_structure.getBaseMaintenanceRate(structure); - int total_cost = (int)((max_condition - condition) * maint_rate / 3.0f); - string_id condition_prompt_text_damaged = new string_id(STF, "condition_prompt"); - string_id credits_to_repair_suffix = new string_id(STF, "credits_to_repair"); - - if (buildingTemplateName.indexOf ("object/building/faction_perk/hq/") == -1) - { - dsrc = utils.addElement(dsrc, getString(condition_prompt_text_damaged) + perc_condition + "%"+ " ("+ total_cost + getString(credits_to_repair_suffix)); - } - else - { - dsrc = utils.addElement(dsrc, getString(condition_prompt_text_damaged) + perc_condition + "%"); - } - } - - int m_pool = player_structure.getMaintenancePool(structure); - m_rate = player_structure.getMaintenanceRate(structure); - - m_rate_base = player_structure.getBaseMaintenanceRate(structure); - - double time_remaining = (double)m_pool * (double)player_structure.getMaintenanceHeartbeat() / (double)m_rate; - if (time_remaining < 0 || time_remaining > Integer.MAX_VALUE) - { - time_remaining = Integer.MAX_VALUE; - } - - if (m_pool > 0) - { - - String time_str = utils.assembleTimeRemainToUse((int)time_remaining, false); - - if (player_structure.isGuildHall(structure)) - { - string_id treasury_prompt_text = new string_id(STF, "treasury_prompt"); - dsrc = utils.addElement(dsrc, getString(treasury_prompt_text) + m_pool + " ("+ time_str + ")"); - } - else - { - - if (buildingTemplateName.indexOf ("object/building/faction_perk/hq/") == -1) - { - - string_id maintenance_prompt_text = new string_id(STF, "maintenance_pool_prompt"); - dsrc = utils.addElement(dsrc, getString(maintenance_prompt_text) + m_pool + " ("+ time_str + ")"); - } - } - } - else - { - if (player_structure.isGuildHall(structure)) - { - string_id treasury_empty_text = new string_id(STF, "treasury_prompt"); - dsrc = utils.addElement(dsrc, getString(treasury_empty_text) + m_pool); - } - else - { - - if (buildingTemplateName.indexOf ("object/building/faction_perk/hq/") == -1) - { - - string_id maintenance_empty_text = new string_id(STF, "maintenance_pool_prompt"); - dsrc = utils.addElement(dsrc, getString(maintenance_empty_text) + m_pool); - } - } - } - - } - int hourly_m_rate = m_rate*(3600/player_structure.getMaintenanceHeartbeat()); - - civic_var = getIntObjVar(structure, player_structure.VAR_CIVIC); - if (civic_var == 1) - { - hourly_m_rate = 0; - } - - if (buildingTemplateName.indexOf ("object/building/faction_perk/hq/") == -1) - { - - if (m_rate == m_rate_base) - { - string_id maintenance_rate_text = new string_id(STF, "maintenance_rate_prompt"); - dsrc = utils.addElement(dsrc, getString(maintenance_rate_text) + Integer.toString(hourly_m_rate) + " cr/hr"); - } - else - { - int hourly_m_rate_base = m_rate_base*(3600/player_structure.getMaintenanceHeartbeat()); - string_id maintenance_rate_mod_text = new string_id(STF, "maintenance_rate_prompt"); - dsrc = utils.addElement(dsrc, getString(maintenance_rate_mod_text) + Integer.toString(hourly_m_rate) + " cr/hr ("+hourly_m_rate_base+")"); - } - } - - if (buildingTemplateName.indexOf ("object/building/faction_perk/hq/") == -1) - { - - int property_tax = city.getPropertyTax(structure); - if (property_tax > 0) - { - string_id maintenance_rate_mod_text = new string_id(STF, "property_tax_rate_prompt"); - dsrc = utils.addElement(dsrc, getString(maintenance_rate_mod_text) + property_tax + "%"); - } - } - - if (player_structure.isHarvester(structure) || player_structure.isFactory(structure)) - { - float p_pool = getPowerValue(structure); - float p_rate = getPowerRate(structure); - int p_time = Math.round(p_pool / p_rate * 3600f); - - if (p_pool > 0) - { - - String p_time_string = utils.assembleTimeRemainToUse(p_time, false); - - string_id power_reserve_empty_text = new string_id(STF, "power_reserve_prompt"); - dsrc = utils.addElement(dsrc, getString(power_reserve_empty_text) + (int)p_pool + " ("+ p_time_string + ")"); - } - else - { - string_id power_reserve_text = new string_id(STF, "power_reserve_prompt"); - dsrc = utils.addElement(dsrc, getString(power_reserve_text) + (int)p_pool); - } - string_id power_consumption_text = new string_id(STF, "power_consumption_prompt"); - string_id units_per_hour_text = new string_id(STF, "units_per_hour"); - dsrc = utils.addElement(dsrc, getString(power_consumption_text) + Integer.toString((int)p_rate) + getString(units_per_hour_text)); - } - - if (sGot == GOT_building_factional && hasObjVar(structure, hq.VAR_HQ_BASE)) - { - if (player_structure.isAdmin(structure, self) || pvpGetCurrentGcwRank(self) >= 6) - { - int now = getGameTime(); - - string_id resource_reserves_text = new string_id(STF, "resource_reserves_prompt"); - string_id units_suffix_text = new string_id(STF, "units_suffix"); - dsrc = utils.addElement(dsrc, getString(resource_reserves_text) + getIntObjVar(structure, hq.VAR_HQ_RESOURCE_CNT) + getString(units_suffix_text)); - - if (hasObjVar(structure, player_structure.VAR_LAST_MAINTANENCE)) - { - int stamp = getIntObjVar(structure, player_structure.VAR_LAST_MAINTANENCE); - int maint_delta = stamp + player_structure.getMaintenanceHeartbeat() - now; - if (maint_delta > 0) - { - int[] mTime = player_structure.convertSecondsTime(maint_delta); - String m_time_string = player_structure.assembleTimeRemaining(mTime); - string_id repair_cycle_text = new string_id(STF, "next_repair_cycle"); - dsrc = utils.addElement(dsrc, getString(repair_cycle_text) + m_time_string); - } - } - - if (hasObjVar(structure, hq.VAR_OBJECTIVE_STAMP)) - { - long current = System.currentTimeMillis(); - long curTime = ((current / 1000) - 1072224000); - - int currentTime = (int) curTime; - - int stamp = getIntObjVar(structure, hq.VAR_OBJECTIVE_STAMP); - int objective_delta = stamp + (int)(hq.VULNERABILITY_CYCLE) - currentTime; - if (objective_delta > 0) - { - int[] oTime = player_structure.convertSecondsTime(objective_delta); - String o_time_string = player_structure.assembleTimeRemaining(oTime); - string_id vulnerability_text = new string_id(STF, "next_vulnerability_prompt"); - dsrc = utils.addElement(dsrc, getString(vulnerability_text) + o_time_string); - } - } - } - } - - if (player_structure.isBuilding(structure)) - { - int numItems = player_structure.getStructureNumItems(structure); - string_id building_items_text = new string_id(STF, "items_in_building_prompt"); - dsrc = utils.addElement(dsrc, getString(building_items_text) + numItems); - - int itemLimit = getPobBaseItemLimit(structure); - - if (hasObjVar(structure, "structureChange.storageIncrease")) - { - int storageIncrease = getIntObjVar(structure, "structureChange.storageIncrease"); - itemLimit += storageIncrease; - } - dsrc = utils.addElement(dsrc, "@player_structure:total_house_storage"+ " "+ itemLimit); - } - - if (hasObjVar(structure, "structureChange.storageIncrease")) - { - int storageIncrease = getIntObjVar(structure, "structureChange.storageIncrease"); - string_id storage_increase = new string_id(STF, "structure_storage_increase"); - dsrc = utils.addElement(dsrc, getString(storage_increase) + storageIncrease); - } - - String prompt = ""; - - String structure_name = player_structure.getStructureName(structure); - if (structure_name != null && !structure_name.equals("")) - { - string_id structure_name_text = new string_id(STF, "structure_name_prompt"); - prompt += getString(structure_name_text) + structure_name; - } - int maint_stamp = getIntObjVar(structure, player_structure.VAR_LAST_MAINTANENCE); - int now = getGameTime(); - if (now < maint_stamp) - { - string_id free_maintenance_text = new string_id(STF, "free_maintenance_time"); - prompt += "\n\\#pcontrast1"+ getString(free_maintenance_text) + "\\#. "; - - int prepaid_delta = maint_stamp - now; - int[] prepaidTime = player_structure.convertSecondsTime(prepaid_delta); - String prepaidTimeString = player_structure.assembleTimeRemaining(prepaidTime); - if (prepaidTimeString != null && !prepaidTimeString.equals("")) - { - prompt += prepaidTimeString; - } - else - { - string_id seconds_suffix_text = new string_id(STF, "seconds_suffix"); - prompt += Integer.toString(prepaid_delta) + getString(seconds_suffix_text); - } - } - - String maint_mods_string = ""; - if (civic_var == 1) - { - string_id civic_structure_alert_text = new string_id(STF, "civic_structure_alert"); - maint_mods_string += "\n- "+ getString(civic_structure_alert_text); - } - else - { - if (hasObjVar(structure, player_structure.VAR_MAINTENANCE_MOD_MERCHANT)) - { - float merchant_mod = getFloatObjVar(structure, player_structure.VAR_MAINTENANCE_MOD_MERCHANT); - string_id merch_mod_text = new string_id(STF, "merch_mod_prompt"); - maint_mods_string += "\n- "+ getString(merch_mod_text) +Integer.toString((int)(merchant_mod*100f))+"%"; - } - - int maint_property_tax = player_structure.getMaintenancePropertyTax(structure); - if (maint_property_tax > 0) - { - int hourly_tax = Math.round(maint_property_tax * (3600f/player_structure.getMaintenanceHeartbeat())); - string_id property_tax_rate_text = new string_id(STF, "property_tax_rate_prompt"); - maint_mods_string += "\n- "+ getString(property_tax_rate_text) +Integer.toString(hourly_tax)+"cr/hr"; - } - } - - if (maint_mods_string != null && !maint_mods_string.equals("")) - { - string_id maintenance_mods_text = new string_id(STF, "maintenance_mods_prompt"); - prompt += "\n\n"+ getString(maintenance_mods_text) + maint_mods_string; - } - - int pid = sui.listbox(self, self, prompt, sui.REFRESH_CANCEL, "@player_structure:structure_status_t", dsrc, "handleStatusUi"); - if (pid > -1) - { - utils.setScriptVar(self, "player_structure.status.pid", pid); - utils.setScriptVar(self, "player_structure.status.target", structure); - if (isIdValid(target)) - { - LOG("house", "StructureStatus:: FROM SCD = true"); - utils.setScriptVar(self, "player_structure.status.fromScd", 1); - } - } - return SCRIPT_CONTINUE; - } - - - public int payMaintenance(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id structure = null; - if (isIdValid(target)) - { - if (player_structure.isBuilding(target) || player_structure.isInstallation(target)) - { - structure = target; - } - else - { - structure = player_structure.getStructure(target); - } - } - if (structure == null) - { - structure = player_structure.getStructure(self); - } - - if (!isIdValid(structure)) - { - sendSystemMessage(self, new string_id(STF, "no_building")); - return SCRIPT_CONTINUE; - } - LOG("house", "payMaintenance - structure = "+ structure); - - if (!player_structure.isOwner(structure, self)) - { - if (utils.isFreeTrial(self)) - { - sendSystemMessage(self, SID_TRIAL_STRUCTURE); - return SCRIPT_CONTINUE; - } - } - - if (player_structure.isCivic(structure)) - { - return SCRIPT_CONTINUE; - } - - String buildingTemplate = getTemplateName(structure); - if (buildingTemplate == null) - { - LOG("LOG_CHANNEL", "player_structure::payMaintenance -- Unable to find template for building."); - return SCRIPT_CONTINUE; - } - - if (player_structure.isFactionPerkBase(buildingTemplate)) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, "payMaintenance.pid")) - { - int oldpid = utils.getIntScriptVar(self, "payMaintenance.pid"); - sui.closeSUI(self, oldpid); - utils.removeScriptVarTree(self, "payMaintenance"); - } - - if (!player_structure.isAdmin(structure, self)) - { - sendSystemMessage(self, new string_id(STF, "must_be_admin")); - return SCRIPT_CONTINUE; - } - - if (player_structure.isHarvester(structure) || player_structure.isGenerator(structure)) - { - if (!player_structure.isOwner(structure, self)) - { - sendSystemMessage(self, new string_id(STF, "must_be_owner")); - return SCRIPT_CONTINUE; - } - } - - if (!player_structure.isInAdminRange(structure, self)) - { - return SCRIPT_CONTINUE; - } - - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - if (st.countTokens() == 0) - { - - int total = getTotalMoney(self); - if (total > 0) - { - int maint_pool = getBankBalance(structure); - string_id select_amount = new string_id(STF, "select_maint_amount"); - String prompt = getString(select_amount) + "\n\n "; - - prompt += getString(new string_id(STF, "current_maint_pool")) + maint_pool + "cr."; - - int pid = sui.transfer(self, self, prompt, "@player_structure:select_amount", "@player_structure:total_funds", total, "@player_structure:to_pay", 0, "msgPayMaintenance"); - if (pid > -1) - { - utils.setScriptVar(self, "payMaintenance.pid", pid); - utils.setScriptVar(self, "payMaintenance.target", structure); - } - } - else - { - sendSystemMessage(self, new string_id(STF, "no_money")); - } - - return SCRIPT_CONTINUE; - } - - String amt_str = st.nextToken(); - int amt = utils.stringToInt(amt_str); - if (amt < 1 || amt > 100000) - { - LOG("LOG_CHANNEL", "The amount must be between 1 and 100000"); - sendSystemMessage(self, new string_id(STF, "amount_params")); - return SCRIPT_CONTINUE; - } - - player_structure.payMaintenance(self, structure, amt); - - return SCRIPT_CONTINUE; - } - - - public int setPrivacy(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::setPrivacy"); - - obj_id structure = player_structure.getStructure(self); - if (!player_structure.isOwner(structure, self)) - { - if (utils.isFreeTrial(self)) - { - return SCRIPT_CONTINUE; - } - } - - if (!isIdValid(structure)) - { - LOG("LOG_CHANNEL", "You must be in a building to do that."); - sendSystemMessage(self, new string_id(STF, "must_be_in_building")); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isBuilding(structure)) - { - LOG("LOG_CHANNEL", self + " ->You can only alter privacy on a building."); - sendSystemMessage(self, new string_id(STF, "privacy_building_only")); - return SCRIPT_CONTINUE; - } - - if (player_structure.isCivic(structure)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(structure, hq.VAR_HQ_BASE)) - { - sendSystemMessage(self, new string_id(STF, "no_privacy_faction_hq")); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isAdmin(structure, self)) - { - LOG("LOG_CHANNEL", "You must be a building admin to do that."); - sendSystemMessage(self, new string_id(STF, "must_be_admin")); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(structure, "force_public")) - { - sendSystemMessage(self, new string_id(STF, "force_public")); - return SCRIPT_CONTINUE; - } - - if (permissionsIsPublic(structure)) - { - - String[] cells = getCellNames(structure); - if (cells != null) - { - for (int i=0; i= 10)) - { - int idx = utils.getElementPositionInArray(entry_list, getFirstName(objects[i])); - if (idx == -1) - { - expelFromBuilding(objects[i]); - } - } - } - } - - permissionsMakePrivate(structure); - } - else - { - LOG("LOG_CHANNEL", "This structure is now public."); - sendSystemMessage(self, new string_id(STF, "structure_now_public")); - permissionsMakePublic(structure); - - if (turnstile.hasTurnstile(structure)) - { - turnstile.removeTurnstile(structure); - } - } - - return SCRIPT_CONTINUE; - } - - - public int declareResidence(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id structure = player_structure.getStructure(self); - if (utils.isFreeTrial(self)) - { - sendSystemMessage(self, SID_NO_DECLARE); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(structure)) - { - LOG("LOG_CHANNEL", "You must be in a building to do that."); - sendSystemMessage(self, new string_id(STF, "must_be_in_building")); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isBuilding(structure)) - { - LOG("LOG_CHANNEL", "Your declared residence must be a building."); - sendSystemMessage(self, new string_id(STF, "must_be_in_building")); - return SCRIPT_CONTINUE; - } - - if (player_structure.isCivic(structure)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isOwner(structure, self)) - { - LOG("LOG_CHANNEL", "You must be the owner of the building to declare residence."); - sendSystemMessage(self, new string_id(STF, "declare_must_be_owner")); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(structure, hq.VAR_HQ_BASE)) - { - sendSystemMessage(self, new string_id(STF, "no_hq_residence")); - return SCRIPT_CONTINUE; - } - - int current_time = getGameTime(); - if (hasObjVar(self, player_structure.VAR_RESIDENCE_CAN_DECLARE)) - { - - int declared_time = getIntObjVar(self, player_structure.VAR_RESIDENCE_CAN_DECLARE); - int duration = current_time - declared_time; - if (duration < player_structure.MIN_RESIDENCE_DURATION) - { - int time_remaining = player_structure.MIN_RESIDENCE_DURATION - duration; - - String time_str = utils.assembleTimeRemainToUse(time_remaining, false); - prose_package pp = new prose_package(); - prose.setStringId(pp, new string_id (STF, "change_residence_time")); - prose.setTT(pp, time_str); - LOG("LOG_CHANNEL", "You cannot change residence for "+ time_str); - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - } - if (player_structure.isResidence(structure, self)) - { - LOG("LOG_CHANNEL", "This building is already your residence."); - sendSystemMessage(self, new string_id(STF, "already_residence")); - return SCRIPT_CONTINUE; - } - - int currentCity = getCitizenOfCityId(self); - obj_id currentCityMayor = cityGetLeader(currentCity); - if (self == currentCityMayor) - { - sendSystemMessage(self, city.SID_MAYOR_RESIDENCE_CHANGE); - return SCRIPT_CONTINUE; - } - - obj_id oldresidence = player_structure.getResidence(self); - - LOG("LOG_CHANNEL", "You change your residence to this building"); - sendSystemMessage(self, new string_id(STF, "change_residence")); - setHouseId(self, structure); - setObjVar(self, player_structure.VAR_RESIDENCE_CAN_DECLARE, current_time); - - setObjVar(structure, player_structure.VAR_RESIDENCE_BUILDING, self); - - messageTo(oldresidence, "removeResidentVar", null, 0.f, true); - city.setCityResidence(self, structure); - - skill.grantAllPoliticianSkills(self); - - return SCRIPT_CONTINUE; - } - - - public int transferStructure(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id structure = player_structure.getStructure(self); - if (!isIdValid(structure)) - { - LOG("LOG_CHANNEL", "You must be in a building, be near an installation, or have one targeted to do that."); - sendSystemMessage(self, new string_id(STF, "no_building")); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isInAdminRange(structure, self)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isOwner(structure, self)) - { - LOG("LOG_CHANNEL", self + "-> You are not the owner of this structure."); - sendSystemMessage(self, new string_id(STF, "not_owner")); - return SCRIPT_CONTINUE; - } - - if (player_structure.isCivic(structure)) - { - return SCRIPT_CONTINUE; - } - - String structureTemplateName = getTemplateName(structure); - if (structureTemplateName.indexOf ("object/building/faction_perk/hq/") != -1) - { - sendSystemMessage(self, new string_id(STF, "faction_base")); - return SCRIPT_CONTINUE; - } - - if (structureTemplateName.equals("object/building/player/player_house_mustafar_lg.iff")) - { - sendSystemMessage(self, new string_id(STF, "mustafar_house")); - return SCRIPT_CONTINUE; - } - if (structureTemplateName.equals("object/building/player/city/barn_no_planet_restriction.iff")) - { - sendSystemMessage(self, new string_id(STF, "barn_no_transfer")); - return SCRIPT_CONTINUE; - } - if (structureTemplateName.equals("object/building/player/city/diner_no_planet_restriction.iff")) - { - sendSystemMessage(self, new string_id(STF, "diner_no_transfer")); - return SCRIPT_CONTINUE; - } - if ((structureTemplateName.equals("object/building/player/player_house_jedi_meditation_room.iff") || structureTemplateName.equals("object/building/player/player_house_sith_meditation_room.iff"))) - { - sendSystemMessage(self, new string_id(STF, "meditation_room_no_transfer")); - return SCRIPT_CONTINUE; - } - if (structureTemplateName.equals("object/building/player/player_house_tcg_relaxation_pool.iff")) - { - sendSystemMessage(self, new string_id(STF, "relaxation_pool_no_transfer")); - return SCRIPT_CONTINUE; - } - if (structureTemplateName.equals("object/building/player/player_house_hangar.iff")) - { - sendSystemMessage(self, new string_id(STF, "hangar_no_transfer")); - return SCRIPT_CONTINUE; - } - if (structureTemplateName.equals("object/building/player/player_house_sandcrawler.iff")) - { - sendSystemMessage(self, new string_id(STF, "sandcrawler_house_no_transfer")); - return SCRIPT_CONTINUE; - } - if (structureTemplateName.equals("object/building/player/player_house_atat.iff")) - { - sendSystemMessage(self, new string_id(STF, "atat_house_no_transfer")); - return SCRIPT_CONTINUE; - } - if (structureTemplateName.equals("object/building/player/player_house_tcg_emperors_spire.iff")) - { - sendSystemMessage(self, new string_id(STF, "tcg_emperors_spire_house_no_transfer")); - return SCRIPT_CONTINUE; - } - if (structureTemplateName.equals("object/building/player/player_house_tcg_rebel_spire.iff")) - { - sendSystemMessage(self, new string_id(STF, "tcg_rebel_spire_house_no_transfer")); - return SCRIPT_CONTINUE; - } - if (hasObjVar(structure, "playerStructure_noTransfer")) - { - sendSystemMessage(self, new string_id(STF, "tcg_player_house_no_transfer")); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(structure, "structureChange.storageIncrease")) - { - sendSystemMessage(self, new string_id(STF, "storage_increase_transfer")); - return SCRIPT_CONTINUE; - } - - obj_id notradeItem = null; - if (player_structure.isBuilding(structure)) - { - - obj_id[] buildingPlayers = player_structure.getPlayersInBuilding(structure); - boolean found = false; - if (buildingPlayers != null) - { - for (int i = 0; i < buildingPlayers.length; ++i) - { - testAbortScript(); - if (buildingPlayers[i] == self) - { - found = true; - break; - } - } - } - if (!found) - { - sendSystemMessage(self, SID_NOT_IN_BUILDING); - return SCRIPT_CONTINUE; - } - - if (!areAllContentsLoaded(structure)) - { - sendSystemMessage(self, SID_CONTENTS_NOT_LOADED); - return SCRIPT_CONTINUE; - } - - notradeItem = utils.findNoTradeItemNotVendor(player_structure.getObjectsInBuilding(structure), false); - } - else - { - - obj_id[] structureArray = new obj_id[1]; - structureArray[0] = structure; - notradeItem = utils.findNoTradeItem(structureArray, false); - } - - if (isIdValid(notradeItem)) - { - prose_package pp = new prose_package(); - pp.stringId = SID_BUILDING_HAS_NOTRADE; - pp.target.id = notradeItem; - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(target)) - { - target = getLookAtTarget(self); - if (!isIdValid(target)) - { - LOG("LOG_CHANNEL", "You must specify a player with whom to transfer ownership"); - sendSystemMessage(self, new string_id(STF, "no_transfer_target")); - return SCRIPT_CONTINUE; - } - } - - if (target == self) - { - LOG("LOG_CHANNEL", "You are already the owner."); - sendSystemMessage(self, new string_id(STF, "already_owner")); - return SCRIPT_CONTINUE; - } - - if (!isPlayer(target)) - { - LOG("LOG_CHANNEL", "The target must be a player."); - sendSystemMessage(self, new string_id(STF, "target_not_player")); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(structure, player_structure.SPECIAL_SIGN_OWNER_ONLY) && getBooleanObjVar(structure, player_structure.SPECIAL_SIGN_OWNER_ONLY)) - { - LOG("LOG_CHANNEL", "You cannot transfer ownership with a special sign attached"); - sendSystemMessage(self, player_structure.SID_SPECIAL_SIGN_NO_TRANSFER); - return SCRIPT_CONTINUE; - } - - if (utils.isFreeTrial(target)) - { - sendSystemMessage(self, SID_NO_TRANSFER); - return SCRIPT_CONTINUE; - } - - if (player_structure.isBanned(structure, target)) - { - LOG("LOG_CHANNEL", "You cannot transfer ownership to a banned player"); - sendSystemMessage(self, new string_id(STF, "no_banned_player")); - return SCRIPT_CONTINUE; - } - - int city_id = getCityAtLocation(getLocation(structure), 0); - if (city.isCityBanned(target, city_id)) - { - sendSystemMessage(self, SID_CANT_TRANSFER_TO_CITY_BANNED); - return SCRIPT_CONTINUE; - } - - if (!player_structure.canOwnStructure(structure, target)) - { - LOG("LOG_CHANNEL", getFirstName(target) + " is not able to own this structure."); - sendSystemMessageProse(self, prose.getPackage(new string_id (STF, "not_able_to_own"), target)); - return SCRIPT_CONTINUE; - } - - if (cityExists(city_id) && city.isCityZoned(city_id) && isIdValid(target)) - { - - if (!city.hasZoningRights(target, city_id)) - { - sendSystemMessage(self, SID_NO_RIGHTS); - return SCRIPT_CONTINUE; - } - } - - if (!structure.isAuthoritative() || !target.isAuthoritative()) - { - obj_id targetTopmostContainer = getTopMostContainer(target); - if (!isIdValid(targetTopmostContainer)) - { - targetTopmostContainer = target; - } - - requestSameServer(targetTopmostContainer, structure); - - if (!structure.isAuthoritative()) - { - obj_id selfTopmostContainer = getTopMostContainer(self); - if (!isIdValid(selfTopmostContainer)) - { - selfTopmostContainer = self; - } - - requestSameServer(selfTopmostContainer, structure); - } - - sendSystemMessage(self, new string_id(STF, "not_authoritative")); - return SCRIPT_CONTINUE; - } - - player_structure.removeStructure(structure, self); - player_structure.addStructure(structure, target); - - LOG("LOG_CHANNEL", "Ownership of the structure has been transfered to "+ getFirstName(target)); - sendSystemMessageProse(self, prose.getPackage(new string_id (STF, "ownership_transferred_out"), target)); - LOG("LOG_CHANNEL", target + " ->"+ getFirstName(self) + " has transfered ownership of the structure to you"); - sendSystemMessageProse(target, prose.getPackage(new string_id (STF, "ownership_transferred_in"), self)); - CustomerServiceLog("playerStructure", "STRUCTURE("+ structure +") TEMPLATE: "+ structureTemplateName +" was transferred FROM: "+ getFirstName(self) +"("+ self +") TO"+ getFirstName(target) + "("+ target + ")."); - CustomerServiceLog("c","Structure "+ structure + " has been transfered from "+ getFirstName(self) + " to "+ getFirstName(target)); - - return SCRIPT_CONTINUE; - } - - - public int destroyStructure(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isFactionBaseEmpty(trial.getTop(self), self)) - { - sendSystemMessage(self, SID_EVACUATE_FACILITY); - return SCRIPT_CONTINUE; - } - - LOG("LOG_CHANNEL", "player_building::destroyStructure"); - obj_id structure = player_structure.getStructure(self); - - if (!isIdValid(structure)) - { - LOG("LOG_CHANNEL", self + " ->You must in a building or near an installation to use that command."); - sendSystemMessage(self, new string_id(STF, "command_no_building")); - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, "player_structure.destroy.pid")) - { - int oldpid = utils.getIntScriptVar(self, "player_structure.destroy.pid"); - sui.closeSUI(self, oldpid); - utils.removeScriptVarTree(self, "player_structure.destroy"); - } - - if (!player_structure.isCivic(structure) && !player_structure.isInAdminRange(structure, self)) - { - return SCRIPT_CONTINUE; - } - - String template = getTemplateName(structure); - if (template.indexOf("cityhall_") > -1) - { - - if (hasObjVar(structure, "cityVoteInterval")) - { - int cityVoteInterval = getIntObjVar(structure, "cityVoteInterval"); - if (cityVoteInterval == 2) - { - sendSystemMessage(self, SID_DESTRUCTION_LOCKED); - return SCRIPT_CONTINUE; - } - } - } - - if (!player_structure.isOwner(structure, self)) - { - LOG("LOG_CHANNEL", "You must be the owner to destroy a structure."); - sendSystemMessage(self, new string_id(STF, "destroy_must_be_owner")); - return SCRIPT_CONTINUE; - } - - if (player_structure.isGenerator(structure)) - { - if (isHarvesterActive(structure)) - { - sendSystemMessage(self, new string_id(STF, "destroy_deactivate_generator_first")); - return SCRIPT_CONTINUE; - } - - if (!isHarvesterEmpty(structure)) - { - sendSystemMessage(self, new string_id(STF, "destroy_empty_generator_hopper")); - return SCRIPT_CONTINUE; - } - } - - if (player_structure.isHarvester(structure)) - { - if (isHarvesterActive(structure)) - { - sendSystemMessage(self, new string_id(STF, "destroy_deactivate_first")); - return SCRIPT_CONTINUE; - } - - if (!isHarvesterEmpty(structure)) - { - sendSystemMessage(self, new string_id(STF, "destroy_empty_hopper")); - return SCRIPT_CONTINUE; - } - } - else if (player_structure.isFactory(structure)) - { - if (isHarvesterActive(structure)) - { - prose_package pp = prose.getPackage(SID_DEACTIVATE_FACTORY_FOR_DELETE, self); - if (pp != null) - { - sendSystemMessageProse(self, pp); - } - return SCRIPT_CONTINUE; - } - String currentSchematicName = getManufactureStationSchematic(structure); - if (currentSchematicName != null) - { - prose_package pp = prose.getPackage(SID_REMOVE_SCHEMATIC_FOR_DELETE, self); - if (pp != null) - { - sendSystemMessageProse(self, pp); - } - return SCRIPT_CONTINUE; - } - obj_id inputHopper = getManufactureStationInputHopper(structure); - if (isIdValid(inputHopper)) - { - if (getNumItemsIn(inputHopper) > 0) - { - prose_package pp = prose.getPackage(SID_CLEAR_INPUT_HOPPER_FOR_DELETE, self); - if (pp != null) - { - sendSystemMessageProse(self, pp); - } - return SCRIPT_CONTINUE; - } - } - obj_id outputHopper = getManufactureStationOutputHopper(structure); - if (isIdValid(outputHopper)) - { - if (getNumItemsIn(outputHopper) > 0) - { - prose_package pp = prose.getPackage(SID_CLEAR_OUTPUT_HOPPER_FOR_DELETE, self); - if (pp != null) - { - sendSystemMessageProse(self, pp); - } - return SCRIPT_CONTINUE; - } - } - } - else if (player_structure.isBuilding(structure)) - { - if (hasObjVar(structure, player_structure.SPECIAL_SIGN_OWNER_ONLY) && getBooleanObjVar(structure, player_structure.SPECIAL_SIGN_OWNER_ONLY)) - { - - sendSystemMessage(self, player_structure.SID_REMOVE_SPCIAL_SIGN_TO_DESTROY); - return SCRIPT_CONTINUE; - - } - if (!areAllContentsLoaded(structure)) - { - prose_package pp = prose.getPackage(SID_CONTENTS_NOT_LOADED, self); - if (pp != null) - { - sendSystemMessageProse(self, pp); - } - return SCRIPT_CONTINUE; - } - - fixHouseItemLimit(structure); - - int numItems = player_structure.getStructureNumItems(structure); - if (numItems > 0) - { - prose_package pp = prose.getPackage(SID_CLEAR_BUILDING_FOR_DELETE, self); - if (pp != null) - { - sendSystemMessageProse(self, pp); - } - return SCRIPT_CONTINUE; - } - - obj_id[] houseContents = trial.getAllObjectsInDungeon(structure); - if (houseContents != null && houseContents.length > 0) - { - for (int i = 0; i < houseContents.length; i++) - { - testAbortScript(); - if (isMob(houseContents[i])) - { - int callableType = callable.getCallableType(houseContents[i]); - if (callableType > 0) - { - - prose_package pp = prose.getPackage(SID_STORE_PETS_FOR_DELETE, self); - if (pp != null) - { - sendSystemMessageProse(self, pp); - } - - return SCRIPT_CONTINUE; - } - } - } - } - - if (!player_structure.canPackStructureWithVendors(self, structure)) - { - return SCRIPT_CONTINUE; - } - } - - int key = utils.getIntScriptVar(self, "player_structure.destroy.key"); - boolean redeedVar = utils.getBooleanScriptVar(self, "player_structure.destroy.willredeed"); - if (params != null && key != 0 && params.equals(Integer.toString(key))) - { - if (utils.getObjIdScriptVar(self, player_structure.VAR_CONFIRM_DESTROY) != structure) - { - sendSystemMessage(self, SID_PENDING_DESTROY); - return SCRIPT_CONTINUE; - } - utils.removeScriptVar(self, player_structure.VAR_CONFIRM_DESTROY); - - String sname = player_structure.getStructureName(structure); - CustomerServiceLog("DestroyStructure", "("+self+") "+getFirstName(self)+" has confirmed /destroyStructure on "+structure+" (Template: "+ template + " Name: "+ sname + "). Owner is "+player_structure.getStructureOwner(structure)+". Will redeed = "+ redeedVar); - CustomerServiceLog("DestroyStructure", getFirstName(self) + "has initiated a destroyStructure on "+ structure + " (Template: "+ template + " Name: "+ sname + "). Owner is "+ player_structure.getStructureOwner(structure)); - - if (redeedVar) - { - if (player_structure.destroyStructure(structure, true)) - { - LOG("LOG_CHANNEL", self + " ->Structure destroyed and deed reclaimed."); - sendSystemMessage(self, new string_id(STF, "deed_reclaimed")); - } - else - { - sendSystemMessage(self, new string_id(STF, "deed_reclaimed_failed")); - return SCRIPT_CONTINUE; - } - } - else - { - if (player_structure.destroyStructure(structure, false)) - { - LOG("LOG_CHANNEL", self + " ->Structure destroyed."); - sendSystemMessage(self, new string_id(STF, "structure_destroyed")); - } - else - { - sendSystemMessage(self, new string_id(STF, "structure_destroy_failed")); - return SCRIPT_CONTINUE; - } - } - } - else - { - - string_id confirm_destruction_title = new string_id(STF, "confirm_destruction_t"); - String title = getString(confirm_destruction_title); - string_id confirm_destruction_detail1 = new string_id(STF, "confirm_destruction_d1"); - String prompt = getString(confirm_destruction_detail1); - string_id confirm_destruction_detail2 = new string_id(STF, "confirm_destruction_d2"); - prompt += getString(confirm_destruction_detail2) + "\n\n"; - string_id confirm_destruction_detail3a = new string_id(STF, "confirm_destruction_d3a"); - string_id confirm_destruction_detail3b = new string_id(STF, "confirm_destruction_d3b"); - prompt += getString(confirm_destruction_detail3a) + " \\"+ colors_hex.LIMEGREEN + getString(confirm_destruction_detail3b) + "\\#."; - string_id confirm_destruction_detail4 = new string_id(STF, "confirm_destruction_d4"); - prompt += getString(confirm_destruction_detail4); - - Vector entries = new Vector(); - entries.setSize(0); - - String structure_name = player_structure.getStructureName(structure); - if (structure_name != null && !structure_name.equals("")) - { - title = structure_name; - } - - boolean canRedeed = false; - boolean willRedeed = true; - if (player_structure.canReclaimDeed(structure)) - { - canRedeed = true; - } - - if (canRedeed) - { - string_id redeed_alert_text = new string_id(STF, "can_redeed_alert"); - string_id redeed_yes_alert_text = new string_id(STF, "can_redeed_yes_suffix"); - entries = utils.addElement(entries, getString(redeed_alert_text) + "\\"+colors_hex.LIMEGREEN+getString(redeed_yes_alert_text)); - - int max_condition = player_structure.getMaxCondition(structure); - int condition = player_structure.getStructureCondition(structure); - - String conditionColor = colors_hex.LIMEGREEN; - if (condition < max_condition) - { - conditionColor = colors_hex.TOMATO; - willRedeed = false; - } - - string_id redeed_condition_text = new string_id(STF, "redeed_condition"); - entries = utils.addElement(entries, " - "+ getString(redeed_condition_text) + "\\"+conditionColor+condition+"/"+max_condition); - - int pool = player_structure.getMaintenancePool(structure); - int reclaim_pool = player_structure.getRedeedCost(structure); - - String maintColor = colors_hex.LIMEGREEN; - if (pool < reclaim_pool) - { - maintColor = colors_hex.TOMATO; - willRedeed = false; - } - string_id redeed_maintenance_text = new string_id(STF, "redeed_maintenance"); - entries = utils.addElement(entries, " - "+ getString(redeed_maintenance_text) + "\\"+maintColor+pool+"/"+reclaim_pool); - } - else - { - string_id redeed_alert_text = new string_id(STF, "can_redeed_alert"); - string_id redeed_no_alert_text = new string_id(STF, "can_redeed_no_suffix"); - entries = utils.addElement(entries, getString(redeed_alert_text) + "\\"+colors_hex.TOMATO+getString(redeed_no_alert_text)); - willRedeed = false; - } - - if (willRedeed) - { - string_id redeed_confirmation_text = new string_id(STF, "redeed_confirmation"); - string_id redeed_yes_alert_text = new string_id(STF, "can_redeed_yes_suffix"); - prompt += "\n"+ getString(redeed_confirmation_text) + "\\"+colors_hex.LIMEGREEN+getString(redeed_yes_alert_text); - } - else - { - string_id redeed_confirmation_text = new string_id(STF, "redeed_confirmation"); - string_id redeed_no_alert_text = new string_id(STF, "can_redeed_no_suffix"); - prompt += "\n"+ getString(redeed_confirmation_text) + "\\"+colors_hex.TOMATO+getString(redeed_no_alert_text); - } - - int pid = sui.listbox(self, self, prompt, sui.YES_NO, title, entries, "handleDestroyUi"); - if (pid > -1) - { - utils.setScriptVar(self, "player_structure.destroy.pid", pid); - utils.setScriptVar(self, "player_structure.destroy.target", structure); - utils.setScriptVar(self, "player_structure.destroy.willredeed", willRedeed); - utils.setScriptVar(self, "player_structure.destroy.key", rand(100000,999999)); - } - - } - - return SCRIPT_CONTINUE; - } - - - public int createVendor(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - blog("player_building:createVendor"); - - if (!validateVendorPlacement(self)) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, CREATING_VENDOR, 1); - - requestPlayerVendorCount(self); - return SCRIPT_CONTINUE; - } - - - public int handleSaveDecorationLayout(obj_id self, dictionary params) throws InterruptedException - { - - if (utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - int savedPageId = utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - forceCloseSUIPage(savedPageId); - } - - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_SAVE_SLOT_CHOICE); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOM_INDEX); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_CURRENT_POB_ROOMS); - - obj_id playerObject = getPlayerObject(self); - if (!isValidId(playerObject)) - { - return SCRIPT_CONTINUE; - } - - String[][] columnData = new String[3][4]; - - columnData[0][0] = "1"; - if (hasObjVar(playerObject, "savedDecoration1.saveTime")) - { - columnData[0][1] = getStringObjVar(playerObject, "savedDecoration1.pobName"); - if (columnData[0][1] == null) - { - columnData[0][1] = ""; - } - - int saveTime = getIntObjVar(playerObject, "savedDecoration1.saveTime"); - if (saveTime > 0) - { - columnData[0][2] = getCalendarTimeStringLocal(saveTime); - } - else - { - columnData[0][2] = ""; - } - - columnData[0][3] = getStringObjVar(playerObject, "savedDecoration1.description"); - if (columnData[0][3] == null) - { - columnData[0][3] = ""; - } - } - else - { - columnData[0][1] = ""; - columnData[0][2] = ""; - columnData[0][3] = ""; - } - - columnData[1][0] = "2"; - if (hasObjVar(playerObject, "savedDecoration2.saveTime")) - { - columnData[1][1] = getStringObjVar(playerObject, "savedDecoration2.pobName"); - if (columnData[1][1] == null) - { - columnData[1][1] = ""; - } - - int saveTime = getIntObjVar(playerObject, "savedDecoration2.saveTime"); - if (saveTime > 0) - { - columnData[1][2] = getCalendarTimeStringLocal(saveTime); - } - else - { - columnData[1][2] = ""; - } - - columnData[1][3] = getStringObjVar(playerObject, "savedDecoration2.description"); - if (columnData[1][3] == null) - { - columnData[1][3] = ""; - } - } - else - { - columnData[1][1] = ""; - columnData[1][2] = ""; - columnData[1][3] = ""; - } - - columnData[2][0] = "3"; - if (hasObjVar(playerObject, "savedDecoration3.saveTime")) - { - columnData[2][1] = getStringObjVar(playerObject, "savedDecoration3.pobName"); - if (columnData[2][1] == null) - { - columnData[2][1] = ""; - } - - int saveTime = getIntObjVar(playerObject, "savedDecoration3.saveTime"); - if (saveTime > 0) - { - columnData[2][2] = getCalendarTimeStringLocal(saveTime); - } - else - { - columnData[2][2] = ""; - } - - columnData[2][3] = getStringObjVar(playerObject, "savedDecoration3.description"); - if (columnData[2][3] == null) - { - columnData[2][3] = ""; - } - } - else - { - columnData[2][1] = ""; - columnData[2][2] = ""; - columnData[2][3] = ""; - } - - String[] columnHeader = - { - "Save Slot #", "Structure/Ship Type", "Save Time", "Description" - }; - String[] columnHeaderType = - { - "integer", "text", "text", "text" - }; - - int pid = sui.tableRowMajor(self, self, sui.OK_CANCEL, "Save Decoration Layout", "handleSelectSaveDecorationLayout", "Select the save slot where you want to save this decoration layout.", columnHeader, columnHeaderType, columnData); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - - return SCRIPT_CONTINUE; - } - - - public int handleSelectSaveDecorationLayout(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (params.getInt("pageId") != utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_OK) - { - int saveSlotId = sui.getTableLogicalIndex(params) + 1; - if ((saveSlotId < 1) || (saveSlotId > 3)) - { - return SCRIPT_CONTINUE; - } - - obj_id playerObject = getPlayerObject(self); - if (!isValidId(playerObject)) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID, saveSlotId); - if (hasObjVar(playerObject, "savedDecoration" + saveSlotId + ".saveTime")) - { - int pid = sui.msgbox(self, self, "Are you sure you want to overwrite the decoration layout currently saved in slot "+ saveSlotId + "?", sui.YES_NO, "Save Decoration Layout", "handleConfirmOverwriteSaveDecorationLayout"); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - } - else - { - int pid = sui.inputbox(self, self, "Enter an optional (40 characters max) description for the decoration layout that will be saved in slot "+ saveSlotId + ".", "Save Decoration Layout", "handleSaveDecorationLayoutEnterDescription", 39, false, ""); - setSUIProperty(pid, sui.INPUTBOX_INPUT, "MaxLength", String.valueOf(39)); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - showSUIPage(pid); - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleConfirmOverwriteSaveDecorationLayout(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID)) - { - return SCRIPT_CONTINUE; - } - - if (params.getInt("pageId") != utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - int saveSlotId = utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_OK) - { - int pid = sui.inputbox(self, self, "Enter an optional (40 characters max) description for the decoration layout that will be saved in slot "+ saveSlotId + ".", "Save Decoration Layout", "handleSaveDecorationLayoutEnterDescription", 39, false, ""); - setSUIProperty(pid, sui.INPUTBOX_INPUT, "MaxLength", String.valueOf(39)); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID, saveSlotId); - showSUIPage(pid); - } - else - { - messageTo(self, "handleSaveDecorationLayout", null, 0.1f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int handleSaveDecorationLayoutEnterDescription(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID)) - { - return SCRIPT_CONTINUE; - } - - if (params.getInt("pageId") != utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - int saveSlotId = utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_OK) - { - obj_id structure = getContainedBy(self); - if (isValidId(structure)) - { - structure = getContainedBy(structure); - } - - if (!isValidId(structure)) - { - sendSystemMessage(self, "You must be standing inside a structure or POB ship to do this.", null ); - } - else - { - String description = sui.getInputBoxText(params); - if (description == null) - { - description = ""; - } - - saveDecorationLayout(self, structure, saveSlotId, description); - } - } - else - { - messageTo(self, "handleSaveDecorationLayout", null, 0.1f, false); - } - - return SCRIPT_CONTINUE; - } - - - public void displayRestoreDecorationRoomMapping(obj_id player, String[] savedRooms, String[] targetRooms, int saveSlotId) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return; - } - - String[] columnHeader = - { - "Items that were in this room at the time the layout was saved", "Will be moved/restored into this room" - }; - String[] columnHeaderType = - { - "text", "text" - }; - String[][] columnData = new String[2][0]; - - String[] tempSavedRooms = new String[savedRooms.length + 1]; - for (int i = 0; i < savedRooms.length; ++i) - { - testAbortScript(); - tempSavedRooms[i] = savedRooms[i]; - } - tempSavedRooms[savedRooms.length] = "Restore Decoration Layout"; - - String[] tempTargetRooms = new String[targetRooms.length + 1]; - for (int i = 0; i < targetRooms.length; ++i) - { - testAbortScript(); - tempTargetRooms[i] = targetRooms[i]; - } - tempTargetRooms[targetRooms.length] = ""; - - columnData[0] = tempSavedRooms; - columnData[1] = tempTargetRooms; - - int pid = sui.tableColumnMajor(player, player, sui.OK_CANCEL, "Restore Decoration Layout", "handleSelectRestoreDecorationRoomMapping", "@player_structure:restore_decoration_layout_specify_target_room", columnHeader, columnHeaderType, columnData); - utils.setScriptVar(player, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - utils.setScriptVar(player, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID, saveSlotId); - utils.setScriptVar(player, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS, targetRooms); - } - - - public int handleRestoreDecorationLayout(obj_id self, dictionary params) throws InterruptedException - { - - if (utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - int savedPageId = utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - forceCloseSUIPage(savedPageId); - } - - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_SAVE_SLOT_CHOICE); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOM_INDEX); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_CURRENT_POB_ROOMS); - - obj_id playerObject = getPlayerObject(self); - if (!isValidId(playerObject)) - { - return SCRIPT_CONTINUE; - } - - int numberOfSavedSlots = 0; - - String[] saveSlot1 = null; - if (hasObjVar(playerObject, "savedDecoration1.saveTime")) - { - int saveTime = getIntObjVar(playerObject, "savedDecoration1.saveTime"); - if (saveTime > 0) - { - ++numberOfSavedSlots; - - saveSlot1 = new String[4]; - - saveSlot1[0] = "1"; - - saveSlot1[1] = getStringObjVar(playerObject, "savedDecoration1.pobName"); - if (saveSlot1[1] == null) - { - saveSlot1[1] = ""; - } - - saveSlot1[2] = getCalendarTimeStringLocal(saveTime); - - saveSlot1[3] = getStringObjVar(playerObject, "savedDecoration1.description"); - if (saveSlot1[3] == null) - { - saveSlot1[3] = ""; - } - } - } - - String[] saveSlot2 = null; - if (hasObjVar(playerObject, "savedDecoration2.saveTime")) - { - int saveTime = getIntObjVar(playerObject, "savedDecoration2.saveTime"); - if (saveTime > 0) - { - ++numberOfSavedSlots; - - saveSlot2 = new String[4]; - - saveSlot2[0] = "2"; - - saveSlot2[1] = getStringObjVar(playerObject, "savedDecoration2.pobName"); - if (saveSlot2[1] == null) - { - saveSlot2[1] = ""; - } - - saveSlot2[2] = getCalendarTimeStringLocal(saveTime); - - saveSlot2[3] = getStringObjVar(playerObject, "savedDecoration2.description"); - if (saveSlot2[3] == null) - { - saveSlot2[3] = ""; - } - } - } - - String[] saveSlot3 = null; - if (hasObjVar(playerObject, "savedDecoration3.saveTime")) - { - int saveTime = getIntObjVar(playerObject, "savedDecoration3.saveTime"); - if (saveTime > 0) - { - ++numberOfSavedSlots; - - saveSlot3 = new String[4]; - - saveSlot3[0] = "3"; - - saveSlot3[1] = getStringObjVar(playerObject, "savedDecoration3.pobName"); - if (saveSlot3[1] == null) - { - saveSlot3[1] = ""; - } - - saveSlot3[2] = getCalendarTimeStringLocal(saveTime); - - saveSlot3[3] = getStringObjVar(playerObject, "savedDecoration3.description"); - if (saveSlot3[3] == null) - { - saveSlot3[3] = ""; - } - } - } - - if (numberOfSavedSlots <= 0) - { - sendSystemMessage(self, "You do not have any saved decoration layout.", null); - return SCRIPT_CONTINUE; - } - - String[][] columnData = new String[numberOfSavedSlots][0]; - int[] choicesSaveSlot = - { - 0, 0, 0 - }; - int choicesSaveSlotIndex = 0; - - if (saveSlot1 != null) - { - columnData[choicesSaveSlotIndex] = saveSlot1; - choicesSaveSlot[choicesSaveSlotIndex] = 1; - ++choicesSaveSlotIndex; - } - - if (saveSlot2 != null) - { - columnData[choicesSaveSlotIndex] = saveSlot2; - choicesSaveSlot[choicesSaveSlotIndex] = 2; - ++choicesSaveSlotIndex; - } - - if (saveSlot3 != null) - { - columnData[choicesSaveSlotIndex] = saveSlot3; - choicesSaveSlot[choicesSaveSlotIndex] = 3; - ++choicesSaveSlotIndex; - } - - String[] columnHeader = - { - "Save Slot #", "Structure/Ship Type", "Save Time", "Description" - }; - String[] columnHeaderType = - { - "integer", "text", "text", "text" - }; - - int pid = sui.tableRowMajor(self, self, sui.OK_CANCEL, "Restore Decoration Layout", "handleSelectRestoreDecorationLayout", "Select the decoration layout save slot you wish to restore.", columnHeader, columnHeaderType, columnData); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - utils.setScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_SAVE_SLOT_CHOICE, choicesSaveSlot); - - return SCRIPT_CONTINUE; - } - - - public int handleSelectRestoreDecorationLayout(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_SAVE_SLOT_CHOICE)) - { - return SCRIPT_CONTINUE; - } - - if (params.getInt("pageId") != utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - int[] choicesSaveSlot = utils.getIntArrayScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_SAVE_SLOT_CHOICE); - - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_SAVE_SLOT_CHOICE); - - if ((choicesSaveSlot == null) || (choicesSaveSlot.length != 3)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_OK) - { - int rowsSelected = sui.getTableLogicalIndex(params); - if ((rowsSelected < 0) || (rowsSelected >= choicesSaveSlot.length)) - { - return SCRIPT_CONTINUE; - } - - int saveSlotId = choicesSaveSlot[rowsSelected]; - if ((saveSlotId < 1) || (saveSlotId > 3)) - { - return SCRIPT_CONTINUE; - } - - obj_id playerObject = getPlayerObject(self); - if (!isValidId(playerObject)) - { - return SCRIPT_CONTINUE; - } - - String[] savedRooms = getStringArrayObjVar(playerObject, "savedDecoration"+ saveSlotId + ".rooms"); - if ((savedRooms == null) || (savedRooms.length <= 0)) - { - return SCRIPT_CONTINUE; - } - - obj_id structure = getContainedBy(self); - if (isValidId(structure)) - { - structure = getContainedBy(structure); - } - - if (!isValidId(structure)) - { - sendSystemMessage(self, "You must be standing inside a structure or POB ship to do this.", null); - return SCRIPT_CONTINUE; - } - - String[] roomsOfCurrentPob = getCellNames(structure); - if ((roomsOfCurrentPob == null) || (roomsOfCurrentPob.length <= 0)) - { - sendSystemMessage(self, "You must be standing inside a structure or POB ship to do this.", null); - return SCRIPT_CONTINUE; - } - - String[] targetRooms = getStringArrayObjVar(playerObject, "savedDecoration"+ saveSlotId + ".targetRooms"); - if ((targetRooms != null) && (targetRooms.length == savedRooms.length)) - { - - for (int i = 0; i < targetRooms.length; ++i) - { - testAbortScript(); - boolean found = false; - for (int j = 0; j < roomsOfCurrentPob.length; ++j) - { - testAbortScript(); - if (targetRooms[i].equals(roomsOfCurrentPob[j])) - { - found = true; - break; - } - } - - if (!found) - { - targetRooms[i] = "(will not be moved/restored)"; - } - } - } - else - { - - targetRooms = new String[savedRooms.length]; - - for (int i = 0; i < savedRooms.length; ++i) - { - testAbortScript(); - boolean found = false; - for (int j = 0; j < roomsOfCurrentPob.length; ++j) - { - testAbortScript(); - if (savedRooms[i].equals(roomsOfCurrentPob[j])) - { - targetRooms[i] = savedRooms[i]; - found = true; - break; - } - } - - if (!found) - { - targetRooms[i] = "(will not be moved/restored)"; - } - } - } - - displayRestoreDecorationRoomMapping(self, savedRooms, targetRooms, saveSlotId); - } - - return SCRIPT_CONTINUE; - } - - - public int handleSelectRestoreDecorationRoomMapping(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS)) - { - return SCRIPT_CONTINUE; - } - - if (params.getInt("pageId") != utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - int saveSlotId = utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - String[] targetRooms = utils.getStringArrayScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS); - - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_OK) - { - obj_id playerObject = getPlayerObject(self); - if (!isValidId(playerObject)) - { - return SCRIPT_CONTINUE; - } - - String[] savedRooms = getStringArrayObjVar(playerObject, "savedDecoration"+ saveSlotId + ".rooms"); - if ((savedRooms == null) || (savedRooms.length <= 0)) - { - return SCRIPT_CONTINUE; - } - - if ((targetRooms == null) || (targetRooms.length != savedRooms.length)) - { - return SCRIPT_CONTINUE; - } - - int rowsSelected = sui.getTableLogicalIndex(params); - if (rowsSelected == savedRooms.length) - { - - obj_id structure = getContainedBy(self); - if (isValidId(structure)) - { - structure = getContainedBy(structure); - } - - if (!isValidId(structure)) - { - int pid = sui.msgbox(self, self, "You must be standing inside a structure or POB ship to do this.", sui.OK_ONLY, "Restore Decoration Layout", "handleRestoreDecorationReturnToRoomMapping"); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID, saveSlotId); - utils.setScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS, targetRooms); - - return SCRIPT_CONTINUE; - } - - String[] roomsOfCurrentPob = getCellNames(structure); - if ((roomsOfCurrentPob == null) || (roomsOfCurrentPob.length <= 0)) - { - int pid = sui.msgbox(self, self, "You must be standing inside a structure or POB ship to do this.", sui.OK_ONLY, "Restore Decoration Layout", "handleRestoreDecorationReturnToRoomMapping"); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID, saveSlotId); - utils.setScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS, targetRooms); - - return SCRIPT_CONTINUE; - } - - boolean hasValidTargetRoom = false; - for (int i = 0; i < targetRooms.length; ++i) - { - testAbortScript(); - if ((targetRooms[i] == null) || (targetRooms[i].length() <= 0) || targetRooms[i].equals("(will not be moved/restored)")) - { - continue; - } - - boolean found = false; - for (int j = 0; j < roomsOfCurrentPob.length; ++j) - { - testAbortScript(); - if (targetRooms[i].equals(roomsOfCurrentPob[j])) - { - hasValidTargetRoom = true; - found = true; - break; - } - } - - if (!found) - { - targetRooms[i] = "(will not be moved/restored)"; - } - } - - if (!hasValidTargetRoom) - { - int pid = sui.msgbox(self, self, "You have not specified any room into which to move/restore the decoration layout.", sui.OK_ONLY, "Restore Decoration Layout", "handleRestoreDecorationReturnToRoomMapping"); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID, saveSlotId); - utils.setScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS, targetRooms); - - return SCRIPT_CONTINUE; - } - - for (int k = 0; k < targetRooms.length; ++k) - { - testAbortScript(); - if ((targetRooms[k] == null) || targetRooms[k].equals("(will not be moved/restored)")) - { - targetRooms[k] = ""; - } - } - - setObjVar(playerObject, "savedDecoration"+ saveSlotId + ".targetRooms", targetRooms); - restoreDecorationLayout(self, structure, saveSlotId); - - return SCRIPT_CONTINUE; - } - - if ((rowsSelected < 0) || (rowsSelected >= savedRooms.length)) - { - int pid = sui.msgbox(self, self, "Please select an action to perform.", sui.OK_ONLY, "Restore Decoration Layout", "handleRestoreDecorationReturnToRoomMapping"); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID, saveSlotId); - utils.setScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS, targetRooms); - - return SCRIPT_CONTINUE; - } - - obj_id structure = getContainedBy(self); - if (isValidId(structure)) - { - structure = getContainedBy(structure); - } - - if (!isValidId(structure)) - { - int pid = sui.msgbox(self, self, "You must be standing inside a structure or POB ship to do this.", sui.OK_ONLY, "Restore Decoration Layout", "handleRestoreDecorationReturnToRoomMapping"); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID, saveSlotId); - utils.setScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS, targetRooms); - - return SCRIPT_CONTINUE; - } - - String[] roomsOfCurrentPob = getCellNames(structure); - if ((roomsOfCurrentPob == null) || (roomsOfCurrentPob.length <= 0)) - { - int pid = sui.msgbox(self, self, "You must be standing inside a structure or POB ship to do this.", sui.OK_ONLY, "Restore Decoration Layout", "handleRestoreDecorationReturnToRoomMapping"); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID, saveSlotId); - utils.setScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS, targetRooms); - - return SCRIPT_CONTINUE; - } - - String[] roomsSelection = new String[roomsOfCurrentPob.length + 1]; - roomsSelection[0] = "do not move/restore items in room " + savedRooms[rowsSelected]; - for (int i = 1; i < roomsSelection.length; ++i) - { - testAbortScript(); - roomsSelection[i] = roomsOfCurrentPob[i-1]; - } - - int pid = sui.listbox(self, self, "Select the room into which you wish to move/restore the items that were in room "+ savedRooms[rowsSelected] + " at the time the decoration layout was saved.", sui.OK_CANCEL, "Restore Decoration Layout", roomsSelection, "handleSelectRestoreDecorationTargetRoom", true, true); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID, pid); - utils.setScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID, saveSlotId); - utils.setScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS, targetRooms); - utils.setScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOM_INDEX, rowsSelected); - utils.setScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_CURRENT_POB_ROOMS, roomsSelection); - } - else - { - messageTo(self, "handleRestoreDecorationLayout", null, 0.1f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int handleRestoreDecorationReturnToRoomMapping(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS)) - { - return SCRIPT_CONTINUE; - } - - if (params.getInt("pageId") != utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - int saveSlotId = utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - String[] targetRooms = utils.getStringArrayScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS); - - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS); - - obj_id playerObject = getPlayerObject(self); - if (!isValidId(playerObject)) - { - return SCRIPT_CONTINUE; - } - - String[] savedRooms = getStringArrayObjVar(playerObject, "savedDecoration"+ saveSlotId + ".rooms"); - if ((savedRooms == null) || (savedRooms.length <= 0)) - { - return SCRIPT_CONTINUE; - } - - if ((targetRooms == null) || (targetRooms.length != savedRooms.length)) - { - return SCRIPT_CONTINUE; - } - - displayRestoreDecorationRoomMapping(self, savedRooms, targetRooms, saveSlotId); - - return SCRIPT_CONTINUE; - } - - - public int handleSelectRestoreDecorationTargetRoom(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOM_INDEX)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_CURRENT_POB_ROOMS)) - { - return SCRIPT_CONTINUE; - } - - if (params.getInt("pageId") != utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - int saveSlotId = utils.getIntScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - String[] targetRooms = utils.getStringArrayScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS); - int targetRoomIndex = utils.getIntScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOM_INDEX); - String[] roomsOfCurrentPob = utils.getStringArrayScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_CURRENT_POB_ROOMS); - - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SUI_ID); - utils.removeScriptVar(self, SCRIPTVAR_SAVE_RESTORE_DECORATION_SAVE_SLOT_ID); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOMS); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_TARGET_ROOM_INDEX); - utils.removeScriptVar(self, SCRIPTVAR_RESTORE_DECORATION_CURRENT_POB_ROOMS); - - obj_id playerObject = getPlayerObject(self); - if (!isValidId(playerObject)) - { - return SCRIPT_CONTINUE; - } - - String[] savedRooms = getStringArrayObjVar(playerObject, "savedDecoration"+ saveSlotId + ".rooms"); - if ((savedRooms == null) || (savedRooms.length <= 0)) - { - return SCRIPT_CONTINUE; - } - - if ((targetRooms == null) || (targetRooms.length != savedRooms.length)) - { - return SCRIPT_CONTINUE; - } - - if ((targetRoomIndex < 0) || (targetRoomIndex >= targetRooms.length)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_OK) - { - int rowsSelected = sui.getListboxSelectedRow(params); - if ((rowsSelected >= 0) && (roomsOfCurrentPob != null) && (roomsOfCurrentPob.length > 0) && (rowsSelected < roomsOfCurrentPob.length)) - { - if (rowsSelected == 0) - { - targetRooms[targetRoomIndex] = "(will not be moved/restored)"; - } - else - { - targetRooms[targetRoomIndex] = roomsOfCurrentPob[rowsSelected]; - } - } - } - - displayRestoreDecorationRoomMapping(self, savedRooms, targetRooms, saveSlotId); - - return SCRIPT_CONTINUE; - } - - - public int handleVendorTypeSelect(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - blog("player_building.handleVendorTypeSelect: init"); - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - blog("player_building.handleVendorTypeSelect: idx: "+idx); - - String[] randomOnly = - { - "@player_structure:random" - }; - utils.setScriptVar(player, "vendor.checkGender", 0); - int hiringMod = getSkillStatMod(player, "hiring"); - blog("handleVendorTypeSelect - hiringMod: "+hiringMod); - switch (idx) - { - case 0: - blog("player_building.handleVendorTypeSelect: selected TERMINAL VENDOR TYPE: "); - - String[] rawTerminalTypes = dataTableGetStringColumn(TBL_TERMINAL_TYPES, 0); - - int test = 10; - Vector vendorTypes = new Vector(); - vendorTypes.setSize(0); - for (int i=0; i= test) - { - vendorTypes = utils.addElement(vendorTypes, "@player_structure:terminal_"+rawTerminalTypes[i]); - } - test += 20; - } - sui.listbox(player, player, "@player_structure:terminal_type_d", sui.OK_CANCEL, "@player_structure:terminal_type_t", vendorTypes, "handleTerminalDesignSelect", true); - break; - case 1: - blog("player_building.handleVendorTypeSelect: selected TERMINAL DROID TYPE: "); - - String[] rawDroidTypes = dataTableGetStringColumn(TBL_DROID_TYPES, 0); - - int dtest = 20; - Vector droidTypes = null; - for (int i=0; i= dtest) - { - droidTypes = utils.addElement(droidTypes, "@player_structure:droid_"+rawDroidTypes[i]); - } - dtest += 20; - } - sui.listbox(player, player, "@player_structure:droid_type_d", sui.OK_CANCEL, "@player_structure:droid_type_t", droidTypes, "handleDroidModelSelect", true); - break; - case 2: - blog("player_building.handleVendorTypeSelect: selected TERMINAL NPC TYPE: "); - if (hiringMod < 50) - { - blog("player_building.handleVendorTypeSelect: player hiringMod < 50"); - sui.listbox(player, player, "@player_structure:race_type_d", sui.OK_CANCEL, "@player_structure:race_type_t", randomOnly, "handleVendorRaceSelect", true); - break; - } - else - { - blog("player_building.handleVendorTypeSelect: player hiringMod > 50"); - - String[] allSpecialVendors = getSpecialVendors(self, hiringMod); - blog("player_building.handleVendorTypeSelect: allSpecialVendors.length: "+allSpecialVendors.length); - - Vector localizedRaceTypes = new Vector(); - localizedRaceTypes.setSize(0); - - Vector modifiedRawRaceTypes = new Vector(); - modifiedRawRaceTypes.setSize(0); - - if (hiringMod >= 60) - { - blog("player_building.handleVendorTypeSelect: player hiringMod >= 60"); - - String[] rawRaceTypesHiLvl = dataTableGetStringColumn(TBL_ALLNPC_TYPES, 0); - if (rawRaceTypesHiLvl == null) - { - break; - } - - for (int i = 0; i < rawRaceTypesHiLvl.length; i++) - { - testAbortScript(); - utils.addElement(localizedRaceTypes, "@player_structure:race_"+rawRaceTypesHiLvl[i]); - utils.addElement(modifiedRawRaceTypes, rawRaceTypesHiLvl[i]); - } - - utils.setScriptVar(self, "vendor.checkGender", 1); - } - else - { - - String[] rawRaceTypesLowLvl = dataTableGetStringColumn(TBL_PLAYER_TYPES, 0); - if (rawRaceTypesLowLvl == null) - { - break; - } - - for (int i = 0; i < rawRaceTypesLowLvl.length; i++) - { - testAbortScript(); - utils.addElement(localizedRaceTypes, "@player_structure:race_"+rawRaceTypesLowLvl[i]); - utils.addElement(modifiedRawRaceTypes, rawRaceTypesLowLvl[i]); - } - } - - if (allSpecialVendors != null) - { - - for (int i = 0; i < allSpecialVendors.length; i++) - { - testAbortScript(); - utils.addElement(localizedRaceTypes, "@player_structure:race_"+allSpecialVendors[i]); - utils.addElement(modifiedRawRaceTypes, allSpecialVendors[i]); - } - - utils.setScriptVar(self, "vendor.checkGender", 1); - } - - if (localizedRaceTypes == null || modifiedRawRaceTypes == null) - { - break; - } - - utils.setScriptVar(player, "vendor.races", modifiedRawRaceTypes); - sui.listbox(self, self, "@player_structure:race_type_d", sui.OK_CANCEL, "@player_structure:race_type_t", localizedRaceTypes, "handleVendorRaceSelect", true); - } - break; - default: - String[] defaultTerminalTypes = dataTableGetStringColumn(TBL_TERMINAL_TYPES, 0); - - int hireVar = 10; - Vector defaultVendorTypes = new Vector(); - defaultVendorTypes.setSize(0); - for (int i=0; i < defaultTerminalTypes.length; i++) - { - testAbortScript(); - if (hiringMod >= hireVar) - { - vendorTypes = utils.addElement(defaultVendorTypes, "@player_structure:terminal_"+defaultTerminalTypes[i]); - } - hireVar += 20; - } - sui.listbox(player, player, "@player_structure:terminal_type_d", sui.OK_CANCEL, "@player_structure:terminal_type_t", defaultVendorTypes, "handleTerminalDesignSelect", true); - break; - } - - return SCRIPT_CONTINUE; - } - - - public int handleTerminalDesignSelect(obj_id self, dictionary params) throws InterruptedException - { - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - String[] rawTerminalTypes = dataTableGetStringColumn(TBL_TERMINAL_TYPES, 0); - String terminalsuffix = "terminal_"+ rawTerminalTypes[idx] + ".iff"; - - utils.setScriptVar(player, "vendor.terminalSuffix", terminalsuffix); - - sui.inputbox(player, player, "@player_structure:name_d", sui.OK_CANCEL, "@player_structure:name_t", sui.INPUT_NORMAL, null, "handleSetVendorName", null); - - return SCRIPT_CONTINUE; - } - - - public int handleDroidModelSelect(obj_id self, dictionary params) throws InterruptedException - { - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - String[] rawDroidTypes = dataTableGetStringColumn(TBL_DROID_TYPES, 0); - String droidsuffix = "droid_"+ rawDroidTypes[idx] + ".iff"; - - utils.setScriptVar(player, "vendor.terminalSuffix", droidsuffix); - - sui.inputbox(player, player, "@player_structure:name_d", sui.OK_CANCEL, "@player_structure:name_t", sui.INPUT_NORMAL, null, "handleSetVendorName", null); - - return SCRIPT_CONTINUE; - } - - - public int handleVendorRaceSelect(obj_id self, dictionary params) throws InterruptedException - { - blog("player_building.handleVendorRaceSelect: init"); - - if (params == null || params.isEmpty()) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, "vendor.raceIndex", idx); - utils.setScriptVar(player, "vendor.terminalSuffix", "NPC"); - - int checkGender = utils.getIntScriptVar(player, "vendor.checkGender"); - blog("player_building.handleVendorRaceSelect: checkGender: "+checkGender); - if (checkGender == 1) - { - - String[] raceTypes = utils.getStringArrayScriptVar(player, "vendor.races"); - String raceChosen = raceTypes[idx]; - blog("player_building.handleVendorRaceSelect: raceChosen: "+raceChosen); - - if (raceChosen.startsWith("special_vendor_")) - { - blog("player_building.handleVendorRaceSelect: Special Vendor = TRUE"); - - int rowNum = dataTableSearchColumnForString(raceChosen, 0, TBL_SPECIAL_PLAYER_VENDOR_TYPES); - if (rowNum < 0) - { - blog("player_building.handleVendorRaceSelect: rowNum is BAD"); - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - blog("player_building.handleVendorRaceSelect: rowNum: "+rowNum); - - dictionary dict = dataTableGetRow(TBL_SPECIAL_PLAYER_VENDOR_TYPES, rowNum); - if (dict == null) - { - blog("player_building.handleVendorRaceSelect: Dictionary is NULL"); - - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - blog("player_building.handleVendorRaceSelect: dict: "+dict); - - int vendorSpeaksBasic = dict.getInt("vendor_basic"); - if (vendorSpeaksBasic > 0) - { - utils.setScriptVar(player, "vendor.special_vendor_basic", 1); - } - else - { - utils.setScriptVar(player, "vendor.special_vendor_basic", 0); - } - - blog("player_building.handleVendorRaceSelect: vendorSpeaksBasic: "+vendorSpeaksBasic); - - int vendor_clothing = dict.getInt("vendor_give"); - if (vendor_clothing > 0) - { - utils.setScriptVar(player, "vendor.special_vendor_clothing", 1); - } - else - { - utils.setScriptVar(player, "vendor.special_vendor_clothing", 0); - } - - blog("player_building.handleVendorRaceSelect: vendor_clothing: "+vendor_clothing); - - int decr_skillmod = dict.getInt("decrement_mod"); - blog("player_building.handleVendorRaceSelect: decr_skillmod equals: "+decr_skillmod); - - if (decr_skillmod > 0) - { - blog("player_building.handleVendorRaceSelect: decrementing skillmod: "+decr_skillmod); - - String skillModName = dict.getString("skill_mod"); - blog("player_building.handleVendorRaceSelect: skillModName: "+skillModName); - - if (skillModName != null && !skillModName.equals("")) - { - blog("player_building.handleVendorRaceSelect: setting skill mod to decrement"); - - utils.setScriptVar(player, "vendor.special_decrement_skillmod", true); - utils.setScriptVar(player, "vendor.special_vendor_skillmod", skillModName); - } - - } - - int specialVendorMale = dict.getInt("vendor_has_male"); - int specialVendorFemale = dict.getInt("vendor_has_female"); - if (specialVendorMale == 0 && specialVendorFemale == 0) - { - blog("player_building.handleVendorRaceSelect: both Male and Female == 0"); - - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - if (specialVendorMale == 1 && specialVendorFemale == 0) - { - - utils.setScriptVar(player, "vendor.genderIndex", 0); - utils.setScriptVar(player, "vendor.gender.male_only_no_female", true); - utils.setScriptVar(player, "vendor.gender.female_only_no_male", false); - } - else if (specialVendorMale == 0 && specialVendorFemale == 1) - { - blog("player_building.handleVendorRaceSelect:Female ONLY"); - - utils.setScriptVar(player, "vendor.genderIndex", 1); - utils.setScriptVar(player, "vendor.gender.female_only_no_male", true); - utils.setScriptVar(player, "vendor.gender.male_only_no_female", false); - } - - } - else - { - blog("player_building.handleVendorRaceSelect: NOT A Special Vendor"); - - int row = dataTableSearchColumnForString(raceChosen, "VENDOR_TYPES", TBL_ALLNPC_TYPES); - dictionary dict = dataTableGetRow(TBL_ALLNPC_TYPES, row); - int hasFemale = dict.getInt("HAS_FEMALE"); - blog("player_building.handleVendorRaceSelect: Has Female(0=no, 1=yes): "+hasFemale); - if (hasFemale == 0) - { - blog("player_building.handleVendorRaceSelect: No female, no gender UI needed"); - - utils.setScriptVar(player, "vendor.genderIndex", 0); - utils.setScriptVar(player, "vendor.gender.male_only_no_female", true); - } - else - { - blog("player_building.handleVendorRaceSelect: Female exists, we'll need to decide which gender"); - - utils.setScriptVar(player, "vendor.genderIndex", 1); - } - } - } - - if (utils.getBooleanScriptVar(player, "vendor.gender.male_only_no_female") || utils.getBooleanScriptVar(player, "vendor.gender.female_only_no_male")) - { - blog("player_building.handleVendorRaceSelect: Either there is No female or No Male in this vendor"); - - if (utils.getIntScriptVar(player, "vendor.genderIndex") == 0 || utils.getIntScriptVar(player, "vendor.genderIndex") == 1) - { - blog("player_building.handleVendorRaceSelect: Male only for this vendor"); - sui.inputbox(player, player, "@player_structure:name_d", sui.OK_CANCEL, "@player_structure:name_t", sui.INPUT_NORMAL, null, "handleSetVendorName", null); - return SCRIPT_CONTINUE; - } - } - - utils.setScriptVar(player, "vendor.gender.female_only_no_male", false); - utils.setScriptVar(player, "vendor.gender.male_only_no_female", false); - blog("player_building.handleVendorRaceSelect: Setting female and male only to false"); - - String[] possibleNPCGender = - { - "@player_structure:male", "@player_structure:female" - }; - sui.listbox(player, player, "@player_structure:gender_d", sui.OK_CANCEL, "@player_structure:gender_t", possibleNPCGender, "handleVendorGenderSelect", true); - return SCRIPT_CONTINUE; - } - - - public int handleVendorGenderSelect(obj_id self, dictionary params) throws InterruptedException - { - blog("player_building.handleVendorGenderSelect: init"); - - if (params == null || params.isEmpty()) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, "vendor.genderIndex", idx); - blog("player_building.handleVendorGenderSelect: idx: "+idx); - - sui.inputbox(player, player, "@player_structure:name_d", sui.OK_CANCEL, "@player_structure:name_t", sui.INPUT_NORMAL, null, "handleSetVendorName", null); - - return SCRIPT_CONTINUE; - } - - - public int handleSetVendorName(obj_id self, dictionary params) throws InterruptedException - { - blog("player_building.handleSetVendorName: init"); - - if (params == null || params.isEmpty()) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - String vendorName = sui.getInputBoxText(params); - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - if ((vendorName.equals("")) || isNameReserved(vendorName)) - { - - sendSystemMessage(player, SID_OBSCENE); - sui.inputbox(player, player, "@player_structure:name_d", sui.OK_CANCEL, "@player_structure:name_t", sui.INPUT_NORMAL, null, "handleSetVendorName", null); - return SCRIPT_CONTINUE; - } - - if (vendorName.length() > 40) - { - vendorName = vendorName.substring(0, 39); - } - - blog("player_building.handleSetVendorName: vendorName: "+vendorName); - - utils.setScriptVar(player, "vendor.vendorName", vendorName); - - messageTo(player, "buildVendor", null, 0, false); - - return SCRIPT_CONTINUE; - } - - - public int buildVendor(obj_id self, dictionary params) throws InterruptedException - { - blog("player_building.buildVendor: init"); - obj_id player = self; - - String terminalSuffix = utils.getStringScriptVar(player, "vendor.terminalSuffix"); - if (terminalSuffix == null || terminalSuffix.equals("")) - { - removeVendorVars(player); - return SCRIPT_CONTINUE; - } - - String vendorName = utils.getStringScriptVar(player, "vendor.vendorName"); - if (vendorName == null || vendorName.equals("")) - { - blog("player_building.buildVendor: vendorName was null"); - removeVendorVars(player); - return SCRIPT_CONTINUE; - } - if (utils.isFreeTrial(player)) - { - removeVendorVars(player); - return SCRIPT_CONTINUE; - } - - blog("player_building.buildVendor: vendor data initial validation pass"); - - obj_id structure = player_structure.getStructure(player); - obj_id inventory = getObjectInSlot(player, "inventory"); - if (!isIdValid(structure)) - { - removeVendorVars(player); - return SCRIPT_CONTINUE; - } - if (inventory == null || inventory == obj_id.NULL_ID) - { - removeVendorVars(player); - return SCRIPT_CONTINUE; - } - - obj_id vendor = null; - if (terminalSuffix.equals("NPC")) - { - String[] genderList = - { - "male", "female" - }; - String creatureName = "vendor"; - String templateName; - - int raceIndex = utils.getIntScriptVar(player, "vendor.raceIndex"); - if (raceIndex < 0) - { - removeVendorVars(player); - return SCRIPT_CONTINUE; - } - - int genderIndex = utils.getIntScriptVar(player, "vendor.genderIndex"); - if (genderIndex < 0 || genderIndex > 1) - { - genderIndex = 0; - } - - if (raceIndex == 0) - { - String[] playerTypes = dataTableGetStringColumn(TBL_PLAYER_TYPES, 0); - if (playerTypes == null) - { - removeVendorVars(player); - return SCRIPT_CONTINUE; - } - - templateName = playerTypes[rand(1,playerTypes.length-1)] + "_"+ genderList[genderIndex] + ".iff"; - } - - else - { - - String[] raceTypes = utils.getStringArrayScriptVar(player, "vendor.races"); - if (raceTypes == null) - { - removeVendorVars(player); - return SCRIPT_CONTINUE; - } - - String specificRace = raceTypes[raceIndex]; - if (specificRace == null || specificRace.equals("")) - { - return SCRIPT_CONTINUE; - } - - boolean maleOnly = utils.getBooleanScriptVar(player, "vendor.gender.male_only_no_female"); - boolean femaleOnly = utils.getBooleanScriptVar(player, "vendor.gender.female_only_no_male"); - - if (maleOnly) - { - genderIndex = 0; - } - else if (femaleOnly) - { - genderIndex = 1; - } - - templateName = specificRace + "_"+ genderList[genderIndex] + ".iff"; - } - - if (templateName == null || templateName.equals("")) - { - removeVendorVars(player); - return SCRIPT_CONTINUE; - } - - vendor = createObject(create.TEMPLATE_PREFIX + "vendor/"+ templateName, inventory, ""); - if (!isIdValid(vendor) || !exists(vendor)) - { - removeVendorVars(player); - return SCRIPT_CONTINUE; - } - - obj_id inv = getObjectInSlot(self, "inventory"); - if ((inv == null) || (inv == obj_id.NULL_ID)) - { - sendSystemMessage(player, SID_SYS_CREATE_FAILED); - destroyObject(vendor); - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - if ((vendor != null)) - { - - setInvulnerable(vendor, true); - ai_lib.setDefaultCalmBehavior(vendor, ai_lib.BEHAVIOR_SENTINEL); - setObjVar(vendor, "vendor.NPC", 1); - - detachAllScripts(vendor); - attachScript(vendor, "terminal.vendor"); - attachScript(vendor, "terminal.npc_vendor"); - - boolean specialVendor = templateName.startsWith("special_vendor_"); - - if (specialVendor) - { - - sendSystemMessage(player, SID_TCG_VENDOR_CTS_WARNING); - - setObjVar(vendor, vendor_lib.SPECIAL_VENDOR_IDENTIFIER, true); - - if (utils.hasScriptVar(player, "vendor.special_vendor_basic")) - { - setObjVar(vendor, "vendor.special_vendor_basic", utils.getIntScriptVar(player, "vendor.special_vendor_basic")); - } - - if (utils.hasScriptVar(player, "vendor.special_vendor_clothing")) - { - setObjVar(vendor, "vendor.special_vendor_clothing", utils.getIntScriptVar(player, "vendor.special_vendor_clothing")); - } - - if (utils.hasScriptVar(player, "vendor.special_decrement_skillmod") && utils.hasScriptVar(player, "vendor.special_vendor_skillmod")) - { - String skillMod = utils.getStringScriptVar(player, "vendor.special_vendor_skillmod"); - if (skillMod == null || skillMod.equals("")) - { - sendSystemMessage(player, SID_SYS_CREATE_FAILED); - destroyObject(vendor); - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - setObjVar(vendor, "vendor.special_decrement_skillmod", true); - setObjVar(vendor, "vendor.special_vendor_skillmod", skillMod); - - CustomerServiceLog("vendor", "Vendor requires a skill mod: "+skillMod+" that is being decremented on the owner. Owner: "+ player + " Vendor: "+ vendor + " Location created is player inventory"); - if (getSkillStatMod(self, skillMod) <= 0) - { - CustomerServiceLog("vendor", " POSSIBLE EXPLOIT!!! Vendor: "+ vendor + " had skill mod: "+ skillMod + " that was supposed to be decremented on Owner: "+ player + " but the owner did not have the skill mod. Possible exploit or other problematic issue. Notify design."); - sendSystemMessage(player, SID_SYS_CREATE_FAILED); - destroyObject(vendor); - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - applySkillStatisticModifier(player, skillMod, -1); - CustomerServiceLog("vendor", " Vendor: "+ self + " had skill mod: "+ skillMod + " that was reimbursed to the Owner: "+ player + ". Skill mod decremented by 1. Location created is player inventory"); - } - } - else if (templateName.indexOf("ithorian") > -1) - { - dressup.dressNpc(vendor, "random_ithorian", true); - setObjVar(vendor, "dressed", 1); - } - else - { - dressup.dressNpc(vendor, "rich_no_jacket"); - } - } - else - { - sendSystemMessage(player, SID_SYS_CREATE_FAILED); - destroyObject(vendor); - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - } - else - { - - String vendorTemplate = "object/tangible/vendor/vendor_"+ terminalSuffix; - if (vendorTemplate == null || vendorTemplate.equals("")) - { - CustomerServiceLog("playerStructure", "Vendor Placement: Player: "+getName(self)+" "+self+" selected vendor type: "+terminalSuffix+" but the selection type failed."); - return SCRIPT_CONTINUE; - } - vendor = createObject(vendorTemplate, inventory, ""); - } - if (!isIdValid(vendor)) - { - sendSystemMessage(player, SID_SYS_CREATE_FAILED); - removeVendorVars(self); - return SCRIPT_CONTINUE; - } - - persistObject(vendor); - setCondition(vendor, CONDITION_VENDOR); - setName(vendor, "Vendor: "+ vendorName); - - int usedSlots = getIntObjVar(player, "used_vendor_slots") + 1; - setObjVar(player, "used_vendor_slots", usedSlots); - setObjVar(vendor, "vendor_owner", player); - setOwner(vendor, player); - setObjVar(player, "vendor_not_initialized", vendor); - removeVendorVars(self); - - int condition = 1000; - int items_stored = 0; - setObjVar(vendor, vendor_lib.VAR_MAINTENANCE_RATE, vendor_lib.BASE_MAINT_RATE); - setObjVar(vendor, vendor_lib.VAR_DECAY_RATE, vendor_lib.BASE_DECAY_RATE); - if (condition > 0) - { - setObjVar(vendor, vendor_lib.VAR_MAX_CONDITION, 1000); - setObjVar(vendor, vendor_lib.VAR_CONDITION, 1000); - } - - int time_stamp = getGameTime(); - setObjVar(vendor, vendor_lib.VAR_LAST_MAINTANENCE, time_stamp); - dictionary outparams = new dictionary(); - outparams.put("timestamp", time_stamp); - - messageTo(vendor, "OnMaintenanceLoop", outparams, vendor_lib.MAINTENANCE_HEARTBEAT, false); - - sendSystemMessage(player, SID_SYS_CREATE_SUCCESS); - - return SCRIPT_CONTINUE; - } - - - public int msgAssignDroid(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::msgAssignDroid --"+ self); - - obj_id[] droid_list = player_structure.getMaintenanceDroids(self); - - if (droid_list.length <= 0) - { - LOG("LOG_CHANNEL", "Error retrieving your list of maintenance capable droids."); - sendSystemMessage(self, new string_id(STF, "error_droid_list")); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_REVERT) - { - return SCRIPT_CONTINUE; - } - else if (bp == sui.BP_OK) - { - - int row_selected = sui.getListboxSelectedRow(params); - - if (row_selected != -1) - { - int max_maint = (((getIntObjVar(droid_list[row_selected], "module_data.struct_maint") - 1) / 5) + 1) * 3; - obj_id[] maint_list = getObjIdArrayObjVar(droid_list[row_selected], "module_data.maint_list.ids"); - - if (maint_list == null || maint_list.length == 0) - { - maint_list = new obj_id[max_maint]; - } - - obj_id structure = player_structure.getStructure(self); - - if (!isIdValid(structure)) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < maint_list.length; i++) - { - testAbortScript(); - if (maint_list[i] == structure) - { - sendSystemMessage(self, new string_id(STF, "structure_on_list")); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(maint_list[i])) - { - maint_list[i] = structure; - setObjVar(droid_list[row_selected], "module_data.maint_list.ids", maint_list); - setObjVar(droid_list[row_selected], "module_data.maint_list.loc_"+i, getLocation(structure)); - - if (callable.hasCDCallable(droid_list[row_selected])) - { - obj_id droid = callable.getCDCallable(droid_list[row_selected]); - - setObjVar(droid, "module_data.maint_list.ids", maint_list); - setObjVar(droid, "module_data.maint_list.loc_"+i, getLocation(structure)); - } - - String structName = ""; - - prose_package ppDroidAssigned = prose.getPackage(SID_DROID_ASSIGNED_TO_MAINTAIN); - prose.setTT(ppDroidAssigned, droid_list[row_selected]); - - if (!player_structure.isInstallation(structure) && hasObjVar(structure, player_structure.VAR_SIGN_NAME)) - { - prose.setTO(ppDroidAssigned, getStringObjVar(structure, player_structure.VAR_SIGN_NAME)); - } - else - { - prose.setTO(ppDroidAssigned, structure); - } - - sendSystemMessageProse(self, ppDroidAssigned); - - return SCRIPT_CONTINUE; - } - } - - sendSystemMessage(self, new string_id(STF, "droid_full")); - } - } - - return SCRIPT_CONTINUE; - } - - - public int turnstileExpire(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - obj_id building = params.getObjId("building"); - if (isIdValid(building)) - { - obj_id cont = getTopMostContainer(self); - if (cont == building) - { - params.put("sender", building); - messageTo(self, "handleEjection", params, 1.f, false); - sendSystemMessage(self, SID_TURNSTILE_EXPIRE); - } - } - - return SCRIPT_CONTINUE; - } - - - public int msgEnterPermissions(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::msgEnterPermissions--"+ params); - int row_selected = sui.getListboxSelectedRow(params); - obj_id structure = player_structure.getStructure(self); - - if ((structure == null)||(structure == obj_id.NULL_ID)) - { - return SCRIPT_CONTINUE; - } - - if (row_selected != -1) - { - String[] enter_list; - if (isGod(self)) - { - enter_list = player_structure.getCompleteEntryList(structure); - } - else - { - enter_list = player_structure.getEntryList(structure); - } - String player_name = enter_list[row_selected]; - player_structure.modifyEntryList(structure, player_name, self); - } - - return SCRIPT_CONTINUE; - } - - - public int msgBanPermissions(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::msgBanPermissions--"+ params); - int row_selected = sui.getListboxSelectedRow(params); - obj_id structure = player_structure.getStructure(self); - - if ((structure == null)||(structure == obj_id.NULL_ID)) - { - return SCRIPT_CONTINUE; - } - - if (row_selected != -1) - { - String[] ban_list = player_structure.getBanList(structure); - String player_name = ban_list[row_selected]; - player_structure.modifyBanList(structure, player_name, self); - } - - return SCRIPT_CONTINUE; - } - - - public int msgAdminPermissions(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::msgAdminPermissions--"+ params); - int row_selected = sui.getListboxSelectedRow(params); - obj_id structure = player_structure.getStructure(self); - - if ((structure == null)||(structure == obj_id.NULL_ID)) - { - return SCRIPT_CONTINUE; - } - - if (row_selected != -1) - { - String[] admin_list = player_structure.getAdminListNames(structure); - String player = admin_list[row_selected]; - player_structure.modifyAdminList(structure, player, self); - } - - return SCRIPT_CONTINUE; - } - - - public int msgVendorPermissions(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::msgVendorPermissions--"+ params); - int row_selected = sui.getListboxSelectedRow(params); - obj_id structure = player_structure.getStructure(self); - - if ((structure == null)||(structure == obj_id.NULL_ID)) - { - return SCRIPT_CONTINUE; - } - - if (row_selected != -1) - { - String[] vendor_list = player_structure.getVendorList(structure); - String player_name = vendor_list[row_selected]; - player_structure.modifyVendorList(structure, player_name, self); - } - - return SCRIPT_CONTINUE; - } - - - public int msgHopperPermissions(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::msgHopperPermissions--"+ params); - int row_selected = sui.getListboxSelectedRow(params); - obj_id structure = player_structure.getStructure(self); - - if ((structure == null)||(structure == obj_id.NULL_ID)) - { - return SCRIPT_CONTINUE; - } - - if (row_selected != -1) - { - String[] hopper_list = player_structure.getHopperListNames(structure); - String player = hopper_list[row_selected]; - player_structure.modifyHopperList(structure, player, self); - } - - return SCRIPT_CONTINUE; - } - - - public int msgPayMaintenance(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::msgPayMaintenance --"+ self); - obj_id target = utils.getObjIdScriptVar(self, "payMaintenance.target"); - boolean fromScd = pclib.isContainedByPlayer(self, target); - - utils.removeScriptVarTree(self, "payMaintenance"); - - if (!isIdValid(target)) - { - return SCRIPT_CONTINUE; - } - - if (!fromScd && player_structure.getStructure(self) != target) - { - sendSystemMessage(self, new string_id(STF, "pay_out_of_range")); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int amt = sui.getTransferInputTo(params); - if (amt < 1) - { - return SCRIPT_CONTINUE; - } - - if (fromScd) - { - queueCommand(self, (-404530384), target, Integer.toString(amt), COMMAND_PRIORITY_DEFAULT); - } - else - { - queueCommand(self, (-404530384), null, Integer.toString(amt), COMMAND_PRIORITY_DEFAULT); - } - return SCRIPT_CONTINUE; - } - - - public int msgAddPower(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::msgAddPower --"+ self); - obj_id target = utils.getObjIdScriptVar(self, "addPower.target"); - utils.removeScriptVarTree(self, "addPower"); - - if (isIdValid(target) && player_structure.getStructure(self) != target) - { - sendSystemMessage(self, new string_id(STF, "power_out_of_range")); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int amt = sui.getTransferInputTo(params); - if (amt < 1) - { - return SCRIPT_CONTINUE; - } - - queueCommand(self, (-1893504550), null, Integer.toString(amt), COMMAND_PRIORITY_DEFAULT); - return SCRIPT_CONTINUE; - } - - - public int msgDepositPowerIncubator(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = utils.getObjIdScriptVar(self, "depositPowerIncubator.target"); - utils.removeScriptVarTree(self, "depositPowerIncubator"); - - if (isIdValid(target) && !incubator.validateActiveUser(target, self)) - { - - sendSystemMessage(self, incubator.SID_NOT_YOUR_INCUBATOR); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - - utils.removeScriptVarTree(self, "powerIncubator"); - return SCRIPT_CONTINUE; - } - - int amt = sui.getTransferInputTo(params); - if (amt < 1) - { - return SCRIPT_CONTINUE; - } - - queueCommand(self, (1833062743), target, Integer.toString(amt), COMMAND_PRIORITY_DEFAULT); - return SCRIPT_CONTINUE; - } - - - public int msgWithdrawMaintenance(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::msgWithdrawMaintenance --"+ self); - - String amount_str = sui.getInputBoxText(params); - - if (utils.stringToInt(amount_str) > 0) - { - queueCommand(self, (-707821905), null, amount_str, COMMAND_PRIORITY_DEFAULT); - } - - return SCRIPT_CONTINUE; - } - - - public int msgNameStructure(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::msgNameStructure --"+ self); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - String name = sui.getInputBoxText(params); - if (name == null || name.length() < 1) - { - LOG("LOG_CHANNEL", self + " ->That is not a valid name."); - sendSystemMessage(self, new string_id(STF, "not_valid_name")); - return SCRIPT_CONTINUE; - } - - queueCommand(self, (-1016613791), null, name, COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int OnAddStructure(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::OnAddStructure"); - - obj_id structure = params.getObjId("structure"); - String template = params.getString("template"); - String structure_name = params.getString("structure_name"); - location structure_loc = params.getLocation("structure_loc"); - - LOG("LOG_CHANNEL", "structure_name ->"+ structure_name); - - player_structure.addStructure(structure, template, structure_name, structure_loc, self, getFirstName(self), false, true); - - if (structure_loc != null) - { - player_structure.addStructureWaypoint(self, structure_loc, structure_name, structure); - } - - return SCRIPT_CONTINUE; - } - - - public int OnRemoveStructure(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::OnRemoveStructure"); - - obj_id structure = params.getObjId("structure"); - String template = params.getString("template"); - obj_id waypoint = params.getObjId("waypoint"); - - player_structure.removeStructure(structure, template, self, getFirstName(self), false, true); - - if (waypoint != null) - { - destroyWaypointInDatapad(waypoint, self); - } - - obj_id[] callables = callable.getDatapadCallablesByType(self, callable.CALLABLE_TYPE_COMBAT_PET); - - if (callables == null || callables.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0, j = callables.length; i < j; i++) - { - testAbortScript(); - if (!isIdValid(callables[i]) || !exists(callables[i])) - { - continue; - } - - if (!hasObjVar(callables[i], "module_data.maint_list.ids")) - { - continue; - } - - obj_id[] struct_list = getObjIdArrayObjVar(callables[i], "module_data.maint_list.ids"); - - if (struct_list == null || struct_list.length <= 0) - { - continue; - } - - int structureIndex = utils.getElementPositionInArray(struct_list, structure); - - if (structureIndex < 0) - { - continue; - } - - obj_id droid = callable.getCDCallable(callables[i]); - - player_structure.removeStructureFromMaintenance(droid, callables[i], structureIndex); - } - - return SCRIPT_CONTINUE; - } - - - public int handleAdjustLotCount(obj_id self, dictionary params) throws InterruptedException - { - int numLots = params.getInt("lotAdjust"); - adjustLotCount(getPlayerObject(self), numLots); - return SCRIPT_CONTINUE; - } - - - public int OnClearConfirmDestroy(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_building::OnClearConfirmDestroy"); - if (utils.hasScriptVar(self, player_structure.VAR_CONFIRM_DESTROY)) - { - utils.removeScriptVar(self, player_structure.VAR_CONFIRM_DESTROY); - } - - return SCRIPT_CONTINUE; - } - - - public int OnConstructionComplete(obj_id self, dictionary params) throws InterruptedException - { - - string_id structure_name = params.getStringId("structure_name"); - int lots_remaining = player_structure.MAX_LOTS - getAccountNumLots(getPlayerObject(self)); - - prose_package pp_msg = new prose_package(); - pp_msg.stringId = ((lots_remaining >= 0) ? SID_CONSTRUCTION_COMPLETE : SID_CONSTRUCTION_COMPLETE_LOT_LIMIT_EXCEEDED); - pp_msg.actor.set(self); - pp_msg.other.set(structure_name); - pp_msg.digitInteger = ((lots_remaining >= 0) ? lots_remaining : -lots_remaining); - - String send_msg = "@"+ SID_CONSTRUCTION_COMPLETE_SENDER.toString (); - String subject_str = "@"+ SID_CONSTRUCTION_COMPLETE_SUBJECT.toString (); - String body_msg = chatMakePersistentMessageOutOfBandBody (null, pp_msg); - chatSendPersistentMessage(send_msg, getFirstName(self), subject_str, null, body_msg); - - return SCRIPT_CONTINUE; - } - - - public int msgPAWithdrawSuccess(obj_id self, dictionary params) throws InterruptedException - { - - if (params != null) - { - int amt = params.getInt("amount"); - if (amt > 0) - { - sendSystemMessageProse(self, prose.getPackage(new string_id (STF, "withdraw_credits"), amt)); - } - } - - return SCRIPT_CONTINUE; - } - - - public int msgPAWithdrawFail(obj_id self, dictionary params) throws InterruptedException - { - sendSystemMessage(self, new string_id(STF, "withdrawal_failed")); - - return SCRIPT_CONTINUE; - } - - - public int handleStatusUi(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = utils.getObjIdScriptVar(self, "player_structure.status.target"); - boolean fromScd = utils.hasScriptVar(self, "player_structure.status.fromScd"); - utils.removeScriptVarTree(self, "player_structure.status"); - - obj_id newTarget = fromScd? target : player_structure.getStructure(self); - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_OK) - { - if (!isIdValid(target)) - { - sendSystemMessage(self, new string_id(STF, "no_valid_structurestatus")); - } - else - { - if (newTarget == target) - { - queueCommand(self, (335013253), fromScd? newTarget : null, "", COMMAND_PRIORITY_DEFAULT); - } - else - { - sendSystemMessage(self, new string_id(STF, "changed_structurestatus")); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleDestroyUi(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar(self, "player_structure.destroy.pid"); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - utils.removeScriptVarTree(self, "player_structure.destroy"); - return SCRIPT_CONTINUE; - } - - obj_id target = utils.getObjIdScriptVar(self, "player_structure.destroy.target"); - obj_id structure = player_structure.getStructure(self); - if (!confirmDestroyTarget(structure, target)) - { - return SCRIPT_CONTINUE; - } - - string_id confirm_destruction_title = new string_id(STF, "confirm_destruction_t"); - String title = getString(confirm_destruction_title); - - string_id redeed_structure_prefix = new string_id(STF, "your_structure_prefix"); - String prompt = getString(redeed_structure_prefix) + "\\"; - - boolean willRedeed = utils.getBooleanScriptVar(self, "player_structure.destroy.willredeed"); - if (willRedeed) - { - string_id will_redeed_confirm_text = new string_id(STF, "will_redeed_confirm"); - prompt += colors_hex.LIMEGREEN+getString(will_redeed_confirm_text); - } - else - { - string_id will_not_redeed_confirm_text = new string_id(STF, "will_not_redeed_confirm"); - prompt += colors_hex.TOMATO+getString(will_not_redeed_confirm_text); - } - - prompt += "\\#."; - string_id will_redeed_confirm_suffix_text = new string_id(STF, "will_redeed_suffix"); - prompt += getString(will_redeed_confirm_suffix_text); - - int key = utils.getIntScriptVar(self, "player_structure.destroy.key"); - if (key == 0) - { - key = rand(100000, 999999); - utils.setScriptVar(self, "player_structure.destroy.key", key); - } - - prompt += "\n\nCode: "+key; - - int pid = sui.inputbox(self, self, prompt, title, "handleDestroyConfirm", 6, false, ""); - if (pid > -1) - { - utils.setScriptVar(self, "player_structure.destroy.pid", pid); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDestroyConfirm(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar(self, "player_structure.destroy.pid"); - - int bp = sui.getIntButtonPressed(params); - String text = sui.getInputBoxText(params); - if (bp == sui.BP_CANCEL || text == null || text.equals("")) - { - utils.removeScriptVarTree(self, "player_structure.destroy"); - return SCRIPT_CONTINUE; - } - - obj_id target = utils.getObjIdScriptVar(self, "player_structure.destroy.target"); - obj_id structure = player_structure.getStructure(self); - if (!confirmDestroyTarget(structure, target)) - { - return SCRIPT_CONTINUE; - } - - int key = utils.getIntScriptVar(self, "player_structure.destroy.key"); - String skey = Integer.toString(key); - - if (text.equals(skey)) - { - if (tcg.isBarnStructure(structure) && tcg.getTotalBarnStoredBeasts(structure) > 0) - { - String title = utils.packStringId(new string_id("tcg", "barn_confirm_destroy_with_beasts_title")); - String testMsg = utils.packStringId(new string_id("tcg", "barn_confirm_destroy_with_beasts_prompt")); - String ok_button = utils.packStringId(new string_id ("quest/ground/util/quest_giver_object", "button_accept")); - String cancel_button = utils.packStringId(new string_id ("quest/ground/util/quest_giver_object", "button_decline")); - - int pid = sui.createSUIPage(sui.SUI_MSGBOX, self, self, "handleDestroyBarnAndBeastsConfirm"); - - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, title); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, testMsg); - - sui.msgboxButtonSetup(pid, sui.OK_ONLY); - - utils.setScriptVar(self, "player_structure.destroy.barn_text", text); - sui.showSUIPage(pid); - } - else - { - utils.setScriptVar(self, player_structure.VAR_CONFIRM_DESTROY, target); - sendSystemMessage(self, new string_id(STF, "processing_destruction")); - queueCommand(self, (419174182), null, text, COMMAND_PRIORITY_DEFAULT); - } - } - else - { - sui.msgbox(self, "@player_structure:incorrect_destroy_code"); - utils.removeScriptVarTree(self, "player_structure.destroy"); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDestroyBarnAndBeastsConfirm(obj_id self, dictionary params) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int handlePlayerStructurePackupLockout(obj_id self, dictionary params) throws InterruptedException - { - - if (!params.containsKey("house")) - { - blog("player_buidling.handlePlayerStructurePackupLockout() PARAMS MISSING, ABORTING."); - return SCRIPT_CONTINUE; - } - - obj_id structure = params.getObjId ("house"); - if (!isValidId(structure)) - { - blog("player_buidling.handlePlayerStructurePackupLockout() Invalid Structure OID, ABORTING."); - return SCRIPT_CONTINUE; - } - - blog("player_buidling.packedAbandonedStructure() Message received by player to start lockout timer."); - - utils.setScriptVar(self, player_structure.SCRIPTVAR_HOUSE_PACKUP_LOCKOUT_TIME, getGameTime()); - messageTo(self, "handlePlayerStructurePackupLockoutRemoval", null, player_structure.HOUSE_PACKUP_LOCKOUT_TIMER, false); - - utils.setScriptVar(structure, player_structure.SCRIPTVAR_HOUSE_PACKUP_LOCKOUT_TIME, getGameTime()); - messageTo(structure, "handleStructurePackupLockoutRemoval", params, player_structure.HOUSE_PACKUP_LOCKOUT_TIMER, false); - - if (params != null && !params.equals("")) - { - CustomerServiceLog("housepackup", "Player: "+ getPlayerName(self) + " ("+ self+ ") is" + " attempting to pack up a structure and has received lockout" + " timer for packup event that will expire in " + player_structure.HOUSE_PACKUP_LOCKOUT_TIMER + "." ); - } - - return SCRIPT_CONTINUE; - } - - - public int handlePlayerStructurePackupLockoutRemoval(obj_id self, dictionary params) throws InterruptedException - { - blog("player_buidling.handlePlayerStructurePackupLockoutRemoval() Message received by player to remove lockout timer."); - - utils.removeScriptVarTree(self, player_structure.SCRIPTVAR_HOUSE_PACKUP_TREE_PREFIX); - return SCRIPT_CONTINUE; - } - - - public int handleFailedStructurePackup(obj_id self, dictionary params) throws InterruptedException - { - blog("player_buidling.handleFailedStructurePackup() Message received by player to handle failed packup."); - - messageTo(self, "handlePlayerStructurePackupLockoutRemoval", null, 0, false); - - if (player_structure.canPackMoreToday(self)) - { - sendSystemMessage(self, SID_HOUSE_PACKUP_FAILED); - } - - CustomerServiceLog("housepackup", "Player: "+ getPlayerName(self) + " ("+ self+ ") has" + " had lockout timer removed early due to structure packup problems." ); - - return SCRIPT_CONTINUE; - } - - - public int callAirStrikePackAbandonedStructure(obj_id self, dictionary params) throws InterruptedException - { - blog("player_buidling.callAirStrikePackAbandonedStructure() Message received by player to send animation, tally success."); - - if ((params == null) || (params.isEmpty())) - { - blog("player_buidling.callAirStrikePackAbandonedStructure() ALL PARAMS MISSING, ABORTING."); - messageTo(self, "handlePlayerStructurePackupLockoutRemoval", null, 0, false); - return SCRIPT_CONTINUE; - } - - if (!params.containsKey("structure") || !params.containsKey("structure_owner")) - { - blog("player_buidling.callAirStrikePackAbandonedStructure() PARAMS MISSING, ABORTING."); - messageTo(self, "handlePlayerStructurePackupLockoutRemoval", null, 0, false); - return SCRIPT_CONTINUE; - } - - blog("player_buidling.callAirStrikePackAbandonedStructure() about to send animation request."); - - obj_id structure = params.getObjId ("structure"); - if (!isValidId(structure)) - { - blog("player_building.moveStructureToSCD() MISSING PARAMS. ABORTING AIRSTRIKE"); - messageTo(self, "handlePlayerStructurePackupLockoutRemoval", null, 0, false); - return SCRIPT_CONTINUE; - } - - location where = getLocation(structure); - if (player_structure.canPackMoreToday(self)) - { - prose_package p = prose.getPackage(new string_id("spam", "house_packup_airstrike")); - commPlayers(self, "object/mobile/dressed_hiddendagger_pilot_m_01.iff", "sound/sys_comm_other.snd", 5f, self, p); - playClientEffectLoc(self, "clienteffect/house_packup_airstrike.cef", where, 0); - } - - params.put("player", self); - messageTo (structure, "moveStructureToSCD", params, 3, false); - - blog("player_buidling.callAirStrikePackAbandonedStructure() The animation will eventually play."); - return SCRIPT_CONTINUE; - } - - - public int msgConfirmHousePackup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "packup.structure")) - { - return SCRIPT_CONTINUE; - } - - obj_id structure = utils.getObjIdScriptVar(self, "packup.structure"); - utils.removeScriptVar(self, "packup.structure"); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - LOG("house", "Declined packup."); - return SCRIPT_CONTINUE; - } - - if (!player_structure.canPackBuilding(self, structure)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.canPackStructureWithVendors(self, structure)) - { - return SCRIPT_CONTINUE; - } - - location structLoc = getLocation(structure); - location playerLoc = getLocation(self); - if (structLoc == null || playerLoc == null) - { - return SCRIPT_CONTINUE; - } - if (getDistance(structLoc, playerLoc) > 10.0f) - { - sendSystemMessage(self, SID_PACKUP_TOO_FAR_AWAY); - return SCRIPT_CONTINUE; - } - - params.put("structure", structure); - messageTo(self, "msgFinalizePackup", params, 0, false); - - return SCRIPT_CONTINUE; - } - - - public int msgFinalizePackup(obj_id self, dictionary params) throws InterruptedException - { - blog("player_building.msgFinalizePackup() init!"); - - obj_id structure = params.getObjId("structure"); - blog("player_building.msgFinalizePackup() STRUCTURE CONTENTS LOADED? "+areAllContentsLoaded(structure)); - - blog("player_building.msgFinalizePackup() STRUCTURE LOADED? "+structure.isLoaded()); - - if (!isIdValid(structure)) - { - return SCRIPT_CONTINUE; - } - - if (!structure.isLoaded() || !structure.isAuthoritative()) - { - blog("player_building.msgFinalizePackup() STRUCTURE LOADED? "+structure.isLoaded()); - blog("player_building.msgFinalizePackup() STRUCTURE CONTENTS LOADED? "+areAllContentsLoaded(structure)); - - CustomerServiceLog("housepackup", "Structure ("+ structure + ") could not be packed by player (" + getPlayerName(self) + ") msgFinalizePackup -" + " isLoaded = "+ structure.isLoaded() - + " isAuthoritative = "+ structure.isAuthoritative() - ); - - return SCRIPT_CONTINUE; - } - - if (!player_structure.isInstallation(structure) && !areAllContentsLoaded(structure) && !hasObjVar(structure, "structure.player.pack")) - { - - setObjVar(structure, "structure.player.pack", self); - - loadBuildingContents(self, structure); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(structure, "structure.player.pack")) - { - blog("player_building.msgFinalizePackup() STRUCTURE IS GOOD FOR PACKUP"); - player_structure.finalizePackUp(self, structure); - } - return SCRIPT_CONTINUE; - } - - - public int packUpCityAbandonedStructure(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - LOG("sissynoid", "Entered: packUpCityAbandonedStructure"); - obj_id structure = params.getObjId("house"); - - if (!isIdValid(structure)) - { - return SCRIPT_CONTINUE; - } - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.isCityPackupAuthoritative(self, structure)) - { - LOG("sissynoid", "packUpCityAbandonedStructure: Structure is not Loaded or Authoritative: "); - CustomerServiceLog("city_house_packup", - "'packUpCityAbandonedStructure' - Structure ("+ structure + - ") could not be packed by player (" + getPlayerName(self) + ") player -"+ - " isLoaded(Player) = "+ self.isLoaded() + - " isAuthoritative(Player) = "+ self.isAuthoritative() + - " isLoaded(Structure) = "+ structure.isLoaded() + - " isAuthoritative(Structure) = "+ structure.isAuthoritative()); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isInstallation(structure) && !areAllContentsLoaded(structure) && !hasObjVar(structure, "structure.player.pack")) - { - LOG("sissynoid", "packUpCityAbandonedStructure: Not Installation, Not Loaded, No Objvar"); - - setObjVar(structure, "structure.player.pack", self); - - loadBuildingContents(self, structure); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(structure, "structure.player.pack")) - { - LOG("sissynoid", "Go! All Contents are Loaded!"); - player_structure.finalizeCityPackUp(self, structure); - } - - return SCRIPT_CONTINUE; - } - - - public int msgConfirmVendorPackup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "packup.vendor")) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, "packup.vendor.suiconfirm")) - { - utils.removeScriptVar(self, "packup.vendor.suiconfirm"); - } - - obj_id vendor = utils.getObjIdScriptVar(self, "packup.vendor"); - utils.removeScriptVar(self, "packup.vendor"); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - LOG("vendor", "Declined packup."); - return SCRIPT_CONTINUE; - } - - obj_id vendorOwner = getObjIdObjVar(vendor, "vendor_owner"); - if (!isIdValid(vendorOwner)) - { - vendorOwner = getOwner(vendor); - } - - vendor_lib.finalizePackUp(vendorOwner, vendor, self, false); - - return SCRIPT_CONTINUE; - } - - - public int getVendorInfoForPlayerRsp(obj_id self, dictionary params) throws InterruptedException - { - String summary = params.getString("summary"); - if (summary == null) - { - return SCRIPT_CONTINUE; - } - - String[] name = params.getStringArray("name"); - if (name == null) - { - return SCRIPT_CONTINUE; - } - - String[] location = params.getStringArray("location"); - if ((location == null) || (location.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] tax = params.getStringArray("tax"); - if ((tax == null) || (tax.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] taxCity = params.getStringArray("taxCity"); - if ((taxCity == null) || (taxCity.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] emptyDate = params.getStringArray("emptyDate"); - if ((emptyDate == null) || (emptyDate.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] lastAccessDate = params.getStringArray("lastAccessDate"); - if ((lastAccessDate == null) || (lastAccessDate.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] inactiveDate = params.getStringArray("inactiveDate"); - if ((inactiveDate == null) || (inactiveDate.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] status = params.getStringArray("status"); - if ((status == null) || (status.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] searchable = params.getStringArray("searchable"); - if ((searchable == null) || (searchable.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] entranceCharge = params.getStringArray("entranceCharge"); - if ((entranceCharge == null) || (entranceCharge.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] itemCount = params.getStringArray("itemCount"); - if ((itemCount == null) || (itemCount.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] offerCount = params.getStringArray("offerCount"); - if ((offerCount == null) || (offerCount.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] stockRoomCount = params.getStringArray("stockRoomCount"); - if ((stockRoomCount == null) || (stockRoomCount.length != name.length)) - { - return SCRIPT_CONTINUE; - } - - String[] columnHeader = - { - "Name", "Location", "Status", "Active Items", "Stockroom Items", "Offered Items", "% Tax", "Tax City", "Searchable", "Entrance Fee", "Last Access Date", "Empty Date", "Inactive Date" - }; - String[] columnHeaderType = - { - "text", "text", "text", "integer", "integer", "integer", "integer", "text", "text", "integer", "text", "text", "text" - }; - String[][] columnData = new String[13][0]; - columnData[0] = name; - columnData[1] = location; - columnData[2] = status; - columnData[3] = itemCount; - columnData[4] = stockRoomCount; - columnData[5] = offerCount; - columnData[6] = tax; - columnData[7] = taxCity; - columnData[8] = searchable; - columnData[9] = entranceCharge; - columnData[10] = lastAccessDate; - columnData[11] = emptyDate; - columnData[12] = inactiveDate; - - sui.tableColumnMajor(self, self, sui.OK_ONLY, "Vendor Information", null, summary, columnHeader, columnHeaderType, columnData, true); - - return SCRIPT_CONTINUE; - } - - - public boolean isMoveCommandValid(obj_id player, obj_id target) throws InterruptedException - { - location loc = getLocation(player); - obj_id structure = getTopMostContainer(loc.cell); - - if (!isIdValid(structure) || !isIdValid(target)) - { - return false; - } - - if (hasObjVar (target, "paintingId")) - { - obj_id painting = getObjIdObjVar (target, "paintingId"); - destroyObject (painting); - removeObjVar (target, "paintingId"); - - sendSystemMessage (player, MOVED_CTRL_OBJ); - - } - - if (static_item.isStaticItem(target)) - { - String paintingName = static_item.getStaticItemName(target); - if (paintingName.startsWith ("item_publish_gift_magic_painting_")) - { - sendSystemMessage (player, MOVED_PAINTING); - return false; - } - } - - if (hasObjVar (target, "noMoveItem")) - { - sendSystemMessage (player, NO_MOVE_ITEM); - return false; - - } - - if (getGameObjectType(structure) == GOT_building_factional && hasObjVar(structure, "hq")) - { - sendSystemMessage(player, new string_id(STF, "no_move_hq")); - return false; - } - - if (!player_structure.isAdmin(structure, player)) - { - LOG("LOG_CHANNEL", player + " ->You must be an admin to manipulate objects."); - sendSystemMessage(player, new string_id(STF, "admin_move_only")); - return false; - } - if (!canManipulateSkipNoTradeCheck(player, target, true, false, 0, true)) - { - sendSystemMessage(player, new string_id(STF, "cant_manipulate")); - return false; - } - - if (isPlayer(target) || (isMob(target) && !hasCondition(target, CONDITION_VENDOR))) - { - LOG("LOG_CHANNEL", player + " ->You can't manipulate that."); - sendSystemMessage(player, new string_id(STF, "cant_manipulate")); - return false; - } - - obj_id structure_obj = getTopMostContainer(target); - if (structure != structure_obj || target == structure_obj) - { - LOG("LOG_CHANNEL", player + " -> That object is not within the building."); - sendSystemMessage(player, new string_id(STF, "item_not_in_building")); - return false; - } - - obj_id[] base_objects = player_structure.getStructureBaseObjects(structure); - if (base_objects != null) - { - for (int i = 0; i < base_objects.length; i++) - { - testAbortScript(); - if (target == base_objects[i]) - { - LOG("LOG_CHANNEL", player + " -> You cannot move that object."); - sendSystemMessage(player, new string_id(STF, "cant_move_item")); - return false; - } - } - } - - return true; - } - - - public String getCellName(obj_id building, obj_id cell) throws InterruptedException - { - - String[] cellNames = getCellNames(building); - - for (int i = 0; i < cellNames.length; i++) - { - testAbortScript(); - - String cellName = cellNames[i]; - obj_id thisCell = getCellId(building, cellName); - - if (thisCell == cell) - { - - return cellName; - } - } - - return ""; - } - - - public boolean canPlaceCivic(obj_id player, obj_id deed, location position, String template) throws InterruptedException - { - - if (utils.isFreeTrial(player)) - { - return false; - } - - int city_id = getCityAtLocation(position, 0); - if (!cityExists(city_id)) - { - return false; - } - - obj_id mayor = cityGetLeader(city_id); - if (mayor != player) - { - return false; - } - - return true; - } - - - public boolean canPlaceUnique(obj_id player, obj_id deed, location position, String template) throws InterruptedException - { - int city_id = getCityAtLocation(position, 0); - if (!cityExists(city_id)) - { - return false; - } - - if (utils.isFreeTrial(player)) - { - return false; - } - - if (player_structure.isShuttleportTemplate(template)) - { - - int travelCost = cityGetTravelCost(city_id); - if (travelCost > 0) - { - return false; - } - else - { - return true; - } - } - else if (player_structure.isCloneTemplate(template)) - { - - obj_id clone = cityGetCloneId(city_id); - if (isIdValid(clone)) - { - - obj_id[] structures = cityGetStructureIds(city_id); - for (int i=0; i 1) - { - return false; - } - - return true; - } - - - public boolean removeVendorVars(obj_id self) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - utils.removeScriptVarTree(self, VENDOR_VAR_PREFIX); - utils.removeScriptVarTree(self, "vendor"); - blog("player_building.removeVendorVars: removed VENDOR_VAR_PREFIX Vars "); - return true; - } - - - public boolean handleVendorTypeSelect(obj_id self) throws InterruptedException - { - blog("player_building:handleVendorTypeSelect() - about to requestPlayerVendorCount"); - if (!isValidId(self) || !exists(self)) - { - return false; - } - else if (!validateVendorPlacement(self)) - { - return false; - } - - blog("player_building:handleVendorTypeSelect() - SETTING CREATING_VENDOR to 1"); - utils.setScriptVar(self, CREATING_VENDOR, 1); - requestPlayerVendorCount(self); - - return true; - } - - - public boolean validateVendorPlacement(obj_id self) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (player_structure.isCivic(self)) - { - blog("player_building:validateVendorPlacement() - isCivic = true"); - return false; - } - if (utils.isFreeTrial(self)) - { - blog("player_building:validateVendorPlacement() - Player is free trial"); - sendSystemMessage(self, SID_NO_VENDOR); - return false; - } - if (hasObjVar(self, "vendor_not_initialized")) - { - blog("player_building:validateVendorPlacement() - has vendor_not_initialized"); - - sendSystemMessage(self, SID_SYS_VENDOR_NOT_INITIALIZED); - return false; - } - blog("player_building:validateVendorPlacement() - Everything is good, player can place."); - - return true; - } - - - public String[] getSpecialVendors(obj_id self, int hireMod) throws InterruptedException - { - blog("player_building.getSpecialVendors: init"); - - if (!isValidId(self) || !exists(self)) - { - return null; - } - else if (hireMod < 50) - { - return null; - } - - blog("player_building.getSpecialVendors: initial validation passes"); - - String[] specialVendorNames = dataTableGetStringColumn(TBL_SPECIAL_PLAYER_VENDOR_TYPES, "special_vendor_name"); - if (specialVendorNames == null) - { - return null; - } - - blog("player_building.getSpecialVendors: specialVendorNames received"); - - String[] specialVendorSkillMod = dataTableGetStringColumn(TBL_SPECIAL_PLAYER_VENDOR_TYPES, "skill_mod"); - if (specialVendorSkillMod == null) - { - return null; - } - - blog("player_building.getSpecialVendors: specialVendorSkillMod received"); - - int[] requiredHireMod = dataTableGetIntColumn(TBL_SPECIAL_PLAYER_VENDOR_TYPES, "requires_hiring_mod"); - if (requiredHireMod == null) - { - return null; - } - - blog("player_building.getSpecialVendors: requiredHireMod received"); - blog("player_building.getSpecialVendors: received specialVendorNames, specialVendorSkillMod, requiredHireMod"); - - Vector allSpecialVendorsOfPlayerHireMod = new Vector(); - allSpecialVendorsOfPlayerHireMod.setSize(0); - Vector allSpecialVendorsMods = new Vector(); - allSpecialVendorsMods.setSize(0); - - blog("player_building.getSpecialVendors: about to grab special vendor list"); - - for (int i = 0; i < specialVendorNames.length; i++) - { - testAbortScript(); - if (requiredHireMod[i] <= hireMod) - { - blog("player_building.getSpecialVendors: "+specialVendorNames[i]+" had a hire mod of: "+requiredHireMod[i]+" and was added to list"); - utils.addElement(allSpecialVendorsOfPlayerHireMod, specialVendorNames[i]); - utils.addElement(allSpecialVendorsMods, specialVendorSkillMod[i]); - blog("player_building.getSpecialVendors: "+specialVendorNames[i]+" has a skill mod: "+specialVendorSkillMod[i]); - } - } - if (allSpecialVendorsOfPlayerHireMod == null || allSpecialVendorsMods == null) - { - return null; - } - - blog("player_building.getSpecialVendors: specialVendorNames.length: "+specialVendorNames.length); - - int vendorNameSize = allSpecialVendorsOfPlayerHireMod.size(); - int vendorModSize = allSpecialVendorsMods.size(); - if (vendorNameSize != vendorModSize) - { - return null; - } - else if (vendorNameSize == 0 || vendorModSize == 0) - { - return null; - } - - String[] vendorNames = new String[vendorNameSize]; - allSpecialVendorsOfPlayerHireMod.toArray(vendorNames); - String[] vendorMods = new String[vendorModSize]; - allSpecialVendorsMods.toArray(vendorMods); - - Vector allSpecialVendors = new Vector(); - allSpecialVendors.setSize(0); - - blog("player_building.getSpecialVendors: about to test each of the special vendors to see if I have the necessary skill mods."); - - for (int b = 0; b < specialVendorSkillMod.length; b++) - { - testAbortScript(); - if (getSkillStatMod(self, vendorMods[b]) <= 0) - { - continue; - } - - blog("player_building.getSpecialVendors: Found a skill mod I have: "+vendorMods[b]); - utils.addElement(allSpecialVendors, vendorNames[b]); - } - blog("player_building.getSpecialVendors: allSpecialVendors.size(): "+allSpecialVendors.size()); - return (String[])allSpecialVendors.toArray(new String[0]); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/player/player_collection.java b/sku.0/sys.server/compiled/game/script/player/player_collection.java deleted file mode 100644 index 21648e8b0..000000000 --- a/sku.0/sys.server/compiled/game/script/player/player_collection.java +++ /dev/null @@ -1,140 +0,0 @@ -package script.player; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.badge; -import script.library.collection; -import script.library.prose; -import script.library.utils; - - -public class player_collection extends script.base_script -{ - public player_collection() - { - } - public static final string_id SID_SLOT_ADDED = new string_id("collection","player_slot_added"); - public static final string_id SID_HIDDEN_SLOT = new string_id("collection","player_hidden_slot_added"); - public static final string_id SID_COLLECTION_COMPLETE = new string_id("collection","player_collection_complete"); - public static final string_id SID_SERVER_FIRST = new string_id("collection","player_server_first"); - - public static final String SERVER_FIRST_SLOT = "bdg_server_first_01"; - - - public int OnCollectionSlotModified(obj_id self, String bookName, String pageName, String collectionName, String slotName, boolean isCounterTypeSlot, int previousValue, int currentValue, int maxSlotValue, boolean slotCompleted) throws InterruptedException - { - - if (bookName.equals(badge.BADGE_BOOK)) - { - return SCRIPT_CONTINUE; - } - - String[] catagories = getCollectionSlotCategoryInfo(slotName); - if (catagories != null && catagories.length > 0) - { - - for (int i = 0; i < catagories.length; ++i) - { - testAbortScript(); - if (catagories[i].equals(collection.REWARD_ON_UPDATE_CATEGORY)) - { - collection.grantCollectionReward(self, slotName); - break; - } - } - } - - if (slotCompleted) - { - boolean giveMessage = true; - - if (catagories != null && catagories.length > 0) - { - for (int i = 0; i < catagories.length; ++i) - { - testAbortScript(); - if (catagories[i].equals(collection.REWARD_ON_COMPLETE_CATEGORY)) - { - collection.grantCollectionReward(self, slotName); - break; - } - } - for (int i = 0; i < catagories.length; ++i) - { - testAbortScript(); - if (catagories[i].equals(collection.NO_MESSAGE_CATEGORY)) - { - giveMessage = false; - break; - } - } - } - - prose_package pp = new prose_package(); - - int row = dataTableSearchColumnForString(slotName, "slotName", collection.COLLECTION_TABLE); - if (row < 0) - { - - return SCRIPT_CONTINUE; - } - - int isHidden = dataTableGetInt(collection.COLLECTION_TABLE, row, "hidden"); - if (isHidden > 0 && giveMessage) - { - prose.setStringId(pp, SID_HIDDEN_SLOT); - prose.setTU(pp, new string_id("collection_n", slotName)); - prose.setTO(pp, new string_id("collection_n", collectionName)); - sendSystemMessageProse(self, pp); - play2dNonLoopingMusic(self, "sound/utinni.snd"); - } - else if (giveMessage) - { - prose.setStringId(pp, SID_SLOT_ADDED); - prose.setTU(pp, new string_id("collection_n", slotName)); - prose.setTO(pp, new string_id("collection_n", collectionName)); - sendSystemMessageProse(self, pp); - play2dNonLoopingMusic(self, "sound/utinni.snd"); - } - - if (hasCompletedCollection(self, collectionName)) - { - - prose.setTO(pp, new string_id("collection_n", collectionName)); - prose.setStringId(pp, SID_COLLECTION_COMPLETE); - sendSystemMessageProse(self, pp); - collection.grantCollectionReward(self, collectionName); - } - - } - - return SCRIPT_CONTINUE; - } - - - public int OnCollectionServerFirst(obj_id self, String bookName, String pageName, String collectionName) throws InterruptedException - { - - prose_package pp = new prose_package(); - - prose.setStringId(pp, SID_SERVER_FIRST); - prose.setTO(pp, new string_id("collection_n", collectionName)); - prose.setTT(pp, getClusterName()); - sendSystemMessageProse(self, pp); - - if (!badge.hasBadge(self, SERVER_FIRST_SLOT)) - { - badge.grantBadge(self, SERVER_FIRST_SLOT); - } - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/player/player_faction.java b/sku.0/sys.server/compiled/game/script/player/player_faction.java deleted file mode 100644 index 4cb1a25f1..000000000 --- a/sku.0/sys.server/compiled/game/script/player/player_faction.java +++ /dev/null @@ -1,781 +0,0 @@ -package script.player; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.colors_hex; -import script.library.factions; -import script.library.gcw; -import script.library.instance; -import script.library.prose; -import script.library.pvp; -import script.library.regions; -import script.library.sui; -import script.library.utils; -import script.library.ai_lib; - - -public class player_faction extends script.base_script -{ - public player_faction() - { - } - public static final string_id SID_ABORT_RESIGNATION = new string_id("faction_recruiter", "abort_resignation"); - public static final string_id SID_SUI_RESIG_COMPLETE_IN_5 = new string_id("faction_recruiter", "sui_resig_complete_in_5"); - - public static final string_id SID_NOT_ALIGNED = new string_id("faction_recruiter", "not_aligned"); - public static final string_id SID_PVP_STATUS_CHANGING = new string_id("faction_recruiter", "pvp_status_changing"); - public static final string_id SID_ON_LEAVE_TO_COVERT = new string_id("faction_recruiter", "on_leave_to_covert"); - public static final string_id SID_COVERT_TO_OVERT = new string_id("faction_recruiter", "covert_to_overt"); - public static final string_id SID_OVERT_TO_COVERT = new string_id("faction_recruiter", "overt_to_covert"); - public static final string_id SID_DUNGEON_NOCHANGE = new string_id("faction_recruiter", "dungeon_nochange"); - - public static final String COLOR_REBELS = "\\"+ colors_hex.COLOR_REBELS; - public static final String COLOR_IMPERIALS = "\\"+ colors_hex.COLOR_IMPERIALS; - - - public int cmdPVP(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (factions.isInAdhocPvpArea(self)) - { - pvpMakeDeclared(self); - return SCRIPT_CONTINUE; - } - - String recruiter = ""; - - String planet = getCurrentSceneName(); - - if ((planet == null) || (planet.equals(""))) - { - return SCRIPT_OVERRIDE; - } - else if (planet.equals("dungeon1")) - { - sendSystemMessage(self, SID_DUNGEON_NOCHANGE); - return SCRIPT_OVERRIDE; - } - - if (factions.isRebel(self)) - { - recruiter = "object/mobile/dressed_rebel_major_human_male_01.iff"; - } - else if (factions.isImperial(self)) - { - recruiter = "object/mobile/dressed_imperial_officer_m.iff"; - } - else - { - sendSystemMessage(self, SID_NOT_ALIGNED); - return SCRIPT_OVERRIDE; - } - - if (factions.isPVPStatusChanging(self)) - { - sendSystemMessage(self, SID_PVP_STATUS_CHANGING); - return SCRIPT_OVERRIDE; - } - - prose_package pp = new prose_package(); - - if (factions.isOnLeave(self)) - { - pp = prose.setStringId(pp, SID_ON_LEAVE_TO_COVERT); - commPlayer(self, self, pp, recruiter); - - factions.goCovertWithDelay(self, 1f); - return SCRIPT_CONTINUE; - } - - if (pvpGetType(self) == PVPTYPE_DECLARED) - { - pp = prose.setStringId(pp, SID_OVERT_TO_COVERT); - commPlayer(self, self, pp, recruiter); - - factions.goCovertWithDelay(self, 300f); - return SCRIPT_CONTINUE; - } - - if (pvpGetType(self) == PVPTYPE_COVERT) - { - pp = prose.setStringId(pp, SID_COVERT_TO_OVERT); - commPlayer(self, self, pp, recruiter); - - factions.goOvertWithDelay(self, 30f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_OVERRIDE; - } - - - public int OnPvpTypeChanged(obj_id self, int oldType, int newType) throws InterruptedException - { - - if (newType == PVPTYPE_DECLARED) - { - utils.setScriptVar(self, factions.VAR_NEWLY_DECLARED, getGameTime()); - messageTo(self, "msgNewlyDeclared", null, factions.NEWLY_DECLARED_INTERVAL, false); - } - - return SCRIPT_CONTINUE; - } - - - public int OnPvpFactionChanged(obj_id self, int oldFaction, int newFaction) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int OnEnterRegion(obj_id self, String planet, String name) throws InterruptedException - { - if (name.startsWith("gcw_") && name.endsWith("_start")) - { - location baseLoc = new location(); - baseLoc.area = planet; - - String waypointName = ""; - - if (hasObjVar(self, "gcw.static_base.waypoint." + planet)) - { - obj_id waypoint = getObjIdObjVar(self, "gcw.static_base.waypoint."+ planet); - - if (exists(waypoint)) - { - return SCRIPT_CONTINUE; - } - } - - if (planet.equals("talus")) - { - baseLoc.x = -4938f; - baseLoc.y = 0f; - baseLoc.z = -3107f; - waypointName = "Weapons Depot"; - } - else if (planet.equals("corellia")) - { - baseLoc.x = 4772f; - baseLoc.y = 0f; - baseLoc.z = -5233f; - waypointName = "Tactical Training Facility"; - } - else if (planet.equals("naboo")) - { - baseLoc.x = 1019f; - baseLoc.y = 0f; - baseLoc.z = -1508f; - waypointName = "Weapons Development Facility"; - } - else - { - return SCRIPT_CONTINUE; - } - - obj_id waypoint = createWaypointInDatapad(self, baseLoc); - - if (isIdValid(waypoint)) - { - setWaypointName(waypoint, waypointName); - setWaypointColor(waypoint, "white"); - setWaypointActive(waypoint, true); - setWaypointVisible(waypoint, true); - - setObjVar(self, "gcw.static_base.waypoint."+ planet, waypoint); - } - - return SCRIPT_CONTINUE; - } - - region enteredRegion = getRegion(planet, name); - if (enteredRegion != null && enteredRegion.getPvPType() == regions.PVP_REGION_TYPE_ADVANCED) - { - if (hasObjVar(self, "gcw.static_base.waypoint." + planet)) - { - obj_id waypoint = getObjIdObjVar(self, "gcw.static_base.waypoint."+ planet); - destroyWaypointInDatapad(waypoint, self); - - removeObjVar(self, "gcw.static_base.waypoint."+ planet); - } - - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnEnteredCombat(obj_id self) throws InterruptedException - { - pvp.validatePlayerDamageTracking(self); - return SCRIPT_CONTINUE; - } - - - public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id wpn, int[] damage) throws InterruptedException - { - pvp.updatePlayerDamageTracking(self, attacker, wpn, damage); - return SCRIPT_CONTINUE; - } - - - public int handleCloneRespawn(obj_id self, dictionary params) throws InterruptedException - { - if (utils.hasScriptVar(self, factions.IN_ADHOC_PVP_AREA) && !getLocation(self).area.equals("adventure2")) - { - utils.removeScriptVar(self, factions.IN_ADHOC_PVP_AREA); - } - - if (!hasScript (self, "theme_park.dungeon.corvette.timer") && !instance.isInInstanceArea(self)) - { - if ((pvpGetType(self)==PVPTYPE_DECLARED)||(pvpGetType(self)==PVPTYPE_COVERT)) - { - factions.goOnLeaveWithDelay(self, 0f); - } - } - pvp.clearPlayerDamageTracking(self); - return SCRIPT_CONTINUE; - } - - - public int msgResignFromFaction(obj_id self, dictionary params) throws InterruptedException - { - if (hasSkill(self, "force_rank_light_novice") || hasSkill(self, "force_rank_dark_novice")) - { - sendSystemMessage(self, new string_id("faction_recruiter", "jedi_cant_resign")); - return SCRIPT_CONTINUE; - } - factions.resignFromFaction(self); - return SCRIPT_CONTINUE; - } - - - public int msgGoCovert(obj_id self, dictionary params) throws InterruptedException - { - obj_id top = getTopMostContainer (self); - if (isIdValid(top)) - { - String bldgName = getTemplateName (top); - if (bldgName.equals("object/building/general/space_dungeon_corellian_corvette.iff") || bldgName.equals("object/building/general/space_dungeon_corellian_corvette_imperial.iff") || bldgName.equals("object/building/general/space_dungeon_corellian_corvette_rebel.iff")) - { - setObjVar (self, "corl_corvette.made_overt", 1); - removeObjVar(self, "intChangingFactionStatus"); - - return SCRIPT_CONTINUE; - } - } - if (hasScript(self, "force_rank_light_novice") || hasScript(self, "force_rank_dark_novice")) - { - sendSystemMessage(self, new string_id("faction_recruiter", "jedi_cant_go_covert")); - removeObjVar(self, "intChangingFactionStatus"); - - return SCRIPT_CONTINUE; - } - - region[] pvpRegions = getRegionsWithPvPAtPoint(getLocation(self), regions.PVP_REGION_TYPE_ADVANCED); - - if (pvpRegions != null && pvpRegions.length > 0) - { - removeObjVar(self, "intChangingFactionStatus"); - - sendSystemMessage(self, new string_id("gcw", "pvp_advanced_region_cannot_go_covert")); - return SCRIPT_CONTINUE; - } - - factions.goCovert(self); - return SCRIPT_CONTINUE; - } - - - public int msgGoOnLeave(obj_id self, dictionary params) throws InterruptedException - { - if (hasScript(self, "force_rank_light_novice") || hasScript(self, "force_rank_dark_novice")) - { - sendSystemMessage(self, new string_id("faction_recruiter", "jedi_cant_go_covert")); - return SCRIPT_CONTINUE; - } - - factions.goOnLeave(self); - return SCRIPT_CONTINUE; - - } - - - public int msgGoOvert(obj_id self, dictionary params) throws InterruptedException - { - if (hasScript(self, "force_rank_light_novice") || hasScript(self, "force_rank_dark_novice")) - { - sendSystemMessage(self, new string_id("faction_recruiter", "jedi_cant_go_covert")); - return SCRIPT_CONTINUE; - } - - int intFaction = pvpGetAlignedFaction(self); - if (intFaction == 0) - { - sendSystemMessage(self, new string_id("spam", "no_spec_force_neutral") ); - removeObjVar(self, "intChangingFactionStatus"); - return SCRIPT_CONTINUE; - } - - factions.goOvert(self); - return SCRIPT_CONTINUE; - } - - - public int gcwStatus(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - string_id strSpam = new string_id("gcw", "gcw_status_info"); - sendSystemMessage(self, strSpam); - return SCRIPT_CONTINUE; - - } - - - public int cmdDelegateFactionPoints(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - factions.delegateFactionPoints(self, target, params); - return SCRIPT_CONTINUE; - } - - - public int handleDelegateSui(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = utils.getObjIdScriptVar(self, "delegate.target"); - utils.removeScriptVarTree(self, "delegate"); - if (!isIdValid(target)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int amt = sui.getTransferInputTo(params); - if (amt < 1) - { - return SCRIPT_CONTINUE; - } - - queueCommand(self, (252954210), target, Integer.toString(amt), COMMAND_PRIORITY_DEFAULT); - return SCRIPT_CONTINUE; - } - - - public int handleLeaveFactionSui(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw", "got mst"); - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - String txt = sui.getInputBoxText(params); - if (bp == sui.BP_CANCEL || txt == null || !toLower(txt).equals("yes")) - { - removeObjVar(player, factions.VAR_RESIGNING); - sendSystemMessage(player, SID_ABORT_RESIGNATION); - return SCRIPT_CONTINUE; - } - - if (hasSkill(player, "force_rank_light_novice") || hasSkill(player, "force_rank_dark_novice")) - { - sendSystemMessage(player, new string_id("faction_recruiter", "jedi_cant_resign")); - return SCRIPT_CONTINUE; - } - - sui.msgbox(player, utils.packStringId(SID_SUI_RESIG_COMPLETE_IN_5)); - setObjVar(self, "intChangingFactionStatus", 1); - - params.put("faction_id", pvpGetAlignedFaction(self)); - messageTo(player, "msgResignFromFaction", params, factions.RESIGN_TIME, true); - CustomerServiceLog( "player_faction", "PLAYER-FACTION ALTERED|TIME:"+getGameTime()+"|PLAYER:"+player+"|PLAYER NAME:"+getName(player)+"|ZONE:"+getCurrentSceneName()+"|PLAYER CONFIRMED DESIRE TO LEAVE THEIR FACTION VIA RECRUITER. TOLD PLAYER OBJECT TO RESIGN FROM FACTION"); - return SCRIPT_CONTINUE; - } - - - public int handleGoCovert(obj_id self, dictionary params) throws InterruptedException - { - - if (hasObjVar(self, "intChangingFactionStatus")) - { - LOG("gcw", "objvar"); - return SCRIPT_CONTINUE; - } - - if (pvpGetType(self)==PVPTYPE_DECLARED) - { - string_id strSpam = new string_id("gcw", "cannot_change_from_combatant_in_field"); - sendSystemMessage(self, strSpam); - return SCRIPT_CONTINUE; - } - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - String txt = sui.getInputBoxText(params); - if (bp == sui.BP_CANCEL || txt == null || !toLower(txt).equals("yes")) - { - string_id strSpam = new string_id("gcw", "abort_field_change"); - sendSystemMessage(self, strSpam); - return SCRIPT_CONTINUE; - } - - if (hasSkill(player, "force_rank_light_novice") || hasSkill(player, "force_rank_dark_novice")) - { - sendSystemMessage(player, new string_id("faction_recruiter", "jedi_cant_go_covert")); - return SCRIPT_CONTINUE; - } - string_id strSpam = new string_id("gcw", "handle_go_covert"); - CustomerServiceLog( "player_faction", "PLAYER-FACTION ALTERED|TIME:"+getGameTime()+"|PLAYER:"+self+"|PLAYER NAME:"+getName(self)+"|ZONE:"+getCurrentSceneName()+"|Player confirmed desire to change in-field faction status to covert. This will apply in 30 seconds"); - sui.msgbox(player, utils.packStringId(strSpam)); - setObjVar(self, "intChangingFactionStatus", 1); - factions.goCovertWithDelay(self, 30); - return SCRIPT_CONTINUE; - } - - - public int handleGoOvert(obj_id self, dictionary params) throws InterruptedException - { - - if (hasObjVar(self, "intChangingFactionStatus")) - { - LOG("gcw", "objvar"); - return SCRIPT_CONTINUE; - } - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - String txt = sui.getInputBoxText(params); - if (bp == sui.BP_CANCEL || txt == null || !toLower(txt).equals("yes")) - { - string_id strSpam = new string_id("gcw", "abort_field_change"); - sendSystemMessage(self, strSpam); - return SCRIPT_CONTINUE; - } - - if (hasSkill(player, "force_rank_light_novice") || hasSkill(player, "force_rank_dark_novice")) - { - sendSystemMessage(player, new string_id("faction_recruiter", "jedi_cant_go_covert")); - return SCRIPT_CONTINUE; - } - string_id strSpam = new string_id("gcw", "handle_go_covert"); - CustomerServiceLog( "player_faction", "PLAYER-FACTION ALTERED|TIME:"+getGameTime()+"|PLAYER:"+self+"|PLAYER NAME:"+getName(self)+"|ZONE:"+getCurrentSceneName()+"|Player confirmed desire to change in-field faction status to overt. This will apply in 300 seconds."); - sui.msgbox(player, utils.packStringId(strSpam)); - setObjVar(self, "intChangingFactionStatus", 1); - factions.goOvertWithDelay(self, 300); - return SCRIPT_CONTINUE; - } - - - public int recievePvpRegionBonus(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, gcw.PVP_REGION_ACTIVITY_PERFORMED)) - { - return SCRIPT_CONTINUE; - } - else - { - utils.removeScriptVar(self, gcw.PVP_REGION_ACTIVITY_PERFORMED); - } - - int points = params.getInt("points"); - String information = params.getString("info"); - gcw.grantModifiedGcwPoints(self, points, gcw.GCW_POINT_TYPE_GROUND_PVP_REGION, information); - - return SCRIPT_CONTINUE; - } - - - public int cmdFactionalHelper(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - factions.neutralMercenaryStatusMenu(self); - return SCRIPT_CONTINUE; - } - - - public int handleFactionalHelperChoice(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, factions.SCRIPTVAR_FACTIONAL_HELPER_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - int pid = utils.getIntScriptVar(self, factions.SCRIPTVAR_FACTIONAL_HELPER_SUI_ID); - utils.removeScriptVar(self, factions.SCRIPTVAR_FACTIONAL_HELPER_SUI_ID); - - if (!utils.hasScriptVar(self, factions.SCRIPTVAR_FACTIONAL_HELPER_SUI_CHOICES)) - { - return SCRIPT_CONTINUE; - } - - String[] choices = utils.getStringArrayScriptVar(self, factions.SCRIPTVAR_FACTIONAL_HELPER_SUI_CHOICES); - utils.removeScriptVar(self, factions.SCRIPTVAR_FACTIONAL_HELPER_SUI_CHOICES); - - if (choices == null) - { - return SCRIPT_CONTINUE; - } - - if (pid != params.getInt("pageId")) - { - return SCRIPT_CONTINUE; - } - - if (0 != pvpGetAlignedFaction(self)) - { - sendSystemMessage(self, "You must be a Civilian to be a factional helper.", ""); - return SCRIPT_CONTINUE; - } - - if (ai_lib.isInCombat(self)) - { - sendSystemMessage(self, "You cannot change your factional helper status while in combat.", ""); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_OK) - { - int rowSelected = sui.getListboxSelectedRow(params); - if ((rowSelected >= 0) && (rowSelected < choices.length)) - { - if (choices[rowSelected].equals(factions.MERC_END_COVERT_IMPERIAL)) - { - sendSystemMessage(self, factions.SID_MERC_IMPERIAL_COMBATANT_END); - } - else if (choices[rowSelected].equals(factions.MERC_END_OVERT_IMPERIAL)) - { - sendSystemMessage(self, factions.SID_MERC_IMPERIAL_SF_END); - } - else if (choices[rowSelected].equals(factions.MERC_END_COVERT_REBEL)) - { - sendSystemMessage(self, factions.SID_MERC_REBEL_COMBATANT_END); - } - else if (choices[rowSelected].equals(factions.MERC_END_OVERT_REBEL)) - { - sendSystemMessage(self, factions.SID_MERC_REBEL_SF_END); - } - else if (choices[rowSelected].equals(factions.MERC_BEGIN_COVERT_IMPERIAL)) - { - sendSystemMessage(self, factions.SID_MERC_IMPERIAL_COMBATANT_BEGIN); - } - else if (choices[rowSelected].equals(factions.MERC_BEGIN_OVERT_IMPERIAL)) - { - sendSystemMessage(self, factions.SID_MERC_IMPERIAL_SF_BEGIN); - } - else if (choices[rowSelected].equals(factions.MERC_BEGIN_COVERT_REBEL)) - { - sendSystemMessage(self, factions.SID_MERC_REBEL_COMBATANT_BEGIN); - } - else if (choices[rowSelected].equals(factions.MERC_BEGIN_OVERT_REBEL)) - { - sendSystemMessage(self, factions.SID_MERC_REBEL_SF_BEGIN); - } - else - { - return SCRIPT_CONTINUE; - } - - dictionary messageToParams = new dictionary(); - messageToParams.put("mercenary_type", choices[rowSelected]); - - if (isGod(self)) - { - sendSystemMessage(self, "Reducing wait to 5 seconds ***BECAUSE YOU ARE IN GOD MODE***.", ""); - messageTo(self, "executeFactionalHelperChoice", messageToParams, 5.0f, false); - } - else - { - messageTo(self, "executeFactionalHelperChoice", messageToParams, 60.0f, false); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int executeFactionalHelperChoice(obj_id self, dictionary params) throws InterruptedException - { - - if (0 != pvpGetAlignedFaction(self)) - { - sendSystemMessage(self, "You must be a Civilian to be a factional helper.", ""); - return SCRIPT_CONTINUE; - } - - if (ai_lib.isInCombat(self)) - { - sendSystemMessage(self, "You cannot change your factional helper status while in combat.", ""); - return SCRIPT_CONTINUE; - } - - String mercenary_type = params.getString("mercenary_type"); - if (mercenary_type == null) - { - return SCRIPT_CONTINUE; - } - - if (mercenary_type.equals(factions.MERC_END_COVERT_IMPERIAL)) - { - pvpNeutralSetMercenaryFaction(self, 0, false); - sendSystemMessage(self, factions.SID_MERC_IMPERIAL_COMBATANT_TERMINATED); - } - else if (mercenary_type.equals(factions.MERC_END_OVERT_IMPERIAL)) - { - pvpNeutralSetMercenaryFaction(self, 0, false); - sendSystemMessage(self, factions.SID_MERC_IMPERIAL_SF_TERMINATED); - } - else if (mercenary_type.equals(factions.MERC_END_COVERT_REBEL)) - { - pvpNeutralSetMercenaryFaction(self, 0, false); - sendSystemMessage(self, factions.SID_MERC_REBEL_COMBATANT_TERMINATED); - } - else if (mercenary_type.equals(factions.MERC_END_OVERT_REBEL)) - { - pvpNeutralSetMercenaryFaction(self, 0, false); - sendSystemMessage(self, factions.SID_MERC_REBEL_SF_TERMINATED); - } - else if (mercenary_type.equals(factions.MERC_BEGIN_COVERT_IMPERIAL)) - { - pvpNeutralSetMercenaryFaction(self, (-615855020), false); - sendSystemMessage(self, factions.SID_MERC_IMPERIAL_COMBATANT_GRANTED); - } - else if (mercenary_type.equals(factions.MERC_BEGIN_OVERT_IMPERIAL)) - { - pvpNeutralSetMercenaryFaction(self, (-615855020), true); - sendSystemMessage(self, factions.SID_MERC_IMPERIAL_SF_GRANTED); - } - else if (mercenary_type.equals(factions.MERC_BEGIN_COVERT_REBEL)) - { - pvpNeutralSetMercenaryFaction(self, (370444368), false); - sendSystemMessage(self, factions.SID_MERC_REBEL_COMBATANT_GRANTED); - } - else if (mercenary_type.equals(factions.MERC_BEGIN_OVERT_REBEL)) - { - pvpNeutralSetMercenaryFaction(self, (370444368), true); - sendSystemMessage(self, factions.SID_MERC_REBEL_SF_GRANTED); - } - else - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int cmdGcwScore(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - showGcwScoreboard(self); - - return SCRIPT_CONTINUE; - } - - - public int displayGcwScoreSui(obj_id self, dictionary params) throws InterruptedException - { - showGcwScoreboard(self); - - return SCRIPT_CONTINUE; - } - - - public void showGcwScoreboard(obj_id self) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - return; - } - - if (utils.hasScriptVar(self, "gcw.score.pid")) - { - int pid = utils.getIntScriptVar(self, "gcw.score.pid"); - - utils.removeScriptVar(self, "gcw.score.pid"); - - forceCloseSUIPage(pid); - } - - String[][] scoreData = gcw_score.getAllGcwData(); - - if (scoreData == null || scoreData.length <= 0) - { - sendSystemMessage(self, new string_id("spam", "gcw_score_empty")); - return; - } - - String[] table_titles = - { - "@guild:table_title_name", "@spam:table_title_faction", "@spam:table_title_profession", "@spam:table_title_level", - "@spam:table_title_gcw", "@spam:table_title_pvp_kills", "@spam:table_title_kills", - "@spam:table_title_assists", "@spam:table_title_crafted", "@spam:table_title_destroyed" - }; - - String[] table_types = - { - "text", "text", "text", "integer", "integer", "integer", "integer", "integer", "integer", "integer" - }; - - String statisticsTitle = "Invasion Statistics"; - - int phase = gcw_score.getGcwPhase(); - int winner = gcw_score.getGcwWinner(); - - String invasionPhase = ""; - String invasionWinner = ""; - - switch(phase) - { - case gcw.GCW_CITY_PHASE_UNKNOWN: - invasionPhase = "Invasion Over"; - - if (winner == factions.FACTION_FLAG_REBEL) - { - invasionWinner = COLOR_REBELS + " Rebels won!"; - } - else if (winner == factions.FACTION_FLAG_IMPERIAL) - { - invasionWinner = COLOR_IMPERIALS + " Imperials won!"; - } - break; - case gcw.GCW_CITY_PHASE_CONSTRUCTION: - invasionPhase = "Construction Underway"; - break; - case gcw.GCW_CITY_PHASE_COMBAT: - invasionPhase = "Invasion Underway"; - break; - default: - invasionPhase = "Unknown"; - break; - } - - String statisticsInfoStr = "Invasion phase: "+ invasionPhase + invasionWinner; - - int pid = sui.tableRowMajor(self, self, sui.OK_CANCEL, statisticsTitle, "onGcwScore", statisticsInfoStr, table_titles, table_types, scoreData, true); - - utils.setScriptVar(self, "gcw.score.pid", pid); - } -} diff --git a/sku.0/sys.server/compiled/game/script/player/player_gm.java b/sku.0/sys.server/compiled/game/script/player/player_gm.java deleted file mode 100644 index 75ed50ebe..000000000 --- a/sku.0/sys.server/compiled/game/script/player/player_gm.java +++ /dev/null @@ -1,105 +0,0 @@ -package script.player; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.healing; -import script.library.dot; -import script.library.utils; -import script.library.consumable; -import script.library.pet_lib; -import script.library.group; -import script.library.pclib; -import script.library.combat; -import script.library.colors; -import script.library.sui; - - -public class player_gm extends script.base_script -{ - public player_gm() - { - } - public static final string_id SID_HEAL_DAMAGE = new string_id("sui", "heal_damage"); - public static final string_id SID_HEAL_WOUND = new string_id("sui", "heal_wound"); - - public static final string_id SID_FLY_DRAG = new string_id("base_player","fly_drag"); - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int cmdGenerateCraftedItem(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isGod(self)) - { - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self, "hello"); - - LOG("LOG_CHANNEL", "player_gm.generateCraftedItem commandHandler called. IsGod check passed, and handler is executing."); - - debugServerConsoleMsg(self, "************ Entered cmdGenerateCraftedItem."); - - java.util.StringTokenizer st = new java.util.StringTokenizer(params); - if (st.countTokens() != 2) - { - sendSystemMessageTestingOnly(self, "Did not find the correct parameters needed to create an item."); - sendSystemMessageTestingOnly(self, "/generateCraftedItem command must at least have schematic template name and attribute percentage paramaters to function."); - sendSystemMessageTestingOnly(self, "Correct usage is /generateCraftedItem "); - debugServerConsoleMsg(self, "************ Did not decode any string tokens from params passed into command handler. Unable to proceed with out at least schematic template name and attribute percentage."); - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self, "hello"); - - String template_string = (st.nextToken()).toLowerCase(); - String schematic = ("object/draft_schematic/"+ template_string + ".iff"); - - sendSystemMessageTestingOnly(self, "template_string: "+template_string); - sendSystemMessageTestingOnly(self, "schematic: "+schematic); - - String percentage_string = (st.nextToken()).toLowerCase(); - int attributePercentage = utils.stringToInt(percentage_string); - if (attributePercentage == -1) - { - LOG("LOG_CHANNEL", "You must specify a valid item attribute percentage."); - sendSystemMessageTestingOnly(self, "You must specify a valid item attribute percentage."); - return SCRIPT_CONTINUE; - } - - obj_id creationTarget = null; - if (!isIdValid(target)) - { - creationTarget = getLookAtTarget(self); - if (!isIdValid(creationTarget)) - { - creationTarget = self; - } - } - else - { - creationTarget = target; - } - obj_id inventory = utils.getInventoryContainer(creationTarget); - - if (inventory != null) - { - obj_id item = makeCraftedItem(schematic, attributePercentage, inventory); - sendSystemMessageTestingOnly(self, "Item created and placed into the inventory of "+getName(creationTarget)); - CustomerServiceLog("generateCraftedItem","Object obj_id "+ item + " was created of type "+ schematic + ". It was created in the inventory of object "+ creationTarget +" which is named "+ getName(creationTarget) +"."); - debugServerConsoleMsg(self, "Object obj_id "+ item + " was created of type "+ schematic + ". It was created in the inventory of object "+ creationTarget +" which is named "+ getName(creationTarget) +"."); - } - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/player/player_instance.java b/sku.0/sys.server/compiled/game/script/player/player_instance.java deleted file mode 100644 index 63a606f10..000000000 --- a/sku.0/sys.server/compiled/game/script/player/player_instance.java +++ /dev/null @@ -1,1014 +0,0 @@ -package script.player; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.badge; -import script.library.buff; -import script.library.callable; -import script.library.factions; -import script.library.group; -import script.library.instance; -import script.library.locations; -import script.library.prose; -import script.library.skill; -import script.library.static_item; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class player_instance extends script.base_script -{ - public player_instance() - { - } - - public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException - { - if (!isGod(self)) - { - return SCRIPT_CONTINUE; - } - - String[] parse = split(text, ' '); - - if (parse.length < 2) - { - return SCRIPT_CONTINUE; - } - - if (parse[0].equals("instanceRequest") && speaker == self) - { - if (parse.length == 3) - { - instance.requestInstanceMovement(self, parse[1], parse[2]); - } - else if (parse.length == 4) - { - instance.requestInstanceMovement(self, parse[1], utils.stringToInt(parse[2]), parse[3]); - } - else - { - instance.requestInstanceMovement(self, parse[1]); - } - } - - if (parse[0].equals("closeInstance") && speaker == self) - { - instance.closeOwnedInstance(self, parse[1]); - } - - if (parse[0].equals("exitInstance") && speaker == self) - { - instance.requestExitPlayer(parse[1], self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnUnsticking(obj_id self) throws InterruptedException - { - obj_id instanceController = instance.getAreaInstanceController(self); - if (hasScript(self, "npe.trigger_journal") && hasObjVar(self, "npe")) - { - location myLoc = getLocation(self); - if (myLoc.area.equals("dungeon1")) - { - String room = getCellName(myLoc.cell); - if (room.equals("cave_entrance")) - { - warpPlayer(self, "dungeon1", 0.0f, 0.0f, 0.0f, myLoc.cell, 7.10f, 9.5f, 6.5f); - return SCRIPT_OVERRIDE; - } - } - } - - if (isIdValid(instanceController)) - { - String instanceName = instance.getInstanceName(instanceController); - instance.requestExitPlayer(instanceName, self); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnDuelRequest(obj_id self, obj_id actor, obj_id target) throws InterruptedException - { - if (instance.isInInstanceArea(actor) || instance.isInInstanceArea(target)) - { - sendConsoleMessage(actor, "Dueling is not permitted here"); - sendConsoleMessage(target, "Dueling is not permitted here"); - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int OnLogin(obj_id self) throws InterruptedException - { - String area_name = locations.getBuildoutAreaName(self); - int area_row = locations.getBuildoutAreaRow(self); - - obj_id planet = getPlanetByName(getLocation(self).area); - String instance_controller = ""+area_name+"_"+area_row; - - obj_id areaInstanceController = utils.hasScriptVar(planet, instance_controller) ? utils.getObjIdScriptVar(planet, instance_controller) : null; - - if (!instance.isInInstanceArea(self)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(areaInstanceController)) - { - doLogging("OnLogin", "Could not locate instance controller"); - return SCRIPT_CONTINUE; - } - - dictionary dict = new dictionary(); - dict.put("player", self); - - messageTo(areaInstanceController, "validatePlayer", dict, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int OnClusterWideDataResponse(obj_id self, String manage_name, String name, int request_id, String[] element_name_list, dictionary[] data, int lock_key) throws InterruptedException - { - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+")recieved trigger"); - int requestType = instance.getInstanceRequestType(self); - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+")'s requestType is "+ requestType); - int team = instance.getInstanceRequestTeam(self); - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+")'s team is "+ team); - - if (requestType == instance.REQUEST_MOVETO && team != instance.REQUEST_INVALID) - { - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+")'s requestType was "+instance.REQUEST_MOVETO+" and team was not "+instance.REQUEST_INVALID); - if (data == null || data.length == 0 || !manage_name.startsWith("instance_manager")) - { - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+")'s dictionary 'data' was null, or manage name didnt start with 'instance_manager'. Releasing lock and dieing here."); - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+")'s manage_name was "+manage_name+" and instance name was "+name+"."); - doLogging("Insufficient Data. Manage name = "+manage_name +", instance name = "+name); - releaseClusterWideDataLock(manage_name, lock_key); - instance.setRequestResolved(self); - return SCRIPT_CONTINUE; - } - int emptyInstance = -1; - String instance_name = ""; - - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-about to start looping thru player "+self+"("+getPlayerName(self)+")'s dictionary 'data' passed from the trigger."); - for (int i=0; i -1) - { - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-we had an empty instance ("+data[emptyInstance]+") for player "+self+"("+getPlayerName(self)+")."); - dictionary newDict = data[emptyInstance]; - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-calling movePlayerToInstance("+self+", "+newDict.getObjId("instance_id")+", "+newDict.getString("instance_name")+", "+newDict.getObjId("owner")+", true, "+team+") for player "+self+"("+getPlayerName(self)+")."); - instance.movePlayerToInstance(self, newDict.getObjId("instance_id"), newDict.getString("instance_name"), newDict.getObjId("owner"), true, team); - newDict.put("owner", self); - newDict.put("team", team); - String strName = newDict.getString("instance_name"); - obj_id objName = newDict.getObjId("instance_id"); - name = strName+"_"+objName; - String groupList = ""+self; - - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+")'s new groupList is "+ groupList); - if (team == 1) - { - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+") assigning new list to group1"); - newDict.put("groupOne", groupList); - } - if (team == 2) - { - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+") assigning new list to group2"); - newDict.put("groupTwo", groupList); - } - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-calling replaceClusterWideData("+manage_name+", "+name+", "+newDict+", true, "+lock_key+") for player "+self+"("+getPlayerName(self)+")."); - replaceClusterWideData(manage_name, name, newDict, true, lock_key); - releaseClusterWideDataLock(manage_name, lock_key); - instance.setRequestResolved(self); - return SCRIPT_CONTINUE; - } - else - { - sendSystemMessage(self, new string_id("instance", "all_full")); - } - } - - if (requestType == instance.REQUEST_CLOSE) - { - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+")'s requestType was "+instance.REQUEST_CLOSE+"."); - if (data == null || data.length == 0 || !manage_name.startsWith("instance_manager")) - { - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-player "+self+"("+getPlayerName(self)+")'s dictionary 'data' was null, or manage name didnt start with 'instance_manager'. Releasing lock and dieing here."); - doLogging("Insufficient Data. Manage name = "+manage_name +", instance name = "+name); - releaseClusterWideDataLock(manage_name, lock_key); - instance.setRequestResolved(self); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "OnClusterWideDataResponse-about to start looping thru player "+self+"("+getPlayerName(self)+")'s dictionary 'data' passed from the trigger."); - for (int i=0; i 0) - { - addSUIDataItem(pid, sui.LISTBOX_DATASOURCE, ""+ idx); - setSUIProperty(pid, sui.LISTBOX_DATASOURCE + "."+ idx, sui.PROP_TEXT, "Group Members In Range"); - idx++; - - for (int i=0; i 0) - { - for (int i = 0; i < members.length; i++) - { - testAbortScript(); - if (!isIdValid(members[i]) || !exists(members[i])) - { - continue; - } - - if (!isPlayer(members[i]) || members[i] == self) - { - continue; - } - - concatenatedAtrocity += getUnflaggedInstancesString(members[i]); - concatenatedAtrocity += "\n"; - } - } - } - - return concatenatedAtrocity; - } - - - public String getUnflaggedInstancesString(obj_id player) throws InterruptedException - { - String[] instanceList = new String[dataTableGetNumRows(instance.INSTANCE_DATATABLE)]; - int numNotFlagged = 0; - String unflaggedInstancesString = getString(new string_id("instance", "gold")); - unflaggedInstancesString += getFirstName(player) + ": "; - - String instancesString = ""; - String preambleString = ""; - - for (int i = 0; i < instanceList.length; i++) - { - testAbortScript(); - String thisInstance = dataTableGetString(instance.INSTANCE_DATATABLE, i, "key_required"); - - if (thisInstance.equals("none")) - { - continue; - } - if (!hasObjVar(player, "instance_player_protected_data." + thisInstance)) - { - - if (numNotFlagged > 0) - { - instancesString += ", "; - } - - instancesString += getString(new string_id("instance", thisInstance)); - numNotFlagged++; - } - } - - if (numNotFlagged == 0) - { - preambleString += getString(new string_id ("instance", "flagging_all_flags")); - } - else - { - preambleString += getString(new string_id("instance", "flagging_not_flagged_for")); - } - - unflaggedInstancesString += preambleString + instancesString; - - return unflaggedInstancesString; - } - - - public String getRaidId(String time, String instance, String owner) throws InterruptedException - { - String subTime = time.substring(time.length() -3, time.length()); - String subInstance = instance.substring(instance.length() - 3, instance.length()); - String subOwner = owner.substring(owner.length() -3,owner.length()); - return subTime + subInstance + subOwner; - } - - - public String getPassedId(Vector listId, String instance_name) throws InterruptedException - { - if (listId == null || listId.size() == 0) - { - return ""; - } - - for (int i=0; i= trial.HEROIC_TOKENS.length) - { - sendSystemMessageTestingOnly(self, "DEBUG: handleAwardtoken sent with out of range tokenIndex."); - return SCRIPT_CONTINUE; - } - - obj_id inventory = utils.getInventoryContainer(self); - obj_id token = static_item.createNewItemFunction(trial.HEROIC_TOKENS[tokenIndex], inventory, count); - - prose_package pp = new prose_package(); - if (count > 1) - { - pp = prose.setStringId(pp, new string_id("set_bonus", "recieve_heroic_token_multi")); - } - else - { - pp = prose.setStringId(pp, new string_id("set_bonus", "recieve_heroic_token")); - } - - pp = prose.setDI(pp, count); - pp = prose.setTT(pp, new string_id("static_item_n", trial.HEROIC_TOKENS[tokenIndex])); - sendSystemMessageProse(self, pp); - - if (tokenIndex == 5 && count == 9) - { - badge.grantBadge(self, "champion_of_hoth"); - obj_id[] rewards = new obj_id[1]; - - rewards[0] = static_item.createNewItemFunction("item_hoth_flawless_painting", inventory); - showLootBox(self, rewards); - setObjVar(self, "hoth.flawless_reward", 1); - } - - return SCRIPT_CONTINUE; - } - - - public int instanceFailureMessage(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "instanceFailureMessage-has a null params exiting handler."); - return SCRIPT_CONTINUE; - } - - int reason = params.getInt("fail_reason"); - - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "instanceFailureMessage-params.fail_reason was "+ reason + "."); - - switch(reason) - { - case instance.FAIL_INSTANCE_FULL: - sendSystemMessage(self, new string_id("instance", "fail_instance_full")); - break; - - case instance.FAIL_NOT_MEMBER: - sendSystemMessage(self, new string_id("instance", "fail_not_member")); - break; - case instance.INSTANCE_TIMEOUT: - sendSystemMessage(self, new string_id("instance", "instance_time_out")); - break; - case instance.FAIL_INVALID_LOCKOUT: - sendSystemMessage(self, new string_id("instance", "fail_invalid_lockout")); - break; - case instance.FAIL_INSTANCE_CLOSED: - sendSystemMessageTestingOnly(self, "The instance you are attempting to enter is currently inactive"); - break; - case instance.FAIL_INSTANCE_FEW_PLAYERS: - sendSystemMessage(self, new string_id("instance", "fail_under_player_limit")); - break; - case instance.FAIL_WARN_TOO_FEW: - int limit = params.getInt("player_low_limit"); - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("instance", "fail_under_player_limit_warning")); - pp = prose.setDI(pp, limit); - sendSystemMessageProse(self, pp); - break; - default: - CustomerServiceLog(instance.INSTANCE_DEBUG_LOG, "instanceFailureMessage-switch statement reached the default case this means no system message to player and we died."); - break; - } - - return SCRIPT_CONTINUE; - } - - public int requestInstance(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id enterObject = getFirstObjectWithObjVar(getLocation(trial.getTop(self)), 1000.0f, "instance_name"); - - if (!isIdValid(enterObject)) - { - sendSystemMessageTestingOnly(self, "No object in range"); - return SCRIPT_CONTINUE; - } - - String instance_name = getStringObjVar(enterObject, "instance_name"); - instance.requestInstanceMovement(self, instance_name); - return SCRIPT_CONTINUE; - } - - - public int delayInstanceRequest(obj_id self, dictionary params) throws InterruptedException - { - String instance_name = params.getString("instance_name"); - instance.requestInstanceMovement(self, instance_name); - return SCRIPT_CONTINUE; - } - - - public int clearInstanceScriptVar(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVarTree(self, "instance"); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/player/player_sui.java b/sku.0/sys.server/compiled/game/script/player/player_sui.java deleted file mode 100644 index e0e4a46e8..000000000 --- a/sku.0/sys.server/compiled/game/script/player/player_sui.java +++ /dev/null @@ -1,262 +0,0 @@ -package script.player; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.player_structure; -import script.library.sui; -import script.library.utils; - - -public class player_sui extends script.base_script -{ - public player_sui() - { - } - public static final String TERMINAL_LOGGING = "special_sign"; - public static final boolean LOGGING_ON = true; - - - public int handleCloseSui(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("pid"); - if (pid > -1) - { - forceCloseSUIPage(pid); - } - - return SCRIPT_CONTINUE; - } - - - public int handleSetSuiAssociate(obj_id self, dictionary params) throws InterruptedException - { - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("pid"); - if (pid < 0) - { - return SCRIPT_CONTINUE; - } - - obj_id associate = params.getObjId("associate"); - if (!isIdValid(associate)) - { - return SCRIPT_CONTINUE; - } - - float range = params.getFloat("range"); - if (range < 0f) - { - return SCRIPT_CONTINUE; - } - - setSUIAssociatedObject(pid, associate); - setSUIMaxRangeToObject(pid, range); - return SCRIPT_CONTINUE; - } - - - public int handleDecorTypeSelect(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - blog("handleDecorTypeSelect: init"); - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - blog("handleDecorTypeSelect: initial validation done"); - - String[] decorMenu = utils.getStringArrayScriptVar(player, player_structure.SVAR_DECOR_PREFIX+".decorMenu"); - if (decorMenu == null || decorMenu.length <= 0) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - blog("handleDecorTypeSelect: decorMenu received"); - - String[] slotName = utils.getStringArrayScriptVar(player, player_structure.SVAR_DECOR_PREFIX+".slotName"); - if (slotName == null || slotName.length <= 0) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - blog("handleDecorTypeSelect: slotName received"); - - String menuSelection = decorMenu[idx]; - if (menuSelection == null || menuSelection.equals("")) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - blog("handleDecorTypeSelect: menuSelection: "+menuSelection); - - String slotSelection = slotName[idx]; - if (slotSelection == null || slotSelection.equals("")) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - blog("handleDecorTypeSelect: slotSelection: "+slotSelection); - - String template = utils.getStringScriptVar(player, player_structure.SVAR_DECOR_PREFIX+".structureTemplate"); - if (template == null || template.equals("")) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - blog("handleDecorTypeSelect: template: "+template); - - obj_id structure = utils.getObjIdScriptVar(player, player_structure.SVAR_DECOR_PREFIX+".structure"); - if (!isValidId(structure)|| !exists(structure)) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - blog("handleDecorTypeSelect: structure: "+structure); - - blog("handleDecorTypeSelect: finished, sendign data"); - player_structure.placeExteriorDecorObject(player, structure, template, menuSelection, slotSelection); - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - - public int handleDecorSlotRemovalSelect(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - blog("handleDecorSlotRemovalSelect: init"); - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - blog("handleDecorSlotRemovalSelect: initial validation done"); - - String[] occupiedSlots = utils.getStringArrayScriptVar(player, player_structure.SVAR_DECOR_PREFIX+".occupiedSlots"); - if (occupiedSlots == null || occupiedSlots.length <= 0) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - String menuSelection = occupiedSlots[idx]; - if (menuSelection == null || menuSelection.equals("")) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - obj_id structure = utils.getObjIdScriptVar(player, player_structure.SVAR_DECOR_PREFIX+".structure"); - if (!isValidId(structure) || !exists(structure)) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - blog("handleDecorSlotRemovalSelect: menuSelection: "+menuSelection); - - obj_id decorObjId = player_structure.getOidOfDecorInSlot(structure, menuSelection); - if (!isValidId(decorObjId) || !exists(decorObjId)) - { - removeDecorVars(player); - return SCRIPT_CONTINUE; - } - - destroyObject(decorObjId); - - sendSystemMessage(player, player_structure.SID_DECOR_ITEM_REMOVED); - return SCRIPT_CONTINUE; - } - - - public boolean removeDecorVars(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - utils.removeScriptVar(player, player_structure.SVAR_DECOR_PREFIX); - sui.removePid(player, player_structure.PID_DECOR_SELECTION); - - return true; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (msg == null || msg.equals("")) - { - return false; - } - if (LOGGING_ON) - { - LOG(TERMINAL_LOGGING, msg); - } - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/player/player_utility.java b/sku.0/sys.server/compiled/game/script/player/player_utility.java deleted file mode 100644 index 73e4746a0..000000000 --- a/sku.0/sys.server/compiled/game/script/player/player_utility.java +++ /dev/null @@ -1,3802 +0,0 @@ -package script.player; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.badge; -import script.library.beast_lib; -import script.library.buff; -import script.library.colors; -import script.library.combat; -import script.library.create; -import script.library.factions; -import script.library.gcw; -import script.library.gm; -import script.library.groundquests; -import script.library.healing; -import script.library.holiday; -import script.library.incubator; -import script.library.locations; -import script.library.loot; -import script.library.luck; -import script.library.marriage; -import script.library.money; -import script.library.pclib; -import script.library.performance; -import script.library.pet_lib; -import script.library.planetary_map; -import script.library.player_structure; -import script.library.player_version; -import script.library.prose; -import script.library.regions; -import script.library.respec; -import script.library.session; -import script.library.skill; -import script.library.skill_template; -import script.library.static_item; -import script.library.stealth; -import script.library.structure; -import script.library.sui; -import script.library.target_dummy; -import script.library.trial; -import script.library.turnstile; -import script.library.utils; -import script.library.vehicle; -import script.library.weapons; -import script.library.xp; - - -public class player_utility extends script.base_script -{ - public player_utility() - { - } - public static final String LOGGING_CATEGORY = "foraging"; - public static final boolean LOGGING_ON = false; - - public static final obj_id WORLD_ID = obj_id.NULL_ID; - - public static final String VAR_AUTODECLINE_DUEL = "decline_duel"; - public static final String VAR_FIND_BASE = "find"; - public static final String VAR_FIND_WAYPOINT = VAR_FIND_BASE + ".waypoint"; - - public static final String TBL_FIND_MAP = "datatables/find/map.iff"; - public static final String COL_NAME = "NAME"; - public static final String COL_DISPLAY = "DISPLAY"; - public static final String COL_DISPLAY_NAME = "DISPLAY_NAME"; - public static final String COL_PARAM = "PARAM"; - - public static final String STF_FIND_DISPLAY = "find_display"; - public static final String STF_FILE = "player/player_utility"; - - public static final string_id PROSE_FIND_SET = new string_id("base_player", "prose_find_set"); - public static final string_id PROSE_FIND_UNFOUND = new string_id("base_player", "prose_find_unfound"); - - public static final string_id PROSE_FIND_UNKNOWN_ARG = new string_id("base_player", "prose_find_unknown_arg"); - - public static final string_id SID_FIND_GENERAL_ERROR = new string_id("base_player", "find_general_error"); - public static final string_id SID_FIND_DATAPAD_FULL = new string_id("base_player", "find_datapad_full"); - - public static final string_id SID_SALE_FEE = new string_id("base_player", "sale_fee"); - public static final string_id SID_VENDOR_PAY = new string_id("player_structure", "vendor_pay"); - - public static final string_id SID_NO_ENTRY_WHILE_MOUNTED = new string_id("base_player", "no_entry_while_mounted"); - public static final string_id SID_DISMOUNTING = new string_id("base_player", "dismounting"); - - public static final string_id SID_WAYPOINT_AND_DATA_CLEARED = new string_id("base_player", "waypoint_and_data_cleared"); - public static final string_id SID_UNABLE_TO_CREATE_PATH = new string_id("base_player", "unable_to_create_path"); - public static final string_id SID_FIND_PATH_STARTED = new string_id("base_player", "find_path_started"); - - public static final string_id SID_SUI_PAY_ACCESS_FEE_PROMPT = new string_id("base_player", "sui_pay_access_fee_prompt"); - public static final string_id SID_SUI_PAY_ACCESS_FEE_TITLE = new string_id("base_player", "sui_pay_access_fee_title"); - public static final string_id SID_CHANNEL_HEAL_WRONG_USER = new string_id("healing", "channel_heal_wrong_user"); - public static final string_id SID_CHANNEL_HEAL_MOVED = new string_id("healing", "channel_heal_moved"); - public static final string_id SID_CHANNEL_HEAL_IN_COMBAT = new string_id("healing", "channel_heal_in_combat"); - - public static final string_id SID_DNA_ONLY_BEAST_MASTER = new string_id("beast", "dna_not_beast_master"); - public static final string_id SID_DNA_TOO_FAR = new string_id("beast", "dna_too_far"); - public static final string_id SID_DNA_NOT_IN_TUTORIAL = new string_id("beast", "dna_not_in_tutorial"); - - public static final string_id SID_NOT_IN_CITY = new string_id("player/player_utility", "forage_not_in_city"); - public static final string_id SID_PATROL_POINT_ENTERTAINED = new string_id("gcw", "the_patrol_point_entertained"); - - public static final String VAR_VERSION_BASE = "ver"; - - public static final String TBL_PLAYER_VERSION = "datatables/player/version.iff"; - - public static final String SKILL = "skill"; - - public static final String COL_LOOKUP = "LOOKUP"; - public static final String COL_VERSION = "VERSION"; - - public static final string_id SID_CITY_UPDATE_ETA = new string_id( "city/city", "city_update_eta"); - - public static final String NON_ENHANCEMENT_BUFF = "buff.non_enhancement"; - - public static final String SCRIPTVAR_RENAME_CHARACTER_SUI_ID = "renameCharacterSuiId"; - public static final String SCRIPTVAR_RENAME_CHARACTER_NEW_NAME = "renameCharacterNewName"; - public static final String SCRIPTVAR_RENAME_CHARACTER_UNVERIFIED_NEW_NAME = "renameCharacterUnverifiedNewName"; - public static final String GUARD_OCCUPIED = "occupied"; - - - public int OnLogin(obj_id self) throws InterruptedException - { - if (utils.checkConfigFlag("GameServer", "jediTestResources")) - { - if (hasSkill(self, "class_bountyhunter_phase4_novice")) - { - createNewBHResources(self); - - } - } - if (utils.checkConfigFlag("GameServer", "jediTestBuffs")) - { - if (hasSkill(self, "class_bountyhunter_phase4_novice")) - { - - createBuffs(self); - } - } - removeObjVar(self, VAR_FIND_BASE); - - if (buff.hasBuff(self, "tcg_series3_hands_of_seduction")) - { - if (buff.removeBuff(self, "tcg_series3_hands_of_seduction")) - { - buff.applyBuff(self, "tcg_series3_hands_of_seduction"); - } - - } - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - removeAttribOrSkillModModifier(self, "TC2 - BUFFS (Health)"); - removeAttribOrSkillModModifier(self, "TC2 - BUFFS (Const)"); - removeAttribOrSkillModModifier(self, "TC2 - BUFFS (Action)"); - removeAttribOrSkillModModifier(self, "TC2 - BUFFS (Stam)"); - removeAttribOrSkillModModifier(self, "TC2 - BUFFS (Mind)"); - removeAttribOrSkillModModifier(self, "TC2 - BUFFS (Will)"); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - obj_id item = getObjectInSlot(self, "held_r"); - if (isIdValid(item)) - { - if (hasObjVar(item, "isLightsaber") && !isJedi(self)) - { - obj_id inv = utils.getInventoryContainer(self); - if (isIdValid(inv)) - { - putInOverloaded(item, inv); - } - } - } - - if (!hasScript(self, "player.player_faction")) - { - attachScript(self, "player.player_faction"); - } - - if (!hasScript(self, "player.player_sui")) - { - attachScript(self, "player.player_sui"); - } - - if (!hasScript(self, "player.player_money")) - { - attachScript(self, "player.player_money"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnWaypointDestroyed(obj_id self, obj_id waypoint) throws InterruptedException - { - if (utils.hasScriptVar(self, "hasClientPath")) - { - obj_id wp = utils.getObjIdScriptVar(self, "hasClientPath"); - if (isIdValid(wp) && wp == waypoint) - { - destroyClientPath(self); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destination, obj_id transferer) throws InterruptedException - { - if ((destination == null) || (transferer == null)) - { - debugServerConsoleMsg(self, "OnAboutToBeTransferred: null parameter"); - return SCRIPT_OVERRIDE; - } - - obj_id currentCell = getContainedBy(self); - - boolean isRidingMount = (getState(self, STATE_RIDING_MOUNT) > 0); - obj_id mountId = (isRidingMount ? getMountId(self) : null); - - if (currentCell == null) - { - - if (pet_lib.canMount(destination, self)) - { - - return SCRIPT_CONTINUE; - } - - if (vehicle.isBattlefieldVehicle(destination) || vehicle.isBattlefieldVehicle(transferer)) - { - return SCRIPT_CONTINUE; - } - - if (isGameObjectTypeOf(getGameObjectType(destination), GOT_ship)) - { - if (isIdValid(getContainedBy(destination))) - { - LOG("space", "VALID CONTAINED BY12!@!"); - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - if (destination != WORLD_ID) - { - LOG("space", "World something or other!@!"); - obj_id building = structure.getContainingBuilding(destination); - if (building == null) - { - return SCRIPT_OVERRIDE; - } - - if (player_structure.isAdmin(building, self) || player_structure.canEnter(building, self)) - { - return SCRIPT_CONTINUE; - } - - if (turnstile.hasTurnstile(building)) - { - if (turnstile.isPatron(building, self)) - { - if (turnstile.hasExpired(building, self)) - { - - turnstile.removePatron(building, self); - sendSystemMessage( self, new string_id(STF_FILE, "access_expired")); - } - else - { - - sendSystemMessage( self, new string_id(STF_FILE, "access_granted")); - return SCRIPT_CONTINUE; - } - } - - turnstileInform( self, building ); - - return SCRIPT_OVERRIDE; - } - } - } - else if (isRidingMount) - { - - if (destination == WORLD_ID) - { - - return SCRIPT_CONTINUE; - } - else - { - - String creature_name = getName(mountId); - sendSystemMessage(self, SID_NO_ENTRY_WHILE_MOUNTED); - sendSystemMessage(self, SID_DISMOUNTING); - - if (vehicle.isBattlefieldVehicle(mountId)) - { - queueCommand(self, (1988230683), self, creature_name, COMMAND_PRIORITY_FRONT); - - setYaw(mountId, getYaw(mountId) + 180.0f); - } - else - { - queueCommand(self, (117012717), self, creature_name, COMMAND_PRIORITY_FRONT); - } - return SCRIPT_OVERRIDE; - } - } - else if ((currentCell != WORLD_ID) && (destination == WORLD_ID)) - { - obj_id building = structure.getContainingBuilding(currentCell); - if (turnstile.hasTurnstile(building)) - { - if (turnstile.hasExpired(building, self) && turnstile.isPatron(building, self)) - { - turnstile.removePatron(building, self); - return SCRIPT_CONTINUE; - } - } - } - else - { - - } - LOG("space", "REturning Aok!@!"); - return SCRIPT_CONTINUE; - } - - - public void turnstileInform(obj_id self, obj_id building) throws InterruptedException - { - - utils.setScriptVar( self, "turnstile.queryTurnstile", 1 ); - utils.setScriptVar( self, "turnstile.structure", building ); - - int fee = turnstile.getFee( building ); - - prose_package ppFeePrompt = prose.getPackage(SID_SUI_PAY_ACCESS_FEE_PROMPT); - prose.setDI(ppFeePrompt, fee); - String feePrompt = " \0"+ packOutOfBandProsePackage(null, ppFeePrompt); - - sui.msgbox( self, self, feePrompt, sui.OK_CANCEL, utils.packStringId(SID_SUI_PAY_ACCESS_FEE_TITLE), sui.OK_CANCEL, "handleTurnstilePay"); - } - - - public int handleTurnstilePay(obj_id self, dictionary params) throws InterruptedException - { - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - utils.removeScriptVar( self, "turnstile.queryTurnstile"); - obj_id building = utils.getObjIdScriptVar( self, "turnstile.structure"); - - return SCRIPT_CONTINUE; - } - - obj_id building = utils.getObjIdScriptVar( self, "turnstile.structure"); - - if (!isIdValid(building)) - { - - utils.removeScriptVar(self, "turnstile.queryTurnstile"); - utils.removeScriptVar(self, "turnstile.structure"); - - return SCRIPT_CONTINUE; - } - - int fee = turnstile.getFee( building ); - utils.removeScriptVar( self, "turnstile.structure"); - - obj_id bowner = player_structure.getStructureOwnerObjId( building ); - - dictionary d = new dictionary(); - d.put( "building", building ); - d.put( money.DICT_MSG_PAYER, 1 ); - d.put( money.DICT_TARGET_NAME, player_structure.getStructureOwner( building ) ); - money.requestPayment( self, bowner, fee, "attemptedPayment", d, true ); - - return SCRIPT_CONTINUE; - } - - - public int attemptedPayment(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - utils.removeScriptVar( self, "turnstile.queryTurnstile"); - return SCRIPT_CONTINUE; - } - - int retCode = money.getReturnCode(params); - if (retCode != money.RET_SUCCESS) - { - obj_id payer = params.getObjId( money.DICT_PLAYER_ID ); - messageTo( payer, "handleTurnstilePayFail", null, 0.f, false ); - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId(money.DICT_PLAYER_ID); - if (!isIdValid(player) || !isPlayer(player)) - { - utils.removeScriptVar( self, "turnstile.queryTurnstile"); - return SCRIPT_CONTINUE; - } - - obj_id structure = params.getObjId( "building"); - turnstile.addPatron( structure, player ); - - utils.removeScriptVar( self, "turnstile.queryTurnstile"); - - int length = turnstile.getTime( structure ) / 60; - - String str = "You may now access the building for "+ length + " minutes."; - sendSystemMessage( self, str, null ); - - return SCRIPT_CONTINUE; - } - - - public int handleVendorDestroy(obj_id self, dictionary params) throws InterruptedException - { - int usedSlots = getIntObjVar(self, "used_vendor_slots") - 1; - setObjVar(self, "used_vendor_slots", usedSlots); - - LOG("vendor","handleVendorDestroy checking for key"); - - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_OVERRIDE; - } - - if (params.containsKey("isSpecialVendor")) - { - LOG("vendor","handleVendorDestroy HAS key"); - - obj_id vendor = params.getObjId("vendor"); - if (vendor == null || vendor.equals("")) - { - return SCRIPT_OVERRIDE; - } - - boolean isSpecialVendor = params.getBoolean("isSpecialVendor"); - boolean canBeIncremented = params.getBoolean("canBeIncremented"); - location destroyLocation = params.getLocation("destroyLocation"); - if (destroyLocation == null) - { - return SCRIPT_OVERRIDE; - } - - location topContainerLocation = params.getLocation("topContainerLocation"); - if (destroyLocation == null) - { - return SCRIPT_OVERRIDE; - } - - obj_id topContainer = params.getObjId("topContainer"); - if (!isValidId(topContainer)) - { - return SCRIPT_OVERRIDE; - } - - String vendorTemplate = params.getString("vendorTemplate"); - if (vendorTemplate == null || vendorTemplate.equals("")) - { - return SCRIPT_OVERRIDE; - } - - CustomerServiceLog("vendor", "Player: "+ self + " "+ getName(self) + " has been notified of Vendor: "+ vendor + " Template Name: "+vendorTemplate+ " being destroyed in container: "+ topContainer + " at container location: "+ topContainerLocation + ". Cell location when destroyed: "+ destroyLocation); - - if (!isSpecialVendor || !canBeIncremented) - { - return SCRIPT_OVERRIDE; - } - - CustomerServiceLog("vendor", "Player: "+ self + " "+ getName(self) + " has been notified of Vendor: "+ vendor + " Template Name: "+vendorTemplate+ ". This has been identified as a TCG SPECIAL VENDOR. The vendor system is attempting to reimburse the player for the destroyed TCG Special Vendor."); - - String skillMod = params.getString("skillMod"); - int skillModCurrentAmount = params.getInt("skillModCurrentAmount"); - - if (skillMod == null || skillMod.equals("")) - { - CustomerServiceLog("vendor", "A TCG Special Vendor was destroyed but the skill mod that needed to be reimbursed to the owner was invalid. Owner: "+ self + " Vendor: "+ vendor + " Template Name: "+vendorTemplate+ " Location of the vendor when destroyed: "+ destroyLocation); - return SCRIPT_OVERRIDE; - } - - if (skillModCurrentAmount > 0) - { - CustomerServiceLog("vendor", "A TCG Special Vendor: "+ vendor + " Template Name: "+vendorTemplate+ " had skill mod: "+ skillMod + " but the Owner: "+ self + " COULD NOT BE REIMBURSED because that skillmod value was less than 0. Location of the vendor when destroyed: "+ destroyLocation); - return SCRIPT_OVERRIDE; - } - - applySkillStatisticModifier(self, skillMod, 1); - CustomerServiceLog("vendor", "A TCG Special Vendor: "+ vendor + " Template Name: "+vendorTemplate+ " had skill mod: "+ skillMod + " that was reimbursed to the Owner: "+ self + ". Skill mod incremented by 1. Location of the vendor when destroyed: "+ destroyLocation); - } - return SCRIPT_OVERRIDE; - } - - - public int handleHoloTimeout(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_OVERRIDE; - } - - if (!utils.hasScriptVar(self, "holoMessageTime")) - { - return SCRIPT_OVERRIDE; - } - - int messageTimeId = params.getInt("holoMessageTime"); - - int actorMessageTime = utils.getIntScriptVar(self, "holoMessageTime"); - - if (messageTimeId != actorMessageTime) - { - return SCRIPT_OVERRIDE; - } - - performance.holographicCleanup(self); - return SCRIPT_CONTINUE; - } - - - public int handlePerformanceBreach(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "holoMessageTime")) - { - return SCRIPT_OVERRIDE; - } - performance.holographicCleanup(self); - return SCRIPT_CONTINUE; - } - - - public int OnRemovingFromWorld(obj_id self) throws InterruptedException - { - if (utils.hasScriptVar(self, "holoMessageTime")) - { - performance.holographicCleanup(self); - } - - obj_id[] enemies = getWhoIsTargetingMe( self ); - if (enemies == null || enemies.length == 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < enemies.length; i++) - { - testAbortScript(); - if (isIdValid(enemies[i]) && !isPlayer( enemies[i] )) - { - setMentalStateToward( enemies[i], self, FEAR, 0.0f ); - setMentalStateToward( enemies[i], self, ANGER, 0.0f ); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnRequestAuctionFee(obj_id self, obj_id who, obj_id bazaar, obj_id item, boolean premium, modifiable_int amount) throws InterruptedException - { - session.logActivity(who, session.ACTIVITY_ACCESS_BAZAAR); - - if (hasCondition( bazaar, CONDITION_VENDOR )) - { - amount.set( 0 ); - return SCRIPT_CONTINUE; - } - - int baseFee = 20; - if (premium) - { - baseFee = 100; - } - - if (hasCommand( self, "merchant_fees_1" )) - { - baseFee *= 0.6; - } - else if (utils.isProfession( self, utils.TRADER )) - { - baseFee *= 0.8; - } - - prose_package pp = prose.getPackage( SID_SALE_FEE, baseFee ); - sendSystemMessageProse( self, pp ); - - amount.set( baseFee ); - - logBalance( "auctionFee;"+ who + ";"+ bazaar + ";"+ baseFee ); - - return SCRIPT_CONTINUE; - } - - - public int handleSUI(obj_id self, dictionary params) throws InterruptedException - { - boolean doMsg = true; - - int pid = params.getInt("pageId"); - String basePath = "sui."+ pid; - - String handlerPath = basePath + ".handler"; - String handler = utils.getStringScriptVar(self, handlerPath); - if ((handler == null) || (handler.equals("")) || (handler.equals("noHandler"))) - { - doMsg = false; - } - - String ownerPath = basePath + ".owner"; - obj_id owner = utils.getObjIdScriptVar(self, ownerPath); - if (!isIdValid(owner)) - { - doMsg = false; - } - - utils.removeScriptVar(self, handlerPath); - utils.removeScriptVar(self, ownerPath); - - if (doMsg) - { - messageTo(owner, handler, params, 0, false); - } - - return SCRIPT_CONTINUE; - } - - - public int handleAttachScript(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_OVERRIDE; - } - - String scriptName = params.getString(pclib.DICT_SCRIPT_NAME); - if (attachScript(self, scriptName) == SCRIPT_CONTINUE) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_OVERRIDE; - } - - - public int handleDetachScript(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_OVERRIDE; - } - - String scriptName = params.getString(pclib.DICT_SCRIPT_NAME); - if (detachScript(self, scriptName)) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_OVERRIDE; - } - - - public int handleRemoveObjVar(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_OVERRIDE; - } - - String objVarName = params.getString(pclib.DICT_OBJVAR_NAME); - removeObjVar(self, objVarName); - - return SCRIPT_CONTINUE; - } - - - public int handleGrantXp(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_OVERRIDE; - } - - String xpType = params.getString(pclib.DICT_XP_TYPE); - int xpAmount = params.getInt(pclib.DICT_XP_AMOUNT); - - xp.grant(self, xpType, xpAmount, false); - return SCRIPT_CONTINUE; - } - - - public int bm_collect_dna(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!beast_lib.isBeastMaster(self)) - { - sendSystemMessage(self, SID_DNA_ONLY_BEAST_MASTER); - return SCRIPT_OVERRIDE; - } - - obj_id player = self; - obj_id intendedTarget = getIntendedTarget(player); - obj_id lookAtTarget = getLookAtTarget(player); - - if (isInTutorialArea(player)) - { - sendSystemMessage(player, SID_DNA_NOT_IN_TUTORIAL); - return SCRIPT_OVERRIDE; - } - - if (isIdValid(lookAtTarget)) - { - target = lookAtTarget; - } - else - { - target = intendedTarget; - } - - if (!isIdValid(target)) - { - sendSystemMessage(player, incubator.SID_DNA_INVALID_TARGET); - return SCRIPT_OVERRIDE; - } - - location playerLoc = getLocation(player); - location targetLoc = getLocation(target); - - float distance = getDistance(playerLoc, targetLoc); - - if (distance > 7.0f) - { - sendSystemMessage(player, SID_DNA_TOO_FAR); - return SCRIPT_OVERRIDE; - } - - if (isPlayer(target)) - { - sendSystemMessage(player, incubator.SID_DNA_INVALID_TARGET); - return SCRIPT_OVERRIDE; - } - - if (utils.hasScriptVar(target, incubator.DNA_BEEN_SAMPLED_SCRIPTVAR)) - { - sendSystemMessage(player, incubator.SID_DNA_ALREADY_BEEN_SAMPLED); - return SCRIPT_OVERRIDE; - } - - obj_id playerCurrentMount = getMountId (player); - if (vehicle.isVehicle(target)) - { - sendSystemMessage(player, incubator.SID_DNA_NO_ALLOW_COLLECT); - return SCRIPT_OVERRIDE; - } - if (isIdValid(playerCurrentMount)) - { - sendSystemMessage(player, incubator.SID_DNA_CANT_COLLECT_MOUNTED); - return SCRIPT_OVERRIDE; - } - - if (pet_lib.isPet(target) || beast_lib.isBeast(target)) - { - sendSystemMessage(player, incubator.SID_DNA_CANT_COLLECT); - return SCRIPT_OVERRIDE; - } - - if (!isMob(target) || hasObjVar(target, "storytellerid")) - { - sendSystemMessage(player, incubator.SID_DNA_INVALID_TARGET); - return SCRIPT_OVERRIDE; - } - - if (!ai_lib.isInCombat(target)) - { - String mobType = ai_lib.getCreatureName(target); - if (mobType == null || mobType.length() < 1) - { - String err = "WARNING: player_utility::bm_collect_dna("+ target + ") returning false because getCreatureName failed. Template="+ getTemplateName(target) + ", IsAuthoritative="+ target.isAuthoritative() + ". Stack Trace as follows:"; - CustomerServiceLog("creatureNameErrors", err); - debugServerConsoleMsg(target, err); - Thread.dumpStack(); - - return SCRIPT_CONTINUE; - } - int niche = ai_lib.aiGetNiche(mobType); - - if (niche == NICHE_MONSTER || niche == NICHE_HERBIVORE || niche == NICHE_CARNIVORE || niche == NICHE_PREDATOR) - { - obj_id dnaCore = incubator.extractDna(player, target); - - if (!isIdValid(dnaCore)) - { - - return SCRIPT_CONTINUE; - } - setObjVar(dnaCore, incubator.DNA_PARENT_TEMPLATE, mobType); - String name = getName(target); - if (name != null && !name.equals("")) - { - setObjVar(dnaCore, incubator.DNA_PARENT_TEMPLATE_NAME, name); - } - return SCRIPT_CONTINUE; - } - - } - else - { - sendSystemMessage(player, incubator.SID_DNA_CANT_IN_COMBAT); - return SCRIPT_OVERRIDE; - } - sendSystemMessage(player, incubator.SID_DNA_INVALID_TARGET); - return SCRIPT_OVERRIDE; - } - - - public int forage(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - location curLoc = getLocation(self); - - if (isIdValid(curLoc.cell)) - { - string_id notIndoors = new string_id("player/player_utility", "forage_not_indoors"); - sendSystemMessage(self, notIndoors); - return SCRIPT_OVERRIDE; - } - else if (isIdValid(getStandingOn(self))) - { - string_id onlyInWorld = new string_id("player/player_utility", "forage_on_ground"); - sendSystemMessage(self, onlyInWorld); - return SCRIPT_OVERRIDE; - } - else if (locations.isInCity(curLoc)) - { - sendSystemMessage(self, SID_NOT_IN_CITY); - return SCRIPT_OVERRIDE; - } - - if (utils.hasScriptVar(self, "forage.lastLocation")) - { - location lastLoc = utils.getLocationScriptVar(self, "forage.lastLocation"); - - if (!lastLoc.area.equals(curLoc.area)) - { - utils.removeScriptVarTree(self, "forage"); - } - else - { - float distance = getDistance(lastLoc, curLoc); - - if (isIdValid(lastLoc.cell)) - { - distance = 5.0f; - } - - if (distance < 5.0f) - { - string_id tooClose = new string_id("player/player_utility","forage_too_close"); - sendSystemMessage(self, tooClose); - return SCRIPT_OVERRIDE; - } - - if (utils.hasScriptVar(self, "forage.listOfAlreadyForagedLocs")) - { - location[] oldListOfLocs = utils.getLocationArrayScriptVar(self, "forage.listOfAlreadyForagedLocs"); - - if (oldListOfLocs.length > 20) - { - - utils.removeScriptVar(self, "forage.listOfAlreadyForagedLocs"); - } - - for (int i = 0; i < oldListOfLocs.length; ++i) - { - testAbortScript(); - if (isIdValid(oldListOfLocs[i].cell)) - { - distance = 5.0f; - } - else - { - distance = getDistance(curLoc, oldListOfLocs[i]); - } - - if (distance < 5.0f) - { - string_id tooClose = new string_id("player/player_utility", "forage_already_done_here"); - sendSystemMessage(self, tooClose); - return SCRIPT_OVERRIDE; - } - } - } - } - } - - doAnimationAction(self, "forage"); - - messageTo(self, "handlerForPlayerForaging", null, 2.0f, false); - return SCRIPT_CONTINUE; - } - - - public int handlerForPlayerForaging(obj_id self, dictionary params) throws InterruptedException - { - if (!loot.playerForaging(self)) - { - CustomerServiceLog( "foraging", "Foraging failed for Player: "+ self + " "+ getName(self)); - } - - return SCRIPT_CONTINUE; - } - - - public int removeAppearanceItemEffect(obj_id self, dictionary params) throws InterruptedException - { - - obj_id allAppearanceItems[] = getAllItemsFromAppearanceInventory(self); - if (allAppearanceItems == null || allAppearanceItems.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < allAppearanceItems.length; i++) - { - testAbortScript(); - if (!hasObjVar(allAppearanceItems[i], NON_ENHANCEMENT_BUFF)) - { - continue; - } - - static_item.removeWornBuffs(allAppearanceItems[i], self); - static_item.checkForRemoveSetBonus(allAppearanceItems[i], self); - } - - return SCRIPT_CONTINUE; - } - - - public int addAppearanceItemEffect(obj_id self, dictionary params) throws InterruptedException - { - obj_id allAppearanceItems[] = getAllItemsFromAppearanceInventory(self); - if (allAppearanceItems == null || allAppearanceItems.length <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < allAppearanceItems.length; i++) - { - testAbortScript(); - if (!hasObjVar(allAppearanceItems[i], NON_ENHANCEMENT_BUFF)) - { - continue; - } - - static_item.applyWornBuffs(allAppearanceItems[i], self); - static_item.checkForAddSetBonus(allAppearanceItems[i], self); - } - - return SCRIPT_CONTINUE; - } - - - public int cmdPathToLocation(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if ((params == null) || (params.equals(""))) - { - return SCRIPT_OVERRIDE; - } - - java.util.StringTokenizer st = new java.util.StringTokenizer(params, " ,\t"); - int count = st.countTokens(); - - if (count < 4) - { - return SCRIPT_OVERRIDE; - } - - float x = Float.parseFloat(st.nextToken()); - float y = Float.parseFloat(st.nextToken()); - float z = Float.parseFloat(st.nextToken()); - - obj_id cell_id = obj_id.getObjId(java.lang.Long.parseLong(st.nextToken())); - - String planet = getCurrentSceneName(); - - location destination = new location(x, y, z, planet, cell_id); - - if (isGod(self)) - { - sendSystemMessageTestingOnly(self, "pathToLocation "+ params); - sendSystemMessageTestingOnly(self, " scene="+ destination.area); - sendSystemMessageTestingOnly(self, " cell="+ getCellName(destination.cell)); - } - - createClientPathAdvanced(self, getLocation(self), destination, "default"); - - return SCRIPT_CONTINUE; - } - - - public int cmdPathClear(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - destroyClientPath (self); - return SCRIPT_CONTINUE; - } - - - public int cmdFind(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - LOG("find", "******************* cmdFind: "+ getGameTime() + " ******************"); - LOG("find", "params = "+ params); - - if ((params == null) || (params.equals(""))) - { - planetary_map.showFindSui(); - return SCRIPT_CONTINUE; - } - - dictionary holocronParams = new dictionary(); - holocronParams.put ("eventName","find"); - messageTo(self, "handleHolocronEvent", holocronParams, 0, false); - - params = toLower(params); - LOG("find", "toLower(params) = "+ params); - - if (params.equals("clear")) - { - clearFindData(self); - sendSystemMessage(self, SID_WAYPOINT_AND_DATA_CLEARED); - return SCRIPT_CONTINUE; - } - - String originalParams = params; - - if (params.indexOf(" ") > -1) - { - java.util.StringTokenizer tmpSt = new java.util.StringTokenizer(params); - params = ""; - while (tmpSt.hasMoreTokens()) - { - testAbortScript(); - params += tmpSt.nextToken(); - } - } - - String cat = ""; - String sub = ""; - java.util.StringTokenizer st = new java.util.StringTokenizer(params, ":"); - int tCnt = st.countTokens(); - LOG("find", "params token count = "+ tCnt); - - cat = st.nextToken(); - if (st.hasMoreTokens()) - { - sub = cat + "_"+ st.nextToken(); - } - - int uidx = cat.indexOf("_"); - if (sub.equals("") && uidx > -1) - { - sub = cat; - cat = cat.substring(0, uidx); - } - - LOG("find","pre-expansion: cat = "+ cat + " sub = "+ sub); - - String[] catList = dataTableGetStringColumnNoDefaults("datatables/player/planet_map_cat.iff","name"); - if ((catList != null) && (catList.length > 0)) - { - for (int i = 0; i < catList.length; i++) - { - testAbortScript(); - if (catList[i].equals(cat)) - { - break; - } - else if (catList[i].startsWith(cat)) - { - cat = catList[i]; - break; - } - } - - if ((sub != null) && (!sub.equals(""))) - { - for (int i = 0; i < catList.length; i++) - { - testAbortScript(); - if (catList[i].equals(sub)) - { - break; - } - else if (catList[i].startsWith(sub)) - { - sub = catList[i]; - break; - } - } - } - } - - LOG("find","expanded: cat = "+ cat + " sub = "+ sub); - - if ((cat != null) && (!cat.equals("")) && (sub != null)) - { - location here = getWorldLocation(self); - String planet = getCurrentSceneName(); - - map_location[] map_locs = getPlanetaryMapLocations(cat, sub); - if ((map_locs == null) || (map_locs.length == 0)) - { - if (sub == null || sub.equals("")) - { - String[] subCats = getPlanetaryMapCategories(cat); - if (subCats == null || (subCats.length == 0)) - { - prose_package unfound = prose.getPackage(PROSE_FIND_UNFOUND, originalParams); - sendSystemMessageProse(self, unfound); - return SCRIPT_CONTINUE; - } - - Vector subLocs = new Vector(); - subLocs.setSize(0); - for (int x = 0; x < subCats.length; x++) - { - testAbortScript(); - map_location[] tmpLocs = getPlanetaryMapLocations(cat, subCats[x]); - if ((tmpLocs != null) || (tmpLocs.length > 0)) - { - subLocs.addAll(Arrays.asList(tmpLocs)); - } - } - - if (subLocs == null || subLocs.size() == 0) - { - prose_package unfound = prose.getPackage(PROSE_FIND_UNFOUND, originalParams); - sendSystemMessageProse(self, unfound); - return SCRIPT_CONTINUE; - } - - map_location[] toUse = new map_location[subLocs.size()]; - subLocs.toArray(toUse); - - map_locs = toUse; - } - } - - float min = Float.POSITIVE_INFINITY; - int locIdx = -1; - - float x = 0f; - float z = 0f; - location there = new location(); - - for (int n = 0; n < map_locs.length; n++) - { - testAbortScript(); - x = (float)(map_locs[n].getX()); - z = (float)(map_locs[n].getY()); - - location tmpLoc = new location(x, 0, z); - - float dist = utils.getDistance2D(here, tmpLoc); - if (dist < min) - { - min = dist; - locIdx = n; - there = (location)tmpLoc.clone(); - } - } - - if (locIdx > -1) - { - obj_id myTarget = map_locs[locIdx].getLocationId(); - if (isIdValid(myTarget)) - { - clearFindData(self); - - obj_id wp = createWaypointInDatapad(self, there); - if (isIdValid(wp)) - { - setWaypointActive(wp, true); - setWaypointVisible(wp, true); - - String locName = map_locs[locIdx].getLocationName(); - string_id sidLocName = utils.unpackString(locName); - if (sidLocName != null) - { - locName = getString(sidLocName); - } - - String locType = params; - - String locCat = "@map_loc_cat_n:"+ map_locs[locIdx].getCategory(); - string_id sidLocCat = utils.unpackString(locCat); - if (sidLocCat != null) - { - locCat = getString(sidLocCat); - } - - if (locCat != null && !locCat.equals("")) - { - locType = locCat; - } - - String locSub = map_locs[locIdx].getSubCategory(); - if (locSub != null && !locSub.equals("")) - { - locSub = "@map_loc_cat_n:"+ locSub; - string_id sidLocSub = utils.unpackString(locSub); - if (sidLocSub != null) - { - locSub = getString(sidLocSub); - } - - if (locSub != null && !locSub.equals("")) - { - locType += ":"+ locSub; - } - } - - setWaypointName(wp, locName + " ("+ locType + ")"); - - utils.setScriptVar(self, VAR_FIND_WAYPOINT, wp); - string_id parsedParams = null; - if (sub == null || sub.equals("")) - { - parsedParams = new string_id("find_display", cat); - } - else - { - parsedParams = new string_id("find_display", sub); - } - - if (parsedParams != null) - { - prose_package findSetParsed = prose.getPackage(PROSE_FIND_SET, parsedParams); - sendSystemMessageProse(self, findSetParsed); - } - else - { - prose_package findSet = prose.getPackage(PROSE_FIND_SET, originalParams); - sendSystemMessageProse(self, findSet); - } - - there = new location(map_locs[locIdx].getX(), 0, map_locs[locIdx].getY()); - - region[] hereCity = getRegionsWithGeographicalAtPoint(here, regions.GEO_CITY); - region[] thereCity = getRegionsWithGeographicalAtPoint(there, regions.GEO_CITY); - if (hereCity != null && hereCity.length > 0 && thereCity != null && thereCity.length > 0) - { - boolean areInSameCity = false; - for (int a = 0; a < hereCity.length; a++) - { - testAbortScript(); - for (int b = 0; b < thereCity.length; b++) - { - testAbortScript(); - if ((hereCity[a].getName()).equals(thereCity[b].getName())) - { - areInSameCity = true; - break; - } - } - - if (areInSameCity) - { - break; - } - } - - if (areInSameCity) - { - there.y = getHeightAtLocation(there.x, there.z); - - location start = getLocation(self); - if (isIdValid(start.cell)) - { - start = getBuildingEjectLocation(getTopMostContainer(self)); - } - - location destination = (location)there.clone(); - - obj_id tId = map_locs[locIdx].getLocationId(); - if (isIdValid(tId) && tId.isLoaded()) - { - location cLoc = getLocation(tId); - if (isIdValid(cLoc.cell)) - { - obj_id topMost = getTopMostContainer(tId); - if (isIdValid(topMost) && tId.isLoaded()) - { - destination = getBuildingEjectLocation(topMost); - } - } - } - - if (destination == null) - { - destination = (location)there.clone(); - } - - if (!createClientPath(self, start, destination)) - { - sendSystemMessage(self, SID_UNABLE_TO_CREATE_PATH); - } - else - { - if (here.cell != start.cell) - { - sendSystemMessage(self, SID_FIND_PATH_STARTED); - } - - utils.setScriptVar(self, "hasClientPath", wp); - } - } - } - - return SCRIPT_CONTINUE; - } - } - else - { - LOG("find","invalid target attached to planet map location??"); - } - } - else - { - LOG("find","unable to determine valid PM index for request..."); - } - } - else - { - prose_package unfound = prose.getPackage(PROSE_FIND_UNKNOWN_ARG, originalParams); - sendSystemMessageProse(self, unfound); - return SCRIPT_CONTINUE; - } - - sendSystemMessage(self, SID_FIND_GENERAL_ERROR); - return SCRIPT_CONTINUE; - } - - - public void clearFindData(obj_id self) throws InterruptedException - { - if (utils.hasScriptVar(self, VAR_FIND_WAYPOINT)) - { - obj_id wp = utils.getObjIdScriptVar(self, VAR_FIND_WAYPOINT); - utils.removeScriptVar(self, VAR_FIND_WAYPOINT); - destroyWaypointInDatapad(wp, self); - } - - destroyClientPath(self); - utils.removeScriptVar(self, "hasClientPath"); - } - - - public int handleFindSui(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int row = sui.getListboxSelectedRow(params); - if (row == -1) - { - return SCRIPT_CONTINUE; - } - - LOG("find","handleFindSui: selrow = "+ row); - - String[] args = utils.getStringBatchScriptVar(self, planetary_map.SCRIPTVAR_FIND_PARAMS); - if ((args == null) || (args.length == 0)) - { - return SCRIPT_CONTINUE; - } - - String arg = args[row]; - if ((arg == null) || (arg.equals(""))) - { - return SCRIPT_CONTINUE; - } - - queueCommand(self, (806879158), null, arg, COMMAND_PRIORITY_DEFAULT); - return SCRIPT_CONTINUE; - } - - - public int handleDelayedSystemMessage(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - string_id sid = params.getStringId("sidMsg"); - if (sid != null) - { - sendSystemMessage(self, sid); - return SCRIPT_CONTINUE; - } - - String msg = params.getString("stringMsg"); - if (msg != null && !msg.equals("")) - { - sendSystemMessageTestingOnly(self, msg); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int handleDelayedProseMessage(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - string_id sid = params.getStringId("sid"); - - obj_id actor = params.getObjId("actor"); - String actorString = params.getString("actorString"); - string_id actorStringId = params.getStringId("actorStringId"); - - obj_id target = params.getObjId("target"); - String targetString = params.getString("targetString"); - string_id targetStringId = params.getStringId("targetStringId"); - - obj_id other = params.getObjId("other"); - String otherString = params.getString("otherString"); - string_id otherStringId = params.getStringId("otherStringId"); - - int di = params.getInt("di"); - float df = params.getFloat("df"); - - prose_package pp = prose.getPackage(sid, actor, actorString, actorStringId, - target, targetString, targetStringId, - other, otherString, otherStringId, - di, df); - - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - - public int handleDivorce(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id sender = params.getObjId("self"); - obj_id spouse = getObjIdObjVar(self, marriage.VAR_SPOUSE_ID); - if (!isIdValid(sender) || !isIdValid(spouse) || (sender != spouse)) - { - return SCRIPT_CONTINUE; - } - - marriage.endUnity(self); - return SCRIPT_CONTINUE; - } - - - public int handleWaypointDestroyRequest(obj_id self, dictionary params) throws InterruptedException - { - obj_id wp = params.getObjId("wp"); - if (isIdValid(wp) && exists(wp) && wp.isLoaded()) - { - destroyWaypointInDatapad(wp, self); - } - - return SCRIPT_CONTINUE; - } - - - public int handleWaypointRenameRequest(obj_id self, dictionary params) throws InterruptedException - { - obj_id wp = params.getObjId("wp"); - if (!isIdValid(wp) || !exists(wp) || !wp.isLoaded()) - { - return SCRIPT_CONTINUE; - } - - String name = params.getString("name"); - if (name == null || name.equals("")) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(wp, self)) - { - return SCRIPT_CONTINUE; - } - - setWaypointName(wp, name); - return SCRIPT_CONTINUE; - } - - - public int handleVendorPayment(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId( money.DICT_PLAYER_ID ); - obj_id target = params.getObjId( money.DICT_TARGET_ID ); - int amt = params.getInt( money.DICT_AMOUNT ); - int code = params.getInt( money.DICT_CODE ); - if (code == money.RET_SUCCESS) - { - CustomerServiceLog( "vendor", "Vendor maintenance deposit. Player: "+ player + " Vendor "+ target + " Amount: "+ amt ); - prose_package pp = prose.getPackage( SID_VENDOR_PAY, target, amt ); - sendSystemMessageProse( player, pp ); - } - - return SCRIPT_CONTINUE; - } - - - public int displayCityUpdateTime(obj_id self, dictionary params) throws InterruptedException - { - String time_remaining = params.getString( "time_remaining"); - prose_package pp = prose.getPackage( SID_CITY_UPDATE_ETA, time_remaining ); - sendSystemMessageProse( self, pp ); - - return SCRIPT_CONTINUE; - } - - - public int handleSurveyDroidReport(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] resourceIdList = params.getObjIdArray("resourceList"); - String planetName = params.getString("planetName"); - String resourceClass = params.getString("resourceClass"); - - String[] resourceList = pclib.buildSortedResourceList(resourceIdList, resourceClass, 0); - - String subject = "Interplanetary Survey: "+toUpper(planetName, 0)+" - "+pclib.getClassString(resourceClass); - String report = pclib.createResourcePlanetReport(resourceList, planetName, resourceClass); - - chatSendPersistentMessage("Interplanetary Survey Droid", getName(self), subject, report, null); - - return SCRIPT_CONTINUE; - } - - - public void createBuffs(obj_id player) throws InterruptedException - { - if (!hasAttribModifier(player, "TC2 - BUFFS (Health)")) - { - addAttribModifier(player, "TC2 - BUFFS (Health)", HEALTH, 2200, 10800, 0.0f, 10.0f, true, false, true); - addAttribModifier(player, "TC2 - BUFFS (Const)", CONSTITUTION, 2200, 10800, 0.0f, 10.0f, true, false, true); - addAttribModifier(player, "TC2 - BUFFS (Action)", ACTION, 2200, 10800, 0.0f, 10.0f, true, false, true); - addAttribModifier(player, "TC2 - BUFFS (Stam)", STAMINA, 2200, 10800, 0.0f, 10.0f, true, false, true); - } - return; - } - - - public void createNewBHResources(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return; - } - - if (hasObjVar(self, "jediTest.bounty_hunter_kit")) - { - return; - } - - obj_id pInv = utils.getInventoryContainer(self); - - if (!isIdValid( pInv)) - { - return; - } - - createObject("object/tangible/wearables/armor/ris/armor_ris_bicep_l.iff", pInv, ""); - createObject("object/tangible/wearables/armor/ris/armor_ris_bicep_r.iff", pInv, ""); - createObject("object/tangible/wearables/armor/ris/armor_ris_boots.iff", pInv, ""); - createObject("object/tangible/wearables/armor/ris/armor_ris_bracer_l.iff", pInv, ""); - createObject("object/tangible/wearables/armor/ris/armor_ris_bracer_r.iff", pInv, ""); - createObject("object/tangible/wearables/armor/ris/armor_ris_chest_plate.iff", pInv, ""); - createObject("object/tangible/wearables/armor/ris/armor_ris_gloves.iff", pInv, ""); - createObject("object/tangible/wearables/armor/ris/armor_ris_helmet.iff", pInv, ""); - createObject("object/tangible/wearables/armor/ris/armor_ris_leggings.iff", pInv, ""); - createObject("object/tangible/deed/vehicle_deed/landspeeder_av21_deed.iff", pInv, ""); - createObject("object/tangible/deed/vehicle_deed/speederbike_swoop_deed.iff", pInv, ""); - createObject("object/tangible/deed/vehicle_deed/speederbike_swoop_deed.iff", pInv, ""); - createObject("object/tangible/wearables/backpack/backpack_s03.iff", pInv, ""); - - obj_id LLC = weapons.createWeapon("object/weapon/ranged/rifle/rifle_lightning.iff", pInv, 0.8f); - obj_id scatter = weapons.createWeapon("object/weapon/ranged/pistol/pistol_scatter.iff", pInv, 0.8f); - obj_id laserCarbine = weapons.createWeapon("object/weapon/ranged/carbine/carbine_laser.iff", pInv, 0.8f); - obj_id dxr6Carbine = weapons.createWeapon("object/weapon/ranged/carbine/carbine_dxr6.iff", pInv, 0.8f); - - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - - obj_id hotpants = createObject("object/tangible/wearables/pants/pants_s26.iff", pInv, ""); - { - if (isIdValid(hotpants)) - { - - int color = rand(151, 255); - custom_var myVar = getCustomVarByName(hotpants, "private/index_color_2"); - if (myVar.isPalColor()) - { - palcolor_custom_var pcVar = (palcolor_custom_var)myVar; - pcVar.setValue(color); - } - } - } - - gm.setBalance(self, money.MT_BANK, "500000"); - setObjVar(self, "jediTest.bounty_hunter_kit", 1); - return; - } - - - public int handleTurnstilePayFail(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar( self, "turnstile.queryTurnstile"); - sendSystemMessage( self, new string_id(STF_FILE, "not_enough_money")); - return SCRIPT_CONTINUE; - } - - - public int handleGmGrantSkillOptions(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = utils.getObjIdScriptVar(self, "gmGrantSkill.target"); - - if (!isIdValid(target)) - { - sendSystemMessageTestingOnly(self, "Target is no longer valid."); - utils.removeScriptVarTree(self, "gmGrantSkill"); - return SCRIPT_CONTINUE; - } - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_CANCEL) - { - utils.removeScriptVarTree(self, "gmGrantSkill"); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - utils.removeScriptVarTree(self, "gmGrantSkill"); - return SCRIPT_CONTINUE; - } - - switch(idx) - { - case 0: - gmGrantSkillRoadmapChoice(self, target); - break; - case 1: - String skillName = getWorkingSkill(target); - - dictionary xpReqs = getSkillPrerequisiteExperience(skillName); - if (xpReqs == null || xpReqs.isEmpty()) - { - sendSystemMessageTestingOnly(self, "Player does not have a valid working skill"); - return SCRIPT_CONTINUE; - } - - java.util.Enumeration e = xpReqs.keys(); - String xpType = (String)(e.nextElement()); - int xpCost = xpReqs.getInt(xpType); - int curXP = getExperiencePoints(target, xpType); - if (curXP < xpCost) - { - grantExperiencePoints(target, xpType, xpCost - curXP); - } - skill_template.earnWorkingSkill(target); - redisplayGrantSkillSui(self, target); - break; - case 2: - String template = getSkillTemplate(target); - gmGrantSkillRoadmapProgression(self, target, template); - break; - - default: - utils.removeScriptVarTree(self, "gmGrantSkill"); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public void redisplayGrantSkillSui(obj_id self, obj_id target) throws InterruptedException - { - utils.setScriptVar(self, "gmGrantSkill.target", target); - - String prompt = "You are attempting to modify the skills for \\#pcontrast3 "+ getName(target) + "\\#..\n\n"; - prompt += "Please choose an option:"; - - int pid = sui.listbox(self, self, prompt, sui.OK_CANCEL, "GM GRANT SKILL", gm.ROADMAP_SKILL_OPTIONS, "handleGmGrantSkillOptions", true, false); - } - - - public void gmGrantSkillRoadmapChoice(obj_id self, obj_id target) throws InterruptedException - { - String[] roadmapList = gm.getRoadmapList(); - - String prompt = "You are attempting to modify the skills for \\#pcontrast3 "+ getName(target) + "\\#..\n\n"; - prompt += "Please select a profession roadmap:"; - - int pid = sui.listbox(self, self, prompt, sui.OK_CANCEL, "GM GRANT SKILL", gm.convertRoadmapNames(roadmapList), "handleGmGrantSkillRoadmapSelect", true, false); - - utils.setBatchScriptVar(self, "gmGrantSkill.roadmap_list", roadmapList); - utils.setScriptVar(self, "gmGrantSkill.target", target); - } - - - public int handleGmGrantSkillRoadmapSelect(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = utils.getObjIdScriptVar(self, "gmGrantSkill.target"); - - if (!isIdValid(target)) - { - sendSystemMessageTestingOnly(self, "Target is no longer valid."); - utils.removeScriptVarTree(self, "gmGrantSkill"); - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - int btn = sui.getIntButtonPressed(params); - - if (btn == sui.BP_CANCEL) - { - utils.removeScriptVarTree(self, "gmGrantSkill"); - redisplayGrantSkillSui(self, target); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - utils.removeScriptVarTree(self, "gmGrantSkill"); - gmGrantSkillRoadmapChoice(self, target); - return SCRIPT_CONTINUE; - } - - if (exists(target)) - { - String[] roadmapList = utils.getStringBatchScriptVar(self, "gmGrantSkill.roadmap_list"); - - gmGrantSkillRoadmapProgression(self, target, roadmapList[idx]); - } - - return SCRIPT_CONTINUE; - } - - - public void gmGrantSkillRoadmapProgression(obj_id self, obj_id target, String template) throws InterruptedException - { - String templateSkills = dataTableGetString(skill_template.TEMPLATE_TABLE, template, "template"); - String[] skillList = split(templateSkills, ','); - - if (skillList == null || skillList.length == 0) - { - sendSystemMessageTestingOnly(self, "No skills found for this profession"); - utils.removeScriptVarTree(self, "gmGrantSkill"); - return; - } - else - { - sendSystemMessageTestingOnly(self, "Revoking all skills and experience for "+ getName(target)); - respec.revokeAllSkillsAndExperience(target); - skill.recalcPlayerPools(target, true); - - if (!template.equals(getSkillTemplate(target))) - { - setSkillTemplate(target, template); - } - - setWorkingSkill(target, skillList[0]); - - utils.setScriptVar(self, "gmGrantSkill.skill_template", template); - utils.setBatchScriptVar(self, "gmGrantSkill.roadmap_skills", skillList); - } - - String prompt = "You are attempting to modify the skills for \\#pcontrast3 "+ getName(target) + "\\#..\n\n"; - prompt += "Please enter the level for this player:"; - - int pid = sui.inputbox(self, self, prompt, "handleGmGrantSkillLevelInput"); - - } - - - public int handleGmGrantSkillSkillSelect(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = utils.getObjIdScriptVar(self, "gmGrantSkill.target"); - - if (!isIdValid(target)) - { - sendSystemMessageTestingOnly(self, "Target is no longer valid."); - utils.removeScriptVarTree(self, "gmGrantSkill"); - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - int btn = sui.getIntButtonPressed(params); - - if (btn == sui.BP_CANCEL) - { - utils.removeScriptVarTree(self, "gmGrantSkill"); - return SCRIPT_CONTINUE; - } - - String skillTemplate = utils.getStringScriptVar(self, "gmGrantSkill.skill_template"); - if (skillTemplate == null || skillTemplate.equals("")) - { - utils.removeScriptVarTree(self, "gmGrantSkill"); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - sendSystemMessageTestingOnly(self, "Please make a selection."); - gmGrantSkillRoadmapProgression(self, target, skillTemplate); - return SCRIPT_CONTINUE; - } - - if (exists(target)) - { - String[] roadmapSkills = utils.getStringBatchScriptVar(self, "gmGrantSkill.roadmap_skills"); - - setWorkingSkill(target, roadmapSkills[0]); - - for (int i = 0; i < idx; i++) - { - testAbortScript(); - grantSkill(target, roadmapSkills[i]); - skill_template.grantRoadmapItem(target); - - setWorkingSkill(target, skill_template.getNextWorkingSkill(target)); - } - - sendSystemMessageTestingOnly(self, "Skill Granting for "+ getName(target) + " is complete"); - } - - utils.removeScriptVarTree(self, "gmGrantSkill"); - - return SCRIPT_CONTINUE; - } - - - public int handleGmGrantSkillLevelInput(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = utils.getObjIdScriptVar(self, "gmGrantSkill.target"); - - if (!isIdValid(target)) - { - sendSystemMessageTestingOnly(self, "Target is no longer valid."); - utils.removeScriptVarTree(self, "gmGrantSkill"); - return SCRIPT_CONTINUE; - } - - String text = sui.getInputBoxText(params); - - int level = utils.stringToInt(text); - - if (level < 1 || level > 90) - { - sendSystemMessageTestingOnly(self, "Invalid level entered!"); - return SCRIPT_CONTINUE; - } - else - { - respec.autoLevelPlayer(target, level, true); - } - - sendSystemMessageTestingOnly(self, "Skill Granting for "+ getName(target) + " is complete"); - - utils.removeScriptVarTree(self, "gmGrantSkill"); - - return SCRIPT_CONTINUE; - } - - - public int cmdAutoDeclineDuel(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (hasObjVar(self, VAR_AUTODECLINE_DUEL)) - { - removeObjVar(self, VAR_AUTODECLINE_DUEL); - sendSystemMessage(self, new string_id("spam", "autodecline_duel_off")); - } - else - { - setObjVar(self, VAR_AUTODECLINE_DUEL, 1); - sendSystemMessage(self, new string_id("spam", "autodecline_duel_on")); - } - - return SCRIPT_CONTINUE; - } - - - public int handleSmugglerGetLocationInfo(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id smuggler = params.getObjId("smuggler"); - - if (!isIdValid(smuggler)) - { - return SCRIPT_CONTINUE; - } - - location loc = getLocation(self); - - params = new dictionary(); - params.put("location", loc); - - messageTo(smuggler, "handleSmugglerDistanceCheck", params, 1.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int handleSmugglerDistanceCheck(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - location targetLoc = params.getLocation("location"); - location myLoc = getLocation(self); - - String myLocArea = myLoc.area; - String targetLocArea = targetLoc.area; - - if (targetLoc != null && myLocArea.equals(targetLocArea)) - { - int distance = (int)getDistance(myLoc, targetLoc); - - if (distance > 1 && distance < 1000) - { - prose_package pp = new prose_package (); - pp.stringId = new string_id ("bounty_hunter", "sm_bounty_hunter_distance"); - prose.setDI(pp, distance); - - sendSystemMessageProse(self, pp); - } - } - - return SCRIPT_CONTINUE; - } - - - public int channelHeal(obj_id self, dictionary params) throws InterruptedException - { - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id user = params.getObjId("user"); - int tick = params.getInt("tick"); - obj_id item = params.getObjId("item"); - int healPerTick = params.getInt("healPerTick"); - location healLoc = params.getLocation("healLoc"); - int attrib = params.getInt("attrib"); - int pid = utils.getIntScriptVar(self, "channelHeal.suiPid"); - - location currentLoc = getLocation(self); - - prose_package pp = new prose_package(); - - if (user != self) - { - - sendSystemMessage(self, SID_CHANNEL_HEAL_WRONG_USER); - buff.removeBuff(self, "channel_healing"); - return SCRIPT_CONTINUE; - } - - if (!healLoc.equals(currentLoc)) - { - - sendSystemMessage(self, SID_CHANNEL_HEAL_MOVED); - buff.removeBuff(self, "channel_healing"); - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(self, "channel_healing") && tick != 0) - { - - sendSystemMessage(self, SID_CHANNEL_HEAL_IN_COMBAT); - return SCRIPT_CONTINUE; - } - - if (luck.isLucky(self, 0.005f)) - { - float bonus = healPerTick * 0.2f; - if (bonus < 1) - { - bonus = 1; - } - - healPerTick += bonus; - } - - if (tick == 0) - { - buff.applyBuff(self, "channel_healing"); - } - - int before = getAttrib(self, attrib); - - healing.healDamage(self, self, attrib, healPerTick); - - int delta = getAttrib(self, attrib) - before; - - pp = prose.setStringId(pp, new string_id("healing", "heal_fly")); - pp = prose.setDI(pp, delta); - pp = prose.setTO(pp, healing.ATTRIBUTES[attrib]); - showFlyTextPrivateProseWithFlags(self, self, pp, 2.0f, colors.SEAGREEN, healing.FLY_TEXT_FLAG_IS_HEAL); - - pp = prose.setStringId(pp, healing.SID_ITEM_PLAYER_HEAL); - pp = prose.setDI(pp, delta); - pp = prose.setTT(pp, self); - healing.sendMedicalSpam(self, pp, healing.COMBAT_RESULT_MEDICAL); - healing.doHealingAnimationAndEffect(self, self); - - tick += 1; - - params.put("tick", tick); - - if (tick < healing.ITEM_CHANNEL_HEAL_TICKS) - { - messageTo( self, "channelHeal", params, 2, false); - } - - return SCRIPT_CONTINUE; - } - - - public int residentLinkFalse(obj_id self, dictionary params) throws InterruptedException - { - setHouseId(self, obj_id.NULL_ID); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } - - - public int handleTargetDummyCombatReport(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - int button = sui.getIntButtonPressed( params ); - String revert = params.getString(sui.MSGBOX_BTN_REVERT+".RevertWasPressed"); - if (button == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - else - { - if (revert != null && !revert.equals("")) - { - - if (utils.hasScriptVarTree(self, target_dummy.BASE_TARGET_DUMMY_VAR)) - { - utils.removeScriptVarTree(self, target_dummy.BASE_TARGET_DUMMY_VAR); - sendSystemMessage(self, new string_id("target_dummy", "combat_data_all_clearing")); - sendSystemMessage(self, new string_id("target_dummy", "combat_data_all_cleared")); - } - else - { - - sendSystemMessage(self, new string_id("target_dummy", "placement_no_combat_data")); - } - } - else - { - - target_dummy.reportCombatData(self, self); - } - } - - return SCRIPT_CONTINUE; - } - - - public int reimburseTcgItem(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - CustomerServiceLog("tcg", "TCG Reimbursement failed because of lack of parameters for reimbursement function for: "+self+"."); - return SCRIPT_CONTINUE; - } - - if (!params.containsKey("reimburseItem")) - { - CustomerServiceLog("tcg", "TCG Reimbursement item parameter not found. Reimbursement function failed for: "+self+"."); - return SCRIPT_CONTINUE; - } - - String reimbursementItem = params.getString("reimburseItem"); - if (reimbursementItem == null || reimbursementItem.equals("")) - { - CustomerServiceLog("tcg", "TCG Reimbursement item parameter was invalid. Reimbursement function failed for: "+self+"."); - return SCRIPT_CONTINUE; - } - - obj_id pInv = utils.getInventoryContainer(self); - if (!isValidId(pInv) || !exists(pInv)) - { - CustomerServiceLog("tcg", "TCG Reimbursement function failed for: "+self+". Player inventory Id failed."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("tcg", "TCG Reimbursement item: "+reimbursementItem+" being given to player: "+self+"."); - obj_id newItem = static_item.createNewItemFunction(reimbursementItem, pInv); - if (!isValidId(newItem)) - { - CustomerServiceLog("tcg", "TCG Reimbursement item: "+reimbursementItem+" failed. New object could not be created for: "+self+"."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("tcg", "TCG Reimbursement item: "+reimbursementItem+" was created: "+newItem+" and given to player: "+self+"."); - return SCRIPT_CONTINUE; - } - - - public boolean applyCostume(obj_id self, String costumeCommand) throws InterruptedException - { - String ibuff = stealth.getInvisBuff(self); - if (ibuff != null && ibuff.length() > 0) - { - sendSystemMessage(self, new string_id("spam", "costume_not_while_invis")); - return false; - } - - if (getState(self, STATE_GLOWING_JEDI) != 0) - { - sendSystemMessage(self, new string_id("spam", "costume_not_while_blue_glowie")); - return false; - } - - String datatable = "datatables/item/costume/costumes.iff"; - dictionary costumeData = dataTableGetRow(datatable, costumeCommand); - if (costumeData != null) - { - String costumeBuff = costumeData.getString("costume_buff"); - String costumeComponentName = costumeData.getString("costume_component"); - - if (costumeBuff != null && costumeBuff.length() > 0) - { - - if (costumeComponentName != null && costumeComponentName.length() > 0 && !costumeComponentName.equals("none")) - { - obj_id costumeComponentId = utils.getStaticItemInInventory(self, costumeComponentName); - if (!isIdValid(costumeComponentId) || getCount(costumeComponentId) <= 0) - { - string_id message = new string_id("spam", "costume_component_missing"); - prose_package pp = prose.getPackage(message, self, self); - prose.setTO(pp, getString(new string_id("static_item_n", costumeComponentName))); - sendSystemMessageProse(self, pp); - return false; - } - else - { - decrementCount(costumeComponentId); - } - } - - buff.applyBuff(self, costumeBuff); - return true; - } - } - return false; - } - - - public int costume_loveday_ewok_cupid(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_loveday_ewok_cupid")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_jawa(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_jawa")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_gungan(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_gungan")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_ewok(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_ewok")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_gamorrean_guard(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_gamorrean_guard")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int costume_battle_droid(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_battle_droid")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_droideka(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_droideka")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_monkey_lizard(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_monkey_lizard")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_toydarian(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_toydarian")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_muftak(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_muftak")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_dantari_m(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_dantari_m")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_4lom(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_4lom")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_dantari_f(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_dantari_f")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_royal_guard(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_royal_guard")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_droid_8t88(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_droid_8t88")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_darktrooper(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_darktrooper")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_mustafarian_01(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_mustafarian_01")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_chevin(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_chevin")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_ig106(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_ig106")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_super_battle_droid(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_super_battle_droid")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_spider_droid(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_spider_droid")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_undead_wookie(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_undead_wookie")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_burning_ewok(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_burning_ewok")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_chiss_01(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_chiss_01")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_exar_kun_cultist(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_exar_kun_cultist")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int costume_lifeday_monkey_lizard(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!applyCostume(self, "costume_lifeday_monkey_lizard")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int cmdShowHousePackUpData(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - String housePackUpData = sui.colorGreen()+""; - String timeMessage = ""; - String displayTime = ""; - int dailyCount = 0; - - int meritPts = player_structure.getPlayerPackUpMeritPoints(self); - if (meritPts < 0) - { - meritPts = 0; - } - housePackUpData +="Total Merit Points: "+sui.colorWhite() + meritPts + sui.colorGreen(); - housePackUpData += sui.newLine(); - - int totalPacked = 0; - int[] housePackingTally = getIntArrayObjVar(self, player_structure.HOUSE_PACKUP_ARRAY_OBJVAR); - if (housePackingTally != null && housePackingTally.length == player_structure.ARRAY_LENGTH_FOR_HOUSE_PACKUP) - { - totalPacked = housePackingTally[1]; - if (totalPacked < 0) - { - totalPacked = 0; - } - - } - housePackUpData += "Total Structures Ever Packed: "+sui.colorWhite() + totalPacked + sui.colorGreen(); - housePackUpData += sui.newLine(); - - if (hasObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TIMER_OBJVAR)) - { - int resetTime = getIntObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TIMER_OBJVAR); - if (getGameTime() < resetTime) - { - dailyCount = getIntObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TALLY_OBJVAR); - if (dailyCount < 0) - { - dailyCount = 0; - } - - if (dailyCount > 0) - { - housePackUpData += "Total Structures Packed in Last 24 hours: "+sui.colorWhite() + dailyCount + sui.colorGreen(); - housePackUpData += sui.newLine(); - } - } - } - - if (!player_structure.canPackMoreToday(self) && hasObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TIMER_OBJVAR)) - { - int timeLeft = getIntObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TIMER_OBJVAR); - timeLeft -= getGameTime(); - displayTime = utils.assembleTimeRemainToUse(timeLeft, false); - if (displayTime != null && displayTime.length() > 0) - { - housePackUpData += "Time Before Next Structure Can Be Packed: "+sui.colorWhite() + displayTime + sui.colorGreen(); - housePackUpData += sui.newLine(); - } - } - else if (player_structure.canPackMoreToday(self) && utils.hasScriptVar(self, player_structure.SCRIPTVAR_HOUSE_PACKUP_LOCKOUT_TIME)) - { - int timeNeeded = utils.getIntScriptVar(self, player_structure.SCRIPTVAR_HOUSE_PACKUP_LOCKOUT_TIME) + (int)player_structure.HOUSE_PACKUP_LOCKOUT_TIMER; - int timeNow = getGameTime(); - int timeDiff = timeNeeded - timeNow; - timeMessage = utils.formatTimeVerbose(timeDiff); - if (timeMessage != null && timeMessage.length() > 0) - { - housePackUpData += "Time Before Next Structure Can Be Packed: "+sui.colorWhite() + timeMessage + sui.colorGreen(); - housePackUpData += sui.newLine(); - } - } - - housePackUpData += sui.colorWhite(); - sendConsoleMessage(self, housePackUpData); - return SCRIPT_CONTINUE; - } - - - public int cmdRename(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (utils.hasScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID)) - { - int savedPageId = utils.getIntScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID); - utils.removeScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID); - forceCloseSUIPage(savedPageId); - } - - if (utils.hasScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_NEW_NAME)) - { - String newName = utils.getStringScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_NEW_NAME); - utils.removeScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_NEW_NAME); - - if ((newName != null) && (newName.length() > 0)) - { - renameCharacterReleaseNameReservation(self); - } - } - - utils.removeScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_UNVERIFIED_NEW_NAME); - - final int daysOld = getCurrentBirthDate() - getPlayerBirthDate(self); - if (daysOld < 90) - { - if (isGod(self)) - { - sendSystemMessage(self, "GOD MODE bypass for 90 days character age requirement for character rename.", ""); - } - else - { - sendSystemMessage(self, "This character is only "+ daysOld + " days old. The character must be at least 90 days old before you can rename the character.", ""); - return SCRIPT_CONTINUE; - } - } - - if (hasObjVar(self, "renameCharacterRequest.requestTime")) - { - final int previousRenameTime = getIntObjVar(self, "renameCharacterRequest.requestTime"); - final int nextRenameTime = previousRenameTime + (90 * 24 * 60 * 60); - final int timeNow = getCalendarTime(); - - if (nextRenameTime > timeNow) - { - final String previousRenameName = getStringObjVar(self, "renameCharacterRequest.requestNewName"); - final String currentName = getName(self); - - if ((currentName != null) && (previousRenameName != null) && !previousRenameName.equals(currentName)) - { - - final int renameRequestTimeOut = previousRenameTime + (24 * 60 * 60); - - if (renameRequestTimeOut > timeNow) - { - int[] convertedGameTime = player_structure.convertSecondsTime(renameRequestTimeOut - timeNow); - if ((convertedGameTime != null) && (convertedGameTime.length == 4)) - { - sendSystemMessage(self, "There is already an outstanding rename request for this character. If the request is not completed in "+ convertedGameTime[1] + "h:"+ convertedGameTime[2] + "m:"+ convertedGameTime[3] + "s, you can try to rename this character again.", ""); - } - else - { - sendSystemMessage(self, "There is already an outstanding rename request for this character.", ""); - } - - return SCRIPT_CONTINUE; - } - } - else - { - - if (isGod(self)) - { - sendSystemMessage(self, "GOD MODE bypass for 90 days wait between character rename.", ""); - } - else - { - int[] convertedGameTime = player_structure.convertSecondsTime(nextRenameTime - timeNow); - if ((convertedGameTime != null) && (convertedGameTime.length == 4)) - { - sendSystemMessage(self, "You must wait "+ convertedGameTime[0] + "d:"+ convertedGameTime[1] + "h:"+ convertedGameTime[2] + "m:"+ convertedGameTime[3] + "s before you can rename this character again.", ""); - } - else - { - sendSystemMessage(self, "There is a 90 days wait after the character has been renamed before you can rename the character again.", ""); - } - - return SCRIPT_CONTINUE; - } - } - } - } - - renameCharacterDisplayNameInput(self, getName(self), "Enter a new name for the character."); - return SCRIPT_CONTINUE; - } - - - public int trigger_city_house_packup(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id player = self; - - if (!isPlayer(player) || !isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - location here = getLocation(player); - obj_id[] potentialSigns = getObjectsInRange(here, 10.0f); - - for (int i = 0; i < potentialSigns.length; i++) - { - testAbortScript(); - if (!hasScript(potentialSigns[i], "systems.sign.sign")) - { - continue; - } - else - { - - if (!utils.hasScriptVar(potentialSigns[i], "player_structure.parent")) - { - sendSystemMessage(player, new string_id(STF_FILE, "unknown_city_packup_error")); - CustomerServiceLog("playerStructure", "Player("+ player +") attempted to use the Remote City Packup Command but the House Sign("+ potentialSigns[i] +") has invalid data."); - LOG("sissynoid", "Invalid Sign - No Parent ObjVar - fail"); - return SCRIPT_CONTINUE; - } - - obj_id structure = utils.getObjIdScriptVar(potentialSigns[i], "player_structure.parent"); - if (!isIdValid(structure)) - { - LOG("sissynoid", "Invalid Structure ID: "+ structure); - CustomerServiceLog("playerStructure", "Player("+ player +") attempted to use the Remote City Packup Command but the House Obj ID has invalid."); - return SCRIPT_CONTINUE; - } - - if (!player_structure.isCityAbandoned(structure)) - { - sendSystemMessage(player, new string_id(STF_FILE, "structure_not_city_abandoned")); - CustomerServiceLog("playerStructure", "Player("+ player +") attempted to use the Remote City Packup Command but the House("+ structure +") was not City Abandoned."); - LOG("sissynoid", "This structure is not City Abandoned - fail"); - return SCRIPT_CONTINUE; - } - else - { - LOG("sissynoid", "I found a sign: "+ potentialSigns[i]); - dictionary dict = new dictionary(); - dict.put("player", player); - dict.put("sign", potentialSigns[i]); - messageTo(potentialSigns[i], "handleRemoteCommandCityHousePackup", dict, 1.0f, false); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int handleRenameCharacterNameInput(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (params.getInt("pageId") != utils.getIntScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - utils.removeScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_OK) - { - String newName = sui.getInputBoxText(params); - if (newName != null) - { - java.util.StringTokenizer st = new java.util.StringTokenizer(newName); - - newName = null; - while (st.hasMoreTokens()) - { - testAbortScript(); - if (newName == null) - { - newName = st.nextToken(); - } - else - { - newName += " "; - newName += st.nextToken(); - } - } - } - - String currentName = getName(self); - if ((newName != null) && (newName.length() > 0) && (currentName != null) && (currentName.length() > 0) && !newName.equals(currentName)) - { - utils.setScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_UNVERIFIED_NEW_NAME, newName); - validateRenameCharacter(self, newName); - } - else - { - if (currentName == null) - { - currentName = ""; - } - - renameCharacterDisplayNameInput(self, currentName, "Please enter a new name for the character."); - } - } - - return SCRIPT_CONTINUE; - } - - - public int renameCharacterNameValidationFail(obj_id self, dictionary params) throws InterruptedException - { - if (utils.hasScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_UNVERIFIED_NEW_NAME)) - { - return SCRIPT_CONTINUE; - } - - String unverifiedNewName = utils.getStringScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_UNVERIFIED_NEW_NAME); - utils.removeScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_UNVERIFIED_NEW_NAME); - - if ((unverifiedNewName != null) && (unverifiedNewName.length() > 0)) - { - renameCharacterDisplayNameInput(self, unverifiedNewName, params.getString("reason")); - } - - return SCRIPT_CONTINUE; - } - - - public int renameCharacterNameValidationSuccess(obj_id self, dictionary params) throws InterruptedException - { - if (utils.hasScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_UNVERIFIED_NEW_NAME)) - { - return SCRIPT_CONTINUE; - } - - String newName = utils.getStringScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_UNVERIFIED_NEW_NAME); - utils.removeScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_UNVERIFIED_NEW_NAME); - - if ((newName != null) && (newName.length() > 0)) - { - String announcement = "Please confirm that you want to rename this character to \""; - announcement += newName; - announcement += "\".\n\n"; - - java.util.StringTokenizer st = new java.util.StringTokenizer(newName); - if (!st.hasMoreTokens()) - { - return SCRIPT_CONTINUE; - } - - String currentFirstName = getFirstName(self); - if ((currentFirstName == null) || (currentFirstName.length() <= 0)) - { - return SCRIPT_CONTINUE; - } - - if (!currentFirstName.equalsIgnoreCase(st.nextToken())) - { - String disableRenameChatAvatar = getConfigSetting("CharacterRename", "disableRenameChatAvatar"); - if (disableRenameChatAvatar == null) - { - disableRenameChatAvatar = "false"; - } - - if (disableRenameChatAvatar.equalsIgnoreCase("true") || disableRenameChatAvatar.equalsIgnoreCase("yes")) - { - announcement += "Please note that this character's mail, friends list, and ignore list will be lost after the rename.\n\n"; - } - else - { - announcement += "Please note that even though this character's mail, friends list, and ignore list will be preserved with the rename, it is still recommended that you make a backup of this character's mail, friends list, and ignore list.\n\n"; - } - } - - announcement += "Once the rename request has been submitted (by clicking the Yes button below), you will be disconnected and will not be able to log in this character until the rename request is completed. It can take up to 30 minutes for the rename request to complete.\n\n"; - announcement += "After the rename, there will be a 90 days wait before you can rename this character again.\n\n"; - announcement += "Do you wish to rename this character?"; - - int pid = sui.msgbox(self, self, announcement, sui.YES_NO, "Rename Character", "handleRenameCharacterConfirmation"); - utils.setScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID, pid); - utils.setScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_NEW_NAME, newName); - } - - return SCRIPT_CONTINUE; - } - - - public int handleRenameCharacterConfirmation(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_NEW_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (params.getInt("pageId") != utils.getIntScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID)) - { - return SCRIPT_CONTINUE; - } - - String newName = utils.getStringScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_NEW_NAME); - - utils.removeScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID); - utils.removeScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_NEW_NAME); - - if ((newName == null) || (newName.length() <= 0)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_OK) - { - - renameCharacter(self, newName); - } - else - { - - renameCharacterReleaseNameReservation(self); - } - - return SCRIPT_CONTINUE; - } - - - public void renameCharacterDisplayNameInput(obj_id self, String newName, String reason) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - return; - } - - String announcement = "Enter a new name for the character."; - if ((reason != null) && (reason.length() > 0)) - { - announcement = reason; - } - - int pid = sui.inputbox(self, self, announcement, "Rename Character", "handleRenameCharacterNameInput", 125, false, ""); - sui.setSUIProperty(pid, sui.INPUTBOX_INPUT, sui.PROP_TEXT, newName); - sui.setSUIProperty(pid, sui.INPUTBOX_INPUT, "MaxLength", String.valueOf(125)); - utils.setScriptVar(self, SCRIPTVAR_RENAME_CHARACTER_SUI_ID, pid); - showSUIPage(pid); - } - - - public int closeLeaderSui(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - sui.removePid(player, holiday.LEADERSUI_PID_NAME); - return SCRIPT_CONTINUE; - } - - - public int handlerCommunityBadgeGrant(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id communityRep = params.getObjId("communityRep"); - String badgeName = params.getString("badgeName"); - - badge.grantBadge(self, badgeName); - - params.put("player", self); - - messageTo(communityRep, "handlerCommunityBadgeGrantedToPlayer", params, 0, true); - CustomerServiceLog("EventPerk", "[EventTool] 'handlerCommunityBadgeGrant' player "+ getPlayerName(self) + ":"+ self + " was awarded badge "+ badgeName + " by "+ getPlayerName(communityRep) + ":"+ communityRep + " .", null); - - return SCRIPT_CONTINUE; - } - - - public int recalculateCampDefenseUndeadArray(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() Params invalid."); - return SCRIPT_CONTINUE; - - } - - if (!params.containsKey("questName")) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() questName param not found."); - return SCRIPT_CONTINUE; - } - - if (!params.containsKey("survivalTaskName")) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() survivalTaskName param not found."); - return SCRIPT_CONTINUE; - } - - if (!params.containsKey("cleanUpTaskName")) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() cleanUpTaskName param not found."); - return SCRIPT_CONTINUE; - } - String questName = params.getString("questName"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() player "+self+" has received an invalid quest name."); - return SCRIPT_CONTINUE; - } - - String survivalTaskName = params.getString("survivalTaskName"); - if (survivalTaskName == null || survivalTaskName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() player "+self+" has received an invalid quest survivalTaskName name."); - return SCRIPT_CONTINUE; - } - - String cleanUpTaskName = params.getString("cleanUpTaskName"); - if (cleanUpTaskName == null || cleanUpTaskName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() player "+self+" has received an invalid quest cleanUpTaskName name."); - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "enemyList")) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() Has no script var list of enemies, sending signal."); - if (!groundquests.isQuestActive(self, questName)) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() Player "+self+" did not have the appropriate quest active. Aborting quest signal."); - return SCRIPT_CONTINUE; - } - - if (groundquests.isTaskActive(self, questName, survivalTaskName)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() Player "+self+" did not have the appropriate quest TASK active. Sending to new handler."); - - messageTo(self, "recalculateCampDefenseUndeadArray", params, 3, false ); - - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(self, "hasKilledWave"); - removeGuardPostFlag(self); - - return SCRIPT_CONTINUE; - } - - obj_id[] enemies = utils.getObjIdArrayScriptVar(self, "enemyList"); - if (enemies == null || enemies.length == 0) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() Has the scriptvar but could not find a valid enemy list on player, sending signal."); - if (!groundquests.isQuestActive(self, questName)) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() Player "+self+" did not have the appropriate quest active. Destroying all enemies."); - for (int i = 0; i < enemies.length; i++) - { - testAbortScript(); - if ((!isIdValid(enemies[i])) || !exists(enemies[i]) || isDead(enemies[i])) - { - continue; - } - destroyObject(enemies[i]); - } - utils.removeScriptVar(self,"enemyList"); - return SCRIPT_CONTINUE; - } - - if (groundquests.isTaskActive(self, questName, survivalTaskName)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() Player "+self+" did not have the appropriate quest TASK active. Sending to new handler."); - messageTo(self, "recalculateCampDefenseUndeadArray", params, 3, false ); - - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(self, "hasKilledWave"); - - removeGuardPostFlag(self); - - return SCRIPT_CONTINUE; - } - - Vector latestGuardList = new Vector(); - for (int i = 0; i < enemies.length; i++) - { - testAbortScript(); - if ((isIdNull(enemies[i])) || !exists(enemies[i]) || isDead(enemies[i])) - { - continue; - } - utils.addElement(latestGuardList, enemies[i]); - } - obj_id[] newGuardArray = new obj_id[latestGuardList.size()]; - if (newGuardArray == null || newGuardArray.length == 0) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() could not find a valid enemy list on player, sending signal."); - if (!groundquests.isQuestActive(self, questName)) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() Player "+self+" did not have the appropriate quest active. Aborting quest signal."); - return SCRIPT_CONTINUE; - } - - if (groundquests.isTaskActive(self, questName, survivalTaskName)) - { - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() Player "+self+" did not have the appropriate quest TASK active. Handling Timer."); - - messageTo(self, "recalculateCampDefenseUndeadArray", params, 3, false ); - - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(self, "hasKilledWave"); - removeGuardPostFlag(self); - - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "player_utility.recalculateCampDefenseUndeadArray() player: "+self+" still has enemies to kill."); - - latestGuardList.toArray(newGuardArray); - utils.setScriptVar(self, "enemyList", newGuardArray); - return SCRIPT_CONTINUE; - } - - - public boolean removeGuardPostFlag(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - CustomerServiceLog("outbreak_themepark", "player_utility.removeGuardPostFlag() Player "+player+" is attempting to remove the guard post occupied flagging."); - - if (utils.hasScriptVar(player, GUARD_OCCUPIED)) - { - obj_id guardPost = utils.getObjIdScriptVar(player, GUARD_OCCUPIED); - if (isValidId(guardPost) && exists(guardPost)) - { - utils.removeScriptVar(guardPost, GUARD_OCCUPIED); - return true; - } - } - CustomerServiceLog("outbreak_themepark", "player_utility.removeGuardPostFlag() Player "+player+" did not have the guard post oid or the oid was invalid."); - return false; - } - - - public int handleEntertainingGcwTroops(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, gcw.GCW_SCRIPTVAR_PARENT + ".gcwNpc")) - { - LOG("gcw_entertainer","no gcwNpc"); - - utils.removeScriptVarTree(self, gcw.GCW_SCRIPTVAR_PARENT); - sui.removePid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - return SCRIPT_CONTINUE; - } - - obj_id npc = utils.getObjIdScriptVar(self, gcw.GCW_SCRIPTVAR_PARENT + ".gcwNpc"); - if (!isValidId(npc) || !exists(npc) || ai_lib.aiIsDead(npc)) - { - LOG("gcw_entertainer","npc not valid"); - - utils.removeScriptVarTree(self, gcw.GCW_SCRIPTVAR_PARENT); - sui.removePid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(npc, gcw.GCW_STOPPED_ENTERTAINING)) - { - LOG("gcw_entertainer","had gcw.GCW_STOPPED_ENTERTAINING"); - - utils.removeScriptVarTree(self, gcw.GCW_SCRIPTVAR_PARENT); - cleanUpGuardPostNpc(npc); - sui.removePid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - int test_pid = getIntObjVar(self, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - LOG("gcw_entertainer","pid != test_pid -- just ignored!"); - return SCRIPT_CONTINUE; - } - - if (!sui.hasPid(self, gcw.ENTERTAIN_GCW_TROOPS_PID)) - { - LOG("gcw_entertainer","no gcw.ENTERTAIN_GCW_TROOPS_PID"); - - utils.removeScriptVarTree(self, gcw.GCW_SCRIPTVAR_PARENT); - cleanUpGuardPostNpc(npc); - sui.removePid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - return SCRIPT_CONTINUE; - } - - test_pid = sui.getPid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - - if (test_pid != pid) - { - LOG("gcw_entertainer","gcw.ENTERTAIN_GCW_TROOPS_PID != pid"); - - utils.removeScriptVarTree(self, gcw.GCW_SCRIPTVAR_PARENT); - cleanUpGuardPostNpc(npc); - sui.removePid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, sui.COUNTDOWNTIMER_SUI_VAR)) - { - LOG("gcw_entertainer","no sui.COUNTDOWNTIMER_SUI_VAR"); - - utils.removeScriptVarTree(self, gcw.GCW_SCRIPTVAR_PARENT); - cleanUpGuardPostNpc(npc); - sui.removePid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - LOG("gcw_entertainer","had BP_CANCEL"); - - utils.removeScriptVarTree(self, gcw.GCW_SCRIPTVAR_PARENT); - cleanUpGuardPostNpc(npc); - sui.removePid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - return SCRIPT_CONTINUE; - } - else if (bp == sui.BP_REVERT) - { - LOG("gcw_entertainer","had BP_REVERT"); - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(self, gcw.SID_COUNTDOWN_LOCOMOTION); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(self, gcw.SID_INTERRUPTED_INCAPACITATED); - } - else if (event == sui.CD_EVENT_DAMAGED || event == sui.CD_EVENT_COMBAT) - { - sendSystemMessage(self, gcw.SID_INTERRUPTED_DAMAGED); - } - - utils.removeScriptVarTree(self, gcw.GCW_SCRIPTVAR_PARENT); - cleanUpGuardPostNpc(npc); - sui.removePid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, gcw.GCW_SCRIPTVAR_PARENT + ".playerEntertainmentStart")) - { - LOG("gcw_entertainer","missing gcw.GCW_SCRIPTVAR_PARENT playerEntertainmentStart"); - - utils.removeScriptVarTree(self, gcw.GCW_SCRIPTVAR_PARENT); - sui.removePid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - cleanUpGuardPostNpc(npc); - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - - utils.removeScriptVarTree(self, gcw.GCW_SCRIPTVAR_PARENT); - utils.removeScriptVarTree(npc, gcw.GCW_SCRIPTVAR_PARENT); - sui.removePid(self, gcw.ENTERTAIN_GCW_TROOPS_PID); - - utils.removeScriptVar(npc, "ai.oldEntertainerSkillMod"); - utils.removeScriptVar(npc, "ai.listeningTo"); - stop(npc); - messageTo(npc, "resumeDefaultCalmBehavior", null, 0, false); - - LOG("gcw_entertainer","YOU WIN!"); - if (factions.isRebelorRebelHelper(self)) - { - LOG("gcw_entertainer","handleEntertainingGcwTroops Rebel task was signaled"); - groundquests.sendSignal(self, gcw.GCW_REB_ENTERTAIN_PATROL_SIGNAL); - } - else if (factions.isImperialorImperialHelper(self)) - { - LOG("gcw_entertainer","handleEntertainingGcwTroops Imp task was signaled"); - groundquests.sendSignal(self, gcw.GCW_IMP_ENTERTAIN_PATROL_SIGNAL); - } - else - { - LOG("gcw_entertainer","handleEntertainingGcwTroops NO FACTION"); - } - - if (hasObjVar(npc, gcw.GCW_PATROL_OBJ)) - { - LOG("gcw_entertainer","Has patrol_point var"); - - obj_id patrolPoint = getObjIdObjVar(npc, gcw.GCW_PATROL_OBJ); - if (isValidId(patrolPoint)) - { - LOG("gcw_entertainer","Flagging obj: "+patrolPoint+" as entertained"); - messageTo(patrolPoint, "flagGCWPatrolEntertained", null, 0, false); - sendSystemMessage(self, SID_PATROL_POINT_ENTERTAINED); - - trial.addNonInstanceFactionParticipant(self, patrolPoint); - } - } - - cleanUpGuardPostNpc(npc); - - return SCRIPT_CONTINUE; - } - - - public boolean cleanUpGuardPostNpc(obj_id npc) throws InterruptedException - { - if (!isValidId(npc) || !exists(npc)) - { - return false; - } - - if (utils.hasScriptVar(npc, gcw.GCW_NPC_CLEANUP_FLAG)) - { - - trial.cleanupObject(npc); - } - else - { - utils.removeScriptVarTree(npc, gcw.GCW_SCRIPTVAR_PARENT); - } - return true; - } - - - public int handleTraderRepairQuest(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - int pid = params.getInt("id"); - int playerPid = getIntObjVar(self, sui.COUNTDOWNTIMER_SUI_VAR); - if (pid != playerPid) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - LOG("gcw_patrol_point","handleTraderRepairQuest had BP_CANCEL"); - - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - else if (bp == sui.BP_REVERT) - { - LOG("gcw_patrol_point","handleTraderRepairQuest had BP_REVERT"); - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(self, gcw.SID_COUNTDOWN_LOCOMOTION); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(self, gcw.SID_INTERRUPTED_INCAPACITATED); - } - else if (event == sui.CD_EVENT_DAMAGED || event == sui.CD_EVENT_COMBAT) - { - sendSystemMessage(self, gcw.SID_INTERRUPTED_DAMAGED); - } - - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, gcw.OBJECT_TO_REPAIR)) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - if (!utils.hasScriptVar(self, gcw.GCW_REPAIR_QUEST)) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - if (!utils.hasScriptVar(self, gcw.GCW_REPAIR_RESOURCE_COUNT)) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - - LOG("gcw_patrol_point","handleTraderRepairQuest passed validation"); - - String questName = utils.getStringScriptVar(self, gcw.GCW_REPAIR_QUEST); - if (questName == null || questName.length() <= 0) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(self, questName)) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - - LOG("gcw_constrction","handleTraderRepairQuest checkign for construction tasks"); - - if (!groundquests.isTaskActive(self, questName, gcw.GCW_CONSTRUCTION_TASK+"_"+questName)) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - - LOG("gcw_constrction","handleTraderRepairQuest a task was found"); - - obj_id gcwObject = utils.getObjIdScriptVar(self, gcw.OBJECT_TO_REPAIR); - if (!isValidId(gcwObject) || !exists(gcwObject)) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - - int resourceCount = utils.getIntScriptVar(self, gcw.GCW_REPAIR_RESOURCE_COUNT); - if (resourceCount <= 0) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - - LOG("gcw_patrol_point","handleTraderRepairQuest"); - if (!gcw.repairGcwObject(gcwObject, self, resourceCount)) - { - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - - LOG("gcw_constrction","handleTraderRepairQuest task was signaled"); - groundquests.sendSignal(self, gcw.GCW_CONSTRUCTION_SIGNAL+"_"+questName); - - buff.applyBuff(self, "gcw_fatigue"); - trial.addNonInstanceFactionParticipant(self, gcwObject); - removeTraderRepairScriptVars(self); - return SCRIPT_CONTINUE; - } - - - public int handleOpposingFactionScoutQuest(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_patrol_point","handleOpposingFactionScoutQuest init"); - - if (params == null) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - int playerPid = getIntObjVar(self, sui.COUNTDOWNTIMER_SUI_VAR); - if (pid != playerPid) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - LOG("gcw_patrol_point","handleOpposingFactionScoutQuest had BP_CANCEL"); - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_SCOUT_PID); - return SCRIPT_CONTINUE; - } - else if (bp == sui.BP_REVERT) - { - LOG("gcw_patrol_point","handleOpposingFactionScoutQuest had BP_REVERT"); - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(self, gcw.SID_COUNTDOWN_LOCOMOTION); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(self, gcw.SID_INTERRUPTED_INCAPACITATED); - } - else if (event == sui.CD_EVENT_DAMAGED || event == sui.CD_EVENT_COMBAT) - { - sendSystemMessage(self, gcw.SID_INTERRUPTED_DAMAGED); - } - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_SCOUT_PID); - return SCRIPT_CONTINUE; - } - - LOG("gcw_patrol_point","handleOpposingFactionScoutQuest passed validation"); - - if (!utils.hasScriptVar(self, "spyPatrolPoint")) - { - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - obj_id patrolPoint = utils.getObjIdScriptVar(self, "spyPatrolPoint"); - if (!isValidId(patrolPoint) || !exists(patrolPoint)) - { - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(self, gcw.GCW_SPY_PATROL_SCOUT_QUEST)) - { - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_SCOUT_PID); - return SCRIPT_CONTINUE; - } - if ((!groundquests.isTaskActive(self, gcw.GCW_SPY_PATROL_SCOUT_QUEST, gcw.GCW_REB_FIND_PATROL_SIGNAL) && !groundquests.isTaskActive(self, gcw.GCW_SPY_PATROL_SCOUT_QUEST, gcw.GCW_IMP_FIND_PATROL_SIGNAL))) - { - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_SCOUT_PID); - return SCRIPT_CONTINUE; - } - - if (factions.isRebelorRebelHelper(self)) - { - LOG("gcw_patrol_point","handleOpposingFactionScoutQuest Rebel task was signaled"); - groundquests.sendSignal(self, gcw.GCW_REB_FIND_PATROL_SIGNAL); - } - else if (factions.isImperialorImperialHelper(self)) - { - LOG("gcw_patrol_point","handleOpposingFactionScoutQuest Imp task was signaled"); - groundquests.sendSignal(self, gcw.GCW_IMP_FIND_PATROL_SIGNAL); - } - else - { - LOG("gcw_patrol_point","handleOpposingFactionScoutQuest NO FACTION"); - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_SCOUT_PID); - return SCRIPT_CONTINUE; - } - - trial.addNonInstanceFactionParticipant(self, patrolPoint); - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_SCOUT_PID); - return SCRIPT_CONTINUE; - } - - - public int handleOpposingFactionDestroyQuest(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - int playerPid = getIntObjVar(self, sui.COUNTDOWNTIMER_SUI_VAR); - if (pid != playerPid) - { - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - LOG("gcw_patrol_point","handleOpposingFactionDestroyQuest had BP_CANCEL"); - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - else if (bp == sui.BP_REVERT) - { - LOG("gcw_patrol_point","handleOpposingFactionDestroyQuest had BP_REVERT"); - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(self, gcw.SID_COUNTDOWN_LOCOMOTION); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(self, gcw.SID_INTERRUPTED_INCAPACITATED); - } - else if (event == sui.CD_EVENT_DAMAGED || event == sui.CD_EVENT_COMBAT) - { - sendSystemMessage(self, gcw.SID_INTERRUPTED_DAMAGED); - } - - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "spyPatrolPoint")) - { - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(self, gcw.GCW_SPY_PATROL_DESTROY_QUEST)) - { - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - LOG("gcw_patrol_point","handleOpposingFactionDestroyQuest passed validation"); - obj_id patrolPoint = utils.getObjIdScriptVar(self, "spyPatrolPoint"); - if (!isValidId(patrolPoint) || !exists(patrolPoint)) - { - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - if (!buff.hasBuff(self, gcw.BUFF_SPY_EXPLOSIVES)) - { - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - long counter = buff.getBuffStackCount(self, gcw.BUFF_SPY_EXPLOSIVES); - if (counter <= 0) - { - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - if (!buff.decrementBuffStack(self, gcw.BUFF_SPY_EXPLOSIVES)) - { - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - int currentHp = getHitpoints(patrolPoint); - int maxHp = getMaxHitpoints(patrolPoint); - - if (currentHp > 0) - { - if (maxHp > 0) - { - double dmg = maxHp * .2; - if (dmg < currentHp) - { - setHitpoints(patrolPoint, (currentHp - (int)dmg)); - playClientEffectLoc(patrolPoint, "clienteffect/combat_explosion_lair_large.cef", getLocation(patrolPoint), 0); - return SCRIPT_CONTINUE; - } - else - { - setHitpoints(patrolPoint, 0); - } - } - } - - if (factions.isRebelorRebelHelper(self)) - { - LOG("gcw_constrction","handleTraderRepairQuest Rebel task was signaled"); - groundquests.sendSignal(self, gcw.GCW_REB_DESTROY_PATROL_SIGNAL); - } - else if (factions.isImperialorImperialHelper(self)) - { - LOG("gcw_constrction","handleTraderRepairQuest Imp task was signaled"); - groundquests.sendSignal(self, gcw.GCW_IMP_DESTROY_PATROL_SIGNAL); - } - else - { - LOG("gcw_constrction","handleTraderRepairQuest NO FACTION"); - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - trial.addNonInstanceFactionParticipant(self, patrolPoint); - buff.removeBuff(self, gcw.BUFF_SPY_EXPLOSIVES); - groundquests.sendSignal(self, "hasDestroyedPatrolPoint"); - - utils.removeScriptVar(self, "spyPatrolPoint"); - sui.removePid(self, gcw.SPY_DESTROY_PID); - return SCRIPT_CONTINUE; - } - - - public boolean removeTraderRepairScriptVars(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - sui.removePid(player, gcw.TRADER_REPAIR_PID); - utils.removeScriptVar(player, gcw.OBJECT_TO_REPAIR); - utils.removeScriptVar(player, gcw.GCW_REPAIR_RESOURCE_COUNT); - utils.removeScriptVar(player, gcw.GCW_REPAIR_QUEST); - return true; - } - - - public int notifyPlayerOfGcwCityEventAnnouncement(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_announcement", "notifyPlayerOfGcwCityEventAnnouncement init"); - - if (params == null) - { - return SCRIPT_CONTINUE; - } - - if ((!params.containsKey("string_file") || !params.containsKey("planetName") || !params.containsKey("cityName"))) - { - return SCRIPT_CONTINUE; - } - - String stringFile = params.getString("string_file"); - if (stringFile == null || stringFile.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String imperialAnnouncement = ""; - if (params.containsKey("imperial_announcement")) - { - imperialAnnouncement = params.getString("imperial_announcement"); - if (imperialAnnouncement == null || imperialAnnouncement.length() <= 0) - { - return SCRIPT_CONTINUE; - } - } - - String rebelAnnouncement = ""; - if (params.containsKey("rebel_announcement")) - { - rebelAnnouncement = params.getString("rebel_announcement"); - if (rebelAnnouncement == null || rebelAnnouncement.length() <= 0) - { - return SCRIPT_CONTINUE; - } - } - - String neutralAnnouncement = ""; - if (params.containsKey("neutral_announcement")) - { - neutralAnnouncement = params.getString("neutral_announcement"); - if (neutralAnnouncement == null || neutralAnnouncement.length() <= 0) - { - return SCRIPT_CONTINUE; - } - } - String planetName = params.getString("planetName"); - if (planetName == null || planetName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityName = params.getString("cityName"); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String npc = "object/mobile/dressed_imperial_moff_m.iff"; - String sound = "sound/sys_comm_imperial.snd"; - prose_package pp = new prose_package(); - - if (factions.isImperial(self) && imperialAnnouncement.length() > 0) - { - LOG("gcw_announcement", "notifyPlayerOfGcwCityEventAnnouncement player is Imperial"); - prose.setStringId(pp, new string_id(stringFile, imperialAnnouncement + planetName +"_"+cityName)); - } - else if (factions.isRebel(self) && rebelAnnouncement.length() > 0) - { - LOG("gcw_announcement", "notifyPlayerOfGcwCityEventAnnouncement player is Rebel"); - npc = "object/mobile/dressed_rebel_high_general_human_male_01.iff"; - sound = "sound/sys_comm_rebel_male.snd"; - prose.setStringId(pp, new string_id(stringFile, rebelAnnouncement + planetName +"_"+cityName)); - } - else - { - LOG("gcw_announcement", "notifyPlayerOfGcwCityEventAnnouncement player is NEUTRAL"); - npc = "object/mobile/dressed_noble_human_male_01.iff"; - sound = "sound/sys_comm_rebel_male.snd"; - prose.setStringId(pp, new string_id(stringFile, neutralAnnouncement + planetName +"_"+cityName)); - } - - commPlayers(self, npc, sound, 12f, self, pp); - return SCRIPT_CONTINUE; - } - - - public int onGcwFactionalPresenceTableDictionaryResponse(obj_id self, dictionary params) throws InterruptedException - { - if (utils.hasScriptVar(self, "gcw.factionalPresenceTablePid")) - { - utils.removeScriptVar(self, "gcw.factionalPresenceTablePid"); - } - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/player/skill/player_teaching.java b/sku.0/sys.server/compiled/game/script/player/skill/player_teaching.java deleted file mode 100644 index 7bd16a8bd..000000000 --- a/sku.0/sys.server/compiled/game/script/player/skill/player_teaching.java +++ /dev/null @@ -1,419 +0,0 @@ -package script.player.skill; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.skill; -import script.library.sui; -import script.library.prose; -import script.library.group; -import script.library.utils; -import script.library.xp; - - -public class player_teaching extends script.base_script -{ - public player_teaching() - { - } - public static final String VAR_TEACHING = "teaching"; - public static final String VAR_VALID_SKILLS = "teaching.valid_skills"; - public static final String VAR_SKILL_TO_LEARN = "teaching.skill_to_learn"; - public static final String VAR_TEACHER = "teaching.teacher"; - public static final String VAR_STUDENT = "teaching.student"; - public static final String VAR_SKILL_COST = "teaching.experience"; - - public static final string_id SID_TEACH = new string_id("sui", "teach"); - public static final string_id SID_STUDENT_TOO_FAR = new string_id("teaching", "student_too_far"); - public static final string_id SID_STUDENT_TOO_FAR_TARGET = new string_id("teaching", "student_too_far_target"); - public static final string_id SID_STUDENT_HAS_OFFER_TO_LEARN = new string_id("teaching", "student_has_offer_to_learn"); - public static final string_id SID_OFFER_GIVEN = new string_id("teaching", "offer_given"); - public static final string_id SID_OFFER_REFUSED = new string_id("teaching", "offer_refused"); - public static final string_id SID_TEACHER_TOO_FAR = new string_id("teaching", "teacher_too_far"); - public static final string_id SID_TEACHER_TOO_FAR_TARGET = new string_id("teaching", "teacher_too_far_target"); - public static final string_id SID_TEACHER_SKILL_LEARNED = new string_id("teaching", "teacher_skill_learned"); - public static final string_id SID_STUDENT_SKILL_LEARNED = new string_id("teaching", "student_skill_learned"); - public static final string_id SID_EXPERIENCE_RECEIVED = new string_id("teaching", "experience_received"); - public static final string_id SID_LEARNING_FAILED = new string_id("teaching", "learning_failed"); - public static final string_id SID_TEACHING_FAILED = new string_id("teaching", "teaching_failed"); - public static final string_id SID_NO_TARGET = new string_id("teaching", "no_target"); - public static final string_id SID_NO_TEACH_SELF = new string_id("teaching", "no_teach_self"); - public static final string_id SID_STUDENT_DEAD = new string_id("teaching", "student_dead"); - public static final string_id SID_NO_SKILLS = new string_id("teaching", "no_skills"); - public static final string_id SID_NO_SKILLS_FOR_STUDENT = new string_id("teaching", "no_skills_for_student"); - public static final string_id SID_NOT_IN_SAME_GROUP = new string_id("teaching", "not_in_same_group"); - - public static final float TEACHING_RANGE = 10.0f; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int OnLogin(obj_id self) throws InterruptedException - { - - if (utils.hasScriptVar(self, VAR_TEACHING)) - { - utils.removeScriptVarTree(self, VAR_TEACHING); - } - - return SCRIPT_CONTINUE; - } - - - public int msgTeachSkillSelected(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_teaching::msgTeachSkillSelected -- "+ params); - - if (!utils.hasScriptVar(self, VAR_STUDENT)) - { - return SCRIPT_CONTINUE; - } - - obj_id student = utils.getObjIdScriptVar(self, VAR_STUDENT); - if (!isIdValid(student)) - { - return SCRIPT_CONTINUE; - } - - String[] valid_skills = utils.getStringBatchScriptVar(self, VAR_VALID_SKILLS); - if (valid_skills == null || valid_skills.length == 0) - { - return SCRIPT_CONTINUE; - } - - utils.removeScriptVarTree(self, VAR_TEACHING); - - String button = params.getString("buttonPressed"); - if (button.equals("Cancel")) - { - return SCRIPT_CONTINUE; - } - - if (!student.isLoaded()) - { - LOG("LOG_CHANNEL", self + " ->Your student must be nearby in order to teach."); - sendSystemMessage(self, SID_STUDENT_TOO_FAR); - return SCRIPT_CONTINUE; - } - - String student_name = getFirstName(student); - String teacher_name = getFirstName(self); - - location loc_student = getLocation(student); - location loc_teacher = getLocation(self); - - float distance = loc_student.distance(loc_teacher); - if (distance > TEACHING_RANGE) - { - LOG("LOG_CHANNEL", self + " ->You are too far away from "+ student_name + " to teach."); - prose_package pp = prose.getPackage(SID_STUDENT_TOO_FAR_TARGET, student); - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(student, VAR_TEACHING)) - { - LOG("LOG_CHANNEL", self + " ->"+ student_name + " already has an offer to learn."); - prose_package pp = prose.getPackage(SID_STUDENT_HAS_OFFER_TO_LEARN, student); - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - int row_selected = sui.getListboxSelectedRow(params); - if (row_selected == -1) - { - return SCRIPT_CONTINUE; - } - - String selected_skill = valid_skills[row_selected]; - - if (selected_skill == null) - { - LOG("LOG_CHANNEL", "player_teaching::msgTeachSkillSelected -- selected skill was null for "+ self); - return SCRIPT_CONTINUE; - } - - dictionary xp_cost = getSkillPrerequisiteExperience(selected_skill); - LOG("LOG_CHANNEL", "xp_cost ->"+ xp_cost); - StringBuffer sb = new StringBuffer(); - - java.util.Enumeration e = xp_cost.keys(); - while (e.hasMoreElements()) - { - testAbortScript(); - String xp_type = (String)(e.nextElement()); - if (xp_type.length() > 0) - { - int xp = xp_cost.getInt(xp_type); - - string_id xp_type_id = utils.unpackString("@exp_n:"+ xp_type); - String xp_type_string = localize(xp_type_id); - sb.append(xp + " "+ xp_type_string); - } - } - String skill_cost = sb.toString(); - if (skill_cost.length() < 1) - { - skill_cost = "0"; - } - - LOG("LOG_CHANNEL", self + " ->You offer to teach "+ student_name + " "+ selected_skill + "."); - string_id skill_id = utils.unpackString("@skl_n:"+ selected_skill); - LOG("LOG_CHANNEL", "skill_id ->"+ skill_id); - prose_package pp = prose.getPackage(SID_OFFER_GIVEN, self, student, skill_id, 0); - sendSystemMessageProse(self, pp); - - utils.setScriptVar(student, VAR_SKILL_TO_LEARN, selected_skill); - utils.setScriptVar(student, VAR_TEACHER, self); - utils.setScriptVar(student, VAR_SKILL_COST, skill_cost); - String selected_skill_string = localize(skill_id); - String prompt = teacher_name + " has offered to teach you "+ selected_skill_string + " ("+ skill_cost + " experience cost.)"; - - sui.msgbox(student, student, prompt, sui.YES_NO, "msgTeachSkillConfirmed"); - - return SCRIPT_CONTINUE; - } - - - public int msgTeachSkillConfirmed(obj_id self, dictionary params) throws InterruptedException - { - - LOG("LOG_CHANNEL", "player_teaching::msgTeachSkillConfirmed"); - - if (!utils.hasScriptVar(self, VAR_TEACHER)) - { - return SCRIPT_CONTINUE; - } - - obj_id teacher = utils.getObjIdScriptVar(self, VAR_TEACHER); - String selected_skill = utils.getStringScriptVar(self, VAR_SKILL_TO_LEARN); - String skill_cost = utils.getStringScriptVar(self, VAR_SKILL_COST); - - utils.removeScriptVarTree(self, VAR_TEACHING); - - String button = params.getString("buttonPressed"); - if (button.equals("Cancel")) - { - if (teacher.isLoaded()) - { - LOG("LOG_CHANNEL", teacher + " ->"+ getFirstName(self) + " has refused your offer to teach."); - prose_package pp = prose.getPackage(SID_OFFER_REFUSED, self); - sendSystemMessageProse(teacher, pp); - } - - return SCRIPT_CONTINUE; - } - - if (!isIdValid(teacher)) - { - LOG("LOG_CHANNEL", "player_teaching::msgTeachSkillConfirmed -- teacher was null for student "+ self); - return SCRIPT_CONTINUE; - } - - if (selected_skill == null) - { - LOG("LOG_CHANNEL", "player_teaching::msgTeachSkillConfirmed -- selected skill was null for "+ teacher + " teaching "+ self); - return SCRIPT_CONTINUE; - } - - if (!teacher.isLoaded()) - { - LOG("LOG_CHANNEL", self + " ->Your teacher must be nearby in order to learn."); - sendSystemMessage(self, SID_TEACHER_TOO_FAR); - return SCRIPT_CONTINUE; - } - - String student_name = getFirstName(self); - String teacher_name = getFirstName(teacher); - - location loc_student = getLocation(self); - location loc_teacher = getLocation(teacher); - - float distance = loc_student.distance(loc_teacher); - if (distance > TEACHING_RANGE) - { - LOG("LOG_CHANNEL", self + " ->You are too far away from "+ teacher_name + " to learn."); - prose_package pp = prose.getPackage(SID_TEACHER_TOO_FAR_TARGET, teacher); - sendSystemMessageProse(self, pp); - utils.removeScriptVarTree(self, VAR_TEACHING); - return SCRIPT_CONTINUE; - } - - if (skill.purchaseSkill(self, selected_skill)) - { - string_id skill_id = utils.unpackString("@skl_n:"+ selected_skill); - LOG("LOG_CHANNEL", "skill_id ->"+ skill_id); - LOG("LOG_CHANNEL", self + " ->You learn "+ selected_skill + " from "+ teacher_name + "."); - LOG("LOG_CHANNEL", teacher + " ->"+ student_name + " learns "+ selected_skill + " from you."); - prose_package pp = prose.getPackage(SID_STUDENT_SKILL_LEARNED, teacher, skill_id); - sendSystemMessageProse(self, pp); - pp = prose.getPackage(SID_TEACHER_SKILL_LEARNED, self, skill_id); - sendSystemMessageProse(teacher, pp); - - int exp = 0; - - if (isJedi(teacher) && isJedi(self) && skill_cost.equals("0") && selected_skill.startsWith("jedi_")) - { - exp = 40; - } - - if (exp > 0) - { - - } - } - else - { - LOG("LOG_CHANNEL", self + " -> Learning failed."); - LOG("LOG_CHANNEL", teacher + " -> Teaching failed."); - sendSystemMessage(self, SID_LEARNING_FAILED); - sendSystemMessage(teacher, SID_TEACHING_FAILED); - } - - return SCRIPT_CONTINUE; - } - - - public int teach(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - LOG("LOG_CHANNEL", "player_teaching::teach"); - - if (utils.hasScriptVar(self, VAR_STUDENT)) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(target)) - { - target = getLookAtTarget(self); - if (!isIdValid(target)) - { - LOG("LOG_CHANNEL", self + " ->Whom do you want to teach?"); - sendSystemMessage(self, SID_NO_TARGET); - return SCRIPT_CONTINUE; - } - } - - if (target == self) - { - LOG("LOG_CHANNEL", self + " ->You cannot teach yourself."); - sendSystemMessage(self, SID_NO_TEACH_SELF); - return SCRIPT_CONTINUE; - } - - if (isDead(target) || isIncapacitated(target)) - { - LOG("LOG_CHANNEL", self + " ->"+ getFirstName(target) + " does not feel like being taught right now."); - prose_package pp = prose.getPackage(SID_STUDENT_DEAD, target); - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - LOG("LOG_CHANNEL", "target ->"+ target); - - String teacher_name = getFirstName(self); - String target_name = getFirstName(target); - - location loc_teacher = getLocation(self); - location loc_student = getLocation(target); - float distance = loc_teacher.distance(loc_student); - - if (distance > TEACHING_RANGE) - { - LOG("LOG_CHANNEL", self + " ->You must be closer in order to teach."); - sendSystemMessage(self, SID_STUDENT_TOO_FAR); - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(target, VAR_TEACHING)) - { - LOG("LOG_CHANNEL", self + " ->"+ target_name + " already has an offer to learn."); - prose_package pp = prose.getPackage(SID_STUDENT_HAS_OFFER_TO_LEARN, target); - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - String[] teacher_skills = getSkillListingForPlayer(self); - if (teacher_skills == null) - { - LOG("LOG_CHANNEL", self + " ->You have no skills to teach."); - sendSystemMessage(self, SID_NO_SKILLS); - return SCRIPT_CONTINUE; - } - - String[] qual_skills = skill.getQualifiedTeachableSkills(target, self); - - if (qual_skills == null) - { - LOG("LOG_CHANNEL", self + " -> You have no skills that "+ target_name + " can currently learn."); - prose_package pp = prose.getPackage(SID_NO_SKILLS_FOR_STUDENT, target); - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - Vector valid_skills = new Vector(); - valid_skills.setSize(0); - for (int i = 0; i < qual_skills.length; i++) - { - testAbortScript(); - int idx = utils.getElementPositionInArray(teacher_skills, qual_skills[i]); - if (idx != -1) - { - - if ((qual_skills[i].indexOf("novice")) == -1 && (qual_skills[i].indexOf("force_sensitive")) == -1) - { - valid_skills = utils.addElement(valid_skills, qual_skills[i]); - } - } - } - - if (valid_skills.size() < 1) - { - LOG("LOG_CHANNEL", self + " -> You have no skills that "+ target_name + " can currently learn."); - prose_package pp = prose.getPackage(SID_NO_SKILLS_FOR_STUDENT, target); - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - if (!group.inSameGroup(self, target)) - { - LOG("LOG_CHANNEL", self + " ->You must be within the same group as "+ target_name + " in order to teach."); - prose_package pp = prose.getPackage(SID_NOT_IN_SAME_GROUP, target); - sendSystemMessageProse(self, pp); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, VAR_STUDENT, target); - utils.setBatchScriptVar(self, VAR_VALID_SKILLS, valid_skills); - - String[] valid_skills_id = new String[valid_skills.size()]; - for (int i = 0; i < valid_skills.size(); i++) - { - testAbortScript(); - valid_skills_id[i] = "@skl_n:" + ((String)(valid_skills.get(i))); - } - - sui.listbox(self, self, "Select a skill to teach.", sui.OK_CANCEL, "Select Skill", valid_skills_id, "msgTeachSkillSelected"); - - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/quest/force_sensitive/fs_buff_item.java b/sku.0/sys.server/compiled/game/script/quest/force_sensitive/fs_buff_item.java deleted file mode 100644 index cf8123194..000000000 --- a/sku.0/sys.server/compiled/game/script/quest/force_sensitive/fs_buff_item.java +++ /dev/null @@ -1,314 +0,0 @@ -package script.quest.force_sensitive; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.player_structure; -import script.library.static_item; - - -public class fs_buff_item extends script.base_script -{ - public fs_buff_item() - { - } - public static final String STRING_TABLE_NAME = "quest/force_sensitive/utils"; - - public static final String VAR_TIMESTAMP = "item.time.timestamp"; - public static final String VAR_REUSE_TIME = "item.time.reuse_time"; - - public static final String VAR_BUFF_TYPE = "item.buff.type"; - public static final String VAR_BUFF_VALUE = "item.buff.value"; - public static final String VAR_BUFF_DURATION = "item.buff.duration"; - - public static final String[] BUFF_STRING_NAMES = - { - "health", - "strength", - "constitution", - "action", - "quickness", - "stamina", - "mind", - "focus", - "willpower" - }; - - public static final int DEFAULT_REUSE_TIME = 60*60*24*3; - - public static final int BUFF_TYPE = 0; - public static final int BUFF_VALUE = 1000; - public static final int BUFF_DURATION = 60*60; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - if (hasObjVar(self, "item.buff.type")) - { - int buffType = getIntObjVar(self, "item.buff.type"); - if (buffType == 6) - { - obj_id home = getContainedBy(self); - if (!isIdValid(home)) - { - CustomerServiceLog("FSMindCrystal: ", "Old Crystal ("+ self + ")"+ " was not deleted, because its container's id was null"); - return SCRIPT_CONTINUE; - } - - obj_id newCrystal = static_item.createNewItemFunction("item_force_crystal_04_02", home); - - if (isIdValid(newCrystal)) - { - CustomerServiceLog("FSMindCrystal: ", "Old Crystal ("+ self + ")"+ " is contained in player's "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - CustomerServiceLog("FSMindCrystal: ", "Old Crystal ("+ self + ")"+ " is to be destroyed and replaced with new Crystal "+ getStaticItemName(newCrystal) + "("+ newCrystal+ ") in "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - destroyObject(self); - CustomerServiceLog("FSMindCrystal: ", "Old Crystal was successfully destroyed "+ !exists(self) + "and replaced with "+ getStaticItemName(newCrystal) + "("+ newCrystal+ ") in "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - } - } - else if (buffType == 0) - { - obj_id home = getContainedBy(self); - if (!isIdValid(home)) - { - CustomerServiceLog("FSMindCrystal: ", "Old FS VILLAGE Focused Crystal ("+ self + ")"+ " was not deleted, because its container's id was null"); - return SCRIPT_CONTINUE; - } - - obj_id newCrystal = static_item.createNewItemFunction("item_force_crystal_04_01", home); - - if (isIdValid(newCrystal)) - { - CustomerServiceLog("FSMindCrystal: ", "Old FS VILLAGE Focused Crystal ("+ self + ")"+ " is contained in player's "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - CustomerServiceLog("FSMindCrystal: ", "Old FS VILLAGE Focused Crystal ("+ self + ")"+ " is to be destroyed and replaced with new Crystal "+ getStaticItemName(newCrystal) + "("+ newCrystal+ ") in "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - destroyObject(self); - CustomerServiceLog("FSMindCrystal: ", "Old FS VILLAGE Focused Crystal was successfully destroyed "+ !exists(self) + "and replaced with "+ getStaticItemName(newCrystal) + "("+ newCrystal+ ") in "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - if (hasObjVar(self, "item.buff.type")) - { - int buffType = getIntObjVar(self, "item.buff.type"); - if (buffType == 6) - { - obj_id home = getContainedBy(self); - if (!isIdValid(home)) - { - CustomerServiceLog("FSMindCrystal: ", "Old Crystal ("+ self + ")"+ " was not deleted, because its container's id was null"); - return SCRIPT_CONTINUE; - } - - obj_id newCrystal = static_item.createNewItemFunction("item_force_crystal_04_02", home); - - if (isIdValid(newCrystal)) - { - CustomerServiceLog("FSMindCrystal: ", "Old Crystal ("+ self + ")"+ " is contained in player's "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - CustomerServiceLog("FSMindCrystal: ", "Old Crystal ("+ self + ")"+ " is to be destroyed and replaced with new Crystal "+ getStaticItemName(newCrystal) + "("+ newCrystal+ ") in "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - destroyObject(self); - CustomerServiceLog("FSMindCrystal: ", "Old Crystal was successfully destroyed "+ !exists(self) + "and replaced with "+ getStaticItemName(newCrystal) + "("+ newCrystal+ ") in "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - } - } - else if (buffType == 0) - { - obj_id home = getContainedBy(self); - if (!isIdValid(home)) - { - CustomerServiceLog("FSMindCrystal: ", "Old FS VILLAGE Focused Crystal ("+ self + ")"+ " was not deleted, because its container's id was null"); - return SCRIPT_CONTINUE; - } - - obj_id newCrystal = static_item.createNewItemFunction("item_force_crystal_04_01", home); - - if (isIdValid(newCrystal)) - { - CustomerServiceLog("FSMindCrystal: ", "Old FS VILLAGE Focused Crystal ("+ self + ")"+ " is contained in player's "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - CustomerServiceLog("FSMindCrystal: ", "Old FS VILLAGE Focused Crystal ("+ self + ")"+ " is to be destroyed and replaced with new Crystal "+ getStaticItemName(newCrystal) + "("+ newCrystal+ ") in "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - destroyObject(self); - CustomerServiceLog("FSMindCrystal: ", "Old FS VILLAGE Focused Crystal was successfully destroyed "+ !exists(self) + "and replaced with "+ getStaticItemName(newCrystal) + "("+ newCrystal+ ") in "+ getFirstName(utils.getContainingPlayer(self)) + "("+ utils.getContainingPlayer(self) + ") inventory."); - } - } - } - - mi.addRootMenu(menu_info_types.SERVER_MENU1, new string_id(STRING_TABLE_NAME, "use_special_effect")); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - - if (!hasObjVar (self, VAR_TIMESTAMP)) - { - setObjVar(self, VAR_TIMESTAMP, getGameTime()); - } - else - { - int timestamp = getIntObjVar(self,VAR_TIMESTAMP); - int current_time = getGameTime(); - int time_delta = current_time - timestamp; - if (!hasObjVar (self, VAR_REUSE_TIME)) - { - setObjVar(self, VAR_REUSE_TIME, DEFAULT_REUSE_TIME); - } - - int reuse_time = getIntObjVar(self, VAR_REUSE_TIME); - if (time_delta < reuse_time) - { - sendSystemMessage(player, new string_id(STRING_TABLE_NAME, "timer_not_up")); - return SCRIPT_CONTINUE; - } - } - - if (item == menu_info_types.SERVER_MENU1) - { - setObjVar(self, VAR_TIMESTAMP, getGameTime()); - - applyBuff (player,self); - - } - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "reuse_time"; - int timestamp = -1; - if (hasObjVar(self,VAR_TIMESTAMP)) - { - timestamp = getIntObjVar(self,VAR_TIMESTAMP); - } - int current_time = getGameTime(); - int time_delta = current_time - timestamp; - if (!hasObjVar (self, VAR_REUSE_TIME)) - { - setObjVar(self, VAR_REUSE_TIME, DEFAULT_REUSE_TIME); - } - int reuse_time = getIntObjVar(self, VAR_REUSE_TIME); - int time_remaining = reuse_time - time_delta; - - if (timestamp == -1 || time_remaining <= 0) - { - attribs[idx] = "0"; - } - else - { - attribs[idx] = player_structure.assembleTimeRemaining(player_structure.convertSecondsTime(time_remaining)); - } - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (hasObjVar(self, VAR_BUFF_TYPE)) - { - names[idx] = "examine_dot_attribute"; - attribs[idx] = BUFF_STRING_NAMES[getIntObjVar(self, VAR_BUFF_TYPE)]; - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - if (hasObjVar(self, VAR_BUFF_VALUE)) - { - names[idx] = "potency"; - attribs[idx] = "+"+getIntObjVar(self, VAR_BUFF_VALUE); - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - if (hasObjVar(self, VAR_BUFF_DURATION)) - { - names[idx] = "duration"; - attribs[idx] = player_structure.assembleTimeRemaining(player_structure.convertSecondsTime(getIntObjVar(self, VAR_BUFF_DURATION))); - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public void applyBuff(obj_id player, obj_id item) throws InterruptedException - { - int buff_type = BUFF_TYPE; - if (hasObjVar(item, VAR_BUFF_TYPE)) - { - buff_type = getIntObjVar(item, VAR_BUFF_TYPE); - } - - int buff_value = BUFF_VALUE; - if (hasObjVar(item, VAR_BUFF_VALUE)) - { - buff_value = getIntObjVar(item, VAR_BUFF_VALUE); - } - - int buff_duration = BUFF_DURATION; - if (hasObjVar(item, VAR_BUFF_DURATION)) - { - buff_duration = getIntObjVar(item, VAR_BUFF_DURATION); - } - - boolean wasBuffApplied = false; - String buff_class = "medical_enhance_"; - String buff_type_name = BUFF_STRING_NAMES[buff_type]; - if (buff_type == 6) - { - buff_class = "performance_enhance_dance_"; - } - if (buff_type == 7) - { - buff_class = "performance_enhance_music_"; - } - if (buff_type == 8) - { - buff_class = "performance_enhance_music_"; - } - - if (wasBuffApplied = !hasAttribModifier(player, buff_class + buff_type_name)) - { - addAttribModifier(player, buff_class + buff_type_name , buff_type, buff_value, buff_duration, 0.0f, 10.0f, true, false, true); - } - - if (wasBuffApplied) - { - sendSystemMessage(player, new string_id(STRING_TABLE_NAME, "buff_applied")); - } - else - { - sendSystemMessage(player, new string_id(STRING_TABLE_NAME, "have_buff")); - removeObjVar (item, VAR_TIMESTAMP); - } - } -} diff --git a/sku.0/sys.server/compiled/game/script/quest/hero_of_tatooine/intellect_spawn_control.java b/sku.0/sys.server/compiled/game/script/quest/hero_of_tatooine/intellect_spawn_control.java deleted file mode 100644 index fb4f5ed55..000000000 --- a/sku.0/sys.server/compiled/game/script/quest/hero_of_tatooine/intellect_spawn_control.java +++ /dev/null @@ -1,391 +0,0 @@ -package script.quest.hero_of_tatooine; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; - - -public class intellect_spawn_control extends script.base_script -{ - public intellect_spawn_control() - { - } - public static final String SPAWNER_DATATABLE = "datatables/quest/hero_of_tatooine/intellect_spawner.iff"; - public static final String SPAWNER_OBJVAR = "quest.hero_of_tatooine.intellect.spawner"; - public static final String SPAWNER_IDS = SPAWNER_OBJVAR + ".ids"; - public static final String SPAWNER_STATUS = SPAWNER_OBJVAR + ".status"; - public static final String SPAWNER_SPAWN_MODE = SPAWNER_OBJVAR + ".spawning"; - - public static final float VALIDATION_CHECK_TIME = 180.0f; - public static final float SPAWN_TIME = 1800.0f; - public static final float REVALIDATE_TIME = 10800.0f; - public static final float SPAWN_CHECK_TIME = SPAWN_TIME + VALIDATION_CHECK_TIME; - - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, SPAWNER_OBJVAR)) - { - setupSpawnerObjVars(self); - } - - messageTo(self, "handleForcedValidation", null, 600.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - if (!hasObjVar(self, SPAWNER_OBJVAR)) - { - setupSpawnerObjVars(self); - } - - CustomerServiceLog("quest", "HERO OF TATOOINE - Initializing Mark of Intellect spawn control"); - - messageTo(self, "handleForcedValidation", null, 600.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException - { - - if (!isGod(speaker)) - { - return SCRIPT_CONTINUE; - } - - if (toLower(text).equals("force_intellect_spawn")) - { - - sendSystemMessageTestingOnly(speaker, "Beginning spawn sequence. It could take a few minutes..."); - startSpawnSequence(self, 0.0f, true); - - } - else if (toLower(text).equals("find_intellect_spawn")) - { - - sendSystemMessageTestingOnly(speaker, "Requesting spawn location information..."); - findSpawned(self, speaker); - } - - return SCRIPT_CONTINUE; - } - - - public int handleValidation(obj_id self, dictionary params) throws InterruptedException - { - - int spawn = params.getInt("spawn"); - int number = params.getInt("number"); - - int[] status = getIntArrayObjVar(self, SPAWNER_STATUS); - - if (status == null || status.length == 0) - { - return SCRIPT_CONTINUE; - } - - if (number >= status.length) - { - return SCRIPT_CONTINUE; - } - - if (status[number] != spawn) - { - - status[number] = spawn; - setObjVar(self, SPAWNER_STATUS, status); - } - - return SCRIPT_CONTINUE; - } - - - public int handleSingleValidationCheck(obj_id self, dictionary params) throws InterruptedException - { - - if (countActiveSpawns(self) == 0) - { - validateAllSpawners(self); - } - - return SCRIPT_CONTINUE; - } - - - public int handleAllValidationCheck(obj_id self, dictionary params) throws InterruptedException - { - - if (countActiveSpawns(self) == 0) - { - startSpawnSequence(self, SPAWN_TIME); - } - - return SCRIPT_CONTINUE; - } - - - public int handleSpawnValidation(obj_id self, dictionary params) throws InterruptedException - { - - float time = params.getFloat("time"); - - if (hasObjVar(self, SPAWNER_SPAWN_MODE)) - { - removeObjVar(self, SPAWNER_SPAWN_MODE); - } - - if (countActiveSpawns(self) == 0) - { - startSpawnSequence(self, time); - } - - return SCRIPT_CONTINUE; - } - - - public int handleCompletion(obj_id self, dictionary params) throws InterruptedException - { - - int number = params.getInt("number"); - - int[] status = getIntArrayObjVar(self, SPAWNER_STATUS); - - if (status == null || status.length == 0) - { - - CustomerServiceLog("quest", "HERO OF TATOOINE - Intellect spawn control failing; Spawner status not available"); - return SCRIPT_CONTINUE; - } - - status[number] = 0; - - setObjVar(self, SPAWNER_STATUS, status); - - validateSpawners(self); - - return SCRIPT_CONTINUE; - } - - - public int handleLocationResponse(obj_id self, dictionary params) throws InterruptedException - { - - obj_id seeker = params.getObjId("seeker"); - location loc = params.getLocation("loc"); - - sendSystemMessageTestingOnly(seeker, "Intellect Spawn: "+ loc.toString()); - - return SCRIPT_CONTINUE; - } - - - public int handleForcedValidation(obj_id self, dictionary params) throws InterruptedException - { - - CustomerServiceLog("quest", "HERO OF TATOOINE - Forcing Mark of Intellect validation"); - - validateAllSpawners(self); - - messageTo(self, "handleForcedValidation", null, REVALIDATE_TIME, false); - - return SCRIPT_CONTINUE; - } - - - public void setupSpawnerObjVars(obj_id self) throws InterruptedException - { - - int numRows = dataTableGetNumRows(SPAWNER_DATATABLE); - obj_id[] ids = new obj_id[numRows]; - int[] status = new int[numRows]; - - for (int i = 0; i < numRows; i++) - { - testAbortScript(); - String strObjId = dataTableGetString(SPAWNER_DATATABLE, i, 0); - obj_id spawner = utils.stringToObjId(strObjId); - - ids[i] = spawner; - status[i] = 0; - } - - if (ids != null && ids.length > 0 && status != null && status.length > 0) - { - setObjVar(self, SPAWNER_IDS, ids); - setObjVar(self, SPAWNER_STATUS, status); - } - } - - - public void validateSpawners(obj_id self) throws InterruptedException - { - - if (countActiveSpawns(self) == 0) - { - - validateAllSpawners(self); - return; - } - - obj_id[] ids = getObjIdArrayObjVar(self, SPAWNER_IDS); - int[] status = getIntArrayObjVar(self, SPAWNER_STATUS); - - dictionary d = new dictionary(); - d.put("controller", self); - - for (int i = 0; i < ids.length; i++) - { - testAbortScript(); - - if (status[i] == 1) - { - - d.put("number", i); - messageTo(ids[i], "handleValidate", d, 1.0f, true); - } - } - - messageTo(self, "handleSingleValidationCheck", null, VALIDATION_CHECK_TIME, true); - } - - - public void validateAllSpawners(obj_id self) throws InterruptedException - { - - obj_id[] ids = getObjIdArrayObjVar(self, SPAWNER_IDS); - int[] status = getIntArrayObjVar(self, SPAWNER_STATUS); - - dictionary d = new dictionary(); - d.put("controller", self); - - for (int i = 0; i < ids.length; i++) - { - testAbortScript(); - - d.put("number", i); - messageTo(ids[i], "handleValidate", d, 1.0f, true); - } - - messageTo(self, "handleAllValidationCheck", null, VALIDATION_CHECK_TIME, true); - } - - - public void startSpawnSequence(obj_id self, float time, boolean override) throws InterruptedException - { - - if (hasObjVar(self, SPAWNER_SPAWN_MODE) && !override) - { - - int spawn_time = getIntObjVar(self, SPAWNER_SPAWN_MODE); - int game_time = getGameTime(); - int difference_time = (game_time - spawn_time); - - if (difference_time >= 0 && difference_time < 10800) - { - CustomerServiceLog("quest", "HERO OF TATOOINE - Intellect spawn control failing; Trying to spawn while currently in spawn mode. Spawn Time: "+spawn_time+" Game Time: "+game_time+". Difference: "+difference_time); - return; - } - else - { - CustomerServiceLog("quest", "HERO OF TATOOINE - Intellect autospawner attempting to spawn. Possibly for the first time. Spawn Time: "+spawn_time+" Game Time: "+game_time+". Difference: "+difference_time); - } - } - - obj_id[] ids = getObjIdArrayObjVar(self, SPAWNER_IDS); - if (ids == null) - { - CustomerServiceLog("quest", "HERO OF TATOOINE - Intellect autospawner cannot find a list of spawner IDs. FAILING."); - return; - } - - int randSpawn = rand(0, (ids.length - 1)); - - dictionary d = new dictionary(); - d.put("controller", self); - d.put("number", randSpawn); - d.put("time", time); - - setObjVar(self, SPAWNER_SPAWN_MODE, getGameTime()); - - float check_time = time + VALIDATION_CHECK_TIME; - - CustomerServiceLog("quest", "HERO OF TATOOINE - Starting Mark of Intellect spawn sequence"); - - messageTo(ids[randSpawn], "handleSpawn", d, time, true); - messageTo(self, "handleSpawnValidation", d, check_time, true); - } - - - public void startSpawnSequence(obj_id self, float time) throws InterruptedException - { - - startSpawnSequence(self, time, false); - } - - - public void findSpawned(obj_id self, obj_id speaker) throws InterruptedException - { - - obj_id[] ids = getObjIdArrayObjVar(self, SPAWNER_IDS); - int[] status = getIntArrayObjVar(self, SPAWNER_STATUS); - - dictionary d = new dictionary(); - d.put("seeker", speaker); - d.put("controller", self); - - boolean found = false; - - for (int i = 0; i < status.length; i++) - { - testAbortScript(); - if (status[i] == 1) - { - messageTo(ids[i], "handleLocationRequest", d, 1.0f, true); - found = true; - } - } - - if (!found) - { - sendSystemMessageTestingOnly(speaker, "No active spawns found"); - } - } - - - public int countActiveSpawns(obj_id self) throws InterruptedException - { - - int[] status = getIntArrayObjVar(self, SPAWNER_STATUS); - - if (status == null || status.length == 0) - { - return -1; - } - - int count = 0; - - for (int i = 0; i < status.length; i++) - { - testAbortScript(); - - if (status[i] == 1) - { - count++; - } - } - - return count; - } -} diff --git a/sku.0/sys.server/compiled/game/script/quest/task/craft.java b/sku.0/sys.server/compiled/game/script/quest/task/craft.java deleted file mode 100644 index e12f270d2..000000000 --- a/sku.0/sys.server/compiled/game/script/quest/task/craft.java +++ /dev/null @@ -1,150 +0,0 @@ -package script.quest.task; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.quests; -import script.library.utils; - - -public class craft extends script.base_script -{ - public craft() - { - } - - public int OnQuestActivated(obj_id self, int questRow) throws InterruptedException - { - - LOG("newquests", "OnQUestActivated("+ quests.getDataEntry(questRow, "NAME")); - - String questName = quests.getDataEntry(questRow, "NAME"); - String craftedObjectTemplateName = null; - String objvarname = "quest."+ questName + ".target"; - if (hasObjVar(self, objvarname)) - { - craftedObjectTemplateName = getStringObjVar(self, objvarname); - } - else - { - craftedObjectTemplateName = quests.getDataEntry(questRow, "TARGET"); - } - - int craftedObjectCount = 1; - objvarname = "quest."+ questName + ".parameter"; - if (hasObjVar(self, objvarname)) - { - craftedObjectCount = getIntObjVar(self, objvarname); - } - else - { - String countString = quests.getDataEntry(questRow, "PARAMETER"); - craftedObjectCount = utils.stringToInt(countString); - if (craftedObjectCount < 1) - { - craftedObjectCount = 1; - } - } - - if (craftedObjectTemplateName != null && craftedObjectTemplateName.length() > 0) - { - int objectTemplateCrc = getObjectTemplateCrc(craftedObjectTemplateName); - objvarname = "quest."+ questName + ".count"; - setObjVar(self, objvarname, craftedObjectCount); - - objvarname = "quest."+ questName + ".current_count"; - int currentCount = 0; - setObjVar(self, objvarname, currentCount); - - objvarname = "quest."+ questName + ".objectTemplateCrc"; - setObjVar(self, objvarname, objectTemplateCrc); - } - else - { - LOG("newquests", "craft - OnQuestActivated() - could not determine object to craft"); - } - return SCRIPT_CONTINUE; - } - - - public int OnCraftedPrototype(obj_id self, obj_id prototypeObject, draft_schematic manufacturingSchematic) throws InterruptedException - { - LOG("newquests", "OnCraftedPrototype("+ prototypeObject + ", "+ manufacturingSchematic + ")"); - LOG("newquests", "OnCraftedPrototype() player has crafted a "+ getTemplateName(prototypeObject)); - - sendSystemMessageTestingOnly(player, "Crafted!!!!!!!!!!!!!!!!!!!"); - - LOG("crafting_counter", "testing messageto logging!"); - dictionary params = new dictionary(); - params.put("tempParam", player); - messageTo(player, "receiveCollectionCreditForCrafting", params, 0.0f, false); - - String[] activeTasks = quests.getActiveQuestsWithScript("quest.task.craft", self); - if (activeTasks != null && activeTasks.length > 0) - { - int iter = 0; - int prototypeObjectTemplateCrc = getObjectTemplateCrc(getTemplateName(prototypeObject)); - for (iter = 0; iter < activeTasks.length; ++iter) - { - testAbortScript(); - String objvarname = "quest."+ activeTasks[iter] + ".objectTemplateCrc"; - if (hasObjVar(self, objvarname)) - { - int objectTemplateCrc = getIntObjVar(self, objvarname); - if (objectTemplateCrc == prototypeObjectTemplateCrc) - { - - int count = 1; - objvarname = "quest."+ activeTasks[iter] + ".count"; - if (hasObjVar(self, objvarname)) - { - count = getIntObjVar(self, objvarname); - if (count < 1) - { - count = 1; - } - } - int currentCount = 0; - objvarname = "quest."+ activeTasks[iter] + ".current_count"; - if (hasObjVar(self, objvarname)) - { - currentCount = getIntObjVar(self, objvarname); - } - - currentCount++; - setObjVar(self, objvarname, currentCount); - - if (currentCount >= count) - { - quests.complete(activeTasks[iter], self, true); - break; - } - else - { - LOG("newquests", "cract - OnCraftedPrototype - the quest requires "+ count + " objects to be crafted. The player has crafted "+ currentCount + " objects"); - } - } - else - { - LOG("newquests", "craft - OnCraftedPrototype - the crafted object template crc ("+ prototypeObjectTemplateCrc + " does not match the required crafted object template crc "+ objectTemplateCrc); - } - } - else - { - LOG("newquests", "craft - OnCraftedPrototype - could not determine what object needs to be crafted, "+ objvarname + " was not found"); - } - } - } - else - { - LOG("newquests", "craft - OnCraftedPrototype - no active tasks for quest.task.craft"); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/quest/task/ground/defend.java b/sku.0/sys.server/compiled/game/script/quest/task/ground/defend.java deleted file mode 100644 index 1b56a36ed..000000000 --- a/sku.0/sys.server/compiled/game/script/quest/task/ground/defend.java +++ /dev/null @@ -1,403 +0,0 @@ -package script.quest.task.ground; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.ai.ai_combat; -import script.library.ai_lib; -import script.library.quests; -import script.library.create; -import script.library.groundquests; -import script.library.locations; -import script.library.prose; -import script.library.utils; - - - -public class defend extends script.quest.task.ground.base_task -{ - public defend() - { - } - public static final String OBJVAR_DEFENSE_TARGET = "defend_target"; - public static final String DEFEND_TARGET = "defendTarget"; - public static final String QUEST_CRC = "questCrc"; - public static final String TASK_ID = "taskId"; - public static final String PLAYER = "player"; - public static final String OBJVAR_BEEN_WARNED_DISTANCE = "beenWarned"; - public static final String TASK_TYPE = "defend"; - public static final String DOT = "."; - - public static final float DEFEND_DISTANCE_TIME_CHECK = 10; - public static final float MAX_ALLOWED_DISTANCE = 40; - public static final float CLEANUP_TIME = 120; - - public static final boolean LOGGING_ON = false; - public static final String LOG_CAT = "defense_ground_task"; - - - public int OnTaskActivated(obj_id self, int questCrc, int taskId) throws InterruptedException - { - blog("OnTaskActivated init"); - groundquests.questOutputDebugInfo(self, questCrc, taskId, TASK_TYPE, "OnTaskActivated", TASK_TYPE + " task activated."); - String baseObjVar = groundquests.setBaseObjVar(self, TASK_TYPE, questGetQuestName(questCrc), taskId); - blog("baseObjVar: "+baseObjVar); - - if (!hasObjVar(self, OBJVAR_DEFENSE_TARGET)) - { - return super.OnTaskActivated(self, questCrc, taskId); - } - blog("has var"); - - obj_id defendTarget = getObjIdObjVar(self, OBJVAR_DEFENSE_TARGET); - if (!isValidId(defendTarget) || !exists(defendTarget)) - { - - questFailTask(questCrc, taskId, self); - } - - blog("defendTarget: "+defendTarget); - groundquests.addDestroyNotification(defendTarget, self); - setObjVar(self, baseObjVar + DOT + OBJVAR_DEFENSE_TARGET, defendTarget); - removeObjVar(self, OBJVAR_DEFENSE_TARGET); - - dictionary distanceCheckParams = new dictionary(); - distanceCheckParams.put(PLAYER, self); - distanceCheckParams.put(DEFEND_TARGET, defendTarget); - distanceCheckParams.put(QUEST_CRC, questCrc); - distanceCheckParams.put(TASK_ID, taskId); - messageTo(self, "messageDefendCheckDistance", distanceCheckParams, DEFEND_DISTANCE_TIME_CHECK, false); - return super.OnTaskActivated(self, questCrc, taskId); - } - - - public int destroyNotification(obj_id self, dictionary params) throws InterruptedException - { - blog("destroyNotification init"); - - if (params == null) - { - blog("destroyNotification params null"); - - return SCRIPT_CONTINUE; - } - - if (!params.containsKey("source")) - { - blog("destroyNotification params source NULL"); - - return SCRIPT_CONTINUE; - } - - obj_id source = params.getObjId("source"); - - String taskObjVarName = groundquests.getTaskTypeObjVar(self, TASK_TYPE); - if (taskObjVarName == null || taskObjVarName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - blog("destroyNotification taskObjVarName: "+taskObjVarName); - - obj_var_list questList = getObjVarList(self, taskObjVarName); - if (questList == null) - { - return SCRIPT_CONTINUE; - } - blog("destroyNotification questList: "+questList); - - int countQuests = questList.getNumItems(); - blog("destroyNotification countQuests: "+countQuests); - - for (int i = 0; i < countQuests; ++i) - { - testAbortScript(); - obj_var ov = questList.getObjVar(i); - String questName = ov.getName(); - int questCrc = questGetQuestId(questName); - - String questObjVarName = taskObjVarName + DOT + questName; - if (hasObjVar(self, questObjVarName)) - { - - obj_var_list taskList = getObjVarList(self, questObjVarName); - if (taskList != null) - { - int countTasks = taskList.getNumItems(); - for (int j = 0; j < countTasks; ++j) - { - testAbortScript(); - obj_var ov2 = taskList.getObjVar(j); - String taskName = ov2.getName(); - int taskId = utils.stringToInt(taskName); - - String escortTargetObjVarName = questObjVarName + DOT + taskName + DOT + OBJVAR_DEFENSE_TARGET; - blog("destroyNotification escortTargetObjVarName: "+escortTargetObjVarName); - - if (hasObjVar(self, escortTargetObjVarName)) - { - obj_id escortTarget = getObjIdObjVar(self, escortTargetObjVarName); - if (source == escortTarget) - { - questFailTask(questCrc, taskId, self); - } - else if (!exists(source) && !exists(escortTarget)) - { - questFailTask(questCrc, taskId, self); - } - } - } - } - } - } - return SCRIPT_CONTINUE; - } - - - public int messageDefendCheckDistance(obj_id self, dictionary params) throws InterruptedException - { - blog("messageDefendCheckDistance init"); - if (params == null) - { - return SCRIPT_CONTINUE; - } - if (!params.containsKey(PLAYER)) - { - return SCRIPT_CONTINUE; - } - if (!params.containsKey(DEFEND_TARGET)) - { - return SCRIPT_CONTINUE; - } - if (!params.containsKey(QUEST_CRC)) - { - return SCRIPT_CONTINUE; - } - if (!params.containsKey(TASK_ID)) - { - return SCRIPT_CONTINUE; - } - - blog("messageDefendCheckDistance contains all keys needed"); - obj_id player = params.getObjId(PLAYER); - obj_id defendTarget = params.getObjId(DEFEND_TARGET); - int questCrc = params.getInt (QUEST_CRC); - int taskId = params.getInt (TASK_ID); - - if (questIsTaskActive(questCrc, taskId, player)) - { - blog("messageDefendCheckDistance questIsTaskActive == true"); - String baseObjVar = groundquests.getBaseObjVar(player, TASK_TYPE, questGetQuestName(questCrc), taskId); - blog("messageDefendCheckDistance baseObjVar: "+baseObjVar); - if (isDefenseObjectNearby(questCrc, taskId, player, defendTarget)) - { - blog("messageDefendCheckDistance isDefenseObjectNearby == true"); - - if (hasObjVar(player, baseObjVar + OBJVAR_BEEN_WARNED_DISTANCE)) - { - removeObjVar(player, baseObjVar + OBJVAR_BEEN_WARNED_DISTANCE); - } - } - else - { - blog("messageDefendCheckDistance isDefenseObjectNearby == FALSE"); - - if (hasObjVar(self, baseObjVar + DOT + OBJVAR_DEFENSE_TARGET)) - { - obj_id defendTargetVar = getObjIdObjVar(self, baseObjVar + DOT + OBJVAR_DEFENSE_TARGET); - if (defendTargetVar != defendTarget) - { - - blog("messageDefendCheckDistance defendTargetVar is NOT the correct object."); - return SCRIPT_CONTINUE; - } - blog("messageDefendCheckDistance defendTargetVar is the correct object."); - blog("messageDefendCheckDistance defendTargetVar: "+defendTargetVar); - } - - failDefenseDistanceCheck(player, questCrc, taskId, defendTarget); - - } - - messageTo(self, "messageDefendCheckDistance", params, DEFEND_DISTANCE_TIME_CHECK, false); - } - - return SCRIPT_CONTINUE; - } - - - public boolean isDefenseObjectNearby(int questCrc, int taskId, obj_id player, obj_id defendTarget) throws InterruptedException - { - blog("isDefenseObjectNearby init"); - - boolean result = false; - if (isIdValid(player) && isIdValid(defendTarget)) - { - blog("isDefenseObjectNearby player and defendTarget are VALID"); - - float distance = getDistance(player, defendTarget); - if (distance < 0.0f) - { - return result; - } - - result = distance <= MAX_ALLOWED_DISTANCE; - blog("isDefenseObjectNearby DISTANCE: "+getDistance(player, defendTarget)); - } - blog("isDefenseObjectNearby result: "+result); - - return result; - } - - - public void failDefenseDistanceCheck(obj_id player, int questCrc, int taskId, obj_id defenseTarget) throws InterruptedException - { - blog("failDefenseDistanceCheck init"); - - String baseObjVar = groundquests.getBaseObjVar(player, TASK_TYPE, questGetQuestName(questCrc), taskId); - if (!hasObjVar(player, baseObjVar + OBJVAR_BEEN_WARNED_DISTANCE)) - { - - setObjVar(player, baseObjVar + OBJVAR_BEEN_WARNED_DISTANCE, "true"); - - string_id message = new string_id ("quest/groundquests", "static_defense_distance_warning"); - prose_package pp = prose.getPackage(message, player, player, 0); - prose.setDF(pp, DEFEND_DISTANCE_TIME_CHECK); - sendSystemMessageProse(player, pp); - } - else - { - string_id message = new string_id ("quest/groundquests", "static_defense_failed_due_to_distance"); - prose_package pp = prose.getPackage(message, player, player, 0); - sendSystemMessageProse(player, pp); - - questFailTask(questCrc, taskId, player); - } - } - - - public int OnTaskCompleted(obj_id self, int questCrc, int taskId) throws InterruptedException - { - blog("OnTaskCompleted init"); - groundquests.questOutputDebugInfo(self, questCrc, taskId, TASK_TYPE, "OnTaskCompleted", TASK_TYPE + " task completed."); - - String baseObjVar = groundquests.getBaseObjVar(self, TASK_TYPE, questGetQuestName(questCrc), taskId); - obj_id escort = getObjIdObjVar(self, baseObjVar + DOT + OBJVAR_DEFENSE_TARGET); - - if (hasObjVar(escort, "questCallBack")) - { - dictionary webster = new dictionary(); - webster.put("questComplete", true); - webster.put("player", self); - messageTo(escort, "handleQuestCallBack", webster, 0, false); - } - - cleanup(self, questCrc, taskId); - return super.OnTaskCompleted(self, questCrc, taskId); - } - - - public int OnTaskFailed(obj_id self, int questCrc, int taskId) throws InterruptedException - { - blog("OnTaskFailed init"); - groundquests.questOutputDebugInfo(self, questCrc, taskId, TASK_TYPE, "OnTaskFailed", TASK_TYPE + " task failed."); - - String baseObjVar = groundquests.getBaseObjVar(self, TASK_TYPE, questGetQuestName(questCrc), taskId); - obj_id escort = getObjIdObjVar(self, baseObjVar + DOT + OBJVAR_DEFENSE_TARGET); - - if (hasObjVar(escort, "questCallBack")) - { - dictionary webster = new dictionary(); - webster.put("questComplete", false); - webster.put("player", self); - messageTo(escort, "handleQuestCallBack", webster, 0, false); - } - - cleanup(self, questCrc, taskId); - return super.OnTaskFailed(self, questCrc, taskId); - } - - - public int OnTaskCleared(obj_id self, int questCrc, int taskId) throws InterruptedException - { - blog("OnTaskCleared init"); - groundquests.questOutputDebugInfo(self, questCrc, taskId, TASK_TYPE, "OnTaskCleared", TASK_TYPE + " task cleared."); - - String baseObjVar = groundquests.getBaseObjVar(self, TASK_TYPE, questGetQuestName(questCrc), taskId); - obj_id escort = getObjIdObjVar(self, baseObjVar + DOT + OBJVAR_DEFENSE_TARGET); - - if (hasObjVar(escort, "questCallBack")) - { - dictionary webster = new dictionary(); - webster.put("questComplete", false); - webster.put("player", self); - messageTo(escort, "handleQuestCallBack", webster, 0, false); - } - - cleanup(self, questCrc, taskId); - return super.OnTaskCleared(self, questCrc, taskId); - } - - - public void cleanup(obj_id player, int questCrc, int taskId) throws InterruptedException - { - blog("cleanup init"); - - String baseObjVar = groundquests.getBaseObjVar(player, TASK_TYPE, questGetQuestName(questCrc), taskId); - String escortTargetObjVarName = baseObjVar + DOT + OBJVAR_DEFENSE_TARGET; - - obj_id escortTarget = getObjIdObjVar(player, escortTargetObjVarName); - - if (escortTarget != null) - { - removeObjVar(player, escortTargetObjVarName); - if (!ai_lib.isAiDead(escortTarget)) - { - - dictionary params = new dictionary(); - messageTo(escortTarget, "messageEscortCleanup", params, CLEANUP_TIME, false); - ai_lib.aiStopFollowing(escortTarget); - } - } - - groundquests.clearBaseObjVar(player, TASK_TYPE, questGetQuestName(questCrc), taskId); - } - - - public int OnLogout(obj_id self) throws InterruptedException - { - blog("OnLogout init"); - groundquests.failAllActiveTasksOfType(self, TASK_TYPE); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - blog("OnInitialize init"); - groundquests.failAllActiveTasksOfType(self, TASK_TYPE); - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - blog("OnDetach init"); - - removeObjVar(self, groundquests.getTaskTypeObjVar(self, TASK_TYPE)); - return SCRIPT_CONTINUE; - } - - - public void blog(String text) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(LOG_CAT, text); - } - } -} diff --git a/sku.0/sys.server/compiled/game/script/quest/task/ground/escort.java b/sku.0/sys.server/compiled/game/script/quest/task/ground/escort.java deleted file mode 100644 index 59dec3d1a..000000000 --- a/sku.0/sys.server/compiled/game/script/quest/task/ground/escort.java +++ /dev/null @@ -1,310 +0,0 @@ -package script.quest.task.ground; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.ai.ai_combat; -import script.library.ai_lib; -import script.library.quests; -import script.library.create; -import script.library.groundquests; -import script.library.locations; -import script.library.prose; -import script.library.spawning; -import script.library.utils; - - - -public class escort extends script.quest.task.ground.base_task -{ - public escort() - { - } - public static final String dataTableColumnServerTemplate = "SERVER_TEMPLATE"; - public static final String dataTableColumnDestinationNodeName = "DESTINATION_NODE_NAME"; - public static final String dataTableColumnMovementType = "MOVEMENT_TYPE"; - - public static final String objvarEscortTarget = "target"; - public static final String objvarBeenWarnedDistance = "beenWarned"; - - public static final String scriptNameEscortOnTarget = "quest.task.ground.escort_on_target"; - - public static final String taskType = "escort"; - public static final String dot = "."; - - public static final float escortDistanceTimeCheck = 10; - public static final float maximumAllowedDistance = 25; - public static final float cleanupTime = 120; - - - public int OnTaskActivated(obj_id self, int questCrc, int taskId) throws InterruptedException - { - groundquests.questOutputDebugInfo(self, questCrc, taskId, taskType, "OnTaskActivated", taskType + " task activated."); - - String baseObjVar = groundquests.setBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - - String serverTemplate = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnServerTemplate); - String destinationNodeName = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnDestinationNodeName); - String movementType = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnMovementType); - - location l = groundquests.getRandom2DLocationAroundPlayer(self, 0, 1); - - LOG("nym_spawn","serverTemplate: "+serverTemplate); - - obj_id escortTarget = obj_id.NULL_ID; - if (serverTemplate.indexOf(".iff") > -1) - { - escortTarget = spawning.createSpawnInLegacyCell(self, l, serverTemplate); - LOG("nym_spawn","spawing actual template, not creature: "+serverTemplate); - - } - else - { - LOG("nym_spawn","spawing creature: "+serverTemplate); - - escortTarget = create.createCreature(serverTemplate, l, true); - } - if (!isValidId(escortTarget)) - { - LOG("nym_spawn","spawing creature: "+serverTemplate); - - return super.OnTaskActivated(self, questCrc, taskId); - } - - attachScript(escortTarget, scriptNameEscortOnTarget); - pathTo(escortTarget, getLocation(self)); - - setMaster(escortTarget, self); - ai_lib.aiFollow(escortTarget, self, 1.0f, 8.0f); - - groundquests.addDestroyNotification(escortTarget, self); - - setObjVar(self, baseObjVar + dot + objvarEscortTarget, escortTarget); - - dictionary distanceCheckParams = new dictionary(); - distanceCheckParams.put("player", self); - distanceCheckParams.put("escortTarget", escortTarget); - distanceCheckParams.put("questCrc", questCrc); - distanceCheckParams.put("taskId", taskId); - messageTo(self, "messageEscortCheckDistance", distanceCheckParams, escortDistanceTimeCheck, false); - - return super.OnTaskActivated(self, questCrc, taskId); - } - - - public int destroyNotification(obj_id self, dictionary params) throws InterruptedException - { - if (params != null) - { - obj_id source = params.getObjId("source"); - - String taskObjVarName = groundquests.getTaskTypeObjVar(self, taskType); - if (taskObjVarName != null) - { - - obj_var_list questList = getObjVarList(self, taskObjVarName); - if (questList != null) - { - int countQuests = questList.getNumItems(); - - for (int i = 0; i < countQuests; ++i) - { - testAbortScript(); - obj_var ov = questList.getObjVar(i); - String questName = ov.getName(); - int questCrc = questGetQuestId(questName); - - String questObjVarName = taskObjVarName + dot + questName; - if (hasObjVar(self, questObjVarName)) - { - - obj_var_list taskList = getObjVarList(self, questObjVarName); - if (taskList != null) - { - int countTasks = taskList.getNumItems(); - for (int j = 0; j < countTasks; ++j) - { - testAbortScript(); - obj_var ov2 = taskList.getObjVar(j); - String taskName = ov2.getName(); - int taskId = utils.stringToInt(taskName); - - String escortTargetObjVarName = questObjVarName + dot + taskName + dot + objvarEscortTarget; - if (hasObjVar(self, escortTargetObjVarName)) - { - obj_id escortTarget = getObjIdObjVar(self, escortTargetObjVarName); - if (source == escortTarget) - { - questFailTask(questCrc, taskId, self); - } - } - } - } - } - } - } - } - } - return SCRIPT_CONTINUE; - } - - - public int messageEscortCheckDistance(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - obj_id escortTarget = params.getObjId("escortTarget"); - int questCrc = params.getInt ("questCrc"); - int taskId = params.getInt ("taskId"); - - if (questIsTaskActive(questCrc, taskId, player)) - { - String baseObjVar = groundquests.getBaseObjVar(player, taskType, questGetQuestName(questCrc), taskId); - if (isEscortNearby(questCrc, taskId, player, escortTarget)) - { - if (hasObjVar(player, baseObjVar + objvarBeenWarnedDistance)) - { - removeObjVar(player, baseObjVar + objvarBeenWarnedDistance); - } - } - else - { - failEscortDistanceCheck(player, questCrc, taskId, escortTarget); - } - - ai_lib.aiFollow(escortTarget, self, 1.0f, 8.0f); - - messageTo(self, "messageEscortCheckDistance", params, escortDistanceTimeCheck, false); - } - - return SCRIPT_CONTINUE; - } - - - public boolean isEscortNearby(int questCrc, int taskId, obj_id player, obj_id escortTarget) throws InterruptedException - { - boolean result = false; - if (isIdValid(player) && isIdValid(escortTarget)) - { - result = getDistance(player, escortTarget) <= maximumAllowedDistance; - } - return result; - } - - - public void failEscortDistanceCheck(obj_id player, int questCrc, int taskId, obj_id escortTarget) throws InterruptedException - { - String baseObjVar = groundquests.getBaseObjVar(player, taskType, questGetQuestName(questCrc), taskId); - if (!hasObjVar(player, baseObjVar + objvarBeenWarnedDistance)) - { - - setObjVar(player, baseObjVar + objvarBeenWarnedDistance, "true"); - - string_id message = new string_id ("quest/groundquests", "static_escort_distance_warning"); - prose_package pp = prose.getPackage(message, player, player, 0); - prose.setDF(pp, escortDistanceTimeCheck); - sendSystemMessageProse(player, pp); - } - else - { - string_id message = new string_id ("quest/groundquests", "static_escort_failed_due_to_distance"); - prose_package pp = prose.getPackage(message, player, player, 0); - sendSystemMessageProse(player, pp); - - questFailTask(questCrc, taskId, player); - } - } - - - public int OnTaskCompleted(obj_id self, int questCrc, int taskId) throws InterruptedException - { - groundquests.questOutputDebugInfo(self, questCrc, taskId, taskType, "OnTaskCompleted", taskType + " task completed."); - - String baseObjVar = groundquests.getBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - obj_id escort = getObjIdObjVar(self, baseObjVar + dot + objvarEscortTarget); - - ai_lib.aiStopFollowing(escort); - - cleanup(self, questCrc, taskId); - return super.OnTaskCompleted(self, questCrc, taskId); - } - - - public int OnTaskFailed(obj_id self, int questCrc, int taskId) throws InterruptedException - { - groundquests.questOutputDebugInfo(self, questCrc, taskId, taskType, "OnTaskFailed", taskType + " task failed."); - - String baseObjVar = groundquests.getBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - obj_id escort = getObjIdObjVar(self, baseObjVar + dot + objvarEscortTarget); - - ai_lib.aiStopFollowing(escort); - - cleanup(self, questCrc, taskId); - return super.OnTaskFailed(self, questCrc, taskId); - } - - - public int OnTaskCleared(obj_id self, int questCrc, int taskId) throws InterruptedException - { - groundquests.questOutputDebugInfo(self, questCrc, taskId, taskType, "OnTaskCleared", taskType + " task cleared."); - - String baseObjVar = groundquests.getBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - obj_id escort = getObjIdObjVar(self, baseObjVar + dot + objvarEscortTarget); - - ai_lib.aiStopFollowing(escort); - - cleanup(self, questCrc, taskId); - return super.OnTaskCleared(self, questCrc, taskId); - } - - - public void cleanup(obj_id player, int questCrc, int taskId) throws InterruptedException - { - - String baseObjVar = groundquests.getBaseObjVar(player, taskType, questGetQuestName(questCrc), taskId); - String escortTargetObjVarName = baseObjVar + dot + objvarEscortTarget; - - obj_id escortTarget = getObjIdObjVar(player, escortTargetObjVarName); - - if (isValidId(escortTarget)) - { - removeObjVar(player, escortTargetObjVarName); - if (!ai_lib.isAiDead(escortTarget)) - { - - dictionary params = new dictionary(); - messageTo(escortTarget, "messageEscortCleanup", params, cleanupTime, false); - ai_lib.aiStopFollowing(escortTarget); - } - } - - groundquests.clearBaseObjVar(player, taskType, questGetQuestName(questCrc), taskId); - } - - - public int OnLogout(obj_id self) throws InterruptedException - { - groundquests.failAllActiveTasksOfType(self, taskType); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - groundquests.failAllActiveTasksOfType(self, taskType); - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - - removeObjVar(self, groundquests.getTaskTypeObjVar(self, taskType)); - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/quest/task/ground/util/quest_use_object_on_object.java b/sku.0/sys.server/compiled/game/script/quest/task/ground/util/quest_use_object_on_object.java deleted file mode 100644 index 3a048201c..000000000 --- a/sku.0/sys.server/compiled/game/script/quest/task/ground/util/quest_use_object_on_object.java +++ /dev/null @@ -1,158 +0,0 @@ -package script.quest.task.ground.util; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.static_item; -import script.library.buff; -import script.library.collection; -import script.library.sui; -import script.library.utils; - - -public class quest_use_object_on_object extends script.base_script -{ - public quest_use_object_on_object() - { - } - public static final string_id SID_USE_CAMERA = new string_id("collection", "use_camera"); - public static final string_id SID_PICTURE_TAKEN = new string_id("collection", "picture_taken"); - public static final string_id SID_INVALID_TARGET = new string_id("collection", "invalid_target"); - public static final string_id SID_SUCCESS_SNAPSHOT = new string_id("collection", "successful_snapshot"); - public static final string_id SID_PHOTO_SLOT_COMPLETE = new string_id("collection", "photo_slot_complete"); - public static final string_id NOT_WHILE_INCAPPED = new string_id ("quest/ground/util/quest_giver_object", "not_while_incapped"); - public static final string_id SID_NOT_WHILE_IN_COMBAT = new string_id("base_player", "not_while_in_combat"); - public static final string_id MUST_DISMOUNT = new string_id ("collection", "must_dismount"); - public static final string_id CREATURE_IS_DEAD = new string_id ("collection", "creature_is_dead"); - - public static final String OBJECT_KEY = "quest.object_key"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!canManipulate(player, self, true, true, 15, true)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithinAPlayer(self)) - { - return SCRIPT_CONTINUE; - } - - menu_info_data mid = mi.getMenuItemByType(menu_info_types.ITEM_USE); - if (mid != null) - { - mid.setServerNotify(true); - } - else - { - mi.addRootMenu(menu_info_types.ITEM_USE, new string_id("spam", "costume_learn")); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - sendDirtyObjectMenuNotification(self); - - if (utils.getContainingPlayer(self) != player) - { - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (isIncapacitated(player) || isDead(player)) - { - sendSystemMessage(player, new string_id("player_structure", "while_dead")); - return SCRIPT_CONTINUE; - } - if (getState(player, STATE_RIDING_MOUNT) == 1) - { - sendSystemMessage(player, MUST_DISMOUNT); - return SCRIPT_CONTINUE; - } - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, NOT_WHILE_INCAPPED); - return SCRIPT_CONTINUE; - } - - obj_id intended = getIntendedTarget(player); - - if (!isIdValid(intended)) - { - - sendSystemMessage(player, SID_INVALID_TARGET); - } - else - { - - checkValidTarget(player, intended, self); - } - - return SCRIPT_CONTINUE; - } - - - public boolean checkValidTarget(obj_id player, obj_id target, obj_id self) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (!isValidId(target) || !exists(target)) - { - return false; - } - - if (!isValidId(self) || !exists(self)) - { - return false; - } - - if (!hasObjVar(self, OBJECT_KEY)) - { - return false; - } - - if (!hasObjVar(target, OBJECT_KEY)) - { - sendSystemMessage(player, SID_INVALID_TARGET); - return false; - } - - String keyString = getStringObjVar(self, OBJECT_KEY); - if (keyString == null || keyString.length() <= 0) - { - return false; - } - - if (!keyString.equals(getStringObjVar(target, OBJECT_KEY))) - { - return false; - } - - if (isMob(target) && (isDead(target) || isIncapacitated(target))) - { - sendSystemMessage(player, CREATURE_IS_DEAD); - return false; - } - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/quest/task/ground/wait_for_signal.java b/sku.0/sys.server/compiled/game/script/quest/task/ground/wait_for_signal.java deleted file mode 100644 index 3c85a4c5d..000000000 --- a/sku.0/sys.server/compiled/game/script/quest/task/ground/wait_for_signal.java +++ /dev/null @@ -1,340 +0,0 @@ -package script.quest.task.ground; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.groundquests; -import script.library.utils; - - - -public class wait_for_signal extends script.quest.task.ground.base_task -{ - public wait_for_signal() - { - } - public static final String dataTableColumnSignalName = "SIGNAL_NAME"; - - public static final String dataTableColumnWaitMarkerCreate = "WAIT_MARKER_CREATE"; - public static final String dataTableColumnWaitMarkerTemplate = "WAIT_MARKER_TEMPLATE"; - public static final String dataTableColumnWaitMarkerPlanetName = "WAIT_MARKER_PLANET_NAME"; - public static final String dataTableColumnWaitMarkerBuilding = "WAIT_MARKER_BUILDING"; - public static final String dataTableColumnWaitMarkerCellName = "WAIT_MARKER_CELL_NAME"; - public static final String dataTableColumnWaitMarkerX = "WAIT_MARKER_X"; - public static final String dataTableColumnWaitMarkerY = "WAIT_MARKER_Y"; - public static final String dataTableColumnWaitMarkerZ = "WAIT_MARKER_Z"; - public static final String dataTableColumnNumRequired = "NUM_REQUIRED"; - - public static final String defaultWaitMarkerTemplate = "object/static/structure/general/tutorial_waypoint.iff"; - - public static final String waitMarkerVarName = "waitMarker"; - - public static final String taskType = "wait_for_signal"; - public static final String dot = "."; - - - public int OnTaskActivated(obj_id self, int questCrc, int taskId) throws InterruptedException - { - groundquests.questOutputDebugInfo(self, questCrc, taskId, taskType, "OnTaskActivated", taskType + " task activated."); - - groundquests.setBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - - createMarker(self, questCrc, taskId); - - int count = groundquests.getTaskIntDataEntry(questCrc, taskId, dataTableColumnNumRequired); - - if (count > 1) - { - questSetQuestTaskCounter(self, questGetQuestName(questCrc), taskId, "quest/groundquests:signals_counter", 0, count); - } - - return super.OnTaskActivated(self, questCrc, taskId); - } - - - public int OnTaskCompleted(obj_id self, int questCrc, int taskId) throws InterruptedException - { - cleanup(self, questCrc, taskId); - groundquests.questOutputDebugInfo(self, questCrc, taskId, taskType, "OnTaskCompleted", taskType + " task completed."); - return super.OnTaskCompleted(self, questCrc, taskId); - } - - - public int OnTaskFailed(obj_id self, int questCrc, int taskId) throws InterruptedException - { - cleanup(self, questCrc, taskId); - groundquests.questOutputDebugInfo(self, questCrc, taskId, taskType, "OnTaskFailed", taskType + " task failed."); - return super.OnTaskFailed(self, questCrc, taskId); - } - - - public int OnTaskCleared(obj_id self, int questCrc, int taskId) throws InterruptedException - { - cleanup(self, questCrc, taskId); - groundquests.questOutputDebugInfo(self, questCrc, taskId, taskType, "OnTaskCleared", taskType + " task cleared."); - return super.OnTaskCleared(self, questCrc, taskId); - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - - removeObjVar(self, groundquests.getTaskTypeObjVar(self, taskType)); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - groundquests.questOutputDebugLog(taskType, "OnInitialize", "Updating wait markers."); - - updateAllMarkers(self, true); - - return SCRIPT_CONTINUE; - } - - - public int OnLogout(obj_id self) throws InterruptedException - { - groundquests.questOutputDebugLog(taskType, "OnLogout", "Updating wait markers."); - - updateAllMarkers(self, false); - - return SCRIPT_CONTINUE; - } - - - public int questSignal(obj_id self, dictionary params) throws InterruptedException - { - String signalReceived = params.getString("signal"); - - LOG("nym_logging","signalReceived: "+signalReceived); - - String taskObjVarName = groundquests.getTaskTypeObjVar(self, taskType); - - if (taskObjVarName == null) - { - return SCRIPT_CONTINUE; - } - - obj_var_list questList = getObjVarList(self, taskObjVarName); - - if (questList == null) - { - return SCRIPT_CONTINUE; - } - - int countQuests = questList.getNumItems(); - - for (int i = 0; i < countQuests; ++i) - { - testAbortScript(); - obj_var ov = questList.getObjVar(i); - String questName = ov.getName(); - int questCrc = questGetQuestId(questName); - - String questObjVarName = taskObjVarName + dot + questName; - - if (!hasObjVar(self, questObjVarName)) - { - continue; - } - - obj_var_list taskList = getObjVarList(self, questObjVarName); - - if (taskList == null) - { - continue; - } - - int countTasks = taskList.getNumItems(); - - for (int j = 0; j < countTasks; ++j) - { - testAbortScript(); - obj_var ov2 = taskList.getObjVar(j); - String taskName = ov2.getName(); - int taskId = utils.stringToInt(taskName); - - String baseObjVar = groundquests.getBaseObjVar(self, taskType, questGetQuestName(questCrc), taskId); - - String signalName = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnSignalName); - - if (signalName == null || signalName.equals("")) - { - String errText = "SIGNALNAME IS NULL: questCrc: "+ questCrc + - " - taskId: "+ taskId + - " - dataTableColumnSignalName: "+ dataTableColumnSignalName; - logScriptDataError(errText); - } - else - { - String[] signalNames = split(signalName, ','); - - for (int k = 0; k < signalNames.length; k++) - { - testAbortScript(); - if (signalNames[k].equals(signalReceived)) - { - groundquests.questOutputDebugInfo(self, questCrc, taskId, taskType, "questSignal", "Signal "+ signalNames[k] + " received."); - - String signalObjvar = baseObjVar + dot + signalReceived + dot + "count"; - - int signalsMaximum = groundquests.getTaskIntDataEntry(questCrc, taskId, dataTableColumnNumRequired); - int signalsCompleted = getIntObjVar(self, signalObjvar) + 1; - - setObjVar(self, signalObjvar, signalsCompleted); - - if (signalsMaximum > 1 && signalsCompleted < signalsMaximum) - { - questSetQuestTaskCounter(self, questGetQuestName(questCrc), taskId, "quest/groundquests:signals_counter", signalsCompleted, signalsMaximum); - play2dNonLoopingSound(self, groundquests.MUSIC_QUEST_INCREMENT_COUNTER); - } - else - { - questCompleteTask(questCrc, taskId, self); - } - } - } - } - } - } - return SCRIPT_CONTINUE; - } - - - public void cleanup(obj_id player, int questCrc, int taskId) throws InterruptedException - { - destroyMarker(player, questCrc, taskId); - - groundquests.clearBaseObjVar(player, taskType, questGetQuestName(questCrc), taskId); - } - - - public void createMarker(obj_id player, int questCrc, int taskId) throws InterruptedException - { - String baseObjVar = groundquests.getBaseObjVar(player, taskType, questGetQuestName(questCrc), taskId); - - boolean createWaitMarker = groundquests.getTaskIntDataEntry(questCrc, taskId, dataTableColumnWaitMarkerCreate) > 0; - - if (createWaitMarker) - { - - destroyMarker(player, questCrc, taskId); - - String waitMarkerTemplate = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnWaitMarkerTemplate); - String waitMarkerPlanetName = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnWaitMarkerPlanetName); - String waitMarkerBuilding = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnWaitMarkerBuilding); - String waitMarkerCellName = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableColumnWaitMarkerCellName); - float waitMarkerX = groundquests.getTaskFloatDataEntry(questCrc, taskId, dataTableColumnWaitMarkerX); - float waitMarkerY = groundquests.getTaskFloatDataEntry(questCrc, taskId, dataTableColumnWaitMarkerY); - float waitMarkerZ = groundquests.getTaskFloatDataEntry(questCrc, taskId, dataTableColumnWaitMarkerZ); - - location waitMarkerLocation; - - if (waitMarkerCellName.length() != 0) - { - obj_id buildingObjId; - - if (utils.stringToInt(waitMarkerBuilding) == 0) - { - buildingObjId = getTopMostContainer(player); - } - else - { - buildingObjId = utils.stringToObjId(waitMarkerBuilding); - } - - if (!isValidId(buildingObjId)) - { - groundquests.questOutputDebugLog(taskType, "createMarker", "Invalid building!"); - return; - } - - waitMarkerPlanetName = getLocation(buildingObjId).area; - - obj_id cellObjId = getCellId(buildingObjId, waitMarkerCellName); - - if (!isValidId(cellObjId)) - { - groundquests.questOutputDebugLog(taskType, "createMarker", "Invalid cell! "+ waitMarkerCellName); - return; - } - - waitMarkerLocation = new location(waitMarkerX, waitMarkerY, waitMarkerZ, waitMarkerPlanetName, cellObjId); - } - else - { - waitMarkerLocation = new location(waitMarkerX, waitMarkerY, waitMarkerZ, waitMarkerPlanetName); - } - - if (waitMarkerTemplate.length() == 0) - { - waitMarkerTemplate = defaultWaitMarkerTemplate; - } - - groundquests.questOutputDebugInfo(player, questCrc, taskId, taskType, "OnTaskActivated", - "Creating wait marker ["+ waitMarkerTemplate + "] at "+ waitMarkerLocation.toString()); - - obj_id waitMarker = createObject(waitMarkerTemplate, waitMarkerLocation); - - setObjVar(player, baseObjVar + dot + waitMarkerVarName, waitMarker); - } - } - - - public void destroyMarker(obj_id player, int questCrc, int taskId) throws InterruptedException - { - String baseObjVar = groundquests.getBaseObjVar(player, taskType, questGetQuestName(questCrc), taskId); - obj_id waitMarker = getObjIdObjVar(player, baseObjVar + dot + waitMarkerVarName); - - if (isIdValid(waitMarker)) - { - groundquests.questOutputDebugInfo(player, questCrc, taskId, taskType, "destroyMarker", - "Destroying wait marker: "+ waitMarker); - - destroyObject(waitMarker); - - removeObjVar(player, baseObjVar + dot + waitMarkerVarName); - } - } - - - public void updateAllMarkers(obj_id player, boolean create) throws InterruptedException - { - dictionary tasks = groundquests.getActiveTasksForTaskType(player, taskType); - if ((tasks != null) && !tasks.isEmpty()) - { - java.util.Enumeration keys = tasks.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String questCrcString = (String)keys.nextElement(); - int questCrc = utils.stringToInt(questCrcString); - - int[] tasksForCurrentQuest = tasks.getIntArray(questCrcString); - - for (int i = 0; i < tasksForCurrentQuest.length; ++i) - { - testAbortScript(); - int taskId = tasksForCurrentQuest[i]; - - if (create) - { - createMarker(player, questCrc, taskId); - } - else - { - destroyMarker(player, questCrc, taskId); - } - } - } - } - } - -} diff --git a/sku.0/sys.server/compiled/game/script/quest/task/ground/wave_event_controller_npc.java b/sku.0/sys.server/compiled/game/script/quest/task/ground/wave_event_controller_npc.java deleted file mode 100644 index b0a160afc..000000000 --- a/sku.0/sys.server/compiled/game/script/quest/task/ground/wave_event_controller_npc.java +++ /dev/null @@ -1,589 +0,0 @@ -package script.quest.task.ground; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.create; -import script.library.groundquests; -import script.library.prose; -import script.library.spawning; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class wave_event_controller_npc extends script.base_script -{ - public wave_event_controller_npc() - { - } - public static final String dataTableWaveEventPrimaryTargetPre = "PRIMARY_TARGET_WAVE_"; - public static final String dataTableWaveEventGuardPre = "GUARDS_SPAWNED_WAVE_"; - public static final String dataTableWaveEventNumGuardsPre = "NUM_GUARDS_WAVE_"; - public static final String dataTableWaveEventDelayPre = "DELAY_WAVE_"; - public static final String dataTableWaveEventRadiusPre = "RADIUS_WAVE_"; - public static final String dataTableWaveEventUtterancePre = "UTTERANCE_WAVE_"; - public static final String dataTableWaveEventStartMessage = "START_MESSAGE"; - - public static final String TASK_TYPE = "wave_event"; - - public static final String WAVE_SCRIPT_VAR = "waveEventCurrentWave"; - public static final String PLAYER_SCRIPT_VAR = "waveEventPlayer"; - public static final String PLAYER_LEVEL_SCRIPT_VAR = "waveEventPlayerLevel"; - public static final String CHILDRENLIST_SCRIPT_VAR = "waveEventChildrenList"; - - public static final boolean LOGGING = false; - - - public int waveEventControllerNPCStart(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = params.getObjId("player"); - int playerLevel = 0; - if (params.containsKey("playerLevel")) - { - playerLevel = params.getInt("playerLevel"); - } - if (isIdValid(player)) - { - if (utils.hasScriptVar(self, WAVE_SCRIPT_VAR)) - { - - int wave = utils.getIntScriptVar(self, WAVE_SCRIPT_VAR); - if (wave > 0) - { - string_id message = new string_id("quest/groundquests", "wave_event_already_underway_npc"); - prose_package pp = prose.getPackage(message, player, player); - prose.setTO(pp, utils.unpackString(getName(self))); - sendSystemMessageProse(player, pp); - - return SCRIPT_CONTINUE; - } - } - - waveEventBegin(self, player, playerLevel); - } - return SCRIPT_CONTINUE; - } - - - public void waveEventBegin(obj_id self, obj_id player, int playerLevel) throws InterruptedException - { - LOG("nym_wave_event", "waveEventBegin init"); - - int wave = 1; - float delay = waveEventGetWaveDelay(self, player, wave); - LOG("nym_wave_event", "wave event delay: "+delay); - - if (delay > -1) - { - clearEventArea(self); - - dictionary webster = trial.getSessionDict(self); - - messageTo(self, "defaultEventReset", webster, 600, false); - - utils.setScriptVar(self, WAVE_SCRIPT_VAR, wave); - utils.setScriptVar(self, PLAYER_SCRIPT_VAR, player); - utils.setScriptVar(self, PLAYER_LEVEL_SCRIPT_VAR, playerLevel); - - prose_package pp = new prose_package (); - pp.stringId = new string_id("quest/groundquests", "wave_event_starting"); - - dictionary questData = getwaveEventQuestData(self, player); - if (questData != null && !questData.isEmpty()) - { - LOG("nym_wave_event", "getwaveEventQuestData init"); - - boolean taskFound = questData.getBoolean("waveEventTaskFound"); - if (taskFound) - { - LOG("nym_wave_event", "taskFound init"); - - int questCrc = questData.getInt("waveEventQuestCrc"); - int taskId = questData.getInt("waveEventTaskId"); - String newMsg = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableWaveEventStartMessage); - if (newMsg != null && !newMsg.equals("")) - { - pp.stringId = utils.unpackString(newMsg); - } - } - } - - sendSystemMessageProse(player, pp); - LOG("nym_wave_event", "waveEventSpawnNextWave init"); - messageTo(self, "waveEventSpawnNextWave", webster, delay, false); - - if (hasObjVar(self, "questFlavorObject")) - { - messageTo(self, "handleQuestFlavorObject", null, 0, false); - } - } - - return; - } - - - public dictionary getwaveEventQuestData(obj_id self, obj_id player) throws InterruptedException - { - dictionary webster = new dictionary(); - - int questCrc = -1; - int taskId = -1; - boolean taskFound = false; - String itemTemplateName = getTemplateName(self); - - dictionary tasks = groundquests.getActiveTasksForTaskType(player, TASK_TYPE); - LOG("nym_wave_event", "wave event tasks: "+tasks); - - if ((tasks != null) && !tasks.isEmpty()) - { - java.util.Enumeration keys = tasks.keys(); - while (keys.hasMoreElements() || !taskFound) - { - testAbortScript(); - String questCrcString = (String)keys.nextElement(); - int tempQuestCrc = utils.stringToInt(questCrcString); - int[] tasksForCurrentQuest = tasks.getIntArray(questCrcString); - - for (int i = 0; i < tasksForCurrentQuest.length; ++i) - { - testAbortScript(); - int tempTaskId = tasksForCurrentQuest[i]; - String baseObjVar = groundquests.getBaseObjVar(player, TASK_TYPE, questGetQuestName(tempQuestCrc), tempTaskId); - String retrieveTemplateName = groundquests.getTaskStringDataEntry(tempQuestCrc, tempTaskId, "SERVER_TEMPLATE"); - if (retrieveTemplateName != null && itemTemplateName.equals(retrieveTemplateName)) - { - questCrc = tempQuestCrc; - taskId = tempTaskId; - taskFound = true; - } - } - } - } - - LOG("nym_wave_event", "wave event taskFound: "+taskFound); - LOG("nym_wave_event", "wave event questCrc: "+questCrc); - LOG("nym_wave_event", "wave event taskId: "+taskId); - - webster.put("waveEventTaskFound", taskFound); - webster.put("waveEventQuestCrc", questCrc); - webster.put("waveEventTaskId", taskId); - - return webster; - } - - - public float waveEventGetWaveDelay(obj_id self, obj_id player, int wave) throws InterruptedException - { - int delay = -1; - - dictionary webster = getwaveEventQuestData(self, player); - - if (webster != null && !webster.isEmpty()) - { - boolean taskFound = webster.getBoolean("waveEventTaskFound"); - if (taskFound) - { - int questCrc = webster.getInt("waveEventQuestCrc"); - int taskId = webster.getInt("waveEventTaskId"); - String dataTableWaveEventDelay = dataTableWaveEventDelayPre + wave; - delay = groundquests.getTaskIntDataEntry(questCrc, taskId, dataTableWaveEventDelay); - } - } - return delay; - } - - - public int waveEventSpawnNextWave(obj_id self, dictionary params) throws InterruptedException - { - LOG("nym_wave_event", "waveEventSpawnNextWave init"); - - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - LOG("nym_wave_event", "waveEventSpawnNextWave session verified"); - - int wave = utils.getIntScriptVar(self, WAVE_SCRIPT_VAR); - obj_id player = utils.getObjIdScriptVar(self, PLAYER_SCRIPT_VAR); - int playerLevel = utils.getIntScriptVar(self, PLAYER_LEVEL_SCRIPT_VAR); - - LOG("nym_wave_event", "waveEventSpawnNextWave wave: "+wave); - LOG("nym_wave_event", "waveEventSpawnNextWave player: "+player); - LOG("nym_wave_event", "waveEventSpawnNextWave playerLevel: "+playerLevel); - - if (!isValidId(player)) - { - LOG("nym_wave_event", "waveEventSpawnNextWave PLAYER INVALID!!!!"); - messageTo(self, "cleanupEvent", null, 2, false); - return SCRIPT_CONTINUE; - } - - dictionary webster = getwaveEventQuestData(self, player); - LOG("nym_wave_event", "waveEventSpawnNextWave webster: "+webster); - - if (webster != null && !webster.isEmpty()) - { - boolean taskFound = webster.getBoolean("waveEventTaskFound"); - if (taskFound) - { - int questCrc = webster.getInt("waveEventQuestCrc"); - int taskId = webster.getInt("waveEventTaskId"); - - String dataTableWaveEventPrimaryTarget = dataTableWaveEventPrimaryTargetPre + wave; - String waveEventPrimaryTarget = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableWaveEventPrimaryTarget); - - if (waveEventPrimaryTarget != null && waveEventPrimaryTarget.length() > 0) - { - String dataTableWaveEventRadius = dataTableWaveEventRadiusPre + wave; - float radius = groundquests.getTaskFloatDataEntry(questCrc, taskId, dataTableWaveEventRadius); - location spawnLoc = spawning.getRandomLocationAtDistance(getLocation(self), radius); - - obj_id spawnedPrimaryTarget = obj_id.NULL_ID; - if (playerLevel > 0) - { - spawnedPrimaryTarget = create.object(waveEventPrimaryTarget, spawnLoc, playerLevel); - } - else - { - spawnedPrimaryTarget = create.object(waveEventPrimaryTarget, spawnLoc); - } - - if (!isIdValid(spawnedPrimaryTarget)) - { - LOG("nym_wave_event", "waveEventSpawnNextWave spawnedPrimaryTarget INVALID!!!!"); - - messageTo(self, "cleanupEvent", null, 2, false); - return SCRIPT_CONTINUE; - } - - setHibernationDelay(spawnedPrimaryTarget, 3600.0f); - - trial.setParent(self, spawnedPrimaryTarget, true); - trial.setInterest(spawnedPrimaryTarget); - - utils.setScriptVar(spawnedPrimaryTarget, "waveEventPlayer", player); - LOG("nym_wave_event", "waveEventSpawnNextWave SPAWNEDPRIMARYTARGET: "+spawnedPrimaryTarget); - - String dataTableWaveEventUtterance = dataTableWaveEventUtterancePre + wave; - String utterance = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableWaveEventUtterance); - if (utterance != null && utterance.length() > 0) - { - utils.setScriptVar(spawnedPrimaryTarget, "waveEventUtterance", utterance); - } - - attachScript(spawnedPrimaryTarget, "quest.task.ground.wave_event_on_creature"); - - Vector waveEventChildrenList = new Vector(); - waveEventChildrenList.setSize(0); - utils.addElement (waveEventChildrenList, spawnedPrimaryTarget); - utils.setScriptVar(self, CHILDRENLIST_SCRIPT_VAR, waveEventChildrenList); - - String dataTableWaveEventGuard = dataTableWaveEventGuardPre + wave; - String waveEventGuard = groundquests.getTaskStringDataEntry(questCrc, taskId, dataTableWaveEventGuard); - if (waveEventGuard != null && waveEventGuard.length() > 0) - { - String dataTableWaveEventNumGuards = dataTableWaveEventNumGuardsPre + wave; - int waveEventNumGuards = groundquests.getTaskIntDataEntry(questCrc, taskId, dataTableWaveEventNumGuards); - if (waveEventNumGuards > 0) - { - for (int i = 0; i < waveEventNumGuards; i++) - { - testAbortScript(); - location guardLoc = spawning.getRandomLocationAtDistance(getLocation(self), radius); - obj_id spawnedGuard = obj_id.NULL_ID; - if (playerLevel > 0) - { - spawnedGuard = create.object(waveEventGuard, spawnLoc, playerLevel); - } - else - { - spawnedGuard = create.object(waveEventGuard, spawnLoc); - } - - if (!isIdValid(spawnedGuard)) - { - return SCRIPT_CONTINUE; - } - setHibernationDelay(spawnedGuard, 3600.0f); - - trial.setParent(self, spawnedGuard, true); - trial.setInterest(spawnedGuard); - - attachScript(spawnedGuard, "quest.task.ground.wave_event_on_creature"); - - if (!utils.hasScriptVar(self, CHILDRENLIST_SCRIPT_VAR)) - { - LOG("nym_wave_event", "waveEventSpawnNextWave CHILDRENLIST_SCRIPT_VAR missing!!!!"); - - messageTo(self, "cleanupEvent", null, 2, false); - return SCRIPT_CONTINUE; - } - - waveEventChildrenList = utils.getResizeableObjIdArrayScriptVar(self, CHILDRENLIST_SCRIPT_VAR); - if (waveEventChildrenList != null) - { - utils.addElement (waveEventChildrenList, spawnedGuard); - if (waveEventChildrenList != null && waveEventChildrenList.size() > 0) - { - utils.setScriptVar(self, CHILDRENLIST_SCRIPT_VAR, waveEventChildrenList); - } - } - else - { - LOG("nym_wave_event", "waveEventSpawnNextWave waveEventChildrenList invalid!!!!"); - - messageTo(self, "cleanupEvent", null, 2, false); - return SCRIPT_CONTINUE; - } - } - } - } - } - else - { - LOG("nym_wave_event", "waveEventSpawnNextWave primary target invalid!!!!"); - - groundquests.questOutputDebugInfo(self, TASK_TYPE, "waveEventSpawnNextWave", "No more waves to spawn...the wave event has ended."); - messageTo(self, "cleanupEvent", null, 2, false); - } - } - else - { - LOG("nym_wave_event", "waveEventSpawnNextWave Task not found!!!!"); - - groundquests.questOutputDebugInfo(self, TASK_TYPE, "waveEventSpawnNextWave", "No active wave event task was found for this player("+player+") and this object("+getTemplateName(self)+")."); - messageTo(self, "cleanupEvent", null, 2, false); - } - } - - return SCRIPT_CONTINUE; - } - - - public int waveEventChildDestroyed(obj_id self, dictionary params) throws InterruptedException - { - if (params != null && !params.isEmpty()) - { - obj_id player = utils.getObjIdScriptVar(self, PLAYER_SCRIPT_VAR); - if (isIdValid(player)) - { - obj_id child = params.getObjId("waveEventChild"); - if (utils.hasScriptVar(self, CHILDRENLIST_SCRIPT_VAR)) - { - Vector waveEventChildrenList = utils.getResizeableObjIdArrayScriptVar(self, CHILDRENLIST_SCRIPT_VAR);; - if (waveEventChildrenList != null) - { - if (waveEventChildrenList.contains(child)) - { - waveEventChildrenList.removeElement(child); - } - - if (waveEventChildrenList.size() > 0) - { - - utils.setScriptVar(self, CHILDRENLIST_SCRIPT_VAR, waveEventChildrenList); - return SCRIPT_CONTINUE; - } - else - { - - utils.removeScriptVar(self, CHILDRENLIST_SCRIPT_VAR); - - int previousWave = utils.getIntScriptVar(self, WAVE_SCRIPT_VAR); - int nextWave = previousWave + 1; - - float delay = waveEventGetWaveDelay(self, player, nextWave); - if (delay > -1) - { - dictionary webster = trial.getSessionDict(self); - - utils.setScriptVar(self, WAVE_SCRIPT_VAR, nextWave); - - messageTo(self, "waveEventSpawnNextWave", webster, delay, false); - return SCRIPT_CONTINUE; - } - } - } - } - } - } - - LOG("nym_wave_event", "cleanupEvent called event children destroyed"); - - messageTo(self, "cleanupEvent", null, 2, false); - return SCRIPT_CONTINUE; - } - - - public void spoutChildrenListScriptVar(obj_id self, obj_id player) throws InterruptedException - { - if (isGod(player)) - { - sendSystemMessage(player, "Spouting waveEventChildrenList scriptvar value...", ""); - Vector testList = utils.getResizeableObjIdArrayScriptVar(self, CHILDRENLIST_SCRIPT_VAR); - if (testList != null) - { - for (int j=0; j 90) - { - CustomerServiceLog("quest", "dynamic_spawn_off_quest_item.handleQuestFlavorObject() Player "+player+" has a level that is invalid. Player level is: "+combatLevel+". Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < spawnCount; i++) - { - testAbortScript(); - - location mobLoc = utils.getRandomLocationInRing(getLocation(self), 4.0f, 7.0f); - - obj_id mob = create.object(creatureName, mobLoc); - if (!isValidId(mob) || !exists(mob)) - { - CustomerServiceLog("quest", "dynamic_spawn_off_quest_item.handleQuestFlavorObject() Mob: "+mob+" could not be created!"); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("quest", "dynamic_spawn_off_quest_item.handleQuestFlavorObject() Mob level is set to match player level"); - - setObjVar(mob, create.INITIALIZE_CREATURE_DO_NOT_SCALE_OBJVAR, 1); - - dictionary creatureDict = utils.dataTableGetRow(CREATURE_TABLE, creatureName); - if (creatureDict != null) - { - create.initializeCreature (mob, creatureName, creatureDict, combatLevel); - } - CustomerServiceLog("quest", "dynamic_spawn_off_quest_item.handleQuestFlavorObject() Mob level is set to match player level."); - - setInvulnerable(mob, false); - clearCondition(mob, CONDITION_CONVERSABLE); - setMovementRun(mob); - setBaseRunSpeed(mob, (getBaseRunSpeed(self)-8)); - setAttributeAttained(mob, attrib.OUTBREAK_AFFLICTED); - setObjVar(mob, "owner", player); - - attachScript(mob, "theme_park.outbreak.dynamic_enemy"); - startCombat(mob, player); - - CustomerServiceLog("quest", "dynamic_spawn_off_quest_item.handleQuestFlavorObject() the NPC is attacking player: "+player); - - if (hasObjVar(self, "explosion")) - { - for (int b = 0; b < 3; b++) - { - testAbortScript(); - location locDestination = utils.getRandomLocationInRing(getLocation(self), 1.0f, 3.0f); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef",locDestination , 0); - } - } - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/space/ai/space_ai.java b/sku.0/sys.server/compiled/game/script/space/ai/space_ai.java deleted file mode 100644 index 7e6862a46..000000000 --- a/sku.0/sys.server/compiled/game/script/space/ai/space_ai.java +++ /dev/null @@ -1,185 +0,0 @@ -package script.space.ai; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ship_ai; -import script.library.space_utils; -import script.library.utils; -import script.library.attrib; -import script.library.space_combat; - -import script.transform; -import script.vector; - - -public class space_ai extends script.base_script -{ - public space_ai() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - setupShip( self ); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - setupShip(self); - return SCRIPT_CONTINUE; - } - - - public int OnShipWasHit(obj_id self, obj_id attacker, int weaponIndex, boolean isMissile, int missileType, int intSlot, boolean fromPlayerAutoTurret, float hitLocationX_o, float hitLocationY_o, float hitLocationZ_o) throws InterruptedException - { - - int lastBroadcast = utils.getIntScriptVar( self , "ship.lastHitBroadcast"); - int timeNow = getGameTime(); - if (( lastBroadcast + 10 ) > timeNow) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar( self, "ship.lastHitBroadcast", timeNow ); - dictionary parms = new dictionary(); - parms.put( "attacker", attacker ); - broadcastMessage( "handleGuardedTargetHit", parms ); - - return SCRIPT_CONTINUE; - } - - - public int OnShipIsHitting(obj_id self, obj_id target, int weaponIndex, int intSlot) throws InterruptedException - { - - if (ship_ai.isShipDead( target )) - { - ship_ai.spaceStopAttack( self, target ); - } - - return SCRIPT_CONTINUE; - } - - - public int OnShipBehaviorChanged(obj_id self, int oldBehavior, int newBehavior) throws InterruptedException - { - LOG("space_debug_ai", "OnShipBehaviorChanged self: "+ self + " newBehavior: "+ newBehavior); - - return SCRIPT_CONTINUE; - } - - - public void setupShip(obj_id ship) throws InterruptedException - { - if (utils.hasScriptVar(ship,"ship.setupComplete")) - { - return; - } - - if (ship_ai.isShipAggro( ship )) - { - setCondition( ship, CONDITION_AGGRESSIVE ); - } - - setAttributeAttained( ship, attrib.SPACE_SHIP ); - utils.setScriptVar(ship, "ship.setupComplete", true); - } - - - public int OnArrivedAtLocation(obj_id self, String strName) throws InterruptedException - { - - if (strName.equals("spawnerArrival")) - { - if (hasObjVar(self, "objDockingStation")) - { - - obj_id objStation = getObjIdObjVar(self, "objDockingStation"); - - ship_ai.unitDock(self, objStation); - - } - else if (hasObjVar(self, "objAttackTarget")) - { - - obj_id objAttackTarget = getObjIdObjVar(self, "objAttackTarget"); - ship_ai.unitAddDamageTaken(self, objAttackTarget, 100f); - - } - else - { - - setObjVar(self, "intHyperspacing", 1); - - destroyObjectHyperspace(self); - - } - } - if (strName.equals("leaderSpawnerArrival")) - { - obj_id[] objMembers = ship_ai.squadGetUnitList(ship_ai.unitGetSquadId(self)); - - if (hasObjVar(self, "objAttackTarget")) - { - obj_id objAttackTarget = getObjIdObjVar(self, "objAttackTarget"); - for (int intI = 0; intI< objMembers.length; intI++) - { - testAbortScript(); - - ship_ai.unitAddDamageTaken(objMembers[intI], objAttackTarget, 100f); - - } - } - else - { - for (int intI = 0; intI< objMembers.length; intI++) - { - testAbortScript(); - - if (objMembers[intI] != self) - { - - setObjVar(objMembers[intI], "intCleaningUp", 1); - setObjVar(objMembers[intI], "intHyperspacing", 1); - destroyObjectHyperspace(objMembers[intI]); - - } - } - setObjVar(self, "intHyperspacing", 1); - - destroyObjectHyperspace(self); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnSpaceUnitDocked(obj_id self, obj_id objStation) throws InterruptedException - { - dictionary dctParams = new dictionary(); - dctParams.put("objShip", self); - space_utils.notifyObject(objStation, "objectDocked", dctParams); - - return SCRIPT_CONTINUE; - } - - - public int handleUnitIncreaseHate(obj_id self, dictionary params) throws InterruptedException - { - obj_id unitToHate = params.getObjId( "unitToHate"); - float amountToHate = params.getFloat( "amountToHate"); - float hateDelay = params.getFloat( "hateDelay"); - int maxRecursions = params.getInt( "maxRecursions"); - ship_ai.unitIncreaseHate( self, unitToHate, amountToHate, hateDelay, maxRecursions ); - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/space/combat/combat_ship.java b/sku.0/sys.server/compiled/game/script/space/combat/combat_ship.java deleted file mode 100644 index cb65a62dc..000000000 --- a/sku.0/sys.server/compiled/game/script/space/combat/combat_ship.java +++ /dev/null @@ -1,1381 +0,0 @@ -package script.space.combat; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.space_combat; -import script.library.space_battlefield; -import script.library.space_crafting; -import script.library.pclib; -import script.library.space_utils; -import script.library.space_content; -import script.library.ship_ai; -import script.library.utils; -import script.library.space_transition; -import script.library.space_pilot_command; -import script.library.gcw; - - -public class combat_ship extends script.base_script -{ - public combat_ship() - { - } - public static final float BROKEN_COMPONENT_DEFAULT_MASS = 50000f; - public static final float SPACE_YACHT_COMPONENT_DEFAULT_MASS = 0f; - - public static final string_id SID_TARGET_DISABLED = new string_id( "space/quest", "target_disabled2"); - - public static final int DROID_VOCALIZE_REACT_CHANCE = 2; - - public static final int SHIP_DAMAGED_SKILLMOD_PENALTY_TIME = 10; - public static final int SHIP_FIRED_SKILLMOD_PENALTY_TIME = 5; - - public static final float STUNNED_COMPONENT_LOOP_TIME = 5.0f; - - public static final String NO_DAMAGE_WARN = "clienteffect/cbt_friendlyfire_warn.cef"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - int[] intSlots = getShipChassisSlots(self); - for (int intI = 0; intI 0.f) - { - notifyShipDamage(self, null, damage); - } - - float fltRemainingDamage = space_combat.doShieldDamage(null, self, space_combat.SHIP, damage, frontBack); - - return SCRIPT_CONTINUE; - } - - - public int OnShipHitByEnvironment(obj_id self, int frontBack, float damage) throws InterruptedException - { - - if (damage > 0.f) - { - notifyShipDamage(self, null, damage); - } - - float fltRemainingDamage = space_combat.doShieldDamage(null, self, space_combat.SHIP, damage, frontBack); - - return SCRIPT_CONTINUE; - } - - - public int OnShipWasHit(obj_id self, obj_id objAttacker, int intWeaponIndex, boolean isMissile, int missileType, int intTargetedComponent, boolean fromPlayerAutoTurret, float hitLocationX_o, float hitLocationY_o, float hitLocationZ_o) throws InterruptedException - { - - int intDisabledTime = getIntObjVar(self, "isDisabled"); - if (intDisabledTime > 0) - { - - int intTime = getGameTime(); - - if (intTime > intDisabledTime) - { - - setObjVar(self, "isDisabled", 0); - } - else - { - - return SCRIPT_CONTINUE; - } - } - int intWeaponSlot = intWeaponIndex + ship_chassis_slot_type.SCST_weapon_0; - - if (hasObjVar(self, "intInvincible")) - { - - ship_ai.unitAddDamageTaken(self, objAttacker, 1.0f); - return SCRIPT_CONTINUE; - } - - if (space_utils.isPlayerControlledShip( objAttacker ) && hasObjVar( self, "objMissionOwner" )) - { - obj_id objOwner = getObjIdObjVar( self, "objMissionOwner"); - if (isIdValid( objOwner ) && exists( objOwner )) - { - boolean absorb = true; - - obj_id group_id = getGroupObject( objOwner ); - - if (isIdValid(group_id)) - { - - obj_id[] groupMembers = space_utils.getSpaceGroupMemberIds( group_id ); - if (groupMembers != null) - { - for (int i=0; i 0.f) - { - notifyShipDamage(self, objAttacker, fltDamage); - ship_ai.unitAddDamageTaken(self, objAttacker, fltDamage); - } - - if (space_utils.isPlayerControlledShip(self)) - { - if (!utils.hasLocalVar(self, "cmd.wasDamagedSkillMod")) - { - int time = getGameTime(); - utils.setLocalVar(self, "cmd.wasDamagedSkillMod", SHIP_DAMAGED_SKILLMOD_PENALTY_TIME+time); - } - } - float fltRemainingDamage = space_combat.doShieldDamage(objAttacker, self, intWeaponSlot, fltDamage, intSide); - - if (fltRemainingDamage > 0) - { - fltRemainingDamage = space_combat.doArmorDamage(objAttacker, self, intWeaponSlot, fltRemainingDamage, intSide); - - if (fltRemainingDamage > 0) - { - fltRemainingDamage = space_combat.doComponentDamage(objAttacker, self, intWeaponSlot, intTargetedComponent, fltRemainingDamage, intSide); - - if (fltRemainingDamage > 0) - { - if (rand (1, 10) < DROID_VOCALIZE_REACT_CHANCE) - { - if (space_utils.isPlayerControlledShip(self)) - { - space_combat.flightDroidVocalize(self, 1); - } - } - - fltRemainingDamage = space_combat.doChassisDamage(objAttacker, self, intWeaponSlot,fltRemainingDamage); - - if (fltRemainingDamage > 0) - { - setShipCurrentChassisHitPoints(self, 0.0f); - - obj_id objDefenderPilot = getPilotId(self); - if (!space_utils.isPlayerControlledShip(self)) - { - - if (space_utils.isPlayerControlledShip(objAttacker)||(hasObjVar(objAttacker, "commanderPlayer"))) - { - - if (utils.hasLocalVar(self, "space.give_rewards" )) - { - - utils.setLocalVar(self, "space.give_rewards", 2); - } - else - { - utils.setLocalVar(self, "space.give_rewards", 1); - } - - space_combat.checkAndPerformCombatTaunts(self, objAttacker, "fltDieTauntChance", "death", 0); - - space_combat.targetDestroyed(self); - return SCRIPT_CONTINUE; - } - else - { - space_combat.targetDestroyed(self); - return SCRIPT_CONTINUE; - } - } - else - { - - space_combat.setDeathFlags(self); - space_combat.sendDestructionNotification(self, objAttacker); - - float fltIntensity = rand(0, 1.0f); - handleShipDestruction(self, fltIntensity); - - if (space_utils.isPlayerControlledShip(objAttacker)) - { - - obj_id[] crew = space_utils.getAllPlayersInShip(objAttacker); - gcw.grantSpacePvpKillCredit(getPilotId(self), crew); - utils.setScriptVar(self, "intPVPKill", 1); - } - messageTo(self, "killSpacePlayer", null, 10.0f, true); - space_combat.doDeathCleanup(self); - CustomerServiceLog("space_death", "%TU "+self+" Has been killed by "+objAttacker, getOwner(objAttacker)); - if (space_battlefield.isInBattlefield(self)) - { - CustomerServiceLog("battlefield", "%TU "+self+" Has been killed by "+objAttacker, getOwner(objAttacker)); - } - } - } - } - - if (rand (1, 10) < DROID_VOCALIZE_REACT_CHANCE) - { - if (space_utils.isPlayerControlledShip(self)) - { - space_combat.flightDroidVocalize(self, 2); - } - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int killSpacePlayer(obj_id self, dictionary params) throws InterruptedException - { - Vector objPlayers = space_transition.getContainedPlayers(self, null); - if (objPlayers != null) - { - for (int intI = 0; intI< objPlayers.size(); intI++) - { - testAbortScript(); - space_combat.strikeBomberCleanup(((obj_id)(objPlayers.get(intI)))); - } - } - - space_combat.killSpacePlayer(self); - space_combat.clearDeathFlags(self); - return SCRIPT_CONTINUE; - } - - - public int OnSpaceUnitEnterCombat(obj_id self, obj_id objTarget) throws InterruptedException - { - - setCondition(self, CONDITION_WINGS_OPENED); - space_combat.checkAndPerformCombatTaunts(self, objTarget, "fltIntroTauntChance", "entercombat", 0); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - debugServerConsoleMsg( null, "combat_ship.OnInitialize: entered!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); - setCondition( self, CONDITION_ON ); - String strChassisType = getShipChassisType(self); - int[] intSlots = space_crafting.getShipInstalledSlots(self); - for (int intI = 0; intI< intSlots.length; intI++) - { - testAbortScript(); - - int currentSlotComponentType = ship_chassis_slot_type.getComponentTypeForSlot(intSlots[intI]); - if (currentSlotComponentType != ship_component_type.SCT_modification) - { - float currentComponentMass = getShipComponentMass(self, intSlots[intI]); - if (strChassisType.equals("player_sorosuub_space_yacht")) - { - if (currentComponentMass != 0) - { - setShipComponentMass(self, intSlots[intI], SPACE_YACHT_COMPONENT_DEFAULT_MASS); - } - } - else if (currentComponentMass == 0) - { - setShipComponentMass(self, intSlots[intI], BROKEN_COMPONENT_DEFAULT_MASS); - } - } - if (intSlots[intI] == space_crafting.ENGINE) - { - - space_crafting.setupChassisDifferentiation(self); - } - space_combat.recalculateEfficiency(intSlots[intI],self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - debugSpeakMsg(self, "KABOOM"); - - obj_id[] notifylist = getObjIdArrayObjVar( self, "destroynotify"); - if (notifylist != null) - { - dictionary outparams = new dictionary(); - outparams.put( "object", self ); - for (int i=0; i 1) - { - - string_id strSpam = new string_id("space/space_interaction", "power_spike"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - - --pumpPulseLoops; - params.put( "ship", ship ); - params.put( "loops", pumpPulseLoops ); - params.put( "pilot", pilot ); - - messageTo( self, "reactorPumpPulseTimeout", params, 5.0f, false ); - } - else if (pumpPulseLoops == 1) - { - string_id strSpam = new string_id("space/space_interaction", "reactor_normalizing"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - - --pumpPulseLoops; - params.put( "ship", ship ); - params.put( "loops", pumpPulseLoops ); - params.put( "pilot", pilot ); - messageTo( self, "reactorPumpPulseTimeout", params, 5.0f, false ); - } - else - { - if (isIdValid(ship)) - { - string_id strSpam = new string_id("space/space_interaction", "reactor_stabilized"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - - space_pilot_command.allPurposeShipComponentReset(ship); - - utils.removeScriptVar(pilot, "cmd.reactorPumpPulse"); - } - else - { - debugServerConsoleMsg( null, "+++ MH reactorPumpPulseTimeout . obj_id of the ship passed into the reactor reset function doesn't come back as valid. What the!?."); - } - } - - return SCRIPT_CONTINUE; - } - - - public int unScramReactor(obj_id self, dictionary params) throws InterruptedException - { - - obj_id ship = params.getObjId( "ship"); - int scramLoops = params.getInt( "loops"); - obj_id pilot = params.getObjId( "pilot"); - - if (scramLoops > 1) - { - - string_id strSpam = new string_id("space/space_interaction", "reactor_standby"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - - String cefPlayBackHardpoint = space_combat.targetHardpointForCefPlayback(ship); - playClientEffectObj(pilot, "clienteffect/space_command/scram_reactor_shutdown_alarm.cef", ship, cefPlayBackHardpoint); - - --scramLoops; - params.put( "ship", ship ); - params.put( "loops", scramLoops ); - params.put( "pilot", pilot ); - messageTo( self, "unScramReactor", params, 5.0f, false ); - } - else if (scramLoops == 1) - { - - string_id strSpam = new string_id("space/space_interaction", "beginning_reactor_restart"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - - String cefPlayBackHardpoint = space_combat.targetHardpointForCefPlayback(ship); - playClientEffectObj(pilot, "clienteffect/space_command/scram_reactor_startup_engine.cef", ship, cefPlayBackHardpoint); - - --scramLoops; - params.put( "ship", ship ); - params.put( "loops", scramLoops ); - params.put( "pilot", pilot ); - messageTo( self, "unScramReactor", params, 8.0f, false ); - } - else - { - space_pilot_command.allPurposeShipComponentReset(ship); - utils.removeScriptVar(pilot, "cmd.reactorPumpPulse"); - } - return SCRIPT_CONTINUE; - } - - - public int OnShipComponentPowerSufficient(obj_id self, int intSlot, float fltPowerReceived) throws InterruptedException - { - obj_id objPilot = getPilotId(self); - float fltCurrentHitPoints = getShipComponentHitpointsCurrent(self, intSlot); - - if (fltCurrentHitPoints > 0) - { - space_utils.setComponentDisabled(self, intSlot, false); - space_combat.recalculateEfficiency(intSlot, self); - } - return SCRIPT_CONTINUE; - } - - - public int OnShipComponentPowerInsufficient(obj_id self, int intSlot, float fltPowerRequired, float fltPowerReceived) throws InterruptedException - { - if (fltPowerRequired == 0) - { - fltPowerRequired = 1.0f; - } - float fltTest = fltPowerReceived / fltPowerRequired; - - if (fltTest < space_combat.MINIMUM_EFFICIENCY) - { - space_utils.setComponentDisabled(self, intSlot, true); - setShipComponentDisabledNeedsPower(self, intSlot, true); - } - else - { - space_combat.recalculateEfficiencyGeneral(intSlot, self, fltTest); - } - - return SCRIPT_CONTINUE; - } - - - public int OnShipComponentInstalling(obj_id self, obj_id installerId, obj_id componentId, int slot) throws InterruptedException - { - obj_id owner = getOwner (self); - if (isIdValid(owner)) - { - if (!hasCertificationsForItem (owner, self)) - { - - string_id strSpam = new string_id("space/space_interaction", "certification_ship_none"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - - return SCRIPT_OVERRIDE; - } - else - { - if (!hasCertificationsForItem (owner, componentId)) - { - - string_id strSpam = new string_id("space/space_interaction", "certification_ordnance_none"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - return SCRIPT_OVERRIDE; - } - } - if (!isGameObjectTypeOf (componentId, GOT_ship_component_modification)) - { - if (hasObjVar(componentId, "ship_comp.mass")) - { - float componentMass = space_crafting.getComponentMass(componentId); - if (componentMass == 0) - { - string_id strSpam = new string_id("space/space_interaction", "installing_zero_mass_component"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - return SCRIPT_OVERRIDE; - } - } - } - - } - else - { - debugServerConsoleMsg( null, "+++ COMBAT_SHIP.OnShipComponentInstalling +++ Unable to find ships owner, so cannot check certifications. What the!?."); - } - - return SCRIPT_CONTINUE; - } - - - public int OnShipComponentInstalled(obj_id self, obj_id objInstaller, int intSlot) throws InterruptedException - { - if (intSlot == space_crafting.ENGINE) - { - - space_crafting.setupChassisDifferentiation(self); - - } - space_pilot_command.allPurposeShipComponentReset(self); - return SCRIPT_CONTINUE; - - } - - - public int OnShipFiredCountermeasure(obj_id self, int intWeaponIndex, obj_id objPlayer) throws InterruptedException - { - int intSlot = intWeaponIndex + ship_chassis_slot_type.SCST_weapon_first; - - float fltMinDefense = getShipWeaponDamageMaximum(self, intSlot); - float fltMaxDefense = getShipWeaponDamageMaximum(self, intSlot); - float fltRoll = rand(fltMinDefense, fltMaxDefense); - - int intMissile = getNearestUnlockedMissileForTarget(self); - - if (intMissile == 0) - { - launchCountermeasure(self, 0, false, 0); - } - else - { - - if (fltRoll>getMissileDefenseRoll(intMissile)) - { - - launchCountermeasure(self, intMissile, true, 0); - - } - else - { - - launchCountermeasure(self, intMissile, false, 0); - - } - } - - applyFiredWeaponsSkillMod(self); - return SCRIPT_CONTINUE; - } - - - public int OnShipFiredMissile(obj_id self, int intMissileId, int intWeaponIndex, int intMissileType, obj_id objPilot, obj_id objDefender, int intTargetedSlot) throws InterruptedException - { - int intSlot = intWeaponIndex + ship_chassis_slot_type.SCST_weapon_first; - - if (isIdValid(objPilot)) - { - if (utils.checkConfigFlag("ScriptFlags","e3Demo")) - { - setShipWeaponAmmoCurrent(self, intSlot,getShipWeaponAmmoCurrent(self, intSlot)); - return SCRIPT_CONTINUE; - } - - applyFiredWeaponsSkillMod(self); - } - - return SCRIPT_CONTINUE; - } - - - public int getMissileDefenseRoll(int intMissileId) throws InterruptedException - { - - int intMissileType = getTypeByMissile(intMissileId); - - dictionary dctRow = dataTableGetRow("datatables/space/missiles.iff", intMissileType); - - return(dctRow.getInt("intCountermeasureDifficulty")); - } - - - public int flightDroidVocalize(obj_id self, dictionary params) throws InterruptedException - { - obj_id ship = params.getObjId( "ship"); - int vocalizePriority = params.getInt( "vocalizePriority"); - - if (space_utils.isPlayerControlledShip(self)) - { - space_combat.flightDroidVocalize(ship, vocalizePriority); - } - return SCRIPT_CONTINUE; - } - - - public int emergencyPowerTimeout(obj_id self, dictionary params) throws InterruptedException - { - - obj_id ship = params.getObjId( "ship"); - obj_id pilot = params.getObjId( "pilot"); - float emergencyPowerTime = params.getFloat( "emergencyPowerTime"); - - if (!isIdValid(ship)) - { - debugServerConsoleMsg( null, "+++ MH emergencyPowerTimeout . obj_id of the ship passed into the emergency power timeout function doesn't come back as valid. What the!?."); - return SCRIPT_CONTINUE; - } - - string_id strSpam = new string_id("space/space_interaction", "emergency_reset"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - - String cefPlayBackHardpoint = space_combat.targetHardpointForCefPlayback(ship); - playClientEffectObj(self, "clienteffect/space_command/emergency_power_off.cef", ship, cefPlayBackHardpoint); - - space_pilot_command.allPurposeShipComponentReset(ship); - - if (utils.hasLocalVar(ship, "cmd.emergWeapon")) - { - utils.removeLocalVar(ship, "cmd.emergWeapon"); - } - if (utils.hasLocalVar(ship, "cmd.emergShields")) - { - utils.removeLocalVar(ship, "cmd.emergShields"); - } - if (utils.hasLocalVar(ship, "cmd.emergThrust")) - { - utils.removeLocalVar(ship, "cmd.emergThrust"); - } - - return SCRIPT_CONTINUE; - } - - - public void applyFiredWeaponsSkillMod(obj_id ship) throws InterruptedException - { - if (!utils.hasLocalVar(ship, "cmd.firedWeaponsSkillMod")) - { - int time = getGameTime(); - utils.setLocalVar(ship, "cmd.firedWeaponsSkillMod", SHIP_FIRED_SKILLMOD_PENALTY_TIME+time); - } - return; - } - - - public int componentsStunned(obj_id self, dictionary params) throws InterruptedException - { - Vector stunnedComponents = params.getResizeableIntArray( "stunned_components"); - int stunDuration = params.getInt( "stun_loops"); - obj_id pilot = null; - String cefPlayBackHardpoint = space_combat.targetHardpointForCefPlayback(self); - - boolean boolPlayerShip = false; - if (!space_utils.isPlayerControlledShip(self)) - { - boolPlayerShip = true; - } - if (stunDuration > 20) - { - if (boolPlayerShip) - { - - playClientEffectObj(self, "clienteffect/space_command/cbt_impact_emp_hvy.cef", self, ""); - - if (stunnedComponents.size() > 1) - { - string_id strSpam = new string_id("space/space_pilot_command", "multiple_systems_disrupted"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - } - else - { - - string_id strSpam = new string_id("space/space_pilot_command", "system_disrupted"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - } - } - else - { - playClientEffectObj(self, "clienteffect/space_command/cbt_impact_emp_hvy_noshake.cef", self, ""); - } - } - else if (stunDuration < 20 && stunDuration > 0) - { - if (boolPlayerShip) - { - - string_id strSpam = new string_id("space/space_pilot_command", "disrupted_standby"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - } - } - else - { - if (boolPlayerShip) - { - string_id strSpam = new string_id("space/space_pilot_command", "sub_system_restart"); - space_utils.sendSystemMessageShip(self, strSpam, true, false, true, true); - } - - for (int i = 0; i < stunnedComponents.size(); i++) - { - testAbortScript(); - space_utils.setComponentDisabled(self,((Integer)(stunnedComponents.get(i))).intValue(),false); - space_combat.recalculateEfficiency(((Integer)(stunnedComponents.get(i))).intValue(), self); - } - - return SCRIPT_CONTINUE; - } - - stunDuration--; - - params.put( "stunned_components", stunnedComponents ); - params.put( "stun_loops", stunDuration ); - messageTo( self, "componentsStunned", params, STUNNED_COMPONENT_LOOP_TIME, false ); - - return SCRIPT_CONTINUE; - } - - - public int vRepairDamageCEFLoop(obj_id self, dictionary params) throws InterruptedException - { - int damageLoops = params.getInt( "damage_loops"); - obj_id pilot = params.getObjId( "pilot"); - - debugServerConsoleMsg(null, "vRepairDamageCEFLoop ********** just entered message handler. Recieved number of loops of: "+damageLoops+" and pilot objId of: "+pilot); - - String cefPlayBackHardpoint = space_combat.targetHardpointForCefPlayback(self); - - String clientEffect = space_pilot_command.randomWeldingCEFPicker(); - debugServerConsoleMsg(null, "vRepairDamageCEFLoop ********** cef chosen for playback is "+clientEffect); - - transform t = new transform(); - t = t.move_p(new vector(0.0f, 1.7f, 0.0f)); - - debugServerConsoleMsg(null, "vRepairDamageCEFLoop ********** DID CRAZY TRANSFORM STUFF. HERE COMES THE EFFECT!!! "); - - if (!playClientEffectObj(pilot, clientEffect, self, null, t)) - { - debugServerConsoleMsg(null, "vRepairDamageCEFLoop ********** FAILED TO PLAYBACK CEF "); - } - - damageLoops--; - - if (damageLoops > 0) - { - params.put( "damage_loops", damageLoops ); - params.put( "pilot", pilot ); - messageTo( self, "vRepairDamageCEFLoop", params, 3.0f, false ); - } - - return SCRIPT_CONTINUE; - - } - - - public int OnSpaceUnitDocked(obj_id self, obj_id target) throws InterruptedException - { - obj_id objPilot = getPilotId( self ); - if (!space_utils.isPlayerControlledShip(self)) - { - return SCRIPT_CONTINUE; - } - dictionary outparams = new dictionary(); - outparams.put( "target", target ); - space_utils.notifyObject( objPilot, "spaceUnitDocked", outparams ); - - return SCRIPT_CONTINUE; - } - - - public int OnSpaceUnitUnDocked(obj_id self, obj_id target, boolean dockSuccessful) throws InterruptedException - { - obj_id objPilot = getPilotId( self ); - if (!space_utils.isPlayerControlledShip(self)) - { - return SCRIPT_CONTINUE; - } - dictionary outparams = new dictionary(); - outparams.put( "target", target ); - - if (dockSuccessful) - { - space_utils.notifyObject( objPilot, "spaceUnitUnDocked", outparams ); - } - else - { - space_utils.notifyObject( objPilot, "spaceUnitDockingFailed", outparams ); - } - - return SCRIPT_CONTINUE; - } - - - public int openComm(obj_id self, dictionary params) throws InterruptedException - { - - obj_id objStation = params.getObjId("objStation"); - obj_id objPilot = getPilotId(self); - - queueCommand(objPilot, (80588750), objStation, "0 ", COMMAND_PRIORITY_FRONT); - - return SCRIPT_CONTINUE; - } - - - public int OnSpeaking(obj_id self, String strText) throws InterruptedException - { - obj_id objPilot = getPilotId(self); - if (isIdValid(objPilot)) - { - - if (isGod(objPilot)||(utils.checkConfigFlag("scriptFlags", "e3Demo"))) - { - Object[] newParams = new Object[2]; - newParams[0] = objPilot; - newParams[1] = strText; - space_utils.callTrigger("OnSpeaking", newParams ); - } - - } - return SCRIPT_CONTINUE; - } - - - public int checkSpacePVPStatus(obj_id self, dictionary params) throws InterruptedException - { - space_transition.updatePVPStatus(self); - return SCRIPT_CONTINUE; - - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - setObjVar(self, "intCleaningUp", 1); - destroyObject(self); - return SCRIPT_CONTINUE; - - } -} diff --git a/sku.0/sys.server/compiled/game/script/space/quest_logic/assassinate.java b/sku.0/sys.server/compiled/game/script/space/quest_logic/assassinate.java deleted file mode 100644 index cc5873eee..000000000 --- a/sku.0/sys.server/compiled/game/script/space/quest_logic/assassinate.java +++ /dev/null @@ -1,367 +0,0 @@ -package script.space.quest_logic; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.space_create; -import script.library.space_quest; -import script.library.space_utils; -import script.library.space_transition; -import script.library.utils; -import script.library.ship_ai; -import script.library.prose; -import script.library.money; - - - -public class assassinate extends script.space.quest_logic.recovery -{ - public assassinate() - { - } - public static final String SOUND_SPAWN_ENEMY = "clienteffect/ui_quest_spawn_enemy.cef"; - public static final String SOUND_DESTROYED_ALL = "clienteffect/ui_quest_destroyed_all.cef"; - public static final string_id WARPOUT_FAILURE = new string_id( "space/quest", "warpout_failure"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - - String questName = getStringObjVar( self, space_quest.QUEST_NAME ); - String questType = getStringObjVar( self, space_quest.QUEST_TYPE ); - obj_id player = getObjIdObjVar( self, space_quest.QUEST_OWNER ); - if ((questName == null) || (questType == null)) - { - - return SCRIPT_OVERRIDE; - } - - String qTable = "datatables/spacequest/"+questType+"/"+questName+".iff"; - dictionary questInfo = dataTableGetRow( qTable, 0 ); - if (questInfo == null) - { - - sendSystemMessageTestingOnly( player, "Debug: Failed to open quest table "+qTable ); - return SCRIPT_OVERRIDE; - } - - setObjVar( self, "targetArrivalDelay", questInfo.getInt("targetArrivalDelay") ); - - String targetShip = questInfo.getString("targetShipType"); - if (targetShip != null) - { - setObjVar( self, "targetShipType", targetShip ); - } - - String[] escortShips = dataTableGetStringColumn( qTable, "targetEscort"); - space_quest.cleanArray( self, "escortShips", escortShips ); - setObjVar( self, "mustDestroyEscort", questInfo.getInt( "mustDestroyEscort") ); - - setObjVar( self, "targetAttackMode", questInfo.getInt("targetAttackMode") ); - - setObjVar( self, "numResponses", questInfo.getInt( "numResponses") ); - - String[] escortPath = dataTableGetStringColumn( qTable, "escortPath"); - space_quest.cleanArray( self, "escortPath", escortPath ); - - String questZone = getStringObjVar( self, space_quest.QUEST_ZONE ); - if (getCurrentSceneName().startsWith( questZone )) - { - dictionary outparams = new dictionary(); - outparams.put( "player", player ); - messageTo( self, "initializedQuestPlayer", outparams, 1.f, false ); - } - - int questid = questGetQuestId( "spacequest/"+questType+"/"+questName ); - if (questid != 0) - { - questActivateTask( questid, 0, player ); - if (questInfo.getInt( "mustDestroyEscort" ) == 1) - { - questActivateTask( questid, 2, player ); - } - - setObjVar( self, "taskId", 1 ); - questActivateTask( questid, 1, player ); - } - - return SCRIPT_OVERRIDE; - } - - - public int warpInTarget(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = getObjIdObjVar( self, space_quest.QUEST_OWNER ); - - String questZone = getStringObjVar( self, space_quest.QUEST_ZONE ); - if (!getCurrentSceneName().startsWith( questZone )) - { - return SCRIPT_OVERRIDE; - } - - int targetAttackMode = getIntObjVar( self, "targetAttackMode"); - - obj_id ship = createTargetShip( self ); - ship_ai.unitSetLeashDistance( ship, 16000 ); - setObjVar( self, "target", ship ); - setLookAtTarget( player, ship ); - setObjVar( ship, "quest", self ); - attachScript( ship, "space.quest_logic.assassinate_target"); - switch( targetAttackMode ) - { - case 0: - ship_ai.unitSetAttackOrders( ship, ship_ai.ATTACK_ORDERS_RETURN_FIRE ); - break; - case 1: - ship_ai.unitSetAttackOrders( ship, ship_ai.ATTACK_ORDERS_ATTACK_FREELY ); - break; - case 2: - ship_ai.unitSetAttackOrders( ship, ship_ai.ATTACK_ORDERS_HOLD_FIRE ); - break; - } - - space_quest._addMissionCriticalShip( player, self, ship ); - - playClientEffectObj( player, SOUND_SPAWN_ENEMY, player, ""); - - setObjVar( ship, "objMissionOwner", player ); - ship_ai.unitAddExclusiveAggro( ship, player ); - - messageTo( self, "updateTargetWaypoint", null, 1.f, false ); - - transform[] translist = getPathTransforms( self, true ); - ship_ai.unitAddPatrolPath( ship, translist ); - dictionary outparams = new dictionary(); - outparams.put( "quest", self ); - outparams.put( "loc", getLocationObjVar( self, "last_loc") ); - outparams.put( "player", player ); - outparams.put( "dest", "escape"); - messageTo( ship, "registerDestination", outparams, 1.f, false ); - - String[] shipTypes = getStringArrayObjVar( self, "escortShips"); - if (shipTypes != null) - { - int escortSquad = ship_ai.squadCreateSquadId(); - obj_id[] escorts = new obj_id[shipTypes.length]; - for (int i=0; i 0) - { - ship_ai.squadFollow( escortSquad, ship, new vector(0,0,1), 10 ); - ship_ai.squadSetGuardTarget( escortSquad, ship_ai.unitGetSquadId(ship) ); - - switch( targetAttackMode ) - { - case 0: - ship_ai.squadSetAttackOrders( escortSquad, ship_ai.ATTACK_ORDERS_RETURN_FIRE ); - break; - case 1: - ship_ai.squadSetAttackOrders( escortSquad, ship_ai.ATTACK_ORDERS_ATTACK_FREELY ); - break; - case 2: - ship_ai.squadSetAttackOrders( escortSquad, ship_ai.ATTACK_ORDERS_HOLD_FIRE ); - break; - } - } - } - - String questName = getStringObjVar( self, space_quest.QUEST_NAME ); - String questType = getStringObjVar( self, space_quest.QUEST_TYPE ); - string_id status_update = new string_id( "spacequest/"+questType+"/"+questName, "arrival_phase_2"); - questUpdate( self, status_update ); - - return SCRIPT_OVERRIDE; - } - - - public int assassinateSuccess(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - String questName = getStringObjVar( self, space_quest.QUEST_NAME ); - String questType = getStringObjVar( self, space_quest.QUEST_TYPE ); - obj_id player = getObjIdObjVar( self, space_quest.QUEST_OWNER ); - obj_id ship = params.getObjId( "ship"); - int mustDestroyEscort = getIntObjVar( self, "mustDestroyEscort"); - int escortDestroyed = getIntObjVar( self, "escortDestroyed"); - - int questid = questGetQuestId( "spacequest/"+questType+"/"+questName ); - if ((questid != 0) && questIsTaskActive( questid, 1, player )) - { - questCompleteTask( questid, 1, player ); - } - - if ((mustDestroyEscort == 1) && (escortDestroyed == 0)) - { - - string_id update = new string_id( "spacequest/"+questType+"/"+questName, "destroy_escort"); - questUpdate( self, update ); - - setObjVar( self, "targetDestroyed", 1 ); - } - else if ((mustDestroyEscort == 0) || ((mustDestroyEscort == 1) && (escortDestroyed == 1))) - { - if (questid != 0 && questIsQuestActive( questid, player )) - { - questCompleteQuest( questid, player ); - } - - string_id update = new string_id( "spacequest/"+questType+"/"+questName, "assassinate_success"); - questUpdate( self, update ); - - messageTo( self, "completeQuestMsg", null, 2.f, false ); - } - - return SCRIPT_CONTINUE; - } - - - public int targetEscaped(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - String questName = getStringObjVar( self, space_quest.QUEST_NAME ); - String questType = getStringObjVar( self, space_quest.QUEST_TYPE ); - obj_id player = getObjIdObjVar( self, space_quest.QUEST_OWNER ); - obj_id ship = params.getObjId( "target"); - - string_id status_update = new string_id( "spacequest/"+questType+"/"+questName, "failed_escape"); - questUpdate( self, status_update ); - - cleanupShips( self ); - questFailed( self ); - - return SCRIPT_CONTINUE; - } - - - public int handleShipDestroyed(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_OVERRIDE; - } - - String questName = getStringObjVar( self, space_quest.QUEST_NAME ); - String questType = getStringObjVar( self, space_quest.QUEST_TYPE ); - obj_id player = getObjIdObjVar( self, space_quest.QUEST_OWNER ); - obj_id destroyed = params.getObjId( "ship"); - obj_id[] escorts = getObjIdArrayObjVar( self, "escorts"); - int dead_escorts = getIntObjVar( self, "dead_escorts"); - int mustDestroyEscort = getIntObjVar( self, "mustDestroyEscort"); - int targetDestroyed = getIntObjVar( self, "targetDestroyed"); - - if (escorts == null) - { - return SCRIPT_OVERRIDE; - } - - for (int i=0; i 0) - { - int time_stamp = getIntObjVar( self, player_structure.VAR_LAST_MAINTANENCE ); - if (time_stamp < 1) - { - time_stamp = getGameTime(); - setObjVar(self, player_structure.VAR_LAST_MAINTANENCE, time_stamp); - } - - messageTo( self, "OnMaintenanceLoop", null, 30.0f, false ); - } - - if (player_structure.isCivic( self )) - { - permissionsMakePublic( self ); - } - - city.validateCityStructure( self ); - - int city_id = getCityAtLocation(getLocation(self), 0); - obj_id mayor = cityGetLeader(city_id); - updateOwnerAndAdmin(self, mayor); - - LOG("LOG_CHANNEL", "permanent_structure::OnInitialize -- complete"); - - if (player_structure.isHarvester(self) || player_structure.isGenerator(self)) - { - player_structure.validateHarvestedResources(self); - } - - if (!player_structure.isInstallation(self)) - { - if (hasObjVar(self, player_structure.VAR_SIGN_NAME)) - { - String signName = getStringObjVar(self, player_structure.VAR_SIGN_NAME); - if (signName != null && !signName.equals("")) - { - if (!isAppropriateText(signName)) - { - removeObjVar(self, player_structure.VAR_SIGN_NAME); - } - } - } - } - else - { - if (!isAppropriateText(getName(self))) - { - setName(self, ""); - } - } - - player_structure.createStructureSign(self); - player_structure.createStructureDecorOnInitialize(self); - - if (hasObjVar(self, "structure.player.pack")) - { - removeObjVar(self, "structure.player.pack"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToReceiveItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - LOG("LOG_CHANNEL", "permanent_structure::OnAboutToReceiveItem --"+ transferer + " - "+ item); - - int myGot = getGameObjectType(self); - if (isGameObjectTypeOf(myGot, GOT_building)) - { - if (!isPlayer(item) && !isMob(item)) - { - - obj_id structure = getTopMostContainer(self); - - if (isIdValid(transferer)) - { - if (isPlayer(transferer)) - { - if (player_structure.canPlaceObject(structure, transferer)) - { - - return SCRIPT_CONTINUE; - } - else - { - return SCRIPT_OVERRIDE; - } - } - } - else - { - - return SCRIPT_CONTINUE; - } - } - else if (isPlayer( item )) - { - - if (player_structure.isCivic( self ) && city.isCityBanned( item, self ) && !player_structure.isOwner(item, self) && !isIdValid(srcContainer)) - { - sendSystemMessage( item, SID_YOURE_CITY_BANNED ); - return SCRIPT_OVERRIDE; - } - - if (player_structure.isStructureCondemned(self)) - { - player_structure.doCondemnedSui(self, item); - return SCRIPT_OVERRIDE; - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToLoseItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - LOG("LOG_CHANNEL", "permanent_structure::OnAboutToLooseItem --"+ transferer + " - "+ item); - - int myGot = getGameObjectType(self); - if (isGameObjectTypeOf(myGot, GOT_building)) - { - if (!isPlayer(item) && !isMob(item)) - { - - obj_id structure = getTopMostContainer(self); - - if (hasObjVar(item, player_structure.VAR_IS_PLACED_OBJECT)) - { - if (isPlayer(transferer)) - { - if (player_structure.isAdmin(structure, transferer)) - { - return SCRIPT_CONTINUE; - } - else - { - LOG("LOG_CHANNEL", transferer + "-> You must be an admin to pick up an item here."); - sendSystemMessageTestingOnly(transferer, "You must be an admin to pick up an item here."); - return SCRIPT_OVERRIDE; - } - } - } - else - { - - return SCRIPT_CONTINUE; - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnReceivedItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - LOG("LOG_CHANNEL", "permanent_structure::OnReceivedItem --"+ transferer + " - "+ item); - - int myGot = getGameObjectType(self); - if (isGameObjectTypeOf(myGot, GOT_building)) - { - LOG("LOG_CHANNEL", "permanent_structure::OnReceivedItem --"+ item); - if (!isPlayer(item) && !isMob(item)) - { - - String template = getTemplateName(item); - if (template == null || template.equals("")) - { - return SCRIPT_CONTINUE; - } - - if (template.equals("object/tangible/terminal/terminal_guild.iff")) - { - return SCRIPT_CONTINUE; - } - else if (template.equals("object/tangible/terminal/terminal_player_structure.iff")) - { - return SCRIPT_CONTINUE; - } - - } - else if (isPlayer( item )) - { - - if (player_structure.isOwner( self, item )) - { - if (player_structure.isResidence( self, item )) - { - - if (!hasObjVar( self, player_structure.VAR_RESIDENCE_BUILDING )) - { - setObjVar(self, player_structure.VAR_RESIDENCE_BUILDING, item); - } - - if (city.isInCity( self )) - { - city.addCitizen( item, self ); - } - } - else - { - if (hasObjVar( self, player_structure.VAR_RESIDENCE_BUILDING )) - { - obj_id resident = getObjIdObjVar(self, player_structure.VAR_RESIDENCE_BUILDING ); - if (resident == item) - { - - removeObjVar( self, player_structure.VAR_RESIDENCE_BUILDING); - } - } - } - - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnLostItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - int myGot = getGameObjectType(self); - if (isGameObjectTypeOf(myGot, GOT_building_player)) - { - if (isPlayer(item)) - { - if (!isIdValid(getLocation( item ).cell)) - { - setAggroImmuneDuration(item, 30); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - if (player_structure.isBuilding(self)) - { - player_structure.destroyStructureSign(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnMaintenanceLoop(obj_id self, dictionary params) throws InterruptedException - { - LOG("LOG_CHANNEL", "permanent_structure::OnMaintenanceLoop"); - obj_id objSender = params.getObjId("objSender"); - - boolean boolSender = false; - boolean boolResetTimeStamp = false; - - if (isIdValid(objSender)) - { - boolSender = true; - utils.setScriptVar(self, "objSender", objSender); - } - if (boolSender) - { - sendSystemMessageTestingOnly(objSender, "Received loop"); - } - int time_stamp = getIntObjVar(self, player_structure.VAR_LAST_MAINTANENCE); - int current_time = getGameTime(); - if (!player_structure.isStructureCondemned(self)) - { - if (boolSender) - { - sendSystemMessageTestingOnly(objSender, "structure is Not condemned"); - sendSystemMessageTestingOnly(objSender, "Timestamp is "+time_stamp); - sendSystemMessageTestingOnly(objSender, "Current Time is "+current_time); - } - - if (time_stamp < 1) - { - setObjVar(self, player_structure.VAR_LAST_MAINTANENCE, current_time); - time_stamp = current_time; - } - - int delta_time = current_time - time_stamp; - if (delta_time < 0) - { - CustomerServiceLog("playerStructure","***TIME WARP WARNING: ("+self+") owned by "+player_structure.getStructureOwner(self)+" -> cycles prepaid = "+(-delta_time/player_structure.getMaintenanceHeartbeat())); - } - if (boolSender) - { - sendSystemMessageTestingOnly(objSender, "delta time is "+delta_time); - } - - LOG("LOG", "delta_time is "+delta_time+" and heartbeat is "+player_structure.getMaintenanceHeartbeat()); - int loops = delta_time / player_structure.getMaintenanceHeartbeat(); - - if (boolSender) - { - sendSystemMessageTestingOnly(objSender, "Loops 1 is "+loops); - } - - if (loops < 0) - { - CustomerServiceLog("playerStructure","Structure "+ self + " has a loop of less than zero ("+ loops + ") Owner is "+ player_structure.getStructureOwner(self)); - loops = 0; - } - - if (loops > 200) - { - CustomerServiceLog("playerStructure","Structure "+ self + " has a suspicious number of unpaid maintenance loops ("+ loops + ") Owner is "+ player_structure.getStructureOwner(self)); - loops = 200; - } - - if (boolSender) - { - sendSystemMessageTestingOnly(objSender, "Loops 2 is "+loops); - } - - int cost = player_structure.getMaintenanceRate(self) * loops; - LOG("LOG_CHANNEL", current_time + "/"+ time_stamp + "/"+ player_structure.getMaintenanceHeartbeat() + " loops ->"+ loops + " cost ->"+ cost); - if (boolSender) - { - sendSystemMessageTestingOnly(objSender, "Raw per loop cost is "+player_structure.getMaintenanceRate(self)); - sendSystemMessageTestingOnly(objSender, "Cost is "+cost); - } - - if ((cost > 0) && !player_structure.isCivic( self )) - { - boolResetTimeStamp = true; - if (boolSender) - { - sendSystemMessageTestingOnly(objSender, "Checkign pools "); - } - - int pool_remaining = player_structure.decrementMaintenancePool(self, cost); - if (boolSender) - { - sendSystemMessageTestingOnly(objSender, "Pool remaing is "+pool_remaining); - } - - obj_id objOwner = player_structure.getStructureOwnerObjId(self); - if (boolSender) - { - sendSystemMessageTestingOnly(objSender, "Owner is "+objOwner); - } - - if (player_structure.isBuilding(self)) - { - CustomerServiceLog("playerStructure","Paying maintenance of "+ cost + " on structure "+ self + ". Pool remaining is "+ pool_remaining + ". Owner is "+ player_structure.getStructureOwner(self)); - } - - if (pool_remaining == -1) - { - LOG("LOG_CHANNEL", "permanent_structure::OnMaintenanceLoop -- unable to decrement maintenance pool."); - } - - else if (pool_remaining == -2) - { - - if (player_structure.isBuilding(self) || player_structure.isFactory(self)) - { - LOG("LOG_CHANNEL", "permanent_structure::OnMaintenanceLoop:BUILDING-HOUSE/FACTORY "+self+"-- insufficient funds. Attempting to take money out of owner: "+objOwner+" bank account."); - if (!hasObjVar(self, "structure.intNoMaintenance")) - { - setObjVar(self, "structure.intNoMaintenance", 1); - player_structure.sendOutOfMaintenanceMail(self); - } - - dictionary dctParams = new dictionary(); - dctParams.put("intLoops", loops); - - int weeklyCost = (60 * 60 * 24 * 7 / player_structure.getMaintenanceHeartbeat()) * player_structure.getMaintenanceRate(self); - - dctParams.put("intCost", weeklyCost); - dctParams.put("amount", weeklyCost); - dctParams.put("offlineAmount", weeklyCost); - dctParams.put("account", money.ACCT_STRUCTURE_MAINTENANCE); - dctParams.put("failCallback", "handleBankTransferError"); - dctParams.put("successCallback", "moneyTransferredFromOwner"); - dctParams.put("replyTo", self); - dctParams.put("owner", objOwner); - messageTo(objOwner, "transferMoneyToNamedAccount", dctParams, 0, false, self, "ownerNotOnline"); - - return SCRIPT_CONTINUE; - } - - else - { - LOG("LOG_CHANNEL", "permanent_structure::OnMaintenanceLoop:HARVESTER-GENERATOR "+self+"-- insufficient funds. Applying damage instead."); - - int damage = player_structure.getDecayRate(self) * loops; - int condition = player_structure.damageStructure(self, damage); - LOG("LOG_CHANNEL", "damage ->"+ damage + " condition ->"+ condition); - - if (condition == 0) - { - return SCRIPT_CONTINUE; - } - } - - } - else - { - if (hasObjVar(self, "structure.intNoMaintenance")) - { - removeObjVar(self, "structure.intNoMaintenance"); - } - } - } - } - if (boolResetTimeStamp) - { - if (boolSender) - { - sendSystemMessageTestingOnly(self, "Resetting timestamp"); - } - - setObjVar(self, player_structure.VAR_LAST_MAINTANENCE, current_time); - } - else - { - if (boolSender) - { - sendSystemMessageTestingOnly(self, "No loops, so not resetting timestamp."); - } - - } - - doHouseMaintenanceHousekeeping(self); - return SCRIPT_CONTINUE; - } - - - public void doHouseMaintenanceHousekeeping(obj_id self) throws InterruptedException - { - - messageTo(self, "OnMaintenanceLoop", null, player_structure.getMaintenanceHeartbeat(), false); - LOG("LOG_CHANNEL", "New Maintenance Loop set. -----"); - - player_structure.initiateRepairCheck(self); - - player_structure.validateBaseObjects(self); - - xp.grantCraftingXpChance( self, player_structure.getStructureOwnerObjId(self), 40 ); - - city.validateCityStructure( self ); - - player_structure.sendMaintenanceMail(self); - return; - } - - - public int handlePayment(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player_id"); - obj_id structure = params.getObjId("target_id"); - int amt = params.getInt("amount"); - - CustomerServiceLog("playerStructure", amt + " credits paid into "+ structure + " by "+ player + ". Owner is "+ player_structure.getStructureOwner(self)); - - player_structure.initiateRepairCheck(self); - int hiringSkillMod = getSkillStatisticModifier(player, "hiring"); - - if (isIdValid(player) && exists(player) && player.isLoaded() && hiringSkillMod >= 90) - { - setObjVar(self, player_structure.VAR_MAINTENANCE_MOD_MERCHANT, player_structure.MERCHANT_SALES_MODIFIER); - } - else - { - removeObjVar(self, player_structure.VAR_MAINTENANCE_MOD_MERCHANT); - } - - return SCRIPT_CONTINUE; - } - - - public int msgDestroyStructure(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("playerStructure", "Intiating destroy for "+ self + " due to character deletion of its owner "+ player_structure.getStructureOwner(self)); - player_structure.destroyStructure(self); - - return SCRIPT_CONTINUE; - } - - - public int removeResidentVar(obj_id self, dictionary params) throws InterruptedException - { - removeObjVar( self, player_structure.VAR_RESIDENCE_BUILDING ); - - city.removeStructureFromCity(self); - - return SCRIPT_CONTINUE; - } - - - public int setNewMayor(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - CustomerServiceLog("player_city_transfer","Failed to transfer Structure("+ self + ") to New Mayor due to Empty Params."); - return SCRIPT_CONTINUE; - } - if (!player_structure.isCivic(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id new_mayor = params.getObjId("mayor"); - obj_id ousted_mayor = params.getObjId("ousted_mayor"); - - if (!isIdValid(new_mayor) || !isIdValid(self) || !isIdValid(ousted_mayor)) - { - CustomerServiceLog("player_city_transfer","Failed to transfer Structure("+ self + ") to New Mayor ("+ new_mayor + ") due to Invalid Mayor/Self ID."); - return SCRIPT_CONTINUE; - } - int city_id = getCityAtLocation(getLocation(self), 0); - if (city_id <= 0) - { - CustomerServiceLog("player_city_transfer","Failed to transfer Structure("+ self + ") to New Mayor ("+ new_mayor + ") due to Invalid City ID ("+ city_id + "). Used getCityAtLocation - using Self"); - return SCRIPT_CONTINUE; - } - - String template = getTemplateName(self); - if (template.indexOf("cloning_") > -1 || template.indexOf("cityhall_") > -1) - { - - CustomerServiceLog("player_city_transfer", "City Hall/Cloning Center Found - Checking for noTrade Items to Transfer. Structure ID ("+ self +")"); - city.moveNoTradeItemsInStructureToOwner(self, ousted_mayor, city_id); - } - - setOwner(self, new_mayor); - obj_id[] adminList = new obj_id[1]; - adminList[0] = new_mayor; - setObjVar(self, player_structure.VAR_ADMIN_LIST, adminList); - - return SCRIPT_CONTINUE; - } - - - public void updateOwnerAndAdmin(obj_id self, obj_id new_mayor) throws InterruptedException - { - if (!player_structure.isCivic(self)) - { - return; - } - if (!isIdValid(new_mayor) || !isIdValid(self)) - { - return; - } - - int city_id = getCityAtLocation(getLocation(self), 0); - if (city_id <= 0) - { - return; - } - obj_id mayor = cityGetLeader(city_id); - if (mayor == new_mayor) - { - return; - } - - setOwner(self, new_mayor); - obj_id[] adminList = new obj_id[1]; - adminList[0] = new_mayor; - setObjVar(self, player_structure.VAR_ADMIN_LIST, adminList); - return; - } - - - public int handleChangeSignSui(obj_id self, dictionary params) throws InterruptedException - { - blog("permanent_structure.handleChangeSignSui INITIALIZED"); - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - boolean owner = player_structure.isOwner(self, player); - - if (hasObjVar(self, player_structure.MODIFIED_HOUSE_SIGN_MODEL)) - { - blog("permanent_structure.handleChangeSignSui REMOVING OLD HALLOWEEN SIGN"); - - player_structure.revertCustomSign(player, self); - } - blog("permanent_structure.handleChangeSignSui checking to see if special sign exists as objvar"); - - if (hasObjVar(self, player_structure.SPECIAL_SIGN)) - { - if (hasObjVar(self, player_structure.SPECIAL_SIGN_OWNER_ONLY)) - { - boolean needsOwnerToRemove = getBooleanObjVar(self, player_structure.SPECIAL_SIGN_OWNER_ONLY); - if (!owner && needsOwnerToRemove) - { - sendSystemMessage(player, player_structure.SID_ONLY_OWNER_CAN_REMOVE); - return SCRIPT_CONTINUE; - } - } - - if (!player_structure.removeSpecialSign(player, self, false)) - { - blog("permanent_structure.handleSpecialSignManagementSelection removeSpecialSign failed!!!!"); - } - } - - setObjVar(self, player_structure.VAR_SIGN_TYPE, idx); - player_structure.createStructureSign(self); - return SCRIPT_CONTINUE; - } - - - public int cityMapRegister(obj_id self, dictionary params) throws InterruptedException - { - if (player_structure.isCivic( self ) || player_structure.isCommercial( self )) - { - String template = getTemplateName(self); - if ((template != null) || (!template.equals(""))) - { - if (template.indexOf ("object/building/player/city/garden_") != -1) - { - return SCRIPT_CONTINUE; - } - } - if (!hasScript( self, "planet_map.map_loc_both" )) - { - attachScript( self, "planet_map.map_loc_both"); - } - } - return SCRIPT_CONTINUE; - } - - - public int cityMapUnregister(obj_id self, dictionary params) throws InterruptedException - { - if (player_structure.isCivic( self ) || player_structure.isCommercial( self )) - { - if (hasScript( self, "planet_map.map_loc_both" )) - { - detachScript( self, "planet_map.map_loc_both"); - } - } - return SCRIPT_CONTINUE; - } - - - public int takeCityDamage(obj_id self, dictionary params) throws InterruptedException - { - int city_id = getCityAtLocation( getLocation( self ), 0 ); - if (!cityExists( city_id )) - { - return SCRIPT_CONTINUE; - } - - obj_id mayor = cityGetLeader( city_id ); - String mayor_name = cityGetCitizenName( city_id, mayor ); - String structure_name = localize( getNameStringId( self ) ); - - int condition = player_structure.damageStructure( self, 300 ); - if (condition <= 0) - { - - prose_package bodypp = prose.getPackage( city.STRUCTURE_DESTROYED_MAINT_BODY, structure_name, mayor_name ); - utils.sendMail( city.STRUCTURE_DESTROYED_MAINT_SUBJECT, bodypp, mayor_name, "City Hall"); - } - else - { - int cost = params.getInt( "cost"); - prose_package bodypp = prose.getPackage( city.STRUCTURE_DAMAGED_BODY, null, null, null, - null, mayor_name, null, null, structure_name, null, cost, 0.f ); - utils.sendMail( city.STRUCTURE_DAMAGED_SUBJECT, bodypp, mayor_name, "City Hall"); - } - - return SCRIPT_CONTINUE; - } - - - public int repairCityDamage(obj_id self, dictionary params) throws InterruptedException - { - int city_id = getCityAtLocation( getLocation( self ), 0 ); - if (!cityExists( city_id )) - { - return SCRIPT_CONTINUE; - } - - int condition = player_structure.getStructureCondition( self ); - int max_condition = player_structure.getMaxCondition( self ); - if (condition < max_condition) - { - player_structure.repairStructure( self, 300 ); - - obj_id mayor = cityGetLeader( city_id ); - String mayor_name = cityGetCitizenName( city_id, mayor ); - String structure_name = localize( getNameStringId( self ) ); - prose_package bodypp = prose.getPackage( city.STRUCTURE_REPAIRED_BODY, structure_name, mayor_name ); - utils.sendMail( city.STRUCTURE_REPAIRED_SUBJECT, bodypp, mayor_name, "City Hall"); - } - - return SCRIPT_CONTINUE; - } - - - public int createStructureObjects(obj_id self, dictionary params) throws InterruptedException - { - int rotation = params.getInt( "rotation"); - player_structure.createStructureObjects( self, rotation ); - - float rot_float = (float)(90 * rotation); - player_structure.createStructureSign( self, rot_float ); - - return SCRIPT_CONTINUE; - } - - - public int requestBankBalance(obj_id self, dictionary params) throws InterruptedException - { - obj_id requestingObj = params.getObjId("requestingObj"); - - int balance = getBankBalance(self); - - dictionary newParam = new dictionary(); - newParam.put("balance", balance); - newParam.put("structure", self); - - messageTo(requestingObj, "returnRequestedBankBalance", newParam, 0, false); - - return SCRIPT_CONTINUE; - } - - - public int requestName(obj_id self, dictionary params) throws InterruptedException - { - obj_id requestingObj = params.getObjId("requestingObj"); - - String name = ""; - - if (!player_structure.isInstallation(self)) - { - if (hasObjVar(self, player_structure.VAR_SIGN_NAME)) - { - name = getStringObjVar(self, player_structure.VAR_SIGN_NAME); - } - } - else - { - name = getEncodedName(self); - } - - dictionary newParam = new dictionary(); - newParam.put("name", name); - newParam.put("structure", self); - - messageTo(requestingObj, "returnRequestedName", newParam, 0, false); - - return SCRIPT_CONTINUE; - } - - - public int handleBankTransferError(obj_id self, dictionary params) throws InterruptedException - { - obj_id objSender = null; - if (utils.hasScriptVar(self, "objSender")) - { - objSender = utils.getObjIdScriptVar(self, "objSender"); - if (!exists(objSender)) - { - objSender = null; - } - } - - int loops = params.getInt("intLoops"); - int cost = params.getInt("intCost"); - if ((loops == 0)&&(cost == 0)) - { - return SCRIPT_CONTINUE; - } - int current_time = getGameTime(); - if (isIdValid(objSender)) - { - sendSystemMessageTestingOnly(self, "FAILED BANK TRANSFER!"); - sendSystemMessageTestingOnly(self, "loops "+loops); - sendSystemMessageTestingOnly(self, "Cost "+cost); - sendSystemMessageTestingOnly(self, "current_time "+current_time); - } - - int damage = player_structure.getDecayRate(self) * loops; - int condition = player_structure.damageStructure(self, damage, true); - if (isIdValid(objSender)) - { - sendSystemMessageTestingOnly(self, "Damaging Structure to "+damage); - } - - LOG("LOG_CHANNEL", "damage ->"+ damage + " condition ->"+ condition); - if (condition == 0) - { - if (isIdValid(objSender)) - { - sendSystemMessageTestingOnly(self, "COndemning "+self); - } - - CustomerServiceLog("playerStructure","Condemning ("+self+") owned by "+player_structure.getStructureOwner(self)); - if (!hasObjVar(self, "player_structurestructure.condemned")) - { - player_structure.sendCondemnedMail(self); - setObjVar(self, "player_structure.condemned", current_time); - } - } - setObjVar(self, player_structure.VAR_LAST_MAINTANENCE, current_time); - if (isIdValid(objSender)) - { - sendSystemMessageTestingOnly(self, "Doing housekeeping"); - } - doHouseMaintenanceHousekeeping(self); - - return SCRIPT_CONTINUE; - } - - - public int handleBankSuccess(obj_id self, dictionary params) throws InterruptedException - { - obj_id objSender = null; - if (utils.hasScriptVar(self, "objSender")) - { - objSender = utils.getObjIdScriptVar(self, "objSender"); - if (!exists(objSender)) - { - objSender = null; - } - } - if (isIdValid(objSender)) - { - sendSystemMessageTestingOnly(objSender, "Succesfully took maintenance, resetting timestamp"); - } - int loops = params.getInt("intLoops"); - int cost = params.getInt("intCost"); - if ((loops == 0)&&(cost == 0)) - { - - return SCRIPT_CONTINUE; - } - int current_time = getGameTime(); - setObjVar(self, player_structure.VAR_LAST_MAINTANENCE, current_time); - doHouseMaintenanceHousekeeping(self); - return SCRIPT_CONTINUE; - } - - - public int payCondemnedFees(obj_id self, dictionary params) throws InterruptedException - { - if (!player_structure.isStructureCondemned(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id objPlayer = sui.getPlayerId(params); - if (!isIdValid(objPlayer)) - { - - return SCRIPT_CONTINUE; - } - int idx = sui.getListboxSelectedRow(params); - int bp = sui.getIntButtonPressed(params); - if (bp != sui.BP_OK) - { - - return SCRIPT_CONTINUE; - } - float fltDistance = getDistance(objPlayer, self); - if (fltDistance > 32) - { - string_id strSpam = new string_id("player_structure", "too_far"); - sendSystemMessage(objPlayer, strSpam); - return SCRIPT_CONTINUE; - } - - int intRepairCost = player_structure.getStructureRepairCost(self); - int intBankCredits = getBankBalance(objPlayer); - - if (intBankCredits >= intRepairCost) - { - int max_condition = player_structure.getMaxCondition(self); - LOG("building", "max_condition is "+max_condition); - player_structure.repairStructure(self, max_condition); - money.bankTo(objPlayer, money.ACCT_STRUCTURE_MAINTENANCE, intRepairCost); - - CustomerServiceLog("playerStructure","UNCOMDEMNING ("+self+") owned by "+player_structure.getStructureOwner(self)+" -> Becuase they paid = "+intRepairCost); - string_id strSpam = new string_id("player_structure", "structure_uncondemned"); - sendSystemMessage(objPlayer, strSpam); - } - return SCRIPT_CONTINUE; - } - - - public int moneyTransferredFromOwner(obj_id self, dictionary params) throws InterruptedException - { - - int transferredAmount = params.getInt("amount"); - transferBankCreditsFromNamedAccount(money.ACCT_STRUCTURE_MAINTENANCE, self, transferredAmount, null, null, null); - - utils.removeScriptVar(self,"maint.dontCheckDB"); - - messageTo(self, "OnMaintenanceLoop", null, player_structure.getMaintenanceHeartbeat(), false); - return SCRIPT_CONTINUE; - } - - - public int ownerNotOnline(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self,"maint.dontCheckDB")) - { - int amount = params.getInt("offlineAmount"); - params.put("amount", amount); - obj_id owner = params.getObjId("owner"); - getMoneyFromOfflineObject(owner, amount, money.ACCT_STRUCTURE_MAINTENANCE, "moneyTransferredFromOwner", "ownerNSF", params); - } - else - { - messageTo(self,"handleBankTransferError", params, 0, false); - } - - return SCRIPT_CONTINUE; - } - - - public int ownerNSF(obj_id self, dictionary params) throws InterruptedException - { - utils.setScriptVar(self, "maint.dontCheckDB", 1); - messageTo(self,"handleBankTransferError", params, 0, false); - return SCRIPT_CONTINUE; - } - - - public int validateHopper(obj_id self, dictionary params) throws InterruptedException - { - int objvar_hopper = getIntObjVar(self, player_structure.VAR_DEED_MAX_HOPPER); - int hopperSize = player_structure.validateHopperSize(self); - - if (objvar_hopper != hopperSize) - { - setObjVar(self, player_structure.VAR_DEED_MAX_HOPPER, hopperSize); - - setMaxHopperAmount(self, hopperSize); - } - - return SCRIPT_CONTINUE; - } - - - public void updateFactoryName(obj_id factory) throws InterruptedException - { - if (player_structure.isFactory(factory)) - { - String assignedName = getAssignedName(factory); - - if (!hasObjVar(factory, "player_structure.name.original")) - { - setObjVar(factory, "player_structure.name.original", assignedName == null ? "": assignedName); - } - else - { - - if (assignedName != null && assignedName.indexOf(player_structure.ABANDONED_TEXT) != -1) - { - - assignedName = getStringObjVar(factory, "player_structure.name.original"); - } - else - { - - setObjVar(factory, "player_structure.name.original", assignedName == null ? "": assignedName); - } - } - - if (assignedName == null || assignedName.length () == 0) - { - String templateName = getTemplateName(factory); - - if (templateName.equals("object/installation/manufacture/food_factory.iff")) - { - assignedName = "Food and Chemical Factory"; - } - else if (templateName.equals("object/installation/manufacture/clothing_factory.iff")) - { - assignedName = "Wearables Factory"; - } - else if (templateName.equals("object/installation/manufacture/weapon_factory.iff")) - { - assignedName = "Equipment Factory"; - } - else if (templateName.equals("object/installation/manufacture/structure_factory.iff")) - { - assignedName = "Structure Factory"; - } - else - { - assignedName = "Factory"; - } - } - - setName(factory, assignedName + player_structure.ABANDONED_TEXT); - } - } - - - public int checkAndMarkForPreAbandon(obj_id self, dictionary params) throws InterruptedException - { - if (isInWorldCell(self) && player_structure.needsPreAbandonCheck(self)) - { - obj_id ownerId = getOwner(self); - - final boolean isPreAbandoned = player_structure.isPreAbandoned(self); - final boolean isAbandoned = player_structure.isAbandoned(self); - - if (isAccountQualifiedForHousePackup(ownerId)) - { - - if (isPreAbandoned || isAbandoned) - { - return SCRIPT_CONTINUE; - } - - player_structure.setPreAbandoned(self); - - CustomerServiceLog("house_packup", "Structure ("+ self + ") marked as preabandoned for player (" + getPlayerName(ownerId) + ") station_id ("+ getPlayerStationId(ownerId) + ")"); - - updateFactoryName(self); - - player_structure.createStructureSign(self); - - String[] adminList = player_structure.getAdminListRaw(self); - - if (adminList != null) - { - String admins = ""; - - for (int i=0; i < adminList.length; ++i) - { - testAbortScript(); - if (adminList[i] != null && adminList[i].toLowerCase().indexOf("guild:") <= -1) - { - admins += "|"+ getPlayerStationId(utils.stringToObjId(adminList[i])); - - if (admins.length() > 256) - { - CustomerServiceLog("house_packup_adminlist", admins + "|"); - - admins = ""; - } - } - } - - if (admins.length() > 0) - { - CustomerServiceLog("house_packup_adminlist", admins + "|"); - } - } - } - else - { - - if (!isPreAbandoned && !isAbandoned) - { - return SCRIPT_CONTINUE; - } - - final String abandonedState = isPreAbandoned ? "preabandoned": isAbandoned ? "abandoned": "none"; - - player_structure.setStructureAsNotAbandoned(self); - - CustomerServiceLog("house_packup", "Structure ("+ self + ") cleared for player ("+ getPlayerName(ownerId) - + ") station_id ("+ getPlayerStationId(ownerId) + ") state ("+ abandonedState + ")"); - - if (player_structure.isFactory(self) && hasObjVar(self, "player_structure.name.original")) - { - final String assignedName = getAssignedName(self); - - if (assignedName != null && assignedName.indexOf(player_structure.ABANDONED_TEXT) != -1) - { - final String originalName = getStringObjVar(self, "player_structure.name.original"); - setName(self, originalName); - } - - removeObjVar(self, "player_structure.name.original"); - } - - player_structure.createStructureSign(self); - } - } - - return SCRIPT_CONTINUE; - } - - - public int checkAndMarkForAbandon(obj_id self, dictionary params) throws InterruptedException - { - if (isInWorldCell(self) && player_structure.needsAbandonCheck(self)) - { - obj_id ownerId = getOwner(self); - - final boolean isPreAbandoned = player_structure.isPreAbandoned(self); - final boolean isAbandoned = player_structure.isAbandoned(self); - final String abandonedState = isPreAbandoned ? "preabandoned": isAbandoned ? "abandoned": "none"; - - if (!isAccountQualifiedForHousePackup(ownerId)) - { - - if (isPreAbandoned || isAbandoned) - { - - player_structure.setStructureAsNotAbandoned(self); - - CustomerServiceLog("house_packup", "Structure ("+ self + ") saved for player (" + getPlayerName(ownerId) + ") station_id ("+ getPlayerStationId(ownerId) + ") state ("+ abandonedState + ")"); - - if (player_structure.isFactory(self) && hasObjVar(self, "player_structure.name.original")) - { - final String assignedName = getAssignedName(self); - - if (assignedName != null && assignedName.indexOf(player_structure.ABANDONED_TEXT) != -1) - { - final String originalName = getStringObjVar(self, "player_structure.name.original"); - setName(self, originalName); - } - - removeObjVar(self, "player_structure.name.original"); - } - - player_structure.createStructureSign(self); - } - } - else - { - if (!isAbandoned) - { - - player_structure.setAbandoned(self); - - CustomerServiceLog("house_packup", "Structure ("+ self + ") marked as abandoned for player (" + getPlayerName(ownerId) + ") station_id ("+ getPlayerStationId(ownerId) + ") state ("+ abandonedState + ")"); - } - - updateFactoryName(self); - - if (!isPreAbandoned && !isAbandoned) - { - player_structure.createStructureSign(self); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int logStructureInfo(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("house_packup_info", player_structure.getStructureInfo(self)); - - return SCRIPT_CONTINUE; - } - - - public int handleStructurePackupLockoutRemoval(obj_id self, dictionary params) throws InterruptedException - { - blog("permanent_structure.handleStructurePackupLockoutRemoval() Message received by player to remove lockout timer."); - - utils.removeScriptVarTree(self, player_structure.SCRIPTVAR_HOUSE_PACKUP_TREE_PREFIX); - return SCRIPT_CONTINUE; - } - - - public int packAbandonedBuilding(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId ("player"); - player_structure.packAbandonedBuilding(player, self, params); - return SCRIPT_CONTINUE; - } - - - public int moveStructureToSCD(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - if (!params.containsKey("structure") || !params.containsKey("structure_owner")) - { - blog("player_building.moveStructureToSCD() did not have the needed params to function"); - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId ("player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id structure = params.getObjId ("structure"); - if (player_structure.isPackedUp(structure)) - { - blog("player_buidling.moveStructureToSCD() ALREADY PACKED!!!! removing lockout from player."); - messageTo(player, "handlePlayerStructurePackupLockoutRemoval", null, 1, false); - return SCRIPT_CONTINUE; - } - - obj_id structure_owner = params.getObjId ("structure_owner"); - if (!isValidId(structure) || !isValidId(structure_owner)) - { - blog("player_building.moveStructureToSCD() MISSING PARAMS. ABORTING AIRSTRIKE"); - messageTo(player, "handlePlayerStructurePackupLockoutRemoval", null, 0, false); - return SCRIPT_CONTINUE; - } - - location where = getLocation(structure); - boolean isAbandoned = true; - - obj_id datapad = utils.getPlayerDatapad(player); - - if (!isIdValid(datapad)) - { - blog("player_structure.finalizeAbandonedStructurePackUp datapad not valid."); - - CustomerServiceLog("housepackup", "Structure ("+ structure + ") could not be packed by player (" + getPlayerName(player) + ") - datapad was not valid" ); - return SCRIPT_CONTINUE; - } - - if (structure_owner.isLoaded() && structure_owner.isAuthoritative()) - { - blog("player_structure.finalizeAbandonedStructurePackUp The owner is loaded in game."); - - obj_id owner_datapad = utils.getPlayerDatapad(structure_owner); - if (isIdValid(owner_datapad)) - { - datapad = owner_datapad; - } - } - else if (!player.isLoaded() || !player.isAuthoritative()) - { - blog("player_structure.finalizeAbandonedStructurePackUp The owner is NOT loaded in game and the player packing is not loaded or not authoritative."); - - CustomerServiceLog("housepackup", "Structure ("+ structure + ") could not be packed by player (" + getPlayerName(player) + ") player -" + " isLoaded = "+ player.isLoaded() - + " isAuthoritative = "+ player.isAuthoritative() - ); - return SCRIPT_CONTINUE; - } - - obj_id scd = createObjectOverloaded("object/intangible/house/generic_house_control_device.iff", datapad); - if (!isIdValid(scd)) - { - CustomerServiceLog("housepackup", "Structure ("+ structure + ") could not be packed by player (" + getPlayerName(player) + ") - scd was not valid" ); - return SCRIPT_CONTINUE; - } - attachScript(scd, "structure.house_control_device"); - - setObjVar(scd, "abandoned.packer", player); - setObjVar(scd, "abandoned.owner", structure_owner); - setObjVar(scd, "abandoned.structure", structure); - - if (player_structure.isFactory(structure) && isHarvesterActive(structure)) - { - CustomerServiceLog("housepackup", "Structure ("+ structure + ") was a factory that was active. Turning off factory for non-owner player (" + getPlayerName(player) + ") OID ("+ player + ")" ); - deactivate(structure); - } - - obj_id[] players = player_structure.getPlayersInBuilding(structure); - if (players != null) - { - blog("player_structure.finalizeAbandonedStructurePackUp Players are in the building that is about to be packed."); - - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - expelFromBuilding(players[i]); - } - } - - String[] cells = getCellNames(structure); - if (cells != null) - { - for (int i = 0; i < cells.length; i++) - { - testAbortScript(); - obj_id cellid = getCellId(structure, cells[i]); - obj_id contents[] = getContents(cellid); - if (contents != null) - { - for (int j=0; j 0) - { - if (getCitizenOfCityId(player) <= 0) - { - String playerName = params.getString("playerName"); - if ((playerName != null) && (playerName.length() > 0)) - { - citySetCitizenInfo(city_id, player, playerName, null, city.CP_CITIZEN); - - CustomerServiceLog("CityFixup", "added "+ player + " ("+ playerName + ") (logged in and has declared residence) as citizen of city "+ city_id + " ("+ cityGetName(city_id) + ")."); - - obj_id mayorId = cityGetLeader(city_id); - if (isIdValid(mayorId)) - { - String mayorName = cityGetCitizenName(city_id, mayorId); - if ((mayorName != null) && (mayorName.length() > 0)) - { - prose_package bodypp = prose.getPackage(SID_NEW_CITY_FIXUP_CITIZEN_BODY, playerName); - utils.sendMail(SID_NEW_CITY_FIXUP_CITIZEN_SUBJECT, bodypp, mayorName, "City Hall"); - } - } - } - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int houseCheck(obj_id self, dictionary params) throws InterruptedException - { - location landingSpot = params.getLocation("landingSpot"); - String groundScene = params.getString("groundScene"); - obj_id player = params.getObjId("player"); - obj_id house = params.getObjId("house"); - String myPlanet = getCurrentSceneName(); - obj_id[] testHouses = getAllObjectsWithObjVar(landingSpot, 250, "player_structure.admin.adminList"); - Vector houses = new Vector(Arrays.asList(testHouses)); - if (myPlanet.equals(groundScene)) - { - if (houses != null) - { - if (houses.contains (house)) - { - return SCRIPT_CONTINUE; - } - else - { - removeObjVar (player, "homingBeacon"); - sendSystemMessage(player, SID_BEACON_MISSING); - } - } - } - else - { - removeObjVar (player, "homingBeacon"); - sendSystemMessage(player, SID_BEACON_MISSING); - } - return SCRIPT_CONTINUE; - } - - - public int handleUnloadedCityStructureReportData(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - obj_id city_terminal = params.getObjId("city_terminal"); - int city_id = params.getInt("city_id"); - - if (!isIdValid(player) || !isIdValid(city_terminal)) - { - return SCRIPT_CONTINUE; - } - - if (!city.isNormalStructure(city_id, self)) - { - location structureLocation = getLocation(self); - String structureName = localize(getNameStringId(self)); - - dictionary dict = new dictionary(); - dict.put("player", player); - dict.put("city_id", city_id); - dict.put("city_terminal", city_terminal); - dict.put("unloadedStructureId", self); - dict.put("unloadedStructureName", structureName); - dict.put("unloadedStructureLocation", structureLocation); - - messageTo(city_terminal, "RecievedUnloadedStructureResponse", dict, 0.0f, false); - } - else if (player_structure.isCivic(self)) - { - location structureLocation = getLocation(self); - float cond = ((float) player_structure.getStructureCondition(self)) / ((float) player_structure.getMaxCondition(self)); - int outcond = (int) (cond * 100); - String structureName = getEncodedName(self) + " (Condition : "+ outcond + "%)"; - - dictionary dict = new dictionary(); - dict.put("player", player); - dict.put("city_id", city_id); - dict.put("city_terminal", city_terminal); - dict.put("unloadedStructureId", self); - dict.put("unloadedStructureName", structureName); - dict.put("unloadedStructureLocation", structureLocation); - - messageTo(city_terminal, "RecievedUnloadedStructureResponse", dict, 0.0f, false); - } - else - { - - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } - - - public int getStructureCitizenInformation(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - int city_id = params.getInt("city_id"); - if (city.isNormalStructure(city_id, self) && !player_structure.isCivic(self)) - { - - obj_id terminal = params.getObjId("terminal_id"); - if (hasObjVar(self, player_structure.VAR_RESIDENCE_BUILDING)) - { - obj_id citizenId = getObjIdObjVar(self, player_structure.VAR_RESIDENCE_BUILDING); - params.put("house_id", self); - params.put("house_name", getEncodedName(self)); - params.put("house_loc", getLocation(self)); - params.put("citizen_id", citizenId); - messageTo(terminal, "getStructureCitizenInformationReturn", params, 0.0f, false); - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleSpecialSignManagementSelection(obj_id self, dictionary params) throws InterruptedException - { - blog("permanent_structure.handleSpecialSignManagementSelection init"); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - blog("permanent_structure.handleSpecialSignManagementSelection getting button press"); - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - removeSpecialSignScriptVars(player); - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - removeSpecialSignScriptVars(player); - return SCRIPT_CONTINUE; - } - - blog("permanent_structure.handleSpecialSignManagementSelection finding selection"); - - String[] menu = utils.getStringArrayScriptVar(player, player_structure.VAR_SPECIAL_SIGN_MENU); - if (menu == null || menu.length <= 0) - { - return SCRIPT_CONTINUE; - } - blog("permanent_structure.handleSpecialSignManagementSelection retrieved scriptvar list of menu selections"); - - String selection = menu[idx]; - if (selection == null || selection.length() <= 0) - { - removeSpecialSignScriptVars(player); - return SCRIPT_CONTINUE; - } - blog("permanent_structure.handleSpecialSignManagementSelection the selection was: "+ selection); - - boolean owner = player_structure.isOwner(self, player); - - if (hasObjVar(self, player_structure.SPECIAL_SIGN_OWNER_ONLY)) - { - boolean needsOwnerToRemove = getBooleanObjVar(self, player_structure.SPECIAL_SIGN_OWNER_ONLY); - if (!owner && needsOwnerToRemove) - { - sendSystemMessage(player, player_structure.SID_ONLY_OWNER_CAN_REMOVE); - return SCRIPT_CONTINUE; - } - } - - blog("permanent_structure.handleSpecialSignManagementSelection Checking for data."); - - if (hasObjVar(self, player_structure.MODIFIED_HOUSE_SIGN_MODEL)) - { - blog("permanent_structure.handleSpecialSignSelection REMOVING OLD HALLOWEEN SIGN"); - - player_structure.revertCustomSign(player, self); - } - - if (hasObjVar(self, player_structure.SPECIAL_SIGN) && selection.startsWith("remove")) - { - if (!player_structure.removeSpecialSign(player, self, true)) - { - blog("permanent_structure.handleSpecialSignManagementSelection removeSpecialSign failed!!!!"); - } - - return SCRIPT_CONTINUE; - } - else if (hasObjVar(self, player_structure.SPECIAL_SIGN) && !selection.startsWith("remove")) - { - blog("permanent_structure.handleSpecialSignManagementSelection case was replace"); - - if (!player_structure.removeSpecialSign(player, self, false)) - { - blog("permanent_structure.handleSpecialSignManagementSelection removeSpecialSign failed!!!!"); - } - } - - if (sui.hasPid(player, player_structure.VAR_SPECIAL_SIGN_MENU_PID)) - { - int pid = sui.getPid(player, player_structure.VAR_SPECIAL_SIGN_MENU_PID); - forceCloseSUIPage(pid); - } - blog("permanent_structure.handleSpecialSignManagementSelection getting specialSignList"); - - String[] specialSignList = utils.getStringArrayScriptVar(player, player_structure.VAR_SPECIAL_SIGN_NAMES); - if (specialSignList == null || specialSignList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - blog("permanent_structure.handleSpecialSignManagementSelection: specialSignList received, sending player to next menu"); - int pid = sui.listbox(self, player, "@base_player:special_sign_ui_prompt", sui.OK_CANCEL, "@base_player:special_sign_ui_title", specialSignList, "handleSpecialSignSelection", true); - sui.setPid(player, pid, player_structure.VAR_SPECIAL_SIGN_MENU_PID); - - return SCRIPT_CONTINUE; - } - - - public int handleSpecialSignSelection(obj_id self, dictionary params) throws InterruptedException - { - blog("permanent_structure.handleSpecialSignSelection: init"); - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - if (bp == sui.BP_CANCEL) - { - removeSpecialSignScriptVars(player); - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - removeSpecialSignScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, player_structure.MODIFIED_HOUSE_SIGN_MODEL)) - { - blog("permanent_structure.handleSpecialSignSelection REMOVING OLD HALLOWEEN SIGN"); - - player_structure.revertCustomSign(player, self); - } - - blog("permanent_structure.handleSpecialSignSelection: validation completed"); - - String[] specialSignList = utils.getStringArrayScriptVar(player, player_structure.VAR_SPECIAL_SIGN_LIST); - if (specialSignList == null || specialSignList.length <= 0) - { - return SCRIPT_CONTINUE; - } - blog("permanent_structure.handleSpecialSignSelection retrieved scriptvar list of menu selections"); - - String selection = specialSignList[idx]; - if (selection == null || selection.length() <= 0) - { - removeSpecialSignScriptVars(player); - return SCRIPT_CONTINUE; - } - blog("permanent_structure.handleSpecialSignSelection the selection was: "+ selection); - - int row = dataTableSearchColumnForString(selection, "sign_template", player_structure.TBL_SPECIAL_SIGNS); - if (row < 0) - { - return SCRIPT_CONTINUE; - } - - dictionary dict = dataTableGetRow(player_structure.TBL_SPECIAL_SIGNS, row); - if (dict == null) - { - return SCRIPT_CONTINUE; - } - - int signType = dict.getInt("sign_type"); - if (signType < 0) - { - return SCRIPT_CONTINUE; - } - - int decrementSkillFlag = dict.getInt("decrement_skillmod"); - if (decrementSkillFlag < 0) - { - return SCRIPT_CONTINUE; - } - - String skillmod = dict.getString("skillmod_name"); - if (skillmod == null || skillmod.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - int adminPlacement = dict.getInt("admin_placement"); - if (adminPlacement < 0) - { - return SCRIPT_CONTINUE; - } - - if (decrementSkillFlag > 0) - { - blog("permanent_structure.handleSpecialSignManagementSelection decrementSkillFlag GREATER THAN ZERO"); - - if (!applySkillStatisticModifier(player, skillmod, -1)) - { - CustomerServiceLog("playerStructure","Special Sign could not be applied to structure "+ self + ". The player: "+player+". Reason: skillmod could not be decremented."); - sendSystemMessage(player, player_structure.SID_SPECIAL_SIGN_FAILED); - - return SCRIPT_CONTINUE; - } - setObjVar(self, player_structure.SPECIAL_SIGN_DECREMENT_MOD, true); - } - - blog("permanent_structure.handleSpecialSignManagementSelection applyign the data to the structure"); - - setObjVar(self, player_structure.SPECIAL_SIGN, true); - setObjVar(self, player_structure.SPECIAL_SIGN_TEMPLATE, selection); - setObjVar(self, player_structure.VAR_SIGN_TYPE, signType); - setObjVar(self, player_structure.SPECIAL_SIGN_SKILLMOD, skillmod); - if (adminPlacement == 0) - { - setObjVar(self, player_structure.SPECIAL_SIGN_OWNER_ONLY, true); - } - - if (!isValidId(player_structure.createStructureSign(self))) - { - blog("permanent_structure.handleSpecialSignManagementSelection THIS DID NOT WORK CORRECTLY!! GIVING PLAYER STUFF BACK"); - - CustomerServiceLog("playerStructure","Special Sign could not be applied to structure "+ self + ". The player: "+player); - sendSystemMessage(player, player_structure.SID_SPECIAL_SIGN_FAILED); - - if (decrementSkillFlag > 0) - { - applySkillStatisticModifier(self, skillmod, 1); - } - - removeObjVar(self, player_structure.SPECIAL_SIGN); - removeObjVar(self, player_structure.SPECIAL_SIGN_TEMPLATE); - removeObjVar(self, player_structure.VAR_SIGN_TYPE); - removeObjVar(self, player_structure.SPECIAL_SIGN_SKILLMOD); - removeObjVar(self, player_structure.SPECIAL_SIGN_DECREMENT_MOD); - removeObjVar(self, player_structure.SPECIAL_SIGN_OWNER_ONLY); - - removeSpecialSignScriptVars(player); - return SCRIPT_CONTINUE; - } - - blog("permanent_structure.handleSpecialSignManagementSelection Looks like it all went ok"); - - removeSpecialSignScriptVars(player); - CustomerServiceLog("playerStructure","Player: "+player+" has used Special Sign skillmod: "+skillmod+" on structure: "+ self + ". The special sign was created on the structure and the skillmod has been decremented by 1."); - sendSystemMessage(player, player_structure.SID_SPECIAL_SIGN_SUCCESS); - - return SCRIPT_CONTINUE; - } - - - public boolean removeSpecialSignScriptVars(obj_id player) throws InterruptedException - { - utils.removeScriptVarTree(player, player_structure.VAR_SPECIAL_SIGN_TREE); - return true; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java b/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java deleted file mode 100644 index 9de5f5075..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/buff/buff_handler.java +++ /dev/null @@ -1,6178 +0,0 @@ -package script.systems.buff; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.armor; -import script.library.buff; -import script.library.camping; -import script.library.chat; -import script.library.collection; -import script.library.combat; -import script.library.colors; -import script.library.create; -import script.library.dot; -import script.library.expertise; -import script.library.event_perk; -import script.library.factions; -import script.library.groundquests; -import script.library.group; -import script.library.healing; -import script.library.holiday; -import script.library.jedi; -import script.library.locations; -import script.library.movement; -import script.library.pclib; -import script.library.proc; -import script.library.prose; -import script.library.regions; -import script.library.skill; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; -import script.library.weapons; -import script.library.beast_lib; -import script.library.performance; -import script.library.xp; - - -public class buff_handler extends script.base_script -{ - public buff_handler() - { - } - public static final float ATTACK_RATE_DEPRICATED = 0.0f; - public static final float DECAY_RATE_DEPRICATED = 0.0f; - - public static final String SKILLS_DATATABLE = "datatables/skill/skills.iff"; - public static final String DATATABLE_BUFF_BUILDER = "datatables/buff/buff_builder.iff"; - - public static final String INITIAL_GENERAL_PROTECTION = "amor.unmodifiedArmorValue"; - public static final String DATATABLE_COSTUME = "datatables/event/costume.iff"; - public static final String DATATABLE_RADAR_HUE = "datatables/buff_data/radar_hue.iff"; - - public static final int IMMUNITY_TO_POISON = 1; - public static final int IMMUNITY_TO_DISEASE = 2; - public static final int IMMUNITY_TO_FIRE = 3; - public static final int IMMUNITY_TO_BLEEDING = 4; - public static final int IMMUNITY_TO_ALL_DOTS = 5; - public static final int IMMUNITY_TO_ACID = 6; - public static final int IMMUNITY_TO_ENERGY = 7; - public static final int IMMUNITY_TO_STUN = 12; - - - - public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException - { - if (buff.hasBuff(self, "channel_healing")) - { - buff.removeBuff(self, "channel_healing"); - } - - return SCRIPT_CONTINUE; - - } - - - public int attribAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int attribute = ATTRIB_ERROR; - - LOG("expertise", "attribAddBuffHandler effectName: "+ effectName + " subtype: "+ subtype + " value: "+ value); - - if (subtype.equals("health")) - { - attribute = HEALTH; - } - else if (subtype.equals("constitution")) - { - attribute = CONSTITUTION; - } - else if (subtype.equals("action")) - { - attribute = ACTION; - } - else if (subtype.equals("stamina")) - { - attribute = STAMINA; - } - else if (subtype.equals("mind")) - { - attribute = MIND; - } - else if (subtype.equals("willpower")) - { - attribute = WILLPOWER; - } - - if (attribute == ATTRIB_ERROR) - { - return SCRIPT_OVERRIDE; - } - - attrib_mod am = new attrib_mod(effectName, attribute, (int)value, duration, ATTACK_RATE_DEPRICATED, DECAY_RATE_DEPRICATED, true, false, false); - addAttribModifier(self, am); - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - combat.cacheCombatData(self); - - return SCRIPT_CONTINUE; - } - - - public int attribRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasAttribModifier(self, effectName)) - { - removeAttribOrSkillModModifier(self, effectName); - } - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - combat.cacheCombatData(self); - return SCRIPT_CONTINUE; - } - - - public int attribPercentAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int attribute = ATTRIB_ERROR; - - if (subtype.equals("health")) - { - attribute = HEALTH; - } - else if (subtype.equals("constitution")) - { - attribute = CONSTITUTION; - } - else if (subtype.equals("action")) - { - attribute = ACTION; - } - else if (subtype.equals("stamina")) - { - attribute = STAMINA; - } - else if (subtype.equals("mind")) - { - attribute = MIND; - } - else if (subtype.equals("willpower")) - { - attribute = WILLPOWER; - } - - if (attribute == ATTRIB_ERROR) - { - return SCRIPT_OVERRIDE; - } - - long stack = buff.getBuffStackCount(self, buffName) > 1 ? buff.getBuffStackCount(self, buffName) : 1; - value *= (int)stack; - - value = 100.0f + value; - value /= 100.0f; - - int maxAttrib = getUnmodifiedMaxAttrib(self, attribute); - float newAttrib = (float)maxAttrib * value; - int delta = (int)newAttrib - maxAttrib; - - attrib_mod am = new attrib_mod(effectName, attribute, delta, duration, ATTACK_RATE_DEPRICATED, DECAY_RATE_DEPRICATED, true, false, false); - addAttribModifier(self, am); - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - combat.cacheCombatData(self); - return SCRIPT_CONTINUE; - } - - - public int attribPercentRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasAttribModifier(self, effectName)) - { - removeAttribOrSkillModModifier(self, effectName); - } - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - combat.cacheCombatData(self); - return SCRIPT_CONTINUE; - } - - - public int skillAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - long stack = buff.getBuffStackCount(self, buffName) > 1 ? buff.getBuffStackCount(self, buffName) : 1; - value *= (int)stack; - - addSkillModModifier(self, effectName, subtype, (int)value, duration, false, true); - - if ((subtype.startsWith("constitution"))||(subtype.startsWith("stamina"))) - { - messageTo(self, "recalcPools", null, 1, false); - } - else if (subtype.startsWith("expertise_innate_protection_")) - { - messageTo(self, "recalcArmor", null, 1, false); - } - - if (subtype.startsWith("movement_resist")) - { - messageTo(self, "check_movement_immunity", null, 0.1f, false); - } - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - combat.cacheCombatData(self); - return SCRIPT_CONTINUE; - } - - - public int skillRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasSkillModModifier(self, effectName)) - { - removeAttribOrSkillModModifier(self, effectName); - } - - if (effectName.lastIndexOf("_") > 0) - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - } - - stopClientEffectObjByLabel(self, effectName); - combat.removeCombatBuffEffect(self, effectName); - - if ((subtype.startsWith("constitution"))||(subtype.startsWith("stamina"))) - { - - messageTo(self, "recalcPools", null, 1, false); - } - else if (subtype.startsWith("expertise_innate_protection_")) - { - messageTo(self, "recalcArmor", null, 1, false); - } - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - combat.cacheCombatData(self); - return SCRIPT_CONTINUE; - } - - - public int armorBreakAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - long stack = buff.getBuffStackCount(self, buffName) > 1 ? buff.getBuffStackCount(self, buffName) : 1; - value *= (int)stack; - - int armorScriptVarValue = 0; - if (stack == 1) - { - armorScriptVarValue = utils.getIntScriptVar(self, armor.SCRIPTVAR_CACHED_GENERAL_PROTECTION); - utils.setScriptVar(self, INITIAL_GENERAL_PROTECTION, armorScriptVarValue); - } - else - { - armorScriptVarValue = utils.getIntScriptVar(self, INITIAL_GENERAL_PROTECTION); - } - - if (subtype.equals("player") && isPlayer(self)) - { - - float baseMod = getSkillStatisticModifier(self, "expertise_innate_protection"); - baseMod += (float)armorScriptVarValue; - - baseMod += getEnhancedSkillStatisticModifierUncapped(self, "expertise_innate_protection_all"); - - float modIncrease = baseMod * (value/100.0f); - - addSkillModModifier(self, effectName, "expertise_innate_protection_all", (int)modIncrease, duration, false, false); - - if (utils.isProfession(caster, utils.BOUNTY_HUNTER)) - { - buff.applyBuff(self, caster, "bh_crit_hit_vuln"); - } - - } - - else if (subtype.equals("mob") && !isPlayer(self)) - { - addSkillModModifier(self, effectName, "expertise_innate_protection_all", (int)value, duration, false, true); - - if (utils.isProfession(caster, utils.BOUNTY_HUNTER)) - { - buff.applyBuff(self, caster, "bh_crit_hit_vuln"); - } - } - - messageTo(self, "recalcArmor", null, 1, false); - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - combat.cacheCombatData(self); - return SCRIPT_CONTINUE; - } - - - public int armorBreakRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasSkillModModifier(self, effectName)) - { - removeAttribOrSkillModModifier(self, effectName); - } - - if (effectName.lastIndexOf("_") > 0) - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - } - - stopClientEffectObjByLabel(self, effectName); - - combat.removeCombatBuffEffect(self, effectName); - messageTo(self, "recalcArmor", null, 1, false); - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - combat.cacheCombatData(self); - return SCRIPT_CONTINUE; - } - - - public int skillPercentAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - float baseMod = getSkillStatisticModifier(self, subtype.substring(0, (subtype.lastIndexOf("_")))); - baseMod += getEnhancedSkillStatisticModifierUncapped(self, subtype); - float modIncrease = baseMod * (value/100.0f); - - addSkillModModifier(self, effectName, subtype, (int)modIncrease, duration, false, false); - - if ((subtype.startsWith("constitution"))||(subtype.startsWith("stamina"))) - { - messageTo(self, "recalcPools", null, .25f, false); - - } - else if (subtype.startsWith("expertise_innate_protection_")) - { - messageTo(self, "recalcArmor", null, .25f, false); - } - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - return SCRIPT_CONTINUE; - } - - - public int skillPercentRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasSkillModModifier(self, effectName)) - { - removeAttribOrSkillModModifier(self, effectName); - } - - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - stopClientEffectObjByLabel(self, effectName); - - combat.removeCombatBuffEffect(self, effectName); - - if ((subtype.startsWith("constitution"))||(subtype.startsWith("stamina"))) - { - - messageTo(self, "recalcPools", null, .25f, false); - } - else if (subtype.startsWith("expertise_innate_protection_")) - { - messageTo(self, "recalcArmor", null, .25f, false); - } - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - return SCRIPT_CONTINUE; - } - - - public int check_movement_immunity(obj_id self, dictionary params) throws InterruptedException - { - movement.updateMovementImmunity(self); - return SCRIPT_CONTINUE; - } - - - public int recalcPools(obj_id self, dictionary params) throws InterruptedException - { - if (beast_lib.isBeast(self)) - { - beast_lib.initializeBeastStats(beast_lib.getBeastBCD(self), self); - } - else - { - if (isPlayer(self)) - { - skill.recalcPlayerPools(self, false); - } - } - - return SCRIPT_CONTINUE; - } - - - public int recalcArmor(obj_id self, dictionary params) throws InterruptedException - { - if (beast_lib.isBeast(self)) - { - beast_lib.initializeBeastStats(beast_lib.getBeastBCD(self), self); - } - else - { - armor.recalculateArmorForPlayer(self); - } - - return SCRIPT_CONTINUE; - } - - - public int movementAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - if (value == 0) - { - value = -1; - } - - if (movement.hasMovementModifier(self, effectName)) - { - movement.removeMovementModifier(self, effectName, false); - } - - movement.applyMovementModifier(self, effectName, value); - - return SCRIPT_CONTINUE; - } - - - public int movementRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - stopClientEffectObjByLabel(self, effectName); - - if (movement.hasMovementModifier(self, effectName)) - { - movement.removeMovementModifier(self, effectName); - } - - return SCRIPT_CONTINUE; - } - - - public int exclusiveProxyAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int[] buffs = buff.getAllBuffs(self); - - if (subtype != null && !subtype.equals("")) - { - String[] buffsToApply = split(subtype, ','); - - for (int i = 0; i < buffsToApply.length; ++i) - { - testAbortScript(); - buff.applyBuff(self, caster, buffsToApply[i]); - } - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - String thisBuffName = buff.getBuffNameFromCrc(buffs[i]); - - if (thisBuffName.startsWith("exclusive_proxy_")) - { - String actualBuff = thisBuffName.substring(16, thisBuffName.length()); - buff.applyBuff(self, self, actualBuff); - } - - } - - return SCRIPT_CONTINUE; - } - - - public int exclusiveProxyRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int excludeSelfAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int[] buffs = buff.getAllBuffs(self); - - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - String thisBuffName = buff.getBuffNameFromCrc(buffs[i]); - String actualBuff = ""; - - if (thisBuffName.startsWith("exclude_self_")) - { - actualBuff = thisBuffName.substring(13, thisBuffName.length()); - } - else - { - continue; - } - - obj_id gid = getGroupObject(self); - - if (isIdValid(gid)) - { - obj_id[] groupMembers = getGroupMemberIds(gid); - - for (int j = 0; j < groupMembers.length; j++) - { - testAbortScript(); - - float dist = getDistance(groupMembers[j], self); - if (dist > buff.GROUP_BUFF_DISTANCE) - { - continue; - } - - if (!pvpCanHelp(self, groupMembers[j])) - { - - prose_package pp = new prose_package(); - pp.stringId = new string_id("spam", "group_buff_fail_pvp"); - pp.target.set(groupMembers[j]); - sendSystemMessageProse(self, pp); - continue; - } - - if (groupMembers[j] != self) - { - buff.applyBuff(groupMembers[j], self, actualBuff); - } - } - } - - buff.removeBuff(self, thisBuffName); - } - - return SCRIPT_CONTINUE; - } - - - public int excludeSelfRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int delayAttackAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.setScriptVar(self, buff.DEBUFF_STATE_PARALYZED + "."+ effectName, duration); - return SCRIPT_CONTINUE; - } - - - public int delayAttackRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVar(self, buff.DEBUFF_STATE_PARALYZED + "."+ effectName); - - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - stopClientEffectObjByLabel(self, effectName); - return SCRIPT_CONTINUE; - } - - - public int suppressionAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int suppressionRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - removeSlowDownEffect(self); - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - stopClientEffectObjByLabel(self, effectName); - - return SCRIPT_CONTINUE; - } - - - public int scriptVarAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - utils.setScriptVar(self, "buff."+ effectName + ".value", value); - return SCRIPT_CONTINUE; - } - - - public int scriptVarRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - utils.removeScriptVarTree(self, "buff."+ effectName); - stopClientEffectObjByLabel(self, effectName); - - return SCRIPT_CONTINUE; - } - - - public int xpBonusAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int xpBonusRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVarTree(self, "buff.xpBonus"); - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - stopClientEffectObjByLabel(self, effectName); - - return SCRIPT_CONTINUE; - } - - - public int xpBonusGeneralAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int playerLevel = getLevel(self); - if (playerLevel < 90) - { - CustomerServiceLog("buff", "xpBonusGeneralAddBuff Buff used by player: "+self+" Name: "+getName(self)+ " Player Level: "+playerLevel+" Effect: "+effectName+" subtype:"+subtype+" duration: "+duration+" value: "+value+" buffName: "+buffName+" caster: "+caster); - String[] xpArray = - { - "crafting", "combat_general", "entertainer", "space_combat_general", "chronicles" - }; - - utils.setScriptVar(self, "buff.xpBonusGeneral.types", xpArray); - utils.setScriptVar(self, "buff.xpBonusGeneral.value", value / 100); - } - else if (subtype.equals("tcg_xp_buff")) - { - CustomerServiceLog("buff", "xpBonusGeneralAddBuff Buff (TCG SPECIFIC BUFF OBJECT) used by player: "+self+" Name: "+getName(self)+ " Player Level: "+playerLevel+". Since player is 90th Lvl, this player receives a random collection object."); - obj_id collectionItem = collection.grantRandomCollectionItem(self, "datatables/loot/loot_items/collectible/magseal_loot.iff", "collections"); - if (!isValidId(collectionItem) || !exists(collectionItem)) - { - CustomerServiceLog("buff", "xpBonusGeneralAddBuff Buff (TCG SPECIFIC BUFF OBJECT) used by player: "+self+" Name: "+getName(self)+ " Player Level: "+playerLevel+". The collection system reports that a collectible object WAS NOT recieved by the player due to an internal error. Please notify SWG design."); - } - - CustomerServiceLog("buff", "xpBonusGeneralAddBuff Buff (TCG SPECIFIC BUFF OBJECT) used by player: "+self+" Name: "+getName(self)+ " Player Level: "+playerLevel+". The collection system reports that the collectible object: "+getName(collectionItem)+" "+collectionItem+" was recieved by the player."); - buff.removeBuff(self, buffName); - } - return SCRIPT_CONTINUE; - } - - - public int xpBonusGeneralRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVarTree(self, "buff.xpBonusGeneral"); - - return SCRIPT_CONTINUE; - } - - - public int xpGrantedGeneralAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int playerLevel = getLevel(self); - - if (playerLevel < 90) - { - int xpGranted = xp.grantUnmodifiedXPPercentageOfLevel(self, value); - - prose_package pp = new prose_package(); - prose.setStringId(pp, new string_id("collection","reward_xp_amount")); - prose.setDI(pp, xpGranted); - sendSystemMessageProse(self, pp); - } - else if (subtype.equals("tcg_xp_buff")) - { - obj_id collectionItem = collection.grantRandomCollectionItem(self, "datatables/loot/loot_items/collectible/magseal_loot.iff", "collections"); - } - - return SCRIPT_CONTINUE; - } - - - public int xpGrantedGeneralRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int craftBonusAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - float mod = 0.02f; - - if (subtype.equals("artisan")) - { - mod = 0.01f; - } - - int intValue = (int)value; - - utils.setScriptVar(self, "buff.craftBonus.types", intValue); - utils.setScriptVar(self, "buff.craftBonus.value", mod); - - return SCRIPT_CONTINUE; - } - - - public int craftBonusRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVarTree(self, "buff.craftBonus"); - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - stopClientEffectObjByLabel(self, effectName); - - return SCRIPT_CONTINUE; - } - - - public int forcePowerAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - addSkillModModifier(self, effectName, subtype, (int)value, duration, false, false); - - messageTo(self,"handleRecalculateForce", null, 0.1f, false); - - return SCRIPT_CONTINUE; - } - - - public int forcePowerRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - if (hasSkillModModifier(self, effectName)) - { - removeAttribOrSkillModModifier(self, effectName); - } - - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - combat.removeCombatBuffEffect(self, effectName); - stopClientEffectObjByLabel(self, effectName); - jedi.recalculateForcePower(self); - - return SCRIPT_CONTINUE; - } - - - public void procBuffAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - if (!utils.hasScriptVar( self, "procBuffEffects" )) - { - String[] procBuffEffects = new String[1]; - procBuffEffects[0] = effectName; - utils.setScriptVar( self, "procBuffEffects", procBuffEffects ); - } - else - { - Vector procBuffEffects = utils.getResizeableStringArrayScriptVar(self, "procBuffEffects"); - if (utils.getElementPositionInArray(procBuffEffects, effectName) == -1) - { - procBuffEffects.addElement(effectName); - utils.setScriptVar( self, "procBuffEffects", procBuffEffects ); - } - } - - proc.buildCurrentProcList(self); - return; - } - - - public void procBuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - if (utils.hasScriptVar( self, "procBuffEffects" )) - { - Vector procBuffEffects = utils.getResizeableStringArrayScriptVar(self, "procBuffEffects"); - procBuffEffects.removeElement(effectName); - if (procBuffEffects.size() < 1) - { - utils.removeScriptVar(self, "procBuffEffects"); - } - else - { - utils.setScriptVar(self, "procBuffEffects", procBuffEffects); - } - } - - stopClientEffectObjByLabel(self, effectName); - - proc.buildCurrentProcList(self); - return; - } - - - public void reactiveBuffAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - if (!utils.hasScriptVar( self, "reacBuffEffects" )) - { - String[] reacBuffEffects = new String[1]; - reacBuffEffects[0] = effectName; - utils.setScriptVar( self, "reacBuffEffects", reacBuffEffects ); - } - else - { - Vector reacBuffEffects = utils.getResizeableStringArrayScriptVar(self, "reacBuffEffects"); - if (utils.getElementPositionInArray(reacBuffEffects, effectName) == -1) - { - reacBuffEffects.addElement(effectName); - utils.setScriptVar( self, "reacBuffEffects", reacBuffEffects ); - } - } - - proc.buildCurrentReacList(self); - return; - } - - - public void reactiveBuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - if (utils.hasScriptVar( self, "reacBuffEffects" )) - { - Vector reacBuffEffects = utils.getResizeableStringArrayScriptVar(self, "reacBuffEffects"); - reacBuffEffects.removeElement(effectName); - if (reacBuffEffects.size() < 1) - { - utils.removeScriptVar(self, "reacBuffEffects"); - } - else - { - utils.setScriptVar(self, "reacBuffEffects", reacBuffEffects); - } - } - - stopClientEffectObjByLabel(self, effectName); - - proc.buildCurrentReacList(self); - return; - } - - - public int stanceAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - buff.playStanceVisual(self, effectName); - - if (subtype.equals("expertise_stance")) - { - int glanceMod = (int)getSkillStatisticModifier(self, "expertise_stance_glance_buff_line"); - utils.setScriptVar(self, "expertise_stance_glance", glanceMod); - - int stanceConstitutionBonus = (int)getSkillStatisticModifier(self, "expertise_stance_constitution"); - - if (stanceConstitutionBonus > 0) - { - skillAddBuffHandler(self, "stanceConstitution", "constitution_modified", duration, stanceConstitutionBonus, "", null); - } - - int stanceSaberShackle = (int)getSkillStatisticModifier(self, "expertise_stance_saber_throw_snare_chance"); - - if (stanceSaberShackle == 25) - { - buff.applyBuff(self, self, "fs_saber_shackle_1"); - } - else if (stanceSaberShackle == 50) - { - buff.applyBuff(self, self, "fs_saber_shackle_2"); - } - else if (stanceSaberShackle == 75) - { - buff.applyBuff(self, self, "fs_saber_shackle_3"); - } - else if (stanceSaberShackle == 100) - { - buff.applyBuff(self, self, "fs_saber_shackle_4"); - } - - int stanceSoothingAura = (int)getSkillStatisticModifier(self, "expertise_stance_healing_line_fs_heal"); - - if (stanceSoothingAura == 25) - { - buff.applyBuff(self, self, "fs_soothing_aura_1"); - } - else if (stanceSoothingAura == 50) - { - buff.applyBuff(self, self, "fs_soothing_aura_2"); - } - else if (stanceSoothingAura == 75) - { - buff.applyBuff(self, self, "fs_soothing_aura_3"); - } - else if (stanceSoothingAura == 100) - { - buff.applyBuff(self, self, "fs_soothing_aura_4"); - } - - int stanceAnticipateAggression = (int)getSkillStatisticModifier(self, "expertise_stance_anticipate_aggression"); - - if (stanceAnticipateAggression == 4) - { - buff.applyBuff(self, self, "fs_anticipate_aggression_1"); - } - else if (stanceAnticipateAggression == 8) - { - buff.applyBuff(self, self, "fs_anticipate_aggression_2"); - } - - int stanceAddToAction = (int)getSkillStatisticModifier(self, "expertise_stance_damage_add_to_action"); - - if (stanceAddToAction == 2) - { - buff.applyBuff(self, self, "fs_reactive_response_1"); - } - else if (stanceAddToAction == 4) - { - buff.applyBuff(self, self, "fs_reactive_response_2"); - } - - int stanceForceClarity = (int)getSkillStatisticModifier(self, "expertise_stance_fs_force_clarity"); - - if (stanceForceClarity > 0) - { - addSkillModModifier(self, "expertise_fs_force_clarity_1_proc", "expertise_fs_force_clarity_1_proc", (int)stanceForceClarity, -1, false, true); - - messageTo(self, "cacheExpertiseProcReacList", null, 2, false); - } - - int stancePerceptiveSentinel = (int)getSkillStatisticModifier(self, "expertise_stance_perceptive_sentinel"); - - if (stancePerceptiveSentinel == 1) - { - buff.applyBuff(self, self, "fs_perceptive_sentinel_1"); - } - else if (stancePerceptiveSentinel == 2) - { - buff.applyBuff(self, self, "fs_perceptive_sentinel_2"); - } - else if (stancePerceptiveSentinel == 3) - { - buff.applyBuff(self, self, "fs_perceptive_sentinel_3"); - } - else if (stancePerceptiveSentinel == 4) - { - buff.applyBuff(self, self, "fs_perceptive_sentinel_4"); - } - } - - if (subtype.equals("expertise_focus")) - { - int critMod = (int)getSkillStatisticModifier(self, "expertise_focus_critical_buff_line"); - utils.setScriptVar(self, "expertise_stance_critical", critMod); - - float stanceStaminaBonus = (float)getSkillStatisticModifier(self, "expertise_focus_stamina"); - float stanceSrengthBonus = (float)getSkillStatisticModifier(self, "expertise_focus_strength"); - - if (stanceStaminaBonus > 0) - { - skillAddBuffHandler(self, "focusStamina", "stamina_modified", duration, stanceStaminaBonus, "", null); - } - - if (stanceSrengthBonus > 0) - { - skillAddBuffHandler(self, "focusStrength", "strength_modified", duration, stanceSrengthBonus, "", null); - } - - int focusDamageIncrease = (int)getSkillStatisticModifier(self, "expertise_focus_damage_increase"); - - if (focusDamageIncrease == 2) - { - buff.applyBuff(self, self, "fs_ruthless_precision_1"); - } - else if (focusDamageIncrease == 4) - { - buff.applyBuff(self, self, "fs_ruthless_precision_2"); - } - else if (focusDamageIncrease == 6) - { - buff.applyBuff(self, self, "fs_ruthless_precision_3"); - } - else if (focusDamageIncrease == 8) - { - buff.applyBuff(self, self, "fs_ruthless_precision_4"); - } - - int focusActionGain = (int)getSkillStatisticModifier(self, "expertise_focus_damage_add_to_action"); - - if (focusActionGain == 2) - { - buff.applyBuff(self, self, "fs_tempt_hatred_1"); - } - else if (focusActionGain == 4) - { - buff.applyBuff(self, self, "fs_tempt_hatred_2"); - } - - int wracking_energy = getEnhancedSkillStatisticModifierUncapped(self, "expertise_fs_dm_armor_bypass"); - - if (wracking_energy > 0) - { - buff.applyBuff(self, self, "fs_wracking_energy_"+wracking_energy / 25); - } - - int imp_drain = getEnhancedSkillStatisticModifierUncapped(self, "expertise_fs_imp_drain"); - - if (imp_drain == 33) - { - buff.applyBuff(self, self, "fs_imp_force_drain_1"); - } - else if (imp_drain == 66) - { - buff.applyBuff(self, self, "fs_imp_force_drain_2"); - } - else if (imp_drain == 100) - { - buff.applyBuff(self, self, "fs_imp_force_drain_3"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int stanceRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasSkillModModifier(self, effectName)) - { - removeAttribOrSkillModModifier(self, effectName); - } - - int stanceCritical = utils.getIntScriptVar(self, "expertise_stance_critical"); - int stanceGlance = utils.getIntScriptVar(self, "expertise_stance_glance"); - - utils.removeScriptVarTree(self, "expertise_stance_glance"); - utils.removeScriptVarTree(self, "expertise_stance_critical"); - removeAttribOrSkillModModifier(self, "stanceConstitution"); - removeAttribOrSkillModModifier(self, "focusStamina"); - removeAttribOrSkillModModifier(self, "focusStrength"); - - messageTo(self, "recalcPools", null, 1, false); - - buff.removeBuff(self, "fs_saber_shackle_1"); - buff.removeBuff(self, "fs_saber_shackle_2"); - buff.removeBuff(self, "fs_saber_shackle_3"); - buff.removeBuff(self, "fs_saber_shackle_4"); - - buff.removeBuff(self, "fs_soothing_aura_1"); - buff.removeBuff(self, "fs_soothing_aura_2"); - buff.removeBuff(self, "fs_soothing_aura_3"); - buff.removeBuff(self, "fs_soothing_aura_4"); - - buff.removeBuff(self, "fs_anticipate_aggression_1"); - buff.removeBuff(self, "fs_anticipate_aggression_2"); - - buff.removeBuff(self, "fs_reactive_response_1"); - buff.removeBuff(self, "fs_reactive_response_2"); - - buff.removeBuff(self, "fs_perceptive_sentinel_1"); - buff.removeBuff(self, "fs_perceptive_sentinel_2"); - buff.removeBuff(self, "fs_perceptive_sentinel_3"); - buff.removeBuff(self, "fs_perceptive_sentinel_4"); - - buff.removeBuff(self, "fs_saber_reflect"); - - buff.removeBuff(self, "fs_ruthless_precision_1"); - buff.removeBuff(self, "fs_ruthless_precision_2"); - buff.removeBuff(self, "fs_ruthless_precision_3"); - buff.removeBuff(self, "fs_ruthless_precision_4"); - - buff.removeBuff(self, "fs_tempt_hatred_1"); - buff.removeBuff(self, "fs_tempt_hatred_2"); - - buff.removeBuff(self, "fs_wracking_energy_1"); - buff.removeBuff(self, "fs_wracking_energy_2"); - buff.removeBuff(self, "fs_wracking_energy_3"); - buff.removeBuff(self, "fs_wracking_energy_4"); - - buff.removeBuff(self, "fs_imp_force_drain_1"); - buff.removeBuff(self, "fs_imp_force_drain_2"); - buff.removeBuff(self, "fs_imp_force_drain_3"); - buff.removeBuff(self, "fs_imp_force_drain_4"); - - removeAttribOrSkillModModifier(self, "expertise_fs_force_clarity_1_proc"); - messageTo(self, "cacheExpertiseProcReacList", null, 2, false); - - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - combat.removeCombatBuffEffect(self, effectName); - utils.removeScriptVarTree(self, "stance."+ subtype); - - return SCRIPT_CONTINUE; - } - - - public int dancePartyAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - String[] danceList = - { - "poplock", - "poplock2", - "popular", - "popular2", - "bunduki", - "bunduki2", - "breakdance", - "breakdance2", - "peiyi", - "freestyle", - "freestyle2", - "jazzy", - "jazzy2" - }; - - String randomDance = danceList[rand(0, danceList.length - 1)]; - performance.effect(self, performance.PERFORMANCE_EFFECT_DANCE_FLOOR, 1); - obj_id[] everyone = getPlayerCreaturesInRange(getLocation(self), 20.f ); - - for (int i = 0; i < everyone.length; i++) - { - testAbortScript(); - - if (!combat.isInCombat(everyone[i])) - { - utils.setScriptVar(everyone[i], "event.dance_party", 1); - performance.startDance(everyone[i], randomDance); - performance.changeDance(everyone[i], randomDance); - } - } - - return SCRIPT_CONTINUE; - } - - - public int dancePartyRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int missByLuckAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int luckPercentage = getSkillStatisticModifier(caster, "expertise_miss_by_luck"); - - float missIncrease = luckPercentage + 4.0f; - - int luckMod = getEnhancedSkillStatisticModifierUncapped(caster, "luck"); - float luck = (float)getEnhancedSkillStatisticModifierUncapped(caster, "luck_modified") + luckMod; - - float missAmount = luck * (missIncrease / 100.0f); - - skillAddBuffHandler(self, "missByLuck", "combat_all_attack_miss", duration, missAmount, "", null); - - return SCRIPT_CONTINUE; - } - - - public int missByLuckRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - removeAttribOrSkillModModifier(self, "missByLuck"); - - return SCRIPT_CONTINUE; - } - - - public int hitByLuckAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int luckPercentage = getSkillStatisticModifier(caster, "expertise_hit_by_luck"); - - float hitIncrease = luckPercentage + 4.0f; - - int luckMod = getEnhancedSkillStatisticModifierUncapped(caster, "luck"); - float luck = (float)getEnhancedSkillStatisticModifierUncapped(caster, "luck_modified") + luckMod; - - float hitAmount = luck * (hitIncrease / 100.0f); - - skillAddBuffHandler(self, "hitByLuck", "hit_table_defender_add_hit", duration, hitAmount, "", null); - - luckPercentage = getSkillStatisticModifier(caster, "expertise_increase_hit_by_luck"); - - hitAmount = luck * (luckPercentage / 100.0f); - - skillAddBuffHandler(self, "increaseHitByLuck", "hit_table_defender_add_hit", duration, hitAmount, "", null); - - return SCRIPT_CONTINUE; - } - - - public int hitByLuckRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - removeAttribOrSkillModModifier(self, "hitByLuck"); - removeAttribOrSkillModModifier(self, "increaseHitByLuck"); - - return SCRIPT_CONTINUE; - } - - - public int pistolWhipAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int pistolWhipStun = getSkillStatisticModifier(caster, "expertise_stun_line_sm_pistol_whip"); - - if (pistolWhipStun > 0 && rand(0,99) < pistolWhipStun) - { - movementAddBuffHandler(self, effectName, subtype, duration, value, buffName, caster); - } - else - { - buff.removeBuff(self, "sm_pistol_whip"); - } - - return SCRIPT_CONTINUE; - } - - - public int pistolWhipRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - movementRemoveBuffHandler(self, effectName, subtype, duration, value, buffName, caster); - - return SCRIPT_CONTINUE; - } - - - public int slyLieAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int dodgeBonus = (int)getSkillStatisticModifier(self, "expertise_half_truth"); - - if (dodgeBonus > 0) - { - skillAddBuffHandler(self, "slyLieDodge", "combat_dodge", duration, dodgeBonus, "", null); - } - - int strikethroughBonus = (int)getSkillStatisticModifier(self, "expertise_innocent_cargo"); - - if (strikethroughBonus > 0) - { - skillAddBuffHandler(self, "innocentCargoStrikethrough", "combat_strikethrough_chance", duration, strikethroughBonus, "", null); - } - - return SCRIPT_CONTINUE; - } - - - public int slyLieRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasSkillModModifier(self, effectName)) - { - removeAttribOrSkillModModifier(self, effectName); - } - - removeAttribOrSkillModModifier(self, "slyLieDodge"); - removeAttribOrSkillModModifier(self, "innocentCargoStrikethrough"); - - return SCRIPT_CONTINUE; - } - - - public int fastTalkAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int agilityBonus = (int)getSkillStatisticModifier(self, "expertise_fake_id"); - - if (agilityBonus > 0) - { - skillAddBuffHandler(self, "fastTalkAgility", "agility_modified", duration, agilityBonus, "", null); - } - - return SCRIPT_CONTINUE; - } - - - public int fastTalkRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasSkillModModifier(self, effectName)) - { - removeAttribOrSkillModModifier(self, effectName); - } - - removeAttribOrSkillModModifier(self, "fastTalkAgility"); - - return SCRIPT_CONTINUE; - } - - - public int pvpAuraBuffSelfAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - attachScript (self, "player.gcw.pvp_aura_buff_controller"); - - return SCRIPT_CONTINUE; - } - - - public int pvpAuraBuffSelfRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - detachScript (self, "player.gcw.pvp_aura_buff_controller"); - removeObjVar (self, "pvp_aura_buff.faction"); - - return SCRIPT_CONTINUE; - } - - - public int nextHitCritAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.setScriptVar(self, "nextCritHit", 1); - - return SCRIPT_CONTINUE; - } - - - public int nextHitCritRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVarTree(self, "nextCritHit"); - - return SCRIPT_CONTINUE; - } - - - public int critDoubleDamageAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.setScriptVar(self, "critDoubleDamage", 1); - - return SCRIPT_CONTINUE; - } - - - public int critDoubleDamageRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVarTree(self, "critDoubleDamage"); - - return SCRIPT_CONTINUE; - } - - - public int critRootAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.setScriptVar(self, "critRoot", 1); - - return SCRIPT_CONTINUE; - } - - - public int critRootRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVarTree(self, "critRoot"); - - return SCRIPT_CONTINUE; - } - - - public int critOnceAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - Vector effectNames = new Vector(); - - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - if (utils.hasScriptVar(self, "critRemoveBuffNames")) - { - effectNames = utils.getResizeableStringArrayScriptVar(self, "critRemoveBuffNames"); - } - - utils.addElement(effectNames, effectName); - - utils.setScriptVar(self, "critRemoveBuffNames", effectNames); - - return SCRIPT_CONTINUE; - } - - - public int critOnceRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - Vector effectNames = new Vector(); - - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - if (utils.hasScriptVar(self, "critRemoveBuffNames")) - { - effectNames = utils.getResizeableStringArrayScriptVar(self, "critRemoveBuffNames"); - } - - int i = 0; - - while (i < effectNames.size()) - { - testAbortScript(); - if (effectName.equals(((String)(effectNames.get(i))))) - { - utils.removeElementAt(effectNames, i); - } - else - { - i++; - } - } - - if (effectNames.size() == 0) - { - utils.removeScriptVar(self, "critRemoveBuffNames"); - } - else - { - utils.setScriptVar(self, "critRemoveBuffNames", effectNames); - } - - return SCRIPT_CONTINUE; - } - - - public int junkDealerAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - obj_id player = utils.getObjIdScriptVar(self, "junkDealerBuffer"); - - utils.removeScriptVar(self, "junkDealerBuffer"); - - if (!isIdValid(player)) - { - return SCRIPT_OVERRIDE; - } - - int precisionBonus = (int)getSkillStatisticModifier(player, "expertise_buff_under_the_counter"); - - if (precisionBonus > 0) - { - skillAddBuffHandler(self, "junkDealerPrecision", "precision_modified", duration, precisionBonus, "", null); - } - - int damageDecrease = (int)getSkillStatisticModifier(player, "expertise_buff_best_deal_ever"); - - if (damageDecrease > 0) - { - skillAddBuffHandler(self, "junkDealerDamageDecrease", "damage_decrease_percentage", duration, damageDecrease, "", null); - } - - return SCRIPT_CONTINUE; - } - - - public int junkDealerRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - removeAttribOrSkillModModifier(self, "junkDealerPrecision"); - removeAttribOrSkillModModifier(self, "junkDealerDamageDecrease"); - - return SCRIPT_CONTINUE; - } - - - public int commandoSnareBonusAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_OVERRIDE; - } - - String[] modifiers = movement.getAllModifiers(self); - - boolean snared = false; - - if (modifiers != null) - { - for (int i = 0; i < modifiers.length; i++) - { - testAbortScript(); - if (movement.getType(modifiers[i]) == movement.MT_SNARE) - { - snared = true; - } - } - } - - if (!snared) - { - buff.removeBuff(self, "co_youll_regret_that"); - - return SCRIPT_OVERRIDE; - } - - int innateArmorBonus = (int)getSkillStatisticModifier(self, "expertise_youll_regret_that"); - - if (innateArmorBonus > 0) - { - skillAddBuffHandler(self, "commandoInnateArmorBonus", "expertise_innate_protection_all", duration, innateArmorBonus, "", null); - messageTo(self, "recalcArmor", null, 1.0f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int commandoSnareBonusRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - removeAttribOrSkillModModifier(self, "commandoInnateArmorBonus"); - messageTo(self, "recalcArmor", null, .25f, false); - - return SCRIPT_CONTINUE; - } - - - public int commandoFlashBangAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - obj_id owner = utils.getObjIdScriptVar(self, "buffOwner."+ getStringCrc(effectName.toLowerCase())); - - if (!isIdValid(owner)) - { - buff.removeBuff(self, effectName); - return SCRIPT_CONTINUE; - } - - int precisionPenalty = (int)getSkillStatisticModifier(owner, "expertise_co_flash_bang"); - - if (precisionPenalty > 0) - { - skillAddBuffHandler(self, "commandoFlashBang", "precision_modified", duration, (precisionPenalty * -1), "", null); - } - else - { - buff.removeBuff(self, effectName); - } - - return SCRIPT_CONTINUE; - } - - - public int commandoFlashBangRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - removeAttribOrSkillModModifier(self, "commandoFlashBang"); - return SCRIPT_CONTINUE; - } - - - public int commandoMuscleSpasmAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - obj_id owner = utils.getObjIdScriptVar(self, "buffOwner."+ getStringCrc(effectName.toLowerCase())); - - if (!isIdValid(owner)) - { - buff.removeBuff(self, effectName); - return SCRIPT_CONTINUE; - } - - int glancePenalty = (int)getSkillStatisticModifier(owner, "expertise_co_muscle_spasm"); - - if (glancePenalty > 0) - { - skillAddBuffHandler(self, "commandoMuscleSpasm", "glancing_blow_vulnerable", duration, glancePenalty, "", null); - } - else - { - buff.removeBuff(self, effectName); - } - - return SCRIPT_CONTINUE; - } - - - public int commandoMuscleSpasmRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - removeAttribOrSkillModModifier(self, "commandoMuscleSpasm"); - return SCRIPT_CONTINUE; - } - - - public int commandoRiddleArmorAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - String tempEffectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - obj_id owner = utils.getObjIdScriptVar(self, "buffOwner."+ getStringCrc(tempEffectName.toLowerCase())); - - if (!isIdValid(owner)) - { - buff.removeBuff(self, tempEffectName); - return SCRIPT_CONTINUE; - } - - value -= getSkillStatisticModifier(owner, "expertise_riddle_armor"); - - skillAddBuffHandler(self, effectName, "expertise_innate_protection_all", duration, value, "", null); - - return SCRIPT_CONTINUE; - } - - - public int commandoRiddleArmorRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - removeAttribOrSkillModModifier(self, effectName); - messageTo(self, "recalcArmor", null, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int radarInvisAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - setVisibleOnMapAndRadar(self, false); - - return SCRIPT_CONTINUE; - } - - - public int radarInvisRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - setVisibleOnMapAndRadar(self, true); - - return SCRIPT_CONTINUE; - } - - - public int onTargetAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (subtype.equals("expertise_on_target")) - { - - int posSecuredImproved = (int)getSkillStatisticModifier(self, "expertise_action_line_co_imp_pos_sec"); - - if (posSecuredImproved == 10) - { - buff.applyBuff(self, self, "co_pos_sec_action_1"); - } - else if (posSecuredImproved == 20) - { - buff.applyBuff(self, self, "co_pos_sec_action_2"); - } - else if (posSecuredImproved == 30) - { - buff.applyBuff(self, self, "co_pos_sec_action_3"); - } - - int posSecuredBurstFire = (int)getSkillStatisticModifier(self, "expertise_co_pos_secured_line_burst_fire_proc"); - - if (posSecuredBurstFire == 10) - { - buff.applyBuff(self, self, "co_pos_sec_proc_1"); - messageTo(self, "cacheExpertiseProcReacList", null, 2, false); - } - else if (posSecuredBurstFire == 20) - { - buff.applyBuff(self, self, "co_pos_sec_proc_2"); - messageTo(self, "cacheExpertiseProcReacList", null, 2, false); - } - - int posSecuredOnTarget = (int)getSkillStatisticModifier(self, "expertise_co_pos_secured_line_critical"); - - if (posSecuredOnTarget == 2) - { - buff.applyBuff(self, self, "co_pos_sec_critical_1"); - } - else if (posSecuredOnTarget == 4) - { - buff.applyBuff(self, self, "co_pos_sec_critical_2"); - } - else if (posSecuredOnTarget == 6) - { - buff.applyBuff(self, self, "co_pos_sec_critical_3"); - } - else if (posSecuredOnTarget == 8) - { - buff.applyBuff(self, self, "co_pos_sec_critical_4"); - } - - int posSecuredBoO = (int)getSkillStatisticModifier(self, "expertise_co_pos_secured_line_armor"); - - if (posSecuredBoO == 1000) - { - buff.applyBuff(self, self, "co_base_of_operations"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int onTargetRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasSkillModModifier(self, effectName)) - { - removeAttribOrSkillModModifier(self, effectName); - } - - buff.removeBuff(self, "co_pos_sec_action_1"); - buff.removeBuff(self, "co_pos_sec_action_2"); - buff.removeBuff(self, "co_pos_sec_action_3"); - - buff.removeBuff(self, "co_pos_sec_proc_1"); - buff.removeBuff(self, "co_pos_sec_proc_2"); - messageTo(self, "cacheExpertiseProcReacList", null, 2, false); - - buff.removeBuff(self, "co_pos_sec_critical_1"); - buff.removeBuff(self, "co_pos_sec_critical_2"); - buff.removeBuff(self, "co_pos_sec_critical_3"); - buff.removeBuff(self, "co_pos_sec_critical_4"); - - if (buff.hasBuff(self, "co_base_of_operations")) - { - obj_id baseOwner = buff.getBuffOwner(self, "co_base_of_operations"); - - if ((baseOwner == self) || !isIdValid(baseOwner)) - { - buff.removeBuff(self, "co_base_of_operations"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int immunityAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - String prefixBuilder = ""; - int wholeValue = (int)value; - if (subtype.equals("dot_immunity")) - { - - if (wholeValue == IMMUNITY_TO_POISON) - { - buff.performBuffDotImmunity(self, buff.DOT_POISON); - - if (dot.removeDotsOfType(self, dot.DOT_POISON)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "poisoned", cureDotMsg); - } - prefixBuilder = "dot.poison"; - } - else if (wholeValue == IMMUNITY_TO_DISEASE) - { - buff.performBuffDotImmunity(self, buff.DOT_DISEASE); - - if (dot.removeDotsOfType(self, dot.DOT_DISEASE)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "diseased", cureDotMsg); - } - prefixBuilder = "dot.disease"; - } - else if (wholeValue == IMMUNITY_TO_FIRE) - { - buff.performBuffDotImmunity(self, buff.DOT_FIRE); - - if (dot.removeDotsOfType(self, dot.DOT_FIRE)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "on fire", cureDotMsg); - } - prefixBuilder = "dot.fire"; - } - else if (wholeValue == IMMUNITY_TO_BLEEDING) - { - buff.performBuffDotImmunity(self, buff.DOT_BLEEDING); - - if (dot.removeDotsOfType(self, dot.DOT_BLEEDING)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "bleeding", cureDotMsg); - } - prefixBuilder = "dot.bleeding"; - } - else if (wholeValue == IMMUNITY_TO_ACID) - { - buff.performBuffDotImmunity(self, buff.DOT_ACID); - - if (dot.removeDotsOfType(self, dot.DOT_ACID)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "acid splattered", cureDotMsg); - } - prefixBuilder = "dot.acid"; - } - else if (wholeValue == IMMUNITY_TO_ENERGY) - { - buff.performBuffDotImmunity(self, buff.DOT_ENERGY); - - if (dot.removeDotsOfType(self, dot.DOT_ENERGY)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "electrified", cureDotMsg); - } - prefixBuilder = "dot.energy"; - } - else if (wholeValue == IMMUNITY_TO_ALL_DOTS) - { - buff.performBuffDotImmunity(self, "all"); - - if (dot.removeDotsOfType(self, dot.DOT_POISON)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "poisoned", cureDotMsg); - } - if (dot.removeDotsOfType(self, dot.DOT_DISEASE)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "diseased", cureDotMsg); - } - if (dot.removeDotsOfType(self, dot.DOT_FIRE)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "on fire", cureDotMsg); - } - if (dot.removeDotsOfType(self, dot.DOT_BLEEDING)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "bleeding", cureDotMsg); - } - if (dot.removeDotsOfType(self, dot.DOT_ACID)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "acid splattered", cureDotMsg); - } - if (dot.removeDotsOfType(self, dot.DOT_ENERGY)) - { - string_id cureDotMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "electrified", cureDotMsg); - } - - prefixBuilder = "dot.all"; - } - else - { - return SCRIPT_OVERRIDE; - } - } - else if (subtype.equals("movement_immunity")) - { - - if (wholeValue == movement.MT_SNARE) - { - - if (removeAllModifiersOfType(self, movement.MT_SNARE)) - { - string_id cureMovementMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "snared", cureMovementMsg); - } - prefixBuilder = "movement.snare"; - - } - else if (wholeValue == movement.MT_ROOT) - { - - if (removeAllModifiersOfType(self, movement.MT_ROOT)) - { - string_id cureMovementMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "rooted", cureMovementMsg); - } - prefixBuilder = "movement.root"; - - } - else if (wholeValue == movement.MT_ALL) - { - removeAllModifiersOfType(self, movement.MT_SNARE); - removeAllModifiersOfType(self, movement.MT_ROOT); - } - else - { - return SCRIPT_OVERRIDE; - } - } - else if (subtype.equals("state_immunity")) - { - - if (wholeValue == buff.STATE_STUNNED) - { - - if (buff.removeAllBuffsOfStateType(self, buff.STATE_STUNNED)) - { - string_id cureStateMsg = new string_id ("spam", "cure_dot"); - messageDetrimentalRemoved(self, "stunned", cureStateMsg); - } - prefixBuilder = "state.stun"; - } - else - { - return SCRIPT_OVERRIDE; - } - } - else if (subtype.equals("debuff_purge")) - { - int numToPurge = wholeValue; - - int[] allBuffs = buff.getAllBuffs(self); - - for (int i = 0; i < allBuffs.length; i++) - { - testAbortScript(); - String curBuff = buff.getBuffNameFromCrc(allBuffs[i]); - - if (numToPurge < 1) - { - return SCRIPT_CONTINUE; - } - - if (buff.isDebuff(curBuff) && !buff.isDotIconOnlyBuff(curBuff) && buff.canBeDispelled(curBuff) && !buff.isBuffDot(curBuff)) - { - - long stack = buff.getBuffStackCount(self, curBuff); - if (stack > 1 && numToPurge > 1) - { - if (stack > numToPurge) - { - buff.decrementBuffStack(self, curBuff, numToPurge); - return SCRIPT_CONTINUE; - } - else - { - buff.removeBuff(self, curBuff); - numToPurge -= stack; - } - - } - else - { - buff.removeBuff(self, curBuff); - numToPurge--; - } - } - } - - } - else if (subtype.equals("buff_purge")) - { - int numToPurge = wholeValue; - - int[] allBuffs = buff.getAllBuffs(self); - - for (int i = 0; i < allBuffs.length; i++) - { - testAbortScript(); - String curBuff = buff.getBuffNameFromCrc(allBuffs[i]); - - if (numToPurge < 1) - { - return SCRIPT_CONTINUE; - } - - if (!buff.isDebuff(curBuff) && !buff.isDotIconOnlyBuff(curBuff) && buff.canBeDispelled(curBuff)) - { - buff.removeBuff(self, curBuff); - numToPurge--; - } - } - - } - else - { - return SCRIPT_OVERRIDE; - } - - if (!prefixBuilder.equals("")) - { - utils.setScriptVar(self, "immunity."+ prefixBuilder, wholeValue); - - } - else - { - - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int dotReductionAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (subtype.equals("dot_reduction_acid") || subtype.equals("dot_reduction_all") || subtype.equals("dot_reduction_elemental")) - { - buff.reduceBuffDotStackCount(self, buff.DOT_ACID, (int)value); - dot.removeDotsOfType(self, dot.DOT_ACID); - } - if (subtype.equals("dot_reduction_heat") || subtype.equals("dot_reduction_all")|| subtype.equals("dot_reduction_elemental")) - { - buff.reduceBuffDotStackCount(self, buff.DOT_FIRE, (int)value); - dot.removeDotsOfType(self, dot.DOT_FIRE); - } - if (subtype.equals("dot_reduction_cold") || subtype.equals("dot_reduction_all")|| subtype.equals("dot_reduction_elemental")) - { - buff.reduceBuffDotStackCount(self, buff.DOT_COLD, (int)value); - dot.removeDotsOfType(self, dot.DOT_COLD); - } - if (subtype.equals("dot_reduction_electrical") || subtype.equals("dot_reduction_all")|| subtype.equals("dot_reduction_elemental")) - { - buff.reduceBuffDotStackCount(self, buff.DOT_ELECTRICITY, (int)value); - dot.removeDotsOfType(self, dot.DOT_ELECTRICITY); - } - if (subtype.equals("dot_reduction_kinetic") || subtype.equals("dot_reduction_all")|| subtype.equals("dot_reduction_elemental")) - { - buff.reduceBuffDotStackCount(self, buff.DOT_KINETIC, (int)value); - dot.removeDotsOfType(self, dot.DOT_KINETIC); - } - if (subtype.equals("dot_reduction_energy") || subtype.equals("dot_reduction_all")|| subtype.equals("dot_reduction_elemental")) - { - buff.reduceBuffDotStackCount(self, buff.DOT_ENERGY, (int)value); - dot.removeDotsOfType(self, dot.DOT_ENERGY); - } - if (subtype.equals("dot_reduction_poison") || subtype.equals("dot_reduction_all")|| subtype.equals("dot_reduction_natural")) - { - buff.reduceBuffDotStackCount(self, buff.DOT_POISON, (int)value); - dot.removeDotsOfType(self, dot.DOT_POISON); - } - if (subtype.equals("dot_reduction_disease") || subtype.equals("dot_reduction_all")|| subtype.equals("dot_reduction_natural")) - { - buff.reduceBuffDotStackCount(self, buff.DOT_DISEASE, (int)value); - dot.removeDotsOfType(self, dot.DOT_DISEASE); - } - if (subtype.equals("dot_reduction_bleeding") || subtype.equals("dot_reduction_all")|| subtype.equals("dot_reduction_natural")) - { - buff.reduceBuffDotStackCount(self, buff.DOT_BLEEDING, (int)value); - dot.removeDotsOfType(self, dot.DOT_BLEEDING); - } - - return SCRIPT_CONTINUE; - } - - - public int dotReductionRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int dotDivisorAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (subtype.equals("dot_divisor_acid") || subtype.equals("dot_divisor_all") || subtype.equals("dot_divisor_elemental")) - { - buff.divideBuffDotStackCount(self, buff.DOT_ACID, (int)value); - dot.removeDotsOfType(self, dot.DOT_ACID); - } - if (subtype.equals("dot_divisor_heat") || subtype.equals("dot_divisor_all") || subtype.equals("dot_divisor_elemental")) - { - buff.divideBuffDotStackCount(self, buff.DOT_FIRE, (int)value); - dot.removeDotsOfType(self, dot.DOT_FIRE); - } - if (subtype.equals("dot_divisor_cold") || subtype.equals("dot_divisor_all") || subtype.equals("dot_divisor_elemental")) - { - buff.divideBuffDotStackCount(self, buff.DOT_COLD, (int)value); - dot.removeDotsOfType(self, dot.DOT_COLD); - } - if (subtype.equals("dot_rdivisor_electrical") || subtype.equals("dot_divisor_all") || subtype.equals("dot_divisor_elemental")) - { - buff.divideBuffDotStackCount(self, buff.DOT_ELECTRICITY, (int)value); - dot.removeDotsOfType(self, dot.DOT_ELECTRICITY); - } - if (subtype.equals("dot_divisor_kinetic") || subtype.equals("dot_divisor_all") || subtype.equals("dot_divisor_elemental")) - { - buff.divideBuffDotStackCount(self, buff.DOT_KINETIC, (int)value); - dot.removeDotsOfType(self, dot.DOT_KINETIC); - } - if (subtype.equals("dot_divisor_energy") || subtype.equals("dot_divisor_all") || subtype.equals("dot_divisor_elemental")) - { - buff.divideBuffDotStackCount(self, buff.DOT_ENERGY, (int)value); - dot.removeDotsOfType(self, dot.DOT_ENERGY); - } - if (subtype.equals("dot_divisor_poison") || subtype.equals("dot_divisor_all") || subtype.equals("dot_divisor_natural")) - { - buff.divideBuffDotStackCount(self, buff.DOT_POISON, (int)value); - dot.removeDotsOfType(self, dot.DOT_POISON); - } - if (subtype.equals("dot_divisor_disease") || subtype.equals("dot_divisor_all") || subtype.equals("dot_divisor_natural")) - { - buff.divideBuffDotStackCount(self, buff.DOT_DISEASE, (int)value); - dot.removeDotsOfType(self, dot.DOT_DISEASE); - } - if (subtype.equals("dot_divisor_bleeding") || subtype.equals("dot_divisor_all") || subtype.equals("dot_divisor_natural")) - { - buff.divideBuffDotStackCount(self, buff.DOT_BLEEDING, (int)value); - dot.removeDotsOfType(self, dot.DOT_BLEEDING); - } - - return SCRIPT_CONTINUE; - } - - - public int dotDivisorRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int immunityRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - String prefixBuilder = ""; - int wholeValue = (int)value; - if (subtype.equals("dot_immunity")) - { - if (wholeValue == IMMUNITY_TO_POISON) - { - prefixBuilder = "dot.poison"; - } - else if (wholeValue == IMMUNITY_TO_FIRE) - { - prefixBuilder = "dot.fire"; - } - else if (wholeValue == IMMUNITY_TO_DISEASE) - { - prefixBuilder = "dot.disease"; - } - else if (wholeValue == IMMUNITY_TO_BLEEDING) - { - prefixBuilder = "dot.bleeding"; - } - else if (wholeValue == IMMUNITY_TO_ALL_DOTS) - { - prefixBuilder = "dot.all"; - } - else - { - return SCRIPT_OVERRIDE; - } - } - else if (subtype.equals("movement_immunity")) - { - if (wholeValue == movement.MT_SNARE) - { - prefixBuilder = "movement.snare"; - } - else if (wholeValue == movement.MT_ROOT) - { - prefixBuilder = "movement.root"; - } - else - { - return SCRIPT_OVERRIDE; - } - } - else if (subtype.equals("state_immunity")) - { - if (wholeValue == buff.STATE_STUNNED) - { - prefixBuilder = "state.stun"; - } - else - { - return SCRIPT_OVERRIDE; - } - } - else - { - return SCRIPT_OVERRIDE; - } - - if (!prefixBuilder.equals("")) - { - utils.removeScriptVarTree(self, "immunity."+ prefixBuilder); - - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - stopClientEffectObjByLabel(self, effectName); - } - else - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int expertiseImmunityAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (!buff.isInStance(self)) - { - - buff.removeBuff(self, "fs_sh_0"); - buff.removeBuff(self, "fs_sh_1"); - buff.removeBuff(self, "fs_sh_2"); - buff.removeBuff(self, "fs_sh_3"); - - buff.removeBuff(self, "fs_dot_immunity_recourse"); - - return SCRIPT_OVERRIDE; - } - - int wholeValue = (int)value; - - int immunityType = (int)getSkillStatisticModifier(self, subtype + wholeValue); - - if (immunityType != 0) - { - return immunityAddBuffHandler(self, effectName, subtype, duration, value, "", null); - } - - return SCRIPT_OVERRIDE; - } - - - public int expertiseImmunityRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return immunityRemoveBuffHandler(self, effectName, subtype, duration, value, "", null); - } - - - public int expertiseChannelActionHealAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.setScriptVar(self, "buff_handler.lastForsakeFearPulse", getGameTime()); - utils.setScriptVar(self, "buff_handler.totalForsakeFearPulses", 0); - utils.removeScriptVar(self, "buff_handler.channelForsakeFearCancelled"); - utils.removeScriptVar(self, "buff_handler.channelForsakeFearSuccessful"); - - return SCRIPT_CONTINUE; - } - - - public int expertiseChannelActionHealRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int cancelled = utils.getIntScriptVar(self, "buff_handler.channelForsakeFearCancelled"); - - int successful = utils.getIntScriptVar(self, "buff_handler.channelForsakeFearSuccessful"); - - if (cancelled == 0 && successful == 1) - { - - channelForsakeFear(self, effectName, true); - } - - utils.removeScriptVar(self, "buff_handler.channelForsakeFearCancelled"); - utils.removeScriptVar(self, "buff_handler.totalForsakeFearPulses"); - utils.removeScriptVar(self, "buff_handler.lastForsakeFearPulse"); - utils.removeScriptVar(self, "buff_handler.channelForsakeFearSuccessful"); - - return SCRIPT_CONTINUE; - } - - - public int onIncapHealAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.setScriptVar(self, "buff_handler."+subtype, value); - return SCRIPT_CONTINUE; - } - - - public int onIncapHealRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVar(self, "buff_handler."+subtype); - - return SCRIPT_CONTINUE; - } - - - public int healEffectAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (subtype.equals("healing_action")) - { - healing.healDamage(self, ACTION, (int)value); - return SCRIPT_CONTINUE; - } - - else if (subtype.equals("healing_health")) - { - healing.healDamage(caster, self, HEALTH, (int)value); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int healEffectRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int buildabuffAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (!utils.hasScriptVar(self, "performance.buildabuff.buffComponentKeys") || !utils.hasScriptVar(self, "performance.buildabuff.buffComponentValues")) - { - - return SCRIPT_CONTINUE; - } - - String[] buffComponentKeys = utils.getStringArrayScriptVar(self, "performance.buildabuff.buffComponentKeys"); - int[] buffComponentValues = utils.getIntArrayScriptVar(self, "performance.buildabuff.buffComponentValues"); - obj_id bufferId = utils.getObjIdScriptVar(self, "performance.buildabuff.bufferId"); - - { - CustomerServiceLog("SuspectedCheaterChannel: ", "Entered BuildABuffAdd Handler, dumping info..."); - CustomerServiceLog("SuspectedCheaterChannel: ", "BufferId: "+ bufferId + " IsValid: "+ isIdValid(bufferId) + " Exists: "+ exists(bufferId) + " isInternalDecay: "+ utils.hasScriptVar(self, "buffDecay")); - for (int i = 0; i < buffComponentKeys.length; ++i) - { - testAbortScript(); - CustomerServiceLog("SuspectedCheaterChannel: ", "BuffComponentKey["+ i + "] = "+ buffComponentKeys[i]); - } - for (int i = 0; i < buffComponentValues.length; ++i) - { - testAbortScript(); - CustomerServiceLog("SuspectedCheaterChannel: ", "BuffComponentValues["+ i + "] = "+ buffComponentValues[i]); - } - } - - boolean internalDecay = false; - if (utils.hasScriptVar(self, "buffDecay")) - { - internalDecay = true; - - utils.removeScriptVar(self, "buffDecay"); - } - - CustomerServiceLog("SuspectedCheaterChannel: ", "Internal Decay = "+ internalDecay); - - int improv = 0; - if (isIdValid(bufferId) && exists(bufferId)) - { - improv = (int)getSkillStatisticModifier(bufferId, "expertise_en_improv"); - } - - if (internalDecay == true) - { - if (utils.hasScriptVar(self, "decayImprov")) - { - improv = utils.getIntScriptVar(self, "decayImprov"); - } - - } - else - { - utils.setScriptVar(self, "decayImprov", improv); - - } - - int improvDance = 0; - if (improv == 1 && isIdValid(bufferId) && exists(bufferId)) - { - if (!camping.isInEntertainmentCamp(bufferId)) - { - location loc = getLocation(bufferId); - if (isIdValid(loc.cell)) - { - obj_id building = getTopMostContainer(loc.cell); - if (!hasObjVar(building, "healing.canhealshock") && !hasObjVar(loc.cell, "healing.canhealshock")) - { - region[] regs = getRegionsWithGeographicalAtPoint(getLocation(bufferId), regions.GEO_THEATER); - if (regs == null || regs.length == 0) - { - improvDance = 1; - } - } - } - } - } - - if (internalDecay == true) - { - if (utils.hasScriptVar(self, "decayImprovDance")) - { - improvDance = utils.getIntScriptVar(self, "decayImprovDance"); - CustomerServiceLog("SuspectedCheaterChannel: ", "Using stored ImprovDance: "+ improvDance); - - } - - } - else - { - utils.setScriptVar(self, "decayImprovDance", improvDance); - CustomerServiceLog("SuspectedCheaterChannel: ", "Storing improvDance: "+ improvDance); - - } - - int actualPointsToSpend = 8; - if (isIdValid(bufferId) && exists(bufferId)) - { - actualPointsToSpend += getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_base_point_increase"); - } - - int attemptingToSpendPoints = 0; - for (int i = 0; i < buffComponentKeys.length; i++) - { - testAbortScript(); - - if (internalDecay == true) - { - break; - } - - dictionary buffData = dataTableGetRow(DATATABLE_BUFF_BUILDER, buffComponentKeys[i]); - int cost = buffData.getInt("COST") * buffComponentValues[i]; - attemptingToSpendPoints += cost; - - if (attemptingToSpendPoints > actualPointsToSpend && internalDecay == false) - { - sendSystemMessage(bufferId, "ERROR: Invalid data. Discrepancy logs generated.", null); - CustomerServiceLog("SuspectedCheaterChannel: ", "Player ("+getName(bufferId)+" : "+ bufferId + ") has tried to spend more points on inspiration buffs then they have ("+attemptingToSpendPoints+")! The buff failed."); - - return SCRIPT_CONTINUE; - } - } - - if (buffComponentKeys.length == buffComponentValues.length && buffComponentKeys.length > 0 && buffComponentValues.length > 0) - { - for (int i = 0; i < buffComponentKeys.length; i++) - { - testAbortScript(); - dictionary buffData = dataTableGetRow(DATATABLE_BUFF_BUILDER, buffComponentKeys[i]); - String effect = buffData.getString("AFFECTS"); - String category = buffData.getString("CATEGORY"); - - int effectAmount = buffData.getInt("AFFECT_AMOUNT"); - int maxTimes = buffData.getInt("MAX_TIMES_APPLIED"); - - if (buffComponentValues[i] > maxTimes) - { - if (internalDecay == false) - { - CustomerServiceLog("SuspectedCheaterChannel: ", "Player ("+getName(bufferId)+" : "+ bufferId + ") has passed an out of bounds build-a-buff value ("+ buffComponentValues[i] + ") which has a cap of ("+ maxTimes + "). HAX!"); - sendSystemMessage(bufferId, "ERROR: Capping invalid buff values. Discrepancy logs generated.", null); - } - buffComponentValues[i] = maxTimes; - } - - float buffValue = effectAmount * buffComponentValues[i]; - - if (improvDance == 1) - { - buffValue = (buffValue * 0.2f); - } - - if (category.equals("attributes") || category.equals("resistances") || category.equals("combat")) - { - - if (category.equals("attributes")) - { - float attribModifier = 0.0f; - - if (isIdValid(bufferId) && exists(bufferId)) - { - attribModifier = (float)(getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_attrib_increase")/100.0f); - } - - if (internalDecay == true) - { - if (utils.hasScriptVar(self, "decayAttribMod")) - { - attribModifier = utils.getFloatScriptVar(self, "decayAttribMod"); - CustomerServiceLog("SuspectedCheaterChannel: ", "Using stored attribMod: "+ attribModifier); - - } - - } - else - { - CustomerServiceLog("SuspectedCheaterChannel: ", "Storing attribMod: "+ attribModifier); - - utils.setScriptVar(self, "decayAttribMod", attribModifier); - - } - - buffValue *= 1.0f + attribModifier; - } - - else if (category.equals("resistances")) - { - float resistModifier = 0.0f; - - if (isIdValid(bufferId) && exists(bufferId)) - { - resistModifier = (float)(getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_resist_increase")/100.0f); - } - - if (internalDecay == true) - { - if (utils.hasScriptVar(self, "decayResistMod")) - { - resistModifier = utils.getFloatScriptVar(self, "decayResistMod"); - } - - } - else - { - utils.setScriptVar(self, "decayResistMod", resistModifier); - - } - - buffValue *= 1.0f + resistModifier; - } - - else if (category.equals("combat")) - { - float combatModifier = 0.0f; - - if (isIdValid(bufferId) && exists(bufferId)) - { - combatModifier = getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_combat_buff_increase"); - } - - if (internalDecay == true) - { - if (utils.hasScriptVar(self, "decayCombatMod")) - { - combatModifier = utils.getFloatScriptVar(self, "decayCombatMod"); - } - - } - else - { - utils.setScriptVar(self, "decayCombatMod", combatModifier); - - } - - buffValue += combatModifier; - } - { - - CustomerServiceLog("SuspectedCheaterChannel: ", "Adding Stat Modifier: "+ "buildabuff_"+ effect + " Value = "+ buffValue + " Duration = "+ duration); - - } - - addSkillModModifier(self, "buildabuff_"+ effect, effect, (int)buffValue, duration, false, true); - - if ((effect.startsWith("constitution"))||(effect.startsWith("stamina"))) - { - messageTo(self, "recalcPools", null, .25f, false); - } - else if (effect.startsWith("expertise_innate_protection_")) - { - messageTo(self, "recalcArmor", null, .25f, false); - } - } - else if (category.equals("trade")) - { - - float tradeModifier = 0.0f; - - if (isIdValid(bufferId) && exists(bufferId)) - { - tradeModifier = (float)(getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_trader_increase")/100.0f); - } - - if (internalDecay == true) - { - if (utils.hasScriptVar(self, "decayTradeMod")) - { - tradeModifier = utils.getFloatScriptVar(self, "decayTradeMod"); - } - - } - else - { - utils.setScriptVar(self, "decayTradeMod", tradeModifier); - - } - - buffValue *= 1.0f + tradeModifier; - - String[] xpArray = - { - "crafting", "combat_general", "entertainer", "space_combat_general" - }; - - utils.setScriptVar(self, "buff.xpBonus.types", xpArray); - utils.setScriptVar(self, "buff.xpBonus.value", buffValue/100); - { - - CustomerServiceLog("SuspectedCheaterChannel: ", "Adding Stat Modifier: "+ "buildabuff_"+ effect + " Value = "+ buffValue + " Duration = "+ duration); - - } - - addSkillModModifier(self, "buildabuff_"+ effect, effect, (int)buffValue, duration, false, true); - } - else if (category.equals("misc")) - { - if (effect.equals("movement_speed")) - { - if (value == 0) - { - value = 1; - } - - if (movement.hasMovementModifier(self, "buildabuff_movement_speed")) - { - movement.removeMovementModifier(self, "buildabuff_movement_speed", false); - } - - movement.applyMovementModifier(self, "buildabuff_movement_speed", buffValue); - } - else if (effect.equals("reactive_second_chance")) - { - int playerLevel = getLevel(self); - float reactiveModifier = 0.0f; - - if (isIdValid(bufferId) && exists(bufferId)) - { - reactiveModifier = getEnhancedSkillStatisticModifierUncapped(bufferId, "expertise_en_inspire_proc_chance_increase"); - } - - if (internalDecay == true) - { - if (utils.hasScriptVar(self, "decayReactiveMod")) - { - reactiveModifier = utils.getFloatScriptVar(self, "decayReactiveMod"); - } - - } - else - { - utils.setScriptVar(self, "decayReactiveMod", reactiveModifier); - - } - - buffValue += reactiveModifier; - - if (playerLevel > 69) - { - addSkillModModifier(self, "expertise_buildabuff_heal_3_reac", "expertise_buildabuff_heal_3_reac", (int)buffValue, duration, false, true); - } - else if (playerLevel > 39 && playerLevel < 70) - { - addSkillModModifier(self, "expertise_buildabuff_heal_2_reac", "expertise_buildabuff_heal_2_reac", (int)buffValue, duration, false, true); - } - else - { - addSkillModModifier(self, "expertise_buildabuff_heal_1_reac", "expertise_buildabuff_heal_1_reac", (int)buffValue, duration, false, true); - } - - messageTo(self, "cacheExpertiseProcReacList", null, 2, false); - } - else if (effect.equals("flush_with_success")) - { - - String[] xpArray = - { - "crafting", "combat_general", "entertainer", "space_combat_general", "chronicles" - }; - - utils.setScriptVar(self, "buff.xpBonus.types", xpArray); - utils.setScriptVar(self, "buff.xpBonus.value", buffValue/100.0f); - } - else - { - { - - CustomerServiceLog("SuspectedCheaterChannel: ", "Adding Stat Modifier: "+ "buildabuff_"+ effect + " Value = "+ buffValue + " Duration = "+ duration); - - } - - addSkillModModifier(self, "buildabuff_"+ effect, effect, (int)buffValue, duration, false, true); - } - } - } - - if (!buff.hasBuff(self, "col_ent_invis_buff_tracker")) - { - collection.entertainerBuffCollection(self, bufferId, duration); - } - } - else - { - sendSystemMessageTestingOnly(self, "Malformed buildabuff data passed to buildabuffAddBuffHandler."); - } - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - if (hasScript(self, "systems.buff_builder.buff_builder_cancel")) - { - detachScript(self, "systems.buff_builder.buff_builder_cancel"); - } - - return SCRIPT_CONTINUE; - } - - - public int buildabuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - String[] baseModList = dataTableGetStringColumn(DATATABLE_BUFF_BUILDER, "AFFECTS"); - - for (int i = 0; i < baseModList.length; i++) - { - testAbortScript(); - if (hasSkillModModifier(self, "buildabuff_"+ baseModList[i])) - { - removeAttribOrSkillModModifier(self, "buildabuff_"+ baseModList[i]); - } - } - - if (hasSkillModModifier(self, "expertise_buildabuff_heal_1_reac")) - { - removeAttribOrSkillModModifier(self, "expertise_buildabuff_heal_1_reac"); - } - - if (hasSkillModModifier(self, "expertise_buildabuff_heal_2_reac")) - { - removeAttribOrSkillModModifier(self, "expertise_buildabuff_heal_2_reac"); - } - - if (hasSkillModModifier(self, "expertise_buildabuff_heal_3_reac")) - { - removeAttribOrSkillModModifier(self, "expertise_buildabuff_heal_3_reac"); - } - - messageTo(self, "recalcPools", null, 1, false); - messageTo(self, "recalcArmor", null, .25f, false); - messageTo(self, "cacheExpertiseProcReacList", null, 2, false); - - utils.removeScriptVar(self, "performance.buildabuff.modNames"); - utils.removeScriptVar(self, "performance.buildabuff.modValues"); - utils.removeScriptVarTree(self, "buff.xpBonus"); - - if (movement.hasMovementModifier(self, "buildabuff_movement_speed")) - { - movement.removeMovementModifier(self, "buildabuff_movement_speed"); - } - - if (hasScript(self, "systems.buff_builder.buff_builder_cancel")) - { - detachScript(self, "systems.buff_builder.buff_builder_cancel"); - } - - trial.bumpSession(self, "displayDefensiveMods"); - messageTo(self, "setDisplayOnlyDefensiveMods", trial.getSessionDict(self, "displayDefensiveMods") , 5, false); - - return SCRIPT_CONTINUE; - } - - - public int meDoomAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - showFlyText(self, new string_id("set_bonus", "doom_fly"), 2, colors.BLACK); - - obj_id doomOwner = utils.getObjIdScriptVar(self, "me_doom.doom_owner"); - int doomStage = utils.getIntScriptVar(self, "me_doom.doom_stage"); - - if (!isIdValid(doomOwner)) - { - utils.removeScriptVar(self, "me_doom.doom_owner"); - utils.removeScriptVar(self, "me_doom.doom_stage"); - return SCRIPT_CONTINUE; - } - - if (doomStage > 3 || doomStage < 1) - { - utils.removeScriptVar(self, "me_doom.doom_owner"); - utils.removeScriptVar(self, "me_doom.doom_stage"); - return SCRIPT_CONTINUE; - } - - if (doomStage == 2) - { - dot.applyDotEffect(self, doomOwner, "bleeding", "me_doom_bleed", HEALTH, 100, 800, 5, true, null); - } - - if (doomStage == 3) - { - dot.applyDotEffect(self, doomOwner, "fire", "me_doom_bleed", HEALTH, 100, 800, 5, true, null); - } - - return SCRIPT_CONTINUE; - } - - - public int meDoomRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - obj_id doomOwner = utils.getObjIdScriptVar(self, "me_doom.doom_owner"); - int doomStage = utils.getIntScriptVar(self, "me_doom.doom_stage"); - - if (!isIdValid(doomOwner)) - { - utils.removeScriptVar(self, "me_doom.doom_owner"); - utils.removeScriptVar(self, "me_doom.doom_stage"); - return SCRIPT_CONTINUE; - } - - if (doomStage > 3 || doomStage < 1) - { - utils.removeScriptVar(self, "me_doom.doom_owner"); - utils.removeScriptVar(self, "me_doom.doom_stage"); - return SCRIPT_CONTINUE; - } - - if (doomStage == 1) - { - utils.setScriptVar(self, "me_doom.doom_stage", 2); - buff.applyBuff(self, self, "me_doom", 10.0f); - } - - if (doomStage == 2) - { - utils.setScriptVar(self, "me_doom.doom_stage", 3); - buff.applyBuff(self, self, "me_doom", 10.0f); - } - - if (doomStage == 3) - { - utils.removeScriptVar(self, "me_doom.doom_owner"); - utils.removeScriptVar(self, "me_doom.doom_stage"); - } - - return SCRIPT_CONTINUE; - } - - - public int cacheExpertiseProcReacList(obj_id self, dictionary params) throws InterruptedException - { - expertise.cacheExpertiseProcReacList(self); - proc.buildCurrentReacList(self); - proc.buildCurrentProcList(self); - return SCRIPT_CONTINUE; - } - - - public void healAttribPercent(obj_id who, int stat, int percent) throws InterruptedException - { - int currentStatValue = getAttrib(who, stat); - int maxStatValue = getMaxAttrib(who, stat); - - if (currentStatValue < maxStatValue) - { - int newStatValue = currentStatValue + (int)(maxStatValue * (float)(percent / 100)); - - if (newStatValue > maxStatValue) - { - setAttrib(who, stat, maxStatValue); - } - else - { - setAttrib(who, stat, newStatValue); - } - } - } - - - public int channelForsakeFear(obj_id player, String buffName, boolean finishChannel) throws InterruptedException - { - - int lastForsakeFearPulse = utils.getIntScriptVar(player, "buff_handler.lastForsakeFearPulse"); - int currentForsakeFearPulses = utils.getIntScriptVar(player, "buff_handler.totalForsakeFearPulses"); - int gameTime = getGameTime(); - - int newTotal = gameTime - lastForsakeFearPulse + currentForsakeFearPulses; - - if (finishChannel || (newTotal > 10)) - { - newTotal = 10; - } - - if (newTotal > currentForsakeFearPulses) - { - - if (group.isGrouped(player)) - { - Vector party = group.getPCMembersInRange(player, 32f); - Vector channelToMembers = new Vector(); - if (party != null) - { - for (int i = 0; i < party.size(); i++) - { - testAbortScript(); - obj_id who = (obj_id)party.elementAt(i); - - if ((obj_id)buff.getBuffOwner(who, buffName) == player) - { - healAttribPercent(who, ACTION, 6 * (newTotal - currentForsakeFearPulses)); - playClientEffectObj(who, "appearance/pt_jedi_forsake_fear.prt", who, ""); - } - } - } - } - - healAttribPercent(player, ACTION, 6 * (newTotal - currentForsakeFearPulses)); - playClientEffectObj(player, "appearance/pt_jedi_forsake_fear.prt", player, ""); - } - - if (!finishChannel) - { - dictionary parms = new dictionary(); - - parms.put("player", player); - parms.put("buffName", buffName); - - utils.setScriptVar(player, "buff_handler.lastForsakeFearPulse", gameTime); - utils.setScriptVar(player, "buff_handler.totalForsakeFearPulses", newTotal); - - messageTo(player, "checkChannelForsakeFear", parms, 1, false); - } - - return SCRIPT_CONTINUE; - } - - - public int checkChannelForsakeFear(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - String buffName = params.getString("buffName"); - - if ((utils.hasScriptVar(player, "buff_handler.channelForsakeFearCancelled") || utils.hasScriptVar(player, "buff_handler.channelForsakeFearSuccessful") || !hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR))) - { - return SCRIPT_CONTINUE; - } - - channelForsakeFear(player, buffName, false); - - return SCRIPT_CONTINUE; - } - - - public int channelForsakeFearCountdownHandler(obj_id self, dictionary params) throws InterruptedException - { - int pid = params.getInt("id"); - obj_id player = params.getObjId("player"); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - - utils.setScriptVar(player, "buff_handler.channelForsakeFearCancelled", 1); - - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - return SCRIPT_CONTINUE; - } - - else if (bp == sui.BP_REVERT) - { - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - utils.setScriptVar(player, "buff_handler.channelForsakeFearCancelled", 1); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - utils.setScriptVar(player, "buff_handler.channelForsakeFearCancelled", 1); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR)) - { - return SCRIPT_CONTINUE; - } - - int test_pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - utils.setScriptVar(player, "buff_handler.channelForsakeFearSuccessful", 1); - - return SCRIPT_CONTINUE; - } - - - public int actionDrainAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - drainAttributes(self, (int)value, 0); - - if (!buff.hasBuff(self, "action_drain_immunity")) - { - buff.applyBuff(self, self, "action_drain_immunity"); - } - - return SCRIPT_CONTINUE; - } - - - public int actionDrainRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int actionBurnAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.setScriptVar(self, "buff.action_burn.value", value); - return SCRIPT_CONTINUE; - } - - - public int actionBurnRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVar(self, "buff.action_burn.value"); - return SCRIPT_CONTINUE; - } - - - public int actionRegenAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int actionMax = getMaxAction(self); - dictionary data = new dictionary(); - - data.put("actionMax", actionMax); - data.put("buffName", "sp_action_regen"); - data.put("ticks", duration); - data.put("currentTick", 0); - - messageTo(self, "actionRegenBuff", data, 1f, false); - return SCRIPT_CONTINUE; - } - - - public int actionRegenRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int actionRegenBuff(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - String buffName = params.getString("buffName"); - - if (!buff.hasBuff(self, buffName)) - { - return SCRIPT_CONTINUE; - } - - int maxAction = params.getInt("actionMax"); - - float ticks = params.getFloat("ticks"); - - float healAmount = maxAction / ticks; - - healing.healDamage(self, ACTION, (int)healAmount); - - int currentTick = params.getInt("currentTick"); - - if (currentTick < ticks) - { - params.put("currentTick", ++currentTick); - messageTo(self, "actionRegenBuff", params, 1f, false); - } - return SCRIPT_CONTINUE; - } - - - public int bodyguardDefenderAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (subtype.equals("shield_master_pet")) - { - obj_id master = getMaster(self); - if (!isIdValid(master)) - { - buff.removeBuff(self, "bm_shield_master_pet"); - return SCRIPT_CONTINUE; - } - - buff.applyBuff(master, self, "bm_shield_master_player"); - return SCRIPT_CONTINUE; - } - - if (subtype.equals("protect_master")) - { - obj_id master = getMaster(self); - - if (isIdValid(master) && exists(master)) - { - utils.setScriptVar(master, combat.DAMAGE_REDIRECT, self); - buff.applyBuff(master, self, "bodyguard"); - } - - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int bodyguardDefenderRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (subtype.equals("shield_master_pet")) - { - obj_id master = getMaster(self); - if (isIdValid(master) && exists(master)) - { - buff.removeBuff(master, "bm_shield_master_player"); - } - - return SCRIPT_CONTINUE; - } - - if (subtype.equals("protect_master")) - { - obj_id master = getMaster(self); - - if (!isIdValid(master)) - { - master = trial.getParent(self); - } - - if (isIdValid(master) && exists(master)) - { - buff.removeBuff(master, "bodyguard"); - utils.removeScriptVar(master, combat.DAMAGE_REDIRECT); - } - - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int cooldownModifyAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (subtype.equals("cooldown_execute_all")) - { - String[] commandList = getCommandListingForPlayer(self); - - if (commandList == null || commandList.length == 0) - { - debugSpeakMsg(self, "Command list was null or empty"); - return SCRIPT_CONTINUE; - } - - for (int i=0; i -1) - { - exclusive = true; - } - - if (subType.endsWith("acid")) - { - type = "acid"; - } - - if (subType.endsWith("cold")) - { - type = "cold"; - } - - if (subType.endsWith("electricity")) - { - type = "electrical"; - } - - utils.setScriptVar(self, "elemental_vulnerability.type_"+type, type); - utils.setScriptVar(self, "elemental_vulnerability.type_"+type+".value", value); - utils.setScriptVar(self, "elemental_vulnerability.type_"+type+".exclusive", exclusive); - - return SCRIPT_CONTINUE; - } - - public void clog(String message) throws InterruptedException - { - debugSpeakMsg(getSelf(), message); - } - - - public int vulnerabilityRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - String type = "heat"; - - if (subType.endsWith("acid")) - { - type = "acid"; - } - - if (subType.endsWith("cold")) - { - type = "cold"; - } - - if (subType.endsWith("electricity")) - { - type = "electrical"; - } - - utils.removeScriptVar(self, "elemental_vulnerability.type_"+type); - utils.removeScriptVar(self, "elemental_vulnerability.type_"+type+".value"); - utils.removeScriptVar(self, "elemental_vulnerability.type_"+type+".exclusive"); - - return SCRIPT_CONTINUE; - } - - - public int removeIncapWeakenAddBuffHandler(obj_id self, String effectName, String subType, float duartion, float value, String buffName, obj_id caster) throws InterruptedException - { - buff.removeBuff(self, "incapWeaken"); - - return SCRIPT_CONTINUE; - } - - - public int removeIncapWeakenRemoveBuffHandler(obj_id self, String effectName, String subType, float duartion, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int axkvaContagionAddBuffHandler(obj_id self, String effectName, String subType, float duartion, float value, String buffName, obj_id caster) throws InterruptedException - { - if (buff.hasBuff(self, "axkva_contagion_recourse")) - { - return SCRIPT_OVERRIDE; - } - - playClientEffectObj(self, "appearance/pt_contagion_debuff.prt", self, "", null, "contagion"); - - return SCRIPT_CONTINUE; - } - - - public int axkvaContagionRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - buff.applyBuff(self, self, "axkva_contagion_recourse"); - stopClientEffectObjByLabel(self, self, "contagion"); - - obj_id axkva = getFirstObjectWithScript(getLocation(self), 250.0f, "theme_park.heroic.axkva_min.axkva"); - - if (!isIdValid(axkva) || ai_lib.isDead(axkva)) - { - return SCRIPT_CONTINUE; - } - - dictionary dict = new dictionary(); - dict.put("player", self); - messageTo(axkva, "contagion_bomb", dict, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int bodyguardMasterAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int bodyguardMasterRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int onNextAttackAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.setScriptVar(self, "next_hit_damage_bonus", value); - obj_id master = utils.getObjIdScriptVar(self, "temp.master"); - if (isIdValid(master) && exists(master)) - { - buff.applyBuff(master, self, "bm_preperation"); - } - - return SCRIPT_CONTINUE; - } - - - public int onNextAttackRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVar(self, "bm_preperation"); - return SCRIPT_CONTINUE; - } - - - public int damageDealtModAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.setScriptVar(self, "damageDealtMod.value", value); - utils.setScriptVar(self, "damageDealtMod.scale", getScale(self)); - float enragedScale = (float)(getScale(self) * 1.3); - setScale(self, enragedScale); - return SCRIPT_CONTINUE; - } - - - public int damageDealtModRemoveBuffHandler(obj_id self, String effectName, String subType, float druation, float value, String buffName, obj_id caster) throws InterruptedException - { - float scale = utils.getFloatScriptVar(self, "damageDealtMod.scale"); - if (scale > 0) - { - setScale(self, scale); - } - - utils.removeScriptVarTree(self, "damageDealtMod"); - return SCRIPT_CONTINUE; - } - - - public int weaponSpeedModAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - obj_id weapon = getCurrentWeapon(self); - float currentAttackSpeed = getWeaponAttackSpeed(weapon); - utils.setScriptVar(self, "recordedAttackSpeed", ""+weapon+"-"+currentAttackSpeed); - float newAttackSpeed = currentAttackSpeed - (currentAttackSpeed * value); - - if (isIdValid(weapon)) - { - setWeaponAttackSpeed(weapon, newAttackSpeed); - weapons.setWeaponData(weapon); - utils.setScriptVar(weapon, "isCreatureWeapon", 1); - } - else - { - utils.removeScriptVar(self, "recordedAttackSpeed"); - } - - return SCRIPT_CONTINUE; - } - - - public int weaponSpeedModRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (!utils.hasScriptVar(self, "recordedAttackSpeed")) - { - return SCRIPT_CONTINUE; - } - - String weaponRecord = utils.getStringScriptVar(self, "recordedAttackSpeed"); - String[] parse = split(weaponRecord, '-'); - if (parse.length < 2) - { - return SCRIPT_CONTINUE; - } - - obj_id weapon = utils.stringToObjId(parse[0]); - float weaponSpeed = utils.stringToFloat(parse[1]); - - if (isIdValid(weapon)) - { - setWeaponAttackSpeed(weapon, weaponSpeed); - weapons.setWeaponData(weapon); - } - - return SCRIPT_CONTINUE; - } - - - public int commandGrantAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (subType == null || subType.equals("")) - { - return SCRIPT_CONTINUE; - } - - if (!hasCommand(self, subType)) - { - grantCommand(self, subType); - } - - return SCRIPT_CONTINUE; - } - - - public int commandGrantRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (subType == null || subType.equals("")) - { - return SCRIPT_CONTINUE; - } - - if (hasCommand(self, subType)) - { - revokeCommand(self, subType); - } - - return SCRIPT_CONTINUE; - } - - - public int OnGroupMembersChanged(obj_id self, obj_id gid, obj_id[] groupMembers, obj_id[] addedMembers, obj_id[] removedMembers) throws InterruptedException - { - int[] buffList = buff.getOwnedGroupBuffs(self); - - if (buffList == null) - { - return SCRIPT_CONTINUE; - } - - if (buffList.length < 1) - { - return SCRIPT_CONTINUE; - } - - dictionary data = new dictionary(); - data.put("owner", self); - data.put("buffList", buffList); - data.put("durList", buff.getGroupBuffDuration(self, buffList)); - data.put("strList", buff.getGroupBuffStrength(self, buffList)); - - if (addedMembers != null && addedMembers.length > 0) - { - data.put("isAdding", true); - - for (int i = 0; i < addedMembers.length; i++) - { - testAbortScript(); - if (addedMembers[i] == self) - { - - for (int j = 0; j < groupMembers.length; j++) - { - testAbortScript(); - if (groupMembers[j] == self) - { - continue; - } - - messageTo(groupMembers[j], "setGroupBuffs", data, 0f, false); - - addTriggerVolumeEventSource("group_buff_breach", groupMembers[j]); - } - continue; - } - - messageTo(addedMembers[i], "setGroupBuffs", data, 0f, false); - - addTriggerVolumeEventSource("group_buff_breach", addedMembers[i]); - } - } - - if (removedMembers != null && removedMembers.length > 0) - { - data.put("isAdding", false); - - for (int i = 0; i < removedMembers.length; i++) - { - testAbortScript(); - if (removedMembers[i] == self) - { - - for (int j = 0; j < groupMembers.length; j++) - { - testAbortScript(); - if (groupMembers[j] == self) - { - continue; - } - - messageTo(groupMembers[j], "setGroupBuffs", data, 0f, false); - - removeTriggerVolumeEventSource("group_buff_breach", groupMembers[j]); - } - continue; - } - - messageTo(removedMembers[i], "setGroupBuffs", data, 0f, false); - - removeTriggerVolumeEventSource("group_buff_breach", removedMembers[i]); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnGroupDisbanded(obj_id self, obj_id group) throws InterruptedException - { - int[] buffList = buff.getGroupBuffEffects(self); - if (buffList != null && buffList.length > 0) - { - buff.removeGroupBuffEffect(self, buffList); - } - - return SCRIPT_CONTINUE; - } - - public int OnRemovedFromGroup(obj_id self, obj_id group) throws InterruptedException - { - int[] buffList = buff.getGroupBuffEffects(self); - if (buffList != null && buffList.length > 0) - { - buff.removeGroupBuffEffect(self, buffList); - } - - return SCRIPT_CONTINUE; - } - - - public int setGroupBuffs(obj_id self, dictionary params) throws InterruptedException - { - obj_id owner = params.getObjId("owner"); - int[] buffList = params.getIntArray("buffList"); - float[] durList = params.getFloatArray("durList"); - float[] strList = params.getFloatArray("strList"); - boolean isAdding = params.getBoolean("isAdding"); - - if (isAdding) - { - - if (owner != self) - { - - float dist = getDistance(self, owner); - if (dist > buff.GROUP_BUFF_DISTANCE) - { - return SCRIPT_CONTINUE; - } - - if (!pvpCanHelp(owner, self)) - { - - prose_package pp = new prose_package(); - pp.stringId = new string_id("spam", "group_buff_fail_pvp"); - pp.target.set(self); - sendSystemMessageProse(owner, pp); - - return SCRIPT_CONTINUE; - } - - if (buffList != null && buffList.length > 0) - { - buff.addGroupBuffEffect(self, owner, buffList, strList, durList); - } - } - } - else - { - - if (owner != self) - { - if (buffList != null && buffList.length > 0) - { - buff.removeGroupBuffEffect(self, buffList); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int groupAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - int[] buffList = new int[1]; - buffList[0] = getStringCrc(effectName.toLowerCase()); - - if (isMob(self) && !isPlayer(self) && isIdValid(caster) && self == caster) - { - obj_id[] buffAi = getCreaturesInRange(getLocation(self), 45.0f); - - if (buffAi != null && buffAi.length > 0) - { - for (int i=0; i -1) - { - group2 = group2.substring(0, (group2.lastIndexOf("_"))); - - int[] group2Buffs = buff.getGroup2BuffsOnTarget(self, group2); - - int auraCount = 0; - - for (int i = 0; i < group2Buffs.length; ++i) - { - testAbortScript(); - float tempDuration = buff.getBuffTimeRemaining(self, group2Buffs[i]); - - if (tempDuration == -1) - { - ++auraCount; - } - } - - int aurasAbleToMaintain = getEnhancedSkillStatisticModifierUncapped(self, "expertise_aura_maintain"); - if ((aurasAbleToMaintain - auraCount) >= 1) - { - buff.applyBuff(self, owner, effectName, -1); - } - } - - boolean newTriggerVolume = !hasTriggerVolume(self, "group_buff_breach"); - - if (newTriggerVolume) - { - createTriggerVolume("group_buff_breach", buff.GROUP_BUFF_DISTANCE, false); - } - - obj_id gid = getGroupObject(self); - - if (!isIdValid(gid)) - { - return SCRIPT_CONTINUE; - } - - dictionary data = new dictionary(); - data.put("owner", self); - data.put("buffList", buffList); - data.put("durList", buff.getGroupBuffDuration(self, buffList)); - data.put("strList", buff.getGroupBuffStrength(self, buffList)); - data.put("isAdding", true); - - obj_id[] groupMembers = getGroupMemberIds(gid); - for (int i = 0; i < groupMembers.length; i++) - { - testAbortScript(); - if (groupMembers[i] == self) - { - continue; - } - - if (newTriggerVolume) - { - addTriggerVolumeEventSource("group_buff_breach", groupMembers[i]); - } - - messageTo(groupMembers[i], "setGroupBuffs", data, 0f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int groupRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int[] ownedBuffs = buff.getOwnedGroupBuffs(self); - boolean lastGroupBuff = (ownedBuffs == null || ownedBuffs.length == 0); - - obj_id gid = getGroupObject(self); - - if (!isIdValid(gid)) - { - removeTriggerVolume("group_buff_breach"); - return SCRIPT_CONTINUE; - } - - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - - int[] buffList = new int[1]; - buffList[0] = getStringCrc(effectName.toLowerCase()); - - String var = "groupBuff."+buffList[0]; - if (!utils.hasScriptVar(self, var)) - { - return SCRIPT_CONTINUE; - } - - obj_id owner = utils.getObjIdScriptVar(self, var); - utils.removeScriptVar(self, var); - if (owner != self) - { - return SCRIPT_CONTINUE; - } - - dictionary data = new dictionary(); - data.put("owner", self); - data.put("buffList", buffList); - data.put("isAdding", false); - - obj_id[] groupMembers = getGroupMemberIds(gid); - for (int i = 0; i < groupMembers.length; i++) - { - testAbortScript(); - if (groupMembers[i] == self) - { - continue; - } - - if (lastGroupBuff) - { - removeTriggerVolumeEventSource("group_buff_breach", groupMembers[i]); - } - - messageTo(groupMembers[i], "setGroupBuffs", data, 0f, false); - } - - if (lastGroupBuff) - { - removeTriggerVolume("group_buff_breach"); - } - - stopClientEffectObjByLabel(self, effectName); - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - - if (!volumeName.equals("group_buff_breach")) - { - return SCRIPT_CONTINUE; - } - - if (!group.inSameGroup(self, breacher)) - { - removeTriggerVolumeEventSource("group_buff_breach", breacher); - return SCRIPT_CONTINUE; - } - - if (!pvpCanHelp(self, breacher)) - { - return SCRIPT_CONTINUE; - } - - int[] buffList = buff.getOwnedGroupBuffs(self); - - float[] durList = buff.getGroupBuffDuration(self, buffList); - float[] strList = buff.getGroupBuffStrength(self, buffList); - buff.addGroupBuffEffect(breacher, self, buffList, strList, durList); - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - - if (!volumeName.equals("group_buff_breach")) - { - return SCRIPT_CONTINUE; - } - - int[] buffList = buff.getOwnedGroupBuffs(self); - - buff.removeGroupBuffEffect(breacher, buffList); - - return SCRIPT_CONTINUE; - } - - - public int OnLogout(obj_id self) throws InterruptedException - { - if (hasTriggerVolume(self, "group_buff_breach")) - { - obj_id groupId = getGroupObject(self); - - if (!isIdValid(groupId)) - { - return SCRIPT_CONTINUE; - } - - obj_id[] groupMembers = getGroupMemberIds(groupId); - - if (groupMembers == null || groupMembers.length <= 0) - { - return SCRIPT_CONTINUE; - } - - int[] buffList = buff.getOwnedGroupBuffs(self); - - for (int i = 0; i < groupMembers.length; ++i) - { - testAbortScript(); - buff.removeGroupBuffEffect(groupMembers[i], buffList); - } - } - - return SCRIPT_CONTINUE; - } - - - public void invisBuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - stealth.invisBuffRemoved(self, effectName); - } - - - public void invisBuffAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int costumeBuff = buff.getBuffOnTargetFromGroup(self, "shapechange"); - if (costumeBuff != 0) - { - buff.removeBuff(self, buffName); - sendSystemMessage(self, new string_id("spam", "costume_not_while_disguised")); - return; - } - - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - stealth.invisBuffAdded(self, effectName); - stopClientEffectObjByLabel(self, effectName); - } - - - public void noBreakInvisRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - String invis = stealth.getInvisBuff(self); - - if (invis == null || invis.equals("")) - { - stealth.invisBuffRemoved(self, ""); - } - } - - - public int messageDetrimentalRemoved(obj_id self, dictionary params) throws InterruptedException - { - obj_id me = params.getObjId("self"); - String detriment = params.getString("detriment"); - string_id msgId = params.getStringId("msgId"); - - messageDetrimentalRemoved(me, detriment, msgId); - return SCRIPT_CONTINUE; - } - - - public void messageDetrimentalRemoved(obj_id self, String detriment, string_id msgId) throws InterruptedException - { - prose_package ppRemoved = new prose_package(); - prose.setTT(ppRemoved, detriment); - prose.setStringId(ppRemoved, msgId); - - sendSystemMessageProse(self, ppRemoved); - } - - - public int OnChangedPosture(obj_id self, int before, int after) throws InterruptedException - { - if (buff.hasBuff(self, "bh_take_cover")) - { - buff.removeBuff(self, "bh_take_cover"); - sendSystemMessage(self, new string_id("spam", "lost_cover") ); - } - - return SCRIPT_CONTINUE; - } - - - public boolean removeAllModifiersOfType(obj_id target, int type) throws InterruptedException - { - String[] mods = movement.getAllModifiers(target); - - if (mods == null || mods.length == 0) - { - return false; - } - - boolean removed = false; - for (int i = 0; i < mods.length; i++) - { - testAbortScript(); - if (movement.getType(mods[i])==type) - { - if (utils.hasScriptVar(target, movement.MOVEMENT_OBJVAR + "." + mods[i] + ".time") && buff.canBeDispelled(mods[i])) - { - utils.removeScriptVarTree(target, movement.MOVEMENT_OBJVAR + "."+ mods[i]); - combat.removeCombatMovementModifierEffect(target, mods[i]); - removed = true; - } - } - } - - if (removed) - { - movement.refresh(target); - return removed; - } - else - { - return false; - } - } - - - public void channelHealAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int myAttribute = getAttributeType(subtype); - boolean worked = healing.useChannelHealItem(self, self, myAttribute); - int pid = sui.smartCountdownTimerSUI(self, self, "channel_heal", null, 0, 12, "", 0, 0); - utils.setScriptVar(self, "channelHeal.suiPid", pid); - } - - - public void channelHealRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int pid = utils.getIntScriptVar(self, "channelHeal.suiPid"); - forceCloseSUIPage(pid); - utils.removeScriptVarTree(self,"channelHeal"); - } - - - public int getAttributeType(String subtype) throws InterruptedException - { - int attribute = 0; - if (subtype.equals("health")) - { - attribute = HEALTH; - } - else if (subtype.equals("constitution")) - { - attribute = CONSTITUTION; - } - else if (subtype.equals("action")) - { - attribute = ACTION; - } - else if (subtype.equals("stamina")) - { - attribute = STAMINA; - } - else if (subtype.equals("mind")) - { - attribute = MIND; - } - else if (subtype.equals("willpower")) - { - attribute = WILLPOWER; - } - - return attribute; - } - - - public void bmBeastFamilyAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - if (!isPlayer(self)) - { - obj_id master = getMaster(self); - - if (!isPlayer(master)) - { - return; - } - - if (!buff.hasBuff(master, buffName)) - { - buff.applyBuff(master, self, buffName); - } - - return; - } - - obj_id player = self; - - obj_id beast = beast_lib.getBeastOnPlayer(player); - - if (!isIdValid(beast) || !exists(beast)) - { - buff.removeBuff(player, buffName); - return; - } - - obj_id bcd = beast_lib.getBeastBCD(beast); - String beastName = beast_lib.getBeastType(bcd); - dictionary beastDict = utils.dataTableGetRow(beast_lib.BEASTS_TABLE, beastName); - String specialAttackFamily = beastDict.getString("special_attack_family"); - - if (!specialAttackFamily.equals(subtype) && !subtype.equals("all")) - { - - buff.removeBuff(player, buffName); - return; - } - - buff.applyBuff(beast, self, buffName); - buff.applyBuff(player, self, buffName); - return; - } - - - public void bmBeastFamilyRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - if (!isPlayer(self)) - { - buff.removeBuff(self, buffName); - - obj_id master = getMaster(self); - - if (!isPlayer(master)) - { - return; - } - - if (buff.hasBuff(master, buffName)) - { - buff.removeBuff(master, buffName); - } - - return; - } - - obj_id player = self; - - obj_id beast = beast_lib.getBeastOnPlayer(player); - - if (!isIdValid(beast) || !exists(beast)) - { - - buff.removeBuff(player, buffName); - return; - } - - buff.removeBuff(player, buffName); - - buff.removeBuff(beast, buffName); - return; - } - - - public String getInitialBuffName(String effectName) throws InterruptedException - { - - String[] spiltEffectName = split(effectName, '_'); - int loopTimes = spiltEffectName.length - 1; - String initialBuffName = spiltEffectName[0]; - for (int i = 1; i < loopTimes; ++i) - { - testAbortScript(); - initialBuffName += "_"+ spiltEffectName[i]; - } - - return initialBuffName; - } - - - public void bmBeastXpBuffAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return; - } - - - public void bmBeastXpBuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - utils.removeScriptVarTree(self, "beastBuff"); - return; - } - - - public int combatStunAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - obj_id crystal = create.object("object/building/heroic/axkva_empty_crystal.iff", getLocation(self)); - setObjVar(crystal, "player", self); - obj_id axkva = utils.getObjIdScriptVar(self, "axkva_min"); - trial.setParent(axkva, crystal, false); - setLocation(self, getLocation(crystal)); - attachScript(crystal, "theme_park.heroic.axkva_min.crystal_prison"); - - return SCRIPT_CONTINUE; - } - - - public int combatStunRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVar(self, "axkva_crystal"); - - return SCRIPT_CONTINUE; - } - - - public int krixResonanceAddBuffHandler(obj_id self, String effectName, String subType, float duartion, float value, String buffName, obj_id caster) throws InterruptedException - { - - playClientEffectObj(self, "appearance/pt_contagion_debuff.prt", self, "", null, "resonance"); - - return SCRIPT_CONTINUE; - } - - - public int krixResonanceRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - stopClientEffectObjByLabel(self, "resonance"); - - obj_id krix = getFirstObjectWithScript(getLocation(self), 250.0f, "theme_park.heroic.star_destroyer.krix"); - - if (!isIdValid(krix) || ai_lib.isDead(krix)) - { - return SCRIPT_CONTINUE; - } - - dictionary dict = new dictionary(); - dict.put("player", self); - messageTo(krix, "contagion_bomb", dict, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int delayedAddBuff(obj_id self, dictionary params) throws InterruptedException - { - String buffName = params.getString("buffName"); - if (buffName == null || buffName.equals("")) - { - return SCRIPT_CONTINUE; - } - - buff.applyBuff(self, self, buffName); - return SCRIPT_CONTINUE; - } - - - public int lureshContagionAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int lureshContagionRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - obj_id[] monkey = trial.getObjectsInDungeonWithObjVar(trial.getTop(self), "skreeg_id"); - - if (monkey == null || monkey.length == 0) - { - return SCRIPT_CONTINUE; - } - - obj_id luresh = monkey[0]; - - if (!isIdValid(luresh) || !exists(luresh) || isDead(luresh)) - { - return SCRIPT_CONTINUE; - } - - obj_id[] players = trial.getValidTargetsInCell(trial.getTop(self), "r3"); - - if (players == null || players.length == 0) - { - return SCRIPT_CONTINUE; - } - - obj_id topAction = null; - int currentAction = 0; - - for (int i=0; i currentAction) - { - topAction = players[i]; - } - } - - if (!isIdValid(topAction)) - { - topAction = self; - } - - queueCommand(luresh, (-1048892018), topAction, "", COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int razorBurstHandlerAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int buffCrc = buff.getBuffOnTargetFromGroup(self, "rb_vulnerability"); - - if (buffCrc == 0) - { - buff.applyBuff(self, self, "razor_burst_vulnerability_1"); - return SCRIPT_CONTINUE; - } - - String myBuffName = buff.getBuffNameFromCrc(buffCrc); - - String[] parse = split(myBuffName, '_'); - - int level = utils.stringToInt(parse[parse.length -1]); - - level = level > 9 ? 10 : level + 1; - - buff.applyBuff(self, self, "razor_burst_vulnerability_"+level); - return SCRIPT_CONTINUE; - } - - - public int razorBurstHandlerRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int caretakerHandlerAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int buffCrc = buff.getBuffOnTargetFromGroup(self, "ct_debuff"); - - if (buffCrc == 0) - { - buff.applyBuff(self, self, "caretaker_debuff_1"); - return SCRIPT_CONTINUE; - } - - String myBuffName = buff.getBuffNameFromCrc(buffCrc); - - String[] parse = split(myBuffName, '_'); - int level = utils.stringToInt(parse[parse.length -1]); - - level = level > 9 ? 10 : level + 1; - - buff.applyBuff(self, self, "caretaker_debuff_"+level); - return SCRIPT_CONTINUE; - } - - - public int caretakerHandlerRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int closedFistBurnHandlerAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - playClientEffectObj(self, "appearance/pt_state_onfire.prt", self, "", null, "closed_fist_burn"); - messageTo(self, "handle_closed_fist_burn", null, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int handle_closed_fist_burn(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "closed_fist_burn")) - { - return SCRIPT_CONTINUE; - } - - obj_id closed_fist = getFirstObjectWithScript(getLocation(self), 250.0f, "theme_park.heroic.exar_kun.closed_fist"); - - if (!isIdValid(closed_fist) || !exists(closed_fist) || isDead(closed_fist)) - { - buff.removeBuff(self, "closed_fist_burn"); - return SCRIPT_CONTINUE; - } - - location tarLoc = getLocation(self); - String targetData = ""+tarLoc.x+" "+tarLoc.y+" "+tarLoc.z+ " "+tarLoc.cell+ " "+tarLoc.x+ " "+tarLoc.y+ " "+tarLoc.z; - queueCommand(closed_fist, (1856722390), self, targetData, COMMAND_PRIORITY_DEFAULT); - messageTo(self, "handle_closed_fist_burn", null, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int closedFistBurnHandlerRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - stopClientEffectObjByLabel(self, "closed_fist_burn"); - return SCRIPT_CONTINUE; - } - - - public int closedFistBurnDebuffAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int buffCrc = buff.getBuffOnTargetFromGroup(self, "cf_burn_debuff"); - - if (buffCrc == 0) - { - buff.applyBuff(self, self, "closed_fist_burn_debuff_1"); - return SCRIPT_CONTINUE; - } - - String myBuffName = buff.getBuffNameFromCrc(buffCrc); - - String[] parse = split(myBuffName, '_'); - int level = utils.stringToInt(parse[parse.length -1]); - - level = level > 2 ? 3 : level + 1; - - buff.applyBuff(self, self, "closed_fist_burn_debuff_"+level); - return SCRIPT_CONTINUE; - } - - - public int closedFistBurnDebuffRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int kunChaosHandlerAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int orderDebuffCrc = buff.getBuffOnTargetFromGroup(self, "kun_order_debuff"); - int chaosDebuffCrc = buff.getBuffOnTargetFromGroup(self, "kun_chaos_debuff"); - - if (orderDebuffCrc == 0) - { - if (chaosDebuffCrc == 0) - { - buff.applyBuff(self, self, "kun_chaos_debuff_1"); - return SCRIPT_CONTINUE; - } - - String chaosBuffName = buff.getBuffNameFromCrc(chaosDebuffCrc); - - String[] parse = split(chaosBuffName, '_'); - int level = utils.stringToInt(parse[parse.length -1]); - - level = level > 9 ? 10 : level + 1; - - buff.applyBuff(self, self, "kun_chaos_debuff_"+level); - return SCRIPT_CONTINUE; - } - else - { - String orderBuffName = buff.getBuffNameFromCrc(orderDebuffCrc); - - String[] parse = split(orderBuffName, '_'); - int level = utils.stringToInt(parse[parse.length -1]); - - if (level == 1) - { - buff.removeBuff(self, "kun_order_debuff_1"); - buff.applyBuff(self, self, "kun_chaos_debuff_1"); - return SCRIPT_CONTINUE; - } - - level = level - 1; - - buff.applyBuff(self, self, "kun_order_debuff_"+level); - } - - return SCRIPT_CONTINUE; - } - - - public int kunChaosHandlerRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int kunOrderHandlerAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int orderDebuffCrc = buff.getBuffOnTargetFromGroup(self, "kun_order_debuff"); - int chaosDebuffCrc = buff.getBuffOnTargetFromGroup(self, "kun_chaos_debuff"); - - if (chaosDebuffCrc == 0) - { - if (orderDebuffCrc == 0) - { - buff.applyBuff(self, self, "kun_order_debuff_1"); - return SCRIPT_CONTINUE; - } - - String orderBuffName = buff.getBuffNameFromCrc(orderDebuffCrc); - - String[] parse = split(orderBuffName, '_'); - int level = utils.stringToInt(parse[parse.length -1]); - - level = level > 9 ? 10 : level + 1; - - buff.applyBuff(self, self, "kun_order_debuff_"+level); - return SCRIPT_CONTINUE; - } - else - { - String chaosBuffName = buff.getBuffNameFromCrc(chaosDebuffCrc); - - String[] parse = split(chaosBuffName, '_'); - int level = utils.stringToInt(parse[parse.length -1]); - - if (level == 1) - { - buff.removeBuff(self, "kun_chaos_debuff_1"); - buff.applyBuff(self, self, "kun_order_debuff_1"); - return SCRIPT_CONTINUE; - } - - level = level - 1; - - buff.applyBuff(self, self, "kun_chaos_debuff_"+level); - } - - return SCRIPT_CONTINUE; - } - - - public int kunOrderHandlerRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int setSpecialTypeAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - String special_type_name = subType.substring(15, subType.length()); - setObjVar(self, "specialNicheType", special_type_name); - return SCRIPT_CONTINUE; - } - - - public int setSpecialTypeRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasObjVar(self, "specialNicheType")) - { - removeObjVar(self, "specialNicheType"); - } - - return SCRIPT_CONTINUE; - } - - - public int kunOpenSparkAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - playClientEffectObj(self, "appearance/pt_electric_flare_green.prt", self, "head", null, "kun_spark"); - trial.bumpSession(self, "spark_handler"); - messageTo(self, "openSparkHandler", trial.getSessionDict(self, "spark_handler"), 0.0f, false); - return SCRIPT_CONTINUE; - } - - - public int openSparkHandler(obj_id self, dictionary params) throws InterruptedException - { - if (!trial.verifySession(self, params, "spark_handler")) - { - return SCRIPT_CONTINUE; - } - - obj_id openHand = getFirstObjectWithScript(getLocation(self), 100.0f, "theme_park.heroic.exar_kun.open_hand"); - - if (!isIdValid(openHand) || !exists(openHand) || isDead(openHand)) - { - buff.removeBuff(self, "kun_open_spark"); - return SCRIPT_CONTINUE; - } - - location selfLoc = getLocation(self); - location tesla = (location)selfLoc.clone(); - tesla.x = -11.7f; - tesla.y = 11.0f; - tesla.z = -64.6f; - - float travelDistance = getDistance(selfLoc, tesla); - - float speed = travelDistance / 2.0f; - - createClientProjectile(self, "object/weapon/ranged/pistol/shared_pistol_green_bolt.iff", tesla, selfLoc, speed, 2.0f, false, 255, 0, 0, 255); - - String targetData = ""+selfLoc.x+" "+selfLoc.y+" "+selfLoc.z+" "+selfLoc.cell+" "+selfLoc.x+" "+selfLoc.y+" "+selfLoc.z; - queueCommand(openHand, (744605409), self, targetData, COMMAND_PRIORITY_DEFAULT); - messageTo(self, "openSparkHandler", trial.getSessionDict(self, "spark_handler"), 4.0f, false); - return SCRIPT_CONTINUE; - - } - - - public int kunOpenSparkRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - stopClientEffectObjByLabel(self, "kun_spark"); - return SCRIPT_CONTINUE; - } - - - public int callPickupCraftAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int callPickupCraftRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - obj_id pickupCraft = utils.getObjIdScriptVar(self,"instantTravelShip.pickupCraft"); - if (isIdValid(pickupCraft)) - { - messageTo(pickupCraft, "cleanupShip", null, 0, false); - } - - utils.removeScriptVarTree(self,"instantTravelShip"); - - return SCRIPT_CONTINUE; - } - - - public int fs_choke_handlerAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int buffCrc = getStringCrc(subtype.toLowerCase()); - obj_id owner = utils.getObjIdScriptVar(self, "buffOwner."+buffCrc); - - int imp_choke = getEnhancedSkillStatisticModifierUncapped(owner, "expertise_fs_imp_choke"); - imp_choke = imp_choke > 2 ? 2 : imp_choke; - - if (imp_choke > 0) - { - buff.applyBuff(self, self, "fs_imp_choke_"+imp_choke); - } - - return SCRIPT_CONTINUE; - } - - - public int fs_choke_handlerRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int jediStatueLightDebuffAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - String buffToApply = "jedi_statue_light_debuff_light"; - if (buff.isInFocus(self)) - { - buffToApply = "jedi_statue_light_debuff_dark"; - } - - buff.applyBuff(self, self, buffToApply); - return SCRIPT_CONTINUE; - } - - - public int jediStatueLightDebuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int jediStatueDarkDebuffAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - String buffToApply = "jedi_statue_dark_debuff_light"; - if (buff.isInFocus(self)) - { - buffToApply = "jedi_statue_dark_debuff_dark"; - } - - buff.applyBuff(self, self, buffToApply); - return SCRIPT_CONTINUE; - } - - - public int jediStatueDarkDebuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int fs_flurry_procAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - buff.applyBuff(self, self, "attack_override_fs_dm_1|fs_flurry_1"); - buff.applyBuff(self, self, "attack_override_fs_dm_2|fs_flurry_2"); - buff.applyBuff(self, self, "attack_override_fs_dm_3|fs_flurry_3"); - buff.applyBuff(self, self, "attack_override_fs_dm_4|fs_flurry_4"); - buff.applyBuff(self, self, "attack_override_fs_dm_5|fs_flurry_5"); - buff.applyBuff(self, self, "attack_override_fs_dm_6|fs_flurry_6"); - buff.applyBuff(self, self, "attack_override_fs_dm_7|fs_flurry_7"); - return SCRIPT_CONTINUE; - } - - - public int fs_flurry_procRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - String[] buffList = - { - "attack_override_fs_dm_1|fs_flurry_1", - "attack_override_fs_dm_2|fs_flurry_2", - "attack_override_fs_dm_3|fs_flurry_3", - "attack_override_fs_dm_4|fs_flurry_4", - "attack_override_fs_dm_5|fs_flurry_5", - "attack_override_fs_dm_6|fs_flurry_6", - "attack_override_fs_dm_7|fs_flurry_7" - }; - - buff.removeBuffs(self, buffList); - - return SCRIPT_CONTINUE; - } - - - public int forceThrowAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int buffCrc = getStringCrc(subtype.toLowerCase()); - obj_id owner = utils.getObjIdScriptVar(self, "buffOwner."+buffCrc); - - if (!buff.isInStance(owner)) - { - return SCRIPT_CONTINUE; - } - - int stanceSaberShackle = (int)getSkillStatisticModifier(owner, "expertise_buff_chance_line_fs_force_throw"); - stanceSaberShackle = stanceSaberShackle > 100 ? 100 : stanceSaberShackle; - - if (stanceSaberShackle <= 0) - { - return SCRIPT_CONTINUE; - } - - int rootChance = (stanceSaberShackle / 25) * 4; - - if (rand(0, 99) < rootChance) - { - buff.applyBuff(self, owner,"fs_force_throw_root"); - buff.applyBuff(self, owner, getStringCrc("fs_force_throw_"+ (stanceSaberShackle / 25)), duration); - return SCRIPT_CONTINUE; - } - - if (rand(0, 99) < stanceSaberShackle) - { - buff.applyBuff(self, owner, getStringCrc("fs_force_throw_"+ (stanceSaberShackle / 25)), duration); - } - - return SCRIPT_CONTINUE; - } - - - public int forceThrowRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int aggroChannelAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (!exists(caster) || !isIdValid(caster)) - { - - buff.removeBuff(self, buffName); - return SCRIPT_CONTINUE; - } - prose_package pp = new prose_package(); - String casterName = ""; - if (isPlayer(caster)) - { - casterName = getFirstName(caster); - } - else - { - casterName = "@"+ getName(caster); - } - - prose.setTT(pp, casterName); - - if (subtype.equals("target")) - { - - buff.applyBuff(caster, self, "aggroChannelself"); - prose.setStringId(pp, new string_id("squad_leader", "aggro_channel_applied_target")); - sendSystemMessageProse(self, pp); - - } - if (subtype.equals("self")) - { - prose.setStringId(pp, new string_id("squad_leader", "aggro_channel_applied_self")); - sendSystemMessageProse(self, pp); - utils.setScriptVar(self, buff.AGGRO_TRANSFER_TO, caster); - } - - return SCRIPT_CONTINUE; - } - - - public int aggroChannelRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - if (!exists(caster) || !isIdValid(caster)) - { - return SCRIPT_CONTINUE; - } - - if (subtype.equals("target")) - { - - buff.removeBuff(caster, "aggroChannelself"); - } - if (subtype.equals("self")) - { - obj_id buffed = utils.getObjIdScriptVar(self, buff.AGGRO_TRANSFER_TO); - buff.removeBuff(buffed, "aggroChannelTarget"); - utils.removeScriptVar(self, buff.AGGRO_TRANSFER_TO); - - } - return SCRIPT_CONTINUE; - } - - - public int dotAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - long stack = buff.getBuffStackCount(self, buffName) > 1 ? buff.getBuffStackCount(self, buffName) : 1; - - dot.applyBuffDotEffect(self, caster, subtype, buffName + "_"+ subtype, stack, HEALTH, 100, (int)value, (int)duration, true, buffName); - - return SCRIPT_CONTINUE; - } - - - public int dotRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - dot.removeBuffDotEffect(self, subtype, true); - - return SCRIPT_CONTINUE; - } - - - public int expertiseDamageDecreaseAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int damageDecrease = (int)getSkillStatisticModifier(self, "expertise_damage_decrease_percentage"); - if (damageDecrease > 0) - { - skillAddBuffHandler(self, effectName, "damage_decrease_percentage", duration, damageDecrease, "", null); - } - - return SCRIPT_CONTINUE; - } - - - public int expertiseDamageDecreaseRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (effectName.lastIndexOf("_") > 0) - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - } - - stopClientEffectObjByLabel(self, effectName); - - int damageDecrease = (int)getSkillStatisticModifier(self, "expertise_damage_decrease_percentage"); - - if (damageDecrease > 0) - { - skillRemoveBuffHandler(self, effectName, "damage_decrease_percentage", duration, damageDecrease, "", null); - } - - return SCRIPT_CONTINUE; - } - - - public int onAttackRemoveAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - Vector removeBuffs = new Vector(); - removeBuffs.setSize(0); - - if (utils.hasScriptVar(self, buff.ON_ATTACK_REMOVE)) - { - removeBuffs = utils.getResizeableStringArrayScriptVar(self, buff.ON_ATTACK_REMOVE); - } - - if (removeBuffs != null && removeBuffs.size() > 0) - { - removeBuffs.add(buffName); - } - else if (removeBuffs.indexOf(buffName) < 0) - { - removeBuffs.add(buffName); - } - - utils.setScriptVar(self, buff.ON_ATTACK_REMOVE, removeBuffs); - - return SCRIPT_CONTINUE; - } - - - public int onAttackRemoveRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - Vector removeBuffs = new Vector(); - removeBuffs.setSize(0); - - if (utils.hasScriptVar(self, buff.ON_ATTACK_REMOVE)) - { - removeBuffs = utils.getResizeableStringArrayScriptVar(self, buff.ON_ATTACK_REMOVE); - } - else - { - return SCRIPT_CONTINUE; - } - - utils.removeScriptVar(self, buff.ON_ATTACK_REMOVE); - - if (removeBuffs.indexOf(buffName) > -1) - { - removeBuffs.remove(buffName); - } - - if (removeBuffs != null || removeBuffs.size() > 0) - { - utils.setScriptVar(self, buff.ON_ATTACK_REMOVE, removeBuffs); - } - - return SCRIPT_CONTINUE; - } - - - public int supression_handlerAddBuffHandler(obj_id self, String effectName, String subytype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - float improvedSpeed = (float)getEnhancedSkillStatisticModifierUncapped(caster, "expertise_supression_speed"); - int level = Math.round(improvedSpeed / 10.0f); - buff.applyBuff(self, caster, "co_supressing_fire_"+level); - return SCRIPT_CONTINUE; - } - - - public int supression_handlerRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int movementSupressingEffectAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - float snareResist = 0.0f; - if (isMob(self) && !isPlayer(self)) - { - snareResist = (float)getEnhancedSkillStatisticModifierUncapped(self, "movement_resist_snare"); - } - - snareResist = 1.0f - (snareResist / 100.0f); - snareResist = snareResist < 0.0f ? 0.0f : snareResist; - snareResist = snareResist > 1.0f ? 1.0f : snareResist; - - value *= snareResist; - - value = value > 89.0f ? 89.0f : value; - addSlowDownEffect(caster, self, 96.0f, 0.01f, value, duration); - return SCRIPT_CONTINUE; - } - - - public int movementSupressingEffectRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int damageImmuneAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - buff.performBuffDotImmunity(self, "all"); - addSkillModModifier(self, "damageImmuneDotResistAll", "dot_resist_all", 100, duration, false, true); - addSkillModModifier(self, "damageImmuneDamageImmune", "damage_immune", 1, duration, false, true); - - if (sui.hasEventFlag(self, sui.CD_EVENT_DAMAGE_IMMUNE)) - { - sui.cancelCountdownTimer(self, sui.CD_EVENT_DAMAGE_IMMUNE); - } - - return SCRIPT_CONTINUE; - } - - - public int damageImmuneRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - removeAttribOrSkillModModifier(self, "damageImmuneDotResistAll"); - removeAttribOrSkillModModifier(self, "damageImmuneDamageImmune"); - return SCRIPT_CONTINUE; - } - - - public int bhFlawlessAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - buff.applyBuff(self, "bh_flawless_proc_chance_1"); - return SCRIPT_CONTINUE; - } - - - public int bhFlawlessRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - buff.removeBuff(self, "bh_flawless_proc_chance_1"); - return SCRIPT_CONTINUE; - } - - - public int mtpMeatlumpAngryAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - ai_lib.setMood(self, chat.MOOD_ANGRY); - chat.setChatMood(self, chat.MOOD_ANGRY); - - attachScript(self, "theme_park.meatlump.hideout.angry_meatlump"); - return SCRIPT_CONTINUE; - } - - - public int mtpMeatlumpAngryRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int mtpMeatlumpHappyAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - ai_lib.setMood(self, chat.MOOD_HAPPY); - chat.setChatMood(self, chat.MOOD_HAPPY); - - removeObjVar(self, "angryMeatlump"); - detachScript(self, "theme_park.meatlump.hideout.angry_meatlump"); - return SCRIPT_CONTINUE; - } - - - public int mtpMeatlumpHappyRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int eventParticleAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - String particleName = buff.getParticle(buffName); - - dictionary params = new dictionary(); - params.put("effectName", effectName); - params.put("particleName", particleName); - params.put("buffName", buffName); - messageTo(self, "eventParticleReload", params, 15.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int eventParticleReload(obj_id self, dictionary params) throws InterruptedException - { - String particleName = params.getString("particleName"); - String buffName = params.getString("buffName"); - String effectName = params.getString("effectName"); - - stopClientEffectObjByLabel(self, effectName); - - if (buff.hasBuff(self, buffName)) - { - playClientEffectObj(self, particleName, self, ""); - messageTo(self, "eventParticleReload", params, 15.0f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int eventParticleRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (effectName.lastIndexOf("_") > 0) - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - } - - stopClientEffectObjByLabel(self, effectName); - - return SCRIPT_CONTINUE; - } - - - public int costumeAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int row = dataTableSearchColumnForInt((int)value, "INDEX", DATATABLE_COSTUME); - if (row < 0) - { - return SCRIPT_CONTINUE; - } - - String costume = dataTableGetString(DATATABLE_COSTUME, row, "APPEARANCE"); - if (getGender(self) == GENDER_FEMALE) - { - String female_costume = dataTableGetString(DATATABLE_COSTUME, row, "FEMALE_APPEARANCE"); - if (female_costume != null && female_costume.length() > 0 && !female_costume.equals("none")) - { - costume = female_costume; - } - } - - if (costume == null || costume.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - obj_id unequipedWeapon = utils.unequipWeaponHand(self); - if (isIdValid(unequipedWeapon)) - { - setObjVar(self, "costume.unequipedWeapon", unequipedWeapon); - } - - setObjectAppearance(self, costume); - - attachScript(self, "event.halloween.trick_or_treater"); - - return SCRIPT_CONTINUE; - } - - - public int costumeRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - revertObjectAppearance(self); - detachScript(self, "event.halloween.trick_or_treater"); - - if (hasObjVar(self, "costume.unequipedWeapon")) - { - obj_id unequipedWeapon = getObjIdObjVar(self, "costume.unequipedWeapon"); - if (isIdValid(unequipedWeapon)) - { - if (exists(unequipedWeapon) && utils.isNestedWithin(unequipedWeapon, self)) - { - obj_id alreadyEquipped = getObjectInSlot(self, "hold_r"); - if (!isIdValid(alreadyEquipped)) - { - equip(unequipedWeapon, self); - } - } - } - - removeObjVar(self, "costume.unequipedWeapon"); - } - - return SCRIPT_CONTINUE; - } - - - public int costumeBurningEffectAddBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - playClientEffectObj(self, "appearance/pt_state_onfire.prt", self, "", null, "costume_burning_effect"); - - messageTo(self, "handleCostumeBurningBuffEffect", null, 15, false); - return SCRIPT_CONTINUE; - } - - - public int costumeBurningEffectRemoveBuffHandler(obj_id self, String effectName, String subType, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - stopClientEffectObjByLabel(self, "costume_burning_effect"); - return SCRIPT_CONTINUE; - } - - - public int handleCostumeBurningBuffEffect(obj_id self, dictionary params) throws InterruptedException - { - int[] costumeBurningBuffs = buff.getAllBuffsByEffect(self, "costume_burning_effect"); - if (costumeBurningBuffs != null && costumeBurningBuffs.length > 0) - { - stopClientEffectObjByLabel(self, "costume_burning_effect"); - playClientEffectObj(self, "appearance/pt_state_onfire.prt", self, "", null, "costume_burning_effect"); - - messageTo(self, "handleCostumeBurningBuffEffect", null, 15, false); - } - return SCRIPT_CONTINUE; - } - - - public int OnNewbieTutorialResponse(obj_id self, String action) throws InterruptedException - { - if (action.equals("clientReady")) - { - int[] costumeBurningBuffs = buff.getAllBuffsByEffect(self, "costume_burning_effect"); - if (costumeBurningBuffs != null && costumeBurningBuffs.length > 0) - { - stopClientEffectObjByLabel(self, "costume_burning_effect"); - playClientEffectObj(self, "appearance/pt_state_onfire.prt", self, "", null, "costume_burning_effect"); - - messageTo(self, "handleCostumeBurningBuffEffect", null, 15, false); - } - } - return SCRIPT_CONTINUE; - } - - - public int halloweenCooldownAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - float yaw = getYaw(self); - utils.setScriptVar(self, "yaw", yaw); - suspendMovement(self); - - return SCRIPT_CONTINUE; - } - - - public int halloweenCooldownRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - float yaw = utils.getFloatScriptVar(self, "yaw"); - setYaw(self, yaw); - utils.removeScriptVar(self, "yaw"); - resumeMovement(self); - - return SCRIPT_CONTINUE; - } - - - public int halloweenCoinLimitAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int now = getCalendarTime(); - int secondsUntil = secondsUntilNextDailyTime(10, 0, 0); - int then = now + secondsUntil; - - if (hasObjVar(self, event_perk.COUNTER_TIMESTAMP)) - { - then = getIntObjVar(self, event_perk.COUNTER_TIMESTAMP); - if (now > then) - { - removeObjVar(self, event_perk.COUNTER_TIMESTAMP); - buff.removeBuff(self, "event_halloween_coin_limit"); - return SCRIPT_CONTINUE; - } - } - - if (!hasObjVar(self, event_perk.COUNTER_TIMESTAMP)) - { - setObjVar(self, event_perk.COUNTER_TIMESTAMP, then); - } - - return SCRIPT_CONTINUE; - } - - - public int halloweenCoinLimitRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (hasObjVar(self, event_perk.COUNTER_TIMESTAMP)) - { - int now = getCalendarTime(); - int then = getIntObjVar(self, event_perk.COUNTER_TIMESTAMP); - if (now >= then) - { - removeObjVar(self, event_perk.COUNTER_TIMESTAMP); - } - } - - return SCRIPT_CONTINUE; - } - - - public int lifedayCompetitiveBuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - String lifedayRunning = getConfigSetting("GameServer", "lifeday"); - - if (lifedayRunning != null && !lifedayRunning.equals("false")) - { - - obj_id tatooine = getPlanetByName("tatooine"); - - setObjVar(self, "lifeday.locked_out", 1); - string_id times_up = new string_id("event/life_day", "time_is_up"); - sendSystemMessage(self, times_up); - - if (!isIdValid(tatooine) || !exists(tatooine)) - { - return SCRIPT_CONTINUE; - } - - dictionary params = new dictionary(); - params.put ("player", self); - messageTo(tatooine, "lifeDayScoreBoardUpdate", params, 0.0f, false); - } - return SCRIPT_CONTINUE; - } - - - public int scoreBoardCheck(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "lifeday.token_counter")) - { - int playerScore = getIntObjVar(self, "lifeday.token_counter"); - String playerName = getName(self); - String scoreBoardEmpty = params.getString("scoreBoardEmpty"); - - String playerFaction = "null"; - - if (hasObjVar(self, "lifeday.neutral_imperial")) - { - playerFaction = "Imperial Mercenary"; - } - if (hasObjVar(self, "lifeday.neutral_rebel")) - { - playerFaction = "Rebel Mercenary"; - } - if (factions.isImperial(self)) - { - playerFaction = "Imperial Soldier"; - } - if (factions.isRebel(self)) - { - playerFaction = "Rebel Soldier"; - } - - if (scoreBoardEmpty.equals ("true")) - { - updateScore (self, playerName, playerScore, playerFaction, "One", "true"); - } - - else - { - int thirdPlaceScore = params.getInt("thirdPlaceScore"); - int secondPlaceScore = params.getInt("secondPlaceScore"); - int firstPlaceScore = params.getInt("firstPlaceScore"); - - if (playerScore < thirdPlaceScore) - { - return SCRIPT_CONTINUE; - } - - else if (playerScore >= firstPlaceScore) - { - updateScore (self, playerName, playerScore, playerFaction, "One", "false"); - } - - else if (playerScore >= secondPlaceScore) - { - updateScore (self, playerName, playerScore, playerFaction, "Two", "false"); - } - - else - { - updateScore (self, playerName, playerScore, playerFaction, "Three", "false"); - } - } - } - return SCRIPT_CONTINUE; - } - - - public void updateScore(obj_id self, String playerName, int playerScore, String playerFaction, String position, String scoreBoardEmpty) throws InterruptedException - { - - obj_id tatooine = getPlanetByName("tatooine"); - - int oneScore = 0; - String oneName = ""; - String oneFaction = ""; - obj_id oneId = null; - - int twoScore = 0; - String twoName = ""; - String twoFaction = ""; - obj_id twoId = null; - - if (hasObjVar(tatooine, "lifeday.positionOne.playerScore")) - { - oneScore = getIntObjVar (tatooine, "lifeday.positionOne.playerScore"); - oneName = getStringObjVar (tatooine, "lifeday.positionOne.playerName"); - oneFaction = getStringObjVar (tatooine, "lifeday.positionOne.playerFaction"); - oneId = getObjIdObjVar (tatooine, "lifeday.positionOne.playerObjId"); - - if (hasObjVar(tatooine, "lifeday.positionTwo.playerScore")) - { - twoScore = getIntObjVar (tatooine, "lifeday.positionTwo.playerScore"); - twoName = getStringObjVar (tatooine, "lifeday.positionTwo.playerName"); - twoFaction = getStringObjVar (tatooine, "lifeday.positionTwo.playerFaction"); - twoId = getObjIdObjVar (tatooine, "lifeday.positionTwo.playerObjId"); - } - } - - if (playerFaction.equals ("null")) - { - return; - } - - if (scoreBoardEmpty.equals ("true")) - { - setObjVar (tatooine, "lifeday.emptyScoreBoard", "false"); - } - - if (position.equals ("One")) - { - if (isIdValid (twoId)) - { - setObjVar (tatooine, "lifeday.positionThree.playerScore", twoScore); - setObjVar (tatooine, "lifeday.positionThree.playerName", twoName); - setObjVar (tatooine, "lifeday.positionThree.playerObjId", twoId); - setObjVar (tatooine, "lifeday.positionThree.playerFaction", twoFaction); - } - if (isIdValid (oneId)) - { - setObjVar (tatooine, "lifeday.positionTwo.playerScore", oneScore); - setObjVar (tatooine, "lifeday.positionTwo.playerName", oneName); - setObjVar (tatooine, "lifeday.positionTwo.playerObjId", oneId); - setObjVar (tatooine, "lifeday.positionTwo.playerFaction", oneFaction); - } - } - - if (position.equals ("Two")) - { - if (isIdValid (twoId)) - { - setObjVar (tatooine, "lifeday.positionThree.playerScore", twoScore); - setObjVar (tatooine, "lifeday.positionThree.playerName", twoName); - setObjVar (tatooine, "lifeday.positionThree.playerObjId", twoId); - setObjVar (tatooine, "lifeday.positionThree.playerFaction", twoFaction); - } - } - - setObjVar (tatooine, "lifeday.emptyScoreBoard", "false"); - setObjVar (tatooine, "lifeday.position"+position+".playerScore", playerScore); - setObjVar (tatooine, "lifeday.position"+position+".playerName", playerName); - setObjVar (tatooine, "lifeday.position"+position+".playerObjId", self); - setObjVar (tatooine, "lifeday.position"+position+".playerFaction", playerFaction); - - return; - } - - - public void checkLifeDayData(obj_id planet) throws InterruptedException - { - if (!hasObjVar(planet, "lifeday.time_stamp")) - { - newLifeDayTimeStamp(planet); - } - - if (!hasObjVar(planet, "lifeday.emptyScoreBoard")) - { - setObjVar(planet, "lifeday.emptyScoreBoard", "true"); - } - - if (hasObjVar(planet, "lifeday.positionOne.playerScore")) - { - if (!newLifeDayDay(planet)) - { - setObjVar(planet, "lifeday.emptyScoreBoard", "false"); - } - } - - if (newLifeDayDay(planet)) - { - removeObjVar(planet, "lifeday"); - setObjVar(planet, "lifeday.emptyScoreBoard", "true"); - newLifeDayTimeStamp(planet); - } - } - - - public boolean newLifeDayDay(obj_id planet) throws InterruptedException - { - if (hasObjVar(planet, "lifeday.time_stamp")) - { - int now = getCalendarTime(); - int then = getIntObjVar(planet, "lifeday.time_stamp"); - - if (now > then) - { - return true; - } - else - { - return false; - } - } - return true; - } - - - public void newLifeDayTimeStamp(obj_id planet) throws InterruptedException - { - int now = getCalendarTime(); - int secondsUntil = secondsUntilNextDailyTime(10, 0, 0); - int then = now + secondsUntil; - setObjVar(planet, "lifeday.time_stamp", then); - } - - - public int procResistAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int procResistRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int wampaBossIceThrowPrepAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - sendWampaBossWarning(self, "wampa_boss_ice_throw_prep"); - return SCRIPT_CONTINUE; - } - - - public int wampaBossIceThrowPrepRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - queueCommand(caster, (-1448600302), self, "", COMMAND_PRIORITY_IMMEDIATE); - - obj_id[] otherPlayers = trial.getValidTargetsInRadiusIgnoreLOS(self, 8.0f); - if (otherPlayers != null && otherPlayers.length > 0) - { - for (int i = 0; i < otherPlayers.length; i++) - { - testAbortScript(); - obj_id nextPlayer = otherPlayers[i]; - if (isIdValid(nextPlayer) && nextPlayer != self) - { - buff.applyBuff(nextPlayer, caster, "wampa_boss_ice_throw"); - sendSystemMessage(nextPlayer, new string_id ("dungeon_strings", "wampa_boss_ice_throw")); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int wampaBossTauntaunThrowPrepAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - sendWampaBossWarning(self, "wampa_boss_tauntaun_throw_prep"); - return SCRIPT_CONTINUE; - } - - - public int wampaBossTauntaunThrowPrepRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - queueCommand(caster, (156825053), self, "", COMMAND_PRIORITY_IMMEDIATE); - - obj_id[] otherPlayers = trial.getValidTargetsInRadiusIgnoreLOS(self, 8.0f); - if (otherPlayers != null && otherPlayers.length > 0) - { - for (int i = 0; i < otherPlayers.length; i++) - { - testAbortScript(); - obj_id nextPlayer = otherPlayers[i]; - if (isIdValid(nextPlayer) && nextPlayer != self) - { - buff.applyBuff(nextPlayer, caster, "wampa_boss_tauntaun_throw"); - sendSystemMessage(nextPlayer, new string_id ("dungeon_strings", "wampa_boss_tauntaun_throw")); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public void sendWampaBossWarning(obj_id target, String messageId) throws InterruptedException - { - String targetName = getName(target); - - obj_id[] playersInArea = getPlayerCreaturesInRange(target, 250.0f); - if (playersInArea != null && playersInArea.length > 0) - { - for (int i = 0; i < playersInArea.length; i++) - { - testAbortScript(); - obj_id player = playersInArea[i]; - if (isIdValid(player) && exists(player)) - { - string_id message = new string_id ("dungeon_strings", messageId); - prose_package pp = prose.getPackage(message, target, target); - prose.setTO(pp, targetName); - - sendSystemMessageProse(player, pp); - } - } - } - return; - } - - - public int iceblockEffectAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - dictionary webster = new dictionary(); - webster.put("caster", caster); - webster.put("buffName", buffName); - messageTo(self, "handleDoIceblock", webster, 0.25f, false); - return SCRIPT_CONTINUE; - } - - - public int handleDoIceblock(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - String buffName = params.getString("buffName"); - if (isIncapacitated(self) || isDead(self)) - { - buff.removeBuff(self, buffName); - } - else - { - if (!utils.hasScriptVar(self, "iceblock") && buff.hasBuff(self, buffName)) - { - obj_id caster = params.getObjId("caster"); - obj_id iceblock = create.object("object/tangible/dungeon/hoth/ice_block.iff", getLocation(self)); - if (isIdValid(iceblock)) - { - if (isIdValid(caster)) - { - trial.setParent(caster, iceblock, false); - } - setLocation(self, getLocation(iceblock)); - - utils.setScriptVar(self, "iceblock", iceblock); - utils.setScriptVar(iceblock, "iceblocked", self); - utils.setScriptVar(iceblock, "buffName", buffName); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int iceblockEffectRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - obj_id iceblock = utils.getObjIdScriptVar(self, "iceblock"); - trial.cleanupObject(iceblock); - - utils.removeScriptVar(self, "iceblock"); - return SCRIPT_CONTINUE; - } - - - public int barricadeDefenderAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.setScriptVar(self, combat.DAMAGE_REDIRECT, caster); - return SCRIPT_CONTINUE; - } - - - public int barricadeDefenderRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVar(self, combat.DAMAGE_REDIRECT); - return SCRIPT_CONTINUE; - } - - - public int snowspeederInstructionsAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - string_id message = new string_id("theme_park/heroic", "hoth_snowspeeder_instructions"); - String templateOverride = "object/mobile/dressed_echo_base_luke_skywalker.iff"; - - obj_id instructor = self; - if (isIdValid(caster)) - { - instructor = caster; - } - - utils.messagePlayer(instructor, self, message, templateOverride); - return SCRIPT_CONTINUE; - } - - - public int snowspeederInstructionsRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - buff.applyBuff(self, "snowspeeder_instructions_block"); - return SCRIPT_CONTINUE; - } - - - public int radarHueAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - int row = dataTableSearchColumnForInt((int)value, "index", DATATABLE_RADAR_HUE); - if (row < 0) - { - return SCRIPT_CONTINUE; - } - - int red = dataTableGetInt(DATATABLE_RADAR_HUE, row, "red"); - int green = dataTableGetInt(DATATABLE_RADAR_HUE, row, "green"); - int blue = dataTableGetInt(DATATABLE_RADAR_HUE, row, "blue"); - - if (red < 0) - { - red = 0; - } - - if (red > 255) - { - red = 255; - } - - if (green < 0) - { - green = 0; - } - - if (green > 255) - { - green = 255; - } - - if (blue < 0) - { - blue = 0; - } - - if (blue > 255) - { - blue = 255; - } - - setOverrideMapColor(self, red, green, blue); - return SCRIPT_CONTINUE; - } - - - public int radarHueRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - clearOverrideMapColor(self); - return SCRIPT_CONTINUE; - } - - - public int bhShieldsChargedAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int bhShieldsChargedRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int bhShieldsAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - attachScript(self, "player.skill.bh_shields"); - String shield_buff = "bh_shields"; - buff.applyBuff(self, shield_buff); - _decrementBuffStack(self, getStringCrc(shield_buff.toLowerCase()), -98); - return SCRIPT_CONTINUE; - } - - - public int bhShieldsRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int sp_covert_masteryAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int sp_covert_masteryRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - public int randomCollectionItemAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - obj_id collectionItem = collection.grantRandomCollectionItem(self, "datatables/loot/loot_items/collectible/magseal_loot.iff", "collections"); - buff.removeBuff(self, buffName); - - return SCRIPT_CONTINUE; - } - - - public int randomCollectionItemRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int gcwBonusGeneralAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - CustomerServiceLog("buff", "gcwBonusGeneral Buff used by player: "+self+" Name: "+getName(self)+ " Effect: "+effectName+" subtype:"+subtype+" duration: "+duration+" value: "+value+" buffName: "+buffName+" caster: "+caster); - utils.setScriptVar(self, "buff.gcwBonusGeneral.value", value / 100); - - return SCRIPT_CONTINUE; - } - - - public int gcwBonusGeneralRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - utils.removeScriptVarTree(self, "buff.gcwBonusGeneral"); - - return SCRIPT_CONTINUE; - } - - - public int battlefieldCommuncationsGlowAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - buff.removeBuff(self, "battlefield_radar_invisibility"); - - if (stealth.hasInvisibleBuff(self)) - { - buff.removeBuff(self, stealth.getInvisBuff(self)); - } - - return SCRIPT_CONTINUE; - } - - - public int battlefieldCommuncationsGlowRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (effectName.lastIndexOf("_") > 0) - { - effectName = effectName.substring(0, (effectName.lastIndexOf("_"))); - } - - stopClientEffectObjByLabel(self, self, effectName); - - buff.applyBuff(self, "battlefield_radar_invisibility"); - - return SCRIPT_CONTINUE; - } - - - public int empireDayImperialRecruitmentAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int empireDayImperialRecruitmentRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - if (buff.hasBuff(self, holiday.BUFF_IMPERIAL_RECRUITMENT_COUNTER)) - { - buff.removeBuff(self, holiday.BUFF_IMPERIAL_RECRUITMENT_COUNTER); - } - modifyCollectionSlotValue(self, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT, 1); - play2dNonLoopingSound(self, groundquests.MUSIC_QUEST_COMPLETED); - setObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT, true); - holiday.setEventLockOutTimeStamp(self, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - - if (hasObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER)) - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayImperialRecruitmentRemoveBuffHandler: Player: ("+self+") is IMPERIAL and updating leader board because this is the second buff."); - if (!updateEmpireDayLeaderBoard(self, holiday.IMPERIAL_PLAYER)) - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayImperialRecruitmentRemoveBuffHandler: updateEmpireDayLeaderBoard reports that updating score for Player: ("+self+") FAILED."); - } - removeObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER); - } - else - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayImperialRecruitmentRemoveBuffHandler: Player: ("+self+") is finishing their first buff. The leader board will not be updated."); - setObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER, true); - } - return SCRIPT_CONTINUE; - } - - - public int empireDayRebelResistanceAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int empireDayRebelResistanceRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - if (buff.hasBuff(self, holiday.BUFF_REBEL_RESISTANCE_COUNTER)) - { - buff.removeBuff(self, holiday.BUFF_REBEL_RESISTANCE_COUNTER); - } - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_COUNTER_SLOT, 1); - play2dNonLoopingSound(self, groundquests.MUSIC_QUEST_COMPLETED); - setObjVar(self, holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT, true); - holiday.setEventLockOutTimeStamp(self, holiday.EMPIRE_DAY_RESISTANCE_TIMESTAMP); - - if (hasObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER)) - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayRebelResistanceRemoveBuffHandler: Player: ("+self+") is REBEL and updating leader board because this is the second buff."); - if (!updateEmpireDayLeaderBoard(self, holiday.REBEL_PLAYER)) - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayRebelResistanceRemoveBuffHandler: updateEmpireDayLeaderBoard reports that updating score for Player: ("+self+") FAILED."); - } - removeObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER); - } - else - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayRebelResistanceRemoveBuffHandler: Player: ("+self+") is finishing their first buff. The leader board will not be updated."); - setObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER, true); - } - return SCRIPT_CONTINUE; - } - - - public int empireDayImperialPropagandaAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int empireDayImperialPropagandaRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - if (buff.hasBuff(self, holiday.BUFF_IMPERIAL_ANTIPROPAGANDA_COUNTER)) - { - buff.removeBuff(self, holiday.BUFF_IMPERIAL_ANTIPROPAGANDA_COUNTER); - } - - modifyCollectionSlotValue(self, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT, 1); - play2dNonLoopingSound(self, groundquests.MUSIC_QUEST_COMPLETED); - setObjVar(self, holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT, true); - holiday.setEventLockOutTimeStamp(self, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - - if (hasObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER)) - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayImperialPropagandaRemoveBuffHandler: Player: ("+self+") is IMPERIAL and updating leader board because this is the second buff."); - if (!updateEmpireDayLeaderBoard(self, holiday.IMPERIAL_PLAYER)) - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayImperialPropagandaRemoveBuffHandler: updateEmpireDayLeaderBoard reports that updating score for Player: ("+self+") FAILED."); - } - removeObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER); - } - else - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayImperialPropagandaRemoveBuffHandler: Player: ("+self+") is finishing their first buff. The leader board will not be updated."); - setObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER, true); - } - return SCRIPT_CONTINUE; - } - - - public int empireDayRebelVandalAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int empireDayRebelVandalRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - - if (buff.hasBuff(self, holiday.BUFF_REBEL_PLAYER_VANDAL_COUNTER)) - { - buff.removeBuff(self, holiday.BUFF_REBEL_PLAYER_VANDAL_COUNTER); - } - - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_COUNTER_SLOT, 1); - play2dNonLoopingSound(self, groundquests.MUSIC_QUEST_COMPLETED); - setObjVar(self, holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT, true); - holiday.setEventLockOutTimeStamp(self, holiday.EMPIRE_DAY_VANDAL_TIMESTAMP); - - if (hasObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER)) - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayRebelVandalRemoveBuffHandler: Player: ("+self+") is REBEL updating leader board because this is the second buff."); - if (!updateEmpireDayLeaderBoard(self, holiday.REBEL_PLAYER)) - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayRebelVandalRemoveBuffHandler: updateEmpireDayLeaderBoard reports that updating score for Player: ("+self+") FAILED."); - } - removeObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER); - } - else - { - CustomerServiceLog("holidayEvent", "buff_handler.empireDayRebelVandalRemoveBuffHandler: Player: ("+self+") is finishing their first buff. The leader board will not be updated."); - setObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER, true); - } - return SCRIPT_CONTINUE; - } - - - public boolean updateEmpireDayLeaderBoard(obj_id player, int faction) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - CustomerServiceLog("holidayEvent", "buff_handler.updateEmpireDayLeaderBoard: Updating leaderboard with Player: "+player+" of faction: "+faction+"score"); - - if (!hasObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE)) - { - CustomerServiceLog("holidayEvent", "buff_handler.updateEmpireDayLeaderBoard: Updating leaderboard with Player: "+player+" HAS NO SCORE. FAILING UPDATE"); - return false; - } - - int playerScore = getIntObjVar(player, holiday.PLAYER_EMPIRE_DAY_SCORE); - if (playerScore <= 0) - { - CustomerServiceLog("holidayEvent", "buff_handler.updateEmpireDayLeaderBoard: Updating leaderboard with Player: "+player+" HAS A CORRUPT SCORE. FAILING UPDATE"); - return false; - } - - String playerName = getPlayerFullName(player); - if (playerName == null || playerName.length() <= 0) - { - CustomerServiceLog("holidayEvent", "buff_handler.updateEmpireDayLeaderBoard: Updating leaderboard with Player: "+player+" HAS AN INVALID NAME. FAILING UPDATE"); - return false; - } - - obj_id tatooine = getPlanetByName("tatooine"); - if (!isIdValid(tatooine) || !exists(tatooine)) - { - CustomerServiceLog("holidayEvent", "buff_handler.updateEmpireDayLeaderBoard: Could not find Tatooine OID."); - return false; - } - - int factionPassed = holiday.IMPERIAL_PLAYER; - if (faction == holiday.REBEL_PLAYER) - { - factionPassed = holiday.REBEL_PLAYER; - } - - CustomerServiceLog("holidayEvent", "buff_handler.updateEmpireDayLeaderBoard: FACTION PASSED: "+factionPassed); - - if (!holiday.setEmpireDayLeaderScores(tatooine, player, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY + holiday.PLANET_VAR_SCORE, playerScore, playerName, factionPassed)) - { - CustomerServiceLog("holidayEvent", "buff_handler.updateEmpireDayLeaderBoard: Player: ("+player+") "+playerName+ " was unable to attain leader board data. Their score was: "+playerScore); - return false; - } - return true; - } - - - public int deathTroopersAfflictedTossAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - messageTo(self, "createAfflicted", null, 1.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int createAfflicted(obj_id self, dictionary params) throws InterruptedException - { - location loc = getLocation(self); - - obj_id afflicted = create.object("outbreak_afflicted_lvl_90", loc); - - debugSpeakMsg(self, "Eww. Gooy! "+ afflicted); - - if (isIdValid(afflicted)) - { - setHate(self, afflicted, 0); - setHate(afflicted, self, 0); - } - - return SCRIPT_CONTINUE; - } - - - public int outbreakStackingInfectionAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (utils.hasScriptVar(self, "outbreak.innoculated") || !isInBlackwingInfectionedArea(self)) - { - return SCRIPT_CONTINUE; - } - - if (value < 1) - { - value = 1.0f; - } - - if (buff.getBuffStackCount(self, buffName) <= 1) - { - dictionary webster = trial.getSessionDict(self, "outbreak_stacking_infection"); - webster.put("value", value); - messageTo(self, "handleOutbreakStackingInfection", webster, value, false); - } - return SCRIPT_CONTINUE; - } - - - public int outbreakStackingInfectionRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - trial.bumpSession(self, "outbreak_stacking_infection"); - return SCRIPT_CONTINUE; - } - - - public int handleOutbreakStackingInfection(obj_id self, dictionary params) throws InterruptedException - { - if (!trial.verifySession(self, params, "outbreak_stacking_infection")) - { - return SCRIPT_CONTINUE; - } - - if (( utils.hasScriptVar(self, "outbreak.innoculated") || buff.hasBuff(self, "death_troopers_inoculation") || buff.hasBuff(self, "death_troopers_infection_3") || !isInBlackwingInfectionedArea(self) )) - { - utils.setScriptVar(self, "outbreak.innoculated", true); - buff.removeBuff(self, "death_troopers_infection_2"); - return SCRIPT_CONTINUE; - } - - float value = params.getFloat("value"); - if (value < 1) - { - value = 1.0f; - } - - int buffCrc = getStringCrc("death_troopers_infection_2"); - - buff_data bdata = combat_engine.getBuffData(buffCrc); - int buffMaxStacks = bdata.maxStacks; - long buffStack = buff.getBuffStackCount(self, buffCrc); - if (buffStack >= buffMaxStacks) - { - - } - else - { - buff.applyBuff(self, self, "death_troopers_infection_2"); - } - - dictionary webster = trial.getSessionDict(self, "outbreak_stacking_infection"); - webster.put("value", value); - messageTo(self, "handleOutbreakStackingInfection", webster, value, false); - return SCRIPT_CONTINUE; - } - - - public boolean isInBlackwingInfectionedArea(obj_id self) throws InterruptedException - { - if (locations.isInRegion(self, "@dathomir_region_names:black_mesa")) - { - return true; - } - - obj_id building = getTopMostContainer(self); - if (isIdValid(building) && getTemplateName(building).equals("object/building/dathomir/imperial_blackwing_facility.iff")) - { - return true; - } - - return false; - } - - - public int killPlayerAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - if (!isDead(self)) - { - setPosture(self, POSTURE_INCAPACITATED); - pclib.killPlayer(self, self, false); - } - - return SCRIPT_CONTINUE; - } - - - public int gcwSpyDestroyPatrolExplosivesAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int gcwSpyDestroyPatrolExplosivesRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int gcwGeneralResistanceStackAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int gcwGeneralResistanceStackRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int gcwFatigueDecay(obj_id self, dictionary params) throws InterruptedException - { - int gcwFatigueTime = params.getInt("gcwFatigueTime"); - int gcwFatigueScriptTime = utils.getIntScriptVar(self, "gcw.fatigueTime"); - - LOG("buff_handler", "gcwFatigueDecay gcwFatigueTime: "+ gcwFatigueTime + " gcwFatigueScriptTime: "+ gcwFatigueScriptTime); - - if (gcwFatigueTime != gcwFatigueScriptTime) - { - return SCRIPT_CONTINUE; - } - - if (buff.hasBuff(self, "gcw_fatigue")) - { - long buffStack = buff.getBuffStackCount(self, "gcw_fatigue"); - - buff.removeBuff(self, "gcw_fatigue"); - - if (buffStack > 1) - { - buff.applyBuff(self, "gcw_fatigue", (int)buffStack - 1); - } - - if (buff.hasBuff(self, "gcw_fatigue")) - { - int gameTime = getGameTime(); - - params.put("gcwFatigueTime", gameTime); - utils.setScriptVar(self, "gcw.fatigueTime", gameTime); - - messageTo(self, "gcwFatigueDecay", params, 120.0f, false); - } - } - - return SCRIPT_CONTINUE; - } - - - public int gcwNpcEntertainerBuffAddBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int gcwNpcEntertainerBuffRemoveBuffHandler(obj_id self, String effectName, String subtype, float duration, float value, String buffName, obj_id caster) throws InterruptedException - { - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/collections/collection_handle_object_on_object.java b/sku.0/sys.server/compiled/game/script/systems/collections/collection_handle_object_on_object.java deleted file mode 100644 index 20e552cf2..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/collections/collection_handle_object_on_object.java +++ /dev/null @@ -1,31 +0,0 @@ -package script.systems.collections; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.static_item; -import script.library.buff; -import script.library.collection; -import script.library.sui; -import script.library.utils; - - -public class collection_handle_object_on_object extends script.base_script -{ - public collection_handle_object_on_object() - { - } - - public int incapaciteSelf(obj_id self, dictionary params) throws InterruptedException - { - setPosture(self, POSTURE_INCAPACITATED); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/collections/collection_use_object_on_object.java b/sku.0/sys.server/compiled/game/script/systems/collections/collection_use_object_on_object.java deleted file mode 100644 index 0ea4a7eb1..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/collections/collection_use_object_on_object.java +++ /dev/null @@ -1,266 +0,0 @@ -package script.systems.collections; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.buff; -import script.library.collection; -import script.library.groundquests; -import script.library.static_item; -import script.library.sui; -import script.library.utils; - - -public class collection_use_object_on_object extends script.base_script -{ - public collection_use_object_on_object() - { - } - public static final string_id SID_INVALID_TARGET = new string_id("collection", "invalid_target"); - public static final string_id NOT_WHILE_INCAPPED = new string_id ("quest/ground/util/quest_giver_object", "not_while_incapped"); - public static final string_id MUST_DISMOUNT = new string_id ("collection", "must_dismount"); - public static final string_id CREATURE_IS_DEAD = new string_id ("collection", "creature_is_dead"); - public static final string_id OBJECT_DESTROYED = new string_id ("collection", "object_destroyed"); - - public static final String OBJECT_KEY = "quest.object_key"; - public static final String COLLECTION_OBJECT_TABLE = "datatables/collection/use_object_on_object.iff"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!canManipulate(player, self, true, true, 15, true)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithinAPlayer(self)) - { - return SCRIPT_CONTINUE; - } - - menu_info_data mid = mi.getMenuItemByType(menu_info_types.ITEM_USE); - if (mid != null) - { - mid.setServerNotify(true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - sendDirtyObjectMenuNotification(self); - - if (utils.getContainingPlayer(self) != player) - { - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (isIncapacitated(player) || isDead(player)) - { - sendSystemMessage(player, new string_id("player_structure", "while_dead")); - return SCRIPT_CONTINUE; - } - if (getState(player, STATE_RIDING_MOUNT) == 1) - { - sendSystemMessage(player, MUST_DISMOUNT); - return SCRIPT_CONTINUE; - } - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, NOT_WHILE_INCAPPED); - return SCRIPT_CONTINUE; - } - - obj_id intended = getIntendedTarget(player); - - if (!isIdValid(intended)) - { - - sendSystemMessage(player, SID_INVALID_TARGET); - } - else - { - setObjVar(self, "owner", player); - - checkValidTarget(player, intended, self); - } - - return SCRIPT_CONTINUE; - } - - - public boolean checkValidTarget(obj_id player, obj_id target, obj_id self) throws InterruptedException - { - - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (!isValidId(target) || !exists(target)) - { - return false; - } - - if (!isValidId(self) || !exists(self)) - { - return false; - } - - if (!hasObjVar(self, OBJECT_KEY)) - { - if (hasScript(self, "item.special.nodestroy")) - { - detachScript(self, "item.special.nodestroy"); - } - messageTo(self, "handleDestroy", null, 0, false); - return false; - } - - String keyString = getStringObjVar(self, OBJECT_KEY); - if (keyString == null || keyString.length() <= 0) - { - if (hasScript(self, "item.special.nodestroy")) - { - detachScript(self, "item.special.nodestroy"); - } - messageTo(self, "handleDestroy", null, 0, false); - return false; - } - - int tableRow = dataTableSearchColumnForString(keyString, "objectKey", COLLECTION_OBJECT_TABLE); - if (tableRow < 0) - { - return false; - } - - dictionary collectionDataDict = dataTableGetRow(COLLECTION_OBJECT_TABLE, tableRow); - if (collectionDataDict == null) - { - return false; - } - - String collectionName = collectionDataDict.getString("collectionName"); - if (collectionName == null || collectionName.length() <= 0) - { - return false; - } - - int questRequired = collectionDataDict.getInt("questRequired"); - - String questName = collectionDataDict.getString("questName"); - - String taskName = collectionDataDict.getString("taskName"); - - if (questRequired > 0 && ((questName == null || questName.length() <= 0) || (taskName == null || taskName.length() <= 0))) - { - return false; - } - - if (hasCompletedCollection(player, collectionName)) - { - messageTo(self, "handleDestroy", null, 0, false); - return false; - } - - if (hasCompletedCollection(player, collectionName)) - { - if (hasScript(self, "item.special.nodestroy")) - { - detachScript(self, "item.special.nodestroy"); - } - messageTo(self, "handleDestroy", null, 0, false); - return false; - - } - - if (questRequired > 0) - { - if (!groundquests.isQuestActive(player, questName)) - { - if (hasScript(self, "item.special.nodestroy")) - { - detachScript(self, "item.special.nodestroy"); - } - messageTo(self, "handleDestroy", null, 0, false); - return false; - } - if (!groundquests.isTaskActive(player, questName, taskName)) - { - if (hasScript(self, "item.special.nodestroy")) - { - detachScript(self, "item.special.nodestroy"); - } - messageTo(self, "handleDestroy", null, 0, false); - return false; - } - } - - if (!keyString.equals(getStringObjVar(target, OBJECT_KEY))) - { - return false; - } - - if (isMob(target) && (isDead(target) || isIncapacitated(target))) - { - sendSystemMessage(player, CREATURE_IS_DEAD); - return false; - } - - String collectonSlot = collectionDataDict.getString("collectonSlot"); - if (collectonSlot != null && collectonSlot.length() > 0) - { - - String[] allSlots = split(collectonSlot, ','); - for (int j = 0; j < allSlots.length; j++) - { - testAbortScript(); - if (!hasCompletedCollectionSlotPrereq(player, allSlots[j])) - { - - break; - } - if (hasCompletedCollectionSlot(player, allSlots[j])) - { - - continue; - } - - modifyCollectionSlotValue(player, allSlots[j], 1); - - String handleTarget = collectionDataDict.getString("handleTarget"); - if (handleTarget != null && handleTarget.length() > 0) - { - messageTo(target, handleTarget, null, 0, false); - } - break; - } - } - return true; - } - - - public int handleDestroy(obj_id self, dictionary params) throws InterruptedException - { - if (hasObjVar(self, "owner")) - { - obj_id player = getObjIdObjVar(self, "owner"); - sendSystemMessage(player, OBJECT_DESTROYED); - } - destroyObject(self); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/collections/consume_click.java b/sku.0/sys.server/compiled/game/script/systems/collections/consume_click.java deleted file mode 100644 index 68caf9f5f..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/collections/consume_click.java +++ /dev/null @@ -1,249 +0,0 @@ -package script.systems.collections; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.collection; -import script.library.prose; -import script.library.stealth; -import script.library.sui; -import script.library.utils; - - -public class consume_click extends script.base_script -{ - public consume_click() - { - } - public static final String OBJVAR_SLOT_NAME = "collection.slotName"; - public static final String VAR_ACCESS_DELAY = "delay.access_delay"; - public static final String COLLECTION_HANDLER = "modifySlot"; - public static final String NEWBIE_COMM = "collection.newbie_comm_series"; - - public static final int MAX_RANGE_TO_COLLECT = 3; - public static final int COLLECT_TIMER_BEGIN = 0; - public static final int COLLECT_TIMER_END = 5; - public static final int COLLECT_TIMER_DELAY = COLLECT_TIMER_END + 3; - - public static final string_id SID_CONSUME_PROMPT = new string_id("collection", "click_item_prompt"); - public static final string_id SID_CONSUME_TITLE = new string_id("collection", "consume_item_title"); - public static final string_id SID_CONSUME_ITEM = new string_id("collection", "consume_item"); - public static final string_id SID_REPORT_CONSUME_ITEM_FAIL = new string_id("collection", "report_consume_item_fail"); - public static final string_id SID_ALREADY_HAVE_SLOT = new string_id("collection", "already_have_slot"); - public static final string_id SID_ALREADY_FINISHED_COLLECTION = new string_id("collection", "already_finished_collection"); - public static final string_id COUNTDOWN_TIMER = new string_id("collection", "click_countdown_timer"); - public static final string_id SID_COUNTDOWN_LOCOMOTION = new string_id("quest/groundquests", "countdown_interrupted_locomotion"); - public static final string_id SID_INTERRUPTED_INCAPACITATED = new string_id("quest/groundquests", "countdown_interrupted_incapacitated"); - public static final string_id SID_INTERRUPTED_DAMAGED = new string_id("quest/groundquests", "countdown_interrupted_damaged"); - public static final string_id SID_NOT_CLOSE_ENOUGH = new string_id("collection", "not_close_enough"); - public static final string_id SID_INVIS_COLLECTION_FAIL = new string_id("collection", "invis_collection_failed"); - public static final string_id SID_CONTROL_ACCESS_DELAY = new string_id("collection", "access_delay"); - public static final string_id SID_GCW_SENSITIVE_DATA = new string_id("collection", "gcw_sensitive_data"); - public static final string_id SID_GCW_NO_DATA = new string_id("collection", "gcw_no_data"); - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - obj_id collectionItem = self; - - if (hasObjVar(collectionItem, "useStringFile") && hasObjVar(collectionItem, "useMenu")) - { - String useStringFile = getStringObjVar(collectionItem, "useStringFile"); - if (useStringFile != null && useStringFile.length() > 0) - { - - String useMenu = getStringObjVar(collectionItem, "useMenu"); - if (useMenu != null && useMenu.length() > 0) - { - string_id thisStringId = new string_id(useStringFile, useMenu); - mi.addRootMenu(menu_info_types.ITEM_USE, thisStringId); - } - } - } - else - { - mi.addRootMenu (menu_info_types.ITEM_USE, SID_CONSUME_ITEM); - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - sendDirtyObjectMenuNotification(self); - - obj_id collectionItem = self; - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(collectionItem, NEWBIE_COMM)) - { - collection.giveNewbieCommWindow(player, self); - } - - boolean isGCW = false; - if (hasObjVar(collectionItem, "collection.gcw_control_check")) - { - - if (!collection.gcwBaseControlCheck(collectionItem, player)) - { - sendSystemMessage(player, SID_GCW_SENSITIVE_DATA); - return SCRIPT_CONTINUE; - } - else - { - - if (utils.hasScriptVar(collectionItem, "collection.gcw_lockout_time")) - { - sendSystemMessage(player, SID_GCW_NO_DATA); - return SCRIPT_CONTINUE; - } - else - { - isGCW = true; - } - } - } - - if (utils.hasScriptVar(player, VAR_ACCESS_DELAY)) - { - int accessTime = utils.getIntScriptVar(player, VAR_ACCESS_DELAY); - int gameTime = getGameTime(); - LOG("collection","Var Delay Exists. accessTime: "+ accessTime); - - if ((accessTime + COLLECT_TIMER_DELAY) > gameTime) - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, SID_CONTROL_ACCESS_DELAY); - pp = prose.setDI(pp, (accessTime + COLLECT_TIMER_DELAY) - gameTime); - - sendSystemMessageProse(player, pp); - - return SCRIPT_CONTINUE; - } - else - { - utils.removeScriptVar(player, VAR_ACCESS_DELAY); - } - } - - String baseSlotName = getStringObjVar(collectionItem, OBJVAR_SLOT_NAME); - - String[] splitSlotNames = split(baseSlotName, ':'); - - String slotName = splitSlotNames[1]; - String collectionName = splitSlotNames[0]; - - if (isGCW && utils.hasScriptVar(collectionItem, "collection.gcwSlotName")) - { - slotName = utils.getStringScriptVar(collectionItem, "collection.gcwSlotName"); - utils.removeScriptVar(collectionItem, "collection.gcwSlotName"); - } - - if (!hasCompletedCollectionSlotPrereq(player, slotName)) - { - - sendSystemMessage(player, collection.SID_NEED_TO_ACTIVATE_COLLECTION); - return SCRIPT_CONTINUE; - } - - if (hasCompletedCollection(player, collectionName)) - { - - sendSystemMessage(player, SID_ALREADY_FINISHED_COLLECTION); - return SCRIPT_CONTINUE; - } - - if ((slotName == null || slotName.equals("")) || hasCompletedCollectionSlot(player, slotName)) - { - - sendSystemMessage(player, SID_ALREADY_HAVE_SLOT); - return SCRIPT_CONTINUE; - } - - boolean currentState = collection.checkState(player); - if (!currentState) - { - return SCRIPT_CONTINUE; - } - - boolean isCloseEnough = collection.checkDistance(self, player, MAX_RANGE_TO_COLLECT); - if (!isCloseEnough) - { - LOG("collection","Not Close ENOUGH"); - sendSystemMessage(player, SID_NOT_CLOSE_ENOUGH); - return SCRIPT_CONTINUE; - } - - LOG("collection","Player collecting "+ slotName); - - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - flags |= sui.CD_EVENT_COMBAT; - flags |= sui.CD_EVENT_LOCOMOTION; - - stealth.testInvisNonCombatAction(player, self); - collection.giveAreaMobsHate(self, player); - - int collectTimerEnd = COLLECT_TIMER_END; - - if (hasObjVar(self, "collection.timerLength")) - { - collectTimerEnd = getIntObjVar(self, "collection.timerLength"); - } - - if (utils.hasScriptVar(player, "collection.qa.clickBypass")) - { - collectTimerEnd = 1; - } - - if (collectTimerEnd > 0) - { - int pid = sui.smartCountdownTimerSUI(player, player, "quest_countdown_timer", COUNTDOWN_TIMER, COLLECT_TIMER_BEGIN, collectTimerEnd, COLLECTION_HANDLER, MAX_RANGE_TO_COLLECT, flags); - sui.setPid(player, pid, collection.CONSUME_PID_NAME); - utils.setScriptVar(player, "col.id", pid); - utils.setScriptVar(player, "col.collectionItem", collectionItem); - utils.setScriptVar(player, "col.slotName", slotName); - - if (isGCW) - { - utils.setScriptVar(player, "col.isGCW", 1); - } - } - else - { - - if (modifyCollectionSlotValue(player, slotName, 1)) - { - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was consumed into a collection, for player "+ getFirstName(player) + "("+ player + ")."); - } - else - { - - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was NOT consumed into a collection, for player "+ getFirstName(player) + "("+ player + ")."); - - sendSystemMessage(player, SID_REPORT_CONSUME_ITEM_FAIL); - } - } - return SCRIPT_CONTINUE; - } - - - public int removeGcwCollectionLockout(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar(self, "collection.gcw_lockout_time"); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/collections/consume_loot.java b/sku.0/sys.server/compiled/game/script/systems/collections/consume_loot.java deleted file mode 100644 index 85377cc39..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/collections/consume_loot.java +++ /dev/null @@ -1,387 +0,0 @@ -package script.systems.collections; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.collection; -import script.library.sui; -import script.library.utils; - - -public class consume_loot extends script.base_script -{ - public consume_loot() - { - } - public static final String PID_NAME = "collectionConsume"; - public static final String SCRIPTVAR_LIST = "collections.availableCollections"; - - public static final string_id SID_CONSUME_PROMPT = new string_id("collection", "consume_item_prompt"); - public static final string_id SID_CONSUME_TITLE = new string_id("collection", "consume_item_title"); - public static final string_id SID_CONSUME_ITEM = new string_id("collection", "consume_item"); - public static final string_id SID_REPORT_CONSUME_ITEM_FAIL = new string_id("collection", "report_consume_item_fail"); - public static final string_id SID_ALREADY_HAVE_SLOT = new string_id("collection", "already_have_slot"); - public static final string_id SID_ALREADY_FINISHED_COLLECTION = new string_id("collection", "already_finished_collection"); - public static final string_id STR_COLLECTION_LIST_PROMPT = new string_id("collection", "collection_list_prompt"); - public static final string_id STR_COLLECTION_LIST_TITLE = new string_id("collection", "collection_list_title"); - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - obj_id collectionItem = self; - - if (utils.isNestedWithinAPlayer(collectionItem)) - { - mi.addRootMenu (menu_info_types.SERVER_MENU3, SID_CONSUME_ITEM); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - sendDirtyObjectMenuNotification(self); - - obj_id collectionItem = self; - CustomerServiceLog("CollectionConsume: ", "collection OnObjectMenuSelect worked"); - - if (item == menu_info_types.SERVER_MENU3 && utils.isNestedWithinAPlayer(collectionItem)) - { - if (sui.hasPid(player, PID_NAME)) - { - int pid = sui.getPid(player, PID_NAME); - forceCloseSUIPage(pid); - } - CustomerServiceLog("CollectionConsume: ", "collection OnObjectMenuSelect nested in player worked"); - - String[] availableCollections = collection.getAllAvailableCollectionsForItem(player, self); - if (availableCollections.length >= 1) - { - CustomerServiceLog("CollectionConsume: ", "collection OnObjectMenuSelect getAllAvailableCollectionsForItem worked"); - - boolean success = getUiConsumeMessageBox(self, player); - return SCRIPT_CONTINUE; - } - else - { - - sendSystemMessage(player, collection.SID_NEED_TO_ACTIVATE_COLLECTION); - return SCRIPT_CONTINUE; - } - } - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (exists(self) && !hasObjVar(self, "relic.doNotShowAsCollectionItem")) - { - String[] collectionsForItem = collection.getAllCollectionsForItem(self); - String[] slotsForItem = collection.getAllSlotsForItem(self); - - if (collectionsForItem != null && collectionsForItem.length > 0) - { - for (int i = 0; i < collectionsForItem.length; ++i) - { - testAbortScript(); - names[idx] = "collection_name"; - if (!hasCompletedCollection(player,collectionsForItem[i])) - { - if (!hasCompletedCollectionSlot(player, slotsForItem[i])) - { - attribs[idx] = "@collection_n:"+collectionsForItem[i] + "_unfinished"; - } - else - { - attribs[idx] = "@collection_n:"+collectionsForItem[i] + "_finished"; - } - } - else - { - attribs[idx] = "@collection_n:"+collectionsForItem[i] + "_finished"; - } - idx++; - } - } - } - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int handlerSuiAddToCollection(obj_id self, dictionary params) throws InterruptedException - { - - obj_id collectionItem = self; - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - - if (!sui.hasPid(player, PID_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(self, player)) - { - sui.removePid(player, PID_NAME); - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was NOT consumed into a collection, for player "+ getFirstName(player) + "("+ player + "). collectionItem("+ collectionItem + "). Player attempted to collect an item that was not in their inventory."); - return SCRIPT_CONTINUE; - } - - String[] availableCollections = collection.getAllAvailableCollectionsForItem(player, self); - String[] availableSlots = collection.getAllAvailableSlotsForItem(player, self); - - String slotName = ""; - String collectionName = ""; - - if (availableCollections.length < 1) - { - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was NOT consumed into a collection, for player "+ getFirstName(player) + "("+ player + "). collectionItem("+ collectionItem + "). Player did not have the collection activated."); - sui.removePid(player, PID_NAME); - - sendSystemMessage(player, collection.SID_NEED_TO_ACTIVATE_COLLECTION); - return SCRIPT_CONTINUE; - } - - if (availableCollections != null && availableCollections.length > 1) - { - - String[] dataStored = (String[])availableCollections.clone(); - utils.setScriptVar(player, SCRIPTVAR_LIST, dataStored); - - for (int i = 0; i < availableCollections.length; ++i) - { - testAbortScript(); - availableCollections[i] = utils.packStringId(new string_id("collection", availableCollections[i])); - } - - int pid = sui.listbox(self, player, "@"+ STR_COLLECTION_LIST_PROMPT, sui.OK_CANCEL, "@"+ STR_COLLECTION_LIST_TITLE, availableCollections, "onCollectionListResponse", true, false); - sui.setPid(player, pid, PID_NAME); - return SCRIPT_CONTINUE; - } - - else if (availableCollections != null && availableCollections.length > 0) - { - slotName = availableSlots[0]; - collectionName = availableCollections[0]; - } - - if (!hasCompletedCollection(player, collectionName)) - { - - if (!hasCompletedCollectionSlot(player, slotName) && !slotName.equals("")) - { - - if (modifyCollectionSlotValue(player, slotName, 1)) - { - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was consumed into a collection, for player "+ getFirstName(player) + "("+ player + "). collectionItem("+ collectionItem + ") will now be destroyed."); - decrementCount(collectionItem); - } - else - { - - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was NOT consumed into a collection, for player "+ getFirstName(player) + "("+ player + "). collectionItem("+ collectionItem + ") will NOT be destroyed."); - - sendSystemMessage(player, SID_REPORT_CONSUME_ITEM_FAIL); - } - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - else - { - - sendSystemMessage(player, SID_ALREADY_HAVE_SLOT); - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - } - else - { - - sendSystemMessage(player, SID_ALREADY_FINISHED_COLLECTION); - } - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - - - public int onCollectionListResponse(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id collectionItem = self; - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (bp == sui.BP_CANCEL) - { - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - - if (idx < 0) - { - - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - - if (!sui.hasPid(player, PID_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithin(self, player)) - { - sui.removePid(player, PID_NAME); - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was NOT consumed into a collection, for player "+ getFirstName(player) + "("+ player + "). collectionItem("+ collectionItem + "). Player attempted to collect an item that was not in their inventory."); - return SCRIPT_CONTINUE; - } - - String[] availableCollections = utils.getStringArrayScriptVar(player, SCRIPTVAR_LIST); - String[] baseSlotNames = split(getStringObjVar(collectionItem, collection.OBJVAR_SLOT_NAME), '|'); - - utils.removeScriptVarTree(player, "collections"); - - String slotName = ""; - String collectionName = availableCollections[idx]; - - for (int i = 0; i < baseSlotNames.length; ++i) - { - testAbortScript(); - boolean found = false; - - String[] splitSlotNames = split(baseSlotNames[i], ':'); - - for (int j = 0; j < splitSlotNames.length; j += 2) - { - testAbortScript(); - if (collectionName.equals(splitSlotNames[j])) - { - - if (!hasCompletedCollection(player, collectionName)) - { - - if (!hasCompletedCollectionSlot(player, splitSlotNames[j + 1])) - { - - slotName = splitSlotNames[j + 1]; - found = true; - break; - } - } - } - } - if (found) - { - break; - } - } - - if (!hasCompletedCollection(player, collectionName)) - { - - if (!hasCompletedCollectionSlot(player, slotName) && !slotName.equals("")) - { - - if (modifyCollectionSlotValue(player, slotName, 1)) - { - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was consumed into a collection, for player "+ getFirstName(player) + "("+ player + "). collectionItem("+ collectionItem + ") will now be destroyed."); - decrementCount(collectionItem); - } - else - { - - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was NOT consumed into a collection, for player "+ getFirstName(player) + "("+ player + "). collectionItem("+ collectionItem + ") will NOT be destroyed."); - - sendSystemMessage(player, SID_REPORT_CONSUME_ITEM_FAIL); - } - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - else - { - - sendSystemMessage(player, SID_ALREADY_HAVE_SLOT); - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - } - else - { - - sendSystemMessage(player, SID_ALREADY_FINISHED_COLLECTION); - } - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - - - public boolean getUiConsumeMessageBox(obj_id self, obj_id player) throws InterruptedException - { - if (!isValidId(self) || !isValidId(player)) - { - return false; - } - CustomerServiceLog("CollectionConsume: ", "collection getUiConsumeMessageBox worked"); - - String questName = getStringObjVar(self, "collection.questName"); - if (questName == null || questName.equals("")) - { - int pid = sui.msgbox(self, player, "@"+ SID_CONSUME_PROMPT, sui.YES_NO, "@"+ SID_CONSUME_TITLE, "handlerSuiAddToCollection"); - sui.setPid(player, pid, PID_NAME); - return true; - } - CustomerServiceLog("CollectionConsume: ", "collection questName: "+questName); - - string_id questCollectionString = new string_id("collection", questName); - - int pid = sui.msgbox(self, player, "@"+ questCollectionString + "_d", sui.YES_NO, "@"+ questCollectionString + "_n", "handlerSuiAddToCollection"); - sui.setPid(player, pid, PID_NAME); - return true; - - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/collections/grant_collection_quest.java b/sku.0/sys.server/compiled/game/script/systems/collections/grant_collection_quest.java deleted file mode 100644 index 01fa1d90e..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/collections/grant_collection_quest.java +++ /dev/null @@ -1,146 +0,0 @@ -package script.systems.collections; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.collection; -import script.library.groundquests; -import script.library.sui; -import script.library.utils; - - -public class grant_collection_quest extends script.base_script -{ - public grant_collection_quest() - { - } - public static final boolean LOGGING_ENABLED = true; - - public static final String STF = "som/som_quest"; - public static final string_id EXAMINE = new string_id(STF, "blistmok_heart_examine"); - public static final string_id DESTROY = new string_id(STF, "blistmok_heart_destroy"); - public static final string_id ALREADY = new string_id(STF, "blistmok_heart_already"); - public static final string_id UNABLE = new string_id(STF, "unable_to_examine"); - public static final string_id DECLINE = new string_id(STF, "quest_decline"); - - public static final String QUEST_OBJVAR = "collection.quest"; - - - public void blog(String identifier, String text) throws InterruptedException - { - if (LOGGING_ENABLED) - { - LOG(identifier, text); - } - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (utils.getContainingPlayer(self) == null) - { - return SCRIPT_CONTINUE; - } - - blog("COLLECTIONS", "Menu Request "); - - int menu = mi.addRootMenu(menu_info_types.ITEM_USE, EXAMINE); - - menu_info_data mid = mi.getMenuItemByType(menu_info_types.ITEM_USE); - if (mid == null) - { - return SCRIPT_CONTINUE; - } - - mid.setServerNotify(true); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - blog("COLLECTIONS", "OnObjectMenuSelect"); - - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (utils.getContainingPlayer(self) == null) - { - return SCRIPT_CONTINUE; - } - - blog("COLLECTIONS", "initial checks done"); - - String quest = getStringObjVar(self, QUEST_OBJVAR); - if (quest == null || quest.equals("")) - { - return SCRIPT_CONTINUE; - } - - blog("COLLECTIONS", "obj objvar: "+quest); - - if (!groundquests.isQuestActive(player, quest)) - { - collection.activateQuestAcceptSUI(player, self); - } - else - { - sendSystemMessage(player, ALREADY); - } - - return SCRIPT_CONTINUE; - } - - - public int handleQuestOfferResponse(obj_id self, dictionary params) throws InterruptedException - { - blog("COLLECTIONS", "handleQuestOfferResponse"); - - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int bp = sui.getIntButtonPressed(params); - - String quest = getStringObjVar(self, QUEST_OBJVAR); - if (quest == null || quest.equals("")) - { - return SCRIPT_CONTINUE; - } - blog("COLLECTIONS", "handleQuestOfferResponse "+ quest); - blog("COLLECTIONS", "player: "+ player); - - switch(bp) - { - case sui.BP_OK: - groundquests.grantQuest(player, quest); - sendSystemMessage(player, DESTROY); - destroyObject(self); - break; - case sui.BP_CANCEL: - sendSystemMessage(player, DECLINE); - break; - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/collections/publish_gift/publish_gift_quest_giver_object.java b/sku.0/sys.server/compiled/game/script/systems/collections/publish_gift/publish_gift_quest_giver_object.java deleted file mode 100644 index 32fbda0ff..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/collections/publish_gift/publish_gift_quest_giver_object.java +++ /dev/null @@ -1,220 +0,0 @@ -package script.systems.collections.publish_gift; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.city; -import script.library.locations; -import script.library.groundquests; -import script.library.sui; -import script.library.utils; - - -public class publish_gift_quest_giver_object extends script.base_script -{ - public publish_gift_quest_giver_object() - { - } - public static final string_id RADIAL_INSPECT = new string_id ("quest/ground/util/quest_giver_object", "radial_inspect"); - public static final string_id OFFER_QUEST_MSG = new string_id ("quest/ground/util/quest_giver_object", "offer_quest"); - public static final string_id SUI_TITLE = new string_id ("quest/ground/util/quest_giver_object", "sui_title"); - public static final string_id BUTTON_DECLINE = new string_id ("quest/ground/util/quest_giver_object", "button_decline"); - public static final string_id BUTTON_ACCEPT = new string_id ("quest/ground/util/quest_giver_object", "button_accept"); - - public static final string_id ALREADY_COMPLETED_QUEST = new string_id ("quest/ground/util/quest_giver_object", "already_completed_quest"); - public static final string_id ALREADY_HAS_QUEST = new string_id ("quest/ground/util/quest_giver_object", "already_has_quest"); - public static final string_id DECLINED_QUEST = new string_id ("quest/ground/util/quest_giver_object", "declined_quest"); - public static final string_id OBJECT_UPLOADED = new string_id ("quest/ground/util/quest_giver_object", "object_uploaded"); - - public static final string_id IMPERIAL_FACTION_REQ = new string_id ("quest/ground/util/quest_giver_object", "imperial_faction_required"); - public static final string_id REBEL_FACTION_REQ = new string_id ("quest/ground/util/quest_giver_object", "rebel_faction_required"); - - public static final String DATATABLE = "datatables/quest/ground/quest_giver_object.iff"; - - public static final String PRE_QUEST_NAME = "pre_quest_name"; - public static final String QUEST_OFFER_TEXT = "quest_offer_text"; - public static final String QUEST_IS_REPEATABLE = "quest_is_repeatable"; - public static final String DO_NOT_DESTROY = "do_not_destroy"; - public static final String IMPERIAL_ONLY = "imperial_only"; - public static final String REBEL_ONLY = "rebel_only"; - - public static final String QUEST_NAME = "chapter7_publish_gift_activation"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - int menuOption = mi.addRootMenu (menu_info_types.ITEM_USE, RADIAL_INSPECT); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.ITEM_USE) - { - - if (!wildLocation(player)) - { - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, QUEST_NAME) || groundquests.isQuestActive(player, QUEST_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(player, "questGiver.openSui")) - { - int oldSui = utils.getIntScriptVar(player, "questGiver.openSui"); - utils.removeScriptVar(player, "questGiver.openSui"); - if (oldSui > -1) - { - forceCloseSUIPage(oldSui); - } - } - - string_id sid_offerText = SUI_TITLE; - - String title = utils.packStringId(sid_offerText); - String testMsg = utils.packStringId(OFFER_QUEST_MSG); - String ok_button = utils.packStringId(BUTTON_ACCEPT); - String cancel_button = utils.packStringId(BUTTON_DECLINE); - - int pid = sui.createSUIPage( sui.SUI_MSGBOX, self, player, "handleQuestOfferResponse"); - - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, title); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, testMsg); - - sui.msgboxButtonSetup(pid, sui.YES_NO); - setSUIProperty(pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, ok_button); - setSUIProperty(pid, sui.MSGBOX_BTN_CANCEL, sui.PROP_TEXT, cancel_button); - - utils.setScriptVar(player, "questGiver.openSui", pid); - sui.showSUIPage( pid ); - - } - return SCRIPT_CONTINUE; - } - - - public int handleQuestOfferResponse(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (!wildLocation(player)) - { - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, QUEST_NAME) || groundquests.isQuestActive(player, QUEST_NAME)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - switch ( bp ) - { - case sui.BP_OK: - callShuttle(self, player); - break; - - case sui.BP_CANCEL: - sendSystemMessage(player, DECLINED_QUEST); - break; - } - return SCRIPT_CONTINUE; - } - - - public void destroySelf(obj_id self) throws InterruptedException - { - destroyObject(self); - } - - - public boolean wildLocation(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - location loc = getLocation(player); - - if (isIdValid(loc.cell)) - { - sendSystemMessage(player, new string_id("combat_effects", "not_indoors")); - return false; - } - - if (locations.isInCity(loc)) - { - sendSystemMessage(player, new string_id("combat_effects", "not_in_city")); - return false; - } - - if (city.isInCity(loc)) - { - sendSystemMessage(player, new string_id("combat_effects", "not_in_city")); - return false; - } - return true; - } - - - public boolean callShuttle(obj_id self, obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - if (!wildLocation(player)) - { - return false; - } - - location loc = getLocation(player); - - obj_id shuttle = createObject("object/creature/npc/theme_park/lambda_shuttle.iff", loc); - - if (!isIdValid(shuttle)) - { - return false; - } - - groundquests.grantQuest(player, QUEST_NAME); - modifyCollectionSlotValue(player, "publish_chapter7_click_activation_01", 1); - - dictionary d = new dictionary(); - d.put("owner", player); - - attachScript(shuttle, "systems.collections.publish_gift.publish_gift_shuttle"); - - messageTo(shuttle, "startLandingSequence", d, 2.0f, false); - destroySelf(self); - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/collections/publish_gift/publish_gift_shuttle.java b/sku.0/sys.server/compiled/game/script/systems/collections/publish_gift/publish_gift_shuttle.java deleted file mode 100644 index e3a9c854e..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/collections/publish_gift/publish_gift_shuttle.java +++ /dev/null @@ -1,80 +0,0 @@ -package script.systems.collections.publish_gift; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - - -public class publish_gift_shuttle extends script.base_script -{ - public publish_gift_shuttle() - { - } - - public int startLandingSequence(obj_id self, dictionary params) throws InterruptedException - { - obj_id owner = params.getObjId("owner"); - - queueCommand(self, (-1114832209), self, "", COMMAND_PRIORITY_FRONT); - setPosture(self, POSTURE_PRONE); - playClientEffectObj(owner, "clienteffect/lambda_hover.cef", owner, ""); - - dictionary d = new dictionary(); - d.put("owner", owner); - - messageTo(self, "takeOff", d, 22.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int takeOff(obj_id self, dictionary params) throws InterruptedException - { - obj_id owner = params.getObjId("owner"); - - location loc = getLocation(self); - - dictionary d = new dictionary(); - d.put("owner", owner); - - messageTo(self, "warpPlayer", d, 1.0f, false); - messageTo(self, "startTakeOffSequence", d, 3.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int startTakeOffSequence(obj_id self, dictionary params) throws InterruptedException - { - queueCommand(self, (-1465754503), self, "", COMMAND_PRIORITY_FRONT); - setPosture(self, POSTURE_UPRIGHT); - - messageTo(self, "cleanUp", null, 20.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int cleanUp(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - - return SCRIPT_CONTINUE; - } - - - public int warpPlayer(obj_id self, dictionary params) throws InterruptedException - { - obj_id owner = params.getObjId("owner"); - - modifyCollectionSlotValue(owner, "publish_chapter7_click_activation_01", 1); - warpPlayer(owner, "tatooine", 3278, 5, -4821, null, 0, 0, 0, "", false); - setYaw(owner, 40); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/combat/combat_actions.java b/sku.0/sys.server/compiled/game/script/systems/combat/combat_actions.java deleted file mode 100644 index 341483986..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/combat/combat_actions.java +++ /dev/null @@ -1,19424 +0,0 @@ -package script.systems.combat; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.ai.ai_combat; -import script.library.ai_lib; -import script.library.bounty_hunter; -import script.library.armor; -import script.library.beast_lib; -import script.library.buff; -import script.library.callable; -import script.library.chat; -import script.library.colors; -import script.library.combat; -import script.library.corpse; -import script.library.craftinglib; -import script.library.create; -import script.library.dot; -import script.library.factions; -import script.library.faction_perk; -import script.library.grenade; -import script.library.groundquests; -import script.library.group; -import script.library.healing; -import script.library.innate; -import script.library.instance; -import script.library.locations; -import script.library.movement; -import script.library.performance; -import script.library.pet_lib; -import script.library.prose; -import script.library.smuggler; -import script.library.space_dungeon; -import script.library.space_utils; -import script.library.squad_leader; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; -import script.library.vehicle; -import script.library.weapons; -import script.library.heavyweapons; - -import script.systems.missions.dynamic.bounty_probe_droid; -import java.lang.Math; - - - -public class combat_actions extends script.systems.combat.combat_base -{ - public combat_actions() - { - } - String DEFAULT_EGG = "object/tangible/gravestone/gravestone05.tpf"; - public static final String COMBAT_TABLE = "datatables/combat/combat_data.iff"; - public static final float DAMAGE_STRENGTH_CUTOFF = .5f; - - - public int OnChangedPosture(obj_id self, int oldPosture, int newPosture) throws InterruptedException - { - - if (newPosture == POSTURE_INCAPACITATED || newPosture == POSTURE_DEAD || newPosture == POSTURE_KNOCKED_DOWN) - { - return SCRIPT_CONTINUE; - } - - setState(self, STATE_IMMOBILIZED, false); - stealth.OnPostureChanged(self, oldPosture, newPosture); - return SCRIPT_CONTINUE; - } - - - public int OnEnteredCombat(obj_id self) throws InterruptedException - { - combat.cacheCombatData(self); - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - combat.clearCachedCombatData(self); - return SCRIPT_CONTINUE; - } - - - public int firePistolLauncherTargeting(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("firePistolLauncherTargeting", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireAcidBeam(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireAcidBeam", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireLavaCannon(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireLavaCannon", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireLavaCannonGeneric(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireLavaCannonGeneric", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireFlameThrowerLight(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireFlameThrowerLight", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int firePlasmaFlameThrower(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("firePlasmaFlameThrower", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireIceGun(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireIceGun", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireRocketLauncher(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireRocketLauncher", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireRocketLauncherGeneric(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireRocketLauncherGeneric", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireAcidRifle(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireAcidRifle", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireStunCannon(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireStunCannon", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireParticleBeam(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireParticleBeam", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireVoidRocketLauncher(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireVoidRocketLauncher", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireLightningBeam(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireLightningBeam", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireAcidBeamAvatar(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireAcidBeamAvatar", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireRepublicFlameThrower(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireRepublicFlameThrower", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireRepublicFlameThrowerGeneric(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireRepublicFlameThrowerGeneric", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int firePistolLauncher(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("firePistolLauncher", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireElitePistolLauncher(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireElitePistolLauncher", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int firePistolLauncherGeneric(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("firePistolLauncherGeneric", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int firePistolLauncherMedium(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("firePistolLauncherMedium", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireCrusaderHeavyRifle(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireCrusaderHeavyRifle", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int firePvpHeavy(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("firePvpHeavy", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fireHeavyShotgun(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fireHeavyShotgun", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int banner_buff_commando(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("banner_buff_commando", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int stand(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (ai_lib.isAiDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (!isIncapacitated(self) && !isDead(self)) - { - setPosture(self, POSTURE_UPRIGHT); - } - return SCRIPT_CONTINUE; - } - - - public int standFail(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (space_utils.isInStation(self)) - { - LOG("space", "Leaving station!"); - queueCommand(self, (616891114), null,"", COMMAND_PRIORITY_FRONT); - - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kneel(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIncapacitated(self) && !isDead(self)) - { - setPosture(self, POSTURE_CROUCHED); - } - return SCRIPT_CONTINUE; - } - - - public int kneelFail(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int prone(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIncapacitated(self) && !isDead(self)) - { - setPosture(self, POSTURE_PRONE); - } - return SCRIPT_CONTINUE; - } - - - public int proneFail(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int veteranPlayerBuff(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("veteranPlayerBuff", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int forceRun(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("forceRun", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bh_detect_camouflage_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!stealth.canDetectCamouflage(self) || !combatStandardAction("bh_detect_camouflage_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float detectSkill = getEnhancedSkillStatisticModifier(self, "detect_hidden"); - float distance = stealth.BASE_DETECT_CAMOUFLAGE_DISTANCE + (detectSkill / 20); - - float detectChance = 50.0f; - - stealth.detectCamouflage(self, true, true, distance, detectChance); - - return SCRIPT_CONTINUE; - } - - - public int bh_ae_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_ae_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bh_ae_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_ae_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bh_del_cc_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_del_cc_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 1); - - return SCRIPT_CONTINUE; - } - - - public int bh_del_cc_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_del_cc_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 1); - - return SCRIPT_CONTINUE; - } - - - public int bh_del_cc_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_del_cc_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 1); - - return SCRIPT_CONTINUE; - } - - - public int bh_del_dm_cc_dot_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_del_dm_cc_dot_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 1); - - return SCRIPT_CONTINUE; - } - - - public int bh_del_dm_cc_dot_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_del_dm_cc_dot_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 1); - - return SCRIPT_CONTINUE; - } - - - public int bh_del_dm_cc_dot_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_del_dm_cc_dot_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 1); - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_dm_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_dm_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_dm_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_dm_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_dm_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_dm_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_dm_7"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_8(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_8", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_dm_8"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_dm") / 10; - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bh_flawless_strike(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_flawless_strike", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_flawless_strike"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_bh_flawless_strike"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int set_bonus_bh_utility_a_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("set_bonus_bh_utility_a_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int set_bonus_bh_utility_a_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("set_bonus_bh_utility_a_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int set_bonus_bh_utility_a_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("set_bonus_bh_utility_a_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public void doDireAbility(obj_id attacker, obj_id defender, int direType) throws InterruptedException - { - int bonusChance = 0; - - switch(direType) - { - case 0: - int direSnare = buff.getBuffOnTargetFromGroup(defender, "dire_snare"); - if (direSnare != 0) - { - return; - } - bonusChance = getEnhancedSkillStatisticModifierUncapped(attacker, "bh_dire_snare"); - break; - case 1: - bonusChance = getEnhancedSkillStatisticModifierUncapped(attacker, "bh_dire_root"); - break; - default: - return; - } - - if (bonusChance > 0) - { - int roll = rand(1, 99); - int total = roll+bonusChance; - - if (total > 99) - { - - if (direType == 0) - { - buff.applyBuff(defender, attacker, "bh_dire_snare_1"); - showFlyText(defender, new string_id("set_bonus", "dire_snare_fly"), 2, colors.BLACK); - } - else - { - queueCommand(attacker, (-2097394013), defender, "", COMMAND_PRIORITY_IMMEDIATE); - showFlyTextPrivate(attacker, attacker, new string_id("set_bonus", "dire_trap_fly"), 2, colors.LEMONCHIFFON); - } - } - } - return; - } - - - public boolean successfulFastAttack(obj_id attacker, String specialLine) throws InterruptedException - { - return successfulFastAttack(attacker, specialLine, "fast_attack_fly"); - } - - - public boolean successfulFastAttack(obj_id attacker, String specialLine, String customFlyReference) throws InterruptedException - { - boolean fastAttackOrWhat = false; - - int bonusChance = getEnhancedSkillStatisticModifierUncapped(attacker, "fast_attack_line_"+ specialLine); - - if (bonusChance > 0) - { - int roll = rand(1, 99); - int total = roll+bonusChance; - - if (total > 99) - { - fastAttackOrWhat = true; - showFlyText(attacker, new string_id("set_bonus", customFlyReference), 2, colors.LEMONCHIFFON); - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("set_bonus", customFlyReference + "_cbspam")); - pp = prose.setTT(pp, attacker); - sendCombatSpamMessageProse(attacker, pp, COMBAT_RESULT_GENERIC); - } - } - - return fastAttackOrWhat; - } - - - public int bh_dm_cc_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_cc_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - if (successfulFastAttack(self, "dm_cc")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_cc_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_cc_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - if (successfulFastAttack(self, "dm_cc")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_cc_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_cc_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - if (successfulFastAttack(self, "dm_cc")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_crit_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_crit_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_dm_crit_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_dm_crit") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bh_dm_crit_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_dm_crit_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("bh_dm_crit_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_dm_crit") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bh_sh_0(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("bh_sh_0", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bh_sh_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("bh_sh_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bh_sh_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("bh_sh_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bh_sh_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("bh_sh_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_kill_trap_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!stealth.canDisarmTrap(self, target)) - { - return SCRIPT_OVERRIDE; - } - - stealth.disarmTrap(self, target); - return SCRIPT_CONTINUE; - } - - - public int co_ae_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_ae_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_ae_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_ae_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_ae_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_ae_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_del_ae_cc_1_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_del_ae_cc_1_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "co_grenade")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int co_del_ae_cc_1_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_del_ae_cc_1_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "co_grenade")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int co_del_ae_cc_1_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_del_ae_cc_1_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "co_grenade")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int sm_feeling_lucky_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "sm_feeling_lucky_recourse")) - { - buff.applyBuff(self, self, "sm_feeling_lucky_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int sm_lucky_break_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "sm_lucky_break_recourse")) - { - buff.applyBuff(self, self, "sm_lucky_break_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int sm_double_fire_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "sm_double_fire_recourse")) - { - buff.applyBuff(self, self, "sm_double_fire_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int sm_false_hope_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "sm_false_hope_recourse")) - { - buff.applyBuff(self, self, "sm_false_hope_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int sm_break_the_deal_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "sm_break_the_deal_recourse")) - { - buff.applyBuff(self, self, "sm_break_the_deal_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int sm_melee_stun_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "sm_melee_stun_recourse")) - { - buff.applyBuff(self, self, "sm_melee_stun_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int maladyRecourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "insidiousMalady_1")) - { - buff.applyBuff(self, self, "insidiousMalady_1"); - } - - return SCRIPT_CONTINUE; - } - - - public int maladyRecourse_1(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "insidiousMalady_2")) - { - buff.applyBuff(self, self, "insidiousMalady_2"); - } - - return SCRIPT_CONTINUE; - } - - public int maladyRecourse_2(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "insidiousMalady_3")) - { - buff.applyBuff(self, self, "insidiousMalady_3"); - } - - return SCRIPT_CONTINUE; - } - - public int maladyRecourse_3(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "insidiousMalady_4")) - { - buff.applyBuff(self, self, "insidiousMalady_4"); - } - - return SCRIPT_CONTINUE; - } - - - public int co_del_ae_cc_2_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_del_ae_cc_2_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "co_grenade")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int co_del_ae_cc_2_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_del_ae_cc_2_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "co_grenade")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int co_del_ae_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_del_ae_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "co_grenade")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int co_del_ae_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_del_ae_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "co_grenade")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int co_del_ae_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_del_ae_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "co_grenade")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int co_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_dm_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_dm_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_dm_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_dm_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_dm_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_dm_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_dm_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_dm_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_dm_8(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_dm_8", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_fld_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_fld_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - - } - - return SCRIPT_CONTINUE; - } - - - public int co_fld_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_fld_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - - } - - return SCRIPT_CONTINUE; - } - - - public int co_shock_tracer_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_shock_tracer_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_shock_tracer_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_shock_tracer_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_shock_tracer_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_shock_tracer_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_shock_tracer_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_shock_tracer_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_shock_grenade_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_shock_grenade_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_shock_grenade_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_shock_grenade_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_shock_grenade_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_shock_grenade_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_shock_grenade_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_shock_grenade_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_enrage_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (buff.hasBuff(self, "cloning_sickness")) - { - sendSystemMessage(self, new string_id("spam", "not_well_enough") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("co_enrage_1", self, target, params, "", "") || !buff.hasBuff(self, "set_bonus_commando_utility_a_3")) - { - return SCRIPT_OVERRIDE; - } - - int healthCost = (int)dataTableGetFloat(COMBAT_TABLE, "co_enrage_1", "healthCost"); - - int currentHealth = getHealth(self); - int modifiedHealth = currentHealth - healthCost; - - attrib_mod[] healthMods = getHealthModifiers(self); - int healthModsValue = 0; - - for (int i = 0; i < healthMods.length; i++) - { - testAbortScript(); - healthModsValue += healthMods[i].getValue(); - } - - if (healthModsValue < 0) - { - sendSystemMessage(self, new string_id("spam", "not_well_enough") ); - return SCRIPT_OVERRIDE; - } - - if (modifiedHealth < 1) - { - showFlyTextPrivate(self, self, new string_id("spam", "low_health"), 1.0f, colors.RED); - return SCRIPT_OVERRIDE; - } - - setHealth(self, modifiedHealth); - incrementKillMeter(self, 10); - - playClientEffectObj(self, "clienteffect/medic_reckless_stimulation.cef", self, "root"); - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("set_bonus", "enraged_cmb_spam")); - pp = prose.setTT(pp, self); - sendCombatSpamMessageProse(self, pp, COMBAT_RESULT_GENERIC); - - return SCRIPT_CONTINUE; - } - - - public int co_stand_fast(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_stand_fast", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("co_stand_fast"); - LOG ("stand_fast", "baseCooldownTime is "+ baseCooldownTime); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_co_stand_fast"); - LOG ("stand_fast", "cooldownTimeMod is "+ cooldownTimeMod); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int eggDetonated(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar(self, "objEgg"); - - return SCRIPT_CONTINUE; - } - - - public boolean hasEgg(obj_id player) throws InterruptedException - { - obj_id egg = utils.getObjIdScriptVar(player, "objEgg"); - - if (isValidId(egg) && utils.hasScriptVar(egg, "objOwner")) - { - return true; - } - else - { - return false; - } - } - - - public boolean detonateEgg(obj_id self, boolean eggCreated) throws InterruptedException - { - - if (eggCreated && hasEgg(self)) - { - dictionary particleParams = new dictionary(); - dictionary attackParams = new dictionary(); - - obj_id objEgg = utils.getObjIdScriptVar(self, "objEgg"); - - particleParams = utils.getDictionaryScriptVar(objEgg, "handleDelayedParticle"); - attackParams = utils.getDictionaryScriptVar(objEgg, "handleDelayedAttack"); - - messageTo(objEgg, "handleDelayedParticle", particleParams, 0, false); - messageTo(objEgg, "handleDelayedAttack", attackParams, 0, false); - - utils.removeScriptVar(self, "objEgg"); - - return true; - } - - return false; - } - - - public int co_remote_detonator_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - boolean eggCreated = hasEgg(self); - - if (!eggCreated && !combatStandardAction("co_remote_detonator_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (!eggCreated && hasEgg(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!detonateEgg(self, eggCreated)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_remote_detonator_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - boolean eggCreated = hasEgg(self); - - if (!eggCreated && !combatStandardAction("co_remote_detonator_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (!eggCreated && hasEgg(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!detonateEgg(self, eggCreated)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_remote_detonator_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - boolean eggCreated = hasEgg(self); - - if (!eggCreated && !combatStandardAction("co_remote_detonator_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (!eggCreated && hasEgg(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!detonateEgg(self, eggCreated)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_remote_detonator_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - boolean eggCreated = hasEgg(self); - - if (!eggCreated && !combatStandardAction("co_remote_detonator_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (!eggCreated && hasEgg(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!detonateEgg(self, eggCreated)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_remote_detonator_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - boolean eggCreated = hasEgg(self); - - if (!eggCreated && !combatStandardAction("co_remote_detonator_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (!eggCreated && hasEgg(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!detonateEgg(self, eggCreated)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_sh_0(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("co_sh_0", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_sh_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("co_sh_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_sh_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("co_sh_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_sh_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("co_sh_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_stim_armor(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_stim_armor", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kill_meter_co_it_burns_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kill_meter_co_it_burns_proc", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kill_meter_co_armor_splash_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kill_meter_co_armor_splash_proc", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kill_meter_co_youll_regret_that_reac(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kill_meter_co_youll_regret_that_reac", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int expertise_co_burst_fire_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("expertise_co_burst_fire_proc", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_position_secured(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (buff.toggleStance(self, "co_position_secured")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("co_position_secured", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - vehicle.storeAllVehicles(self); - - showFlyText(self, new string_id("spam", "co_position_secured"), 2, colors.LEMONCHIFFON); - - return SCRIPT_CONTINUE; - } - - - public int co_suppressing_fire(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_suppressing_fire", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_riddle_armor(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_riddle_armor", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("co_riddle_armor"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_co_riddle_armor"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int co_armor_cracker(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_armor_cracker", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("co_armor_cracker"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_co_riddle_armor"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int ofAggroChannel(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!group.inSameGroup(self, target) || target == self) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_aggro_channel", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_mirror_armor(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_mirror_armor", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - combat.mirrorArmor(self); - - return SCRIPT_CONTINUE; - } - - - public int en_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("en_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int en_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("en_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int en_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("en_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int en_dm_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("en_dm_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int en_dm_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("en_dm_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int en_dm_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("en_dm_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int en_dm_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("en_dm_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int en_dm_8(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("en_dm_8", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int en_sh_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("en_sh_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int en_sh_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("en_sh_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int en_sh_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("en_sh_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bh_conceal_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bh_conceal_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_conceal_device_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_conceal_device_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sp_neutralize_device_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!stealth.canDisarmTrap(self, target)) - { - return SCRIPT_OVERRIDE; - } - - stealth.disarmTrap(self, target); - return SCRIPT_CONTINUE; - } - - - public int sp_hide_device_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sp_hide_device_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_saber_reflect_buff(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInStance(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_stance")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_saber_reflect_buff", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_saber_reflect(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInStance(self) || !buff.hasBuff(self, "fs_saber_reflect")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_saber_reflect", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - showFlyTextPrivate(self, self, new string_id("combat_effects", "saber_reflect"), 1.5f, colors.ORANGERED); - - return SCRIPT_CONTINUE; - } - - - public int saberBlock(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("saberBlock", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_sense_danger_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!stealth.canDetectCamouflage(self) || !combatStandardAction("fs_sense_danger_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float detectSkill = getEnhancedSkillStatisticModifier(self, "detect_hidden"); - float distance = stealth.BASE_DETECT_CAMOUFLAGE_DISTANCE + (detectSkill / 20); - - float detectChance = 50.0f; - - stealth.detectCamouflage(self, true, true, distance, detectChance); - return SCRIPT_CONTINUE; - } - - - public int fs_forsake_fear(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInStance(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_stance")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_forsake_fear", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - string_id promptString = new string_id("healing", "fs_forsake_fear_channel"); - - int flags = sui.CD_EVENT_INCAPACITATE; - - int pid = sui.smartCountdownTimerSUI(self, self, "channelForsakeFearCountdown", promptString, 0, 10, "channelForsakeFearCountdownHandler", 1f, flags); - - utils.setScriptVar(self, "buff_handler.ForsakeFearSUIPID", pid); - - dictionary parms = new dictionary(); - - parms.put("player", self); - parms.put("buffName", "fs_forsake_fear"); - - messageTo(self, "checkChannelForsakeFear", parms, 1, false); - - return SCRIPT_CONTINUE; - } - - - public int fs_force_spark(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_force_spark", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_ae_dm_cc_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_ae_dm_cc_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_ae_dm_cc_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_ae_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_ae_dm_cc_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_ae_dm_cc_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_ae_dm_cc_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_ae_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_ae_dm_cc_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_ae_dm_cc_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_ae_dm_cc_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_ae_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_ae_dm_cc_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_ae_dm_cc_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_ae_dm_cc_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_ae_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_ae_dm_cc_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_ae_dm_cc_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_ae_dm_cc_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_ae_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_ae_dm_cc_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_ae_dm_cc_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_ae_dm_cc_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_ae_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_maelstrom_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_maelstrom_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int fs_maelstrom_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_maelstrom_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int fs_maelstrom_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_maelstrom_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int fs_maelstrom_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_maelstrom_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int fs_maelstrom_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_maelstrom_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int fs_buff_ca_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (buff.toggleStance(self, "fs_buff_ca_1")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_buff_ca_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_buff_def_1_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (buff.toggleStance(self, "fs_buff_def_1_1")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_buff_def_1_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_flurry_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_flurry_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_flurry_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_flurry_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int fs_flurry_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_flurry_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int fs_flurry_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_flurry_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int fs_flurry_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_flurry_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int fs_flurry_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_flurry_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int fs_flurry_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_flurry_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int fs_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_7"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_sweep_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_sweep_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_sweep_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_sweep") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_sweep_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_sweep_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_sweep_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_sweep") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_sweep_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_sweep_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_sweep_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_sweep") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_sweep_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_sweep_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_sweep_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_sweep") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_sweep_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_sweep_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_sweep_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_sweep") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_sweep_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_sweep_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_sweep_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_sweep") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_sweep_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_sweep_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_sweep_7"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_sweep") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_mind_trick_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_mind_trick_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - ai_lib.mindTrick(self, target); - - return SCRIPT_CONTINUE; - } - - - public int fs_mind_trick_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_mind_trick_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - combat_data actionData = combat_engine.getCombatData("fs_mind_trick_2"); - float actionRadius = actionData.coneLength; - - actionRadius += getEnhancedSkillStatisticModifierUncapped(self, "expertise_area_size_single_fs_mind_trick_2"); - - obj_id[] defenders = pvpGetTargetsInRange(self, target, actionRadius); - - for (int i = 0; i < defenders.length; i++) - { - testAbortScript(); - ai_lib.mindTrick(self, defenders[i]); - } - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_cc_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_dm_cc_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_cc_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_dm_cc_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_cc_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_dm_cc_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_cc_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_dm_cc_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_cc_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_dm_cc_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int fs_dm_cc_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_dm_cc_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_cc_crit_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_cc_crit_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_cc_crit_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_cc_crit") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_cc_crit_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_cc_crit_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_cc_crit_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_cc_crit") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_cc_crit_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_cc_crit_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_cc_crit_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_cc_crit") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_cc_crit_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_cc_crit_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_cc_crit_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_cc_crit") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_dm_cc_crit_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("fs_dm_cc_crit_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "fs_powers", "fury_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("fs_dm_cc_crit_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_fs_cc_crit") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int fs_sh_0(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_sh_0", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_sh_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_sh_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_sh_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_sh_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_sh_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_sh_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_hermetic_touch(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!buff.isInStance(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_hermetic_touch", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_set_heroic_taunt_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!buff.hasBuff(self, "set_bonus_jedi_utility_b_3")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_set_heroic_taunt_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_ae_heal_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_ae_heal_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_ae_heal_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_ae_heal_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_ae_heal_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_ae_heal_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_ae_heal_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_ae_heal_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_ae_heal_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_ae_heal_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_ae_heal_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_ae_heal_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_buff_health_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_health")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_buff_health_1", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_dm_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_dm_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_dm_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_dm_8(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_8", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_dm_dot_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_dot_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - float baseCooldownTime = getBaseCooldownTime("me_dm_dot_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_dot"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int me_dm_dot_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_dot_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - float baseCooldownTime = getBaseCooldownTime("me_dm_dot_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_dot"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int me_dm_dot_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_dot_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - float baseCooldownTime = getBaseCooldownTime("me_dm_dot_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_dot"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int me_dm_dot_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_dot_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - float baseCooldownTime = getBaseCooldownTime("me_dm_dot_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_dot"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int me_dm_dot_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_dot_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - float baseCooldownTime = getBaseCooldownTime("me_dm_dot_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_dot"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int me_dm_dot_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_dm_dot_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - float baseCooldownTime = getBaseCooldownTime("me_dm_dot_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_dot"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - public int me_fld_dm_dot_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_fld_dm_dot_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("me_fld_dm_dot_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_dot"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int me_fld_dm_dot_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_fld_dm_dot_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("me_fld_dm_dot_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_dot"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int me_fld_dm_dot_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_fld_dm_dot_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("me_fld_dm_dot_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_dot"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int me_hot_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_hot_1", false)) - { - target = self; - } - - if (!combatStandardAction("me_hot_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_hot_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_hot_2", false)) - { - target = self; - } - - if (!combatStandardAction("me_hot_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_hot_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_hot_3", false)) - { - target = self; - } - - if (!combatStandardAction("me_hot_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_sh_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_sh_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_rv_ooc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_rv_ooc", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_revive", "quick_revive_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("me_rv_ooc"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_revive"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int me_rv_area(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_rv_area", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_revive", "quick_revive_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("me_rv_area"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_revive"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int me_rv_combat(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!combatStandardAction("me_rv_combat", self, self, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_revive", "quick_revive_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("me_rv_combat"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_aoe_revive"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod * 60) ); - - return SCRIPT_CONTINUE; - } - - - public int me_rv_pvp_single(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || space_dungeon.isInSpaceDungeon(self) || instance.isInInstanceArea(self) || !utils.hasScriptVar(target, "pvp_death")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_rv_pvp_single", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_revive", "quick_revive_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("me_rv_pvp_single"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_revive"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int me_rv_pvp_area(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (space_dungeon.isInSpaceDungeon(self) || instance.isInInstanceArea(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_rv_pvp_area", self, self, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_revive", "quick_revive_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("me_rv_pvp_area"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_aoe_revive"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod * 60) ); - - return SCRIPT_CONTINUE; - } - - - public int me_drag_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!group.isGrouped(self)) - { - sendSystemMessage(self, new string_id("spam", "drag_not_grouped") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_drag_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - corpse.dragPlayerCorpse(self, corpse.getDraggableCorpsesInRange(self, true) ); - - return SCRIPT_CONTINUE; - } - - - public int me_blood_cleaners_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.hasBuff(target, "incapWeaken")) - { - if (target == self) - { - sendSystemMessage(self, new string_id("spam", "remove_weakness_self_fail") ); - } - else - { - sendSystemMessage(self, new string_id("spam", "remove_weakness_other_fail") ); - } - - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_blood_cleaners_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - buff.removeBuff(target, "incapWeaken"); - playClientEffectObj(target, "appearance/pt_heal_2.prt", target, "root"); - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_bomb_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_bomb_1", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_bomb_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_bomb_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_bomb_2", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_bomb_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_bomb_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_bomb_3", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_bomb_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_bomb_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_bomb_4", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_bomb_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_bomb_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_bomb_5", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_bomb_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_ampule_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_ampule_1", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_ampule_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_ampule_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_ampule_2", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_ampule_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_ampule_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_ampule_3", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_ampule_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_ampule_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_ampule_4", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_ampule_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_ampule_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_ampule_5", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_ampule_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_ampule_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_ampule_6", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_ampule_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_cure_affliction_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!combatStandardAction("me_cure_affliction_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_serotonin_boost_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!combatStandardAction("me_serotonin_boost_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_grenade_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_grenade_1", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_grenade_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_grenade_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_grenade_2", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_grenade_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_grenade_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_grenade_3", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_grenade_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_grenade_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_grenade_4", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_grenade_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_grenade_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target) || !isInAttackRange(self, target, "me_bacta_bomb_5", false)) - { - target = self; - } - - if (!combatStandardAction("me_bacta_grenade_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (target != self && pvpCanHelp(self, target) && successfulFastAttack(self, "me_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_action_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_action_1")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_action_1", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_action_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_action_2")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_action_2", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_action_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_action_3")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_action_3", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_reckless_stimulation_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (hasFullActionPool(self)) - { - showFlyTextPrivate(self, self, new string_id("spam", "full_action_pool"), 2, colors.LEMONCHIFFON); - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(self, "cloning_sickness")) - { - sendSystemMessage(self, new string_id("spam", "not_well_enough") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_reckless_stimulation_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int healthCost = (int)dataTableGetFloat(COMBAT_TABLE, "me_reckless_stimulation_1", "healthCost"); - int actionGain = dataTableGetInt(COMBAT_TABLE, "me_reckless_stimulation_1", "addedDamage"); - - healthToActionConversion(self, healthCost, actionGain); - - return SCRIPT_CONTINUE; - } - - - public int me_reckless_stimulation_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (hasFullActionPool(self)) - { - showFlyTextPrivate(self, self, new string_id("spam", "full_action_pool"), 2, colors.LEMONCHIFFON); - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(self, "cloning_sickness")) - { - sendSystemMessage(self, new string_id("spam", "not_well_enough") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_reckless_stimulation_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int healthCost = (int)dataTableGetFloat(COMBAT_TABLE, "me_reckless_stimulation_2", "healthCost"); - int actionGain = dataTableGetInt(COMBAT_TABLE, "me_reckless_stimulation_2", "addedDamage"); - - healthToActionConversion(self, healthCost, actionGain); - - return SCRIPT_CONTINUE; - } - - - public int me_reckless_stimulation_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (hasFullActionPool(self)) - { - showFlyTextPrivate(self, self, new string_id("spam", "full_action_pool"), 2, colors.LEMONCHIFFON); - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(self, "cloning_sickness")) - { - sendSystemMessage(self, new string_id("spam", "not_well_enough") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_reckless_stimulation_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int healthCost = (int)dataTableGetFloat(COMBAT_TABLE, "me_reckless_stimulation_3", "healthCost"); - int actionGain = dataTableGetInt(COMBAT_TABLE, "me_reckless_stimulation_3", "addedDamage"); - - healthToActionConversion(self, healthCost, actionGain); - - return SCRIPT_CONTINUE; - } - - - public int me_reckless_stimulation_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (hasFullActionPool(self)) - { - showFlyTextPrivate(self, self, new string_id("spam", "full_action_pool"), 2, colors.LEMONCHIFFON); - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(self, "cloning_sickness")) - { - sendSystemMessage(self, new string_id("spam", "not_well_enough") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_reckless_stimulation_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int healthCost = (int)dataTableGetFloat(COMBAT_TABLE, "me_reckless_stimulation_4", "healthCost"); - int actionGain = dataTableGetInt(COMBAT_TABLE, "me_reckless_stimulation_4", "addedDamage"); - - healthToActionConversion(self, healthCost, actionGain); - return SCRIPT_CONTINUE; - } - - - public int me_reckless_stimulation_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (hasFullActionPool(self)) - { - showFlyTextPrivate(self, self, new string_id("spam", "full_action_pool"), 2, colors.LEMONCHIFFON); - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(self, "cloning_sickness")) - { - sendSystemMessage(self, new string_id("spam", "not_well_enough") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_reckless_stimulation_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int healthCost = (int)dataTableGetFloat(COMBAT_TABLE, "me_reckless_stimulation_5", "healthCost"); - int actionGain = dataTableGetInt(COMBAT_TABLE, "me_reckless_stimulation_5", "addedDamage"); - - healthToActionConversion(self, healthCost, actionGain); - - return SCRIPT_CONTINUE; - } - - - public int me_reckless_stimulation_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (hasFullActionPool(self)) - { - showFlyTextPrivate(self, self, new string_id("spam", "full_action_pool"), 2, colors.LEMONCHIFFON); - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(self, "cloning_sickness")) - { - sendSystemMessage(self, new string_id("spam", "not_well_enough") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_reckless_stimulation_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int healthCost = (int)dataTableGetFloat(COMBAT_TABLE, "me_reckless_stimulation_6", "healthCost"); - int actionGain = dataTableGetInt(COMBAT_TABLE, "me_reckless_stimulation_6", "addedDamage"); - - healthToActionConversion(self, healthCost, actionGain); - - return SCRIPT_CONTINUE; - } - - - public int me_stasis_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - int stasisBuff = buff.getBuffOnTargetFromGroup(target, "stasis"); - if (stasisBuff != 0) - { - return SCRIPT_OVERRIDE; - } - - if (!buff.canApplyBuff(target, "me_stasis_1")) - { - return SCRIPT_OVERRIDE; - } - - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - obj_id testTarget = getIntendedTarget(self); - - if ((isIdValid(testTarget) && ( (group.inSameGroup(self, testTarget) && pvpCanHelp(self, testTarget) ) || pvpCanAttack(self, testTarget) ) )) - { - target = testTarget; - } - else - { - return SCRIPT_OVERRIDE; - } - - if (getDistance(self, target) > 48.0f) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_stasis_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - buff.applyBuff(target, self, "me_stasis_1"); - - return SCRIPT_CONTINUE; - } - - - public int me_stasis_self_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - int stasisBuff = buff.getBuffOnTargetFromGroup(self, "stasis"); - if (stasisBuff != 0) - { - return SCRIPT_OVERRIDE; - } - - if (!buff.canApplyBuff(self, "me_stasis_self_1")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_stasis_self_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("me_stasis_self_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_stasis_self"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod*60) ); - - return SCRIPT_CONTINUE; - } - - - public int me_serotonin_purge_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_serotonin_purge_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_induce_insanity_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_induce_insanity_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - if (successfulFastAttack(self, "me_debuff", "fast_attack_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_bacta_resistance_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_bacta_resistance_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - if (successfulFastAttack(self, "me_debuff", "fast_attack_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_electrolyte_drain_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_electrolyte_drain_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - if (successfulFastAttack(self, "me_debuff", "fast_attack_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_traumatize_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(target, "action_drain_immunity")) - { - sendSystemMessage(self, new string_id("spam", "immune_to_that") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_traumatize_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_debuff", "fast_attack_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_traumatize_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(target, "action_drain_immunity")) - { - sendSystemMessage(self, new string_id("spam", "immune_to_that") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_traumatize_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_debuff", "fast_attack_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_traumatize_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(target, "action_drain_immunity")) - { - sendSystemMessage(self, new string_id("spam", "immune_to_that") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_traumatize_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_debuff", "fast_attack_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_traumatize_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(target, "action_drain_immunity")) - { - sendSystemMessage(self, new string_id("spam", "immune_to_that") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_traumatize_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "me_debuff", "fast_attack_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_traumatize_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(target, "action_drain_immunity")) - { - sendSystemMessage(self, new string_id("spam", "immune_to_that") ); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_traumatize_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - if (successfulFastAttack(self, "me_debuff", "fast_attack_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_thyroid_rupture_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (vehicle.isVehicle(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("me_thyroid_rupture_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDoom(self, target); - - if (successfulFastAttack(self, "me_debuff", "fast_attack_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_strength_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_strength_1")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_strength_1", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_strength_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_strength_2")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_strength_2", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_strength_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_strength_3")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_strength_3", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_burst_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_burst_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_burst_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_burst_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_burst_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_burst_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_burst_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_burst_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_burst_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_burst_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_agility_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_agility_1")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_agility_1", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_agility_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_agility_2")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_agility_2", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_agility_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_agility_3")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_agility_3", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_cranial_smash_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_cranial_smash_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_cranial_smash_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_cranial_smash_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_cranial_smash_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_cranial_smash_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_cranial_smash_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_cranial_smash_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_cranial_smash_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_cranial_smash_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_evasion_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("me_evasion_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doMedicEvasion(self); - - float baseCooldownTime = getBaseCooldownTime("me_evasion_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_me_evasion"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_precision_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_precision_1")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_precision_1", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_precision_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_precision_2")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_precision_2", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_precision_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_precision_3")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_precision_3", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_block_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_melee_gb_1")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_block_1", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_enhance_dodge_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_ranged_gb_1")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(target) || !pvpCanHelp(self, target)) - { - target = self; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_enhance_dodge_1", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_buff_health_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_health_0")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_buff_health_2", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int me_buff_health_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target) || !pvpCanHelp(self, target) || vehicle.isVehicle(target) || isDead(target)) - { - target = self; - } - - if (!buff.canApplyBuff(target, "me_buff_health_2")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - boolean performed_buff = performMedicGroupBuff(self, target, "me_buff_health_3", params); - - if (!performed_buff) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int expertise_dueterium_rounds_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("expertise_dueterium_rounds_proc", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int expertise_poison_knuckle_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("expertise_poison_knuckle_proc", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public void doDoom(obj_id attacker, obj_id defender) throws InterruptedException - { - int bonusChance = getEnhancedSkillStatisticModifierUncapped(attacker, "me_doom_chance"); - - if (bonusChance > 0) - { - int roll = rand(1, 99); - int total = roll+bonusChance; - - if (roll + bonusChance > 99 && !utils.hasScriptVar(defender, "me_doom.doom_owner")) - { - utils.setScriptVar(defender, "me_doom.doom_owner", attacker); - utils.setScriptVar(defender, "me_doom.doom_stage", 1); - - buff.applyBuff(defender, attacker, "me_doom", 18.0f, 1.0f); - - if (hasCommand(attacker, "me_bacta_resistance_1")) - { - buff.applyBuff(defender, attacker, "me_bacta_resistance_1"); - } - - if (hasCommand(attacker, "me_electrolyte_drain_1")) - { - buff.applyBuff(defender, attacker, "me_electrolyte_drain_1"); - } - - if (hasCommand(attacker, "me_induce_insanity_1")) - { - buff.applyBuff(defender, attacker, "me_rheumatic_calamity_1"); - } - - if (hasCommand(attacker, "me_thyroid_rupture_1")) - { - buff.applyBuff(defender, attacker, "me_thyroid_rupture_1"); - } - } - } - - return; - } - - - public int of_buff_def_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_buff_def_1")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_buff_def_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_buff_def_1"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_buff_def_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_buff_def_2")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_buff_def_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_buff_def_2"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_buff_def_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_buff_def_3")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_buff_def_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_buff_def_3"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_deb_def_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_deb_def_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_deb_def_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_paint"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_deb_def_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_deb_def_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_deb_def_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_paint"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_deb_def_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_deb_def_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_deb_def_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_paint"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_ae_dm_cc_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_ae_dm_cc_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "of_aoe")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int of_ae_dm_cc_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_ae_dm_cc_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "of_aoe")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int of_ae_dm_cc_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_ae_dm_cc_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "of_aoe")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_del_ae_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (getTopMostContainer(self) != self) - { - sendSystemMessage(self, new string_id("spam", "cant_do_indoors")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_del_ae_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - prose_package p = prose.getPackage(new string_id("spam", "artillery_coming")); - commPlayers(self, "object/mobile/npe/npe_hutt_minion.iff", "sound/sys_comm_other.snd", 5f, self, p); - - if (successfulFastAttack(self, "of_aoe")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int of_del_ae_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (getTopMostContainer(self) != self) - { - sendSystemMessage(self, new string_id("spam", "cant_do_indoors")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_del_ae_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - prose_package p = prose.getPackage(new string_id("spam", "hailfire_coming")); - commPlayers(self, "object/mobile/npe/npe_hutt_minion.iff", "sound/sys_comm_other.snd", 5f, self, p); - playClientEffectLoc(self, "clienteffect/combat_pt_aerialstrike.cef", getLocation(target), 0); - - if (successfulFastAttack(self, "of_aoe")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int of_del_ae_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (getTopMostContainer(self) != self) - { - sendSystemMessage(self, new string_id("spam", "cant_do_indoors")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_del_ae_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - prose_package p = prose.getPackage(new string_id("spam", "orbitalstrike_coming")); - commPlayers(self, "object/mobile/npe/npe_hutt_minion.iff", "sound/sys_comm_other.snd", 5f, self, p); - playClientEffectLoc(self, "clienteffect/combat_pt_orbitalstrike.cef", getLocation(target), 0); - - if (successfulFastAttack(self, "of_aoe")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_del_ae_dm_dot_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_del_ae_dm_dot_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "of_aoe")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int of_del_ae_dm_dot_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_del_ae_dm_dot_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "of_aoe")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int of_del_ae_dm_dot_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_del_ae_dm_dot_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "of_aoe")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_del_ae_dot_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_del_ae_dot_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "of_aoe")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - } - - return SCRIPT_CONTINUE; - } - - - public int of_pistol_dm(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_pistol_dm", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int level = getLevel(self); - if (level >= 74) - { - doInspiredAction(self); - } - - return SCRIPT_CONTINUE; - } - - - public int of_pistol_bleed(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_pistol_bleed", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int level = getLevel(self); - if (level >= 74) - { - doInspiredAction(self); - } - - return SCRIPT_CONTINUE; - } - - - public int of_rally_point_off(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - location eggLoc = combat.getCommandGroundTargetLocation(params); - - location myLoc = getLocation(self); - - float distance = getDistance(myLoc, eggLoc); - - obj_id objEgg = createObject("object/tangible/space/content_infrastructure/generic_egg_small.iff", eggLoc); - - if (!isIdValid(objEgg)) - { - return SCRIPT_OVERRIDE; - } - - utils.setScriptVar(objEgg, "objOwner", self); - utils.setScriptVar(self, "objEgg", objEgg); - utils.setScriptVar(objEgg, "triggerBuff", "of_rally_point_off"); - int duration = combat.EGG_AURA_DURATION; - duration += (int)getEnhancedSkillStatisticModifierUncapped(self, "rally_point_duration"); - utils.setScriptVar(objEgg, "triggerDuration", duration); - utils.setScriptVar(objEgg, "triggerPrt", "appearance/pt_rally_point_red.prt"); - - attachScript(objEgg, "systems.combat.combat_trigger_area"); - - combat_data cData = combat_engine.getCombatData("of_rally_point_off"); - obj_id weapon = getCurrentWeapon(self); - weapon_data wData = getWeaponData(weapon); - - int[] actionCost = combat.getActionCost(self, wData, cData); - - combat.drainCombatActionAttributes(self, actionCost); - - float baseCooldownTime = getBaseCooldownTime("of_rally_point_off"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - if (group.isGrouped(self)) - { - obj_id groupId = getGroupObject(self); - obj_id[] members = getGroupMemberIds(groupId); - prose_package pp = new prose_package(); - - prose.setStringId(pp, new string_id("squad_leader", "of_set_rally_point")); - prose.setTT(pp, self); - - if (members != null && members.length > 0) - { - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - combat.sendCombatSpamMessageProse(members[i], pp); - } - } - squad_leader.sendSquadLeaderCommand( self, "Rallypoint has been set!"); - } - else - { - combat.sendCombatSpamMessage(self, new string_id("squad_leader", "self_set_rally_point")); - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_rally_point_def(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - location eggLoc = combat.getCommandGroundTargetLocation(params); - - location myLoc = getLocation(self); - - float distance = getDistance(myLoc, eggLoc); - - obj_id objEgg = createObject("object/tangible/space/content_infrastructure/generic_egg_small.iff", eggLoc); - - if (!isIdValid(objEgg)) - { - return SCRIPT_OVERRIDE; - } - - utils.setScriptVar(objEgg, "objOwner", self); - utils.setScriptVar(self, "objEgg", objEgg); - utils.setScriptVar(objEgg, "triggerBuff", "of_rally_point_def"); - int duration = combat.EGG_AURA_DURATION; - duration += (int)getEnhancedSkillStatisticModifierUncapped(self, "rally_point_duration"); - utils.setScriptVar(objEgg, "triggerDuration", duration); - utils.setScriptVar(objEgg, "triggerPrt", "appearance/pt_rally_point_blue.prt"); - - attachScript(objEgg, "systems.combat.combat_trigger_area"); - - combat_data cData = combat_engine.getCombatData("of_rally_point_def"); - obj_id weapon = getCurrentWeapon(self); - weapon_data wData = getWeaponData(weapon); - - int[] actionCost = combat.getActionCost(self, wData, cData); - - combat.drainCombatActionAttributes(self, actionCost); - - float baseCooldownTime = getBaseCooldownTime("of_rally_point_def"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - if (group.isGrouped(self)) - { - obj_id groupId = getGroupObject(self); - obj_id[] members = getGroupMemberIds(groupId); - prose_package pp = new prose_package(); - - prose.setStringId(pp, new string_id("squad_leader", "of_set_rally_point")); - prose.setTT(pp, self); - - if (members != null && members.length > 0) - { - for (int i = 0; i < members.length; ++i) - { - testAbortScript(); - combat.sendCombatSpamMessageProse(members[i], pp); - } - } - squad_leader.sendSquadLeaderCommand( self, "Rallypoint has been set!"); - } - else - { - combat.sendCombatSpamMessage(self, new string_id("squad_leader", "self_set_rally_point")); - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_dm_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sure"); - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_dm_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sure"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_dm_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sure"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_dm_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_dm_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_dm_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sure"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_dm_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_dm_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_dm_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sure"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_dm_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_dm_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_dm_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sure"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_dm_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_dm_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_dm_7"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sure"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_dm_8(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_dm_8", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_dm_8"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sure"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_sh_0(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_sh_0", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "of_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("of_sh_0"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_heal"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_sh_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_sh_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "of_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("of_sh_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_heal"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_sh_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_sh_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "of_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("of_sh_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_heal"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_sh_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_sh_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doInspiredAction(self); - - if (successfulFastAttack(self, "of_heal", "quick_heal_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("of_sh_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_heal"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_drop_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_drop_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 0)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_drop_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_buff_def_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_buff_def_4")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_buff_def_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_buff_def_4"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_buff_def_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_buff_def_5")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_buff_def_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_buff_def_5"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_buff_def_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_buff_def_6")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_buff_def_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_buff_def_6"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_buff_def_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_buff_def_7")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_buff_def_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_buff_def_7"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_buff_def_8(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_buff_def_8")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_buff_def_8", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_buff_def_8"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_buff_def_9(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_buff_def_9")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_buff_def_9", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_buff_def_9"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_focus_fire_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_focus_fire_1")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_focus_fire_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_focus_fire_1"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_focus_fire_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_focus_fire_2")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_focus_fire_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_focus_fire_2"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_focus_fire_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_focus_fire_3")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_focus_fire_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_focus_fire_3"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_focus_fire_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_focus_fire_4")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_focus_fire_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_focus_fire_4"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_focus_fire_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_focus_fire_5")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_focus_fire_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_focus_fire_5"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_focus_fire_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.canApplyBuff(self, "of_focus_fire_6")) - { - sendSystemMessage(self, new string_id("spam", "buff_wont_stack") ); - sendCombatSpamMessage(self, new string_id("spam", "buff_wont_stack"), COMBAT_RESULT_GENERIC); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_focus_fire_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_focus_fire_6"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_inspiration_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_inspiration_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_inspiration_1"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_inspiration_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_inspiration_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_inspiration_2"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_inspiration_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_inspiration_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_inspiration_3"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_inspiration_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_inspiration_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_inspiration_4"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_inspiration_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_inspiration_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_inspiration_5"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_inspiration_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_inspiration_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_inspiration_6"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - - return SCRIPT_CONTINUE; - } - - - public int of_scatter_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_scatter_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_scatter_1"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_charge_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_charge_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_charge_1"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_medical_sup_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_medical_sup_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 1)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_medical_sup_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_medical_sup_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_medical_sup_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 2)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_medical_sup_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_medical_sup_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_medical_sup_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 3)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_medical_sup_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_medical_sup_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_medical_sup_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 4)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_medical_sup_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_medical_sup_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_medical_sup_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 5)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_medical_sup_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_medical_sup_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_medical_sup_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 6)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_medical_sup_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_tactical_sup_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_tactical_sup_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 7)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_tactical_sup_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_tactical_sup_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_tactical_sup_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 8)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_tactical_sup_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_tactical_sup_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_tactical_sup_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 9)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_tactical_sup_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_tactical_sup_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_tactical_sup_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 10)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_tactical_sup_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_tactical_sup_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_tactical_sup_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 11)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_tactical_sup_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_tactical_sup_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!canCallSupplyDrop(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_tactical_sup_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callSupplyDrop(self, 12)) - { - return SCRIPT_OVERRIDE; - } - } - - float baseCooldownTime = getBaseCooldownTime("of_tactical_sup_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_reinforcements_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (pet_lib.hasMaxStoredPetsOfType (self, pet_lib.PET_TYPE_NPC)) - { - sendSystemMessage (self, pet_lib.SID_SYS_CALL_MAX_DATAPAD); - return SCRIPT_OVERRIDE; - } - - if (!canCallSupplyDrop(self) || pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_NPC)) - { - return SCRIPT_OVERRIDE; - } - - boolean droidPets = pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_DROID); - boolean npcPets = pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_NPC); - if (droidPets || npcPets) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_reinforcements_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else if (!callSupplyDrop(self, 13)) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_reinforcements_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_reinforcements_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (pet_lib.hasMaxStoredPetsOfType (self, pet_lib.PET_TYPE_NPC)) - { - sendSystemMessage (self, pet_lib.SID_SYS_CALL_MAX_DATAPAD); - return SCRIPT_OVERRIDE; - } - - if (!canCallSupplyDrop(self) || pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_NPC)) - { - return SCRIPT_OVERRIDE; - } - - boolean droidPets = pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_DROID); - boolean npcPets = pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_NPC); - if (droidPets || npcPets) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_reinforcements_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else if (!callSupplyDrop(self, 14)) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_reinforcements_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_reinforcements_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (pet_lib.hasMaxStoredPetsOfType (self, pet_lib.PET_TYPE_NPC)) - { - sendSystemMessage (self, pet_lib.SID_SYS_CALL_MAX_DATAPAD); - return SCRIPT_OVERRIDE; - } - - if (!canCallSupplyDrop(self) || pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_NPC)) - { - return SCRIPT_OVERRIDE; - } - - boolean droidPets = pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_DROID); - boolean npcPets = pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_NPC); - if (droidPets || npcPets) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_reinforcements_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else if (!callSupplyDrop(self, 15)) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_reinforcements_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_reinforcements_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (pet_lib.hasMaxStoredPetsOfType (self, pet_lib.PET_TYPE_NPC)) - { - sendSystemMessage (self, pet_lib.SID_SYS_CALL_MAX_DATAPAD); - return SCRIPT_OVERRIDE; - } - - if (!canCallSupplyDrop(self) || pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_NPC)) - { - return SCRIPT_OVERRIDE; - } - - boolean droidPets = pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_DROID); - boolean npcPets = pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_NPC); - if (droidPets || npcPets) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_reinforcements_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else if (!callSupplyDrop(self, 16)) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_reinforcements_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_reinforcements_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (pet_lib.hasMaxStoredPetsOfType (self, pet_lib.PET_TYPE_NPC)) - { - sendSystemMessage (self, pet_lib.SID_SYS_CALL_MAX_DATAPAD); - return SCRIPT_OVERRIDE; - } - - if (!canCallSupplyDrop(self) || pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_NPC)) - { - return SCRIPT_OVERRIDE; - } - - boolean droidPets = pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_DROID); - boolean npcPets = pet_lib.hasMaxPets(self, pet_lib.PET_TYPE_NPC); - if (droidPets || npcPets) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("of_reinforcements_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else if (!callSupplyDrop(self, 17)) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_reinforcements_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_sup") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int of_firepower_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_firepower_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_firepower_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_firepower") * 60; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_deb_def_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_deb_def_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_deb_def_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_paint"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_deb_def_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_deb_def_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_deb_def_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_paint"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_deb_def_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_deb_def_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_deb_def_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_paint"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_deb_def_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_deb_def_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_deb_def_7"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_paint"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - - return SCRIPT_CONTINUE; - } - - - public int of_deb_def_8(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_deb_def_8", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_deb_def_8"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_paint"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - (cooldownTimeMod/10)); - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_decapitate_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_decapitate_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int of_decapitate_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_decapitate_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int of_decapitate_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_decapitate_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int of_decapitate_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_decapitate_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int of_decapitate_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_decapitate_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int of_decapitate_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_decapitate_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_vortex_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_vortex_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int of_vortex_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_vortex_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int of_vortex_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_vortex_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int of_vortex_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_vortex_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int of_vortex_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_vortex_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int of_vortex_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_vortex_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_drillmaster_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_drillmaster_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_drillmaster_1"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "cooldown_percent_of_group_buff"); - baseCooldownTime = baseCooldownTime - (baseCooldownTime * (cooldownTimeMod/100) ); - - if (baseCooldownTime < 0) - { - baseCooldownTime = 0.0f; - } - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime); - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_stimulator_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_stimulator_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_stimulator_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_purge"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public int of_purge_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("of_purge_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("of_stimulator_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_of_purge"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - doInspiredAction(self); - - return SCRIPT_CONTINUE; - } - - - public void doInspiredAction(obj_id officer) throws InterruptedException - { - int bonusChance = getEnhancedSkillStatisticModifierUncapped(officer, "of_inspired_action_chance"); - - if (bonusChance > 0) - { - int roll = rand(1, 99); - int total = roll+bonusChance; - - if (total > 99) - { - buff.applyBuff(officer, officer, "of_inspiration_6"); - showFlyText(officer, new string_id("set_bonus", "inspired_action_fly"), 2, colors.LEMONCHIFFON); - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("set_bonus", "inspired_action_fly_cbspam")); - pp = prose.setTT(pp, officer); - sendCombatSpamMessageProse(officer, pp, COMBAT_RESULT_GENERIC); - } - } - - return; - - } - - - public int of_last_words_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "of_last_words_recourse")) - { - buff.applyBuff(self, self, "of_last_words_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int sm_disarm_trap_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!stealth.canDisarmTrap(self, target)) - { - return SCRIPT_OVERRIDE; - } - - stealth.disarmTrap(self, target); - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_melee_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_melee_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_melee_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_melee_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_melee_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_melee_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_melee_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_melee_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_melee_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_melee_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_melee_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_melee_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int sm_ae_cover_fire(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_cover_fire", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_cc_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_cc_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_cc_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_cc_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_cc_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_cc_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_cc_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_cc_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_cc_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_cc_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_pin_down(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_pin_down", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_cc_melee_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_cc_melee_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_cc_melee_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_cc_melee_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_cc_melee_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_cc_melee_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_cc_melee_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_cc_melee_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_ae_dm_cc_melee_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_ae_dm_cc_melee_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_del_dm_cc_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_del_dm_cc_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_del_dm_cc_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_del_dm_cc_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_del_dm_cc_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_del_dm_cc_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_del_dm_cc_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_del_dm_cc_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_del_dm_cc_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_del_dm_cc_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_del_dm_cc_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_del_dm_cc_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_fast_draw(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_fast_draw", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_precision_strike(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_precision_strike", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_melee_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_melee_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_melee_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_melee_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_melee_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_melee_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_melee_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_melee_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_melee_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_melee_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_melee_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_melee_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_melee_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_melee_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_melee_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_melee_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_melee_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_melee_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_melee_7(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_melee_7", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (successfulFastAttack(self, "sm_dm")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_dm_melee_7"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_concussion_shot(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_concussion_shot", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dizzy(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dizzy", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int sm_dm_cc_melee_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_melee_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_melee_1"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_melee_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_melee_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_melee_2"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_melee_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_melee_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_melee_3"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_melee_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_melee_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_melee_4"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_melee_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_melee_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_melee_5"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_cc_melee_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_cc_melee_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doDireAbility(self, target, 0); - - float baseCooldownTime = getBaseCooldownTime("sm_dm_cc_melee_6"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_dm_cc") / 10; - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_dot_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_dot_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_dot_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_dot_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_dot_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_dot_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_dot_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_dot_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_dot_melee_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_dot_melee_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_dot_melee_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_dot_melee_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_dot_melee_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_dot_melee_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_dm_dot_melee_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_dm_dot_melee_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_bad_odds_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_bad_odds_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_bad_odds_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_bad_odds_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_bad_odds_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_bad_odds_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_bad_odds_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_bad_odds_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_bad_odds_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_bad_odds_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_sh_0(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sm_sh_0", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_sh_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sm_sh_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_sh_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sm_sh_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_sh_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!healing.isDamaged(self)) - { - sendSystemMessage(self, new string_id("healing", "no_damage_to_heal_self")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sm_sh_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_summon_smuggler(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_summon_smuggler", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callFavor(self, 0)) - { - return SCRIPT_OVERRIDE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int sm_summon_medic(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_summon_medic", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callFavor(self, 1)) - { - return SCRIPT_OVERRIDE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int sm_sly_lie(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!smuggler.canSlyLie(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sm_sly_lie", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (!smuggler.doSlyLie(self)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_fast_talk(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (isIdValid(target) && !smuggler.canFastTalk(self, target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sm_fast_talk", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - if (!smuggler.doFastTalk(self, target)) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int sm_skullduggery(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_skullduggery", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_impossible_odds(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_impossible_odds", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_nerf_herder(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_nerf_herder", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_pistol_whip_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_pistol_whip_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_pistol_whip_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_pistol_whip_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_pistol_whip_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_pistol_whip_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_pistol_whip_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_pistol_whip_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_shoot_first_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (isBeingHuntedByBountyHunter(self, target)) - { - pvpSetPersonalEnemyFlag(self, target); - pvpSetPersonalEnemyFlag(target, self); - } - - if (!combatStandardAction("sm_shoot_first_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_shoot_first_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (isBeingHuntedByBountyHunter(self, target)) - { - pvpSetPersonalEnemyFlag(self, target); - pvpSetPersonalEnemyFlag(target, self); - } - - if (!combatStandardAction("sm_shoot_first_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_shoot_first_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (isBeingHuntedByBountyHunter(self, target)) - { - pvpSetPersonalEnemyFlag(self, target); - pvpSetPersonalEnemyFlag(target, self); - } - - if (!combatStandardAction("sm_shoot_first_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_shoot_first_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (isBeingHuntedByBountyHunter(self, target)) - { - pvpSetPersonalEnemyFlag(self, target); - pvpSetPersonalEnemyFlag(target, self); - } - - if (!combatStandardAction("sm_shoot_first_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_shoot_first_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (isBeingHuntedByBountyHunter(self, target)) - { - pvpSetPersonalEnemyFlag(self, target); - pvpSetPersonalEnemyFlag(target, self); - } - - if (!combatStandardAction("sm_shoot_first_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_inspect_cargo(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id player = self; - smuggler.inspectCorpseForContraband(player, target); - - return SCRIPT_CONTINUE; - } - - - public int sm_spot_a_sucker_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_spot_a_sucker_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - int glanceMod = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_glance_chance"); - int criticalMod = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_critical_decrease"); - int damageDecrease = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_damage_decrease_chance"); - - if (damageDecrease >= 40) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_1_7"); - } - else if (damageDecrease >= 20) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_1_6"); - } - else if (glanceMod >= 50) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_1_5"); - } - else if (glanceMod >= 25) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_1_4"); - } - else if (criticalMod >= 50) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_1_3"); - } - else if (criticalMod >= 25) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_1_2"); - } - else - { - buff.applyBuff(target, self, "sm_spot_a_sucker_1_1"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int sm_spot_a_sucker_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_spot_a_sucker_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - int glanceMod = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_glance_chance"); - int criticalMod = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_critical_decrease"); - int damageDecrease = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_damage_decrease_chance"); - - if (damageDecrease >= 40) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_2_7"); - } - else if (damageDecrease >= 20) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_2_6"); - } - else if (glanceMod >= 50) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_2_5"); - } - else if (glanceMod >= 25) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_2_4"); - } - else if (criticalMod >= 50) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_2_3"); - } - else if (criticalMod >= 25) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_2_2"); - } - else - { - buff.applyBuff(target, self, "sm_spot_a_sucker_2_1"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int sm_spot_a_sucker_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_spot_a_sucker_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - int glanceMod = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_glance_chance"); - int criticalMod = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_critical_decrease"); - int damageDecrease = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_damage_decrease_chance"); - - if (damageDecrease >= 40) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_3_7"); - } - else if (damageDecrease >= 20) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_3_6"); - } - else if (glanceMod >= 50) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_3_5"); - } - else if (glanceMod >= 25) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_3_4"); - } - else if (criticalMod >= 50) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_3_3"); - } - else if (criticalMod >= 25) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_3_2"); - } - else - { - buff.applyBuff(target, self, "sm_spot_a_sucker_3_1"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int sm_spot_a_sucker_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_spot_a_sucker_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - int glanceMod = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_glance_chance"); - int criticalMod = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_critical_decrease"); - int damageDecrease = (int)getEnhancedSkillStatisticModifierUncapped(self, "expertise_spot_a_sucker_damage_decrease_chance"); - - if (damageDecrease >= 40) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_4_7"); - } - else if (damageDecrease >= 20) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_4_6"); - } - else if (glanceMod >= 50) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_4_5"); - } - else if (glanceMod >= 25) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_4_4"); - } - else if (criticalMod >= 50) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_4_3"); - } - else if (criticalMod >= 25) - { - buff.applyBuff(target, self, "sm_spot_a_sucker_4_2"); - } - else - { - buff.applyBuff(target, self, "sm_spot_a_sucker_4_1"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int sm_off_the_cuff(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_off_the_cuff", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int doubleDeal = (int)getSkillStatisticModifier(self, "expertise_double_deal_chance"); - - if (rand(0,99) < doubleDeal) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0); - showFlyTextPrivate(self, self, new string_id("combat_effects", "double_deal"), 1.5f, colors.ORANGERED); - } - - return SCRIPT_CONTINUE; - } - - - public int sm_end_of_the_line(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_end_of_the_line", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int expertise_sm_card_ranged_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.hasBuff(self, "sm_double_hit")) - { - return SCRIPT_CONTINUE; - } - - if (!combatStandardAction("expertise_sm_card_ranged_proc", self, target, params, "", "")) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int expertise_sm_card_melee_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.hasBuff(self, "sm_double_hit")) - { - return SCRIPT_CONTINUE; - } - - if (!combatStandardAction("expertise_sm_card_melee_proc", self, target, params, "", "")) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public boolean callJunkDealer(obj_id self) throws InterruptedException - { - location loc = getLocation(self); - - if (!isIdValid(loc.cell)) - { - int x = rand(-3, 3); - int z = rand(-3, 3); - - loc.x += x; - loc.z += z; - } - - obj_id buddy = create.object("junk_dealer_smuggler", loc, getLevel(self)); - - if (!isIdValid(buddy)) - { - return false; - } - - if (!isIdValid(loc.cell)) - { - loc.x += 30; - setHomeLocation(buddy, loc); - } - - setMaster(buddy, self); - utils.setScriptVar(self, "junk_dealer_smuggler", buddy); - - return true; - } - - - public int sm_off_the_books(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (utils.hasScriptVar(self, "junk_dealer_smuggler")) - { - obj_id dealer = utils.getObjIdScriptVar(self, "junk_dealer_smuggler"); - - if (isIdValid(dealer) && exists(dealer)) - { - sendSystemMessage(self, new string_id("spam", "dealer_already_exists")); - return SCRIPT_OVERRIDE; - } - else - { - utils.removeScriptVar(self, "junk_dealer_smuggler"); - } - } - - if (!combatStandardAction("sm_off_the_books", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - else - { - if (!callJunkDealer(self)) - { - return SCRIPT_OVERRIDE; - } - } - - return SCRIPT_CONTINUE; - } - - - public int sm_inside_information(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_inside_information", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - obj_id infoTarget; - - if (isIdValid(target) && isPlayer(target)) - { - infoTarget = target; - - if (factions.getFactionStatus(self, target) == factions.STATUS_ENEMY) - { - return SCRIPT_OVERRIDE; - } - } - else - { - infoTarget = self; - } - - if (bounty_hunter.isSpammingBountyCheck(self, false)) - { - sendSystemMessage(self, new string_id("bounty_hunter", "sm_calling_contact_too_often")); - - return SCRIPT_OVERRIDE; - } - - if (infoTarget != self && bounty_hunter.isSpammingBountyCheck(infoTarget, false)) - { - sendSystemMessage(self, new string_id("bounty_hunter", "sm_calling_contact_too_often_target")); - - return SCRIPT_OVERRIDE; - } - - if (isDead(infoTarget) || isIncapacitated(infoTarget)) - { - return SCRIPT_OVERRIDE; - } - - int amount = getIntObjVar(infoTarget, "bounty.amount"); - - if (amount <= 0) - { - prose_package pp = new prose_package (); - pp.stringId = new string_id ("bounty_hunter", "sm_no_bounty_target_player"); - prose.setTT(pp, getName(self)); - - if (infoTarget != self) - { - sendSystemMessageProse(infoTarget, pp); - sendSystemMessage(self, new string_id("bounty_hunter", "sm_no_bounty_target")); - - utils.setScriptVar(infoTarget, "bountyCheckFloodControl", getGameTime() + 600); - } - else - { - sendSystemMessage(self, new string_id("bounty_hunter", "sm_no_bounty_self")); - } - - utils.setScriptVar(self, "bountyCheckFloodControl", getGameTime() + 60); - - return SCRIPT_CONTINUE; - } - - obj_id[] bounties = getJediBounties(infoTarget); - - if (bounties != null && bounties.length > 0) - { - prose_package pp = new prose_package (); - pp.stringId = new string_id ("bounty_hunter", "sm_bounty_amount_target_with_bounties"); - prose.setDI(pp, amount); - - sendSystemMessageProse(infoTarget, pp); - - for (int i = 0; i < bounties.length; i++) - { - testAbortScript(); - obj_id bountyHunter = bounties[i]; - - if (isIdValid(bountyHunter)) - { - dictionary messageParams = new dictionary(); - messageParams.put("smuggler", infoTarget); - - messageTo(bountyHunter, "handleSmugglerGetLocationInfo", messageParams, 1.0f, false); - } - } - - utils.setScriptVar(self, "bountyCheckFloodControl", getGameTime() + 60); - } - else - { - prose_package pp = new prose_package (); - pp.stringId = new string_id ("bounty_hunter", "sm_bounty_amount_target_no_bounties"); - prose.setDI(pp, amount); - - sendSystemMessageProse(infoTarget, pp); - - utils.setScriptVar(self, "bountyCheckFloodControl", getGameTime() + 60); - } - - if (infoTarget != self) - { - prose_package pm = new prose_package(); - pm.stringId = new string_id ("bounty_hunter", "sm_bounty_notified_target"); - prose.setTT(pm, getName(infoTarget)); - - sendSystemMessageProse(self, pm); - - utils.setScriptVar(infoTarget, "bountyCheckFloodControl", getGameTime() + 600); - } - - return SCRIPT_CONTINUE; - } - - - public int sm_false_hope(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_false_hope", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("sm_false_hope"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getSkillStatisticModifier(self, "expertise_cooldown_line_sm_false_hope"); - - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sm_break_the_deal(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_break_the_deal", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_narrow_escape_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_narrow_escape_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_narrow_escape_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_narrow_escape_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_narrow_escape_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_narrow_escape_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_narrow_escape_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_narrow_escape_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_buff_invis_ally_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if ((!stealth.canPerformCamouflageAlly(self, target) || !combatStandardAction("sm_buff_invis_ally_1", self, target, params, "", "") || !isInAttackRange(self, target, "sm_buff_invis_ally_1", false))) - { - return SCRIPT_OVERRIDE; - } - - int minPower = 10; - int maxPower = 30; - float difference = maxPower - minPower; - float ratio = getLevel(self)/90; - - int duration = (int) Math.ceil(minPower + (difference * ratio)); - - buff.applyBuff(target, self, "invis_sm_buff_invis_1"); - return SCRIPT_CONTINUE; - } - - - public int sm_how_are_you(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sm_how_are_you", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doMedicEvasion(self); - - int randomPhrase = rand(0,75); - - if (randomPhrase < 5) - { - chat.chat(self, chat.CHAT_SAY, new string_id("set_bonus", "sm_blather_"+randomPhrase)); - } - - return SCRIPT_CONTINUE; - } - - - public int expertise_sm_ranged_shot_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("expertise_sm_ranged_shot_proc", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int expertise_sm_melee_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("expertise_sm_melee_proc", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int expertise_sm_melee_stun_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("expertise_sm_melee_stun_proc", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int expertise_sm_feeling_lucky_chance_proc(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("expertise_sm_feeling_lucky_chance_proc", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_buff_invis_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!stealth.canPerformForceCloak(self) || !combatStandardAction("fs_buff_invis_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int steal(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!stealth.hasInvisibleBuff(self) && !buff.hasBuff(self, "sp_smoke_mirrors")) - { - return SCRIPT_OVERRIDE; - } - - if (!stealth.canSteal(self, target) || !combatStandardAction("steal", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - stealth.steal(self, target); - return SCRIPT_CONTINUE; - } - - - public int sp_buff_invis_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - dictionary blankMsg = new dictionary(); - if (hasSkill(self, "expertise_sp_without_a_trace_1")) - { - if (!stealth.canPerformWithoutTrace(self) || !combatStandardAction("sp_without_a_trace", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - utils.setScriptVar(self, "sp_without_a_trace", 1); - messageTo(self, "withoutTraceTimerExpired", blankMsg, 30, false); - - if (successfulFastAttack(self, "sp_perfect", "perfect_opportunity_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - buff.applyBuff(self, self, "sp_set_perfect_opportunity"); - return SCRIPT_CONTINUE; - } - - if (successfulFastAttack(self, "sp_smoke", "flawless_getaway_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - float baseCooldownTime = getBaseCooldownTime("sp_buff_invis_1"); - if (baseCooldownTime < 0) - { - baseCooldownTime = 0; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_sp_smoke"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - if (!stealth.canPerformSmokeGrenade(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sp_buff_invis_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - utils.setScriptVar(self, "sp_smoke_bomb", 1); - messageTo(self, "smokeBombTimerExpired", blankMsg, 10, false); - - if (successfulFastAttack(self, "sp_perfect", "perfect_opportunity_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - buff.applyBuff(self, self, "sp_set_perfect_opportunity"); - return SCRIPT_CONTINUE; - } - - if (successfulFastAttack(self, "sp_smoke", "flawless_getaway_fly")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_CONTINUE; - } - - float baseCooldownTime = getBaseCooldownTime("sp_buff_invis_1"); - if (baseCooldownTime < 0) - { - baseCooldownTime = 0; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_sp_smoke"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sp_burst_of_shadows(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!stealth.hasInvisibleBuff(self) && !buff.hasBuff(self, "sp_smoke_mirrors")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sp_burst_of_shadows", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("sp_burst_of_shadows"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_sp_burst_shadows"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sp_reveal_shadows(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!stealth.canDetectCamouflage(self) || !combatStandardAction("sp_reveal_shadows", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float detectSkill = getEnhancedSkillStatisticModifier(self, "detect_hidden"); - float distance = stealth.BASE_DETECT_CAMOUFLAGE_DISTANCE + (detectSkill / 20); - - float detectChance = 75.0f; - - int distanceMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_sp_reveal_shadows_distance_increase"); - int detectMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_sp_reveal_shadows_detect_chance_increase"); - - distance = distance + distanceMod; - detectChance = detectChance + detectMod; - - stealth.detectCamouflage(self, true, true, distance, detectChance); - - float baseCooldownTime = getBaseCooldownTime("sp_reveal_shadows"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_sp_reveal_shadows"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - return SCRIPT_CONTINUE; - } - - - public int sp_avoid_damage(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sp_avoid_damage", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int sp_preparation(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sp_preparation", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float baseCooldownTime = getBaseCooldownTime("sp_preparation"); - if (baseCooldownTime < 0) - { - return SCRIPT_OVERRIDE; - } - - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_cooldown_line_sp_preparation"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int sp_buff_stealth_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - String invis = stealth.getInvisBuff(self); - if (invis != null && invis.equals("invis_sp_buff_stealth_1")) - { - buff.removeBuff(self, invis); - return SCRIPT_OVERRIDE; - } - - if (invis != null && (invis.equals("invis_sp_buff_invis_1"))) - { - - buff.removeBuff(self, "invis_sp_buff_invis_1"); - buff.applyBuff(self, self, "invis_sp_buff_stealth_1"); - return SCRIPT_OVERRIDE; - } - - if (!stealth.canPerformStealth(self) || !buff.canApplyBuff(self, "invis_sp_buff_stealth_1") || !combatStandardAction("sp_buff_stealth_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sp_decoy(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!stealth.canPerformSmokeGrenade(self)) - { - return SCRIPT_OVERRIDE; - } - - obj_id decoy = stealth.createDecoy(self); - - if (!isIdValid(decoy)) - { - return SCRIPT_OVERRIDE; - } - - obj_id[] haters = getWhoIsTargetingMe(self); - int diversionLevel = getEnhancedSkillStatisticModifierUncapped(self, "expertise_improved_decoy"); - combat.sendCombatSpamMessage(self, new string_id("spam", "decoy_created")); - - if (haters == null || haters.length == 0) - { - - if (diversionLevel == 2) - { - buff.applyBuff(self, self, "invis_sp_diversion_stealth"); - } - - return SCRIPT_CONTINUE; - } - - for (int i=0; i 7.0f) - { - sendSystemMessage(self, new string_id("spam", "stand_next_to_corpse") ); - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("bm_revive_pet_1", self, target, params, "", "")) - { - setCommandTimerValue(self, TIMER_COOLDOWN, 0f); - return SCRIPT_OVERRIDE; - } - - messageTo(self, "channelRevivePet", null, 0, false); - - float baseCooldownTime = getBaseCooldownTime("bm_revive_pet_1"); - float cooldownTimeMod = getEnhancedSkillStatisticModifierUncapped(self, "expertise_bm_pet_revive_time"); - setCommandTimerValue(self, TIMER_COOLDOWN, baseCooldownTime - cooldownTimeMod); - - return SCRIPT_CONTINUE; - } - - - public int bm_paralytic_poison_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "bm_paralytic_poison_recourse")) - { - buff.applyBuff(self, self, "bm_paralytic_poison_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int handlePostureRestore(obj_id self, dictionary params) throws InterruptedException - { - stopClientEffectObjByLabel(self, "state_knockdown"); - - if (getPosture(self) == POSTURE_KNOCKED_DOWN) - { - setPostureClientImmediate(self, utils.getIntScriptVar(self, "combat.intKnockdownTime.posture")); - } - - return SCRIPT_CONTINUE; - } - - - public int performHateTick(obj_id self, dictionary params) throws InterruptedException - { - obj_id attacker = params.getObjId("attacker"); - int hate = params.getInt("hate"); - int tick = params.getInt("tick"); - int duration = params.getInt("duration"); - - addHate(attacker, self, 0.0f); - addHate(self, attacker, hate); - - if (duration < getGameTime()) - { - messageTo(self, "performHateTick", params, tick, false); - } - - return SCRIPT_CONTINUE; - } - - - public int combatTarget(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target)) - { - return SCRIPT_OVERRIDE; - } - - setTarget(self, target); - - return SCRIPT_OVERRIDE; - } - - - public int updateCrowdControlEffect(obj_id self, dictionary params) throws InterruptedException - { - boolean effectActive = false; - - int[] buffList = buff.getAllBuffs(self); - - if (buffList == null || buffList.length == 0) - { - return SCRIPT_CONTINUE; - } - - prose_package pp = new prose_package(); - - for (int i = 0; i < buffList.length; i++) - { - testAbortScript(); - if (movement.isStunEffect(buff.getBuffNameFromCrc(buffList[i]))) - { - effectActive = true; - pp = prose.setStringId(pp, new string_id("combat_effects", "go_stunned")); - showFlyTextPrivateProseWithFlags(self, self, pp, 1.5f, colors.LAWNGREEN, FLY_TEXT_FLAG_IS_SNARE ); - - } - if (movement.isRoot(buffList[i])) - { - effectActive = true; - pp = prose.setStringId(pp, new string_id("combat_effects", "go_rooted")); - showFlyTextPrivateProseWithFlags(self, self, pp, 1.5f, colors.LAWNGREEN, FLY_TEXT_FLAG_IS_SNARE ); - } - - if (movement.isSnare(buffList[i])) - { - effectActive = true; - pp = prose.setStringId(pp, new string_id("combat_effects", "go_snare")); - showFlyTextPrivateProseWithFlags(self, self, pp, 1.5f, colors.LAWNGREEN, FLY_TEXT_FLAG_IS_SNARE ); - - } - } - - if (effectActive) - { - messageTo (self, "updateCrowdControlEffect", null, 4f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int creatureMeleeAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureMeleeAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureRangedAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureRangedAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureBlindAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureBlindAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureDizzyAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureDizzyAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureStunAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureStunAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureIntimidationAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureIntimidationAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureKnockdownAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureKnockdownAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creaturePostureDownAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creaturePostureDownAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creaturePostureUpAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creaturePostureUpAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureAreaAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureAreaAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureAreaCombo(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureAreaCombo", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureAreaBleeding(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureAreaBleeding", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureAreaDisease(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureAreaDisease", self, target, params, "creatureAreaDiseaseSuccess", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureAreaPoison(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureAreaPoison", self, target, params, "creatureAreaPoisonSuccess", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureAreaKnockdown(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureAreaKnockdown", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creaturePoisonAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creaturePoisonAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureFireAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureFireAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureSnareAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("creatureSnareAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int creatureAreaDiseaseSuccess(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] defenders = params.getObjIdArray("defenders"); - - for (int i = 0; i < defenders.length; i++) - { - testAbortScript(); - dot.applyDotEffect(defenders[i], self, dot.DOT_DISEASE, "creatureDiseaseAttack", HEALTH, 100, 300, 300); - } - - return SCRIPT_CONTINUE; - } - - - public int creatureAreaPoisonSuccess(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] defenders = params.getObjIdArray("defenders"); - - for (int i = 0; i < defenders.length; i++) - { - testAbortScript(); - if (dot.canApplyDotType(defenders[i], dot.DOT_POISON)) - { - dot.applyDotEffect(defenders[i], self, dot.DOT_POISON, "creaturePoisonAttack", HEALTH, 100, 150, 300); - } - } - - return SCRIPT_CONTINUE; - } - - - public int knockdownRecovery(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("knockdownRecovery", self, target, params, "knockdownRecoverySuccess", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int stunRecovery(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("stunRecovery", self, target, params, "stunRecoverySuccess", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int blindRecovery(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("blindRecovery", self, target, params, "blindRecoverySuccess", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int dizzyRecovery(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("dizzyRecovery", self, target, params, "dizzyRecoverySuccess", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int iceCreamRecourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "ice_cream_recourse")) - { - buff.applyBuff(self, self, "ice_cream_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int dazeRecourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "dazeBlockDebuff")) - { - buff.applyBuff(self, self, "dazeBlockDebuff"); - } - - return SCRIPT_CONTINUE; - } - - - public int mezRecourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "mezBlockDebuff")) - { - buff.applyBuff(self, self, "mezBlockDebuff"); - } - - return SCRIPT_CONTINUE; - } - - - public int seetingAngerRecourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "seetingAnger_1")) - { - buff.applyBuff(self, self, "seethingAnger_1"); - } - - return SCRIPT_CONTINUE; - } - - public int seetingAngerRecourse_1(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "seetingAnger_2")) - { - buff.applyBuff(self, self, "seethingAnger_2"); - } - - return SCRIPT_CONTINUE; - } - - public int seetingAngerRecourse_2(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "seetingAnger_3")) - { - buff.applyBuff(self, self, "seethingAnger_3"); - } - - return SCRIPT_CONTINUE; - } - - - public int seetingAngerRecourse_3(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "seetingAnger_4")) - { - buff.applyBuff(self, self, "seethingAnger_4"); - } - - return SCRIPT_CONTINUE; - } - - - public int petSnareAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("petSnareAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int petPinAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("petPinAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int petBleedAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("petBleedAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int petIntimidateAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("petIntimidateAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int petStunAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("petStunAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int petBlindAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("petBlindAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int petKnockdownAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("petKnockdownAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int petDefenseBreakAttack(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("petDefenseBreakAttack", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int insidiousMalady(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("insidiousMalady", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int euphoria(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("euphoria", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - - } - - - public int rampage(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("rampage", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int seethingAnger(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("seethingAnger", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int cloakOfLava(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("cloakOfLava", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - - } - - - public int sherKarRage(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sherKarRage", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - - } - - - public int decrepitStrike(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("decrepitStrike", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - - } - - - public int sk_shockWave(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sk_shockWave", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - - } - - - public int bm_charge_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_charge_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int bm_charge_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!combatStandardAction("bm_charge_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int bm_charge_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!combatStandardAction("bm_charge_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int bm_charge_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!combatStandardAction("bm_charge_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int bm_charge_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!combatStandardAction("bm_charge_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int bm_trample(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!combatStandardAction("bm_trample", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int bm_bite_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!combatStandardAction("bm_bite_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_bite_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!combatStandardAction("bm_bite_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_bite_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_bite_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_bite_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_bite_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_bite_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_bite_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_puncture_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_puncture_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_puncture_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_puncture_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_puncture_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_puncture_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_siphon_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_siphon_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_siphon_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_siphon_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_siphon_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_siphon_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_siphon_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_siphon_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_siphon_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_siphon_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_hamstring_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_hamstring_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_hamstring_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_hamstring_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_hamstring_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_hamstring_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_hamstring_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_hamstring_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_hamstring_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_hamstring_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_claw_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_claw_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_claw_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_claw_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_claw_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_claw_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_claw_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_claw_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_claw_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_claw_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_slash_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_slash_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_slash_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_slash_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_slash_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_slash_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_slash_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_slash_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_slash_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_slash_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_flank_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_flank_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_flank_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_flank_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_flank_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_flank_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_bolster_armor_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_bolster_armor_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int bm_bolster_armor_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_bolster_armor_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_bolster_armor_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_bolster_armor_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_bolster_armor_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_bolster_armor_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_bolster_armor_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_bolster_armor_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_dampen_pain_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_dampen_pain_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int bm_dampen_pain_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_dampen_pain_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_dampen_pain_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_dampen_pain_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_dampen_pain_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_dampen_pain_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_dampen_pain_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_dampen_pain_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_shield_master(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_shield_master", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int bm_deflective_hide(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_deflective_hide", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int bm_defensive_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_defensive_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int bm_defensive_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_defensive_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int bm_defensive_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_defensive_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int bm_defensive_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_defensive_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - public int bm_defensive_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_defensive_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int bm_damage_poison_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_damage_poison_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int bm_damage_poison_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_damage_poison_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int bm_damage_poison_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_damage_poison_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int bm_damage_poison_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_damage_poison_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - public int bm_damage_poison_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_damage_poison_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_damage_disease_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_damage_disease_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_damage_disease_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_damage_disease_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_damage_disease_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_damage_disease_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_damage_disease_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_damage_disease_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_damage_disease_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_damage_disease_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_paralytic_poison(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_paralytic_poison", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_enfeeble_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_enfeeble_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_enfeeble_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_enfeeble_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_enfeeble_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_enfeeble_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_enfeeble_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_enfeeble_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_enfeeble_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_enfeeble_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_preperation(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_preperation", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_stomp_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_stomp_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_stomp_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_stomp_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_stomp_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_stomp_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_stomp_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_stomp_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_stomp_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_stomp_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_shaken_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_shaken_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_shaken_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_shaken_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_shaken_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_shaken_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_wing_buffet_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_wing_buffet_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_wing_buffet_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_wing_buffet_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_wing_buffet_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_wing_buffet_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_wing_buffet_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_wing_buffet_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_wing_buffet_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_wing_buffet_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_spit_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_spit_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_spit_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_spit_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_spit_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_spit_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_spit_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_spit_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_spit_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_spit_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_kick_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_kick_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_kick_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_kick_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_kick_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_kick_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_kick_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_kick_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_kick_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_kick_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_enrage(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_enrage", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_frenzy(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_frenzy", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int bm_provoke_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id beast = beast_lib.getBeastOnPlayer(self); - target = isIdValid(getTarget(beast)) ? getTarget(beast) : getIntendedTarget(self); - - if (!ai_lib.isTauntable(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("bm_provoke_1", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - beast_lib.doBmProvokeCommand(beast, target, 1); - - return SCRIPT_CONTINUE; - } - - - public int bm_provoke_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id beast = beast_lib.getBeastOnPlayer(self); - target = isIdValid(getTarget(beast)) ? getTarget(beast) : getIntendedTarget(self); - - if (!ai_lib.isTauntable(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("bm_provoke_2", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - beast_lib.doBmProvokeCommand(beast, target, 2); - - return SCRIPT_CONTINUE; - } - - - public int bm_provoke_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id beast = beast_lib.getBeastOnPlayer(self); - target = isIdValid(getTarget(beast)) ? getTarget(beast) : getIntendedTarget(self); - - if (!ai_lib.isTauntable(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("bm_provoke_3", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - beast_lib.doBmProvokeCommand(beast, target, 3); - - return SCRIPT_CONTINUE; - } - - - public int bm_provoke_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id beast = beast_lib.getBeastOnPlayer(self); - target = isIdValid(getTarget(beast)) ? getTarget(beast) : getIntendedTarget(self); - - if (!ai_lib.isTauntable(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("bm_provoke_4", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - beast_lib.doBmProvokeCommand(beast, target, 4); - - return SCRIPT_CONTINUE; - } - - - public int bm_provoke_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id beast = beast_lib.getBeastOnPlayer(self); - target = isIdValid(getTarget(beast)) ? getTarget(beast) : getIntendedTarget(self); - - if (!ai_lib.isTauntable(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("bm_provoke_5", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - beast_lib.doBmProvokeCommand(beast, target, 5); - - return SCRIPT_CONTINUE; - } - - - public int fs_taunt(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - int stanceBuff = buff.getBuffOnTargetFromGroup(self, "fsDefStance"); - if (stanceBuff == 0) - { - return SCRIPT_OVERRIDE; - } - - target = isIdValid(getIntendedTarget(self)) ? getIntendedTarget(self): getTarget(self) ; - - if (!isIdValid(target) || !exists(target)) - { - return SCRIPT_OVERRIDE; - } - - if (!ai_lib.isTauntable(target)) - { - return SCRIPT_OVERRIDE; - } - - if (isPlayer(target) || beast_lib.isBeast(target)) - { - return SCRIPT_OVERRIDE; - } - - obj_id topHateTarget = getHateTarget(target); - - if (topHateTarget == self) - { - return SCRIPT_CONTINUE; - } - - if (!combatStandardAction("fs_taunt", self, target, params, "", "", false)) - { - return SCRIPT_OVERRIDE; - } - - combat.dsFsTaunt(self, target); - - return SCRIPT_CONTINUE; - } - - - public int togglePetAutoRepeatOn(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - beast_lib.setAbilityAutoRepeat(beast_lib.getBeastOnPlayer(self), params); - return SCRIPT_CONTINUE; - } - - - public int togglePetAutoRepeatOff(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - beast_lib.unsetAbilityAutoRepeat(beast_lib.getBeastOnPlayer(self), params); - return SCRIPT_CONTINUE; - } - - - public int toggleBeastDefensive(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id beast = beast_lib.getBeastOnPlayer(self); - if (!isIdValid(beast) || !exists(beast)) - { - return SCRIPT_OVERRIDE; - } - - if (isDead(beast)) - { - sendSystemMessage(self, beast_lib.SID_BEAST_CANT_WHEN_DEAD); - return SCRIPT_OVERRIDE; - } - - beast_lib.setBeastDefensive(beast, self, true); - return SCRIPT_CONTINUE; - } - - - public int toggleBeastPassive(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id beast = beast_lib.getBeastOnPlayer(self); - if (!isIdValid(beast) || !exists(beast)) - { - return SCRIPT_OVERRIDE; - } - - if (isDead(beast)) - { - sendSystemMessage(self, beast_lib.SID_BEAST_CANT_WHEN_DEAD); - return SCRIPT_OVERRIDE; - } - - beast_lib.setBeastDefensive(beast, self, false); - return SCRIPT_CONTINUE; - } - - - public int bm_forage_enzyme_buff(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_forage_enzyme_buff", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int devastating_strike(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("devastating_strike", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int human_ability_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!combatStandardAction("human_ability_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - showFlyText(self, new string_id("spam", "fly_human_ability_1"), 1.5f, colors.LEMONCHIFFON); - - return SCRIPT_CONTINUE; - } - - - public int wookiee_ability_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("wookiee_ability_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - showFlyText(self, new string_id("spam", "fly_wookiee_ability_1"), 1.5f, colors.LEMONCHIFFON); - - return SCRIPT_CONTINUE; - } - - - public int rodian_ability_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("rodian_ability_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - showFlyText(self, new string_id("spam", "fly_rodian_ability_1"), 1.5f, colors.LEMONCHIFFON); - - return SCRIPT_CONTINUE; - } - - - public int bothan_ability_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!stealth.canPerformSmokeGrenade(self) || !combatStandardAction("bothan_ability_1", self, target, params, "", "") || !buff.canApplyBuff(target, "invis_bothan_ability_1")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int ithorian_ability_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("ithorian_ability_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - float level = getLevel(self); - float blockValue = level * (1000.0f/90.0f); - - buff.applyBuff(self, self, "ithorian_ability_1", 30.0f,blockValue); - showFlyText(self, new string_id("spam", "fly_ithorian_ability_1"), 1.5f, colors.LEMONCHIFFON); - - return SCRIPT_CONTINUE; - } - - - public int twilek_ability_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("twilek_ability_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - showFlyText(self, new string_id("spam", "fly_twilek_ability_1"), 1.5f, colors.LEMONCHIFFON); - - return SCRIPT_CONTINUE; - } - - - public int sullustan_ability_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sullustan_ability_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - showFlyText(self, new string_id("spam", "fly_sullustan_ability_1"), 1.5f, colors.LEMONCHIFFON); - - return SCRIPT_CONTINUE; - } - - - public int moncal_ability_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("moncal_ability_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - showFlyText(self, new string_id("spam", "fly_moncal_ability_1"), 1.5f, colors.LEMONCHIFFON); - - return SCRIPT_CONTINUE; - } - - - public int trandoshan_ability_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("trandoshan_ability_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int level = getLevel(self); - int healPerTick = level * 20; - - healing.startHealOverTime(self, self, "trandoshan_ability_1", 4.0f, 1.0f, healPerTick, true); - showFlyText(self, new string_id("spam", "fly_trandoshan_ability_1"), 1.5f, colors.LEMONCHIFFON); - - return SCRIPT_CONTINUE; - } - - - public int zabrak_ability_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("zabrak_ability_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - int level = getLevel(self); - int amount = level * 40; - int actionBefore = getAttrib(self, ACTION); - - int healthDelta = healing.healDamage(self, self, HEALTH, amount); - healing.healDamage(self, ACTION, amount); - - int actionDelta = getAttrib(self, ACTION) - actionBefore; - - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "zabrak_equilibrium_spam")); - pp = prose.setTT(pp, self); - pp = prose.setDI(pp, healthDelta); - healing.sendMedicalSpam(self, self, pp, true, true, true, COMBAT_RESULT_MEDICAL); - - prose_package ppp = new prose_package(); - pp = prose.setStringId(ppp, new string_id("spam", "zabrak_equilibrium_spam_action")); - pp = prose.setTT(ppp, self); - pp = prose.setDI(ppp, actionDelta); - healing.sendMedicalSpam(self, self, ppp, true, true, true, COMBAT_RESULT_MEDICAL); - - showFlyText(self, new string_id("spam", "fly_zabrak_ability_1"), 1.5f, colors.LEMONCHIFFON); - return SCRIPT_CONTINUE; - } - - - public int gcw_reward_comlink(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!faction_perk.executeComlinkReinforcements(self)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int trample_random(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("trample_random", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - setLocation(self, getLocation(utils.getObjIdScriptVar(self, combat.CHARGE_TARGET))); - - return SCRIPT_CONTINUE; - - } - - - public int bodyguard(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bodyguard", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int nandina_heal(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - obj_id[] spawn_id = trial.getObjectsInDungeonWithObjVar(trial.getTop(self), "spawn_id"); - - if (spawn_id == null || spawn_id.length == 0) - { - - return SCRIPT_CONTINUE; - } - obj_id gorvo = null; - - for (int i=0; i 0) - { - for (int i = 0; i < defenders.length; i++) - { - testAbortScript(); - if (isIdValid(defenders[i]) && !isDead(defenders[i]) && isPlayer(defenders[i])) - { - filteredDefenders = utils.addElement(filteredDefenders, defenders[i]); - } - } - } - - if (filteredDefenders != null && filteredDefenders.size() > 0) - { - target = ((obj_id)(filteredDefenders.get(rand(0, filteredDefenders.size() - 1)))); - } - - if (!combatStandardAction("ig88_flame_thrower", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int ig88_flame_thrower_vertical(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target)) - { - return SCRIPT_OVERRIDE; - } - - location where = getLocation(target); - - obj_id[] defenders = pvpGetTargetsInCone(self, self, where, 64, 10); - - Vector filteredDefenders = new Vector(); - filteredDefenders.setSize(0); - - if (defenders != null && defenders.length > 0) - { - for (int i = 0; i < defenders.length; i++) - { - testAbortScript(); - if (isIdValid(defenders[i]) && !isDead(defenders[i]) && isPlayer(defenders[i])) - { - filteredDefenders = utils.addElement(filteredDefenders, defenders[i]); - } - } - } - - if (filteredDefenders != null && filteredDefenders.size() > 0) - { - target = ((obj_id)(filteredDefenders.get(rand(0, filteredDefenders.size() - 1)))); - } - - if (!combatStandardAction("ig88_flame_thrower_vertical", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public obj_id getRocketTarget(obj_id self, obj_id target) throws InterruptedException - { - obj_id dungeon = getTopMostContainer(self); - - if (!isIdValid(dungeon)) - { - return target; - } - - obj_id[] targets = trial.getNonStealthedTargetsInCell(dungeon, "r1"); - - if (targets == null || targets.length <= 0) - { - dictionary sessionDict = new dictionary(); - - messageTo(dungeon, "ig88_failed", sessionDict, 0, false); - - return target; - } - - target = targets[rand(0, targets.length - 1)]; - - if (!isIdValid(target)) - { - debugSpeakMsg(self, "I couldn't find a valid target."); - return target; - } - - return target; - } - - - public int gcw_rocket_launch(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("ig88_rocket_launch", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - playClientEffectObj(self, "appearance/pt_gcw_rocket_launch.prt", self, ""); - playClientEffectObj(self, "sound/wep_heavy_rocket_launcher.snd", self, ""); - - playClientEffectLoc(target, "appearance/pt_ig88_rocket_target.prt", getLocation(target), 0f); - - dictionary rocketParams = new dictionary(); - - rocketParams.put("loc", getLocation(target)); - - messageTo(self, "gcw_rocket_hit", rocketParams, 2f, false); - - removeObjVar(self, "ai.combat.oneShotAction"); - removeObjVar(self, "oneShotActionComplete"); - - return SCRIPT_CONTINUE; - } - - - public int gcw_rocket_launcher(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("ig88_rocket_launcher", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int gcw_rocket_hit(obj_id self, dictionary params) throws InterruptedException - { - location loc = params.getLocation("loc"); - - playClientEffectLoc(self, "appearance/pt_gcw_rocket_hit.prt", loc, 0f); - - return SCRIPT_CONTINUE; - } - - - public int ig88_rocket_launch(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - target = getRocketTarget(self, target); - - LOG("combat_actions", "gcw ig88_rocket_launch 1"); - - if (!combatStandardAction("ig88_rocket_launch", self, target, params, "", "")) - { - LOG("combat_actions", "gcw ig88_rocket_launch FAIL self: "+ self + " target: "+ target + " params: "+ params); - return SCRIPT_OVERRIDE; - } - - playClientEffectObj(self, "appearance/pt_ig88_rocket_launch.prt", self, ""); - playClientEffectObj(self, "sound/wep_heavy_rocket_launcher.snd", self, ""); - - playClientEffectLoc(target, "appearance/pt_ig88_rocket_target.prt", getLocation(target), 0f); - - dictionary rocketParams = new dictionary(); - - rocketParams.put("loc", getLocation(target)); - - messageTo(self, "ig88_rocket_hit", rocketParams, 2f, false); - - removeObjVar(self, "ai.combat.oneShotAction"); - removeObjVar(self, "oneShotActionComplete"); - - return SCRIPT_CONTINUE; - } - - - public int ig88_rocket_launcher(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("ig88_rocket_launcher", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int ig88_rocket_hit(obj_id self, dictionary params) throws InterruptedException - { - location loc = params.getLocation("loc"); - - playClientEffectLoc(self, "appearance/pt_ig88_rocket_hit.prt", loc, 0f); - - return SCRIPT_CONTINUE; - } - - - public int ig88_shockwave(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - location loc = getLocation(self); - - String strLoc = ""+ loc.x + " "+ loc.y + " "+ loc.z + " "+ loc.cell + " "+ loc.x + " "+ loc.y + " "+ loc.z; - - if (!combatStandardAction("ig88_shockwave", self, target, strLoc, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int ig88_grenade(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - location loc = getLocation(self); - - String strLoc = ""+ loc.x + " "+ loc.y + " "+ loc.z + " "+ loc.cell + " "+ loc.x + " "+ loc.y + " "+ loc.z; - - if (!combatStandardAction("ig88_grenade", self, target, strLoc, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int nandina_fester(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("nandina_fester", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int lelli_mine(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id[] hateList = getHateList(self); - - Vector vectorList = new Vector(Arrays.asList(hateList)); - vectorList = utils.shuffleArray(vectorList); - - for (int i=0; i 0) - { - target2 = ((obj_id)(targets.get(rand(0, targets.size() -1)))); - } - } - - if (isIdValid(target1)) - { - utils.setScriptVar(target1, "axkva_min", self); - buff.applyBuff(target1, self, "axkva_crystalize"); - } - - if (isIdValid(target2)) - { - utils.setScriptVar(target2, "axkva_min", self); - buff.applyBuff(target2, self, "axkva_crystalize"); - } - - return SCRIPT_CONTINUE; - } - - - public int stasis_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "stasis_recourse")) - { - buff.applyBuff(self, self, "stasis_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int grenadier_cold(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - location loc = getLocation(target); - String targetLoc = ""+loc.x+" "+loc.y+" "+loc.z+" "+loc.cell+" "+loc.x+" "+loc.y+" "+loc.z; - - if (!combatStandardAction("grenadier_cold", self, target, targetLoc, "", "")) - { - return SCRIPT_OVERRIDE; - } - - clearOneShotAction(self); - - return SCRIPT_CONTINUE; - } - - - public int grenadier_heat(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - location loc = getLocation(target); - String targetLoc = ""+loc.x+" "+loc.y+" "+loc.z+" "+loc.cell+" "+loc.x+" "+loc.y+" "+loc.z; - - if (!combatStandardAction("grenadier_heat", self, target, targetLoc, "", "")) - { - return SCRIPT_OVERRIDE; - } - - clearOneShotAction(self); - - return SCRIPT_CONTINUE; - } - - - public int grenadier_acid(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - location loc = getLocation(target); - String targetLoc = ""+loc.x+" "+loc.y+" "+loc.z+" "+loc.cell+" "+loc.x+" "+loc.y+" "+loc.z; - - if (!combatStandardAction("grenadier_acid", self, target, targetLoc, "", "")) - { - return SCRIPT_OVERRIDE; - } - - clearOneShotAction(self); - - return SCRIPT_CONTINUE; - } - - - public int grenadier_kinetic(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - location loc = getLocation(target); - String targetLoc = ""+loc.x+" "+loc.y+" "+loc.z+" "+loc.cell+" "+loc.x+" "+loc.y+" "+loc.z; - - if (!combatStandardAction("grenadier_kinetic", self, target, targetLoc, "", "")) - { - return SCRIPT_OVERRIDE; - } - - clearOneShotAction(self); - - return SCRIPT_CONTINUE; - } - - - public void clearOneShotAction(obj_id self) throws InterruptedException - { - setObjVar(self, "ai.combat.oneShotAction", "non_attack"); - } - - - public int krix_burn(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("krix_burn", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int ito_nerve_gas(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("ito_nerve_gas", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - playClientEffectLoc(self, "appearance/pt_sd_ito_nerve_gas.prt", getLocation(self), 0); - - return SCRIPT_CONTINUE; - } - - - public int kenkirk_droid_blast(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - location loc = getLocation(target); - - String strLoc = ""+ loc.x + " "+ loc.y + " "+ loc.z + " "+ loc.cell + " "+ loc.x + " "+ loc.y + " "+ loc.z; - - if (!combatStandardAction("kenkirk_droid_blast", self, target, strLoc, "", "")) - { - return SCRIPT_OVERRIDE; - } - - playClientEffectLoc(target, "appearance/pt_sd_kenkirk_hallway_strike.prt", getLocation(target), 0f); - - return SCRIPT_CONTINUE; - } - - - public int sd_obliterate(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sd_obliterate", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int krix_megaburn(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("krix_megaburn", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int krix_megapatch(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("krix_megapatch", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int vicious_swing(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("vicious_swing", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int sp_action_regen(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("sp_action_regen", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int sm_modify_pistol_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id module = utils.getStaticItemInInventory(self, "item_reward_modify_pistol_01_01"); - - if (!isIdValid(module) || getCount(module) <= 0) - { - sendSystemMessage(self, new string_id("spam", "pistol_module_missing")); - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(self, "sm_modify_pistol_1") || buff.hasBuff(self, "sm_modify_pistol_2") || buff.hasBuff(self, "sm_modify_pistol_3")) - { - sendSystemMessage(self, new string_id("spam", "pistol_buff_exists")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sm_modify_pistol_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doAnimationAction(self, "reload"); - - decrementCount(module); - - return SCRIPT_CONTINUE; - - } - - - public int sm_modify_pistol_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id module = utils.getStaticItemInInventory(self, "item_reward_modify_pistol_01_01"); - - if (!isIdValid(module) || getCount(module) <= 0) - { - sendSystemMessage(self, new string_id("spam", "pistol_module_missing")); - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(self, "sm_modify_pistol_1") || buff.hasBuff(self, "sm_modify_pistol_2") || buff.hasBuff(self, "sm_modify_pistol_3")) - { - sendSystemMessage(self, new string_id("spam", "pistol_buff_exists")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sm_modify_pistol_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doAnimationAction(self, "reload"); - - decrementCount(module); - - return SCRIPT_CONTINUE; - - } - - - public int sm_modify_pistol_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id module = utils.getStaticItemInInventory(self, "item_reward_modify_pistol_01_01"); - - if (!isIdValid(module) || getCount(module) <= 0) - { - sendSystemMessage(self, new string_id("spam", "pistol_module_missing")); - return SCRIPT_OVERRIDE; - } - - if (buff.hasBuff(self, "sm_modify_pistol_1") || buff.hasBuff(self, "sm_modify_pistol_2") || buff.hasBuff(self, "sm_modify_pistol_3")) - { - sendSystemMessage(self, new string_id("spam", "pistol_buff_exists")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("sm_modify_pistol_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - doAnimationAction(self, "reload"); - - decrementCount(module); - - return SCRIPT_CONTINUE; - - } - - - public int kun_one_sacrifice(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_one_sacrifice", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_two_sacrifice(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_two_sacrifice", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_three_sacrifice(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_three_sacrifice", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_four_sacrifice(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_four_sacrifice", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_five_sacrifice(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_five_sacrifice", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_six_sacrifice(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_six_sacrifice", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_seven_sacrifice(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_seven_sacrifice", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_eight_sacrifice(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_eight_sacrifice", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int open_cultist_drain(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("open_cultist_drain", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - dictionary dict = new dictionary(); - dict.put("target", target); - messageTo(self, "handle_drain_anim", dict, 0.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int bm_siphon_master(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("bm_siphon_master", self, target, params, "", "", true)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int minder_luresh_drain(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("minder_luresh_drain", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int closed_fist_cleave(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("closed_fist_cleave", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int closed_fist_toss(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("closed_fist_toss", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int closed_fist_burn(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("closed_fist_burn", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int closed_fist_burn_damage(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("closed_fist_burn_damage", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int lasher_increase_pain(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("lasher_increase_pain", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int subduer_decrease_damage(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("subduer_decrease_damage", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int lasher_strike(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("lasher_strike", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int subduer_strike(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("subduer_strike", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int tomb_guard_cleave(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("tomb_guard_cleave", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int tomb_guard_toss(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("tomb_guard_toss", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int caretaker_blast(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("caretaker_blast", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int caretaker_drain(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("caretaker_drain", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int caretaker_shield(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("caretaker_shield", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int caretaker_shield_reflect(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("caretaker_shield_reflect", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int caretaker_vapors(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("caretaker_vapors", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int ct_guard_buff(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("ct_guard_buff", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_order_set(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_order_set", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_chaos_set(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_chaos_set", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_order_discipline(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_order_discipline", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_chaos_discord(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_chaos_discord", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int executioner_swipe(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("executioner_swipe", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_wrath_cold(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_wrath_cold", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_wrath_heat(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_wrath_heat", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_wrath_electrical(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_wrath_electrical", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_wrath_acid(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_wrath_acid", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_wrath_ward(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_wrath_ward", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_veng_slam(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_veng_slam", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_veng_wave(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_veng_wave", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_open_coil(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_open_coil", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_word_coil(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_word_coil", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_word_flurry(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_word_flurry", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int kun_word_shaken(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_word_shaken", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int kun_sword_multi(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - String[] actions = - { - "kun_word_flurry", - "kun_sword_break", - "kun_sword_cleave", - "kun_sword_defensive" - }; - - queueCommand(self, getStringCrc(actions[rand(0, actions.length - 1)].toLowerCase()), getHateTarget(self), "", COMMAND_PRIORITY_DEFAULT); - - return SCRIPT_CONTINUE; - } - - - public int kun_sword_break(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_sword_break", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - - } - - - public int kun_sword_cleave(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_sword_cleave", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int kun_sword_defensive(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("kun_sword_defensive", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int dire_root_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "dire_root_recourse")) - { - buff.applyBuff(self, self, "dire_root_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int dire_snare_recourse(obj_id self, dictionary params) throws InterruptedException - { - if (!buff.hasBuff(self, "dire_snare_recourse")) - { - buff.applyBuff(self, self, "dire_snare_recourse"); - } - - return SCRIPT_CONTINUE; - } - - - public int bountycheck(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id originalTarget = target; - if (bounty_hunter.canCheckForBounty(self, target)) - { - doAnimationAction(self, "anims.PLAYER_DRAW_DATAPAD"); - - if (bounty_hunter.checkForPresenceOfBounty(self, target)) - { - location spawnLoc = getLocation(target); - setHealth(target, -5000); - trial.cleanupObject(target); - bounty_hunter.spawnFugitive(self, spawnLoc); - } - else - { - utils.setScriptVar(target,"bountyCheck",self); - return SCRIPT_OVERRIDE; - } - } - else - { - return SCRIPT_OVERRIDE; - } - - if (isGod(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!exists(originalTarget)) - { - return SCRIPT_CONTINUE; - } - return SCRIPT_OVERRIDE; - } - - - public int fs_drain_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_drain_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_drain_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_drain_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_drain_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_drain_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_drain_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_drain_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int fs_drain_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!buff.isInFocus(self)) - { - sendSystemMessage(self, new string_id("spam", "fs_command_no_focus")); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("fs_drain_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int col_jedi_statue_light_debuff(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("col_jedi_statue_light_debuff", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int col_jedi_statue_dark_debuff(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("col_jedi_statue_dark_debuff", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dot(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id weapon = getCurrentWeapon(self); - String finalAttackName = heavyweapons.getHeavyWeaponDotName(self, weapon, true); - - if (finalAttackName == null || finalAttackName.equals("")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction(finalAttackName, self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_ae_hw_dot(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - obj_id weapon = getCurrentWeapon(self); - String finalAttackName = heavyweapons.getHeavyWeaponDotName(self, weapon, false); - - if (finalAttackName == null || finalAttackName.equals("")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction(finalAttackName, self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_crit_1(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_crit_1", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_crit_2(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_crit_2", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_crit_3(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_crit_3", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_crit_4(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_crit_4", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_crit_5(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_crit_5", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_hw_dm_crit_6(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_hw_dm_crit_6", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int co_cluster_bomb(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("co_cluster_bomb", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - location centerLoc = getLocation(target); - int extraBomb = getEnhancedSkillStatisticModifierUncapped(self, "expertise_co_cluster_bomblet"); - - int bombCount = 4 + extraBomb; - - for (int i=0; i minRange) - { - target = ((obj_id)(validTargets.get(i))); - break; - } - } - - if (!isIdValid(target)) - { - target = ((obj_id)(validTargets.get(rand(0, validTargets.size() - 1)))); - } - - if (!isIdValid(target) || !exists(target)) - { - createClientProjectileObjectToLocation(self, "object/weapon/ranged/turret/shared_turret_energy.iff", speeder, "muzzle", farTarget, 200.0f, 1.0f, false, 0,0,0,0); - createClientProjectileObjectToLocation(self, "object/weapon/ranged/turret/shared_turret_energy.iff", speeder, "muzzle2", farTarget, 200.0f, 1.0f, false, 0,0,0,0); - play2dNonLoopingSound(self, "sound/hoth_snowspeeder_blaster_fire_01.snd"); - - return SCRIPT_CONTINUE; - } - - queueCommand(self, (-1310636694), target, "", COMMAND_PRIORITY_IMMEDIATE); - - float travelDistance = getDistance(target, self); - - createClientProjectileObjectToObject(self, "object/weapon/ranged/turret/shared_turret_energy.iff", getMountId(self), "muzzle", target, "", 200.0f, 1.0f, false, 0, 0, 0, 0); - createClientProjectileObjectToObject(self, "object/weapon/ranged/turret/shared_turret_energy.iff", getMountId(self), "muzzle2", target, "", 200.0f, 1.0f, false, 0, 0, 0, 0); - play2dNonLoopingSound(self, "sound/hoth_snowspeeder_blaster_fire_01.snd"); - - return SCRIPT_CONTINUE; - } - - - public int hoth_speeder_shoot(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("hoth_speeder_shoot", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int hoth_speeder_up(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!vehicle.isRidingVehicle(self)) - { - return SCRIPT_OVERRIDE; - } - - obj_id mount = getMountId(self); - float height = vehicle.getHoverHeight(mount); - int active = utils.getIntScriptVar(mount, "airborne"); - - if (active == 0) - { - return SCRIPT_OVERRIDE; - } - - if (height > 12.0f) - { - return SCRIPT_OVERRIDE; - } - - height = height + 2.0f; - height = height > 16.0f ? 16.0f : height; - - vehicle.setDampingHeight(mount, 100.0f); - vehicle.setGlide(mount, 100.0f); - - vehicle.setHoverHeight(mount, height); - - messageTo(self, "hoth_speeder_up_reset", null, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int hoth_speeder_up_reset(obj_id self, dictionary params) throws InterruptedException - { - obj_id mount = getMountId(self); - vehicle.setDampingHeight(mount, 0.1f); - vehicle.setGlide(mount, 2.5f); - return SCRIPT_CONTINUE; - } - - - public int hoth_speeder_down(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!vehicle.isRidingVehicle(self)) - { - return SCRIPT_OVERRIDE; - } - - obj_id mount = getMountId(self); - float height = vehicle.getHoverHeight(mount); - - int active = utils.getIntScriptVar(mount, "airborne"); - - if (active == 0) - { - return SCRIPT_OVERRIDE; - } - - if (height < 1.0f) - { - return SCRIPT_OVERRIDE; - } - - height = height - 2.0f; - height = height < 5.0f ? 5.0f : height; - - vehicle.setDampingHeight(mount, 100.0f); - vehicle.setGlide(mount, 100.0f); - - vehicle.setHoverHeight(mount, height); - - messageTo(self, "hoth_speeder_down_reset", null, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int hoth_speeder_down_reset(obj_id self, dictionary params) throws InterruptedException - { - obj_id mount = getMountId(self); - vehicle.setDampingHeight(mount, 0.1f); - vehicle.setGlide(mount, 2.5f); - return SCRIPT_CONTINUE; - } - - - public int hoth_sapper_place(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int hoth_sapper_detonate(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("hoth_sapper_detonate", self, target, params, "", "")) - { - stopCombat(self); - clearHateList(self); - return SCRIPT_OVERRIDE; - } - - kill(self); - return SCRIPT_CONTINUE; - } - - - public int hoth_commando_rocket(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - public int hoth_scout_shield(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!vehicle.isRidingBattlefieldVehicle(self)) - { - removeDefaultAttackOverride(self); - return SCRIPT_OVERRIDE; - } - - obj_id vehicleId = getMountId(self); - - int stasisBuff = buff.getBuffOnTargetFromGroup(vehicleId, "stasis"); - if (stasisBuff != 0) - { - return SCRIPT_OVERRIDE; - } - - if (!buff.canApplyBuff(vehicleId, "hoth_scout_shield")) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("hoth_scout_shield", vehicleId, self, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int hoth_scout_cannon(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!vehicle.isRidingVehicle(self)) - { - removeDefaultAttackOverride(self); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("hoth_scout_cannon", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - location eggLoc = combat.getCommandGroundTargetLocation(params); - location myLoc = getLocation(self); - - float travelDistance = getDistance(myLoc, eggLoc); - float speed = travelDistance; - - playClientEffectObj(self, "sound/wep_veh_blaster.snd", self, ""); - createClientProjectileObjectToLocation(self, "object/weapon/ranged/turret/shared_turret_energy.iff", getMountId(self), "muzzle3", eggLoc, 150.0f, 1.0f, false, 0, 0, 0, 0); - createClientProjectileObjectToLocation(self, "object/weapon/ranged/turret/shared_turret_energy.iff", getMountId(self), "muzzle", eggLoc, 150.0f, 1.0f, false, 0, 0, 0, 0); - return SCRIPT_CONTINUE; - } - - - public int hoth_scout_ear_gun(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!vehicle.isRidingVehicle(self)) - { - removeDefaultAttackOverride(self); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("hoth_scout_ear_gun", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - float travelDistance = getDistance(target, self); - float speed = travelDistance; - - playClientEffectObj(self, "sound/wep_veh_blaster.snd", self, ""); - createClientProjectileObjectToObject(self, "object/weapon/ranged/rifle/shared_rifle_dlt20a.iff", getMountId(self), "muzzle2", target, "", 150.0f, 1.0f, false, 0, 0, 0, 0); - - return SCRIPT_CONTINUE; - } - - - public int hoth_scout_ear_gun_switch(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!vehicle.isRidingVehicle(self)) - { - removeDefaultAttackOverride(self); - return SCRIPT_OVERRIDE; - } - removeDefaultAttackOverride(self); - overrideDefaultAttack(self, "hoth_scout_ear_gun"); - - return SCRIPT_CONTINUE; - } - - - public int hoth_scout_rocket_switch(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!vehicle.isRidingVehicle(self)) - { - removeDefaultAttackOverride(self); - return SCRIPT_OVERRIDE; - } - removeDefaultAttackOverride(self); - overrideDefaultAttack(self, "hoth_scout_rocket"); - - return SCRIPT_CONTINUE; - } - - - public int hoth_scout_rocket(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!vehicle.isRidingVehicle(self)) - { - removeDefaultAttackOverride(self); - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("hoth_scout_rocket", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - location eggLoc = combat.getCommandGroundTargetLocation(params); - location myLoc = getLocation(self); - createClientProjectileObjectToLocation(self, "object/weapon/ranged/rifle/shared_quest_rifle_flame_thrower.iff", getMountId(self), "muzzle4", eggLoc, 150.0f, 2.0f, false, 0, 0, 0, 0); - - return SCRIPT_CONTINUE; - } - - - public int hoth_atat_shoot(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("hoth_atat_shoot", self, target, params, "", "")) - { - String targetName = getCreatureName(target); - if (targetName == null) - { - targetName = getPlayerName(target); - } - LOG("slapHappy", "ATAT has Damaged: "+ target + " ( "+ targetName + " )"); - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int hoth_atat_vehicle_shoot(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!isIdValid(target)) - { - LOG("maggie", "hoth_atat_vehicle_shoot:::: TARGET is INVALID"); - return SCRIPT_CONTINUE; - } - if (!isIdValid(self)) - { - LOG("maggie", "hoth_atat_vehicle_shoot:::: SELF is INVALID"); - return SCRIPT_CONTINUE; - } - - if (!combatStandardAction("hoth_atat_vehicle_shoot", self, target, params, "", "")) - { - LOG("maggie", "hoth_atat_vehicle_shoot:::: Hit Called"); - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } - - - public int hoth_speeder_takeoff(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!vehicle.isRidingVehicle(self)) - { - return SCRIPT_OVERRIDE; - } - - obj_id mount = getMountId(self); - - vehicle.setMinimumSpeed(mount, 29.99f); - vehicle.setMaximumSpeed(mount, 30.0f); - vehicle.setTurnRateMin(mount, 28.0f); - vehicle.setTurnRateMax(mount, 28.0f); - vehicle.setAccelMin(mount, 25.0f); - vehicle.setAccelMax(mount, 25.0f); - vehicle.setDecel(mount, 300.0f); - vehicle.setDampingRoll(mount, 1.0f); - vehicle.setDampingPitch(mount, 1.0f); - vehicle.setDampingHeight(mount, 0.1f); - vehicle.setGlide(mount, 2.5f); - vehicle.setBankingAngle(mount, 50.0f); - vehicle.setHoverHeight(mount, 10.0f); - vehicle.setAutoLevelling(mount, 0.25f); - vehicle.setStrafe(mount, false); - utils.setScriptVar(mount, "airborne", 1); - return SCRIPT_CONTINUE; - } - - - public int hoth_speeder_land(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!vehicle.isRidingVehicle(self)) - { - return SCRIPT_OVERRIDE; - } - - obj_id mount = getMountId(self); - vehicle.initializeVehicle(mount); - - utils.setScriptVar(mount, "airborne", 0); - - return SCRIPT_CONTINUE; - } - - - public int hoth_ai_speeder_shoot(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - - if (!isIdValid(target)) - { - LOG("maggie", "hoth_ai_speeder_shoot:::: TARGET is INVALID"); - return SCRIPT_CONTINUE; - } - if (!isIdValid(self)) - { - LOG("maggie", "hoth_ai_speeder_shoot:::: SELF is INVALID"); - return SCRIPT_CONTINUE; - } - - if (!combatStandardAction("hoth_ai_speeder_shoot", self, target, params, "", "")) - { - LOG("maggie", "hoth_ai_speeder_shoot:::: Hit Called"); - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } - - - public int wampa_boss_ice_throw_prep(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("wampa_boss_ice_throw_prep", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int wampa_boss_ice_throw(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("wampa_boss_ice_throw", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int wampa_boss_tauntaun_throw_prep(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (combatStandardAction("wampa_boss_tauntaun_throw_prep", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int wampa_boss_tauntaun_throw(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (!combatStandardAction("wampa_boss_tauntaun_throw", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int hoth_atat_mine(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - location loc = getLocation(self); - String targetLoc = ""+loc.x+" "+loc.y+" "+loc.z+" "+loc.cell+" "+loc.x+" "+loc.y+" "+loc.z; - - if (!combatStandardAction("hoth_atat_mine", self, target, targetLoc, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int vader_force_choke(obj_id self, obj_id target, String params, float defaultTime) throws InterruptedException - { - if (isPlayer(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!combatStandardAction("vader_force_choke", self, target, params, "", "")) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public boolean performMedicGroupBuff(obj_id medic, obj_id target, String buffName, String params) throws InterruptedException - { - if (!isIdValid(medic) || !exists(medic)) - { - return false; - } - if (!isIdValid(target) || !exists(target)) - { - return false; - } - if (buffName == null || buffName.length() <= 0) - { - return false; - } - if (params == null || params.length() <= 0) - { - return false; - } - - obj_id tgId = getGroupObject(target); - obj_id sgId = getGroupObject(medic); - boolean performed_buff = false; - - if (!isIdValid(tgId) || !isIdValid(sgId) || sgId != tgId) - { - performed_buff |= combatStandardAction(buffName, medic, target, params, "", ""); - obj_id beast = beast_lib.getBeastOnPlayer(target); - if (isIdValid(beast) && exists(beast) && !isDead(beast) && getDistance(medic, beast) < 72.0f) - { - performed_buff |= combatStandardAction(buffName, medic, beast, params, "", ""); - } - - if (!performed_buff) - { - return false; - } - } - else - { - obj_id[] members = getGroupMemberIds(sgId); - - for (int i=0; i 0) - { - setObjVar(self, "weapon.original_max_range", weaponRange); - } - else - { - CustomerServiceLog("weap_conversion_bad", "POSSIBLE :BROKEN WEAPON: COULD NOT GET MAX RANGE FOR "+ self + " template: "+ getTemplateName(self)); - return; - } - } - - obj_id holder = getContainedBy(self); - - if (!isIdNull(holder) && isPlayer(holder)) - { - if (self == getObjectInSlot(holder, "hold_r")) - { - weapons.adjustWeaponRangeForExpertise(holder, self, true); - } - - else - { - weapons.adjustWeaponRangeForExpertise(holder, self, false); - } - } - - else - { - weapons.adjustWeaponRangeForExpertise(null, self, false); - } - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "weaponConversion", null, 5, false); - - return SCRIPT_CONTINUE; - } - - - public int weaponConversion(obj_id self, dictionary params) throws InterruptedException - { - - obj_id owner = utils.getContainingPlayerOrCreature( self ); - int niche = ai_lib.aiGetNiche(owner); - - if (niche != 1) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, "isCreatureWeapon")) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "QAWeapon")) - { - return SCRIPT_CONTINUE; - } - - if (static_item.isStaticItem(self)) - { - expertiseRangeModify(self); - - return SCRIPT_CONTINUE; - } - else - { - - int currentVersion = getConversionId(self); - int masterVersion = 0; - - boolean isCoredWeapon = weapons.isCoredWeapon(self); - - if (isCoredWeapon) - { - masterVersion = weapons.CORED_WEAPON_CONVERSION_VERSION; - } - else - { - masterVersion = weapons.CONVERSION_VERSION; - } - - if (currentVersion != masterVersion) - { - if (static_item.isDynamicItem(self)) - { - - weapons.staticDynamicWeaponConversion(self); - } - else if (isCoredWeapon) - { - - weapons.coredWeaponConversion(self); - } - else - { - - weapons.clickCombatWeaponConversion(self); - } - } - } - - weapons.validateWeaponDamageType(self); - - weapons.validateWeaponRange(self); - - weapons.setWeaponData(self); - - expertiseRangeModify(self); - - if (weapons.checkForIllegalStorytellerWeapon(owner, self)) - { - weapons.handleIllegalStorytellerWeapon(owner, self, "OnInitialize"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - if (isPlayer(destContainer) && !combat.hasCertification(destContainer, self)) - { - prose_package pp = new prose_package(); - pp = prose.setStringId(pp, new string_id("spam", "weapon_no_cert")); - pp = prose.setTT(pp, self); - sendSystemMessageProse(destContainer, pp); - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnTransferred(obj_id self, obj_id sourceContainer, obj_id destContainer, obj_id transferer) throws InterruptedException - { - expertiseRangeModify(self); - - if (isPlayer(destContainer)) - { - setDamageSkillMods( destContainer, self ); - proc.buildCurrentProcList(destContainer); - } - else if (isPlayer(sourceContainer)) - { - setDamageSkillMods( sourceContainer, null ); - proc.buildCurrentProcList(sourceContainer); - } - - return SCRIPT_CONTINUE; - } - - - public void setDamageSkillMods(obj_id player, obj_id weapon) throws InterruptedException - { - int intMultiplier = combat.PLAYER_ATTACKER_DAMAGE_LEVEL_MULTIPLIER; - int intBaseDamage = combat.PLAYER_COMBAT_BASE_DAMAGE; - - int weaponMinDamage = 0; - int weaponMaxDamage = 0; - if (isIdValid(weapon)) - { - weaponMinDamage = getWeaponMinDamage(weapon); - weaponMaxDamage = getWeaponMaxDamage(weapon); - } - int playerLevel = getLevel( player ); - - int minDamage = weaponMinDamage + ( playerLevel * intMultiplier ); - int maxDamage = intBaseDamage + weaponMaxDamage + ( playerLevel * intMultiplier ); - - int oldMin = getSkillStatisticModifier(player, "minDamage"); - applySkillStatisticModifier(player, "minDamage", 0-oldMin); - int oldMax = getSkillStatisticModifier(player, "maxDamage"); - applySkillStatisticModifier(player, "maxDamage", 0-oldMax); - - applySkillStatisticModifier(player, "minDamage", minDamage); - applySkillStatisticModifier(player, "maxDamage", maxDamage); - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - - String at = "@obj_attr_n:"; - boolean staticItem = static_item.isStaticItem(self); - - int free = getFirstFreeIndex(names); - if (free == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - String template = getTemplateName(self); - if (template != null) - { - dictionary itemData = new dictionary(); - - if (staticItem) - { - itemData = static_item.getMasterItemDictionary(self); - } - - int levelRequired = -1; - if (hasObjVar(self, weapons.OBJVAR_WP_LEVEL)) - { - levelRequired = getIntObjVar(self, weapons.OBJVAR_WP_LEVEL); - } - else - { - - levelRequired = dataTableGetInt(combat.WEAPON_LEVEL_TABLE, template, "weapon_level"); - if (staticItem) - { - levelRequired = itemData.getInt("required_level"); - } - if (static_item.isDynamicItem(self)) - { - levelRequired = getIntObjVar(self, "dynamic_item.intLevelRequired"); - } - } - - names[free] = "healing_combat_level_required"; - attribs[free++] = "" + levelRequired; - - names[free] = "tooltip.healing_combat_level_required"; - attribs[free++] = "" + levelRequired; - - String skillRequired = dataTableGetString(combat.WEAPON_LEVEL_TABLE, template, "secondary_restriction"); - - if (staticItem) - { - skillRequired = itemData.getString("required_skill"); - } - - String skillRequiredAttribute; - if (skillRequired != null && !skillRequired.equals("")) - { - skillRequiredAttribute = "@ui_roadmap:title_"+ skillRequired; - } - else - { - skillRequiredAttribute = "None"; - } - - if (static_item.isDynamicItem(self)) - { - skillRequiredAttribute = "None"; - } - - names[free] = "skillmodmin"; - attribs[free++] = skillRequiredAttribute; - - names[free] = "tooltip.skillmodmin"; - attribs[free++] = skillRequiredAttribute; - - int speciesRequired = dataTableGetInt(combat.WEAPON_LEVEL_TABLE, template, "species_restriction"); - if (speciesRequired > 0) - { - names[free] = "race_requirement"; - attribs[free++] = "@weapon_detail:species_" + speciesRequired; - - names[free] = "tooltip.race_requirement"; - attribs[free++] = "@weapon_detail:species_" + speciesRequired; - } - - if (staticItem) - { - - int tier = itemData.getInt("tier"); - names[free] = "tier"; - attribs[free++] = "" + tier; - - names[free] = "tooltip.tier"; - attribs[free++] = "" + tier; - } - } - - weapon_data weaponData = getWeaponData(self); - if (weaponData != null) - { - - { - String wpn_damage_type = "cat_wpn_damage.wpn_damage_type"; - String wpn_damage_min = "cat_wpn_damage.wpn_damage_min"; - String wpn_damage_max = "cat_wpn_damage.wpn_damage_max"; - String wpn_damage_radius = "cat_wpn_damage.wpn_damage_radius"; - String wpn_damage_wound = "cat_wpn_damage.wpn_wound_chance"; - String wpn_elemental_type = "cat_wpn_damage.wpn_elemental_type"; - String wpn_elemental_value = "cat_wpn_damage.wpn_elemental_value"; - String wpn_category = "cat_wpn_damage.wpn_category"; - - final int damageType = weaponData.damageType; - names[free] = wpn_damage_type; - attribs[free++] = at + "armor_eff_" + weapons.getDamageTypeString(damageType); - - names[free] = "cat_wpn_damage.wpn_category"; - attribs[free++] = at + "wpn_category_" + weaponData.weaponType; - - names[free] = "tooltip.wpn_damage_type"; - attribs[free++] = at + "armor_eff_" + weapons.getDamageTypeString(damageType); - - names[free] = "cat_wpn_damage.wpn_attack_speed"; - attribs[free++] = floatFormat.format(weaponData.attackSpeed); - - names[free] = "cat_wpn_damage.damage"; - String weaponDamage = Integer.toString(weaponData.minDamage) + " - "+ Integer.toString(weaponData.maxDamage); - attribs[free++] = weaponDamage; - - names[free] = "tooltip.damage"; - attribs[free++] = weaponDamage; - - final int elementalType = weaponData.elementalType; - int elementalValue = 0; - if (elementalType > 0) - { - elementalValue = weaponData.elementalValue; - if (elementalValue > 0) - { - names[free] = wpn_elemental_type; - attribs[free++] = at + weapons.getDamageTypeString(elementalType); - names[free] = wpn_elemental_value; - attribs[free++] = Integer.toString(elementalValue); - - names[free] = "tooltip.wpn_elemental_type"; - attribs[free++] = at + weapons.getDamageTypeString(elementalType); - names[free] = "tooltip.wpn_elemental_value"; - attribs[free++] = Integer.toString(elementalValue); - } - } - - names[free] = "cat_wpn_damage.weapon_dps"; - float avg = (weaponData.minDamage + weaponData.maxDamage) / 2; - - avg += (elementalValue * 2); - attribs[free++] = "" + (int)(avg / weaponData.attackSpeed); - - } - - { - names[free] = "cat_wpn_other.wpn_range"; - String weaponRange = noDecimalFormat.format(weaponData.minRange) + "-"+ noDecimalFormat.format(weaponData.maxRange) + "m"; - attribs[free++] = weaponRange; - - names[free] = "tooltip.wpn_range"; - attribs[free++] = weaponRange; - - } - - } - - if (staticItem) - { - dictionary itemData = static_item.getStaticItemWeaponDictionary(self); - String procEffect = itemData.getString("proc_effect"); - if (procEffect != null && !procEffect.equals("")) - { - names[free] = utils.packStringId( new string_id ( "proc/proc", "proc_name" )); - attribs[free++] = utils.packStringId( new string_id ( "ui_buff", procEffect)); - } - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public obj_id getContainingMobile(obj_id item) throws InterruptedException - { - obj_id containedBy = getContainedBy(item); - - if (!isIdValid(containedBy)) - { - return null; - } - else if (isPlayer(containedBy) || isMob(containedBy)) - { - return containedBy; - } - - return getContainingMobile(containedBy); - } - - - public int handleConvertSchemSui(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - - int pageId = params.getInt("pageId"); - - if (!sui.hasPid(player, PID_NAME)) - { - forceCloseSUIPage(pageId); - CustomerServiceLog("new_weapon_conversion", "Player "+getFirstName(player)+"("+player+") has somehow gotten two conversion windows while attempting to convert their old weapon("+self+") to a new cored schematic. Bailing out now"); - return SCRIPT_CONTINUE; - } - - int pid = sui.getPid(player, PID_NAME); - - if (pageId != pid) - { - forceCloseSUIPage(pageId); - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - CustomerServiceLog("new_weapon_conversion", "Player "+getFirstName(player)+"("+player+") has somehow gotten two conversion windows while attempting to convert their old weapon("+self+") to a new cored schematic. Bailing out now"); - return SCRIPT_CONTINUE; - } - - if (!utils.isNestedWithinAPlayer(self)) - { - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - CustomerServiceLog("new_weapon_conversion", "Player "+getFirstName(player)+"("+player+") has moved their weapon into a container that is not a player while attempting to convert their old weapon("+self+") to a new cored schematic. Bailing out now"); - return SCRIPT_CONTINUE; - } - - if (utils.isEquipped(self)) - { - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - CustomerServiceLog("new_weapon_conversion", "Player "+getFirstName(player)+"("+player+") has equipped their old weapon("+self+") while attempting to convert it int a new cored schematic. Bailing out now"); - return SCRIPT_CONTINUE; - } - - obj_id playerContained = utils.getContainingPlayer(self); - - if (playerContained != player) - { - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - CustomerServiceLog("new_weapon_conversion", "Player "+getFirstName(player)+"("+player+") traded their old weapon("+self+") to "+ getFirstName(playerContained) + "("+playerContained+") while attempting to convert it int a new cored schematic. They are prolly trying to exploit, bailing out now"); - return SCRIPT_CONTINUE; - } - - obj_id bioLink = getBioLink(self); - if (isIdValid(bioLink) && utils.stringToLong(bioLink.toString()) != 1) - { - if (bioLink != player) - { - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - CustomerServiceLog("armor_conversion", "Player "+getFirstName(player)+"("+player+") tried to deconstruct an old weapon("+self+") that is biolinked to "+ getFirstName(bioLink) + "("+bioLink+"). They are prolly trying to exploit, bailing out now"); - return SCRIPT_CONTINUE; - } - } - - String response = sui.getInputBoxText(params); - - if (!response.toLowerCase().equals("deconstruct")) - { - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - sendSystemMessage(player, weapons.SID_CONVERT_INVALID_RESPONSE); - CustomerServiceLog("new_weapon_conversion", "Player "+getFirstName(player)+"("+player+") has entered '"+ response + "' instead of 'deconstruct' so the weapon will not be deconstructed."); - return SCRIPT_CONTINUE; - } - - if (weapons.turnWeaponIntoSchem(player, self)) - { - CustomerServiceLog("new_weapon_conversion", "Player "+getFirstName(player)+"("+player+") has decided to convert their old weapon("+self+") to a new cored schematic."); - sui.removePid(player, PID_NAME); - sendSystemMessage(player, weapons.SID_CONVERT_CONVERT_SUCCESS); - destroyObject(self); - return SCRIPT_CONTINUE; - } - else - { - sendSystemMessage(player, weapons.SID_CONVERT_CONVERT_FAIL); - CustomerServiceLog("new_weapon_conversion", "Player "+getFirstName(player)+"("+player+") attempted to convert their old weapon("+self+") to a new cored schematic, and it failed."); - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/crafting/base_tool.java b/sku.0/sys.server/compiled/game/script/systems/crafting/base_tool.java deleted file mode 100644 index 702616815..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/crafting/base_tool.java +++ /dev/null @@ -1,480 +0,0 @@ -package script.systems.crafting; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.craftinglib; -import script.library.jedi_trials; -import script.library.pet_lib; -import script.library.utils; -import script.library.temp_schematic; -import script.library.session; - - -public class base_tool extends script.base_script -{ - public base_tool() - { - } - public static final String PROTOTYPE_SLOT = "anythingNoMod2"; - - public static final String OBJVAR_CRAFTING_FAKE_PROTOTYPE = "crafting.isFakePrototype"; - - public static final float[] COMPLEXITY_LIMIT = - { - 15, - 20, - 25 - }; - - - public int OnAttach(obj_id self) throws InterruptedException - { - - setObjVar(self, craftinglib.OBJVAR_PROTOTYPE_TIME, 0.0f); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - float time = getFloatObjVar(self, craftinglib.OBJVAR_PROTOTYPE_TIME); - if (time == 0.0f) - { - removeObjVar(self, craftinglib.OBJVAR_CRAFTER); - } - - String template = getTemplateName(self); - - if (template != null && template.indexOf("weapon_tool.iff") >= 0) - { - int craftingType = getIntObjVar(self, craftinglib.OBJVAR_CRAFTING_TYPE); - - craftingType &= ~CT_genericItem; - craftingType |= CT_misc; - - setObjVar(self, craftinglib.OBJVAR_CRAFTING_TYPE, craftingType); - } - - return SCRIPT_CONTINUE; - } - - - public int determineCraftingLevel(obj_id tool, obj_id player) throws InterruptedException - { - - int craftingLevel = 0; - obj_id stationId = obj_id.NULL_ID; - debugServerConsoleMsg(tool, "OnObjectMenuRequest initial crafting level 0"); - - int toolType = getIntObjVar(tool, craftinglib.OBJVAR_CRAFTING_TYPE); - if (toolType == 0) - { - LOG("crafting", "No crafting type defined for object "+ tool); - return -1; - } - - if (toolType != CT_genericItem) - { - ++craftingLevel; - debugServerConsoleMsg(tool, "OnObjectMenuRequest crafting level 1"); - - location myPos = getLocation(player); - - debugServerConsoleMsg(tool, "Looking for a crafting station, I think I'm at location "+ myPos); - - obj_id[] testIds = getObjectsInRange(myPos, craftinglib.STATION_AREA); - if (testIds != null) - { - float closestLength = craftinglib.STATION_AREA + 100.0f; - for (int i = 0; i < testIds.length; ++i) - { - testAbortScript(); - if (isIdValid(testIds[i]) && hasObjVar(testIds[i], craftinglib.OBJVAR_STATION)) - { - debugServerConsoleMsg(tool, "Testing crafting station "+ testIds[i] + " at "+ getLocation(testIds[i])); - float dist = getDistance(testIds[i], myPos); - debugServerConsoleMsg(tool, "\tstation distance = "+ dist); - if (dist >= 0 && dist < closestLength) - { - closestLength = dist; - stationId = testIds[i]; - } - } - } - - if ((isIdValid(stationId) && ((ai_lib.getNiche(stationId) != NICHE_DROID && ai_lib.getNiche(stationId) != NICHE_ANDROID) || pet_lib.isMyPet(stationId, player)))) - { - debugServerConsoleMsg(tool, "Found crafting station "+ stationId + " at "+ getLocation(stationId)); - - int stationType = getIntObjVar(stationId, craftinglib.OBJVAR_CRAFTING_TYPE); - if ((stationType & toolType) != 0) - { - ++craftingLevel; - debugServerConsoleMsg(tool, "OnObjectMenuRequest crafting level 2"); - - int privateStation = getIntObjVar(stationId, craftinglib.OBJVAR_PRIVATE_STATION); - if ((privateStation == 1 && (ai_lib.aiGetNiche(stationId) != NICHE_DROID || ai_lib.aiGetNiche(stationId) != NICHE_ANDROID))) - { - ++craftingLevel; - debugServerConsoleMsg(tool, "OnObjectMenuRequest crafting level 3"); - } - else if (privateStation == 2 && (ai_lib.aiGetNiche(stationId) == NICHE_DROID || ai_lib.aiGetNiche(stationId) != NICHE_ANDROID)) - { - craftingLevel = craftingLevel + 2; - debugServerConsoleMsg(tool, "OnObjectMenuRequest crafting level 4"); - } - } - else - { - debugServerConsoleMsg(tool, "OnObjectMenuRequest station is wrong type "+ stationType); - } - } - else - { - debugServerConsoleMsg(tool, "OnObjectMenuRequest no station objvar"); - } - } - } - - String template = getTemplateName(stationId); - - if (template != null && template.indexOf("weapon_station.iff") >= 0) - { - int craftingType = getIntObjVar(stationId, craftinglib.OBJVAR_CRAFTING_TYPE); - - craftingType &= ~CT_genericItem; - craftingType |= CT_misc | CT_lightsaber; - - setObjVar(stationId, craftinglib.OBJVAR_CRAFTING_TYPE, craftingType); - } - - if (!setCraftingLevelAndStation(player, craftingLevel, stationId)) - { - debugServerConsoleMsg(tool, "OnObjectMenuRequest failed to set crafting level on player"); - craftingLevel = -1; - } - return craftingLevel; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - int craftingLevel = determineCraftingLevel(self, player); - if (craftingLevel == -1) - { - return SCRIPT_OVERRIDE; - } - - menu_info_data craft_menu = mi.getMenuItemByType (menu_info_types.CRAFT_START); - if (craft_menu != null) - { - - float time = getFloatObjVar(self, craftinglib.OBJVAR_PROTOTYPE_TIME); - if (time == 0.0f && isIdValid(getObjectInSlot(self, PROTOTYPE_SLOT))) - { - mi.addSubMenu (craft_menu.getId(), menu_info_types.CRAFT_HOPPER_OUTPUT, null); - } - - if (craftingLevel == 3) - { - mi.addSubMenu (craft_menu.getId(), menu_info_types.CRAFT_HOPPER_INPUT, null); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnRequestDraftSchematics(obj_id self, obj_id player, int[] schematics, float[] complexities) throws InterruptedException - { - debugServerConsoleMsg(self, "OnRequestDraftSchematics enter, num schematics = "+ schematics.length); - - if (schematics.length > 0 && schematics.length == complexities.length) - { - int craftingLevel = determineCraftingLevel(self, player); - if (craftingLevel == -1) - { - return SCRIPT_OVERRIDE; - } - - debugServerConsoleMsg(self, "OnRequestDraftSchematics crafting level = "+ craftingLevel); - - int[] allowedSchematics; - if (craftingLevel < 3) - { - allowedSchematics = new int[schematics.length]; - for (int i = 0; i < schematics.length; ++i) - { - testAbortScript(); - if (complexities[i] <= COMPLEXITY_LIMIT[craftingLevel]) - { - allowedSchematics[i] = schematics[i]; - } - else - { - allowedSchematics[i] = 0; - } - } - } - else - { - allowedSchematics = schematics; - } - - if (sendUseableDraftSchematics(player, allowedSchematics)) - { - return SCRIPT_CONTINUE; - } - } - - debugServerConsoleMsg(self, "OnRequestDraftSchematics exit - override"); - return SCRIPT_OVERRIDE; - } - - - public int OnAboutToReceiveItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - if (transferer == obj_id.NULL_ID || transferer == srcContainer) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_OVERRIDE; - } - - - public int OnAboutToLoseItem(obj_id self, obj_id destContainer, obj_id transferer, obj_id item) throws InterruptedException - { - debugServerConsoleMsg(self, "Crafting station OnAboutToLoseItem enter"); - float time = getFloatObjVar(self, craftinglib.OBJVAR_PROTOTYPE_TIME); - if (time != 0.0f) - { - debugServerConsoleMsg(self, "Crafting station OnAboutToLoseItem preventing prototype from being removed"); - return SCRIPT_OVERRIDE; - } - debugServerConsoleMsg(self, "Crafting station OnAboutToLoseItem allowing prototype to be removed"); - return SCRIPT_CONTINUE; - } - - - public int OnAboutToOpenContainer(obj_id self, obj_id whoOpenedMe) throws InterruptedException - { - debugServerConsoleMsg(self, "Crafting station OnAboutToOpenContainer enter"); - float time = getFloatObjVar(self, craftinglib.OBJVAR_PROTOTYPE_TIME); - if (time != 0.0f) - { - - sendSystemMessage (whoOpenedMe, new string_id("system_msg", "cant_open_output_hopper")); - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnCraftingAddResource(obj_id self, obj_id player, obj_id resource, draft_schematic.slot ingredientSlot, modifiable_int[] resourceAmount) throws InterruptedException - { - int numResources = resourceAmount.length; - int totalResources = ingredientSlot.amountRequired; - - int resourcesPer = totalResources / numResources; - if (totalResources % numResources != 0) - { - ++resourcesPer; - } - - for (int i = 0; i < numResources; ++i) - { - testAbortScript(); - resourceAmount[i].set(resourcesPer); - } - - return SCRIPT_CONTINUE; - } - - - public int OnCraftingDone(obj_id self, obj_id player, String schematicName, int craftingStage, boolean normalExit) throws InterruptedException - { - session.logActivity(player, session.ACTIVITY_CRAFTING); - if ((craftingStage != CS_selectDraftSchematic && craftingStage != CS_assembly && schematicName != null && schematicName.length() > 0)) - { - temp_schematic.decrement(player, getObjectTemplateCrc(schematicName)); - } - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (hasObjVar(self, "quality")) - { - names[idx] = "quality"; - float attrib = getFloatObjVar(self, "quality"); - attribs[idx] = " " + attrib; - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - int critAssembly = getIntObjVar(self, craftinglib.OBJVAR_FORCE_CRITICAL_ASSEMBLY); - if (critAssembly > 0) - { - names[idx] = "@crafting:crit_assembly"; - attribs[idx] = "" + critAssembly; - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - int critExperiment = getIntObjVar(self, craftinglib.OBJVAR_FORCE_CRITICAL_EXPERIMENT); - if (critExperiment > 0) - { - names[idx] = "@crafting:crit_experiment"; - attribs[idx] = "" + critExperiment; - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int prototypeDone(obj_id self, dictionary params) throws InterruptedException - { - obj_id prototype = params.getObjId("prototype"); - obj_id crafter = params.getObjId("crafter"); - - debugServerConsoleMsg(self, "prototypeDone enter, crafter = "+ crafter + ", prototype = "+ prototype); - - LOG("crafting_counter", "testing tool completion!"); - - debugSpeakMsg(self, "PING! The prototype is done now."); - setObjVar(self, craftinglib.OBJVAR_PROTOTYPE_TIME, 0.0f); - removeObjVar(self, craftinglib.OBJVAR_CRAFTER); - removeObjVar(self, craftinglib.OBJVAR_PROTOTYPE_START); - removeObjVar(self, craftinglib.OBJVAR_CRAFTING_PROTOTYPE_OBJECT); - removeObjVar(self, craftinglib.OBJVAR_CRAFTING_PROTOTYPE_CRAFTER); - - if (hasScript(crafter, "theme_park.new_player.new_player") || hasScript(crafter, jedi_trials.PADAWAN_TRIALS_SCRIPT)) - { - if (isIdValid(prototype)) - { - String templateName = getTemplateName(prototype); - - if (templateName != null && !templateName.equals("")) - { - dictionary webster = new dictionary(); - webster.put("prototype", prototype); - webster.put("prototypeTemplate", templateName); - messageTo(crafter, "handleQuestCraftingAction", webster, 1, false); - } - else - { - LOG("new_player", "New player "+ crafter + " successfully made prototype item "+ prototype + " but its template name is null, so the new player crafting action failed!"); - } - } - } - - endCraftingSession(crafter, self, params.getObjId("prototype")); - - getPrototype(self, params); - - logBalance( "crafting;"+getGameTime()+";"+crafter+";"+prototype+";"+getTemplateName(prototype) ); - - return SCRIPT_CONTINUE; - } - - - public obj_id getFirstParentInWorldOrPlayer(obj_id obj) throws InterruptedException - { - obj_id firstParent = getFirstParentInWorld(obj); - while (obj != firstParent && !isPlayer(obj)) - { - testAbortScript(); - obj = getContainedBy(obj); - } - return obj; - } - - - public int getPrototype(obj_id self, dictionary params) throws InterruptedException - { - obj_id crafter = params.getObjId("crafter"); - obj_id owner = getFirstParentInWorldOrPlayer(self); - - float time = getFloatObjVar(self, craftinglib.OBJVAR_PROTOTYPE_TIME); - if (time != 0.0f && isIdValid(owner)) - { - sendSystemMessage (owner, new string_id("system_msg", "cant_open_output_hopper")); - return SCRIPT_OVERRIDE; - } - - if (isIdValid(owner)) - { - obj_id inventory = getObjectInSlot(owner, utils.SLOT_INVENTORY); - if (isIdValid(inventory)) - { - obj_id prototype = params.getObjId("prototype"); - if (!isIdValid(prototype)) - { - - obj_id mightBePrototype = getObjectInSlot(self, PROTOTYPE_SLOT); - if (!isIdValid(mightBePrototype)) - { - return SCRIPT_CONTINUE; - } - prototype = mightBePrototype; - } - - if (hasObjVar(prototype, OBJVAR_CRAFTING_FAKE_PROTOTYPE)) - { - destroyObject(prototype); - } - else - { - - if (putIn(prototype, inventory)) - { - sendSystemMessage (owner, new string_id("system_msg", "prototype_transferred")); - } - else - { - sendSystemMessage (owner, new string_id("system_msg", "prototype_not_transferred")); - } - } - } - else - { - - sendSystemMessage (owner, new string_id("system_msg", "prototype_done")); - } - } - else if (isIdValid(crafter)) - { - - sendSystemMessage (crafter, new string_id("system_msg", "prototype_done")); - } - setCount(self, 0); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/crafting/furniture/crafting_base_furniture_customization.java b/sku.0/sys.server/compiled/game/script/systems/crafting/furniture/crafting_base_furniture_customization.java deleted file mode 100644 index d045b2acb..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/crafting/furniture/crafting_base_furniture_customization.java +++ /dev/null @@ -1,69 +0,0 @@ -package script.systems.crafting.furniture; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.craftinglib; - - - -public class crafting_base_furniture_customization extends script.systems.crafting.crafting_base -{ - public crafting_base_furniture_customization() - { - } - public static final String VERSION = "v1.00.00"; - - - public void calcAndSetPrototypeProperties(obj_id prototype, draft_schematic.attribute[] itemAttributes, dictionary craftingValuesDictionary) throws InterruptedException - { - - for (int i = 0; i < itemAttributes.length; ++i) - { - testAbortScript(); - if (itemAttributes[i] == null) - { - continue; - } - - if (itemAttributes[i].name.getAsciiId().equals("charges")) - { - itemAttributes[i].currentValue = (itemAttributes[i].minValue + itemAttributes[i].maxValue) + itemAttributes[i].currentValue; - } - } - - super.calcAndSetPrototypeProperties ( prototype, itemAttributes, craftingValuesDictionary ); - } - - - public void calcAndSetPrototypeProperties(obj_id prototype, draft_schematic.attribute[] itemAttributes) throws InterruptedException - { - - debugServerConsoleMsg(null, "Beginning assembly-phase prototype property setting"); - for (int i = 0; i < itemAttributes.length; ++i) - { - testAbortScript(); - if (itemAttributes[i] == null) - { - continue; - } - - if (!calcAndSetPrototypeProperty ( prototype, itemAttributes[i])) - { - - setObjVar (prototype, craftinglib.COMPONENT_ATTRIBUTE_OBJVAR_NAME + "."+ itemAttributes[i].name.getAsciiId(), - (int)itemAttributes[i].currentValue); - - setCount(prototype, (int)itemAttributes[i].currentValue); - } - } - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/crafting/furniture/specific_item/structure_customization_kit.java b/sku.0/sys.server/compiled/game/script/systems/crafting/furniture/specific_item/structure_customization_kit.java deleted file mode 100644 index 331137bfe..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/crafting/furniture/specific_item/structure_customization_kit.java +++ /dev/null @@ -1,88 +0,0 @@ -package script.systems.crafting.furniture.specific_item; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.craftinglib; - - - -public class structure_customization_kit extends script.systems.crafting.furniture.crafting_base_furniture_customization -{ - public structure_customization_kit() - { - } - public static final String VERSION = "v0.00.00"; - - public static final String[] REQUIRED_SKILLS = - { - "crafting_architect_novice" - }; - - public static final String[] ASSEMBLY_SKILL_MODS = - { - "structure_assembly" - }; - - public static final String[] EXPERIMENT_SKILL_MODS = - { - "structure_experimentation" - }; - - public static final resource_weight[] OBJ_ASSEMBLY_ATTRIBUTE_RESOURCES = - { - new resource_weight("charges", new resource_weight.weight[] - { - new resource_weight.weight(craftinglib.RESOURCE_DECAY_RESIST, 1), - new resource_weight.weight(craftinglib.RESOURCE_QUALITY, 1) - } - ) - }; - - public static final resource_weight[] OBJ_MAX_ATTRIBUTE_RESOURCES = - { - new resource_weight("charges", new resource_weight.weight[] - { - new resource_weight.weight(craftinglib.RESOURCE_DECAY_RESIST, 1), - new resource_weight.weight(craftinglib.RESOURCE_QUALITY, 1) - } - ) - }; - - - public String[] getRequiredSkills() throws InterruptedException - { - return REQUIRED_SKILLS; - } - - - public String[] getAssemblySkillMods() throws InterruptedException - { - return ASSEMBLY_SKILL_MODS; - } - - - public String[] getExperimentSkillMods() throws InterruptedException - { - return EXPERIMENT_SKILL_MODS; - } - - - public resource_weight[] getResourceMaxResourceWeights() throws InterruptedException - { - return OBJ_MAX_ATTRIBUTE_RESOURCES; - } - - - public resource_weight[] getAssemblyResourceWeights() throws InterruptedException - { - return OBJ_ASSEMBLY_ATTRIBUTE_RESOURCES; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/crafting/space/reverse_engineering/armor_analysis_tool.java b/sku.0/sys.server/compiled/game/script/systems/crafting/space/reverse_engineering/armor_analysis_tool.java deleted file mode 100644 index b8e257fc9..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/crafting/space/reverse_engineering/armor_analysis_tool.java +++ /dev/null @@ -1,332 +0,0 @@ -package script.systems.crafting.space.reverse_engineering; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.sui; -import script.library.temp_schematic; -import script.library.space_crafting; -import script.library.create; -import script.library.xp; - - -public class armor_analysis_tool extends script.base_script -{ - public armor_analysis_tool() - { - } - public static final string_id LOOT_LIST = new string_id("sui", "analyze_loot"); - - public static final String TABLE = "datatables/ship/components/armor.iff"; - - public static final String TOOL = "reverse_engineering_tool"; - - public static final String LOOT = "datatables/space_loot/reverse_engineering/reverse_loot.iff"; - public static final String LOOT_LOOKUP = "datatables/space_loot/reverse_engineering/reverse_loot_lookup.iff"; - - public static final String SCRIPTVAR_ANALYZE_SUI = "analyzer.sui"; - public static final String SCRIPTVAR_ANALYZE_IDS = "analyzer.ids"; - - public static final String STF = "component_analyzer"; - - public static final String ANALYZE_TITLE = "@"+ STF + ":analyze_title"; - public static final String ANALYZE_PROMPT = "@"+ STF + ":analyze_prompt"; - public static final String NO_ITEMS_PROMPT = "@"+ STF + ":no_items"; - - public static final String BTN_ANALYZE = "@"+ STF + ":analyze"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnAboutToReceiveItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - if (space_crafting.getShipComponentStringType(item) != "armor") - { - string_id errormessage2 = new string_id(TOOL, "wrong_component_type"); - sendSystemMessage(transferer, errormessage2); - return SCRIPT_OVERRIDE; - } - if (getBooleanObjVar(item, "cannotReverseEngineer") == true) - { - string_id errormessage = new string_id(TOOL, "already_engineered"); - sendSystemMessage(transferer, errormessage); - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - if (hasObjVar(self, "reverse_engineering.charges")) - { - - int value = getIntObjVar(self, "reverse_engineering.charges"); - names[idx] = "charges"; - attribs[idx] = Integer.toString(value); - idx++; - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - int lootList = mi.addRootMenu(menu_info_types.SERVER_MENU1, LOOT_LIST); - if (lootList > -1 && (( getContainedBy(self) != getOwner(self) ) || isGod(player))) - { - String template = utils.getTemplateFilenameNoPath(self); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(item, "character.builder")) - { - return SCRIPT_CONTINUE; - } - - String template = utils.getTemplateFilenameNoPath(self); - - if (item == menu_info_types.SERVER_MENU1) - { - int charges = getIntObjVar(self, "reverse_engineering.charges"); - - obj_id[] x = getContents(self); - int countX = 0; - String temp = ""; - if (x[0] != null) - { - temp = getTemplateName(x[0]); - - } - for (int i = 0; i < x.length; i++) - { - testAbortScript(); - - if (space_crafting.getShipComponentStringType(x[i]) != "armor") - { - string_id errormessage2 = new string_id(TOOL, "wrong_component_type"); - sendSystemMessage(player, errormessage2); - return SCRIPT_CONTINUE; - } - - if (getTemplateName(x[i]).equals(temp)) - { - countX++; - } - - if (getBooleanObjVar(x[i], "cannotReverseEngineer") == true) - { - string_id errormessage = new string_id(TOOL, "already_engineered"); - sendSystemMessage(player, errormessage); - return SCRIPT_CONTINUE; - } - } - - int level = space_crafting.getReverseEngineeringLevel(x[0]); - - if (level == countX) - { - int revSkill = getSkillStatisticModifier(player, "reverse_engineering"); - debugSpeakMsg(player, "Skill = "+ revSkill); - if (revSkill < level) - { - string_id sysmessage = new string_id(TOOL, "not_skilled"); - sendSystemMessage(player, sysmessage); - return SCRIPT_CONTINUE; - } - float pct = dataTableGetFloat(LOOT, temp, 1); - int intPct = (int)(pct*10); - int pctCheck = rand(0, 1000); - if (intPct >= pctCheck) - { - String category1 = dataTableGetString(LOOT, temp, 2); - createLegendaryLoot(player, self, category1); - return SCRIPT_CONTINUE; - } - int roll = rand(0, 100); - if (roll < revSkill) - { - createSpecialLoot(player, temp); - string_id sysmessage = new string_id(TOOL, "special"); - sendSystemMessage(player, sysmessage); - } - else - { - createImprovedLoot(player, temp); - string_id sysmessage = new string_id(TOOL, "improved"); - sendSystemMessage(player, sysmessage); - } - int xpGranted = 0; - if (level == 1) - { - xpGranted = level * 20; - } - else if (level == 2 || level == 3) - { - xpGranted = level * 25; - } - else if (level == 4 || level == 5) - { - xpGranted = level * 30; - } - else if (level == 6 || level == 7) - { - xpGranted = level * 35; - } - else if (level == 8 || level == 9) - { - xpGranted = level * 40; - } - else if (level == 10) - { - xpGranted = level * 45; - } - - xp.grant(player, "reverse_engineering", xpGranted); - - charges--; - - setObjVar(self, "reverse_engineering.charges",charges); - if (charges > 0) - { - for (int i = 0; i < x.length; i++) - { - testAbortScript(); - destroyObject(x[i]); - } - } - if (charges <= 0) - { - destroyObject(self); - } - } - - if (level < countX) - { - string_id errortoomany = new string_id(TOOL, "too_many"); - sendSystemMessage(player, errortoomany); - return SCRIPT_CONTINUE; - } - - if (level > countX) - { - string_id errortoofew = new string_id(TOOL, "too_few"); - sendSystemMessage(player, errortoofew); - return SCRIPT_CONTINUE; - } - - } - - return SCRIPT_CONTINUE; - } - - - public obj_id createLegendaryLoot(obj_id player, obj_id tool, String category) throws InterruptedException - { - - String[] items = dataTableGetStringColumn(LOOT_LOOKUP, category); - int pick = rand(0, items.length-1); - String rare = dataTableGetString(LOOT_LOOKUP, pick, category); - String msg = dataTableGetString(LOOT_LOOKUP, pick, (category+"_strings")); - obj_id newLoot = createSpecialLoot(player, rare); - string_id sysmessage = new string_id(TOOL, msg); - sendSystemMessage(player, sysmessage); - destroyObject(tool); - return newLoot ; - } - - - public obj_id createImprovedLoot(obj_id player, String template) throws InterruptedException - { - obj_id playerInv = utils.getInventoryContainer(player); - obj_id newWeapon = create.object(template, playerInv, false, false); - - float energyMaintenance = dataTableGetFloat(TABLE, template, "fltEnergyMaintenance"); - float energyMaintenanceModifier = dataTableGetFloat(TABLE, template, "fltEnergyMaintenanceModifier"); - energyMaintenance = energyMaintenance - energyMaintenanceModifier; - float mass = dataTableGetFloat(TABLE, template, "fltMass"); - float massModifier = dataTableGetFloat(TABLE, template, "fltMassModifier"); - mass = mass - massModifier; - space_crafting.setComponentMass(newWeapon, mass); - space_crafting.setComponentEnergyMaintenance(newWeapon, energyMaintenance); - - float armorHp = dataTableGetFloat(TABLE, template, "fltMaximumArmorHitpoints"); - float armorHpMod = dataTableGetFloat(TABLE, template, "fltMaximumArmorHitpointsModifier"); - armorHp = armorHp + armorHpMod; - space_crafting.setComponentCurrentArmorHitpoints(newWeapon, armorHp); - space_crafting.setComponentMaximumArmorHitpoints(newWeapon, armorHp); - - setObjVar(newWeapon, "cannotReverseEngineer", true); - - return newWeapon; - - } - - - public obj_id createSpecialLoot(obj_id player, String template) throws InterruptedException - { - obj_id playerInv = utils.getInventoryContainer(player); - obj_id newWeapon = create.object(template, playerInv, false, false); - - float energyMaintenance = dataTableGetFloat(TABLE, template, "fltEnergyMaintenance"); - float energyMaintenanceModifier = dataTableGetFloat(TABLE, template, "fltEnergyMaintenanceModifier"); - energyMaintenance = energyMaintenance - energyMaintenanceModifier; - energyMaintenance = energyMaintenance - ((.05f)*energyMaintenance); - float mass = dataTableGetFloat(TABLE, template, "fltMass"); - float massModifier = dataTableGetFloat(TABLE, template, "fltMassModifier"); - mass = mass - massModifier; - mass = mass - ((.05f)*mass); - space_crafting.setComponentMass(newWeapon, mass); - space_crafting.setComponentEnergyMaintenance(newWeapon, energyMaintenance); - - float armorHp = dataTableGetFloat(TABLE, template, "fltMaximumArmorHitpoints"); - float armorHpMod = dataTableGetFloat(TABLE, template, "fltMaximumArmorHitpointsModifier"); - armorHp = armorHp + armorHpMod; - space_crafting.setComponentCurrentArmorHitpoints(newWeapon, armorHp); - space_crafting.setComponentMaximumArmorHitpoints(newWeapon, armorHp); - - setObjVar(newWeapon, "cannotReverseEngineer", true); - - return newWeapon; - - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/dungeon_sequencer/ai_controller.java b/sku.0/sys.server/compiled/game/script/systems/dungeon_sequencer/ai_controller.java deleted file mode 100644 index 68a5e93a2..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/dungeon_sequencer/ai_controller.java +++ /dev/null @@ -1,1005 +0,0 @@ -package script.systems.dungeon_sequencer; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.beast_lib; -import script.library.buff; -import script.library.chat; -import script.library.factions; -import script.library.utils; -import script.library.trial; -import script.library.create; -import script.library.restuss_event; - - -public class ai_controller extends script.base_script -{ - public ai_controller() - { - } - public static final String PATH = "patrol_path"; - public static final String MOVETO = "moveTo"; - - public static final boolean LOGGING = true; - - - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (!isGod(objSpeaker)) - { - return SCRIPT_CONTINUE; - } - - if (strText.equals("gcwpath")) - { - if (hasObjVar(self, "patrol_path")) - { - dictionary dict = new dictionary(); - dict.put("pathAction", PATH); - dict.put("pathName", getStringObjVar(self, "patrol_path")); - messageTo(self, "doPathAction", dict, 1.0f, false); - } - } - - return SCRIPT_CONTINUE; - } - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "ai_controller.behavior")) - { - - ai_lib.setDefaultCalmBehavior(self, getIntObjVar(self, "ai_controller.behavior")); - } - else - { - ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); - } - - trial.setInterest(self); - - if (hasObjVar(self, "patrol_path")) - { - dictionary dict = new dictionary(); - dict.put("pathAction", PATH); - dict.put("pathName", getStringObjVar(self, "patrol_path")); - messageTo(self, "doPathAction", dict, 1.0f, false); - } - - if (hasObjVar(self, "moveTo")) - { - dictionary dict = new dictionary(); - dict.put("pathAction", MOVETO); - dict.put("pathName", getStringObjVar(self, "moveTo")); - messageTo(self, "doPathAction", dict, 1.0f, false); - } - - if (hasObjVar(self, "posture")) - { - String posture = getStringObjVar(self, "posture"); - - if (posture.equals("prone")) - { - setPosture(self, POSTURE_PRONE); - } - - if (posture.equals("kneeling")) - { - setPosture(self, POSTURE_CROUCHED); - } - } - - if (hasObjVar(self, "name")) - { - String name = getStringObjVar(self, "name"); - - setName(self, name); - } - - if (hasObjVar(self, "passive")) - { - removeTriggerVolume(ai_lib.ALERT_VOLUME_NAME); - removeTriggerVolume(ai_lib.AGGRO_VOLUME_NAME); - - } - - if (hasObjVar(self, "equip")) - { - aiEquipPrimaryWeapon(self); - } - - if (hasObjVar(self, "faction")) - { - String factionName = getStringObjVar(self, "faction"); - - if (factionName != null && factionName.length() > 0 && (factionName.equals("Imperial") || factionName.equals("Rebel"))) - { - factions.setFaction(self, factionName, true, 0); - } - } - - if (hasObjVar(self, "buff")) - { - String buffName = getStringObjVar(self, "buff"); - if (buffName != null && buffName.length() > 0) - { - buff.applyBuff(self, self, buffName); - } - } - - if (hasObjVar(self, "hp_value")) - { - trial.setHp(self, getIntObjVar(self, "hp_value")); - } - - return SCRIPT_CONTINUE; - } - - - public int OnRemovingFromWorld(obj_id self) throws InterruptedException - { - LOG("remove_from_sequencer","OnRemovingFromWorld init"); - dictionary dict = new dictionary(); - dict.put("object", self); - String spawn_id = hasObjVar(self, "spawn_id") ? getStringObjVar(self, "spawn_id") : "none"; - dict.put("spawn_id", spawn_id); - LOG("remove_from_sequencer","OnRemovingFromWorld spawn_id of obj: "+spawn_id); - - messageTo(trial.getParent(self), "unregisterObjectWithSequencer", dict, 0.0f, false); - return SCRIPT_CONTINUE; - } - - - public int OnAiTetherStart(obj_id self) throws InterruptedException - { - messageTo(self, "tether_delay", null, 3.0f, false); - return SCRIPT_CONTINUE; - } - - - public int tether_delay(obj_id self, dictionary params) throws InterruptedException - { - if (aiIsTethered(self)) - { - messageTo(self, "resumeDefaultCalmBehavior", null, 3.0f, false); - } - - return SCRIPT_CONTINUE; - } - - - public void resetSequenceMovement() throws InterruptedException - { - obj_id self = getSelf(); - - if (!isIdValid(self) || !exists(self)) - { - return; - } - - if (ai_lib.isInCombat(self)) - { - setMovementPercent(self, 1.0f); - } - - if (hasObjVar(self, "run")) - { - int testInt = getIntObjVar(self, "run"); - float testFloat = getFloatObjVar(self, "run"); - - if (testInt != 0) - { - float newMove = (1.0f + (float)testInt); - - setMovementPercent(self, newMove); - } - - if (testFloat != 0) - { - float newMove = 1.0f + testFloat; - - setMovementPercent(self, newMove); - } - } - } - - - public int OnMoveMoving(obj_id self) throws InterruptedException - { - resetSequenceMovement(); - - return SCRIPT_CONTINUE; - } - - - public int resumeDefaultCalmBehavior(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "patrol_path")) - { - dictionary dict = new dictionary(); - dict.put("pathAction", PATH); - dict.put("pathName", getStringObjVar(self, "patrol_path")); - messageTo(self, "doPathAction", dict, 1.0f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int doPathAction(obj_id self, dictionary params) throws InterruptedException - { - String pathAction = params.getString("pathAction"); - String pathName = params.getString("pathName"); - - if (pathAction.equals(PATH)) - { - beginPathRoutine(self, pathName); - } - - if (pathAction.equals(MOVETO)) - { - pathToPoint(self, pathName); - } - - return SCRIPT_CONTINUE; - } - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - trial.cleanupObject(self); - return SCRIPT_CONTINUE; - } - - - public int wsDoAnimation(obj_id self, dictionary params) throws InterruptedException - { - String anim = params.getString("animation"); - doAnimationAction(self, anim); - return SCRIPT_CONTINUE; - } - - - public int wsPlayEmote(obj_id self, dictionary params) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int wsSignalMaster(obj_id self, dictionary params) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int wsDespawn(obj_id self, dictionary params) throws InterruptedException - { - messageTo(self, "destroySelf", null, 5.0f, false); - return SCRIPT_CONTINUE; - } - - - public int wsToggleInvulnerability(obj_id self, dictionary params) throws InterruptedException - { - - boolean toggleVulnerable = !isInvulnerable(self); - - if (toggleVulnerable) - { - clearHateList(self); - stopCombat(self); - } - - setInvulnerable(self, toggleVulnerable); - return SCRIPT_CONTINUE; - } - - - public int customSignal(obj_id self, dictionary params) throws InterruptedException - { - String signalName = params.getString("triggerName"); - - if (signalName == null) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, restuss_event.TRIG_CUSTOMSIGNAL)) - { - Vector customTrigger = utils.getResizeableStringArrayScriptVar(self, restuss_event.TRIG_CUSTOMSIGNAL); - - if (customTrigger != null && customTrigger.size() > 0) - { - for (int i=0; i 0) - { - for (int i=0; i 0) - { - for (int i=0; i 0) - { - for (int i=0; i 0) - { - for (int i=0; i= patrolTypeMaster.length) - { - doLogging("beginPathRoutine", "Bad idx: "+ idx + " patrolTypeMaster.length: "+ patrolTypeMaster.length + " pathName: "+ pathName); - return; - } - - String patrolType = patrolTypeMaster[idx]; - - if (idx < 0 || idx >= patrolListMaster.length) - { - doLogging("beginPathRoutine", "Bad idx: "+ idx + " patrolListMaster.length: "+ patrolListMaster.length + " pathName: "+ pathName); - return; - } - - String[] pathPointList = filterRandomPoints(patrolListMaster[idx]); - location[] pathPointLocationList = getLocationListFromPointList(pathPointList); - - initiatePatrol(self, patrolType , pathPointLocationList); - - } - - - public String[] filterRandomPoints(String patrolListString) throws InterruptedException - { - String[] thisList = split(patrolListString, ','); - - for (int i=0; i pointList.length - 1) - { - doLogging("getPointLocation", "Failed to get good index: "+ idx + " for point: "+ pointName + " ["+ self + "] - "+ getName(self)); - return null; - } - - return locationList[idx]; - } - - - public location[] getPplForNpc(obj_id sender, String patrolType, location[] patrolPoints) throws InterruptedException - { - int idx = getNearestPatrolPointIndex(sender, patrolPoints); - patrolPoints = trial.shuffleByIndex(patrolType, patrolPoints, idx); - return patrolPoints; - } - - - public int getNearestPatrolPointIndex(obj_id sender, location[] patrolLoc) throws InterruptedException - { - - float distance = 2000.0f; - int idx = 0; - - for (int i=0; i 0 && !defaultTrigger.equals("") ? defaultTrigger : "default"; - } - - spawnActors(self, defaultTrigger); - return SCRIPT_CONTINUE; - } - - - public int cleanupSpawn(obj_id self, dictionary params) throws InterruptedException - { - handleCleanup(self); - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - handleCleanup(self); - return SCRIPT_CONTINUE; - } - - - public void handleCleanup(obj_id self) throws InterruptedException - { - trial.bumpSession(self); - obj_id[] children = getSpawnedChildren(self); - - if (children != null && children.length > 0) - { - for (int i=0; i 0) - { - for (int q=0; q 0) - { - for (int k=0; k 0) - { - for (int q=0; q 0) - { - for (int r=0; r -1) - { - switch (type) - { - case TYPE_AI: - attachScript(subject, "systems.dungeon_sequencer.ai_controller"); - break; - - case TYPE_TRIGGER: - attachScript(subject, "theme_park.restuss_event.trigger_controller"); - break; - case TYPE_EFFECT_MANAGER: - attachScript(subject, "theme_park.restuss_event.restuss_clientfx_controller"); - break; - - case TYPE_OBJECT: - attachScript(subject, "systems.dungeon_sequencer.ai_controller"); - break; - - } - - } - - if (spawnScripts == null || spawnScripts.equals("none")) - { - return; - } - - String[] scripts = split(spawnScripts,','); - for (int q=0; q= 4) - { - range = utils.stringToFloat(parse[3]); - } - - if (label == null || label.length() < 1) - { - return; - } - - obj_id[] players; - obj_id self = getSelf(); - - if (range > -1 && spawnLoc != null) - { - players = getPlayerCreaturesInRange(spawnLoc, range); - } - else - { - players = instance.getPlayersInInstanceArea(self); - } - - if (players == null || players.length == 0) - { - return; - } - - for (int i=0; i 0 && !effectName.equals("none")) - { - playClientEffectObj(player, effectName, player, "", null, label); - } - } - } - - if (effectName != null && effectName.length() > 0 && range < 0) - { - utils.setScriptVar(self, "instance_persistedLabeledEffect", effectName+":"+label); - } - } - - - public void storeTriggerEvents(obj_id object, String event) throws InterruptedException - { - if (event.startsWith("OnDeath")) - { - storeDeathTrigger(object, event); - } - - if (event.startsWith("OnEnterCombat")) - { - storeEnterCombatTrigger(object, event); - } - - if (event.startsWith("OnExitCombat")) - { - storeExitCombatTrigger(object, event); - } - - if (event.startsWith("OnArrivedAtLocation")) - { - storeArrivedLocationTrigger(object, event); - } - - if (event.startsWith("customSignal")) - { - storeCustomSignal(object, event); - } - } - - - public void storeDeathTrigger(obj_id object, String event) throws InterruptedException - { - String[] parse = split(event, ':'); - Vector OnDeathTrig = new Vector(); - OnDeathTrig.setSize(0); - if (utils.hasScriptVar(object, restuss_event.TRIG_ONDEATH)) - { - OnDeathTrig = utils.getResizeableStringArrayScriptVar(object, restuss_event.TRIG_ONDEATH); - utils.removeScriptVar(object, restuss_event.TRIG_ONDEATH); - } - - utils.addElement(OnDeathTrig, event.substring(8, event.length())); - - utils.setScriptVar(object, restuss_event.TRIG_ONDEATH, OnDeathTrig); - - } - - - public void storeEnterCombatTrigger(obj_id object, String event) throws InterruptedException - { - String[] parse = split(event, ':'); - - Vector OnEnterCombatTrig = new Vector(); - OnEnterCombatTrig.setSize(0); - if (utils.hasScriptVar(object, restuss_event.TRIG_ENTERCOMBAT)) - { - OnEnterCombatTrig = utils.getResizeableStringArrayScriptVar(object, restuss_event.TRIG_ENTERCOMBAT); - utils.removeScriptVar(object, restuss_event.TRIG_ENTERCOMBAT); - } - - utils.addElement(OnEnterCombatTrig, event.substring(14, event.length())); - - utils.setScriptVar(object, restuss_event.TRIG_ENTERCOMBAT, OnEnterCombatTrig); - } - - - public void storeExitCombatTrigger(obj_id object, String event) throws InterruptedException - { - String[] parse = split(event, ':'); - - Vector OnExitCombatTrig = new Vector(); - OnExitCombatTrig.setSize(0); - if (utils.hasScriptVar(object, restuss_event.TRIG_EXITCOMBAT)) - { - OnExitCombatTrig = utils.getResizeableStringArrayScriptVar(object, restuss_event.TRIG_EXITCOMBAT); - utils.removeScriptVar(object, restuss_event.TRIG_EXITCOMBAT); - } - - utils.addElement(OnExitCombatTrig, event.substring(13, event.length())); - - utils.setScriptVar(object, restuss_event.TRIG_EXITCOMBAT, OnExitCombatTrig); - } - - - public void storeArrivedLocationTrigger(obj_id object, String event) throws InterruptedException - { - if (!isIdValid(object) || event.equals("")) - { - doLogging("storeArrivedLocationTrigger", "object was null or event was blank"); - return; - } - String[] parse = split(event, ':'); - String pointName = parse[1]; - - String ppEntry = "pathPoint:"+pointName; - - int row = dataTableSearchColumnForString(ppEntry, "object", getStringObjVar(getSelf(), "instance.data_table")); - dictionary dict = dataTableGetRow(getStringObjVar(getSelf(), "instance.data_table"), row); - dict.put("wp_name", pointName); - String room = dict.getString("room"); - float locX = dict.getFloat("loc_x"); - float locY = dict.getFloat("loc_y"); - float locZ = dict.getFloat("loc_z"); - location here = getLocation(getSelf()); - boolean indoor = false; - location spawnLoc = null; - if (room.equals("none")) - { - locX = here.x + locX; - locY = here.y + locY; - locZ = here.z + locZ; - - spawnLoc = new location(locX, locY, locZ, here.area); - } - else - { - indoor = true; - spawnLoc = new location(locX, locY, locZ, here.area, getCellId(getSelf(), room)); - } - - dict.put("loc", spawnLoc); - - messageTo(object, "setLocationTarget", dict, 0.0f, false); - String constructedTrigger = ""; - for (int i=2; i 2) - { - effect = parse[2]; - } - - obj_id[] spawn_id = getObjectsInSpawnedListWithObjVar(getSelf(), "spawn_id"); - - if (spawn_id == null || spawn_id.length <= 0) - { - return; - } - - for (int i = 0; i < spawn_id.length; i++) - { - testAbortScript(); - String checkSpawn = getStringObjVar(spawn_id[i], "spawn_id"); - - if (checkSpawn.equals(spawnId)) - { - if (!effect.equals("none")) - { - - dictionary dict = trial.getSessionDict(getSelf()); - dict.put("to_delete", spawn_id[i]); - - location object_loc = getLocation(spawn_id[i]); - obj_id newFxController = obj_id.NULL_ID; - - if (isIdValid(object_loc.cell)) - { - newFxController = createObjectInCell("object/tangible/theme_park/invisible_object.iff", getSelf(), getCellName(object_loc.cell), object_loc); - } - else - { - newFxController = createObject("object/tangible/theme_park/invisible_object.iff", object_loc); - } - - setYaw(newFxController, getYaw(spawn_id[i])); - setClientEffectData(newFxController, "clientfx:"+effect+":forced_visability-150"); - attachScript(newFxController, "theme_park.restuss_event.restuss_clientfx_controller"); - messageTo(getSelf(), "handleDelayedDeleteSpawn", dict, 0.75f, false); - } - else - { - trial.cleanupObject(spawn_id[i]); - } - } - } - } - - - public int handleDelayedDeleteSpawn(obj_id self, dictionary params) throws InterruptedException - { - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - obj_id to_delete = params.getObjId("to_delete"); - trial.cleanupObject(to_delete); - return SCRIPT_CONTINUE; - } - - - public void storeSpawnedChild(obj_id self, obj_id child, String spawn_id) throws InterruptedException - { - dictionary childArray = utils.getDictionaryScriptVar(self, trial.PROT_CHILD_ARRAY); - - Vector thisList = new Vector(); - thisList.setSize(0); - Vector all_spawn_id = new Vector(); - all_spawn_id.setSize(0); - - if (childArray.containsKey(spawn_id)) - { - thisList = childArray.getResizeableObjIdArray(spawn_id); - } - - if (childArray.containsKey(trial.PROT_CHILD_KEY_LIST)) - { - all_spawn_id = childArray.getResizeableStringArray(trial.PROT_CHILD_KEY_LIST); - } - - thisList.add(child); - - if (!all_spawn_id.contains(spawn_id)) - { - all_spawn_id.add(spawn_id); - } - - childArray.put(spawn_id, thisList); - childArray.put(trial.PROT_CHILD_KEY_LIST, all_spawn_id); - - utils.setScriptVar(self, trial.PROT_CHILD_ARRAY, childArray); - } - - - public void sendDelayedSpawnActors(String triggerId) throws InterruptedException - { - Vector sentIds = new Vector(); - sentIds.setSize(0); - if (utils.hasScriptVar(getSelf(), ABSOLUTE_TIMER)) - { - sentIds = utils.getResizeableStringArrayScriptVar(getSelf(), ABSOLUTE_TIMER); - } - - if (sentIds.indexOf(triggerId) > -1) - { - return; - } - - sentIds.add(triggerId); - - utils.setScriptVar(getSelf(), ABSOLUTE_TIMER, sentIds); - - int delay = utils.stringToInt(triggerId); - dictionary dict = trial.getSessionDict(getSelf()); - dict.put("triggerId", triggerId); - messageTo(getSelf(), "doDelayedSpawnActors", dict, delay, false); - } - - - public int doDelayedSpawnActors(obj_id self, dictionary params) throws InterruptedException - { - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - String triggerId = params.getString("triggerId"); - - spawnActors(self, triggerId); - return SCRIPT_CONTINUE; - } - - - public void setUpWaitTree(String object) throws InterruptedException - { - obj_id self = getSelf(); - String[] parse = split(object, ':'); - String action = parse[1]; - String signalName = parse[2]; - - String[] tasks = split(parse[3], ','); - - if (tasks == null || tasks.length == 0) - { - return; - } - - Vector masterList = new Vector(); - masterList.setSize(0); - - if (utils.hasScriptVar(self, WFC_MASTER)) - { - masterList = utils.getResizeableStringArrayScriptVar(self, WFC_MASTER); - utils.removeScriptVar(self, WFC_MASTER); - } - - if (!masterList.contains(object.substring(16, object.length()))) - { - utils.addElement(masterList, object.substring(16, object.length())); - } - - utils.setScriptVar(self, WFC_MASTER, masterList); - - for (int i=0; i -1) - { - dict.put("row", row); - messageTo(self, "handleDelayedSpawnRow", dict, respawn, false); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDelayedSpawnRow(obj_id self, dictionary params) throws InterruptedException - { - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - int row = params.getInt("row"); - - spawnActorRow(row); - - return SCRIPT_CONTINUE; - } - - - public obj_id doRandomSpawn(String[] list, location spawnLoc) throws InterruptedException - { - Vector spawnList = new Vector(); - spawnList.setSize(0); - - for (int i=0; i 3) - { - duration = utils.stringToFloat(parse[3]); - } - - obj_id[] players = instance.getPlayersInInstanceArea(getSelf()); - - if (players == null || players.length == 0) - { - return; - } - - if (!templateOverride.equals("none")) - { - if (duration > 0.0f) - { - utils.messagePlayer(getSelf(), players, message, templateOverride, duration); - } - else - { - utils.messagePlayer(getSelf(), players, message, templateOverride); - } - } - else - { - utils.sendSystemMessage(players, message); - } - } - - - public void performTheaterAction(obj_id self, String object) throws InterruptedException - { - String[] parse = split(object, ':'); - String actor = parse[1]; - String action = parse[2]; - - obj_id[] allIds = getObjectsInSpawnedListWithObjVar(self, "spawn_id"); - - if (allIds == null || allIds.length <= 0) - { - return; - } - - obj_id objActor = null; - - for (int i=0; i 3) - { - movement.performRun(objActor, parse[3]); - } - } - - - public void performFacingAction(obj_id self, obj_id actor, String object) throws InterruptedException - { - String[] parse = split(object, ':'); - - String target = parse[3]; - String affector = parse[4]; - - obj_id[] allIds = getObjectsInSpawnedListWithObjVar(self, "spawn_id"); - obj_id objTarget = null; - - if (target.equals("spawn_id")) - { - for (int i=0; i 0) - { - for (int i=0; i 0) - { - for (int q=0; q 0) - { - if (city.equals("coronet")) - { - faction = "rebel"; - } - else if (city.equals("theed")) - { - faction = "imperial"; - } - } - } - } - - transform t = getTransform_o2w( self ); - obj_id banner = createObject( "object/tangible/gcw/flip_banner_onpole_"+faction+".iff", t, null ); - - if (banner == null || !isIdValid( banner )) - { - - return; - } - - setObjVar( banner, "spawner", self ); - utils.setScriptVar( self, "banner", banner ); - - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_barricade.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_barricade.java deleted file mode 100644 index f8fe88af1..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_barricade.java +++ /dev/null @@ -1,342 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.restuss_event; -import script.library.static_item; -import script.library.trial; -import script.library.utils; - -public class gcw_barricade extends script.base_script -{ - public gcw_barricade() - { - } - public static final boolean LOGGING_ON = false; - - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, gcw.GCW_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_barricade_tool.iff"); - setObjVar(self, "questCallBack", 1); - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - messageTo(self, "handleGCWBarricade", null, 2, false); - - dictionary params = new dictionary(); - location loc = getLocation(self); - params.put("particleLoc", loc); - int playIconTime = getGameTime(); - params.put("iconMessageTime", playIconTime); - utils.setScriptVar(self, "iconMessageTime", playIconTime); - messageTo(self, "playQuestIcon", params, 2.0f, false); - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - if (!exists(self)) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int idx = utils.getValidAttributeIndex(names); - - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "object_repaired"; - int repairCount = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - if (repairCount > 0) - { - attribs[idx] = ""+repairCount+" out of "+gcw.REPAIR_COUNT_MAX; - } - else - { - attribs[idx] = "Never Repaired"; - } - idx++; - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!utils.hasScriptVar(self, "faction")) - { - blog("no faction on turret obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - blog("faction invalid on turret obj"); - return SCRIPT_CONTINUE; - } - else - { - if (utils.isProfession(player, utils.TRADER)) - { - blog("player is trader"); - - if (!gcw.canGcwObjectBeRepaired(self)) - { - blog("OnObjectMenuRequest no repair needed"); - - sendSystemMessage(player, gcw.SID_DOESNT_NEED_REPAIR); - return SCRIPT_CONTINUE; - } - if (!gcw.hasConstructionOrRepairTool(player, self)) - { - blog("OnObjectMenuRequest no resources"); - - gcw.playerSystemMessageResourceNeeded(player, self, false); - return SCRIPT_CONTINUE; - } - } - - menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE); - - if (data != null) - { - data.setServerNotify (true); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - blog("OnObjectMenuSelect"); - - if (!isIdValid(player) || !exists(player) || isIncapacitated(player) || isDead(player) || factions.isOnLeave(player)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "faction")) - { - blog("no faction on patrol obj"); - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - if (faction < 0) - { - blog("faction invalid on patrol obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - blog("Wrong Faction"); - return SCRIPT_CONTINUE; - } - else - { - if (utils.isProfession(player, utils.TRADER)) - { - blog("player is trader"); - - if (!gcw.canGcwObjectBeRepaired(self)) - { - sendSystemMessage(player, gcw.SID_DOESNT_NEED_REPAIR); - return SCRIPT_CONTINUE; - } - if (!gcw.hasConstructionOrRepairTool(player, self)) - { - gcw.playerSystemMessageResourceNeeded(player, self, false); - return SCRIPT_CONTINUE; - } - - if (groundquests.isQuestActive(player, gcw.GCW_REPAIR_BARRICADE_QUEST)) - { - if (gcw.useGcwObjectForQuest(player, self, gcw.GCW_REPAIR_BARRICADE_QUEST)) - { - gcw.useConstructionOrRepairTool(player, self); - } - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_REPAIR_BARRICADE_QUEST)) - { - groundquests.clearQuest(player, gcw.GCW_REPAIR_BARRICADE_QUEST); - } - if (!groundquests.isQuestActive(player, gcw.GCW_REPAIR_BARRICADE_QUEST)) - { - groundquests.grantQuest(player, gcw.GCW_REPAIR_BARRICADE_QUEST); - } - } - else - { - String questName = gcw.GCW_DEFEND_BARRICADE_REBEL; - if (faction == factions.FACTION_FLAG_IMPERIAL) - { - questName = gcw.GCW_DEFEND_BARRICADE_IMPERIAL; - } - - if (groundquests.isQuestActive(player, questName)) - { - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, questName)) - { - groundquests.clearQuest(player, questName); - } - if (!groundquests.isQuestActive(player, questName)) - { - setObjVar(player,"defend_target", self); - groundquests.grantQuest(player, questName); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int playQuestIcon(obj_id self, dictionary params) throws InterruptedException - { - gcw.playQuestIconHandler(self, params); - - return SCRIPT_CONTINUE; - } - - - public int handleGCWBarricade(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] objects = getObjectsInRange(self, 5.0f); - - int faction = -1; - - if (utils.hasScriptVar(self, "faction")) - { - faction = utils.getIntScriptVar(self, "faction"); - } - - if (objects != null && objects.length > 0) - { - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - obj_id object = objects[i]; - - if (isIdValid(object) && isMob(object) && factions.isPlayerSameGcwFactionAsSchedulerObject(object, self)) - { - buff.applyBuff(object, self, "barricade_defender"); - } - } - } - - messageTo(self, "handleGCWBarricade", null, 2, false); - - return SCRIPT_CONTINUE; - } - - - public int handleQuestCallBack(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - if (!params.containsKey("questComplete")) - { - return SCRIPT_CONTINUE; - } - if (!params.containsKey("player")) - { - return SCRIPT_CONTINUE; - } - if (params.getBoolean("questComplete")) - { - obj_id player = params.getObjId("player"); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - trial.addNonInstanceFactionParticipant(player, self); - } - return SCRIPT_CONTINUE; - } - - - public int destroyGCWBarricade(obj_id self, dictionary params) throws InterruptedException - { - trial.cleanupObject(self); - return SCRIPT_CONTINUE; - } - - - public int OnDeath(obj_id self, obj_id killer, obj_id corpseId) throws InterruptedException - { - handleDestroyBarricade(self, killer); - return SCRIPT_CONTINUE; - } - - - public int OnObjectDisabled(obj_id self, obj_id killer) throws InterruptedException - { - handleDestroyBarricade(self, killer); - return SCRIPT_CONTINUE; - } - - - public void handleDestroyBarricade(obj_id self, obj_id killer) throws InterruptedException - { - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - setInvulnerable( self, true ); - messageTo(self, "destroyGCWBarricade", null, 1f, false); - - int faction = utils.getIntScriptVar(self, "faction"); - if (faction < 0) - { - blog("handleDestroyBarricade - faction invalid on obj"); - return; - } - - if (faction == factions.FACTION_FLAG_IMPERIAL) - { - gcw.signalAllParticipantsForDamage(self, gcw.GCW_DESTROY_BARRICADE, gcw.GCW_IMP_DESTROY_BARRICADE_TASK, gcw.GCW_IMP_DESTROY_BARRICADE_SIGNAL); - } - else if (faction == factions.FACTION_FLAG_REBEL) - { - gcw.signalAllParticipantsForDamage(self, gcw.GCW_DESTROY_BARRICADE, gcw.GCW_REB_DESTROY_BARRICADE_TASK, gcw.GCW_REB_DESTROY_BARRICADE_SIGNAL); - } - return; - } - - - public void blog(String text) throws InterruptedException - { - if (LOGGING_ON) - { - LOG("gcw_barricade", text); - } - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_camp.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_camp.java deleted file mode 100644 index a4b7d49d7..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_camp.java +++ /dev/null @@ -1,216 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.camping; -import script.library.create; -import script.library.factions; -import script.library.gcw; -import script.library.theater; -import script.library.trial; -import script.library.utils; - - -public class gcw_camp extends script.base_script -{ - public gcw_camp() - { - } - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "initializeAdvancedCamp", null, 30.0f, false); - return SCRIPT_CONTINUE; - } - - - public int initializeAdvancedCamp(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_camp_functionality", "initializeAdvancedCamp"); - - if (!hasObjVar(self, "factionFlag")) - { - return SCRIPT_CONTINUE; - } - - int factionFlag = getIntObjVar(self, "factionFlag"); - if (factionFlag < 0) - { - return SCRIPT_CONTINUE; - } - LOG("gcw_camp_functionality", "initializeAdvancedCamp factionFlag: "+ factionFlag); - - int numNodes = camping.getAdvancedCampNumberOfNodes(self); - if (numNodes > 6) - { - numNodes = 6; - } - LOG("gcw_camp_functionality", "initializeAdvancedCamp - numNodes: "+numNodes); - - obj_id[] nodeObjects = new obj_id[numNodes]; - int arrayIdx = 0; - - obj_var_list ovl = getObjVarList(self, "modules"); - LOG("gcw_camp_functionality", "initializeAdvancedCamp - obj_var_list: "+ovl); - - if (ovl == null) - { - LOG("gcw_camp_functionality", "initializeAdvancedCamp - ovl == null"); - return SCRIPT_CONTINUE; - } - LOG("gcw_camp_functionality", "initializeAdvancedCamp - ovl not null"); - - String[] modules = ovl.getAllObjVarNames(); - if (modules == null || modules.length <= 0) - { - LOG("gcw_camp_functionality", "initializeAdvancedCamp - modules == null"); - return SCRIPT_CONTINUE; - } - int nodeCount = 1; - int i = 0; - int recruitersPlaced = 0; - - while (nodeCount <= numNodes && i < modules.length) - { - testAbortScript(); - if (modules[i] == null || modules[i].equals("")) - { - LOG("gcw_camp_functionality", "initializeAdvancedCamp - modules == null"); - continue; - } - - LOG("gcw_camp_functionality", "initializeAdvancedCamp - modules[i]: "+modules[i]); - - location tempLoc = getLocation(self); - location nodeLoc = camping.getAdvancedCampNodeLocation(self, tempLoc, nodeCount); - int nodeYaw = camping.getAdvancedCampNodeYaw(self, nodeCount); - - String module_template = ""; - - if (modules[i].equals("shuttle_beacon")) - { - module_template = "object/building/poi/player_camp_shuttle_beacon.iff"; - } - else if (modules[i].equals("cloning_tube")) - { - module_template = "object/building/poi/player_camp_clone_tube.iff"; - } - - else if (modules[i].equals("entertainer")) - { - if (factionFlag == factions.FACTION_FLAG_REBEL) - { - LOG("gcw_camp_functionality", "initializeAdvancedCamp - Entertainment Camp is FACTION_FLAG_REBEL"); - module_template = "object/building/poi/gcw_camp_entertainment_rebel.iff"; - } - else if (factionFlag == factions.FACTION_FLAG_IMPERIAL) - { - LOG("gcw_camp_functionality", "initializeAdvancedCamp - Entertainment Camp is FACTION_FLAG_IMPERIAL"); - module_template = "object/building/poi/gcw_camp_entertainment_imperial.iff"; - } - else - { - LOG("gcw_camp_functionality", "initializeAdvancedCamp - Entertainment Camp is FACTION_FLAG_UNKNOWN"); - module_template = "object/building/poi/player_camp_entertainment_area.iff"; - } - } - - else if (modules[i].equals("junk_dealer")) - { - if (factionFlag == factions.FACTION_FLAG_REBEL) - { - LOG("gcw_camp_functionality", "initializeAdvancedCamp - Junk Dealer is FACTION_FLAG_REBEL"); - module_template = "object/building/poi/gcw_camp_junk_dealer_rebel.iff"; - } - else if (factionFlag == factions.FACTION_FLAG_IMPERIAL) - { - LOG("gcw_camp_functionality", "initializeAdvancedCamp - Junk Dealer is FACTION_FLAG_IMPERIAL"); - module_template = "object/building/poi/gcw_camp_junk_dealer_imperial.iff"; - } - else - { - LOG("gcw_camp_functionality", "initializeAdvancedCamp - Junk Dealer is FACTION_FLAG_UNKNOWN"); - module_template = "object/building/poi/player_camp_junk_dealer.iff"; - } - } - - else if (modules[i].equals("imperial")) - { - module_template = "object/building/poi/gcw_camp_imperial_recruiter.iff"; - } - else if (modules[i].equals("rebel")) - { - module_template = "object/building/poi/gcw_camp_rebel_recruiter.iff"; - } - else if (modules[i].equals("rebel_clone")) - { - module_template = "object/building/poi/gcw_rebel_clone_tent_small.iff"; - } - else if (modules[i].equals("imperial_clone")) - { - module_template = "object/building/poi/gcw_imperial_clone_tent_small.iff"; - } - - else if (modules[i].equals("clothing_station")) - { - module_template = "object/building/poi/player_camp_crafting_clothing.iff"; - } - else if (modules[i].equals("food_station")) - { - module_template = "object/building/poi/player_camp_crafting_food.iff"; - } - else if (modules[i].equals("ship_station")) - { - module_template = "object/building/poi/player_camp_crafting_space.iff"; - } - else if (modules[i].equals("structure_station")) - { - module_template = "object/building/poi/player_camp_crafting_structure.iff"; - } - else if (modules[i].equals("weapon_station")) - { - module_template = "object/building/poi/player_camp_crafting_weapon.iff"; - } - - if (!module_template.equals("")) - { - obj_id module_id = create.object(module_template, nodeLoc); - if (camping.isRecruiterModule(module_template)) - { - recruitersPlaced = recruitersPlaced +1; - } - if (isIdValid(module_id)) - { - setYaw(module_id, nodeYaw); - nodeObjects[arrayIdx] = module_id; - arrayIdx++; - nodeCount++; - } - } - - i++; - } - - LOG("gcw_camp_functionality", "initializeAdvancedCamp - Setting Vars!!"); - - setObjVar(self, "modules.ids", nodeObjects); - setObjVar(self, camping.VAR_CREATION_TIME, getCalendarTime()); - - Vector children = getResizeableObjIdArrayObjVar(self, theater.VAR_CHILDREN); - LOG("gcw_camp_functionality", "initializeAdvancedCamp - children.length: "+children.size()); - for (int b = 0; b < nodeObjects.length; b++) - { - testAbortScript(); - children = utils.addElement(children, nodeObjects[b]); - } - - setObjVar(self, theater.VAR_CHILDREN, children, resizeableArrayTypeobj_id); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city.java deleted file mode 100644 index 5a03ab9a8..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city.java +++ /dev/null @@ -1,1388 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.colors_hex; -import script.library.factions; -import script.library.gcw; -import script.library.planetary_map; -import script.library.trial; -import script.library.utils; - - -public class gcw_city extends script.base_script -{ - public gcw_city() - { - } - public static final location KEREN_ANNOUNCEMENT_ORIGIN = new location (1616, 24, 2705, "naboo", null); - public static final location BESTINE_ANNOUNCEMENT_ORIGIN = new location (-1097, 12, -3583, "tatooine", null); - public static final location DEARIC_ANNOUNCEMENT_ORIGIN = new location (435, 6, -2966, "talus", null); - - public static final float KEREN_ANNOUNCEMENT_RADIUS = 700.0f; - public static final float BESTINE_ANNOUNCEMENT_RADIUS = 450.0f; - public static final float DEARIC_ANNOUNCEMENT_RADIUS = 650.0f; - - public static final String COLOR_REBELS = "\\"+ colors_hex.COLOR_REBELS; - public static final String COLOR_IMPERIALS = "\\"+ colors_hex.COLOR_IMPERIALS; - - public static final int PHASE_CONSTRUCTION = 0; - public static final int PHASE_COMBAT = 1; - public static final int PHASE_OCCUPATION = 2; - - public static final obj_id CITY_OBJECT_BESTINE = getObjIdWithNull(9835358); - public static final obj_id CITY_OBJECT_DEARIC = getObjIdWithNull(9805353); - public static final obj_id CITY_OBJECT_KEREN = getObjIdWithNull(9865353); - - - public void qaInstabuild(obj_id[] kits) throws InterruptedException - { - for (int i = 0, j = kits.length; i < j; i++) - { - testAbortScript(); - if (!isIdValid(kits[i]) || !exists(kits[i])) - { - continue; - } - - int construction = getIntObjVar(kits[i], "gcw.constructionQuestsCompleted"); - int newConstruction = gcw.GCW_CONSTRUCTION_MAXIMUM / 2; - - if (construction >= newConstruction) - { - newConstruction = gcw.GCW_CONSTRUCTION_MAXIMUM; - } - - setObjVar(kits[i], "gcw.constructionQuestsCompleted", newConstruction); - - messageTo(kits[i], "handleUpdateName", null, 1.0f, false); - } - } - - - public void qaInstaclear(obj_id[] kits) throws InterruptedException - { - for (int i = 0, j = kits.length; i < j; i++) - { - testAbortScript(); - if (!isIdValid(kits[i]) || !exists(kits[i])) - { - continue; - } - - setObjVar(kits[i], "gcw.constructionQuestsCompleted", 0); - - messageTo(kits[i], "handleUpdateName", null, 1.0f, false); - } - } - - - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (!isGod(objSpeaker)) - { - return SCRIPT_CONTINUE; - } - - dictionary params = trial.getSessionDict(self); - - if (strText.equals("gcwcleanup") || strText.equals("gcwend")) - { - CustomerServiceLog("gcw_city_invasion", "gcw_city.OnHearSpeech: God Player: "+objSpeaker+" has used the gcwcleanup command. session: "+params.getInt(trial.MESSAGE_SESSION)); - obj_id planet = getPlanetByName("tatooine"); - if (!isValidId(planet)) - { - debugSpeakMsg(self, "GCW Controller: Failed to find planet Tatooine."); - return SCRIPT_CONTINUE; - } - - String city = gcw.getCityFromTable(self); - if (city == null || city.length() <= 0) - { - debugSpeakMsg(self, "GCW Controller: Failed to find city name."); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(planet, "gcw.calendar_time."+ city, getCalendarTime() - gcw.GCW_CONSTRUCTION_END_TIMER - gcw.GCW_COMBAT_END_TIMER); - - messageTo(self, "cleanupInvasion", params, 1.0f, false); - - debugSpeakMsg(self, "GCW Controller: Cleaning up invasion."); - } - - else if (strText.equals("gcwdefensewin")) - { - if (!utils.hasScriptVar(self, "gcw.constructionEnded") && !utils.hasScriptVar(self, "gcw.invasionRunning")) - { - debugSpeakMsg(self, "Must be used when in construction or combat phase."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("gcw_city_invasion", "gcw_city.OnHearSpeech: God Player: "+objSpeaker+" has used the gcwcleanup command. session: "+params.getInt(trial.MESSAGE_SESSION)); - obj_id planet = getPlanetByName("tatooine"); - if (!isValidId(planet)) - { - debugSpeakMsg(self, "GCW Controller: Failed to find planet Tatooine."); - return SCRIPT_CONTINUE; - } - - String city = gcw.getCityFromTable(self); - if (city == null || city.length() <= 0) - { - debugSpeakMsg(self, "GCW Controller: Failed to find city name."); - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneral = utils.getObjIdScriptVar(self, "defendingGeneral"); - if (!isValidId(defendingGeneral) || !exists(defendingGeneral)) - { - return SCRIPT_CONTINUE; - } - - Vector loserDefenseParticipants = new Vector(); - loserDefenseParticipants.setSize(0); - Vector winnerOffenseParticipants = new Vector(); - winnerOffenseParticipants.setSize(0); - int loserFactionFlag = factions.FACTION_FLAG_UNKNOWN; - int winnerFactionFlag = factions.FACTION_FLAG_UNKNOWN; - - if (factions.isImperialorImperialHelper(defendingGeneral)) - { - loserDefenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_REBEL); - loserFactionFlag = factions.FACTION_FLAG_REBEL; - - winnerOffenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_IMPERIAL); - winnerFactionFlag = factions.FACTION_FLAG_IMPERIAL; - } - else if (factions.isRebelorRebelHelper(defendingGeneral)) - { - loserDefenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_IMPERIAL); - loserFactionFlag = factions.FACTION_FLAG_IMPERIAL; - - winnerOffenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_REBEL); - winnerFactionFlag = factions.FACTION_FLAG_REBEL; - } - - if (loserDefenseParticipants != null && loserDefenseParticipants.size() > 0) - { - gcw.awardGcwInvasionParticipants(loserDefenseParticipants, loserFactionFlag, gcw.GCW_TOKENS_LOSER_PARTICIPANTS, gcw.GCW_POINTS_LOSER_PARTICIPANTS); - } - if (winnerOffenseParticipants != null && winnerOffenseParticipants.size() > 0) - { - gcw.awardGcwInvasionParticipants(winnerOffenseParticipants, winnerFactionFlag, gcw.GCW_TOKENS_WINNER_PARTICIPANTS, gcw.GCW_POINTS_WINNER_PARTICIPANTS); - } - - utils.setScriptVar(planet, "gcw.calendar_time."+ city, getCalendarTime() - gcw.GCW_CONSTRUCTION_END_TIMER - gcw.GCW_COMBAT_END_TIMER); - messageTo(self, "cleanupInvasion", params, 1.0f, false); - - debugSpeakMsg(self, "GCW Controller: Defense has won the invasion -- No announcements will be sent."); - } - - else if (strText.equals("gcwbegin") || strText.equals("gcwstart")) - { - CustomerServiceLog("gcw_city_invasion", "gcw_city.OnHearSpeech: God Player: "+objSpeaker+" has used the gcwbegin command. session: "+params.getInt(trial.MESSAGE_SESSION)); - - obj_id planet = getPlanetByName("tatooine"); - if (!isValidId(planet)) - { - debugSpeakMsg(self, "GCW Controller: Failed to find planet Tatooine."); - return SCRIPT_CONTINUE; - } - - String city = gcw.getCityFromTable(self); - if (city == null || city.length() <= 0) - { - debugSpeakMsg(self, "GCW Controller: Failed to find city name."); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(planet, "gcw.time."+ city, getGameTime()); - utils.setScriptVar(planet, "gcw.object."+ city, self); - utils.setScriptVar(planet, "gcw.calendar_time."+ city, getCalendarTime()); - - messageTo(self, "beginInvasion", null, 1.0f, false); - - debugSpeakMsg(self, "GCW Controller: Starting construction."); - } - - else if (strText.equals("gcwendbuild") || strText.equals("gcwstartinvasion")) - { - CustomerServiceLog("gcw_city_invasion", "gcw_city.OnHearSpeech: God Player: "+objSpeaker+" has used the gcwendbuild command. session: "+params.getInt(trial.MESSAGE_SESSION)); - - obj_id planet = getPlanetByName("tatooine"); - if (!isValidId(planet)) - { - debugSpeakMsg(self, "GCW Controller: Failed to find planet Tatooine."); - return SCRIPT_CONTINUE; - } - - String city = gcw.getCityFromTable(self); - if (city == null || city.length() <= 0) - { - debugSpeakMsg(self, "GCW Controller: Failed to find city name."); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(planet, "gcw.calendar_time."+ city, getCalendarTime() - gcw.GCW_CONSTRUCTION_END_TIMER); - messageTo(self, "endConstruction", params, 1.0f, false); - - debugSpeakMsg(self, "GCW Controller: Starting invasion."); - } - - else if (strText.equals("gcwkits")) - { - obj_id[] npcs = trial.getObjectsInInstanceBySpawnId(self, "defense_kit"); - - debugSpeakMsg(self, "count: "+ npcs.length); - } - - else if (strText.equals("gcwquickbuild")) - { - CustomerServiceLog("gcw_city_invasion", "gcw_city.OnHearSpeech: God Player: "+objSpeaker+" has used the gcwquickbuild command. session: "+params.getInt(trial.MESSAGE_SESSION)); - - obj_id[] kits = trial.getObjectsInInstanceBySpawnId(self, "defense_kit"); - qaInstabuild(kits); - - int kitsLength = kits.length / 2; - - kits = trial.getObjectsInInstanceBySpawnId(self, "defense_patrol"); - qaInstabuild(kits); - - kitsLength += kits.length / 2; - - kits = trial.getObjectsInInstanceBySpawnId(self, "offense_patrol"); - qaInstabuild(kits); - - kitsLength += kits.length / 2; - - kits = trial.getObjectsInInstanceBySpawnId(self, "vehicle_patrol"); - qaInstabuild(kits); - - kitsLength += kits.length / 2; - - debugSpeakMsg(self, "GCW Controller: "+ kitsLength + " Construction kits modified."); - } - - else if (strText.equals("gcwquickbuildclear")) - { - CustomerServiceLog("gcw_city_invasion", "gcw_city.OnHearSpeech: God Player: "+objSpeaker+" has used the gcwquickbuildclear command. session: "+params.getInt(trial.MESSAGE_SESSION)); - - obj_id[] kits = trial.getObjectsInInstanceBySpawnId(self, "defense_kit"); - qaInstaclear(kits); - - int kitsLength = kits.length / 2; - - kits = trial.getObjectsInInstanceBySpawnId(self, "defense_patrol"); - qaInstaclear(kits); - - kitsLength += kits.length / 2; - - kits = trial.getObjectsInInstanceBySpawnId(self, "offense_patrol"); - qaInstaclear(kits); - - kitsLength += kits.length / 2; - - kits = trial.getObjectsInInstanceBySpawnId(self, "vehicle_patrol"); - qaInstaclear(kits); - - kitsLength += kits.length / 2; - - debugSpeakMsg(self, "GCW Controller: "+ kitsLength + " Construction kits modified to zero quests completed."); - } - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - CustomerServiceLog("gcw_city_invasion", "gcw_city.OnInitialize: The city sequencer object is starting for the fist time."); - messageTo(self, "checkForInvasion", null, 1.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int checkForInvasion(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id planet = getPlanetByName("tatooine"); - - String cityName = gcw.getCityFromTable(self); - - if (cityName != null && cityName.length() > 0 && isIdValid(planet)) - { - CustomerServiceLog("gcw_city_invasion", "gcw_city.checkForInvasion: The city sequencer object is being checked for a running invasion. session: "+params.getInt(trial.MESSAGE_SESSION)); - params = new dictionary(); - params.put("sequencer", self); - params.put("city", cityName); - messageTo(planet, "gcwInvasionTracker", params, 1.0f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int beginInvasion(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_announcement", "beginInvasion init"); - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - LOG("dologging", "gcw_city beginInvasion"); - - obj_id planet = getPlanetByName("tatooine"); - - if (!isIdValid(planet)) - { - return SCRIPT_CONTINUE; - } - - String cityName = gcw.getCityFromTable(self); - - if (utils.hasScriptVar(self, "gcw.invasionRunning")) - { - CustomerServiceLog("gcw_city_invasion", "gcw_city.beginInvasion: beginInvasion has been called but according to the city object AN INVASION IS CURRENTLY RUNNING. session: "+params.getInt(trial.MESSAGE_SESSION)); - - if (cityName == null || cityName.length() < 1) - { - return SCRIPT_CONTINUE; - } - - int lastPulse = utils.getIntScriptVar(self, "gcw.time."+ cityName); - int gameTime = getGameTime(); - - if (gameTime - lastPulse > gcw.GCW_PULSE_TIMER) - { - CustomerServiceLog("gcw_city_invasion", "gcw_city.beginInvasion: The city sequencer object had a gcw.invasionRunning var on it. The invasionRunning and constructionEnded vars are being removed because the system thinks we have an invasion that failed to end properly. Removing vars at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - messageTo(self, "cleanupInvasion", params, 1.0f, false); - utils.removeScriptVar(self, "gcw.invasionRunning"); - utils.removeScriptVar(planet, "gcw.invasionRunning."+ cityName); - utils.removeScriptVar(self, "gcw.constructionEnded"); - } - - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("gcw_city_invasion", "gcw_city.beginInvasion: beginInvasion has been called. we are starting the construction phase at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - - messageTo(self, "beginSpawn", null, 1.0f, false); - messageTo(self, "startFactionDefense", null, 5.0f, false); - - utils.setScriptVar(self, "gcw.invasionRunning", 1); - - gcw_score.setGcwPhase(gcw.GCW_CITY_PHASE_CONSTRUCTION); - - utils.setScriptVar(planet, "gcw.invasionRunning."+ cityName, 1); - - LOG("gcw_announcement", "beginInvasion getting defending general"); - return SCRIPT_CONTINUE; - } - - - public int beginInvasionNotifyFactions(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_announcement", "beginInvasionNotifyFactions init"); - - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneralList[] = trial.getObjectsInInstanceBySpawnId(self, "defense_camp"); - if (defendingGeneralList == null || defendingGeneralList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneral = defendingGeneralList[0]; - if (!isValidId(defendingGeneral) || !exists(defendingGeneral)) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, "defendingGeneral", defendingGeneral); - utils.setScriptVar(self, "currentOccupyFaction", getIntObjVar(defendingGeneral, "factionFlag")); - - if ((!utils.hasScriptVar(self, "planetName") || !utils.hasScriptVar(self, "cityName"))) - { - - String planetName = getCurrentSceneName(); - if (planetName == null || planetName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityName = gcw.getCityFromTable(self); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - if (cityName.equals(gcw.CITY_DEARIC)) - { - utils.setScriptVar(self, "announcementOrigin", DEARIC_ANNOUNCEMENT_ORIGIN); - utils.setScriptVar(self, "announcementRadius", DEARIC_ANNOUNCEMENT_RADIUS); - utils.setScriptVar(self, "cityObject", CITY_OBJECT_DEARIC); - } - else if (cityName.equals(gcw.CITY_BESTINE)) - { - utils.setScriptVar(self, "announcementOrigin", BESTINE_ANNOUNCEMENT_ORIGIN); - utils.setScriptVar(self, "announcementRadius", BESTINE_ANNOUNCEMENT_RADIUS); - utils.setScriptVar(self, "cityObject", CITY_OBJECT_BESTINE); - - } - else if (cityName.equals(gcw.CITY_KEREN)) - { - utils.setScriptVar(self, "announcementOrigin", KEREN_ANNOUNCEMENT_ORIGIN); - utils.setScriptVar(self, "announcementRadius", KEREN_ANNOUNCEMENT_RADIUS); - utils.setScriptVar(self, "cityObject", CITY_OBJECT_KEREN); - } - - utils.setScriptVar(self, "planetName", planetName); - utils.setScriptVar(self, "cityName", cityName); - } - - String planetName = utils.getStringScriptVar(self, "planetName"); - if (planetName == null || planetName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityName = utils.getStringScriptVar(self, "cityName"); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - location announcementOrigin = utils.getLocationScriptVar(self, "announcementOrigin"); - if (announcementOrigin == null) - { - return SCRIPT_CONTINUE; - } - - float announcementRadius = utils.getFloatScriptVar(self, "announcementRadius"); - if (announcementRadius <= -1) - { - return SCRIPT_CONTINUE; - } - - LOG("gcw_announcement", "beginInvasionNotifyFactions planetName: "+planetName+" cityName: "+cityName); - - dictionary webster = new dictionary(); - webster.put("string_file", "gcw"); - webster.put("planetName", planetName); - webster.put("cityName", cityName); - - if (factions.isImperialorImperialHelper(defendingGeneral)) - { - LOG("gcw_announcement", "beginInvasionNotifyFactions defending general is Imperial"); - webster.put("imperial_announcement", "gcw_announcement_construct_defenses_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_call_to_arms_rebel_"); - } - else if (factions.isRebelorRebelHelper(defendingGeneral)) - { - LOG("gcw_announcement", "beginInvasionNotifyFactions defending general is Rebel"); - webster.put("imperial_announcement", "gcw_announcement_call_to_arms_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_construct_defenses_rebel_"); - } - webster.put("neutral_announcement", "gcw_announcement_construct_defenses_neutral_"); - - messageToPlayersOnPlanet("notifyPlayerOfGcwCityEventAnnouncement", webster, 0.0f, announcementOrigin, announcementRadius, false); - CustomerServiceLog("gcw_city_invasion", "gcw_city.beginInvasionNotifyFactions: beginInvasionNotifyFactions has sent all players messages regarding the construction phase starting at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - - utils.setScriptVar(self, "phase", PHASE_CONSTRUCTION); - messageTo(self, "updateGcwMapData", params, 0.0f, false); - return SCRIPT_CONTINUE; - } - - - public int constructionEndsSoon(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_announcement", "constructionEndsSoon init"); - - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - if ((!utils.hasScriptVar(self, "defendingGeneral") || !utils.hasScriptVar(self, "planetName") || !utils.hasScriptVar(self, "cityName"))) - { - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneral = utils.getObjIdScriptVar(self, "defendingGeneral"); - if (!isValidId(defendingGeneral) || !exists(defendingGeneral)) - { - return SCRIPT_CONTINUE; - } - - String planetName = utils.getStringScriptVar(self, "planetName"); - if (planetName == null || planetName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityName = utils.getStringScriptVar(self, "cityName"); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - location announcementOrigin = utils.getLocationScriptVar(self, "announcementOrigin"); - if (announcementOrigin == null) - { - return SCRIPT_CONTINUE; - } - - float announcementRadius = utils.getFloatScriptVar(self, "announcementRadius"); - if (announcementRadius <= -1) - { - return SCRIPT_CONTINUE; - } - - dictionary webster = new dictionary(); - webster.put("string_file", "gcw"); - webster.put("planetName", planetName); - webster.put("cityName", cityName); - - if (factions.isImperialorImperialHelper(defendingGeneral)) - { - LOG("gcw_announcement", "constructionEndsSoon defending general is Imperial"); - webster.put("imperial_announcement", "gcw_announcement_building_almost_complete_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_rally_for_invasion_rebel_"); - } - else if (factions.isRebelorRebelHelper(defendingGeneral)) - { - LOG("gcw_announcement", "constructionEndsSoon defending general is Rebel"); - webster.put("imperial_announcement", "gcw_announcement_rally_for_invasion_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_building_almost_complete_rebel_"); - } - webster.put("neutral_announcement", "gcw_announcement_rally_for_invasion_neutral_"); - messageToPlayersOnPlanet("notifyPlayerOfGcwCityEventAnnouncement", webster, 0.0f, announcementOrigin, announcementRadius, false); - CustomerServiceLog("gcw_city_invasion", "gcw_city.constructionEndsSoon: constructionEndsSoon has sent all players messages regarding the construction phase ending soon. Message sent at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - return SCRIPT_CONTINUE; - } - - - public int invasionEndsSoon(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_announcement", "invasionEndsSoon init"); - - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - if ((!utils.hasScriptVar(self, "defendingGeneral") || !utils.hasScriptVar(self, "planetName") || !utils.hasScriptVar(self, "cityName"))) - { - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneral = utils.getObjIdScriptVar(self, "defendingGeneral"); - if (!isValidId(defendingGeneral) || !exists(defendingGeneral)) - { - return SCRIPT_CONTINUE; - } - - String planetName = utils.getStringScriptVar(self, "planetName"); - if (planetName == null || planetName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityName = utils.getStringScriptVar(self, "cityName"); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - location announcementOrigin = utils.getLocationScriptVar(self, "announcementOrigin"); - if (announcementOrigin == null) - { - return SCRIPT_CONTINUE; - } - - float announcementRadius = utils.getFloatScriptVar(self, "announcementRadius"); - if (announcementRadius <= -1) - { - return SCRIPT_CONTINUE; - } - - dictionary webster = new dictionary(); - webster.put("string_file", "gcw"); - webster.put("planetName", planetName); - webster.put("cityName", cityName); - - if (factions.isImperialorImperialHelper(defendingGeneral)) - { - LOG("gcw_announcement", "invasionEndsSoon defending general is Imperial"); - webster.put("imperial_announcement", "gcw_announcement_invasion_almost_defeated_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_invasion_almost_lost_rebel_"); - } - else if (factions.isRebelorRebelHelper(defendingGeneral)) - { - LOG("gcw_announcement", "invasionEndsSoon defending general is Rebel"); - webster.put("imperial_announcement", "gcw_announcement_invasion_almost_lost_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_invasion_almost_defeated_rebel_"); - } - webster.put("neutral_announcement", "gcw_announcement_invasion_almost_defeated_neutral_"); - CustomerServiceLog("gcw_city_invasion", "gcw_city.invasionEndsSoon: invasionEndsSoon has sent all players messages regarding the combat phase ending soon. Message sent at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - - messageToPlayersOnPlanet("notifyPlayerOfGcwCityEventAnnouncement", webster, 0.0f, announcementOrigin, announcementRadius, false); - return SCRIPT_CONTINUE; - } - - - public int defenseGeneralUnderSustainedAttack(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_announcement", "defenseGeneralUnderSustainedAttack init"); - - if ((!utils.hasScriptVar(self, "defendingGeneral") || !utils.hasScriptVar(self, "planetName") || !utils.hasScriptVar(self, "cityName"))) - { - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneral = utils.getObjIdScriptVar(self, "defendingGeneral"); - if (!isValidId(defendingGeneral) || !exists(defendingGeneral)) - { - return SCRIPT_CONTINUE; - } - - String planetName = utils.getStringScriptVar(self, "planetName"); - if (planetName == null || planetName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityName = utils.getStringScriptVar(self, "cityName"); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - location announcementOrigin = utils.getLocationScriptVar(self, "announcementOrigin"); - if (announcementOrigin == null) - { - return SCRIPT_CONTINUE; - } - - float announcementRadius = utils.getFloatScriptVar(self, "announcementRadius"); - if (announcementRadius <= -1) - { - return SCRIPT_CONTINUE; - } - - dictionary webster = new dictionary(); - webster.put("string_file", "gcw"); - webster.put("planetName", planetName); - webster.put("cityName", cityName); - - if (factions.isImperialorImperialHelper(defendingGeneral)) - { - LOG("gcw_announcement", "defenseGeneralUnderSustainedAttack defending general is Imperial"); - webster.put("imperial_announcement", "gcw_announcement_general_under_attack_imperial_"); - } - else if (factions.isRebelorRebelHelper(defendingGeneral)) - { - LOG("gcw_announcement", "defenseGeneralUnderSustainedAttack defending general is Rebel"); - webster.put("rebel_announcement", "gcw_announcement_general_under_attack_rebel_"); - } - webster.put("neutral_announcement", "gcw_announcement_general_under_attack_neutral_"); - - messageToPlayersOnPlanet("notifyPlayerOfGcwCityEventAnnouncement", webster, 0.0f, announcementOrigin, announcementRadius, false); - CustomerServiceLog("gcw_city_invasion", "gcw_city.defenseGeneralUnderSustainedAttack: defenseGeneralUnderSustainedAttack has sent all players messages regarding the generals status. Message sent at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - - return SCRIPT_CONTINUE; - } - - - public int startFactionDefense(obj_id self, dictionary params) throws InterruptedException - { - - gcw_score.clearGcwData(); - gcw_score.setGcwPhase(gcw.GCW_CITY_PHASE_CONSTRUCTION); - - int percentage = gcw.getRebelPercentileByRegion(self); - - obj_id planet = getPlanetByName("tatooine"); - - String cityName = gcw.getCityFromTable(self); - - if (percentage > 50) - { - LOG("dologging", "gcw_city beginInvasion rebel_defense > 50"); - sendSequenceTrigger(self, "rebel_defense"); - CustomerServiceLog("gcw_city_invasion", "gcw_city.startFactionDefense: startFactionDefense is setting the city object "+self+" to be rebel_defense at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - utils.setScriptVar(planet, "gcw.factionDefending."+ cityName, factions.FACTION_FLAG_REBEL); - } - - else if (percentage < 50) - { - LOG("dologging", "gcw_city beginInvasion imperial_defense < 50"); - sendSequenceTrigger(self, "imperial_defense"); - CustomerServiceLog("gcw_city_invasion", "gcw_city.startFactionDefense: startFactionDefense is setting the city object "+self+" to be imperial_defense at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - utils.setScriptVar(planet, "gcw.factionDefending."+ cityName, factions.FACTION_FLAG_IMPERIAL); - } - else if (percentage == 50) - { - LOG("dologging", "gcw_city beginInvasion rebel_defense == 50"); - sendSequenceTrigger(self, "rebel_defense"); - CustomerServiceLog("gcw_city_invasion", "gcw_city.startFactionDefense: startFactionDefense is setting the city object "+self+" to be rebel_defense at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - utils.setScriptVar(planet, "gcw.factionDefending."+ cityName, factions.FACTION_FLAG_REBEL); - } - - return SCRIPT_CONTINUE; - } - - - public int endConstruction(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw", "endConstruction"); - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, "gcw.constructionEnded")) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, "gcw.constructionEnded", 1); - gcw_score.setGcwPhase(gcw.GCW_CITY_PHASE_COMBAT); - - LOG("gcw", "endConstruction 2"); - - sendSequenceTrigger(self, "invasion"); - if ((!utils.hasScriptVar(self, "defendingGeneral") || !utils.hasScriptVar(self, "planetName") || !utils.hasScriptVar(self, "cityName"))) - { - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneral = utils.getObjIdScriptVar(self, "defendingGeneral"); - if (!isValidId(defendingGeneral) || !exists(defendingGeneral)) - { - return SCRIPT_CONTINUE; - } - - String planetName = utils.getStringScriptVar(self, "planetName"); - if (planetName == null || planetName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityName = utils.getStringScriptVar(self, "cityName"); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - location announcementOrigin = utils.getLocationScriptVar(self, "announcementOrigin"); - if (announcementOrigin == null) - { - return SCRIPT_CONTINUE; - } - - float announcementRadius = utils.getFloatScriptVar(self, "announcementRadius"); - if (announcementRadius <= -1) - { - return SCRIPT_CONTINUE; - } - - dictionary webster = new dictionary(); - webster.put("string_file", "gcw"); - webster.put("planetName", planetName); - webster.put("cityName", cityName); - - if (factions.isImperialorImperialHelper(defendingGeneral)) - { - LOG("gcw_announcement", "endConstruction defending general is Imperial"); - webster.put("imperial_announcement", "gcw_announcement_man_defenses_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_attack_city_rebel_"); - } - else if (factions.isRebelorRebelHelper(defendingGeneral)) - { - LOG("gcw_announcement", "endConstruction defending general is Rebel"); - webster.put("imperial_announcement", "gcw_announcement_attack_city_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_man_defenses_rebel_"); - } - - Vector rebelParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_REBEL); - Vector imperialParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_IMPERIAL); - - gcw.awardGcwInvasionParticipants(rebelParticipants, factions.FACTION_FLAG_REBEL, gcw.GCW_TOKENS_CONSTRUCTION_PHASE, gcw.GCW_POINTS_CONSTRUCTION_PHASE); - gcw.awardGcwInvasionParticipants(imperialParticipants, factions.FACTION_FLAG_IMPERIAL, gcw.GCW_TOKENS_CONSTRUCTION_PHASE, gcw.GCW_POINTS_CONSTRUCTION_PHASE); - - webster.put("neutral_announcement", "gcw_announcement_man_defenses_neutral_"); - - messageToPlayersOnPlanet("notifyPlayerOfGcwCityEventAnnouncement", webster, 0.0f, announcementOrigin, announcementRadius, false); - CustomerServiceLog("gcw_city_invasion", "gcw_city.endConstruction: endConstruction has sent all players messages regarding the construction phase has ended. Message sent at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - - utils.setScriptVar(self, "phase", PHASE_COMBAT); - messageTo(self, "updateGcwMapData", params, 0.0f, false); - return SCRIPT_CONTINUE; - } - - - public void sendSequenceTrigger(obj_id self, String trig) throws InterruptedException - { - dictionary dict = trial.getSessionDict(self); - - LOG("dologging", "sendSequenceTrigger dict.getInt(MESSAGE_SESSION): "+ dict.getInt(trial.MESSAGE_SESSION)); - - dict.put("triggerType", "triggerId"); - dict.put("triggerName", trig); - messageTo(self, "triggerFired", dict, 2.0f, false); - } - - - public int invasionHalfWayPoint(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_announcement", "invasionHalfWayPoint init"); - - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - if ((!utils.hasScriptVar(self, "defendingGeneral") || !utils.hasScriptVar(self, "planetName") || !utils.hasScriptVar(self, "cityName"))) - { - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneral = utils.getObjIdScriptVar(self, "defendingGeneral"); - if (!isValidId(defendingGeneral) || !exists(defendingGeneral)) - { - return SCRIPT_CONTINUE; - } - - String planetName = utils.getStringScriptVar(self, "planetName"); - if (planetName == null || planetName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityName = utils.getStringScriptVar(self, "cityName"); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - location announcementOrigin = utils.getLocationScriptVar(self, "announcementOrigin"); - if (announcementOrigin == null) - { - return SCRIPT_CONTINUE; - } - - float announcementRadius = utils.getFloatScriptVar(self, "announcementRadius"); - if (announcementRadius <= -1) - { - return SCRIPT_CONTINUE; - } - - dictionary webster = new dictionary(); - webster.put("string_file", "gcw"); - webster.put("planetName", planetName); - webster.put("cityName", cityName); - - if (factions.isImperialorImperialHelper(defendingGeneral)) - { - LOG("gcw_announcement", "invasionHalfWayPoint defending general is Imperial"); - webster.put("imperial_announcement", "gcw_announcement_defense_half_done_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_attack_half_done_rebel_"); - } - else if (factions.isRebelorRebelHelper(defendingGeneral)) - { - LOG("gcw_announcement", "invasionHalfWayPoint defending general is Rebel"); - webster.put("imperial_announcement", "gcw_announcement_attack_half_done_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_defense_half_done_rebel_"); - } - webster.put("neutral_announcement", "gcw_announcement_defense_half_done_neutral_"); - CustomerServiceLog("gcw_city_invasion", "gcw_city.invasionHalfWayPoint: invasionHalfWayPoint has sent all players messages regarding the combat phase being half over Message sent at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - - messageToPlayersOnPlanet("notifyPlayerOfGcwCityEventAnnouncement", webster, 0.0f, announcementOrigin, announcementRadius, false); - return SCRIPT_CONTINUE; - } - - - public int defendersEvacuate(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_announcement", "defendersEvacuate init"); - - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - if ((!utils.hasScriptVar(self, "defendingGeneral") || !utils.hasScriptVar(self, "planetName") || !utils.hasScriptVar(self, "cityName"))) - { - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneral = utils.getObjIdScriptVar(self, "defendingGeneral"); - if (!isValidId(defendingGeneral) || !exists(defendingGeneral)) - { - return SCRIPT_CONTINUE; - } - - String planetName = utils.getStringScriptVar(self, "planetName"); - if (planetName == null || planetName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityName = utils.getStringScriptVar(self, "cityName"); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - location announcementOrigin = utils.getLocationScriptVar(self, "announcementOrigin"); - if (announcementOrigin == null) - { - return SCRIPT_CONTINUE; - } - - float announcementRadius = utils.getFloatScriptVar(self, "announcementRadius"); - if (announcementRadius <= -1) - { - return SCRIPT_CONTINUE; - } - - dictionary webster = new dictionary(); - webster.put("string_file", "gcw"); - webster.put("planetName", planetName); - webster.put("cityName", cityName); - - Vector loserDefenseParticipants = new Vector(); - loserDefenseParticipants.setSize(0); - Vector winnerOffenseParticipants = new Vector(); - winnerOffenseParticipants.setSize(0); - int loserFactionFlag = factions.FACTION_FLAG_UNKNOWN; - int winnerFactionFlag = factions.FACTION_FLAG_UNKNOWN; - - if (factions.isImperialorImperialHelper(defendingGeneral)) - { - LOG("gcw_announcement", "defendersEvacuate defending general is Imperial"); - webster.put("imperial_announcement", "gcw_announcement_city_lost_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_city_won_rebel_"); - - loserDefenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_IMPERIAL); - loserFactionFlag = factions.FACTION_FLAG_IMPERIAL; - - winnerOffenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_REBEL); - winnerFactionFlag = factions.FACTION_FLAG_REBEL; - } - else if (factions.isRebelorRebelHelper(defendingGeneral)) - { - LOG("gcw_announcement", "defendersEvacuate defending general is Rebel"); - webster.put("imperial_announcement", "gcw_announcement_city_won_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_city_lost_rebel_"); - - loserDefenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_REBEL); - loserFactionFlag = factions.FACTION_FLAG_REBEL; - - winnerOffenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_IMPERIAL); - winnerFactionFlag = factions.FACTION_FLAG_IMPERIAL; - } - - gcw_score.setGcwWinner(winnerFactionFlag); - - webster.put("neutral_announcement", "gcw_announcement_city_lost_neutral_"); - CustomerServiceLog("gcw_city_invasion", "gcw_city.defendersEvacuate: defendersEvacuate has sent all players messages regarding the defense losing the battle. Message sent at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - - messageToPlayersOnPlanet("notifyPlayerOfGcwCityEventAnnouncement", webster, 0.0f, announcementOrigin, announcementRadius, false); - - if (loserDefenseParticipants != null && loserDefenseParticipants.size() > 0) - { - gcw.awardGcwInvasionParticipants(loserDefenseParticipants, loserFactionFlag, gcw.GCW_TOKENS_LOSER_PARTICIPANTS, gcw.GCW_POINTS_LOSER_PARTICIPANTS); - } - if (winnerOffenseParticipants != null && winnerOffenseParticipants.size() > 0) - { - gcw.awardGcwInvasionParticipants(winnerOffenseParticipants, winnerFactionFlag, gcw.GCW_TOKENS_WINNER_PARTICIPANTS, gcw.GCW_POINTS_WINNER_PARTICIPANTS); - } - - messageTo(self, "cleanupInvasion", params, 1.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int cityAttackUnsuccessful(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_announcement", "cityAttackUnsuccessful init"); - - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - if ((!utils.hasScriptVar(self, "defendingGeneral") || !utils.hasScriptVar(self, "planetName") || !utils.hasScriptVar(self, "cityName"))) - { - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneral = utils.getObjIdScriptVar(self, "defendingGeneral"); - if (!isValidId(defendingGeneral) || !exists(defendingGeneral)) - { - return SCRIPT_CONTINUE; - } - - String planetName = utils.getStringScriptVar(self, "planetName"); - if (planetName == null || planetName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityName = utils.getStringScriptVar(self, "cityName"); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - location announcementOrigin = utils.getLocationScriptVar(self, "announcementOrigin"); - if (announcementOrigin == null) - { - return SCRIPT_CONTINUE; - } - - float announcementRadius = utils.getFloatScriptVar(self, "announcementRadius"); - if (announcementRadius <= -1) - { - return SCRIPT_CONTINUE; - } - - dictionary webster = new dictionary(); - webster.put("string_file", "gcw"); - webster.put("planetName", planetName); - webster.put("cityName", cityName); - - Vector loserDefenseParticipants = new Vector(); - loserDefenseParticipants.setSize(0); - Vector winnerOffenseParticipants = new Vector(); - winnerOffenseParticipants.setSize(0); - int loserFactionFlag = factions.FACTION_FLAG_UNKNOWN; - int winnerFactionFlag = factions.FACTION_FLAG_UNKNOWN; - - if (factions.isImperialorImperialHelper(defendingGeneral)) - { - LOG("gcw_announcement", "cityAttackUnsuccessful defending general is Imperial"); - webster.put("imperial_announcement", "gcw_announcement_city_safe_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_attack_unsuccessful_rebel_"); - - loserDefenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_REBEL); - loserFactionFlag = factions.FACTION_FLAG_REBEL; - - winnerOffenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_IMPERIAL); - winnerFactionFlag = factions.FACTION_FLAG_IMPERIAL; - } - else if (factions.isRebelorRebelHelper(defendingGeneral)) - { - LOG("gcw_announcement", "cityAttackUnsuccessful defending general is Rebel"); - webster.put("imperial_announcement", "gcw_announcement_attack_unsuccessful_imperial_"); - webster.put("rebel_announcement", "gcw_announcement_city_safe_rebel_"); - - loserDefenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_IMPERIAL); - loserFactionFlag = factions.FACTION_FLAG_IMPERIAL; - - winnerOffenseParticipants = trial.getNonInstanceFactionParticipants(self, factions.FACTION_FLAG_REBEL); - winnerFactionFlag = factions.FACTION_FLAG_REBEL; - - } - - gcw_score.setGcwWinner(winnerFactionFlag); - - webster.put("neutral_announcement", "gcw_announcement_city_safe_neutral_"); - CustomerServiceLog("gcw_city_invasion", "gcw_city.cityAttackUnsuccessful: cityAttackUnsuccessful has sent all players messages regarding the offense losing the battle. Message sent at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - - messageToPlayersOnPlanet("notifyPlayerOfGcwCityEventAnnouncement", webster, 0.0f, announcementOrigin, announcementRadius, false); - if (loserDefenseParticipants != null && loserDefenseParticipants.size() > 0) - { - gcw.awardGcwInvasionParticipants(loserDefenseParticipants, loserFactionFlag, gcw.GCW_TOKENS_LOSER_PARTICIPANTS, gcw.GCW_POINTS_LOSER_PARTICIPANTS); - } - if (winnerOffenseParticipants != null && winnerOffenseParticipants.size() > 0) - { - gcw.awardGcwInvasionParticipants(winnerOffenseParticipants, winnerFactionFlag, gcw.GCW_TOKENS_WINNER_PARTICIPANTS, gcw.GCW_POINTS_WINNER_PARTICIPANTS); - } - - messageTo(self, "cleanupInvasion", params, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int cleanupInvasion(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!trial.verifySession(self, params)) - { - return SCRIPT_CONTINUE; - } - - trial.clearNonInstanceFactionParticipants(self); - - utils.setScriptVar(self, "phase", PHASE_OCCUPATION); - messageTo(self, "updateGcwMapData", params, 0.0f, false); - - utils.removeScriptVar(self, "gcw.constructionEnded"); - utils.removeScriptVar(self, "gcw.invasionRunning"); - gcw_score.setGcwPhase(gcw.GCW_CITY_PHASE_UNKNOWN); - - obj_id planet = getPlanetByName("tatooine"); - String cityName = gcw.getCityFromTable(self); - - if (isIdValid(planet)) - { - utils.removeScriptVar(planet, "gcw.invasionRunning."+ cityName); - utils.removeScriptVar(planet, "gcw.factionDefending."+ cityName); - } - - messageTo(self, "cleanupSpawn", null, 1.0f, false); - CustomerServiceLog("gcw_city_invasion", "gcw_city.cleanupInvasion: cleanupInvasion is cleaning up all the assets for the battle. This happened at: "+getGameTime()+" session: "+params.getInt(trial.MESSAGE_SESSION)); - - return SCRIPT_CONTINUE; - } - - - public int updateGcwMapData(obj_id self, dictionary params) throws InterruptedException - { - LOG("gcw_map_data", "updateGcwMapData init"); - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "phase")) - { - return SCRIPT_CONTINUE; - } - - int phase = utils.getIntScriptVar(self, "phase"); - if (phase < PHASE_CONSTRUCTION) - { - return SCRIPT_CONTINUE; - } - - LOG("gcw_map_data", "updateGcwMapData phase: "+phase); - - if (!trial.verifySession(self, params) && phase != PHASE_OCCUPATION) - { - return SCRIPT_CONTINUE; - } - - if (params == null) - { - return SCRIPT_CONTINUE; - } - - location announcementOrigin = utils.getLocationScriptVar(self, "announcementOrigin"); - if (announcementOrigin == null) - { - return SCRIPT_CONTINUE; - } - - String cityName = utils.getStringScriptVar(self, "cityName"); - if (cityName == null || cityName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String cityFirstLetter = cityName.substring(0,1); - String remainder = cityName.substring(1); - String cityNameString = cityFirstLetter.toUpperCase() + remainder.toLowerCase(); - - obj_id cityObject = utils.getObjIdScriptVar(self, "cityObject"); - if (!isValidId(cityObject) || !exists(cityObject)) - { - return SCRIPT_CONTINUE; - } - - String color = ""; - String defenders = ""; - String invaders = ""; - String stringName = ""; - - int faction = utils.getIntScriptVar(self, "currentOccupyFaction"); - - LOG("gcw_map_data", "updateGcwMapData faction: "+faction); - - if (faction != factions.FACTION_FLAG_REBEL && faction != factions.FACTION_FLAG_IMPERIAL) - { - return SCRIPT_CONTINUE; - } - - if (faction == factions.FACTION_FLAG_REBEL) - { - LOG("gcw_map_data", "updateGcwMapData faction is REB"); - - color = COLOR_REBELS; - defenders = "Rebel"; - invaders = "Imperial"; - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - LOG("gcw_map_data", "updateGcwMapData faction is IMP"); - - color = COLOR_IMPERIALS; - defenders = "Imperial"; - invaders = "Rebel"; - } - - obj_id planet = getPlanetByName("tatooine"); - - int currentTime = getCalendarTime(); - LOG("gcw_map_data", "updateGcwMapData currentTime format: "+getCalendarTimeStringLocal(currentTime)); - int lastPulse = utils.getIntScriptVar(planet, "gcw.calendar_time."+ cityName); - LOG("gcw_map_data", "updateGcwMapData lastPulse format: "+getCalendarTimeStringLocal(lastPulse)); - - if (phase == PHASE_CONSTRUCTION) - { - int nextPulse = (lastPulse + gcw.GCW_CONSTRUCTION_END_TIMER); - LOG("gcw_map_data", "updateGcwMapData nextPulse format: "+getCalendarTimeStringLocal(nextPulse)); - - String theNextPulse = utils.padTimeHM(nextPulse - currentTime); - LOG("gcw_map_data", "updateGcwMapData theNextPulse format: "+getCalendarTimeStringLocal(nextPulse)); - - if (theNextPulse != null && theNextPulse.length() > 0) - { - stringName = color + cityNameString + "\n"+ defenders + "s Building Defenses\n"+ theNextPulse;; - } - else - { - stringName = color + cityNameString + "\n"+ defenders + "s Building Defenses"; - } - - } - else if (phase == PHASE_COMBAT) - { - int nextPulse = (lastPulse + gcw.GCW_CONSTRUCTION_END_TIMER + gcw.GCW_COMBAT_END_TIMER); - LOG("gcw_map_data_err", "updateGcwMapData nextPulse format: "+getCalendarTimeStringLocal(nextPulse)); - - String theNextPulse = utils.padTimeHM(nextPulse - currentTime); - LOG("gcw_map_data_err", "updateGcwMapData theNextPulse format: "+getCalendarTimeStringLocal(nextPulse)); - - if (theNextPulse != null && theNextPulse.length() > 0) - { - stringName = color + cityNameString + "\n"+ invaders + "s Invading\n"+ theNextPulse;; - } - else - { - stringName = color + cityNameString + "\n"+ invaders + "s Invading "; - } - } - else if (phase == PHASE_OCCUPATION) - { - int nextPulse = (lastPulse + gcw.GCW_PULSE_TIMER); - LOG("gcw_map_data", "updateGcwMapData nextPulse format: "+getCalendarTimeStringLocal(nextPulse)); - - String theNextPulse = utils.padTimeHM(nextPulse - currentTime); - LOG("gcw_map_data", "updateGcwMapData theNextPulse format: "+getCalendarTimeStringLocal(nextPulse)); - - if (theNextPulse != null && theNextPulse.length() > 0) - { - stringName = color + cityNameString + "\n"+ defenders + " Occupation\n"+ theNextPulse; - } - else - { - stringName = color + cityNameString + "\n"+ defenders + " Occupation"; - } - } - - LOG("gcw_map_data", "updateGcwMapData stringName: "+stringName); - - removePlanetaryMapLocation(cityObject); - if (!addPlanetaryMapLocation(cityObject, stringName, (int)announcementOrigin.x, (int)announcementOrigin.z - 10, planetary_map.CITY, null, MLT_STATIC, planetary_map.NO_FLAG)) - { - LOG("gcw_map_data", "updateGcwMapData addPlanetaryMapLocation FAILED to update planet map"); - } - else - { - LOG("gcw_map_data", "updateGcwMapData addPlanetaryMapLocation successfully updated planet map"); - } - - dictionary dict = trial.getSessionDict(cityObject); - messageTo(self, "updateGcwMapData", params, 60.0f, false); - return SCRIPT_CONTINUE; - } - - - public boolean verifyCurrentOccupyFaction(obj_id cityObject) throws InterruptedException - { - LOG("gcw_map_data", "switchCurrentOccupyFaction init"); - if (!isValidId(cityObject) || !exists(cityObject)) - { - return false; - } - if (!utils.hasScriptVar(cityObject, "currentOccupyFaction")) - { - return false; - } - - int faction = utils.getIntScriptVar(cityObject, "currentOccupyFaction"); - LOG("gcw_map_data", "switchCurrentOccupyFaction faction: "+faction); - if (faction != factions.FACTION_FLAG_REBEL && faction != factions.FACTION_FLAG_IMPERIAL) - { - return false; - } - - int percentage = gcw.getRebelPercentileByRegion(cityObject); - - if (percentage > 50 && faction == factions.FACTION_FLAG_IMPERIAL) - { - LOG("gcw_map_data", "switchCurrentOccupyFaction switching to REB faction"); - utils.setScriptVar(cityObject, "currentOccupyFaction", factions.FACTION_FLAG_REBEL); - } - - else if (percentage < 50 && faction == factions.FACTION_FLAG_REBEL) - { - LOG("gcw_map_data", "switchCurrentOccupyFaction switching to IMP faction"); - utils.setScriptVar(cityObject, "currentOccupyFaction", factions.FACTION_FLAG_IMPERIAL); - } - else if (percentage == 50 && faction == factions.FACTION_FLAG_IMPERIAL) - { - LOG("gcw_map_data", "switchCurrentOccupyFaction switching to REB faction"); - utils.setScriptVar(cityObject, "currentOccupyFaction", factions.FACTION_FLAG_REBEL); - } - - dictionary dict = trial.getSessionDict(cityObject); - messageTo(cityObject, "updateGcwMapData", dict, 0.0f, false); - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_kit.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_kit.java deleted file mode 100644 index a637fcc20..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_kit.java +++ /dev/null @@ -1,327 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.factions; -import script.library.gcw; -import script.library.trial; -import script.library.utils; - - -public class gcw_city_kit extends script.base_script -{ - public gcw_city_kit() - { - } - public static final int CONSTRUCTION_HP_BASE = 5000; - - - public void destroyKitObj(obj_id self) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - return; - } - - obj_id kitObj = getObjIdObjVar(self, "gcw.kitObj"); - - if (!isIdValid(kitObj) || !exists(kitObj)) - { - return; - } - - trial.cleanupObject(kitObj); - - removeObjVar(self, "gcw.kitObj"); - utils.removeScriptVar(self, "iconMessageTime"); - } - - - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (!isGod(objSpeaker)) - { - return SCRIPT_CONTINUE; - } - - if (strText.equals("gcwcleanup")) - { - destroyKitObj(self); - } - - if (strText.equals("gcwbuildi")) - { - - dictionary params = new dictionary(); - - params.put("faction", factions.FACTION_FLAG_IMPERIAL); - - messageTo(self, "beginConstruction", params, 1.0f, false); - } - - if (strText.equals("gcwbuildr")) - { - - dictionary params = new dictionary(); - - params.put("faction", factions.FACTION_FLAG_REBEL); - - messageTo(self, "beginConstruction", params, 1.0f, false); - } - - if (strText.equals("gcwinvadei")) - { - - dictionary params = new dictionary(); - - obj_id pylon = getObjIdObjVar(self, "gcw.kitObj"); - - if (!isIdValid(pylon) || !exists(pylon)) - { - return SCRIPT_CONTINUE; - } - - setObjVar(pylon, "gcw.constructionQuestsCompleted", 40); - - params.put("faction", factions.FACTION_FLAG_IMPERIAL); - - messageTo(self, "beginInvasion", params, 1.0f, false); - } - - if (strText.equals("gcwinvader")) - { - - dictionary params = new dictionary(); - - obj_id pylon = getObjIdObjVar(self, "gcw.kitObj"); - - if (!isIdValid(pylon) || !exists(pylon)) - { - return SCRIPT_CONTINUE; - } - - setObjVar(pylon, "gcw.constructionQuestsCompleted", 40); - - params.put("faction", factions.FACTION_FLAG_REBEL); - - messageTo(self, "beginInvasion", params, 1.0f, false); - } - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - destroyKitObj(self); - - return SCRIPT_CONTINUE; - } - - - public int getConstructionQuestsCompleted(obj_id pylon) throws InterruptedException - { - int completed = 0; - - if (!isIdValid(pylon) || !exists(pylon)) - { - return 0; - } - - if (hasObjVar(pylon, "gcw.constructionQuestsCompleted")) - { - completed = getIntObjVar(pylon, "gcw.constructionQuestsCompleted"); - } - - return completed; - } - - - public boolean hasConstructionQuests() throws InterruptedException - { - return true; - } - - - public void setupConstructionQuests(obj_id self, obj_id pylon) throws InterruptedException - { - } - - - public int beginConstruction(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - destroyKitObj(self); - - int faction = params.getInt("faction"); - - if (hasObjVar(self, "factionFlag")) - { - faction = getIntObjVar(self, "factionFlag"); - } - - if (faction != factions.FACTION_FLAG_REBEL && faction != factions.FACTION_FLAG_IMPERIAL) - { - return SCRIPT_CONTINUE; - } - - location loc = getLocation(self); - - if (hasConstructionQuests()) - { - - obj_id pylon = createObject("object/tangible/destructible/gcw_city_construction_beacon.iff", loc); - - if (isIdValid(pylon) && exists(pylon)) - { - setObjVar(self, "gcw.kitObj", pylon); - utils.setObjVar(self, "factionFlag", faction); - utils.setScriptVar(pylon, "faction", faction); - setObjVar(pylon, "gcw.constructionQuestsCompleted", getObjVar(self, "gcw.constructionQuestsCompleted")); - - String spawnID = getStringObjVar(self, "spawn_id"); - - setObjVar(pylon, "spawn_id", spawnID); - - obj_id kitParent = trial.getParent(self); - - if (isIdValid(kitParent) && exists(kitParent)) - { - trial.setParent(kitParent, pylon, true); - trial.storeSpawnedChild(kitParent, pylon, spawnID); - } - - trial.markAsTempObject(pylon, true); - trial.setInterest(pylon); - - attachScript(pylon, "systems.dungeon_sequencer.ai_controller"); - - setupConstructionQuests(self, pylon); - } - } - - return SCRIPT_CONTINUE; - } - - - public void setupInvasionQuests(obj_id kit) throws InterruptedException - { - } - - - public obj_id createFactionKit(int faction, location loc) throws InterruptedException - { - return null; - } - - - public int getConstructionHP() throws InterruptedException - { - return CONSTRUCTION_HP_BASE; - } - - - public int beginInvasion(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id pylon = getObjIdObjVar(self, "gcw.kitObj"); - - int construction = getConstructionQuestsCompleted(pylon); - int faction = getIntObjVar(self, "factionFlag"); - - destroyKitObj(self); - - if (construction < 1) - { - return SCRIPT_CONTINUE; - } - - setObjVar(self, "gcw.constructionQuestsCompleted", construction); - - location loc = getLocation(self); - - obj_id kit = createFactionKit(faction, loc); - - if (isIdValid(kit) && exists(kit)) - { - setYaw(kit, getYaw(self)); - - setObjVar(self, "gcw.kitObj", kit); - setObjVar(self, "factionFlag", faction); - utils.setScriptVar(kit, "faction", faction); - - if (faction == factions.FACTION_FLAG_REBEL) - { - factions.setFaction(kit, "Rebel"); - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - factions.setFaction(kit, "Imperial"); - } - - utils.setScriptVar(kit, "creator", self); - - obj_id kitParent = trial.getParent(self); - - String spawnId = getStringObjVar(self, "spawn_id"); - - if (isIdValid(kitParent) && exists(kitParent)) - { - trial.setParent(kitParent, kit, true); - if (spawnId.equals("offense_patrol") || spawnId.equals("vehicle_patrol")) - { - trial.storeSpawnedChild(kitParent, kit, "offense_quest_asset"); - setObjVar(kit, "spawn_id", "offense_quest_asset"); - } - else if (spawnId.equals("defense_patrol")) - { - trial.storeSpawnedChild(kitParent, kit, "defense_quest_asset"); - setObjVar(kit, "spawn_id", "defense_quest_asset"); - } - else - { - trial.storeSpawnedChild(kitParent, kit, spawnId); - setObjVar(kit, "spawn_id", spawnId); - } - } - - trial.markAsTempObject(kit, true); - trial.setInterest(kit); - trial.setHp(kit, construction * getConstructionHP()); - - if (!isMob(kit)) - { - setObjVar(kit, "pvpCanAttack", 1); - setObjVar(kit, "ai_combat.attackable", 1); - } - - attachScript(kit, "systems.dungeon_sequencer.ai_controller"); - } - - setupInvasionQuests(kit); - - return SCRIPT_CONTINUE; - } - - - public int cleanup(obj_id self, dictionary params) throws InterruptedException - { - destroyKitObj(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_kit_turret.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_kit_turret.java deleted file mode 100644 index 3dc3cab6e..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_kit_turret.java +++ /dev/null @@ -1,160 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.advanced_turret; -import script.library.create; -import script.library.factions; -import script.library.utils; - - - -public class gcw_city_kit_turret extends script.systems.gcw.gcw_city_kit -{ - public gcw_city_kit_turret() - { - } - public static final int CONSTRUCTION_HP_TURRET = 10000; - - public static final String[] lowImperials = - { - "gcw_city_imperial_turret_1" - }; - - public static final String[] normalImperials = - { - "gcw_city_imperial_turret_2" - }; - - public static final String[] eliteImperials = - { - "gcw_city_imperial_turret_3" - }; - - public static final String[] lowRebels = - { - "gcw_city_rebel_turret_1" - }; - - public static final String[] normalRebels = - { - "gcw_city_rebel_turret_2" - }; - - public static final String[] eliteRebels = - { - "gcw_city_rebel_turret_3" - }; - - - public void setupConstructionQuests(obj_id self, obj_id pylon) throws InterruptedException - { - setName(pylon, "Turret Construction Site"); - - attachScript(pylon, "systems.gcw.gcw_city_pylon_turret"); - } - - - public void setupInvasionQuests(obj_id kit) throws InterruptedException - { - } - - - public obj_id createFactionKit(int faction, location loc) throws InterruptedException - { - if (loc == null) - { - return null; - } - - obj_id kit = null; - obj_id self = getSelf(); - - if (!isIdValid(self) || !exists(self)) - { - return null; - } - - int construction = getConstructionQuestsCompleted(self); - - String npcName = ""; - - int turretMinDamage = 1; - int turretMaxDamage = 2; - - if (construction < 1) - { - return null; - } - else if (construction < 50) - { - turretMinDamage = 1000; - turretMaxDamage = 2000; - - if (faction == factions.FACTION_FLAG_REBEL) - { - npcName = lowRebels[rand(0, lowRebels.length - 1)]; - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - npcName = lowImperials[rand(0, lowImperials.length - 1)]; - } - } - else if (construction < 100) - { - turretMinDamage = 2000; - turretMaxDamage = 4000; - - if (faction == factions.FACTION_FLAG_REBEL) - { - npcName = normalRebels[rand(0, normalRebels.length - 1)]; - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - npcName = normalImperials[rand(0, normalImperials.length - 1)]; - } - } - else if (construction >= 100) - { - turretMinDamage = 3000; - turretMaxDamage = 6000; - - if (faction == factions.FACTION_FLAG_REBEL) - { - npcName = eliteRebels[rand(0, eliteRebels.length - 1)]; - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - npcName = eliteImperials[rand(0, eliteImperials.length - 1)]; - } - } - - if (factions.FACTION_FLAG_IMPERIAL == faction) - { - kit = advanced_turret.createTurret(loc, getYaw(self), advanced_turret.TYPE_BLOCK, advanced_turret.SIZE_LARGE, - advanced_turret.DAMAGE_ELEMENTAL_HEAT, turretMinDamage, turretMaxDamage, construction * getConstructionHP(), 64.0f, 4.0f, "Imperial"); - setName(kit, "Imperial Turret"); - attachScript(kit, "systems.gcw.gcw_turret"); - } - else if (factions.FACTION_FLAG_REBEL == faction) - { - kit = advanced_turret.createTurret(loc, getYaw(self), advanced_turret.TYPE_DISH, advanced_turret.SIZE_LARGE, - advanced_turret.DAMAGE_ELEMENTAL_HEAT, turretMinDamage, turretMaxDamage, construction * getConstructionHP(), 64.0f, 4.0f, "Rebel"); - setName(kit, "Rebel Turret"); - attachScript(kit, "systems.gcw.gcw_turret"); - } - return kit; - } - - - public int getConstructionHP() throws InterruptedException - { - return CONSTRUCTION_HP_TURRET; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon.java deleted file mode 100644 index 56c5878a5..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon.java +++ /dev/null @@ -1,499 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.prose; -import script.library.skill; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class gcw_city_pylon extends script.base_script -{ - public gcw_city_pylon() - { - } - public static final int PYLON_CONSTRUCTION_TIME = 10; - - public static final string_id SID_PYLON_CANNOT_USE = new string_id("gcw", "pylon_construction_cannot_use"); - public static final string_id SID_PYLON_CONSTRUCTION_COMPLETE = new string_id("gcw", "pylon_construction_complete"); - public static final string_id SID_PYLON_TOO_FAR = new string_id("gcw", "pylon_too_far"); - public static final string_id SID_PYLON_SUI_PROMPT = new string_id("gcw", "pylon_construction_prompt"); - public static final string_id SID_PYLON_ENTERED_COMBAT = new string_id("gcw", "pylon_construction_entered_combat"); - public static final string_id SID_PYLON_MOVED = new string_id("gcw", "pylon_construction_moved"); - public static final string_id SID_PYLON_INCAPACITATED = new string_id("gcw", "pylon_construction_incapacitated"); - public static final string_id SID_TOO_FATIGUED = new string_id("gcw", "too_fatigued_to_construct"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "handleSetup", null, 1.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int OnHearSpeech(obj_id self, obj_id objSpeaker, String strText) throws InterruptedException - { - if (!isGod(objSpeaker)) - { - return SCRIPT_CONTINUE; - } - - if (strText.equals("gcwbuild")) - { - int questsCompleted = getIntObjVar(self, "gcw.constructionQuestsCompleted"); - - if (questsCompleted < gcw.GCW_CONSTRUCTION_MAXIMUM / 2) - { - questsCompleted = gcw.GCW_CONSTRUCTION_MAXIMUM / 2; - } - else if (questsCompleted < gcw.GCW_CONSTRUCTION_MAXIMUM) - { - questsCompleted = gcw.GCW_CONSTRUCTION_MAXIMUM; - } - - setObjVar(self, "gcw.constructionQuestsCompleted", questsCompleted); - } - - return SCRIPT_CONTINUE; - } - - - public void updatePylonName(obj_id self) throws InterruptedException - { - String name = utils.getStringScriptVar(self, "gcw.name"); - - int questsCompleted = getIntObjVar(self, "gcw.constructionQuestsCompleted"); - - int questsMaximum = getMaximumQuests(self); - - if (questsMaximum == 0) - { - return; - } - - String suffix = ""; - - if (questsCompleted >= questsMaximum) - { - suffix = " (100 Resources)"; - } - else if (questsCompleted <= 0) - { - suffix = " (0 Resources)"; - } - else - { - suffix = " ("+ questsCompleted + " Resources)"; - } - - setName(self, name + suffix); - } - - - public String getImperialIcon() throws InterruptedException - { - return "pt_icon_quest_red.prt"; - } - - - public String getRebelIcon() throws InterruptedException - { - return "pt_icon_quest_red.prt"; - } - - - public int handleSetup(obj_id self, dictionary params) throws InterruptedException - { - if (!utils.hasScriptVar(self, "faction")) - { - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - - if (factions.FACTION_FLAG_IMPERIAL == faction) - { - utils.setScriptVar(self, "gcwQuestIcon", getImperialIcon()); - } - else if (factions.FACTION_FLAG_REBEL == faction) - { - utils.setScriptVar(self, "gcwQuestIcon", getRebelIcon()); - } - - gcw.playQuestIconParticle(self); - - updatePylonName(self); - - return SCRIPT_CONTINUE; - } - - - public int handleUpdateName(obj_id self, dictionary params) throws InterruptedException - { - updatePylonName(self); - - return SCRIPT_CONTINUE; - } - - - public int playQuestIcon(obj_id self, dictionary params) throws InterruptedException - { - int questsCompleted = getIntObjVar(self, "gcw.constructionQuestsCompleted"); - - if (questsCompleted < getMaximumQuests(self)) - { - gcw.playQuestIconHandler(self, params); - } - - return SCRIPT_CONTINUE; - } - - - public int getMaximumQuests(obj_id self) throws InterruptedException - { - return gcw.GCW_CONSTRUCTION_MAXIMUM; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int questsCompleted = getIntObjVar(self, "gcw.constructionQuestsCompleted"); - int questsMaximum = getMaximumQuests(self); - - if (questsCompleted > questsMaximum) - { - questsCompleted = questsMaximum; - } - - if (questsCompleted > 0) - { - names[idx] = "construction_completed"; - attribs[idx] = "" + questsCompleted + " (" + questsMaximum + " Maximum)"; - idx++; - } - else - { - names[idx] = "construction_completed"; - attribs[idx] = "0 (" + questsMaximum + " Maximum)"; - idx++; - } - - if (questsCompleted <= 0) - { - names[idx] = "pylon_level"; - attribs[idx] = "0 (No construction)"; - idx++; - } - else if (questsCompleted < getMaximumQuests(self) / 2) - { - names[idx] = "pylon_level"; - attribs[idx] = "1"; - idx++; - } - else if (questsCompleted < getMaximumQuests(self)) - { - names[idx] = "pylon_level"; - attribs[idx] = "2"; - idx++; - } - else if (questsCompleted >= getMaximumQuests(self)) - { - names[idx] = "pylon_level"; - attribs[idx] = "3"; - idx++; - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public String getConstructionQuest() throws InterruptedException - { - return "gcw_construct_barricade"; - } - - - public boolean hasConstructionResources(obj_id player) throws InterruptedException - { - return false; - } - - - public boolean consumeConstructionResources(obj_id player) throws InterruptedException - { - return false; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "faction")) - { - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - if (faction < 0) - { - return SCRIPT_CONTINUE; - } - - menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE); - - if (data != null) - { - data.setServerNotify (true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.ITEM_USE) - { - if (isDead(player) || isIncapacitated(player) || !factions.isPlayerSameGcwFactionAsSchedulerObject(player, self) || factions.isOnLeave(player)) - { - sendSystemMessage(player, SID_PYLON_CANNOT_USE); - return SCRIPT_CONTINUE; - } - - if (getDistance(self, player) > 5.0f) - { - sendSystemMessage(player, SID_PYLON_TOO_FAR); - return SCRIPT_CONTINUE; - } - - int questsCompleted = getIntObjVar(self, "gcw.constructionQuestsCompleted"); - - if (questsCompleted >= getMaximumQuests(self)) - { - sendSystemMessage(player, SID_PYLON_CONSTRUCTION_COMPLETE); - return SCRIPT_CONTINUE; - } - - String skillTemplate = getSkillTemplate(player); - String profession = skill.getProfessionName(skillTemplate); - - String questName = getConstructionQuest(); - - if (groundquests.hasCompletedQuest(player, questName)) - { - groundquests.clearQuest(player, questName); - } - - if (!groundquests.isQuestActive(player, questName)) - { - groundquests.grantQuest(player, questName); - - return SCRIPT_CONTINUE; - } - - if (groundquests.isQuestActive(player, questName) && gcw.hasConstructionOrRepairTool(player, self)) - { - startConstructionAttempt(self, player); - - faceTo(player, self); - doAnimationAction(player, "manipulate_medium"); - - location loc = getLocation(self); - - playClientEffectLoc(self, "appearance/pt_gcw_pylon_construction.prt", loc, 0); - } - else if (groundquests.isQuestActive(player, questName) && !gcw.hasConstructionOrRepairTool(player, self)) - { - gcw.playerSystemMessageResourceNeeded(player, self, true); - } - } - - return SCRIPT_CONTINUE; - } - - - public void startConstructionAttempt(obj_id self, obj_id player) throws InterruptedException - { - int gameTime = getGameTime(); - - stealth.testInvisCombatAction(player, self); - - int flags = 0; - flags |= sui.CD_EVENT_LOCOMOTION; - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - flags |= sui.CD_EVENT_STEALTHED; - flags |= sui.CD_EVENT_DAMAGE_IMMUNE; - - int captureTime = PYLON_CONSTRUCTION_TIME + gcw.getFatigueTimerMod(player); - - if (captureTime > gcw.GCW_FATIGUE_TIMER_MAX) - { - captureTime = gcw.GCW_FATIGUE_TIMER_MAX; - } - - if (isGod(player)) - { - captureTime = 3; - } - - int pid = sui.smartCountdownTimerSUI(self, player, "gcwPylonConstruction", SID_PYLON_SUI_PROMPT, 0, captureTime, "handleConstructionAttemptResults", 4.0f, flags); - } - - - public int handleConstructionAttemptResults(obj_id self, dictionary params) throws InterruptedException - { - int pid = params.getInt("id"); - obj_id player = params.getObjId("player"); - - if (!isIdValid(player) || !exists(player) || factions.isOnLeave(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - return SCRIPT_CONTINUE; - } - else if (bp == sui.BP_REVERT) - { - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_COMBAT) - { - sendSystemMessage(player, SID_PYLON_ENTERED_COMBAT); - } - else if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(player, SID_PYLON_MOVED); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(player, SID_PYLON_INCAPACITATED); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR)) - { - return SCRIPT_CONTINUE; - } - - int test_pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - return SCRIPT_CONTINUE; - } - - int questsCompleted = getIntObjVar(self, "gcw.constructionQuestsCompleted"); - - if (questsCompleted >= getMaximumQuests(self)) - { - sendSystemMessage(player, SID_PYLON_CONSTRUCTION_COMPLETE); - return SCRIPT_CONTINUE; - } - - String questName = getConstructionQuest(); - if (questName == null || questName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - LOG("gcw_constrction","handleConstructionAttemptResults checking for quest: "+questName); - - if (!groundquests.isQuestActive(player, questName)) - { - return SCRIPT_CONTINUE; - } - - LOG("gcw_constrction","handleConstructionAttemptResults checking tasks for quest: "+questName); - - if (!groundquests.isTaskActive(player, questName, gcw.GCW_CONSTRUCTION_TASK + "_" + questName)) - { - return SCRIPT_CONTINUE; - } - - LOG("gcw_constrction","handleConstructionAttemptResults task found"); - - if (gcw.useConstructionOrRepairTool(player, self)) - { - LOG("gcw_constrction","handleTraderRepairQuest Rebel task was signaled"); - groundquests.sendSignal(player, gcw.GCW_CONSTRUCTION_SIGNAL + "_"+ questName); - trial.addNonInstanceFactionParticipant(player, self); - - buff.applyBuff(player, "gcw_fatigue"); - - int gameTime = getGameTime(); - - params.put("gcwFatigueTime", gameTime); - utils.setScriptVar(player, "gcw.fatigueTime", gameTime); - - messageTo(player, "gcwFatigueDecay", params, 120.0f, false); - - int completed = getIntObjVar(self, "gcw.constructionQuestsCompleted"); - - String skillTemplate = getSkillTemplate(player); - String profession = skill.getProfessionName(skillTemplate); - - if (profession.equals("trader")) - { - completed += 10; - } - else - { - completed++; - } - - setObjVar(self, "gcw.constructionQuestsCompleted", completed); - - updatePylonName(self); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_barricade.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_barricade.java deleted file mode 100644 index 81e492f7a..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_barricade.java +++ /dev/null @@ -1,37 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.skill; -import script.library.utils; - - - -public class gcw_city_pylon_barricade extends script.systems.gcw.gcw_city_pylon -{ - public gcw_city_pylon_barricade() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, gcw.GCW_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_barricade_tool.iff"); - return super.OnAttach(self); - } - - - public String getConstructionQuest() throws InterruptedException - { - return "gcw_construct_barricade"; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_patrol.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_patrol.java deleted file mode 100644 index df5eb26b3..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_patrol.java +++ /dev/null @@ -1,39 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.skill; -import script.library.utils; - - - -public class gcw_city_pylon_patrol extends script.systems.gcw.gcw_city_pylon -{ - public gcw_city_pylon_patrol() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, gcw.GCW_DEF_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_spawner_tool.iff"); - setObjVar(self, gcw.GCW_OFF_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_patrol_tool.iff"); - - return super.OnAttach(self); - } - - - public String getConstructionQuest() throws InterruptedException - { - return "gcw_construct_patrol"; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_tower.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_tower.java deleted file mode 100644 index 4054966f2..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_tower.java +++ /dev/null @@ -1,37 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.skill; -import script.library.utils; - - - -public class gcw_city_pylon_tower extends script.systems.gcw.gcw_city_pylon -{ - public gcw_city_pylon_tower() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, gcw.GCW_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_tower_tool.iff"); - return super.OnAttach(self); - } - - - public String getConstructionQuest() throws InterruptedException - { - return "gcw_construct_tower"; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_turret.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_turret.java deleted file mode 100644 index 118fbe144..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_turret.java +++ /dev/null @@ -1,37 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.skill; -import script.library.utils; - - - -public class gcw_city_pylon_turret extends script.systems.gcw.gcw_city_pylon -{ - public gcw_city_pylon_turret() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, gcw.GCW_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_turret_tool.iff"); - return super.OnAttach(self); - } - - - public String getConstructionQuest() throws InterruptedException - { - return "gcw_construct_turret"; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_vehicle.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_vehicle.java deleted file mode 100644 index d5fb06d89..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_vehicle.java +++ /dev/null @@ -1,37 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.skill; -import script.library.utils; - - - -public class gcw_city_pylon_vehicle extends script.systems.gcw.gcw_city_pylon -{ - public gcw_city_pylon_vehicle() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, gcw.GCW_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_vehicle_tool.iff"); - return super.OnAttach(self); - } - - - public String getConstructionQuest() throws InterruptedException - { - return "gcw_construct_vehicle"; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_vehicle_boss.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_vehicle_boss.java deleted file mode 100644 index e2857fdfc..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_city_pylon_vehicle_boss.java +++ /dev/null @@ -1,71 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.skill; -import script.library.utils; - - - -public class gcw_city_pylon_vehicle_boss extends script.systems.gcw.gcw_city_pylon -{ - public gcw_city_pylon_vehicle_boss() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, gcw.GCW_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_vehicle_tool.iff"); - return super.OnAttach(self); - } - - - public String getConstructionQuest() throws InterruptedException - { - return "gcw_construct_vehicle_boss"; - } - - - public boolean hasConstructionResources(obj_id player) throws InterruptedException - { - if (resource.hasResource(player, "metal", 10000)) - { - return true; - } - - return false; - } - - - public boolean consumeConstructionResources(obj_id player) throws InterruptedException - { - if (resource.consumeResource(player, "metal", 10000)) - { - return true; - } - - return false; - } - - - public String getImperialIcon() throws InterruptedException - { - return "pt_gcw_quest_imperial_vehicle_boss.prt"; - } - - - public String getRebelIcon() throws InterruptedException - { - return "pt_gcw_quest_rebel_vehicle_boss.prt"; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_damaged_vehicle.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_damaged_vehicle.java deleted file mode 100644 index 4a3000ef3..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_damaged_vehicle.java +++ /dev/null @@ -1,258 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.create; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.utils; - - -public class gcw_damaged_vehicle extends script.base_script -{ - public gcw_damaged_vehicle() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "handleSetup", null, 1.0f, false); - setObjVar(self, gcw.GCW_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_vehicle_tool.iff"); - return SCRIPT_CONTINUE; - } - - - public void updateName(obj_id self) throws InterruptedException - { - String name = utils.getStringScriptVar(self, "gcw.name"); - - int questsCompleted = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - String suffix = ""; - - if (questsCompleted >= 4) - { - suffix = " (100% Repaired)"; - } - else if (questsCompleted <= 0) - { - suffix = " (0% Repaired)"; - } - else - { - suffix = " ("+ (int)(((float)questsCompleted / 4.0f) * 100.0f) + "% Repaired)"; - } - - setName(self, name + suffix); - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - if (!exists(self)) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int idx = utils.getValidAttributeIndex(names); - - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "object_repaired"; - int repairCount = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - if (repairCount > 0) - { - attribs[idx] = "" + repairCount + " out of 4"; - } - else - { - attribs[idx] = "Never Repaired"; - } - idx++; - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int handleSetup(obj_id self, dictionary params) throws InterruptedException - { - gcw.playQuestIconParticle(self); - - utils.setObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT, 0); - - setPosture(self, POSTURE_KNOCKED_DOWN); - setCreatureStatic(self, true); - updateName(self); - - return SCRIPT_CONTINUE; - } - - - public int playQuestIcon(obj_id self, dictionary params) throws InterruptedException - { - int repairs = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - if (repairs < 4) - { - gcw.playQuestIconHandler(self, params); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - LOG("gcw_damaged_vehicle", "OnObjectMenuRequest"); - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_damaged_vehicle","no faction on turret obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_damaged_vehicle","faction invalid on turret obj"); - return SCRIPT_CONTINUE; - } - else - { - if (utils.isProfession(player, utils.TRADER)) - { - LOG("gcw_damaged_vehicle","player is trader"); - - int repairs = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - if (repairs > 3) - { - LOG("gcw_damaged_vehicle","OnObjectMenuRequest no repair needed"); - - sendSystemMessage(player, gcw.SID_DOESNT_NEED_REPAIR); - return SCRIPT_CONTINUE; - } - - if (!gcw.hasConstructionOrRepairTool(player, self)) - { - LOG("gcw_damaged_vehicle","OnObjectMenuRequest no resources"); - - gcw.playerSystemMessageResourceNeeded(player, self, false); - return SCRIPT_CONTINUE; - } - - menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE); - - int mnu = mi.addRootMenu(menu_info_types.ITEM_USE, new string_id("","")); - - if (data != null) - { - data.setServerNotify(true); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - LOG("gcw_damaged_vehicle", "OnObjectMenuSelect"); - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_damaged_vehicle","no faction on patrol obj"); - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - - if (faction < 0) - { - LOG("gcw_damaged_vehicle","faction invalid on patrol obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_damaged_vehicle","Wrong Faction"); - return SCRIPT_CONTINUE; - } - else - { - if (utils.isProfession(player, utils.TRADER)) - { - LOG("gcw_damaged_vehicle","player is trader"); - - int repairs = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - if (repairs > 3) - { - sendSystemMessage(player, gcw.SID_DOESNT_NEED_REPAIR); - return SCRIPT_CONTINUE; - } - - if (!gcw.hasConstructionOrRepairTool(player, self)) - { - gcw.playerSystemMessageResourceNeeded(player, self, false); - return SCRIPT_CONTINUE; - } - - if (groundquests.isQuestActive(player, gcw.GCW_REPAIR_DAMAGED_VEHICLE_QUEST)) - { - if (gcw.useGcwObjectForQuest(player, self, gcw.GCW_REPAIR_DAMAGED_VEHICLE_QUEST)) - { - gcw.useConstructionOrRepairTool(player, self); - } - - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_REPAIR_DAMAGED_VEHICLE_QUEST)) - { - groundquests.clearQuest(player, gcw.GCW_REPAIR_DAMAGED_VEHICLE_QUEST); - } - if (!groundquests.isQuestActive(player, gcw.GCW_REPAIR_DAMAGED_VEHICLE_QUEST)) - { - groundquests.grantQuest(player, gcw.GCW_REPAIR_DAMAGED_VEHICLE_QUEST); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int repairComplete(obj_id self, dictionary params) throws InterruptedException - { - int repairs = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - updateName(self); - - if (repairs > 3) - { - obj_id creator = utils.getObjIdScriptVar(self, "creator"); - - if (isIdValid(creator)) - { - messageTo(creator, "createRepairedVehicle", null, 0.0f, false); - } - - destroyObject(self); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_defensive_general_boss.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_defensive_general_boss.java deleted file mode 100644 index a3fcf6a89..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_defensive_general_boss.java +++ /dev/null @@ -1,495 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import java.util.HashSet; -import java.util.Iterator; - -import script.library.ai_lib; -import script.library.armor; -import script.library.buff; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.restuss_event; -import script.library.static_item; -import script.library.trial; -import script.library.utils; - - -public class gcw_defensive_general_boss extends script.base_script -{ - public gcw_defensive_general_boss() - { - } - public static final boolean LOGGING_ON = false; - public static final int MAX_HIT_POINTS = 1000000; - public static final int MAX_GENERAL_BUFF_STACK = 100; - - - public int OnAttach(obj_id self) throws InterruptedException - { - blog("OnAttach init"); - - setAttrib(self, HEALTH, MAX_HIT_POINTS); - setMaxAttrib(self, HEALTH, MAX_HIT_POINTS); - - blog("OnAttach maxHitPoints: "+ getMaxAttrib(self, HEALTH)); - - messageTo(self, "checkConstructionPhase", null, 20.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int OnHateTargetAdded(obj_id self, obj_id target) throws InterruptedException - { - Vector allPlayersHatedList = new Vector(); - allPlayersHatedList.setSize(0); - - if (utils.hasScriptVar(self, "allPlayersEverHated")) - { - allPlayersHatedList = utils.getResizeableObjIdArrayScriptVar(self, "allPlayersEverHated"); - } - - utils.addElement(allPlayersHatedList, target); - utils.setScriptVar(self, "allPlayersEverHated", allPlayersHatedList); - trial.addNonInstanceFactionParticipant(target, self); - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - - obj_id[] attackerList = utils.getObjIdBatchScriptVar(self, "creditForKills.attackerList.attackers"); - - Vector allPlayersHatedList = utils.getResizeableObjIdArrayScriptVar(self, "allPlayersEverHated"); - if ((allPlayersHatedList == null || allPlayersHatedList.size() <= 0) && (attackerList == null || attackerList.length <= 0)) - { - return SCRIPT_CONTINUE; - } - - HashSet allParticipants = new HashSet(); - - if (allPlayersHatedList != null && allPlayersHatedList.size() > 0) - { - for (int i = 0; i < allPlayersHatedList.size(); ++i) - { - testAbortScript(); - allParticipants.add(((obj_id)(allPlayersHatedList.get(i)))); - } - } - - if (attackerList != null && attackerList.length > 0) - { - for (int i = 0; i < attackerList.length; ++i) - { - testAbortScript(); - allParticipants.add(attackerList[i]); - } - } - - obj_id[] participantList = new obj_id[allParticipants.size()]; - - Iterator participantIterator = allParticipants.iterator(); - int j = 0; - while (participantIterator.hasNext()) - { - testAbortScript(); - participantList[j] = (obj_id)participantIterator.next(); - j++; - } - - if (participantList == null || participantList.length <= 0) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "factionFlag")) - { - return SCRIPT_CONTINUE; - } - - int factionFlag = getIntObjVar(self, "factionFlag"); - if (factionFlag != factions.FACTION_FLAG_IMPERIAL && factionFlag != factions.FACTION_FLAG_REBEL) - { - return SCRIPT_CONTINUE; - } - - blog("calculateGeneralHealthAndAbilities factionFlag: "+ factionFlag); - - String token = ""; - - if (factionFlag == factions.FACTION_FLAG_IMPERIAL) - { - token = gcw.GCW_REBEL_TOKEN; - } - else if (factionFlag == factions.FACTION_FLAG_REBEL) - { - token = gcw.GCW_IMPERIAL_TOKEN; - } - - if (token == null || token.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String information = getName(self); - - for (int i = 0; i < participantList.length; i++) - { - testAbortScript(); - - if (!isPlayer(participantList[i])) - { - continue; - } - - if (utils.getDistance2D(self, participantList[i]) > 150.0) - { - continue; - } - - int damage = 0; - int damageBase = 10000; - int actualDmg = utils.getIntScriptVar(self, "creditForKills.attackerList."+ participantList[i] + ".damage"); - if (actualDmg > damageBase) - { - damage = actualDmg; - } - else - { - damage = damageBase; - } - - if (damage <= 0) - { - continue; - } - - gcw.grantModifiedGcwPoints(self, participantList[i], gcw.GCW_GENERAL_GCW_BASE_AMOUNT, false, gcw.GCW_POINT_TYPE_GROUND_PVE, information); - - obj_id inv = getObjectInSlot(participantList[i], "inventory"); - if (!isIdValid(inv)) - { - continue; - } - - obj_id tokenObject = static_item.createNewItemFunction(token, inv); - if (!isValidId(tokenObject)) - { - continue; - } - - int count = damage / gcw.GCW_GENERAL_TOKEN_BONUS_DIVISOR; - - if (!incrementCount(tokenObject, count)) - { - continue; - } - groundquests.sendPlacedMoreThanOneInInventorySystemMessage(participantList[i], tokenObject, count); - - } - return SCRIPT_CONTINUE; - - } - - - public int checkConstructionPhase(obj_id self, dictionary params) throws InterruptedException - { - blog("checkConstructionPhase init"); - - if (hasObjVar(self, "offense") && getIntObjVar(self, "offense") == 1) - { - blog("OnAttach offensive general found, removing script."); - detachScript(self, "systems.gcw.gcw_defensive_general_boss"); - - return SCRIPT_CONTINUE; - } - - obj_id parent = trial.getParent(self); - - if (!isValidId(parent) || !exists(parent)) - { - blog("checkConstructionPhase parnet invalid"); - return SCRIPT_CONTINUE; - } - - blog("checkConstructionPhase parent: "+parent); - - if (!utils.hasScriptVar(parent, "gcw.constructionEnded") && !hasObjVar(self, "initialKitCount")) - { - - obj_id[] kitsAndPylons = trial.getObjectsInInstanceBySpawnId(parent, "defense_kit"); - blog("checkConstructionPhase kitsAndPylons: "+ kitsAndPylons.length); - - obj_id[] patrolAndPylons = trial.getObjectsInInstanceBySpawnId(parent, "defense_patrol"); - - int combinedKitAmt = 0; - if (kitsAndPylons != null && kitsAndPylons.length > 0) - { - blog("checkConstructionPhase initial kitsAndPylons.length: "+ kitsAndPylons.length); - combinedKitAmt += kitsAndPylons.length; - } - if (patrolAndPylons != null && patrolAndPylons.length > 0) - { - blog("checkConstructionPhase initial patrolAndPylons.length: "+ patrolAndPylons.length); - combinedKitAmt += patrolAndPylons.length; - } - - setObjVar(self, "initialKitCount", combinedKitAmt / 2); - blog("checkConstructionPhase initial kit count: "+ combinedKitAmt + " / 2 = "+ combinedKitAmt / 2); - } - else if (utils.hasScriptVar(parent, "gcw.constructionEnded")) - { - if (!hasObjVar(self, "initialKitCount")) - { - blog("checkConstructionPhase initialKitCount not found, default it to 0"); - setObjVar(self, "initialKitCount", 0); - } - - blog("checkConstructionPhase removing invulnerable from general"); - - messageTo(self, "calculateGeneralHealthAndAbilities", null, 10.0f, false); - - return SCRIPT_CONTINUE; - } - blog("checkConstructionPhase fell through, recalling this messageHandler in 10"); - - messageTo(self, "checkConstructionPhase", null, 10.0f, false); - - return SCRIPT_CONTINUE; - } - - - public int calculateGeneralHealthAndAbilities(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self) || ai_lib.isDead(self)) - { - return SCRIPT_CONTINUE; - } - - blog("calculateGeneralHealthAndAbilities init"); - - obj_id parent = trial.getParent(self); - - if (!isValidId(parent) || !exists(parent)) - { - blog("calculateGeneralHealthAndAbilities parent invalid"); - return SCRIPT_CONTINUE; - } - - blog("calculateGeneralHealthAndAbilities parent: "+parent); - - if (!utils.hasScriptVar(parent, "gcw.constructionEnded")) - { - blog("calculateGeneralHealthAndAbilities parent is not in the correct phase"); - return SCRIPT_CONTINUE; - } - blog("calculateGeneralHealthAndAbilities parent is not in construction phase"); - - if (!hasObjVar(self, "initialKitCount")) - { - blog("calculateGeneralHealthAndAbilities initialKitCount not found"); - return SCRIPT_CONTINUE; - } - - int initialKitCount = getIntObjVar(self, "initialKitCount"); - - if (initialKitCount < 0) - { - blog("calculateGeneralHealthAndAbilities initialKitCount is 0 or less"); - setObjVar(self, "initialKitCount", 0); - } - - blog("calculateGeneralHealthAndAbilities initialKitCount: "+initialKitCount); - - int combinedAmt = 0; - - obj_id[] patrols = trial.getObjectsInInstanceBySpawnId(parent, "defense_quest_asset"); - if (patrols != null && patrols.length > 0) - { - blog("calculateGeneralHealthAndAbilities PATROLS FOUND: "+patrols.length); - combinedAmt += patrols.length; - } - else - { - blog("calculateGeneralHealthAndAbilities PATROLS NOT FOUND"); - } - - obj_id[] kits = trial.getObjectsInInstanceBySpawnId(parent, "defense_kit"); - if (kits == null || kits.length <= 0) - { - blog("calculateGeneralHealthAndAbilities KITS NOT FOUND"); - return SCRIPT_CONTINUE; - } - blog("calculateGeneralHealthAndAbilities KITS FOUND: "+kits.length+" This number includes the kit as well as the crafted object."); - combinedAmt += kits.length; - - blog("calculateGeneralHealthAndAbilities kits: "+ kits.length); - - if (!hasObjVar(self, "alertedPlayersOfMyDamage")) - { - blog("general_announce general's health being checked to see if announcement shoudl be sent: "); - - int maxHealth = getMaxAttrib(self, HEALTH); - int lowHealth = maxHealth / 2; - blog("general_announce general's health should not be lower than: "+lowHealth); - - int curHealth = getAttrib(self, HEALTH); - blog("general_announce general's current health: "+curHealth); - - if (curHealth < lowHealth) - { - blog("general_announce HALP the general~!"); - messageTo(parent, "defenseGeneralUnderSustainedAttack", null, 0.0f, false); - setObjVar(self, "alertedPlayersOfMyDamage", 1); - } - } - - if (!hasObjVar(self, "defenseObjectCount") && initialKitCount > 0) - { - blog("calculateGeneralHealthAndAbilities setting up defenseObjectCount FOR THE FIRST TIME"); - - int defenseObjectCount = combinedAmt - initialKitCount; - if (defenseObjectCount < 0) - { - blog("calculateGeneralHealthAndAbilities defenseObjectCount is less than zero!"); - setObjVar(self, "initialKitCount", 0); - messageTo(self, "calculateGeneralHealthAndAbilities", null, 10.0f, false); - return SCRIPT_CONTINUE; - } - - blog("calculateGeneralHealthAndAbilities defenseObjectCount --- THIS IS THE TOTAL NON PATROL DEFENSES CRAFTED: "+defenseObjectCount); - if (patrols != null && patrols.length > 0) - { - blog("calculateGeneralHealthAndAbilities defenseObjectCount --- THIS IS THE TOTAL PATROL DEFENSES CRAFTED: "+patrols.length); - defenseObjectCount += patrols.length; - - blog("calculateGeneralHealthAndAbilities defenseObjectCount --- TOTAL OF BOTH: "+defenseObjectCount); - } - - blog("calculateGeneralHealthAndAbilities defenseObjectCount --- THIS IS THE TOTAL POSSIBLE DEFENSES: "+initialKitCount); - blog("calculateGeneralHealthAndAbilities defenseObjectCount --- THIS IS THE AMT BEING SET AS INITIAL DEFENSE COUNT: "+initialKitCount); - - setObjVar(self, "defenseObjectCount", defenseObjectCount); - - messageTo(self, "calculateGeneralHealthAndAbilities", null, 0.25f, false); - - return SCRIPT_CONTINUE; - } - else if (initialKitCount > 0) - { - blog("calculateGeneralHealthAndAbilities checking for a change in the defensive count"); - - float defenseObjectCount = (float)getIntObjVar(self, "defenseObjectCount"); - if (defenseObjectCount < 0) - { - blog("calculateGeneralHealthAndAbilities defenseObjectCount is less than 0!"); - setObjVar(self, "initialKitCount", 0); - messageTo(self, "calculateGeneralHealthAndAbilities", null, 10.0f, false); - return SCRIPT_CONTINUE; - } - - blog("calculateGeneralHealthAndAbilities This is what the defense count was when the fight first started: "+defenseObjectCount); - - float currentDefenseCount = combinedAmt - initialKitCount; - if (currentDefenseCount < 0) - { - blog("calculateGeneralHealthAndAbilities current kit count is less than 0"); - setObjVar(self, "initialKitCount", 0); - messageTo(self, "calculateGeneralHealthAndAbilities", null, 10.0f, false); - return SCRIPT_CONTINUE; - } - - blog("calculateGeneralHealthAndAbilities This is what the defense count is at this very moment: "+currentDefenseCount); - if (patrols != null && patrols.length > 0) - { - blog("calculateGeneralHealthAndAbilities defenseObjectCount --- THIS IS THE TOTAL PATROL DEFENSES CRAFTED: "+patrols.length); - currentDefenseCount += patrols.length; - - blog("calculateGeneralHealthAndAbilities defenseObjectCount --- TOTAL OF BOTH: "+currentDefenseCount); - } - - if ((currentDefenseCount < defenseObjectCount || (!buff.hasBuff(self, gcw.BUFF_GENERAL_RESIST_STACK_IMP) && !buff.hasBuff(self, gcw.BUFF_GENERAL_RESIST_STACK_REB)))) - { - blog("calculateGeneralHealthAndAbilities the currentDefenseCount has changed and is lower than the OG defenseObjectCount"); - - if (!hasObjVar(self, "factionFlag")) - { - return SCRIPT_CONTINUE; - } - - blog("calculateGeneralHealthAndAbilities has factionFlag objvar"); - - int factionFlag = getIntObjVar(self, "factionFlag"); - - if (factionFlag != factions.FACTION_FLAG_IMPERIAL && factionFlag != factions.FACTION_FLAG_REBEL) - { - return SCRIPT_CONTINUE; - } - - blog("calculateGeneralHealthAndAbilities factionFlag: "+ factionFlag); - - String gcwBuffName = ""; - - if (factionFlag == factions.FACTION_FLAG_IMPERIAL) - { - blog("calculateGeneralHealthAndAbilities faction is imp"); - gcwBuffName = gcw.BUFF_GENERAL_RESIST_STACK_IMP; - } - else if (factionFlag == factions.FACTION_FLAG_REBEL) - { - blog("calculateGeneralHealthAndAbilities faction is reb"); - gcwBuffName = gcw.BUFF_GENERAL_RESIST_STACK_REB; - } - - if (gcwBuffName == null || gcwBuffName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - float percent = currentDefenseCount / defenseObjectCount; - blog("calculateGeneralHealthAndAbilities Percent: "+percent); - - int mobGeneralArmor = (int)getFloatObjVar(self, armor.OBJVAR_ARMOR_BASE + "."+ armor.OBJVAR_GENERAL_PROTECTION); - blog("calculateGeneralHealthAndAbilities mobGeneralArmor: "+mobGeneralArmor); - - float newMobGeneralArmor = mobGeneralArmor * percent; - blog("calculateGeneralHealthAndAbilities newMobGeneralArmor: "+newMobGeneralArmor); - - int newstackAmt = (int)(MAX_GENERAL_BUFF_STACK * percent); - blog("calculateGeneralHealthAndAbilities newstackAmt: "+newstackAmt); - - buff.removeBuff(self, gcwBuffName); - blog("calculateGeneralHealthAndAbilities making buff stack: "+newstackAmt); - buff.applyBuffWithStackCount(self, gcwBuffName, newstackAmt); - - utils.setScriptVar(self, armor.SCRIPTVAR_CACHED_GENERAL_PROTECTION, newMobGeneralArmor); - } - } - - messageTo(self, "calculateGeneralHealthAndAbilities", null, 10.0f, false); - - return SCRIPT_CONTINUE; - } - - - public void blog(String text) throws InterruptedException - { - if (LOGGING_ON) - { - LOG("gcw_defensive_general_boss", text); - } - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_entertainer_faction_quest.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_entertainer_faction_quest.java deleted file mode 100644 index 9cf40a42e..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_entertainer_faction_quest.java +++ /dev/null @@ -1,133 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.factions; -import script.library.ai_lib; - - -public class gcw_entertainer_faction_quest extends script.base_script -{ - public gcw_entertainer_faction_quest() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - setObjVar(self, "faction_recruit_quest", 0); - return SCRIPT_CONTINUE; - } - - - public int readyToTalk(obj_id self, dictionary params) throws InterruptedException - { - - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id entertainer = utils.getObjIdScriptVar(self, "ai.listeningTo"); - obj_id faction_entertainer = utils.getObjIdScriptVar(self, "faction_ent"); - - if (!isValidId(entertainer) || (entertainer != faction_entertainer)) - { - return SCRIPT_CONTINUE; - - } - - utils.setObjVar(self, "faction_recruit_quest", 1); - utils.setScriptVar(self, "readyToTalk", faction_entertainer); - - String particle = ""; - if (factions.isImperialorImperialHelper(faction_entertainer)) - { - particle = "appearance/pt_imperial_symbol.prt"; - } - - else if (factions.isRebelorRebelHelper(faction_entertainer)) - { - particle = "appearance/pt_rebel_symbol.prt"; - } - - else - { - cleanup(self); - return SCRIPT_CONTINUE; - } - - obj_id[] particleList = new obj_id[1]; - particleList[0] = faction_entertainer; - playClientEffectObj(particleList, particle, self, null); - return SCRIPT_CONTINUE; - } - - - public int lostInterest(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self) || params == null) - { - return SCRIPT_CONTINUE; - - } - - int paramsTime = params.getInt("lostInterestTime"); - int scriptVarTime = utils.getIntScriptVar(self, "lostInterestTime"); - - if (paramsTime == scriptVarTime) - { - cleanup(self); - - } - return SCRIPT_CONTINUE; - } - - - public int convinced(obj_id self, dictionary params) throws InterruptedException - { - obj_id parent = utils.getObjIdScriptVar(self, "spawnedBy"); - - params.put("convincedTrooper", self); - - messageTo(parent, "createFightingNpc", params, 1.0f, false); - LOG("mikkel","sent message to spawn a fighting npc"); - return SCRIPT_CONTINUE; - } - - - public int notConvinced(obj_id self, dictionary params) throws InterruptedException - { - LOG("mikkel","notConvinced, calling cleanup"); - cleanup(self); - - return SCRIPT_CONTINUE; - } - - - public void cleanup(obj_id self) throws InterruptedException - { - if (isValidId(self) && exists(self)) - { - - utils.removeScriptVar(self, "ai.oldEntertainerSkillMod"); - utils.removeScriptVar(self, "ai.listeningTo"); - utils.setObjVar(self, "faction_recruit_quest", 0); - utils.removeScriptVar(self, "faction_ent"); - stop(self); - messageTo(self, "resumeDefaultCalmBehavior", null, 0, false); - - } - - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_npc_hurt.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_npc_hurt.java deleted file mode 100644 index d52c88805..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_npc_hurt.java +++ /dev/null @@ -1,200 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.create; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.utils; - - -public class gcw_npc_hurt extends script.base_script -{ - public gcw_npc_hurt() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "handleSetup", null, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int handleSetup(obj_id self, dictionary params) throws InterruptedException - { - gcw.playQuestIconParticle(self); - - utils.setObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT, 0); - - setPosture(self, POSTURE_KNOCKED_DOWN); - setCreatureStatic(self, true); - - return SCRIPT_CONTINUE; - } - - - public int playQuestIcon(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - int repairs = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - if (repairs < 1) - { - gcw.playQuestIconHandler(self, params); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - LOG("gcw_npc_hurt", "OnObjectMenuRequest"); - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_npc_hurt","no faction on npc obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_npc_hurt","faction invalid on turret obj"); - return SCRIPT_CONTINUE; - } - else - { - if (!utils.isProfession(player, utils.MEDIC)) - { - return SCRIPT_CONTINUE; - } - - LOG("gcw_npc_hurt", "player is MEDIC"); - - int repairs = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - if (repairs > 0) - { - LOG("gcw_npc_hurt","OnObjectMenuRequest no repair needed"); - - sendSystemMessage(player, gcw.SID_DOESNT_NEED_HEALING); - return SCRIPT_CONTINUE; - } - - menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE); - - int mnu = mi.addRootMenu(menu_info_types.ITEM_USE, new string_id("","")); - - if (data != null) - { - data.setServerNotify(true); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - LOG("gcw_npc_hurt", "OnObjectMenuSelect"); - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_npc_hurt","no faction on patrol obj"); - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - if (faction < 0) - { - LOG("gcw_npc_hurt","faction invalid on patrol obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_npc_hurt","faction invalid on turret obj"); - return SCRIPT_CONTINUE; - } - else - { - if (!utils.isProfession(player, utils.MEDIC)) - { - return SCRIPT_CONTINUE; - } - LOG("gcw_npc_hurt", "player is MEDIC"); - - int repairs = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - if (repairs > 0) - { - sendSystemMessage(player, gcw.SID_DOESNT_NEED_HEALING); - return SCRIPT_CONTINUE; - } - - if (groundquests.isQuestActive(player, gcw.GCW_MEDIC_HEAL_QUEST)) - { - LOG("gcw_npc_hurt", "player isQuestActive"); - gcw.useGcwObjectForQuest(player, self, gcw.GCW_MEDIC_HEAL_QUEST); - - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_MEDIC_HEAL_QUEST)) - { - LOG("gcw_npc_hurt", "player groundquests.hasCompletedQuest(player, gcw.GCW_MEDIC_HEAL_QUEST): "+ groundquests.hasCompletedQuest(player, gcw.GCW_MEDIC_HEAL_QUEST)); - groundquests.clearQuest(player, gcw.GCW_MEDIC_HEAL_QUEST); - } - if (!groundquests.isQuestActive(player, gcw.GCW_MEDIC_HEAL_QUEST)) - { - LOG("gcw_npc_hurt", "player !groundquests.isQuestActive(player, gcw.GCW_MEDIC_HEAL_QUEST): "+ !groundquests.isQuestActive(player, gcw.GCW_MEDIC_HEAL_QUEST)); - groundquests.grantQuest(player, gcw.GCW_MEDIC_HEAL_QUEST); - } - } - - return SCRIPT_CONTINUE; - } - - - public int repairComplete(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - int repairs = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - LOG("gcw_npc_hurt", "repairComplete self: "+ self + " repairs: "+ repairs); - - if (repairs > 0) - { - LOG("gcw_npc_hurt", "repairComplete repairs > 0"); - - obj_id creator = utils.getObjIdScriptVar(self, "creator"); - - if (isIdValid(creator)) - { - messageTo(creator, "createHealedNPC", null, 0.0f, false); - } - - destroyObject(self); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_patrol.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_patrol.java deleted file mode 100644 index ea5ac2f4e..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_patrol.java +++ /dev/null @@ -1,667 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.buff; -import script.library.chat; -import script.library.create; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.restuss_event; -import script.library.resource; -import script.library.static_item; -import script.library.sui; -import script.library.stealth; -import script.library.trial; -import script.library.utils; - - -public class gcw_patrol extends script.base_script -{ - public gcw_patrol() - { - } - public static final string_id SID_THERE_IS_NO_GUARD = new string_id("gcw", "there_is_no_guard_to_entertain"); - public static final string_id SID_PATROL_ALREADY_ENTERTAINED = new string_id("gcw", "patrol_point_already_entertained"); - public static final int ENTERTAINMENT_TIMER = 300; - - public static final String[] lowImperials = - { - "gcw_city_imperial_1" - }; - - public static final String[] normalImperials = - { - "gcw_city_imperial_black", - "gcw_city_imperial_2", - "gcw_city_imperial_sandtrooper" - }; - - public static final String[] eliteImperials = - { - "gcw_city_imperial_3", - "gcw_city_imperial_black_sgt", - "gcw_city_imperial_black_darkt", - "gcw_city_imperial_sandtrooper_sgt" - }; - - public static final String[] lowRebels = - { - "gcw_city_rebel_grunt_assault", - "gcw_city_rebel_grunt_defense" - }; - - public static final String[] normalRebels = - { - "gcw_city_rebel_commando_assault", - "gcw_city_rebel_commando_defense" - - }; - - public static final String[] eliteRebels = - { - "gcw_city_rebel_specforce_assault", - "gcw_city_rebel_specforce_defense" - }; - - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, gcw.GCW_DEF_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_spawner_tool.iff"); - setObjVar(self, gcw.GCW_OFF_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_patrol_tool.iff"); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - messageTo(self, "handleGCWPatrol", null, rand(5, 10), false); - - dictionary params = new dictionary(); - location loc = getLocation(self); - params.put("particleLoc", loc); - int playIconTime = getGameTime(); - params.put("iconMessageTime", playIconTime); - utils.setScriptVar(self, "iconMessageTime", playIconTime); - - messageTo(self, "playQuestIcon", params, 2.0f, false); - - return SCRIPT_CONTINUE; - }; - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - if (!exists(self)) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int idx = utils.getValidAttributeIndex(names); - - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "patrol_entertained"; - - String status = "No"; - if (utils.getBooleanScriptVar(self, "entertained")) - { - status = "Yes"; - } - attribs[idx] = status; - idx++; - - names[idx] = "object_repaired"; - int repairCount = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - if (repairCount > 0) - { - attribs[idx] = ""+repairCount+" out of "+gcw.REPAIR_COUNT_MAX; - } - else - { - attribs[idx] = "Never Repaired"; - } - idx++; - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_patrol_point","no faction on patrol obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_patrol_point","player not my faction"); - if ((!groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST) && !groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST))) - { - LOG("gcw_patrol_point","player doesn't have a quest that works with patrol point"); - return SCRIPT_CONTINUE; - } - LOG("gcw_patrol_point","OnObjectMenuRequest: Opposing player has a quest that works with patrol point"); - menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE); - - if (data != null) - { - data.setServerNotify (true); - } - } - else - { - if (utils.isProfession(player, utils.ENTERTAINER)) - { - LOG("gcw_patrol_point","player is entertainer"); - - if (utils.hasScriptVar(self, "entertained") && utils.getBooleanScriptVar(self, "entertained")) - { - sendSystemMessage(player, SID_PATROL_ALREADY_ENTERTAINED); - return SCRIPT_CONTINUE; - } - } - else if (utils.isProfession(player, utils.TRADER)) - { - LOG("gcw_patrol_point","player is trader"); - - if (!gcw.canGcwObjectBeRepaired(self)) - { - LOG("gcw_patrol_point","OnObjectMenuRequest no repair needed"); - - sendSystemMessage(player, gcw.SID_DOESNT_NEED_REPAIR); - return SCRIPT_CONTINUE; - } - if (!gcw.hasConstructionOrRepairTool(player, self)) - { - LOG("gcw_patrol_point","OnObjectMenuRequest no resources"); - - gcw.playerSystemMessageResourceNeeded(player, self, false); - return SCRIPT_CONTINUE; - } - } - menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE); - - if (data != null) - { - data.setServerNotify (true); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - LOG("gcw_patrol_point","OnObjectMenuSelect"); - - if (!isIdValid(player) || !exists(player) || isIncapacitated(player) || isDead(player) || factions.isOnLeave(player)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_patrol_point","no faction on patrol obj"); - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - - if (faction < 0) - { - LOG("gcw_patrol_point","faction invalid on patrol obj"); - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_patrol_point","OnObjectMenuSelect - player not my faction"); - - if ((!groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST) && !groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST))) - { - LOG("gcw_patrol_point","player doesn't have a quest that works with patrol point"); - - return SCRIPT_CONTINUE; - } - - LOG("gcw_patrol_point","OnObjectMenuSelect - Opposing player has a quest that works with patrol point"); - - if (groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_SCOUT_QUEST)) - { - LOG("gcw_patrol_point","gcw_spy_scout_patrol"); - - gcw.useGcwObjectForQuest(player, self, gcw.GCW_SPY_PATROL_SCOUT_QUEST); - - return SCRIPT_CONTINUE; - } - else if (groundquests.isQuestActive(player, gcw.GCW_SPY_PATROL_DESTROY_QUEST)) - { - LOG("gcw_patrol_point","gcw_spy_destroy_patrol"); - if (!buff.hasBuff(player, gcw.BUFF_SPY_EXPLOSIVES)) - { - return SCRIPT_CONTINUE; - } - - long counter = buff.getBuffStackCount(player, gcw.BUFF_SPY_EXPLOSIVES); - if (counter <= 0) - { - return SCRIPT_CONTINUE; - } - - gcw.useGcwObjectForQuest(player, self, gcw.GCW_SPY_PATROL_DESTROY_QUEST); - - return SCRIPT_CONTINUE; - } - - LOG("gcw_patrol_point","could not find a valid quest!!!"); - - return SCRIPT_CONTINUE; - } - else - { - if (utils.isProfession(player, utils.ENTERTAINER)) - { - LOG("gcw_patrol_point","is entertainer"); - - if (utils.hasScriptVar(self, "entertained") && utils.getBooleanScriptVar(self, "entertained")) - { - sendSystemMessage(player, SID_PATROL_ALREADY_ENTERTAINED); - return SCRIPT_CONTINUE; - } - - obj_id kit = utils.getObjIdScriptVar(self, "creator"); - - if (!isIdValid(kit) || !exists(kit)) - { - return SCRIPT_CONTINUE; - } - - int patrolType = getIntObjVar(kit, "patrolType"); - if (patrolType == 0) - { - LOG("gcw_patrol_point","patrol is defensive"); - - obj_id guardToEntertain = utils.getObjIdScriptVar(self, gcw.GCW_NPC_SCRIPTVAR_FLAG); - if (!isValidId(guardToEntertain) || !exists(guardToEntertain)) - { - - sendSystemMessage(player, SID_THERE_IS_NO_GUARD); - return SCRIPT_CONTINUE; - } - } - else if (patrolType == 1) - { - LOG("gcw_patrol_point","patrol is offensive"); - - if (utils.hasScriptVar(self, gcw.GCW_NPC_BEING_ENTERTAINED)) - { - LOG("gcw_patrol_point","GCW_NPC_BEING_ENTERTAINED scriptvar found"); - - obj_id npcBeingEntertained = utils.getObjIdScriptVar(self, gcw.GCW_NPC_BEING_ENTERTAINED); - if (isValidId(npcBeingEntertained) && exists(npcBeingEntertained) && !ai_lib.isDead(npcBeingEntertained)) - { - return SCRIPT_CONTINUE; - } - } - - String npcName = lowRebels[rand(0, lowRebels.length - 1)]; - if (faction == factions.FACTION_FLAG_IMPERIAL) - { - npcName = lowImperials[rand(0, lowImperials.length - 1)]; - } - - obj_id npc = create.object(npcName, getLocation(self)); - if (!isIdValid(npc) || !exists(npc)) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, gcw.GCW_NPC_BEING_ENTERTAINED, npc); - utils.setScriptVar(npc, gcw.GCW_NPC_CLEANUP_FLAG, 1); - setObjVar(npc, gcw.GCW_PATROL_OBJ, self); - - pathTo(npc, getLocation(player)); - - chat.chat(npc, new string_id("gcw", "you_have_thirty_seconds")); - - dictionary webster = new dictionary(); - webster.put("npc",npc); - webster.put("player",player); - messageTo(self, "handleOffensiveEntertainedNpcCleanUp", webster, 30.0f, false); - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_ENTERTAINER_PATROL_QUEST)) - { - groundquests.clearQuest(player, gcw.GCW_ENTERTAINER_PATROL_QUEST); - } - if (!groundquests.isQuestActive(player, gcw.GCW_ENTERTAINER_PATROL_QUEST)) - { - groundquests.grantQuest(player, gcw.GCW_ENTERTAINER_PATROL_QUEST); - } - } - else if (utils.isProfession(player, utils.TRADER)) - { - LOG("gcw_patrol_point","player is trader"); - - if (!gcw.canGcwObjectBeRepaired(self)) - { - sendSystemMessage(player, gcw.SID_DOESNT_NEED_REPAIR); - return SCRIPT_CONTINUE; - } - if (!gcw.hasConstructionOrRepairTool(player, self)) - { - gcw.playerSystemMessageResourceNeeded(player, self, false); - return SCRIPT_CONTINUE; - } - - if (groundquests.isQuestActive(player, gcw.GCW_REPAIR_PATROL_QUEST)) - { - if (gcw.useGcwObjectForQuest(player, self, gcw.GCW_REPAIR_PATROL_QUEST)) - { - gcw.useConstructionOrRepairTool(player, self); - } - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_REPAIR_PATROL_QUEST)) - { - groundquests.clearQuest(player, gcw.GCW_REPAIR_PATROL_QUEST); - } - if (!groundquests.isQuestActive(player, gcw.GCW_REPAIR_PATROL_QUEST)) - { - groundquests.grantQuest(player, gcw.GCW_REPAIR_PATROL_QUEST); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int getConstructionQuestsCompleted(obj_id pylon) throws InterruptedException - { - int completed = 0; - - if (!isIdValid(pylon) || !exists(pylon)) - { - return 0; - } - - if (hasObjVar(pylon, "gcw.constructionQuestsCompleted")) - { - completed = getIntObjVar(pylon, "gcw.constructionQuestsCompleted"); - } - - return completed; - } - - - public int handleGCWPatrol(obj_id self, dictionary params) throws InterruptedException - { - int faction = -1; - - if (utils.hasScriptVar(self, "faction")) - { - faction = utils.getIntScriptVar(self, "faction"); - } - - obj_id kit = utils.getObjIdScriptVar(self, "creator"); - - if (!isIdValid(kit) || !exists(kit)) - { - return SCRIPT_CONTINUE; - } - - int patrolType = getIntObjVar(kit, "patrolType"); - int construction = getConstructionQuestsCompleted(kit); - - String npcName = ""; - - if (construction < 1) - { - return SCRIPT_CONTINUE; - } - else if (construction < gcw.GCW_CONSTRUCTION_MAXIMUM / 2) - { - if (faction == factions.FACTION_FLAG_REBEL) - { - npcName = lowRebels[rand(0, lowRebels.length - 1)]; - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - npcName = lowImperials[rand(0, lowImperials.length - 1)]; - } - } - else if (construction < gcw.GCW_CONSTRUCTION_MAXIMUM) - { - if (faction == factions.FACTION_FLAG_REBEL) - { - npcName = normalRebels[rand(0, normalRebels.length - 1)]; - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - npcName = normalImperials[rand(0, normalImperials.length - 1)]; - } - } - else if (construction >= gcw.GCW_CONSTRUCTION_MAXIMUM) - { - if (faction == factions.FACTION_FLAG_REBEL) - { - npcName = eliteRebels[rand(0, eliteRebels.length - 1)]; - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - npcName = eliteImperials[rand(0, eliteImperials.length - 1)]; - } - } - - if (getSchedulerNPCs(kit, "gcwPatrol") < 0) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = null; - - if (patrolType == 0 && getSchedulerNPCs(kit, "gcwPatrol") < 500) - { - obj_id currentPatrol = utils.getObjIdScriptVar(kit, "currentPatrol"); - - if (!isIdValid(currentPatrol) || !exists(currentPatrol) || isIncapacitated(currentPatrol) || isDead(currentPatrol)) - { - npc = trial.createSchedulerNPC(kit, self, npcName); - utils.setScriptVar(kit, "currentPatrol", npc); - } - else - { - - npc = currentPatrol; - } - - if (isIdValid(npc) && exists(npc)) - { - setBaseRunSpeed(npc, 0); - setBaseWalkSpeed(npc, 0); - } - } - - if (patrolType == 1 && getSchedulerNPCs(kit, "gcwPatrol") < 500) - { - npc = trial.createSchedulerNPC(kit, self, npcName); - } - - setObjVar(npc, gcw.GCW_PATROL_OBJ, self); - if (utils.hasScriptVar(self, "entertained") && isValidId(npc)) - { - buff.applyBuff(npc, gcw.GCW_NPC_ENTERTAINED_BUFF, -1.0f); - } - - messageTo(self, "handleGCWPatrol", null, 60.0f + rand(0, 30), false); - - return SCRIPT_CONTINUE; - } - - - public int getSchedulerNPCs(obj_id kit, String npcID) throws InterruptedException - { - if (!isIdValid(kit) || !exists(kit)) - { - return -1; - } - - obj_id kitParent = trial.getParent(kit); - - if (!isIdValid(kitParent) || !exists(kitParent)) - { - return -1; - } - - obj_id[] npcs = trial.getObjectsInInstanceBySpawnId(trial.getParent(kit), npcID); - - if (npcs == null) - { - return 0; - } - - return npcs.length; - } - - - public int destroyGCWPatrol(obj_id self, dictionary params) throws InterruptedException - { - trial.cleanupObject(self); - return SCRIPT_CONTINUE; - } - - - public int handleOffensiveEntertainedNpcCleanUp(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = params.getObjId("npc"); - if (!isValidId(npc) || !exists(npc)) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId("player"); - if (isValidId(player) || exists(player)) - { - - if (utils.hasScriptVar(npc, "ai.listeningTo")) - { - obj_id entertainedBy = utils.getObjIdScriptVar(npc, "ai.listeningTo"); - if (isValidId(entertainedBy) && exists(entertainedBy)) - { - if (entertainedBy == player) - { - return SCRIPT_CONTINUE; - } - } - } - } - - int pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - if (pid > 0) - { - forceCloseSUIPage(pid); - } - - trial.cleanupObject(npc); - return SCRIPT_CONTINUE; - } - - - public int flagGCWPatrolEntertained(obj_id self, dictionary params) throws InterruptedException - { - obj_id kit = utils.getObjIdScriptVar(self, "creator"); - if (!isValidId(kit)) - { - return SCRIPT_CONTINUE; - } - - int construction = getConstructionQuestsCompleted(kit); - if (construction < 1) - { - return SCRIPT_CONTINUE; - } - - int patrolType = getIntObjVar(kit, "patrolType"); - if (patrolType == 0) - { - obj_id currentPatrol = utils.getObjIdScriptVar(kit, "currentPatrol"); - if (isValidId(currentPatrol) && exists(currentPatrol)) - { - buff.applyBuff(currentPatrol, gcw.GCW_NPC_ENTERTAINED_BUFF, -1.0f); - } - } - - utils.setScriptVar(self, "entertained", true); - messageTo(self, "removeGCWPatrolEntertained", null, ENTERTAINMENT_TIMER, false); - return SCRIPT_CONTINUE; - } - - - public int removeGCWPatrolEntertained(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar(self, "entertained"); - utils.removeScriptVar(self, "entertainment_locked"); - return SCRIPT_CONTINUE; - } - - - public int playQuestIcon(obj_id self, dictionary params) throws InterruptedException - { - gcw.playQuestIconHandler(self, params); - - return SCRIPT_CONTINUE; - } - - - public int OnDeath(obj_id self, obj_id killer, obj_id corpseId) throws InterruptedException - { - handleDestroyPatrol(self, killer); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectDisabled(obj_id self, obj_id killer) throws InterruptedException - { - handleDestroyPatrol(self, killer); - return SCRIPT_CONTINUE; - } - - - public void handleDestroyPatrol(obj_id self, obj_id killer) throws InterruptedException - { - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - setInvulnerable(self, true); - messageTo(self, "destroyGCWPatrol", null, 1f, false); - - gcw.gcwInvasionCreditForDestroy(killer); - - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_patrol_point_npc_ai.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_patrol_point_npc_ai.java deleted file mode 100644 index 4ad263041..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_patrol_point_npc_ai.java +++ /dev/null @@ -1,58 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.create; -import script.library.factions; -import script.library.utils; - - - -public class gcw_patrol_point_npc_ai extends script.systems.gcw.gcw_city_kit -{ - public gcw_patrol_point_npc_ai() - { - } - - public void setupConstructionQuests(obj_id self, obj_id pylon) throws InterruptedException - { - setName(pylon, "Turret Construction Site"); - - attachScript(pylon, "systems.gcw.gcw_city_pylon_turret"); - } - - - public void setupInvasionQuests(obj_id kit) throws InterruptedException - { - } - - - public obj_id createFactionKit(int faction, location loc) throws InterruptedException - { - if (loc == null) - { - return null; - } - - obj_id kit = null; - - if (factions.FACTION_FLAG_IMPERIAL == faction) - { - kit = create.object("gcw_city_imperial_turret_1", loc); - setName(kit, "Imperial Turret"); - } - else if (factions.FACTION_FLAG_REBEL == faction) - { - kit = create.object("gcw_city_rebel_turret_1", loc); - setName(kit, "Rebel Turret"); - } - - return kit; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_poi_guard_spawning.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_poi_guard_spawning.java deleted file mode 100644 index 41f146606..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_poi_guard_spawning.java +++ /dev/null @@ -1,80 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.attrib; -import script.library.create; -import script.library.holiday; -import script.library.utils; - - -public class gcw_poi_guard_spawning extends script.base_script -{ - public gcw_poi_guard_spawning() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "spawnSentry", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - if (!utils.hasScriptVar(self, "child")) - { - return SCRIPT_CONTINUE; - } - - obj_id child = utils.getObjIdScriptVar(self, "child"); - if (!isValidId(child) || !exists(child)) - { - return SCRIPT_CONTINUE; - } - - destroyObject(child); - return SCRIPT_CONTINUE; - } - - - public int spawnSentry(obj_id self, dictionary params) throws InterruptedException - { - LOG("guard_spawning","spawnSentry init"); - if (hasObjVar(self, "mob")) - { - messageTo(self, "spawnSentry", null, 10, false); - return SCRIPT_CONTINUE; - } - LOG("guard_spawning","spawnSentry has mob objvar"); - - String creatureType = getStringObjVar(self, "mob"); - if (creatureType == null || creatureType.length() <= 0) - { - return SCRIPT_CONTINUE; - } - LOG("guard_spawning","spawnSentry creatureType: "+creatureType); - - obj_id mob = create.object(creatureType, getLocation(self)); - if (!isValidId(mob) || !exists(mob)) - { - return SCRIPT_CONTINUE; - } - LOG("guard_spawning","spawnSentry mob: "+mob); - - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Mob: "+mob+" WAS SUCCESSFULLY CREATED for spawner: "+self); - - setObjVar(mob, "mySpawner", self); - utils.setScriptVar(self, "child", mob); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_poi_spawner.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_poi_spawner.java deleted file mode 100644 index 91fd88d53..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_poi_spawner.java +++ /dev/null @@ -1,80 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.attrib; -import script.library.create; -import script.library.holiday; -import script.library.utils; - - -public class gcw_poi_spawner extends script.base_script -{ - public gcw_poi_spawner() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "spawnSentry", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - if (!utils.hasScriptVar(self, "child")) - { - return SCRIPT_CONTINUE; - } - - obj_id child = utils.getObjIdScriptVar(self, "child"); - if (!isValidId(child) || !exists(child)) - { - return SCRIPT_CONTINUE; - } - - destroyObject(child); - return SCRIPT_CONTINUE; - } - - - public int spawnSentry(obj_id self, dictionary params) throws InterruptedException - { - LOG("guard_spawning","spawnSentry init"); - - if (!hasObjVar(self, "mob")) - { - return SCRIPT_CONTINUE; - } - LOG("guard_spawning","spawnSentry has mob objvar"); - - String creatureType = getStringObjVar(self, "mob"); - if (creatureType == null || creatureType.length() <= 0) - { - return SCRIPT_CONTINUE; - } - LOG("guard_spawning","spawnSentry creatureType: "+creatureType); - - obj_id mob = create.object(creatureType, getLocation(self)); - if (!isValidId(mob) || !exists(mob)) - { - return SCRIPT_CONTINUE; - } - LOG("guard_spawning","spawnSentry mob: "+mob); - - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Mob: "+mob+" WAS SUCCESSFULLY CREATED for spawner: "+self); - - setObjVar(mob, "mySpawner", self); - utils.setScriptVar(self, "child", mob); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_smuggler_device.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_smuggler_device.java deleted file mode 100644 index bea049fe2..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_smuggler_device.java +++ /dev/null @@ -1,186 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.restuss_event; -import script.library.static_item; -import script.library.trial; -import script.library.utils; - - -public class gcw_smuggler_device extends script.base_script -{ - public gcw_smuggler_device() - { - } - public static final String PARENT = "parent"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!hasObjVar(self, PARENT)) - { - LOG("gcw_smuggler_functionality","no parent var on obj"); - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, PARENT); - if (!isValidId(parent)) - { - LOG("gcw_smuggler_functionality","parent var not valid"); - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_smuggler_functionality","no faction on turret obj"); - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - if (faction < 0) - { - LOG("gcw_smuggler_functionality","faction invalid on turret obj"); - return SCRIPT_CONTINUE; - } - - if (faction != factions.getFactionFlag(player)) - { - LOG("gcw_smuggler_functionality","faction invalid on turret obj"); - return SCRIPT_CONTINUE; - } - - if (faction == factions.getFactionFlag(player)) - { - menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE); - - if (data != null) - { - data.setServerNotify (true); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - LOG("gcw_smuggler_functionality","OnObjectMenuSelect"); - if (!hasObjVar(self, PARENT)) - { - LOG("gcw_smuggler_functionality","no parent var on obj"); - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, PARENT); - if (!isValidId(parent)) - { - LOG("gcw_smuggler_functionality","parent var not valid"); - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_smuggler_functionality","no faction on patrol obj"); - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - if (faction < 0) - { - LOG("gcw_smuggler_functionality","faction invalid on patrol obj"); - return SCRIPT_CONTINUE; - } - - if (faction != factions.getFactionFlag(player)) - { - LOG("gcw_smuggler_functionality","Wrong Faction"); - return SCRIPT_CONTINUE; - } - - LOG("gcw_smuggler_functionality","player has used patrol point"); - - if (faction == factions.getFactionFlag(player)) - { - LOG("gcw_smuggler_functionality","player is of correct faction"); - - String questName = gcw.GCW_DEFEND_TOWER_REBEL; - if (faction == 2) - { - questName = gcw.GCW_DEFEND_TOWER_IMPERIAL; - } - LOG("gcw_smuggler_functionality","questName: "+questName); - - if (groundquests.isQuestActive(player, questName)) - { - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, questName)) - { - groundquests.clearQuest(player, questName); - } - if (!groundquests.isQuestActive(player, questName)) - { - groundquests.grantQuest(player, questName); - } - } - return SCRIPT_CONTINUE; - } - - - public int destroyGCWTower(obj_id self, dictionary params) throws InterruptedException - { - trial.cleanupObject(self); - return SCRIPT_CONTINUE; - } - - - public int OnDeath(obj_id self, obj_id killer, obj_id corpseId) throws InterruptedException - { - handleDestroyTower(self, killer); - return SCRIPT_CONTINUE; - } - - - public int OnObjectDisabled(obj_id self, obj_id killer) throws InterruptedException - { - handleDestroyTower(self, killer); - return SCRIPT_CONTINUE; - } - - - public void handleDestroyTower(obj_id self, obj_id killer) throws InterruptedException - { - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - setInvulnerable( self, true ); - messageTo(self, "destroyGCWTower", null, 1f, false); - return; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_tower.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_tower.java deleted file mode 100644 index a73923ab4..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_tower.java +++ /dev/null @@ -1,259 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.restuss_event; -import script.library.static_item; -import script.library.trial; -import script.library.utils; - - -public class gcw_tower extends script.base_script -{ - public gcw_tower() - { - } - - public int OnInitialize(obj_id self) throws InterruptedException - { - setObjVar(self, "questCallBack", 1); - - dictionary params = new dictionary(); - location loc = getLocation(self); - params.put("particleLoc", loc); - int playIconTime = getGameTime(); - params.put("iconMessageTime", playIconTime); - utils.setScriptVar(self, "iconMessageTime", playIconTime); - - messageTo(self, "playQuestIcon", params, 1.0f, false); - - setInvulnerable(self, false); - pvpSetAttackableOverride(self, true); - - messageTo(self, "handleGCWTower", null, 2, false); - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_patrol_point","no faction on turret obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_patrol_point","faction invalid on turret obj"); - return SCRIPT_CONTINUE; - } - else - { - menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE); - - if (data != null) - { - data.setServerNotify (true); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - LOG("gcw_patrol_point","OnObjectMenuSelect"); - - if (!isIdValid(player) || !exists(player) || isIncapacitated(player) || isDead(player) || factions.isOnLeave(player)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_patrol_point","no faction on patrol obj"); - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - if (faction < 0) - { - LOG("gcw_patrol_point","faction invalid on patrol obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_patrol_point","Wrong Faction"); - return SCRIPT_CONTINUE; - } - else - { - LOG("gcw_patrol_point","player is of correct faction"); - - String questName = gcw.GCW_DEFEND_TOWER_REBEL; - if (faction == factions.FACTION_FLAG_IMPERIAL) - { - questName = gcw.GCW_DEFEND_TOWER_IMPERIAL; - } - LOG("gcw_patrol_point","questName: "+questName); - - if (groundquests.isQuestActive(player, questName)) - { - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, questName)) - { - groundquests.clearQuest(player, questName); - } - if (!groundquests.isQuestActive(player, questName)) - { - groundquests.grantQuest(player, questName); - } - } - return SCRIPT_CONTINUE; - } - - - public int destroyGCWTower(obj_id self, dictionary params) throws InterruptedException - { - trial.cleanupObject(self); - return SCRIPT_CONTINUE; - } - - - public int playQuestIcon(obj_id self, dictionary params) throws InterruptedException - { - params.put("offset", 12.0f); - - gcw.playQuestIconHandler(self, params); - - return SCRIPT_CONTINUE; - } - - - public int OnDeath(obj_id self, obj_id killer, obj_id corpseId) throws InterruptedException - { - handleDestroyTower(self, killer); - return SCRIPT_CONTINUE; - } - - - public int OnObjectDisabled(obj_id self, obj_id killer) throws InterruptedException - { - handleDestroyTower(self, killer); - return SCRIPT_CONTINUE; - } - - - public void handleDestroyTower(obj_id self, obj_id killer) throws InterruptedException - { - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - setInvulnerable( self, true ); - messageTo(self, "destroyGCWTower", null, 1f, false); - return; - } - - - public int OnObjectDamaged(obj_id self, obj_id attacker, obj_id weapon, int damage) throws InterruptedException - { - if (!isIdValid(attacker) || !exists(attacker) || !isIdValid(weapon) || !exists(weapon) || damage < 1) - { - return SCRIPT_CONTINUE; - } - - String template = getTemplateName(attacker); - - if (template == null || (!template.equals("object/mobile/atst.iff") && !template.equals("object/mobile/atxt.iff") && !template.equals("object/mobile/atat.iff"))) - { - LOG("gcw_vehicle", "Tower being attacked by non-vehicle: "+ attacker); - return SCRIPT_CONTINUE; - } - - LOG("gcw_vehicle", "Tower being attacked by vehicle: "+ attacker + " damage: "+ damage); - - return SCRIPT_CONTINUE; - } - - - public int handleGCWTower(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] objects = getObjectsInRange(self, 25.0f); - - int faction = -1; - - if (utils.hasScriptVar(self, "faction")) - { - faction = utils.getIntScriptVar(self, "faction"); - } - - if (objects != null && objects.length > 0) - { - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - obj_id object = objects[i]; - - if (isIdValid(object) && isMob(object) && !isPlayer(object) && !isIdValid(getMaster(object)) && factions.isPlayerSameGcwFactionAsSchedulerObject(object, self)) - { - buff.applyBuff(object, self, "tower_defender"); - } - } - } - - messageTo(self, "handleGCWTower", null, 10, false); - - return SCRIPT_CONTINUE; - } - - - public int handleQuestCallBack(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - if (!params.containsKey("questComplete")) - { - return SCRIPT_CONTINUE; - } - if (!params.containsKey("player")) - { - return SCRIPT_CONTINUE; - } - if (params.getBoolean("questComplete")) - { - obj_id player = params.getObjId("player"); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - trial.addNonInstanceFactionParticipant(player, self); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_turret.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_turret.java deleted file mode 100644 index a69b37c7d..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_turret.java +++ /dev/null @@ -1,295 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.chat; -import script.library.create; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.restuss_event; -import script.library.resource; -import script.library.static_item; -import script.library.sui; -import script.library.stealth; -import script.library.trial; -import script.library.utils; - - -public class gcw_turret extends script.base_script -{ - public gcw_turret() - { - } - public static final string_id SID_MNU_REPAIR = new string_id("sui", "mnu_repair"); - public static final string_id SID_MNU_DEFEND = new string_id("sui", "mnu_defend"); - - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, gcw.GCW_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_turret_tool.iff"); - setObjVar(self, "questCallBack", 1); - - dictionary params = new dictionary(); - location loc = getLocation(self); - params.put("particleLoc", loc); - int playIconTime = getGameTime(); - params.put("iconMessageTime", playIconTime); - utils.setScriptVar(self, "iconMessageTime", playIconTime); - messageTo(self, "playQuestIcon", params, 1.0f, false); - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - if (!exists(self)) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int idx = utils.getValidAttributeIndex(names); - - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int displayPower = utils.getIntScriptVar(self, "gcw.displayPower"); - - if (displayPower > 0 && displayPower < 4) - { - String[] powerLevels = - { - "Low Firepower", "Normal Firepower", "Maximum Firepower" - }; - - names[idx] = "turret_level"; - attribs[idx] = powerLevels[displayPower - 1]; - idx++; - } - - names[idx] = "object_repaired"; - int repairCount = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - - if (repairCount > 0) - { - attribs[idx] = ""+repairCount+" out of "+gcw.REPAIR_COUNT_MAX; - } - else - { - attribs[idx] = "Never Repaired"; - } - idx++; - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_patrol_point","no faction on turret obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_patrol_point","faction invalid on turret obj"); - return SCRIPT_CONTINUE; - } - else - { - if (utils.isProfession(player, utils.TRADER)) - { - LOG("gcw_patrol_point","player is trader"); - - if (!gcw.canGcwObjectBeRepaired(self)) - { - LOG("gcw_patrol_point","OnObjectMenuRequest no repair needed"); - - sendSystemMessage(player, gcw.SID_DOESNT_NEED_REPAIR); - return SCRIPT_CONTINUE; - } - if (!gcw.hasConstructionOrRepairTool(player, self)) - { - LOG("gcw_patrol_point","OnObjectMenuRequest no resources"); - - gcw.playerSystemMessageResourceNeeded(player, self, false); - return SCRIPT_CONTINUE; - } - mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_MNU_REPAIR); - } - else - { - mi.addRootMenu(menu_info_types.SERVER_MENU2, SID_MNU_DEFEND); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - LOG("gcw_patrol_point","OnObjectMenuSelect"); - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_patrol_point","no faction on patrol obj"); - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - if (faction < 0) - { - LOG("gcw_patrol_point","faction invalid on patrol obj"); - return SCRIPT_CONTINUE; - } - - if ((item != menu_info_types.SERVER_MENU1 && item != menu_info_types.SERVER_MENU2)) - { - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_patrol_point","Wrong Faction"); - return SCRIPT_CONTINUE; - } - else - { - if (item == menu_info_types.SERVER_MENU1) - { - if (utils.isProfession(player, utils.TRADER)) - { - LOG("gcw_patrol_point","player is trader"); - - if (!gcw.canGcwObjectBeRepaired(self)) - { - sendSystemMessage(player, gcw.SID_DOESNT_NEED_REPAIR); - return SCRIPT_CONTINUE; - } - if (!gcw.hasConstructionOrRepairTool(player, self)) - { - gcw.playerSystemMessageResourceNeeded(player, self, false); - return SCRIPT_CONTINUE; - } - - if (groundquests.isQuestActive(player, gcw.GCW_REPAIR_TURRET_QUEST)) - { - if (gcw.useGcwObjectForQuest(player, self, gcw.GCW_REPAIR_TURRET_QUEST)) - { - gcw.useConstructionOrRepairTool(player, self); - } - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_REPAIR_TURRET_QUEST)) - { - groundquests.clearQuest(player, gcw.GCW_REPAIR_TURRET_QUEST); - } - if (!groundquests.isQuestActive(player, gcw.GCW_REPAIR_TURRET_QUEST)) - { - groundquests.grantQuest(player, gcw.GCW_REPAIR_TURRET_QUEST); - } - } - } - else - { - LOG("gcw_patrol_point","OnObjectMenuSelect server menu 2"); - - String questName = gcw.GCW_DEFEND_TURRET_REBEL; - if (faction == factions.FACTION_FLAG_IMPERIAL) - { - questName = gcw.GCW_DEFEND_TURRET_IMPERIAL; - } - - if (groundquests.isQuestActive(player, questName)) - { - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, questName)) - { - groundquests.clearQuest(player, questName); - } - if (!groundquests.isQuestActive(player, questName)) - { - setObjVar(player,"defend_target", self); - groundquests.grantQuest(player, questName); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - int faction = utils.getIntScriptVar(self, "faction"); - if (faction < 0) - { - return SCRIPT_CONTINUE; - } - - if (faction == factions.FACTION_FLAG_IMPERIAL) - { - gcw.signalAllParticipantsForDamage(self, gcw.GCW_DESTROY_TURRET, gcw.GCW_IMP_DESTROY_TURRET_TASK, gcw.GCW_IMP_DESTROY_TURRET_SIGNAL); - } - else if (faction == factions.FACTION_FLAG_REBEL) - { - gcw.signalAllParticipantsForDamage(self, gcw.GCW_DESTROY_TURRET, gcw.GCW_REB_DESTROY_TURRET_TASK, gcw.GCW_REB_DESTROY_TURRET_SIGNAL); - } - - return SCRIPT_CONTINUE; - } - - - public int playQuestIcon(obj_id self, dictionary params) throws InterruptedException - { - params.put("offset", 2.0f); - - gcw.playQuestIconHandler(self, params); - - return SCRIPT_CONTINUE; - } - - - public int handleQuestCallBack(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - if (!params.containsKey("questComplete")) - { - return SCRIPT_CONTINUE; - } - if (!params.containsKey("player")) - { - return SCRIPT_CONTINUE; - } - if (params.getBoolean("questComplete")) - { - obj_id player = params.getObjId("player"); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - trial.addNonInstanceFactionParticipant(player, self); - } - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_vehicle_patrol.java b/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_vehicle_patrol.java deleted file mode 100644 index 969cc7692..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/gcw_vehicle_patrol.java +++ /dev/null @@ -1,444 +0,0 @@ -package script.systems.gcw; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.create; -import script.library.factions; -import script.library.gcw; -import script.library.groundquests; -import script.library.resource; -import script.library.restuss_event; -import script.library.static_item; -import script.library.trial; -import script.library.utils; - - -public class gcw_vehicle_patrol extends script.base_script -{ - public gcw_vehicle_patrol() - { - } - public static final String[] lowImperials = - { - "gcw_city_at_st_1" - }; - - public static final String[] normalImperials = - { - "gcw_city_at_st_2" - }; - - public static final String[] eliteImperials = - { - "gcw_city_at_st_3" - }; - - public static final String[] lowRebels = - { - "gcw_city_at_xt_1" - }; - - public static final String[] normalRebels = - { - "gcw_city_at_xt_2" - }; - - public static final String[] eliteRebels = - { - "gcw_city_at_xt_3" - }; - - - public int OnAttach(obj_id self) throws InterruptedException - { - setObjVar(self, gcw.GCW_TOOL_TEMPLATE_OBJVAR, "object/tangible/gcw/crafting_quest/gcw_vehicle_tool.iff"); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "handleGCWPatrol", null, 120, false); - - return SCRIPT_CONTINUE; - }; - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - if (!exists(self)) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int idx = utils.getValidAttributeIndex(names); - - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "object_repaired"; - if (hasObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT)) - { - int repairCount = getIntObjVar(self, gcw.GCW_OBJECT_REPAIR_COUNT); - if (repairCount > 0) - { - attribs[idx] = ""+repairCount; - idx++; - return super.OnGetAttributes(self, player, names, attribs); - } - } - - attribs[idx] = "Never Repaired"; - idx++; - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_patrol_point","no faction on turret obj"); - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_patrol_point","faction invalid on turret obj"); - return SCRIPT_CONTINUE; - } - else - { - if (utils.isProfession(player, utils.TRADER)) - { - LOG("gcw_patrol_point","player is trader"); - - if (!gcw.canGcwObjectBeRepaired(self)) - { - LOG("gcw_patrol_point","OnObjectMenuRequest no repair needed"); - - sendSystemMessage(player, gcw.SID_DOESNT_NEED_REPAIR); - return SCRIPT_CONTINUE; - } - if (!gcw.hasConstructionOrRepairTool(player, self)) - { - LOG("gcw_patrol_point","OnObjectMenuRequest no resources"); - - gcw.playerSystemMessageResourceNeeded(player, self, false); - return SCRIPT_CONTINUE; - } - menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE); - - if (data != null) - { - data.setServerNotify (true); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - LOG("gcw_patrol_point","OnObjectMenuSelect"); - - if (!utils.hasScriptVar(self, "faction")) - { - LOG("gcw_patrol_point","no faction on patrol obj"); - return SCRIPT_CONTINUE; - } - - int faction = utils.getIntScriptVar(self, "faction"); - if (faction < 0) - { - LOG("gcw_patrol_point","faction invalid on patrol obj"); - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!factions.isPlayerSameGcwFactionAsSchedulerObject(player, self)) - { - LOG("gcw_patrol_point","Wrong Faction"); - return SCRIPT_CONTINUE; - } - else - { - if (utils.isProfession(player, utils.TRADER)) - { - LOG("gcw_patrol_point","player is trader"); - - if (!gcw.canGcwObjectBeRepaired(self)) - { - sendSystemMessage(player, gcw.SID_DOESNT_NEED_REPAIR); - return SCRIPT_CONTINUE; - } - if (!gcw.hasConstructionOrRepairTool(player, self)) - { - gcw.playerSystemMessageResourceNeeded(player, self, false); - return SCRIPT_CONTINUE; - } - LOG("gcw_patrol_point","player can repair"); - if (groundquests.isQuestActive(player, gcw.GCW_REPAIR_VEHICLE_PATROL_QUEST)) - { - if (gcw.useGcwObjectForQuest(player, self, gcw.GCW_REPAIR_VEHICLE_PATROL_QUEST)) - { - gcw.useConstructionOrRepairTool(player, self); - } - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, gcw.GCW_REPAIR_VEHICLE_PATROL_QUEST)) - { - groundquests.clearQuest(player, gcw.GCW_REPAIR_VEHICLE_PATROL_QUEST); - } - if (!groundquests.isQuestActive(player, gcw.GCW_REPAIR_VEHICLE_PATROL_QUEST)) - { - groundquests.grantQuest(player, gcw.GCW_REPAIR_VEHICLE_PATROL_QUEST); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int getConstructionQuestsCompleted(obj_id pylon) throws InterruptedException - { - int completed = 0; - - if (!isIdValid(pylon) || !exists(pylon)) - { - return 0; - } - - if (utils.hasScriptVar(pylon, "gcw.constructionQuestsCompleted")) - { - completed = utils.getIntScriptVar(pylon, "gcw.constructionQuestsCompleted"); - } - - return completed; - } - - - public int handleGCWPatrol(obj_id self, dictionary params) throws InterruptedException - { - int faction = -1; - - if (utils.hasScriptVar(self, "faction")) - { - faction = utils.getIntScriptVar(self, "faction"); - } - - obj_id kit = utils.getObjIdScriptVar(self, "creator"); - - if (!isIdValid(kit) || !exists(kit)) - { - return SCRIPT_CONTINUE; - } - - int patrolType = getIntObjVar(kit, "patrolType"); - int construction = getConstructionQuestsCompleted(kit); - - String npcName = ""; - - if (construction < 1) - { - return SCRIPT_CONTINUE; - } - else if (construction < gcw.GCW_CONSTRUCTION_MAXIMUM / 2) - { - if (faction == factions.FACTION_FLAG_REBEL) - { - npcName = lowRebels[rand(0, lowRebels.length - 1)]; - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - npcName = lowImperials[rand(0, lowImperials.length - 1)]; - } - } - else if (construction < gcw.GCW_CONSTRUCTION_MAXIMUM) - { - if (faction == factions.FACTION_FLAG_REBEL) - { - npcName = normalRebels[rand(0, normalRebels.length - 1)]; - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - npcName = normalImperials[rand(0, normalImperials.length - 1)]; - } - } - else if (construction >= gcw.GCW_CONSTRUCTION_MAXIMUM) - { - if (faction == factions.FACTION_FLAG_REBEL) - { - npcName = eliteRebels[rand(0, eliteRebels.length - 1)]; - } - else if (faction == factions.FACTION_FLAG_IMPERIAL) - { - npcName = eliteImperials[rand(0, eliteImperials.length - 1)]; - } - } - - if (getSchedulerNPCs(kit, "gcwPatrol") < 0) - { - return SCRIPT_CONTINUE; - } - - obj_id npc = null; - - if (patrolType == 0 && getSchedulerNPCs(kit, "gcwPatrol") < 500) - { - obj_id currentPatrol = utils.getObjIdScriptVar(kit, "currentPatrol"); - - if (!isIdValid(currentPatrol) || !exists(currentPatrol) || isIncapacitated(currentPatrol) || isDead(currentPatrol)) - { - npc = createSchedulerNPC(kit, npcName); - - utils.setScriptVar(kit, "currentPatrol", npc); - } - } - - if (patrolType == 1 && getSchedulerNPCs(kit, "gcwPatrol") < 500) - { - npc = createSchedulerNPC(kit, npcName); - } - - if (isIdValid(npc) && exists(npc)) - { - detachScript(npc, "systems.vehicle_system.vehicle_base"); - detachScript(npc, "systems.vehicle_system.vehicle_ping"); - } - - messageTo(self, "handleGCWPatrol", null, 240.0f + rand(0, 30), false); - - return SCRIPT_CONTINUE; - } - - - public int getSchedulerNPCs(obj_id kit, String npcID) throws InterruptedException - { - if (!isIdValid(kit) || !exists(kit)) - { - return -1; - } - - obj_id kitParent = trial.getParent(kit); - - if (!isIdValid(kitParent) || !exists(kitParent)) - { - return -1; - } - - obj_id[] npcs = trial.getObjectsInInstanceBySpawnId(trial.getParent(kit), npcID); - - if (npcs == null) - { - return 0; - } - - return npcs.length; - } - - - public obj_id createSchedulerNPC(obj_id kit, String npcName) throws InterruptedException - { - - if (!isIdValid(kit) || !exists(kit)) - { - return null; - } - - obj_id kitParent = trial.getParent(kit); - - if (!isIdValid(kitParent) || !exists(kitParent)) - { - return null; - } - - location loc = getLocation(kit); - - obj_id npc = create.object(npcName, loc); - - if (!isIdValid(npc) || !exists(npc)) - { - return null; - } - - trial.markAsTempObject(npc, true); - trial.setParent(kitParent, npc, true); - trial.setInterest(npc); - - setObjVar(npc, "spawn_id", "gcwPatrol"); - - trial.storeSpawnedChild(kitParent, npc, "gcwPatrol"); - - String patrol = getStringObjVar(kit, "patrolPoint"); - - if (patrol != null && patrol.length() > 0) - { - dictionary path_data = utils.hasScriptVar(kitParent, trial.SEQUENCER_PATH_DATA) ? utils.getDictionaryScriptVar(kitParent, trial.SEQUENCER_PATH_DATA) : null; - - if (path_data != null && !path_data.isEmpty()) - { - utils.setScriptVar(npc, trial.SEQUENCER_PATH_DATA, utils.getDictionaryScriptVar(kitParent, trial.SEQUENCER_PATH_DATA)); - } - - setObjVar(npc, "patrol_path", patrol); - setHibernationDelay(npc, 3600.0f); - } - - attachScript(npc, "systems.dungeon_sequencer.ai_controller"); - - return npc; - } - - - public int destroyGCWPatrol(obj_id self, dictionary params) throws InterruptedException - { - trial.cleanupObject(self); - return SCRIPT_CONTINUE; - } - - - public int OnDeath(obj_id self, obj_id killer, obj_id corpseId) throws InterruptedException - { - handleDestroyPatrol(self, killer); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectDisabled(obj_id self, obj_id killer) throws InterruptedException - { - handleDestroyPatrol(self, killer); - return SCRIPT_CONTINUE; - } - - - public void handleDestroyPatrol(obj_id self, obj_id killer) throws InterruptedException - { - location death = getLocation( self ); - playClientEffectObj(killer, "clienteffect/combat_explosion_lair_large.cef", self, ""); - playClientEffectLoc(killer, "clienteffect/combat_explosion_lair_large.cef", death, 0); - - setInvulnerable(self, true); - messageTo(self, "destroyGCWPatrol", null, 1f, false); - - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/gcw/static_base/base_master.java b/sku.0/sys.server/compiled/game/script/systems/gcw/static_base/base_master.java deleted file mode 100644 index adc6c204a..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/gcw/static_base/base_master.java +++ /dev/null @@ -1,519 +0,0 @@ -package script.systems.gcw.static_base; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.create; -import script.library.utils; - - -public class base_master extends script.base_script -{ - public base_master() - { - } - public static final int NO_CONTROL = 0; - public static final int IMPERIAL_CONTROL = 1; - public static final int REBEL_CONTROL = 2; - - public static final String VAR_TERMINAL_IDS = "gcw.static_base.terminal_ids"; - public static final String VAR_TERMINAL_STATUS = "gcw.static_base.terminal_status"; - public static final String VAR_MASTER = "gcw.static_base.master"; - public static final String VAR_BASE_STATUS = "gcw.static_base.base_status"; - public static final String VAR_BASE_LAST_CAPTURE = "gcw.static_base.last_capture"; - public static final String VAR_ACCESS_DELAY = "gcw.static_base.access_delay"; - - public static final String SCRIPT_VAR_VALIDATION = "gcw.static_base.validation"; - - public static final String TABLE_TERMINAL_SPAWN = "datatables/gcw/static_base/terminal_spawn.iff"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - obj_id master = findMasterObject(self); - - if (!isIdValid(master)) - { - dictionary d = new dictionary(); - d.put("tries", 0); - - messageTo(self, "handleBaseInitializationRetry", d, 30.0f, false); - } - else - { - initializeBase(self, master); - } - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - obj_id master = findMasterObject(self); - - if (!isIdValid(master)) - { - dictionary d = new dictionary(); - d.put("tries", 0); - - messageTo(self, "handleBaseInitializationRetry", d, 30.0f, false); - } - else - { - initializeBase(self, master); - } - - return SCRIPT_CONTINUE; - } - - - public obj_id findMasterObject(obj_id self) throws InterruptedException - { - LOG("gcw_testing","Attempting to find Master Object: "); - obj_id[] objects = getObjectsInRange(getLocation(self), 100f); - - if (objects == null || objects.length == 0) - { - return obj_id.NULL_ID; - } - - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (isIdValid(objects[i])) - { - if (hasScript(objects[i], "systems.gcw.static_base.master")) - { - LOG("gcw_testing","MASTER OID: "+objects[i]); - return objects[i]; - } - } - } - - return obj_id.NULL_ID; - } - - - public void initializeBase(obj_id self, obj_id master) throws InterruptedException - { - if (isIdValid(master)) - { - setObjVar(self, VAR_MASTER, master); - - if (hasObjVar(master, VAR_BASE_STATUS)) - { - int status = getIntObjVar(master, VAR_BASE_STATUS); - setObjVar(self, VAR_BASE_STATUS, status); - } - - if (hasObjVar(master, VAR_TERMINAL_IDS)) - { - obj_id[] terminals = getObjIdArrayObjVar(master, VAR_TERMINAL_IDS); - setObjVar(self, VAR_TERMINAL_IDS, terminals); - } - } - - if (!hasScript(self, "systems.gcw.static_base.base_spawner")) - { - attachScript(self, "systems.gcw.static_base.base_spawner"); - } - - messageTo(self, "handleTerminalSetup", null, 1.0f, false); - } - - - public void beginTerminalSpawnSequence(obj_id self) throws InterruptedException - { - float spawnTime = 10.0f; - - if (hasObjVar(self, VAR_TERMINAL_IDS)) - { - destroyTerminals(self); - spawnTime = 60.0f; - } - - messageTo(self, "handleTerminalSpawnRequest", null, spawnTime, false); - } - - - public void validateTerminals(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, VAR_TERMINAL_IDS)) - { - return; - } - - obj_id[] terminals = getObjIdArrayObjVar(self, VAR_TERMINAL_IDS); - - if (terminals == null || terminals.length == 0) - { - return; - } - - int[] validate = new int[terminals.length]; - - dictionary d = new dictionary(); - d.put("master", self); - - for (int i = 0; i < terminals.length; i++) - { - testAbortScript(); - if (isIdValid(terminals[i])) - { - messageTo(terminals[i], "handleTerminalValidationRequest", d, 20.0f, false); - } - - validate[i] = 0; - } - - utils.setScriptVar(self, SCRIPT_VAR_VALIDATION, validate); - - messageTo(self, "handleTerminalValidation", null, 60.0f, false); - } - - - public void destroyTerminals(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, VAR_TERMINAL_IDS)) - { - return; - } - - obj_id[] terminals = getObjIdArrayObjVar(self, VAR_TERMINAL_IDS); - - if (terminals == null || terminals.length == 0) - { - return; - } - - for (int i = 0; i < terminals.length; i++) - { - testAbortScript(); - if (isIdValid(terminals[i])) - { - messageTo(terminals[i], "handleTerminalDestructionRequest", null, 20.0f, false); - } - } - - if (hasObjVar(self, VAR_TERMINAL_STATUS)) - { - removeObjVar(self, VAR_TERMINAL_STATUS); - } - } - - - public void testBaseStatusChange(obj_id self) throws InterruptedException - { - int status = NO_CONTROL; - - if (hasObjVar(self, VAR_BASE_STATUS)) - { - status = getIntObjVar(self, VAR_BASE_STATUS); - } - - int[] terminalStatus = null; - - if (!hasObjVar(self, VAR_TERMINAL_STATUS)) - { - return; - } - - terminalStatus = getIntArrayObjVar(self, VAR_TERMINAL_STATUS); - - if (terminalStatus == null || terminalStatus.length == 0) - { - return; - } - - int testCase = terminalStatus[0]; - - for (int i = 0; i < terminalStatus.length; i++) - { - testAbortScript(); - if (testCase != terminalStatus[i]) - { - return; - } - } - - if (status != testCase) - { - beginBaseFactionSwitcheroo(self, testCase); - } - } - - - public void beginBaseFactionSwitcheroo(obj_id self, int status) throws InterruptedException - { - LOG("gcw_testing", "beginBaseFactionSwitcheroo setting: "+VAR_BASE_STATUS+ " to "+status); - setObjVar(self, VAR_BASE_STATUS, status); - - String faction = "imperial_"; - - if (status == REBEL_CONTROL) - { - faction = "rebel_"; - } - - location loc = getLocation(self); - - string_id message = new string_id("gcw", "static_base_capture_"+ faction + loc.area); - - sendFactionalSystemMessagePlanet(message, null, -1.0f, true, true); - - obj_id master = getObjIdObjVar(self, VAR_MASTER); - LOG("gcw_testing", "beginBaseFactionSwitcheroo master: "+master); - - if (isIdValid(master)) - { - setObjVar(master, VAR_BASE_LAST_CAPTURE, getGameTime()); - setObjVar(master, VAR_BASE_STATUS, status); - } - - if (hasObjVar(self, VAR_TERMINAL_IDS)) - { - obj_id[] terminals = getObjIdArrayObjVar(self, VAR_TERMINAL_IDS); - - if (terminals != null && terminals.length > 0) - { - for (int i = 0; i < terminals.length; i++) - { - testAbortScript(); - if (isIdValid(terminals[i])) - { - setObjVar(terminals[i], VAR_ACCESS_DELAY, (getGameTime()+ 30)); - } - } - } - } - - messageTo(self, "handleBaseCleanupRequest", null, 0.0f, false); - messageTo(self, "handleBeginSpawnRequest", null, 2.0f, false); - - } - - - public int handleBaseInitializationRetry(obj_id self, dictionary params) throws InterruptedException - { - int tries = params.getInt("tries"); - obj_id master = findMasterObject(self); - - if (!isIdValid(master) && tries < 5) - { - tries++; - - dictionary d = new dictionary(); - d.put("tries", tries); - - messageTo(self, "handleBaseInitializationRetry", d, 30.0f, false); - } - else - { - initializeBase(self, master); - } - - return SCRIPT_CONTINUE; - } - - - public int handleTerminalSetup(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, VAR_TERMINAL_IDS)) - { - beginTerminalSpawnSequence(self); - } - else - { - validateTerminals(self); - } - - return SCRIPT_CONTINUE; - } - - - public int handleTerminalSpawnRequest(obj_id self, dictionary params) throws InterruptedException - { - int status = NO_CONTROL; - - if (hasObjVar(self, VAR_BASE_STATUS)) - { - status = getIntObjVar(self, VAR_BASE_STATUS); - } - - String planet = getLocation(self).area; - - if (planet == null || planet.equals("")) - { - return SCRIPT_CONTINUE; - } - - String[] planetList = dataTableGetStringColumn(TABLE_TERMINAL_SPAWN, "planet"); - - if (planetList == null || planetList.length == 0) - { - return SCRIPT_CONTINUE; - } - - int counter = 0; - Vector v = new Vector(); - - for (int i = 0; i < planetList.length; i++) - { - testAbortScript(); - if (planet.equals(planetList[i])) - { - dictionary spawnData = dataTableGetRow(TABLE_TERMINAL_SPAWN, i); - float x = spawnData.getFloat("loc_x"); - float y = spawnData.getFloat("loc_y"); - float z = spawnData.getFloat("loc_z"); - float yaw = spawnData.getFloat("yaw"); - String cellName = spawnData.getString("cell"); - String template = spawnData.getString("template"); - - obj_id cell = getCellId(self, cellName); - location loc = new location(x, y, z, planet, cell); - - if (template == null || template.equals("")) - { - continue; - } - - obj_id terminal = create.object(template, loc); - - setYaw(terminal, yaw); - - if (isIdValid(terminal)) - { - dictionary d = new dictionary(); - d.put("master", self); - d.put("id", counter); - d.put("control", status); - - messageTo(terminal, "handleTerminalInitialization", d, 1.0f, false); - - v.addElement(terminal); - ++counter; - } - } - } - - setObjVar(self, VAR_TERMINAL_IDS, v); - - obj_id master = getObjIdObjVar(self, VAR_MASTER); - if (isIdValid(master)) - { - setObjVar(master, VAR_TERMINAL_IDS, v); - } - - return SCRIPT_CONTINUE; - } - - - public int handleTerminalValidationResponse(obj_id self, dictionary params) throws InterruptedException - { - int response = params.getInt("response"); - int id = params.getInt("id"); - - int[] validate = utils.getIntArrayScriptVar(self, SCRIPT_VAR_VALIDATION); - - if (validate == null || validate.length == 0) - { - return SCRIPT_CONTINUE; - } - - if (id < 0 || id >= validate.length) - { - return SCRIPT_CONTINUE; - } - - validate[id] = response; - - utils.setScriptVar(self, SCRIPT_VAR_VALIDATION, validate); - - return SCRIPT_CONTINUE; - } - - - public int handleTerminalValidation(obj_id self, dictionary params) throws InterruptedException - { - int[] validate = utils.getIntArrayScriptVar(self, SCRIPT_VAR_VALIDATION); - - if (validate == null || validate.length == 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < validate.length; i++) - { - testAbortScript(); - if (validate[i] < 1) - { - beginTerminalSpawnSequence(self); - break; - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleControlUpdate(obj_id self, dictionary params) throws InterruptedException - { - int id = params.getInt("id"); - int control = params.getInt("control"); - - int[] terminalStatus = null; - - if (hasObjVar(self, VAR_TERMINAL_STATUS)) - { - terminalStatus = getIntArrayObjVar(self, VAR_TERMINAL_STATUS); - } - else - { - if (hasObjVar(self, VAR_TERMINAL_IDS)) - { - obj_id[] temp = getObjIdArrayObjVar(self, VAR_TERMINAL_IDS); - terminalStatus = new int[temp.length]; - - for (int i = 0; i < terminalStatus.length; i++) - { - testAbortScript(); - terminalStatus[i] = 0; - } - } - else - { - return SCRIPT_CONTINUE; - } - } - - if (terminalStatus == null || terminalStatus.length == 0) - { - return SCRIPT_CONTINUE; - } - - if (id < 0 || id >= terminalStatus.length) - { - return SCRIPT_CONTINUE; - } - - if (control != NO_CONTROL && control != REBEL_CONTROL && control != IMPERIAL_CONTROL) - { - return SCRIPT_CONTINUE; - } - - terminalStatus[id] = control; - - setObjVar(self, VAR_TERMINAL_STATUS, terminalStatus); - - testBaseStatusChange(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/jedi/jedi_saber_component.java b/sku.0/sys.server/compiled/game/script/systems/jedi/jedi_saber_component.java deleted file mode 100644 index bca18cd63..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/jedi/jedi_saber_component.java +++ /dev/null @@ -1,525 +0,0 @@ -package script.systems.jedi; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.jedi; -import script.library.jedi_trials; -import script.library.colors_hex; -import script.library.sui; -import script.library.utils; -import script.library.static_item; - - -public class jedi_saber_component extends script.base_script -{ - public jedi_saber_component() - { - } - - public int OnInitialize(obj_id self) throws InterruptedException - { - - detachScript(self, "systems.crafting.weapon.component.crafting_weapon_component_attribute"); - if (!static_item.isStaticItem(self)) - { - jedi.clickyCombatPearlFix(self); - } - - String template = getTemplateName(self); - if (template.endsWith("lance_module_force_crystal.iff")) - { - removeObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_MIN_DMG); - removeObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_MAX_DMG); - } - - removeObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_SPEED); - removeObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_WOUND); - removeObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_ATTACK_COST); - removeObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_FORCE); - removeObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_ACCURACY); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!static_item.isStaticItem(self)) - { - - int level = -1; - obj_id inv = getContainedBy(self); - LOG("jedi", "Crystal created in - "+inv); - if (inv != null) - { - if (isIdValid(inv)) - { - obj_id target = getContainedBy(inv); - LOG("jedi", " Inventory contained by - "+target); - if (isIdValid(target)) - { - final String mobType = getCreatureName(target); - LOG("jedi", " Mob type = "+mobType); - - level = getLevel(target); - LOG("jedi", " level = "+level); - } - } - if (level == -1) - { - level = rand (1, 50); - } - - jedi.initializeCrystal(self, level); - } - else - { - dictionary data = new dictionary(); - data.put("attempts", 0); - messageTo(self, "setCrystalLevel", data, 0.5f, false); - } - } - return SCRIPT_CONTINUE; - } - - - public int setCrystalLevel(obj_id self, dictionary params) throws InterruptedException - { - int attempts = params.getInt("attempts"); - - int level = -1; - obj_id inv = getContainedBy(self); - LOG("jedi", "Crystal created in - "+inv); - if (inv != null) - { - if (isIdValid(inv)) - { - obj_id target = getContainedBy(inv); - LOG("jedi", " Inventory contained by - "+target); - if (isIdValid(target)) - { - final String mobType = getCreatureName(target); - LOG("jedi", " Mob type = "+mobType); - - level = getLevel(target); - LOG("jedi", " level = "+level); - } - } - if (level == -1) - { - level = rand (1, 50); - } - - jedi.initializeCrystal(self, level); - } - else - { - attempts++; - - if (attempts < 5) - { - params.put("attempts", attempts); - messageTo(self, "setCrystalLevel", params, 0.5f, false); - } - else - { - jedi.initializeCrystal(self, rand (1, 50)); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - if (isDisabled(self)) - { - return SCRIPT_CONTINUE; - } - - csLogCrystal(self, "destroyed"); - - obj_id inv = getContainedBy(self); - obj_id saber = getContainedBy(inv); - - if (!jedi.isLightsaber(saber)) - { - return SCRIPT_CONTINUE; - } - - obj_id[] contents = getContents(inv); - - if (contents == null || contents.length == 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < contents.length; i++) - { - testAbortScript(); - if (contents[i] == self) - { - jedi.removeCrystalStats(saber, self); - break; - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectDisabled(obj_id self, obj_id killer) throws InterruptedException - { - obj_id inv = getContainedBy(self); - obj_id saber = getContainedBy(inv); - - csLogCrystal(self, "decayed"); - - LOG ("saber_test", "Crystal ("+self+") disabled."); - - if (jedi.isLightsaber(saber)) - { - jedi.removeCrystalStats(saber, self); - } - - String name = getEncodedName(self); - if (name.startsWith("@")) - { - name = localize(getNameStringId(self)); - } - name = "\\"+colors_hex.RED+""+name + " (broken)\\#."; - - LOG ("saber_test", "Setting Crystal name to: "+name); - - setName(self, name); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!jedi.isForceSensitiveLevelRequired(player, jedi.MIN_CRYSTAL_TUNE_PLAYER_LEVEL)) - { - return SCRIPT_CONTINUE; - } - if (!utils.isNestedWithin(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (canManipulate(player, self, false, true, 15, true)) - { - if (!jedi.isCrystalTuned(self)) - { - menu_info_data mid = mi.getMenuItemByType(menu_info_types.SERVER_PET_OPEN); - if (mid != null) - { - mid.setServerNotify(true); - } - else - { - mi.addRootMenu (menu_info_types.SERVER_PET_OPEN, new string_id("jedi_spam","tune_crystal")); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!jedi.isForceSensitiveLevelRequired(player, jedi.MIN_CRYSTAL_TUNE_PLAYER_LEVEL)) - { - return SCRIPT_CONTINUE; - } - - if (canManipulate(player, self, false, true, 15, true)) - { - if (item == menu_info_types.SERVER_PET_OPEN) - { - verifyTune(player); - } - } - - return SCRIPT_CONTINUE; - } - - - public void verifyTune(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - - int pid = sui.createSUIPage( sui.SUI_MSGBOX, self, player, "handleVerifyTune"); - - setSUIProperty(pid, "", "Size", "250,175"); - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, utils.packStringId(new string_id("jedi_spam", "confirm_tune_title"))); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, utils.packStringId(new string_id("jedi_spam", "confirm_tune_prompt"))); - - sui.msgboxButtonSetup(pid, sui.OK_CANCEL); - - sui.showSUIPage( pid ); - } - - - public int handleVerifyTune(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int bp = sui.getIntButtonPressed(params); - switch (bp) - { - case sui.BP_CANCEL: - return SCRIPT_CONTINUE; - - case sui.BP_OK: - tuneCrystal(player); - return SCRIPT_CONTINUE; - - } - - return SCRIPT_CONTINUE; - } - - - public void tuneCrystal(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - - setObjVar(self, jedi.VAR_CRYSTAL_OWNER_ID, player); - setObjVar(self, jedi.VAR_CRYSTAL_OWNER_NAME, getName(player)); - - String name = getEncodedName(self); - if (name.startsWith("@")) - { - name = localize(getNameStringId(self)); - } - name = "\\"+colors_hex.GREEN+""+name + " (tuned)\\#."; - setName(self, name); - - sendSystemMessage(player, new string_id("jedi_spam", "crystal_tune_success")); - sendDirtyObjectMenuNotification(self); - } - - - public int distributedRand(int min, int max, int level) throws InterruptedException - { - final int levelMin = 60; - final int levelMax = 280; - - boolean inverted = false; - int _min = min; - int _max = max; - - if (min > max) - { - inverted = true; - int temp = min; - min = max; - max = temp; - - } - - float rank = (float)(level - levelMin) / (float)(levelMax - levelMin); - - float mid = min + ((max - min) * rank); - - if (mid < min) - { - max += (mid-min); - mid = min; - } - if (mid > max) - { - min += (mid-max); - mid = max; - } - - int minRand = rand(min, (int)(mid+0.5f)); - int maxRand = rand((int)(mid+0.5f), max); - - int randNum = rand(minRand, maxRand); - - if (inverted) - { - randNum = _min + (_max - randNum); - } - - return randNum; - } - - - public float distributedRand(float min, float max, int level) throws InterruptedException - { - final int levelMin = 60; - final int levelMax = 280; - - boolean inverted = false; - float _min = min; - float _max = max; - - if (min > max) - { - inverted = true; - min = _max; - max = _min; - } - - float rank = (float)(level - levelMin) / (float)(levelMax - levelMin); - - float mid = min + ((max - min) * rank); - - if (mid < min) - { - max += (mid-min); - mid = min; - } - if (mid > max) - { - min += (mid-max); - mid = max; - } - - float minRand = rand(min, mid); - float maxRand = rand(mid, max); - - float randNum = rand(minRand, maxRand); - - if (inverted) - { - randNum = _min + (_max - randNum); - } - - return randNum; - } - - - public void csLogCrystal(obj_id crystal, String state) throws InterruptedException - { - int damage = getIntObjVar(crystal, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_MIN_DMG); - float wound = getFloatObjVar(crystal, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_WOUND); - float force = getFloatObjVar(crystal, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_FORCE); - float speed = getFloatObjVar(crystal, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_SPEED); - - obj_id player = getContainedBy(crystal); - - while (!isPlayer(player)) - { - testAbortScript(); - obj_id container = getContainedBy(player); - - if (player != container) - { - player = container; - } - else - { - break; - } - } - - CustomerServiceLog("jedi_saber", "A crystal("+crystal+" - "+getTemplateName(crystal)+") owned by %TU was "+state+". (Dam:"+damage+" Spd:"+speed+" Wnd:"+wound+" Frc:"+force+")", player); - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (jedi.isCrystalTuned(self)) - { - if (hasObjVar(self, jedi.VAR_CRYSTAL_STATS + "." + jedi.VAR_MIN_DMG)) - { - names[idx] = "wpn_comp_damage_min"; - int attrib = getIntObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_MIN_DMG); - attribs[idx] = Integer.toString(attrib); - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - if (hasObjVar(self, jedi.VAR_CRYSTAL_STATS + "." + jedi.VAR_MAX_DMG)) - { - names[idx] = "wpn_comp_damage_max"; - int attrib = getIntObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_MAX_DMG); - attribs[idx] = Integer.toString(attrib); - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - names[idx] = "crystal_owner"; - attribs[idx] = getStringObjVar(self, jedi.VAR_CRYSTAL_OWNER_NAME); - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - else - { - names[idx] = "crystal_owner"; - attribs[idx] = "\\#pcontrast2 "+localize(new string_id("jedi_spam", "crystal_untuned"))+"\\#."; - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - if (hasObjVar(self, jedi.VAR_CRYSTAL_STATS + "." + jedi.VAR_QUALITY)) - { - int qualityLevel = getIntObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_QUALITY); - names[idx] = "crystal_quality"; - int attrib = jedi.getStaticCrystalQuality(qualityLevel); - attribs[idx] = utils.packStringId(new string_id("jedi_spam", "crystal_quality_"+attrib)); - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - } - - if (hasObjVar(self, jedi.VAR_CRYSTAL_STATS + "." + jedi.VAR_COLOR)) - { - names[idx] = "color"; - int attrib = getIntObjVar(self, jedi.VAR_CRYSTAL_STATS + "."+ jedi.VAR_COLOR); - String strAsciiId = "saber_color_"+attrib; - - if (getIntObjVar(self, jedi.VAR_CRYSTAL_STATS + "." + jedi.VAR_SHADER) == 1) - { - strAsciiId = "saber_color_lava"; - } - string_id strSpam = new string_id("jedi_spam", strAsciiId); - String strPackedId = utils.packStringId(strSpam); - attribs[idx] = strPackedId; - idx++; - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - return super.OnGetAttributes(self, player, names, attribs); - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_probe_droid.java b/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_probe_droid.java deleted file mode 100644 index cf701502b..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_probe_droid.java +++ /dev/null @@ -1,388 +0,0 @@ -package script.systems.missions.dynamic; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.regions; -import script.library.locations; -import script.library.groundquests; -import script.library.utils; -import script.library.bounty_hunter; - - - -public class bounty_probe_droid extends script.systems.missions.base.mission_dynamic_base -{ - public bounty_probe_droid() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - - int intDroidType = getIntObjVar(self, "intDroidType"); - if (intDroidType == DROID_PROBOT) - { - setCount(self, 10); - - } - else if (intDroidType == DROID_SEEKER) - { - setCount(self, 20); - } - - return SCRIPT_CONTINUE; - - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - int intRootMenu; - - obj_id objBountyMission = getBountyMission(player); - if (objBountyMission == null) - { - return SCRIPT_CONTINUE; - } - - if (!utils.isProfession( player, utils.BOUNTY_HUNTER )) - { - string_id strResponse = new string_id("mission/mission_generic", "bounty_no_ability"); - sendSystemMessage(player, strResponse); - return SCRIPT_CONTINUE; - } - - int intDroidType = getIntObjVar(self, "intDroidType"); - if (intDroidType == DROID_PROBOT) - { - string_id strProbeId = new string_id("mission/mission_generic", "probe_droid_summon"); - intRootMenu = mi.addRootMenu (menu_info_types.SERVER_PROBE_DROID_FIND_TARGET, strProbeId); - return SCRIPT_CONTINUE; - } - - string_id strActivateId = new string_id("mission/mission_generic", "probe_droid_activate"); - string_id strFindId = new string_id("mission/mission_generic", "probe_droid_find_target"); - string_id strTrackId = new string_id("mission/mission_generic", "probe_droid_track_target"); - intRootMenu = mi.addRootMenu (menu_info_types.SERVER_PROBE_DROID_ACTIVATE, strActivateId); - - mi.addSubMenu(intRootMenu, menu_info_types.SERVER_PROBE_DROID_FIND_TARGET, strFindId); - - if (hasCommand(player, "droid_track")) - { - mi.addSubMenu(intRootMenu, menu_info_types.SERVER_PROBE_DROID_TRACK_TARGET, strTrackId ); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - - if (item == menu_info_types.EXAMINE) - { - return SCRIPT_CONTINUE; - - } - if (item == menu_info_types.ITEM_DESTROY) - { - return SCRIPT_CONTINUE; - } - - int intDroidType = getIntObjVar(self, "intDroidType"); - - obj_id objBountyMission = getBountyMission(player); - if (objBountyMission == null) - { - string_id strSpam = new string_id("mission/mission_generic", "bounty_no_mission"); - sendSystemMessage(player, strSpam); - return SCRIPT_CONTINUE; - } - - if (!utils.isProfession( player, utils.BOUNTY_HUNTER )) - { - return SCRIPT_CONTINUE; - } - - obj_id objMission = getBountyMission(player); - - int intState = getIntObjVar(objMission, "intState"); - - if (intState != STATE_BOUNTY_PROBE) - { - string_id strSpam = new string_id("mission/mission_generic", "bounty_no_signature"); - sendSystemMessage(player, strSpam); - return SCRIPT_CONTINUE; - - } - if (hasObjVar(objMission, "intTracking")) - { - string_id strSpam = new string_id("mission/mission_generic", "bounty_already_tracking"); - sendSystemMessage(player, strSpam); - return SCRIPT_CONTINUE; - - } - - if (hasObjVar(objMission, "objTarget")) - { - - obj_id objTarget = getObjIdObjVar(objMission, "objTarget"); - if (objTarget != null) - { - dictionary dctJediInfo = requestJedi(objTarget); - if (dctJediInfo == null) - { - - string_id strSpam = new string_id("mission/mission_generic", "jedi_not_online"); - sendSystemMessage(player, strSpam); - return SCRIPT_CONTINUE; - } - else - { - boolean boolOnline = dctJediInfo.getBoolean("online"); - if (!boolOnline) - { - - string_id strSpam = new string_id("mission/mission_generic", "jedi_not_online"); - sendSystemMessage(player, strSpam); - return SCRIPT_CONTINUE; - } - } - } - - } - - dictionary dctParams = new dictionary(); - dctParams.put("objPlayer", player); - setObjVar(self, "objPlayer", player); - debugServerConsoleMsg(self, "Droid Type is "+intDroidType); - if (item == menu_info_types.SERVER_PROBE_DROID_TRACK_TARGET) - { - bounty_hunter.probeDroidTrackTarget(player, self); - } - else if (item == menu_info_types.SERVER_PROBE_DROID_FIND_TARGET) - { - location currentPlayerLocation = getLocation(player); - if (isValidId(currentPlayerLocation.cell)) - { - string_id strResponse = new string_id("mission/mission_generic", "not_in_house"); - sendSystemMessage(player, strResponse); - return SCRIPT_CONTINUE; - } - - if (intDroidType == DROID_PROBOT) - { - debugServerConsoleMsg(self, "PROBOT, STARTING FIND"); - dctParams.put("intDroidType", intDroidType); - dctParams.put("objDroid", self); - dctParams.put("intTrackType", DROID_FIND_TARGET); - - if (!hasObjVar(objMission, "intMissionDynamic")) - { - dctParams.put("playerBounty", 1); - } - - messageTo(self, "droid_Probot_Start", dctParams, 0, true); - - } - if (intDroidType == DROID_SEEKER) - { - string_id strSpam = new string_id("mission/mission_generic", "seeker_droid_launched"); - sendSystemMessage(player, strSpam); - debugServerConsoleMsg(self, "seeker"); - dctParams.put("intDroidType", intDroidType); - dctParams.put("objDroid", self); - dctParams.put("intTrackType", DROID_FIND_TARGET); - - if (!hasObjVar(objMission, "intMissionDynamic")) - { - dctParams.put("playerBounty", 1); - } - - location locHeading = getHeading(player); - location locSpawnLocation = getLocation(player); - - locSpawnLocation.x = locSpawnLocation.x + locHeading.x; - locSpawnLocation.z = locSpawnLocation.z + locHeading.z; - - obj_id objSeeker = createObject("object/creature/npc/droid/bounty_seeker.iff", locSpawnLocation); - messageTo(objSeeker, "takeOff", null, 5, true); - messageTo(objMission, "halfwayNotification", dctParams, 40, true); - messageTo(objMission, "halfwayNotification", dctParams, 60, true); - messageTo(objMission, "findTarget", dctParams, 20, true); - int intCount = getCount(self); - intCount = intCount - 1; - if (intCount < 0) - { - destroyObject(self); - } - else - { - setCount(self, intCount); - } - } - - } - else if (item == menu_info_types.SERVER_PROBE_DROID_ACTIVATE) - { - - } - - return SCRIPT_CONTINUE; - - } - - - public int droid_Probot_Start(obj_id self, dictionary params) throws InterruptedException - { - - debugServerConsoleMsg(self, "PROBE_DROID STARTED"); - obj_id objPlayer = params.getObjId("objPlayer"); - - location locCurrentLocation = getLocation(objPlayer); - - region rgnCities[] = getRegionsWithMunicipalAtPoint(locCurrentLocation, regions.MUNI_TRUE); - if (rgnCities != null) - { - debugServerConsoleMsg(self, "cities!"); - string_id strResponse = new string_id("mission/mission_generic", "probe_droid_bad_location"); - sendSystemMessage(objPlayer, strResponse); - return SCRIPT_CONTINUE; - - } - location locSpawnLocation = groundquests.getRandom2DLocationAroundLocation(objPlayer, 3, 3, 64, 64); - if (locSpawnLocation != null) - { - if (isSpaceScene()) - { - string_id strResponse = new string_id("mission/mission_generic", "in_space"); - sendSystemMessage(objPlayer, strResponse); - return SCRIPT_CONTINUE; - } - rgnCities = getRegionsWithMunicipalAtPoint(locSpawnLocation, regions.MUNI_TRUE); - if (rgnCities != null) - { - debugServerConsoleMsg(self, "cities2"); - string_id strResponse = new string_id("mission/mission_generic", "probe_droid_bad_location"); - sendSystemMessage(objPlayer, strResponse); - return SCRIPT_CONTINUE; - - } - - setObjVar(self, "locSpawnLocation", locSpawnLocation); - - int intTrackType = params.getInt("intTrackType"); - obj_id objMission = getBountyMission(objPlayer); - if (objMission == null) - { - return SCRIPT_CONTINUE; - } - setObjVar(objMission, "intTracking", 1); - setObjVar(self, "objMission", objMission); - setObjVar(self, "intTrackType", intTrackType); - - dictionary dctParams = new dictionary(); - - string_id strResponse = new string_id("mission/mission_generic", "probe_droid_launch_prep"); - sendSystemMessage(objPlayer, strResponse); - - dctParams.put("intCountDown", 6); - messageTo(self, "probe_Droid_Countdown", dctParams, 20, true); - - } - else - { - - } - - return SCRIPT_CONTINUE; - } - - - public int probe_Droid_Countdown(obj_id self, dictionary params) throws InterruptedException - { - int intCountDown = params.getInt("intCountDown"); - debugServerConsoleMsg(self, "intCountDown is "+intCountDown); - obj_id objPlayer = getObjIdObjVar(self, "objPlayer"); - intCountDown = intCountDown-1; - if (intCountDown == 0) - { - - location locSpawnLocation = getLocationObjVar(self, "locSpawnLocation"); - - location locTest = getLocation(objPlayer); - locSpawnLocation.y = locTest.y; - - playClientEffectLoc(objPlayer, "clienteffect/probot_delivery.cef", locSpawnLocation, 0); - - messageTo(self, "probe_Droid_Spawn", null, 4, true); - - } - else - { - string_id strResponse = new string_id("mission/mission_generic", "probe_droid_arrival_"+intCountDown); - sendSystemMessage(objPlayer, strResponse); - dictionary dctParams = new dictionary(); - dctParams.put("intCountDown", intCountDown); - messageTo(self, "probe_Droid_Countdown", dctParams, 1, true); - - } - return SCRIPT_CONTINUE; - - } - - public int probe_Droid_Spawn(obj_id self, dictionary params) throws InterruptedException - { - location locSpawnLocation = getLocationObjVar(self, "locSpawnLocation"); - string_id strResponse = new string_id("mission/mission_generic", "probe_droid_arrival"); - - obj_id objPlayer = getObjIdObjVar(self, "objPlayer"); - sendSystemMessage(objPlayer, strResponse); - int intTrackType = getIntObjVar(self, "intTrackType"); - int intDroidType = getIntObjVar(self, "intDroidType"); - - obj_id objMission = getBountyMission(objPlayer); - if (objMission == null) - { - return SCRIPT_CONTINUE; - } - - obj_id objDroid = createObject( "object/creature/npc/droid/imperial_probot_bounty.iff", locSpawnLocation); - if (objDroid == null) - { - - debugServerConsoleMsg(self, "Null probe droid!"); - - } - attachScript(objDroid, "systems.missions.dynamic.bounty_probot"); - setMovementRun(objDroid); - follow(objDroid, objPlayer, 3.f, 5.f); - - dictionary dctParams = new dictionary(); - dctParams.put("objPlayer", objPlayer); - dctParams.put("intTrackType", intTrackType); - dctParams.put("intDroidType", intDroidType); - dctParams.put("objMission", objMission); - - messageTo(objDroid, "setup_Droid", dctParams, 0, true); - int intCount = getCount(self); - intCount = intCount - 1; - if (intCount < 0) - { - destroyObject(self); - } - else - { - setCount(self, intCount); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_probot.java b/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_probot.java deleted file mode 100644 index 4944c261c..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_probot.java +++ /dev/null @@ -1,100 +0,0 @@ -package script.systems.missions.dynamic; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; - - - -public class bounty_probot extends script.systems.missions.base.mission_dynamic_base -{ - public bounty_probot() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - setInvulnerable(self, true); - messageTo(self, "destroySelf", null, 180, true); - - if (!hasScript(self, "conversation.bounty_probot")) - { - attachScript(self, "conversation.bounty_probot"); - } - - return SCRIPT_CONTINUE; - - } - - - public int setup_Droid(obj_id self, dictionary params) throws InterruptedException - { - - obj_id objWaypoint = params.getObjId("objWaypoint"); - obj_id objPlayer = params.getObjId("objPlayer"); - obj_id objMission = params.getObjId("objMission"); - int intTrackType = params.getInt("intTrackType"); - int intDroidType = params.getInt("intDroidType"); - setObjVar(self, "objPlayer", objPlayer); - setObjVar(self, "objMission", objMission); - setObjVar(self, "intTrackType", intTrackType); - setObjVar(self, "intDroidType", intDroidType); - setObjVar(self, "objWaypoint", objWaypoint); - return SCRIPT_CONTINUE; - - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - - obj_id[] objPlayers = getAllPlayers(getLocation(self), 64); - - if (objPlayers != null && objPlayers.length > 0) - { - playClientEffectLoc(objPlayers[0], "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - } - - obj_id objMission = getObjIdObjVar(self, "objMission"); - messageTo(objMission, "stopTracking", null, 0, true); - messageTo(self, "delete_Self", null, 0, true); - - return SCRIPT_CONTINUE; - - } - - - public int delete_Self(obj_id self, dictionary params) throws InterruptedException - { - - obj_id objWaypoint = getObjIdObjVar(self, "objWaypoint"); - destroyObject(objWaypoint); - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int take_Off(obj_id self, dictionary params) throws InterruptedException - { - doAnimationAction(self, "sp_13"); - dictionary dctParams = new dictionary(); - obj_id objMission = getObjIdObjVar(self, "objMission"); - int intTrackType = getIntObjVar(self, "intTrackType"); - int intDroidType = getIntObjVar(self, "intDroidType"); - dctParams.put("intDroidType", intDroidType); - dctParams.put("intTrackType", DROID_FIND_TARGET); - messageTo(objMission, "findTarget", dctParams, 20, true); - utils.sendPostureChange(self, POSTURE_SITTING); - messageTo(self, "delete_Self", null, 10, true); - - return SCRIPT_CONTINUE; - - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_seeker.java b/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_seeker.java deleted file mode 100644 index 43845ec2f..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/bounty_seeker.java +++ /dev/null @@ -1,46 +0,0 @@ -package script.systems.missions.dynamic; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; - - -public class bounty_seeker extends script.systems.missions.base.mission_dynamic_base -{ - public bounty_seeker() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - setInvulnerable(self, true); - - return SCRIPT_CONTINUE; - - } - - - public int takeOff(obj_id self, dictionary params) throws InterruptedException - { - doAnimationAction(self, "sp_13"); - messageTo(self, "destroySelf", null, 10.3f, true); - utils.sendPostureChange(self, POSTURE_SITTING); - return SCRIPT_CONTINUE; - - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - return SCRIPT_CONTINUE; - - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/deliver_npc_spawner.java b/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/deliver_npc_spawner.java deleted file mode 100644 index b76d62327..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/deliver_npc_spawner.java +++ /dev/null @@ -1,51 +0,0 @@ -package script.systems.missions.dynamic; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.create; -import script.library.locations; - - -public class deliver_npc_spawner extends script.base_script -{ - public deliver_npc_spawner() - { - } - - public int OnInitialize(obj_id self) throws InterruptedException - { - String empiredayRunning = getConfigSetting("GameServer", "empireday_ceremony"); - if (empiredayRunning != null) - { - if (empiredayRunning.equals("true") || empiredayRunning.equals("1")) - { - - location here = getLocation( self ); - String city = locations.getCityName( here ); - if (city == null) - { - city = locations.getGuardSpawnerRegionName( here ); - } - - if (city != null && city.length() > 0) - { - if (city.equals("theed")) - { - return SCRIPT_CONTINUE; - } - } - } - } - - location here = getLocation(self); - obj_id npc = create.object("commoner", here); - attachScript (npc, "systems.missions.dynamic.mission_deliver_npc"); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/mission_bounty.java b/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/mission_bounty.java deleted file mode 100644 index ebc086761..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/mission_bounty.java +++ /dev/null @@ -1,785 +0,0 @@ -package script.systems.missions.dynamic; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.locations; -import script.library.utils; -import script.library.ai_lib; -import script.library.jedi; -import script.library.missions; -import script.library.stealth; - - - -public class mission_bounty extends script.systems.missions.base.mission_dynamic_base -{ - public mission_bounty() - { - } - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (!hasScript (self, "systems.missions.base.mission_cleanup_tracker")) - { - attachScript (self, "systems.missions.base.mission_cleanup_tracker"); - } - - if (hasObjVar(self, "movingTarget")) - { - if (hasObjVar(self, "intTargetSpawned")) - { - removeObjVar(self, "movingTarget"); - } - else - { - dictionary d = new dictionary(); - d.put("moveTargetSequence", utils.getIntScriptVar(self, "moveTargetSequence")); - messageTo(self, "moveTarget", d, rand(30, 60), false); - } - } - - return SCRIPT_CONTINUE; - } - - - public int onArrivedAtLocation(obj_id self, dictionary params) throws InterruptedException - { - debugServerConsoleMsg(self, "Arrived at location message"); - obj_id objPlayer = getMissionHolder(self); - dictionary dctParams = new dictionary(); - - dctParams.put("objMission", self); - messageTo(objPlayer, "bounty_Arrival", dctParams, 0, true); - return SCRIPT_CONTINUE; - } - - - public int abortMission(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = getObjIdObjVar(self, "objTarget"); - obj_id owner = getMissionHolder(self); - if (isIdValid(target) && isIdValid(owner)) - { - removeJediBounty(target, owner); - } - - if (isIdValid(owner)) - { - setObjVar(owner, "intState", missions.STATE_MISSION_COMPLETE); - } - - dictionary newParams = new dictionary(); - if (target == null) - { - target = obj_id.NULL_ID; - } - newParams.put("target", target); - bountyIncomplete(self, newParams); - return SCRIPT_CONTINUE; - } - - - public int timedOutMission(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = getObjIdObjVar(self, "objTarget"); - obj_id owner = getMissionHolder(self); - if (isIdValid(target) && isIdValid(owner)) - { - removeJediBounty(target, owner); - } - - if (isIdValid(owner)) - { - setObjVar(owner, "intState", missions.STATE_MISSION_COMPLETE); - } - - dictionary newParams = new dictionary(); - if (target == null) - { - target = obj_id.NULL_ID; - } - newParams.put("target", target); - bountyTimedOut(self, newParams); - return SCRIPT_CONTINUE; - } - - - public int OnStartMission(obj_id self, dictionary params) throws InterruptedException - { - - setupInvisibleWaypoint(self); - - if (!hasObjVar(self, "objTarget")) - { - setObjVar(self, "intMissionDynamic", 1); - location locSpawnLocation = getLocationObjVar(self, "locSpawnLocation"); - setObjVar(self, "locSpawnLocation", locSpawnLocation); - setupSpawn(self, locSpawnLocation); - - } - else - { - obj_id objTarget = getObjIdObjVar(self, "objTarget"); - - dictionary dctParams = new dictionary(); - dctParams.put("objMission", self); - dctParams.put("objKiller", getMissionHolder(self)); - messageTo(objTarget, "addJediListener", dctParams, 0, true); - - dictionary d = new dictionary(); - d.put("gametime", getGameTime()); - messageTo(objTarget, "handleUpdateBountyMissionTime", d, 0.0f, true); - } - - setObjVar(self, "intState", STATE_BOUNTY_INFORMANT); - - obj_id objMissionData = getMissionData(self); - obj_id objPlayer = getMissionHolder(self); - - int intMissionDifficulty = getIntObjVar(objMissionData, "intBountyDifficulty"); - String strEventName = ""; - if (intMissionDifficulty == 1) - { - strEventName = "EasyBountyMissionGranted"; - } - else - { - strEventName = "HardBountyMissionGranted"; - } - - dictionary dctParams = new dictionary(); - dctParams.put("eventName",strEventName); - messageTo(objPlayer, "handleHolocronEvent", dctParams, 0, false); - return SCRIPT_CONTINUE; - - } - - - public int bountyIncomplete(obj_id self, dictionary params) throws InterruptedException - { - obj_id objPlayer = getMissionHolder(self); - String strTitleString = MISSION_INCOMPLETE_PERSISTENT_MESSAGE; - obj_id objMissionData = getMissionData(self); - int intStringId = getIntObjVar(objMissionData, "intStringId"); - String strMessageString = "m"+intStringId+"d"; - string_id strMessage = new string_id(GENERIC_MISSION_MESSAGE_STRING_FILE, "incomplete"); - sendSystemMessage(objPlayer, strMessage); - sendMissionPersistentMessage(self, "incomplete"); - - if (hasObjVar(objMissionData, "jediBonusReward")) - { - missions.increaseBountyJediKillTracking(objPlayer, missions.ABORTS); - } - endMission(self); - return SCRIPT_CONTINUE; - } - - - public int bountyTimedOut(obj_id self, dictionary params) throws InterruptedException - { - obj_id objPlayer = getMissionHolder(self); - String strTitleString = MISSION_TIMED_OUT_PERSISTENT_MESSAGE; - obj_id objMissionData = getMissionData(self); - int intStringId = getIntObjVar(objMissionData, "intStringId"); - String strMessageString = "m"+intStringId+"d"; - string_id strMessage = new string_id(GENERIC_MISSION_MESSAGE_STRING_FILE, "timed_out"); - sendSystemMessage(objPlayer, strMessage); - sendMissionPersistentMessage(self, "timed_out"); - - if (hasObjVar(objMissionData, "jediBonusReward")) - { - missions.increaseBountyJediKillTracking(objPlayer, missions.TIMEOUTS); - } - endMission(self); - return SCRIPT_CONTINUE; - } - - - public int bountyFailure(obj_id self, dictionary params) throws InterruptedException - { - obj_id objPlayer = getMissionHolder(self); - string_id strMessage = new string_id(GENERIC_MISSION_MESSAGE_STRING_FILE, "failed"); - sendSystemMessage(objPlayer, strMessage); - - String strTitleString = MISSION_FAILURE_PERSISTENT_MESSAGE; - - obj_id objMissionData = getMissionData(self); - int intStringId = getIntObjVar(objMissionData, "intStringId"); - String strMessageString = "m"+intStringId+"d"; - - sendMissionPersistentMessage(self, "fail"); - - if (hasObjVar(objMissionData, "jediBonusReward")) - { - missions.increaseBountyJediKillTracking(objPlayer, missions.LOSSES); - } - endMission(self); - return SCRIPT_CONTINUE; - } - - - public int bountySuccess(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, "intCompleted")) - { - setObjVar(self, "intCompleted", 1); - obj_id objPlayer = getMissionHolder(self); - deliverReward(self); - playMusic(objPlayer, "sound/music_mission_complete.snd"); - endMission(self); - } - return SCRIPT_CONTINUE; - - } - - - public int OnEndMission(obj_id self, dictionary params) throws InterruptedException - { - - cleanupObjects(self); - debugServerConsoleMsg(self, "Ending mission"); - - cleanupLocationTargets(self); - debugServerConsoleMsg(self, "cleaned up locationt argets, getting objwaypoint objvars"); - obj_id objTargetWaypoint = getObjIdObjVar(self, "objTargetWaypoint"); - debugServerConsoleMsg(self, "got waypoint objvar"); - - if (objTargetWaypoint == null) - { - - debugServerConsoleMsg(self, "objTargetWaypoint ObjVar is null!"); - return SCRIPT_CONTINUE; - - } - debugServerConsoleMsg(self, "ObjTargetWaypoint is "+objTargetWaypoint); - setWaypointActive(objTargetWaypoint, false); - setWaypointVisible(objTargetWaypoint, false); - - destroyObject(objTargetWaypoint); - - return SCRIPT_CONTINUE; - } - - - public int findTarget(obj_id self, dictionary params) throws InterruptedException - { - - debugServerConsoleMsg(self, "Tracking target"); - dictionary dctParams = new dictionary(); - obj_id objPlayer = getMissionHolder(self); - setObjVar(self, "intTracking", 1); - - obj_id objDroid = params.getObjId("objDroid"); - int intDroidType = params.getInt("intDroidType"); - int intTrackType = params.getInt("intTrackType"); - location locCurrentLocation = getLocation(objPlayer); - String strHomePlanet = locCurrentLocation.area; - debugServerConsoleMsg(self, "strHomePlanet is "+strHomePlanet); - - obj_id objMissionData = getMissionData(self); - - int intTrackChance = getSkillStatMod(objPlayer, "droid_track_chance"); - int intFindChance = getSkillStatMod(objPlayer, "droid_find_chance"); - int intTracksLeft = getSkillStatMod(objPlayer, "droid_tracks"); - int intTrackSpeed = getSkillStatMod(objPlayer, "droid_track_speed"); - int intFindSpeed = getSkillStatMod(objPlayer, "droid_find_speed"); - - LOG("missions", "intTrackSpeed = "+intTrackSpeed); - LOG("missions", "intFindSpeed = "+intFindSpeed); - - location locPlayerLocation = getLocation(objPlayer); - - float fltDistance = 0; - - if (!hasObjVar(self, "objTarget")) - { - location locSpawnLocation = getLocationObjVar(self, "locSpawnLocation"); - - fltDistance = getDistance(locPlayerLocation, locSpawnLocation); - if (locPlayerLocation.area != locSpawnLocation.area) - { - fltDistance = fltDistance + 8000; - } - } - else - { - fltDistance = rand(5000, 15000); - } - - LOG("missions", "fltDistance is "+fltDistance); - - float fltBaseFindSpeed = fltDistance/150; - float fltBaseTrackSpeed = fltDistance/75; - LOG("missions", "base find speed is "+fltBaseFindSpeed); - LOG("missions", "base track speed is "+fltBaseTrackSpeed); - - fltBaseFindSpeed = fltBaseFindSpeed + BOUNTY_FIND_SPEED; - fltBaseTrackSpeed = fltBaseTrackSpeed + BOUNTY_TRACK_SPEED; - - LOG("missions", "base1 find speed is "+fltBaseFindSpeed); - LOG("missions", "base1 track speed is "+fltBaseTrackSpeed); - - fltBaseFindSpeed = fltBaseFindSpeed + rand(60, 180); - fltBaseTrackSpeed = fltBaseTrackSpeed + rand(60, 300); - - LOG("missions", "base2 find speed is "+fltBaseFindSpeed); - LOG("missions", "base2 track speed is "+fltBaseTrackSpeed); - - float fltTrackSpeed = (float)(intTrackSpeed); - float fltFindSpeed = (float)(intFindSpeed); - fltTrackSpeed = 1f - (fltTrackSpeed/ 100); - fltFindSpeed = 1f - (fltFindSpeed / 100); - - if (fltTrackSpeed <= 0) - { - fltTrackSpeed = .01f; - } - if (fltFindSpeed <= 0) - { - fltFindSpeed = .01f; - } - - fltTrackSpeed = fltBaseTrackSpeed* fltTrackSpeed; - fltFindSpeed = fltBaseFindSpeed* fltFindSpeed; - - if (fltTrackSpeed < 30) - { - fltTrackSpeed = 30.0f; - } - - if (fltFindSpeed < 60) - { - fltFindSpeed = 60.0f; - - } - - int intRoll = rand(1, 100); - - if (intTrackType == DROID_TRACK_TARGET) - { - debugServerConsoleMsg(self, "track type is DROID_TRACK_TARGER"); - - if (intRoll <= intFindChance) - { - if (intRoll <= intTrackChance) - { - - setObjVar(self, "intTracking", 1); - dctParams.put("intDroidType", intDroidType); - dctParams.put("strHomePlanet", locCurrentLocation.area); - dctParams.put("intTracksLeft", intTracksLeft); - dctParams.put("fltTrackSpeed", fltTrackSpeed); - dctParams.put("intTrackType", intTrackType); - messageTo(self, "probe_Droid_Response", dctParams, fltTrackSpeed, true); - - } - else - { - - setObjVar(self, "intTracking", 1); - dctParams.put("intDroidType", intDroidType); - dctParams.put("strHomePlanet", locCurrentLocation.area); - dctParams.put("intTracksLeft", 1); - dctParams.put("intTrackType", intTrackType); - messageTo(self, "probe_Droid_Response", dctParams, fltFindSpeed, true); - } - } - else - { - messageTo(self, "probe_Droid_Find_Fail", null, rand(0, 10), true); - return SCRIPT_CONTINUE; - - } - } - else if (intTrackType == DROID_FIND_TARGET) - { - - if (intRoll <= intFindChance) - { - debugServerConsoleMsg(self, "finding target at speed "+fltFindSpeed); - setObjVar(self, "intTracking", 1); - dctParams.put("intDroidType", intDroidType); - dctParams.put("strHomePlanet", locCurrentLocation.area); - dctParams.put("intTracksLeft", 1); - dctParams.put("intTrackType", intTrackType); - messageTo(self, "probe_Droid_Response", dctParams, fltFindSpeed, true); - - } - else - { - messageTo(self, "probe_Droid_Find_Fail", null, rand(0, 10), true); - return SCRIPT_CONTINUE; - - } - } - - return SCRIPT_CONTINUE; - } - - - public int probe_Droid_Find_Fail(obj_id self, dictionary params) throws InterruptedException - { - string_id strSpam = new string_id("mission/mission_generic", "target_not_found_"+rand(1,6)); - sendSystemMessage(getMissionHolder(self), strSpam); - removeObjVar(self, "intTracking"); - return SCRIPT_CONTINUE; - } - - - public int probe_Droid_Track_Lost(obj_id self, dictionary params) throws InterruptedException - { - string_id strSpam = new string_id("mission/mission_generic", "target_track_lost"); - sendSystemMessage(getMissionHolder(self), strSpam); - return SCRIPT_CONTINUE; - } - - - public int probe_Droid_Response(obj_id self, dictionary params) throws InterruptedException - { - - dictionary dctParams = new dictionary(); - obj_id objMissionData = getMissionData(self); - obj_id objPlayer = getMissionHolder(self); - String strHomePlanet = params.getString("strHomePlanet"); - - int intTracksLeft = params.getInt("intTracksLeft"); - intTracksLeft = intTracksLeft - 1; - if (intTracksLeft < 0) - { - - debugServerConsoleMsg(self, "intTracksLeft is "+intTracksLeft); - removeObjVar(self, "intTracking"); - messageTo(self, "probe_Droid_Track_Lost", dctParams, rand(10, 20), false); - return SCRIPT_CONTINUE; - } - - boolean canBeResolved = true; - if (strHomePlanet != null && strHomePlanet.equals("dungeon1")) - { - string_id strSpam = new string_id("mission/mission_generic", "out_in_space"); - sendSystemMessage(objPlayer, strSpam); - removeObjVar(self, "intTracking"); - messageTo(self, "probe_Droid_Track_Lost", dctParams, rand(10, 20), false); - return SCRIPT_CONTINUE; - } - - location locSpawnLocation = new location(); - obj_id objTarget = null; - - if (hasObjVar(objMissionData, "objTarget")) - { - - objTarget = getObjIdObjVar(objMissionData, "objTarget"); - if (objTarget == null) - { - CustomerServiceLog("BountyHunter", "Lost target for hunter %TU", self); - removeObjVar(self, "intTracking"); - messageTo(self, "probe_Droid_Track_Lost", dctParams, rand(10, 20), false); - return SCRIPT_CONTINUE; - } - - location tmpLocation = getLocation(objTarget); - if (tmpLocation != null) - { - obj_id topmost = getTopMostContainer(objTarget); - if (topmost != null) - { - tmpLocation = getLocation(topmost); - } - locSpawnLocation = (location)tmpLocation.clone(); - } - else - { - canBeResolved = false; - dictionary dctJediInfo = requestJedi(objTarget); - if (dctJediInfo == null) - { - - string_id strSpam = new string_id("mission/mission_generic", "jedi_not_online"); - sendSystemMessage(objPlayer, strSpam); - removeObjVar(self, "intTracking"); - messageTo(self, "probe_Droid_Track_Lost", dctParams, rand(10, 20), false); - return SCRIPT_CONTINUE; - } - - boolean boolOnline = dctJediInfo.getBoolean("online"); - if (boolOnline) - { - locSpawnLocation = dctJediInfo.getLocation("location"); - if (locSpawnLocation == null) - { - CustomerServiceLog("BountyHunter", "Got null location from Jedi manager for Jedi %TT hunted by %TU", self, objTarget); - removeObjVar(self, "intTracking"); - messageTo(self, "probe_Droid_Track_Lost", dctParams, rand(10, 20), false); - return SCRIPT_CONTINUE; - } - } - else - { - - string_id strSpam = new string_id("mission/mission_generic", "jedi_not_online"); - sendSystemMessage(objPlayer, strSpam); - removeObjVar(self, "intTracking"); - messageTo(self, "probe_Droid_Track_Lost", dctParams, rand(10, 20), false); - return SCRIPT_CONTINUE; - } - } - } - else if (hasObjVar(objMissionData, "intTargetCreated")) - { - locSpawnLocation = getMissionStartLocation(objMissionData); - - } - else - { - locSpawnLocation = getLocationObjVar(self, "locSpawnLocation"); - } - - float fltTrackSpeed = params.getFloat("fltTrackSpeed"); - - fltTrackSpeed = fltTrackSpeed / 4; - params.put("intTracksLeft", intTracksLeft); - - int intDroidType = params.getInt("intDroidType"); - - boolean sendProbotResponse = false; - boolean sendSeekerResponse = false; - boolean booleanCoverState = params.getBoolean("booleanCoverState"); - - if (toLower(locSpawnLocation.area).startsWith("kashyyyk") && intDroidType == DROID_PROBOT) - { - sendSystemMessage(objPlayer, new string_id("mission/mission_generic", "no_seek_kashyyyk")); - removeObjVar(self, "intTracking"); - return SCRIPT_CONTINUE; - } - - if (toLower(locSpawnLocation.area).startsWith("mustafar") && intDroidType == DROID_PROBOT) - { - sendSystemMessage(objPlayer, new string_id("mission/mission_generic", "no_seek_mustafar")); - removeObjVar(self, "intTracking"); - return SCRIPT_CONTINUE; - } - - if (!locSpawnLocation.area.equals(strHomePlanet)) - { - if (intDroidType == DROID_PROBOT) - { - sendProbotResponse = true; - } - else - { - string_id strSpam = new string_id("mission/mission_generic", "target_not_on_planet"); - sendSystemMessage(objPlayer, strSpam); - removeObjVar(self, "intTracking"); - return SCRIPT_CONTINUE; - } - } - else if (canBeResolved) - { - if (intDroidType == DROID_PROBOT) - { - sendProbotResponse = true; - } - else - { - sendSeekerResponse = true; - } - } - else if (objTarget != null) - { - findObjectAnywhere(objTarget, self); - messageTo(self, "probe_Droid_Response", params, fltTrackSpeed, true); - } - else - { - CustomerServiceLog("BountyHunter", "Could not acquire target for hunter %TU", self); - removeObjVar(self, "intTracking"); - messageTo(self, "probe_Droid_Track_Lost", dctParams, rand(10, 20), false); - return SCRIPT_CONTINUE; - } - - if (sendProbotResponse) - { - updateMissionWaypoint(self, locSpawnLocation); - string_id strSpam = new string_id("mission/mission_generic", "target_location_updated"); - sendSystemMessage(objPlayer, strSpam); - String strTargetLocation = "target_located_"+ locSpawnLocation.area; - strSpam = new string_id("mission/mission_generic", strTargetLocation); - sendSystemMessage(objPlayer, strSpam); - - messageTo(self, "probe_Droid_Response", params, fltTrackSpeed, true); - } - else if (sendSeekerResponse) - { - if (isIdValid(objTarget) && (stealth.hasServerCoverState(objTarget) || stealth.hasInvisibleBuff(objTarget))) - { - sendSystemMessage(objPlayer, new string_id("mission/mission_generic", "target_location_stealth")); - } - else - { - int intTrackType = params.getInt("intTrackType"); - - updateMissionWaypoint(self, locSpawnLocation); - string_id strSpam = new string_id("mission/mission_generic", "target_location_updated"); - sendSystemMessage(objPlayer, strSpam); - - if (intTrackType == DROID_TRACK_TARGET) - { - if (intTracksLeft > 0) - { - strSpam =new string_id( "mission/mission_generic", "target_continue_tracking"); - sendSystemMessage(objPlayer, strSpam); - } - } - else if (intTrackType == DROID_FIND_TARGET) - { - if (hasObjVar(objMissionData, "strTargetName")) - { - String msg = utils.packStringId(new string_id("mission/mission_generic", "seeker_droid_seek_target")); - msg += " "+getStringObjVar(objMissionData, "strTargetName"); - sendSystemMessage(objPlayer, msg, null); - } - } - } - - messageTo(self, "probe_Droid_Response", params, fltTrackSpeed, true); - } - return SCRIPT_CONTINUE; - } - - - public int foundObject(obj_id self, dictionary params) throws InterruptedException - { - String sceneId = params.getString("scene"); - location loc = params.getLocation("location"); - loc.area = sceneId; - obj_id objPlayer = getMissionHolder(self); - - updateMissionWaypoint(self, loc); - string_id strSpam = new string_id("mission/mission_generic", "target_location_updated"); - sendSystemMessage(objPlayer, strSpam); - strSpam =new string_id( "mission/mission_generic", "target_continue_tracking"); - sendSystemMessage(objPlayer, strSpam); - return SCRIPT_CONTINUE; - } - - - public int moveTarget(obj_id self, dictionary params) throws InterruptedException - { - int sequence = utils.getIntScriptVar(self, "moveTargetSequence"); - if (params.getInt("moveTargetSequence") != sequence) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "intTargetSpawned")) - { - return SCRIPT_CONTINUE; - } - - debugServerConsoleMsg(self, "Moving Target"); - - final int MOVEMENT_RATE_PER_SECOND = 1; - final int MOVEMENT_RATE_MIN_CALLBACK = 40; - final int MOVEMENT_RATE_MAX_CALLBACK = 75; - int intDelay = rand(MOVEMENT_RATE_MIN_CALLBACK, MOVEMENT_RATE_MAX_CALLBACK); - - obj_id objMissionData = getMissionData(self); - int intMissionDifficulty = getIntObjVar(objMissionData, "intBountyDifficulty"); - float fltMovementRate = MOVEMENT_RATE_PER_SECOND + intMissionDifficulty; - float fltOffPlanetChance = intMissionDifficulty * 10; - if (hasObjVar(self, "intMovedOffPlanet")) - { - fltOffPlanetChance = 0; - } - if (fltMovementRate > 4) - { - fltMovementRate = 4; - } - - float fltDelay; - - location locSpawnLocation = getLocationObjVar(self, "locSpawnLocation"); - - if (!hasObjVar(self, "locDestination")) - { - - int intRoll = rand(1,100); - if ((intRoll < fltOffPlanetChance)&&(hasStarPort(locSpawnLocation))) - { - - String strNewPlanet = PLANETS[rand(0, PLANETS.length-1)]; - location locDestination = locations.getBountyLocation(strNewPlanet); - setObjVar(self, "locSpawnLocation", locDestination); - setObjVar(self, "intMovedOffPlanet", 1); - fltDelay = rand(100, 300); - } - else - { - location locDestination = locations.getBountyLocation(locSpawnLocation.area); - setObjVar(self, "locDestination", locDestination); - fltDelay = rand(300, 900); - } - } - else - { - location locDestination = getLocationObjVar(self, "locDestination"); - - float fltDistance = 0; - float fltTime = params.getFloat("fltTime"); - - fltDistance = fltMovementRate * fltTime; - locSpawnLocation = locations.moveLocationTowardsLocation(locSpawnLocation, locDestination, fltDistance); - setObjVar(self, "locSpawnLocation", locSpawnLocation); - - fltDistance = getDistance(locDestination, locSpawnLocation); - if (fltDistance < 128) - { - setObjVar(self, "locSpawnLocation", locDestination); - locSpawnLocation = (location)locDestination.clone(); - removeObjVar(self, "locDestination"); - } - setupSpawn(self, locSpawnLocation); - fltDelay = rand(MOVEMENT_RATE_MIN_CALLBACK, MOVEMENT_RATE_MAX_CALLBACK); - } - - dictionary dctParams = new dictionary(); - dctParams.put("fltTime", fltDelay); - - sequence = sequence + 1; - utils.setScriptVar(self, "moveTargetSequence", sequence); - dctParams.put("moveTargetSequence", sequence); - messageTo(self, "moveTarget", dctParams, fltDelay, false); - - return SCRIPT_CONTINUE; - } - - - public int stopTracking(obj_id self, dictionary params) throws InterruptedException - { - removeObjVar(self, "intTracking"); - return SCRIPT_CONTINUE; - - } - - - public int halfwayNotification(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - obj_id objPlayer = params.getObjId("objPlayer"); - - string_id strSpam = new string_id("mission/mission_generic", "seeker_droid_standby"); - sendSystemMessage(objPlayer, strSpam); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/mission_deliver_npc.java b/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/mission_deliver_npc.java deleted file mode 100644 index 770194d42..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/missions/dynamic/mission_deliver_npc.java +++ /dev/null @@ -1,349 +0,0 @@ -package script.systems.missions.dynamic; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.ai_lib; -import script.library.chat; -import script.library.factions; -import script.library.anims; -import script.library.missions; - - - -public class mission_deliver_npc extends script.systems.missions.base.mission_dynamic_base -{ - public mission_deliver_npc() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - attachScript(self, "npc.converse.npc_converse_menu"); - debugServerConsoleMsg(self, "deliver dropoff script attached"); - factions.setFaction(self, "Unattackable"); - ai_lib.setDefaultCalmBehavior(self, ai_lib.BEHAVIOR_SENTINEL); - clearCondition(self, CONDITION_HOLIDAY_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (!hasScript (self, "systems.missions.base.mission_cleanup_tracker")) - { - attachScript (self, "systems.missions.base.mission_cleanup_tracker"); - } - clearCondition(self, CONDITION_HOLIDAY_INTERESTING); - return SCRIPT_CONTINUE; - } - - - public int OnStartNpcConversation(obj_id self, obj_id speaker) throws InterruptedException - { - boolean boolDebug = false; - if (hasObjVar(speaker, "verboseDebug")) - { - boolDebug = true; - } - location here = getLocation (self); - obj_id[] missionList = getMissionObjects (speaker); - obj_id missionInfo = null; - location missionLoc = new location(); - - if (missionList == null) - { - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "Error 1, Mission list is null"); - } - doIncorrectPlayerBlurb(self); - return SCRIPT_CONTINUE; - } - - int numMissions = missionList.length; - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "NumMission is "+numMissions); - } - - if (numMissions == 1) - { - obj_id onlyMission = missionList[0]; - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "Since we're one, onlyMission is "+onlyMission); - } - - int missionState = getIntObjVar(onlyMission, "intState"); - if (missionState == missions.STATE_DYNAMIC_PICKUP) - { - - missionLoc = getMissionStartLocation (onlyMission); - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "State is pickup, using start location of value "+missionLoc); - } - - } - else if (missionState == missions.STATE_DYNAMIC_DROPOFF) - { - missionLoc = getMissionEndLocation (onlyMission); - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "State is dropoff, using end location of value "+missionLoc); - } - } - else - { - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "Fucked up missions, no nothing"); - } - - debugServerConsoleMsg (speaker, "IT's all messed up, the mission State was totally wrong"); - return SCRIPT_CONTINUE; - } - - float dist = utils.getDistance2D (here, missionLoc); - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "using here as test value. Here is "+here); - } - - if ((dist > 15.0f) || (dist < 0)) - { - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "Distance is "+dist+" and erroring out"); - } - - doIncorrectPlayerBlurb(self); - return SCRIPT_CONTINUE; - } - missionInfo = onlyMission; - } - else if (numMissions == 2) - { - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "numMissions is 2, doing a loop"); - } - boolean rightSpot = false; - for (int x = 0; x < numMissions; x ++) - { - testAbortScript(); - - obj_id thisMission = missionList[x]; - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "Iterating, x is "+x+ " and misison si "+thisMission); - } - - int currentState = getIntObjVar (thisMission, "intState"); - - if (currentState == missions.STATE_DYNAMIC_PICKUP) - { - missionLoc = getMissionStartLocation (thisMission); - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "State is pickup, using start location of value "+missionLoc); - } - } - else if (currentState == missions.STATE_DYNAMIC_DROPOFF) - { - missionLoc = getMissionEndLocation (thisMission); - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "State is dropoff, using end location of value "+missionLoc); - } - } - - float dist2 = utils.getDistance2D (here, missionLoc); - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "dist2 is "+dist2); - sendSystemMessageTestingOnly(speaker, "Location 1(here) is "+here); - sendSystemMessageTestingOnly(speaker, "Location 2(missionLoc) is "+missionLoc); - } - - if ((dist2 < 15.0f) && (dist2 >= 0)) - { - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "Distance 2 is "+dist2+" and setting rightspot to true"); - } - - rightSpot = true; - setObjVar (self, "startLoc"+ x, missionLoc); - missionInfo = thisMission; - } - } - - if (rightSpot != true) - { - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "rightSpot is false after our loop, erroring out"); - } - - doIncorrectPlayerBlurb (self); - return SCRIPT_CONTINUE; - } - - if (hasObjVar (self, "startLoc1") && hasObjVar (self, "startLoc2")) - { - - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "sameSpot check"); - } - - location one = getLocationObjVar (self, "startLoc1"); - location two = getLocationObjVar (self, "startLoc2"); - if (one.equals(two)) - { - if (boolDebug) - { - sendSystemMessageTestingOnly(speaker, "sameSpot is true"); - } - boolean sameSpot = true; - } - } - } - - int intState = getIntObjVar(missionInfo, "intState"); - - if (intState == missions.STATE_DYNAMIC_DROPOFF) - { - String missionType = getMissionType (missionInfo); - obj_id objMissionData = getMissionData(missionInfo); - int intStringId = getIntObjVar(objMissionData, "intStringId"); - String strIdFileName = getStringObjVar(objMissionData, "strIdFileName"); - string_id strConvo = new string_id(strIdFileName, "m"+intStringId+"r"); - - if (missionType.equals("deliver")) - { - - setObjVar(objMissionData, "strIdFileName", strIdFileName); - chat.chat(self, strConvo); - - dictionary dctParams = new dictionary(); - messageTo(missionInfo, "pickup_event", dctParams, 0, true); - sendDeliverSuccess(missionInfo); - } - else if (missionType.equals("crafting")) - { - String strItemToMake = getStringObjVar(objMissionData, "strItemToMake"); - if (hasCraftingMissionItem(speaker, strItemToMake)) - { - revokeMissionSchematic(speaker, missionInfo); - setObjVar(objMissionData, "strIdFileName", strIdFileName); - - String strSpeakString = getString(strConvo); - chat.chat(self, strSpeakString); - - dictionary dctParams = new dictionary(); - sendCraftingSuccess(missionInfo); - return SCRIPT_OVERRIDE; - } - else - { - string_id strSpam = new string_id("mission/mission_generic", "wrong_item"); - chat.chat(self, strSpam); - return SCRIPT_CONTINUE; - } - } - else - { - string_id message = new string_id ("mission/mission_generic", "crafting_already_dropped_off"); - chat.chat(self, message); - doAnimationAction(self, anims.PLAYER_WAVE_ON_DISMISSING); - } - } - - else if (intState == missions.STATE_DYNAMIC_PICKUP) - { - String missionType = getMissionType (missionInfo); - if (missionType.equals("deliver")) - { - obj_id objMissionData = getMissionData(missionInfo); - int intStringId = getIntObjVar(objMissionData, "intStringId"); - String strIdFileName = getStringObjVar(objMissionData, "strIdFileName"); - string_id strConvo = new string_id(strIdFileName, "m"+intStringId+"p"); - setObjVar(objMissionData, "strIdFileName", strIdFileName); - chat.chat(self, strConvo); - - string_id strTitleId = new string_id("mission/mission_generic", "deliver_received_data"); - string_id strMissionTitleId = new string_id(strIdFileName, "m"+intStringId+"t"); - String strMissionTitle = getString(strMissionTitleId); - String strSystemMessage = getString(strTitleId); - strSystemMessage = strSystemMessage + " "+strMissionTitle; - sendSystemMessageTestingOnly(speaker, strSystemMessage); - - dictionary dctParams = new dictionary(); - messageTo(missionInfo, "pickup_event", dctParams, 0, true); - - setObjVar(missionInfo, "intState", missions.STATE_DYNAMIC_DROPOFF); - location locDropoffLocation = getMissionEndLocation(objMissionData); - - debugServerConsoleMsg(self, "objMissionData for npc pickup is "+objMissionData); - - if (hasObjVar(objMissionData, "objEndNPC")) - { - setObjVar(missionInfo, "intMissionComplete", 1); - } - else - { - setupSpawn(missionInfo, locDropoffLocation); - } - updateMissionWaypoint(missionInfo, locDropoffLocation); - } - if (missionType.equals("crafting")) - { - grantMissionSchematic(speaker, missionInfo); - obj_id missionInfoData = getMissionData(missionInfo); - String[] strComponents = getStringArrayObjVar(missionInfoData, "strComponents"); - int intI = 0; - obj_id objInventory = utils.getInventoryContainer(speaker); - while (intI < strComponents.length) - { - testAbortScript(); - obj_id objComponent = createObjectOverloaded(strComponents[intI], objInventory); - setCraftedId(objComponent, objComponent); - intI = intI+1; - - } - setObjVar(missionInfo, "intState", missions.STATE_DYNAMIC_DROPOFF); - int intStringId = getIntObjVar(missionInfoData, "intStringId"); - String strIdFileName = getStringObjVar(missionInfoData, "strIdFileName"); - string_id strConvo = new string_id(strIdFileName, "m"+intStringId+"p"); - setObjVar(missionInfoData, "strIdFileName", strIdFileName); - String strSpeakString = getString(strConvo); - chat.chat(self, strSpeakString); - string_id strSpam = new string_id("mission/mission_generic", "crafting_components_received"); - sendSystemMessage(speaker, strSpam); - dictionary dctParams = new dictionary(); - messageTo(missionInfo, "pickup_event", null, 0, true); - location locDropoffLocation = getMissionEndLocation(missionInfoData); - setupSpawn(missionInfo, locDropoffLocation); - updateMissionWaypoint(missionInfo, locDropoffLocation); - } - } - else - { - string_id message = new string_id ("mission/mission_generic", "deliver_already_dropped_off"); - chat.chat(self, message); - doAnimationAction(self, anims.PLAYER_WAVE_ON_DISMISSING); - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/npc_lair/lair_interactivity.java b/sku.0/sys.server/compiled/game/script/systems/npc_lair/lair_interactivity.java deleted file mode 100644 index fcf2ab4be..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/npc_lair/lair_interactivity.java +++ /dev/null @@ -1,144 +0,0 @@ -package script.systems.npc_lair; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.buff; -import script.library.utils; -import script.library.resource; - - -public class lair_interactivity extends script.base_script -{ - public lair_interactivity() - { - } - public static final String LAIR_SEARCHED = "lair.searched"; - public static final int LAIR_BUFF_INCREASE = 2; - - public static final string_id SID_SEARCH_LAIR = new string_id("lair_n", "search_lair"); - public static final string_id SID_FOUND_NOTHING = new string_id("lair_n", "found_nothing"); - public static final string_id SID_INVENTORY_FULL = new string_id("lair_n", "inventory_full"); - public static final string_id SID_FOUND_EGGS = new string_id("lair_n", "found_eggs"); - public static final string_id SID_FOUND_BUGS = new string_id("lair_n", "found_bugs"); - - public static final String[] BUG_SAMPLE_OBJECTS = - { - "object/tangible/bug_jar/sample_bats.iff", - "object/tangible/bug_jar/sample_bees.iff", - "object/tangible/bug_jar/sample_butterflies.iff", - "object/tangible/bug_jar/sample_flies.iff", - "object/tangible/bug_jar/sample_glowzees.iff", - "object/tangible/bug_jar/sample_moths.iff" - }; - - public static final String[] RARE_BUG_SAMPLE_OBJECTS = - { - "object/tangible/fishing/bait/bait_grub.iff", - "object/tangible/fishing/bait/bait_worm.iff", - "object/tangible/fishing/bait/bait_insect.iff" - }; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - if (!hasObjVar( self, "npc_lair.isCreatureLair" )) - { - detachScript( self, "systems.npc_lair.lair_interactivity"); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int searchLair(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId( "player"); - searchLair(self, player); - return SCRIPT_CONTINUE; - } - - - public void searchLair(obj_id self, obj_id player) throws InterruptedException - { - - if (utils.hasScriptVar( self, LAIR_SEARCHED )) - { - return; - } - - int searchagain = rand(0,2); - - if (searchagain == 0) - { - utils.setScriptVar( self, LAIR_SEARCHED, 1 ); - } - - obj_id pInv = utils.getInventoryContainer( player ); - if (!isIdValid( pInv )) - { - return; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessage(player, SID_INVENTORY_FULL); - return; - } - - int searchRoll = rand( 1, 100 ); - if (searchRoll < 10) - { - - sendSystemMessage( player, SID_FOUND_NOTHING ); - } - else if (searchRoll < 90) - { - - sendSystemMessage( player, SID_FOUND_EGGS ); - - int amt = rand( 10, 20 ); - - if (buff.hasBuff(player, "lair_egg_buff")) - { - amt = amt * LAIR_BUFF_INCREASE; - } - - resource.createRandom( "meat_egg_"+getCurrentSceneName(), amt, getLocation(self), pInv, player, 2 ); - } - else - { - - sendSystemMessage( player, SID_FOUND_BUGS ); - - if (rand(1, 100) < 50) - { - createObject(RARE_BUG_SAMPLE_OBJECTS[rand(0,RARE_BUG_SAMPLE_OBJECTS.length-1)], pInv, ""); - } - else - { - createObject(BUG_SAMPLE_OBJECTS[rand(0,BUG_SAMPLE_OBJECTS.length-1)], pInv, ""); - } - - } - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/npc_lair/npc_lair.java b/sku.0/sys.server/compiled/game/script/systems/npc_lair/npc_lair.java deleted file mode 100644 index 15881e0a1..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/npc_lair/npc_lair.java +++ /dev/null @@ -1,1526 +0,0 @@ -package script.systems.npc_lair; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.create; -import script.library.utils; -import script.library.ai_lib; -import script.ai.ai_combat; -import script.library.factions; -import script.library.xp; - - - -public class npc_lair extends script.theme_park.poi.base -{ - public npc_lair() - { - } - public static final String TERMINAL_LOGGING = "lair_attack"; - public static final boolean LOGGING_ON = true; - - public static final String CREATURE_TABLE = "datatables/mob/creatures.iff"; - public static final int MAX_ITERATIONS = 5; - public static final int MIN_NON_DIFFICULTY_CREATURES = 2; - public static final int MAX_NON_DIFFICULTY_CREATURES = 5; - public static final int MAX_LAIR_HEALTH = 850000; - - public static final float CREATURE_LAIR_EXCHANGE = 0.25f; - - - public int OnAttach(obj_id self) throws InterruptedException - { - location locTest = getLocation(self); - float fltHeight = getHeightAtLocation(locTest.x, locTest.z); - - if (fltHeight != locTest.y) - { - locTest.y = fltHeight; - setLocation(self, locTest); - - } - - String strLairType = getStringObjVar(self, "spawning.lairType"); - - if (strLairType == null) - { - LOG("DESIGNER_FATAL", "Object "+ self + " at "+ getLocation(self) + " has no lairType objvar. Please fix ASAP"); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - int intIndex = strLairType.indexOf("theater"); - - if (intIndex > -1) - { - if (!hasObjVar(self, "intTheaterCheck")) - { - int intRoll = rand(1, 2); - - if (intRoll < 75) - { - setObjVar(self, "intNoTheaters", 1); - setObjVar(self, "spawning.buildingType", "none"); - } - - setObjVar(self, "intTheaterCheck", 1); - } - } - - if (hasObjVar(self, "npc_lair.target")) - { - removeObjVar(self, "npc_lair.target"); - } - - initializePoi(self); - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - initializePoi(self); - return SCRIPT_CONTINUE; - } - - - public void initializePoi(obj_id poiBaseObject) throws InterruptedException - { - obj_id self = getSelf(); - - if (hasObjVar(self, "npc_lair.numberOfMobiles")) - { - int numRespawned = getIntObjVar(self, "npc_lair.numRespawned"); - int population = getIntObjVar(self, "npc_lair.numberOfMobiles"); - - if (numRespawned >= (population * 3)) - { - if (!poiIsCompleted(self)) - { - poiComplete(self); - } - - destroyObject(self); - - return; - } - } - - String diff = getStringObjVar(poiBaseObject, "spawning.lairDifficulty"); - int lairLevel = getIntObjVar(poiBaseObject, "spawning.intDifficultyLevel"); - int groupSize = getIntObjVar(poiBaseObject, "spawning.groupSize"); - String lairType = getStringObjVar(poiBaseObject, "spawning.lairType"); - String lairDatatable = "datatables/npc_lair/"+ lairType + ".iff"; - - if (!dataTableOpen(lairDatatable)) - { - destroyObject(self); - return; - } - - PROFILER_START("npc_lair.script.initializePoi."+ lairType); - - String strFaction = utils.getFactionSubString(lairType); - - if (strFaction != null) - { - setObjVar(poiBaseObject, factions.FACTION, strFaction); - } - - dictionary dctParams = new dictionary(); - - dctParams.put("lairType", lairType); - dctParams.put("diff", diff); - messageTo(poiBaseObject, "doTheater", dctParams, 1, false); - - dctParams = new dictionary(); - dctParams.put("lairType", lairType); - dctParams.put("lairLevel", lairLevel); - dctParams.put("groupSize", groupSize); - - if (lairType.equals("") || lairLevel < 1) - { - LOG("designer_fatal", "Failed spawning lairType "+ lairType + " at level "+ lairLevel); - destroyObject(self); - return; - } - - messageTo(poiBaseObject, "makeSomeMobiles", dctParams, 4, false); - - messageTo(poiBaseObject, "handleNpcAiManagement", null, 20, false); - PROFILER_STOP("npc_lair.script.initializePoi."+ lairType); - } - - - public int doTheater(obj_id self, dictionary params) throws InterruptedException - { - String lairType = params.getString("lairType"); - String diff = params.getString("diff"); - - createTheater(self, lairType, diff); - return SCRIPT_CONTINUE; - } - - - public int makeSomeMobiles(obj_id self, dictionary params) throws InterruptedException - { - String lairType = params.getString("lairType"); - int lairLevel = params.getInt("lairLevel"); - int groupSize = params.getInt("groupSize"); - - if (groupSize < 1) - { - groupSize = 2; - } - spawnNpcLairMobiles(self, lairType, lairLevel, groupSize); - return SCRIPT_CONTINUE; - } - - - public void flagCreatureLairs(obj_id poiBaseObject) throws InterruptedException - { - PROFILER_START("npc_lair.flagCreatureLairs"); - - if (hasObjVar(poiBaseObject, "npc_lair.isNotCreatureLair")) - { - PROFILER_STOP("npc_lair.flagCreatureLairs"); - return; - } - - obj_id target = getObjIdObjVar(poiBaseObject, "npc_lair.target"); - - if (isIdValid(target)) - { - setObjVar(poiBaseObject, "npc_lair.isCreatureLair", true); - setObjVar(target, "npc_lair.isCreatureLair", true); - setYaw(target, rand(0.0f, 360.0f)); - } - - PROFILER_STOP("npc_lair.flagCreatureLairs"); - } - - - public int handleTargetDestroyed(obj_id self, dictionary params) throws InterruptedException - { - poiComplete(POI_SUCCESS); - return SCRIPT_CONTINUE; - } - - - public int handleTheaterComplete(obj_id self, dictionary params) throws InterruptedException - { - PROFILER_START("npc_lair.handleTheaterComplete.Start"); - obj_id objTheater = params.getObjId("master"); - - if (!isIdValid(objTheater)) - { - - PROFILER_STOP("npc_lair.handleTheaterComplete.Start"); - return SCRIPT_CONTINUE; - } - - PROFILER_START("npc_lair.handleTheaterComplete.ObjVars"); - setObjVar(self, "theater.objTheater", objTheater); - PROFILER_STOP("npc_lair.handleTheaterComplete.Start"); - - return SCRIPT_CONTINUE; - } - - - public void createTheater(obj_id poiBaseObject, String lairType, String diff) throws InterruptedException - { - - PROFILER_START("npc_lair.script.createTheatre"); - - String buildingToSpawn = null; - - if (hasObjVar(poiBaseObject, "spawning.buildingType")) - { - buildingToSpawn = getStringObjVar(poiBaseObject, "spawning.buildingType"); - } - else - { - String lairDatatable = "datatables/npc_lair/"+ lairType + ".iff"; - - String[] buildings = dataTableGetStringColumnNoDefaults(lairDatatable, diff); - - if (buildings == null) - { - PROFILER_STOP("npc_lair.script.createTheatre"); - return; - } - if (buildings.length == 0) - { - PROFILER_STOP("npc_lair.script.createTheatre"); - return; - } - - buildingToSpawn = buildings[rand(0, buildings.length - 1)]; - setObjVar(poiBaseObject, "spawning.buildingType", buildingToSpawn); - } - - if (buildingToSpawn.startsWith("object/building/poi")) - { - buildingToSpawn = "none"; - } - if (buildingToSpawn.startsWith("object/static/structure/naboo/gungan_relic_s01.iff")) - { - buildingToSpawn = "none"; - } - - if (!buildingToSpawn.equals("none")) - { - obj_id mainBuilding = poiCreateObject(buildingToSpawn, 0f, 0f); - int intIndex = lairType.indexOf("theater"); - - if (intIndex < 0) - { - if (isIdValid(mainBuilding)) - { - poiSetDestroyMessage(mainBuilding, "handleBuildingDestruction", 1); - setYaw(mainBuilding, rand(0.0f, 360.0f)); - setObjVar(poiBaseObject, "npc_lair.target", mainBuilding); - setHpAndXpValues(poiBaseObject, mainBuilding); - } - } - else - { - setObjVar(poiBaseObject, "theater.objTheater", mainBuilding); - } - } - - PROFILER_STOP("npc_lair.script.createTheatre"); - } - - - public int handleBuildingDestruction(obj_id self, dictionary params) throws InterruptedException - { - setObjVar(self, "npc_lair.buildingType", "none"); - poiComplete(POI_SUCCESS); - return SCRIPT_CONTINUE; - } - - - public float getAverageDifficulty(float[] fltDifficulties) throws InterruptedException - { - float fltAverage = 0; - - for (int intI = 0; intI < fltDifficulties.length; intI++) - { - testAbortScript(); - fltAverage = fltAverage + fltDifficulties[intI]; - } - fltAverage = fltAverage / fltDifficulties.length; - return fltAverage; - - } - - - public float getMaxDifficulty(float[] fltDifficulties) throws InterruptedException - { - float fltMaxDifficulty = 0; - - for (int intI = 0; intI < fltDifficulties.length; intI++) - { - testAbortScript(); - if (fltDifficulties[intI] > fltMaxDifficulty) - { - fltMaxDifficulty = fltDifficulties[intI]; - } - } - - return fltMaxDifficulty; - } - - - public void spawnNpcLairMobiles(obj_id poiBaseObject, String lairType, int lairLevel, int groupSize) throws InterruptedException - { - PROFILER_START("npc_lair.spawnNpcLairMobiles.setup"); - - if (utils.hasScriptVar(poiBaseObject, "npc_lair.mobile.0")) - { - respawnAllMobiles(poiBaseObject); - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.setup"); - return; - } - - String lairDatatable = "datatables/npc_lair/"+ lairType + ".iff"; - String[] creatureList = dataTableGetStringColumnNoDefaults(lairDatatable, "mobiles"); - - if (creatureList == null) - { - LOG("DESIGNER_FATAL", "WARNING: "+ lairDatatable + " has no mobiles column."); - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.setup"); - destroyObject(getSelf()); - return; - } - - int[] spawnLimit = getSpawnLimit(lairDatatable, creatureList); - - if (spawnLimit == null) - { - debugServerConsoleMsg(null, "WARNING: "+ lairDatatable + " has no spawn Limit"); - LOG("DESIGNER_FATAL", "WARNING: "+ lairDatatable + " has no spawn Limit"); - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.setup"); - destroyObject(getSelf()); - return; - } - - dictionary[] dctCreatureInfo = new dictionary[creatureList.length]; - - for (int intI = 0; intI < creatureList.length; intI++) - { - testAbortScript(); - dctCreatureInfo[intI] = dataTableGetRow(CREATURE_TABLE, creatureList[intI]); - - if (dctCreatureInfo[intI] == null) - { - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.setup"); - LOG("DESIGNER_FATAL", "For lairType "+ lairType + " and creature "+ creatureList[intI] + " there is no creatures.tab entry!"); - destroyObject(getSelf()); - return; - } - } - - int[] numSpawned = new int[creatureList.length]; - - int mobileNumber = 0; - int intI = 0; - - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.setup"); - - int creatureListLength = creatureList.length; - - if (creatureListLength != spawnLimit.length || creatureListLength != numSpawned.length) - { - LOG("DESIGNER_FATAL", "Mis aligned arrays for lair type "+ lairType); - destroyObject(getSelf()); - return; - } - - PROFILER_START("npc_lair.spawnNpcLairMobiles.makeMobs"); - - int intArrayLength = creatureList.length - 1; - - if (intArrayLength < 0) - { - intArrayLength = 0; - } - - int xpValue = 0; - int hpValue = 1500; - - int minSpawn = (int) ((groupSize * 1.5f) + 0.5f); - int maxSpawn = (int) ((groupSize * 2.5f) + 0.5f); - int spawnAmount = rand(minSpawn, maxSpawn); - - for (int intTotalCount = 0; intTotalCount < spawnAmount; intTotalCount++) - { - testAbortScript(); - PROFILER_START("npc_lair.spawnNpcLairMobiles.makeMobs.innerLoop"); - - if (intArrayLength < 0) - { - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.makeMobs.innerLoop"); - break; - } - - int intIndex = rand(0, intArrayLength); - - PROFILER_START("npc_lair.spawnNpcLairMobiles.makeMobs.getting"); - int creatureXpValue = xp.getLevelBasedXP(lairLevel); - - xpValue += (int) (CREATURE_LAIR_EXCHANGE * creatureXpValue); - utils.setScriptVar(poiBaseObject, "npc_lair.mobile."+ mobileNumber, creatureList[intIndex]); - - numSpawned[intIndex]++; - mobileNumber++; - boolean boolSpawnLimit = false; - - if (spawnLimit[intIndex] > 0) - { - if (numSpawned[intIndex] >= spawnLimit[intIndex]) - { - boolSpawnLimit = true; - } - - } - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.makeMobs.getting"); - PROFILER_START("npc_lair.spawnNpcLairMobiles.makeMobs.swap"); - - if (boolSpawnLimit) - { - String strSwapString = ""; - int intSwapInt = 0; - float fltSwapFloat = 0; - - dictionary dctSwapThing = new dictionary(); - - dctSwapThing = dctCreatureInfo[intArrayLength]; - dctCreatureInfo[intIndex] = dctSwapThing; - - strSwapString = creatureList[intArrayLength]; - creatureList[intArrayLength] = creatureList[intIndex]; - creatureList[intIndex] = strSwapString; - - intSwapInt = spawnLimit[intArrayLength]; - spawnLimit[intArrayLength] = spawnLimit[intIndex]; - spawnLimit[intIndex] = intSwapInt; - - intSwapInt = numSpawned[intArrayLength]; - numSpawned[intArrayLength] = numSpawned[intIndex]; - numSpawned[intIndex] = intSwapInt; - - intArrayLength = intArrayLength - 1; - } - - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.makeMobs.swap"); - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.makeMobs.innerLoop"); - } - - obj_id target = getObjIdObjVar(getSelf(), "npc_lair.target"); - - if (mobileNumber <= 0) - { - PROFILER_START("npc_lair.spawnNpcLairMobiles.makeMobs.badDifficulty"); - int intJ = 0; - - while (intJ < 3) - { - testAbortScript(); - int intRoll = rand(0, creatureList.length - 1); - obj_id mobile = null; - - mobile = spawnMobile(creatureList[intRoll], target, lairLevel); - - if (isIdValid(mobile)) - { - int creatureXpValue = xp.getLevelBasedXP(lairLevel); - - xpValue += (int) (CREATURE_LAIR_EXCHANGE * creatureXpValue); - utils.setScriptVar(poiBaseObject, "npc_lair.mobile."+ mobileNumber, creatureList[intRoll]); - numSpawned[intRoll]++; - mobileNumber++; - } - intJ = intJ + 1; - } - LOG("DESIGNER_FATAL", "BAD MOJO WARNING: object id: "+ poiBaseObject); - LOG("DESIGNER_FATAL", "BAD MOJO WARNING: lairType: "+ lairType); - LOG("DESIGNER_FATAL", "BAD MOJO WARNING: mobileNumber: "+ mobileNumber); - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.makeMobs.badDifficulty"); - } - - if (lairLevel < 5) - { - lairLevel = 5; - } - if (lairLevel > 90) - { - lairLevel = 90; - } - - int avgAttrib = dataTableGetInt(create.STAT_BALANCE_TABLE, lairLevel - 1, "HP"); - - int intMinHP = (int) (avgAttrib * 0.9f); - int intMaxHP = (int) (avgAttrib * 1.1f); - - hpValue += 6 * (rand(intMinHP, intMaxHP)); - - if (groupSize > 1) - { - hpValue = hpValue * groupSize; - } - - if (hpValue > MAX_LAIR_HEALTH) - { - hpValue = MAX_LAIR_HEALTH; - } - - setObjVar(poiBaseObject, "npc_lair.targetHps", hpValue); - setObjVar(poiBaseObject, "npc_lair.targetXps", xpValue); - setObjVar(poiBaseObject, "npc_lair.lairDifficulty", lairLevel); - - if (isIdValid(target)) - { - setObjVar(target, "intCombatDifficulty", lairLevel); - setMaxHitpoints(target, hpValue); - setHitpoints(target, hpValue); - } - else - { - dictionary params = new dictionary(); - - params.put("hpValue", hpValue); - - params.put("intCombatDifficulty", lairLevel); - messageTo(poiBaseObject, "handleDelayedTargetSetup", params, 2, false); - } - - setObjVar(poiBaseObject, "npc_lair.numberOfMobiles", mobileNumber); - respawnAllMobiles(poiBaseObject); - PROFILER_STOP("npc_lair.spawnNpcLairMobiles.makeMobs"); - } - - - public int handleDelayedTargetSetup(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = getObjIdObjVar(self, "npc_lair.target"); - - if (!isIdValid(target)) - { - return SCRIPT_CONTINUE; - } - - int hpValue = params.getInt("hpValue"); - int intCombatDifficulty = params.getInt("intCombatDifficulty"); - - setObjVar(target, "intCombatDifficulty", intCombatDifficulty); - - if (hpValue > MAX_LAIR_HEALTH) - { - hpValue = MAX_LAIR_HEALTH; - } - - setMaxHitpoints(target, hpValue); - setHitpoints(target, hpValue); - return SCRIPT_CONTINUE; - } - - - public int[] getSpawnLimit(String lairDatatable, String[] creatureList) throws InterruptedException - { - if (creatureList == null) - { - return null; - } - - int[] entireSpawnLimit = dataTableGetIntColumn(lairDatatable, "spawnLimit"); - - if (entireSpawnLimit == null) - { - debugServerConsoleMsg(null, "WARNING: "+ lairDatatable + " has no spawnLimit column."); - return null; - } - - if (entireSpawnLimit.length < creatureList.length) - { - debugServerConsoleMsg(null, "WARNING: "+ lairDatatable + " has mismatched creature, spawnLimit columns."); - return null; - } - - int[] spawnLimitList = new int[creatureList.length]; - - for (int i = 0; i < creatureList.length; i++) - { - testAbortScript(); - spawnLimitList[i] = entireSpawnLimit[i]; - } - - return spawnLimitList; - } - - - public float[] getDifficultyList(dictionary[] dctCreatureInfo) throws InterruptedException - { - float diffArray[] = new float[dctCreatureInfo.length]; - - for (int i = 0; i < dctCreatureInfo.length; i++) - { - testAbortScript(); - if (dctCreatureInfo[i] != null) - { - diffArray[i] = (float) dctCreatureInfo[i].getInt("level"); - } - else - { - diffArray[i] = 0; - } - } - - return diffArray; - } - - - public float getLowestLevel(obj_id poiBaseObj, float[] difficultyList, int[] spawnLimit, int[] numSpawned) throws InterruptedException - { - float lowestLevel = 999; - - for (int i = 0; i < difficultyList.length; i++) - { - testAbortScript(); - if (spawnLimit[i] == -1 || numSpawned[i] < spawnLimit[i]) - { - if ((difficultyList[i] < lowestLevel) && (difficultyList[i] > 0)) - { - lowestLevel = difficultyList[i]; - } - } - } - - return lowestLevel; - } - - - public int spawnCreatures(obj_id self, dictionary params) throws InterruptedException - { - int mobSpawnLoopNumber = params.getInt("mobSpawnLoopNumber"); - int storedMobSpawnLoopNumber = utils.getIntScriptVar(self, "mobSpawnLoopNumber"); - - if (storedMobSpawnLoopNumber != mobSpawnLoopNumber) - { - return SCRIPT_CONTINUE; - } - - obj_id poiBaseObject = self; - int mobileNumber = params.getInt("mobileNumber"); - obj_id target = null; - - if (!hasObjVar(poiBaseObject, "npc_lair.target")) - { - String lairType = getStringObjVar(poiBaseObject, "spawning.lairType"); - String strFaction = utils.getFactionSubString(lairType); - - if (hasObjVar(poiBaseObject, "spawning.target")) - { - location locSpawnLocation = getLocation(poiBaseObject); - - if (hasObjVar(poiBaseObject, "theater.objTheater")) - { - obj_id objTheater = getObjIdObjVar(poiBaseObject, "theater.objTheater"); - - obj_id[] objObjectiveSpawners = getObjIdArrayObjVar(objTheater, "theater.objObjectiveSpawners"); - - if (objObjectiveSpawners != null) - { - if (objObjectiveSpawners.length > 0) - { - locSpawnLocation = getLocation(objObjectiveSpawners[rand(0, objObjectiveSpawners.length - 1)]); - } - } - } - - target = poiCreateObject(poiBaseObject, getStringObjVar(poiBaseObject, "spawning.target"), locSpawnLocation); - - if (isIdValid(target)) - { - if (strFaction != null) - { - factions.setFaction(target, strFaction); - } - - setYaw(target, rand(0.0f, 360.0f)); - PROFILER_STOP("npc_lair.setYaw"); - string_id strLairName = new string_id("lair_n", lairType); - String strTest = getString(strLairName); - - if (strTest != null && !strTest.equals("")) - { - setName(target, strLairName); - } - - poiSetDestroyMessage(target, "handleTargetDestroyed"); - setObjVar(poiBaseObject, "npc_lair.target", target); - setHpAndXpValues(poiBaseObject, target); - } - } - } - else - { - target = getObjIdObjVar(poiBaseObject, "npc_lair.target"); - } - - int lairLevel = getIntObjVar(poiBaseObject, "spawning.intDifficultyLevel"); - - boolean isCreatureLair = (hasObjVar(poiBaseObject, "npc_lair.isCreatureLair")); - - if (!isIdValid(target)) - { - isCreatureLair = false; - } - - int xpValue = xp.getLevelBasedXP(lairLevel); - - String mobileName = utils.getStringScriptVar(poiBaseObject, "npc_lair.mobile."+ mobileNumber); - - if (mobileName != null) - { - obj_id mobile = null; - - if (lairLevel < 1) - { - lairLevel = 1; - } - - if (lairLevel > 90) - { - lairLevel = 90; - } - - if (utils.dataTableGetInt(CREATURE_TABLE, mobileName, "difficultyClass") != 2) - { - mobile = spawnMobile(mobileName, target, lairLevel); - } - else - { - int baseLevel = utils.dataTableGetInt(CREATURE_TABLE, mobileName, "BaseLevel"); - - if (baseLevel < lairLevel) - { - mobile = spawnMobile(mobileName, target, lairLevel); - } - else - { - mobile = spawnMobile(mobileName, target, false); - } - } - - if (isIdValid(mobile)) - { - if (!ai_lib.isMonster(mobile)) - { - setObjVar(self, "npc_lair.isNotCreatureLair", true); - } - - attachNPCLairAiScript(mobile, mobileNumber); - - if (isCreatureLair) - { - int creatureXpValue = getIntObjVar(mobile, "combat.intCombatXP"); - - xpValue = xpValue + creatureXpValue; - } - } - } - - mobileNumber = mobileNumber + 1; - - if (utils.hasScriptVar(self, "npc_lair.mobile." + mobileNumber)) - { - params.put("mobileNumber", mobileNumber); - - messageTo(self, "spawnCreatures", params, .50f, false); - } - else - { - if (isIdValid(target)) - { - xpValue = (int) (xpValue * CREATURE_LAIR_EXCHANGE); - attachScript(target, "systems.combat.credit_for_kills"); - flagCreatureLairs(self); - } - } - - if (isIdValid(target)) - { - setObjVar(target, "combat.intCombatXP", xpValue); - } - - return SCRIPT_CONTINUE; - } - - - public void respawnAllMobiles(obj_id poiBaseObject) throws InterruptedException - { - obj_id self = getSelf(); - int mobSpawnLoopNumber = utils.getIntScriptVar(self, "mobSpawnLoopNumber"); - - ++mobSpawnLoopNumber; - utils.setScriptVar(self, "mobSpawnLoopNumber", mobSpawnLoopNumber); - - dictionary dctParams = new dictionary(); - - dctParams.put("mobileNumber", 0); - dctParams.put("mobSpawnLoopNumber", mobSpawnLoopNumber); - messageTo(poiBaseObject, "spawnCreatures", dctParams, 4, false); - return; - } - - - public int handleSpawnWaveOfDefenders(obj_id self, dictionary params) throws InterruptedException - { - params.put("mobileNumber", 0); - messageTo(self, "handleSpawnNextDefender", params, rand(1, 10), false); - return SCRIPT_CONTINUE; - } - - - public int handleSpawnNextDefender(obj_id self, dictionary params) throws InterruptedException - { - blog("handleSpawnNextDefender - init"); - - int mobileNumber = params.getInt("mobileNumber"); - obj_id poiBaseObject = self; - obj_id target = getObjIdObjVar(poiBaseObject, "npc_lair.target"); - - blog("handleSpawnNextDefender - target: "+target); - - int lairLevel = getIntObjVar(poiBaseObject, "spawning.intDifficultyLevel"); - int xpValue = xp.getLevelBasedXP(lairLevel); - - boolean isCreatureLair = hasObjVar(poiBaseObject, "npc_lair.isCreatureLair"); - - if (!isIdValid(target)) - { - isCreatureLair = false; - } - - String mobileName = utils.getStringScriptVar(poiBaseObject, "npc_lair.mobile."+ mobileNumber); - - if (mobileName == null) - { - return SCRIPT_CONTINUE; - } - - obj_id lair = params.getObjId("spawningFor"); - - if (!isIdValid(lair)) - { - return SCRIPT_CONTINUE; - } - - int maxHP = getMaxHitpoints(lair); - int curHP = getHitpoints(lair); - - int numSpawned = getIntObjVar(self, "npc_lair.numberOfMobiles"); - int costPerMobile = maxHP / (numSpawned * 5); - - if (costPerMobile > curHP) - { - return SCRIPT_CONTINUE; - } - - curHP -= costPerMobile; - setHitpoints(lair, curHP); - - obj_id mobile = null; - - mobile = spawnMobile(mobileName, target, lairLevel, false); - - if (isIdValid(mobile)) - { - int creatureXpValue = getIntObjVar(mobile, "combat.intCombatXP"); - - xpValue += (int) (CREATURE_LAIR_EXCHANGE * creatureXpValue); - attachNPCLairAiScript(mobile, mobileNumber); - ai_lib.setDefaultCalmBehavior(mobile, ai_lib.BEHAVIOR_LOITER); - } - else - { - - debugServerConsoleMsg(self, "designer WARNING: NPC LAIR handleSpawnNextDefender: I couldn't spawn a defender called "+ mobileName); - return SCRIPT_CONTINUE; - } - - setObjVar(target, "combat.intCombatXP", xpValue); - - mobileNumber++; - - if (utils.hasScriptVar(poiBaseObject, "npc_lair.mobile." + mobileNumber) && (mobileNumber < 20)) - { - params.put("mobileNumber", mobileNumber); - - int numAttackers = getIntObjVar(self, "npc_lair.numAttackers"); - int delay = rand(15, 20); - - if (numAttackers > 15) - { - delay = 1; - } - else if (numAttackers > 10) - { - delay = rand(5, 10); - } - else if (numAttackers > 5) - { - delay = rand(10, 15); - } - - messageTo(self, "handleSpawnNextDefender", params, delay, false); - } - - return SCRIPT_CONTINUE; - } - - - public int handleSpawnBossMonster(obj_id self, dictionary params) throws InterruptedException - { - String lairType = getStringObjVar(self, "spawning.lairType"); - - if (lairType == null) - { - return SCRIPT_CONTINUE; - } - - String lairDatatable = "datatables/npc_lair/"+ lairType + ".iff"; - - if (!dataTableHasColumn(lairDatatable, "bossMonster")) - { - return SCRIPT_CONTINUE; - } - - String[] bossMonsters = dataTableGetStringColumnNoDefaults(lairDatatable, "bossMonster"); - - if (bossMonsters == null || bossMonsters.length < 1) - { - return SCRIPT_CONTINUE; - } - - location spawnLoc = getLocation(self); - - obj_id target = params.getObjId("npc_lair"); - int lairLevel = getIntObjVar(self, "spawning.intDifficultyLevel"); - - for (int i = 0; i < bossMonsters.length; i++) - { - testAbortScript(); - int baseLevel = utils.dataTableGetInt(CREATURE_TABLE, bossMonsters[i], "BaseLevel"); - - obj_id mobile = null; - - if (baseLevel < lairLevel) - { - mobile = create.object(bossMonsters[i], spawnLoc, lairLevel); - } - else - { - mobile = create.object(bossMonsters[i], spawnLoc); - } - - setObjVar(mobile, "npc_lair.target", target); - stopFloating(mobile); - - obj_id[] enemies = getPlayerCreaturesInRange(self, 65.0f); - - if (enemies != null && enemies.length > 0) - { - obj_id victim = enemies[rand(0, (enemies.length - 1))]; - - startCombat(mobile, victim); - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleCreatureDeath(obj_id self, dictionary params) throws InterruptedException - { - int numRespawned = getIntObjVar(self, "npc_lair.numRespawned"); - - numRespawned++; - int population = getIntObjVar(self, "npc_lair.numberOfMobiles"); - int maxPopulation = population; - - if (hasObjVar(self, "npc_lair.isCreatureLair")) - { - maxPopulation *= 3; - } - - if (numRespawned >= maxPopulation) - { - if (!hasObjVar(self, "npc_lair.target")) - { - poiComplete(self, POI_SUCCESS); - } - else - { - obj_id objTarget = getObjIdObjVar(self, "npc_lair.target"); - - if (isIdValid(objTarget)) - { - setObjVar(objTarget, "fltDamageModifier", 5.0f); - - } - } - messageTo(self, "handlePoiTimeOutDestruction", null, 14400f, false); - return SCRIPT_CONTINUE; - } - else - { - setObjVar(self, "npc_lair.numRespawned", numRespawned); - } - - if (hasObjVar(self, "objMission")) - { - return SCRIPT_CONTINUE; - } - - String name = params.getString("creatureName"); - - if (name == null) - { - return SCRIPT_CONTINUE; - } - - messageTo(self, "handleRespawnCreature", params, rand(120, 240), false); - - return SCRIPT_CONTINUE; - } - - - public int handleRespawnCreature(obj_id self, dictionary params) throws InterruptedException - { - if (poiIsCompleted(self)) - { - return SCRIPT_CONTINUE; - } - - int lairLevel = getIntObjVar(self, "spawning.intDifficultyLevel"); - - obj_id target = getObjIdObjVar(self, "npc_lair.target"); - String name = params.getString("name"); - - if (name != null) - { - spawnMobile(name, target, lairLevel); - } - else - { - name = params.getString("creatureName"); - - if (name != null) - { - spawnMobile(name, target, lairLevel); - } - } - - return SCRIPT_CONTINUE; - } - - - public obj_id spawnMobile(String name, obj_id target) throws InterruptedException - { - return spawnMobile(name, target, -1); - } - - - public obj_id spawnMobile(String name, obj_id target, int level) throws InterruptedException - { - return spawnMobile(name, target, level, true); - } - - - public obj_id spawnMobile(String name, obj_id target, boolean randomLoc) throws InterruptedException - { - return spawnMobile(name, target, -1, randomLoc); - } - - - public obj_id spawnMobile(String name, obj_id target, int level, boolean randomLoc) throws InterruptedException - { - boolean boolMobSpawners = false; - - obj_id mobile = null; - obj_id objBase = poiGetBaseObject(target); - - if (isIdValid(objBase)) - { - obj_id objTheater = getObjIdObjVar(objBase, "theater.objTheater"); - - if (isIdValid(objTheater)) - { - obj_id[] objMobSpawners = getObjIdArrayObjVar(objTheater, "theater.objMobSpawners"); - - if (objMobSpawners != null && objMobSpawners.length > 0) - { - location locSpawnLocation = getLocation(objMobSpawners[rand(0, objMobSpawners.length - 1)]); - - if (locSpawnLocation != null) - { - boolMobSpawners = true; - mobile = poiCreateObject(objBase, name, locSpawnLocation, level); - stopFloating(mobile); - } - } - } - } - - if (!boolMobSpawners) - { - float x = 0.0f; - float y = 0.0f; - - if (randomLoc) - { - x = rand(-25f, 25f); - y = rand(-25f, 25f); - } - else - { - x = rand(-15f, 15f); - y = rand(-15f, 15f); - } - - mobile = poiCreateObject(name, x, y, level); - stopFloating(mobile); - } - - boolean tamable = (utils.dataTableGetFloat(CREATURE_TABLE, name, "canTame") > 0.0f); - boolean npcLair = hasObjVar(getSelf(), "npc_lair.isNotCreatureLair"); - - if (hasObjVar(getSelf(), "npc_lair.isCreatureLair")) - { - npcLair = false; - } - - if (hasObjVar(objBase, "objMission")) - { - tamable = false; - } - - if (isIdValid(mobile)) - { - if ((!randomLoc) && (!boolMobSpawners)) - { - location homeLoc = getLocation(mobile); - - homeLoc.x += rand(-10, 10); - homeLoc.z += rand(-10, 10); - setHomeLocation(mobile, homeLoc); - } - - String faction = factions.getFaction(mobile); - - if (faction != null) - { - - if (!factions.isAggro(mobile)) - { - if (!isPlayer(mobile)) - { - pvpMakeNeutral(mobile); - } - removeObjVar(mobile, "ai.faction.nonAggro"); - } - } - - poiSetDestroyMessage(mobile, "handleCreatureDeath", 1); - - if (isIdValid(target)) - { - setObjVar(mobile, "npc_lair.target", target); - } - - if (!ai_lib.isMonster(mobile)) - { - tamable = false; - } - - if (!ai_lib.isMonster(mobile)) - { - setObjVar(getSelf(), "npc_lair.isNotCreatureLair", true); - npcLair = true; - - } - - return mobile; - } - - return null; - } - - - public int handleNpcLairDecay(obj_id self, dictionary params) throws InterruptedException - { - poiComplete(POI_INCOMPLETE); - messageTo(self, "handlePoiTimeOutDestruction", null, 14400f, false); - return SCRIPT_CONTINUE; - } - - - public int handlePoiTimeOutDestruction(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public void makeBaby(obj_id mobile) throws InterruptedException - { - obj_id baseObj = poiGetBaseObject(); - - String name = ai_lib.getCreatureName(mobile); - - if (name == null || name.equals("")) - { - return; - } - - float tameChance = utils.dataTableGetFloat(CREATURE_TABLE, name, "canTame"); - - if (rand(0.0f, 1.0f) > tameChance) - { - return; - } - - int numBabiesSpawned = utils.getIntScriptVar(baseObj, "npc_lair.numbabies"); - - if (numBabiesSpawned > 2 && (rand(1, 100) > 25)) - { - return; - } - - numBabiesSpawned++; - utils.setScriptVar(baseObj, "npc_lair.numbabies", numBabiesSpawned); - attachScript(mobile, "ai.pet_advance"); - } - - - public int handleNpcAiManagement(obj_id self, dictionary params) throws InterruptedException - { - if (hasObjVar(self, "npc_lair.isCreatureLair")) - { - doCreatureLairAiManagement(self); - } - else - { - doNPCLairAiManagement(self); - } - - return SCRIPT_CONTINUE; - } - - - public void attachNPCLairAiScript(obj_id mobile, int mobileNumber) throws InterruptedException - { - if (hasScript(mobile, "ai.pet_advance")) - { - return; - } - else if (hasScript(mobile, "ai.tusken_raider")) - { - return; - } - else if (hasScript(mobile, "ai.soldier")) - { - return; - } - - setObjVar(mobile, "npc_lair.mobileNumber", mobileNumber); - attachScript(mobile, "systems.npc_lair.npc_lair_ai"); - } - - public static final int JOB_NONE = 0; - public static final int JOB_LOITER = 1; - public static final int JOB_SCOUT = 2; - public static final int JOB_REST = 3; - public static final int JOB_DEFEND = 4; - public static final int JOB_HEAL = 5; - public static final int JOB_CONVERSE = 6; - public static final int JOB_DANCE = 7; - - - public int handleScoutAlarm(obj_id self, dictionary params) throws InterruptedException - { - - params.put("job", JOB_DEFEND); - broadcastMessage("handleNpcLairCustomAi", params); - return SCRIPT_CONTINUE; - } - - - public int handleCallForHealing(obj_id self, dictionary params) throws InterruptedException - { - - if (!hasObjVar(self, "npc_lair.isCreatureLair")) - { - - return SCRIPT_CONTINUE; - } - - params.put("job", JOB_HEAL); - broadcastMessage("handleNpcLairCustomAi", params); - return SCRIPT_CONTINUE; - } - - - public void doCreatureLairAiManagement(obj_id poiBaseObject) throws InterruptedException - { - blog("npc_lair.doCreatureLairAiManagement - init"); - - int numMobiles = getIntObjVar(poiBaseObject, "npc_lair.numberOfMobiles"); - blog("npc_lair.doCreatureLairAiManagement - numMobiles: "+numMobiles); - - if (numMobiles < 2 || numMobiles > 20) - { - return; - } - - blog("npc_lair.doCreatureLairAiManagement - numMobiles is greater than 2 and less than 20: "+numMobiles); - - int[] jobAssignment = new int[numMobiles]; - - for (int currentMob = 0; currentMob < numMobiles; currentMob++) - { - testAbortScript(); - blog("npc_lair.doCreatureLairAiManagement - currentMob #: "+currentMob); - blog("npc_lair.doCreatureLairAiManagement - currentMob #: "+numMobiles); - - if (currentMob < (numMobiles / 5) * 2) - { - blog("npc_lair.doCreatureLairAiManagement - currentMob #: "+currentMob+" has JOB_LOITER"); - jobAssignment[currentMob] = JOB_LOITER; - } - else if (currentMob < ((numMobiles / 5) * 3)) - { - blog("npc_lair.doCreatureLairAiManagement - currentMob #: "+currentMob+" has JOB_SCOUT"); - jobAssignment[currentMob] = JOB_SCOUT; - } - else if (currentMob < ((numMobiles / 5) * 4)) - { - blog("npc_lair.doCreatureLairAiManagement - currentMob #: "+currentMob+" has JOB_REST"); - jobAssignment[currentMob] = JOB_REST; - } - else - { - blog("npc_lair.doCreatureLairAiManagement - currentMob #: "+currentMob+" has JOB_LOITER!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"); - jobAssignment[currentMob] = JOB_LOITER; - } - } - - dictionary params = new dictionary(); - - params.put("jobAssignments", jobAssignment); - params.put("baseObj", poiBaseObject); - - broadcastMessage("handleNpcLairCustomAi", params); - - return; - } - - - public void doNPCLairAiManagement(obj_id poiBaseObject) throws InterruptedException - { - int numMobiles = getIntObjVar(poiBaseObject, "npc_lair.numberOfMobiles"); - - if (numMobiles < 2 || numMobiles > 20) - { - return; - } - - location danceLoc = new location(getLocation(poiBaseObject)); - - switch (rand(1, 4)) - { - case 1: - danceLoc.x += rand(7, 10); - danceLoc.z += rand(7, 10); - break; - case 2: - danceLoc.x -= rand(7, 10); - danceLoc.z += rand(7, 10); - break; - case 3: - danceLoc.x += rand(7, 10); - danceLoc.z -= rand(7, 10); - break; - case 4: - danceLoc.x -= rand(7, 10); - danceLoc.z -= rand(7, 10); - break; - } - setObjVar(poiBaseObject, "npc_lair.danceLoc", danceLoc); - - int[] jobAssignment = new int[numMobiles]; - - for (int currentMob = 0; currentMob < numMobiles; currentMob++) - { - testAbortScript(); - switch (currentMob) - { - case 0: - case 1: - jobAssignment[currentMob] = JOB_CONVERSE; - break; - case 2: - jobAssignment[currentMob] = JOB_DANCE; - break; - case 3: - case 4: - jobAssignment[currentMob] = JOB_REST; - break; - default: - jobAssignment[currentMob] = JOB_NONE; - break; - } - } - - dictionary params = new dictionary(); - - params.put("jobAssignments", jobAssignment); - params.put("baseObj", poiBaseObject); - - broadcastMessage("handleNpcLairCustomAi", params); - - return; - } - - - public void setHpAndXpValues(obj_id poiBaseObject, obj_id target) throws InterruptedException - { - if (hasObjVar(poiBaseObject, "npc_lair.targetHps")) - { - int hpValue = getIntObjVar(poiBaseObject, "npc_lair.targetHps"); - - setMaxHitpoints(target, hpValue); - setHitpoints(target, hpValue); - } - if (hasObjVar(poiBaseObject, "npc_lair.targetXps")) - { - int xpValue = getIntObjVar(poiBaseObject, "npc_lair.targetXps"); - - setObjVar(target, "combat.intCombatXP", xpValue); - } - if (hasObjVar(poiBaseObject, "npc_lair.lairDifficulty")) - { - int diff = getIntObjVar(poiBaseObject, "npc_lair.lairDifficulty"); - - if (diff < 4) - { - diff = 4; - } - setObjVar(target, "intCombatDifficulty", diff); - } - - } - - - public boolean canOfferMission(obj_id mobile) throws InterruptedException - { - if (rand(1, 10) > 5) - { - return false; - } - - String creatureName = ai_lib.getCreatureName(mobile); - - if (creatureName == null) - { - return false; - } - - return (dataTableGetInt(CREATURE_TABLE, creatureName, "canOfferMission") == 1); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (msg == null || msg.equals("")) - { - return false; - } - if (LOGGING_ON) - { - LOG(TERMINAL_LOGGING, msg); - } - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/npc_lair/npc_lair_ai.java b/sku.0/sys.server/compiled/game/script/systems/npc_lair/npc_lair_ai.java deleted file mode 100644 index 38a05de19..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/npc_lair/npc_lair_ai.java +++ /dev/null @@ -1,972 +0,0 @@ -package script.systems.npc_lair; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.ai.ai_combat; -import script.ai.ai_combat_movement; -import script.library.pet_lib; -import script.library.healing; -import script.library.utils; -import script.library.factions; - - - -public class npc_lair_ai extends script.theme_park.poi.base -{ - public npc_lair_ai() - { - } - public static final String TERMINAL_LOGGING = "lair_attack"; - public static final boolean LOGGING_ON = true; - - - public int OnLostTarget(obj_id self, obj_id oldTarget) throws InterruptedException - { - blog("npc_lair_ai.OnLostTarget - I lost my target."); - return SCRIPT_CONTINUE; - } - - - public int OnEnteredCombat(obj_id self) throws InterruptedException - { - blog("npc_lair_ai.OnEnteredCombat - I have entered combat."); - - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - blog("npc_lair_ai.OnExitedCombat - I have exited combat."); - messageTo( self, "handleResumeJob", null, 3, false ); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - obj_id baseObj = poiGetBaseObject( self ); - if (!isIdValid(baseObj)) - { - messageTo( self, "handleDestruction", null, 5, false ); - return SCRIPT_CONTINUE; - } - if (!isMob(self)) - { - messageTo( self, "handleDetachment", null, 5, false ); - return SCRIPT_CONTINUE; - } - - listenToMessage( baseObj, "handleNpcLairCustomAi"); - - return SCRIPT_CONTINUE; - } - - - public int handleDestruction(obj_id self, dictionary params) throws InterruptedException - { - destroyObject( self ); - - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - if (hasScript( self, "ai.pet" )) - { - detachScript( self, "systems.npc_lair.npc_lair_ai"); - return SCRIPT_OVERRIDE; - } - - obj_id baseObj = poiGetBaseObject( self ); - if (isIdValid(baseObj)) - { - stopListeningToMessage(baseObj, "handleNpcLairCustomAi"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnDetach(obj_id self) throws InterruptedException - { - obj_id baseObj = poiGetBaseObject( self ); - if (isIdValid(baseObj)) - { - stopListeningToMessage(baseObj, "handleNpcLairCustomAi"); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDetachment(obj_id self, dictionary params) throws InterruptedException - { - detachScript( self, "systems.npc_lair.npc_lair_ai"); - return SCRIPT_CONTINUE; - } - - public static final int JOB_NONE = 0; - public static final int JOB_LOITER = 1; - public static final int JOB_SCOUT = 2; - public static final int JOB_REST = 3; - public static final int JOB_DEFEND = 4; - public static final int JOB_HEAL = 5; - public static final int JOB_CONVERSE = 6; - public static final int JOB_DANCE = 7; - - - public void doImmediateCommand(obj_id mobile, int job, dictionary params) throws InterruptedException - { - blog("npc_lair_ai.doImmediateCommand - init"); - - switch ( job ) - { - case JOB_DEFEND : - obj_id target = params.getObjId( "target"); - respondToScoutAlarm( mobile, target ); - return; - case JOB_HEAL : - if (!ai_lib.isMonster(mobile)) - { - return; - } - - obj_id myTarget = getTarget( mobile ); - if (!isIdValid(myTarget)) - { - doLairHealing( mobile, params ); - } - else if (getTarget( myTarget ) != mobile) - { - doLairHealing( mobile, params ); - } - } - - } - - - public void respondToScoutAlarm(obj_id mobile, obj_id target) throws InterruptedException - { - blog("npc_lair_ai.respondToScoutAlarm - init"); - - if (!isIdValid(target) || ai_lib.isAiDead( target )) - { - return; - } - - if (!ai_lib.isInCombat(mobile)) - { - - if (pvpGetAlignedFaction( mobile ) == (221551254)) - { - - factions.setFaction( mobile, "angry"); - } - - if (getDistance( mobile,target)>60.0f) - { - utils.setScriptVar( mobile, "pathingToAttack", target ); - pathTo( mobile, getLocation( target )); - } - else - { - blog("npc_lair_ai.respondToScoutAlarm - starting combat with target: "+target); - startCombat( mobile, target ); - } - } - } - - - public int handleNpcLairCustomAi(obj_id self, dictionary params) throws InterruptedException - { - blog("npc_lair_ai.handleNpcLairCustomAi - init"); - blog("npc_lair_ai.handleNpcLairCustomAi - params: "+params); - - if (pet_lib.isPet(self)) - { - detachScript( self, "systems.npc_lair.npc_lair_ai"); - return SCRIPT_CONTINUE; - } - - if (ai_lib.isAiDead(self)) - { - detachScript( self, "systems.npc_lair.npc_lair_ai"); - return SCRIPT_CONTINUE; - } - - int jobToDo = params.getInt( "job"); - if (jobToDo > 0) - { - - doImmediateCommand( self, jobToDo, params ); - return SCRIPT_CONTINUE; - } - - blog("npc_lair_ai.handleNpcLairCustomAi - no immediate command: "); - - if (!hasObjVar( self, "npc_lair.mobileNumber")) - { - return SCRIPT_CONTINUE; - } - - obj_id baseObj = params.getObjId( "baseObj"); - if (!isIdValid( baseObj )) - { - detachScript( self, "systems.npc_lair.npc_lair_ai"); - return SCRIPT_CONTINUE; - } - if (!exists( baseObj ) || !isInWorld( baseObj )) - { - detachScript( self, "systems.npc_lair.npc_lair_ai"); - return SCRIPT_CONTINUE; - } - - if (ai_lib.isHerdingCreature( self )) - { - obj_id myLair = ai_lib.getLair( self ); - if (!isIdValid( myLair )) - { - detachScript( self, "systems.npc_lair.npc_lair_ai"); - return SCRIPT_CONTINUE; - } - } - - int mobileNum = getIntObjVar( self, "npc_lair.mobileNumber"); - blog("npc_lair_ai.handleNpcLairCustomAi - mobileNum: "+mobileNum); - - int[] jobAssignment = params.getIntArray( "jobAssignments"); - blog("npc_lair_ai.handleNpcLairCustomAi - jobAssignment.length: "+jobAssignment.length); - for (int i = 0; i < jobAssignment.length; i++) - { - testAbortScript(); - blog("npc_lair_ai.handleNpcLairCustomAi - jobAssignment["+i+"]: "+jobAssignment[i]); - } - - if (jobAssignment == null || jobAssignment.length == 0) - { - blog("npc_lair_ai.handleNpcLairCustomAi - jobAssignment == null or length == 0"); - - detachScript( self, "systems.npc_lair.npc_lair_ai"); - return SCRIPT_CONTINUE; - } - if (mobileNum >= jobAssignment.length) - { - blog("npc_lair_ai.handleNpcLairCustomAi - mobileNum >= jobAssignment.length"); - - detachScript( self, "systems.npc_lair.npc_lair_ai"); - return SCRIPT_CONTINUE; - } - - blog("npc_lair_ai.handleNpcLairCustomAi - mobileNum: "+mobileNum); - - int job = jobAssignment[mobileNum ]; - blog("npc_lair_ai.handleNpcLairCustomAi - job: "+job); - - setObjVar( self, "npc_lair.job", job ); - switch ( job ) - { - case JOB_NONE : - - break; - case JOB_LOITER : - setHomeLocation( self, getLocation( baseObj )); - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_LOITER ); - break; - case JOB_SCOUT : - setHomeLocation( self, getLocation( baseObj )); - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_WANDER ); - - String myName = getAssignedName( self ); - if (myName != null && !myName.equals("")) - { - if (!myName.equals("null")) - { - setName( self, myName + " (scout)"); - } - else - { - String crName = ai_lib.getCreatureName( self ); - debugServerConsoleMsg( self, "WARNING: "+ crName + " has an assigned name of Null - why is that?"); - } - } - else - { - if (!myName.equals("null")) - { - setName( self, (getString( getNameStringId(self) ) + " (scout)")); - } - else - { - String crName = ai_lib.getCreatureName( self ); - debugServerConsoleMsg( self, "WARNING: "+ crName + " has an assigned name of Null - why is that?"); - } - } - break; - case JOB_REST : - if (ai_lib.isMonster(self)) - { - if (ai_lib.canSit( self )) - { - setHomeLocationNearLair( self, baseObj ); - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL ); - } - else if (ai_lib.canLieDown(self)) - { - setHomeLocationNearLair( self, baseObj ); - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL ); - } - else - { - - setHomeLocation( self, getLocation( baseObj )); - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_LOITER ); - } - } - else if (ai_lib.aiGetNiche(self)==NICHE_NPC) - { - location danceLoc = getLocationObjVar( baseObj, "npc_lair.danceLoc"); - obj_id dancer = getObjIdObjVar( baseObj, "npc_lair.dancer"); - if (isIdValid( dancer )) - { - setObjVar( self, "npc_lair.dancer", dancer ); - } - - setObjVar( baseObj, "npc_lair.watcher", self ); - boolean entertainment = getBooleanObjVar( baseObj, "npc_lair.entertainment"); - location startLoc = getLocation(self); - if (startLoc.x > danceLoc.x) - { - danceLoc.x += (rand(2,3)); - } - else - { - danceLoc.x -= (rand(2,3)); - } - - if (startLoc.z > danceLoc.z) - { - danceLoc.z += (rand(2,3)); - } - else - { - danceLoc.z -= (rand(2,3)); - } - - setHomeLocation( self, danceLoc ); - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL ); - { - switch ( rand(1,10) ) - { - case 1 : - ai_lib.setDefaultCalmMood( self, "conversation"); - break; - case 2 : - ai_lib.setDefaultCalmMood( self, "npc_accusing"); - break; - case 3 : - ai_lib.setDefaultCalmMood( self, "npc_angry"); - break; - case 4 : - ai_lib.setDefaultCalmMood( self, "npc_consoling"); - break; - case 5 : - ai_lib.setDefaultCalmMood( self, "npc_sad"); - break; - case 6 : - case 7 : - case 8 : - case 9 : - case 10 : - ai_lib.setDefaultCalmMood( self, "npc_sitting_ground"); - break; - } - } - } - break; - case JOB_CONVERSE : - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL ); - if (mobileNum != 0) - { - - return SCRIPT_CONTINUE; - } - obj_id[] allNpcs = getAllNpcs(getLocation(self), 45.0f); - if (allNpcs == null || allNpcs.length == 0) - { - - return SCRIPT_CONTINUE; - } - for (int i = 0; i < allNpcs.length; i++) - { - testAbortScript(); - if (allNpcs[i] != self) - { - int yourNum = getIntObjVar( allNpcs[i], "npc_lair.mobileNumber"); - if (yourNum == 1) - { - - faceToBehavior( self, allNpcs[i] ); - ai_lib.setDefaultCalmMood( self, "conversation"); - dictionary parms = new dictionary(); - parms.put("converseWith", self); - setObjVar( self, "npc_lair.converseWith", allNpcs[i] ); - messageTo( allNpcs[i], "handleRequestToConverse", parms, 5, false ); - return SCRIPT_CONTINUE; - } - } - } - - break; - case JOB_DANCE : - location danceLoc = getLocationObjVar( baseObj, "npc_lair.danceLoc"); - setObjVar( baseObj, "npc_lair.dancer", self ); - danceLoc.x += rand(-2,2); - danceLoc.z += rand(-2,2); - setHomeLocation( self, danceLoc ); - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL ); - switch ( rand(1,6) ) - { - case 1 : - ai_lib.setDefaultCalmMood( self, "conversation"); - break; - case 2 : - case 3 : - case 4 : - if (getGender(self)==GENDER_FEMALE) - { - ai_lib.setDefaultCalmMood( self, "themepark_oola"); - } - else - { - ai_lib.setDefaultCalmMood( self, "entertained"); - } - - setObjVar( baseObj, "npc_lair.entertainment", true ); - break; - case 5 : - ai_lib.setDefaultCalmMood( self, "npc_accusing"); - break; - case 6 : - ai_lib.setDefaultCalmMood( self, "npc_angry"); - break; - } - break; - } - - return SCRIPT_CONTINUE; - } - - - public int OnMovePathComplete(obj_id self) throws InterruptedException - { - int job = getIntObjVar( self, "npc_lair.job"); - - if (ai_lib.isInCombat( self ) && (getIntObjVar( self, "ai.combat.moveMode")==ai_combat_movement.MOVEMODE_PATHING_HOME)) - { - - if (job == JOB_SCOUT) - { - - obj_id poiObj = poiGetBaseObject( self ); - if (isIdValid(poiObj)) - { - obj_id myTarget = getTarget(self); - if (isIdValid(myTarget)) - { - - dictionary parms = new dictionary(); - parms.put( "target", myTarget ); - messageTo(poiObj,"handleScoutAlarm", parms, 0, false); - } - } - } - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar( self, "pathingToHealLair" )) - { - utils.removeScriptVar( self, "pathingToHealLair"); - - doLairHealing( self, null ); - return SCRIPT_OVERRIDE; - } - - if (utils.hasScriptVar( self, "pathingToAttack" )) - { - obj_id target = utils.getObjIdScriptVar( self, "pathingToAttack"); - if (isIdValid( target ) && exists( target ) && !ai_lib.aiIsDead( target )) - { - if (getDistance( self, target ) > 60.0f) - { - pathTo( self, getLocation( target ) ); - return SCRIPT_CONTINUE; - } - else - { - startCombat( self, target ); - } - } - utils.removeScriptVar( self, "pathingToAttack"); - } - - if (getBehavior(self) != BEHAVIOR_CALM) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isMonster( self )) - { - if (job == JOB_REST) - { - if (ai_lib.canSit( self )) - { - if (rand(1,2)==1) - { - ai_lib.aiSetPosture(self, POSTURE_SITTING ); - } - else - { - ai_lib.aiSetPosture(self, POSTURE_LYING_DOWN ); - } - } - else if (ai_lib.canLieDown(self)) - { - ai_lib.aiSetPosture(self, POSTURE_LYING_DOWN ); - } - return SCRIPT_OVERRIDE; - } - } - - if (job == JOB_CONVERSE) - { - utils.removeScriptVar( self, "npc_lair.pathingToConverse"); - obj_id partner = getObjIdObjVar( self, "npc_lair.converseWith"); - if (isIdValid( partner ) && exists( partner )) - { - faceToBehavior( self, partner ); - ai_lib.setDefaultCalmMood( self, "conversation"); - setHomeLocation( self, getLocation( self )); - } - } - else if (hasObjVar( self, "npc_lair.dancer" )) - { - obj_id dancer = getObjIdObjVar( self, "npc_lair.dancer"); - if (isIdValid(dancer) && exists( dancer )) - { - faceToBehavior( self, dancer ); - - } - else - { - - obj_id[] creatures = getCreaturesInRange( getLocation( self ), 6.0f ); - if (creatures != null && creatures.length > 0) - { - for (int i = 0; i < creatures.length; i++) - { - testAbortScript(); - int yourJob = getIntObjVar( creatures[i], "npc_lair.job"); - if (yourJob == JOB_DANCE) - { - faceToBehavior( self, creatures[i] ); - faceToBehavior( creatures[i], self ); - return SCRIPT_CONTINUE; - } - } - } - } - } - else if (job == JOB_DANCE) - { - obj_id poiObj = poiGetBaseObject( self ); - if (isIdValid(poiObj)) - { - obj_id watcher = getObjIdObjVar( poiObj, "npc_lair.watcher"); - if (isIdValid( watcher ) && exists( watcher )) - { - faceToBehavior( self, watcher ); - - } - else - { - - obj_id[] creatures = getCreaturesInRange( getLocation( self), 6.0f ); - if (creatures != null && creatures.length > 0) - { - for (int i = 0; i < creatures.length; i++) - { - testAbortScript(); - if (hasObjVar( creatures[i], "npc_lair.dancer" )) - { - faceToBehavior( self, creatures[i] ); - faceToBehavior( creatures[i], self ); - return SCRIPT_CONTINUE; - } - } - } - } - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnMovePathBlocked(obj_id self) throws InterruptedException - { - if (utils.hasScriptVar( self, "pathingToHealLair" )) - { - - utils.removeScriptVar( self, "pathingToHealLair"); - removeObjVar( self, "ai.combat.ignoreCombat"); - utils.removeScriptVar( self, "npc_lair.willheal"); - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public int OnMovePathNotFound(obj_id self) throws InterruptedException - { - if (utils.hasScriptVar( self, "pathingToHealLair" )) - { - - utils.removeScriptVar( self, "pathingToHealLair"); - removeObjVar( self, "ai.combat.ignoreCombat"); - utils.removeScriptVar( self, "npc_lair.willheal"); - return SCRIPT_OVERRIDE; - } - return SCRIPT_CONTINUE; - } - - - public void setHomeLocationNearLair(obj_id mobile, obj_id baseObj) throws InterruptedException - { - if (!isIdValid( baseObj )) - { - return; - } - - location baseLoc = getLocation( baseObj ); - if ((baseLoc.x < 1.0f && baseLoc.x > -1.0f ) && (baseLoc.z < 1.0f && baseLoc.z > 1.0f)) - { - return; - } - - baseLoc.x += rand(7,7); - baseLoc.z += rand(7,7); - setHomeLocation(mobile,baseLoc); - } - - - public void doLairHealing(obj_id mobile, dictionary params) throws InterruptedException - { - - blog("npc_lair_ai.doLairHealing - init"); - if (!isIdValid( mobile ) || !exists( mobile )) - { - return; - } - - if (ai_lib.isAiDead( mobile )) - { - return; - } - - if (!utils.hasScriptVar( mobile,"npc_lair.willheal")) - { - if (rand(1,3)==1) - { - utils.setScriptVar( mobile, "npc_lair.willheal", true ); - } - else - { - return; - } - } - - obj_id lair = getObjIdObjVar(mobile,"npc_lair.target"); - if (!isIdValid(lair)) - { - if (params != null) - { - lair = params.getObjId( "lair"); - if (isIdValid(lair) && exists( lair )) - { - setObjVar( mobile, "npc_lair.target", lair ); - } - else - { - removeObjVar( mobile, "ai.combat.ignoreCombat"); - utils.setScriptVar( mobile, "npc_lair.willheal", false ); - return; - } - } - else - { - return; - } - } - - if (!exists(lair) || !isInWorld(lair)) - { - removeObjVar( mobile, "ai.combat.ignoreCombat"); - utils.setScriptVar( mobile, "npc_lair.willheal", false ); - return; - } - - int maxHP = getMaxHitpoints( lair ); - int curHP = getHitpoints(lair); - if (curHP == maxHP) - { - - removeObjVar( mobile, "ai.combat.ignoreCombat"); - utils.removeScriptVar( mobile,"npc_lair.willheal"); - if (!ai_lib.isInCombat(mobile)) - { - messageTo( mobile, "resumeDefaultCalmBehavior", null, rand(3,5), false ); - } - return; - } - - int amountToHeal = (maxHP/5); - - location baseLoc = getLocation(lair); - - if (getDistance( lair, mobile ) > 3.0f) - { - - setObjVar( mobile, "ai.combat.ignoreCombat", true ); - utils.setScriptVar( mobile, "pathingToHealLair", true ); - stop( mobile ); - setMovementRun( mobile ); - pathToWithinTwoMetersOf( mobile, baseLoc ); - return; - } - - switch ( rand(0,3) ) - { - case 0 : - debugSpeakMsgc(aiLoggingEnabled(mobile), mobile, "eat"); - - stop( mobile ); - doAnimationAction( mobile, "eat"); - break; - case 1 : - debugSpeakMsgc(aiLoggingEnabled(mobile), mobile, "vocalize"); - - stop( mobile ); - doAnimationAction( mobile, "vocalize"); - break; - case 2 : - debugSpeakMsgc(aiLoggingEnabled(mobile), mobile, "loiter"); - - final location anchorLocation = getLocation(lair); - final float minDistance = 1.0f; - final float maxDistance = 3.0f; - final float minDelay = 1.0f; - final float maxDelay = 2.0f; - - loiterLocation(mobile, anchorLocation, minDistance, maxDistance, minDelay, maxDelay); - break; - } - - obj_id[] players = getAllPlayers(baseLoc, healing.VAR_EFFECT_DISPLAY_RADIUS); - if (players != null) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - playClientEffectObj(players[i], "clienteffect/healing_healdamage.cef", lair, ""); - playClientEffectObj(players[i], "clienteffect/healing_healdamage.cef", mobile, ""); - } - } - - curHP += amountToHeal; - if (curHP < maxHP) - { - setHitpoints(lair,curHP); - } - else - { - setHitpoints(lair,maxHP); - } - - dictionary parms = new dictionary(); - parms.put( "lair", lair ); - messageTo( mobile, "handleRecoverFromHealingLair", parms, rand(3,5), false ); - - } - - - public int resumeDefaultCalmBehavior(obj_id self, dictionary params) throws InterruptedException - { - obj_id lair = getObjIdObjVar( self, "npc_lair.target"); - if (isIdValid(lair)) - { - if (!ai_lib.isInCombat(self)) - { - int maxHP = getMaxHitpoints( lair ); - int curHP = getHitpoints(lair); - if (curHP < maxHP) - { - params.put("lair",lair); - doLairHealing( self, params ); - } - - return SCRIPT_OVERRIDE; - } - } - return SCRIPT_CONTINUE; - } - - - public int handleRecoverFromHealingLair(obj_id self, dictionary params) throws InterruptedException - { - - obj_id lair = params.getObjId( "lair"); - int maxHP = getMaxHitpoints( lair ); - int curHP = getHitpoints(lair); - if (curHP < maxHP) - { - doLairHealing( self, params ); - } - else - { - - removeObjVar( self, "ai.combat.ignoreCombat"); - utils.removeScriptVar( self, "pathingToHealLair"); - utils.removeScriptVar( self, "npc_lair.willheal"); - if (!ai_lib.isInCombat(self)) - { - messageTo( self, "resumeDefaultCalmBehavior", null, 5, false ); - } - } - - return SCRIPT_CONTINUE; - } - - - public void pathToWithinTwoMetersOf(obj_id mobile, location destLoc) throws InterruptedException - { - location startLoc = getLocation( mobile ); - location baseLoc = new location( destLoc ); - if (startLoc.x > baseLoc.x) - { - baseLoc.x += 1.5f; - } - else - { - baseLoc.x -= 1.5f; - } - - if (startLoc.z > baseLoc.z) - { - baseLoc.z += 1.5f; - } - else - { - baseLoc.z -= 1.5f; - } - - pathTo( mobile, baseLoc ); - } - - - public int OnSawAttack(obj_id self, obj_id defender, obj_id[] attackers) throws InterruptedException - { - if (hasObjVar( self, "ai.combat.ignoreCombat" )) - { - - return SCRIPT_OVERRIDE; - } - else - { - return SCRIPT_CONTINUE; - } - } - - - public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException - { - if (hasObjVar( self, "ai.combat.ignoreCombat" )) - { - - obj_id lair = getObjIdObjVar( self, "npc_lair.target"); - utils.removeScriptVar( self, "npc_lair.willheal"); - removeObjVar( self, "ai.combat.ignoreCombat"); - } - return SCRIPT_CONTINUE; - } - - - public int handleRequestToConverse(obj_id self, dictionary params) throws InterruptedException - { - - obj_id partner = params.getObjId("converseWith"); - if (!isIdValid(partner) || !exists( partner )) - { - - return SCRIPT_CONTINUE; - } - - setObjVar( self, "npc_lair.converseWith", partner ); - utils.setScriptVar( self, "npc_lair.pathingToConverse", true ); - location destLoc = new location( getLocation( partner )); - location myLoc = getLocation( self ); - if (myLoc.x < destLoc.x) - { - destLoc.x -= 1; - } - else - { - destLoc.x += 1; - } - if (myLoc.z < destLoc.z) - { - destLoc.z -= 1; - } - else - { - destLoc.z += 1; - } - - pathTo( self, destLoc); - - return SCRIPT_CONTINUE; - } - - - public int handleResumeJob(obj_id self, dictionary params) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (msg == null || msg.equals("")) - { - return false; - } - if (LOGGING_ON) - { - LOG(TERMINAL_LOGGING, msg); - } - - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/sign/sign.java b/sku.0/sys.server/compiled/game/script/systems/sign/sign.java deleted file mode 100644 index 61b5f337c..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/sign/sign.java +++ /dev/null @@ -1,133 +0,0 @@ -package script.systems.sign; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.sui; -import script.library.utils; -import script.library.player_structure; -import script.library.prose; -import script.library.utils; - - -public class sign extends script.base_script -{ - public sign() - { - } - public static final boolean LOGGING_ON = false; - public static final String LOGGING_CATEGORY = "packup"; - - public static final string_id SID_TERMINAL_MANAGEMENT = new string_id("player_structure", "management"); - public static final string_id SID_TERMINAL_PACK_HOUSE = new string_id("sui", "packup_house"); - public static final string_id EMAIL_TITLE = new string_id("spam", "email_title"); - public static final string_id EMAIL_BODY = new string_id("spam", "email_body"); - public static final string_id SID_OWNER_PACKUP_AT_TERMINAL = new string_id("player_structure", "onwer_packup_at_terminal"); - public static final int minTimeDelayBetweenSameServerRequests = 300; - public static final String timeOfLastSameServerRequest = "timeOfLastSameServerRequest"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - menu_info_data menuData = mi.getMenuItemByType(menu_info_types.ITEM_USE); - if (menuData != null) - { - menuData.setServerNotify(true); - } - - deltadictionary scriptvars = self.getScriptVars(); - obj_id house = scriptvars.getObjId("player_structure.parent"); - - if (player_structure.canShowPackOption(player, house)) - { - int management_root = mi.addRootMenu (menu_info_types.SERVER_TERMINAL_MANAGEMENT, SID_TERMINAL_MANAGEMENT); - mi.addSubMenu( management_root, menu_info_types.SERVER_MENU10, SID_TERMINAL_PACK_HOUSE); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item == menu_info_types.ITEM_USE) - { - string_id desc = getDescriptionStringId(self); - String text = utils.packStringId(desc); - sui.msgbox(self, player, text, "noHandlerNeeded"); - } - else if (item == menu_info_types.SERVER_MENU10) - { - - deltadictionary scriptvars = self.getScriptVars(); - obj_id house = scriptvars.getObjId("player_structure.parent"); - - if (player_structure.isOwner(house, player)) - { - sendSystemMessage(player, SID_OWNER_PACKUP_AT_TERMINAL); - return SCRIPT_CONTINUE; - } - - if (player_structure.isPlayerGatedFromHousePackUp(player)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.canPlayerPackAbandonedStructure(player, house)) - { - - if (isAtPendingLoadRequestLimit()) - { - sendSystemMessage(player, new string_id("player_structure", "abandoned_structure_pack_up_try_again_later")); - } - else if (player_structure.isAbandoned(house) && (!house.isAuthoritative() || !player.isAuthoritative())) - { - if ((!utils.hasScriptVar(player, timeOfLastSameServerRequest) || utils.getIntScriptVar(player, timeOfLastSameServerRequest) < getGameTime())) - { - requestSameServer(player, house); - utils.setScriptVar(player, timeOfLastSameServerRequest, getGameTime() + minTimeDelayBetweenSameServerRequests); - utils.setScriptVar(player, "requestedSameServerToAbandonHouse", house); - } - - sendSystemMessage(player, new string_id("player_structure", "abandoned_structure_pack_up_please_wait_processing")); - } - - return SCRIPT_CONTINUE; - } - - if (isIdValid(house)) - { - dictionary params = new dictionary(); - params.put( "house", house ); - params.put( "player", player ); - - messageTo (house, "packAbandonedBuilding", params, 4, false); - messageTo (player, "handlePlayerStructurePackupLockout", null, 0, false); - - if (!hasObjVar(player, player_structure.HOUSE_PACKUP_ARRAY_OBJVAR)) - { - String recipient = getPlayerName(player); - utils.sendMail(EMAIL_TITLE, EMAIL_BODY, recipient, "Galactic Vacant Building Demolishing Movement"); - } - } - } - - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/spawning/dropship/player_shuttle.java b/sku.0/sys.server/compiled/game/script/systems/spawning/dropship/player_shuttle.java deleted file mode 100644 index 02a388eb0..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/spawning/dropship/player_shuttle.java +++ /dev/null @@ -1,76 +0,0 @@ -package script.systems.spawning.dropship; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.ai_lib; - - - -public class player_shuttle extends script.systems.spawning.dropship.base -{ - public player_shuttle() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - return super.OnAttach(self); - } - - - public int landShuttle(obj_id self, dictionary params) throws InterruptedException - { - queueCommand(self, (-1465754503), self, "", COMMAND_PRIORITY_FRONT); - setPosture(self, POSTURE_UPRIGHT); - return SCRIPT_CONTINUE; - } - - - public int takeOff(obj_id self, dictionary params) throws InterruptedException - { - setPosture(self, POSTURE_PRONE); - queueCommand(self, (-1114832209), self, "", COMMAND_PRIORITY_FRONT); - messageTo(self, "destroySelf", null, 60.0f, false); - return SCRIPT_CONTINUE; - } - - - public int explodeThenDestroySelf(obj_id self, dictionary params) throws InterruptedException - { - if (params != null) - { - - location locList[] = params.getLocationArray("explosionLocaitonList"); - if (locList != null && locList.length > 0) - { - for (int i = 0; i < locList.length; i++) - { - testAbortScript(); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", locList[i], 0); - } - } - messageTo(self, "destroySelf", null, 0, false); - } - else - { - location death = getLocation(self); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", death, 0); - messageTo(self, "destroySelf", null, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_tangible.java b/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_tangible.java deleted file mode 100644 index 89c9c2892..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/spawning/spawn_tangible.java +++ /dev/null @@ -1,162 +0,0 @@ -package script.systems.spawning; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -public class spawn_tangible extends script.base_script -{ - public spawn_tangible() - { - } - - public int OnInitialize(obj_id self) throws InterruptedException - { - requestPreloadCompleteTrigger(self); - return SCRIPT_CONTINUE; - } - - - public int OnPreloadComplete(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, "spawn.object")) - { - return SCRIPT_CONTINUE; - } - - LOG("bomb_spawner","OnPreloadComplete"); - - if (hasObjVar(self, "spawn.oid")) - { - obj_id currentObject = getObjIdObjVar(self, "spawn.oid"); - if (!isValidId(currentObject) || !exists(currentObject)) - { - removeObjVar(self, "spawn.oid"); - } - else - { - return SCRIPT_CONTINUE; - } - } - - String objectName = getStringObjVar(self, "spawn.object"); - if (objectName == null || objectName.equals("")) - { - return SCRIPT_CONTINUE; - } - - location spawnerLocation = getLocation(self); - if (spawnerLocation == null) - { - return SCRIPT_CONTINUE; - } - - obj_id spawnedObject = createObject(objectName, spawnerLocation); - if (!isValidId(spawnedObject) || !exists(spawnedObject)) - { - return SCRIPT_CONTINUE; - } - - setObjVar(self, "spawn.oid", spawnedObject); - setObjVar(spawnedObject, "spawn.spawner", self); - - LOG("bomb_spawner","spawnedObject: "+spawnedObject); - - return SCRIPT_CONTINUE; - } - - - public int handleTangibleRespawn(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, "spawn.object")) - { - return SCRIPT_CONTINUE; - } - - LOG("bomb_spawner","handleTangibleRespawn"); - - if (hasObjVar(self, "spawn.oid")) - { - obj_id currentObject = getObjIdObjVar(self, "spawn.oid"); - LOG("bomb_spawner","found old oid: "+currentObject); - - if (!isValidId(currentObject) || !exists(currentObject)) - { - LOG("bomb_spawner","removing Oid: "+currentObject); - removeObjVar(self, "spawn.oid"); - } - else - { - return SCRIPT_CONTINUE; - } - } - - String objectName = getStringObjVar(self, "spawn.object"); - if (objectName == null || objectName.equals("")) - { - return SCRIPT_CONTINUE; - } - - location spawnerLocation = getLocation(self); - if (spawnerLocation == null) - { - return SCRIPT_CONTINUE; - } - - obj_id spawnedObject = createObject(objectName, spawnerLocation); - if (!isValidId(spawnedObject) || !exists(spawnedObject)) - { - return SCRIPT_CONTINUE; - } - - setObjVar(self, "spawn.oid", spawnedObject); - setObjVar(spawnedObject, "spawn.spawner", self); - - return SCRIPT_CONTINUE; - } - - - public int handleTangibleDestroy(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, "spawn.oid")) - { - return SCRIPT_CONTINUE; - } - - obj_id spawnedObject = getObjIdObjVar(self, "spawn.oid"); - if (!isValidId(spawnedObject) || !exists(spawnedObject)) - { - return SCRIPT_CONTINUE; - } - - destroyObject(spawnedObject); - removeObjVar(self, "spawn.oid"); - - return SCRIPT_CONTINUE; - } - - - public int OnRemovingFromWorld(obj_id self) throws InterruptedException - { - if (!hasObjVar(self, "spawn.oid")) - { - return SCRIPT_CONTINUE; - } - - obj_id spawnedObject = getObjIdObjVar(self, "spawn.oid"); - if (!isValidId(spawnedObject) || !exists(spawnedObject)) - { - return SCRIPT_CONTINUE; - } - - destroyObject(spawnedObject); - removeObjVar(self, "spawn.oid"); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/spawning/spawned_tracker.java b/sku.0/sys.server/compiled/game/script/systems/spawning/spawned_tracker.java deleted file mode 100644 index 8ccb44185..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/spawning/spawned_tracker.java +++ /dev/null @@ -1,95 +0,0 @@ -package script.systems.spawning; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; - - -public class spawned_tracker extends script.base_script -{ - public spawned_tracker() - { - } - - public int OnIncapacitated(obj_id self, obj_id objAttacker) throws InterruptedException - { - if (!utils.hasScriptVar(self, "intCleanedUp")) - { - utils.setScriptVar(self, "intCleanedUp", 1); - obj_id objParent = getObjIdObjVar(self, "objParent"); - float fltRespawnTime = getFloatObjVar(self, "fltRespawnTime"); - - if (utils.hasScriptVar(self, "deathTracker")) - { - location loc = utils.getLocationScriptVar(self, "deathTracker"); - dictionary params = new dictionary (); - params.put ("loc", loc ); - messageTo ( objParent, "spawnDestroyed", params, fltRespawnTime, false ); - return SCRIPT_CONTINUE; - } - messageTo(objParent, "spawnDestroyed", null, fltRespawnTime, false); - } - - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - - if (hasObjVar(self, "dontCountDeath")) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "intCleanedUp")) - { - utils.setScriptVar(self, "intCleanedUp", 1); - obj_id objParent = getObjIdObjVar(self, "objParent"); - - if (!isIdValid(objParent)) - { - return SCRIPT_CONTINUE; - } - - float fltRespawnTime = getFloatObjVar(self, "fltRespawnTime"); - if (utils.hasScriptVar(self, "deathTracker")) - { - location loc = utils.getLocationScriptVar(self, "deathTracker"); - dictionary params = new dictionary (); - params.put ("loc", loc ); - messageTo ( objParent, "spawnDestroyed", params, fltRespawnTime, false ); - return SCRIPT_CONTINUE; - } - messageTo(objParent, "spawnDestroyed", null, fltRespawnTime, false); - - } - - return SCRIPT_CONTINUE; - } - - - public int selfDestruct(obj_id self, dictionary params) throws InterruptedException - { - if (hasObjVar(self, "force_cleanup")) - { - - setPosture(self, POSTURE_INCAPACITATED); - } - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int OnRemovingFromWorld(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/dummy_treasure_drum.java b/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/dummy_treasure_drum.java deleted file mode 100644 index 93eb7f827..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/dummy_treasure_drum.java +++ /dev/null @@ -1,412 +0,0 @@ -package script.systems.treasure_map.base; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.util.Vector; -import script.library.ai_lib; -import script.library.create; -import script.library.groundquests; -import script.library.loot; -import script.library.utils; - - -public class dummy_treasure_drum extends script.base_script -{ - public dummy_treasure_drum() - { - } - public static final String SCRIPT_TREASUREGUARD = "systems.treasure_map.base.treasure_guard"; - public static final String REAL_CHEST = "object/tangible/container/drum/treasure_drum.iff"; - public static final String SCRIPT_REAL_CHEST = "systems.treasure_map.base.treasure_drum"; - public static final String BONUS_LOOT_TABLE_81_90 = "treasure/treasure_bonus_81_90"; - public static final String RARE_BONUS_LOOT_TABLE_81_90 = "treasure/treasure_rare_bonus_81_90"; - public static final String LOOT_TABLE_81_90 = "treasure/treasure_81_90"; - - public static final String SID_WRONG_PLAYER = "@treasure_map/treasure_map:wrong_player"; - public static final String SID_KILL_GUARDS = "@treasure_map/treasure_map:kill_guards_message"; - public static final String SID_UNLOCK_CHEST = "@treasure_map/treasure_map:unlock_chest"; - - public static final int TREASURE_LOOT_ITEMS = 6; - public static final int NUMBER_OF_BONUS_LOOT_ITEMS = 1; - public static final int EIGHT_MEMBER_GROUP_BONUS = 2; - public static final int EIGHT_GROUP_PERCENT_CHANCE_FOR_SUPER_RARE = 5; - public static final int EIGHT_GROUP_PERCENT_CHANCE_FOR_RARE = 20; - public static final int FOUR_GROUP_PERCENT_CHANCE_FOR_RARE = 25; - - - public int OnAttach(obj_id self) throws InterruptedException - { - - messageTo(self, "cleanUpFakeChest", null, 1000, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - obj_id fake_chest = self; - if (!exists(fake_chest)) - { - return SCRIPT_CONTINUE; - } - - obj_id owner = getObjIdObjVar(fake_chest, "owner"); - if (!isValidId(owner) || !exists(owner)) - { - return SCRIPT_CONTINUE; - } - - messageTo(fake_chest, "recalculateGuardArray", null, 0, false); - - if (owner != player) - { - sendSystemMessage(player, SID_WRONG_PLAYER, null); - return SCRIPT_CONTINUE; - } - - obj_id[] guards = getObjIdArrayObjVar(fake_chest, "guards"); - if (guards == null) - { - sendSystemMessage(player, SID_UNLOCK_CHEST, null); - messageTo(fake_chest, "setupChest", null, 1, false); - } - else - { - sendSystemMessage(player, SID_KILL_GUARDS, null); - - for (int i=0; i 0) - { - setObjVar(fake_chest, "guards", guards); - - for (int i = 0; i < guards.size(); i++) - { - testAbortScript(); - CustomerServiceLog("treasureMap", "Player: "+ player + " "+ getName(player) - + " has spawned boss mob level: "+ ((obj_id)(guards.get(i))) - + " at: "+ getLocation(((obj_id)(guards.get(i)))) - + ". [ spawnTreasureGuards() ]"); - } - } - return SCRIPT_CONTINUE; - } - - - public int recalculateGuardArray(obj_id self, dictionary params) throws InterruptedException - { - obj_id fake_chest = self; - obj_id player = getObjIdObjVar(fake_chest, "owner"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - Vector latestGuardList = new Vector(); - obj_id[] guards = getObjIdArrayObjVar(fake_chest, "guards"); - if (guards == null || guards.length == 0) - { - sendSystemMessage(player, SID_UNLOCK_CHEST, null); - messageTo(fake_chest, "setupChest", null, 0, false); - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < guards.length; i++) - { - testAbortScript(); - if ((isIdNull(guards[i])) || !exists(guards[i]) || isDead(guards[i])) - { - continue; - } - utils.addElement(latestGuardList, guards[i]); - } - obj_id[] newGuardArray = new obj_id[latestGuardList.size()]; - if (newGuardArray == null || newGuardArray.length == 0) - { - sendSystemMessage(player, SID_UNLOCK_CHEST, null); - messageTo(fake_chest, "setupChest", null, 0, false); - return SCRIPT_CONTINUE; - } - - latestGuardList.toArray(newGuardArray); - setObjVar(fake_chest, "guards", newGuardArray); - return SCRIPT_CONTINUE; - } - - - public boolean fillTreasureChestWithLoot(obj_id player, obj_id treasureChest, int groupModifier, String loot_table, int treasureLevel) throws InterruptedException - { - loot.makeLootInContainer(treasureChest, loot_table, TREASURE_LOOT_ITEMS, treasureLevel); - - CustomerServiceLog("treasureMap", "Player: "+ player + " "+ getName(player) - + " has spawned a treasure chest: "+ treasureChest - + " with loot of level: "+ treasureLevel - + " using loot table: "+ loot_table - + ". This function gives the chest 6 items. [ fillTreasureChestWithLoot() ]"); - - if (groupModifier < 4) - { - return true; - } - - if (!loot_table.equals(LOOT_TABLE_81_90)) - { - return true; - } - - if (groupModifier >= 4 && groupModifier < 8) - { - int bonus = rand(1,100); - boolean bonusReceived = fourParticipantBonusLootItem(treasureChest, treasureLevel, bonus); - - CustomerServiceLog("treasureMap", "Player: "+ player + " "+ getName(player) - + " has received a bonus treasure item in: "+ treasureChest - + " because the player was in a group of 4 or more (but less than 8 total)" + ". This function gives the chest 1 item and the chest should now have 7 items total. [ fillTreasureChestWithLoot() ]"); - } - - else if (groupModifier >= 8) - { - - int firstBonus = rand(1,100); - int secondBonus = rand(1,100); - boolean firstBonusReceived = eightParticipantBonusLootItem(treasureChest, treasureLevel, firstBonus); - boolean secondBonusReceived = eightParticipantBonusLootItem(treasureChest, treasureLevel, secondBonus); - - CustomerServiceLog("treasureMap", "Player: "+ player + " "+ getName(player) - + " has received a TWO bonus treasure items in: "+ treasureChest - + " because the player was in a group of 8" + ". This function gives the chest 2 items and the chest should now have 8 items total. [ fillTreasureChestWithLoot() ]"); - } - return true; - } - - - public boolean eightParticipantBonusLootItem(obj_id treasureChest, int treasureLevel, int randomNumber) throws InterruptedException - { - if (randomNumber <= EIGHT_GROUP_PERCENT_CHANCE_FOR_SUPER_RARE) - { - loot.makeLootInContainer(treasureChest, RARE_BONUS_LOOT_TABLE_81_90, NUMBER_OF_BONUS_LOOT_ITEMS, treasureLevel); - - CustomerServiceLog("treasureMap", "Treasure Chest: "+ treasureChest - + " has received a VERY RARE treasure item because they rolled a: "+ randomNumber - + ". The player should have this rare item added to their chest. [ eightParticipantBonusLootItem() ]"); - - return true; - } - else if (randomNumber > EIGHT_GROUP_PERCENT_CHANCE_FOR_SUPER_RARE && randomNumber <= EIGHT_GROUP_PERCENT_CHANCE_FOR_RARE) - { - loot.makeLootInContainer(treasureChest, BONUS_LOOT_TABLE_81_90, NUMBER_OF_BONUS_LOOT_ITEMS, treasureLevel); - - CustomerServiceLog("treasureMap", "Treasure Chest: "+ treasureChest - + " has received a SOMEWHAT RARE treasure item because they rolled a: "+ randomNumber - + ". The player should have this rare item added to their chest. [ eightParticipantBonusLootItem() ]"); - - return true; - } - - loot.makeLootInContainer(treasureChest, LOOT_TABLE_81_90, NUMBER_OF_BONUS_LOOT_ITEMS, treasureLevel); - - CustomerServiceLog("treasureMap", "Treasure Chest: "+ treasureChest - + " has received a regular roll: "+ randomNumber - + ". They still have a slight chance of receiving a somewhat rare item." + " The player should have this rare item added to their chest. [ eightParticipantBonusLootItem() ]"); - - return true; - } - - - public boolean fourParticipantBonusLootItem(obj_id treasureChest, int treasureLevel, int randomNumber) throws InterruptedException - { - if (randomNumber <= FOUR_GROUP_PERCENT_CHANCE_FOR_RARE) - { - loot.makeLootInContainer(treasureChest, BONUS_LOOT_TABLE_81_90, NUMBER_OF_BONUS_LOOT_ITEMS, treasureLevel); - - CustomerServiceLog("treasureMap", "Treasure Chest: "+ treasureChest - + " has received a SOMEWHAT RARE treasure item because they rolled a: "+ randomNumber - + ". The player should have this rare item added to their chest. [ fourParticipantBonusLootItem() ]"); - - return true; - } - - loot.makeLootInContainer(treasureChest, LOOT_TABLE_81_90, NUMBER_OF_BONUS_LOOT_ITEMS, treasureLevel); - - CustomerServiceLog("treasureMap", "Treasure Chest: "+ treasureChest - + " has received a regular roll: "+ randomNumber - + ". They still have a slight chance of receiving a somewhat rare item." + " The player should have this rare item added to their chest. [ fourParticipantBonusLootItem() ]"); - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_drum.java b/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_drum.java deleted file mode 100644 index 078870454..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_drum.java +++ /dev/null @@ -1,47 +0,0 @@ -package script.systems.treasure_map.base; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - - -public class treasure_drum extends script.base_script -{ - public treasure_drum() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - - messageTo(self, "cleanUpChest", null, 1000, true); - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToReceiveItem(obj_id self, obj_id srcContainer, obj_id transferer, obj_id item) throws InterruptedException - { - if (isPlayer(transferer)) - { - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int cleanUpChest(obj_id self, dictionary params) throws InterruptedException - { - obj_id chest = self; - - playClientEffectLoc(self, "clienteffect/lair_damage_light.cef", getLocation(self), 1f); - destroyObject(chest); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_guard.java b/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_guard.java deleted file mode 100644 index a7406b459..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_guard.java +++ /dev/null @@ -1,338 +0,0 @@ -package script.systems.treasure_map.base; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.anims; -import script.library.chat; -import script.library.create; -import script.library.group; -import script.library.prose; -import script.library.utils; -import script.ai.ai_combat; - - -public class treasure_guard extends script.base_script -{ - public treasure_guard() - { - } - public static final String RARE_CHAT = "rare_elite_chat"; - - - public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException - { - if (!ai_lib.isAttackable(self)) - { - CustomerServiceLog("treasureMap", "Mob: "+ self + " "+ getName(self) - + " is NOT ATTACKABLE to: "+ attacker - + " Mob location: "+ getLocation(self) - +". [ OnCreatureDamaged() ]"); - } - - if (getBehavior(self) != BEHAVIOR_CALM && getBehavior(self) != BEHAVIOR_ATTACK) - { - CustomerServiceLog("treasureMap", "Mob: "+ self + " "+ getName(self) - + " is being attacked by: "+ attacker - + " at location: "+ getLocation(self) - +" with a behavior int: "+ getBehavior(self) - +". [ OnCreatureDamaged() ]"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - - messageTo( self, "cleanUpGuard", null, 1000, true ); - - messageTo( self, "attackThief", null, 1, false ); - - detachScript( self, "npc.converse.npc_convo"); - detachScript( self, "npc.converse.npc_converse_menu"); - - return SCRIPT_CONTINUE; - } - - - public int OnDeath(obj_id self, obj_id killer, obj_id corpseId) throws InterruptedException - { - CustomerServiceLog("treasureMap", "Mob: "+ self + " "+ getName(self) - + " died at the hands of: "+ killer - + " at location: "+ getLocation(self) - +". [ OnDeath() ]"); - - if (utils.hasObjVar(self, "glow")) - { - messageTo(self, "glow", null, 2, false ); - return SCRIPT_CONTINUE; - } - - obj_id fake_chest = getObjIdObjVar(self, "fake_chest"); - if (isValidId(fake_chest) && exists(fake_chest)) - { - - messageTo(fake_chest, "recalculateGuardArray", null, 0, false ); - } - - boolean wookieeNPC = isWookiee(self); - if (wookieeNPC) - { - return SCRIPT_CONTINUE; - } - - int combatLevel = getIntObjVar(self, "intCombatDifficulty"); - if (combatLevel < 88) - { - return SCRIPT_CONTINUE; - } - - int glow = rand(1,100); - if (glow == 50 || glow == 100) - { - messageTo(self, "glow", null, 2, false ); - } - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - obj_id glowingMob = getObjIdObjVar(self, "glowing_mob"); - if (!isValidId(glowingMob) || !exists(glowingMob)) - { - return SCRIPT_CONTINUE; - } - - destroyObject(glowingMob); - return SCRIPT_CONTINUE; - } - - - public int cleanUpGuard(obj_id self, dictionary params) throws InterruptedException - { - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int attackThief(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = getObjIdObjVar( self, "player"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (!group.isGrouped(player)) - { - startCombat(self, player); - return SCRIPT_CONTINUE; - } - else - { - - obj_id groupObj = getGroupObject(player); - if (!isValidId(groupObj) || !exists(groupObj)) - { - return SCRIPT_CONTINUE; - } - - obj_id[] members = getGroupMemberIds(groupObj); - if ((members == null) || (members.length == 0)) - { - return SCRIPT_CONTINUE; - } - - boolean success = getRandomGroupMember(self, player, members); - - if (!success && members.length >= 4) - { - boolean secondTry = getRandomGroupMember(self, player, members); - if (!secondTry) - { - startCombat(self, player); - CustomerServiceLog("treasureMap", "TREASURE MAP ERROR: Mob: "+ self + " "+ getName(self) - + " is attacking: "+ player + " "+ getName(player) - + " by default. This means the function failed to have the mob attach a group member" + " [ attackThief() ]"); - } - } - else - { - startCombat(self, player); - - CustomerServiceLog("treasureMap", "Mob: "+ self + " "+ getName(self) - + " is attacking: "+ player + " "+ getName(player) - + ". [ attackThief() ]"); - } - } - - return SCRIPT_CONTINUE; - } - - - public int glow(obj_id self, dictionary params) throws InterruptedException - { - - obj_id[] primaryKillers = getObjIdArrayObjVar(self, "scenario.primaryKillers"); - if ((primaryKillers == null) || (primaryKillers.length == 0)) - { - return SCRIPT_CONTINUE; - } - - obj_id priKiller = primaryKillers[0]; - if (!isValidId(priKiller) || !exists(priKiller)) - { - return SCRIPT_CONTINUE; - } - - String mobTemplate = getTemplateName(self); - if (mobTemplate.equals("")) - { - return SCRIPT_CONTINUE; - } - - location glowLocation = getLocation(self); - if (glowLocation == null) - { - return SCRIPT_CONTINUE; - } - - obj_id glowingMob = create.object( mobTemplate, glowLocation, 1, true, false ); - if (!isValidId(glowingMob) || !exists(glowingMob)) - { - return SCRIPT_CONTINUE; - } - - setObjVar(self, "glowing_mob", glowingMob); - setInvulnerable(glowingMob, true); - setState(glowingMob, STATE_GLOWING_JEDI, true); - setName(glowingMob, "Force Apparition"); - - faceTo(glowingMob, priKiller); - - chat.chat(glowingMob, chat.CHAT_SHOUT, chat.MOOD_ANGRY, new string_id("treasure_map/treasure_map", RARE_CHAT)); - - messageTo( self, "expression_fist", null, 1, true ); - messageTo( self, "expression_disappear", null, 6, true ); - - messageTo( self, "cleanUpGlowie", null, 10, true ); - return SCRIPT_CONTINUE; - } - - - public int expression_fist(obj_id self, dictionary params) throws InterruptedException - { - obj_id glowingMob = getObjIdObjVar(self, "glowing_mob"); - if (!isValidId(glowingMob) || !exists(glowingMob)) - { - return SCRIPT_CONTINUE; - } - doAnimationAction (glowingMob, anims.PLAYER_POUND_FIST_PALM); - - return SCRIPT_CONTINUE; - } - - - public int expression_disappear(obj_id self, dictionary params) throws InterruptedException - { - obj_id glowingMob = getObjIdObjVar(self, "glowing_mob"); - if (!isValidId(glowingMob) || !exists(glowingMob)) - { - return SCRIPT_CONTINUE; - } - - doAnimationAction (glowingMob, anims.PLAYER_FORCE_ILLUSION); - - return SCRIPT_CONTINUE; - } - - - public int cleanUpGlowie(obj_id self, dictionary params) throws InterruptedException - { - obj_id glowingMob = getObjIdObjVar(self, "glowing_mob"); - if (!isValidId(glowingMob) || !exists(glowingMob)) - { - return SCRIPT_CONTINUE; - } - - destroyObject(glowingMob); - - return SCRIPT_CONTINUE; - } - - - public boolean getRandomGroupMember(obj_id self, obj_id player, obj_id[] members) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if ((members == null) || (members.length == 0)) - { - return false; - } - - int j = rand(0, members.length-1); - if (getDistance(getLocation(self), getLocation(members[j])) < 100) - { - startCombat(self, members[j]); - - CustomerServiceLog("treasureMap", "Mob: "+ self + " "+ getName(self) - + " is attacking: "+ members[j] + " "+ getName(members[j]) - + " located: "+ getLocation(members[j]) - +". [ getRandomGroupMember() ]"); - - return true; - } - return false; - } - - - public boolean isWookiee(obj_id playerOrMob) throws InterruptedException - { - int species = getSpecies(playerOrMob); - if (species == SPECIES_WOOKIEE) - { - return true; - } - - return false; - } - - - public int barkAttack(obj_id self, dictionary params) throws InterruptedException - { - obj_id guard = self; - if (params == null) - { - return SCRIPT_CONTINUE; - } - - boolean wookieeNPC = isWookiee(guard); - - if (!wookieeNPC) - { - String type = params.getString("type"); - chat.chat(self, chat.CHAT_SHOUT, chat.MOOD_ANGRY, new string_id("treasure_map/treasure_map", "bark_"+type)); - } - else - { - chat.chat(self, chat.CHAT_SHOUT, chat.MOOD_ANGRY, new string_id("treasure_map/treasure_map", "bark_wookiee")); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_map.java b/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_map.java deleted file mode 100644 index a9eda6352..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/treasure_map/base/treasure_map.java +++ /dev/null @@ -1,1320 +0,0 @@ -package script.systems.treasure_map.base; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.buff; -import script.library.combat; -import script.library.groundquests; -import script.library.locations; -import script.library.stealth; -import script.library.sui; -import script.library.utils; - - -public class treasure_map extends script.base_script -{ - public treasure_map() - { - } - public static final string_id SID_USE = new string_id("treasure_map/treasure_map", "use"); - public static final string_id SID_SEARCH_AREA = new string_id("treasure_map/treasure_map", "search_area"); - public static final string_id SID_EXTRACT_TREASURE = new string_id("treasure_map/treasure_map", "extract_treasure"); - public static final string_id SID_SYS_NO_REGIONS = new string_id("treasure_map/treasure_map", "sys_no_regions"); - public static final string_id SID_SYS_STORE_WAYPOINT = new string_id("treasure_map/treasure_map", "sys_store_waypoint"); - public static final string_id SID_SYS_WAYPOINT_EXISTS = new string_id("treasure_map/treasure_map", "sys_waypoint_exists"); - public static final string_id SID_SYS_DIST_HERE = new string_id("treasure_map/treasure_map", "sys_dist_here"); - public static final string_id SID_SYS_DIST_NEAR = new string_id("treasure_map/treasure_map", "sys_dist_near"); - public static final string_id SID_SYS_DIST_FAR = new string_id("treasure_map/treasure_map", "sys_dist_far"); - public static final string_id SID_SYS_NOT_IN_INV = new string_id("treasure_map/treasure_map", "sys_not_in_inv"); - public static final string_id SID_SYS_NO_WAYPOINT = new string_id("treasure_map/treasure_map", "sys_no_waypoint"); - public static final string_id SID_SYS_START_PINPOINT = new string_id("treasure_map/treasure_map", "sys_start_pinpoint"); - public static final string_id SID_SYS_CANT_PINPOINT = new string_id("treasure_map/treasure_map", "sys_cant_pinpoint"); - public static final string_id SID_SYS_PINPOINT = new string_id("treasure_map/treasure_map", "sys_pinpoint"); - public static final string_id SID_SYS_FOUND = new string_id("treasure_map/treasure_map", "sys_found"); - public static final string_id SID_SYS_EXTRACTING = new string_id("treasure_map/treasure_map", "sys_extracting"); - public static final string_id SID_SYS_NO_COMBAT = new string_id("treasure_map/treasure_map", "sys_no_combat"); - public static final string_id SID_SYS_NO_MOUNT = new string_id("treasure_map/treasure_map", "sys_no_mount"); - public static final string_id SID_SYS_NO_DEAD_INCAP = new string_id("treasure_map/treasure_map", "sys_no_dead_incap"); - public static final string_id SID_SYS_TREASURE_TIME_LIMIT = new string_id("treasure_map/treasure_map", "sys_time_limit"); - - public static final String SID_STORE_WAYPOINT = "@treasure_map/treasure_map:store_waypoint"; - public static final String SID_CLOSE = "@treasure_map/treasure_map:close"; - public static final String SCRIPT_DUMMY_CHEST = "systems.treasure_map.base.dummy_treasure_drum"; - public static final String TREASURE_TABLE = "datatables/treasure_map/treasure_map.iff"; - public static final String DUMMY_CHEST = "object/tangible/container/drum/nonopening_treasure_drum.iff"; - public static final String LOOT_TABLE_81_90 = "treasure/treasure_81_90"; - - public static final int EXPLOITER_RANGE = 64; - public static final int MIN_DISTANCE_TO_MAP_OWNER = 300; - public static final int MAX_DISTANCE_FOR_SEARCH = 16; - - - public int OnAttach(obj_id self) throws InterruptedException - { - obj_id map = self; - messageTo(map, "getMapTreasurePlanet", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - - obj_id map = self; - obj_id player = getObjIdObjVar(map, "owner"); - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id chest = getObjIdObjVar(map, "chest"); - if (!isIdValid(chest) || !exists(chest)) - { - obj_id mapWaypoint = getObjIdObjVar(map, "treasureMapWaypoint"); - if (isIdValid(mapWaypoint)) - { - - destroyWaypointInDatapad(mapWaypoint, player); - removeObjVar(chest, "treasureMapWaypoint"); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isIdValid(player)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to retrieve a menu for player "+ player + ". [ OnObjectMenuRequest() ]"); - sendSystemMessage(player, "The treasure map failed to retrieve the menu correctly.", null); - return SCRIPT_CONTINUE; - } - - obj_id map = self; - if (!hasObjVar( map, "pinpoint")) - { - - if (!isValidId(getWaypoint(map, player))) - { - mi.addRootMenu (menu_info_types.ITEM_USE, SID_USE); - } - else - { - mi.addRootMenu (menu_info_types.ITEM_USE, SID_SEARCH_AREA); - setObjVar( map, "searchArea", true ); - } - } - else - { - if (!isValidId(getWaypoint(map, player))) - { - mi.addRootMenu (menu_info_types.ITEM_USE, SID_USE); - } - else - { - mi.addRootMenu (menu_info_types.ITEM_USE, SID_EXTRACT_TREASURE); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) && item == -1) - { - CustomerServiceLog("treasureMap", "a treasure map trigger failed for player "+ player + ". [ OnObjectMenuSelect() ]"); - sendSystemMessage(player, "The treasure map failed to select the menu correctly.", null); - return SCRIPT_CONTINUE; - } - - obj_id map = self; - sendDirtyObjectMenuNotification(map); - if (item == menu_info_types.ITEM_USE) - { - if (hasObjVar(map, "pinpoint") && hasObjVar(map, "searchArea")) - { - doDebugLogging("treasureMap", "Player has pinpoint and searchArea"); - - boolean statePass = checkState(player); - if (!statePass) - { - return SCRIPT_CONTINUE; - } - - boolean planetCheck = checkScene(player, map); - if (!planetCheck) - { - return SCRIPT_CONTINUE; - } - - extractTreasure(map, player); - - return SCRIPT_CONTINUE; - } - else if (!hasObjVar(map, "pinpoint") && hasObjVar(map, "searchArea") && isValidId(getWaypoint(map, player))) - { - doDebugLogging("treasureMap", "Player has just searchArea"); - - boolean statePass = checkState(player); - if (!statePass) - { - return SCRIPT_CONTINUE; - } - - boolean planetCheck = checkScene(player, map); - if (!planetCheck) - { - return SCRIPT_CONTINUE; - } - - searchArea(map, player); - - return SCRIPT_CONTINUE; - } - else - { - doDebugLogging("treasureMap", "player has no objvars or has deleted waypoint"); - - displayDialog( map, player ); - - return SCRIPT_CONTINUE; - } - - } - return SCRIPT_CONTINUE; - } - - - public obj_id getWaypoint(obj_id map, obj_id player) throws InterruptedException - { - if (!isIdValid(map)) - { - CustomerServiceLog("treasureMap", "a treasure map would not retrieve a waypoint for player because the map OID was not passed properly. [ getWaypoint() ]"); - sendSystemMessage(player, "The treasure map failed to get a waypoint.", null); - return null; - } - if (!isIdValid(player)) - { - CustomerServiceLog("treasureMap", "a treasure map would not retrieve a waypoint for player because the player OID was not passed properly. [ getWaypoint() ]"); - return null; - } - - location treasureLoc = getLocationObjVar(map, "treasureLoc"); - - obj_id[] data = getWaypointsInDatapad(player); - if (data != null) - { - for (int i=0; i= 0) - { - - obj_id waypoint = getWaypoint( map, player ); - - treasureLoc = groundquests.getRandom2DLocationAroundLocation(player, 1, 1, 10, 40); - sendSystemMessage( player, SID_SYS_PINPOINT ); - setWaypointLocation( waypoint, treasureLoc ); - setObjVar( map, "treasureLoc", treasureLoc ); - - setObjVar( map, "pinpoint", true ); - } - else - { - - sendSystemMessage( player, SID_SYS_CANT_PINPOINT ); - } - - return SCRIPT_CONTINUE; - } - - - public void extractTreasure(obj_id map, obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - CustomerServiceLog("treasureMap", "a treasure map would not allow the player to extract the treasure because no player OID was passed. [ extractTreasure() ]"); - return; - } - if (!isIdValid(map)) - { - CustomerServiceLog("treasureMap", "a treasure map would not allow the player to extract the treasure for player "+ player + ". [ extractTreasure() ]"); - sendSystemMessage(player, "The treasure map failed. You cannot extract the treasure.", null); - return; - } - - obj_id inventory = getObjectInSlot( player, "inventory"); - if (!contains( inventory, map )) - { - sendSystemMessage( player, SID_SYS_NOT_IN_INV ); - return; - } - - if (!hasObjVar( map, "treasureLoc" ) || (getWaypoint( map, player ) == null)) - { - sendSystemMessage( player, SID_SYS_NO_WAYPOINT ); - return; - } - - if (hasObjVar( map, "extracting" )) - { - sendSystemMessage( player, SID_SYS_EXTRACTING ); - return; - } - - location treasureLoc = getLocationObjVar( map, "treasureLoc"); - location curLoc = getLocation(player); - float dist = utils.getDistance2D( treasureLoc, curLoc ); - if (dist <= 8 && dist >= 0) - { - - sendSystemMessage( player, SID_SYS_DIST_HERE ); - - CustomerServiceLog("treasureMap", "Player: "+ player + " "+ getName(player) - + " is extracting a chest using: "+ map - + " at location "+ getLocation(player) + ". [ extractTreasure() ]"); - - dictionary params = new dictionary(); - params.put( "player", player ); - messageTo( map, "spawnTreasure", params, 2, false ); - - setObjVar( map, "extracting", true ); - - } - else if (dist <= 30) - { - - sendSystemMessage( player, SID_SYS_DIST_NEAR ); - } - else - { - - sendSystemMessage( player, SID_SYS_DIST_FAR ); - } - } - - - public int spawnTreasure(obj_id self, dictionary params) throws InterruptedException - { - obj_id map = self; - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId( "player"); - boolean paramsReceived = getTreasureParams(map, player); - - if (!paramsReceived) - { - CustomerServiceLog("treasureMap", "TREASURE MAP ERROR: Player: "+ player + " "+ getName(player) - + " could not spawn a treasure chest at location: "+ getLocation(player) - + ". Please notify development. [ spawnTreasure() ]"); - - doDebugLogging("treasureMap", "a treasure map failed to spawn for player: "+player+". [ spawnTreasure() ]"); - sendSystemMessage(player, "You could not extract the chest. Notify Customer Service.", null); - - return SCRIPT_CONTINUE; - } - - int treasureLevel = getIntObjVar(map, "max"); - - removeObjVar(map, "extracting"); - - sendSystemMessage( player, SID_SYS_FOUND ); - sendSystemMessage(player, SID_SYS_TREASURE_TIME_LIMIT); - - obj_id waypoint = getWaypoint( map, player ); - if (isIdNull(waypoint)) - { - destroyObject( waypoint ); - } - - location playerLocation = getLocation(player); - playerLocation.y = getHeightAtLocation( playerLocation.x, playerLocation.z ); - - obj_id treasureChest = createObject(DUMMY_CHEST, playerLocation); - if (!isValidId(treasureChest)) - { - CustomerServiceLog("treasureMap", "TREASURE MAP ERROR: Player: "+ player + " "+ getName(player) - + " could not spawn a treasure chest at location: "+ playerLocation - + ". Please notify development. [ spawnTreasure() ]"); - - doDebugLogging("treasureMap", "a treasure map failed to spawn for player: "+player+". [ spawnTreasure() ]"); - sendSystemMessage(player, "You could not extract the chest. Notify Customer Service.", null); - - return SCRIPT_CONTINUE; - } - - setObjVar(treasureChest, "owner", player); - setOwner(treasureChest, player); - - String invis = stealth.getInvisBuff(player); - if (invis != null) - { - stealth.checkForAndMakeVisibleNoRecourse(player); - } - - attachScript(treasureChest, SCRIPT_DUMMY_CHEST); - - setObjVar(map, "chest", treasureChest); - - setObjVar(treasureChest, "treasureLevel", treasureLevel); - - if (hasObjVar(map, "treasureMapWaypoint")) - { - obj_id treasureMapWaypoint = getObjIdObjVar(map, "treasureMapWaypoint"); - setObjVar(treasureChest, "treasureMapWaypoint", treasureMapWaypoint); - } - - String loot_table = getStringObjVar(map, "loot_table"); - setObjVar(treasureChest, "loot_table", loot_table); - String type = getStringObjVar(map, "mob"); - int mobLevel = getIntObjVar(map, "mobLevel"); - int groupModifier = getIntObjVar(map, "groupModifier"); - int count = getIntObjVar(map, "count"); - int dataTableIdx = getIntObjVar(map, "dataTableIdx"); - - boolean verifiedAllVars = verifyVariablesNotNull(loot_table, type, mobLevel, groupModifier, count, dataTableIdx); - if (!verifiedAllVars) - { - CustomerServiceLog("treasureMap", "TREASURE MAP ERROR: Player: "+ player + " "+ getName(player) - + " could not spawn guards correctly because data taken off the map: "+ map - + " was incomplete, corrupted or invalid. [ spawnTreasure() ]"); - - doDebugLogging("treasureMap", "a treasure map failed to retrieve all data necessary to spawn treasure for player: "+player+". [ spawnTreasure() ]"); - sendSystemMessage(player, "The treasure map failed to attain treasure guard data. Notify Customer Service.", null); - } - - String boss_mob = checkForBossMobSpawn(player, mobLevel, groupModifier, dataTableIdx, loot_table); - - dictionary outparams = new dictionary(); - outparams.put("loot_table", loot_table); - outparams.put("count", count); - outparams.put("type", type); - outparams.put("mobLevel", mobLevel); - outparams.put("location", playerLocation); - outparams.put("player", player); - outparams.put("boss_mob", boss_mob); - outparams.put("groupModifier", groupModifier); - - doDebugLogging("treasureMap", "loot_table: "+ loot_table - + " count: "+ count - + " type: "+ type - + "player: "+ player - + "treasureLoc: "+ playerLocation - + "boss_mob: "+ boss_mob - ); - - CustomerServiceLog("treasureMap", "Player: "+ player + " "+ getName(player) - + " spawned treasure chest: "+ treasureChest - + " at location: "+ getLocation(treasureChest) - + " with "+ count - + " mobs of type: "+ type - + " and their level being: "+ mobLevel - +". [ spawnTreasure() ]"); - - messageTo(treasureChest, "spawnTreasureGuards", outparams, 0, false); - - CustomerServiceLog("treasureMap", "Player: "+ player + " "+ getName(player) - + " extracted the treasure chest at location: "+ playerLocation - + " and the map:"+ map - + " was destroyed. [ spawnTreasure() ]"); - - doDebugLogging("treasureMap", "map: "+ map + " destroyed. [ spawnTreasure() ]"); - - destroyObject(map); - return SCRIPT_CONTINUE; - } - - - public boolean getTreasureParams(obj_id map, obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to get the treasure parameters because the player OID was not passed. [ getTreasureParams() ]"); - return false; - } - if (!isIdValid(map)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to get the treasure parameters because the map OID was not passed. [ getTreasureParams() ]"); - sendSystemMessage(player, "The treasure map failed to get the loot table and group modifier.", null); - return false; - } - - if (!hasObjVar(map, "max")) - { - CustomerServiceLog("treasureMap", "a treasure map failed to get the treasure parameters because the max variable was not found on the map. [ getTreasureParams() ]"); - sendSystemMessage(player, "The treasure map failed to find the map max level.", null); - return false; - } - - boolean successPlayerLvl = setPlayerGroupLevel(map, player); - if (!successPlayerLvl) - { - CustomerServiceLog("treasureMap", "a treasure map failed to retrieve the player combat level. [ getTreasureParams() ]"); - sendSystemMessage(player, "The treasure map failed to retrieve your combat level.", null); - return false; - } - - int intMaxLevel = getIntObjVar(map, "max"); - int intMinLevel = getIntObjVar(map, "min"); - int dataTableIdx = getIntObjVar(map, "dataTableIdx"); - - if (dataTableIdx == -1) - { - CustomerServiceLog("treasureMap", "a treasure map failed to retrieve the datatable index. This is possibly due to the datatable being changed or corrupted . [ getTreasureParams() ]"); - sendSystemMessage(player, "The treasure map failed to retrieve a data index.", null); - return false; - } - - int count = 0; - - String type = null; - dictionary params = dataTableGetRow(TREASURE_TABLE, dataTableIdx); - if (params.isEmpty() || params == null) - { - CustomerServiceLog("treasureMap", "a treasure map failed to get the treasure loot table and group modifier for player "+ player + ". [ getTreasureParams() ]"); - sendSystemMessage(player, "The treasure map failed to get the loot table and group modifier.", null); - return false; - } - - setObjVar(map, "loot_table", params.getString("loot_table")); - - if (!hasObjVar(map, "count")) - { - count = rand(params.getInt("mob_count_min"), params.getInt("mob_count_max")); - if (hasObjVar(map, "playerLevel")) - { - int playerLevel = getIntObjVar(map, "playerLevel"); - - int mobLevelModifier = params.getInt("mob_level_modifier"); - - int mobLevel = getMobLevel(map, player, playerLevel, intMaxLevel, intMinLevel, mobLevelModifier); - setObjVar(map, "mobLevel", mobLevel); - if (hasObjVar(map, "groupModifier")) - { - count = getEnemyReCount(player, map, count); - } - } - setObjVar(map, "count", count); - } - return true; - } - - - public boolean setPlayerGroupLevel(obj_id map, obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to set the group level because the player OID was not passed. [ setPlayerGroupLevel() ]"); - return false; - } - if (!isIdValid(map)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to set the group level because the map OID was not passed. [ setPlayerGroupLevel() ]"); - sendSystemMessage(player, "The treasure map failed to set the group level.", null); - return false; - } - - int intPlayerLevel = getLevel(player); - if (intPlayerLevel == -1|| intPlayerLevel == 0) - { - CustomerServiceLog("treasureMap", "a treasure map failed to use the player's correct combat level. [ setPlayerGroupLevel() ]"); - sendSystemMessage(player, "The treasure map failed to retrieve your current level.", null); - - intPlayerLevel = 5; - return false; - } - - location ownerLocation = getLocation(player); - String ownerArea = ownerLocation.area; - obj_id groupId = getGroupObject(player); - if (isValidId(groupId)) - { - obj_id[] groupOids = getGroupMemberIds(groupId); - - int finalCount = 1; - - for (int i = 0; i < groupOids.length; i++) - { - testAbortScript(); - if (!isValidId(groupOids[i]) || !exists(groupOids[i])) - { - continue; - } - - if (groupOids[i] == player) - { - continue; - } - - location groupMemberLocation = getLocation(groupOids[i]); - if (groupMemberLocation == null) - { - continue; - } - - String groupMemberArea = groupMemberLocation.area; - if (!ownerArea.equals(groupMemberArea)) - { - continue; - } - - float dist = utils.getDistance2D(ownerLocation, groupMemberLocation); - if (dist > MIN_DISTANCE_TO_MAP_OWNER) - { - continue; - } - - int groupMemberLevel = getLevel(groupOids[i]); - - if (groupMemberLevel > intPlayerLevel) - { - intPlayerLevel = groupMemberLevel; - } - - finalCount++; - } - - if (finalCount > 0 && finalCount <= 8) - { - setObjVar(map, "groupModifier", finalCount); - } - else if (finalCount > 8) - { - - setObjVar(map, "groupModifier", 8); - } - } - - else - { - removeObjVar(map, "groupModifier"); - } - - setObjVar(map, "playerLevel", intPlayerLevel); - return true; - } - - - public int findAmbushNearBy(obj_id map, obj_id player, int intPlayerLevel, location ownerLocation) throws InterruptedException - { - if (!isIdValid(player)) - { - return 0; - } - if (intPlayerLevel < 0) - { - return 0; - } - if (ownerLocation == null) - { - return 0; - } - - int exploiterLevel = intPlayerLevel; - int exploiterGroup = 0; - - obj_id[] playersNear = getAllObjectsWithScript(ownerLocation, EXPLOITER_RANGE, "player.base.base_player"); - if (playersNear == null || playersNear.length == 0) - { - return 0; - } - - for (int i = 0; i < playersNear.length; i++) - { - testAbortScript(); - if (!isValidId(playersNear[i]) || !exists(playersNear[i])) - { - continue; - } - - if (!isPlayer(playersNear[i])) - { - continue; - } - - if (playersNear[i] == player) - { - continue; - } - - if (getLocomotion(playersNear[i]) == 3) - { - continue; - } - - if (i == 14) - { - break; - } - - int playerNearLevel = getLevel(playersNear[i]); - if (playerNearLevel > intPlayerLevel) - { - exploiterLevel = playerNearLevel; - exploiterGroup =+ 1; - } - } - - int groupModifier = getIntObjVar(map, "groupModifier"); - if (groupModifier > 0) - { - exploiterGroup =+ groupModifier; - } - - if (exploiterGroup > 8) - { - exploiterGroup = 8; - } - - sendSystemMessage(player, "exploiterGroup:"+exploiterGroup, null); - sendSystemMessage(player, "groupModifier:"+groupModifier, null); - - if (exploiterGroup > 0 && exploiterGroup > groupModifier) - { - setObjVar(map, "groupModifier", exploiterGroup); - } - - return exploiterLevel; - } - - - public int getEnemyReCount(obj_id player, obj_id map, int intCurrentCount) throws InterruptedException - { - if (!isIdValid(player)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to recount the enemies before treasure extraction because the player OID was not received. [ getEnemyReCount() ]"); - return -1; - } - if (!isIdValid(map)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to recount the enemies before treasure extraction because the map OID was not received. [ getEnemyReCount() ]"); - sendSystemMessage(player, "The treasure map failed to recount enemies.", null); - return -1; - } - if (intCurrentCount == -1) - { - CustomerServiceLog("treasureMap", "a treasure map failed to recount the enemies before treasure extraction because the enemy count was -1. [ getEnemyReCount() ]"); - sendSystemMessage(player, "The treasure map failed to recount enemies due to incorrect enemy count variable.", null); - return -1; - } - - int groupRecount = 0; - int finalCount = 0; - - if (hasObjVar(map, "groupModifier")) - { - - int modifier = getIntObjVar(map, "groupModifier"); - if (modifier >= 2) - { - if (modifier <= 4) - { - groupRecount = modifier+2; - } - else - { - groupRecount = rand(modifier, modifier+1); - } - } - } - if (groupRecount > intCurrentCount) - { - return groupRecount; - } - - return intCurrentCount; - } - - - public location getMapLocation(obj_id map, obj_id player) throws InterruptedException - { - if (!isIdValid(player)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to recount the enemies before treasure extraction because the player OID was not received. [ getEnemyReCount() ]"); - return null; - } - if (!isIdValid(map)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to recount the enemies before treasure extraction because the map OID was not received. [ getEnemyReCount() ]"); - sendSystemMessage(player, "The treasure map failed to recount enemies.", null); - return null; - } - - location treasureLoc = null; - location storedLoc = getLocationObjVar( map, "treasureLoc"); - - if (storedLoc == null) - { - setObjVar(map, "owner", player); - setObjVar(map, "noTrade", true); - - region[] nearRegions = getRegionsAtPoint( getLocation( player ) ); - if (nearRegions == null) - { - - sendSystemMessage( player, SID_SYS_NO_REGIONS ); - destroyObject( map ); - return null; - } - - region closestCity = locations.getClosestCityRegion( nearRegions[0] ); - boolean goodLoc = false; - for (int i=0; (i < 30)&&!goodLoc; i++) - { - testAbortScript(); - - treasureLoc = locations.getGoodLocationOutsideOfRegion(closestCity, 1, 1, 8000); - - if (!isValidLocation(treasureLoc, 10.f) || treasureLoc == null || locations.isInCity(treasureLoc)) - { - continue; - } - goodLoc = true; - } - - if (treasureLoc == null) - { - return null; - } - - setObjVar( map, "treasureLoc", treasureLoc ); - } - else - { - treasureLoc = (location)storedLoc.clone(); - } - return treasureLoc; - } - - - public boolean createMapWaypointAtLocation(obj_id map, obj_id player, location locationMapLocation) throws InterruptedException - { - if (!isIdValid(player)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to create a waypoint because the player OID was not passed. [ getMobLevel() ]"); - return false; - } - if (!isIdValid(map)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to create a waypoint for player "+ player + " because the map object was not passed. [ createMapWaypointAtLocation() ]"); - sendSystemMessage(player, "The treasure map failed to attain a waypoint because there was no map found.", null); - return false; - } - if (locationMapLocation == null) - { - CustomerServiceLog("treasureMap", "a treasure map failed to create a waypoint for player "+ player + " because the map object was not passed. [ createMapWaypointAtLocation() ]"); - sendSystemMessage(player, "The treasure map failed to attain a waypoint because there was no map found.", null); - return false; - } - - obj_id waypoint = createWaypointInDatapad(player, locationMapLocation); - if (!isIdValid(waypoint)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to create a waypoint for player "+ player + " because the waypoint couldn't be created in the player datapad. [ createMapWaypointAtLocation() ]"); - sendSystemMessage(player, "The treasure map failed to create a waypoint in your datapad.", null); - return false; - } - - setWaypointVisible(waypoint, true); - setWaypointActive(waypoint, true); - setWaypointName(waypoint, "Treasure Location"); - - setObjVar(map, "treasureMapWaypoint", waypoint); - - sendSystemMessage( player, SID_SYS_STORE_WAYPOINT ); - return true; - } - - - public int getMobLevel(obj_id map, obj_id player, int playerLevel, int intMaxLevel, int intMinLevel, int mobLevelModifier) throws InterruptedException - { - if (!isIdValid(player)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to get the mob enemy level because the player OID was not passed. [ getMobLevel() ]"); - return -1; - } - if (!isIdValid(map)) - { - CustomerServiceLog("treasureMap", "a treasure map failed to get the mob enemy level for "+ player + " because the map OID was not passed. [ getMobLevel() ]"); - sendSystemMessage(player, "The treasure map failed to attain an accurate enemy mob level.", null); - return -1; - } - if (playerLevel < 5) - { - CustomerServiceLog("treasureMap", "a treasure map failed to get a useabel player level for "+ player + ". The player level is less than 5. [ getMobLevel() ]"); - sendSystemMessage(player, "The treasure map failed to attain your player level accurately.", null); - return -1; - } - if (intMaxLevel < 10 || intMinLevel > 90) - { - CustomerServiceLog("treasureMap", "a treasure map failed to get a mob level for "+ player + " because the map maximum level was out of range [ getMobLevel() ]"); - sendSystemMessage(player, "The treasure map failed to attain your player level accurately.", null); - return -1; - } - if (intMinLevel < 1 || intMinLevel > 81) - { - CustomerServiceLog("treasureMap", "a treasure map failed to get a mob level for "+ player + " because the map minimum level was out of range [ getMobLevel() ]"); - sendSystemMessage(player, "The treasure map failed to attain your player level accurately.", null); - return -1; - } - - if (playerLevel > intMaxLevel) - { - int newMobLevel = intMaxLevel + mobLevelModifier; - if (newMobLevel > 90) - { - return 90; - } - return newMobLevel; - } - if (playerLevel < intMinLevel) - { - return intMinLevel; - } - - int newMobLevel = playerLevel + mobLevelModifier; - if (newMobLevel > 90) - { - return 90; - } - return newMobLevel; - } - - - public int getMapTreasurePlanet(obj_id self, dictionary params) throws InterruptedException - { - obj_id map = self; - int intMaxLevel = getIntObjVar(map, "max"); - - if (intMaxLevel <= 0) - { - - setObjVar(map, "planet", "tatooine"); - CustomerServiceLog("treasureMap", "a treasure map failed to get the correct planet, setting map to Tatooine instead. [ getMapTreasurePlanet() ]"); - } - - int dataTableIdx = dataTableSearchColumnForInt(intMaxLevel, "map_level_max", TREASURE_TABLE); - if (dataTableIdx == -1) - { - - setObjVar(map, "planet", "tatooine"); - CustomerServiceLog( "treasureMap", "a treasure map failed to get the correct planet because the treasure map data table failed to return a row number. [ getMapTreasurePlanet() ]"); - } - - setObjVar(map, "dataTableIdx", dataTableIdx); - - String allPlanets = dataTableGetString(TREASURE_TABLE, dataTableIdx, "planets"); - String chosenPlanet = ""; - - String[] planetList = split(allPlanets, ','); - if (planetList.length == 1) - { - chosenPlanet = planetList[0]; - } - else - { - int planetIndex = rand(0,planetList.length-1); - chosenPlanet = planetList[planetIndex]; - } - if (chosenPlanet != null && !chosenPlanet.equals("")) - { - - setObjVar(map, "planet", chosenPlanet); - } - else - { - - setObjVar(map, "planet", "tatooine"); - } - return SCRIPT_CONTINUE; - } - - - public String checkForBossMobSpawn(obj_id player, int mobLevel, int groupModifier, int dataTableIdx, String loot_table) throws InterruptedException - { - if (!loot_table.equals(LOOT_TABLE_81_90)) - { - return "none"; - } - - if (isGod(player) && hasObjVar(player, "boss_mob")) - { - return dataTableGetString(TREASURE_TABLE, dataTableIdx, "boss_mob"); - } - if (mobLevel < 80) - { - return "none"; - } - if (groupModifier < 8) - { - return "none"; - } - - return dataTableGetString(TREASURE_TABLE, dataTableIdx, "boss_mob"); - } - - - public boolean verifyVariablesNotNull(String loot_table, String type, int mobLevel, int groupModifier, int count, int datTableIdx) throws InterruptedException - { - if (loot_table.equals("") || loot_table.equals("")) - { - return false; - } - if (type.equals("") || type.equals("")) - { - return false; - } - if (mobLevel <= 0) - { - return false; - } - if (groupModifier < 0) - { - return false; - } - if (count < 2) - { - return false; - } - if (datTableIdx < 0) - { - return false; - } - - return true; - } - - - public boolean checkState(obj_id player) throws InterruptedException - { - if (getState(player, STATE_COMBAT) == 1) - { - sendSystemMessage(player, SID_SYS_NO_COMBAT); - return false; - } - if (getState(player, STATE_RIDING_MOUNT) == 1) - { - sendSystemMessage(player, SID_SYS_NO_MOUNT); - return false; - } - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, SID_SYS_NO_DEAD_INCAP); - return false; - } - - return true; - } - - - public boolean checkScene(obj_id player, obj_id map) throws InterruptedException - { - - String req_planet = getStringObjVar(map, "planet"); - String scene = getCurrentSceneName(); - doDebugLogging("treasureMap", "planet: "+req_planet); - if (scene.equals(req_planet)) - { - return true; - } - - String requiredPlanet = localize(new string_id("planet_n", req_planet)); - sendSystemMessage(player, "You need to travel to "+ requiredPlanet + " before using the map.", null); - return false; - } - - - public void doDebugLogging(String section, String message) throws InterruptedException - { - LOG(section, message); - } -} diff --git a/sku.0/sys.server/compiled/game/script/systems/turret/advanced_turret_ai.java b/sku.0/sys.server/compiled/game/script/systems/turret/advanced_turret_ai.java deleted file mode 100644 index d64d328a4..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/turret/advanced_turret_ai.java +++ /dev/null @@ -1,135 +0,0 @@ -package script.systems.turret; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.advanced_turret; -import script.library.utils; - - -public class advanced_turret_ai extends script.systems.combat.combat_base -{ - public advanced_turret_ai() - { - } - public static final int INTERVAL_MAX = 10; - public static final int FARTHEST_TRIGGER = INTERVAL_MAX - 1; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - advanced_turret.activateTurret(self); - - return SCRIPT_CONTINUE; - } - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id who) throws InterruptedException - { - doLogging("OnTriggerEnt", ""+getName(who)+" has entered volume "+volumeName+" which is a valid volume name: "+volumeName.startsWith(advanced_turret.ALERT_VOLUME_NAME )); - if (volumeName.startsWith(advanced_turret.ALERT_VOLUME_NAME ) && who != self) - { - advanced_turret.addTarget(self, who); - } - else - { - doLogging("OnTriggerEnt", ""+getName(who)+" Was non-attackable"); - } - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id who) throws InterruptedException - { - - doLogging("OnTriggerExit", ""+getName(who)+" has exited volume name "+volumeName+" which is the farthest: "+volumeName.endsWith(advanced_turret.ALERT_VOLUME_NAME+FARTHEST_TRIGGER )); - if (volumeName.endsWith(advanced_turret.ALERT_VOLUME_NAME+FARTHEST_TRIGGER ) && who != self) - { - advanced_turret.removeTarget(self, who); - } - else - { - advanced_turret.addTarget(self, who); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectDamaged(obj_id self, obj_id attacker, obj_id weapon, int damage) throws InterruptedException - { - if (!advanced_turret.handleTurretDamage(self, attacker, weapon, damage)) - { - - int maxCondition = getMaxHitpoints(self); - setHitpoints(self, maxCondition); - } - doLogging("OnTriggerEnt", ""+getName(attacker)+" is attacking me!"); - - return SCRIPT_CONTINUE; - } - - - public int effectManager(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar(self, "playingEffect"); - - return SCRIPT_CONTINUE; - } - - - public int handleDestroyTurret(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - - return SCRIPT_CONTINUE; - } - - - public int createTriggerVolume(obj_id self, dictionary params) throws InterruptedException - { - if (params == null) - { - advanced_turret.explodeTurret(self, self); - return SCRIPT_CONTINUE; - } - - float range = advanced_turret.DEFAULT_TURRET_RANGE; - if (params.containsKey("range")) - { - range = params.getFloat("range"); - } - - float interval = range / (float)INTERVAL_MAX; - - for (int i=0; i= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - if (hasObjVar(self, "pet.uses_left")) - { - - names[idx] = "new_player_vehicle_uses_left"; - - int uses = getIntObjVar(self, "pet.uses_left"); - - attribs[idx] = " " + uses; - idx++; - - if (idx >= names.length) - { - return super.OnGetAttributes(self, player, names, attribs); - } - } - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public boolean isSameFaction(obj_id petControlDevice) throws InterruptedException - { - obj_id datapad = getContainedBy( petControlDevice ); - if (!isIdValid( datapad )) - { - return false; - } - - obj_id master = getContainedBy( datapad ); - if (!isIdValid( master )) - { - return false; - } - - String creatureName = getStringObjVar( petControlDevice, "pet.creatureName"); - if (creatureName == null || creatureName.equals("")) - { - return false; - } - - String petFaction = utils.dataTableGetString(CREATURE_TABLE, creatureName, "pvpFaction"); - if (petFaction == null || petFaction.equals("")) - { - - return true; - } - - if (!petFaction.equals("Imperial") && !petFaction.equals("Rebel")) - { - - return true; - } - - if (pvpGetType( master ) != PVPTYPE_DECLARED) - { - - sendSystemMessage( master, new string_id ( pet_lib.MENU_FILE, "not_declared")); - return false; - } - String masterFaction = factions.getFaction( master ); - if (masterFaction == null || !masterFaction.equals(petFaction)) - { - - sendSystemMessage( master, new string_id ( pet_lib.MENU_FILE, "not_declared")); - return false; - } - - return true; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - obj_id newMaster = getContainedBy( destContainer ); - if (!isPlayer( newMaster )) - { - return SCRIPT_OVERRIDE; - } - - if (isIdValid( transferer )) - { - - obj_id currentContainer = getContainedBy( self ); - if (isIdValid(currentContainer)) - { - obj_id currentContOwner = getContainedBy( currentContainer ); - if (isIdValid( currentContOwner )) - { - - if (hasScript( currentContOwner, "ai.pet_control_device" )) - { - - obj_id yourPad = utils.getPlayerDatapad(transferer); - if (destContainer == yourPad) - { - return SCRIPT_CONTINUE; - } - } - } - } - } - - if (!hasScript( newMaster, "ai.pet_master")) - { - attachScript( newMaster, "ai.pet_master"); - } - - if (vehicle.hasMaxStoredVehicles( newMaster )) - { - sendSystemMessage( newMaster, vehicle.SID_SYS_HAS_MAX_VEHICLE ); - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int getLevelFromPetControlDevice(obj_id petControlDevice) throws InterruptedException - { - int growthStage = 10; - if (hasObjVar( petControlDevice, "ai.petAdvance.growthStage" )) - { - growthStage = getIntObjVar( petControlDevice, "ai.petAdvance.growthStage"); - } - - String creatureName = getStringObjVar( petControlDevice, "pet.creatureName"); - if (creatureName == null) - { - return 0; - } - - int maxDiff = create.calcCreatureLevel( creatureName ); - if (maxDiff < 1) - { - maxDiff = 1; - } - - if (growthStage < 10) - { - maxDiff = (maxDiff/10)*growthStage; - } - - return maxDiff; - } - - - public int handlePetDeathblow(obj_id self, dictionary params) throws InterruptedException - { - int vitality = getIntObjVar( self, "pet.vitality"); - vitality += 2; - - if (vitality > pet_lib.MAX_VITALITY_LOSS) - { - vitality = pet_lib.MAX_VITALITY_LOSS; - } - - setObjVar( self, "pet.vitality", vitality ); - return SCRIPT_CONTINUE; - } - - - public void restoreCustomization(obj_id pet, obj_id petControlDevice) throws InterruptedException - { - if (hasObjVar(petControlDevice, pet_lib.VAR_PALVAR_BASE)) - { - obj_var_list ovl = getObjVarList(petControlDevice, pet_lib.VAR_PALVAR_VARS); - if (ovl != null) - { - int numItem = ovl.getNumItems(); - for (int i = 0; i < numItem; i++) - { - testAbortScript(); - obj_var ov = ovl.getObjVar(i); - String var = ov.getName(); - int idx = ov.getIntData(); - hue.setColor(pet, var, idx); - } - } - } - } - - - public int handleFlagDeadCreature(obj_id self, dictionary params) throws InterruptedException - { - setObjVar( self, "pet.isDead", true ); - return SCRIPT_CONTINUE; - } - - - public boolean petIsDead(obj_id petControlDevice, obj_id player, int petType) throws InterruptedException - { - if (hasObjVar( petControlDevice, "pet.isDead" )) - { - if (petType == pet_lib.PET_TYPE_NON_AGGRO || petType == pet_lib.PET_TYPE_AGGRO) - { - - removeObjVar( petControlDevice, "pet.isDead"); - return false; - } - sendSystemMessage( player, new string_id( "pet/pet_menu", "dead_pet") ); - return true; - } - return false; - } - - - public boolean validatePetStats(obj_id pcd, obj_id player) throws InterruptedException - { - - if (!hasObjVar(pcd, "pet.crafted")) - { - return true; - } - - final int MAX_HAM_VALUE = 16000; - final float MAX_ATK_VALUE = 30.0f; - final float MAX_HIT_VALUE = 1.0f; - final int MAX_DAM_VALUE = 1500; - - boolean status = true; - - if (getIntObjVar(pcd, "creature_attribs." + create.MAXATTRIBNAMES[HEALTH]) > MAX_HAM_VALUE) - { - status = false; - } - - if (getIntObjVar(pcd, "creature_attribs." + create.MAXATTRIBNAMES[ACTION]) > MAX_HAM_VALUE) - { - status = false; - } - - if (getIntObjVar(pcd, "creature_attribs." + create.MAXATTRIBNAMES[MIND]) > MAX_HAM_VALUE) - { - status = false; - } - - if (getFloatObjVar(pcd, "creature_attribs.attackSpeed") > MAX_ATK_VALUE) - { - status = false; - } - - if (getFloatObjVar(pcd, "creature_attribs.toHitChance") > MAX_HIT_VALUE) - { - status = false; - } - - if (getIntObjVar(pcd, "creature_attribs.minDamage") > MAX_DAM_VALUE) - { - status = false; - } - - if (getIntObjVar(pcd, "creature_attribs.maxDamage") > MAX_DAM_VALUE) - { - status = false; - } - - if (status == false) - { - sendSystemMessage(player, pet_lib.SID_INVALID_CRAFTED_PET); - } - - return status; - } - - - public int handleValidatePet(obj_id self, dictionary params) throws InterruptedException - { - obj_id currentPet = callable.getCDCallable(self); - - obj_id calledPet = params.getObjId( "calledPet"); - - if (!isIdValid( currentPet )) - { - - if (isIdValid( calledPet )) - { - if (calledPet.isLoaded()) - { - destroyObject( calledPet ); - } - else - { - messageTo( calledPet, "handlePackRequest", null, 1, false ); - } - } - return SCRIPT_CONTINUE; - } - - if (!isIdValid( calledPet )) - { - return SCRIPT_CONTINUE; - } - - if (calledPet == currentPet) - { - return SCRIPT_CONTINUE; - } - - if (isIdValid( calledPet )) - { - if (calledPet.isLoaded()) - { - destroyObject( calledPet ); - } - else - { - messageTo( calledPet, "handlePackRequest", null, 1, false ); - } - } - - return SCRIPT_CONTINUE; - - } - - - public int handleGrowthChoice(obj_id self, dictionary params) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public obj_id createVehicle(obj_id player, obj_id petControlDevice) throws InterruptedException - { - debugServerConsoleMsg( player, "+++ VEHICLE_CONTROL_DEVICE . createVehicle +++ Entered PCD/Pet creation function."); - - String objectTemplate = vehicle.getVehicleTemplate(petControlDevice); - - if (callable.hasCallable(player, callable.CALLABLE_TYPE_RIDEABLE)) - { - return null; - } - - obj_id playerCurrentMount = getMountId (player); - - if (isIdValid(playerCurrentMount) && vehicle.isBattlefieldVehicle(playerCurrentMount)) - { - string_id noBattlefieldVehicle = new string_id ("pet/pet_menu", "vehicle_battlefield_vehicle_restriction"); - sendSystemMessage (player, noBattlefieldVehicle); - return null; - } - - int shapechange = buff.getBuffOnTargetFromGroup(player, "shapechange"); - if (shapechange != 0) - { - sendSystemMessage(player, new string_id("spam","not_while_shapechanged")); - return null; - } - - if (objectTemplate.equals("object/mobile/vehicle/jetpack.iff")) - { - if (getLocomotion(player) == LOCOMOTION_RUNNING) - { - string_id noMove = new string_id ( "pet/pet_menu", "no_moving"); - sendSystemMessage (player, noMove); - return null; - } - } - - obj_id pet = createObject(objectTemplate, getLocation(player)); - - if (!isIdValid(pet)) - { - debugServerConsoleMsg( player, "+++ VEHICLE_CONTROL_DEVICE . createVehicle +++ OBJ_ID Validity check on Vehicular_Prototype pet object came back as NOT VALID"); - return petControlDevice; - } - - sendDirtyObjectMenuNotification(petControlDevice); - - callable.setCallableCD(pet, petControlDevice); - - setObjVar(pet, "vehicularTestBed", 1); - setObjVar(pet, "ai.pet.masterName", getEncodedName(player)); - - setAttributeAttained(pet, attrib.VEHICLE); - - vehicle.reHueVehicle(petControlDevice, pet); - - if (!(couldPetBeMadeMountable(pet)==0 )) - { - debugServerConsoleMsg( null, "+++ VEHICLE_CONTROL_DEVICE . createVehicle +++ couldPetBeMadeMountable(pet) returned FALSE."); - return pet; - } - - if (!makePetMountable( pet )) - { - debugServerConsoleMsg( null, "+++ VEHICLE_CONTROL_DEVICE . createVehicle +++ makePetMountable(pet) returned FALSE."); - return pet; - } - else - { - setObjVar( petControlDevice, "ai.pet.trainedMount", 1 ); - setObjVar( pet, "ai.pet.trainedMount", 1 ); - } - - if (hasObjVar( petControlDevice, "attrib.max_hp" )) - { - debugServerConsoleMsg( player, "+++ VEHICLE_CONTROL_DEVICE . createVehicle +++ "); - setMaxHitpoints(pet, getIntObjVar(petControlDevice, "attrib.max_hp")); - } - - if (hasObjVar( petControlDevice, "attrib.hit_points" )) - { - setHitpoints(pet, getIntObjVar(petControlDevice, "attrib.hit_points")); - } - - if (hasObjVar(petControlDevice, vehicle.VAR_PALVAR_BASE)) - { - restoreCustomization(pet, petControlDevice); - - if (hasObjVar(petControlDevice, vehicle.VAR_PALVAR_CNT)) - { - int cnt = getIntObjVar(petControlDevice, vehicle.VAR_PALVAR_CNT); - - if (cnt > -1) - { - cnt--; - setObjVar(petControlDevice, vehicle.VAR_PALVAR_CNT, cnt); - - if (cnt < 6) - { - switch(cnt) - { - case 5: - customizationFadeToWhite(pet, 0.15f); - sendSystemMessage(player, pet_lib.SID_SYS_VEH_CUST_FADING); - break; - case 4: - customizationFadeToWhite(pet, 0.20f); - sendSystemMessage(player, pet_lib.SID_SYS_VEH_CUST_FADING); - break; - case 3: - customizationFadeToWhite(pet, 0.25f); - sendSystemMessage(player, pet_lib.SID_SYS_VEH_CUST_FADING); - break; - case 2: - customizationFadeToWhite(pet, 0.30f); - sendSystemMessage(player, pet_lib.SID_SYS_VEH_CUST_FADING); - break; - case 1: - customizationFadeToWhite(pet, 0.35f); - sendSystemMessage(player, pet_lib.SID_SYS_VEH_CUST_FADING); - break; - case 0: - customizationFadeToWhite(pet, 0.40f); - sendSystemMessage(player, pet_lib.SID_SYS_VEH_CUST_GONE); - removeObjVar(petControlDevice, vehicle.VAR_PALVAR_CNT); - break; - } - } - } - } - } - - if (hasObjVar(petControlDevice, "pet.uses_left")) - { - int uses = getIntObjVar(petControlDevice, "pet.uses_left"); - uses--; - - if (uses > 0) - { - prose_package pp = prose.getPackage(vehicle.SID_SYS_USES_LEFT, uses); - sendSystemMessageProse(player, pp); - - } - else - { - sendSystemMessage(player, vehicle.SID_SYS_USES_LEFT_LAST); - } - - setObjVar(petControlDevice, "pet.uses_left", uses); - } - - messageTo(pet, "handleVehicleDecay", null, 5f, false); - - vehicle.initializeVehicle (pet, player); - - dictionary web = new dictionary (); - web.put ("player", player); - messageTo(pet, "checkForJetpack", web, 1, false); - - String vehicleType = getTemplateName (pet); - - if (vehicleType.equals("object/mobile/vehicle/jetpack.iff")) - { - vehicle.setHoverHeight(pet, 4); - } - - callable.setCallableLinks(player, petControlDevice, pet); - - return pet; - } - - - public void customizationFadeToWhite(obj_id pet, float percent) throws InterruptedException - { - - ranged_int_custom_var[] ricv = hue.getPalcolorVars(pet); - - Vector pcv = new Vector(); - pcv.setSize(0); - - if (ricv == null || ricv.length == 0) - { - return; - } - - for (int i = 0; i < ricv.length; i++) - { - testAbortScript(); - - if (ricv[i].isPalColor()) - { - - pcv = utils.addElement(pcv, (palcolor_custom_var)ricv[i]); - } - } - - if (pcv == null || pcv.size() == 0) - { - return; - } - - for (int j = 0; j < pcv.size(); j++) - { - testAbortScript(); - - color old_color = ((palcolor_custom_var)(pcv.get(j))).getSelectedColor(); - - int old_r = old_color.getR(); - int old_g = old_color.getG(); - int old_b = old_color.getB(); - int old_a = old_color.getA(); - - float d_r = (255 - old_r) * percent; - float d_g = (255 - old_g) * percent; - float d_b = (255 - old_b) * percent; - float d_a = (255 - old_a) * percent; - - int new_r = old_r + (int)d_r; - int new_g = old_g + (int)d_g; - int new_b = old_b + (int)d_b; - int new_a = old_a + (int)d_a; - - color new_color = new color(new_r, new_g, new_b, new_a); - - ((palcolor_custom_var)(pcv.get(j))).setToClosestColor(new_color); - } - } - - - public int handleRemoveCurrentVehicle(obj_id self, dictionary params) throws InterruptedException - { - - obj_id sendingVehicleId = params.getObjId(MESSAGE_VEHICLE_ID); - - if (!isIdValid(sendingVehicleId)) - { - if (debug) - { - LOG("vcd-debug", "vehicle_control_device.handleRemoveCurrentVehicle(): vcd id=["+ self + "]: sending vehicle's ID is invalid, ignoring"); - } - return SCRIPT_CONTINUE; - } - - debugServerConsoleMsg( null, "+++ vehicle_control_device.messageHandler handleRemoveCurrentVehicle +++ entered HANDLEREMOVECURRENTVEHICLE message handler"); - - if (callable.hasCDCallable(self)) - { - sendDirtyObjectMenuNotification (self); - - obj_id controlledVehicleId = callable.getCDCallable(self); - - if (controlledVehicleId == sendingVehicleId) - { - - callable.setCDCallable(self, null); - - if (debug) - { - LOG("vcd-debug", "vehicle_control_device.handleRemoveCurrentVehicle(): vcd id=["+ self + "]: removing scriptvar requested by vehicle id=["+ sendingVehicleId + "]"); - } - } - else - { - - LOG("vcd", "vehicle_control_device.handleRemoveCurrentVehicle(): vcd id=["+ self + "]: ignoring request from vehicle id=["+ sendingVehicleId + "]: VCD thinks it is controlling a different vehicle, id=["+ controlledVehicleId + "]"); - } - } - else - { - debugServerConsoleMsg( null, "+++ vehicle_control_device.messageHandler handleRemoveCurrentVehicle +++ WHOOPS! no callable.current scriptvar on VCD."); - debugServerConsoleMsg( null, "+++ vehicle_control_device.messageHandler handleRemoveCurrentVehicle +++ How'd that happen?."); - } - - return SCRIPT_CONTINUE; - } - - - public int handleStoreVehicleDamage(obj_id self, dictionary params) throws InterruptedException - { - int hp = params.getInt("hp"); - int penalty = params.getInt("penalty"); - - vehicle.storeDamage(self, hp, penalty); - - return SCRIPT_CONTINUE; - } - - - public boolean updateTcgVehicleMaxHealth(obj_id tcgVehiclePcd) throws InterruptedException - { - if (!isValidId(tcgVehiclePcd) || !exists(tcgVehiclePcd)) - { - return false; - } - if (!hasObjVar(tcgVehiclePcd, "attrib.max_hp")) - { - return false; - } - - int currentHp = 0; - if (hasObjVar(tcgVehiclePcd, "attrib.hit_points")) - { - currentHp = getIntObjVar(tcgVehiclePcd, "attrib.hit_points"); - if (currentHp < 0) - { - currentHp = 0; - } - else if (currentHp == 0) - { - currentHp = TCG_PCD_OLD_NEW_DIFFERENCE; - } - else if (currentHp > 0 && currentHp < TCG_PCD_OLD_MAX_HEALTH) - { - int damage = TCG_PCD_OLD_MAX_HEALTH - currentHp; - currentHp = TCG_PCD_MAX_HEALTH - damage; - } - else - { - currentHp = TCG_PCD_MAX_HEALTH; - } - } - else - { - currentHp = TCG_PCD_MAX_HEALTH; - } - - if (currentHp < 0) - { - return false; - } - - setObjVar(tcgVehiclePcd, "attrib.max_hp", TCG_PCD_MAX_HEALTH); - setObjVar(tcgVehiclePcd, "attrib.hit_points", currentHp); - setObjVar(tcgVehiclePcd, TCG_VEHICLE_PCD_UPDATED, true); - return true; - } - - - public int modifyPaletteIndex(int idx) throws InterruptedException - { - int series_idx = idx%8; - if (series_idx == 0) - { - return idx; - } - - return idx-1; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/systems/veteran_reward/structure_storage_increase_deed.java b/sku.0/sys.server/compiled/game/script/systems/veteran_reward/structure_storage_increase_deed.java deleted file mode 100644 index 833754ece..000000000 --- a/sku.0/sys.server/compiled/game/script/systems/veteran_reward/structure_storage_increase_deed.java +++ /dev/null @@ -1,192 +0,0 @@ -package script.systems.veteran_reward; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.player_structure; -import script.library.prose; -import script.library.space_utils; -import script.library.static_item; -import script.library.sui; -import script.library.utils; - - -public class structure_storage_increase_deed extends script.base_script -{ - public structure_storage_increase_deed() - { - } - public static final string_id STORAGE_INCREASE = new string_id(player_structure.STF_FILE, "use_storage_increase_deed"); - public static final string_id SID_STORAGE_INCREASE_TITLE = new string_id(player_structure.STF_FILE, "sui_storage_title"); - public static final string_id SID_STORAGE_INCREASE_PROMPT = new string_id(player_structure.STF_FILE, "sui_storage_prompt"); - public static final string_id MSG_STORAGE_INCREASED = new string_id(player_structure.STF_FILE, "msg_storage_increased"); - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - obj_id structure = getTopMostContainer(player); - - if ((isGameObjectTypeOf(structure, GOT_building) || (isGameObjectTypeOf(structure, GOT_ship_fighter) && space_utils.isShipWithInterior(structure))) && player_structure.isOwner(structure, player)) - { - mi.addRootMenu(menu_info_types.ITEM_USE, STORAGE_INCREASE); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item == menu_info_types.ITEM_USE) - { - obj_id structure = getTopMostContainer(player); - - if (validateDeedUse(self, player, structure)) - { - String title = utils.packStringId(SID_STORAGE_INCREASE_TITLE); - String prompt = utils.packStringId(SID_STORAGE_INCREASE_PROMPT); - sui.msgbox(self, player, prompt, sui.YES_NO, title, "handleStorageChoice"); - } - } - - return SCRIPT_CONTINUE; - } - - - public boolean validateDeedUse(obj_id self, obj_id player, obj_id structure) throws InterruptedException - { - if (!isIdValid(structure)) - { - sendSystemMessage(player, new string_id(player_structure.STF_FILE, "storage_increase_inside_warning")); - return false; - } - - if (player_structure.isNonGenericLootItem(self)) - { - if (player_structure.alreadyHasNonGenericStorageIncreaseOfType(structure, self)) - { - string_id alreadyHasThatOneMsg = new string_id(player_structure.STF_FILE, "storage_increase_has_nongeneric_type"); - prose_package pp = prose.getPackage(alreadyHasThatOneMsg); - prose.setTO(pp, new string_id("static_item_n", getStaticItemName(self))); - sendSystemMessageProse(player, pp); - return false; - } - } - - String template = getTemplateName(structure); - - if (!isGameObjectTypeOf(structure, GOT_ship_fighter)) - { - if (!(template.indexOf("player_house_") > -1) && !(template.indexOf("player_guildhall_") > -1) && !(template.indexOf("barn_no_planet_restriction.iff") > -1) && !(template.indexOf("diner_no_planet_restriction.iff") > -1)) - { - sendSystemMessage(player, new string_id(player_structure.STF_FILE, "storage_increase_houses_only")); - return false; - } - - if (!isGameObjectTypeOf(structure, GOT_building)) - { - sendSystemMessage(player, new string_id(player_structure.STF_FILE, "storage_increase_inside_warning")); - return false; - } - - if (!player_structure.isOwner(structure, player)) - { - sendSystemMessage(player, new string_id(player_structure.STF_FILE, "not_owner")); - return false; - } - } - else - { - if (!space_utils.isShipWithInterior(structure)) - { - sendSystemMessage(player, new string_id(player_structure.STF_FILE, "storage_increase_inside_warning")); - return false; - } - - if (getOwner(structure) != player) - { - sendSystemMessage(player, new string_id(player_structure.STF_FILE, "not_owner")); - return false; - } - } - - return true; - } - - - public int handleStorageChoice(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id structure = getTopMostContainer(player); - - if (validateDeedUse(self, player, structure)) - { - int structureIncrease = 0; - - if (hasObjVar(self, player_structure.OBJVAR_STORAGE_AMOUNT)) - { - structureIncrease = getIntObjVar(self, player_structure.OBJVAR_STORAGE_AMOUNT); - } - - if (structureIncrease > 0 && player_structure.incrementStorageAmount(player, structure, self, structureIncrease)) - { - String itemName = getStaticItemName(self); - if (itemName != null && itemName.length() > 0) - { - dictionary itemData = new dictionary(); - itemData = dataTableGetRow(static_item.ITEM_STAT_BALANCE_TABLE, itemName); - if (itemData != null) - { - String clientEffect = itemData.getString("client_effect"); - if (clientEffect != null && clientEffect.length() > 0) - { - playClientEffectObj(player, clientEffect, player, ""); - } - } - } - - sendSystemMessage(player, MSG_STORAGE_INCREASED); - destroyObject(self); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int free = getFirstFreeIndex(names); - - if (free == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int structureIncrease = 0; - - if (hasObjVar(self, player_structure.OBJVAR_STORAGE_AMOUNT)) - { - structureIncrease = getIntObjVar(self, player_structure.OBJVAR_STORAGE_AMOUNT); - } - - names[free] = utils.packStringId(new string_id("player_structure", "storage_amount_display")); - attribs[free++] = "" + structureIncrease; - - return super.OnGetAttributes(self, player, names, attribs); - } - -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/city_vote.java b/sku.0/sys.server/compiled/game/script/terminal/city_vote.java deleted file mode 100644 index 85cb95f73..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/city_vote.java +++ /dev/null @@ -1,675 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.city; -import script.library.prose; -import script.library.sui; -import script.library.utils; -import java.util.Vector; - - - -public class city_vote extends script.terminal.base.base_terminal -{ - public city_vote() - { - } - public static final string_id SID_MAYORAL_RACE = new string_id("city/city", "mayoral_race"); - public static final string_id SID_MAYORAL_STANDINGS = new string_id("city/city", "mayoral_standings"); - public static final string_id SID_MAYORAL_VOTE = new string_id("city/city", "mayoral_vote"); - public static final string_id SID_MAYORAL_REGISTER = new string_id("city/city", "mayoral_register"); - public static final string_id SID_MAYORAL_UNREGISTER = new string_id("city/city", "mayoral_unregister"); - - public static final string_id SID_RESET_VOTING = new string_id("city/city", "reset_voting"); - - public static final string_id SID_REGISTER_INCUMBENT = new string_id("city/city", "register_incumbent"); - public static final string_id SID_REGISTER_NONCITIZEN = new string_id("city/city", "register_noncitizen"); - public static final string_id SID_REGISTER_NONPOLITICIAN = new string_id("city/city", "register_nonpolitician"); - public static final string_id SID_REGISTER_DUPE = new string_id("city/city", "register_dupe"); - public static final string_id SID_REGISTER_CONGRATS = new string_id("city/city", "register_congrats"); - public static final string_id SID_REGISTER_TIMESTAMP = new string_id("city/city", "register_timestamp"); - - public static final string_id SID_REGISTRATION_LOCKED = new string_id("city/city", "registration_locked"); - - public static final string_id REGISTERED_CITIZEN_EMAIL_BODY = new string_id("city/city", "rceb"); - public static final string_id REGISTERED_CITIZEN_EMAIL_SUBJECT = new string_id("city/city", "registered_citizen_email_subject"); - public static final string_id UNREGISTERED_CITIZEN_EMAIL_BODY = new string_id("city/city", "unregistered_citizen_email_body"); - public static final string_id UNREGISTERED_CITIZEN_EMAIL_SUBJECT = new string_id("city/city", "unregistered_citizen_email_subject"); - - public static final string_id SID_NOT_REGISTERED = new string_id("city/city", "not_registered"); - public static final string_id SID_UNREGISTERED = new string_id("city/city", "unregistered_race"); - - public static final string_id SID_NO_CANDIDATES = new string_id("city/city", "no_candidates"); - - public static final string_id SID_VOTE_NONCITIZEN = new string_id("city/city", "vote_noncitizen"); - public static final string_id SID_VOTE_PLACED = new string_id("city/city", "vote_placed"); - public static final string_id SID_VOTE_ABSTAIN = new string_id("city/city", "vote_abstain"); - - public static final string_id SID_ALREADY_MAYOR = new string_id("city/city", "already_mayor"); - - public static final String STF_FILE = "city/city"; - - public static final string_id SID_NOT_OLD_ENOUGH = new string_id("city/city", "not_old_enough"); - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - dictionary outparams = new dictionary(); - outparams.put( "terminal", self ); - obj_id city_hall = getTopMostContainer( self ); - messageTo( city_hall, "registerVoteTerminal", outparams, 0.f, true ); - - return super.OnInitialize(self); - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return SCRIPT_CONTINUE; - } - - if (exists(self)) - { - - obj_id city_hall = getTopMostContainer( self ); - if (isValidId(city_hall) && exists(city_hall)) - { - int city_id = findCityByCityHall( city_hall ); - if (city_id > -1) - { - names[idx] = "city_name"; - attribs[idx] = cityGetName( city_id ); - idx++; - - obj_id mayor = cityGetLeader(city_id); - if (isValidId(mayor)) - { - names[idx] = "current_mayor"; - attribs[idx] = cityGetCitizenName(city_id, mayor); - idx++; - } - - int currentInterval = getIntObjVar(city_hall, "cityVoteInterval"); - if (currentInterval > -1) - { - String intervalName = convertInterval(currentInterval); - if (!intervalName.equals("error")) - { - names[idx] = "vote_interval"; - attribs[idx] = intervalName; - idx++; - } - } - - int nextUpdate = (getIntObjVar(city_hall, "lastUpdateTime") + getIntObjVar(city_hall, "currentInterval")) - getGameTime(); - if (nextUpdate > -1) - { - names[idx] = "next_interval"; - attribs[idx] = utils.assembleTimeRemainToUse(nextUpdate); - idx++; - } - - obj_id[] candidates = getObjIdArrayObjVar(city_hall, "candidate_list"); - if (candidates != null) - { - for (int i=0; i < candidates.length; i++) - { - testAbortScript(); - if (candidates[i] == mayor) - { - names[idx] = "incumbent"; - attribs[idx] = cityGetCitizenName(city_id, mayor); - idx++; - } - else - { - names[idx] = "candidate"; - attribs[idx] = cityGetCitizenName(city_id, candidates[i]); - idx++; - } - } - } - } - } - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - obj_id city_hall = getTopMostContainer( self ); - int city_id = findCityByCityHall( city_hall ); - obj_id mayor = cityGetLeader( city_id ); - - int menu = mi.addRootMenu( menu_info_types.SERVER_MENU1, SID_MAYORAL_RACE ); - - mi.addSubMenu( menu, menu_info_types.SERVER_MENU2, SID_MAYORAL_STANDINGS ); - mi.addSubMenu( menu, menu_info_types.SERVER_MENU3, SID_MAYORAL_VOTE ); - - if (!isRegisteredToRun( player, self )) - { - mi.addSubMenu( menu, menu_info_types.SERVER_MENU4, SID_MAYORAL_REGISTER ); - } - else - { - mi.addSubMenu( menu, menu_info_types.SERVER_MENU5, SID_MAYORAL_UNREGISTER ); - } - - if (isGod( player )) - { - mi.addSubMenu( menu, menu_info_types.SERVER_MENU6, SID_RESET_VOTING ); - } - - return super.OnObjectMenuRequest(self, player, mi); - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item == menu_info_types.SERVER_MENU1 || item == menu_info_types.SERVER_MENU2) - { - - showStandings( self, player ); - } - else if (item == menu_info_types.SERVER_MENU3) - { - - placeVote( self, player ); - } - else if (item == menu_info_types.SERVER_MENU4) - { - - registerToRun( self, player ); - } - else if (item == menu_info_types.SERVER_MENU5) - { - - unregisterFromRace( self, player ); - } - else if (item == menu_info_types.SERVER_MENU6) - { - - if (isGod( player )) - { - obj_id city_hall = getTopMostContainer( self ); - int city_id = findCityByCityHall( city_hall ); - obj_id[] citizens = cityGetCitizenIds( city_id ); - for (int i=0; i 0) - { - setObjVar( city_hall, "candidate_list", new_candidates ); - } - else - { - if (hasObjVar( city_hall, "candidate_list" )) - { - removeObjVar( city_hall, "candidate_list"); - } - } - } - - - public String getNumVotes(obj_id candidate, Vector vote_ids, Vector vote_counts) throws InterruptedException - { - for (int j=0; j 7 || isGod(player)) - { - isOldEnough = true; - } - - return isOldEnough; - } - - - public String convertInterval(int currentInterval) throws InterruptedException - { - if (currentInterval == 0) - { - return "Voting Week 1"; - } - if (currentInterval == 1) - { - return "Voting Week 2"; - } - if (currentInterval == 2) - { - return "Election Week"; - } - return "error"; - } -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/gcw_publish_gift_terminal.java b/sku.0/sys.server/compiled/game/script/terminal/gcw_publish_gift_terminal.java deleted file mode 100644 index 77f7e54ee..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/gcw_publish_gift_terminal.java +++ /dev/null @@ -1,55 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.player_structure; -import script.library.sui; -import script.library.utils; -import script.library.prose; - - - -public class gcw_publish_gift_terminal extends script.terminal.base.base_terminal -{ - public gcw_publish_gift_terminal() - { - } - - public int OnDestroy(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - return super.OnInitialize(self); - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - menu_info_data data = mi.getMenuItemByType (menu_info_types.ITEM_USE); - return super.OnObjectMenuRequest(self, player, mi); - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/greeter.java b/sku.0/sys.server/compiled/game/script/terminal/greeter.java deleted file mode 100644 index 1cdd16e25..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/greeter.java +++ /dev/null @@ -1,4167 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import java.util.Vector; -import script.library.ai_lib; -import script.library.chat; -import script.library.dressup; -import script.library.hue; -import script.library.money; -import script.library.player_structure; -import script.library.prose; -import script.library.session; -import script.library.smuggler; -import script.library.static_item; -import script.library.sui; -import script.library.turnstile; -import script.library.utils; -import script.library.vendor_lib; -import script.library.xp; - - - -public class greeter extends script.terminal.base.base_terminal -{ - public greeter() - { - } - public static final boolean LOGGING_ON = true; - public static final String LOGGING_CATEGORY = "greeter"; - - public static final string_id SID_GREETER_STATUS = new string_id("player_structure", "greeter_status"); - public static final string_id SID_GREETER_INIT = new string_id("player_structure", "greeter_init"); - public static final string_id SID_GREETER_INITIALIZED = new string_id("player_structure", "greeter_initialized_message"); - - public static final string_id SID_GREETER_CONTROL = new string_id("player_structure", "greeter_control"); - public static final string_id SID_REMOVE_GREETER = new string_id("player_structure", "remove_greeter"); - - public static final string_id SID_CUSTOMIZE_GREETER = new string_id("player_structure", "customize_greeter"); - public static final string_id SID_CHANGE_NAME = new string_id("player_structure", "greeter_change_name"); - public static final string_id SID_GREETER_PREVIEW_ALL = new string_id("player_structure", "greeter_preview_all"); - public static final string_id SID_GREETER_MODIFY_DELAY = new string_id("player_structure", "greeter_modify_greeting_delay"); - public static final string_id SID_GREETER_SAVE_GREET = new string_id("player_structure", "greeter_save_greet"); - public static final string_id SID_GREETER_LOAD_GREET = new string_id("player_structure", "greeter_load_greet"); - public static final string_id SID_GREETER_ACTIVE_ON = new string_id("player_structure", "greeter_activation_on"); - public static final string_id SID_GREETER_ACTIVE_OFF = new string_id("player_structure", "greeter_activation_off"); - public static final string_id SID_GREETER_VOICE_ON = new string_id("player_structure", "greeter_voicing_on"); - public static final string_id SID_GREETER_VOICE_OFF = new string_id("player_structure", "greeter_voicing_off"); - public static final string_id SID_GREETER_ANIMATING_ON = new string_id("player_structure", "greeter_animating_on"); - public static final string_id SID_GREETER_ANIMATING_OFF = new string_id("player_structure", "greeter_animating_off"); - public static final string_id SID_GREETER_SOUND_ON = new string_id("player_structure", "greeter_sounds_on"); - public static final string_id SID_GREETER_SOUND_OFF = new string_id("player_structure", "greeter_sounds_off"); - public static final string_id SID_GREETER_MOOD_ON = new string_id("player_structure", "greeter_mood_on"); - public static final string_id SID_GREETER_MOOD_OFF = new string_id("player_structure", "greeter_mood_off"); - public static final string_id SID_GREETER_EFFECT_ON = new string_id("player_structure", "greeter_effects_on"); - public static final string_id SID_GREETER_EFFECT_OFF = new string_id("player_structure", "greeter_effects_off"); - public static final string_id SID_GREETER_STATEMENT_ON = new string_id("player_structure", "greeter_statement_on"); - public static final string_id SID_GREETER_STATEMENT_OFF = new string_id("player_structure", "greeter_statement_off"); - public static final string_id SID_COLOR = new string_id("player_structure", "greeter_color"); - - public static final string_id SID_GREETER_WAS_RENAMED = new string_id("player_structure", "greeter_renamed"); - public static final string_id SID_ACTIVATION_ENABLED = new string_id("player_structure", "greeter_activation_enabled"); - public static final string_id SID_ACTIVATION_DISABLED = new string_id("player_structure", "greeter_activation_disabled"); - public static final string_id SID_VOICING_ENABLED = new string_id("player_structure", "greeter_voice_enabled"); - public static final string_id SID_VOICING_DISABLED = new string_id("player_structure", "greeter_voice_disabled"); - public static final string_id SID_ANIMATING_ENABLED = new string_id("player_structure", "greeter_animations_enabled"); - public static final string_id SID_ANIMATING_DISABLED = new string_id("player_structure", "greeter_animations_disabled"); - public static final string_id SID_SOUNDS_ENABLED = new string_id("player_structure", "greeter_sounds_enabled"); - public static final string_id SID_SOUNDS_DISABLED = new string_id("player_structure", "greeter_sounds_disabled"); - public static final string_id SID_MOOD_ENABLED = new string_id("player_structure", "greeter_mood_enabled"); - public static final string_id SID_MOOD_DISABLED = new string_id("player_structure", "greeter_mood_disabled"); - public static final string_id SID_EFFECT_ENABLED = new string_id("player_structure", "greeter_effects_enabled"); - public static final string_id SID_EFFECT_DISABLED = new string_id("player_structure", "greeter_effects_disabled"); - public static final string_id SID_STATEMENT_ENABLED = new string_id("player_structure", "greeter_statement_enabled"); - public static final string_id SID_STATEMENT_DISABLED = new string_id("player_structure", "greeter_statement_disabled"); - public static final string_id SID_GREETER_DRESSING_NOT_AVAIL = new string_id("player_structure", "greeter_dressing_not_avail"); - public static final string_id SID_MIN_FIVE_TIMER = new string_id("player_structure", "greeter_min_delay"); - public static final string_id SID_MAX_TIMER = new string_id("player_structure", "greeter_max_delay"); - public static final string_id SID_MIN_RADIUS = new string_id("player_structure", "greeter_min_radius"); - public static final string_id SID_MAX_RADIUS = new string_id("player_structure", "greeter_max_radius"); - public static final string_id SID_GREETER_SAVE_MAX = new string_id("player_structure", "greeter_max_saves"); - public static final string_id SID_NAME_ALREADY_EXISTS = new string_id("player_structure", "greeter_name_already_exists"); - public static final string_id SID_GREETER_RANDOM_GREETING_SELECTED = new string_id("player_structure", "greeter_random_selected"); - - public static final string_id SID_OBSCENE = new string_id("player_structure", "greeter_obscene"); - public static final string_id SID_CANT_MOVE = new string_id("player_structure", "greeter_cant_move"); - public static final string_id SID_GREETER_NOT_IN_SHIP = new string_id("player_structure", "greeter_not_in_ship"); - public static final string_id SID_GREETER_PUBLIC_ONLY = new string_id("player_structure", "greeter_public_only"); - public static final string_id SID_NO_SAVED_GREETS = new string_id("player_structure", "greeter_no_saves"); - public static final string_id SID_GREETING_LOADED = new string_id("player_structure", "greeter_greeting_loaded"); - public static final string_id SID_GREETING_RADIUS_CHANGED = new string_id("player_structure", "greeter_radius_changed"); - public static final string_id SID_GREETING_DELAY_CHANGED = new string_id("player_structure", "greeter_delay_changed"); - public static final string_id SID_RANDOMIZED_GREETINGS_OFF = new string_id("player_structure", "greeter_random_greetings_off"); - public static final string_id SID_RANDOMIZED_GREETINGS_ON = new string_id("player_structure", "greeter_random_greetings_on"); - - public static final String SUI_GREETER_INSTRUCTIONS_TITLE = "@player_structure:greeter_main_instructions_title"; - public static final String SUI_GREETER_INSTRUCTIONS_DESCR = "@player_structure:greeter_main_instructions_description"; - public static final String SUI_GREETER_COLOR_DESC = "@player_structure:greeter_color_description"; - public static final String SUI_GREETER_COLOR_TITLE = "@player_structure:greeter_color_title"; - public static final String SUI_GREETER_LOAD_DESCR = "@player_structure:greeter_load_description"; - public static final String SUI_GREETER_LOAD_TITLE = "@player_structure:greeter_load_title"; - public static final String SUI_GREETER_SAVE_NAME_DESCR = "@player_structure:greeter_save_name_description"; - public static final String SUI_GREETER_SAVE_NAME_TITLE = "@player_structure:greeter_save_name_title"; - - public static final String GREETER_RADIUS_DESCRIPTION = "@player_structure:greeter_radius_instructions_description"; - public static final String GREETER_RADIUS_TITLE = "@player_structure:greeter_radius_instructions_title"; - public static final String GREETER_DELAY_DESCRIPTION = "@player_structure:greeter_delay_instructions_description"; - public static final String GREETER_DELAY_TITLE = "@player_structure:greeter_delay_instructions_title"; - - public static final String MENU_CUSTOMIZE_GREETER = "@player_structure:customize_greeter"; - public static final String MENU_CHANGE_NAME = "@player_structure:greeter_change_name"; - public static final String MENU_RANDOMIZED_GREETINGS_ON = "@player_structure:greeter_randomized_greeting_on"; - public static final String MENU_RANDOMIZED_GREETINGS_OFF = "@player_structure:greeter_randomized_greeting_off"; - public static final String MENU_GREETER_RANDOM_ALL = "@player_structure:greeter_random_greeting"; - public static final String MENU_GREETER_PREVIEW_ALL = "@player_structure:greeter_preview_all"; - public static final String MENU_GREETER_MODIFY_DELAY = "@player_structure:greeter_modify_greeting_delay"; - public static final String MENU_GREETER_SAVE_GREET = "@player_structure:greeter_save_greet"; - public static final String MENU_GREETER_LOAD_GREET = "@player_structure:greeter_load_greet"; - public static final String MENU_GREETER_LIST_GREET = "@player_structure:greeter_list_greet"; - public static final String MENU_GREETER_ACTIVE_ON = "@player_structure:greeter_activation_on"; - public static final String MENU_GREETER_ACTIVE_OFF = "@player_structure:greeter_activation_off"; - public static final String MENU_GREETER_VOICE_ON = "@player_structure:greeter_voicing_on"; - public static final String MENU_GREETER_VOICE_OFF = "@player_structure:greeter_voicing_off"; - public static final String MENU_GREETER_ANIMATING_ON = "@player_structure:greeter_animating_on"; - public static final String MENU_GREETER_ANIMATING_OFF = "@player_structure:greeter_animating_off"; - public static final String MENU_GREETER_SOUND_ON = "@player_structure:greeter_sounds_on"; - public static final String MENU_GREETER_SOUND_OFF = "@player_structure:greeter_sounds_off"; - public static final String MENU_GREETER_MOOD_ON = "@player_structure:greeter_mood_on"; - public static final String MENU_GREETER_MOOD_OFF = "@player_structure:greeter_mood_off"; - public static final String MENU_GREETER_EFFECT_ON = "@player_structure:greeter_effects_on"; - public static final String MENU_GREETER_EFFECT_OFF = "@player_structure:greeter_effects_off"; - public static final String MENU_GREETER_STATEMENT_ON = "@player_structure:greeter_statement_on"; - public static final String MENU_GREETER_STATEMENT_OFF = "@player_structure:greeter_statement_off"; - public static final String MENU_COLOR = "@player_structure:greeter_color"; - public static final String MENU_GREETER_MODIFY_TRIGGER_VOL_RADIUS = "@player_structure:greeter_trigger_radius"; - public static final String MENU_GREETER_CONVERSE_OTHER_GREETER = "@player_structure:greeter_converse_other_greeter"; - public static final String MENU_GREETER_STOP_CONVERSE_OTHER_GREETER = "@player_structure:greeter_stop_converse_other_greeter"; - public static final String MENU_GREETER_STATEMENT_EDIT = "@player_structure:greeter_statement_edit"; - public static final String MENU_GREETER_SOUND_EDIT = "@player_structure:greeter_sound_edit"; - public static final String MENU_GREETER_MOOD_EDIT = "@player_structure:greeter_mood_edit"; - public static final String MENU_GREETER_ANIMATING_EDIT = "@player_structure:greeter_animating_edit"; - public static final String MENU_GREETER_VOICE_EDIT = "@player_structure:greeter_voice_edit"; - public static final String MENU_GREETER_EFFECT_EDIT = "@player_structure:greeter_effect_edit"; - - public static final String ALERT_VOLUME_NAME = "vendorTriggerVolume"; - public static final String VOICE_OPTION = "voice"; - public static final String SOUND_OPTION = "sound"; - public static final String VOICE_STRING = "voice_string"; - public static final String SOUND_STRING = "sound_string"; - public static final String GREETER_INITIALIZE_SCRVAR = "greeter.oninitialize"; - - public static final String GREETER_VOICING_ENABLED = "voice_off"; - public static final String GREETER_VOICING_DISABLED = "voice_on"; - public static final String GREETER_ANIMATING_ENABLED = "anims_off"; - public static final String GREETER_ANIMATING_DISABLED = "anims_on"; - public static final String GREETER_SOUNDS_ENABLED = "sounds_off"; - public static final String GREETER_SOUNDS_DISABLED = "sounds_on"; - public static final String GREETER_MOOD_ENABLED = "mood_off"; - public static final String GREETER_MOOD_DISABLED = "mood_on"; - public static final String GREETER_STATEMENT_ENABLED = "spatial_off"; - public static final String GREETER_STATEMENT_DISABLED = "spatial_on"; - public static final String GREETER_CHANGE_NAME = "name_change"; - public static final String GREETER_RANDOMIZED_GREETINGS_ON = "randomized_greetings_on"; - public static final String GREETER_RANDOMIZED_GREETINGS_OFF = "randomized_greetings_off"; - public static final String GREETER_COLOR_CHANGE = "color_change"; - public static final String GREETER_RANDOM = "random_greeting"; - public static final String GREETER_PREVIEW = "preview_all"; - public static final String GREETER_SAVE_GREET = "save_greet"; - public static final String GREETER_LIST_GREET = "list_greet"; - public static final String GREETER_MODIFY_DELAY = "modify_delay"; - public static final String GREETER_MODIFY_TRIGGER_VOL_RADIUS = "modify_trigger"; - public static final String GREETER_GET_OTHER_GREETER = "get_other_greeter"; - public static final String GREETER_START_ITERACTION = "greeter_interact"; - public static final String GREETER_STOP_ITERACTION = "greeter_stop_interact"; - public static final String LAST_OTHER_GREETER = "last_other_greeter"; - public static final String GREETER_STATEMENT_EDIT = "edit_current_statement"; - public static final String GREETER_MOOD_EDIT = "edit_current_mood"; - public static final String GREETER_SOUNDS_EDIT = "edit_current_sounds"; - public static final String GREETER_VOICING_EDIT = "edit_current_voicing"; - public static final String GREETER_ANIMATING_EDIT = "edit_current_animating"; - - public static final String SAVE_SAY_CHAT = "say_chat="; - public static final String SAVE_VOICE = "voice="; - public static final String SAVE_MOOD = "mood="; - public static final String SAVE_SOUND = "sound="; - public static final String SAVE_EFFECT = "effect="; - public static final String SAVE_ANIM = "say_anim="; - public static final String COMMA = ","; - public static final String PIPE = "|"; - - public static final int GREETER_BARK_TIMER_MAX = 60; - public static final int GREETER_BARK_TIMER_MIN = 5; - public static final int GREETER_COLOR_MAX = 4; - public static final int GREETER_TRIGGER_VOL_MAX = 15; - public static final int GREETER_TRIGGER_VOL_DEFAULT = 4; - public static final int GREETER_TRIGGER_VOL_MIN = 1; - public static final int GREETER_SAVE_MAX = 10; - public static final int GREETER_TIMER_DELAY = 60; - public static final int GREETER_CONVERSATION_LOOP_TIME = 3; - public static final int GREETER_CONVERSATION_PAUSE_TIME = 10; - public static final int GREETER_DELAY_AT_ONINITIALIZE = 3; - - public static final float MAX_GREETER_CONV_RANGE_FLOAT = 2.f; - - public static final String CATEGORY_ANIM_COL_NAMES_SCRVAR = vendor_lib.GREETER_VAR_PREFIX+".greeterAnimCategories"; - public static final String CATEGORY_ANIM_COL_STRINGS_SCRVAR = vendor_lib.GREETER_VAR_PREFIX+".greeterAnimCategoriesStrings"; - public static final String SELECTED_CAT_ANIM_SCRVAR = vendor_lib.GREETER_VAR_PREFIX+".greeterAnimCategorySelected"; - public static final String SELECTED_CAT_ANIM_STR_SCRVAR = vendor_lib.GREETER_VAR_PREFIX+".greeterAnimCategorySelectedStrings"; - public static final String CATEGORY_MOOD_COL_NAMES_SCRVAR = vendor_lib.GREETER_VAR_PREFIX+".greeterMoodCategories"; - public static final String CATEGORY_MOOD_COL_STRINGS_SCRVAR = vendor_lib.GREETER_VAR_PREFIX+".greeterMoodCategoriesStrings"; - public static final String SELECTED_CAT_MOOD_SCRVAR = vendor_lib.GREETER_VAR_PREFIX+".greeterMoodCategorySelected"; - public static final String SELECTED_CAT_MOOD_STR_SCRVAR = vendor_lib.GREETER_VAR_PREFIX+".greeterMoodCategoryStringSelected"; - public static final String PLAYER_SEL_GREETER_EFFECT_LIST = vendor_lib.GREETER_VAR_PREFIX+".greeterEffectListSelected"; - public static final String PLAYER_SEL_GREETER_EFFECT_TYPE = vendor_lib.GREETER_VAR_PREFIX+".greeterEffectTypeSelected"; - public static final String PLAYER_SEL_GREETER_STATEMENT_LIST = vendor_lib.GREETER_VAR_PREFIX+".greeterStatementSelected"; - public static final String PLAYER_SEL_GREETER_SAVE_ELEMENT = vendor_lib.GREETER_VAR_PREFIX+".greeterSaveElementSelected"; - public static final String PLAYER_SEL_GREETER_SOUND_VO_STRING_LIST = vendor_lib.GREETER_VAR_PREFIX+".greeterSoundVOStringList"; - public static final String PLAYER_SEL_GREETER_SOUND_VO_SELECTION = vendor_lib.GREETER_VAR_PREFIX+".greeterSoundVOStringSelected"; - - public static final String GREETER_EFFECT_PID = "greeter_pid.effect_pid"; - public static final String GREETER_MOOD_PID = "greeter_pid.mood_pid"; - public static final String GREETER_ANIM_PID = "greeter_pid.anim_pid"; - public static final String GREETER_MOOD_CATEGORY_PID = "greeter_pid.mood_cat_pid"; - public static final String GREETER_ANIM_CATEGORY_PID = "greeter_pid.anim_cat_pid"; - public static final String GREETER_STATEMENT_PID = "greeter_pid.statement_pid"; - public static final String GREETER_ANIM_PARENT_PID = "greeter_pid.anim_parent_pid"; - public static final String GREETER_PROGRAM_MAIN_PID = "greeter_pid.anim_main_menu_pid"; - public static final String GREETER_BARK_PID = "greeter_pid.bark_pid"; - public static final String GREETER_NAME_PID = "greeter_pid.name_pid"; - public static final String GREETER_COLOR_PID = "greeter_pid.color_pid"; - public static final String GREETER_RADIUS_PID = "greeter_pid.radius_pid"; - public static final String GREETER_LOAD_GREETING_PID = "greeter_pid.load_greeting_pid"; - public static final String GREETER_SAVE_NAME_PID = "greeter_pid.save_greeting_pid"; - public static final String GREETER_GREETING_SELECT_PID = "greeter_pid.greeting_select_pid"; - public static final String GREETER_GET_SAVED_GREETING_LIST_PID = "greeter_pid.get_saved_greeting_list_pid"; - public static final String GREETER_GET_RANDOM_PID = "greeter_pid.get_random_pid"; - - public static final String GREETER_MAIN_MENU_STRINGS = "greeter_data.greeter_menu_strings"; - public static final String GREETER_MAIN_MENU_DATA = "greeter_data.greeter_menu_data"; - - public static final String GREETER_COLOR_SECONDARY = "controller.color.secondary"; - public static final String GREETER_COLOR_PRIMARY = "controller.color.primary"; - public static final String GREETER_DELAY_TIMER_CURRENT = "controller.delay_current"; - public static final String GREETER_TRIGGER_VOL_CURRENT = "controller.trigger_current"; - public static final String GREETER_SAVE_DATA = "controller.save_data"; - public static final String GREETER_SAVE_GREETING = "controller.save_greeting"; - public static final String GREETER_SAVED_GREET_DATA = "controller.saved_data"; - public static final String GREETER_SAVED_GREET_NAMES = "controller.saved_names"; - public static final String FOUND_OTHER_GREETERS = "controller.other_greeter_found"; - public static final String FOUND_OTHER_GREETER_TIMER = "controller.other_greeter_search_timer"; - - public static final String[] PLAYER_GREETING_MAINT_MENU = - { - "Load", - "Delete" - }; - - public static final String[] HUMANOID_ANIMATIONS = - { - "cough_polite", - "point_to_self", - "nod_head_once", - "clap_rousing", - "laugh_cackle", - "nod_head_multiple", - "rub_chin_thoughtful", - "shake_head_no", - "check_wrist_device", - "hair_flip", - "taunt1", - "taunt2", - "shake_head_disgust", - "wave_finger_warning", - "wave_on_dismissing", - "embarrassed", - "point_away", - "point_down", - "point_forward", - "point_left", - "point_right", - "point_up", - "shrug_hands", - "shrug_shoulders", - "scratch_head", - "conversation_1", - "conversation_2", - "conversation_1", - "conversation_2", - "conversation_1", - "conversation_2", - "conversation_1", - "conversation_2" - }; - - public static final String[] JAWA_ANIMATIONS = - { - "cough_polite", - "alert", - "angry", - "conversation_1", - "conversation_2", - "laugh_cackle", - "nervous", - "point_forward", - "shake_head_no", - "shrug_hands", - "sp_01", - "sp_02", - "threaten", - "yes" - }; - - public static final String[] EWOK_ANIMATIONS = - { - "cough_polite", - "alert", - "angry", - "conversation_1", - "explain", - "greet", - "laugh_cackle", - "nervous", - "point_forward", - "ewok_pound_fist_chest", - "shake_head_no", - "shrug_shoulders", - "smell_air", - "ewok_sp_01", - "threaten", - "threaten_combat", - "vocalize", - "yes" - }; - - - public int OnAttach(obj_id self) throws InterruptedException - { - blog("vendor.greeter.OnAttach init"); - - removeTriggerVolume("alertTriggerVolume"); - setInvulnerable(self, true); - - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(controller, vendor_lib.GREETER_COLOR_OBJVAR) && getBooleanObjVar(controller, vendor_lib.GREETER_COLOR_OBJVAR) == true) - { - messageTo(self, "colorGreeter", null, 0, false); - } - - if (hasObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR)) - { - - utils.setScriptVar(self, GREETER_INITIALIZE_SCRVAR, true); - blog("vendor.greeter.OnAttach Setting up Trigger Volume"); - messageTo(self, "handleCallVolumeToggleOnInitialized", null, GREETER_DELAY_AT_ONINITIALIZE, false); - } - - conversableGreeterInRange(self); - if (!hasObjVar(controller, FOUND_OTHER_GREETERS) || getBooleanObjVar(controller, FOUND_OTHER_GREETERS) != true) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(controller, vendor_lib.GREETER_CONVERSE) && getBooleanObjVar(controller, vendor_lib.GREETER_CONVERSE) == true) - { - messageTo(self, "handleConverseWithOtherGreeter", null, GREETER_CONVERSATION_LOOP_TIME, false); - } - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - blog("vendor.greeter.OnInitialize init"); - - if (isObjectPersisted(self)) - { - blog("vendor.greeter.OnInitialize Greeter is persisted"); - - messageTo(self, "handleCallGreeterUpdate", null, 1, false); - return super.OnInitialize(self); - } - - blog("vendor.greeter.OnInitialize set invuln"); - - setInvulnerable(self, true); - - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return super.OnInitialize(self); - } - - blog("vendor.greeter.OnInitialize has controller ID"); - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return super.OnInitialize(self); - } - - if (hasObjVar(controller, vendor_lib.GREETER_COLOR_OBJVAR) && getBooleanObjVar(controller, vendor_lib.GREETER_COLOR_OBJVAR) == true) - { - messageTo(self, "colorGreeter", null, 0, false); - } - - blog("vendor.greeter.OnInitialize controller ID received"); - - if (hasObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR)) - { - blog("vendor.greeter.OnInitialize Greeter is already active"); - - utils.setScriptVar(self, GREETER_INITIALIZE_SCRVAR, true); - blog("vendor.greeter.OnInitialize Setting up Trigger Volume"); - messageTo(self, "handleCallVolumeToggleOnInitialized", null, GREETER_DELAY_AT_ONINITIALIZE, false); - } - - blog("vendor.greeter.OnInitialize Trigger Done checking controller"); - - conversableGreeterInRange(self); - if (!hasObjVar(controller, FOUND_OTHER_GREETERS) || getBooleanObjVar(controller, FOUND_OTHER_GREETERS) != true) - { - return super.OnInitialize(self); - } - - if (hasObjVar(controller, vendor_lib.GREETER_CONVERSE) && getBooleanObjVar(controller, vendor_lib.GREETER_CONVERSE) == true) - { - messageTo(self, "handleConverseWithOtherGreeter", null, GREETER_CONVERSATION_LOOP_TIME, false); - } - return super.OnInitialize(self); - } - - - public int OnGiveItem(obj_id self, obj_id item, obj_id player) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - blog("vendor.greeter.OnObjectMenuRequest init"); - obj_id ownerId = getOwner(self); - if (!isValidId(ownerId) || !exists(ownerId)) - { - return super.OnObjectMenuRequest(self, player, mi); - } - - blog("vendor.greeter.OnObjectMenuRequest Owner received"); - - obj_id pInv = utils.getInventoryContainer(player); - if (!isValidId(pInv) || !exists(pInv)) - { - return super.OnObjectMenuRequest(self, player, mi); - } - if (player != ownerId) - { - return super.OnObjectMenuRequest(self, player, mi); - } - - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return super.OnObjectMenuRequest(self, player, mi); - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return super.OnObjectMenuRequest(self, player, mi); - } - - blog("vendor.greeter.OnObjectMenuRequest validation complete, controller ID received"); - - if (contains(pInv, self)) - { - - messageTo(self, "handleDestroyGreeter", null, 0, false ); - return super.OnObjectMenuRequest(self, player, mi); - } - - conversableGreeterInRange(self); - - blog("vendor.greeter.OnObjectMenuRequest Creating Menu"); - - int menu = mi.addRootMenu(menu_info_types.SERVER_MENU1, SID_GREETER_CONTROL); - - if (hasObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR)) - { - mi.addSubMenu(menu, menu_info_types.SERVER_MENU3, SID_GREETER_ACTIVE_ON); - - mi.addSubMenu(menu, menu_info_types.SERVER_MENU4, SID_CUSTOMIZE_GREETER); - } - else - { - mi.addSubMenu(menu, menu_info_types.SERVER_MENU3, SID_GREETER_ACTIVE_OFF); - } - - mi.addRootMenu(menu_info_types.SERVER_MENU2, SID_REMOVE_GREETER); - blog("vendor.greeter.OnObjectMenuRequest Menu created"); - - return super.OnObjectMenuRequest(self, player, mi); - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - blog("vendor.greeter.OnObjectMenuSelect init"); - - obj_id ownerId = getOwner(self); - if (!isValidId(ownerId) || !exists(ownerId)) - { - return SCRIPT_CONTINUE; - } - else if (player != ownerId) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - blog("vendor.greeter.OnObjectMenuSelect initial validation done, including the controller ID"); - - obj_id pInv = utils.getInventoryContainer(ownerId); - if (!isValidId(pInv) || !exists(pInv)) - { - return SCRIPT_CONTINUE; - } - - blog("vendor.greeter.OnObjectMenuSelect owner inv. id recieved"); - - sendDirtyObjectMenuNotification(self); - - blog("vendor.greeter.OnObjectMenuSelect item: "+item); - - blog("vendor.greeter.OnObjectMenuSelect looking for: "+menu_info_types.SERVER_MENU4); - - if (item == menu_info_types.SERVER_MENU1) - { - return SCRIPT_CONTINUE; - } - - else if (item == menu_info_types.ITEM_DESTROY && contains(pInv, self)) - { - blog("terminal.greeter.OnObjectMenuSelect: player selected greeter destroy option while in player inventory."); - messageTo(self, "handleDestroyGreeter", null, 0, false); - return SCRIPT_CONTINUE; - } - else if (item == menu_info_types.SERVER_MENU2) - { - blog("terminal.greeter.OnObjectMenuSelect: player selected greeter destroy option after greeter placed."); - messageTo(self, "handleDestroyGreeter", null, 0, false); - return SCRIPT_CONTINUE; - } - else if (item == menu_info_types.SERVER_MENU3) - { - blog("terminal.greeter.OnObjectMenuSelect: player selected item == menu_info_types.SERVER_MENU3."); - blog("terminal.greeter.OnObjectMenuSelect: player has: vendor_lib.GREETER_ACTIVE_OBJVAR"); - - if (hasObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR)) - { - blog("terminal.greeter.OnObjectMenuSelect: changing to: DEACTIVATE"); - - removeObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR); - - toggleTriggerVolume(self); - - sendSystemMessage(player, SID_ACTIVATION_DISABLED); - } - - else - { - - setObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR, true); - - toggleTriggerVolume(self); - - sendSystemMessage(player, SID_ACTIVATION_ENABLED); - } - } - else if (item == menu_info_types.SERVER_MENU4) - { - blog("terminal.greeter.OnObjectMenuSelect: SERVER_MENU4"); - buildMainControlMenu(self, player); - } - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id dest, obj_id transferer) throws InterruptedException - { - blog("vendor.greeter.OnAboutToBeTransferred init"); - - obj_id ownerId = getOwner(self); - if (!isValidId(ownerId) || !exists(ownerId)) - { - messageTo(self, "handleDestroyGreeter", null, 0, false ); - return SCRIPT_OVERRIDE; - } - else if (transferer != ownerId) - { - sendSystemMessage(transferer, SID_CANT_MOVE); - return SCRIPT_OVERRIDE; - } - else if (hasObjVar(self, vendor_lib.GREETER_INIT_OBJVAR)) - { - sendSystemMessage(transferer, SID_CANT_MOVE); - return SCRIPT_OVERRIDE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - obj_id pInv = utils.getInventoryContainer(ownerId); - if (dest == ownerId || dest == pInv) - { - blog("vendor.greeter.OnAboutToBeTransferred Somehow the mob object is being transferred"); - toggleTriggerVolume(self); - - vendor_lib.removeObjectFromController(controller, self); - return SCRIPT_CONTINUE; - } - - else if (getContainedBy(transferer) == dest) - { - obj_id structure = getTopMostContainer(dest); - int got = getGameObjectType(structure); - if (isGameObjectTypeOf(got, GOT_building) && !permissionsIsPublic(structure)) - { - sendSystemMessage(transferer, SID_GREETER_PUBLIC_ONLY); - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - String msg = "Greeters may only reside in the owner's inventory or in structures the owner has vendor permissions in."; - String title = "WARNING"; - sui.msgbox(ownerId, ownerId, msg, sui.OK_ONLY, title, "noHandler"); - - return SCRIPT_OVERRIDE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - blog("vendor.greeter.OnTriggerVolumeEntered init"); - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - blog("vendor.greeter.OnTriggerVolumeEntered hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)"); - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - blog("vendor.greeter.OnTriggerVolumeEntered controller valid"); - - if (hasObjVar(controller, vendor_lib.GREETER_CONVERSE) && getBooleanObjVar(controller, vendor_lib.GREETER_CONVERSE) == true) - { - blog("vendor.greeter.OnTriggerVolumeEntered: GREETER_CONVERSE"); - - removeObjVar(controller, vendor_lib.GREETER_CONVERSE); - blog("vendor.greeter.OnTriggerVolumeEntered: GREETER_CONVERSE removed"); - - conversableGreeterInRange(self); - if (!hasObjVar(controller, FOUND_OTHER_GREETERS) || getBooleanObjVar(controller, FOUND_OTHER_GREETERS) != true) - { - blog("vendor.greeter.OnTriggerVolumeEntered: no greeters in area"); - return SCRIPT_CONTINUE; - } - - messageTo(self, "handleConverseWithOtherGreeterAfterGreetDelay", null, GREETER_CONVERSATION_PAUSE_TIME, false); - } - - vendor_lib.colorizeGreeterFromController(controller, self); - - if (hasObjVar(breacher, "gm")) - { - blog("vendor.greeter.OnTriggerVolumeEntered: GM tripped"); - return SCRIPT_CONTINUE; - } - else if (breacher == self) - { - - return SCRIPT_CONTINUE; - } - else if (isIncapacitated(breacher)) - { - - return SCRIPT_CONTINUE; - } - else if (!isMob(breacher)) - { - - return SCRIPT_CONTINUE; - } - else if (ai_lib.isMonster(breacher)) - { - - return SCRIPT_CONTINUE; - } - else if (!hasObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR)) - { - - return SCRIPT_CONTINUE; - } - else if (utils.hasScriptVar(self, vendor_lib.GREETER_ALREADY_BARKED_SCRVAR)) - { - - return SCRIPT_CONTINUE; - } - else if (!volumeName.equals(ALERT_VOLUME_NAME)) - { - - return SCRIPT_CONTINUE; - } - - blog("vendor.greeter.OnTriggerVolumeEntered: TRIGGER PASSED THE TESTS ----GIVE THE GREETER LIFE"); - - if (!bringGreeterToLife(self, controller, breacher)) - { - blog("vendor.greeter.OnTriggerVolumeEntered: bringGreeterToLife failed somehow."); - } - else - { - blog("vendor.greeter.OnTriggerVolumeEntered: bringGreeterToLife shows success."); - } - - if (hasObjVar(controller, vendor_lib.GREETER_CURRENTLY_RANDOMIZED_GREET) && getBooleanObjVar(controller, vendor_lib.GREETER_CURRENTLY_RANDOMIZED_GREET) == true) - { - blog("terminal.greeter:handlePlayerProgramSelect: I AM A RANDOMIZED GREETER!!!!!!!!!!!!!!!!!!!!!!!!!!!!."); - if (!getRandomGreeting(self, controller)) - { - blog("terminal.greeter:handlePlayerProgramSelect: getRandomGreeting failed."); - return SCRIPT_CONTINUE; - } - } - return SCRIPT_CONTINUE; - } - - - public int handleDelayedMainControlMenu(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handleDelayedMainControlMenu: init"); - - obj_id ownerId = getOwner(self); - if (!isValidId(ownerId) || !exists(ownerId)) - { - return SCRIPT_CONTINUE; - } - - buildMainControlMenu(self, ownerId); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerProgramSelect(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handlePlayerProgramSelect: init"); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - if (!validateAllImperativeGreeterVars(self, player)) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerProgramSelect: prelim validation completed."); - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - String[] availableOptionStrings = utils.getStringArrayScriptVar(player, GREETER_MAIN_MENU_DATA); - if (availableOptionStrings == null) - { - return SCRIPT_CONTINUE; - } - - String choice = availableOptionStrings[idx]; - if (choice == null || choice.equals("")) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerProgramSelect: choice: "+choice); - - if (choice.startsWith(GREETER_CHANGE_NAME)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_CHANGE_NAME"); - - if (sui.hasPid(player, GREETER_NAME_PID)) - { - int pid = sui.getPid(player, GREETER_NAME_PID); - forceCloseSUIPage(pid); - } - - int pid = sui.inputbox(self, player, "@player_structure:greeter_name_d", sui.OK_CANCEL, "@player_structure:greeter_name_t", sui.INPUT_NORMAL, null, "handleSetVendorName", null ); - sui.setPid(player, pid, GREETER_NAME_PID); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_RANDOMIZED_GREETINGS_ON)) - { - setObjVar(controller, vendor_lib.GREETER_CURRENTLY_RANDOMIZED_GREET, true); - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_RANDOMIZED_GREETINGS_ON"); - if (!getRandomGreeting(self, controller)) - { - blog("terminal.greeter:handlePlayerProgramSelect: getRandomGreeting failed."); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - sendSystemMessage(player, SID_RANDOMIZED_GREETINGS_ON); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_RANDOMIZED_GREETINGS_OFF)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_RANDOMIZED_GREETINGS_OFF"); - removeObjVar(controller, vendor_lib.GREETER_CURRENTLY_RANDOMIZED_GREET); - - sendSystemMessage(player, SID_RANDOMIZED_GREETINGS_OFF); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_ANIMATING_DISABLED) || choice.startsWith(GREETER_ANIMATING_EDIT)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_ANIMATING_DISABLED"); - - if (!getGreeterAnimCategorySelect(self, controller, player)) - { - CustomerServiceLog("vendor", "terminal.greeter:getGreeterAnimCategorySelect: player/Owner: "+getName(player)+" "+ player+" Could not turn animations on for Greeter: "+ self); - } - - if (choice.startsWith(GREETER_ANIMATING_DISABLED)) - { - sendSystemMessage(player, SID_ANIMATING_ENABLED); - } - - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_ANIMATING_ENABLED)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_ANIMATING_ENABLED"); - - removeObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR); - - sendSystemMessage(player, SID_ANIMATING_DISABLED); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_VOICING_DISABLED) || choice.startsWith(GREETER_VOICING_EDIT)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_VOICING_DISABLED"); - - if (!getGreeterSoundVoiceList(self, controller, player, VOICE_OPTION)) - { - CustomerServiceLog("vendor", "terminal.greeter:getGreeterSoundVoiceList: player/Owner: "+getName(player)+" "+ player+" Could not turn on "+VOICE_OPTION+" for Greeter: "+ self); - } - - if (choice.startsWith(GREETER_VOICING_DISABLED)) - { - sendSystemMessage(player, SID_VOICING_ENABLED); - } - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_VOICING_ENABLED)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_VOICING_ENABLED"); - - removeObjVar(controller, vendor_lib.GREETER_VOICING_OBJVAR); - - sendSystemMessage(player, SID_VOICING_DISABLED); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_SOUNDS_DISABLED) || choice.startsWith(GREETER_SOUNDS_EDIT)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_SOUNDS_DISABLED"); - - if (!getGreeterSoundVoiceList(self, controller, player, SOUND_OPTION)) - { - CustomerServiceLog("vendor", "terminal.greeter:getGreeterSoundVoiceList: player/Owner: "+getName(player)+" "+ player+" Could not turn on "+SOUND_OPTION+" for Greeter: "+ self); - } - - if (choice.startsWith(GREETER_SOUNDS_DISABLED)) - { - sendSystemMessage(player, SID_SOUNDS_ENABLED); - } - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_SOUNDS_ENABLED)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_SOUNDS_ENABLED"); - - removeObjVar(controller, vendor_lib.GREETER_SOUNDING_OBJVAR); - - sendSystemMessage(player, SID_SOUNDS_DISABLED); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_MOOD_DISABLED) || choice.startsWith(GREETER_MOOD_EDIT)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_MOOD_DISABLED"); - - if (!getGreeterMoodCategorySelect(self, controller, player)) - { - CustomerServiceLog("vendor", "terminal.greeter:getGreeterMoodCategorySelect: player/Owner: "+getName(player)+" "+ player+" Could not turn moods on for Greeter: "+ self); - } - if (choice.startsWith(GREETER_MOOD_DISABLED)) - { - sendSystemMessage(player, SID_MOOD_ENABLED); - } - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_MOOD_ENABLED)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_MOOD_ENABLED"); - - removeObjVar(controller, vendor_lib.GREETER_HAS_MOOD_OBJVAR); - - sendSystemMessage(player, SID_MOOD_DISABLED); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_STATEMENT_DISABLED) || choice.startsWith(GREETER_STATEMENT_EDIT)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_STATEMENT_DISABLED"); - - if (!getGreeterStatementSelection(self, controller, player)) - { - CustomerServiceLog("vendor", "terminal.greeter:getGreeterMoodCategorySelect: player/Owner: "+getName(player)+" "+ player+" Could not turn moods on for Greeter: "+ self); - } - - if (choice.startsWith(GREETER_STATEMENT_DISABLED)) - { - sendSystemMessage(player, SID_STATEMENT_ENABLED); - } - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_STATEMENT_ENABLED)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_STATEMENT_ENABLED"); - - blog("HAS HAS HAS vendor_lib.GREETER_HAS_STATEMENT_OBJVAR"); - - removeObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR); - - sendSystemMessage(player, SID_STATEMENT_DISABLED); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_PREVIEW)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_PREVIEW"); - - bringGreeterToLife(self, controller, player); - messageTo(self, "handleDelayedMainControlMenu", null, 2, false); - return SCRIPT_CONTINUE; - } - if (choice.startsWith(GREETER_MODIFY_DELAY)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_MODIFY_DELAY"); - - if (sui.hasPid(player, GREETER_BARK_PID)) - { - int pid = sui.getPid(player, GREETER_BARK_PID); - forceCloseSUIPage(pid); - } - - int delay = GREETER_BARK_TIMER_MAX; - if (hasObjVar(controller, GREETER_DELAY_TIMER_CURRENT) && getIntObjVar(controller, GREETER_DELAY_TIMER_CURRENT) >= GREETER_BARK_TIMER_MIN) - { - delay = getIntObjVar(controller, GREETER_DELAY_TIMER_CURRENT); - } - - int pid = sui.transfer(self, player, GREETER_DELAY_DESCRIPTION, GREETER_DELAY_TITLE, "Maximum", (GREETER_BARK_TIMER_MAX - delay), "Current", delay, "changeGreeterDelay"); - sui.showSUIPage(pid); - sui.setPid(player, pid, GREETER_BARK_PID); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_COLOR_CHANGE)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_COLOR_CHANGE"); - - ranged_int_custom_var[] palColors = hue.getPalcolorVars(self); - if ((palColors == null) || (palColors.length == 0)) - { - return SCRIPT_CONTINUE; - } - - int palColorsLength = palColors.length; - blog("handlePlayerProgramSelect - palColors.length: "+palColorsLength); - - String[] indexName = new String[GREETER_COLOR_MAX]; - - blog("handlePlayerProgramSelect - indexName: "+indexName.length); - - int loop = GREETER_COLOR_MAX; - if (palColorsLength < GREETER_COLOR_MAX) - { - for (int i = 0; i < GREETER_COLOR_MAX; i++) - { - testAbortScript(); - indexName[i] = ""; - } - - loop = palColorsLength; - } - - for (int i = 0; i < loop; i++) - { - testAbortScript(); - ranged_int_custom_var ri = palColors[i]; - if (ri != null) - { - blog("handlePlayerProgramSelect - indexName["+i+"]: "+indexName[i]); - String customizationVar = ri.getVarName(); - if (customizationVar.startsWith("/")) - { - customizationVar = customizationVar.substring(1); - } - indexName[i] = customizationVar; - } - } - if (indexName[0].equals("")) - { - CustomerServiceLog("vendor", "Coloring UI for Greeter: "+ self +" by player "+player+ " has failed because the 1st color was null."); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("vendor", "Coloring UI for greeter: "+ self +" by player "+player); - blog("handlePlayerProgramSelect - Greeter getting color UI: "+ self); - - utils.setScriptVar(player, vendor_lib.GREETER_PLAYTERCOLOR_SCRVAR, true); - - openCustomizationWindow(player, self, indexName[0], -1, -1, indexName[1], -1, -1, indexName[2], -1, -1, indexName[3], -1, -1); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_MODIFY_TRIGGER_VOL_RADIUS)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_MODIFY_TRIGGER_VOL_RADIUS"); - - if (sui.hasPid(player, GREETER_RADIUS_PID)) - { - int pid = sui.getPid(player, GREETER_RADIUS_PID); - forceCloseSUIPage(pid); - } - - int radius = GREETER_TRIGGER_VOL_DEFAULT; - if (hasObjVar(controller, GREETER_TRIGGER_VOL_CURRENT) && getIntObjVar(controller, GREETER_TRIGGER_VOL_CURRENT) >= GREETER_TRIGGER_VOL_MIN) - { - radius = getIntObjVar(controller, GREETER_TRIGGER_VOL_CURRENT); - } - - int pid = sui.transfer(self, player, GREETER_RADIUS_DESCRIPTION, GREETER_RADIUS_TITLE, "Maximum", (GREETER_TRIGGER_VOL_MAX - radius), "Current", radius, "changeTriggerRadius"); - sui.showSUIPage(pid); - sui.setPid(player, pid, GREETER_RADIUS_PID); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_SAVE_GREET)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_SAVE_GREET"); - - if (sui.hasPid(player, GREETER_SAVE_NAME_PID)) - { - int pid = sui.getPid(player, GREETER_SAVE_NAME_PID); - forceCloseSUIPage(pid); - } - - int pid = sui.inputbox(self, player, SUI_GREETER_SAVE_NAME_DESCR, sui.OK_CANCEL, SUI_GREETER_SAVE_NAME_TITLE, sui.INPUT_NORMAL, null, "handleSetSaveName", null); - sui.setPid(player, pid, GREETER_SAVE_NAME_PID); - - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_LIST_GREET)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_LIST_GREET"); - - if (sui.hasPid(player, GREETER_GET_SAVED_GREETING_LIST_PID)) - { - int pid = sui.getPid(player, GREETER_GET_SAVED_GREETING_LIST_PID); - forceCloseSUIPage(pid); - } - - if (!getSavedGreetings(self, player, controller)) - { - blog("terminal.greeter:handlePlayerProgramSelect: getSavedGreetings failed."); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - String[] menu = utils.getStringArrayScriptVar(player, GREETER_SAVED_GREET_NAMES); - if (menu == null) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_SAVED_GREET_NAMES not found."); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - int pid = sui.listbox(self, player, SUI_GREETER_LOAD_DESCR, sui.OK_CANCEL, SUI_GREETER_LOAD_TITLE, menu, "handlePlayerGreetingSelect", true); - sui.setPid(player, pid, GREETER_GET_SAVED_GREETING_LIST_PID); - - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_RANDOM)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_RANDOM"); - setObjVar(controller, vendor_lib.GREETER_RANDOM_TEST_FIRE, true); - if (!getRandomGreeting(self, controller)) - { - blog("terminal.greeter:handlePlayerProgramSelect: getRandomGreeting failed."); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - sendSystemMessage(player, SID_GREETER_RANDOM_GREETING_SELECTED); - bringGreeterToLife(self, controller, player); - messageTo(self, "handleDelayedMainControlMenu", null, 2, false); - return SCRIPT_CONTINUE; - } - - if (choice.startsWith(GREETER_START_ITERACTION)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_START_ITERACTION"); - - setObjVar(controller, vendor_lib.GREETER_CONVERSE, true); - messageTo(self, "handleConverseWithOtherGreeter", null, 0, false); - } - - if (choice.startsWith(GREETER_STOP_ITERACTION)) - { - blog("terminal.greeter:handlePlayerProgramSelect: GREETER_STOP_ITERACTION"); - - removeObjVar(controller, vendor_lib.GREETER_CONVERSE); - } - - return SCRIPT_CONTINUE; - } - - - public int handleCallGreeterUpdate(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handleCallGreeterUpdate: init."); - - if (!vendor_lib.updateGreeterFunctionality(self)) - { - blog("terminal.greeter:handleCallGreeterUpdate: Greeter FAILED UPDATE"); - CustomerServiceLog("vendor", "terminal.greeter:OnInitialize: GREETER UPDATE FAILED: "+getName(self)+" "+ self+" "+ getLocation(self)); - } - else - { - blog("terminal.greeter:handleCallGreeterUpdate: Greeter Updated!!!"); - } - - return SCRIPT_CONTINUE; - } - - - public int handleCallVolumeToggleOnInitialized(obj_id self, dictionary params) throws InterruptedException - { - toggleTriggerVolume(self); - return SCRIPT_CONTINUE; - } - - - public int handleCallVolumeToggleNoLife(obj_id self, dictionary params) throws InterruptedException - { - toggleTriggerVolume(self, false); - return SCRIPT_CONTINUE; - } - - - public int colorGreeter(obj_id self, dictionary params) throws InterruptedException - { - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - vendor_lib.colorizeGreeterFromController(controller, self); - return SCRIPT_CONTINUE; - } - - - public int handleConverseWithOtherGreeterAfterGreetDelay(obj_id self, dictionary params) throws InterruptedException - { - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - setObjVar(controller, vendor_lib.GREETER_CONVERSE, true); - messageTo(self, "handleConverseWithOtherGreeter", null, 0, false); - return SCRIPT_CONTINUE; - } - - - public int handleConverseWithOtherGreeter(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handleConverseWithOtherGreeter: init."); - - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(controller, vendor_lib.GREETER_CONVERSE) || getBooleanObjVar(controller, vendor_lib.GREETER_CONVERSE) != true) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handleConverseWithOtherGreeter: Controller id found."); - - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (!isValidId(ownerId)) - { - blog("terminal.greeter:handleConverseWithOtherGreeter: GREETER HAD NO OWNER! Aborting initialization process and deleting greeter."); - - ownerId = vendor_lib.getObjectOwner(controller); - if (!isValidId(ownerId)) - { - blog("terminal.greeter:handleConverseWithOtherGreeter: GREETER HAD NO OWNER! Aborting initialization process and deleting greeter."); - CustomerServiceLog("vendor", "terminal.greeter:handleGreeterInitialize: GREETER HAD NO OWNER! Aborting initialization process and deleting Greeter: "+ self); - messageTo(self, "handleDestroyGreeter", null, 0, false ); - return SCRIPT_CONTINUE; - } - } - - blog("terminal.greeter:handleConverseWithOtherGreeter: Owner id found. Checking for other greeter var."); - - obj_id otherGreeter = getConversableGreeter(self, ownerId, controller); - if (!isValidId(otherGreeter) || !exists(otherGreeter)) - { - blog("terminal.greeter:handleConverseWithOtherGreeter: No other greeter var. Removing"); - removeObjVar(controller, FOUND_OTHER_GREETERS); - return SCRIPT_CONTINUE; - } - blog("terminal.greeter:handleConverseWithOtherGreeter: FOUND other greeter: "+otherGreeter); - faceTo(self, otherGreeter); - - String creatureType = getStringObjVar(controller, vendor_lib.CREATURE_TYPE); - if (creatureType == null || creatureType.equals("")) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handleConverseWithOtherGreeter: FOUND creature Type of greeter: "+creatureType); - - if (creatureType.equals("ewok")) - { - String anim = EWOK_ANIMATIONS[rand(0,JAWA_ANIMATIONS.length -1)]; - if (anim != null || !anim.equals("")) - { - doAnimationAction(self, anim); - } - - messageTo(self, "handleConverseWithOtherGreeter", null, GREETER_CONVERSATION_LOOP_TIME, false); - return SCRIPT_CONTINUE; - } - if (creatureType.equals("greeter_jawa")) - { - String anim = JAWA_ANIMATIONS[rand(0,JAWA_ANIMATIONS.length -1)]; - if (anim != null || !anim.equals("")) - { - doAnimationAction(self, anim); - } - - messageTo(self, "handleConverseWithOtherGreeter", null, GREETER_CONVERSATION_LOOP_TIME, false); - return SCRIPT_CONTINUE; - } - String anim = HUMANOID_ANIMATIONS[rand(0,HUMANOID_ANIMATIONS.length -1)]; - if (anim != null || !anim.equals("")) - { - doAnimationAction(self, anim); - } - - messageTo(self, "handleConverseWithOtherGreeter", null, GREETER_CONVERSATION_LOOP_TIME, false); - return SCRIPT_CONTINUE; - } - - - public int handleSetSaveName(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handleSetSaveName: init"); - - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - String saveName = sui.getInputBoxText(params); - if (saveName == null || saveName.equals("")) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (saveName == null || saveName.equals("") || isNameReserved(saveName)) - { - blog("terminal.greeter:handleSetSaveName: handleSetSaveName"); - - sendSystemMessage(player, SID_OBSCENE); - int pid = sui.inputbox(self, player, SUI_GREETER_SAVE_NAME_DESCR, sui.OK_CANCEL, SUI_GREETER_SAVE_NAME_TITLE, sui.INPUT_NORMAL, null, "handleSetSaveName", null); - sui.setPid(player, pid, GREETER_SAVE_NAME_PID); - return SCRIPT_CONTINUE; - } - - if (saveName.length() > 10) - { - saveName = saveName.substring(0, 9); - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (!saveGreeting(self, player, controller, saveName)) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerGreetingSelect(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handlePlayerGreetingSelect: init"); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.hasPid(player, GREETER_GREETING_SELECT_PID)) - { - int pid = sui.getPid(player, GREETER_GREETING_SELECT_PID); - forceCloseSUIPage(pid); - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerGreetingSelect: initial validation completed"); - int idx = sui.getListboxSelectedRow(params); - blog("terminal.greeter:handlePlayerGreetingSelect: idx: "+idx); - - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - String[] loadList = getStringArrayObjVar(controller, GREETER_SAVE_DATA); - if (loadList == null) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - blog("terminal.greeter:handlePlayerGreetingSelect: loadList.length: "+loadList.length); - - String selection = loadList[idx]; - if (selection == null || selection.equals("")) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - blog("terminal.greeter:handlePlayerGreetingSelect: +++++++SELECTION: "+selection); - - utils.setScriptVar(player, PLAYER_SEL_GREETER_SAVE_ELEMENT, selection); - int pid = sui.listbox(self, player, SUI_GREETER_LOAD_DESCR, sui.OK_CANCEL, SUI_GREETER_LOAD_TITLE, PLAYER_GREETING_MAINT_MENU, "handlePlayerGreetingMaintenanceSelect", true); - sui.setPid(player, pid, GREETER_GET_SAVED_GREETING_LIST_PID); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerGreetingMaintenanceSelect(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handlePlayerGreetingMaintenanceSelect: init"); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerGreetingMaintenanceSelect: initial validation completed"); - int idx = sui.getListboxSelectedRow(params); - blog("terminal.greeter:handlePlayerGreetingMaintenanceSelect: idx: "+idx); - - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - switch (idx) - { - case 0: - blog("terminal.greeter:handlePlayerGreetingMaintenanceSelect: CASE 0"); - messageTo(self, "handlePlayerLoadGreetingSelect", params, 0, false); - break; - case 1: - blog("terminal.greeter:handlePlayerGreetingMaintenanceSelect: CASE 1"); - String selection = utils.getStringScriptVar(player, PLAYER_SEL_GREETER_SAVE_ELEMENT); - blog("terminal.greeter:handlePlayerGreetingMaintenanceSelect: -----------SELECTION: "+selection); - - if (selection == null || selection.equals("")) - { - blog("terminal.greeter:handlePlayerGreetingMaintenanceSelect: selection name failed: "+selection); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - String[] saveData = split(selection, '-'); - if (saveData == null) - { - blog("terminal.greeter:handlePlayerGreetingMaintenanceSelect: saveData failed: "+saveData.length); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (!deleteGreeting(self, player, controller, saveData[0])) - { - blog("terminal.greeter:handlePlayerGreetingMaintenanceSelect: deleteGreeting failed"); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - break; - - default: - messageTo(self, "handlePlayerLoadGreetingSelect", params, 0, false); - break; - } - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerLoadGreetingSelect(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handlePlayerLoadGreetingSelect: init"); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerLoadGreetingSelect: initial validation completed"); - int idx = sui.getListboxSelectedRow(params); - blog("terminal.greeter:handlePlayerLoadGreetingSelect: idx: "+idx); - - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - String selection = utils.getStringScriptVar(player, PLAYER_SEL_GREETER_SAVE_ELEMENT); - - if (selection == null || selection.equals("")) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - blog("terminal.greeter:handlePlayerLoadGreetingSelect: selection: "+selection); - - if (!loadSavedData(self, player, controller, selection)) - { - blog("terminal.greeter:handlePlayerLoadGreetingSelect: failed loadSavedData"); - - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - sendSystemMessage(player, SID_GREETING_LOADED); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - - public int changeTriggerRadius(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:changeTriggerRadius: init"); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - int radius = sui.getTransferInputTo(params); - if (radius < GREETER_TRIGGER_VOL_MIN) - { - radius = 1; - sendSystemMessage(player, SID_MIN_RADIUS); - } - if (radius > GREETER_TRIGGER_VOL_MAX) - { - radius = GREETER_TRIGGER_VOL_MAX; - sendSystemMessage(player, SID_MAX_RADIUS); - } - - setObjVar(controller, GREETER_TRIGGER_VOL_CURRENT, radius); - sendSystemMessage(player, SID_GREETING_RADIUS_CHANGED); - - messageTo(self, "handleCallVolumeToggleNoLife", null, 1, false); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - - public int changeGreeterDelay(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:changeGreeterDelay: init"); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - int delayAmt = sui.getTransferInputTo(params); - if (delayAmt < GREETER_BARK_TIMER_MIN) - { - delayAmt = 5; - sendSystemMessage(player, SID_MIN_FIVE_TIMER); - } - if (delayAmt > GREETER_BARK_TIMER_MAX) - { - delayAmt = GREETER_BARK_TIMER_MAX; - sendSystemMessage(player, SID_MAX_TIMER); - } - - setObjVar(controller, GREETER_DELAY_TIMER_CURRENT, delayAmt); - sendSystemMessage(player, SID_GREETING_DELAY_CHANGED); - - messageTo(self, "handleCallVolumeToggleNoLife", null, 1, false); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - - public int handleDestroyGreeter(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handleDestroyGreeter: init"); - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(controller, FOUND_OTHER_GREETERS)) - { - removeObjVar(controller, FOUND_OTHER_GREETERS); - } - - vendor_lib.removeObjectFromController(controller, self); - return SCRIPT_CONTINUE; - } - - - public int handleGreeterInitialize(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (!isValidId(ownerId) || !exists(ownerId)) - { - blog("terminal.greeter:handleGreeterInitialize: GREETER HAD NO OWNER! Aborting initialization process and deleting greeter."); - CustomerServiceLog("vendor", "terminal.greeter:handleGreeterInitialize: GREETER HAD NO OWNER! Aborting initialization process and deleting Greeter: "+ self); - messageTo(self, "handleDestroyGreeter", null, 0, false ); - return SCRIPT_OVERRIDE; - } - - removeObjVar(controller, vendor_lib.GREETER_NOT_INIT_OBJVAR); - setObjVar(controller, vendor_lib.GREETER_INIT_OBJVAR, true); - - blog("terminal.greeter:handleGreeterInitialize: GREETER INITIALIZED BY OWNER!"); - CustomerServiceLog("vendor", "terminal.greeter:handleGreeterInitialize: GREETER INITIALIZED BY OWNER: "+ getName(ownerId) +" "+ ownerId + " Greeter: "+ self); - return SCRIPT_CONTINUE; - } - - - public int handleSetVendorName(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - String greeterName = sui.getInputBoxText(params); - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (greeterName == null || greeterName.equals("") || isNameReserved(greeterName)) - { - - sendSystemMessage(player, SID_OBSCENE); - sui.inputbox(self, player, "@player_structure:name_d", sui.OK_CANCEL, "@player_structure:name_t", sui.INPUT_NORMAL, null, "handleSetVendorName", null ); - return SCRIPT_CONTINUE; - } - - if (greeterName.length() > 40) - { - greeterName = greeterName.substring(0, 39); - } - - setName(self, "Greeter: "+ greeterName); - sendSystemMessage(player, SID_GREETER_WAS_RENAMED); - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerGreeterAnimCategorySelect(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handlePlayerGreeterAnimCategorySelect: init."); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.hasPid(player, GREETER_ANIM_CATEGORY_PID)) - { - int pid = sui.getPid(player, GREETER_ANIM_CATEGORY_PID); - forceCloseSUIPage(pid); - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (!validateAllImperativeGreeterVars(self, player)) - { - return SCRIPT_CONTINUE; - } - else if (!utils.hasScriptVar(player, CATEGORY_ANIM_COL_NAMES_SCRVAR)) - { - blog("terminal.greeter:handlePlayerGreeterAnimCategorySelect: Player somehow lost the anim category list given in previous handler."); - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerGreeterAnimCategorySelect: prevalidation completed."); - - String[] greeterAnimCategories = utils.getStringArrayScriptVar(player, CATEGORY_ANIM_COL_NAMES_SCRVAR); - if (greeterAnimCategories == null) - { - return SCRIPT_CONTINUE; - } - - String greeterAnimCategory = greeterAnimCategories[idx]; - if (greeterAnimCategory == null || greeterAnimCategory.equals("")) - { - return SCRIPT_CONTINUE; - } - - String[] categoryAnims = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_ANIMS, greeterAnimCategory); - if (categoryAnims == null) - { - return SCRIPT_CONTINUE; - } - - String[] categoryAnimStrings = new String[categoryAnims.length]; - - for (int i = 0; i < categoryAnims.length; i++) - { - testAbortScript(); - categoryAnimStrings[i] = "@player_structure:"+categoryAnims[i]; - } - - if (categoryAnimStrings == null) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, SELECTED_CAT_ANIM_SCRVAR, categoryAnims); - utils.setScriptVar(player, SELECTED_CAT_ANIM_STR_SCRVAR, categoryAnimStrings); - - int pid = sui.listbox( self, player, "@player_structure:greeter_anim_category_d", sui.OK_CANCEL, "@player_structure:greeter_anim_category_t", categoryAnimStrings, "handlePlayerGreeterAnimSelect", true); - sui.setPid(player, pid, GREETER_ANIM_CATEGORY_PID); - - return SCRIPT_CONTINUE; - } - - - public int handlePlayerGreeterAnimSelect(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handlePlayerGreeterAnimSelect: init."); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (!validateAllImperativeGreeterVars(self, player)) - { - return SCRIPT_CONTINUE; - } - else if (!utils.hasScriptVar(player, SELECTED_CAT_ANIM_SCRVAR)) - { - blog("terminal.greeter:handlePlayerGreeterAnimSelect: Player somehow lost the anim category selected in previous handler."); - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerGreeterAnimSelect: prevalidation completed."); - - String[] animCategoryList = utils.getStringArrayScriptVar(player, SELECTED_CAT_ANIM_SCRVAR); - if (animCategoryList == null) - { - return SCRIPT_CONTINUE; - } - - String greeterAnimSelected = animCategoryList[idx]; - if (greeterAnimSelected == null || greeterAnimSelected.equals("")) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerGreeterAnimSelect: We have Anim. Getting Controller"); - - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - blog("terminal.greeter:handlePlayerGreeterAnimSelect: We have Controller. Setting Anim"); - - setObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION, greeterAnimSelected); - setObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION_STRING, "@player_structure:"+greeterAnimSelected); - - setObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR, true); - - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerGreeterMoodCategorySelect(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handlePlayerGreeterMoodCategorySelect: init."); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.hasPid(player, GREETER_MOOD_CATEGORY_PID)) - { - int pid = sui.getPid(player, GREETER_MOOD_CATEGORY_PID); - forceCloseSUIPage(pid); - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (!validateAllImperativeGreeterVars(self, player)) - { - return SCRIPT_CONTINUE; - } - else if (!utils.hasScriptVar(player, CATEGORY_MOOD_COL_NAMES_SCRVAR) || !utils.hasScriptVar(player, CATEGORY_MOOD_COL_STRINGS_SCRVAR)) - { - blog("terminal.greeter:handlePlayerGreeterMoodCategorySelect: Player somehow lost the mood category list given in previous handler."); - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerGreeterMoodCategorySelect: prevalidation completed."); - String[] greeterMoodCategories = utils.getStringArrayScriptVar(player, CATEGORY_MOOD_COL_NAMES_SCRVAR); - - if (greeterMoodCategories == null) - { - return SCRIPT_CONTINUE; - } - - String greeterMoodCategory = greeterMoodCategories[idx]; - if (greeterMoodCategory == null || greeterMoodCategory.equals("")) - { - return SCRIPT_CONTINUE; - } - - String[] categoryMoods = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_MOODS, greeterMoodCategory); - if (categoryMoods == null) - { - return SCRIPT_CONTINUE; - } - - String[] categoryMoodStrings = new String[categoryMoods.length]; - for (int i = 0; i < categoryMoods.length; i++) - { - testAbortScript(); - categoryMoodStrings[i] = "@player_structure:"+categoryMoods[i]; - } - - utils.setScriptVar(player, SELECTED_CAT_MOOD_SCRVAR, categoryMoods); - - int pid = sui.listbox( self, player, "@player_structure:greeter_mood_category_d", sui.OK_CANCEL, "@player_structure:greeter_mood_category_t", categoryMoodStrings, "handlePlayerGreeterMoodSelect", true); - sui.setPid(player, pid, GREETER_MOOD_CATEGORY_PID); - - return SCRIPT_CONTINUE; - } - - - public int handlePlayerGreeterMoodSelect(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handlePlayerGreeterMoodSelect: init."); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (!validateAllImperativeGreeterVars(self, player)) - { - return SCRIPT_CONTINUE; - } - else if (!utils.hasScriptVar(player, SELECTED_CAT_MOOD_SCRVAR)) - { - blog("terminal.greeter:handlePlayerGreeterMoodSelect: Player somehow lost the mood category selected in previous handler."); - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerGreeterMoodSelect: prevalidation completed."); - - String[] moodCategoryList = utils.getStringArrayScriptVar(player, SELECTED_CAT_MOOD_SCRVAR); - if (moodCategoryList == null) - { - return SCRIPT_CONTINUE; - } - - String greeterMoodSelected = moodCategoryList[idx]; - if (greeterMoodSelected == null || greeterMoodSelected.equals("")) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerGreeterMoodSelect: We have Mood. Getting Controller"); - - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - blog("terminal.greeter:handlePlayerGreeterMoodSelect: We have Controller. Setting Mood"); - - setObjVar(controller, vendor_lib.GREETER_ACTUAL_MOOD, greeterMoodSelected); - setObjVar(controller, vendor_lib.GREETER_ACTUAL_MOOD_STRING, "@player_structure:"+greeterMoodSelected); - - setObjVar(controller, vendor_lib.GREETER_HAS_MOOD_OBJVAR, true); - - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerEffectSelection(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handlePlayerEffectSelection: init."); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (!validateAllImperativeGreeterVars(self, player)) - { - return SCRIPT_CONTINUE; - } - else if (!utils.hasScriptVar(player, PLAYER_SEL_GREETER_EFFECT_LIST) || !utils.hasScriptVar(player, PLAYER_SEL_GREETER_EFFECT_TYPE)) - { - blog("terminal.greeter:handlePlayerEffectSelection: Player somehow lost the effect or effect type selected in previous handler."); - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerEffectSelection: prevalidation completed."); - - String[] effectList = utils.getStringArrayScriptVar(player, PLAYER_SEL_GREETER_EFFECT_LIST); - String[] menuList = utils.getStringArrayScriptVar(player, PLAYER_SEL_GREETER_SOUND_VO_STRING_LIST); - String effectType = utils.getStringScriptVar(player, PLAYER_SEL_GREETER_EFFECT_TYPE); - - blog("greeter:handlePlayerEffectSelection: effectList: "+effectList); - blog("greeter:handlePlayerEffectSelection: effectType: "+effectType); - - if (effectList == null) - { - return SCRIPT_CONTINUE; - } - else if (effectType == null || effectType.equals("")) - { - return SCRIPT_CONTINUE; - } - else if (!effectType.equals(SOUND_OPTION) && !effectType.equals(VOICE_OPTION)) - { - return SCRIPT_CONTINUE; - } - - blog("greeter:handlePlayerEffectSelection: effectList and effectType attained."); - - String effectSelected = effectList[idx]; - if (effectSelected == null || effectSelected.equals("")) - { - return SCRIPT_CONTINUE; - } - - blog("greeter:handlePlayerEffectSelection: We have Effect. Getting Controller"); - - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - blog("greeter:handlePlayerEffectSelection: We have Controller. Setting Effect"); - - String menuStrSelected = menuList[idx]; - if (menuStrSelected == null || menuStrSelected.equals("")) - { - return SCRIPT_CONTINUE; - } - - setObjVar(controller, vendor_lib.GREETER_SOUNDS_VO_MENU_OBJVAR, menuStrSelected); - - if (effectType.equals(SOUND_OPTION)) - { - blog("greeter:handlePlayerEffectSelection: Setting SOUND"); - - setObjVar(controller, vendor_lib.GREETER_SOUNDS_OBJVAR, effectSelected); - - setObjVar(controller, vendor_lib.GREETER_SOUNDING_OBJVAR, true); - - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - else if (effectType.equals(VOICE_OPTION)) - { - blog("greeter:handlePlayerEffectSelection: Setting VOICE"); - - setObjVar(controller, vendor_lib.GREETER_VOICES_OBJVAR, effectSelected); - - setObjVar(controller, vendor_lib.GREETER_VOICING_OBJVAR, true); - - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerEffectSelection: FAILED TO RECEIVE EFFECT."); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerStatementSelection(obj_id self, dictionary params) throws InterruptedException - { - blog("terminal.greeter:handlePlayerStatementSelection: init."); - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int idx = sui.getListboxSelectedRow(params); - - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - if (!validateAllImperativeGreeterVars(self, player)) - { - return SCRIPT_CONTINUE; - } - else if (!utils.hasScriptVar(player, PLAYER_SEL_GREETER_STATEMENT_LIST)) - { - blog("terminal.greeter:handlePlayerStatementSelection: Player somehow lost the statement for greeter previous handler."); - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerStatementSelection: prelim validation completed."); - String[] statementList = utils.getStringArrayScriptVar(player, PLAYER_SEL_GREETER_STATEMENT_LIST); - if (statementList == null) - { - return SCRIPT_CONTINUE; - } - blog("terminal.greeter:handlePlayerStatementSelection: statementList: "+statementList); - - String finalStatement = localize(new string_id("player_structure", statementList[idx])); - - if (finalStatement == null || finalStatement.equals("")) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.greeter:handlePlayerGreeterAnimSelect: We have Statement. Getting Controller"); - - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return SCRIPT_CONTINUE; - } - blog("terminal.greeter:handlePlayerGreeterAnimSelect: We have Controller. Setting Statement"); - - setObjVar(controller, vendor_lib.GREETER_ACTUAL_STATEMENT, finalStatement); - - setObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR, true); - blog("terminal.greeter:handlePlayerStatementSelection: has GREETER_HAS_STATEMENT_OBJVAR: "+hasObjVar(self, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR)); - blog("terminal.greeter:handlePlayerStatementSelection: setObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR, true): "+getBooleanObjVar(self, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR)); - - buildMainControlMenu(self, player); - return SCRIPT_CONTINUE; - } - - - public int resetBarkTimer(obj_id self, dictionary params) throws InterruptedException - { - - utils.removeScriptVar(self, vendor_lib.GREETER_ALREADY_BARKED_SCRVAR); - return SCRIPT_CONTINUE; - } - - - public boolean getGreeterAnimCategorySelect(obj_id self, obj_id controller, obj_id player) throws InterruptedException - { - blog("terminal.greeter:getGreeterAnimCategorySelect: init."); - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - if (!validateAllImperativeGreeterVars(self, player)) - { - return false; - } - if (!hasObjVar(controller, vendor_lib.GREETER_HAS_ANIMS_OBJVAR)) - { - blog("terminal.greeter:getGreeterAnimCategorySelect: Greeter somehow had animation radial option even though no animations are allowed."); - return false; - } - if (sui.hasPid(player, GREETER_ANIM_PID)) - { - int pid = sui.getPid(player, GREETER_ANIM_PID); - forceCloseSUIPage(pid); - } - - blog("terminal.greeter:getGreeterAnimCategorySelect: prevalidation completed."); - - String[] greeterAnimCategories = vendor_lib.getAllGreeterDatatableColumnNames(self, vendor_lib.TBL_GREETER_ANIMS); - if (greeterAnimCategories == null) - { - return false; - } - - blog("terminal.greeter:getGreeterAnimCategorySelect: Animations received."); - - int greeterAnimCategoriesLen = greeterAnimCategories.length; - if (greeterAnimCategoriesLen < 0) - { - return false; - } - - blog("terminal.greeter:getGreeterAnimCategorySelect: Animations length ok."); - - String creatureType = getStringObjVar(controller, vendor_lib.CREATURE_TYPE); - if (creatureType == null || creatureType.equals("")) - { - return false; - } - - blog("terminal.greeter:getGreeterAnimCategorySelect: creatureType: "+creatureType); - String greeterType = "greeter_"+creatureType; - if (!greeterType.equals("greeter_ewok") && !greeterType.equals("greeter_jawa") && !greeterType.equals("greeter_gamorrean")) - { - blog("terminal.greeter:getGreeterAnimCategorySelect: NO JAWA OR EWOK FOUND: "+greeterType); - if (sui.hasPid(player, GREETER_ANIM_PARENT_PID)) - { - int pid = sui.getPid(player, GREETER_ANIM_PARENT_PID); - forceCloseSUIPage(pid); - } - - Vector greeterAnimCategoriesRaw = new Vector(); - greeterAnimCategoriesRaw.setSize(0); - Vector greeterAnimCategoriesStrings = new Vector(); - greeterAnimCategoriesStrings.setSize(0); - - for (int i = 0; i < greeterAnimCategoriesLen; i++) - { - testAbortScript(); - if (greeterAnimCategories[i].startsWith("greeter_")) - { - utils.addElement(greeterAnimCategoriesRaw, greeterAnimCategories[i]); - utils.addElement(greeterAnimCategoriesStrings, "@player_structure:"+greeterAnimCategories[i]); - } - } - - if (greeterAnimCategoriesRaw.isEmpty() || greeterAnimCategoriesStrings.isEmpty()) - { - return false; - } - else if (greeterAnimCategoriesRaw.size() != greeterAnimCategoriesStrings.size()) - { - return false; - } - - String[] greeterAnimStringMenu = new String[greeterAnimCategoriesStrings.size()]; - String[] greeterAnimRawData = new String[greeterAnimCategoriesRaw.size()]; - greeterAnimCategoriesStrings.toArray(greeterAnimStringMenu); - greeterAnimCategoriesRaw.toArray(greeterAnimRawData); - - utils.setScriptVar(player, CATEGORY_ANIM_COL_NAMES_SCRVAR, greeterAnimRawData); - - blog("terminal.greeter:getGreeterAnimCategorySelect: sending player sui."); - - int pid = sui.listbox( self, player, "@player_structure:greeter_anim_parent_d", sui.OK_CANCEL, "@player_structure:greeter_anim_parent_t", greeterAnimStringMenu, "handlePlayerGreeterAnimCategorySelect", true); - sui.setPid(player, pid, GREETER_ANIM_PARENT_PID); - - return true; - } - blog("terminal.greeter:getGreeterAnimCategorySelect: EWOK OR JAWA FOUND: "+greeterType); - - String[] jawaOrEwokEmoteList = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_ANIMS, "emote_"+greeterType); - if (jawaOrEwokEmoteList == null) - { - return false; - } - - int listLength = jawaOrEwokEmoteList.length; - if (listLength <= 0) - { - return false; - } - - String[] jawaOrEwokEmoteStrings = new String[listLength]; - - for (int i = 0; i < listLength; i++) - { - testAbortScript(); - jawaOrEwokEmoteStrings[i] = "@player_structure:"+jawaOrEwokEmoteList[i]; - } - - if (jawaOrEwokEmoteStrings == null) - { - return false; - } - - utils.setScriptVar(player, SELECTED_CAT_ANIM_SCRVAR, jawaOrEwokEmoteList); - - int pid = sui.listbox( self, player, "@player_structure:greeter_anim_category_d", sui.OK_CANCEL, "@player_structure:greeter_anim_category_t", jawaOrEwokEmoteStrings, "handlePlayerGreeterAnimSelect", true); - sui.setPid(player, pid, GREETER_ANIM_PID); - - return true; - } - - - public boolean getGreeterMoodCategorySelect(obj_id self, obj_id controller, obj_id player) throws InterruptedException - { - blog("terminal.greeter:getGreeterMoodCategorySelect: init."); - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - if (!validateAllImperativeGreeterVars(self, player)) - { - return false; - } - if (!hasObjVar(controller, vendor_lib.GREETER_MOODS_OBJVAR)) - { - blog("terminal.greeter:getGreeterMoodCategorySelect: Greeter somehow had animation radial option even though no animations are allowed."); - return false; - } - if (sui.hasPid(player, GREETER_MOOD_PID)) - { - int pid = sui.getPid(player, GREETER_MOOD_PID); - forceCloseSUIPage(pid); - } - - blog("terminal.greeter:getGreeterMoodCategorySelect: prevalidation completed."); - - String[] greeterMoodCategories = vendor_lib.getAllGreeterDatatableColumnNames(self, vendor_lib.TBL_GREETER_MOODS); - if (greeterMoodCategories == null) - { - return false; - } - - int greeterMoodCategoriesLen = greeterMoodCategories.length; - if (greeterMoodCategoriesLen < 0) - { - return false; - } - - String[] greeterMoodCategoriesStrings = new String[greeterMoodCategoriesLen]; - for (int i = 0; i < greeterMoodCategoriesLen; i++) - { - testAbortScript(); - greeterMoodCategoriesStrings[i] = "@player_structure:"+greeterMoodCategories[i]; - } - if (greeterMoodCategoriesStrings == null) - { - return false; - } - - utils.setScriptVar(player, CATEGORY_MOOD_COL_NAMES_SCRVAR, greeterMoodCategories); - utils.setScriptVar(player, CATEGORY_MOOD_COL_STRINGS_SCRVAR, greeterMoodCategoriesStrings); - - blog("terminal.greeter:getGreeterMoodCategorySelect: sending player sui."); - - int pid = sui.listbox( self, player, "@player_structure:greeter_mood_parent_d", sui.OK_CANCEL, "@player_structure:greeter_mood_parent_t", greeterMoodCategoriesStrings, "handlePlayerGreeterMoodCategorySelect", true); - sui.setPid(player, pid, GREETER_MOOD_PID); - return true; - } - - - public boolean getGreeterSoundVoiceList(obj_id self, obj_id controller, obj_id player, String effectType) throws InterruptedException - { - blog("terminal.greeter:getGreeterSoundVoiceList: init."); - if (!isValidId(self) || !exists(self)) - { - return false; - } - else if (!isValidId(player) || !exists(player)) - { - return false; - } - else if (effectType == null || effectType.equals("")) - { - return false; - } - else if (!validateAllImperativeGreeterVars(self, player)) - { - return false; - } - else if (!effectType.equals(SOUND_OPTION) && !effectType.equals(VOICE_OPTION)) - { - blog("terminal.greeter:getGreeterSoundVoiceList: Player somehow lost their effect type."); - return false; - } - else if (effectType.equals(SOUND_OPTION) && !hasObjVar(controller, vendor_lib.GREETER_HAS_SOUND_OBJVAR)) - { - blog("terminal.greeter:getGreeterSoundVoiceList: Player has "+SOUND_OPTION+" but the greeter doesn't allow for "+SOUND_OPTION); - return false; - } - else if (effectType.equals(VOICE_OPTION) && !hasObjVar(controller, vendor_lib.GREETER_HAS_VO_OBJVAR)) - { - blog("terminal.greeter:getGreeterSoundVoiceList: Player has "+VOICE_OPTION+" but the greeter doesn't allow for "+VOICE_OPTION); - return false; - } - - if (sui.hasPid(player, GREETER_EFFECT_PID)) - { - int pid = sui.getPid(player, GREETER_EFFECT_PID); - forceCloseSUIPage(pid); - } - - blog("terminal.greeter:getGreeterSoundVoiceList: prevalidation completed."); - String creatureType = getStringObjVar(controller, vendor_lib.CREATURE_TYPE); - if (creatureType == null || creatureType.equals("")) - { - return false; - } - - String greeterType = "greeter_"+creatureType; - String greeterSoundVoColName = greeterType+"_"+effectType; - String greeterSoundVoColNameString = greeterType+"_"+effectType+"_string"; - - if (hasObjVar(self, "greeter.sound_vo") && hasObjVar(self, "greeter.sound_vo_string")) - { - String soundVo = getStringObjVar(self, "greeter.sound_vo"); - String soundVoString = getStringObjVar(self, "greeter.sound_vo_string"); - if (soundVo != null && !soundVo.equals("") && soundVoString != null && !soundVoString.equals("")) - { - - greeterSoundVoColName = soundVo; - greeterSoundVoColNameString = soundVoString; - } - } - - String[] effectList = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_SOUND_VOICE_EFFECT, greeterSoundVoColName); - if (effectList == null) - { - return false; - } - - int effectListLen = effectList.length; - if (effectListLen < 0) - { - return false; - } - - String[] menuStringData = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_SOUND_VOICE_EFFECT, greeterSoundVoColNameString); - if (menuStringData == null) - { - return false; - } - - int menuStringDatalength = menuStringData.length; - if (menuStringDatalength < 0) - { - return false; - } - - String[] menuStrings = new String[menuStringDatalength]; - for (int i = 0; i < menuStringDatalength; i++) - { - testAbortScript(); - menuStrings[i] = "@player_vendor:"+menuStringData[i]; - } - if (menuStrings == null) - { - return false; - } - - blog("terminal.greeter:getGreeterSoundVoiceList: has effect list."); - - utils.setScriptVar(player, PLAYER_SEL_GREETER_EFFECT_LIST, effectList); - utils.setScriptVar(player, PLAYER_SEL_GREETER_EFFECT_TYPE, effectType); - utils.setScriptVar(player, PLAYER_SEL_GREETER_SOUND_VO_STRING_LIST, menuStrings); - int pid = sui.listbox( self, player, "@player_structure:greeter_effect_list_d", sui.OK_CANCEL, "@player_structure:greeter_effect_list_t", menuStrings, "handlePlayerEffectSelection", true); - sui.setPid(player, pid, GREETER_EFFECT_PID); - - return true; - } - - - public boolean getGreeterStatementSelection(obj_id self, obj_id controller, obj_id player) throws InterruptedException - { - blog("terminal.greeter:getGreeterStatementSelection: init."); - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - if (!validateAllImperativeGreeterVars(self, player)) - { - return false; - } - if (!hasObjVar(controller, vendor_lib.GREETER_HAS_CHAT_OBJVAR)) - { - blog("terminal.greeter:getGreeterStatementSelection: Player somehow received a statement option when the greeter cannot make statements."); - return false; - } - - if (sui.hasPid(player, GREETER_STATEMENT_PID)) - { - int pid = sui.getPid(player, GREETER_STATEMENT_PID); - forceCloseSUIPage(pid); - } - - blog("terminal.greeter:getGreeterStatementSelection: prevalidation completed."); - String creatureType = getStringObjVar(controller, vendor_lib.CREATURE_TYPE); - if (creatureType == null || creatureType.equals("")) - { - return false; - } - - String greeterType = "greeter_"+creatureType; - String[] statementList = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_SAY_CHAT, greeterType); - if (statementList == null) - { - return false; - } - blog("terminal.greeter:getGreeterStatementSelection: has effect list."); - - String[] combinedStrings = new String[statementList.length]; - for (int i = 0; i < statementList.length; i++) - { - testAbortScript(); - combinedStrings[i] = "@player_structure:"+statementList[i]; - } - - int statementListLen = statementList.length; - if (statementListLen < 0) - { - return false; - } - - utils.setScriptVar(player, PLAYER_SEL_GREETER_STATEMENT_LIST, statementList); - int pid = sui.listbox(self, player, "@player_structure:greeter_statement_list_d", sui.OK_CANCEL, "@player_structure:greeter_statement_list_t", combinedStrings, "handlePlayerStatementSelection", true); - sui.setPid(player, pid, GREETER_STATEMENT_PID); - - return true; - } - - - public boolean destroyGreeter(obj_id self) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - - blog("terminal.greeter:destroyGreeter: Greeter Destroy Initiated."); - CustomerServiceLog("vendor", "terminal.greeter:destroyGreeter: Greeter Destroy Initiated. Object: "+self); - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (!isIdValid(ownerId) && !exists(ownerId)) - { - blog("terminal.greeter:destroyGreeter: Greeter Destroy could not find owner ID. Destroy object NOW!"); - CustomerServiceLog("vendor", "terminal.greeter:destroyGreeter: Greeter Destroy could not find owner ID for object: "+self+" Destroy object NOW!"); - destroyObject(self); - return false; - } - if (hasObjVar(ownerId, vendor_lib.GREETER_NOT_INIT_OBJVAR)) - { - removeObjVar(ownerId, vendor_lib.GREETER_NOT_INIT_OBJVAR); - } - - String ownerName = getName(ownerId); - if (ownerName == null || ownerName.equals("")) - { - blog("terminal.greeter:destroyGreeter: Greeter Destroy could not find owner name with the owner oid. Destroy object NOW!"); - CustomerServiceLog("vendor", "terminal.greeter:destroyGreeter: Greeter Destroy could not find the owner name with the owner oid: "+ownerId+" for object: "+self+" Destroy object NOW!"); - destroyObject(self); - return false; - } - - location loc = getLocation(self); - if (loc == null) - { - blog("terminal.greeter:destroyGreeter: Greeter Destroy could not find greeter location. Destroy object NOW!"); - CustomerServiceLog("vendor", "terminal.greeter:destroyGreeter: Greeter Destroy could not find the owner name with the owner oid: "+ownerId+" for object: "+self+" Destroy object NOW!"); - destroyObject(self); - return false; - } - - blog("terminal.greeter:destroyGreeter: Attempting to delete."); - CustomerServiceLog("vendor", "terminal.greeter:destroyGreeter: Destroying Greeter. Owner: "+ownerName+" "+ownerId+" Object: "+self+ " Location: "+ loc); - - destroyObject(self); - return true; - } - - - public boolean toggleTriggerVolume(obj_id self) throws InterruptedException - { - return toggleTriggerVolume(self, true); - } - - - public boolean toggleTriggerVolume(obj_id self, boolean giveLife) throws InterruptedException - { - - blog("terminal.greeter:toggleTriggerVolume init: GIVE LIFE = "+giveLife); - - blog("terminal.greeter:toggleTriggerVolume: Greeter Initiated Trigger Volume Toggle."); - CustomerServiceLog("vendor", "terminal.greeter:handleGreeterInitialize: Greeter Initiated Trigger Volume Toggle. Greeter: "+ self); - if (!isValidId(self) || !exists(self)) - { - return false; - } - - blog("terminal.greeter:toggleTriggerVolume: Greeter ID is valid."); - - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (!isIdValid(ownerId) && !exists(ownerId)) - { - return false; - } - blog("terminal.greeter:toggleTriggerVolume: Trigger Volume Owner ID validation complete."); - - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return false; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - - blog("terminal.greeter:toggleTriggerVolume: Greeter has Controller ID."); - - if (!hasObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR)) - { - removeTriggerVolume(ALERT_VOLUME_NAME); - blog("terminal.greeter:toggleTriggerVolume: Greeter Removing Trigger Volume."); - CustomerServiceLog("vendor", "terminal.greeter:toggleTriggerVolume: Greeter Removing Trigger Volume. OWNER: "+ getName(ownerId) +" "+ ownerId + " Greeter: "+ self); - removeObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR); - return true; - } - - blog("terminal.greeter:toggleTriggerVolume: The greeter is currently active."); - - location loc = getLocation(self); - if (loc == null) - { - blog("terminal.greeter:toggleTriggerVolume: Trigger Toggler could not find greeter location."); - CustomerServiceLog("vendor", "terminal.greeter:toggleTriggerVolume: Trigger Toggler could not find greeter location for: "+self+" owner oid: "+ownerId); - - } - blog("terminal.greeter:toggleTriggerVolume: Trigger Volume location received."); - - int radius = GREETER_TRIGGER_VOL_DEFAULT; - if (hasObjVar(controller, GREETER_TRIGGER_VOL_CURRENT) && getIntObjVar(controller, GREETER_TRIGGER_VOL_CURRENT) >= GREETER_TRIGGER_VOL_MIN) - { - radius = getIntObjVar(controller, GREETER_TRIGGER_VOL_CURRENT); - } - - createTriggerVolume(ALERT_VOLUME_NAME, radius, true); - blog("terminal.greeter:toggleTriggerVolume: Greeter Creating Trigger Volume."); - CustomerServiceLog("vendor", "terminal.greeter:toggleTriggerVolume: Greeter Creating Trigger Volume. OWNER: "+ getName(ownerId) +" "+ ownerId + " Greeter: "+ self+ " Location: "+ loc); - - if (utils.hasScriptVar(self, GREETER_INITIALIZE_SCRVAR)) - { - utils.removeScriptVar(self, GREETER_INITIALIZE_SCRVAR); - } - - if (utils.hasScriptVar(self, vendor_lib.GREETER_ALREADY_BARKED_SCRVAR)) - { - utils.removeScriptVar(self, vendor_lib.GREETER_ALREADY_BARKED_SCRVAR); - } - - if (giveLife) - { - blog("terminal.greeter:toggleTriggerVolume: GIVE LIFE = "+giveLife); - bringGreeterToLife(self); - } - return true; - } - - - public boolean validateAllImperativeGreeterVars(obj_id self, obj_id player) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - else if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return false; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (!isValidId(ownerId) || !exists(ownerId)) - { - blog("terminal.greeter:handleVendorAnimSelect: Greeter somehow didn't have a greeter ownerId objvar. Aborting."); - return false; - } - else if (ownerId != player) - { - blog("terminal.greeter:handleVendorAnimSelect: Greeter is being accessed by a player that is not owner. Aborting."); - return false; - } - else if (!hasObjVar(controller, vendor_lib.GREETER_IS_ACTIVATED_OBJVAR)) - { - blog("terminal.greeter:handleVendorAnimSelect: Greeter somehow didn't have a greeter activation objvar. Aborting."); - return false; - } - else if (!hasObjVar(controller, vendor_lib.CREATURE_TYPE)) - { - blog("terminal.greeter:handleVendorAnimSelect: Greeter somehow didn't have a creature type objvar. Aborting."); - return false; - } - else if (hasObjVar(controller, vendor_lib.GREETER_NOT_INIT_OBJVAR)) - { - blog("terminal.greeter:handleVendorAnimSelect: Greeter not initialized. Aborting."); - return false; - } - else if (hasObjVar(controller, vendor_lib.GREETER_NOT_INIT_OBJVAR)) - { - blog("terminal.greeter:handleVendorAnimSelect: Owner using Greeter still has the not initialized var. Aborting."); - return false; - } - - return true; - } - - - public boolean bringGreeterToLife(obj_id self) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - - if (!hasObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR)) - { - return false; - } - - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (!isIdValid(ownerId)) - { - return false; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - - location loc = getLocation(self); - if (loc == null) - { - return false; - } - - int radius = GREETER_TRIGGER_VOL_DEFAULT; - if (hasObjVar(controller, GREETER_TRIGGER_VOL_CURRENT) && getIntObjVar(controller, GREETER_TRIGGER_VOL_CURRENT) >= GREETER_TRIGGER_VOL_MIN) - { - radius = getIntObjVar(controller, GREETER_TRIGGER_VOL_CURRENT); - } - - if (radius <= 0) - { - return false; - } - - obj_id[] objects = getPlayerCreaturesInRange(loc, radius); - if (objects == null || objects.length == 0) - { - return false; - } - - obj_id playerToGreet = objects[0]; - - bringGreeterToLife(self, controller, playerToGreet); - return true; - } - - - public boolean bringGreeterToLife(obj_id self, obj_id controller, obj_id player) throws InterruptedException - { - blog("vendor.greeter.bringGreeterToLife: init."); - - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - - blog("vendor.greeter.bringGreeterToLife: validation complete. Player: "+player); - - String anim = ""; - String voice = ""; - String mood = "friendly"; - String sound = ""; - String effect = ""; - String say_chat = ""; - - blog("vendor.greeter.bringGreeterToLife: initialized greeter vars "); - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_ANIMS_OBJVAR) == vendor_lib.VAR_TRUE && hasObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR)) - { - anim = getStringObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION); - blog("vendor.greeter.bringGreeterToLife: has anim: "+anim); - } - - blog("vendor.greeter.bringGreeterToLife: VOICE VAR: "+utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_VO_OBJVAR)); - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_VO_OBJVAR) == vendor_lib.VAR_TRUE && hasObjVar(controller, vendor_lib.GREETER_VOICING_OBJVAR)) - { - voice = getStringObjVar(controller, vendor_lib.GREETER_VOICES_OBJVAR); - blog("vendor.greeter.bringGreeterToLife: has voice: "+voice); - } - blog("vendor.greeter.bringGreeterToLife: SOUND VAR: "+utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_SOUND_OBJVAR)); - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_SOUND_OBJVAR) == vendor_lib.VAR_TRUE && hasObjVar(controller, vendor_lib.GREETER_SOUNDING_OBJVAR)) - { - sound = getStringObjVar(controller, vendor_lib.GREETER_SOUNDS_OBJVAR); - blog("vendor.greeter.bringGreeterToLife: has sound: "+sound); - } - if (utils.getIntObjVar(controller, vendor_lib.GREETER_MOODS_OBJVAR) == vendor_lib.VAR_TRUE && hasObjVar(controller, vendor_lib.GREETER_HAS_MOOD_OBJVAR)) - { - mood = getStringObjVar(controller, vendor_lib.GREETER_ACTUAL_MOOD); - blog("vendor.greeter.bringGreeterToLife: has mood: "+mood); - } - else - { - mood = ai_lib.MOOD_CALM; - blog("vendor.greeter.bringGreeterToLife: has anim: "+mood); - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_CHAT_OBJVAR) == vendor_lib.VAR_TRUE && hasObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR)) - { - say_chat = getStringObjVar(controller, vendor_lib.GREETER_ACTUAL_STATEMENT); - blog("vendor.greeter.bringGreeterToLife: has say_chat: "+say_chat); - } - - blog("vendor.greeter.bringGreeterToLife: trigger passed more tests"); - blog("vendor.greeter.bringGreeterToLife: anim: "+anim); - blog("vendor.greeter.bringGreeterToLife: voice: "+voice); - blog("vendor.greeter.bringGreeterToLife: sound: "+sound); - blog("vendor.greeter.bringGreeterToLife: say_chat: "+say_chat); - - faceTo(self, player); - - if (voice != null && !voice.equals("")) - { - blog("vendor.greeter.bringGreeterToLife: trigger VOICE using voice: "+voice); - if (!play2dNonLoopingSound(player, voice)) - { - blog("vendor.greeter.bringGreeterToLife: trigger FAILED VOICE"); - } - } - - if (say_chat != null && !say_chat.equals("")) - { - - blog("vendor.greeter.bringGreeterToLife: trigger CHATTING"); - chat._chat(self, player, chat.CHAT_SAY, mood, say_chat, null, null); - } - if (anim != null && !anim.equals("")) - { - blog("vendor.greeter.bringGreeterToLife: trigger ANIMATING using anim: "+anim); - doAnimationAction(self, anim); - } - if (sound != null && !sound.equals("")) - { - blog("vendor.greeter.bringGreeterToLife: trigger SOUNDS using sound: "+sound); - playClientEffectObj(self, sound, player, ""); - } - - blog("vendor.greeter.bringGreeterToLife: trigger should have done it all"); - - utils.setScriptVar(self, vendor_lib.GREETER_ALREADY_BARKED_SCRVAR, 1); - - int delay = GREETER_BARK_TIMER_MAX; - if (hasObjVar(controller, GREETER_DELAY_TIMER_CURRENT) && getIntObjVar(controller, GREETER_DELAY_TIMER_CURRENT) >= GREETER_BARK_TIMER_MIN) - { - delay = getIntObjVar(controller, GREETER_DELAY_TIMER_CURRENT); - } - - messageTo(self, "resetBarkTimer", null, delay, false); - - return true; - } - - - public boolean deleteGreeting(obj_id self, obj_id player, obj_id controller, String saveName) throws InterruptedException - { - blog("vendor.greeter.deleteGreeting: init."); - - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - if (saveName == null || saveName.equals("")) - { - return false; - } - - blog("vendor.greeter.deleteGreeting: initial validation completed"); - - String[] allSaves = getStringArrayObjVar(controller, GREETER_SAVE_DATA); - if (allSaves == null) - { - return false; - } - - blog("vendor.greeter.deleteGreeting: allSaves.length: "+allSaves.length); - int listLength = allSaves.length; - if (listLength == 1 && allSaves[0].startsWith(saveName + "-")) - { - blog("vendor.greeter.deleteGreeting: List LENGTH == 1, removing OBJVAR"); - removeObjVar(controller, GREETER_SAVE_DATA); - return true; - } - - blog("vendor.greeter.deleteGreeting: List longer than 1, saveName:"+saveName); - int row = -1; - for (int a = 0; a < listLength; a++) - { - testAbortScript(); - blog("vendor.greeter.deleteGreeting: Loop found: "+allSaves[a]); - - if (allSaves[a].startsWith(saveName + "-")) - { - blog("vendor.greeter.deleteGreeting: Loop FOUND MATCH: "+allSaves[a]); - row = a; - break; - } - } - if (row < 0) - { - return false; - } - - blog("vendor.greeter.deleteGreeting: row: "+row); - - String[] newSaveList = new String[listLength - 1]; - blog("vendor.greeter.deleteGreeting: newSaveList.length(): "+newSaveList.length); - - int i = 0; - for (int b = 0; b < listLength; b++) - { - testAbortScript(); - if (b == row) - { - continue; - } - - blog("vendor.greeter.deleteGreeting: allSaves[b]: "+allSaves[b]+" being saved to location: "+i+" in array newSaveList"); - newSaveList[i] = allSaves[b]; - i++; - } - - blog("vendor.greeter.deleteGreeting: array copy skipping deleted complete"); - - setObjVar(controller, GREETER_SAVE_DATA, newSaveList); - return true; - } - - - public boolean getSavedGreetings(obj_id self, obj_id player, obj_id controller) throws InterruptedException - { - blog("vendor.greeter.getSavedGreetings: init."); - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - - blog("vendor.greeter.getSavedGreetings: initial validation completed."); - - String[] allSaves = getStringArrayObjVar(controller, GREETER_SAVE_DATA); - if (allSaves == null || allSaves.length == 0) - { - sendSystemMessage(player, SID_NO_SAVED_GREETS); - return false; - } - blog("vendor.greeter.getSavedGreetings: Saved Data List Length: "+allSaves.length); - blog("vendor.greeter.getSavedGreetings: allSaves[0]: "+allSaves[0]); - Vector allNamesVector = new Vector(); - Vector allDataVector = new Vector(); - Vector combinedDataVector = new Vector(); - - for (int i = 0; i < allSaves.length; i++) - { - testAbortScript(); - blog("vendor.greeter.getSavedGreetings: Loop found: "+allSaves[i]); - if (allSaves[i] == null || allSaves[i].length() == 0) - { - continue; - } - blog("vendor.greeter.getSavedGreetings: allSaves[i].length(): "+allSaves[i].length()); - String[] data = split(allSaves[i], '-'); - if (data == null) - { - break; - } - - if (data[0] == null || data[1] == null) - { - continue; - } - blog("vendor.greeter.getSavedGreetings: Split [0] found: "+data[0]); - blog("vendor.greeter.getSavedGreetings: Split [1] found: "+data[1]); - - allNamesVector.add(data[0]); - allDataVector.add(data[1]); - combinedDataVector.add(allSaves[i]); - } - - blog("vendor.greeter.getSavedGreetings: Name List Length: "+allNamesVector.size()); - blog("vendor.greeter.getSavedGreetings: Data List Length: "+allDataVector.size()); - if (allNamesVector.size() <= 0 || allDataVector.size() <= 0 || combinedDataVector.size() <= 0) - { - return false; - } - if (allNamesVector.size() != allDataVector.size() || allNamesVector.size() != combinedDataVector.size()) - { - return false; - } - - String[] allNamesArray = new String[allNamesVector.size()]; - allNamesVector.toArray(allNamesArray); - String[] allDataArray = new String[allDataVector.size()]; - allDataVector.toArray(allDataArray); - - if (allSaves.length != combinedDataVector.size()) - { - - String[] newAllSaves = new String[combinedDataVector.size()]; - combinedDataVector.toArray(newAllSaves); - setObjVar(controller, GREETER_SAVE_DATA, newAllSaves); - } - - blog("vendor.greeter.getSavedGreetings: Saved Data Conversion to arrays completed"); - - utils.setScriptVar(player, GREETER_SAVED_GREET_NAMES, allNamesArray); - utils.setScriptVar(player, GREETER_SAVED_GREET_DATA, allDataArray); - return true; - } - - - public boolean saveGreeting(obj_id self, obj_id player, obj_id controller, String saveName) throws InterruptedException - { - blog("vendor.greeter.saveGreeting: init."); - - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - if (saveName == null || saveName.equals("")) - { - return false; - } - - blog("vendor.greeter.saveGreeting: inital validation completed."); - - String[] allSaves = getStringArrayObjVar(controller, GREETER_SAVE_DATA); - if (allSaves == null) - { - blog("vendor.greeter.saveGreeting: GREETER_SAVE_DATA had to be created."); - allSaves = new String[1]; - } - else if (allSaves.length < GREETER_SAVE_MAX) - { - blog("vendor.greeter.saveGreeting: allSaves.length: "+allSaves.length); - int currentSaveArrayLenth = allSaves.length; - - String[] tempList = new String[currentSaveArrayLenth + 1]; - for (int i = 0; i < currentSaveArrayLenth; i++) - { - testAbortScript(); - if (allSaves[i].startsWith(saveName + "-")) - { - sendSystemMessage(player, SID_NAME_ALREADY_EXISTS); - return false; - } - blog("vendor.greeter.saveGreeting: Loop: "+i); - - if (allSaves[i] == null) - { - blog("vendor.greeter.saveGreeting: &&&&&&&&&&&&EXISTING SAVE DATA HAD NULL ENTRY."); - } - blog("vendor.greeter.saveGreeting: allSaves[i]: "+allSaves[i]); - blog("vendor.greeter.saveGreeting: allSaves[i].length(): "+allSaves[i].length()); - - tempList[i] = allSaves[i]; - } - allSaves = tempList; - - } - else - { - sendSystemMessage(player, SID_GREETER_SAVE_MAX); - return false; - } - - blog("vendor.greeter.saveGreeting: validation complete. Player: "+player); - - String sayChatSlot = ""; - String animSlot = ""; - String voiceSlot = ""; - String moodSlot = ""; - String soundSlot = ""; - String soundString = ""; - String effectSlot = ""; - - String saveString = saveName + "-"; - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_ANIMS_OBJVAR) == vendor_lib.VAR_TRUE && hasObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR)) - { - animSlot = getStringObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION); - if (animSlot == null || animSlot.equals("")) - { - return false; - } - saveString += SAVE_ANIM + animSlot + COMMA; - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_VO_OBJVAR) == vendor_lib.VAR_TRUE && hasObjVar(controller, vendor_lib.GREETER_VOICING_OBJVAR)) - { - voiceSlot = getStringObjVar(controller, vendor_lib.GREETER_VOICES_OBJVAR); - if (voiceSlot == null || voiceSlot.equals("")) - { - return false; - } - - soundString = getStringObjVar(controller, vendor_lib.GREETER_SOUNDS_VO_MENU_OBJVAR); - if (soundString == null || soundString.equals("")) - { - return false; - } - - saveString += SAVE_VOICE + voiceSlot + PIPE + soundString + COMMA; - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_SOUND_OBJVAR) == vendor_lib.VAR_TRUE && hasObjVar(controller, vendor_lib.GREETER_SOUNDING_OBJVAR)) - { - soundSlot = getStringObjVar(controller, vendor_lib.GREETER_SOUNDS_OBJVAR); - if (soundSlot == null || soundSlot.equals("")) - { - return false; - } - - soundString = getStringObjVar(controller, vendor_lib.GREETER_SOUNDS_VO_MENU_OBJVAR); - if (soundString == null || soundString.equals("")) - { - return false; - } - saveString += SAVE_SOUND + soundSlot + PIPE + soundString + COMMA; - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_MOODS_OBJVAR) == vendor_lib.VAR_TRUE && hasObjVar(controller, vendor_lib.GREETER_HAS_MOOD_OBJVAR)) - { - moodSlot = getStringObjVar(controller, vendor_lib.GREETER_ACTUAL_MOOD); - if (moodSlot == null || moodSlot.equals("")) - { - return false; - } - saveString += SAVE_MOOD + moodSlot + COMMA; - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_CHAT_OBJVAR) == vendor_lib.VAR_TRUE && hasObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR)) - { - sayChatSlot = getStringObjVar(controller, vendor_lib.GREETER_ACTUAL_STATEMENT); - if (sayChatSlot == null || sayChatSlot.equals("")) - { - return false; - } - saveString += SAVE_SAY_CHAT + sayChatSlot + COMMA; - } - - if (saveString == null || saveString.equals("")) - { - return false; - } - - allSaves[allSaves.length - 1] = saveString; - - setObjVar(controller, GREETER_SAVE_DATA, allSaves); - return true; - } - - - public boolean getMainProgramUIListOptions(obj_id self, obj_id player, obj_id controller) throws InterruptedException - { - - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - - Vector dynMenuStrings = new Vector(); - Vector dynMenuData = new Vector(); - - dynMenuStrings.add(MENU_CHANGE_NAME); - dynMenuData.add(GREETER_CHANGE_NAME); - - if (hasObjVar(controller, vendor_lib.GREETER_CURRENTLY_RANDOMIZED_GREET)) - { - dynMenuStrings.add(MENU_RANDOMIZED_GREETINGS_OFF); - dynMenuData.add(GREETER_RANDOMIZED_GREETINGS_OFF); - } - else - { - dynMenuStrings.add(MENU_RANDOMIZED_GREETINGS_ON); - dynMenuData.add(GREETER_RANDOMIZED_GREETINGS_ON); - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_ANIMS_OBJVAR) == vendor_lib.VAR_TRUE) - { - - if (hasObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR)) - { - dynMenuStrings.add(MENU_GREETER_ANIMATING_ON); - dynMenuData.add(GREETER_ANIMATING_ENABLED); - - dynMenuStrings.add(MENU_GREETER_ANIMATING_EDIT + " "+ getStringObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION_STRING)); - dynMenuData.add(GREETER_ANIMATING_EDIT); - } - else - { - dynMenuStrings.add(MENU_GREETER_ANIMATING_OFF); - dynMenuData.add(GREETER_ANIMATING_DISABLED); - } - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_VO_OBJVAR) == vendor_lib.VAR_TRUE) - { - - if (hasObjVar(controller, vendor_lib.GREETER_VOICING_OBJVAR)) - { - dynMenuStrings.add(MENU_GREETER_VOICE_ON); - dynMenuData.add(GREETER_VOICING_ENABLED); - - dynMenuStrings.add(MENU_GREETER_VOICE_EDIT + " "+ getStringObjVar(controller, vendor_lib.GREETER_SOUNDS_VO_MENU_OBJVAR)); - dynMenuData.add(GREETER_VOICING_EDIT); - } - else - { - dynMenuStrings.add(MENU_GREETER_VOICE_OFF); - dynMenuData.add(GREETER_VOICING_DISABLED); - } - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_SOUND_OBJVAR) == vendor_lib.VAR_TRUE) - { - - if (hasObjVar(controller, vendor_lib.GREETER_SOUNDING_OBJVAR)) - { - dynMenuStrings.add(MENU_GREETER_SOUND_ON); - dynMenuData.add(GREETER_SOUNDS_ENABLED); - - dynMenuStrings.add(MENU_GREETER_SOUND_EDIT + " "+ getStringObjVar(controller, vendor_lib.GREETER_SOUNDS_VO_MENU_OBJVAR)); - dynMenuData.add(GREETER_SOUNDS_EDIT); - } - else - { - dynMenuStrings.add(MENU_GREETER_SOUND_OFF); - dynMenuData.add(GREETER_SOUNDS_DISABLED); - } - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_MOODS_OBJVAR) == vendor_lib.VAR_TRUE) - { - - if (hasObjVar(controller, vendor_lib.GREETER_HAS_MOOD_OBJVAR)) - { - dynMenuStrings.add(MENU_GREETER_MOOD_ON); - dynMenuData.add(GREETER_MOOD_ENABLED); - - dynMenuStrings.add(MENU_GREETER_MOOD_EDIT + " "+ getStringObjVar(controller, vendor_lib.GREETER_ACTUAL_MOOD_STRING)); - dynMenuData.add(GREETER_MOOD_EDIT); - } - else - { - dynMenuStrings.add(MENU_GREETER_MOOD_OFF); - dynMenuData.add(GREETER_MOOD_DISABLED); - } - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_CHAT_OBJVAR) == vendor_lib.VAR_TRUE) - { - - if (hasObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR)) - { - dynMenuStrings.add(MENU_GREETER_STATEMENT_ON); - dynMenuData.add(GREETER_STATEMENT_ENABLED); - - dynMenuStrings.add(MENU_GREETER_STATEMENT_EDIT + " "+ getStringObjVar(controller, vendor_lib.GREETER_ACTUAL_STATEMENT)); - dynMenuData.add(GREETER_STATEMENT_EDIT); - } - else - { - dynMenuStrings.add(MENU_GREETER_STATEMENT_OFF); - dynMenuData.add(GREETER_STATEMENT_DISABLED); - } - } - - if (hasObjVar(controller, vendor_lib.GREETER_COLOR_OBJVAR) && getBooleanObjVar(controller, vendor_lib.GREETER_COLOR_OBJVAR) == true) - { - - dynMenuStrings.add(MENU_COLOR); - dynMenuData.add(GREETER_COLOR_CHANGE); - } - - dynMenuStrings.add(MENU_GREETER_RANDOM_ALL); - dynMenuData.add(GREETER_RANDOM); - - if ((hasObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR) || hasObjVar(controller, vendor_lib.GREETER_VOICING_OBJVAR) || hasObjVar(controller, vendor_lib.GREETER_SOUNDING_OBJVAR) || hasObjVar(controller, vendor_lib.GREETER_HAS_MOOD_OBJVAR) || hasObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR))) - { - dynMenuStrings.add(MENU_GREETER_PREVIEW_ALL); - dynMenuData.add(GREETER_PREVIEW); - } - - dynMenuStrings.add(MENU_GREETER_MODIFY_DELAY); - dynMenuData.add(GREETER_MODIFY_DELAY); - dynMenuStrings.add(MENU_GREETER_MODIFY_TRIGGER_VOL_RADIUS); - dynMenuData.add(GREETER_MODIFY_TRIGGER_VOL_RADIUS); - - if (hasObjVar(controller, FOUND_OTHER_GREETERS)) - { - blog("terminal.greeter.getMainProgramUIListOptions: FOUND_OTHER_GREETERS"); - if (getBooleanObjVar(controller, FOUND_OTHER_GREETERS) == true && getBooleanObjVar(controller, vendor_lib.GREETER_CONVERSE) == true) - { - blog("terminal.greeter.getMainProgramUIListOptions: FOUND_OTHER_GREETERS && GREETER_CONVERSE"); - dynMenuStrings.add(MENU_GREETER_STOP_CONVERSE_OTHER_GREETER); - dynMenuData.add(GREETER_STOP_ITERACTION); - } - else - { - blog("terminal.greeter.getMainProgramUIListOptions: FOUND_OTHER_GREETERS BUT NOT GREETER_CONVERSE"); - - dynMenuStrings.add(MENU_GREETER_CONVERSE_OTHER_GREETER); - dynMenuData.add(GREETER_START_ITERACTION); - } - } - - if ((hasObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR) || hasObjVar(controller, vendor_lib.GREETER_VOICING_OBJVAR) || hasObjVar(controller, vendor_lib.GREETER_SOUNDING_OBJVAR) || hasObjVar(controller, vendor_lib.GREETER_HAS_MOOD_OBJVAR) || hasObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR))) - { - dynMenuStrings.add(MENU_GREETER_SAVE_GREET); - dynMenuData.add(GREETER_SAVE_GREET); - } - - if (hasObjVar(controller, GREETER_SAVE_DATA)) - { - String[] allData = getStringArrayObjVar(controller, GREETER_SAVE_DATA); - if (allData.length > 0) - { - dynMenuStrings.add(MENU_GREETER_LIST_GREET); - dynMenuData.add(GREETER_LIST_GREET); - } - } - - String[] availableOptionStrings = new String[dynMenuStrings.size()]; - - dynMenuStrings.toArray(availableOptionStrings); - - String[] availableDataOptions = new String[dynMenuData.size()]; - - dynMenuData.toArray(availableDataOptions); - - utils.setScriptVar(player, GREETER_MAIN_MENU_STRINGS, availableOptionStrings); - utils.setScriptVar(player, GREETER_MAIN_MENU_DATA, availableDataOptions); - - return true; - } - - - public boolean buildMainControlMenu(obj_id self, obj_id player) throws InterruptedException - { - - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - - if (sui.hasPid(player, GREETER_PROGRAM_MAIN_PID)) - { - int pid = sui.getPid(player, GREETER_PROGRAM_MAIN_PID); - forceCloseSUIPage(pid); - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - - if (!getMainProgramUIListOptions(self, player, controller)) - { - blog("terminal.greeter.OnObjectMenuSelect: List failed"); - return false; - } - - String[] menuStrings = utils.getStringArrayScriptVar(player, GREETER_MAIN_MENU_STRINGS); - if (menuStrings == null) - { - - return false; - } - - int pid = sui.listbox(self, player, SUI_GREETER_INSTRUCTIONS_DESCR, sui.OK_CANCEL, SUI_GREETER_INSTRUCTIONS_TITLE, menuStrings, "handlePlayerProgramSelect", true); - sui.setPid(player, pid, GREETER_PROGRAM_MAIN_PID); - return true; - } - - - public boolean loadSavedData(obj_id self, obj_id player, obj_id controller, String selection) throws InterruptedException - { - blog("terminal.greeter.loadSavedData: init"); - - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - if (selection == null || selection.equals("")) - { - return false; - } - - blog("terminal.greeter.loadSavedData: initial validation completed"); - - String[] fileName = split(selection, '-'); - if (fileName == null || fileName.length <= 0) - { - return false; - } - - blog("terminal.greeter.loadSavedData: fileNme: "+fileName[0]); - blog("terminal.greeter.loadSavedData: data: "+fileName[1]); - - String[] data = split(fileName[1], ','); - if (data == null || data.length <= 0) - { - return false; - } - - blog("terminal.greeter.loadSavedData: selection: "+selection); - blog("terminal.greeter.loadSavedData: data.length: "+data.length); - blog("terminal.greeter.loadSavedData: data[0]: "+data[0]); - blog("terminal.greeter.loadSavedData: data[1]: "+data[1]); - - String sayChatSlot = ""; - String animSlot = ""; - String voiceSlot = ""; - String moodSlot = ""; - String soundSlot = ""; - - removeObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR); - removeObjVar(controller, vendor_lib.GREETER_VOICES_OBJVAR); - removeObjVar(controller, vendor_lib.GREETER_HAS_MOOD_OBJVAR); - removeObjVar(controller, vendor_lib.GREETER_SOUNDS_OBJVAR); - removeObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR); - removeObjVar(controller, vendor_lib.GREETER_CURRENTLY_RANDOMIZED_GREET); - - for (int i = 0; i < data.length; i++) - { - testAbortScript(); - if (data[i] == null || data[i].length() == 0) - { - continue; - } - - if (data[i].startsWith(SAVE_SAY_CHAT)) - { - blog("terminal.greeter.loadSavedData: SAVE_SAY_CHAT"); - - String[] sayChatData = split(data[i], '='); - if (sayChatData == null || sayChatData.length <= 0) - { - continue; - } - - blog("terminal.greeter.loadSavedData: sayChatData: "+sayChatData[1]); - - setObjVar(controller, vendor_lib.GREETER_ACTUAL_STATEMENT, sayChatData[1]); - setObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR, true); - continue; - } - - if (data[i].startsWith(SAVE_VOICE)) - { - blog("terminal.greeter.loadSavedData: SAVE_VOICE"); - - String[] voiceData = split(data[i], '='); - if (voiceData == null || voiceData.length <= 0) - { - continue; - } - - blog("terminal.greeter.loadSavedData: voiceData: "+voiceData[1]); - - String[] voiceAndStringData = split(voiceData[1], '|'); - if (voiceAndStringData == null || voiceAndStringData.length <= 0) - { - continue; - } - - setObjVar(controller, vendor_lib.GREETER_VOICES_OBJVAR, voiceAndStringData[0]); - setObjVar(controller, vendor_lib.GREETER_SOUNDS_VO_MENU_OBJVAR, voiceAndStringData[1]); - setObjVar(controller, vendor_lib.GREETER_VOICING_OBJVAR, true); - continue; - } - if (data[i].startsWith(SAVE_MOOD)) - { - blog("terminal.greeter.loadSavedData: SAVE_MOOD"); - - String[] moodData = split(data[i], '='); - if (moodData == null || moodData.length <= 0) - { - continue; - } - - blog("terminal.greeter.loadSavedData: moodData: "+moodData[1]); - - setObjVar(controller, vendor_lib.GREETER_ACTUAL_MOOD, moodData[1]); - setObjVar(controller, vendor_lib.GREETER_ACTUAL_MOOD_STRING, "@player_structure:"+moodData[1]); - setObjVar(controller, vendor_lib.GREETER_HAS_MOOD_OBJVAR, true); - continue; - } - if (data[i].startsWith(SAVE_SOUND)) - { - blog("terminal.greeter.loadSavedData: SAVE_SOUND"); - - String[] soundData = split(data[i], '='); - if (soundData == null || soundData.length <= 0) - { - continue; - } - - blog("terminal.greeter.loadSavedData: soundData: "+soundData[1]); - - String[] soundAndStringData = split(soundData[1], '|'); - if (soundAndStringData == null || soundAndStringData.length <= 0) - { - continue; - } - - blog("terminal.greeter.loadSavedData: soundData: "+soundAndStringData[0]); - - setObjVar(controller, vendor_lib.GREETER_SOUNDS_OBJVAR, soundAndStringData[0]); - setObjVar(controller, vendor_lib.GREETER_SOUNDS_VO_MENU_OBJVAR, soundAndStringData[1]); - setObjVar(controller, vendor_lib.GREETER_SOUNDING_OBJVAR, true); - continue; - } - if (data[i].startsWith(SAVE_ANIM)) - { - blog("terminal.greeter.loadSavedData: SAVE_ANIM"); - - String[] animData = split(data[i], '='); - if (animData == null || animData.length <= 0) - { - continue; - } - - blog("terminal.greeter.loadSavedData: animData: "+animData[1]); - - setObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION, animData[1]); - setObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION_STRING, "@player_structure:"+animData[1]); - setObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR, true); - continue; - } - } - - return true; - } - - - public boolean getRandomGreeting(obj_id self, obj_id controller) throws InterruptedException - { - blog("terminal.greeter.getRandomGreeting: init"); - - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - - blog("terminal.greeter.getRandomGreeting: initial validation completed"); - - if (!hasObjVar(controller, vendor_lib.GREETER_CURRENTLY_RANDOMIZED_GREET) || getBooleanObjVar(controller, vendor_lib.GREETER_CURRENTLY_RANDOMIZED_GREET) == false) - { - if (!hasObjVar(controller, vendor_lib.GREETER_RANDOM_TEST_FIRE) || getBooleanObjVar(controller, vendor_lib.GREETER_RANDOM_TEST_FIRE) == false) - { - blog("terminal.greeter.getRandomGreeting: I AM NOT LABELED AS A RANDOMIZED GREETER"); - return false; - } - } - - blog("terminal.greeter.getRandomGreeting: I AM STILL LABELED AS A RANDOMIZED GREETER"); - - String creatureType = getStringObjVar(controller, vendor_lib.CREATURE_TYPE); - if (creatureType == null || creatureType.equals("")) - { - return false; - } - - blog("terminal.greeter.getRandomGreeting: creatureType: "+creatureType); - String greeterType = "greeter_"+creatureType; - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_ANIMS_OBJVAR) == vendor_lib.VAR_TRUE) - { - blog("terminal.greeter.getRandomGreeting: GREETER_ANIMATES_OBJVAR"); - - if (greeterType.equals("greeter_ewok") || greeterType.equals("greeter_jawa")) - { - blog("terminal.greeter.getRandomGreeting: Is an ewok or jawa"); - - String[] jawaOrEwokEmoteList = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_ANIMS, "emote_"+greeterType); - if (jawaOrEwokEmoteList == null) - { - return false; - } - - int listLength = jawaOrEwokEmoteList.length; - if (listLength <= 0) - { - return false; - } - - int randomAnimInt = rand(0, listLength - 1); - - setObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION, jawaOrEwokEmoteList[randomAnimInt]); - setObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION_STRING, "@player_structure:"+jawaOrEwokEmoteList[randomAnimInt]); - blog("terminal.greeter.getRandomGreeting: randAnim: "+jawaOrEwokEmoteList[randomAnimInt]); - setObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR, true); - } - else - { - blog("terminal.greeter.getRandomGreeting: not an ewok or jawa"); - - String[] greeterAnimCategories = vendor_lib.getAllGreeterDatatableColumnNames(self, vendor_lib.TBL_GREETER_ANIMS); - if (greeterAnimCategories == null) - { - return false; - } - - int greeterAnimCategoriesLen = greeterAnimCategories.length; - if (greeterAnimCategoriesLen <= 0) - { - return false; - } - - int randomCategory = rand(0, greeterAnimCategoriesLen - 1); - String animCategory = greeterAnimCategories[randomCategory]; - - String[] categoryAnims = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_ANIMS, animCategory); - if (categoryAnims == null) - { - return false; - } - - int categoryAnimslength = categoryAnims.length; - if (categoryAnimslength <= 0) - { - return false; - } - - int randomAnimInt = rand(0, categoryAnimslength - 1); - setObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION, categoryAnims[randomAnimInt]); - setObjVar(controller, vendor_lib.GREETER_ACTUAL_ANIMATION_STRING, "@player_structure:"+categoryAnims[randomAnimInt]); - - blog("terminal.greeter.getRandomGreeting: randAnim: "+categoryAnims[randomAnimInt]); - setObjVar(controller, vendor_lib.GREETER_ANIMATING_OBJVAR, true); - } - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_VO_OBJVAR) == vendor_lib.VAR_TRUE || utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_SOUND_OBJVAR) == vendor_lib.VAR_TRUE) - { - blog("greeter.getRandomGreeting: GREETER_HAS_SOUND_OBJVAR or GREETER_HAS_VO_OBJVAR"); - String greeterSoundVoColName = ""; - String greeterSoundVoColNameString = ""; - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_SOUND_OBJVAR) == vendor_lib.VAR_TRUE) - { - blog("greeter.getRandomGreeting: GREETER_HAS_SOUND_OBJVAR"); - greeterSoundVoColName = greeterType+"_"+SOUND_OPTION; - greeterSoundVoColNameString = greeterType+"_"+SOUND_STRING; - } - else - { - blog("greeter.getRandomGreeting: GREETER_HAS_VO_OBJVAR"); - greeterSoundVoColName = greeterType+"_"+VOICE_OPTION; - greeterSoundVoColNameString = greeterType+"_"+VOICE_STRING; - } - - if (hasObjVar(self, "greeter.sound_vo")) - { - String soundVo = getStringObjVar(self, "greeter.sound_vo"); - String soundVoString = getStringObjVar(self, "greeter.sound_vo_string"); - if (soundVo != null && !soundVo.equals("") && soundVoString != null && !soundVoString.equals("")) - { - - greeterSoundVoColName = soundVo; - greeterSoundVoColNameString = soundVoString; - } - } - - blog("greeter.getRandomGreeting: greeterSoundVoColName: "+greeterSoundVoColName); - - String[] effectList = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_SOUND_VOICE_EFFECT, greeterSoundVoColName); - if (effectList == null || effectList.length <= 0) - { - return false; - } - - int effectListLen = effectList.length; - - String[] stringList = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_SOUND_VOICE_EFFECT, greeterSoundVoColNameString); - if (stringList == null || stringList.length <= 0 || stringList.length != effectListLen) - { - return false; - } - - int randNumber = rand(0, effectListLen - 1); - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_SOUND_OBJVAR) == vendor_lib.VAR_TRUE) - { - blog("greeter.getRandomGreeting: got a sound:"+ effectList[randNumber]); - - setObjVar(controller, vendor_lib.GREETER_SOUNDS_OBJVAR, effectList[randNumber]); - blog("terminal.greeter.getRandomGreeting: randSound: "+effectList[randNumber]); - setObjVar(controller, vendor_lib.GREETER_SOUNDS_VO_MENU_OBJVAR, "@player_vendor:"+stringList[randNumber]); - setObjVar(controller, vendor_lib.GREETER_SOUNDING_OBJVAR, true); - } - else - { - blog("greeter.getRandomGreeting: got a VO: "+effectList[randNumber]); - - setObjVar(controller, vendor_lib.GREETER_VOICES_OBJVAR, effectList[randNumber]); - blog("terminal.greeter.getRandomGreeting: randVO: "+effectList[randNumber]); - setObjVar(controller, vendor_lib.GREETER_SOUNDS_VO_MENU_OBJVAR, "@player_vendor:"+stringList[randNumber]); - setObjVar(controller, vendor_lib.GREETER_VOICING_OBJVAR, true); - } - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_MOODS_OBJVAR) == vendor_lib.VAR_TRUE) - { - blog("terminal.greeter.getRandomGreeting: GREETER_MOODS_OBJVAR"); - - String[] greeterMoodCategories = vendor_lib.getAllGreeterDatatableColumnNames(self, vendor_lib.TBL_GREETER_MOODS); - if (greeterMoodCategories == null) - { - return false; - } - - int greeterMoodCategoriesLen = greeterMoodCategories.length; - if (greeterMoodCategoriesLen <= 0) - { - return false; - } - - int randNumber = rand(0, greeterMoodCategoriesLen - 1); - String randMoodCat = greeterMoodCategories[randNumber]; - - String[] categoryMoods = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_MOODS, randMoodCat); - if (categoryMoods == null) - { - return false; - } - - int moodListLength = categoryMoods.length; - if (moodListLength <= 0) - { - return false; - } - - int randMoodInt = rand(0, moodListLength-1); - setObjVar(controller, vendor_lib.GREETER_ACTUAL_MOOD, categoryMoods[randMoodInt]); - setObjVar(controller, vendor_lib.GREETER_ACTUAL_MOOD_STRING, "@player_structure:"+categoryMoods[randMoodInt]); - - blog("terminal.greeter.getRandomGreeting: randMood: "+categoryMoods[randMoodInt]); - setObjVar(controller, vendor_lib.GREETER_HAS_MOOD_OBJVAR, true); - } - - if (utils.getIntObjVar(controller, vendor_lib.GREETER_HAS_CHAT_OBJVAR) == vendor_lib.VAR_TRUE) - { - blog("terminal.greeter.getRandomGreeting: GREETER_STATEMENT_OBJVAR"); - - String[] statementList = dataTableGetStringColumnNoDefaults(vendor_lib.TBL_GREETER_SAY_CHAT, greeterType); - if (statementList == null) - { - return false; - } - - int statementListLen = statementList.length; - if (statementListLen < 0) - { - return false; - } - - int randNumber = rand(0, statementListLen-1); - setObjVar(controller, vendor_lib.GREETER_ACTUAL_STATEMENT, localize(new string_id("player_structure", statementList[randNumber]))); - blog("terminal.greeter.getRandomGreeting: randMood: "+statementList[randNumber]); - setObjVar(controller, vendor_lib.GREETER_HAS_STATEMENT_OBJVAR, true); - } - blog("terminal.greeter.getRandomGreeting: RETURNING TRUE"); - - return true; - - } - - - public boolean conversableGreeterInRange(obj_id self) throws InterruptedException - { - blog("terminal.greeter.conversableGreeterInRange: init"); - - if (!isValidId(self) || !exists(self)) - { - return false; - } - - obj_id controller = getObjIdObjVar(self, vendor_lib.CNTRLR_GREETER_NONVENDOR_ID_OBJVAR); - if (!isValidId(controller) || !exists(controller)) - { - return false; - } - - blog("terminal.greeter.conversableGreeterInRange: controller received"); - - if (hasObjVar(controller, FOUND_OTHER_GREETER_TIMER)) - { - blog("terminal.greeter.conversableGreeterInRange: controller has FOUND_OTHER_GREETER_TIMER"); - int gameTime = getGameTime(); - int gameTimeSaved = getIntObjVar(self, FOUND_OTHER_GREETER_TIMER); - int diff = gameTime - gameTimeSaved; - if (diff < 0) - { - removeObjVar(controller, FOUND_OTHER_GREETER_TIMER); - } - if (diff < GREETER_TIMER_DELAY) - { - return false; - } - - blog("terminal.greeter.conversableGreeterInRange: controller removing FOUND_OTHER_GREETER_TIMER"); - removeObjVar(controller, FOUND_OTHER_GREETER_TIMER); - } - - location loc = getLocation(self); - obj_id[] allGreeters = getAllObjectsWithScript(loc, MAX_GREETER_CONV_RANGE_FLOAT, "terminal.greeter"); - if (allGreeters == null || allGreeters.length <= 0) - { - return false; - } - - if (allGreeters.length == 1 && allGreeters[0] == self) - { - return false; - } - - setObjVar(controller, FOUND_OTHER_GREETERS, true); - setObjVar(controller, FOUND_OTHER_GREETER_TIMER, getGameTime()); - - return true; - } - - - public obj_id getConversableGreeter(obj_id self, obj_id player, obj_id controller) throws InterruptedException - { - blog("terminal.greeter.getConversableGreeter: Init"); - - if (!isValidId(self) || !exists(self)) - { - return null; - } - if (!isValidId(player)) - { - return null; - } - if (!isValidId(controller) || !exists(controller)) - { - return null; - } - - blog("terminal.greeter.getConversableGreeter: validation completed"); - - if (!hasObjVar(controller, FOUND_OTHER_GREETERS)) - { - return null; - } - - blog("terminal.greeter.getConversableGreeter: has correct variable"); - - location loc = getLocation(self); - if (loc == null) - { - return null; - } - - blog("terminal.greeter.getConversableGreeter: locaiton of self attained."); - - obj_id[] allGreeters = getAllObjectsWithScript(loc, MAX_GREETER_CONV_RANGE_FLOAT, "terminal.greeter"); - if (allGreeters == null || allGreeters.length <= 0 || (allGreeters.length == 1 && allGreeters[0] == self)) - { - blog("terminal.greeter.getConversableGreeter: No other greeters found. Removing variable from controller."); - removeObjVar(controller, FOUND_OTHER_GREETERS); - return null; - } - blog("terminal.greeter.getConversableGreeter: At least one other greeters found! #: "+allGreeters.length); - - Vector greeterList = new Vector(); - for (int i = 0; i < allGreeters.length; i++) - { - testAbortScript(); - if (allGreeters[i] != self && isValidId(allGreeters[i]) && exists(allGreeters[i])) - { - greeterList.add(allGreeters[i]); - } - } - if (greeterList.size() < 0) - { - return null; - } - - obj_id[] newGreeterList = new obj_id[greeterList.size()]; - greeterList.toArray(newGreeterList); - - if (newGreeterList.length == 1) - { - return newGreeterList[0]; - } - - blog("terminal.greeter.getConversableGreeter: New list of greeters is more than 1 in size"); - return newGreeterList[rand(0,newGreeterList.length-1)]; - - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/nonvendor.java b/sku.0/sys.server/compiled/game/script/terminal/nonvendor.java deleted file mode 100644 index e50cad76a..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/nonvendor.java +++ /dev/null @@ -1,256 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.player_structure; -import script.library.vendor_lib; -import script.library.static_item; - - - -public class nonvendor extends script.terminal.base.base_terminal -{ - public nonvendor() - { - } - public static final boolean LOGGING_ON = true; - public static final String LOGGING_CATEGORY = "nonvendor"; - - public static final string_id SID_FACE_ME = new string_id("player_vendor", "face_me"); - public static final string_id SID_RECOVER = new string_id("player_vendor", "recover_nonvendor"); - public static final string_id SID_MAKE_ROOM = new string_id("player_vendor", "recover_nonvendor_make_room"); - public static final string_id SID_NO_USE_WHILE_DEAD = new string_id("player_structure", "while_dead"); - - - public int OnDestroy(obj_id self) throws InterruptedException - { - if (!isValidId(self)) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, "messageCompleted")) - { - return SCRIPT_CONTINUE; - } - - int currentTime = getGameTime(); - dictionary msgparams = new dictionary(); - msgparams.put("time", currentTime); - utils.setScriptVar(self, "messageTime", currentTime); - utils.setScriptVar(self, "messageCompleted", true); - messageTo(self, "handleDestroyNonVendor", msgparams, 0, false); - CustomerServiceLog("tcg", "TCG NonVendor: "+self+" is about to be destroyed and given to the owner. The nonvendor is being destroyed (probably via structure terminal)."); - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (!isValidId(ownerId)) - { - return SCRIPT_CONTINUE; - } - - if (transferer != ownerId) - { - return SCRIPT_OVERRIDE; - } - - int currentTime = getGameTime(); - dictionary msgparams = new dictionary(); - msgparams.put("time", currentTime); - utils.setScriptVar(self, "messageTime", currentTime); - utils.setScriptVar(self, "messageCompleted", true); - messageTo(self, "handleDestroyNonVendor", msgparams, 0, false); - CustomerServiceLog("tcg", "TCG NonVendor: "+self+" is about to be destroyed and given to: "+ ownerId + ". The nonvendor is being transferred (probably picked up)."); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return super.OnObjectMenuRequest(self, player, mi); - } - if (isIncapacitated(player) || isDead(player)) - { - return super.OnObjectMenuRequest(self, player, mi); - } - - blog("terminal.nonvendor.OnObjectMenuRequest init"); - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (!isValidId(ownerId) || !exists(ownerId)) - { - return super.OnObjectMenuRequest(self, player, mi); - } - if (player != ownerId) - { - return super.OnObjectMenuRequest(self, player, mi); - } - - return super.OnObjectMenuRequest(self, player, mi); - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - if (isIncapacitated(player) || isDead(player)) - { - return SCRIPT_CONTINUE; - } - - blog("terminal.nonvendor.OnObjectMenuSelect init"); - - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (!isValidId(ownerId) || !exists(ownerId)) - { - return SCRIPT_CONTINUE; - } - else if (player != ownerId) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int handleDestroyNonVendor(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - int time = params.getInt("time"); - if (time <= 0) - { - return SCRIPT_CONTINUE; - } - - int messageTime = utils.getIntScriptVar(self, "messageTime"); - if (messageTime <= 0) - { - return SCRIPT_CONTINUE; - } - - if (time != messageTime) - { - return SCRIPT_CONTINUE; - } - - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (!isValidId(ownerId)) - { - utils.removeScriptVar(self, "messageTime"); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("tcg", "TCG NonVendor "+self+ " is about to be destroyed. The owner of this TCG item is: "+ownerId+"."); - - String staticItem = getStringObjVar(self, vendor_lib.STATIC_ITEM_DEED_NAME); - if (staticItem == null || staticItem.equals("")) - { - utils.removeScriptVar(self, "messageTime"); - return SCRIPT_CONTINUE; - } - - dictionary reimburseParams = new dictionary(); - reimburseParams.put("reimburseItem", staticItem); - - blog("terminal.nonvendor.handleDestroyNonVendor OWNER ID: "+ ownerId); - - if (!ownerId.isLoaded()) - { - blog("terminal.nonvendor.handleDestroyNonVendor OWNER OFFLINE"); - CustomerServiceLog("tcg", "TCG NonVendor "+self+" owner "+ownerId+ " is not online. The TCG NonVendor will be reimbursed at next login."); - messageTo(ownerId, "reimburseTcgItem", reimburseParams, 0, true); - } - else - { - blog("terminal.nonvendor.handleDestroyNonVendor OWNER LOADED"); - - obj_id pInv = utils.getInventoryContainer(ownerId); - if (!isValidId(pInv) || !exists(pInv)) - { - CustomerServiceLog("tcg", "TCG NonVendor: "+self+" could not be destroyed properly because owner: "+ ownerId + " had no player inventory container available. We have sent a message to reimburse the player at another time."); - messageTo(ownerId, "reimburseTcgItem", reimburseParams, 0, true); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - obj_id newItem = static_item.createNewItemFunction(staticItem, pInv); - if (!isValidId(newItem) || !exists(newItem)) - { - CustomerServiceLog("tcg", "TCG NonVendor: "+self+" could not be destroyed for owner: "+ ownerId + " because the deed could not be created properly. We have sent a message to reimburse the player at another time."); - messageTo(ownerId, "reimburseTcgItem", reimburseParams, 0, true); - destroyObject(self); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("tcg", "TCG NonVendor "+self+" will be destroyed because the owner: "+ ownerId + " has received a new deed for the nonvendor destruction. The object: "+newItem); - } - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int OnPack(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("tcg", "TCG NonVendor "+self+ " is being packed up."); - - location loc = getLocation(self); - if (loc != null && isValidId(loc.cell)) - { - CustomerServiceLog("tcg", "TCG NonVendor "+self+ " is being packed up. Current Location: "+loc); - - obj_id structure = player_structure.getStructure(self); - if (isValidId(structure)) - { - CustomerServiceLog("tcg", "TCG NonVendor "+self+" currently resides in "+structure); - obj_id structureOwner = getOwner(structure); - if (isValidId(structureOwner)) - { - CustomerServiceLog("tcg", "TCG NonVendor "+self+" currently resides in "+structure+ " that is owned by "+structureOwner); - obj_id ownerId = getObjIdObjVar(self, vendor_lib.GREETER_OWNER_OBJVAR); - if (isValidId(ownerId) && ownerId != structureOwner) - { - CustomerServiceLog("tcg", "TCG NonVendor "+self+" is being packed up in a house that the NonVendor owner "+ownerId+" doesn't own."); - } - } - } - } - int currentTime = getGameTime(); - dictionary msgparams = new dictionary(); - msgparams.put("time", currentTime); - utils.setScriptVar(self, "messageTime", currentTime); - utils.setScriptVar(self, "messageCompleted", true); - messageTo(self, "handleDestroyNonVendor", msgparams, 0, false); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/npc_vendor.java b/sku.0/sys.server/compiled/game/script/terminal/npc_vendor.java deleted file mode 100644 index 1388f8b52..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/npc_vendor.java +++ /dev/null @@ -1,636 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.player_structure; -import script.library.chat; -import script.library.sui; -import script.library.utils; -import script.library.prose; -import script.library.slots; -import script.library.ai_lib; -import script.library.dressup; -import script.library.smuggler; -import script.library.vendor_lib; - - -public class npc_vendor extends script.base_script -{ - public npc_vendor() - { - } - public static final String LOGGING_CATEGORY = "vendor"; - public static final boolean LOGGING_ON = true; - - public static final string_id SID_ITEM_DROP = new string_id("ui_radial", "item_drop"); - public static final string_id SID_DROP_NPC_VENDOR_BUILDING = new string_id("player_structure", "drop_npc_vendor_building"); - public static final string_id SID_DROP_NPC_VENDOR_PERM = new string_id("player_structure", "drop_npc_vendor_perm"); - public static final string_id SID_ITEM_DESTROY = new string_id("ui_radial", "item_destroy"); - public static final string_id SID_AREABARKS_ENABLED = new string_id("player_structure", "areabarks_enabled"); - public static final string_id SID_AREABARKS_DISABLED = new string_id("player_structure", "areabarks_disabled"); - public static final string_id SID_OBSCENE = new string_id("player_structure", "obscene"); - - public static final String TBL_VENDOR_SUBCATEGORIES = "datatables/vendor/vendor_map_subcategories.iff"; - public static final String TBL_VENDOR_ANIMS = "datatables/vendor/vendor_areabark_anims.iff"; - public static final String TBL_VENDOR_MOODS = "datatables/vendor/vendor_areabark_moods.iff"; - public static final String TBL_VENDOR_STRCATS = "datatables/vendor/vendor_areabark_strcats.iff"; - - public static final String ALERT_VOLUME_NAME = "vendorTriggerVolume"; - - public static final String WKE_CAN_WEAR_PADAWAN_ROBE = "object/tangible/wearables/robe/robe_jedi_padawan_generic.iff"; - public static final String STANDARD_VENDOR_SHIRT = "object/tangible/wearables/shirt/shirt_s11.iff"; - public static final String STANDARD_VENDOR_PANTS = "object/tangible/wearables/pants/pants_s14.iff"; - public static final String STANDARD_VENDOR_SHOES = "object/tangible/wearables/boots/boots_s14.iff"; - public static final String ITH_VENDOR_SHIRT = "object/tangible/wearables/ithorian/ith_shirt_s05.iff"; - public static final String ITH_VENDOR_PANTS = "object/tangible/wearables/ithorian/ith_pants_s03.iff"; - - public static final String NON_ENHANCEMENT_BUFF = "buff.non_enhancement"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - removeTriggerVolume( "alertTriggerVolume"); - setInvulnerable( self, true ); - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - if (hasObjVar( self, "vendor.areaBarks" )) - { - createTriggerVolume( ALERT_VOLUME_NAME, 10, true ); - } - - String templateName = getTemplateName( self ); - if (!hasObjVar( self, "dressed" ) && (templateName.indexOf( "ithorian" ) > 0)) - { - - dressup.dressNpc( self, "random_ithorian", true ); - setObjVar( self, "dressed", 1 ); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - obj_id ownerId = getObjIdObjVar( self, "vendor_owner"); - if (player == ownerId) - { - - obj_id inventory = getObjectInSlot( player, "inventory"); - if (contains( inventory, self )) - { - mi.addRootMenu( menu_info_types.ITEM_DESTROY, SID_ITEM_DESTROY ); - return SCRIPT_CONTINUE; - } - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - obj_id ownerId = getObjIdObjVar( self, "vendor_owner"); - if (player != ownerId) - { - return SCRIPT_CONTINUE; - } - int hiringSkillMod = getSkillStatisticModifier(player, "hiring"); - - if ((item == menu_info_types.SERVER_MENU4) && utils.isProfession(player, utils.TRADER)) - { - - if (hasObjVar( self, "vendor.areaBarks" )) - { - - removeObjVar( self, "vendor.areaBarks"); - removeTriggerVolume( ALERT_VOLUME_NAME ); - - sendSystemMessage( player, SID_AREABARKS_DISABLED ); - } - else - { - - String[] rawAnims = dataTableGetStringColumnNoDefaults( TBL_VENDOR_ANIMS, 0 ); - String[] anims = new String[rawAnims.length]; - for (int i=0; i= 90) - { - - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_CHEERFUL, null, new string_id( "player_structure", "wear_how"), null ); - doAnimationAction( self, "slow_down"); - - return SCRIPT_OVERRIDE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeTransferred(obj_id self, obj_id destContainer, obj_id transferer) throws InterruptedException - { - if (hasObjVar( self, "vendor.areaBarks" )) - { - removeObjVar( self, "vendor.areaBarks"); - removeTriggerVolume( ALERT_VOLUME_NAME ); - } - - return SCRIPT_CONTINUE; - } - - - public int OnGiveItem(obj_id self, obj_id item, obj_id player) throws InterruptedException - { - blog("OnGiveItem init"); - - obj_id ownerId = getObjIdObjVar( self, "vendor_owner"); - if (player != ownerId) - { - return SCRIPT_CONTINUE; - } - - String templateName = getTemplateName( self ); - String itemName = getTemplateName( item ); - if (templateName == null || templateName.equals("")) - { - return SCRIPT_CONTINUE; - } - else if (itemName == null || itemName.equals("")) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(item, NON_ENHANCEMENT_BUFF)) - { - - doAnimationAction(self, "shake_head_no"); - return SCRIPT_CONTINUE; - } - - if (vendor_lib.isSpecialVendor(self) && getIntObjVar(self, "vendor.special_vendor_clothing") == 0) - { - - if (getIntObjVar(self, "vendor.special_vendor_basic") == 1) - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_STUBBORN, null, new string_id("player_structure", "wear_not_special_vendor"), null ); - doAnimationAction( self, "wave_finger_warning"); - return SCRIPT_CONTINUE; - } - - doAnimationAction(self, "shake_head_no"); - return SCRIPT_CONTINUE; - } - - if (templateName.indexOf( "ithorian" ) > -1) - { - blog("I am an Ithorian"); - if (itemName.indexOf( "ith_" ) > -1) - { - blog("I have received an Ithorian wearable!"); - - } - else if (itemName.equals(WKE_CAN_WEAR_PADAWAN_ROBE)) - { - - } - else if (!(itemName.indexOf("cybernetic_") > -1)) - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_STUBBORN, null, new string_id( "player_structure", "wear_not_ithorian"), null ); - doAnimationAction( self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - } - - if (templateName.indexOf( "wookiee" ) > -1) - { - if ((itemName.indexOf( "wke_" ) > -1) || (itemName.indexOf( "armor_kashyyykian_" ) > -1)) - { - - } - else if (itemName.equals(WKE_CAN_WEAR_PADAWAN_ROBE)) - { - - } - else if (!(itemName.indexOf("cybernetic_") > -1)) - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_STUBBORN, null, new string_id( "player_structure", "wear_not_wookiee"), null ); - doAnimationAction( self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - } - else if (templateName.indexOf( "ithorian" ) > -1) - { - blog("itemName: "+itemName); - if ((itemName.indexOf( "ith_" ) > -1)) - { - - } - else if (itemName.equals(WKE_CAN_WEAR_PADAWAN_ROBE)) - { - - } - else if (!(itemName.indexOf("cybernetic_") > -1)) - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_STUBBORN, null, new string_id( "player_structure", "wear_not_wookiee"), null ); - doAnimationAction( self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - } - else - { - if (itemName.indexOf( "wke_" ) > -1) - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_STUBBORN, null, new string_id( "player_structure", "wear_no_wookiee"), null ); - doAnimationAction( self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - else if (itemName.indexOf( "ith_" ) > -1) - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_STUBBORN, null, new string_id( "player_structure", "wear_no_ithorian"), null ); - doAnimationAction( self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - } - - if (templateName.indexOf( "ishi_tib" ) > -1 || templateName.indexOf( "aqualish" ) > -1 || templateName.indexOf( "devaronian" ) > -1) - { - if (itemName.startsWith("object/tangible/wearables/hat")) - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_STUBBORN, null, new string_id( "player_structure", "wear_not_ishitib"), null ); - doAnimationAction( self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - } - - if (utils.isContainer(item) && smuggler.hasItemsInContainer(item)) - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_STUBBORN, null, new string_id( "player_structure", "wear_no_bag_full"), null ); - doAnimationAction( self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - blog("OnGiveItem ABOUT TO FORCE CLOTHING"); - - messageTo(self, "checkNakedSlots", null, 1, false); - - int hiringSkillMod = getSkillStatisticModifier(player, "hiring"); - if (hiringSkillMod < 90) - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_OFFENDED, null, new string_id( "player_structure", "wear_noway"), null ); - doAnimationAction( self, "wave_on_dismissing"); - return SCRIPT_CONTINUE; - } - - if (equipOverride( item, self )) - { - - if (isGameObjectTypeOf( item, GOT_weapon )) - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_HAPPY, null, new string_id( "player_structure", "wear_yes_weapon"), null ); - } - else - { - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_HAPPY, null, new string_id( "player_structure", "wear_yes"), null ); - } - doAnimationAction( self, "pose_proudly"); - return SCRIPT_CONTINUE; - } - else - { - - chat._chat( self, null, chat.CHAT_SAY, chat.MOOD_CHEERFUL, null, new string_id( "player_structure", "wear_no"), null ); - doAnimationAction( self, "slow_down"); - return SCRIPT_CONTINUE; - } - } - - - public int handleVendorAnimSelect(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = sui.getPlayerId(params); - int idx = sui.getListboxSelectedRow( params ); - if (idx < 0) - { - idx = 0; - } - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - String[] rawAnims = dataTableGetStringColumnNoDefaults( TBL_VENDOR_ANIMS, 0 ); - setObjVar( self, "vendor.barkAnim", rawAnims[idx] ); - - String[] rawMoods = dataTableGetStringColumnNoDefaults( TBL_VENDOR_MOODS, 0 ); - String[] moods = new String[rawMoods.length]; - for (int i=0; i 140) - { - customBark = customBark.substring( 0, 139 ); - } - setObjVar( self, "vendor.customBark", customBark ); - - setObjVar( self, "vendor.areaBarks", 1 ); - createTriggerVolume( ALERT_VOLUME_NAME, 10, true ); - - sendSystemMessage( player, SID_AREABARKS_ENABLED ); - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - if (hasObjVar( breacher, "gm")) - { - return SCRIPT_OVERRIDE; - } - - if (breacher == self) - { - return SCRIPT_OVERRIDE; - } - - if (isIncapacitated(self)) - { - return SCRIPT_OVERRIDE; - } - - if (!isMob( breacher )) - { - return SCRIPT_OVERRIDE; - } - - if (ai_lib.isMonster( breacher )) - { - return SCRIPT_OVERRIDE; - } - - if (!hasObjVar( self, "vendor.areaBarks" )) - { - return SCRIPT_OVERRIDE; - } - - if (utils.hasScriptVar( self, "bark.alreadyBarked" )) - { - return SCRIPT_OVERRIDE; - } - - if (rand( 1, 3 ) == 1) - { - return SCRIPT_OVERRIDE; - } - - if (volumeName.equals(ALERT_VOLUME_NAME)) - { - - String anim = getStringObjVar( self, "vendor.barkAnim"); - String mood = getStringObjVar( self, "vendor.barkMood"); - String strcat = getStringObjVar( self, "vendor.barkStrCat"); - String custbark = getStringObjVar( self, "vendor.customBark"); - - faceTo( self, breacher ); - if (custbark != null) - { - chat._chat( self, breacher, chat.CHAT_SAY, mood, custbark, null, null ); - } - else - { - prose_package pp = prose.getPackage( new string_id( "player_structure", "areabark_"+strcat ), breacher ); - chat.publicChat( self, breacher, chat.CHAT_SAY, mood, pp ); - } - doAnimationAction( self, anim ); - - utils.setScriptVar( self, "bark.alreadyBarked", 1 ); - messageTo( self, "resetBarkTimer", null, 60, false ); - - return SCRIPT_OVERRIDE; - } - - return SCRIPT_OVERRIDE; - } - - - public int resetBarkTimer(obj_id self, dictionary params) throws InterruptedException - { - utils.removeScriptVar( self, "bark.alreadyBarked"); - return SCRIPT_CONTINUE; - } - - - public int checkNakedSlots(obj_id self, dictionary params) throws InterruptedException - { - String templateName = getTemplateName(self); - if (templateName == null || templateName.equals("")) - { - return SCRIPT_CONTINUE; - } - - if (templateName.indexOf("wookiee") > -1) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "vendor.special_vendor_clothing") && getIntObjVar(self, "vendor.special_vendor_clothing") == 0) - { - return SCRIPT_CONTINUE; - } - - boolean ithorian = false; - - if (templateName.indexOf("ithorian") > -1) - { - blog("I am an Ithorian"); - ithorian = true; - } - - blog("OnGiveItem FORCING CLOTHING"); - - obj_id currentChest = getObjectInSlot(self, slots.CHEST1); - obj_id currentPants = getObjectInSlot(self, slots.PANTS1); - obj_id currentShoes = getObjectInSlot(self, slots.SHOES); - - if (!isValidId(currentChest)) - { - blog("OnGiveItem NO CHEST"); - - if (ithorian) - { - createObject(ITH_VENDOR_SHIRT, self, slots.CHEST1); - } - else - { - createObject(STANDARD_VENDOR_SHIRT, self, slots.CHEST1); - } - - } - if (!isValidId(currentPants)) - { - blog("OnGiveItem NO PANTS"); - - if (ithorian) - { - createObject(ITH_VENDOR_PANTS, self, slots.PANTS1); - } - else - { - createObject(STANDARD_VENDOR_PANTS, self, slots.PANTS1); - } - - } - - if (!isValidId(currentShoes) && !ithorian) - { - blog("OnGiveItem NO SHOES"); - - createObject(STANDARD_VENDOR_SHOES, self, slots.SHOES); - } - - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON && msg != null && !msg.equals("")) - { - LOG(LOGGING_CATEGORY, msg); - } - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_camp.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_camp.java deleted file mode 100644 index 4b2e7f92b..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_camp.java +++ /dev/null @@ -1,136 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.camping; -import script.library.utils; - - -public class terminal_camp extends script.base_script -{ - public terminal_camp() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "handleTimeSensitiveData", null, 4, false); - return SCRIPT_CONTINUE; - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - int destructTime = getIntObjVar(self, camping.VAR_DESTRUCT_TIME); - if (destructTime <= 0) - { - return super.OnGetAttributes(self, player, names, attribs); - } - - names[idx] = "camp_destruction"; - attribs[idx] = getCalendarTimeStringLocal(destructTime); - idx++; - - names[idx] = "camp_timer"; - attribs[idx] = utils.formatTimeVerbose(destructTime - getCalendarTime()); - idx++; - - return super.OnGetAttributes(self, player, names, attribs); - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - menu_info_data data = mi.getMenuItemByType(menu_info_types.ITEM_USE); - - if (data != null) - { - data.setLabel(new string_id("camp","menu_dismantle")); - data.setServerNotify(true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item == menu_info_types.ITEM_USE) - { - requestCampDismantle(self, player); - } - - return SCRIPT_CONTINUE; - } - - - public void requestCampDismantle(obj_id self, obj_id player) throws InterruptedException - { - if (!hasObjVar(self, "camp")) - { - return; - } - - obj_id camp = getObjIdObjVar(self, "camp"); - - if (!isIdValid(camp)) - { - return; - } - - if (hasObjVar(camp, "camp.owner")) - { - obj_id owner = utils.getObjIdObjVar(camp, "camp.owner"); - if (player == owner) - { - destroyObject(camp); - } - else - { - sendSystemMessage(player, new string_id("camp", "owner_dismantle")); - return; - } - } - - return; - } - - - public int handleTimeSensitiveData(obj_id self, dictionary params) throws InterruptedException - { - obj_id camp = getObjIdObjVar(self, "camp"); - if (!isValidId(camp) || !exists(camp)) - { - return SCRIPT_CONTINUE; - } - - int lifeTime = (int)getFloatObjVar(camp, camping.VAR_LIFETIME); - if (lifeTime <= 0) - { - return SCRIPT_CONTINUE; - } - - int creationTime = getIntObjVar(camp, camping.VAR_CREATION_TIME); - if (lifeTime <= 0) - { - return SCRIPT_CONTINUE; - } - - int destructTime = creationTime + lifeTime; - setObjVar(self, camping.VAR_DESTRUCT_TIME, destructTime); - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java deleted file mode 100644 index 63e0c9ae2..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_character_builder.java +++ /dev/null @@ -1,10666 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.armor; -import script.library.beast_lib; -import script.library.buff; -import script.library.callable; -import script.library.chat; -import script.library.consumable; -import script.library.craftinglib; -import script.library.create; -import script.library.expertise; -import script.library.factions; -import script.library.gm; -import script.library.healing; -import script.library.incubator; -import script.library.instance; -import script.library.jedi; -import script.library.money; -import script.library.pet_lib; -import script.library.player_stomach; -import script.library.prose; -import script.library.resource; -import script.library.respec; -import script.library.skill; -import script.library.skill_template; -import script.library.space_crafting; -import script.library.space_flags; -import script.library.space_skill; -import script.library.space_transition; -import script.library.space_utils; -import script.library.static_item; -import script.library.stealth; -import script.library.sui; -import script.library.utils; -import script.library.weapons; - - -public class terminal_character_builder extends script.base_script -{ - public terminal_character_builder() - { - } - public static final int CASH_AMOUNT = 100000000; - public static final int AMT = 1000000; - public static final int FACTION_AMT = 250000; - - public static final float WEAPON_SPEED = 1.0f; - public static final float WEAPON_DAMAGE = 1.0f; - public static final float WEAPON_ELEMENTAL = 1.0f; - public static final float WEAPON_EFFECIENCY = 1.0f; - - public static final float CONDITION = 1.0f; - public static final float GENERAL_PROTECTION = 0.94f; - public static final String SKILL_TBL = "datatables/skill/skills.iff"; - public static final String HEROIC_JEWELRY_SETS = "datatables/skill/character_builder_heroic_jewelry.iff"; - public static final String SKILL_LOADOUT_TBL = "datatables/skill/loadout.iff"; - public static final String EXOTIC_SKILL_MODS = "datatables/crafting/reverse_engineering_mods.iff"; - - public static final String SHIP_CHASSIS_TBL = "datatables/ship/components/character_builder/frog_chassis.iff"; - public static final String SHIPCOMPONENT_ARMOR_TBL = "datatables/ship/components/character_builder/frog_armor.iff"; - public static final String SHIPCOMPONENT_BOOSTER_TBL = "datatables/ship/components/character_builder/frog_booster.iff"; - public static final String SHIPCOMPONENT_DROIDINTERFACE_TBL = "datatables/ship/components/character_builder/frog_droid_interface.iff"; - public static final String SHIPCOMPONENT_ENGINE_TBL = "datatables/ship/components/character_builder/frog_engine.iff"; - public static final String SHIPCOMPONENT_REACTOR_TBL = "datatables/ship/components/character_builder/frog_reactor.iff"; - public static final String SHIPCOMPONENT_SHIELD_TBL = "datatables/ship/components/character_builder/frog_shield.iff"; - public static final String SHIPCOMPONENT_WEAPON_TBL = "datatables/ship/components/character_builder/frog_weapon.iff"; - public static final String SHIPCOMPONENT_CAPACITOR_TBL = "datatables/ship/components/character_builder/frog_capacitor.iff"; - - public static final String GENERIC_PROMPT = "Select the desired option"; - public static final String GENERIC_TITLE = "Character Builder Terminal"; - - public static final string_id SID_TERMINAL_PROMPT = new string_id("skill_teacher","skill_terminal_prompt"); - public static final string_id SID_TERMINAL_TITLE = new string_id("skill_teacher","skill_terminal_title"); - public static final string_id SID_TERMINAL_DISABLED = new string_id("skill_teacher","skill_terminal_disabled"); - public static final string_id SID_TERMINAL_DENIED = new string_id("skill_teacher","skill_terminal_denied"); - public static final string_id SID_TERMINAL_MAX_SKILLS = new string_id("skill_teacher","skill_terminal_max_skills"); - public static final string_id PROSE_GRANT_SKILL = new string_id("skill_teacher","skill_terminal_grant"); - public static final string_id PROSE_GRANT_SKILL_FAIL = new string_id("skill_teacher","skill_terminal_grant_fail"); - - public static final String[] CHARACTER_BUILDER_OPTIONS = - { - "Weapons", - "Armor Sets", - "Roadmap Skill Builder", - "Resources", - "Credits", - "Faction", - "Vehicles/Mounts/Beasts", - "Ships", - "Crafting Items", - "Structure Deeds", - "PA Halls", - "Misc Items/Medicines", - "Jedi Options", - "Best Resource", - "Flag for All Heroic Instances", - "Draft Schematics" - }; - public static final String[] RESOURCE_TYPES = - { - "Creature Resources", - "Flora Resources", - "Chemical", - "Water", - "Mineral", - "Gas", - "Energy", - "Asteroid" - }; - - public static final String[] BEST_RESOURCE_TYPES = - { - "Creature Resources", - "Flora Resources", - "Chemical", - "Water", - "Mineral", - "Gas", - "Energy", - "Asteroid", - "Filter by specific attribute" - }; - - public static final String[] SPACE_RESOURCE_LOCALIZED = - { - "@resource/resource_names:space_chemical_acid", - "@resource/resource_names:space_chemical_cyanomethanic", - "@resource/resource_names:space_chemical_petrochem", - "@resource/resource_names:space_chemical_sulfuric", - "@resource/resource_names:space_gas_methane", - "@resource/resource_names:space_gas_organometallic", - "@resource/resource_names:space_gem_crystal", - "@resource/resource_names:space_gem_diamond", - "@resource/resource_names:space_metal_carbonaceous", - "@resource/resource_names:space_metal_ice", - "@resource/resource_names:space_metal_iron", - "@resource/resource_names:space_metal_obsidian", - "@resource/resource_names:space_metal_silicaceous" - }; - - public static final String[] SPACE_RESOURCE_CONST = - { - "space_chemical_acid", - "space_chemical_cyanomethanic", - "space_chemical_petrochem", - "space_chemical_sulfuric", - "space_gas_methane", - "space_gas_organometallic", - "space_gem_crystal", - "space_gem_diamond", - "space_metal_carbonaceous", - "space_metal_ice", - "space_metal_iron", - "space_metal_obsidian", - "space_metal_silicaceous" - }; - - public static final String[] RESOURCE_BASE_TYPES = - { - "creature_resources", - "flora_resources", - "chemical", - "water", - "mineral", - "gas", - "energy", - "Asteroid" - }; - public static final String[] VEHICLE_MOUNT_OPTIONS = - { - "Vehicles", - "Mounts", - "Beasts" - }; - public static final String[] VEHICLE_OPTIONS = - { - "Swoop", - "Speederbike", - "X34", - "AB1", - "V35", - "XP38", - "Barc Speeder", - "AV21", - "X31", - "Flash Speeder" - }; - public static final String[] MOUNT_OPTIONS = - { - "Carrion Spat", - "Kaduu", - "Dewback", - "Bol", - "Falumpaset", - "Brackaset", - "Cu Pa - Creature Handler Version", - "Bantha - Creature Handler Version" - }; - - public static final String[] BEAST_OPTIONS_FOR_PLAYERS = - { - "angler", - "bageraset", - "bantha", - "bark_mite", - "bearded_jax", - "boar_wolf", - "bocatt", - "bolle_bol", - "bordok", - "borgle", - "blurrg", - "capper_spineflap", - "choku", - "chuba", - "condor_dragon", - "dalyrake", - "durni", - "fambaa", - "gronda", - "gurk", - "ikopi", - "mamien", - "mynock", - "quenker", - "reptilian_flier" - }; - - public static final String[] BEAST_OPTIONS = - { - "acklay", - "angler", - "bageraset", - "bantha", - "bark_mite", - "baz_nitch", - "bearded_jax", - "blistmok", - "blurrg", - "boar_wolf", - "bocatt", - "bol", - "bolle_bol", - "bolma", - "bolotaur", - "bordok", - "borgle", - "brackaset", - "capper_spineflap", - "carrion_spat", - "choku", - "chuba", - "condor_dragon", - "corellian_butterfly", - "corellian_sand_panther", - "corellian_slice_hound", - "crystal_snake", - "cu_pa", - "dalyrake", - "dewback", - "dune_lizard", - "durni", - "dwarf_nuna", - "eopie", - "falumpaset", - "fambaa", - "fanned_rawl", - "flewt", - "flit", - "fynock", - "gackle_bat", - "gaping_spider", - "gnort", - "graul", - "gronda", - "gualama", - "gubbur", - "guf_drolg", - "gulginaw", - "gurk", - "gurnaset", - "gurreck", - "hanadak", - "hermit_spider", - "horned_krevol", - "horned_rasp", - "huf_dun", - "huurton", - "ikopi", - "jundak", - "kaadu", - "kai_tok", - "kashyyyk_bantha", - "kima", - "kimogila", - "kittle", - "kliknik", - "krahbu", - "kubaza_beetle", - "kusak", - "kwi", - "langlatch", - "lantern_bird", - "lava_flea", - "malkloc", - "mamien", - "mawgax", - "merek", - "minstyngar", - "mott", - "mouf", - "murra", - "mutated_acklay", - "mutated_boar", - "mutated_borgax", - "mutated_cat", - "mutated_chuba_fly", - "mutated_cu_pa", - "mutated_dewback", - "mutated_griffon", - "mutated_jax", - "mutated_quenker", - "mutated_rancor", - "mutated_slice_hound", - "mutated_varasquactyl", - "mynock", - "narglatch", - "nerf", - "nuna", - "peko_peko", - "perlek", - "pharple", - "piket", - "plumed_rasp", - "pugoriss", - "purbole", - "quenker", - "rancor", - "remmer", - "reptilian_flier", - "roba", - "rock_mite", - "ronto", - "salt_mynock", - "sharnaff", - "shaupaut", - "shear_mite", - "skreeg", - "snorbal", - "spined_puc", - "spined_snake", - "squall", - "squill", - "stintaril", - "swirl_prong", - "tanc_mite", - "tanray", - "tauntaun", - "thune", - "torton", - "tulrus", - "tusk_cat", - "tybis", - "uller", - "varactyl", - "veermok", - "verne", - "vesp", - "vir_vur", - "voritor_lizard", - "vynock", - "walluga", - "wampa", - "webweaver", - "whisper_bird", - "womp_rat", - "woolamander", - "worrt", - "xandank", - "zucca_boar" - }; - public static final String[] SHIP_OPTIONS = - { - "Rebel", - "Imperial", - "Freelance", - "Other", - "Parts", - "Pilot Skills" - }; - public static final String[] REBEL_SHIP_OPTIONS = - { - "Incom X4 Gunship", - "Z95", - "Y-Wing", - "Y-Wing Longprobe", - "X-Wing", - "Advanced X-Wing", - "A-Wing", - "B-Wing", - "YKL-37R Nova Courier" - }; - public static final String[] REBEL_SHIP_TYPES = - { - "gunship_rebel", - "z95", - "ywing", - "ywing_longprobe", - "xwing", - "advanced_xwing", - "awing", - "bwing", - "ykl37r" - }; - public static final String[] IMPERIAL_SHIP_OPTIONS = - { - "Imperial YE-4 Gunship", - "TIE Fighter (Light Duty)", - "TIE Fighter", - "TIE/In", - "TIE Interceptor", - "TIE Bomber", - "TIE Advanced", - "TIE Aggressor", - "TIE Interceptor (Imperial Guard)", - "VT-49 Decimator" - }; - public static final String[] IMPERIAL_SHIP_TYPES = - { - "gunship_imperial", - "tie_light_duty", - "tiefighter", - "tie_in", - "tieinterceptor", - "tiebomber", - "tieadvanced", - "tieaggressor", - "tieinterceptor_imperial_guard", - "decimator" - }; - public static final String[] FREELANCE_SHIP_OPTIONS = - { - "Blacksun AEG-77 Vigo Gunship", - "Naboo N-1", - "Scyk", - "Dunelizard", - "Kimogila", - "Kihraxz", - "Ixiyen", - "Rihkxyrk", - "Vaksai", - "Krayt", - }; - public static final String[] FREELANCE_SHIP_TYPES = - { - "gunship_neutral", - "naboo_n1", - "hutt_light_s01", - "hutt_medium_s01", - "hutt_heavy_s01", - "blacksun_light_s01", - "blacksun_medium_s01", - "blacksun_heavy_s01", - "blacksun_vaksai", - "hutt_turret_ship", - }; - public static final String[] OTHER_SHIP_OPTIONS = - { - "Sorosuub", - "Eta-2 Actis (Jedi Starfighter)", - "Belbullab-22 (Grievous' Starship)", - "ARC-170", - "KSE Firespray", - "Y-8 Mining Ship", - "YT-1300", - "YT-2400" - }; - public static final String[] OTHER_SHIP_TYPES = - { - "sorosuub_space_yacht", - "jedi_starfighter", - "grievous_starship", - "arc170", - "firespray", - "y8_mining_ship", - "yt1300", - "yt2400" - }; - public static final String[] MAIN_SHIP_OPTIONS = - { - "Ship Components", - "Ship Chassis", - "Gunship Collection Reward Schematics", - "Component Schematics", - "Pilot Skills" - }; - - public static final String[] PILOT_SKILLS = - { - "Master Imperial Pilot", - "Master Rebel Pilot", - "Neutral Pilot", - "Revoke Pilot" - }; - - public static final String[] DEED_CRAFTING_OPTIONS = - { - "Deeds", - "Crafting Items" - }; - public static final String[] DEED_OPTIONS = - { - "Clothing Factory", - "Food Factory", - "Equipment Factory", - "Structure Factory", - "Generic House", - "Small Tatooine House", - "Small Naboo House", - "Small Corellia House", - "Merchant Tent", - "Heavy Mineral Harvester", - "Heavy Flora Harvester", - "Heavy Gas Harvester", - "Heavy Chemical Harvester", - "Heavy Moisture Vaporator", - "Fusion Reactor", - "Corellia City Pack", - "Naboo City Pack", - "Tatooine City Pack" - - }; - - public static final String[] CRAFTING_OPTIONS = - { - "Weapon Crafting Station", - "Structure Crafting Station", - "Clothing Crafting Station", - "Food Crafting Station", - "Generic Crafting Tool", - "Weapon Crafting Tool", - "Structure Crafting Tool", - "Clothing Crafting Tool", - "Food Crafting Tool", - "Ship Crafting Tool", - "Ship Crafting Station" - - }; - public static final String[] PA_OPTIONS = - { - "Generic PA Hall", - "Tatooine PA Hall", - "Naboo PA Hall", - "Corellia PA Hall", - "Tatooine City Hall", - "Naboo City Hall", - "Corellia City Hall" - - }; - public static final String[] WEAPON_OPTIONS = - { - "Pistols", - "Carbines", - "Rifles", - "Heavy Weapons", - "Unarmed Weapons", - "One-Handed Weapons", - "Two-Handed Weapons", - "Polearm Weapons", - "Battlefield Weapons" - - }; - public static final String[] PISTOL_OPTIONS = - { - "CDEF Pistol", - "Scout Blaster", - "Geonosian Sonic Blaster", - "Republic Blaster", - "Launcher", - "High Capacity Scatter Pistol", - "Scatter Pistol", - "SR Combat", - "Striker", - "Tangle", - "Power5", - "FWG5", - "DX2", - "DL44 XT", - "DL44", - "DH17", - "D18", - "Alliance Disruptor", - "Deathhammer", - "Flare Pistol", - "Flechette Pistol", - "Intimidator", - "Jawa Pistol", - "Renegade Pistol", - "DE-10", - "DL44 Metal", - "Disruptor Pistol", - "Ion Relic Pistol", - "Pistol Lamprey" - }; - - public static final String[] CARBINE_OPTIONS = - { - "CDEF Carbine", - "DH 17 Carbine", - "DH 17 Snubnose", - "E11 Carbine", - "E11 Carbine Mark 2", - "Laser", - "DxR 6", - "EE 3", - "Elite Carbine", - "Nym Slugthrower", - "Alliance Needler", - "Bothan Bola", - "E 5 Carbine", - "Geonosian Carbine", - "Proton Carbine", - "Czerka Dart Carbine", - "Sfor Carbine", - "Whistler Modified" - - }; - public static final String[] RIFLE_OPTIONS = - { - "BWDL19 Rifle (Death Trooper)", - "TC-22 Blaster Rifle Replica (GCW Rifle)", - "Jinkins J-1 Rifle (Nym's Themepark)", - "CDEF", - "DLT 20", - "DLT 20a", - "Tusken", - "Advanced Laser Rifle", - "SG 82", - "Spraystick", - "E 11", - "Jawa Ion", - "T 21", - "Tenloss DxR 6", - "Beserker", - "Light Bowcaster", - "Recon Bowcaster", - "Assault Bowcaster", - "Beam Rifle", - "Acid Beam Rifle", - "High Velocity Sniper Rifle", - "LD 1 Rifle", - "Massassi Ink Rifle", - "Proton Rifle", - "Lightning Rifle", - "Laser Rifle", - "Heavy Lightning Rifle", - "DP-23 Rifle", - "Mustafar Disruptor Rifle", - "Tusken Elite" - - }; - public static final String[] HEAVY_WEAPON_OPTIONS = - { - "Rocket Launcher", - "Plasma Flame Thrower", - "Acid Beam", - "Light Lightning Canon", - "Heavy Acid Beam", - "Heavy Lighting Beam", - "Heavy Particle Beam", - "Flame Thrower", - "Heavy Republic Flame Thrower", - "Lava Cannon", - "Crusader M-XX Heavy Rifle", - "C-M 'Frag Storm' Heavy Shotgun", - "Devastator Acid Launcher", - "CC-V 'Legion' Cryo Projector" - }; - public static final String[] UNARMED_OPTIONS = - { - "Vibroknuckler", - "Massasiknuckler", - "Razorknuckler", - "Basterfist", - "Guardian Blaster Fist" - - }; - public static final String[] ONEHANDED_OPTIONS = - { - "Survival Knife", - "'Twilek' Dagger", - "Sword", - "Curved Sword", - "Gaderiffi Baton", - "Vibroblade", - "Ryyk Blade", - "Rantok Blade", - "Stun Baton", - "Acid Sword", - "Junta Mace", - "Marauder Sword", - "Massassi Sword", - "RSF SWORD", - "Stone Knife", - "Janta Knife", - "Donkuwa Knife", - "Nyax Curved Sword", - "Obsidian Sword", - "Mustafar Bandit Sword", - "Gaderiffi Elite" - - }; - public static final String[] TWOHANDED_OPTIONS = - { - "Axe", - "Battleaxe", - "Katana", - "Vibroaxe", - "Cleaver", - "Power Hammer", - "Scythe", - "Kashyyk Sword", - "Sith Sword", - "Nyax Sword", - "Black Sun Executioner's Hack", - "Tulrus Sword", - "Obsidian 2h Sword", - "Massassi Enforcer Blade" - - }; - public static final String[] POLEARM_OPTIONS = - { - "1H Wood Staff", - "Metal Staff", - "Reinforced Staff", - "Vibro Lance", - "Long Vibro Axe", - "Lance", - "Kaminoan Great Staff", - "Massassi Lance", - "Shocklance", - "Cryo Lance", - "Kashyyk BladeStick", - "Electric Polearm", - "Nightsister Energy Lance", - "Nightsister Lance", - "Obsidian Lance", - "Xandank Lance", - "Acidic Paragon Vibro Axe" - }; - public static final String[] GRENADE_OPTIONS = - { - "Light Fragmentation Grenade", - "Fragmentation Grenade", - "Imperial Detonator", - "Proton Grenade", - "Thermal Detonator", - "Glop Detonator", - "Cryoban" - - }; - - public static final String[] BATTLEFIELD_WEAPON_OPTIONS = - { - "Westar-34 Blaster Pistol", - "NGant-Zarvel 9118 Carbine", - "Westar-M5 Blaster Rifle", - "CR-1 Blast Cannon", - "Buzz-Knuck", - "Sith Sword", - "Vibrosword", - "Magnaguard Electrostaff", - "One-Handed Sith-Saber Hilt", - "Two-Handed Mysterious Lightsaber Hilt", - "Double-Bladed Darth Phobos Lightsaber Hilt" - }; - - public static final String[] ARMOR_OPTIONS = - { - "Assault Armor, For Classes: Commando, Bounty Hunter", - "Battle Armor, For Classes: Spy, Officer", - "Reconnaissance Armor, For Classes: Medic, Smuggler", - "Personal Shield Generators", - "Combat Enhancement Items", - "PvP Sets", - "Heroic Jewelry" - }; - - public static final String[] ARMOR_ASSAULT_OPTIONS = - { - "Composite Armor Set", - "Marauder Assault Armor Set", - "Chitin Armor Set", - "Crafted Bounty Hunter Armor Set", - "Kashyyykian Hunting Armor Set", - "Ithorian Sentinel Armor Set", - "Shocktrooper (Imperial Factional) Armor Set", - "Rebel Assault (Rebel Factional) Armor Set" - }; - public static final String[] ARMOR_BATTLE_OPTIONS = - { - "Padded Armor Set", - "Marauder Battle Armor Set", - "RIS Armor Set", - "Bone Armor Set", - "Kashyyykian Black Mountain Armor Set", - "Ithorian Defender Armor Set", - "Stormtrooper (Imperial Factional) Armor Set", - "Rebel Battle (Rebel Factional) Armor Set", - "Imperial Snowtrooper Armor Set" - }; - public static final String[] ARMOR_RECON_OPTIONS = - { - "Tantel Armor Set", - "Ubese Armor Set", - "Mabari Armor Set", - "Recon Marauder Set", - "Kashyyykian Ceremonial Armor Set", - "Ithorian Guardian Armor Set", - "Scout Trooper (Imperial Factional) Armor Set", - "Marine Rebel (Rebel Factional) Armor Set", - "Alliance Cold Weather Armor set" - }; - public static final String[] ARMOR_PROTECTION_AMOUNT = - { - "Basic", - "Standard", - "Advanced" - }; - public static final String[] ARMOR_PSG_OPTIONS = - { - "MARK I", - "MARK II", - "MARK III" - }; - public static final String[] ARMOR_ENHANCEMENT_OPTIONS = - { - "Combat Enhancement Ring" - - }; - - public static final String[] ARMOR_PVP_SETS = - { - "Imperial Black PvP", - "Imperial White PvP", - "Rebel Grey PvP", - "Rebel Green PvP", - "Galactic Marine Armor Set", - "Rebel SpecForce Armor Set" - }; - - public static final String[] MISCITEM_OPTIONS = - { - "Misc Items", - "Medicines", - "Power Ups", - "Exotic Attachments", - "Socketed Clothing", - "Basic Armor Attachments", - "Basic Clothing Attachments", - "Crafting Suit", - "Aurilia Crystals" - }; - public static final String[] CLOTHING_OPTIONS = - { - "Socketed Shirt", - "Socketed Gloves", - "Socketed Hat", - "Socketed Pants", - "Socketed Jacket", - "Socketed Boots", - }; - - public static final String[] ATTACHMENT_OPTIONS = - { - "Weapon", - "Armor", - "Chest Armor", - "Shirt" - }; - - public static final String[] MISC_OPTIONS = - { - "Spec-Ops Pack", - "Krayt Skull Pack", - "Pilot Ace Pack", - "Jedi Belt Pouch", - "Snowtrooper Backpack", - "Alliance Cold Weather Backpack", - "Arakyd Probe Droid", - "Seeker Droid", - "Master Crafted EE3 Schematic", - "Master Crafted DC-15 Schematic", - "Vet 30k Resource Deed" - - }; - public static final String[] MEDICINE_OPTIONS = - { - "High Charge Stimpack-A", - "High Charge Stimpack-B", - "High Charge Stimpack-C", - "High Charge Stimpack-D" - - - }; - public static final String[] HEAL_OPTIONS = - { - "Heal Wounds", - "Heal Battle Fatigue" - }; - - public static final String[] SMUGGLER_TOOLS_OPTIONS = - { - "Simple Toolkit", - "Finely Crafted Toolset", - "Trandoshan Interframe", - "Delicate Trigger", - "Illegal Core Booster", - "Mandalorian Interframe", - "Micro Plating" - }; - - public static final String[] FACTION_OPTIONS = - { - "Receive Faction Points", - "Declare Faction Rebel", - "Declare Faction Imperial", - - "Gain One Faction Rank", - "Lose One Faction Rank", - "Resign From Current Faction" - }; - - public static final String[] ROADMAP_SKILL_OPTIONS = - { - "Select Roadmap", - "Earn Current Skill", - "Set Combat Level", - "Level 90 - Reset respecs" - }; - - public static final String[] JEDI_OPTIONS = - { - "Saber Crystals", - "Light Sabers", - "Jedi Robes" - - }; - public static final String[] PUBLISH_OPTIONS = - { - "Heavy Weapons", - "Jedi Options", - "Traps", - "Death Watch Bunker Entrance Flag", - "Spy Camouflage Gear" - }; - - public static final String[] CRYSTAL_OPTIONS = - { - "Color Crystals", - "Lava Crystal", - "Power Crystals", - "Ancient Krayt Pearls" - }; - - public static final String[] SABER_OPTIONS = - { - "Training Saber", - "Generation One Sabers", - "Generation Two Sabers", - "Generation Three Sabers", - "Generation Four Sabers", - "Generation Five Sabers" - }; - public static final String[] JEDI_PLAYTEST_OPTIONS = - { - "Level 26 Playtest", - "Level 86 Playtest" - }; - public static final String[] ROBE_OPTIONS = - { - "Padawan Robe", - "(40)Light Acolyte Robe", - "(40)Dark Acolyte Robe", - "(60)Light Apprentice Robe", - "(60)Dark Apprentice Robe", - "(80)Light Jedi Knight Robe", - "(80)Dark Jedi Knight Robe", - "(80)Jedi Master Cloak Brown", - "(80)Jedi Master Cloak Black", - "Reset Jedi Statue Slots for Master Jedi Cloaks Collection" - }; - public static final String ARMOR_SET_PREFIX = "object/tangible/wearables/armor/"; - public static final String[] ARMOR_SET_ASSAULT_1 = - { - "composite/armor_composite_bicep_l.iff", - "composite/armor_composite_chest_plate.iff", - "composite/armor_composite_bicep_r.iff", - "composite/armor_composite_gloves.iff", - "composite/armor_composite_boots.iff", - "composite/armor_composite_helmet.iff", - "composite/armor_composite_bracer_l.iff", - "composite/armor_composite_leggings.iff", - "composite/armor_composite_bracer_r.iff" - }; - public static final String[] ARMOR_SET_ASSAULT_2 = - { - "chitin/armor_chitin_s01_bicep_l.iff", - "chitin/armor_chitin_s01_bicep_r.iff", - "chitin/armor_chitin_s01_boots.iff", - "chitin/armor_chitin_s01_bracer_l.iff", - "chitin/armor_chitin_s01_bracer_r.iff", - "chitin/armor_chitin_s01_chest_plate.iff", - "chitin/armor_chitin_s01_gloves.iff", - "chitin/armor_chitin_s01_helmet.iff", - "chitin/armor_chitin_s01_leggings.iff" - }; - public static final String[] ARMOR_SET_ASSAULT_3 = - { - "marauder/armor_marauder_s03_bicep_l.iff", - "marauder/armor_marauder_s03_bicep_r.iff", - "marauder/armor_marauder_s03_boots.iff", - "marauder/armor_marauder_s03_bracer_l.iff", - "marauder/armor_marauder_s03_bracer_r.iff", - "marauder/armor_marauder_s03_chest_plate.iff", - "marauder/armor_marauder_s03_gloves.iff", - "marauder/armor_marauder_s03_helmet.iff", - "marauder/armor_marauder_s03_leggings.iff" - }; - public static final String[] ARMOR_SET_ASSAULT_4 = - { - "bounty_hunter/armor_bounty_hunter_crafted_bicep_l.iff", - "bounty_hunter/armor_bounty_hunter_crafted_bicep_r.iff", - "bounty_hunter/armor_bounty_hunter_crafted_boots.iff", - "bounty_hunter/armor_bounty_hunter_crafted_bracer_l.iff", - "bounty_hunter/armor_bounty_hunter_crafted_bracer_r.iff", - "bounty_hunter/armor_bounty_hunter_crafted_chest_plate.iff", - "bounty_hunter/armor_bounty_hunter_crafted_gloves.iff", - "bounty_hunter/armor_bounty_hunter_crafted_helmet.iff", - "bounty_hunter/armor_bounty_hunter_crafted_leggings.iff" - }; - public static final String[] ARMOR_SET_BATTLE_1 = - { - "bone/armor_bone_s01_bicep_l.iff", - "bone/armor_bone_s01_bicep_r.iff", - "bone/armor_bone_s01_boots.iff", - "bone/armor_bone_s01_bracer_l.iff", - "bone/armor_bone_s01_bracer_r.iff", - "bone/armor_bone_s01_chest_plate.iff", - "bone/armor_bone_s01_gloves.iff", - "bone/armor_bone_s01_helmet.iff", - "bone/armor_bone_s01_leggings.iff" - }; - public static final String[] ARMOR_SET_BATTLE_2 = - { - "marauder/armor_marauder_s01_bicep_l.iff", - "marauder/armor_marauder_s01_bicep_r.iff", - "marauder/armor_marauder_s01_boots.iff", - "marauder/armor_marauder_s01_bracer_l.iff", - "marauder/armor_marauder_s01_bracer_r.iff", - "marauder/armor_marauder_s01_chest_plate.iff", - "marauder/armor_marauder_s01_gloves.iff", - "marauder/armor_marauder_s01_helmet.iff", - "marauder/armor_marauder_s01_leggings.iff" - }; - public static final String[] ARMOR_SET_BATTLE_3 = - { - "padded/armor_padded_s01_bicep_l.iff", - "padded/armor_padded_s01_bicep_r.iff", - "padded/armor_padded_s01_boots.iff", - "padded/armor_padded_s01_bracer_l.iff", - "padded/armor_padded_s01_bracer_r.iff", - "padded/armor_padded_s01_chest_plate.iff", - "padded/armor_padded_s01_gloves.iff", - "padded/armor_padded_s01_helmet.iff", - "padded/armor_padded_s01_leggings.iff" - }; - public static final String[] ARMOR_SET_BATTLE_4 = - { - "ris/armor_ris_bicep_l.iff", - "ris/armor_ris_bracer_l.iff", - "ris/armor_ris_gloves.iff", - "ris/armor_ris_bicep_r.iff", - "ris/armor_ris_bracer_r.iff", - "ris/armor_ris_helmet.iff", - "ris/armor_ris_boots.iff", - "ris/armor_ris_chest_plate.iff", - "ris/armor_ris_leggings.iff" - }; - public static final String[] ARMOR_SET_RECON_1 = - { - "zam/armor_zam_wesell_helmet.iff", - "zam/armor_zam_wesell_boots.iff", - "zam/armor_zam_wesell_chest_plate.iff", - "zam/armor_zam_wesell_pants.iff", - "zam/armor_zam_wesell_gloves.iff" - }; - public static final String[] ARMOR_SET_RECON_2 = - { - "marauder/armor_marauder_s02_bicep_l.iff", - "marauder/armor_marauder_s02_bicep_r.iff", - "marauder/armor_marauder_s02_boots.iff", - "marauder/armor_marauder_s02_bracer_l.iff", - "marauder/armor_marauder_s02_bracer_r.iff", - "marauder/armor_marauder_s02_chest_plate.iff", - "marauder/armor_marauder_s02_gloves.iff", - "marauder/armor_marauder_s02_helmet.iff", - "marauder/armor_marauder_s02_leggings.iff" - }; - public static final String[] ARMOR_SET_RECON_3 = - { - "tantel/armor_tantel_skreej_bicep_l.iff", - "tantel/armor_tantel_skreej_chest_plate.iff", - "tantel/armor_tantel_skreej_bicep_r.iff", - "tantel/armor_tantel_skreej_boots.iff", - "tantel/armor_tantel_skreej_gloves.iff", - "tantel/armor_tantel_skreej_helmet.iff", - "tantel/armor_tantel_skreej_bracer_l.iff", - "tantel/armor_tantel_skreej_bracer_r.iff", - "tantel/armor_tantel_skreej_leggings.iff" - }; - public static final String[] ARMOR_SET_RECON_4 = - { - "ubese/armor_ubese_boots.iff", - "ubese/armor_ubese_jacket.iff", - "ubese/armor_ubese_bracer_l.iff", - "ubese/armor_ubese_bracer_r.iff", - "ubese/armor_ubese_pants.iff", - "ubese/armor_ubese_gloves.iff", - "ubese/armor_ubese_helmet.iff", - "ubese/armor_ubese_shirt.iff" - }; - public static final String[] ARMOR_SET_ASSAULT_ITHORIAN = - { - "ithorian_sentinel/ith_armor_s03_bicep_l.iff", - "ithorian_sentinel/ith_armor_s03_chest_plate.iff", - "ithorian_sentinel/ith_armor_s03_bicep_r.iff", - "ithorian_sentinel/ith_armor_s03_gloves.iff", - "ithorian_sentinel/ith_armor_s03_boots.iff", - "ithorian_sentinel/ith_armor_s03_helmet.iff", - "ithorian_sentinel/ith_armor_s03_bracer_l.iff", - "ithorian_sentinel/ith_armor_s03_leggings.iff", - "ithorian_sentinel/ith_armor_s03_bracer_r.iff" - }; - public static final String[] ARMOR_SET_BATTLE_ITHORIAN = - { - "ithorian_defender/ith_armor_s01_bicep_l.iff", - "ithorian_defender/ith_armor_s01_chest_plate.iff", - "ithorian_defender/ith_armor_s01_bicep_r.iff", - "ithorian_defender/ith_armor_s01_gloves.iff", - "ithorian_defender/ith_armor_s01_boots.iff", - "ithorian_defender/ith_armor_s01_helmet.iff", - "ithorian_defender/ith_armor_s01_bracer_l.iff", - "ithorian_defender/ith_armor_s01_leggings.iff", - "ithorian_defender/ith_armor_s01_bracer_r.iff" - }; - public static final String[] ARMOR_SET_RECON_ITHORIAN = - { - "ithorian_guardian/ith_armor_s02_bicep_l.iff", - "ithorian_guardian/ith_armor_s02_chest_plate.iff", - "ithorian_guardian/ith_armor_s02_bicep_r.iff", - "ithorian_guardian/ith_armor_s02_gloves.iff", - "ithorian_guardian/ith_armor_s02_boots.iff", - "ithorian_guardian/ith_armor_s02_helmet.iff", - "ithorian_guardian/ith_armor_s02_bracer_l.iff", - "ithorian_guardian/ith_armor_s02_leggings.iff", - "ithorian_guardian/ith_armor_s02_bracer_r.iff" - }; - public static final String[] ARMOR_SET_ASSAULT_WOOKIEE = - { - "kashyyykian_hunting/armor_kashyyykian_hunting_bicep_l.iff", - "kashyyykian_hunting/armor_kashyyykian_hunting_bicep_r.iff", - "kashyyykian_hunting/armor_kashyyykian_hunting_bracer_l.iff", - "kashyyykian_hunting/armor_kashyyykian_hunting_bracer_r.iff", - "kashyyykian_hunting/armor_kashyyykian_hunting_chestplate.iff", - "kashyyykian_hunting/armor_kashyyykian_hunting_leggings.iff" - }; - public static final String[] ARMOR_SET_BATTLE_WOOKIEE = - { - "kashyyykian_black_mtn/armor_kashyyykian_black_mtn_bicep_l.iff", - "kashyyykian_black_mtn/armor_kashyyykian_black_mtn_bicep_r.iff", - "kashyyykian_black_mtn/armor_kashyyykian_black_mtn_bracer_l.iff", - "kashyyykian_black_mtn/armor_kashyyykian_black_mtn_bracer_r.iff", - "kashyyykian_black_mtn/armor_kashyyykian_black_mtn_chestplate.iff", - "kashyyykian_black_mtn/armor_kashyyykian_black_mtn_leggings.iff" - }; - public static final String[] ARMOR_SET_RECON_WOOKIEE = - { - "kashyyykian_ceremonial/armor_kashyyykian_ceremonial_bicep_l.iff", - "kashyyykian_ceremonial/armor_kashyyykian_ceremonial_bicep_r.iff", - "kashyyykian_ceremonial/armor_kashyyykian_ceremonial_bracer_l.iff", - "kashyyykian_ceremonial/armor_kashyyykian_ceremonial_bracer_r.iff", - "kashyyykian_ceremonial/armor_kashyyykian_ceremonial_chestplate.iff", - "kashyyykian_ceremonial/armor_kashyyykian_ceremonial_leggings.iff" - }; - public static final String[] ARMOR_SET_ASSAULT_IMPERIAL = - { - "assault_trooper/armor_assault_trooper_chest_plate.iff", - "assault_trooper/armor_assault_trooper_leggings.iff", - "assault_trooper/armor_assault_trooper_helmet.iff", - "assault_trooper/armor_assault_trooper_bicep_l.iff", - "assault_trooper/armor_assault_trooper_bicep_r.iff", - "assault_trooper/armor_assault_trooper_bracer_l.iff", - "assault_trooper/armor_assault_trooper_bracer_r.iff", - "assault_trooper/armor_assault_trooper_boots.iff", - "assault_trooper/armor_assault_trooper_gloves.iff" - }; - public static final String[] ARMOR_SET_BATTLE_IMPERIAL = - { - "stormtrooper/armor_stormtrooper_chest_plate.iff", - "stormtrooper/armor_stormtrooper_leggings.iff", - "stormtrooper/armor_stormtrooper_helmet.iff", - "stormtrooper/armor_stormtrooper_bicep_l.iff", - "stormtrooper/armor_stormtrooper_bicep_r.iff", - "stormtrooper/armor_stormtrooper_bracer_l.iff", - "stormtrooper/armor_stormtrooper_bracer_r.iff", - "stormtrooper/armor_stormtrooper_boots.iff", - "stormtrooper/armor_stormtrooper_gloves.iff" - }; - public static final String[] ARMOR_SET_RECON_IMPERIAL = - { - "scout_trooper/armor_scout_trooper_chest_plate.iff", - "scout_trooper/armor_scout_trooper_leggings.iff", - "scout_trooper/armor_scout_trooper_helmet.iff", - "scout_trooper/armor_scout_trooper_bicep_l.iff", - "scout_trooper/armor_scout_trooper_bicep_r.iff", - "scout_trooper/armor_scout_trooper_bracer_l.iff", - "scout_trooper/armor_scout_trooper_bracer_r.iff", - "scout_trooper/armor_scout_trooper_boots.iff", - "scout_trooper/armor_scout_trooper_gloves.iff" - }; - public static final String[] ARMOR_SET_ASSAULT_REBEL = - { - "rebel_assault/armor_rebel_assault_chest_plate.iff", - "rebel_assault/armor_rebel_assault_leggings.iff", - "rebel_assault/armor_rebel_assault_helmet.iff", - "rebel_assault/armor_rebel_assault_bicep_l.iff", - "rebel_assault/armor_rebel_assault_bicep_r.iff", - "rebel_assault/armor_rebel_assault_bracer_l.iff", - "rebel_assault/armor_rebel_assault_bracer_r.iff", - "rebel_assault/armor_rebel_assault_boots.iff", - "rebel_assault/armor_rebel_assault_gloves.iff" - }; - public static final String[] ARMOR_SET_BATTLE_REBEL = - { - "rebel_battle/armor_rebel_battle_chest_plate.iff", - "rebel_battle/armor_rebel_battle_leggings.iff", - "rebel_battle/armor_rebel_battle_helmet.iff", - "rebel_battle/armor_rebel_battle_bicep_l.iff", - "rebel_battle/armor_rebel_battle_bicep_r.iff", - "rebel_battle/armor_rebel_battle_bracer_l.iff", - "rebel_battle/armor_rebel_battle_bracer_r.iff", - "rebel_battle/armor_rebel_battle_boots.iff", - "rebel_battle/armor_rebel_battle_gloves.iff" - }; - public static final String[] ARMOR_SET_BATTLE_SNOWTROOPER = - { - "snowtrooper/armor_snowtrooper_chest_plate.iff", - "snowtrooper/armor_snowtrooper_leggings.iff", - "snowtrooper/armor_snowtrooper_helmet.iff", - "snowtrooper/armor_snowtrooper_bicep_l.iff", - "snowtrooper/armor_snowtrooper_bicep_r.iff", - "snowtrooper/armor_snowtrooper_bracer_l.iff", - "snowtrooper/armor_snowtrooper_bracer_r.iff", - "snowtrooper/armor_snowtrooper_boots.iff", - "snowtrooper/armor_snowtrooper_gloves.iff", - "snowtrooper/armor_snowtrooper_belt.iff" - }; - public static final String[] ARMOR_SET_RECON_REBEL = - { - "marine/armor_marine_chest_plate_rebel.iff", - "marine/armor_marine_leggings.iff", - "marine/armor_marine_helmet.iff", - "marine/armor_marine_bicep_l.iff", - "marine/armor_marine_bicep_r.iff", - "marine/armor_marine_bracer_l.iff", - "marine/armor_marine_bracer_r.iff", - "marine/armor_marine_boots.iff", - "marine/armor_marine_gloves.iff" - }; - - public static final String[] ARMOR_SET_REBEL_SNOW = - { - "rebel_snow/armor_rebel_snow_chest_plate.iff", - "rebel_snow/armor_rebel_snow_leggings.iff", - "rebel_snow/armor_rebel_snow_helmet.iff", - "rebel_snow/armor_rebel_snow_bicep_l.iff", - "rebel_snow/armor_rebel_snow_bicep_r.iff", - "rebel_snow/armor_rebel_snow_bracer_l.iff", - "rebel_snow/armor_rebel_snow_bracer_r.iff", - "rebel_snow/armor_rebel_snow_boots.iff", - "rebel_snow/armor_rebel_snow_gloves.iff", - "rebel_snow/armor_rebel_snow_belt.iff" - }; - - public static final String[] ARMOR_SET_PVP_IMPERIAL_BLACK = - { - "armor_pvp_spec_ops_imperial_black_bicep_l_05_01", - "armor_pvp_spec_ops_imperial_black_bicep_r_05_01", - "armor_pvp_spec_ops_imperial_black_boots_05_01", - "armor_pvp_spec_ops_imperial_black_bracer_l_05_01", - "armor_pvp_spec_ops_imperial_black_bracer_r_05_01", - "armor_pvp_spec_ops_imperial_black_chest_plate_orange_pad_05_01", - "armor_pvp_spec_ops_imperial_black_chest_plate_red_pad_05_01", - "armor_pvp_spec_ops_imperial_black_chest_plate_yellow_pad_05_01", - "armor_pvp_spec_ops_imperial_black_chest_plate_blue_pad_05_01", - "armor_pvp_spec_ops_imperial_black_chest_plate_white_pad_05_01", - "armor_pvp_spec_ops_imperial_black_chest_plate_black_pad_05_01", - "armor_pvp_spec_ops_imperial_black_gloves_05_01", - "armor_pvp_spec_ops_imperial_black_helmet_05_01", - "armor_pvp_spec_ops_imperial_black_leggings_05_01" - }; - - public static final String[] ARMOR_SET_PVP_IMPERIAL_WHITE = - { - "armor_pvp_spec_ops_imperial_white_bicep_l_05_01", - "armor_pvp_spec_ops_imperial_white_bicep_r_05_01", - "armor_pvp_spec_ops_imperial_white_boots_05_01", - "armor_pvp_spec_ops_imperial_white_bracer_l_05_01", - "armor_pvp_spec_ops_imperial_white_bracer_r_05_01", - "armor_pvp_spec_ops_imperial_white_chest_plate_orange_pad_05_01", - "armor_pvp_spec_ops_imperial_white_chest_plate_red_pad_05_01", - "armor_pvp_spec_ops_imperial_white_chest_plate_yellow_pad_05_01", - "armor_pvp_spec_ops_imperial_white_chest_plate_blue_pad_05_01", - "armor_pvp_spec_ops_imperial_white_chest_plate_white_pad_05_01", - "armor_pvp_spec_ops_imperial_white_chest_plate_black_pad_05_01", - "armor_pvp_spec_ops_imperial_white_gloves_05_01", - "armor_pvp_spec_ops_imperial_white_helmet_05_01", - "armor_pvp_spec_ops_imperial_white_leggings_05_01" - }; - - public static final String[] ARMOR_SET_PVP_REBEL_GREY = - { - "armor_pvp_spec_ops_rebel_black_grey_bicep_l_05_01", - "armor_pvp_spec_ops_rebel_black_grey_bicep_r_05_01", - "armor_pvp_spec_ops_rebel_black_grey_boots_05_01", - "armor_pvp_spec_ops_rebel_black_grey_bracer_l_05_01", - "armor_pvp_spec_ops_rebel_black_grey_bracer_r_05_01", - "armor_pvp_spec_ops_rebel_black_grey_gloves_05_01", - "armor_pvp_spec_ops_rebel_black_grey_helmet_05_01", - "armor_pvp_spec_ops_rebel_black_grey_leggings_05_01", - "armor_pvp_spec_ops_rebel_black_grey_chest_plate_05_01", - "armor_pvp_spec_ops_rebel_black_black_chest_plate_05_01" - }; - - public static final String[] ARMOR_SET_PVP_REBEL_GREEN = - { - "armor_pvp_spec_ops_rebel_black_green_bicep_l_05_01", - "armor_pvp_spec_ops_rebel_black_green_bicep_r_05_01", - "armor_pvp_spec_ops_rebel_black_green_boots_05_01", - "armor_pvp_spec_ops_rebel_black_green_bracer_l_05_01", - "armor_pvp_spec_ops_rebel_black_green_bracer_r_05_01", - "armor_pvp_spec_ops_rebel_black_green_gloves_05_01", - "armor_pvp_spec_ops_rebel_black_green_helmet_05_01", - "armor_pvp_spec_ops_rebel_black_green_leggings_05_01", - "armor_pvp_spec_ops_rebel_black_green_chest_plate_05_01", - "armor_pvp_spec_ops_rebel_black_black_chest_plate_05_01" - }; - - public static final String[] ARMOR_SET_ASSUALT_GALACTIC_MARINE = - { - "armor_galactic_marine_bicep_l", - "armor_galactic_marine_bicep_r", - "armor_galactic_marine_boots", - "armor_galactic_marine_bracer_l", - "armor_galactic_marine_bracer_r", - "armor_galactic_marine_chest_plate", - "armor_galactic_marine_gloves", - "armor_galactic_marine_helmet", - "armor_galactic_marine_leggings", - "armor_galactic_marine_belt" - }; - - public static final String[] ARMOR_SET_ASSUALT_REBEL_SPECFORCE = - { - "armor_rebel_spec_force_bicep_l", - "armor_rebel_spec_force_bicep_r", - "armor_rebel_spec_force_boots", - "armor_rebel_spec_force_bracer_l", - "armor_rebel_spec_force_bracer_r", - "armor_rebel_spec_force_chest_plate", - "armor_rebel_spec_force_gloves", - "armor_rebel_spec_force_helmet", - "armor_rebel_spec_force_leggings", - "armor_rebel_spec_force_belt" - }; - - public static final String[][] ARMOR_SETS_ASSAULT = - { - ARMOR_SET_ASSAULT_1, - ARMOR_SET_ASSAULT_2, - ARMOR_SET_ASSAULT_3 - }; - public static final String[][] ARMOR_SETS_BATTLE = - { - ARMOR_SET_BATTLE_1, - ARMOR_SET_BATTLE_2, - ARMOR_SET_BATTLE_3, - ARMOR_SET_BATTLE_4 - }; - public static final String[][] ARMOR_SETS_RECON = - { - ARMOR_SET_RECON_1, - ARMOR_SET_RECON_2, - ARMOR_SET_RECON_3, - ARMOR_SET_RECON_4 - }; - - public static final String[] CYBERNETIC_ITEMS = - { - "object/tangible/wearables/cybernetic/s02/cybernetic_s02_arm_l.iff", - "object/tangible/wearables/cybernetic/s02/cybernetic_s02_arm_r.iff", - "object/tangible/wearables/cybernetic/s02/cybernetic_s02_legs.iff", - "object/tangible/wearables/cybernetic/s03/cybernetic_s03_arm_l.iff", - "object/tangible/wearables/cybernetic/s03/cybernetic_s03_arm_r.iff", - "object/tangible/wearables/cybernetic/s05/cybernetic_s05_arm_l.iff", - "object/tangible/wearables/cybernetic/s05/cybernetic_s05_arm_r.iff", - "object/tangible/wearables/cybernetic/s05/cybernetic_s05_legs.iff" - }; - - public static final String[] PUB27_HEAVYPACK = - { - "object/weapon/ranged/heavy/ep3_loot_void.iff", - "object/weapon/ranged/heavy/heavy_rocket_launcher.iff", - "weapon_tow_heavy_rocket_launcher_05_01", - "object/weapon/ranged/rifle/rifle_odararissl.iff", - "object/weapon/ranged/rifle/rifle_proton.iff", - "object/weapon/ranged/heavy/som_lava_cannon.iff", - "weapon_tow_cannon_03_02", - "object/weapon/ranged/heavy/som_republic_flamer.iff", - "weapon_tow_flamer_01_01", - "weapon_publish_gift_27_04_01", - "object/weapon/ranged/pistol/pistol_launcher.iff", - "object/weapon/ranged/pistol/pistol_launcher_elite.iff", - "object/weapon/ranged/pistol/pistol_launcher_medium.iff", - "object/weapon/ranged/pistol/quest_pistol_launcher.iff", - "object/weapon/ranged/rifle/rifle_acid_beam.iff", - "object/weapon/ranged/rifle/rifle_flame_thrower.iff", - "object/weapon/ranged/rifle/rifle_flame_thrower_light.iff" - }; - - public static final String[] PUB27_TRAPS = - { - "prx_trapCaltrop", - "tmr_trapCaltrop", - "rmt_trapCaltrop", - "prx_trapFlashbang", - "tmr_trapFlashbang", - "rmt_trapFlashbang", - "prx_trapHX2", - "tmr_trapHX2", - "rmt_trapHX2", - "prx_trapKamino", - "tmr_trapKamino", - "rmt_trapKamino" - }; - - public static final String[] PUB27_CAMOSTUFF = - { - "item_clothing_spy_stealth_shirt_02_01", - "item_clothing_spy_stealth_pants_02_01", - "item_clothing_spy_stealth_duster_02_01", - "item_clothing_spy_stealth_gloves_02_01", - "item_clothing_spy_stealth_boots_02_01" - }; - - public static final String[] SPACE_LOOT_CATEGORIES = - { - "armor", - "booster", - "droid_interface", - "engine", - "reactor", - "shield_generator", - "weapon", - "weapon_capacitor" - }; - - public static final String[] CRAFTING_PROFESSIONS = - { - "Domestics", - "Engineer", - "Structure", - "Weaponsmith" - }; - - public static final String[] CRAFTING_SKILL_TEMPLATES = - { - "trader_1a", - "trader_1d", - "trader_1b", - "trader_1c" - }; - - public static final String[] COLLECTION_COMPONENT_SCHEMS = - { - "Collection Boosters", - "Collection Capacitors", - "Collection Engines", - "Collection Reactors", - "Nova Orion Engines" - }; - - public static final String[] BASIC_MOD_STRINGS = - { - "precision_modified", - "strength_modified", - "agility_modified", - "stamina_modified", - "constitution_modified", - "luck_modified", - "camouflage", - "combat_block_value" - }; - - public static final String[] BASIC_MOD_LIST = - { - "Precision", - "Strength", - "Agility", - "Stamina", - "Constitution", - "Luck", - "Camouflage", - "Block Value" - }; - - public static final String[] HEROIC_JEWELRY_LIST = - { - "Bounty Hunter Enforcer (DPS)", - "Bounty Hunter Flawless (Utility A)", - "Bounty Hunter Dire Fate (PvP)", - "Medic Striker's (DPS)", - "Medic First Responder's (Healing)", - "Medic Blackbar's Doom (PvP)", - "Jedi Duelist (Saber DPS)", - "Jedi Dark Fury (Force Power DPS)", - "Jedi Guardian (Tanking)", - "Commando Grenadier (Grenade DPS)", - "Commando Frontman (Tanking)", - "Commando Juggernaut (Weapon DPS)", - "Smuggler Scoundrel (DPS)", - "Smuggler Rogue (PvP)", - "Smuggler Gambler's (PvE)", - "Spy Assassin's (DPS)", - "Spy Ghost (PvP)", - "Spy Razor Cat (DPS)", - "Officer Dead Eye (DPS)", - "Officer Hellstorm (AoE DPS)", - "Officer General's (Group PvE)", - "Heroism (Stats)" - }; - public static final String[] AURILIA_CRYSTALS = - { - "Small Aurilian Crystal", - "Medium Aurilian Crystal", - "Large Aurilian Crystal" - }; - - public static final String[] CRAFTING_SUIT = - { - "Blix's Ultra Crafting Suit" - }; - - - public boolean checkConfigSetting(String configString) throws InterruptedException - { - String enabled = toLower(getConfigSetting("CharacterBuilder", configString)); - if (enabled == null) - { - return false; - } - - if (enabled.equals("true") || enabled.equals("1")) - { - return true; - } - - return false; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - menu_info_data data = mi.getMenuItemByType (menu_info_types.ITEM_USE); - - if (data != null) - { - data.setServerNotify (true); - } - else - { - mi.addRootMenu (menu_info_types.ITEM_USE, new string_id("","")); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isGod(player) || checkConfigSetting("builderEnabled")) - { - - if (item == menu_info_types.ITEM_USE) - { - startCharacterBuilder(player); - } - return SCRIPT_CONTINUE; - } - else - { - sendSystemMessageTestingOnly(player, "Only authorized users may access this terminal."); - return SCRIPT_CONTINUE; - } - - } - - - public void startCharacterBuilder(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - - String prompt = "Select the desired character option"; - String title = "Character Builder Terminal"; - - closeOldWindow(player); - - int pid = sui.listbox(self, player, prompt, sui.OK_CANCEL, title, CHARACTER_BUILDER_OPTIONS, "handleOptionSelect", true, false); - setWindowPid(player, pid); - - } - - - public int handleOptionSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > CHARACTER_BUILDER_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - switch(idx) - { - - case 0: - if (isGod(player) || checkConfigSetting("weaponsEnabled")) - { - handleWeaponOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - case 1: - if (isGod(player) || checkConfigSetting("armorEnabled")) - { - handleArmorOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - case 2: - if (isGod(player) || checkConfigSetting("skillsEnabled")) - { - handleRoadmapSkills(player); - } - else - { - sendSystemMessageTestingOnly(player, "The Roadmap Skill Builder option is DISABLED."); - return SCRIPT_CONTINUE; - } - break; - - case 3: - if (isGod(player) || checkConfigSetting("resourcesEnabled")) - { - handleResourceOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - case 4: - if (isGod(player) || checkConfigSetting("creditsEnabled")) - { - handleCreditOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - - case 5: - if (isGod(player) || checkConfigSetting("factionEnabled")) - { - handleFactionOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - case 6: - handleVehicleOption(player); - break; - case 7: - if (isGod(player) || checkConfigSetting("shipsEnabled")) - { - handleShipMenuSelect(player); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - case 8: - if (isGod(player) || checkConfigSetting("craftingEnabled")) - { - handleCraftingOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - case 9: - if (isGod(player) || checkConfigSetting("deedsEnabled")) - { - handleDeedOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - case 10: - if (isGod(player) || checkConfigSetting("pahallEnabled")) - { - handlePAOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - case 11: - if (isGod(player) || checkConfigSetting("miscitemEnabled")) - { - handleMiscOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - case 12: - if (isGod(player) || checkConfigSetting("jediEnabled")) - { - handleJediOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "You Are Not Authorized to use the Jedi Options!."); - return SCRIPT_CONTINUE; - } - break; - case 13: - if (isGod(player)) - { - handleBestResourceOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This is for developers only."); - return SCRIPT_CONTINUE; - } - break; - - case 14: - if (isGod(player)) - { - flagAllHeroicInstances(player); - } - else - { - sendSystemMessageTestingOnly(player, "This is for developers only."); - return SCRIPT_CONTINUE; - } - break; - case 15: - if (isGod(player)) - { - handleDraftSchematicsOption(player); - } - else - { - sendSystemMessageTestingOnly(player, "This is for developers only."); - return SCRIPT_CONTINUE; - } - break; - - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public void cleanScriptVars(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - - utils.removeScriptVarTree(player, "character_builder"); - utils.removeScriptVarTree(self, "character_builder"); - - setObjVar(player, "character_builder", true); - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - String playerPath = "character_builder."; - if (utils.hasScriptVar(player, "character_builder.pid")) - { - int oldpid = utils.getIntScriptVar(player, "character_builder.pid"); - forceCloseSUIPage (oldpid); - utils.removeScriptVar(player, "character_builder.pid"); - } - } - - - public void setWindowPid(obj_id player, int pid) throws InterruptedException - { - if (pid > -1) - { - utils.setScriptVar(player, "character_builder.pid", pid); - } - } - - - public String[] convertSkillListNames(String[] skillList) throws InterruptedException - { - for (int i = 0; i < skillList.length; i++) - { - testAbortScript(); - skillList[i] = "@skl_n:" + skillList[i]; - } - - return skillList; - } - - - public void handleSkillLoadoutOption(obj_id player) throws InterruptedException - { - - if (!isIdValid(player)) - { - return; - } - obj_id inventoryId = utils.getInventoryContainer(player); - if (!isIdValid(inventoryId)) - { - return; - } - obj_id[] inventoryArray = getInventoryAndEquipment(player); - if (inventoryArray == null) - { - inventoryArray = new obj_id[0]; - } - java.util.HashSet inventoryLookup = new java.util.HashSet(inventoryArray.length > 8 ? inventoryArray.length * 2 : 16); - for (int i = 0; i < inventoryArray.length; ++i) - { - testAbortScript(); - String itemTemplate = getTemplateName(inventoryArray[i]); - if (itemTemplate != null) - { - inventoryLookup.add(itemTemplate); - } - } - - int itemCount = 0; - int shipCount = 0; - String[] skills = getSkillListingForPlayer(player); - if (skills != null) - { - for (int i = 0; i < skills.length; ++i) - { - testAbortScript(); - if (space_transition.isPlayerBelowShipLimit(player)) - { - obj_id shipId = null; - if (skills[i].equals("pilot_rebel_navy_master")) - { - shipId = space_utils.createShipControlDevice(player, "advanced_xwing", false); - } - else if (skills[i].equals("pilot_imperial_navy_master")) - { - shipId = space_utils.createShipControlDevice(player, "tieinterceptor_imperial_guard", false); - } - else if (skills[i].equals("pilot_neutral_master")) - { - shipId = space_utils.createShipControlDevice(player, "yt1300", false); - } - else if (skills[i].equals("pilot_rebel_navy_novice")) - { - shipId = space_utils.createShipControlDevice(player, "z95", false); - } - else if (skills[i].equals("pilot_imperial_navy_novice")) - { - shipId = space_utils.createShipControlDevice(player, "tie_light_duty", false); - } - else if (skills[i].equals("pilot_neutral_novice")) - { - shipId = space_utils.createShipControlDevice(player, "basic_hutt_light", false); - } - if (isValidId(shipId)) - { - ++shipCount; - } - } - - dictionary items = dataTableGetRow(SKILL_LOADOUT_TBL, skills[i]); - if (items != null) - { - - java.util.Enumeration keys = items.keys(); - while (keys.hasMoreElements()) - { - testAbortScript(); - String key = (String)(keys.nextElement()); - if (key.equals("skill")) - { - continue; - } - - Object value = items.get(key); - if (value != null && value instanceof String && ((String)value).length() > 0) - { - if (key.equals("armor")) - { - - String armorSetName = (String)(value); - String armorCategoryName = armorSetName.substring(0, armorSetName.length()-1); - String armorLevelName = armorSetName.substring(armorSetName.length()-1, armorSetName.length()); - if ((!armorCategoryName.equals("assault") && !armorCategoryName.equals("battle") && !armorCategoryName.equals("recon"))) - { - sendSystemMessageTestingOnly(player, "Invalid armor category "+ armorCategoryName + - " for skill entry "+ skills[i]); - continue; - } - if ((!armorLevelName.equals("1") && !armorLevelName.equals("2") && !armorLevelName.equals("3"))) - { - sendSystemMessageTestingOnly(player, "Invalid armor level "+ armorLevelName + - " for skill entry "+ skills[i]); - continue; - } - int armorCategory = AC_none; - int armorLevel = Integer.parseInt(armorLevelName) - 1; - int playerSpecies = getSpecies(player); - String[] armorSet = null; - if (armorCategoryName.equals("assault")) - { - armorCategory = AC_assault; - if (playerSpecies == SPECIES_WOOKIEE) - { - armorSet = ARMOR_SET_ASSAULT_WOOKIEE; - } - else if (playerSpecies == SPECIES_ITHORIAN) - { - armorSet = ARMOR_SET_ASSAULT_ITHORIAN; - } - else - { - armorSet = ARMOR_SETS_ASSAULT[rand(0, ARMOR_SETS_ASSAULT.length-1)]; - } - } - else if (armorCategoryName.equals("battle")) - { - armorCategory = AC_battle; - if (playerSpecies == SPECIES_WOOKIEE) - { - armorSet = ARMOR_SET_BATTLE_WOOKIEE; - } - else if (playerSpecies == SPECIES_ITHORIAN) - { - armorSet = ARMOR_SET_BATTLE_ITHORIAN; - } - else - { - armorSet = ARMOR_SETS_BATTLE[rand(0, ARMOR_SETS_BATTLE.length-1)]; - } - } - else - { - armorCategory = AC_reconnaissance; - if (playerSpecies == SPECIES_WOOKIEE) - { - armorSet = ARMOR_SET_RECON_WOOKIEE; - } - else if (playerSpecies == SPECIES_ITHORIAN) - { - armorSet = ARMOR_SET_RECON_ITHORIAN; - } - else - { - armorSet = ARMOR_SETS_RECON[rand(0, ARMOR_SETS_RECON.length-1)]; - } - } - if (armorSet == null) - { - sendSystemMessageTestingOnly(player, "Unable to get armor set for armor category "+ armorCategoryName); - continue; - } - for (int j = 0; j < armorSet.length; ++j) - { - testAbortScript(); - String armorTemplate = ARMOR_SET_PREFIX + armorSet[j]; - if (!inventoryLookup.contains(armorTemplate)) - { - obj_id newItem = createObject(armorTemplate, inventoryId, ""); - if (isIdValid(newItem)) - { - - if (!isGameObjectTypeOf(newItem, GOT_armor_foot) && !isGameObjectTypeOf(newItem, GOT_armor_hand)) - { - armor.setArmorDataPercent(newItem, armorLevel, armorCategory, GENERAL_PROTECTION, CONDITION); - } - inventoryLookup.add(armorTemplate); - ++itemCount; - } - } - } - } - else - { - if (!inventoryLookup.contains(value)) - { - String itemTemplate = (String)(value); - obj_id newItem = null; - int itemGot = getGameObjectTypeFromTemplate(itemTemplate); - if (isGameObjectTypeOf(itemGot, GOT_weapon)) - { - newItem = weapons.createWeapon(itemTemplate, inventoryId, weapons.VIA_TEMPLATE, WEAPON_SPEED, WEAPON_DAMAGE, WEAPON_EFFECIENCY, WEAPON_ELEMENTAL); - } - else - { - newItem = createObject(itemTemplate, inventoryId, ""); - } - if (isIdValid(newItem)) - { - inventoryLookup.add(itemTemplate); - ++itemCount; - } - } - } - } - } - } - } - } - - if (itemCount > 0 || shipCount > 0) - { - if (shipCount > 0) - { - sendSystemMessageTestingOnly(player, shipCount + " ships were placed in your datapad."); - } - if (itemCount > 0) - { - sendSystemMessageTestingOnly(player, itemCount + " items were placed in your inventory."); - } - sendSystemMessageTestingOnly(player, "Have fun storming the castle!"); - } - else - { - sendSystemMessageTestingOnly(player, "No new items were placed in your inventory. You've got everything you need."); - } - - startCharacterBuilder(player); - } - - - public void handleCreditOption(obj_id player) throws InterruptedException - { - - if (getCashBalance(player) < 100000000) - { - dictionary d = new dictionary(); - d.put("payoutTarget", player); - money.systemPayout(money.ACCT_BETA_TEST, player, CASH_AMOUNT, "handlePayoutToPlayer", d); - } - else - { - sendSystemMessageTestingOnly(player, "You already have 100,000,000+ credits. Why do you need any more money?"); - } - startCharacterBuilder(player); - - } - - - public int handlePayoutToPlayer(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("payoutTarget"); - if (!isIdValid(player)) - { - return SCRIPT_CONTINUE; - } - - int retCode = params.getInt(money.DICT_CODE); - if (retCode == money.RET_SUCCESS) - { - String terminal = "Character Builder Terminal"; - sendSystemMessageTestingOnly(player, "You receive "+ CASH_AMOUNT + " credits from the "+ terminal); - } - else if (retCode == money.RET_FAIL) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - } - - return SCRIPT_CONTINUE; - } - - - public void handleBuffOption(obj_id player) throws InterruptedException - { - buff.applyBuff(player, "frogBuff"); - sendSystemMessageTestingOnly(player, "Buffs applied!"); - startCharacterBuilder(player); - } - - - public void handleResourceOption(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - - refreshMenu ( player, "Select the desired resource category", "Character Builder Terminal", RESOURCE_TYPES, "handleCategorySelection", false); - - return; - } - - - public int handleCategorySelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - location loc = getLocation(player); - String planet = "current"; - - String[] resourceList = buildAvailableResourceTree(self, loc, RESOURCE_BASE_TYPES[idx]); - - refreshMenu ( player, "Select the desired resource category", "Character Builder Terminal", resourceList, "handleResourceSelection", false); - if (resourceList[0].startsWith("@resource/resource_names")) - { - utils.setScriptVar(player, "character_builder.resourceList", SPACE_RESOURCE_CONST); - } - else - { - utils.setScriptVar(player, "character_builder.resourceList", resourceList); - } - - return SCRIPT_CONTINUE; - } - - - public int handleResourceSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu ( player, "Select the desired resource category", "Character Builder Terminal", RESOURCE_TYPES, "handleCategorySelection", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - String[] resourceList = utils.getStringArrayScriptVar(player, "character_builder.resourceList"); - - String resourceName = resourceList[idx].trim(); - if (resourceName.startsWith("\\#")) - { - resourceName = resourceName.substring(13, resourceName.length()-3); - } - - if (resourceName.startsWith("space")) - { - makeSpaceResource(player, resourceName); - return SCRIPT_CONTINUE; - } - - obj_id resourceId = getResourceTypeByName(resourceName); - - if (isIdNull(resourceId)) - { - resourceId = pickRandomNonDepeletedResource(resourceName); - } - - obj_id inv = utils.getInventoryContainer(player); - obj_id resourceCrate = createResourceCrate(resourceId, AMT, inv); - - if (isIdNull(resourceCrate)) - { - sendSystemMessageTestingOnly(player, "Resource grant failed. It is likely your inventory is full."); - } - else - { - resourceName = " \\#pcontrast1 "+getResourceName(resourceId)+"\\#. a type of "+ getClassString(getResourceClass(resourceId)); - prose_package proseSuccess = prose.getPackage(resource.SID_SAMPLE_LOCATED, resourceName, AMT); - sendSystemMessageProse(player, proseSuccess); - - } - - refreshMenu ( player, "Select the desired resource category", "Character Builder Terminal", resourceList, "handleResourceSelection", false); - return SCRIPT_CONTINUE; - } - - - public void makeSpaceResource(obj_id self, String rclass) throws InterruptedException - { - obj_id[] rtypes = getResourceTypes(rclass); - sendSystemMessageTestingOnly(self, "Types are..."+ rtypes[0].toString()); - obj_id rtype = rtypes[0]; - if (!isIdValid(rtype)) - { - sendSystemMessageTestingOnly(self, "No id found"); - sendSystemMessageTestingOnly(self, "Type was "+rclass); - return; - } - - String crateTemplate = getResourceContainerForType(rtype); - - if (!crateTemplate.equals("")) - { - obj_id pInv = utils.getInventoryContainer(self); - if (isIdValid(pInv)) - { - obj_id crate = createObject(crateTemplate, pInv, ""); - if (addResourceToContainer (crate, rtype, AMT, self)) - { - sendSystemMessageTestingOnly(self, "Resource of class "+rclass+" added"); - } - } - } - } - - - public String[] buildAvailableResourceTree(obj_id self, location loc, String topParent) throws InterruptedException - { - Vector allResources = new Vector(); - allResources.setSize(0); - - if (topParent.equals("Asteroid")) - { - return SPACE_RESOURCE_LOCALIZED; - - } - - if (hasObjVar(self, "allPlanetResources")) - { - String[] planetNames = - { - "corellia", "dantooine", "lok", "naboo", "rori", "talus", "tatooine" - }; - - for (int i = 0; i < planetNames.length; i++) - { - testAbortScript(); - loc.area = planetNames[i]; - - resource_density[] resources = requestResourceList(loc, 0.0f, 1.0f, topParent); - - for (int j = 0; j < resources.length; j++) - { - testAbortScript(); - allResources.add(resources[j]); - } - } - } - else - { - resource_density[] resources = requestResourceList(loc, 0.0f, 1.0f, topParent); - - for (int j = 0; j < resources.length; j++) - { - testAbortScript(); - allResources.add(resources[j]); - } - } - - String[] resourceTree = buildSortedResourceTree(allResources, topParent, 0); - - return resourceTree; - } - - - public String[] buildSortedResourceTree(Vector resources, String topParent, int branchLevel) throws InterruptedException - { - Vector resourceTree = new Vector(); - resourceTree.setSize(0); - - if (resources != null) - { - for (int i = 0; i < resources.size(); i++) - { - testAbortScript(); - if (!isResourceDerivedFrom(((resource_density)(resources.get(i))).getResourceType(), topParent)) - { - continue; - } - - String parent = getResourceClass(((resource_density)(resources.get(i))).getResourceType()); - String child = null; - - if (parent == null) - { - continue; - } - - while (!parent.equals(topParent)) - { - testAbortScript(); - child = parent; - parent = getResourceParentClass(child); - } - - if (child == null) - { - child = "\\#pcontrast1 "+getResourceName(((resource_density)(resources.get(i))).getResourceType())+"\\#."; - } - - for (int j = 0; j < branchLevel; j++) - { - testAbortScript(); - child = " "+ child; - } - - if (resourceTree.indexOf(child) == -1) - { - resourceTree.add(child); - } - } - } - - for (int i = 0; i < resourceTree.size(); i++) - { - testAbortScript(); - String parent = ((String)(resourceTree.get(i))).trim(); - String[] childBranch = buildSortedResourceTree(resources, parent, branchLevel+1); - - for (int j = 0; j < childBranch.length; j++) - { - testAbortScript(); - resourceTree.add(++i, childBranch[j]); - } - } - - return (String[])resourceTree.toArray(new String[0]); - } - - - public String getClassString(String className) throws InterruptedException - { - final String resourceTable = "datatables/resource/resource_tree.iff"; - - String classString = ""; - - int row = dataTableSearchColumnForString(className, 1, resourceTable); - int column = 2; - while ((classString == null || classString.length() == 0) && column <= 9) - { - testAbortScript(); - classString = dataTableGetString(resourceTable, row, column); - column++; - } - - return classString; - } - - - public void handleBestResourceOption(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - - refreshMenu(player, "Select the desired resource category", "Character Builder Terminal", BEST_RESOURCE_TYPES, "handleBestCategorySelection", false); - - return; - } - - - public int handleBestCategorySelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (idx > RESOURCE_BASE_TYPES.length - 1) - { - utils.setScriptVar(player, "character_builder.specificFilter", -1); - refreshMenu(player, "Select the desired resource category", "Character Builder Terminal", RESOURCE_TYPES, "handleBestCategorySelection", false); - return SCRIPT_CONTINUE; - } - - location loc = getLocation(player); - String planet = "current"; - - String[] resourceList = getResourceChildClasses(RESOURCE_BASE_TYPES[idx]); - - int goodResources = 0; - - for (int i = 0; i < resourceList.length; ++i) - { - testAbortScript(); - if (!hasResourceType(resourceList[i])) - { - resourceList[i] = null; - } - else - { - ++goodResources; - } - } - - String[] temp = new String[goodResources]; - goodResources = 0; - - for (int i = 0; i < resourceList.length; ++i) - { - testAbortScript(); - if (resourceList[i] != null) - { - temp[goodResources++] = resourceList[i]; - } - } - - resourceList = temp; - temp = null; - - refreshMenu(player, "Select the desired resource category", "Character Builder Terminal", resourceList, "handleBestResourceSelection", false); - utils.setScriptVar(player, "character_builder.resourceList", resourceList); - - return SCRIPT_CONTINUE; - } - - - public int handleBestResourceSelection(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - String[] resourceList = utils.getStringArrayScriptVar(player, "character_builder.resourceList"); - - if (utils.hasScriptVar(player, "character_builder.specificFilter")) - { - String[] attribs = craftinglib.getAttribNamesByResourceClass(resourceList[idx]); - - if (attribs == null) - { - debugSpeakMsg(player, "attribs null"); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, "character_builder.resourceIndex", idx); - - refreshMenu(player, "Select the desired attribute", "Character Builder Terminal", attribs, "handleBestResourceSelectionWithAttribute", false); - - return SCRIPT_CONTINUE; - } - - craftinglib.makeBestResource(player, resourceList[idx], AMT); - - refreshMenu(player, "Select the desired resource category", "Character Builder Terminal", resourceList, "handleBestResourceSelection", false); - - return SCRIPT_CONTINUE; - } - - - public int handleBestResourceSelectionWithAttribute(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - String[] resourceList = utils.getStringArrayScriptVar(player, "character_builder.resourceList"); - int resourceListIndex = utils.getIntScriptVar(player, "character_builder.resourceIndex"); - - String[] attribs = craftinglib.getAttribNamesByResourceClass(resourceList[resourceListIndex]); - - utils.removeScriptVar(player, "character_builder.specificFilter"); - utils.removeScriptVar(player, "character_builder.resourceIndex"); - - craftinglib.makeBestResourceByAttribute(player, resourceList[resourceListIndex], attribs[idx], AMT); - - refreshMenu(player, "Select the desired resource category", "Character Builder Terminal", BEST_RESOURCE_TYPES, "handleBestCategorySelection", false); - - return SCRIPT_CONTINUE; - } - - - public void handleVehicleOption(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - - refreshMenu ( player, "Select the desired vehicle or mount option", "Character Builder Terminal", VEHICLE_MOUNT_OPTIONS, "handleVehicleOptions", false); - } - - - public int handleVehicleOptions(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > VEHICLE_MOUNT_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String prompt = "Select the desired option"; - String title = "Character Builder Terminal"; - int pid = 0; - - switch(idx) - { - - case 0: - if (isGod(player) || checkConfigSetting("vehiclesEnabled")) - { - refreshMenu ( player, prompt, title, VEHICLE_OPTIONS, "handleVehicleSelect", false); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - - break; - - case 1: - if (isGod(player) || checkConfigSetting("vehiclesEnabled")) - { - refreshMenu ( player, prompt, title, MOUNT_OPTIONS, "handleMountSelect", false); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - return SCRIPT_CONTINUE; - } - break; - - case 2: - if (!isGod(player)) - { - refreshMenu(player, prompt, title, BEAST_OPTIONS_FOR_PLAYERS, "handleBeastSelect", false); - } - else - { - refreshMenu(player, prompt, title, BEAST_OPTIONS, "handleBeastSelect", false); - } - break; - - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - return SCRIPT_CONTINUE; - - } - - - public int handleVehicleSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleVehicleOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > VEHICLE_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - createObject("object/tangible/deed/vehicle_deed/speederbike_swoop_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Swoop Deed Issued."); - break; - - case 1: - createObject("object/tangible/deed/vehicle_deed/speederbike_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Speederbike Deed Issued."); - break; - case 2: - createObject("object/tangible/deed/vehicle_deed/landspeeder_x34_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "X34 Landspeeder Deed Issued."); - break; - case 3: - createObject("object/tangible/deed/vehicle_deed/landspeeder_ab1_deed.iff",pInv, ""); - sendSystemMessageTestingOnly(player, "AB1 Deed Issued."); - break; - case 4: - createObject("object/tangible/deed/vehicle_deed/landspeeder_v35_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "V-35 SoroSuub Carrier Deed Issued."); - break; - case 5: - createObject("object/tangible/deed/vehicle_deed/landspeeder_xp38_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "XP38 Landspeeder Deed Issued."); - break; - case 6: - if (isGod(player)) - { - createObject("object/tangible/deed/vehicle_deed/barc_speeder_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Barc Speeder Deed Issued."); - } - else - { - sendSystemMessageTestingOnly(player, "You Must be in God Mode to enjoy the BARC Speeder!"); - } - break; - case 7: - if (isGod(player)) - { - createObject("object/tangible/deed/vehicle_deed/landspeeder_av21_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "AV21 Deed Issued."); - } - else - { - sendSystemMessageTestingOnly(player, "You Must be in God Mode to enjoy the AV21 Speeder!"); - } - break; - case 8: - createObject("object/tangible/deed/vehicle_deed/landspeeder_x31_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "X31 Deed Issued."); - break; - case 9: - if (isGod(player)) - { - createObject("object/tangible/deed/vehicle_deed/speederbike_flash_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Flash Speeder Deed Issued."); - } - else - { - sendSystemMessageTestingOnly(player, "You Must be in God Mode to enjoy the Flash Speeder!"); - } - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", VEHICLE_OPTIONS, "handleVehicleSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleMountSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleVehicleOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > MOUNT_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - handleMount(player, "carrion_spat"); - break; - case 1: - handleMount(player, "kaadu_motley"); - break; - case 2: - handleMount(player, "lesser_dewback"); - break; - case 3: - handleMount(player, "bol_lesser_plains"); - break; - case 4: - handleMount(player, "falumpaset_plodding"); - break; - case 5: - handleMount(player, "brackaset_lowlands"); - break; - case 6: - handleMount(player, "cu_pa"); - break; - case 7: - handleMount(player, "dwarf_bantha"); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", MOUNT_OPTIONS, "handleMountSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleBeastSelect(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleVehicleOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - String[] beasts = (!isGod(player) ? BEAST_OPTIONS_FOR_PLAYERS : BEAST_OPTIONS); - - if (idx == -1 || idx > beasts.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String creatureName = "bm_"+ beasts[idx]; - obj_id inv = utils.getInventoryContainer(player); - - obj_id egg = createObject("object/tangible/item/beast/bm_egg.iff", inv, ""); - - int hashCreatureType = incubator.getHashType(creatureName); - - incubator.setUpEggWithDummyData(player, egg, hashCreatureType); - - refreshMenu(player, "Select the desired option", "Character Builder Terminal", beasts, "handleBeastSelect", false); - - return SCRIPT_CONTINUE; - } - - - public void handleMount(obj_id player, String mountType) throws InterruptedException - { - location spawnLoc = getLocation(player); - spawnLoc.x += 2; - spawnLoc.z += 2; - - int petType = pet_lib.getPetType(mountType); - int level = dataTableGetInt(pet_lib.CREATURE_TABLE, mountType, "level"); - int chance = pet_lib.getChanceToTame(level, petType, player); - - if (chance <= 0) - { - - if (petType == pet_lib.PET_TYPE_AGGRO) - { - - sendSystemMessage(player, pet_lib.SID_SYS_LACK_SKILL); - return; - } - else - { - if (level > 10) - { - - sendSystemMessage(player, pet_lib.SID_SYS_LACK_SKILL); - return; - } - } - } - - obj_id mount = create.object(mountType, spawnLoc); - - if (!hasScript(player, "ai.pet_master")) - { - attachScript(player, "ai.pet_master"); - } - - if (!createNewMount(player, mount)) - { - destroyObject(mount); - } - else - { - if (getMountsEnabled()) - { - if (couldPetBeMadeMountable(mount) == 0) - { - if (makePetMountable(mount)) - { - obj_id petControlDevice = callable.getCallableCD(mount); - setObjVar(petControlDevice, "ai.pet.trainedMount", 1); - setObjVar(petControlDevice, "ai.pet.type", pet_lib.getPetType(mount)); - } - } - else - { - sendSystemMessageTestingOnly(player, "For some reason, the creature spawned can NOT be turned into a mount. Might be out of SCALE, could be several other things."); - } - } - } - } - - - public boolean createNewMount(obj_id master, obj_id pet) throws InterruptedException - { - String creatureName = ai_lib.getCreatureName(pet); - - if (creatureName == null || creatureName.equals("")) - { - return false; - } - - int petSpecies = ai_lib.aiGetSpecies(pet); - - if (petSpecies == -1) - { - return false; - } - - if (callable.hasCallable(master, callable.CALLABLE_TYPE_RIDEABLE)) - { - return false; - } - - if (!pet_lib.hasMaxStoredPetsOfType(master, pet_lib.PET_TYPE_MOUNT)) - { - obj_id petControlDevice = null; - - if (!callable.hasCallableCD(pet)) - { - obj_id datapad = utils.getPlayerDatapad(master); - - if (!isIdValid(datapad)) - { - return false; - } - - String controlTemplate = "object/intangible/pet/"+ utils.dataTableGetString(create.CREATURE_TABLE, creatureName, "template"); - - if (!controlTemplate.endsWith(".iff")) - { - controlTemplate = pet_lib.PET_CTRL_DEVICE_TEMPLATE; - } - - petControlDevice = createObject(controlTemplate, datapad, ""); - - if (!isIdValid(petControlDevice)) - { - petControlDevice = createObject(pet_lib.PET_CTRL_DEVICE_TEMPLATE, datapad, ""); - - if (!isIdValid(petControlDevice)) - { - sendSystemMessage(master, pet_lib.SID_SYS_TOO_MANY_STORED_PETS); - return false; - } - } - - setObjVar(petControlDevice, "ai.pet.trainedMount", 1); - - pet_lib.setUpPetControlDevice(petControlDevice, pet); - } - - petControlDevice = callable.getCallableCD(pet); - - callable.setCallableLinks(master, petControlDevice, pet); - - dictionary params = new dictionary(); - params.put("pet", pet); - params.put("master", master); - messageTo(pet, "handleAddMaster", params, 1, false); - - sendSystemMessageTestingOnly(master, creatureName + " Issued and Stored on Your Datapad."); - - return true; - } - - sendSystemMessage( master, pet_lib.SID_SYS_TOO_MANY_STORED_PETS ); - - return false; - } - - - public void handleShipOption(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - - refreshMenu ( player, "Select the desired ship option", "Character Builder Terminal", SHIP_OPTIONS, "handleShipOptions", false); - } - - - public int handleShipOptions(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > SHIP_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String prompt = "Select the desired option"; - String title = "Character Builder Terminal"; - int pid = 0; - - switch(idx) - { - - case 0: - refreshMenu ( player, prompt, title, REBEL_SHIP_OPTIONS, "handleRebelShipSelect", false); - break; - case 1: - refreshMenu ( player, prompt, title, IMPERIAL_SHIP_OPTIONS, "handleImperialShipSelect", false); - break; - case 2: - refreshMenu ( player, prompt, title, FREELANCE_SHIP_OPTIONS, "handleFreelanceShipSelect", false); - break; - case 3: - refreshMenu ( player, prompt, title, OTHER_SHIP_OPTIONS, "handleOtherShipSelect", false); - break; - case 4: - refreshMenu ( player, prompt, title, MAIN_SHIP_OPTIONS, "handlePartShipSelect", false); - break; - case 5: - if (isGod(player)) - { - refreshMenu(player, prompt, title, PILOT_SKILLS, "handlePilotSkillSelect", false); - } - else - { - sendSystemMessageTestingOnly(player, "This Option is Currently Disabled."); - cleanScriptVars(player); - } - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - return SCRIPT_CONTINUE; - } - - - public boolean revokePilotingSkills(obj_id player) throws InterruptedException - { - if (hasSkill(player, "pilot_rebel_navy_novice") || hasSkill(player, "pilot_imperial_navy_novice") || hasSkill(player, "pilot_neutral_novice")) - { - String pilotFaction = ""; - - if (!utils.hasScriptVar(player, "revokePilotSkill")) - { - utils.setScriptVar(player, "revokePilotSkill", 1); - } - - if (hasSkill(player, "pilot_rebel_navy_novice")) - { - pilotFaction = "rebel_navy"; - } - else if (hasSkill(player, "pilot_imperial_navy_novice")) - { - pilotFaction = "imperial_navy"; - } - else if (hasSkill(player, "pilot_neutral_novice")) - { - pilotFaction = "neutral"; - } - - if (!pilotFaction.equals("")) - { - for (int i = 0; i < space_skill.SKILL_NAMES.length; i++) - { - testAbortScript(); - - skill.revokeSkill(player, "pilot_"+ pilotFaction + space_skill.SKILL_NAMES[i]); - } - - utils.removeScriptVar(player, "revokePilotSkill"); - sendSystemMessageTestingOnly(player, "Pilot Skills Revoked."); - return true; - } - } - return false; - } - - - public void handlePilotSkillSelect(obj_id player) throws InterruptedException - { - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, PILOT_SKILLS, "handlePilotSkillSelect", false); - } - - - public int handlePilotSkillSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipMenuSelect(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > PILOT_SKILLS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - boolean pilotRevoked = true; - - if (space_skill.hasSpaceSkills(player)) - { - pilotRevoked = revokePilotingSkills(player); - } - - if (!pilotRevoked) - { - sendSystemMessageTestingOnly(player, "The system was unable to revoke your pilot skills."); - return SCRIPT_OVERRIDE; - } - - if (idx == 0) - { - skill.grantSkill(player, "pilot_imperial_navy_novice"); - skill.grantSkill(player, "pilot_imperial_navy_starships_01"); - skill.grantSkill(player, "pilot_imperial_navy_starships_02"); - skill.grantSkill(player, "pilot_imperial_navy_starships_03"); - skill.grantSkill(player, "pilot_imperial_navy_starships_04"); - skill.grantSkill(player, "pilot_imperial_navy_weapons_01"); - skill.grantSkill(player, "pilot_imperial_navy_weapons_02"); - skill.grantSkill(player, "pilot_imperial_navy_weapons_03"); - skill.grantSkill(player, "pilot_imperial_navy_weapons_04"); - skill.grantSkill(player, "pilot_imperial_navy_procedures_01"); - skill.grantSkill(player, "pilot_imperial_navy_procedures_02"); - skill.grantSkill(player, "pilot_imperial_navy_procedures_03"); - skill.grantSkill(player, "pilot_imperial_navy_procedures_04"); - skill.grantSkill(player, "pilot_imperial_navy_droid_01"); - skill.grantSkill(player, "pilot_imperial_navy_droid_02"); - skill.grantSkill(player, "pilot_imperial_navy_droid_03"); - skill.grantSkill(player, "pilot_imperial_navy_droid_04"); - skill.grantSkill(player, "pilot_imperial_navy_master"); - sendSystemMessageTestingOnly(player, "Master Imperial Pilot skills received."); - } - else if (idx == 1) - { - skill.grantSkill(player, "pilot_rebel_navy_novice"); - skill.grantSkill(player, "pilot_rebel_navy_starships_01"); - skill.grantSkill(player, "pilot_rebel_navy_starships_02"); - skill.grantSkill(player, "pilot_rebel_navy_starships_03"); - skill.grantSkill(player, "pilot_rebel_navy_starships_04"); - skill.grantSkill(player, "pilot_rebel_navy_weapons_01"); - skill.grantSkill(player, "pilot_rebel_navy_weapons_02"); - skill.grantSkill(player, "pilot_rebel_navy_weapons_03"); - skill.grantSkill(player, "pilot_rebel_navy_weapons_04"); - skill.grantSkill(player, "pilot_rebel_navy_procedures_01"); - skill.grantSkill(player, "pilot_rebel_navy_procedures_02"); - skill.grantSkill(player, "pilot_rebel_navy_procedures_03"); - skill.grantSkill(player, "pilot_rebel_navy_procedures_04"); - skill.grantSkill(player, "pilot_rebel_navy_droid_01"); - skill.grantSkill(player, "pilot_rebel_navy_droid_02"); - skill.grantSkill(player, "pilot_rebel_navy_droid_03"); - skill.grantSkill(player, "pilot_rebel_navy_droid_04"); - skill.grantSkill(player, "pilot_rebel_navy_master"); - sendSystemMessageTestingOnly(player, "Master Rebel Pilot skills received."); - } - else if (idx == 2) - { - skill.grantSkill(player, "pilot_neutral_novice"); - skill.grantSkill(player, "pilot_neutral_starships_01"); - skill.grantSkill(player, "pilot_neutral_starships_02"); - skill.grantSkill(player, "pilot_neutral_starships_03"); - skill.grantSkill(player, "pilot_neutral_starships_04"); - skill.grantSkill(player, "pilot_neutral_weapons_01"); - skill.grantSkill(player, "pilot_neutral_weapons_02"); - skill.grantSkill(player, "pilot_neutral_weapons_03"); - skill.grantSkill(player, "pilot_neutral_weapons_04"); - skill.grantSkill(player, "pilot_neutral_procedures_01"); - skill.grantSkill(player, "pilot_neutral_procedures_02"); - skill.grantSkill(player, "pilot_neutral_procedures_03"); - skill.grantSkill(player, "pilot_neutral_procedures_04"); - skill.grantSkill(player, "pilot_neutral_droid_01"); - skill.grantSkill(player, "pilot_neutral_droid_02"); - skill.grantSkill(player, "pilot_neutral_droid_03"); - skill.grantSkill(player, "pilot_neutral_droid_04"); - skill.grantSkill(player, "pilot_neutral_master"); - sendSystemMessageTestingOnly(player, "Master Privateer Pilot skills received."); - } - - handlePilotSkillSelect(player); - return SCRIPT_CONTINUE; - } - - - public int handleRebelShipSelect(obj_id self, dictionary params) throws InterruptedException - { - handleShipSelect(params, REBEL_SHIP_OPTIONS, REBEL_SHIP_TYPES, "handleRebelShipSelect"); - return SCRIPT_CONTINUE; - } - - - public int handleImperialShipSelect(obj_id self, dictionary params) throws InterruptedException - { - handleShipSelect(params, IMPERIAL_SHIP_OPTIONS, IMPERIAL_SHIP_TYPES, "handleImperialShipSelect"); - return SCRIPT_CONTINUE; - } - - - public int handleFreelanceShipSelect(obj_id self, dictionary params) throws InterruptedException - { - handleShipSelect(params, FREELANCE_SHIP_OPTIONS, FREELANCE_SHIP_TYPES, "handleFreelanceShipSelect"); - return SCRIPT_CONTINUE; - } - - - public int handleOtherShipSelect(obj_id self, dictionary params) throws InterruptedException - { - handleShipSelect(params, OTHER_SHIP_OPTIONS, OTHER_SHIP_TYPES, "handleOtherShipSelect"); - return SCRIPT_CONTINUE; - } - - - public void handleShipSelect(dictionary params, String[] options, String[] types, String message) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return; - } - - obj_id player = sui.getPlayerId(params); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipOption(player); - return; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return; - } - - if (idx == -1 || idx > options.length) - { - cleanScriptVars(player); - return; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return; - } - - if (space_transition.isPlayerBelowShipLimit(player)) - { - obj_id shipId = space_utils.createShipControlDevice(player, types[idx], false); - if (isIdValid(shipId)) - { - sendSystemMessageTestingOnly(player, "Created ship ("+ options[idx] + ") in datapad."); - } - else - { - sendSystemMessageTestingOnly(player, "Failed to create ship."); - } - } - else - { - sendSystemMessageTestingOnly(player, "Failed to create ship. No room in datapad."); - } - - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", options, message, false); - } - - - public void handleShipMenuSelect(obj_id player) throws InterruptedException - { - - refreshMenu ( player, "Select the desired deed option", "Character Builder Terminal", MAIN_SHIP_OPTIONS, "handleShipMenuSelect", false); - } - - - public int handleShipMenuSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > MAIN_SHIP_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, SPACE_LOOT_CATEGORIES, "handleShipComponentSelection", false); - break; - case 1: - String[] shipChassisArray = dataTableGetStringColumn(SHIP_CHASSIS_TBL, "name");; - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, shipChassisArray, "handleShipChasisSelection", false); - break; - case 2: - static_item.createNewItemFunction("item_gunship_imperial_schematic",pInv); - static_item.createNewItemFunction("item_gunship_rebel_schematic",pInv); - static_item.createNewItemFunction("item_gunship_neutral_schematic",pInv); - sendSystemMessageTestingOnly(player, "Gunship Schematics Issued."); - handleShipMenuSelect(player); - break; - case 3: - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, COLLECTION_COMPONENT_SCHEMS, "handleCollectionComponentSelect", false); - break; - case 4: - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, PILOT_SKILLS, "handlePilotSkillSelect", false); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } - - - public void handleCollectionComponentSelect(obj_id player) throws InterruptedException - { - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, COLLECTION_COMPONENT_SCHEMS, "handleCollectionComponentSelect", false); - } - - - public int handleCollectionComponentSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipMenuSelect(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - int dataTableLength = dataTableGetNumRows(SHIP_CHASSIS_TBL); - if (idx == -1 || idx > dataTableLength) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - switch(idx) - { - case 0: - static_item.createNewItemFunction("item_collection_reward_booster_01_mk5_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_booster_01_mk4_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_booster_01_mk3_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_booster_01_mk2_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_booster_01_mk1_schematic",pInv); - sendSystemMessageTestingOnly(player, "Component Schematics Issued."); - handleCollectionComponentSelect(player); - break; - case 1: - static_item.createNewItemFunction("item_collection_reward_capacitor_01_mk5_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_capacitor_01_mk4_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_capacitor_01_mk3_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_capacitor_01_mk2_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_capacitor_01_mk1_schematic",pInv); - sendSystemMessageTestingOnly(player, "Component Schematics Issued."); - handleCollectionComponentSelect(player); - break; - case 2: - static_item.createNewItemFunction("item_collection_reward_engine_01_mk5_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_engine_01_mk4_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_engine_01_mk3_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_engine_01_mk2_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_engine_01_mk1_schematic",pInv); - sendSystemMessageTestingOnly(player, "Component Schematics Issued."); - handleCollectionComponentSelect(player); - break; - case 3: - static_item.createNewItemFunction("item_collection_reward_reactor_01_mk5_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_reactor_01_mk4_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_reactor_01_mk3_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_reactor_01_mk2_schematic",pInv); - static_item.createNewItemFunction("item_collection_reward_reactor_01_mk1_schematic",pInv); - sendSystemMessageTestingOnly(player, "Component Schematics Issued."); - handleCollectionComponentSelect(player); - break; - case 4: - static_item.createNewItemFunction("item_reward_orion_engine_schematic_01_01",pInv); - static_item.createNewItemFunction("item_reward_nova_engine_schematic_01_01",pInv); - sendSystemMessageTestingOnly(player, "Component Schematics Issued."); - handleCollectionComponentSelect(player); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - handleCollectionComponentSelect(player); - return SCRIPT_CONTINUE; - } - - - public void handleShipChasisSelection(obj_id player) throws InterruptedException - { - String[] shipChassisArray = dataTableGetStringColumn(SHIP_CHASSIS_TBL, "name");; - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, shipChassisArray, "handleShipChasisSelection", false); - } - - - public int handleShipChasisSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipMenuSelect(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - int dataTableLength = dataTableGetNumRows(SHIP_CHASSIS_TBL); - if (idx == -1 || idx > dataTableLength) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - issueShipChassis(player, idx); - - handleShipChasisSelection(player); - return SCRIPT_CONTINUE; - } - - - public void handleShipComponentSelection(obj_id player) throws InterruptedException - { - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, SPACE_LOOT_CATEGORIES, "handleShipComponentSelection", false); - } - - - public int handleShipComponentSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipMenuSelect(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > SPACE_LOOT_CATEGORIES.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - switch(idx) - { - case 0: - String armorMenuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_ARMOR_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, armorMenuArray, "handleShipComponentArmorSelection", false); - break; - case 1: - String boosterMenuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_BOOSTER_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, boosterMenuArray, "handleShipComponentBoosterSelection", false); - break; - case 2: - String droidInterfaceMenuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_DROIDINTERFACE_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, droidInterfaceMenuArray, "handleShipComponentDroidInterfaceSelection", false); - break; - case 3: - String engineMenuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_ENGINE_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, engineMenuArray, "handleShipComponentEngineSelection", false); - break; - case 4: - String reactorMenuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_REACTOR_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, reactorMenuArray, "handleShipComponentReactorSelection", false); - break; - case 5: - String shieldMenuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_SHIELD_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, shieldMenuArray, "handleShipComponentShieldSelection", false); - break; - case 6: - String weaponMenuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_WEAPON_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, weaponMenuArray, "handleShipComponentWeaponSelection", false); - break; - case 7: - String capacitorMenuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_CAPACITOR_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, capacitorMenuArray, "handleShipComponentCapacitorSelection", false); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } - - - public void handleShipComponentArmorSelection(obj_id player) throws InterruptedException - { - String armorMenuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_ARMOR_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, armorMenuArray, "handleShipComponentArmorSelection", false); - } - - - public int handleShipComponentArmorSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipComponentSelection(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - int dataTableLength = dataTableGetNumRows(SHIPCOMPONENT_ARMOR_TBL); - if (idx == -1 || idx > dataTableLength) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - String objString = dataTableGetString(SHIPCOMPONENT_ARMOR_TBL, idx, "strType"); - obj_id objectOID = createObject(objString, pInv, ""); - - if (!isIdValid(objectOID)) - { - sendSystemMessage(player, "The component could not be created", null); - return SCRIPT_CONTINUE; - } - - tweakSpaceShipComponent(objectOID); - - handleShipComponentArmorSelection(player); - return SCRIPT_CONTINUE; - } - - - public void handleShipComponentBoosterSelection(obj_id player) throws InterruptedException - { - String boosterMenuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_BOOSTER_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, boosterMenuArray, "handleShipComponentBoosterSelection", false); - } - - - public int handleShipComponentBoosterSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipComponentSelection(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - int dataTableLength = dataTableGetNumRows(SHIPCOMPONENT_BOOSTER_TBL); - if (idx == -1 || idx > dataTableLength) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - String objectString = dataTableGetString(SHIPCOMPONENT_BOOSTER_TBL, idx, "strType"); - obj_id objectOID = createObject(objectString, pInv, ""); - - if (!isIdValid(objectOID)) - { - sendSystemMessage(player, "The component could not be created", null); - return SCRIPT_CONTINUE; - } - - tweakSpaceShipComponent(objectOID); - - handleShipComponentBoosterSelection(player); - return SCRIPT_CONTINUE; - } - - - public void handleShipComponentCapacitorSelection(obj_id player) throws InterruptedException - { - String menuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_CAPACITOR_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, menuArray, "handleShipComponentCapacitorSelection", false); - } - - - public int handleShipComponentCapacitorSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipComponentSelection(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - int dataTableLength = dataTableGetNumRows(SHIPCOMPONENT_CAPACITOR_TBL); - if (idx == -1 || idx > dataTableLength) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - String objectString = dataTableGetString(SHIPCOMPONENT_CAPACITOR_TBL, idx, "strType"); - obj_id objectOID = createObject(objectString, pInv, ""); - - if (!isIdValid(objectOID)) - { - sendSystemMessage(player, "The component could not be created", null); - return SCRIPT_CONTINUE; - } - - tweakSpaceShipComponent(objectOID); - - handleShipComponentCapacitorSelection(player); - return SCRIPT_CONTINUE; - } - - - public void handleShipComponentDroidInterfaceSelection(obj_id player) throws InterruptedException - { - String menuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_DROIDINTERFACE_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, menuArray, "handleShipComponentDroidInterfaceSelection", false); - } - - - public int handleShipComponentDroidInterfaceSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipComponentSelection(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - int dataTableLength = dataTableGetNumRows(SHIPCOMPONENT_DROIDINTERFACE_TBL); - if (idx == -1 || idx > dataTableLength) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - String objectString = dataTableGetString(SHIPCOMPONENT_DROIDINTERFACE_TBL, idx, "strType"); - obj_id objectOID = createObject(objectString, pInv, ""); - - if (!isIdValid(objectOID)) - { - sendSystemMessage(player, "The component could not be created", null); - return SCRIPT_CONTINUE; - } - - tweakSpaceShipComponent(objectOID); - - handleShipComponentDroidInterfaceSelection(player); - return SCRIPT_CONTINUE; - } - - - public void handleShipComponentEngineSelection(obj_id player) throws InterruptedException - { - String menuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_ENGINE_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, menuArray, "handleShipComponentEngineSelection", false); - } - - - public int handleShipComponentEngineSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipComponentSelection(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - int dataTableLength = dataTableGetNumRows(SHIPCOMPONENT_ENGINE_TBL); - if (idx == -1 || idx > dataTableLength) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - String objectString = dataTableGetString(SHIPCOMPONENT_ENGINE_TBL, idx, "strType"); - obj_id objectOID = createObject(objectString, pInv, ""); - - if (!isIdValid(objectOID)) - { - sendSystemMessage(player, "The component could not be created", null); - return SCRIPT_CONTINUE; - } - - tweakSpaceShipComponent(objectOID); - - handleShipComponentEngineSelection(player); - return SCRIPT_CONTINUE; - } - - - public void handleShipComponentReactorSelection(obj_id player) throws InterruptedException - { - String menuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_REACTOR_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, menuArray, "handleShipComponentReactorSelection", false); - } - - - public int handleShipComponentReactorSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipComponentSelection(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - int dataTableLength = dataTableGetNumRows(SHIPCOMPONENT_REACTOR_TBL); - if (idx == -1 || idx > dataTableLength) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - String objectString = dataTableGetString(SHIPCOMPONENT_REACTOR_TBL, idx, "strType"); - obj_id objectOID = createObject(objectString, pInv, ""); - - if (!isIdValid(objectOID)) - { - sendSystemMessage(player, "The component could not be created", null); - return SCRIPT_CONTINUE; - } - - tweakSpaceShipComponent(objectOID); - - handleShipComponentReactorSelection(player); - return SCRIPT_CONTINUE; - } - - - public void handleShipComponentShieldSelection(obj_id player) throws InterruptedException - { - String menuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_SHIELD_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, menuArray, "handleShipComponentShieldSelection", false); - } - - - public int handleShipComponentShieldSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipComponentSelection(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - int dataTableLength = dataTableGetNumRows(SHIPCOMPONENT_SHIELD_TBL); - if (idx == -1 || idx > dataTableLength) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - String objectString = dataTableGetString(SHIPCOMPONENT_SHIELD_TBL, idx, "strType"); - obj_id objectOID = createObject(objectString, pInv, ""); - - if (!isIdValid(objectOID)) - { - sendSystemMessage(player, "The component could not be created", null); - return SCRIPT_CONTINUE; - } - - tweakSpaceShipComponent(objectOID); - - handleShipComponentShieldSelection(player); - return SCRIPT_CONTINUE; - } - - public void handleShipComponentWeaponSelection(obj_id player) throws InterruptedException - { - String menuArray[] = dataTableGetStringColumn(SHIPCOMPONENT_WEAPON_TBL, "strName"); - refreshMenu(player, GENERIC_PROMPT, GENERIC_TITLE, menuArray, "handleShipComponentWeaponSelection", false); - } - - - public int handleShipComponentWeaponSelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleShipComponentSelection(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - int dataTableLength = dataTableGetNumRows(SHIPCOMPONENT_WEAPON_TBL); - if (idx == -1 || idx > dataTableLength) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - String objectString = dataTableGetString(SHIPCOMPONENT_WEAPON_TBL, idx, "strType"); - obj_id objectOID = createObject(objectString, pInv, ""); - - if (!isIdValid(objectOID)) - { - sendSystemMessage(player, "The component could not be created", null); - return SCRIPT_CONTINUE; - } - - tweakSpaceShipComponent(objectOID); - - handleShipComponentWeaponSelection(player); - return SCRIPT_CONTINUE; - } - - - public void handleDeedOption(obj_id player) throws InterruptedException - { - - refreshMenu ( player, "Select the desired deed option", "Character Builder Terminal", DEED_OPTIONS, "handleDeedSelect", false); - } - - - public int handleDeedSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > DEED_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - createObject("object/tangible/deed/factory_deed/clothing_factory_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Clothing Factory Deed Issued."); - break; - case 1: - createObject("object/tangible/deed/factory_deed/food_factory_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Food Factory Deed Issued."); - break; - case 2: - createObject("object/tangible/deed/factory_deed/item_factory_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Item Factory Deed Issued."); - break; - case 3: - createObject("object/tangible/deed/factory_deed/structure_factory_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Structure Factory Deed Issued."); - break; - case 4: - createObject("object/tangible/deed/player_house_deed/generic_house_small_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Generic House Deed Issued."); - break; - case 5: - createObject("object/tangible/deed/player_house_deed/tatooine_house_small_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Small Tatooine House Deed Issued."); - break; - case 6: - createObject("object/tangible/deed/player_house_deed/naboo_house_small_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Small Naboo House Deed Issued."); - break; - case 7: - createObject("object/tangible/deed/player_house_deed/corellia_house_small_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Small Corellia House Deed Issued."); - break; - case 8: - createObject("object/tangible/deed/player_house_deed/merchant_tent_style_03_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Merchant Tent Deed Issued."); - break; - case 9: - obj_id mineral = createObject("object/tangible/deed/harvester_deed/ore_harvester_heavy_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Heavy Mineral Harvester Issued."); - if (isIdValid(mineral)) - { - setObjVar (mineral, "player_structure.deed.maxExtractionRate", 13); - setObjVar (mineral, "player_structure.deed.currentExtractionRate", 13); - } - break; - case 10: - obj_id flora = createObject("object/tangible/deed/harvester_deed/flora_harvester_deed_heavy.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Heavy Flora Harvester Issued."); - if (isIdValid(flora)) - { - setObjVar (flora, "player_structure.deed.maxExtractionRate", 13); - setObjVar (flora, "player_structure.deed.currentExtractionRate", 13); - } - break; - case 11: - obj_id gas = createObject("object/tangible/deed/harvester_deed/gas_harvester_deed_heavy.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Heavy Gas Harvester Issued."); - if (isIdValid(gas)) - { - setObjVar (gas, "player_structure.deed.maxExtractionRate", 13); - setObjVar (gas, "player_structure.deed.currentExtractionRate", 13); - } - break; - case 12: - obj_id chemical = createObject("object/tangible/deed/harvester_deed/liquid_harvester_deed_heavy.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Heavy Chemical Harvester Issued."); - if (isIdValid(chemical)) - { - setObjVar (chemical, "player_structure.deed.maxExtractionRate", 13); - setObjVar (chemical, "player_structure.deed.currentExtractionRate", 13); - } - break; - case 13: - obj_id moisture = createObject("object/tangible/deed/harvester_deed/moisture_harvester_deed_heavy.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Heavy Moisture Vaporator Issued."); - if (isIdValid(moisture)) - { - setObjVar (moisture, "player_structure.deed.maxExtractionRate", 13); - setObjVar (moisture, "player_structure.deed.currentExtractionRate", 13); - } - break; - case 14: - obj_id fusion = createObject("object/tangible/deed/generator_deed/power_generator_fusion_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Fusion Reactor Issued."); - if (isIdValid(fusion)) - { - setObjVar (fusion, "player_structure.deed.maxExtractionRate", 16); - setObjVar (fusion, "player_structure.deed.currentExtractionRate", 16); - } - break; - case 15: - createObject("object/tangible/deed/city_deed/cityhall_corellia_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/cloning_corellia_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/bank_corellia_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garage_corellia_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garden_corellia_lrg_01_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garden_corellia_med_01_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garden_corellia_sml_01_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Corellia City Pack Created"); - break; - case 16: - createObject("object/tangible/deed/city_deed/cityhall_naboo_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/cloning_naboo_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/bank_naboo_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garage_naboo_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garden_naboo_lrg_01_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garden_naboo_med_01_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garden_naboo_sml_01_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Naboo City Pack Created"); - break; - case 17: - createObject("object/tangible/deed/city_deed/cityhall_tatooine_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/cloning_tatooine_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/bank_tatooine_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garage_tatooine_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garden_tatooine_lrg_01_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garden_tatooine_med_01_deed.iff", pInv, ""); - createObject("object/tangible/deed/city_deed/garden_tatooine_sml_01_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Tatooine City Pack Created"); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - handleDeedOption(player); - return SCRIPT_CONTINUE; - } - - - public void handleCraftingOption(obj_id player) throws InterruptedException - { - - refreshMenu ( player, "Select the desired deed option", "Character Builder Terminal", CRAFTING_OPTIONS, "handleCraftingSelect", false); - } - - - public int handleCraftingSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > CRAFTING_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - createObject("object/tangible/crafting/station/weapon_station.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Weapon Crafting Station Issued."); - break; - case 1: - createObject("object/tangible/crafting/station/structure_station.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Structure Crafting Station Issued."); - break; - case 2: - createObject("object/tangible/crafting/station/clothing_station.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Clothing Crafting Station Issued."); - break; - case 3: - createObject("object/tangible/crafting/station/food_station.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Food Crafting Station Issued."); - break; - case 4: - createObject("object/tangible/crafting/station/generic_tool.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Generic Crafting Tool Issued."); - break; - case 5: - createObject("object/tangible/crafting/station/weapon_tool.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Weapon Crafting Tool Issued."); - break; - case 6: - createObject("object/tangible/crafting/station/structure_tool.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Structure Crafting Tool Issued."); - break; - case 7: - createObject("object/tangible/crafting/station/clothing_tool.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Clothing Crafting Tool Issued."); - break; - case 8: - createObject("object/tangible/crafting/station/food_tool.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Food Crafting Tool Issued."); - break; - case 9: - createObject("object/tangible/crafting/station/space_tool.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Ship Crafting Tool Issued."); - break; - case 10: - createObject("object/tangible/crafting/station/space_station.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Ship Crafting Station Issued."); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - handleCraftingOption(player); - return SCRIPT_CONTINUE; - - } - - - public void handlePAOption(obj_id player) throws InterruptedException - { - refreshMenu ( player, "Select the desired deed option", "Character Builder Terminal", PA_OPTIONS, "handlePASelect", false); - } - - - public int handlePASelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > PA_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - createObject("object/tangible/deed/guild_deed/generic_guild_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Generic PA Hall Deed Issued."); - break; - case 1: - createObject("object/tangible/deed/guild_deed/tatooine_guild_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Tatooine PA Hall Deed Issued."); - break; - case 2: - createObject("object/tangible/deed/guild_deed/naboo_guild_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Naboo PA Hall Deed Issued."); - break; - case 3: - createObject("object/tangible/deed/guild_deed/corellia_guild_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Corellia PA Hall Deed Issued."); - break; - case 4: - createObject("object/tangible/deed/city_deed/cityhall_tatooine_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Tatooine City Hall Deed Issued."); - break; - case 5: - createObject("object/tangible/deed/city_deed/cityhall_naboo_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Naboo City Hall Deed Issued."); - break; - case 6: - createObject("object/tangible/deed/city_deed/cityhall_corellia_deed.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Corellia City Hall Deed Issued."); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - handlePAOption(player); - return SCRIPT_CONTINUE; - } - - - public void handleWeaponOption(obj_id player) throws InterruptedException - { - - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - - } - - public int handleWeaponOptions(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired character option", "Character Builder Terminal", CHARACTER_BUILDER_OPTIONS, "handleOptionSelect", true); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > WEAPON_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - - case 0: - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", PISTOL_OPTIONS, "handlePistolSelect", false); - break; - case 1: - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", CARBINE_OPTIONS, "handleCarbineSelect", false); - break; - case 2: - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", RIFLE_OPTIONS, "handleRifleSelect", false); - break; - case 3: - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", HEAVY_WEAPON_OPTIONS, "handleHeavySelect", false); - break; - case 4: - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", UNARMED_OPTIONS, "handleUnarmedSelect", false); - break; - case 5: - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", ONEHANDED_OPTIONS, "handleOneHandedSelect", false); - break; - case 6: - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", TWOHANDED_OPTIONS, "handleTwoHandedSelect", false); - break; - case 7: - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", POLEARM_OPTIONS, "handlePolearmSelect", false); - break; - case 8: - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", BATTLEFIELD_WEAPON_OPTIONS, "handleBattlefieldSelect", false); - break; - - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - return SCRIPT_CONTINUE; - } - - public int handlePistolSelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > PISTOL_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String weapon = ""; - - switch(idx) - { - case 0: - weapon = "object/weapon/ranged/pistol/pistol_cdef.iff"; - break; - case 1: - weapon = "object/weapon/ranged/pistol/pistol_scout_blaster.iff"; - break; - case 2: - weapon = "object/weapon/ranged/pistol/pistol_geonosian_sonic_blaster_loot.iff"; - break; - case 3: - weapon = "object/weapon/ranged/pistol/pistol_republic_blaster.iff"; - break; - case 4: - weapon = "object/weapon/ranged/pistol/pistol_launcher.iff"; - break; - case 5: - weapon = "object/weapon/ranged/pistol/pistol_scatter.iff"; - break; - case 6: - weapon = "object/weapon/ranged/pistol/pistol_scatter_light.iff"; - break; - case 7: - weapon = "object/weapon/ranged/pistol/pistol_srcombat.iff"; - break; - case 8: - weapon = "object/weapon/ranged/pistol/pistol_striker.iff"; - break; - case 9: - weapon = "object/weapon/ranged/pistol/pistol_tangle.iff"; - break; - case 10: - weapon = "object/weapon/ranged/pistol/pistol_power5.iff"; - break; - case 11: - weapon = "object/weapon/ranged/pistol/pistol_fwg5.iff"; - break; - case 12: - weapon = "object/weapon/ranged/pistol/pistol_dx2.iff"; - break; - case 13: - weapon = "object/weapon/ranged/pistol/pistol_dl44_metal.iff"; - break; - case 14: - weapon = "object/weapon/ranged/pistol/pistol_dl44.iff"; - break; - case 15: - weapon = "object/weapon/ranged/pistol/pistol_dh17.iff"; - break; - case 16: - weapon = "object/weapon/ranged/pistol/pistol_d18.iff"; - break; - case 17: - weapon = "object/weapon/ranged/pistol/pistol_alliance_disruptor.iff"; - break; - case 18: - weapon = "object/weapon/ranged/pistol/pistol_deathhammer.iff"; - break; - case 19: - weapon = "object/weapon/ranged/pistol/pistol_flare.iff"; - break; - case 20: - weapon = "object/weapon/ranged/pistol/pistol_flechette.iff"; - break; - case 21: - weapon = "object/weapon/ranged/pistol/pistol_intimidator.iff"; - break; - case 22: - weapon = "object/weapon/ranged/pistol/pistol_jawa.iff"; - break; - case 23: - weapon = "object/weapon/ranged/pistol/pistol_renegade.iff"; - break; - case 24: - weapon = "object/weapon/ranged/pistol/pistol_de_10.iff"; - break; - case 25: - weapon = "object/weapon/ranged/pistol/pistol_dl44_metal_light.iff"; - break; - case 26: - weapon = "object/weapon/ranged/pistol/som_disruptor_pistol.iff"; - break; - case 27: - weapon = "object/weapon/ranged/pistol/som_ion_relic_pistol.iff"; - break; - case 28: - weapon = "object/weapon/ranged/pistol/pistol_heroic_sd.iff"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (weapon != null && !weapon.equals("")) - { - createSnowFlakeFrogWeapon(player, weapon); - } - - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", PISTOL_OPTIONS, "handlePistolSelect", false); - return SCRIPT_CONTINUE; - } - - public int handleCarbineSelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > CARBINE_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String weapon = ""; - - switch(idx) - { - case 0: - weapon = "object/weapon/ranged/carbine/carbine_cdef.iff"; - break; - case 1: - weapon = "object/weapon/ranged/carbine/carbine_dh17.iff"; - break; - case 2: - weapon = "object/weapon/ranged/carbine/carbine_dh17_snubnose.iff"; - break; - case 3: - weapon = "object/weapon/ranged/carbine/carbine_e11.iff"; - break; - case 4: - weapon = "object/weapon/ranged/carbine/carbine_e11_mark2.iff"; - break; - case 5: - weapon = "object/weapon/ranged/carbine/carbine_laser.iff"; - break; - case 6: - weapon = "object/weapon/ranged/carbine/carbine_dxr6.iff"; - break; - case 7: - weapon = "object/weapon/ranged/carbine/carbine_ee3.iff"; - break; - case 8: - weapon = "object/weapon/ranged/carbine/carbine_elite.iff"; - break; - case 9: - weapon = "object/weapon/ranged/carbine/carbine_nym_slugthrower.iff"; - break; - case 10: - weapon = "object/weapon/ranged/carbine/carbine_alliance_needler.iff"; - break; - case 11: - weapon = "object/weapon/ranged/carbine/carbine_bothan_bola.iff"; - break; - case 12: - weapon ="object/weapon/ranged/carbine/carbine_e5.iff"; - break; - case 13: - weapon = "object/weapon/ranged/carbine/carbine_geo.iff"; - break; - case 14: - weapon = "object/weapon/ranged/carbine/carbine_proton.iff"; - break; - case 15: - weapon = "object/weapon/ranged/carbine/carbine_czerka_dart.iff"; - break; - case 16: - weapon = "object/weapon/ranged/carbine/som_carbine_republic_sfor.iff"; - break; - case 17: - weapon = "object/weapon/ranged/carbine/carbine_heroic_sd.iff"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (weapon != null && !weapon.equals("")) - { - createSnowFlakeFrogWeapon(player, weapon); - } - - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", CARBINE_OPTIONS, "handleCarbineSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleRifleSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > RIFLE_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String weapon = ""; - - switch(idx) - { - case 0: - weapon = "item_outbreak_deathrooper_rifle"; - break; - case 1: - weapon = "weapon_gcw_tc22_rifle_03_01"; - break; - case 2: - weapon = "weapon_jinkins_j1_01_01"; - break; - case 3: - weapon = "object/weapon/ranged/rifle/rifle_cdef.iff"; - break; - case 4: - weapon = "object/weapon/ranged/rifle/rifle_dlt20.iff"; - break; - case 5: - weapon = "object/weapon/ranged/rifle/rifle_dlt20a.iff"; - break; - case 6: - weapon = "object/weapon/ranged/rifle/rifle_tusken.iff"; - break; - case 7: - weapon = "object/weapon/ranged/rifle/rifle_laser.iff"; - break; - case 8: - weapon = "object/weapon/ranged/rifle/rifle_sg82.iff"; - break; - case 9: - weapon = "object/weapon/ranged/rifle/rifle_spraystick.iff"; - break; - case 10: - weapon = "object/weapon/ranged/rifle/rifle_e11.iff"; - break; - case 11: - weapon = "object/weapon/ranged/rifle/rifle_jawa_ion.iff"; - break; - case 12: - weapon = "object/weapon/ranged/rifle/rifle_t21.iff"; - break; - case 13: - weapon = "object/weapon/ranged/rifle/rifle_tenloss_dxr6_disruptor_loot.iff"; - break; - case 14: - weapon = "object/weapon/ranged/rifle/rifle_berserker.iff"; - break; - case 15: - weapon = "object/weapon/ranged/rifle/rifle_bowcaster.iff"; - break; - case 16: - weapon = "object/weapon/ranged/rifle/rifle_bowcaster_medium.iff"; - break; - case 17: - weapon = "object/weapon/ranged/rifle/rifle_bowcaster_heavy.iff"; - break; - case 18: - weapon = "object/weapon/ranged/rifle/rifle_beam.iff"; - break; - case 19: - weapon = "object/weapon/ranged/rifle/rifle_acid_beam.iff"; - break; - case 20: - weapon = "object/weapon/ranged/rifle/rifle_adventurer.iff"; - break; - case 21: - weapon = "object/weapon/ranged/rifle/rifle_ld1.iff"; - break; - case 22: - weapon = "object/weapon/ranged/rifle/rifle_massassi_ink.iff"; - break; - case 23: - weapon = "object/weapon/ranged/rifle/rifle_proton.iff"; - break; - case 24: - weapon = "object/weapon/ranged/rifle/rifle_lightning_light.iff"; - break; - case 25: - weapon = "object/weapon/ranged/rifle/rifle_laser_light.iff"; - break; - case 26: - weapon = "object/weapon/ranged/rifle/rifle_lightning_heavy.iff"; - break; - case 27: - weapon = "object/weapon/ranged/rifle/som_rifle_dp23.iff"; - break; - case 28: - weapon = "object/weapon/ranged/rifle/som_rifle_mustafar_disruptor.iff"; - break; - case 29: - weapon = "object/weapon/ranged/rifle/rifle_tusken_elite.iff"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (weapon != null && !weapon.equals("")) - { - if (static_item.isStaticItem(weapon)) - { - static_item.createNewItemFunction(weapon, pInv); - } - else - { - createSnowFlakeFrogWeapon(player, weapon); - } - } - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", RIFLE_OPTIONS, "handleRifleSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleHeavySelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > HEAVY_WEAPON_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String weapon = ""; - - switch(idx) - { - case 0: - weapon = "object/weapon/ranged/heavy/heavy_rocket_launcher.iff"; - break; - case 1: - weapon = "object/weapon/ranged/rifle/rifle_flame_thrower.iff"; - break; - case 2: - weapon = "object/weapon/ranged/rifle/rifle_acid_beam.iff"; - break; - case 3: - weapon = "object/weapon/ranged/rifle/rifle_lightning.iff"; - break; - case 4: - weapon = "object/weapon/ranged/heavy/heavy_acid_beam.iff"; - break; - case 5: - weapon = "object/weapon/ranged/heavy/heavy_lightning_beam.iff"; - break; - case 6: - weapon = "object/weapon/ranged/heavy/heavy_particle_beam.iff"; - break; - case 7: - weapon = "object/weapon/ranged/rifle/rifle_flame_thrower_light.iff"; - break; - case 8: - weapon = "object/weapon/ranged/heavy/som_republic_flamer.iff"; - break; - case 9: - weapon = "object/weapon/ranged/heavy/som_lava_cannon.iff"; - break; - case 10: - static_item.createNewItemFunction("weapon_mandalorian_heavy_04_01",pInv); - sendSystemMessageTestingOnly(player, "Crusader M-XX Heavy Rifle Issued."); - break; - case 11: - static_item.createNewItemFunction("weapon_rebel_heavy_04_01",pInv); - sendSystemMessageTestingOnly(player, "C-M 'Frag Storm' Heavy Shotgun Issued."); - break; - case 12: - static_item.createNewItemFunction("weapon_tow_heavy_acid_beam_04_01",pInv); - sendSystemMessageTestingOnly(player, "Devastator Acid Launcher Issued."); - break; - case 13: - weapon = "object/weapon/ranged/heavy/heavy_carbonite_rifle.iff"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (weapon != null && !weapon.equals("")) - { - createSnowFlakeFrogWeapon(player, weapon); - } - - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", HEAVY_WEAPON_OPTIONS, "handleHeavySelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleUnarmedSelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > UNARMED_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String weapon = ""; - - switch(idx) - { - case 0: - weapon = "object/weapon/melee/special/vibroknuckler.iff"; - break; - case 1: - weapon = "object/weapon/melee/special/massassiknuckler.iff"; - break; - case 2: - weapon = "object/weapon/melee/special/blacksun_razor.iff"; - break; - case 3: - weapon = "object/weapon/melee/special/blasterfist.iff"; - break; - - case 4: - static_item.createNewItemFunction("weapon_tow_blasterfist_04_01",pInv); - sendSystemMessageTestingOnly(player, "Guardian Blaster Fist"); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (weapon != null && !weapon.equals("")) - { - createSnowFlakeFrogWeapon(player, weapon); - } - - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", UNARMED_OPTIONS, "handleUnarmedSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleOneHandedSelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ONEHANDED_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String weapon = ""; - - switch(idx) - { - case 0: - weapon = "object/weapon/melee/knife/knife_survival.iff"; - break; - case 1: - weapon = "object/weapon/melee/knife/knife_dagger.iff"; - break; - case 2: - weapon = "object/weapon/melee/sword/sword_01.iff"; - break; - case 3: - weapon = "object/weapon/melee/sword/sword_02.iff"; - break; - case 4: - weapon = "object/weapon/melee/baton/baton_gaderiffi.iff"; - break; - case 5: - weapon = "object/weapon/melee/knife/knife_vibroblade.iff"; - break; - case 6: - weapon = "object/weapon/melee/sword/sword_blade_ryyk.iff"; - break; - case 7: - weapon = "object/weapon/melee/sword/sword_rantok.iff"; - break; - case 8: - weapon = "object/weapon/melee/baton/baton_stun.iff"; - break; - case 9: - weapon = "object/weapon/melee/sword/sword_acid.iff"; - break; - case 10: - weapon = "object/weapon/melee/sword/sword_mace_junti.iff"; - break; - case 11: - weapon = "object/weapon/melee/sword/sword_marauder.iff"; - break; - case 12: - weapon = "object/weapon/melee/sword/sword_massassi.iff"; - break; - case 13: - weapon = "object/weapon/melee/sword/sword_rsf.iff"; - break; - case 14: - weapon = "object/weapon/melee/knife/knife_stone.iff"; - break; - case 15: - weapon = "object/weapon/melee/knife/knife_janta.iff"; - break; - case 16: - weapon = "object/weapon/melee/knife/knife_donkuwah.iff"; - break; - case 17: - weapon = "object/weapon/melee/sword/sword_curved_nyax.iff"; - break; - case 18: - weapon = "object/weapon/melee/sword/som_sword_obsidian.iff"; - break; - case 19: - weapon = "object/weapon/melee/sword/som_sword_mustafar_bandit.iff"; - break; - case 20: - weapon = "object/weapon/melee/baton/baton_gaderiffi_elite.iff"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (weapon != null && !weapon.equals("")) - { - createSnowFlakeFrogWeapon(player, weapon); - } - - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", ONEHANDED_OPTIONS, "handleOneHandedSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleTwoHandedSelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > TWOHANDED_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String weapon = ""; - - switch(idx) - { - case 0: - weapon = "object/weapon/melee/axe/axe_heavy_duty.iff"; - break; - case 1: - weapon = "object/weapon/melee/2h_sword/2h_sword_battleaxe.iff"; - break; - case 2: - weapon = "object/weapon/melee/2h_sword/2h_sword_katana.iff"; - break; - case 3: - weapon = "object/weapon/melee/axe/axe_vibroaxe.iff"; - break; - case 4: - weapon = "object/weapon/melee/2h_sword/2h_sword_cleaver.iff"; - break; - case 5: - weapon = "object/weapon/melee/2h_sword/2h_sword_maul.iff"; - break; - case 6: - weapon = "object/weapon/melee/2h_sword/2h_sword_scythe.iff"; - break; - case 7: - weapon = "object/weapon/melee/2h_sword/2h_sword_kashyyk.iff"; - break; - case 8: - weapon = "object/weapon/melee/2h_sword/2h_sword_sith.iff"; - break; - case 9: - weapon = "object/weapon/melee/sword/sword_nyax.iff"; - break; - case 10: - weapon = "object/weapon/melee/2h_sword/2h_sword_blacksun_hack.iff"; - break; - case 11: - weapon = "object/weapon/melee/2h_sword/som_2h_sword_tulrus.iff"; - break; - case 12: - weapon = "object/weapon/melee/2h_sword/som_2h_sword_obsidian.iff"; - break; - case 13: - weapon = "object/weapon/melee/2h_sword/2h_sword_kun_massassi.iff"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (weapon != null && !weapon.equals("")) - { - createSnowFlakeFrogWeapon(player, weapon); - } - - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", TWOHANDED_OPTIONS, "handleTwoHandedSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handlePolearmSelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > POLEARM_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String weapon = ""; - - switch(idx) - { - case 0: - weapon = "object/weapon/melee/polearm/lance_staff_wood_s1.iff"; - break; - case 1: - weapon = "object/weapon/melee/polearm/lance_staff_metal.iff"; - break; - case 2: - weapon = "object/weapon/melee/polearm/lance_staff_wood_s2.iff"; - break; - case 3: - weapon = "object/weapon/melee/polearm/lance_vibrolance.iff"; - break; - case 4: - weapon = "object/weapon/melee/polearm/polearm_vibro_axe.iff"; - break; - case 5: - weapon = "object/weapon/melee/polearm/lance_controllerfp.iff"; - break; - case 6: - weapon = "object/weapon/melee/polearm/lance_kaminoan.iff"; - break; - case 7: - weapon = "object/weapon/melee/polearm/lance_massassi.iff"; - break; - case 8: - weapon = "object/weapon/melee/polearm/lance_shock.iff"; - break; - case 9: - weapon = "object/weapon/melee/polearm/lance_cryo.iff"; - break; - case 10: - weapon = "object/weapon/melee/polearm/lance_kashyyk.iff"; - break; - case 11: - weapon = "object/weapon/melee/polearm/polearm_lance_electric_polearm.iff"; - break; - case 12: - weapon = "object/weapon/melee/polearm/lance_nightsister.iff"; - break; - case 13: - weapon = "object/weapon/melee/polearm/lance_controllerfp_nightsister.iff"; - break; - case 14: - weapon = "object/weapon/melee/polearm/som_lance_obsidian.iff"; - break; - case 15: - weapon = "object/weapon/melee/polearm/som_lance_xandank.iff"; - break; - case 16: - weapon = "object/weapon/melee/polearm/polearm_heroic_sd.iff"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (weapon != null && !weapon.equals("")) - { - createSnowFlakeFrogWeapon(player, weapon); - } - - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", POLEARM_OPTIONS, "handlePolearmSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleBattlefieldSelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > BATTLEFIELD_WEAPON_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String weapon = ""; - - switch(idx) - { - - case 0: - static_item.createNewItemFunction("weapon_westar_pistol_04_01",pInv); - sendSystemMessageTestingOnly(player, "Westar-34 Blaster Pistol Issued."); - break; - case 1: - static_item.createNewItemFunction("weapon_carbine_ngant_zarvel_04_01",pInv); - sendSystemMessageTestingOnly(player, "NGant-Zarvel 9118 Carbine Issued."); - break; - case 2: - static_item.createNewItemFunction("weapon_westar_rifle_04_01",pInv); - sendSystemMessageTestingOnly(player, "Westar-M5 Blaster Rifle Issued."); - break; - case 3: - static_item.createNewItemFunction("weapon_heavy_cr1_04_01",pInv); - sendSystemMessageTestingOnly(player, "CR-1 Blast Cannon Issued."); - break; - - case 4: - static_item.createNewItemFunction("weapon_knuckler_buzz_knuck",pInv); - sendSystemMessageTestingOnly(player, "Buzz-Knuck Issued."); - break; - case 5: - static_item.createNewItemFunction("weapon_sword_1h_pvp_04_01",pInv); - sendSystemMessageTestingOnly(player, "Sith Sword Issued."); - break; - case 6: - static_item.createNewItemFunction("weapon_sword_2h_pvp_04_01",pInv); - sendSystemMessageTestingOnly(player, "Vibrosword Issued."); - break; - case 7: - static_item.createNewItemFunction("weapon_magna_guard_polearm_04_01",pInv); - sendSystemMessageTestingOnly(player, "Magnaguard Electrostaff Issued."); - break; - case 8: - static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_01",pInv); - sendSystemMessageTestingOnly(player, "One-Handed Sith-Saber Hilt Schematic Issued."); - break; - case 9: - static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_02",pInv); - sendSystemMessageTestingOnly(player, "Two-Handed Mysterious Lightsaber Hilt Schematic Issued."); - break; - case 10: - static_item.createNewItemFunction("item_schematic_pvp_bf_saber_03_03",pInv); - sendSystemMessageTestingOnly(player, "Double-Bladed Darth Phobos Lightsaber Hilt Schematic Issued."); - break; - - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", BATTLEFIELD_WEAPON_OPTIONS, "handleBattlefieldSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleGrenadeSelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", WEAPON_OPTIONS, "handleWeaponOptions", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > GRENADE_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - obj_id item = null; - switch(idx) - { - case 0: - item = createObject("object/weapon/ranged/grenade/grenade_fragmentation_light.iff", pInv, ""); - setCount(item, 500); - sendSystemMessageTestingOnly(player, "Light Fragmentation Grenade with many charges Issued."); - break; - case 1: - item = createObject("object/weapon/ranged/grenade/grenade_fragmentation.iff", pInv, ""); - setCount(item, 500); - sendSystemMessageTestingOnly(player, "Fragmentation Grenade with many charges Issued."); - break; - case 2: - item = createObject("object/weapon/ranged/grenade/grenade_imperial_detonator.iff", pInv, ""); - setCount(item, 500); - sendSystemMessageTestingOnly(player, "Imperial Detonator with many charges Issued."); - break; - case 3: - item = createObject("object/weapon/ranged/grenade/grenade_proton.iff", pInv, ""); - setCount(item, 500); - sendSystemMessageTestingOnly(player, "Proton Grenade with many charges Issued."); - break; - case 4: - item = createObject("object/weapon/ranged/grenade/grenade_thermal_detonator.iff", pInv, ""); - setCount(item, 500); - sendSystemMessageTestingOnly(player, "Thermal Detonator with many charges Issued."); - break; - case 5: - item = createObject("object/weapon/ranged/grenade/grenade_glop.iff", pInv, ""); - setCount(item, 500); - sendSystemMessageTestingOnly(player, "Glop Grenade with many charges Issued."); - break; - case 6: - item = createObject("object/weapon/ranged/grenade/grenade_cryoban.iff", pInv, ""); - setCount(item, 500); - sendSystemMessageTestingOnly(player, "Cryoban Grenade with many charges Issued."); - break; - - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - refreshMenu (player, "Select the desired weapon option", "Character Builder Terminal", GRENADE_OPTIONS, "handleGrenadeSelect", false); - return SCRIPT_CONTINUE; - } - - - public void handleArmorOption(obj_id player) throws InterruptedException - { - refreshMenu (player, "Select the desired armor option", "Character Builder Terminal", ARMOR_OPTIONS, "handleArmorSelect", false); - } - - - public int handleArmorSelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired character option", "Character Builder Terminal", CHARACTER_BUILDER_OPTIONS, "handleOptionSelect", true); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ARMOR_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String prompt = "Select the desired armor option"; - String title = "Character Builder Terminal"; - int pid = 0; - - switch(idx) - { - - case 0: - refreshMenu (player, prompt, title, ARMOR_PROTECTION_AMOUNT, "handleProtectionAmount", false); - utils.setScriptVar(player, "character_builder.armorType", 2); - break; - case 1: - refreshMenu (player, prompt, title, ARMOR_PROTECTION_AMOUNT, "handleProtectionAmount", false); - utils.setScriptVar(player, "character_builder.armorType", 1); - break; - case 2: - refreshMenu (player, prompt, title, ARMOR_PROTECTION_AMOUNT, "handleProtectionAmount", false); - utils.setScriptVar(player, "character_builder.armorType", 0); - break; - case 3: - refreshMenu (player, prompt, title, ARMOR_PSG_OPTIONS, "handlePsgSelect", false); - break; - case 4: - refreshMenu (player, prompt, title, ARMOR_ENHANCEMENT_OPTIONS, "handleEnhancementSelect", false); - break; - case 5: - refreshMenu (player, prompt, title, ARMOR_PVP_SETS, "handlePvPSelect", false); - break; - case 6: - refreshMenu (player, prompt, title, HEROIC_JEWELRY_LIST, "handleHeroicJewelrySelect", false); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - return SCRIPT_CONTINUE; - } - - - public int handleProtectionAmount(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired armor option", "Character Builder Terminal", ARMOR_OPTIONS, "handleArmorSelect", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ARMOR_PROTECTION_AMOUNT.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 9) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full! Please free up at least 9 inventory slots and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - utils.setScriptVar(player, "character_builder.armorLevel", idx +1); - int type = utils.getIntScriptVar(player, "character_builder.armorType"); - String[] options = new String[0]; - String handler = ""; - int pid = 0; - String prompt = "Select the desired armor level option"; - String title = "Character Builder Terminal"; - switch(type) - { - case 0: - options = ARMOR_RECON_OPTIONS; - handler = "handleReconSelect"; - break; - case 1: - options = ARMOR_BATTLE_OPTIONS; - handler = "handleBattleSelect"; - break; - case 2: - options = ARMOR_ASSAULT_OPTIONS; - handler = "handleAssaultSelect"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - utils.setScriptVar(player, "character_builder.armorOptions", options); - utils.setScriptVar(player, "character_builder.armorHandler", handler); - refreshMenu (player, prompt, title, options, handler, false); - - return SCRIPT_CONTINUE; - } - - - public int handleAssaultSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired armor option", "Character Builder Terminal", ARMOR_PROTECTION_AMOUNT, "handleProtectionAmount", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ARMOR_ASSAULT_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 9) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full! Please free up at least 9 inventory slots and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - issueAssaultArmorSet(player,ARMOR_SET_ASSAULT_1); - sendSystemMessageTestingOnly(player, "Composite Armor Set Issued."); - break; - case 1: - issueAssaultArmorSet(player,ARMOR_SET_ASSAULT_3); - sendSystemMessageTestingOnly(player, "Marauder Assault Armor Set Issued."); - break; - case 2: - issueAssaultArmorSet(player,ARMOR_SET_ASSAULT_2); - sendSystemMessageTestingOnly(player, "Chitin Armor Set Issued."); - break; - case 3: - issueAssaultArmorSet(player,ARMOR_SET_ASSAULT_4); - sendSystemMessageTestingOnly(player, "Crafted Bounty Hunter Armor Set Issued."); - break; - case 4: - issueAssaultArmorSet(player,ARMOR_SET_ASSAULT_WOOKIEE); - sendSystemMessageTestingOnly(player, "Kashyyykian Hunting Armor Set Issued."); - break; - case 5: - issueAssaultArmorSet(player,ARMOR_SET_ASSAULT_ITHORIAN); - sendSystemMessageTestingOnly(player, "Ithorian Sentinel Armor Set Issued."); - break; - case 6: - issueAssaultArmorSet(player,ARMOR_SET_ASSAULT_IMPERIAL); - sendSystemMessageTestingOnly(player, "Shocktrooper Armor Set Issued."); - break; - case 7: - issueAssaultArmorSet(player,ARMOR_SET_ASSAULT_REBEL); - sendSystemMessageTestingOnly(player, "Rebel Assault Armor Set Issued."); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - String[] options = utils.getStringArrayScriptVar(player, "character_builder.armorOptions"); - String handler = utils.getStringScriptVar(player, "character_builder.armorHandler"); - refreshMenu (player, "Select the desired armor level option", "Character Builder Terminal", options, handler, false); - return SCRIPT_CONTINUE; - } - - - public int handleBattleSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired armor option", "Character Builder Terminal", ARMOR_PROTECTION_AMOUNT, "handleProtectionAmount", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ARMOR_BATTLE_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 9) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full! Please free up at least 9 inventory slots and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - issueBattleArmorSet(player,ARMOR_SET_BATTLE_3); - sendSystemMessageTestingOnly(player, "Padded Armor Set Issued."); - break; - case 1: - issueBattleArmorSet(player,ARMOR_SET_BATTLE_2); - sendSystemMessageTestingOnly(player, "Marauder Battle Armor Set Issued."); - break; - case 2: - issueBattleArmorSet(player,ARMOR_SET_BATTLE_4); - sendSystemMessageTestingOnly(player, "RIS Armor Set Issued."); - break; - case 3: - issueBattleArmorSet(player,ARMOR_SET_BATTLE_1); - sendSystemMessageTestingOnly(player, "Bone Armor Set Issued."); - break; - case 4: - issueBattleArmorSet(player,ARMOR_SET_BATTLE_WOOKIEE); - sendSystemMessageTestingOnly(player, "Kashyyykian Black Mountain Armor Set Issued."); - break; - case 5: - issueBattleArmorSet(player,ARMOR_SET_BATTLE_ITHORIAN); - sendSystemMessageTestingOnly(player, "Ithorian Defender Armor Set Issued."); - break; - case 6: - issueBattleArmorSet(player,ARMOR_SET_BATTLE_IMPERIAL); - sendSystemMessageTestingOnly(player, "Stormtrooper Armor Set Issued."); - break; - case 7: - issueBattleArmorSet(player,ARMOR_SET_BATTLE_REBEL); - sendSystemMessageTestingOnly(player, "Rebel Battle Armor Set Issued."); - break; - case 8: - issueBattleArmorSet(player,ARMOR_SET_BATTLE_SNOWTROOPER); - sendSystemMessageTestingOnly(player, "Imperial Snowtrooper Set Issued."); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - String[] options = utils.getStringArrayScriptVar(player, "character_builder.armorOptions"); - String handler = utils.getStringScriptVar(player, "character_builder.armorHandler"); - refreshMenu (player, "Select the desired armor level option", "Character Builder Terminal", options, handler, false); - return SCRIPT_CONTINUE; - } - - public int handleReconSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired armor option", "Character Builder Terminal", ARMOR_PROTECTION_AMOUNT, "handleProtectionAmount", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ARMOR_RECON_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 9) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full! Please free up at least 9 inventory slots and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - issueReconArmorSet(player,ARMOR_SET_RECON_3); - sendSystemMessageTestingOnly(player, "Tantel Armor Set Issued."); - break; - case 1: - issueReconArmorSet(player,ARMOR_SET_RECON_4); - sendSystemMessageTestingOnly(player, "Ubese Armor Set Issued."); - break; - case 2: - issueReconArmorSet(player,ARMOR_SET_RECON_1); - sendSystemMessageTestingOnly(player, "Mabari Armor Set Issued."); - break; - case 3: - issueReconArmorSet(player,ARMOR_SET_RECON_2); - sendSystemMessageTestingOnly(player, "Recon Marauder Armor Set Issued."); - break; - case 4: - issueReconArmorSet(player,ARMOR_SET_RECON_WOOKIEE); - sendSystemMessageTestingOnly(player, "Kashyyykian Ceremonial Armor Set Issued."); - break; - case 5: - issueReconArmorSet(player,ARMOR_SET_RECON_ITHORIAN); - sendSystemMessageTestingOnly(player, "Ithorian Guardian Armor Set Issued."); - break; - case 6: - issueReconArmorSet(player,ARMOR_SET_RECON_IMPERIAL); - sendSystemMessageTestingOnly(player, "Scout Trooper Armor Set Issued."); - break; - case 7: - issueReconArmorSet(player,ARMOR_SET_RECON_REBEL); - sendSystemMessageTestingOnly(player, "Rebel Marine Armor Set Issued."); - break; - case 8: - issueReconArmorSet(player,ARMOR_SET_REBEL_SNOW); - sendSystemMessageTestingOnly(player, "Rebel Snow Armor Set Issued."); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - String[] options = utils.getStringArrayScriptVar(player, "character_builder.armorOptions"); - String handler = utils.getStringScriptVar(player, "character_builder.armorHandler"); - refreshMenu (player, "Select the desired armor level option", "Character Builder Terminal", options, handler, false); - return SCRIPT_CONTINUE; - } - - public int handlePsgSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired armor option", "Character Builder Terminal", ARMOR_OPTIONS, "handleArmorSelect", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ARMOR_PSG_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 2) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full! Please free up at least 9 inventory slots and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - obj_id item = null; - switch(idx) - { - case 0: - item = createObject("object/tangible/component/armor/shield_generator_personal.iff", pInv, ""); - armor.initializePsg(item, 2.5f, 500, 10000); - sendSystemMessageTestingOnly(player, "PSG Mark I Issued."); - break; - case 1: - item = createObject("object/tangible/component/armor/shield_generator_personal_b.iff", pInv, ""); - armor.initializePsg(item, 2.5f, 1000, 10000); - sendSystemMessageTestingOnly(player, "PSG Mark II Issued."); - break; - case 2: - item = createObject("object/tangible/component/armor/shield_generator_personal_c.iff", pInv, ""); - armor.initializePsg(item, 2.5f, 2000, 10000); - setSocketsUp(item); - sendSystemMessageTestingOnly(player, "PSG Mark III Issued."); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - refreshMenu (player, "Select the desired armor option", "Character Builder Terminal", ARMOR_PSG_OPTIONS, "handlePsgSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handlePvPSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired armor option", "Character Builder Terminal", ARMOR_PROTECTION_AMOUNT, "handleProtectionAmount", false); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ARMOR_ASSAULT_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 9) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full! Please free up at least 9 inventory slots and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - issuePvPSet(player, ARMOR_SET_PVP_IMPERIAL_BLACK); - sendSystemMessageTestingOnly(player, "Imperial Black PvP Set Issued."); - break; - case 1: - issuePvPSet(player,ARMOR_SET_PVP_IMPERIAL_WHITE); - sendSystemMessageTestingOnly(player, "Imperial White PvP Set Issued."); - break; - case 2: - issuePvPSet(player,ARMOR_SET_PVP_REBEL_GREY); - sendSystemMessageTestingOnly(player, "Rebel Grey PvP Set Issued."); - break; - case 3: - issuePvPSet(player,ARMOR_SET_PVP_REBEL_GREEN); - sendSystemMessageTestingOnly(player, "Rebel Green PvP Set Issued."); - break; - case 4: - issueAssaultArmorSet(player,ARMOR_SET_ASSUALT_GALACTIC_MARINE); - sendSystemMessageTestingOnly(player, "Galactic Marine Armor Set Issued."); - break; - case 5: - issueAssaultArmorSet(player,ARMOR_SET_ASSUALT_REBEL_SPECFORCE); - sendSystemMessageTestingOnly(player, "Rebel SpecForce Armor Set Issued."); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - String[] options = utils.getStringArrayScriptVar(player, "character_builder.armorOptions"); - String handler = utils.getStringScriptVar(player, "character_builder.armorHandler"); - refreshMenu (player, "Select the desired armor level option", "Character Builder Terminal", options, handler, false); - return SCRIPT_CONTINUE; - } - - - public void issuePvPSet(obj_id player, String[] armorPieces) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - for (int i = 0; i < armorPieces.length; i++) - { - testAbortScript(); - static_item.createNewItemFunction(armorPieces[i], pInv); - } - } - - - public void issueAssaultArmorSet(obj_id player, String[] armorPieces) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - for (int j = 0; j < armorPieces.length; ++j) - { - testAbortScript(); - if (static_item.isStaticItem(armorPieces[j])) - { - obj_id armorItem = static_item.createNewItemFunction(armorPieces[j], pInv); - - if (hasScript(armorItem, "npc.faction_recruiter.biolink_item")) - { - setBioLink(armorItem, player); - } - } - else - { - String armorTemplate = ARMOR_SET_PREFIX + armorPieces[j]; - obj_id armorItem = createObject(armorTemplate, pInv, ""); - if (isIdValid(armorItem)) - { - if (!isGameObjectTypeOf(armorItem, GOT_armor_foot) && !isGameObjectTypeOf(armorItem, GOT_armor_hand)) - { - armor.setArmorDataPercent(armorItem, 2, 2, utils.getIntScriptVar(player,"character_builder.armorLevel")*.33f, CONDITION); - armor.setArmorSpecialProtectionPercent(armorItem, armor.DATATABLE_ASSAULT_LAYER, 1.0f); - } - setSocketsUp(armorItem); - } - } - - } - } - - - public void issueBattleArmorSet(obj_id player, String[] armorPieces) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - for (int j = 0; j < armorPieces.length; ++j) - { - testAbortScript(); - if (static_item.isStaticItem(armorPieces[j])) - { - obj_id armorItem = static_item.createNewItemFunction(armorPieces[j], pInv); - - if (hasScript(armorItem, "npc.faction_recruiter.biolink_item")) - { - setBioLink(armorItem, player); - } - } - else - { - String armorTemplate = ARMOR_SET_PREFIX + armorPieces[j]; - obj_id armorItem = createObject(armorTemplate, pInv, ""); - if (isIdValid(armorItem)) - { - if (!isGameObjectTypeOf(armorItem, GOT_armor_foot) && !isGameObjectTypeOf(armorItem, GOT_armor_hand)) - { - armor.setArmorDataPercent(armorItem, 2, 1, utils.getIntScriptVar(player,"character_builder.armorLevel")*.33f, CONDITION); - } - setSocketsUp(armorItem); - } - } - } - } - - - public void issueReconArmorSet(obj_id player, String[] armorPieces) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - for (int j = 0; j < armorPieces.length; ++j) - { - testAbortScript(); - if (static_item.isStaticItem(armorPieces[j])) - { - obj_id armorItem = static_item.createNewItemFunction(armorPieces[j], pInv); - - if (hasScript(armorItem, "npc.faction_recruiter.biolink_item")) - { - setBioLink(armorItem, player); - } - } - else - { - String armorTemplate = ARMOR_SET_PREFIX + armorPieces[j]; - obj_id armorItem = createObject(armorTemplate, pInv, ""); - if (isIdValid(armorItem)) - { - if (!isGameObjectTypeOf(armorItem, GOT_armor_foot) && !isGameObjectTypeOf(armorItem, GOT_armor_hand)) - { - armor.setArmorDataPercent(armorItem, 2, 0, utils.getIntScriptVar(player,"character_builder.armorLevel")*.33f, CONDITION); - armor.setArmorSpecialProtectionPercent(armorItem, armor.DATATABLE_RECON_LAYER, 1.0f); - } - setSocketsUp(armorItem); - } - } - } - } - - - public void handleEnhancementSelect(obj_id player) throws InterruptedException - { - - refreshMenu ( player, "Select the desired deed option", "Character Builder Terminal", ARMOR_ENHANCEMENT_OPTIONS, "handleEnhancementSelect", false); - } - - - public int handleEnhancementSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ARMOR_ENHANCEMENT_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - if (isGod(player)) - { - static_item.createNewItemFunction("item_development_combat_test_ring_06_01",pInv); - sendSystemMessageTestingOnly(player, "Combat Enhancement Ring Issued"); - } - else - { - sendSystemMessageTestingOnly(player, "You Must be in God Mode to enjoy the Combat Ring!"); - } - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - handleEnhancementSelect(player); - return SCRIPT_CONTINUE; - } - - - public int handleHeroicJewelrySelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > HEROIC_JEWELRY_LIST.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 5) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String column = ""; - - switch(idx) - { - case 0: - column = "set_bh_dps"; - break; - case 1: - column = "set_bh_utility_a"; - break; - case 2: - column = "set_bh_utility_b"; - break; - case 3: - column = "set_medic_dps"; - break; - case 4: - column = "set_medic_utility_a"; - break; - case 5: - column = "set_medic_utility_b"; - break; - case 6: - column = "set_jedi_dps"; - break; - case 7: - column = "set_jedi_utility_a"; - break; - case 8: - column = "set_jedi_utility_b"; - break; - case 9: - column = "set_commando_dps"; - break; - case 10: - column = "set_commando_utility_a"; - break; - case 11: - column = "set_commando_utility_b"; - break; - case 12: - column = "set_smuggler_dps"; - break; - case 13: - column = "set_smuggler_utility_a"; - break; - case 14: - column = "set_smuggler_utility_b"; - break; - case 15: - column = "set_spy_dps"; - break; - case 16: - column = "set_spy_utility_a"; - break; - case 17: - column = "set_spy_utility_b"; - break; - case 18: - column = "set_officer_dps"; - break; - case 19: - column = "set_officer_utility_a"; - break; - case 20: - column = "set_officer_utility_b"; - break; - case 21: - column = "set_hero"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (column != null && !column.equals("")) - { - String[] itemSet = dataTableGetStringColumn(HEROIC_JEWELRY_SETS, column); - - if ((itemSet != null) && (itemSet.length != 0)) - { - for (int i = 0; i < itemSet.length; i++) - { - testAbortScript(); - static_item.createNewItemFunction(itemSet[i], pInv); - } - } - } - - refreshMenu( player, "Select the desired armor option", "Character Builder Terminal", HEROIC_JEWELRY_LIST, "handleHeroicJewelrySelect", false); - return SCRIPT_CONTINUE; - - } - - - public void handleMiscOption(obj_id player) throws InterruptedException - { - refreshMenu ( player, "Select the desired item option", "Character Builder Terminal", MISCITEM_OPTIONS, "handleMiscOptions", false); - } - - - public int handleMiscOptions(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > MISCITEM_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String prompt = "Select the desired option"; - String promptTwo = "Select FIRST Skill Modifier, You will need to pick Three total times!"; - String title = "Character Builder Terminal"; - int pid = 0; - - switch(idx) - { - - case 0: - refreshMenu ( player, prompt, title, MISC_OPTIONS, "handleMiscSelect", false); - break; - case 1: - refreshMenu ( player, prompt, title, MEDICINE_OPTIONS, "handleMedicineSelect", false); - break; - - case 2: - refreshMenu ( player, prompt, title, getExoticMods(), "handlePowerUpSelect", false); - break; - case 3: - refreshMenu ( player, promptTwo, title, getExoticMods(), "handleAttachmentOneSelect", false); - break; - case 4: - refreshMenu ( player, prompt, title, CLOTHING_OPTIONS, "handleClothingSelect", false); - break; - case 5: - refreshMenu ( player, promptTwo, title, BASIC_MOD_LIST, "handleBasicArmorAttachmentOne", false); - utils.setScriptVar(player, "character_builder.attachment", "object/tangible/gem/armor.iff"); - break; - case 6: - refreshMenu ( player, promptTwo, title, BASIC_MOD_LIST, "handleBasicArmorAttachmentOne", false); - utils.setScriptVar(player, "character_builder.attachment", "object/tangible/gem/clothing.iff"); - break; - case 7: - refreshMenu ( player, prompt, title, CRAFTING_SUIT, "handleCraftingSuitSelect", false); - break; - case 8: - refreshMenu ( player, prompt, title, AURILIA_CRYSTALS, "handleBuffCrystalSelect", false); - break; - - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - return SCRIPT_CONTINUE; - - } - - - public int handleMiscSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > MISC_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - createObject("object/tangible/wearables/backpack/backpack_s06.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Spec-Ops Pack Issued."); - break; - case 1: - createObject("object/tangible/wearables/backpack/backpack_krayt_skull.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Krayt Pack Issued."); - break; - case 2: - createObject("object/tangible/wearables/backpack/backpack_s09.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Pilot Ace Pack Issued."); - break; - case 3: - static_item.createNewItemFunction("item_fannypack_04_01", pInv); - sendSystemMessageTestingOnly(player, "Jedi Belt of Master Bodo Baas Issued."); - break; - case 4: - static_item.createNewItemFunction("armor_snowtrooper_backpack", pInv); - sendSystemMessageTestingOnly(player, "Snowtrooper Backpack Issued."); - break; - case 5: - static_item.createNewItemFunction("armor_rebel_snow_backpack", pInv); - sendSystemMessageTestingOnly(player, "Alliance Cold Weather Backpack Issued."); - break; - case 6: - createObject("object/tangible/mission/mission_bounty_droid_probot.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Arakyd Probe Droid Issued."); - break; - case 7: - createObject("object/tangible/mission/mission_bounty_droid_seeker.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Seeker Droid Issued."); - break; - case 8: - static_item.createNewItemFunction("item_limited_use_schematic_bounty_ee3_04_01", pInv); - sendSystemMessageTestingOnly(player, "Master Crafted EE3 Draft Schematic Issued."); - break; - case 9: - static_item.createNewItemFunction("item_limited_use_schematic_bounty_dc15_04_01", pInv); - sendSystemMessageTestingOnly(player, "Master Crafted DC-15 Draft Schematic Issued."); - break; - case 10: - createObject("object/tangible/veteran_reward/resource.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Resource Kit Issued"); - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", MISC_OPTIONS, "handleMiscSelect", false); - return SCRIPT_CONTINUE; - - } - - - public int handleCraftingSuitSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > CRAFTING_SUIT.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - obj_id suit = static_item.createNewItemFunction("item_god_craftingsuit_06_01", pInv); - if (isIdValid(suit)) - { - sendSystemMessageTestingOnly(player, "Blix's Ultra Crafting Suit Issued, May you see nothing but Amazing Crafts!"); - } - break; - - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", CRAFTING_SUIT, "handleCraftingSuitSelect", false); - return SCRIPT_CONTINUE; - - } - - - public int handleSmugglerSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > SMUGGLER_TOOLS_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - createObject("object/tangible/smuggler/simple_toolkit.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Simple Toolkit Issued."); - break; - case 1: - createObject("object/tangible/smuggler/finely_crafted_toolset.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Finely Crafted Toolset Issued."); - break; - case 2: - createObject("object/tangible/smuggler/trandoshan_interframe.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Trandoshan Interframe Issued."); - break; - case 3: - createObject("object/tangible/smuggler/delicate_trigger_assembly.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Delicate Trigger Issued."); - break; - case 4: - createObject("object/tangible/smuggler/illegal_core_booster.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Illegal Core Booster Issued."); - break; - case 5: - createObject("object/tangible/smuggler/mandalorian_interframe.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Mandalorian Interframe Issued."); - break; - case 6: - createObject("object/tangible/smuggler/reactive_micro_plating.iff", pInv, ""); - sendSystemMessageTestingOnly(player, "Micro Plating Issued."); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", SMUGGLER_TOOLS_OPTIONS, "handleSmugglerSelect", false); - return SCRIPT_CONTINUE; - - } - - - public String[] getExoticMods() throws InterruptedException - { - String[] skillMods = dataTableGetStringColumn(EXOTIC_SKILL_MODS, "name"); - - for (int i = 0; i < skillMods.length; i++) - { - testAbortScript(); - skillMods[i] = utils.packStringId(new string_id("stat_n", skillMods[i])); - } - - return skillMods; - } - - - public int handlePowerUpSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - String[] skillMods = dataTableGetStringColumn(EXOTIC_SKILL_MODS, "name"); - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > skillMods.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String skillMod = dataTableGetString(EXOTIC_SKILL_MODS, idx, "name"); - int powerRatio = dataTableGetInt(EXOTIC_SKILL_MODS, idx, "ratio"); - int power = 75; - - obj_id armorPower = static_item.createNewItemFunction("item_reverse_engineering_powerup_armor_02_01", pInv); - obj_id shirtPower = static_item.createNewItemFunction("item_reverse_engineering_powerup_clothing_02_01", pInv); - obj_id weaponPower = static_item.createNewItemFunction("item_reverse_engineering_powerup_weapon_02_01", pInv); - - if (isIdValid(armorPower)) - { - setObjVar(armorPower, "reverse_engineering.reverse_engineering_modifier", skillMod); - setObjVar(armorPower, "reverse_engineering.reverse_engineering_ratio", powerRatio); - setObjVar(armorPower, "reverse_engineering.reverse_engineering_power", power); - setCount(armorPower, 350); - sendSystemMessageTestingOnly(player, "Armor Power Up Issued"); - } - - if (isIdValid(shirtPower)) - { - setObjVar(shirtPower, "reverse_engineering.reverse_engineering_modifier", skillMod); - setObjVar(shirtPower, "reverse_engineering.reverse_engineering_ratio", powerRatio); - setObjVar(shirtPower, "reverse_engineering.reverse_engineering_power", power); - setCount(shirtPower, 350); - sendSystemMessageTestingOnly(player, "Shirt Power Up Issued"); - } - - if (isIdValid(weaponPower)) - { - setObjVar(weaponPower, "reverse_engineering.reverse_engineering_modifier", skillMod); - setObjVar(weaponPower, "reverse_engineering.reverse_engineering_ratio", powerRatio); - setObjVar(weaponPower, "reverse_engineering.reverse_engineering_power", power); - setCount(weaponPower, 350); - sendSystemMessageTestingOnly(player, "Weapon Power Up Issued"); - } - - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", getExoticMods(), "handlePowerUpSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleAttachmentOneSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - String[] skillMods = dataTableGetStringColumn(EXOTIC_SKILL_MODS, "name"); - - String prompt = "Select Second Skill Modifier, You will need to pick one more time!"; - String title = "Character Builder Terminal"; - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > skillMods.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, "character_builder.modTypeOne", idx); - - refreshMenu ( player, prompt, title, getExoticMods(), "handleAttachmentTwoSelect", false); - - return SCRIPT_CONTINUE; - } - - - public int handleAttachmentTwoSelect(obj_id self, dictionary params) throws InterruptedException - { - - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - String[] skillMods = dataTableGetStringColumn(EXOTIC_SKILL_MODS, "name"); - - String prompt = "Select Final Skill Modifier"; - String title = "Character Builder Terminal"; - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > skillMods.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, "character_builder.modTypeTwo", idx); - - refreshMenu ( player, prompt, title, getExoticMods(), "handleAttachmentsSelect", false); - - return SCRIPT_CONTINUE; - } - - - public int handleAttachmentsSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - String[] skillMods = dataTableGetStringColumn(EXOTIC_SKILL_MODS, "name"); - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > skillMods.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, "character_builder.modTypeThree", idx); - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - int skillModOne = utils.getIntScriptVar(player, "character_builder.modTypeOne"); - int skillModTwo = utils.getIntScriptVar(player, "character_builder.modTypeTwo"); - int skillModThree = utils.getIntScriptVar(player, "character_builder.modTypeThree"); - - String stringSkillModOne = dataTableGetString(EXOTIC_SKILL_MODS, skillModOne, "name"); - String stringSkillModTwo = dataTableGetString(EXOTIC_SKILL_MODS, skillModTwo, "name"); - String stringSkillModThree = dataTableGetString(EXOTIC_SKILL_MODS, skillModThree, "name"); - - int powerRatioOne = dataTableGetInt(EXOTIC_SKILL_MODS, skillModOne, "ratio"); - int powerRatioTwo = dataTableGetInt(EXOTIC_SKILL_MODS, skillModTwo, "ratio"); - int powerRatioThree = dataTableGetInt(EXOTIC_SKILL_MODS, skillModThree, "ratio"); - - int power = 35; - int powerOne = power/powerRatioOne; - int powerTwo = power/powerRatioTwo; - int powerThree = power/powerRatioThree; - - obj_id armorPower = createObject("object/tangible/gem/bp_armor_only.iff", pInv, ""); - obj_id shirtPower = createObject("object/tangible/gem/shirt_only.iff", pInv, ""); - obj_id weaponPower = createObject("object/tangible/gem/weapon.iff", pInv, ""); - - if (isIdValid(armorPower)) - { - setObjVar(armorPower, "skillmod.bonus."+ stringSkillModOne, powerOne); - setObjVar(armorPower, "skillmod.bonus."+ stringSkillModTwo, powerTwo); - setObjVar(armorPower, "skillmod.bonus."+ stringSkillModThree, powerThree); - setObjVar(armorPower, "reverse_engineering.attachment_level", 2); - sendSystemMessageTestingOnly(player, "Exotic Armor Attachment Issued"); - } - - if (isIdValid(shirtPower)) - { - setObjVar(shirtPower, "skillmod.bonus."+ stringSkillModOne, powerOne); - setObjVar(shirtPower, "skillmod.bonus."+ stringSkillModTwo, powerTwo); - setObjVar(shirtPower, "skillmod.bonus."+ stringSkillModThree, powerThree); - setObjVar(shirtPower, "reverse_engineering.attachment_level", 2); - sendSystemMessageTestingOnly(player, "Exotic Shirt Attachment Issued"); - } - - if (isIdValid(weaponPower)) - { - setObjVar(weaponPower, "skillmod.bonus."+ stringSkillModOne, powerOne); - setObjVar(weaponPower, "skillmod.bonus."+ stringSkillModTwo, powerTwo); - setObjVar(weaponPower, "skillmod.bonus."+ stringSkillModThree, powerThree); - setObjVar(weaponPower, "reverse_engineering.attachment_level", 2); - sendSystemMessageTestingOnly(player, "Exotic Weapon Attachment Issued"); - } - - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", MISCITEM_OPTIONS, "handleMiscOptions", false); - return SCRIPT_CONTINUE; - } - - - public int handleClothingSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > CLOTHING_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String clothing = ""; - - switch(idx) - { - case 0: - clothing = "object/tangible/wearables/shirt/npe_shirt.iff"; - break; - case 1: - clothing = "object/tangible/wearables/gloves/gloves_s14.iff"; - break; - case 2: - clothing = "object/tangible/wearables/hat/hat_s02.iff"; - break; - case 3: - clothing = "object/tangible/wearables/pants/pants_s07.iff"; - break; - case 4: - clothing = "object/tangible/wearables/jacket/jacket_s13.iff"; - break; - case 5: - clothing = "object/tangible/wearables/boots/boots_s05.iff"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (clothing != null && !clothing.equals("")) - { - obj_id clothingObject = createObject(clothing, pInv, ""); - - if (isIdValid(clothingObject)) - { - setSocketsUp(clothingObject); - sendSystemMessageTestingOnly(player, "Clothing Issued"); - } - } - - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", CLOTHING_OPTIONS, "handleClothingSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleBasicArmorAttachmentOne(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - String prompt = "Select Second Skill Modifier, You will need to pick one more time!"; - String title = "Character Builder Terminal"; - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > BASIC_MOD_LIST.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, "character_builder.basicModTypeOne", idx); - - refreshMenu ( player, prompt, title, BASIC_MOD_LIST, "handleBasicArmorAttachmentTwo", false); - - return SCRIPT_CONTINUE; - } - - - public int handleBasicArmorAttachmentTwo(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - String prompt = "Select Final Skill Modifier"; - String title = "Character Builder Terminal"; - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > BASIC_MOD_LIST.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, "character_builder.basicModTypeTwo", idx); - - refreshMenu ( player, prompt, title, BASIC_MOD_LIST, "handleBasicArmorAttachment", false); - - return SCRIPT_CONTINUE; - } - - - public int handleBasicArmorAttachment(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > BASIC_MOD_LIST.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(player, "character_builder.basicModTypeThree", idx); - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - int skillModOne = utils.getIntScriptVar(player, "character_builder.basicModTypeOne"); - int skillModTwo = utils.getIntScriptVar(player, "character_builder.basicModTypeTwo"); - int skillModThree = utils.getIntScriptVar(player, "character_builder.basicModTypeThree"); - - String stringSkillModOne = BASIC_MOD_STRINGS[skillModOne]; - String stringSkillModTwo = BASIC_MOD_STRINGS[skillModTwo]; - String stringSkillModThree = BASIC_MOD_STRINGS[skillModThree]; - - int powerRatio = 1; - int power = 35; - power = power/powerRatio; - - String attachment = utils.getStringScriptVar(player, "character_builder.attachment"); - obj_id armorPower = createObject(attachment, pInv, ""); - - if (isIdValid(armorPower)) - { - setObjVar(armorPower, "skillmod.bonus."+ stringSkillModOne, power); - setObjVar(armorPower, "skillmod.bonus."+ stringSkillModTwo, power); - setObjVar(armorPower, "skillmod.bonus."+ stringSkillModThree, power); - setObjVar(armorPower, "reverse_engineering.attachment_level", 2); - sendSystemMessageTestingOnly(player, "Basic Armor Attachment Issued"); - cleanScriptVars(player); - } - - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", MISCITEM_OPTIONS, "handleMiscOptions", false); - return SCRIPT_CONTINUE; - - } - - - public int handleBuffCrystalSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > AURILIA_CRYSTALS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String crystal = ""; - - switch(idx) - { - case 0: - crystal = "item_aurilia_buff_crystal_03_01"; - break; - case 1: - crystal = "item_aurilia_buff_crystal_03_02"; - break; - case 2: - crystal = "item_aurilia_buff_crystal_03_03"; - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (crystal != null && !crystal.equals("")) - { - if (isGod(player)) - { - static_item.createNewItemFunction(crystal, pInv); - } - else - { - sendSystemMessageTestingOnly(player, "You Must be in God Mode to enjoy the Aurilia Crystals!"); - } - } - - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", AURILIA_CRYSTALS, "handleBuffCrystalSelect", false); - return SCRIPT_CONTINUE; - - } - - - public int handleMedicineSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleMiscOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > MEDICINE_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - case 0: - obj_id stima = createObject("object/tangible/medicine/instant_stimpack/stimpack_a.iff", pInv, ""); - if (isIdValid(stima)) - { - setCount(stima, 350); - setObjVar(stima, "healing.power", 250); - sendSystemMessageTestingOnly(player, "High Charge Instant Stimpack-A Issued!"); - } - else - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction, Invalid Stim."); - } - break; - case 1: - obj_id stimb = createObject("object/tangible/medicine/instant_stimpack/stimpack_b.iff", pInv, ""); - if (isIdValid(stimb)) - { - setCount(stimb, 350); - setObjVar(stimb, "healing.power", 400); - sendSystemMessageTestingOnly(player, "High Charge Instant Stimpack-B Issued!"); - } - else - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction, Invalid Stim."); - } - break; - case 2: - obj_id stimc = createObject("object/tangible/medicine/instant_stimpack/stimpack_c.iff", pInv, ""); - if (isIdValid(stimc)) - { - setCount(stimc, 350); - setObjVar(stimc, "healing.power", 700); - sendSystemMessageTestingOnly(player, "High Charge Instant Stimpack-C Issued!"); - } - else - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction, Invalid Stim."); - } - break; - case 3: - obj_id stimd = createObject("object/tangible/medicine/instant_stimpack/stimpack_d.iff", pInv, ""); - if (isIdValid(stimd)) - { - setCount(stimd, 350); - setObjVar(stimd, "healing.power", 1200); - sendSystemMessageTestingOnly(player, "High Charge Instant Stimpack-D Issued!"); - } - else - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction, Invalid Stim."); - } - break; - - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - refreshMenu ( player, "Select the desired option", "Character Builder Terminal", MEDICINE_OPTIONS, "handleMedicineSelect", false); - return SCRIPT_CONTINUE; - } - - - public void handleHealOption(obj_id player) throws InterruptedException - { - refreshMenu ( player, "Select the desired item option", "Character Builder Terminal", HEAL_OPTIONS, "handleHealOptions", false); - } - - - public int handleHealOptions(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired character option", "Character Builder Terminal", CHARACTER_BUILDER_OPTIONS, "handleOptionSelect", true); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > HEAL_OPTIONS.length) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - - case 0: - { - sendSystemMessageTestingOnly(player, "You have been licked by a Frog! All wounds have been Healed!"); - } - break; - case 1: - healShockWound(player, 1000); - sendSystemMessageTestingOnly(player, "You have been licked by a Frog! All Battle Fatigue has been Healed!"); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - refreshMenu (player, "Select the desired option", "Character Builder Terminal", HEAL_OPTIONS, "handleHealOptions", false); - return SCRIPT_CONTINUE; - } - - - public void handleSpaceMiningOption(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - - skill.grantSkill(player, "pilot_rebel_navy_novice"); - skill.grantSkill(player, "pilot_rebel_navy_starships_01"); - skill.grantSkill(player, "pilot_rebel_navy_starships_02"); - skill.grantSkill(player, "pilot_rebel_navy_starships_03"); - skill.grantSkill(player, "pilot_rebel_navy_starships_04"); - skill.grantSkill(player, "pilot_rebel_navy_weapons_01"); - skill.grantSkill(player, "pilot_rebel_navy_weapons_02"); - skill.grantSkill(player, "pilot_rebel_navy_weapons_03"); - skill.grantSkill(player, "pilot_rebel_navy_weapons_04"); - skill.grantSkill(player, "pilot_rebel_navy_procedures_01"); - skill.grantSkill(player, "pilot_rebel_navy_procedures_02"); - skill.grantSkill(player, "pilot_rebel_navy_procedures_03"); - skill.grantSkill(player, "pilot_rebel_navy_procedures_04"); - skill.grantSkill(player, "pilot_rebel_navy_droid_01"); - skill.grantSkill(player, "pilot_rebel_navy_droid_02"); - skill.grantSkill(player, "pilot_rebel_navy_droid_03"); - skill.grantSkill(player, "pilot_rebel_navy_droid_04"); - skill.grantSkill(player, "pilot_rebel_navy_master"); - - attachScript(player, "wwallace.space_mining_test"); - - obj_id objInventory = utils.getInventoryContainer(player); - sendSystemMessageTestingOnly(player, "Granting a mining vessel...and launching you to spaaaace!"); - obj_id weapon1 = createObjectOverloaded("object/tangible/ship/components/weapon/wpn_mining_laser_mk2.iff", objInventory); - obj_id weapon2 = createObjectOverloaded("object/tangible/ship/components/weapon/wpn_tractor_pulse_gun.iff", objInventory); - obj_id cargoHold = createObjectOverloaded("object/tangible/ship/components/cargo_hold/crg_starfighter_large.iff", objInventory); - - obj_id newship = space_utils.createShipControlDevice(player, "xwing", true); - - if (isIdValid(newship)) - { - obj_id ship = space_transition.getShipFromShipControlDevice(newship); - obj_id comp1 = shipUninstallComponent(player, ship , ship_chassis_slot_type.SCST_weapon_0, objInventory); - destroyObject(comp1); - shipInstallComponent(player, ship, ship_chassis_slot_type.SCST_weapon_0, weapon1); - obj_id comp2 = shipUninstallComponent(player, ship , ship_chassis_slot_type.SCST_weapon_1, objInventory); - destroyObject(comp2); - shipInstallComponent(player, ship, ship_chassis_slot_type.SCST_weapon_1, weapon2); - shipInstallComponent(player, ship, ship_chassis_slot_type.SCST_cargo_hold, cargoHold); - - location space = new location(0, 0, 0, "space_tatooine"); - location ground = getLocation(player); - - launch(player, ship, null, space, ground); - } - } - - - public void handleFactionOption(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - - refreshMenu ( player, "Select the desired faction option", "Character Builder Terminal", FACTION_OPTIONS, "handleFactionOptions", false); - } - - - public int handleFactionOptions(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > FACTION_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String prompt = "Select the desired option"; - String title = "Character Builder Terminal"; - int pid = 0; - String factionName = factions.getFaction(player); - int current_rank = pvpGetCurrentGcwRank(player); - switch(idx) - { - - case 0: - if (factionName == null) - { - sendSystemMessageTestingOnly(player, "You must declare a Faction before receiving Points!"); - return SCRIPT_OVERRIDE; - } - int standing = (int)factions.getFactionStanding(player, factionName); - if (standing < 25000) - { - factions.addFactionStanding(player, factionName, FACTION_AMT); - } - else - { - sendSystemMessageTestingOnly(player, "You already have a large amount of unspent faction points. Why do you need any more?"); - } - break; - case 1: - if (space_flags.isImperialPilot(player)) - { - sendSystemMessageTestingOnly(player, "You are an Imperial Pilot! You must surrender your current space faction before you become a Rebel!"); - return SCRIPT_OVERRIDE; - } - if (factionName == null) - { - pvpSetAlignedFaction(player, (370444368)); - pvpMakeCovert(player); - sendSystemMessageTestingOnly(player, "Faction Set. You are now a Covert Rebel!"); - } - else if (factionName.equals("Imperial")) - { - sendSystemMessageTestingOnly(player, "You are an Imperial! You must surrender your current faction before you become a Rebel!"); - } - else if (factionName.equals("Rebel")) - { - sendSystemMessageTestingOnly(player, "You are already a Rebel!"); - } - break; - case 2: - if (space_flags.isRebelPilot(player)) - { - sendSystemMessageTestingOnly(player, "You are a Rebel Pilot! You must surrender your current space faction before you become an Imperial!"); - return SCRIPT_OVERRIDE; - } - if (factionName == null) - { - pvpSetAlignedFaction(player, (-615855020)); - pvpMakeCovert(player); - sendSystemMessageTestingOnly(player, "Faction Set. You are now a Covert Imperial!"); - } - else if (factionName.equals("Rebel")) - { - sendSystemMessageTestingOnly(player, "You are a Rebel! You must surrender your current faction before you become an Imperial!"); - } - else if (factionName.equals("Imperial")) - { - sendSystemMessageTestingOnly(player, "You are already an Imperial!"); - } - break; - - case 3: - if (factionName == null) - { - sendSystemMessageTestingOnly(player, "You must declare a Faction before receiving Rank"); - return SCRIPT_OVERRIDE; - } - else - { - factions.setRank(player, current_rank + 1); - } - break; - - case 4: - if (factionName == null) - { - sendSystemMessageTestingOnly(player, "You must declare a Faction before losing Rank"); - return SCRIPT_OVERRIDE; - } - else - { - factions.setRank(player, current_rank - 1); - } - break; - case 5: - if (hasObjVar(player, "intChangingFactionStatus")) - { - removeObjVar(player, "intChangingFactionStatus"); - } - pvpMakeNeutral(player); - pvpSetAlignedFaction(player, 0); - factions.setFactionStanding(player, factionName, 0); - factions.unequipFactionEquipment(player, false); - factions.releaseFactionHirelings(player); - sendSystemMessageTestingOnly(player, "You are now Neutral."); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - refreshMenu ( player, "Select the desired faction option", "Character Builder Terminal", FACTION_OPTIONS, "handleFactionOptions", false); - return SCRIPT_CONTINUE; - } - - - public void handleRoadmapSkills(obj_id player) throws InterruptedException - { - refreshMenu ( player, "Select the desired Roadmap option", "Character Builder Terminal", ROADMAP_SKILL_OPTIONS, "handleRoadmapSelect", false); - } - - - public int handleRoadmapSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ROADMAP_SKILL_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String prompt = "Select the desired roadmap skill option"; - String title = "Character Builder Terminal"; - int pid = 0; - - switch(idx) - { - case 0: - if (isGod(player)) - { - handleRoadmapChoice(player); - } - else - { - sendSystemMessageTestingOnly(player, "You cannot access that option."); - } - break; - case 1: - String skillName = getWorkingSkill(player); - - dictionary xpReqs = getSkillPrerequisiteExperience(skillName); - if (xpReqs == null || xpReqs.isEmpty()) - { - sendSystemMessageTestingOnly(player, "Current working skill is invalid."); - return SCRIPT_CONTINUE; - } - - java.util.Enumeration e = xpReqs.keys(); - String xpType = (String)(e.nextElement()); - int xpCost = xpReqs.getInt(xpType); - int curXP = getExperiencePoints(player, xpType); - if (curXP < xpCost) - { - grantExperiencePoints(player, xpType, xpCost - curXP); - } - skill_template.earnWorkingSkill(player); - handleRoadmapSkills(player); - break; - case 2: - String template = getSkillTemplate(player); - sui.inputbox(self, player, "Enter your desired level.", "handleAutoLevelSelect"); - break; - case 3: - respec.revokeAllSkillsAndExperience(player); - - int currentCombatXp = getExperiencePoints(player, "combat_general"); - grantExperiencePoints(player, "combat_general", -currentCombatXp); - skill.recalcPlayerPools(player, true); - - respec.autoLevelPlayer(player, 90, false); - - utils.fullExpertiseReset(player, true); - - skill.setPlayerStatsForLevel(player, 90); - - removeObjVar(player, "expertise_reset"); - removeObjVar(player, "respecsBought"); - sendSystemMessageTestingOnly(player, "Respecced to level 90 and respecs cleared."); - cleanScriptVars(player); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } - - - public int handleAutoLevelSelect(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - String text = sui.getInputBoxText(params); - - int level = utils.stringToInt(text); - - if (level < 1 || level > 90) - { - sendSystemMessageTestingOnly(player, "Invalid level entered!"); - } - else - { - respec.autoLevelPlayer(player, level, false); - } - - utils.fullExpertiseReset(player, true); - - expertise.autoAllocateExpertiseByLevel(player, false); - handleRoadmapSkills(player); - - return SCRIPT_CONTINUE; - } - - - public void handleRoadmapChoice(obj_id player) throws InterruptedException - { - obj_id self = getSelf(); - String[] roadmapList = getRoadmapList(); - - if (roadmapList == null || roadmapList.length == 0) - { - sendSystemMessage(player, SID_TERMINAL_DENIED); - cleanScriptVars(player); - return; - } - else - { - closeOldWindow(player); - utils.setBatchScriptVar(player, "character_builder.roadmap_list", roadmapList); - } - refreshMenu ( player, "Select a skill roadmap.", "Character Builder Terminal", convertRoadmapNames(roadmapList), "handleRoadmapChoiceSelection", false); - } - - - public int handleRoadmapChoiceSelection(obj_id self, dictionary params) throws InterruptedException - { - int idx = sui.getListboxSelectedRow(params); - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired character option", "Character Builder Terminal", CHARACTER_BUILDER_OPTIONS, "handleOptionSelect", true); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - boolean levelNinety = false; - - if (idx % 2 == 1) - { - levelNinety = true; - } - - idx = idx / 2; - - String[] roadmapList = utils.getStringBatchScriptVar(player, "character_builder.roadmap_list"); - - if (exists(player)) - { - if (!levelNinety) - { - handleRoadmapSkillProgression(player, roadmapList[idx]); - } - else - { - handleProfessionLevelToNinety(player, roadmapList[idx]); - } - } - - return SCRIPT_CONTINUE; - } - - - public String[] getRoadmapList() throws InterruptedException - { - - return gm.getRoadmapList(); - } - - - public String[] convertRoadmapNames(String[] list) throws InterruptedException - { - String[] newList = new String[list.length * 2]; - - for (int i = 0; i < newList.length; i += 2) - { - testAbortScript(); - char branch = list[i / 2].charAt(list[i / 2].length() - 1); - branch -= 49; - - String roadmapName = "@ui_roadmap:title_"+ list[i / 2].substring(0, list[i / 2].lastIndexOf('_')); - String branchName = "@ui_roadmap:track_title_"+ list[i / 2].substring(0, list[i / 2].lastIndexOf('_')) + "_"+ branch; - - newList[i] = roadmapName + " - " + branchName; - - newList[i + 1] = roadmapName + " - Level 90"; - } - - return newList; - } - - - public void handleProfessionLevelToNinety(obj_id player, String roadmap) throws InterruptedException - { - revokeAllSkills(player); - - int currentCombatXp = getExperiencePoints(player, "combat_general"); - grantExperiencePoints(player, "combat_general", -currentCombatXp); - skill.recalcPlayerPools(player, true); - - setSkillTemplate(player, roadmap); - - respec.autoLevelPlayer(player, 90, false); - - utils.fullExpertiseReset(player, true); - - skill.setPlayerStatsForLevel(player, 90); - - expertise.autoAllocateExpertiseByLevel(player, false); - handleRoadmapSkills(player); - } - - - public void handleRoadmapSkillProgression(obj_id player, String roadmap) throws InterruptedException - { - obj_id self = getSelf(); - - String templateSkills = dataTableGetString(skill_template.TEMPLATE_TABLE, roadmap, "template"); - String[] skillList = split(templateSkills, ','); - - if (skillList == null || skillList.length == 0) - { - sendSystemMessage(player, SID_TERMINAL_DENIED); - cleanScriptVars(player); - return; - } - else - { - - closeOldWindow(player); - utils.setScriptVar(player, "character_builder.skill_template", roadmap); - utils.setBatchScriptVar(player, "character_builder.roadmap_skills", skillList); - } - - refreshMenu ( player, "Select a the working skill in the roadmap.", "Character Builder Terminal", convertSkillListNames(skillList), "handleRoadmapSkillSelection", false); - } - - - public int handleRoadmapSkillSelection(obj_id self, dictionary params) throws InterruptedException - { - int idx = sui.getListboxSelectedRow(params); - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired character option", "Character Builder Terminal", CHARACTER_BUILDER_OPTIONS, "handleOptionSelect", true); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (exists(player) && !outOfRange(self , player, false)) - { - sendSystemMessageTestingOnly(player, "Revoking all old skills."); - revokeAllSkills(player); - - int currentCombatXp = getExperiencePoints(player, "combat_general"); - grantExperiencePoints(player, "combat_general", -currentCombatXp); - skill.recalcPlayerPools(player, true); - - String skillTemplate = utils.getStringScriptVar(player, "character_builder.skill_template"); - setSkillTemplate(player, skillTemplate); - - String[] roadmapSkills = utils.getStringBatchScriptVar(player, "character_builder.roadmap_skills"); - - for (int i = 0; i < idx; i++) - { - testAbortScript(); - skill.grantSkillToPlayer(player, roadmapSkills[i]); - } - - setWorkingSkill(player, roadmapSkills[idx]); - - utils.fullExpertiseReset(player, true); - - expertise.autoAllocateExpertiseByLevel(player, false); - skill.recalcPlayerPools(player, true); - } - - refreshMenu (player, "Select the desired character option", "Character Builder Terminal", CHARACTER_BUILDER_OPTIONS, "handleOptionSelect", true); - - return SCRIPT_CONTINUE; - } - - - public void revokeAllSkills(obj_id player) throws InterruptedException - { - String[] skillList = getSkillListingForPlayer(player); - int attempts = skillList.length; - - if ((skillList != null) && (skillList.length != 0)) - { - while (skillList.length > 0 && attempts > 0) - { - testAbortScript(); - for (int i = 0; i < skillList.length; i++) - { - testAbortScript(); - String skillName = skillList[i]; - if ((!skillName.startsWith ("species_")&& !skillName.startsWith("social_language_")&& !skillName.startsWith("utility_")&& !skillName.startsWith("common_")&& !skillName.startsWith("demo_")&& !skillName.startsWith("force_title_")&& !skillName.startsWith("force_sensitive_")&& !skillName.startsWith("combat_melee_basic")&& !skillName.startsWith("pilot_")&& !skillName.startsWith("internal_expertise_") && !skillName.startsWith("class_chronicles_") && !skillName.startsWith("combat_ranged_weapon_basic"))) - { - skill.revokeSkillSilent(player, skillName); - } - } - - skillList = getSkillListingForPlayer(player); - - --attempts; - } - } - - utils.fullExpertiseReset(player, false); - - skill.recalcPlayerPools(player, true); - } - - - public void handlePetAbilityOption(obj_id player) throws InterruptedException - { - int[] abilityList = dataTableGetIntColumn(pet_lib.PET_ABILITY_TABLE, "abilityCrc"); - String[] abilityNames = dataTableGetStringColumn(pet_lib.PET_ABILITY_TABLE, "abilityName"); - - for (int i = 0; i < abilityNames.length; i++) - { - testAbortScript(); - abilityNames[i] = utils.packStringId(new string_id("pet/pet_ability", abilityNames[i])); - } - - refreshMenu ( player, "Select the desired Pet Ability", "Character Builder Terminal", abilityNames, "handlePetAbilitySelection", false); - utils.setScriptVar(player, "character_builder.petAbilityList", abilityList); - utils.setScriptVar(player, "character_builder.petAbilityNames", abilityNames); - } - - - public int handlePetAbilitySelection(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - int[] petAbilityList = utils.getIntArrayScriptVar(player, "character_builder.petAbilityList"); - String[] petAbilityNames = utils.getStringArrayScriptVar(player, "character_builder.petAbilityNames"); - - int[] chAbilityList = getIntArrayObjVar(player, "ch.petAbility.abilityList"); - int[] newAbilityList = null; - - if (chAbilityList != null && chAbilityList.length > 0) - { - if (utils.getElementPositionInArray(chAbilityList, petAbilityList[idx]) > -1) - { - refreshMenu ( player, "Select the desired Pet Ability", "Character Builder Terminal", petAbilityNames, "handlePetAbilitySelection", false); - return SCRIPT_CONTINUE; - } - - newAbilityList = new int[chAbilityList.length + 1]; - for (int i = 0; i < chAbilityList.length; i++) - { - testAbortScript(); - newAbilityList[i] = chAbilityList[i]; - } - - newAbilityList[newAbilityList.length - 1] = petAbilityList[idx]; - } - else - { - newAbilityList = new int[1]; - newAbilityList[0] = petAbilityList[idx]; - } - setObjVar(player, "ch.petAbility.abilityList", newAbilityList); - - refreshMenu ( player, "Select the desired Pet Ability", "Character Builder Terminal", petAbilityNames, "handlePetAbilitySelection", false); - - return SCRIPT_CONTINUE; - } - - - public void handleJediOption(obj_id player) throws InterruptedException - { - refreshMenu ( player, "Select the desired Jedi option", "Character Builder Terminal", JEDI_OPTIONS, "handleJediSelect", false); - } - - - public int handleJediSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > JEDI_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String prompt = "Select the desired armor option"; - String title = "Character Builder Terminal"; - int pid = 0; - - switch(idx) - { - case 0: - refreshMenu( player, prompt, title, CRYSTAL_OPTIONS, "handleCrystalSelect", false); - break; - case 1: - refreshMenu( player, prompt, title, SABER_OPTIONS, "handleSaberSelect", false); - break; - case 2: - refreshMenu( player, prompt, title, ROBE_OPTIONS, "handleRobeSelect", false); - break; - - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } - - public int handleCrystalSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleJediOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > CRYSTAL_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 4) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full! Please free up at least 4 inventory slots and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - - case 0: - for (int i = 0; i < 4; i++) - { - testAbortScript(); - jedi.createColorCrystal(pInv, rand(0, 11)); - } - sendSystemMessageTestingOnly(player, "Color Crystals Issued!"); - break; - case 1: - if (isGod(player)) - { - static_item.createNewItemFunction("item_tow_lava_crystal_06_01",pInv); - sendSystemMessageTestingOnly(player, "Lava Crystal Issued!"); - } - else - { - sendSystemMessageTestingOnly(player, "You Must be in God Mode to enjoy the Lava Crystal!"); - } - break; - case 2: - for (int i = 0; i < 4; i++) - { - testAbortScript(); - static_item.createNewItemFunction("item_power_crystal_04_15", pInv); - } - sendSystemMessageTestingOnly(player, "Power Crystals Issued!"); - break; - case 3: - if (isGod(player)) - { - for (int i = 0; i < 4; i++) - { - testAbortScript(); - static_item.createNewItemFunction("item_krayt_pearl_04_20", pInv); - - } - sendSystemMessageTestingOnly(player, "Ancient Krayt Pearls Issued!"); - } - else - { - sendSystemMessageTestingOnly(player, "You Must be in God Mode to enjoy the Ancient Krayt Pearls Issued!"); - } - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - refreshMenu( player, "Select the desired armor option", "Character Builder Terminal", CRYSTAL_OPTIONS, "handleCrystalSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleSaberSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleJediOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > SABER_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 4) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full! Please free up at least 4 inventory slots and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - - case 0: - { - float[] weaponMinDamage = - { - 145f - }; - float[] weaponMaxDamage = - { - 300f - }; - float[] weaponAttackSpeed = - { - 1f - }; - float weaponWoundChance = 1.0f; - float weaponForceCost = 0.0f; - float weaponAttackCost = 100f; - generateGenerationSabers(0, player, pInv, weaponMinDamage, weaponMaxDamage, weaponAttackSpeed, weaponWoundChance,weaponForceCost,weaponAttackCost); - jedi.createColorCrystal(pInv, rand(0, 11)); - sendSystemMessageTestingOnly(player, "Training Saber Issued!"); - } - break; - case 1: - { - float[] weaponMinDamage = - { - 300f, 300f, 300f - }; - float[] weaponMaxDamage = - { - 611f, 611f, 611f - }; - float[] weaponAttackSpeed = - { - 1f, 1f, 1f - }; - float weaponWoundChance = 1.0f; - float weaponForceCost = 0.0f; - float weaponAttackCost = 1f; - generateGenerationSabers(1, player, pInv, weaponMinDamage, weaponMaxDamage, weaponAttackSpeed, weaponWoundChance,weaponForceCost,weaponAttackCost); - jedi.createColorCrystal(pInv, rand(0, 11)); - sendSystemMessageTestingOnly(player, "Generation One Sabers Issued!"); - } - break; - case 2: - { - float[] weaponMinDamage = - { - 360f, 360f, 360f - }; - float[] weaponMaxDamage = - { - 740f, 740f, 740f - }; - float[] weaponAttackSpeed = - { - 1f, 1f, 1f - }; - float weaponWoundChance = 1.0f; - float weaponForceCost = 0.0f; - float weaponAttackCost = 1f; - generateGenerationSabers(2, player, pInv, weaponMinDamage, weaponMaxDamage, weaponAttackSpeed, weaponWoundChance,weaponForceCost,weaponAttackCost); - jedi.createColorCrystal(pInv, rand(0, 11)); - sendSystemMessageTestingOnly(player, "Generation Two Sabers Issued!"); - - } - break; - case 3: - { - float[] weaponMinDamage = - { - 500f, 500f, 500f - }; - float[] weaponMaxDamage = - { - 1000f, 1000f, 1000f - }; - float[] weaponAttackSpeed = - { - 1f, 1f, 1f - }; - float weaponWoundChance = 1.0f; - float weaponForceCost = 0.0f; - float weaponAttackCost = 1f; - generateGenerationSabers(3, player, pInv, weaponMinDamage, weaponMaxDamage, weaponAttackSpeed, weaponWoundChance,weaponForceCost,weaponAttackCost); - jedi.createColorCrystal(pInv, rand(0, 11)); - sendSystemMessageTestingOnly(player, "Generation Three Sabers Issued!"); - } - break; - case 4: - { - float[] weaponMinDamage = - { - 597f, 597f, 597f - }; - float[] weaponMaxDamage = - { - 1193f, 1193f, 1193f - }; - float[] weaponAttackSpeed = - { - 1f, 1f, 1f - }; - float weaponWoundChance = 1.0f; - float weaponForceCost = 0.0f; - float weaponAttackCost = 1f; - generateGenerationSabers(4, player, pInv, weaponMinDamage, weaponMaxDamage, weaponAttackSpeed, weaponWoundChance,weaponForceCost,weaponAttackCost); - jedi.createColorCrystal(pInv, rand(0, 11)); - sendSystemMessageTestingOnly(player, "Generation Four Sabers Issued!"); - } - break; - case 5: - { - float[] weaponMinDamage = - { - 660f, 660f, 660f - }; - float[] weaponMaxDamage = - { - 1350f, 1350f, 1350f - }; - float[] weaponAttackSpeed = - { - 1f, 1f, 1f - }; - float weaponWoundChance = 1.0f; - float weaponForceCost = 0.0f; - float weaponAttackCost = 1f; - generateGenerationSabers(5, player, pInv, weaponMinDamage, weaponMaxDamage, weaponAttackSpeed, weaponWoundChance,weaponForceCost,weaponAttackCost); - jedi.createColorCrystal(pInv, rand(0, 11)); - sendSystemMessageTestingOnly(player, "Generation Five Sabers Issued!"); - } - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - refreshMenu( player, "Select the desired armor option", "Character Builder Terminal", SABER_OPTIONS, "handleSaberSelect", false); - return SCRIPT_CONTINUE; - } - - - public int handleRobeSelect(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleJediOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > ROBE_OPTIONS.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 2) - { - sendSystemMessageTestingOnly(player, "Your Inventory is Full! Please free up at least 2 inventory slots and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - - case 0: - { - static_item.createNewItemFunction("item_jedi_robe_padawan_04_01", pInv); - sendSystemMessageTestingOnly(player, "Padawan Robe Issued!"); - } - break; - case 1: - { - static_item.createNewItemFunction("item_jedi_robe_light_03_01", pInv); - sendSystemMessageTestingOnly(player, "Light Acolyte Robe Issued!"); - } - break; - case 2: - { - static_item.createNewItemFunction("item_jedi_robe_dark_03_01", pInv); - sendSystemMessageTestingOnly(player, "Dark Acolyte Robe Issued!"); - } - break; - case 3: - { - static_item.createNewItemFunction("item_jedi_robe_light_03_02", pInv); - sendSystemMessageTestingOnly(player, "Light Apprentice Robe Issued!"); - } - break; - case 4: - { - static_item.createNewItemFunction("item_jedi_robe_dark_03_02", pInv); - sendSystemMessageTestingOnly(player, "Dark Apprentice Robe Issued!"); - } - break; - case 5: - { - static_item.createNewItemFunction("item_jedi_robe_light_03_03", pInv); - sendSystemMessageTestingOnly(player, "Light Jedi Knight Robe Issued!"); - } - break; - case 6: - { - static_item.createNewItemFunction("item_jedi_robe_dark_03_03", pInv); - sendSystemMessageTestingOnly(player, "Dark Jedi Knight Robe Issued!"); - } - break; - case 7: - { - static_item.createNewItemFunction("item_jedi_robe_06_01", pInv); - sendSystemMessageTestingOnly(player, "Jedi Master Cloak Issued!"); - } - break; - case 8: - { - static_item.createNewItemFunction("item_jedi_robe_06_02", pInv); - sendSystemMessageTestingOnly(player, "Jedi Master Cloak Issued!"); - } - break; - case 9: - { - if (hasCompletedCollectionSlot(player, "jedi_robe_01_07")) - { - modifyCollectionSlotValue(player, "jedi_robe_01_07", -1); - } - if (hasCompletedCollectionSlot(player, "jedi_robe_01_08")) - { - modifyCollectionSlotValue(player, "jedi_robe_01_08", -1); - } - sendSystemMessageTestingOnly(player, "Statue slots in Master Jedi Cloak collection reset!"); - } - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - refreshMenu( player, "Select the desired armor option", "Character Builder Terminal", ROBE_OPTIONS, "handleRobeSelect", false); - return SCRIPT_CONTINUE; - } - - - public void generateGenerationSabers(int generation, obj_id player, obj_id pInv, float[] weaponMinDamage, float[] weaponMaxDamage, float[] weaponAttackSpeed, float weaponWoundChance, float weaponForceCost, float weaponAttackCost) throws InterruptedException - { - String[] saber; - if (generation < 1 || generation > 5) - { - saber = new String[1]; - saber[0] = "object/weapon/melee/sword/crafted_saber/sword_lightsaber_training.iff"; - } - else - { - saber = new String[3]; - saber[0] = "object/weapon/melee/sword/crafted_saber/sword_lightsaber_one_handed_gen"+ generation +".iff"; - saber[1] = "object/weapon/melee/2h_sword/crafted_saber/sword_lightsaber_two_handed_gen"+ generation +".iff"; - saber[2] = "object/weapon/melee/polearm/crafted_saber/sword_lightsaber_polearm_gen"+ generation +".iff"; - } - if (saber.length != weaponMinDamage.length || saber.length != weaponMaxDamage.length || saber.length != weaponAttackSpeed.length) - { - return; - } - - for (int i = 0; i < saber.length; i++) - { - testAbortScript(); - obj_id saberObj = createObject(saber[i], pInv, ""); - if (!isIdValid (saberObj)) - { - continue; - } - - setWeaponMinDamage(saberObj, (int)(weaponMinDamage[i])); - setWeaponMaxDamage(saberObj, (int)(weaponMaxDamage[i])); - setWeaponAttackSpeed(saberObj, weaponAttackSpeed[i]); - setWeaponAttackCost(saberObj, (int)weaponAttackCost); - setWeaponWoundChance(saberObj, weaponWoundChance); - - setConversionId(saberObj,weapons.CONVERSION_VERSION); - - setObjVar(saberObj, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_MIN_DMG, (int)weaponMinDamage[i]); - setObjVar(saberObj, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_MAX_DMG, (int)weaponMaxDamage[i]); - setObjVar(saberObj, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_SPEED, weaponAttackSpeed[i]); - - setObjVar(saberObj, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_WOUND, weaponWoundChance); - setObjVar(saberObj, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_RADIUS, getWeaponDamageRadius (saberObj)); - setObjVar(saberObj, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_ATTACK_COST, getWeaponAttackCost(saberObj)); - setObjVar(saberObj, jedi.VAR_SABER_DEFAULT_STATS + "."+ jedi.VAR_ACCURACY, getWeaponAccuracy (saberObj)); - - setWeaponRangeInfo(saberObj, 0.0f, 5.0f); - setWeaponDamageType (saberObj, DAMAGE_ENERGY); - setCraftedId(saberObj, saberObj); - setCrafter(saberObj, player); - setSocketsUp(saberObj); - weapons.setWeaponData(saberObj); - } - } - - - public void launch(obj_id player, obj_id ship, obj_id[] membersApprovedByShipOwner, location warpLocation, location groundLoc) throws InterruptedException - { - - space_transition.clearOvertStatus(ship); - Vector groupMembersToWarp = utils.addElement(null, player); - Vector groupMemberStartIndex = utils.addElement(null, 0); - utils.setScriptVar(player, "strLaunchPointName", "launching"); - Vector shipStartLocations = space_transition.getShipStartLocations(ship); - if (shipStartLocations != null && shipStartLocations.size() > 0) - { - int startIndex = 0; - location playerLoc = getLocation(player); - if (isIdValid(playerLoc.cell)) - { - obj_id group = getGroupObject(player); - if (isIdValid(group)) - { - obj_id[] groupMembers = getGroupMemberIds(group); - for (int i = 0; i < groupMembers.length; ++i) - { - testAbortScript(); - if ((groupMembers[i] != player && exists(groupMembers[i]) && getLocation(groupMembers[i]).cell == playerLoc.cell && groupMemberApproved(membersApprovedByShipOwner, groupMembers[i]))) - { - - startIndex = getNextStartIndex(shipStartLocations, startIndex); - if (startIndex <= shipStartLocations.size()) - { - groupMembersToWarp = utils.addElement(groupMembersToWarp, groupMembers[i]); - groupMemberStartIndex = utils.addElement(groupMemberStartIndex, startIndex); - } - - else - { - string_id strSpam = new string_id("space/space_interaction", "no_space_expansion"); - sendSystemMessage(groupMembers[i], strSpam); - } - } - } - } - } - } - - for (int i = 0; i < groupMembersToWarp.size(); ++i) - { - testAbortScript(); - space_transition.setLaunchInfo(((obj_id)(groupMembersToWarp.get(i))), ship, ((Integer)(groupMemberStartIndex.get(i))).intValue(), groundLoc); - warpPlayer( - ((obj_id)(groupMembersToWarp.get(i))), - warpLocation.area, - warpLocation.x, warpLocation.y, warpLocation.z, - null, - warpLocation.x, warpLocation.y, warpLocation.z); - } - - } - - - public int getNextStartIndex(Vector shipStartLocations, int lastStartIndex) throws InterruptedException - { - int startIndex = lastStartIndex+1; - - if (startIndex > shipStartLocations.size()) - { - for (startIndex = 1; startIndex <= shipStartLocations.size(); ++startIndex) - { - testAbortScript(); - if (((location)(shipStartLocations.get(startIndex-1))).cell != null) - { - break; - } - } - } - - return startIndex; - } - - - public boolean groupMemberApproved(obj_id[] membersApprovedByShipOwner, obj_id memberToTest) throws InterruptedException - { - for (int i = 0; i < membersApprovedByShipOwner.length; ++i) - { - testAbortScript(); - if (membersApprovedByShipOwner[i] == memberToTest) - { - return true; - } - } - return false; - } - - - public void handleCyberneticsOption(obj_id player) throws InterruptedException - { - obj_id inv = utils.getInventoryContainer(player); - if (!isIdValid( inv )) - { - return; - } - - for (int i = 0; i < CYBERNETIC_ITEMS.length; ++i) - { - testAbortScript(); - createObject(CYBERNETIC_ITEMS[i], inv, ""); - } - sendSystemMessageTestingOnly( player, "Cybernetics issued. Pay a cybernetic Engineer to install the items"); - sendSystemMessageTestingOnly( player, "Locate the cybernetic engineer on the 2nd floor of a medical center"); - location warpLocation = getLocation( player ); - warpLocation.area = "tatooine"; - warpLocation.x = 1305f; - warpLocation.y = 7f; - warpLocation.z = 3261f; - warpPlayer( player, warpLocation.area, warpLocation.x, warpLocation.y, warpLocation.z, null, 0.0f, 0.0f, 0.0f); - } - - - public void refreshMenu(obj_id player, String prompt, String title, String[] options, String myHandler, boolean draw) throws InterruptedException - { - obj_id self = getSelf(); - closeOldWindow(player); - - if (outOfRange(self , player, true)) - { - cleanScriptVars(player); - return; - } - - if (draw == false) - { - int pid = sui.listbox(self, player, prompt, sui.OK_CANCEL_REFRESH, title, options, myHandler, false, false); - sui.listboxUseOtherButton(pid, "Back"); - sui.showSUIPage(pid); - setWindowPid(player, pid); - - } - else - { - int pid = sui.listbox(self, player, prompt, sui.OK_CANCEL, title, options, myHandler, true, false); - sui.showSUIPage(pid); - setWindowPid(player, pid); - } - } - - - public boolean outOfRange(obj_id self, obj_id player, boolean message) throws InterruptedException - { - - if (isGod(player)) - { - return false; - } - - location a = getLocation(self); - location b = getLocation(player); - if (a.cell == b.cell && a.distance(b) < 8.0f) - { - return false; - } - - if (message) - { - sendSystemMessageTestingOnly(player, "Out of Range of Character Builder Terminal."); - } - - return true; - } - - - public void handlePublishOption(obj_id player) throws InterruptedException - { - refreshMenu ( player, "Select the desired Publish 27 option", "Character Builder Terminal", PUBLISH_OPTIONS, "handlePublishOptions", false); - } - - - public int handlePublishOptions(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - obj_id pInv = utils.getInventoryContainer(player); - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - refreshMenu (player, "Select the desired character option", "Character Builder Terminal", CHARACTER_BUILDER_OPTIONS, "handleOptionSelect", true); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > PUBLISH_OPTIONS.length) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (!isIdValid(pInv)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - if (getVolumeFree(pInv) <= 12) - { - sendSystemMessageTestingOnly(player, "Your Inventory has less than 12 slots, please make room and try again."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - switch(idx) - { - - case 0: - { - for (int i = 0; i < PUB27_HEAVYPACK.length; i++) - { - testAbortScript(); - if (PUB27_HEAVYPACK[i].startsWith("object")) - { - weapons.createWeapon(PUB27_HEAVYPACK[i], pInv, weapons.VIA_TEMPLATE, WEAPON_SPEED, WEAPON_DAMAGE, WEAPON_EFFECIENCY, WEAPON_ELEMENTAL); - } - else - { - static_item.createNewItemFunction(PUB27_HEAVYPACK[i], pInv); - } - } - - String template = getSkillTemplate(player); - if (!template.startsWith("trader") && !template.startsWith("entertainer")) - { - if (!isGod(player)) - { - respec.autoLevelPlayer(player, 88, false); - } - } - } - - sendSystemMessageTestingOnly(player, "Heavy Weapons Pack Issued!"); - break; - case 1: - { - float[] weaponMinDamage = - { - 239f, 239f, 239f - }; - float[] weaponMaxDamage = - { - 477f, 477f, 477f - }; - float[] weaponAttackSpeed = - { - .5f, .5f, .5f - }; - float weaponWoundChance = 1.0f; - float weaponForceCost = 0.0f; - float weaponAttackCost = 1f; - generateGenerationSabers(4, player, pInv, weaponMinDamage, weaponMaxDamage, weaponAttackSpeed, weaponWoundChance,weaponForceCost,weaponAttackCost); - jedi.createColorCrystal(pInv, rand(0, 11)); - - for (int i = 0; i < 4; i++) - { - testAbortScript(); - static_item.createNewItemFunction("item_krayt_pearl_04_16", pInv); - } - - static_item.createNewItemFunction("item_jedi_robe_dark_03_03", pInv); - static_item.createNewItemFunction("item_jedi_robe_light_03_03", pInv); - - revokeAllSkills(player); - int currentCombatXp = getExperiencePoints(player, "combat_general"); - grantExperiencePoints(player, "combat_general", -currentCombatXp); - setSkillTemplate(player, "force_sensitive_1a"); - String templateSkills = dataTableGetString(skill_template.TEMPLATE_TABLE, "force_sensitive_1a", "template"); - String[] skillList = split(templateSkills, ','); - setWorkingSkill(player, skillList[0]); - - respec.autoLevelPlayer(player, 88, false); - skill.recalcPlayerPools(player, true); - sendSystemMessageTestingOnly(player, "Level 78 Gear Issued!"); - } - break; - case 2: - { - for (int i = 0; i < PUB27_TRAPS.length; i++) - { - testAbortScript(); - stealth.createRangerLoot(100, PUB27_TRAPS[i], pInv, 100); - } - - sendSystemMessageTestingOnly(player, "Traps Issued!"); - - } - break; - case 3: - { - setObjVar(player, "mand.acknowledge", true); - sendSystemMessageTestingOnly(player, "Death Watch Bunker Access Granted!"); - } - break; - case 4: - for (int i = 0; i < PUB27_CAMOSTUFF.length; i++) - { - testAbortScript(); - static_item.createNewItemFunction(PUB27_CAMOSTUFF[i],pInv); - } - sendSystemMessageTestingOnly(player, "Spy Gear Issued!"); - break; - default: - cleanScriptVars(player); - return SCRIPT_CONTINUE; - - } - - refreshMenu (player, "Select the desired option", "Character Builder Terminal", PUBLISH_OPTIONS, "handlePublishOptions", false); - return SCRIPT_CONTINUE; - } - - - public void flagAllHeroicInstances(obj_id player) throws InterruptedException - { - String[] instanceFlags = dataTableGetStringColumn(instance.INSTANCE_DATATABLE, "key_required"); - if (instanceFlags != null && instanceFlags.length > 0) - { - for (int i = 0; i < instanceFlags.length; i++) - { - testAbortScript(); - String flag = instanceFlags[i]; - if (flag != null && flag.length() > 0) - { - instance.flagPlayerForInstance(player, flag); - } - } - - sendSystemMessageTestingOnly(player, "All Heroic Instances Flagged"); - } - else - { - sendSystemMessageTestingOnly(player, "No Instance Flags Found."); - } - } - - - public obj_id tweakSpaceShipComponent(obj_id objComponent) throws InterruptedException - { - String strComponentType = space_crafting.getShipComponentStringType(objComponent); - - if (strComponentType == null) - { - LOG("tweakSpaceShipComponent", "MAJOR MESSUP! "+ objComponent + " is 9 kinds of messed up"); - setName(objComponent, "BAD COMPONENT: "+ getTemplateName(objComponent) + " : PLEASE REPORT BUG"); - return null; - } - - if (!strComponentType.equals("")) - { - - dictionary dctParams = dataTableGetRow("datatables/ship/components/character_builder/frog_"+ strComponentType + ".iff", getTemplateName(objComponent)); - - if (dctParams == null) - { - LOG("tweakSpaceShipComponent", "TEMPLATE OF TYPE "+ getTemplateName(objComponent) + " HAS BEEN PASSED TO SETUP SPACE COMPONENT. THIS DOES NOT EXIST IN THE DATATBLE of "+ "datatables/ship/components/"+ strComponentType + ".iff"); - return null; - } - - if (strComponentType.equals("armor")) - { - float fltMaximumHitpoints = dctParams.getFloat("fltMaximumHitpoints"); - space_crafting.setComponentCurrentHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumHitpoints(objComponent, fltMaximumHitpoints); - - float fltMaximumArmorHitpoints = dctParams.getFloat("fltMaximumArmorHitpoints"); - space_crafting.setComponentCurrentArmorHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumArmorHitpoints(objComponent, fltMaximumHitpoints); - - float fltMass = dctParams.getFloat("fltMass"); - space_crafting.setComponentMass(objComponent, fltMass); - - setComponentObjVar(objComponent, "character.builder", 1); - String newName = dctParams.getString("strName"); - setName(objComponent, newName); - } - else if (strComponentType.equals("booster")) - { - LOG("tweakSpaceShipComponent", "BOOSTER"+ getTemplateName(objComponent)); - - float fltMaximumEnergy = dctParams.getFloat("fltMaximumEnergy"); - space_crafting.setBoosterMaximumEnergy(objComponent, fltMaximumEnergy); - space_crafting.setBoosterCurrentEnergy(objComponent, fltMaximumEnergy); - - float fltRechargeRate = dctParams.getFloat("fltRechargeRate"); - space_crafting.setBoosterEnergyRechargeRate(objComponent, fltRechargeRate); - - float fltConsumptionRate = dctParams.getFloat("fltConsumptionRate"); - space_crafting.setBoosterEnergyConsumptionRate(objComponent, fltConsumptionRate); - - float fltAcceleration = dctParams.getFloat("fltAcceleration"); - space_crafting.setBoosterAcceleration(objComponent, fltAcceleration); - - float fltMaxSpeed = dctParams.getFloat("fltMaxSpeed"); - space_crafting.setBoosterMaximumSpeed(objComponent, fltMaxSpeed); - - float fltMaximumHitpoints = dctParams.getFloat("fltMaximumHitpoints"); - space_crafting.setComponentCurrentHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumHitpoints(objComponent, fltMaximumHitpoints); - - float fltMaximumArmorHitpoints = dctParams.getFloat("fltMaximumArmorHitpoints"); - space_crafting.setComponentCurrentArmorHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumArmorHitpoints(objComponent, fltMaximumHitpoints); - - float fltEnergyMaintenance = dctParams.getFloat("fltEnergyMaintenance"); - space_crafting.setComponentEnergyMaintenance(objComponent, fltEnergyMaintenance); - - float fltMass = dctParams.getFloat("fltMass"); - space_crafting.setComponentMass(objComponent, fltMass); - - setComponentObjVar(objComponent, "character.builder", 1); - String newName = dctParams.getString("strName"); - setName(objComponent, newName); - } - else if (strComponentType.equals("cargo_hold")) - { - LOG("tweakSpaceShipComponent", "CARGO HOLD"+ getTemplateName(objComponent)); - - int intCargoHoldCapacity = dctParams.getInt("intCargoHoldCapacity"); - space_crafting.setCargoHoldMaxCapacity(objComponent, intCargoHoldCapacity); - - setComponentObjVar(objComponent, "character.builder", 1); - String newName = dctParams.getString("strName"); - setName(objComponent, newName); - } - else if (strComponentType.equals("droid_interface")) - { - LOG("tweakSpaceShipComponent", "DROID INTERFACE"+ getTemplateName(objComponent)); - - float fltCommandSpeed = dctParams.getFloat("fltCommandSpeed"); - space_crafting.setDroidInterfaceCommandSpeed(objComponent, fltCommandSpeed); - - float fltMaximumHitpoints = dctParams.getFloat("fltMaximumHitpoints"); - space_crafting.setComponentCurrentHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumHitpoints(objComponent, fltMaximumHitpoints); - - float fltMaximumArmorHitpoints = dctParams.getFloat("fltMaximumArmorHitpoints"); - space_crafting.setComponentCurrentArmorHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumArmorHitpoints(objComponent, fltMaximumHitpoints); - - float fltEnergyMaintenance = dctParams.getFloat("fltEnergyMaintenance"); - space_crafting.setComponentEnergyMaintenance(objComponent, fltEnergyMaintenance); - - float fltMass = dctParams.getFloat("fltMass"); - space_crafting.setComponentMass(objComponent, fltMass); - - setComponentObjVar(objComponent, "character.builder", 1); - String newName = dctParams.getString("strName"); - setName(objComponent, newName); - } - else if (strComponentType.equals("engine")) - { - LOG("tweakSpaceShipComponent", "ENGINE"+ getTemplateName(objComponent)); - - float fltMaxSpeed = dctParams.getFloat("fltMaxSpeed"); - space_crafting.setEngineMaximumSpeed(objComponent, fltMaxSpeed); - - float fltMaxPitch = dctParams.getFloat("fltMaxPitch"); - space_crafting.setEngineMaximumPitch(objComponent, fltMaxPitch); - - float fltMaxRoll = dctParams.getFloat("fltMaxRoll"); - space_crafting.setEngineMaximumRoll(objComponent, fltMaxRoll); - - float fltMaxYaw = dctParams.getFloat("fltMaxYaw"); - space_crafting.setEngineMaximumYaw(objComponent, fltMaxYaw); - - float fltMaximumHitpoints = dctParams.getFloat("fltMaximumHitpoints"); - space_crafting.setComponentCurrentHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumHitpoints(objComponent, fltMaximumHitpoints); - - float fltMaximumArmorHitpoints = dctParams.getFloat("fltMaximumArmorHitpoints"); - space_crafting.setComponentCurrentArmorHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumArmorHitpoints(objComponent, fltMaximumHitpoints); - - float fltEnergyMaintenance = dctParams.getFloat("fltEnergyMaintenance"); - space_crafting.setComponentEnergyMaintenance(objComponent, fltEnergyMaintenance); - - float fltMass = dctParams.getFloat("fltMass"); - space_crafting.setComponentMass(objComponent, fltMass); - - setComponentObjVar(objComponent, "character.builder", 1); - String newName = dctParams.getString("strName"); - setName(objComponent, newName); - } - else if (strComponentType.equals("reactor")) - { - LOG("tweakSpaceShipComponent", "REACTOR"+ getTemplateName(objComponent)); - - float fltEnergyGeneration = dctParams.getFloat("fltEnergyGeneration"); - space_crafting.setReactorEnergyGeneration(objComponent, fltEnergyGeneration); - - float fltMaximumHitpoints = dctParams.getFloat("fltMaximumHitpoints"); - space_crafting.setComponentCurrentHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumHitpoints(objComponent, fltMaximumHitpoints); - - float fltMaximumArmorHitpoints = dctParams.getFloat("fltMaximumArmorHitpoints"); - space_crafting.setComponentCurrentArmorHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumArmorHitpoints(objComponent, fltMaximumHitpoints); - - float fltMass = dctParams.getFloat("fltMass"); - space_crafting.setComponentMass(objComponent, fltMass); - - setComponentObjVar(objComponent, "character.builder", 1); - String newName = dctParams.getString("strName"); - setName(objComponent, newName); - } - else if (strComponentType.equals("shield")) - { - LOG("tweakSpaceShipComponent", "SHIELD"+ getTemplateName(objComponent)); - - float fltShieldHitpointsMaximumFront = dctParams.getFloat("fltShieldHitpointsMaximumFront"); - float fltShieldHitpointsMaximumBack = dctParams.getFloat("fltShieldHitpointsMaximumFront"); - space_crafting.setShieldGeneratorCurrentFrontHitpoints(objComponent, 0f); - space_crafting.setShieldGeneratorCurrentBackHitpoints(objComponent, 0f); - space_crafting.setShieldGeneratorMaximumFrontHitpoints(objComponent, fltShieldHitpointsMaximumFront); - space_crafting.setShieldGeneratorMaximumBackHitpoints(objComponent, fltShieldHitpointsMaximumBack); - - float fltShieldRechargeRate = dctParams.getFloat("fltShieldRechargeRate"); - space_crafting.setShieldGeneratorRechargeRate(objComponent, fltShieldRechargeRate); - - float fltMaximumHitpoints = dctParams.getFloat("fltMaximumHitpoints"); - space_crafting.setComponentCurrentHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumHitpoints(objComponent, fltMaximumHitpoints); - - float fltMaximumArmorHitpoints = dctParams.getFloat("fltMaximumArmorHitpoints"); - space_crafting.setComponentCurrentArmorHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumArmorHitpoints(objComponent, fltMaximumHitpoints); - - float fltEnergyMaintenance = dctParams.getFloat("fltEnergyMaintenance"); - space_crafting.setComponentEnergyMaintenance(objComponent, fltEnergyMaintenance); - - float fltMass = dctParams.getFloat("fltMass"); - space_crafting.setComponentMass(objComponent, fltMass); - - setComponentObjVar(objComponent, "character.builder", 1); - String newName = dctParams.getString("strName"); - setName(objComponent, newName); - } - else if (strComponentType.equals("weapon")) - { - float fltMinDamage = dctParams.getFloat("fltMinDamage"); - space_crafting.setWeaponMinimumDamage(objComponent, fltMinDamage); - - float fltMaxDamage = dctParams.getFloat("fltMaxDamage"); - space_crafting.setWeaponMaximumDamage(objComponent, fltMaxDamage); - - float fltShieldEffectiveness = dctParams.getFloat("fltShieldEffectiveness"); - space_crafting.setWeaponShieldEffectiveness(objComponent, fltShieldEffectiveness); - - float fltArmorEffectiveness = dctParams.getFloat("fltArmorEffectiveness"); - space_crafting.setWeaponArmorEffectiveness(objComponent, fltArmorEffectiveness); - - float fltEnergyPerShot = dctParams.getFloat("fltEnergyPerShot"); - space_crafting.setWeaponEnergyPerShot(objComponent, fltEnergyPerShot); - - float fltRefireRate = dctParams.getFloat("fltRefireRate"); - space_crafting.setWeaponRefireRate(objComponent, fltRefireRate); - - float fltMaximumHitpoints = dctParams.getFloat("fltMaximumHitpoints"); - space_crafting.setComponentCurrentHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumHitpoints(objComponent, fltMaximumHitpoints); - - float fltMaximumArmorHitpoints = dctParams.getFloat("fltMaximumArmorHitpoints"); - space_crafting.setComponentCurrentArmorHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumArmorHitpoints(objComponent, fltMaximumHitpoints); - - float fltEnergyMaintenance = dctParams.getFloat("fltEnergyMaintenance"); - space_crafting.setComponentEnergyMaintenance(objComponent, fltEnergyMaintenance); - - float fltMass = dctParams.getFloat("fltMass"); - space_crafting.setComponentMass(objComponent, fltMass); - - setComponentObjVar(objComponent, "character.builder", 1); - String newName = dctParams.getString("strName"); - setName(objComponent, newName); - } - else if (strComponentType.equals("capacitor")) - { - LOG("tweakSpaceShipComponent", "CAPACITOR"+ getTemplateName(objComponent)); - - float fltMaxEnergy = dctParams.getFloat("fltMaxEnergy"); - space_crafting.setWeaponCapacitorMaximumEnergy(objComponent, fltMaxEnergy); - space_crafting.setWeaponCapacitorCurrentEnergy(objComponent, fltMaxEnergy); - - float fltRechargeRate = dctParams.getFloat("fltRechargeRate"); - space_crafting.setWeaponCapacitorRechargeRate(objComponent, fltRechargeRate); - float fltMaximumHitpoints = dctParams.getFloat("fltMaximumHitpoints"); - space_crafting.setComponentCurrentHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumHitpoints(objComponent, fltMaximumHitpoints); - - float fltMaximumArmorHitpoints = dctParams.getFloat("fltMaximumArmorHitpoints"); - space_crafting.setComponentCurrentArmorHitpoints(objComponent, fltMaximumHitpoints); - space_crafting.setComponentMaximumArmorHitpoints(objComponent, fltMaximumHitpoints); - - float fltEnergyMaintenance = dctParams.getFloat("fltEnergyMaintenance"); - space_crafting.setComponentEnergyMaintenance(objComponent, fltEnergyMaintenance); - - float fltMass = dctParams.getFloat("fltMass"); - space_crafting.setComponentMass(objComponent, fltMass); - - setComponentObjVar(objComponent, "character.builder", 1); - String newName = dctParams.getString("strName"); - setName(objComponent, newName); - } - return objComponent; - } - else - { - LOG("tweakSpaceShipComponent", "MAJOR MESSUP! "+ objComponent + " could not be modified as it was not valid"); - return null; - } - } - - - public boolean setComponentObjVar(obj_id objComponent, String objVarName, float fltValue) throws InterruptedException - { - return setObjVar(objComponent, objVarName, fltValue); - } - - - public boolean issueShipChassis(obj_id player, int idx) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - LOG("issueShipChassis", "idx = "+ idx); - - if (idx < 0) - { - return false; - } - - LOG("issueShipChassis", "issueShipChassis function"); - - String type = dataTableGetString(SHIP_CHASSIS_TBL, idx, "shipType"); - - String skill = dataTableGetString(SHIP_CHASSIS_TBL, type, "skill"); - - float mass = dataTableGetFloat(SHIP_CHASSIS_TBL, idx, "fltMass"); - - float hp = dataTableGetFloat(SHIP_CHASSIS_TBL, idx, "fltHitPoints"); - - LOG("issueShipChassis", "SKILL: "+ skill); - - if (type.equals("firespray") || type.equals("yt2400")) - { - if (hasSkill(player, "pilot_rebel_navy_master") || !hasSkill(player, "pilot_imperial_navy_master") || !hasSkill(player, "pilot_neutral_master")) - { - giveShipChassis(player, type, mass, hp); - return true; - } - sendSystemMessageTestingOnly(player, "You cannot use the Firespray due to certification requirements. Skill Required is: "+ skill); - return false; - } - - if (!hasSkill(player, skill)) - { - sendSystemMessageTestingOnly(player, "You cannot use this ship due to certification requirements. Skill Required is: "+ skill); - return false; - } - - giveShipChassis(player, type, mass, hp); - return true; - } - - - public boolean giveShipChassis(obj_id player, String type, float mass, float hp) throws InterruptedException - { - if (!isIdValid(player)) - { - return false; - } - - if (type == null || type.equals("")) - { - return false; - } - - if (mass < 0 || hp < 0) - { - return false; - } - - obj_id pInv = utils.getInventoryContainer(player); - - obj_id pcd = space_crafting.createDeedFromBlueprints(player, type, pInv, mass, hp); - if (!isIdValid(pcd)) - { - - sendSystemMessageTestingOnly(player, "The ship was not created due to error."); - LOG("issueShipChassis", "CHASSIS"+ type + " IS BAD"); - - return false; - } - - sendSystemMessageTestingOnly(player, "Chassis Issued."); - return true; - } - - - public void handleDraftSchematicsOption(obj_id player) throws InterruptedException - { - refreshMenu(player, "Select the desired crafting profession", "Character Builder Terminal", CRAFTING_PROFESSIONS, "handleDraftSchematicsList", false); - } - - - public int handleDraftSchematicsList(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - startCharacterBuilder(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (idx == -1 || idx > CRAFTING_SKILL_TEMPLATES.length) - { - cleanScriptVars(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player) || !isGod(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String[] skillList = skill_template.getSkillTemplateSkillsByTemplateName(CRAFTING_SKILL_TEMPLATES[idx]); - - String[] schematicGroups = craftinglib.getDraftSchematicGroupsFromSkills(skillList); - - String[] schematics = craftinglib.getDraftSchematicsFromGroups(schematicGroups); - - Arrays.sort(schematics); - - utils.setScriptVar(player, "character_builder.schematicsList", schematics); - - float craftPercentage = 100.0f; - - if (!utils.hasScriptVar(player, "character_builder.qualityPercentage")) - { - utils.setScriptVar(player, "character_builder.qualityPercentage", 100.0f); - } - else - { - craftPercentage = utils.getFloatScriptVar(player, "character_builder.qualityPercentage"); - } - - if (utils.hasScriptVar(player, "character_builder.qualityPercentagePID")) - { - int oldpid = utils.getIntScriptVar(player, "character_builder.qualityPercentagePID"); - sui.closeSUI(player, oldpid); - } - - refreshMenu(player, "Select a profession draft schematic. Schematics that require items in addition to resources may not be crafted properly (armor, weapons, droids). Instead, use this to select the items required for their schematic and then use the crafting tool.", "Character Builder Terminal", schematics, "handleSchematicSelect", false); - int pid = sui.inputbox(self, player, "A high crafting percentage can result in a crafted item that players cannot create legally.", sui.OK_CANCEL, "Crafting Percentage", sui.INPUT_NORMAL, null, "handleCraftQualityPercentage", null); - - utils.setScriptVar(player, "character_builder.qualityPercentagePID", pid); - - return SCRIPT_CONTINUE; - } - - - public int handleCraftQualityPercentage(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - String stringPercentage = sui.getInputBoxText(params); - int btn = sui.getIntButtonPressed(params); - - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player) || !isGod(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - return SCRIPT_OVERRIDE; - } - - float floatPercentage = utils.stringToFloat(stringPercentage); - - if (floatPercentage > 100.0f || floatPercentage < 0.0f) - { - sendSystemMessageTestingOnly(player, "Bad Crafting Percentage."); - return SCRIPT_OVERRIDE; - } - - utils.setScriptVar(player, "character_builder.qualityPercentage", floatPercentage); - - return SCRIPT_CONTINUE; - } - - - public int handleSchematicSelect(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.isEmpty()) - { - - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - int btn = sui.getIntButtonPressed(params); - int idx = sui.getListboxSelectedRow(params); - - if (btn == sui.BP_REVERT) - { - handleDraftSchematicsOption(player); - return SCRIPT_CONTINUE; - } - - if (btn == sui.BP_CANCEL) - { - cleanScriptVars(player); - closeOldWindow(player); - return SCRIPT_CONTINUE; - } - - if (!isIdValid(player) || !isGod(player)) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - String[] schematics = utils.getStringArrayScriptVar(player, "character_builder.schematicsList"); - - if (schematics == null || schematics.length <= 0) - { - sendSystemMessageTestingOnly(player, "The system is unable to complete the transaction."); - cleanScriptVars(player); - return SCRIPT_OVERRIDE; - } - - float craftPercentage = 100.0f; - - if (utils.hasScriptVar(player, "character_builder.qualityPercentage")) - { - craftPercentage = utils.getFloatScriptVar(player, "character_builder.qualityPercentage"); - } - - obj_id container = utils.getInventoryContainer(player); - - obj_id craftedItem = makeCraftedItem(schematics[idx], craftPercentage, container); - - if (isIdValid(craftedItem)) - { - sendSystemMessageTestingOnly(player, "Making: "+ getName(craftedItem)); - } - else - { - sendSystemMessageTestingOnly(player, "Failed to make: "+ schematics[idx]); - } - - if (utils.hasScriptVar(player, "character_builder.qualityPercentagePID")) - { - int oldpid = utils.getIntScriptVar(player, "character_builder.qualityPercentagePID"); - sui.closeSUI(player, oldpid); - } - - refreshMenu(player, "Select the draft schematic. Schematics that require items in addition to resources may not be crafted properly (armor, weapons, droids). Instead, use this to select the items required for their schematic and then use the crafting tool.", "Character Builder Terminal", schematics, "handleSchematicSelect", false); - int pid = sui.inputbox(self, player, "A high crafting percentage can result in a crafted item that players cannot create legally.", sui.OK_CANCEL, "A high crafting percentage ", sui.INPUT_NORMAL, null, "handleCraftQualityPercentage", null); - - utils.setScriptVar(player, "character_builder.qualityPercentagePID", pid); - - return SCRIPT_CONTINUE; - } - - - public void setSocketsUp(obj_id item) throws InterruptedException - { - - setSkillModSockets(item, 1); - setCondition(item, CONDITION_MAGIC_ITEM); - - } - - - public void createSnowFlakeFrogWeapon(obj_id player, String weaponName) throws InterruptedException - { - obj_id pInv = utils.getInventoryContainer(player); - - obj_id weaponObject = weapons.createWeapon(weaponName, pInv, weapons.VIA_TEMPLATE, WEAPON_SPEED, WEAPON_DAMAGE, WEAPON_EFFECIENCY, WEAPON_ELEMENTAL); - if (isIdValid(weaponObject)) - { - setSocketsUp(weaponObject); - sendSystemMessageTestingOnly(player, "Weapon Issued!"); - } - - } -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_city.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_city.java deleted file mode 100644 index 066386056..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_city.java +++ /dev/null @@ -1,1995 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.city; -import script.library.prose; -import script.library.sui; -import script.library.utils; -import script.library.money; -import script.library.player_structure; -import java.util.Vector; - - -public class terminal_city extends script.base_script -{ - public terminal_city() - { - } - public static final String STF = "city/city"; - - public static final string_id SID_CITY_HACKS = new string_id(STF, "city_hacks"); - public static final string_id SID_CITY_FORCE_UPDATE = new string_id(STF, "force_update"); - public static final string_id SID_CITY_RANK_UP = new string_id(STF, "rank_up"); - public static final string_id SID_CITY_RANK_DOWN = new string_id(STF, "rank_down"); - public static final string_id SID_CITY_FIX_MAYOR = new string_id(STF, "fix_mayor"); - public static final string_id SID_CITY_MAKE_MAYOR = new string_id(STF, "make_mayor"); - public static final string_id SID_CITY_REVOKE_CITIZENSHIP = new string_id(STF, "revoke_citizenship"); - public static final string_id SID_CITY_REMOVE_OLD_TRAINERS = new string_id(STF, "remove_trainers"); - - public static final string_id SID_CLONE_DATA_WIPED = new string_id(STF, "clone_data_wiped"); - public static final string_id SID_SHUTTLE_DATA_WIPED = new string_id(STF, "clone_data_wiped"); - - public static final string_id SID_CITY_RESET_CLONE_DATA = new string_id(STF, "reset_clone_data"); - public static final string_id SID_CITY_RESET_SHUTTLE_DATA = new string_id(STF, "reset_shuttle_data"); - public static final string_id SID_CITY_MODIFY_STRUCTURE_LIST = new string_id(STF, "modify_structure_list"); - - public static final string_id SID_CITY_INFO = new string_id(STF, "city_info"); - public static final string_id SID_CITY_STATUS = new string_id(STF, "city_status"); - public static final string_id SID_CITY_CITIZENS = new string_id(STF, "city_citizens"); - public static final string_id SID_CITY_STRUCTURES = new string_id(STF, "city_structures"); - public static final string_id SID_CITY_RANK = new string_id(STF, "city_rank"); - public static final string_id SID_CITY_MAINT_REPORT = new string_id(STF, "city_maint"); - - public static final string_id SID_CITY_MANAGEMENT = new string_id(STF, "city_management"); - public static final string_id SID_CITY_NAME = new string_id(STF, "city_name"); - public static final string_id SID_CITY_MILITIA = new string_id(STF, "city_militia"); - public static final string_id SID_CITY_REGISTER = new string_id(STF, "city_register"); - public static final string_id SID_CITY_UNREGISTER = new string_id(STF, "city_unregister"); - public static final string_id SID_CITY_SPECIALIZATIONS = new string_id(STF, "city_specializations"); - - public static final string_id SID_TREASURY_MANAGEMENT = new string_id(STF, "treasury_management"); - public static final string_id SID_TREASURY_STATUS = new string_id(STF, "treasury_status"); - public static final string_id SID_TREASURY_DEPOSIT = new string_id(STF, "treasury_deposit"); - public static final string_id SID_TREASURY_WITHDRAW = new string_id(STF, "treasury_withdraw"); - public static final string_id SID_TREASURY_TAXES = new string_id(STF, "treasury_taxes"); - - public static final string_id SID_NAME_CHANGED = new string_id(STF, "name_changed"); - public static final string_id SID_OBSCENE = new string_id("player_structure", "obscene"); - public static final string_id SID_NOT_UNIQUE = new string_id("player_structure", "cityname_not_unique"); - - public static final string_id SID_CANT_FIND_PLAYER = new string_id(STF, "cant_find_player"); - public static final string_id SID_NOT_CITIZEN = new string_id(STF, "not_citizen"); - public static final string_id SID_ADDED_MILITIA = new string_id(STF, "added_militia"); - public static final string_id SID_REMOVED_MILITIA = new string_id(STF, "removed_militia"); - public static final string_id SID_ADDED_MILITIA_TARGET = new string_id(STF, "added_militia_target"); - public static final string_id SID_REMOVED_MILITIA_TARGET = new string_id(STF, "removed_militia_target"); - - public static final string_id SID_NO_MONEY = new string_id(STF, "no_money"); - public static final string_id SID_TAX_OUT_OF_RANGE = new string_id(STF, "tax_out_of_range"); - public static final string_id SID_INCOME_TAX = new string_id(STF, "set_income_tax"); - public static final string_id SID_PROPERTY_TAX = new string_id(STF, "set_property_tax"); - public static final string_id SID_SALES_TAX = new string_id(STF, "set_sales_tax"); - public static final string_id SID_TRAVEL_FEE = new string_id(STF, "set_travel_fee"); - public static final string_id SID_GARAGE_TAX = new string_id(STF, "set_garage_tax"); - - public static final string_id SID_CANT_TAX = new string_id(STF, "cant_tax"); - public static final string_id SID_CANT_REGISTER = new string_id(STF, "cant_register"); - public static final string_id SID_CANT_REGISTER_RANK = new string_id(STF, "cant_register_rank"); - public static final string_id SID_REGISTERED = new string_id(STF, "registered"); - public static final string_id SID_UNREGISTERED = new string_id(STF, "unregistered"); - public static final string_id SID_CANT_MILITIA = new string_id(STF, "cant_militia"); - public static final string_id SID_NO_RANK_TAXES = new string_id(STF, "no_rank_taxes"); - - public static final string_id SID_NO_RANK_SPEC = new string_id(STF, "no_rank_spec"); - public static final string_id SID_NO_SPECS = new string_id(STF, "no_specs"); - public static final string_id SID_SPEC_SET = new string_id(STF, "spec_set"); - public static final string_id SID_SPEC_TIME = new string_id(STF, "spec_time"); - - public static final string_id SID_WITHDRAW_LIMITS = new string_id(STF, "withdraw_limits"); - public static final string_id SID_WITHDRAW_DAILY = new string_id(STF, "withdraw_daily"); - - public static final string_id SID_NO_SHUTTLEPORT = new string_id(STF, "no_shuttleport"); - - public static final string_id PUBLIC_ELECTION_SUBJECT = new string_id( STF, "public_election_subject"); - public static final string_id PUBLIC_ELECTION_BODY = new string_id( STF, "public_election_body"); - - public static final String CITY_SPECS = "datatables/city/specializations.iff"; - - public static final String[] TAX_STRING = - { - "income", "property", "sales", "travel", "garage" - }; - public static final int[] TAX_MIN = - { - 0, 0, 0, 1, 0 - }; - public static final int[] TAX_MAX = - { - 2000, 50, 20, 500, 30 - }; - - public static final string_id SID_CITY_ZONE = new string_id(STF, "zone"); - public static final string_id SID_CITY_UNZONE = new string_id(STF, "unzone"); - public static final string_id SID_ZONING_ENABLED = new string_id(STF, "zoning_enabled"); - public static final string_id SID_ZONING_DISABLED = new string_id(STF, "zoning_disabled"); - public static final string_id SID_ZONING_SKILL = new string_id(STF, "zoning_skill"); - - public static final string_id TREASURY_WITHDRAW_SUBJECT = new string_id( STF, "treasury_withdraw_subject"); - public static final string_id TREASURY_WITHDRAW_BODY = new string_id( STF, "treasury_withdraw_body"); - - public static final string_id TAX_INCOME_SUBJECT = new string_id( STF, "tax_income_subject"); - public static final string_id TAX_INCOME_BODY = new string_id( STF, "tax_income_body"); - - public static final string_id TAX_PROPERTY_SUBJECT = new string_id( STF, "tax_property_subject"); - public static final string_id TAX_PROPERTY_BODY = new string_id( STF, "tax_property_body"); - - public static final string_id TAX_SALES_SUBJECT = new string_id( STF, "tax_sales_subject"); - public static final string_id TAX_SALES_BODY = new string_id( STF, "tax_sales_body"); - - public static final string_id TAX_TRAVEL_SUBJECT = new string_id( STF, "tax_travel_subject"); - public static final string_id TAX_TRAVEL_BODY = new string_id( STF, "tax_travel_body"); - - public static final string_id GARAGE_FEE_SUBJECT = new string_id( STF, "garage_fee_subject"); - public static final string_id GARAGE_FEE_BODY = new string_id( STF, "garage_fee_body"); - - public static final string_id SID_YOU_WITHDRAW_FROM_TREASURY = new string_id( STF, "you_withdraw_from_treasury"); - - public static final string_id SID_SUI_CONFIRM_REMOVE_TITLE = new string_id( STF, "sui_confirm_remove_title"); - - public static final string_id SID_REVOKE_CITIZEN_WARNING = new string_id(STF, "revoke_citizenship_warning"); - - public static final String PROFESSION_TRAINER_SCRIPT = "npc.skillteacher.trainer_spawner"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - obj_id structure = getTopMostContainer( self ); - int city_id = findCityByCityHall( structure ); - if (!cityExists( city_id )) - { - return SCRIPT_CONTINUE; - } - obj_id mayor = cityGetLeader( city_id ); - - if (!city.isCitizenOfCity(player, city_id) && (player != mayor) && !isGod(player)) - { - return SCRIPT_CONTINUE; - } - - int menu = mi.addRootMenu(menu_info_types.ITEM_USE, SID_CITY_INFO); - mi.addSubMenu( menu, menu_info_types.CITY_STATUS, SID_CITY_STATUS ); - mi.addSubMenu( menu, menu_info_types.CITY_CITIZENS, SID_CITY_CITIZENS ); - mi.addSubMenu( menu, menu_info_types.CITY_STRUCTURES, SID_CITY_STRUCTURES ); - mi.addSubMenu( menu, menu_info_types.CITY_RANK, SID_CITY_RANK ); - mi.addSubMenu( menu, menu_info_types.SERVER_MENU3, SID_CITY_MAINT_REPORT ); - mi.addSubMenu( menu, menu_info_types.CITY_TREASURY, SID_TREASURY_STATUS ); - mi.addSubMenu( menu, menu_info_types.CITY_TREASURY_DEPOSIT, SID_TREASURY_DEPOSIT ); - - if (city.isCitizenOfCity(player, city_id) && (player != mayor)) - { - mi.addSubMenu( menu, menu_info_types.SERVER_MENU5, SID_CITY_REVOKE_CITIZENSHIP ); - } - - if (player == mayor) - { - menu = mi.addRootMenu( menu_info_types.CITY_MANAGEMENT, SID_CITY_MANAGEMENT ); - mi.addSubMenu( menu, menu_info_types.CITY_NAME, SID_CITY_NAME ); - if (!city.isCityRegistered( city_id )) - { - mi.addSubMenu( menu, menu_info_types.CITY_REGISTER, SID_CITY_REGISTER ); - } - else - { - mi.addSubMenu( menu, menu_info_types.CITY_REGISTER, SID_CITY_UNREGISTER ); - } - if (city.isCityZoned( city_id )) - { - mi.addSubMenu( menu, menu_info_types.SERVER_MENU2, SID_CITY_UNZONE ); - } - else - { - mi.addSubMenu( menu, menu_info_types.SERVER_MENU2, SID_CITY_ZONE ); - } - mi.addSubMenu( menu, menu_info_types.CITY_MILITIA, SID_CITY_MILITIA ); - mi.addSubMenu( menu, menu_info_types.CITY_TAXES, SID_TREASURY_TAXES ); - mi.addSubMenu( menu, menu_info_types.CITY_TREASURY_WITHDRAW, SID_TREASURY_WITHDRAW ); - mi.addSubMenu( menu, menu_info_types.SERVER_MENU1, SID_CITY_SPECIALIZATIONS ); - - if (!city.isCitizenOfCity( player, city_id )) - { - mi.addSubMenu( menu, menu_info_types.SERVER_MENU8, SID_CITY_FIX_MAYOR ); - } - - if (citySkillTrainersExist(city_id)) - { - mi.addRootMenu( menu_info_types.SERVER_MENU10, SID_CITY_REMOVE_OLD_TRAINERS ); - } - } - - if (isGod( player )) - { - int godMenu = mi.addRootMenu( menu_info_types.ITEM_USE_SELF, SID_CITY_HACKS ); - mi.addSubMenu( godMenu, menu_info_types.SERVER_MENU4, SID_CITY_FORCE_UPDATE ); - mi.addSubMenu( godMenu, menu_info_types.SERVER_MENU6, SID_CITY_RANK_UP ); - mi.addSubMenu( godMenu, menu_info_types.SERVER_MENU7, SID_CITY_RANK_DOWN ); - mi.addSubMenu( godMenu, menu_info_types.CITY_NAME, SID_CITY_NAME ); - mi.addSubMenu( godMenu, menu_info_types.SERVER_MENU9, SID_CITY_MAKE_MAYOR ); - mi.addSubMenu( godMenu, menu_info_types.CITY_ADMIN_1, SID_CITY_RESET_CLONE_DATA ); - mi.addSubMenu( godMenu, menu_info_types.CITY_ADMIN_2, SID_CITY_RESET_SHUTTLE_DATA ); - mi.addSubMenu( godMenu, menu_info_types.CITY_ADMIN_3, SID_CITY_MODIFY_STRUCTURE_LIST ); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - - obj_id structure = getTopMostContainer( self ); - int city_id = findCityByCityHall( structure ); - if (!cityExists( city_id )) - { - return SCRIPT_CONTINUE; - } - obj_id mayor = cityGetLeader( city_id ); - - if (item == menu_info_types.CITY_STATUS) - { - - showCityInfo( player, self, city_id ); - } - else if (item == menu_info_types.CITY_CITIZENS) - { - - showCitizensList( player, self, city_id ); - } - else if (item == menu_info_types.CITY_STRUCTURES) - { - - showStructuresList( player, self, city_id ); - } - else if (item == menu_info_types.CITY_TREASURY) - { - - showTreasuryInfo( player, self, city_id ); - } - else if (item == menu_info_types.CITY_RANK) - { - - showAdvancementInfo( player, self, city_id ); - } - else if (item == menu_info_types.SERVER_MENU3) - { - - showMaintInfo( player, self, city_id ); - } - if (item == menu_info_types.CITY_TREASURY_DEPOSIT) - { - - makeTreasuryDeposit( player, self, city_id ); - } - - if (player == mayor) - { - - if (item == menu_info_types.CITY_NAME) - { - - changeCityName( player, self, city_id ); - } - else if (item == menu_info_types.CITY_TAXES) - { - - adjustTaxes( player, self, city_id ); - } - else if (item == menu_info_types.CITY_MILITIA) - { - - modifyMilitia( player, self, city_id ); - } - else if (item == menu_info_types.CITY_TREASURY_WITHDRAW) - { - - makeTreasuryWithdraw( player, self, city_id ); - } - else if (item == menu_info_types.CITY_REGISTER) - { - - if (!city.isCityRegistered( city_id )) - { - sui.msgbox( self, player, "@city/city:register_d", sui.YES_NO, "@city/city:register_t", sui.MSG_QUESTION, "handleRegisterCity"); - } - else - { - sui.msgbox( self, player, "@city/city:unregister_d", sui.YES_NO, "@city/city:unregister_t", sui.MSG_QUESTION, "handleUnregisterCity"); - } - } - else if (item == menu_info_types.SERVER_MENU1) - { - - changeSpecialization( player, self, city_id ); - } - else if (item == menu_info_types.SERVER_MENU2) - { - - changeZoning( player, self, city_id ); - } - else if (item == menu_info_types.SERVER_MENU8) - { - - if (!city.isCitizenOfCity( mayor, city_id )) - { - citySetCitizenInfo( city_id, mayor, getName(mayor), mayor, city.CP_CITIZEN ); - sendSystemMessage(self, new string_id(STF, "mayor_citizen_restored")); - } - } - else if (item == menu_info_types.SERVER_MENU10) - { - - boolean trainersDestroyed = destroyCitySkillTrainers(mayor, city_id); - if (trainersDestroyed) - { - sendSystemMessage(mayor, new string_id(STF, "old_trainers_removed")); - } - } - } - else - { - if (item == menu_info_types.SERVER_MENU5) - { - - if (city.isCitizenOfCity( player, city_id )) - { - sui.msgbox( self, player, "@city/city:revoke_cit_d", sui.YES_NO, "@city/city:revoke_cit_t", sui.MSG_QUESTION, "handleRevokeCitizenship"); - } - } - } - - if (isGod( player )) - { - if (item == menu_info_types.SERVER_MENU4) - { - - forceUpdate( player, self, city_id ); - } - else if (item == menu_info_types.SERVER_MENU6) - { - - forceRank( player, self, city_id, 1 ); - } - else if (item == menu_info_types.SERVER_MENU7) - { - - forceRank( player, self, city_id, -1 ); - } - else if (item == menu_info_types.SERVER_MENU9) - { - - makeMayor( player, self, city_id ); - } - else if (item == menu_info_types.CITY_ADMIN_1) - { - - resetCloneData( player, self, city_id ); - } - else if (item == menu_info_types.CITY_ADMIN_2) - { - - resetShuttleData( player, self, city_id ); - } - else if (item == menu_info_types.CITY_ADMIN_3) - { - - modifyStructureList( player, self, city_id ); - } - } - - return SCRIPT_CONTINUE; - } - - - public void forceUpdate(obj_id player, obj_id self, int city_id) throws InterruptedException - { - sui.msgbox( self, player, "@city/city:force_election_only", sui.YES_NO, "@city/city:force_city_update_t", sui.MSG_QUESTION, "handleForceUpdateElection"); - } - - - public int handleForceUpdateElection(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId( params ); - obj_id structure = getTopMostContainer( self ); - int city_id = findCityByCityHall( structure ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - sui.msgbox( self, player, "@city/city:confirm_city_update", sui.YES_NO, "@city/city:force_city_update_t", sui.MSG_QUESTION, "handleForceUpdateConfirmed"); - } - else - { - - CustomerServiceLog( "player_city", "!!!!! A CITY ELECTION WAS FORCED !!!!! Player: "+ player + " City: "+ city_id ); - - sendSystemMessageProse(self, prose.getPackage(new string_id (STF, "force_city_election"), city_id)); - - obj_id cityMaster = getMasterCityObject(); - dictionary outparams = new dictionary(); - outparams.put( "city_id", city_id ); - messageTo( cityMaster, "forceElection", outparams, 0.f, false ); - } - - return SCRIPT_CONTINUE; - } - - - public int handleForceUpdateConfirmed(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId( params ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - sui.msgbox( self, player, "@city/city:confirm_disable_cleanup", sui.YES_NO, "@city/city:disable_cleanup_t", sui.MSG_QUESTION, "handleForceUpdateNow"); - - return SCRIPT_CONTINUE; - } - - - public int handleForceUpdateNow(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId( params ); - obj_id structure = getTopMostContainer( self ); - int city_id = findCityByCityHall( structure ); - - dictionary outparams = new dictionary(); - outparams.put( "city_id", city_id ); - int btn = sui.getIntButtonPressed( params ); - if (btn != sui.BP_CANCEL) - { - outparams.put( "no_citizen_cleanup", 1 ); - } - - CustomerServiceLog( "player_city", "!!!!! A CITY UPDATE WAS FORCED !!!!! Player: "+ player + " City: "+ city_id ); - - sendSystemMessageProse(self, prose.getPackage(new string_id (STF, "force_city_update"), city_id)); - - obj_id cityMaster = getMasterCityObject(); - messageTo( cityMaster, "forceUpdate", outparams, 0.f, false ); - - return SCRIPT_CONTINUE; - } - - - public void forceRank(obj_id player, obj_id self, int city_id, int rank) throws InterruptedException - { - utils.setScriptVar( self, "rank_change", rank ); - sui.msgbox( self, player, "@city/city:force_city_rank_d", sui.YES_NO, "@city/city:force_city_rank_t", sui.MSG_QUESTION, "handleForceRankConfirmed"); - } - - - public int handleForceRankConfirmed(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId( params ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id structure = getTopMostContainer( self ); - int city_id = findCityByCityHall( structure ); - - CustomerServiceLog( "player_city", "!!!!! A CITY RANK CHANGE WAS FORCED !!!!! Player: "+ player + " City: "+ city_id ); - - sendSystemMessageProse(self, prose.getPackage(new string_id (STF, "force_city_rank"), city_id)); - - obj_id cityMaster = getMasterCityObject(); - dictionary outparams = new dictionary(); - outparams.put( "city_id", city_id ); - outparams.put( "rank_change", utils.getIntScriptVar( self, "rank_change") ); - messageTo( cityMaster, "forceRank", outparams, 0.f, false ); - - return SCRIPT_CONTINUE; - } - - - public void makeMayor(obj_id player, obj_id self, int city_id) throws InterruptedException - { - - sui.inputbox( self, player, "@city/city:make_mayor_d", sui.OK_CANCEL, "@city/city:make_mayor_t", sui.INPUT_NORMAL, null, "handleMakeMayor", null ); - } - - - public int handleMakeMayor(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - String input_name = sui.getInputBoxText( params ); - obj_id structure = getTopMostContainer( self ); - int city_id = findCityByCityHall( structure ); - obj_id[] citizens = cityGetCitizenIds( city_id ); - for (int i=0; i= 1) - { - string_id sm_garden = new string_id(STF, "small_garden"); - rankInfo = utils.addElement( rankInfo, getString(sm_garden)); - } - if (city_rank >= 2) - { - string_id bank = new string_id(STF, "bank"); - rankInfo = utils.addElement( rankInfo, getString(bank)); - - string_id cantina = new string_id(STF, "cantina"); - rankInfo = utils.addElement( rankInfo, getString(cantina)); - - string_id med_garden = new string_id(STF, "medium_garden"); - rankInfo = utils.addElement( rankInfo, getString(med_garden)); - - string_id garage = new string_id(STF, "garage"); - rankInfo = utils.addElement( rankInfo, getString(garage)); - } - if (city_rank >= 3) - { - string_id cloning = new string_id(STF, "cloning_facility"); - rankInfo = utils.addElement( rankInfo, getString(cloning)); - - string_id hospital = new string_id(STF, "hospital"); - rankInfo = utils.addElement( rankInfo, getString(hospital)); - - string_id lg_garden = new string_id(STF, "large_garden"); - rankInfo = utils.addElement( rankInfo, getString(lg_garden)); - } - if (city_rank >= 4) - { - string_id theater = new string_id(STF, "theater"); - rankInfo = utils.addElement( rankInfo, getString(theater)); - - string_id shuttleport = new string_id(STF, "shuttleport"); - rankInfo = utils.addElement( rankInfo, getString(shuttleport)); - } - - sui.listbox( self, player, "@city/city:rank_info_d", sui.OK_CANCEL, "@city/city:rank_info_t", rankInfo, "handleRankInfo", true ); - - obj_id city_master = getMasterCityObject(); - dictionary outparams = new dictionary(); - outparams.put( "player", player ); - outparams.put( "city_id", city_id ); - messageTo( city_master, "reportUpdateEstimate", outparams, 0.f, false ); - } - - - public void showMaintInfo(obj_id player, obj_id self, int city_id) throws InterruptedException - { - obj_id city_hall = getTopMostContainer( self ); - int city_hall_cost = city.getStructureCost( city_id, city_hall ); - int spec_cost = city.cityGetSpecCost( city_id ); - - int over_cap = 0; - int total_cost = 0; - String[] maintInfo; - int civic_count = city.getCivicCount( city_id ); - int max_civic = city.getMaxCivicCount( city_id ); - if (civic_count > max_civic) - { - over_cap = civic_count - max_civic; - total_cost += 75000 * over_cap; - maintInfo = new String[9]; - } - else - { - maintInfo = new String[7]; - } - - int structures_cost = 0; - int deco_cost = 0; - int other_cost = 0; - obj_id[] structures = cityGetStructureIds( city_id ); - for (int i=0; i max_civic) - { - string_id civ_struc_pen = new string_id(STF, "civic_structure_panalty"); - maintInfo[i++] = "\\#FF0000" + getString(civ_struc_pen) + "\\ " + (75000*over_cap); - string_id you_have = new string_id(STF, "you_have"); - string_id more_than_cap = new string_id(STF, "more_than_cap"); - maintInfo[i++] = " (" + getString(you_have) + over_cap + getString(more_than_cap) + max_civic + ".)"; - } - if (city.isCityRegistered( city_id )) - { - string_id map_reg_cost = new string_id(STF, "map_reg_cost"); - maintInfo[i++] = getString(map_reg_cost); - } - else - { - string_id map_unreg = new string_id(STF, "map_unreg"); - maintInfo[i++] = getString(map_unreg); - } - string_id spec_text = new string_id(STF, "specialization"); - maintInfo[i++] = getString(spec_text) + spec_cost + getString(credits_suffix); - string_id struc_text = new string_id(STF, "structures"); - maintInfo[i++] = getString(struc_text) + structures_cost + getString(credits_suffix); - string_id deco_text = new string_id(STF, "decorations"); - maintInfo[i++] = getString(deco_text) + deco_cost + getString(credits_suffix); - string_id tnt_text = new string_id(STF, "train_and_term"); - maintInfo[i++] = getString(tnt_text) + other_cost + getString(credits_suffix); - - sui.listbox( self, player, "@city/city:maint_info_d", sui.OK_CANCEL, "@city/city:maint_info_t", maintInfo, "handleMaintInfo", true ); - - obj_id city_master = getMasterCityObject(); - dictionary outparams = new dictionary(); - outparams.put( "player", player ); - outparams.put( "city_id", city_id ); - messageTo( city_master, "reportUpdateEstimate", outparams, 0.f, false ); - } - - - public void changeCityName(obj_id player, obj_id self, int city_id) throws InterruptedException - { - - sui.inputbox( self, player, "@city/city:city_name_new_d", sui.OK_CANCEL, "@city/city:city_name_new_t", sui.INPUT_NORMAL, null, "handleSetCityName", null ); - } - - - public int handleSetCityName(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = sui.getPlayerId(params); - String cityName = sui.getInputBoxText( params ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - if ((cityName.equals("")) || isNameReserved(cityName)) - { - - sendSystemMessage( player, SID_OBSCENE ); - sui.inputbox( self, player, "@city/city:city_name_new_d", sui.OK_CANCEL, "@city/city:city_name_new_t", sui.INPUT_NORMAL, null, "handleSetCityName", null ); - return SCRIPT_CONTINUE; - } - - if (cityName.length() > 24) - { - cityName = cityName.substring( 0, 23 ); - } - - if (!city.isUniqueCityName( cityName )) - { - - sendSystemMessage( player, SID_NOT_UNIQUE ); - sui.inputbox( self, player, "@city/city:city_name_new_d", sui.OK_CANCEL, "@city/city:city_name_new_t", sui.INPUT_NORMAL, null, "handleSetCityName", null ); - return SCRIPT_CONTINUE; - } - - obj_id structure = getTopMostContainer( self ); - int city_id = findCityByCityHall( structure ); - if (!cityExists( city_id )) - { - return SCRIPT_CONTINUE; - } - city.setName( city_id, cityName ); - - obj_id mayor = cityGetLeader( city_id ); - sendSystemMessage( mayor, SID_NAME_CHANGED ); - - return SCRIPT_CONTINUE; - } - - - public void modifyMilitia(obj_id player, obj_id self, int city_id) throws InterruptedException - { - - if (!hasCommand( player, "manage_militia" )) - { - sendSystemMessage( player, SID_CANT_MILITIA ); - return; - } - - obj_id[] citizens = cityGetCitizenIds( city_id ); - Vector militiaMembers = new Vector(); - militiaMembers.setSize(0); - militiaMembers = utils.addElement( militiaMembers, "Add Militia Member"); - for (int i=0; i -1) - { - s1 = s1.substring( 0, indexOf ); - } - if (s1.compareTo( s2 ) == 0) - { - - if (city.isCitizenOfCity( players[i], city_id )) - { - city.addMilitia( city_id, players[i] ); - sendSystemMessage( player, SID_ADDED_MILITIA ); - sendSystemMessage( players[i], SID_ADDED_MILITIA_TARGET ); - } - else - { - sendSystemMessage( player, SID_NOT_CITIZEN ); - } - return SCRIPT_CONTINUE; - } - } - - sendSystemMessage( player, SID_CANT_FIND_PLAYER ); - - return SCRIPT_CONTINUE; - } - - - public int handleRemoveMilitiaConfirmed(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId( params ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id structure = getTopMostContainer( self ); - int city_id = findCityByCityHall( structure ); - if (!cityExists( city_id )) - { - return SCRIPT_CONTINUE; - } - - obj_id removeTarget = utils.getObjIdScriptVar( self, "removal.temp"); - if (city.isCitizenOfCity( removeTarget, city_id )) - { - city.removeMilitia( city_id, removeTarget ); - sendSystemMessage( player, SID_REMOVED_MILITIA ); - sendSystemMessage( removeTarget, SID_REMOVED_MILITIA_TARGET ); - } - else - { - sendSystemMessage( player, SID_NOT_CITIZEN ); - } - - return SCRIPT_CONTINUE; - } - - - public void showTreasuryInfo(obj_id player, obj_id self, int city_id) throws InterruptedException - { - obj_id structure = getTopMostContainer( self ); - String[] treasury_info = new String[6]; - treasury_info[0] = "Balance: " + getBankBalance( structure ); - obj_id city = cityGetCityHall(city_id); - String city_name = cityGetName(city_id); - String garage = city_name + ".garageFee"; - if (!hasObjVar(city, garage)) - { - setObjVar(city, garage, 0); - } - - int income_tax = cityGetIncomeTax( city_id ); - int property_tax = cityGetPropertyTax( city_id ); - int sales_tax = cityGetSalesTax( city_id ); - int travel_fee = cityGetTravelCost( city_id ); - int garage_fee = getIntObjVar(city, garage); - - treasury_info[1] = "@city/city:income_tax" + " -- " + income_tax + " cr"; - treasury_info[2] = "@city/city:property_tax" + " -- " + property_tax + "%"; - treasury_info[3] = "@city/city:sales_tax" + " -- " + sales_tax + "%"; - treasury_info[4] = "@city/city:travel_tax" + " -- " + travel_fee + " cr"; - treasury_info[5] = "@city/city:garage_tax" + " -- " + garage_fee + "%"; - - sui.listbox( self, player, "@city/city:treasury_balance_d", sui.OK_CANCEL, "@city/city:treasury_balance_t", treasury_info, "handleTreasuryInfoSelect", true ); - } - - - public void makeTreasuryDeposit(obj_id player, obj_id self, int city_id) throws InterruptedException - { - obj_id structure = getTopMostContainer( self ); - int total = getTotalMoney( player ); - if (total > 0) - { - int maint_pool = getBankBalance( structure ); - int pid = sui.transfer( self, player, "@city/city:treasury_deposit_d", "@city/city:treasury_deposit", "@city/city:total_funds", total, "@city/city:treasury", 0, "depositTreasury"); - } - else - { - - sendSystemMessage( player, SID_NO_MONEY ); - } - } - - - public int depositTreasury(obj_id self, dictionary params) throws InterruptedException - { - obj_id structure = getTopMostContainer( self ); - obj_id player = sui.getPlayerId( params ); - int bp = sui.getIntButtonPressed( params ); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int total = getTotalMoney( player ); - int end_bal = sui.getTransferInputFrom( params ); - - int amt = total - end_bal; - if (amt < 0) - { - sendSystemMessage(player, new string_id(STF, "positive_deposit")); - } - else if (amt == 0) - { - return SCRIPT_CONTINUE; - } - else - { - sendSystemMessageProse(self, prose.getPackage(new string_id (STF, "deposit_treasury"), amt)); - money.requestPayment( player, structure, amt, "handlePayment", null ); - } - - return SCRIPT_CONTINUE; - } - - - public void makeTreasuryWithdraw(obj_id player, obj_id self, int city_id) throws InterruptedException - { - sui.inputbox( self, player, "@city/city:withdraw_reason_d", sui.OK_CANCEL, "@city/city:withdraw_reason_t", sui.INPUT_NORMAL, null, "handleWithdrawReason", null ); - } - - - public int handleWithdrawReason(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = sui.getPlayerId(params); - String withdraw_reason = sui.getInputBoxText( params ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - utils.setScriptVar( self, "withdrawReason", withdraw_reason ); - - obj_id structure = getTopMostContainer( self ); - int total = getBankBalance( structure ); - if (total > 0) - { - int player_cash = getCashBalance( player ); - int pid = sui.transfer( self, player, "@city/city:treasury_withdraw_prompt", "@city/city:treasury_withdraw", "@city/city:treasury", total, "@city/city:funds", 0, "withdrawTreasury"); - } - else - { - - sendSystemMessage( player, SID_NO_MONEY ); - } - - return SCRIPT_CONTINUE; - } - - - public int withdrawTreasury(obj_id self, dictionary params) throws InterruptedException - { - obj_id structure = getTopMostContainer( self ); - int city_id = findCityByCityHall( structure ); - obj_id player = sui.getPlayerId( params ); - int bp = sui.getIntButtonPressed( params ); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - int total = getBankBalance( structure ); - int end_bal = sui.getTransferInputFrom( params ); - - if (hasObjVar( self, "lastWithdrawTime" )) - { - int lastWithdrawTime = getIntObjVar( self, "lastWithdrawTime"); - if (getGameTime() - lastWithdrawTime < 86400) - { - sendSystemMessage( player, SID_WITHDRAW_DAILY ); - return SCRIPT_CONTINUE; - } - } - - int amt = total - end_bal; - if (amt < 0) - { - sendSystemMessage(player, new string_id(STF, "withdraw_treasury")); - } - else if (amt == 0) - { - return SCRIPT_CONTINUE; - } - else - { - if ((amt < 5000) || (amt > 50000)) - { - sendSystemMessage( player, SID_WITHDRAW_LIMITS ); - return SCRIPT_CONTINUE; - } - - dictionary payparams = new dictionary(); - payparams.put( "city_id", city_id ); - payparams.put( "amt", amt ); - payparams.put( "player", player ); - transferBankCreditsTo( structure, player, amt, "handleWithdrawSuccess", "handleWithdrawFail", payparams ); - } - - return SCRIPT_CONTINUE; - } - - - public int handleWithdrawSuccess(obj_id self, dictionary params) throws InterruptedException - { - int city_id = params.getInt( "city_id"); - int amt = params.getInt( "amt"); - obj_id player = params.getObjId( "player"); - - setObjVar( self, "lastWithdrawTime", getGameTime() ); - prose_package ppWithdraw = prose.getPackage(SID_YOU_WITHDRAW_FROM_TREASURY); - prose.setDI(ppWithdraw, amt); - sendSystemMessageProse( player, ppWithdraw ); - - CustomerServiceLog( "player_city", "Mayor withdrew from treasury. City: "+ city_id + " Amt: "+ amt + " Player: "+ player ); - - obj_id mayor = cityGetLeader( city_id ); - String mayor_name = cityGetCitizenName( city_id, mayor ); - String citizen_name = ""; - String withdraw_reason = utils.getStringScriptVar( self, "withdrawReason"); - obj_id[] citizens = cityGetCitizenIds( city_id ); - for (int i=0; i TAX_MAX[set_tax]) - { - sendSystemMessage( player, SID_TAX_OUT_OF_RANGE ); - return SCRIPT_CONTINUE; - } - - obj_id mayor = cityGetLeader( city_id ); - String mayor_name = cityGetCitizenName( city_id, mayor ); - String city_name = cityGetName( city_id ); - obj_id[] citizens = cityGetCitizenIds( city_id ); - prose_package pp = null; - switch( set_tax ) - { - case 0: - city.setIncomeTax( city_id, desired_tax ); - pp = prose.getPackage( SID_INCOME_TAX, desired_tax ); - - for (int i=0; i -1) - { - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } - - - public int checkScene(obj_id self, obj_id player) throws InterruptedException - { - if (!isValidId(self) || !isValidId(player)) - { - return -1; - } - - String scene = getCurrentSceneName(); - int gcwPlanetIndex = -1; - - for (int i = 0; i < PLANETS_DATA[0].length; i++) - { - testAbortScript(); - if (PLANETS_DATA[0][i].equals(scene)) - { - gcwPlanetIndex = i; - } - } - return gcwPlanetIndex; - } - - - public String getSpecificPlanetData(obj_id self, obj_id player, obj_id planetId, String gcwData, String planet, String planetName) throws InterruptedException - { - if (!isValidId(self) || !exists(self) || !isValidId(player) || !exists(player) || !isValidId(planetId) || !exists(planetId)) - { - return null; - } - else if (planet == null || planet.equals("") || planetName == null || planetName.equals("")) - { - return null; - } - - int maxPlanet = gcw.getCurrentPlanetaryFactionBaseMaxPlanet(planet); - - gcwData += sui.colorGreen() + planetName + sui.colorWhite() + sui.newLine() ; - - String planetScoreReb = "Unknown"; - String planetScoreImp = "Unknown"; - - if (utils.hasScriptVar(self, "Rebel."+ planet +".controlScore")) - { - planetScoreReb = ""+ utils.getIntScriptVar(self, "Rebel."+ planet +".controlScore"); - } - if (utils.hasScriptVar(self, "Imperial."+ planet +".controlScore")) - { - planetScoreImp = ""+ utils.getIntScriptVar(self, "Imperial."+ planet +".controlScore"); - } - - gcwData += sui.colorGreen() + " Planetary Score Rebel: "+ sui.colorWhite() + planetScoreReb + sui.newLine(); - gcwData += sui.colorGreen() + " Planetary Score Imperial: "+ sui.colorWhite() + planetScoreImp + sui.newLine(); - - gcwData += sui.colorBlue() + " Total Player Bases: "+ sui.colorWhite() + gcw.getCurrentPlanetaryFactionBaseCountPlanet(planet) + sui.newLine(); - gcwData += sui.colorBlue() + " Total Player Base Max: "+ sui.colorWhite() + maxPlanet + sui.newLine(); - gcwData += sui.colorBlue() + " Total Imperial Bases: "+ sui.colorWhite() + gcw.getImperialBaseCount(planetId) + sui.newLine(); - gcwData += sui.colorBlue() + " Total Alliance Bases: "+ sui.colorWhite() + gcw.getRebelBaseCount(planetId) + sui.newLine(); - - if (utils.hasScriptVarTree(planetId, gcw.VAR_BASE_HACK_DICTIONARY)) - { - gcwData += sui.colorRed() + getPlayerBaseData(player, planetId, maxPlanet) + sui.colorWhite(); - } - - if (planet.equals("corellia") || planet.equals("naboo") || planet.equals("talus")) - { - gcwData += sui.colorOrange(); - if (utils.hasScriptVar(planetId, VAR_BASE_STATUS)) - { - gcwData += "GCW BASE: "+ getStaticBaseData(utils.getIntScriptVar(planetId, VAR_BASE_STATUS)); - if (utils.hasScriptVar(planetId, VAR_TERMINAL_STATUS)) - { - gcwData += getTerminalData(utils.getIntArrayScriptVar(planetId, VAR_TERMINAL_STATUS)); - } - } - gcwData += sui.colorWhite(); - } - - if (planet.equals("corellia") || planet.equals("naboo") || planet.equals("talus") || planet.equals("rori") || planet.equals("dantooine") || planet.equals("lok") || planet.equals("tatooine")) - { - gcwData += " "+ getCurrentSceneCityHallCount(planet) + sui.newLine(); - gcwData += " "+ getMaxSceneCityHallCount(planet) + sui.newLine(); - } - - gcwData += sui.newLine(); - - return gcwData; - } - - - public String getCurrentSceneCityHallCount(String planetName) throws InterruptedException - { - if (planetName == null || planetName.equals("")) - { - return null; - } - - int citiesOnPlanet = 0; - int[] cityIds = getAllCityIds(); - if (cityIds == null) - { - return null; - } - for (int i = 0; i < cityIds.length; i++) - { - testAbortScript(); - location city_loc = cityGetLocation(cityIds[i]); - if (city_loc.area.equals(planetName)) - { - citiesOnPlanet++; - } - } - return "Total City Halls: "+citiesOnPlanet; - } - - - public String getMaxSceneCityHallCount(String planetName) throws InterruptedException - { - if (planetName == null || planetName.equals("")) - { - return null; - } - - int maxCityHalls = 0; - String[] allPlanets = dataTableGetStringColumn( "datatables/city/city_limits.iff", "SCENE"); - if (allPlanets == null) - { - return null; - } - - for (int i=0; i < allPlanets.length; i++) - { - testAbortScript(); - if (allPlanets[i].equals(planetName)) - { - maxCityHalls = dataTableGetInt( "datatables/city/city_limits.iff", i, "MAX_CITIES"); - break; - } - } - return "Maximum City Halls: "+maxCityHalls; - } - - - public boolean blog(String msg) throws InterruptedException - { - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_guild.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_guild.java deleted file mode 100644 index a03d334c4..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_guild.java +++ /dev/null @@ -1,2043 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.guild; -import script.library.player_structure; -import script.library.sui; -import script.library.utils; -import script.library.prose; - - - -public class terminal_guild extends script.terminal.base.base_terminal -{ - public terminal_guild() - { - } - public static final string_id SID_GUILD_GUILD_MANAGEMENT = new string_id ("guild", "menu_guild_management"); - public static final string_id SID_GUILD_MEMBER_MANAGEMENT = new string_id ("guild", "menu_member_management"); - public static final string_id SID_GUILD_CREATE = new string_id ("guild", "menu_create"); - public static final string_id SID_GUILD_INFO = new string_id ("guild", "menu_info"); - public static final string_id SID_GUILD_MEMBERS = new string_id ("guild", "menu_members"); - public static final string_id SID_GUILD_SPONSORED = new string_id ("guild", "menu_sponsored"); - public static final string_id SID_GUILD_ENEMIES = new string_id ("guild", "menu_enemies"); - public static final string_id SID_GUILD_SPONSOR = new string_id ("guild", "menu_sponsor"); - public static final string_id SID_GUILD_DISBAND = new string_id ("guild", "menu_disband"); - public static final string_id SID_GUILD_NAMECHANGE = new string_id ("guild", "menu_namechange"); - public static final string_id SID_GUILD_SPONSOR_ACCEPT = new string_id ("guild", "sponsor_accept"); - public static final string_id SID_GUILD_SPONSOR_DECLINE = new string_id ("guild", "sponsor_decline"); - public static final string_id SID_GUILD_SPONSOR_NOT_FOUND = new string_id ("guild", "sponsor_not_found"); - public static final string_id SID_GUILD_SPONSOR_ALREADY_IN_GUILD = new string_id ("guild", "sponsor_already_in_guild"); - - public static final String STR_GUILD_ALLEGIENCE = "@guild:allegiance"; - public static final String STR_GUILD_TITLE = "@guild:title"; - public static final String STR_GUILD_KICK = "@guild:kick"; - public static final String STR_GUILD_PERMISSIONS = "@guild:permissions"; - public static final String STR_GUILD_SPONSOR_PROMPT = "@guild:sponsor_prompt"; - public static final String STR_GUILD_SPONSOR_TITLE = "@guild:sponsor_title"; - public static final String STR_GUILD_ADD_ENEMY = "@guild:add_enemy"; - public static final String STR_GUILD_ENEMIES_PROMPT = "@guild:enemies_prompt"; - public static final String STR_GUILD_ENEMIES_TITLE = "@guild:enemies_title"; - public static final String STR_GUILD_SPONSORED_PROMPT = "@guild:sponsored_prompt"; - public static final String STR_GUILD_SPONSORED_TITLE = "@guild:sponsored_title"; - public static final String STR_GUILD_MEMBERS_PROMPT = "@guild:members_prompt"; - public static final String STR_GUILD_MEMBERS_TITLE = "@guild:members_title"; - public static final String STR_GUILD_DISBAND_TITLE = "@guild:disband_title"; - public static final String STR_GUILD_DISBAND_PROMPT = "@guild:disband_prompt"; - public static final String STR_GUILD_CREATE_NAME_PROMPT = "@guild:create_name_prompt"; - public static final String STR_GUILD_CREATE_NAME_TITLE = "@guild:create_name_title"; - public static final String STR_GUILD_CREATE_ABBREV_PROMPT = "@guild:create_abbrev_prompt"; - public static final String STR_GUILD_CREATE_ABBREV_TITLE = "@guild:create_abbrev_title"; - public static final String STR_GUILD_NAMECHANGE_NAME_PROMPT = "@guild:namechange_name_prompt"; - public static final String STR_GUILD_NAMECHANGE_NAME_TITLE = "@guild:namechange_name_title"; - public static final String STR_GUILD_NAMECHANGE_ABBREV_PROMPT = "@guild:namechange_abbrev_prompt"; - public static final String STR_GUILD_NAMECHANGE_ABBREV_TITLE = "@guild:namechange_abbrev_title"; - public static final String STR_GUILD_SPONSOR_VERIFY_PROMPT = "@guild:sponsor_verify_prompt"; - public static final String STR_GUILD_SPONSOR_VERIFY_TITLE = "@guild:sponsor_verify_title"; - public static final String STR_GUILD_MEMBER_OPTIONS_PROMPT = "@guild:member_options_prompt"; - public static final String STR_GUILD_MEMBER_OPTIONS_TITLE = "@guild:member_options_title"; - public static final String STR_GUILD_ACCEPT = "@guild:accept"; - public static final String STR_GUILD_DECLINE = "@guild:decline"; - public static final String STR_GUILD_SPONSORED_OPTIONS_PROMPT = "@guild:sponsored_options_prompt"; - public static final String STR_GUILD_SPONSORED_OPTIONS_TITLE = "@guild:sponsored_options_title"; - public static final String STR_GUILD_WAR_ENEMY_NAME_PROMPT = "@guild:war_enemy_name_prompt"; - public static final String STR_GUILD_WAR_ENEMY_NAME_TITLE = "@guild:war_enemy_name_title"; - public static final String STR_GUILD_TITLE_PROMPT = "@guild:title_prompt"; - public static final String STR_GUILD_TITLE_TITLE = "@guild:title_title"; - public static final String STR_GUILD_KICK_PROMPT = "@guild:kick_prompt"; - public static final String STR_GUILD_KICK_TITLE = "@guild:kick_title"; - public static final String STR_GUILD_PERMISSIONS_PROMPT = "@guild:permissions_prompt"; - public static final String STR_GUILD_PERMISSIONS_TITLE = "@guild:permissions_title"; - public static final String STR_GUILD_INFO_TITLE = "@guild:info_title"; - public static final String STR_GUILD_PERMISSION_MAIL_YES = "@guild:permission_mail_yes"; - public static final String STR_GUILD_PERMISSION_MAIL_NO = "@guild:permission_mail_no"; - public static final String STR_GUILD_PERMISSION_SPONSOR_YES = "@guild:permission_sponsor_yes"; - public static final String STR_GUILD_PERMISSION_SPONSOR_NO = "@guild:permission_sponsor_no"; - public static final String STR_GUILD_PERMISSION_TITLE_YES = "@guild:permission_title_yes"; - public static final String STR_GUILD_PERMISSION_TITLE_NO = "@guild:permission_title_no"; - public static final String STR_GUILD_PERMISSION_ACCEPT_YES = "@guild:permission_accept_yes"; - public static final String STR_GUILD_PERMISSION_ACCEPT_NO = "@guild:permission_accept_no"; - public static final String STR_GUILD_PERMISSION_KICK_YES = "@guild:permission_kick_yes"; - public static final String STR_GUILD_PERMISSION_KICK_NO = "@guild:permission_kick_no"; - public static final String STR_GUILD_PERMISSION_WAR_YES = "@guild:permission_war_yes"; - public static final String STR_GUILD_PERMISSION_WAR_NO = "@guild:permission_war_no"; - public static final String STR_GUILD_PERMISSION_NAMECHANGE_YES = "@guild:permission_namechange_yes"; - public static final String STR_GUILD_PERMISSION_NAMECHANGE_NO = "@guild:permission_namechange_no"; - public static final String STR_GUILD_PERMISSION_DISBAND_YES = "@guild:permission_disband_yes"; - public static final String STR_GUILD_PERMISSION_DISBAND_NO = "@guild:permission_disband_no"; - - public static final string_id SID_GUILD_LEADER_CHANGE = new string_id ("guild", "menu_leader_change"); - public static final string_id SID_GUILD_ENABLE_ELECTIONS = new string_id ("guild", "menu_enable_elections"); - public static final string_id SID_GUILD_DISABLE_ELECTIONS = new string_id ("guild", "menu_disable_elections"); - - public static final string_id SID_LEADER_RACE = new string_id ("guild", "menu_leader_race"); - public static final string_id SID_LEADER_STANDINGS = new string_id ("guild", "menu_leader_standings"); - public static final string_id SID_LEADER_VOTE = new string_id ("guild", "menu_leader_vote"); - public static final string_id SID_LEADER_REGISTER = new string_id ("guild", "menu_leader_register"); - public static final string_id SID_LEADER_UNREGISTER = new string_id ("guild", "menu_leader_unregister"); - public static final string_id SID_RESET_VOTING = new string_id ("guild", "menu_leader_reset_vote"); - public static final string_id SID_NO_CANDIDATES = new string_id ("guild", "vote_no_candidates"); - public static final string_id SID_VOTE_PLACED = new string_id ("guild", "vote_placed"); - public static final string_id SID_VOTE_ABSTAIN = new string_id ("guild", "vote_abstain"); - public static final string_id SID_REGISTER_DUPE = new string_id ("guild", "vote_register_dupe"); - public static final string_id SID_NOT_REGISTERED = new string_id ("guild", "vote_not_registered"); - public static final string_id SID_UNREGISTERED = new string_id ("guild", "vote_unregistered"); - public static final string_id SID_REGISTER_CONGRATS = new string_id ("guild", "vote_register_congrats"); - public static final string_id SID_ELECTIONS_OPEN = new string_id ("guild", "vote_elections_open"); - public static final string_id SID_ELECTIONS_CLOSED = new string_id ("guild", "vote_elections_closed"); - - public static final string_id SID_ALREADY_LEADER = new string_id ("guild", "already_leader"); - - public static final string_id OPEN_ELECTIONS_EMAIL_BODY = new string_id ("guild", "open_elections_email_body"); - public static final string_id OPEN_ELECTIONS_EMAIL_SUBJECT = new string_id ("guild", "open_elections_email_subject"); - public static final string_id CLOSED_ELECTIONS_EMAIL_BODY = new string_id ("guild", "closed_elections_email_body"); - public static final string_id CLOSED_ELECTIONS_EMAIL_SUBJECT = new string_id ("guild", "closed_elections_email_subject"); - public static final string_id OPEN_ELECTIONS_ABSENT_EMAIL_BODY = new string_id ("guild", "open_elections_absent_email_body"); - public static final string_id OPEN_ELECTIONS_ABSENT_EMAIL_SUBJECT = new string_id ("guild", "open_elections_absent_email_subject"); - - public static final string_id SID_NEED_ACCEPT_HALL = new string_id ("guild", "need_accept_hall"); - public static final string_id SID_ACCEPT_HALL = new string_id ("guild", "accept_hall"); - public static final string_id SID_TERMINAL_LOCKED = new string_id ("guild", "terminal_locked"); - public static final string_id SID_NO_LOTS = new string_id ("guild", "no_lots"); - - public static final string_id SID_ML_NOT_LOADED = new string_id ("guild", "ml_not_loaded"); - public static final string_id SID_ML_NO_LOTS_FREE = new string_id ("guild", "ml_no_lots_free"); - public static final string_id SID_ML_TRIAL = new string_id ("guild", "ml_trial"); - public static final string_id SID_ML_SUCCESS = new string_id ("guild", "ml_success"); - public static final string_id SID_ML_REJECTED = new string_id ("guild", "ml_rejected"); - public static final string_id SID_ML_YOU_ARE_LEADER = new string_id ("guild", "ml_you_are_leader"); - public static final string_id SID_ML_FAIL = new string_id ("guild", "ml_fail"); - - public static final string_id SID_PA_OWNER_NOW = new string_id ("guild", "pa_owner_now"); - - public static final int DISBAND_CHECK_TIME = 60*60*2; - public static final float TERMINAL_USE_DISTANCE = 8.0f; - - public static final int LEADER_ABSENT_TIME = 60*60*24*28; - public static final int ELECTIONS_COMPLETE = 60*60*24*14; - - public static final String SID_VOTING_ENABLED = "@guild:voting_enabled"; - public static final String SID_VOTING_DISABLED = "@guild:voting_disabled"; - - - public int getStructureGuildId(obj_id self) throws InterruptedException - { - - int guildId = 0; - obj_id structure = player_structure.getStructure(self); - if (isIdValid(structure) && hasObjVar(structure, "player_structure.owner") && hasObjVar(structure, "guildId")) - { - guildId = getIntObjVar(structure, "guildId"); - if (guildId != 0 && !guildExists(guildId)) - { - removeObjVar(structure, "guildId"); - guildId = 0; - } - } - - if (guildId == 0 && hasObjVar(self, "guildId")) - { - guildId = getIntObjVar(self, "guildId"); - if (guildId != 0 && !guildExists(guildId)) - { - removeObjVar(self, "guildId"); - guildId = 0; - } - } - return guildId; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "checkDisband", null, DISBAND_CHECK_TIME, false); - - obj_id structure = player_structure.getStructure(self); - if (isIdValid(structure)) - { - if (!hasObjVar(structure, player_structure.VAR_IS_GUILD_HALL)) - { - setObjVar(structure, player_structure.VAR_IS_GUILD_HALL, 1); - } - setObjVar( self, "pa_hall", structure ); - if (hasObjVar( structure, "elections" )) - { - setObjVar( self, "elections", getIntObjVar( structure, "elections") ); - } - } - - obj_id pa_hall = player_structure.getStructure( self ); - if (!hasScript( pa_hall, "guild.pa_hall_vote" )) - { - attachScript( pa_hall, "guild.pa_hall_vote"); - } - setObjVar( pa_hall, "vote_terminal", self ); - - return super.OnInitialize(self); - } - - - public int OnGetAttributes(obj_id self, obj_id player, String[] names, String[] attribs) throws InterruptedException - { - int idx = utils.getValidAttributeIndex(names); - if (idx == -1) - { - return SCRIPT_CONTINUE; - } - - if (exists(self)) - { - - obj_id pa_hall = getTopMostContainer(self); - if (isValidId(pa_hall) && exists(pa_hall)) - { - int guildId = getStructureGuildId(self); - if (guildId > -1) - { - String guildName = guildGetName(guildId); - if (!guildName.equals("")) - { - names[idx] = "guild_name"; - attribs[idx] = guildName; - idx++; - } - String guildAbbrev = guildGetAbbrev(guildId); - if (!guildName.equals("")) - { - names[idx] = "guild_abbrev"; - attribs[idx] = guildAbbrev; - idx++; - } - - obj_id guildLeader = guildGetLeader(guildId); - if (isValidId(guildLeader)) - { - names[idx] = "guild_leader"; - attribs[idx] = guildGetMemberName(guildId, guildLeader); - idx++; - } - - names[idx] = "elections"; - if (hasObjVar( self, "elections" )) - { - attribs[idx] = SID_VOTING_ENABLED; - } - else - { - attribs[idx] = SID_VOTING_DISABLED; - } - idx++; - - if (hasObjVar( self, "elections")) - { - names[idx] = "elections_countdown"; - int electionCompleted = (getIntObjVar(self, "elections") + ELECTIONS_COMPLETE) - getGameTime(); - attribs[idx] = utils.assembleTimeRemainToUse(electionCompleted); - idx++; - - obj_id[] candidates = getObjIdArrayObjVar( pa_hall, "candidate_list"); - if (candidates != null) - { - for (int i=0; i < candidates.length; i++) - { - testAbortScript(); - if (candidates[i] == guildLeader) - { - names[idx] = "incumbent"; - attribs[idx] = guildGetMemberName(guildId, guildLeader); - idx++; - } - else - { - names[idx] = "candidate"; - attribs[idx] = guildGetMemberName(guildId, candidates[i]); - idx++; - } - } - } - } - } - } - } - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (outOfRange(self, player)) - { - return super.OnObjectMenuRequest(self, player, mi); - } - - int guildId = getStructureGuildId(self); - - obj_id structure = player_structure.getStructure(self); - String pa_owner = getStringObjVar( structure, "player_structure.owner"); - - if (guildId == 0) - { - if (isIdValid(structure) && hasObjVar(structure, "player_structure.owner")) - { - String ownerName = getStringObjVar(structure, "player_structure.owner"); - String firstName = getFirstName(player); - if (ownerName.toUpperCase().equals(firstName.toUpperCase())) - { - - guildId = getGuildId(player); - if (guildId != 0) - { - setObjVar(structure, "guildId", guildId); - permissionsAddAllowed(structure, "Guild:"+guildGetAbbrev(guildId)); - } - else - { - mi.addRootMenu(menu_info_types.SERVER_GUILD_CREATE, SID_GUILD_CREATE); - } - } - } - } - - if (guildId != 0 && (getGuildId(player) == guildId || isGod(player))) - { - int guildManagementMenu = mi.addRootMenu(menu_info_types.SERVER_GUILD_GUILD_MANAGEMENT, SID_GUILD_GUILD_MANAGEMENT); - mi.addSubMenu(guildManagementMenu, menu_info_types.SERVER_GUILD_INFO, SID_GUILD_INFO); - mi.addSubMenu(guildManagementMenu, menu_info_types.SERVER_GUILD_ENEMIES, SID_GUILD_ENEMIES); - if (guild.hasGuildPermission(guildId, player, guild.GUILD_PERMISSION_DISBAND)) - { - mi.addSubMenu(guildManagementMenu, menu_info_types.SERVER_GUILD_DISBAND, SID_GUILD_DISBAND); - } - if (guild.hasGuildPermission(guildId, player, guild.GUILD_PERMISSION_NAMECHANGE)) - { - mi.addSubMenu(guildManagementMenu, menu_info_types.SERVER_GUILD_NAMECHANGE, SID_GUILD_NAMECHANGE); - } - if (player == guildGetLeader(guildId)) - { - if (hasObjVar( self, "elections" )) - { - mi.addSubMenu(guildManagementMenu, menu_info_types.SERVER_MENU2, SID_GUILD_DISABLE_ELECTIONS); - } - else - { - mi.addSubMenu(guildManagementMenu, menu_info_types.SERVER_MENU2, SID_GUILD_ENABLE_ELECTIONS); - } - - String player_whole_name = guildGetMemberName( guildId, player ); - java.util.StringTokenizer tok = new java.util.StringTokenizer( player_whole_name ); - String player_name = tok.nextToken(); - if (!player_name.equalsIgnoreCase( pa_owner )) - { - - obj_id pa_owner_id = getPlayerIdFromFirstName( pa_owner ); - int login_date = getPlayerLastLoginTime( pa_owner_id ); - long current_date = System.currentTimeMillis() / 1000; - if (current_date - login_date > LEADER_ABSENT_TIME) - { - - mi.addRootMenu( menu_info_types.SERVER_MENU9, SID_ACCEPT_HALL ); - } - } - } - - int memberManagementMenu = mi.addRootMenu(menu_info_types.SERVER_GUILD_MEMBER_MANAGEMENT, SID_GUILD_MEMBER_MANAGEMENT); - mi.addSubMenu(memberManagementMenu, menu_info_types.SERVER_GUILD_MEMBERS, SID_GUILD_MEMBERS); - if (guild.hasSponsoredMembers(guildId)) - { - mi.addSubMenu(memberManagementMenu, menu_info_types.SERVER_GUILD_SPONSORED, SID_GUILD_SPONSORED); - } - if (guild.hasGuildPermission(guildId, player, guild.GUILD_PERMISSION_SPONSOR)) - { - mi.addSubMenu(memberManagementMenu, menu_info_types.SERVER_GUILD_SPONSOR, SID_GUILD_SPONSOR); - } - if (player == guildGetLeader(guildId)) - { - mi.addSubMenu(memberManagementMenu, menu_info_types.SERVER_MENU1, SID_GUILD_LEADER_CHANGE); - } - - if (hasObjVar( self, "elections" )) - { - - int menu = mi.addRootMenu( menu_info_types.SERVER_MENU3, SID_LEADER_RACE ); - - mi.addSubMenu( menu, menu_info_types.SERVER_MENU4, SID_LEADER_STANDINGS ); - mi.addSubMenu( menu, menu_info_types.SERVER_MENU5, SID_LEADER_VOTE ); - - if (!isRegisteredToRun( player, self )) - { - mi.addSubMenu( menu, menu_info_types.SERVER_MENU6, SID_LEADER_REGISTER ); - } - else - { - mi.addSubMenu( menu, menu_info_types.SERVER_MENU7, SID_LEADER_UNREGISTER ); - } - - } - } - - return super.OnObjectMenuRequest(self, player, mi); - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - int guildId = getStructureGuildId(self); - obj_id structure = player_structure.getStructure(self); - String pa_owner = getStringObjVar( structure, "player_structure.owner"); - - String leader_name = null; - if (guildId != 0) - { - String leader_whole_name = guildGetMemberName( guildId, guildGetLeader(guildId) ); - if (leader_whole_name != null) - { - java.util.StringTokenizer tok = new java.util.StringTokenizer( leader_whole_name ); - leader_name = tok.nextToken(); - } - } - - if (guildId == 0) - { - - if (getGuildId(player) == 0) - { - if (isIdValid(structure)) - { - String ownerName = getStringObjVar(structure, "player_structure.owner"); - String firstName = getFirstName(player); - if (ownerName.toUpperCase().equals(firstName.toUpperCase())) - { - sui.inputbox( - self, - player, - STR_GUILD_CREATE_NAME_PROMPT, - sui.OK_CANCEL, - STR_GUILD_CREATE_NAME_TITLE, - sui.INPUT_NORMAL, - null, - "onGuildCreateNameResponse"); - } - } - } - } - else if (getGuildId(player) == guildId || isGod(player)) - { - if (item == menu_info_types.ITEM_USE || item == menu_info_types.SERVER_GUILD_INFO) - { - showGuildInfo(self, player); - } - else if (item == menu_info_types.SERVER_GUILD_ENEMIES) - { - showGuildEnemies(self, player); - } - else if (item == menu_info_types.SERVER_GUILD_SPONSORED) - { - showGuildSponsored(self, player); - } - else if (item == menu_info_types.SERVER_GUILD_MEMBERS) - { - showGuildMembers(self, player); - } - else if (item == menu_info_types.SERVER_GUILD_SPONSOR) - { - sui.inputbox( - self, - player, - STR_GUILD_SPONSOR_PROMPT, - sui.OK_CANCEL, - STR_GUILD_SPONSOR_TITLE, - sui.INPUT_NORMAL, - null, - "onGuildSponsorResponse"); - } - else if (item == menu_info_types.SERVER_GUILD_DISBAND) - { - sui.msgbox( - self, - player, - STR_GUILD_DISBAND_PROMPT, - sui.YES_NO, - STR_GUILD_DISBAND_TITLE, - sui.MSG_NORMAL, - "onGuildDisbandResponse"); - } - else if (item == menu_info_types.SERVER_GUILD_NAMECHANGE) - { - sui.inputbox( - self, - player, - STR_GUILD_NAMECHANGE_NAME_PROMPT, - sui.OK_CANCEL, - STR_GUILD_NAMECHANGE_NAME_TITLE, - sui.INPUT_NORMAL, - null, - "onGuildNamechangeNameResponse"); - } - else if (item == menu_info_types.SERVER_MENU1) - { - if (player == guildGetLeader(guildId)) - { - sui.inputbox( self, player, "@guild:make_leader_d", sui.OK_CANCEL, "@guild:make_leader_t", sui.INPUT_NORMAL, null, "handleMakeLeader", null ); - } - } - else if (item == menu_info_types.SERVER_MENU2) - { - toggleElections( self, player ); - sendDirtyObjectMenuNotification(self); - } - - if (item == menu_info_types.SERVER_MENU3 || item == menu_info_types.SERVER_MENU4) - { - - showStandings( self, player ); - } - else if (item == menu_info_types.SERVER_MENU5) - { - - placeVote( self, player ); - } - else if (item == menu_info_types.SERVER_MENU6) - { - - registerToRun( self, player ); - } - else if (item == menu_info_types.SERVER_MENU7) - { - - unregisterFromRace( self, player ); - } - else if (item == menu_info_types.SERVER_MENU8) - { - - } - else if ((leader_name == null) || !leader_name.equalsIgnoreCase( pa_owner )) - { - - if (player == guildGetLeader(guildId) && item == menu_info_types.SERVER_MENU9) - { - obj_id pa_owner_id = getPlayerIdFromFirstName( pa_owner ); - int login_date = getPlayerLastLoginTime( pa_owner_id ); - long current_date = System.currentTimeMillis() / 1000; - if (current_date - login_date > LEADER_ABSENT_TIME) - { - acceptPAHall( self, player ); - } - } - } - } - return SCRIPT_CONTINUE; - } - - - public int selectPermissionsMessage(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - String name = params.getString("name"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - int guildId = getStructureGuildId(self); - - obj_id target = guild.findMemberIdByName(guildId, name, false, true); - setMenuContextString(self, player, "guildPermissionsTarget", name); - - String[] perms = new String[8]; - - if (guild.hasGuildPermission(guildId, target, guild.GUILD_PERMISSION_MAIL)) - { - perms[0] = STR_GUILD_PERMISSION_MAIL_YES; - } - else - { - perms[0] = STR_GUILD_PERMISSION_MAIL_NO; - } - - if (guild.hasGuildPermission(guildId, target, guild.GUILD_PERMISSION_SPONSOR)) - { - perms[1] = STR_GUILD_PERMISSION_SPONSOR_YES; - } - else - { - perms[1] = STR_GUILD_PERMISSION_SPONSOR_NO; - } - - if (guild.hasGuildPermission(guildId, target, guild.GUILD_PERMISSION_TITLE)) - { - perms[2] = STR_GUILD_PERMISSION_TITLE_YES; - } - else - { - perms[2] = STR_GUILD_PERMISSION_TITLE_NO; - } - - if (guild.hasGuildPermission(guildId, target, guild.GUILD_PERMISSION_ACCEPT)) - { - perms[3] = STR_GUILD_PERMISSION_ACCEPT_YES; - } - else - { - perms[3] = STR_GUILD_PERMISSION_ACCEPT_NO; - } - - if (guild.hasGuildPermission(guildId, target, guild.GUILD_PERMISSION_KICK)) - { - perms[4] = STR_GUILD_PERMISSION_KICK_YES; - } - else - { - perms[4] = STR_GUILD_PERMISSION_KICK_NO; - } - - if (guild.hasGuildPermission(guildId, target, guild.GUILD_PERMISSION_WAR)) - { - perms[5] = STR_GUILD_PERMISSION_WAR_YES; - } - else - { - perms[5] = STR_GUILD_PERMISSION_WAR_NO; - } - - if (guild.hasGuildPermission(guildId, target, guild.GUILD_PERMISSION_NAMECHANGE)) - { - perms[6] = STR_GUILD_PERMISSION_NAMECHANGE_YES; - } - else - { - perms[6] = STR_GUILD_PERMISSION_NAMECHANGE_NO; - } - - if (guild.hasGuildPermission(guildId, target, guild.GUILD_PERMISSION_DISBAND)) - { - perms[7] = STR_GUILD_PERMISSION_DISBAND_YES; - } - else - { - perms[7] = STR_GUILD_PERMISSION_DISBAND_NO; - } - - sui.listbox( - self, - player, - guild.buildFakeLocalizedProse(STR_GUILD_PERMISSIONS_PROMPT, name, ""), - sui.OK_CANCEL, - STR_GUILD_PERMISSIONS_TITLE, - perms, - "onGuildPermissionsResponse"); - - return SCRIPT_CONTINUE; - } - - - public int showGuildEnemiesMessage(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - int guildId = getStructureGuildId(self); - - int[] enemyIds = guild.getEnemyIds(guildId); - setMenuContextIntArray(self, player, "guildEnemyIds", enemyIds); - String[] enemies = guild.getEnemyNamesAndAbbrevs(guildId); - int numEnemies = 0; - if (enemies != null) - { - numEnemies = enemies.length; - } - boolean warPerms = guild.hasGuildPermission(guildId, player, guild.GUILD_PERMISSION_WAR); - int numOptions = numEnemies; - if (warPerms) - { - ++numOptions; - } - String[] options = new String[numOptions]; - int index = 0; - if (warPerms) - { - options[index++] = STR_GUILD_ADD_ENEMY; - } - for (int i = 0; i < numEnemies; ++i) - { - testAbortScript(); - options[index++] = enemies[i]; - } - sui.listbox( - self, - player, - STR_GUILD_ENEMIES_PROMPT, - sui.OK_CANCEL, - STR_GUILD_ENEMIES_TITLE, - options, - "onGuildEnemiesResponse", - true, - false); - - return SCRIPT_CONTINUE; - } - - - public int showGuildSponsoredMessage(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - int guildId = getStructureGuildId(self); - - sui.listbox( - self, - player, - STR_GUILD_SPONSORED_PROMPT, - sui.OK_CANCEL, - STR_GUILD_SPONSORED_TITLE, - guild.getMemberNames(guildId, true, false), - "onGuildSponsoredResponse", - true, - false); - - return SCRIPT_CONTINUE; - } - - - public int onGuildNamechangeNameResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - String newGuildName = sui.getInputBoxText(params); - setMenuContextString(self, player, "guildNamechangeName", newGuildName); - sui.inputbox( - self, - player, - STR_GUILD_NAMECHANGE_ABBREV_PROMPT, - sui.OK_CANCEL, - STR_GUILD_NAMECHANGE_ABBREV_TITLE, - sui.INPUT_NORMAL, - null, - "onGuildNamechangeAbbrevResponse"); - } - return SCRIPT_CONTINUE; - } - - - public int onGuildNamechangeAbbrevResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - String newGuildName = getMenuContextString(self, player, "guildNamechangeName"); - removeMenuContextVar(self, player, "guildNamechangeName"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - int guildId = getStructureGuildId(self); - String newGuildAbbrev = sui.getInputBoxText(params); - guild.nameChange(guildId, player, newGuildName, newGuildAbbrev); - } - return SCRIPT_CONTINUE; - } - - - public int onGuildCreateNameResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - String newGuildName = sui.getInputBoxText(params); - setMenuContextString(self, player, "guildCreateName", newGuildName); - sui.inputbox( - self, - player, - STR_GUILD_CREATE_ABBREV_PROMPT, - sui.OK_CANCEL, - STR_GUILD_CREATE_ABBREV_TITLE, - sui.INPUT_NORMAL, - null, - "onGuildCreateAbbrevResponse"); - } - return SCRIPT_CONTINUE; - } - - - public int onGuildCreateAbbrevResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - String newGuildName = getMenuContextString(self, player, "guildCreateName"); - removeMenuContextVar(self, player, "guildCreateName"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - - messageTo( self, "endVote", null, 0.f, false ); - - String newGuildAbbrev = sui.getInputBoxText(params); - guild.create(player, newGuildName, newGuildAbbrev); - } - return SCRIPT_CONTINUE; - } - - - public int onGuildDisbandResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - int guildId = getStructureGuildId(self); - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - guild.disband(guildId, player); - } - return SCRIPT_CONTINUE; - } - - - public int onGuildSponsorResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - String sponsorName = sui.getInputBoxText(params); - obj_id target = utils.getNearbyPlayerByName(player, sponsorName); - if (isIdValid(target)) - { - if (getGuildId(target) != 0) - { - prose_package pp = new prose_package(); - pp.actor.set(getName(target)); - pp.stringId = SID_GUILD_SPONSOR_ALREADY_IN_GUILD; - sendSystemMessageProse(getChatName(player), pp); - } - else - { - obj_id targetPlayerObj = getPlayerObject(target); - if (isIdValid(targetPlayerObj) && !isIgnoring(targetPlayerObj, getFirstName(player))) - { - setMenuContextObjId(self, target, "sponsoring", player); - int guildId = getStructureGuildId(self); - - deltadictionary dd = target.getScriptVars(); - dd.put("sponsorTerminal", self); - - dictionary d = new dictionary(); - d.put("prompt", guild.buildFakeLocalizedProse(STR_GUILD_SPONSOR_VERIFY_PROMPT, getName(player), guildGetName(guildId))); - d.put("title", STR_GUILD_SPONSOR_VERIFY_TITLE); - messageTo(target, "startGuildSponsorSui", d, 0, false); - } - } - } - else - { - prose_package pp = new prose_package(); - pp.actor.set(sponsorName); - pp.stringId = SID_GUILD_SPONSOR_NOT_FOUND; - sendSystemMessageProse(getChatName(player), pp); - } - } - return SCRIPT_CONTINUE; - } - - - public int onGuildSponsorVerifyResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id target = params.getObjId("player"); - obj_id player = getMenuContextObjId(self, target, "sponsoring"); - removeMenuContextVar(self, target, "sponsoring"); - - int guildId = getStructureGuildId(self); - - prose_package pp = new prose_package(); - pp.actor.set(getName(target)); - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - guild.sponsor(guildId, player, target); - pp.stringId = SID_GUILD_SPONSOR_ACCEPT; - } - else - { - pp.stringId = SID_GUILD_SPONSOR_DECLINE; - } - sendSystemMessageProse(getChatName(player), pp); - return SCRIPT_CONTINUE; - } - - - public int onGuildMembersResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - int guildId = getStructureGuildId(self); - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - int row = sui.getListboxSelectedRow(params); - obj_id[] members = guild.getMemberIds(guildId, false, true); - if (row >= 0 && row < members.length) - { - String name = guildGetMemberName(guildId, members[row]); - setMenuContextString(self, player, "guildMemberName", name); - sui.listbox( - self, - player, - guild.buildFakeLocalizedProse(STR_GUILD_MEMBER_OPTIONS_PROMPT, name, ""), - sui.OK_CANCEL, - STR_GUILD_MEMBER_OPTIONS_TITLE, - getAvailableMemberOptions(self, player), - "onGuildMemberOptionsResponse"); - } - } - return SCRIPT_CONTINUE; - } - - - public int onGuildMemberOptionsResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - int row = sui.getListboxSelectedRow(params); - String name = getMenuContextString(self, player, "guildMemberName"); - String[] entries = getAvailableMemberOptions(self, player); - if (row >= 0 && row < entries.length) - { - if (entries[row].equals(STR_GUILD_TITLE)) - { - chooseTitle(self, player, name); - } - else if (entries[row].equals(STR_GUILD_KICK)) - { - confirmKick(self, player, name); - } - else if (entries[row].equals(STR_GUILD_PERMISSIONS)) - { - selectPermissions(self, player, name); - } - } - } - removeMenuContextVar(self, player, "guildMemberName"); - return SCRIPT_CONTINUE; - } - - - public int onGuildSponsoredResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - int guildId = getStructureGuildId(self); - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - int row = sui.getListboxSelectedRow(params); - obj_id[] sponsored = guild.getMemberIds(guildId, true, false); - if (row >= 0 && row < sponsored.length) - { - String[] entries = new String[2]; - entries[0] = STR_GUILD_ACCEPT; - entries[1] = STR_GUILD_DECLINE; - String name = guildGetMemberName(guildId, sponsored[row]); - setMenuContextString(self, player, "guildSponsoredName", name); - sui.listbox( - self, - player, - guild.buildFakeLocalizedProse(STR_GUILD_SPONSORED_OPTIONS_PROMPT, name, ""), - sui.OK_CANCEL, - STR_GUILD_SPONSORED_OPTIONS_TITLE, - entries, - "onGuildSponsoredOptionsResponse"); - } - } - return SCRIPT_CONTINUE; - } - - - public int onGuildSponsoredOptionsResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - String name = getMenuContextString(self, player, "guildSponsoredName"); - removeMenuContextVar(self, player, "guildSponsoredName"); - - if (name == null || !isIdValid(player) || outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - int row = sui.getListboxSelectedRow(params); - if (row >= 0 && row <= 1) - { - int guildId = getStructureGuildId(self); - if (row == 0) - { - guild.accept(guildId, player, name); - } - else if (row == 1) - { - guild.kick(guildId, player, name); - } - showGuildSponsored(self, player); - } - } - return SCRIPT_CONTINUE; - } - - - public int onGuildEnemiesResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - int[] enemyIds = getMenuContextIntArray(self, player, "guildEnemyIds"); - removeMenuContextVar(self, player, "guildEnemyIds"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - int guildId = getStructureGuildId(self); - if (guild.hasGuildPermission(guildId, player, guild.GUILD_PERMISSION_WAR)) - { - int row = sui.getListboxSelectedRow(params); - if (row == 0) - { - - sui.inputbox( - self, - player, - STR_GUILD_WAR_ENEMY_NAME_PROMPT, - sui.OK_CANCEL, - STR_GUILD_WAR_ENEMY_NAME_TITLE, - sui.INPUT_NORMAL, - null, - "onGuildWarEnemyNameResponse"); - } - else - { - - if (row > 0 && row <= enemyIds.length) - { - int enemyId = enemyIds[row-1]; - if (guild.hasDeclaredWarAgainst(guildId, enemyId)) - { - guild.peace(guildId, player, enemyId); - } - else - { - guild.war(guildId, player, enemyId); - } - showGuildEnemies(self, player); - } - } - } - } - return SCRIPT_CONTINUE; - } - - - public int onGuildWarEnemyNameResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - int guildId = getStructureGuildId(self); - String enemyName = sui.getInputBoxText(params); - guild.war(guildId, player, enemyName); - } - showGuildEnemies(self, player); - return SCRIPT_CONTINUE; - } - - - public int onGuildKickResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - String name = getMenuContextString(self, player, "guildKickName"); - removeMenuContextVar(self, player, "guildKickName"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - int guildId = getStructureGuildId(self); - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - guild.kick(guildId, player, name); - } - return SCRIPT_CONTINUE; - } - - - public int onGuildTitleResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - String name = getMenuContextString(self, player, "guildTitlePlayerName"); - removeMenuContextVar(self, player, "guildTitlePlayerName"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - int guildId = getStructureGuildId(self); - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - String newTitle = sui.getInputBoxText(params); - guild.title(guildId, player, name, newTitle); - } - return SCRIPT_CONTINUE; - } - - - public int onGuildInfoResponse(obj_id self, dictionary params) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int onGuildPermissionsResponse(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = params.getObjId("player"); - String target = getMenuContextString(self, player, "guildPermissionsTarget"); - removeMenuContextVar(self, player, "guildPermissionsTarget"); - - if (outOfRange(self, player)) - { - return SCRIPT_CONTINUE; - } - - int guildId = getStructureGuildId(self); - - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - int row = sui.getListboxSelectedRow(params); - if (row >= 0 && row <= 7) - { - if (row == 0) - { - guild.togglePermission(guildId, player, target, guild.GUILD_PERMISSION_MAIL); - } - else if (row == 1) - { - guild.togglePermission(guildId, player, target, guild.GUILD_PERMISSION_SPONSOR); - } - else if (row == 2) - { - guild.togglePermission(guildId, player, target, guild.GUILD_PERMISSION_TITLE); - } - else if (row == 3) - { - guild.togglePermission(guildId, player, target, guild.GUILD_PERMISSION_ACCEPT); - } - else if (row == 4) - { - guild.togglePermission(guildId, player, target, guild.GUILD_PERMISSION_KICK); - } - else if (row == 5) - { - guild.togglePermission(guildId, player, target, guild.GUILD_PERMISSION_WAR); - } - else if (row == 6) - { - guild.togglePermission(guildId, player, target, guild.GUILD_PERMISSION_NAMECHANGE); - } - else if (row == 7) - { - guild.togglePermission(guildId, player, target, guild.GUILD_PERMISSION_DISBAND); - } - selectPermissions(self, player, target); - } - } - return SCRIPT_CONTINUE; - } - - - public int checkDisband(obj_id self, dictionary params) throws InterruptedException - { - int guildId = getStructureGuildId(self); - - if (guildId != 0 && !guildExists(guildId)) - { - obj_id structure = player_structure.getStructure(self); - if (isIdValid(structure)) - { - player_structure.destroyStructure(structure, false); - } - } - else - { - messageTo(self, "checkDisband", null, DISBAND_CHECK_TIME, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean outOfRange(obj_id self, obj_id player) throws InterruptedException - { - location a = getLocation(self); - location b = getLocation(player); - if (a.cell == b.cell && a.distance(b) < TERMINAL_USE_DISTANCE) - { - return false; - } - return true; - } - - - public String[] getAvailableMemberOptions(obj_id self, obj_id player) throws InterruptedException - { - int guildId = getStructureGuildId(self); - - int count = 0; - if (guild.hasGuildPermission(guildId, player, guild.GUILD_PERMISSION_TITLE)) - { - ++count; - } - if (guild.hasGuildPermission(guildId, player, guild.GUILD_PERMISSION_KICK)) - { - ++count; - } - if (player == guildGetLeader(guildId) || isGod(player)) - { - ++count; - } - String[] ret = new String[count]; - count = 0; - if (guild.hasGuildPermission(guildId, player, guild.GUILD_PERMISSION_TITLE)) - { - ret[count++] = STR_GUILD_TITLE; - } - if (guild.hasGuildPermission(guildId, player, guild.GUILD_PERMISSION_KICK)) - { - ret[count++] = STR_GUILD_KICK; - } - if (player == guildGetLeader(guildId) || isGod(player)) - { - ret[count++] = STR_GUILD_PERMISSIONS; - } - return ret; - } - - - public void chooseTitle(obj_id self, obj_id player, String name) throws InterruptedException - { - setMenuContextString(self, player, "guildTitlePlayerName", name); - sui.inputbox( - self, - player, - guild.buildFakeLocalizedProse(STR_GUILD_TITLE_PROMPT, name, ""), - sui.OK_CANCEL, - STR_GUILD_TITLE_TITLE, - sui.INPUT_NORMAL, - null, - "onGuildTitleResponse"); - } - - - public void confirmKick(obj_id self, obj_id player, String name) throws InterruptedException - { - setMenuContextString(self, player, "guildKickName", name); - sui.msgbox( - self, - player, - guild.buildFakeLocalizedProse(STR_GUILD_KICK_PROMPT, name, ""), - sui.YES_NO, - STR_GUILD_KICK_TITLE, - sui.MSG_NORMAL, - "onGuildKickResponse"); - } - - - public void selectPermissions(obj_id self, obj_id player, String name) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - params.put("name", name); - messageTo(self, "selectPermissionsMessage", params, 2, false); - } - - - public void showGuildInfo(obj_id self, obj_id player) throws InterruptedException - { - - int guildId = getStructureGuildId(self); - obj_id[] memberIds = guild.getMemberIds(guildId, false, true); - String guildInfoStr = new String ( - "Guild Name: "+ guildGetName(guildId) + "\n"+ - "Guild Abbreviation: "+ guildGetAbbrev(guildId) + "\n"+ - "Guild Leader: "+ guildGetMemberName(guildId, guildGetLeader(guildId)) + "\n"+ - "Members: "+ memberIds.length); - - sui.msgbox( - self, - player, - guildInfoStr, - sui.OK_ONLY, - STR_GUILD_INFO_TITLE, - sui.MSG_NORMAL, - "onGuildInfoResponse"); - } - - - public void showGuildMembers(obj_id self, obj_id player) throws InterruptedException - { - int guildId = getStructureGuildId(self); - sui.listbox( - self, - player, - STR_GUILD_MEMBERS_PROMPT, - sui.OK_CANCEL, - STR_GUILD_MEMBERS_TITLE, - guild.getMemberNamesAndTitles(guildId), - "onGuildMembersResponse", - true, - false); - } - - - public void showGuildEnemies(obj_id self, obj_id player) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - messageTo(self, "showGuildEnemiesMessage", params, 2, false); - } - - - public void showGuildSponsored(obj_id self, obj_id player) throws InterruptedException - { - dictionary params = new dictionary(); - params.put("player", player); - messageTo(self, "showGuildSponsoredMessage", params, 2, false); - } - - - public String getMenuContextString(obj_id self, obj_id player, String varName) throws InterruptedException - { - deltadictionary dd = self.getScriptVars(); - return dd.getString("guildMenu." + player + "." + varName); - } - - - public void setMenuContextString(obj_id self, obj_id player, String varName, String value) throws InterruptedException - { - deltadictionary dd = self.getScriptVars(); - dd.put("guildMenu."+ player + "."+ varName, value); - } - - - public obj_id getMenuContextObjId(obj_id self, obj_id player, String varName) throws InterruptedException - { - deltadictionary dd = self.getScriptVars(); - return dd.getObjId("guildMenu." + player + "." + varName); - } - - - public void setMenuContextObjId(obj_id self, obj_id player, String varName, obj_id value) throws InterruptedException - { - deltadictionary dd = self.getScriptVars(); - dd.put("guildMenu."+ player + "."+ varName, value); - } - - - public int[] getMenuContextIntArray(obj_id self, obj_id player, String varName) throws InterruptedException - { - deltadictionary dd = self.getScriptVars(); - return dd.getIntArray("guildMenu." + player + "." + varName); - } - - - public void setMenuContextIntArray(obj_id self, obj_id player, String varName, int[] value) throws InterruptedException - { - deltadictionary dd = self.getScriptVars(); - dd.put("guildMenu."+ player + "."+ varName, value); - } - - - public void removeMenuContextVar(obj_id self, obj_id player, String varName) throws InterruptedException - { - deltadictionary dd = self.getScriptVars(); - dd.remove("guildMenu."+ player + "."+ varName); - } - - - public int handleMakeLeader(obj_id self, dictionary params) throws InterruptedException - { - if (sui.getIntButtonPressed(params) != sui.BP_OK) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - String input_name = sui.getInputBoxText( params ); - int guildId = getStructureGuildId(self); - - obj_id[] members = guild.getMemberIds( guildId, false, true ); - for (int i=0; i 20) - { - - sendSystemMessage( player, SID_ML_NOT_LOADED ); - return SCRIPT_CONTINUE; - } - - obj_id structure = player_structure.getStructure( self ); - if (!player_structure.canOwnStructure( structure, members[i] )) - { - - sendSystemMessage( player, SID_ML_NO_LOTS_FREE ); - return SCRIPT_CONTINUE; - } - - if (utils.isFreeTrial(player, members[i])) - { - - sendSystemMessage( player, SID_ML_TRIAL ); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar( self, "temp_new_leader", members[i] ); - sui.msgbox( self, members[i], "@guild:make_leader_p", sui.YES_NO, "@guild:make_leader_t", sui.MSG_NORMAL, "handleAcceptLeadership"); - - return SCRIPT_CONTINUE; - } - } - - sendSystemMessage( player, SID_ML_FAIL ); - - return SCRIPT_CONTINUE; - } - - - public int handleAcceptLeadership(obj_id self, dictionary params) throws InterruptedException - { - obj_id pa_hall = getTopMostContainer( self ); - int guildId = getStructureGuildId( self ); - obj_id oldLeader = guildGetLeader( guildId ); - obj_id newLeader = utils.getObjIdScriptVar( self, "temp_new_leader"); - if (sui.getIntButtonPressed(params) == sui.BP_OK) - { - obj_id[] members = guild.getMemberIds( guildId, false, true ); - boolean done = false; - for (int i=0; i 0) - { - setObjVar( pa_hall, "candidate_list", new_candidates ); - } - else - { - if (hasObjVar( pa_hall, "candidate_list" )) - { - removeObjVar( pa_hall, "candidate_list"); - } - } - } - - - public String getNumVotes(obj_id candidate, Vector vote_ids, Vector vote_counts) throws InterruptedException - { - for (int j=0; j -1) - { - mi.addSubMenu(management_root, menu_info_types.SET_NAME, new string_id()); - } - if (template.indexOf("garden_") > -1) - { - mi.addSubMenu(management_root, menu_info_types.SET_NAME, new string_id()); - } - if (!(template.indexOf("cityhall_") > -1)) - { - return SCRIPT_CONTINUE; - } - } - - int permissions_root = 0; - - if (!player_structure.isHarvester(structure) && !player_structure.isGenerator(structure)) - { - blog("terminal_structure::OnObjectMenuRequest - I am harvester/generator"); - - permissions_root = mi.addRootMenu (menu_info_types.SERVER_TERMINAL_PERMISSIONS, SID_TERMINAL_PERMISSIONS); - mi.addSubMenu(permissions_root, menu_info_types.SERVER_TERMINAL_PERMISSIONS_ADMIN, SID_TERMINAL_PERMISSIONS_ADMIN); - } - - if ((template.indexOf("cityhall_") > -1)) - { - return SCRIPT_CONTINUE; - } - - mi.addSubMenu(management_root, menu_info_types.SERVER_TERMINAL_MANAGEMENT_PAY, SID_TERMINAL_MANAGEMENT_PAY); - - mi.addSubMenu(management_root, menu_info_types.SET_NAME, new string_id()); - - if (player_structure.hasMaintenanceDroid(player)) - { - mi.addSubMenu(management_root, menu_info_types.SERVER_MENU5, SID_TERMINAL_ASSIGN_DROID); - } - if (player_structure.canPackBuilding(player, structure)) - { - mi.addSubMenu( management_root, menu_info_types.SERVER_MENU10, SID_TERMINAL_PACK_HOUSE); - } - - if (player_structure.isBuilding(structure)) - { - blog("terminal_structure::OnObjectMenuRequest - I am a building"); - - boolean isStructureOwner = player_structure.isOwner(structure, player); - - if (permissions_root != 0) - { - permissions_root = mi.addRootMenu (menu_info_types.SERVER_TERMINAL_PERMISSIONS, SID_TERMINAL_PERMISSIONS); - } - - mi.addSubMenu(permissions_root, menu_info_types.SERVER_TERMINAL_PERMISSIONS_ADMIN, SID_TERMINAL_PERMISSIONS_ADMIN); - mi.addSubMenu(permissions_root, menu_info_types.SERVER_TERMINAL_PERMISSIONS_ENTER, SID_TERMINAL_PERMISSIONS_ENTER); - mi.addSubMenu(management_root, menu_info_types.SERVER_TERMINAL_MANAGEMENT_RESIDENCE, SID_TERMINAL_MANAGEMENT_RESIDENCE); - mi.addSubMenu(permissions_root, menu_info_types.SERVER_TERMINAL_PERMISSIONS_BANNED, SID_TERMINAL_PERMISSIONS_BANNED); - - if (areAllContentsLoaded(structure)) - { - mi.addSubMenu(management_root, menu_info_types.SERVER_TERMINAL_MANAGEMENT_PRIVACY, SID_TERMINAL_MANAGEMENT_PRIVACY); - - if (getSkillStatMod(player, "manage_vendor") > 0) - { - mi.addSubMenu(management_root, menu_info_types.SERVER_TERMINAL_CREATE_VENDOR, SID_TERMINAL_CREATE_VENDOR); - } - if (utils.isProfession(player, utils.TRADER)) - { - - if (turnstile.hasTurnstile( structure )) - { - mi.addSubMenu(management_root, menu_info_types.SERVER_MENU3, SID_TERMINAL_MANAGEMENT_REMOVE_TURNSTILE); - } - else - { - mi.addSubMenu(management_root, menu_info_types.SERVER_MENU4, SID_TERMINAL_MANAGEMENT_ADD_TURNSTILE); - } - } - - if (player_structure.isGuildHall(structure)) - { - mi.addSubMenu(management_root, menu_info_types.SERVER_MENU8, SID_WITHDRAW_MAINTENANCE); - } - - mi.addSubMenu( management_root, menu_info_types.SERVER_MENU12, SID_FIND_ALL_HOUSE_ITEMS ); - mi.addSubMenu( management_root, menu_info_types.SERVER_MENU13, SID_SEARCH_FOR_HOUSE_ITEMS ); - mi.addSubMenu( management_root, menu_info_types.SERVER_MENU9, SID_MOVE_FIRST_ITEM ); - mi.addSubMenu( management_root, menu_info_types.SERVER_MENU2, SID_DELETE_ALL_ITEMS ); - - if (player_structure.isOwner(structure, player)) - { - - if (hasObjVar(structure, player_structure.OBJVAR_STRUCTURE_STORAGE_INCREASE)) - { - - mi.addSubMenu( management_root, menu_info_types.DICE_ROLL, SID_TERMINAL_REDEED_STORAGE); - } - } - - } - else - { - blog("terminal_structure::OnObjectMenuRequest - NOT ALL ITEMS LOADED"); - } - - if (hasObjVar(structure, player_structure.MODIFIED_HOUSE_SIGN) && isStructureOwner) - { - mi.addSubMenu( management_root, menu_info_types.SERVER_MENU11, SID_REVERT_CUSTOM_SIGN ); - } - if ((hasObjVar(structure, player_structure.SPECIAL_SIGN) || player_structure.hasSpecialSignSkillMod(player, structure))) - { - blog("terminal_structure.OnObjectMenuRequest: Creating Special Sign Radial Option"); - mi.addSubMenu(management_root, menu_info_types.SERVER_MENU14, SID_TERMINAL_MANAGEMENT_SPECIAL_SIGNS); - } - - if (player_structure.isOwner(structure, player) && isGod(player)) - { - int decor_root = mi.addRootMenu(menu_info_types.SERVER_MENU14, SID_STRUCTURE_DECOR); - mi.addSubMenu(decor_root, menu_info_types.SERVER_MENU15, SID_STRUCTURE_ADD_DECOR); - mi.addSubMenu(decor_root, menu_info_types.SERVER_MENU16, SID_STRUCTURE_REMOVE_DECOR); - } - } - else if (player_structure.isInstallation(structure)) - { - - if (got != GOT_installation_turret) - { - - if ((got == GOT_installation_harvester) || (got == GOT_installation_generator)) - { - mi.addSubMenu(management_root, menu_info_types.SERVER_HARVESTER_MANAGE, SID_TERMINAL_PERMISSIONS_HARVESTER); - } - - if ((got == GOT_installation_harvester) || (got == GOT_installation_factory)) - { - mi.addSubMenu(management_root, menu_info_types.SERVER_MENU6, SID_TERMINAL_MANAGEMENT_POWER); - } - } - else - { - - } - } - } - else - { - if (player_structure.canPlayerPackAbandonedStructure(player, structure)) - { - int management_root = mi.addRootMenu (menu_info_types.SERVER_TERMINAL_MANAGEMENT, SID_TERMINAL_MANAGEMENT); - mi.addSubMenu( management_root, menu_info_types.SERVER_MENU10, SID_TERMINAL_PACK_HOUSE); - } - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - sendDirtyObjectMenuNotification(self); - - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage( player, SID_WHILE_DEAD ); - return SCRIPT_CONTINUE; - } - - blog("terminal_structure::OnObjectMenuSelect item = "+ item); - blog("terminal_structure::OnObjectMenuSelect SERVER_TERMINAL_CREATE_VENDOR = "+ menu_info_types.SERVER_TERMINAL_CREATE_VENDOR); - - if (utils.hasScriptVar(player, "packup.suiconfirm")) - { - sui.closeSUI(player, utils.getIntScriptVar(player, "packup.suiconfirm")); - } - - obj_id structure = self; - if (!player_structure.isInstallation(structure)) - { - structure = player_structure.getStructure( player ); - if (!isIdValid(structure)) - { - return SCRIPT_CONTINUE; - } - if (player_structure.isHarvester(structure) || player_structure.isGenerator(structure)) - { - player_structure.validateHarvestedResources(structure); - } - } - - if (!player_structure.isAdmin(structure, player) && !player_structure.isAbandoned(structure)) - { - return SCRIPT_CONTINUE; - } - if (player_structure.isStructureCondemned(self) && player_structure.isOwner(player, structure)) - { - player_structure.doCondemnedSui(self, player); - return SCRIPT_OVERRIDE; - } - - if ((item == menu_info_types.SERVER_TERMINAL_MANAGEMENT)||(item == menu_info_types.SERVER_TERMINAL_MANAGEMENT_STATUS)) - { - queueCommand(player, (335013253), null, "", COMMAND_PRIORITY_DEFAULT); - } - - String template = getTemplateName(structure); - if (player_structure.isCivic(structure)) - { - - if (template.indexOf("cloning_") > -1 && item == menu_info_types.SET_NAME) - { - queueCommand(player, (-1016613791), null, "", COMMAND_PRIORITY_DEFAULT); - } - - if (template.indexOf("garden_") > -1 && item == menu_info_types.SET_NAME) - { - queueCommand(player, (-1016613791), null, "", COMMAND_PRIORITY_DEFAULT); - } - - if (!(template.indexOf("cityhall_") > -1) && (item != menu_info_types.SERVER_TERMINAL_MANAGEMENT_DESTROY)) - { - return SCRIPT_CONTINUE; - } - } - - if (player_structure.isHarvester(structure) || player_structure.isGenerator(structure)) - { - session.logActivity(player, session.ACTIVITY_ACCESS_HARVESTER); - } - else if (player_structure.isFactory(structure)) - { - session.logActivity(player, session.ACTIVITY_ACCESS_FACTORY); - } - else - { - session.logActivity(player, session.ACTIVITY_ACCESS_STRUCTURE); - } - - if (item == menu_info_types.SERVER_TERMINAL_PERMISSIONS_ENTER) - { - - queueCommand(player, (1768087594), null, "entry", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_TERMINAL_PERMISSIONS_BANNED) - { - queueCommand(player, (1768087594), null, "ban", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_TERMINAL_PERMISSIONS || item == menu_info_types.SERVER_TERMINAL_PERMISSIONS_ADMIN) - { - queueCommand(player, (1768087594), null, "admin", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_TERMINAL_PERMISSIONS_VENDOR) - { - queueCommand(player, (1768087594), null, "vendor", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_TERMINAL_PERMISSIONS_HOPPER) - { - queueCommand(player, (1768087594), null, "hopper", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_TERMINAL_MANAGEMENT_PRIVACY) - { - queueCommand(player, (2020393870), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_TERMINAL_MANAGEMENT_RESIDENCE) - { - queueCommand(player, (-174179103), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_TERMINAL_MANAGEMENT_TRANSFER) - { - queueCommand(player, (292280838), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_TERMINAL_MANAGEMENT_DESTROY) - { - if (player_structure.isCivic(structure)) - { - - int city_id = getCityAtLocation(getLocation(structure), 0); - - if (city_id > 0) - { - obj_id mayor = cityGetLeader(city_id); - - if (isIdValid(mayor)) - { - - if (mayor != player) - { - - String city_name = cityGetName(city_id); - string_id message = new string_id("player_structure", "no_longer_mayor_block_destroy"); - prose_package pp = new prose_package(); - prose.setStringId(pp, message); - prose.setTO(pp, city_name); - sendSystemMessageProse(player, pp); - - CustomerServiceLog("playerStructure", "Civic Structure Destruction: Player: "+ player + " ("+ getName(player) + ") is NO LONGER THE MAYOR and is trying to destroy a Structure ("+ structure + - ") before the City conversion is complete. The NEW MAYOR is "+ mayor + " ("+ getName(mayor) + ") and is the only one with this authority."); - return SCRIPT_CONTINUE; - } - } - else - { - - string_id message = new string_id("player_structure", "catastrophic_failure_city_destroy_structure"); - sendSystemMessage(player, message); - return SCRIPT_CONTINUE; - } - } - } - queueCommand(player, (419174182), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_TERMINAL_MANAGEMENT_PAY) - { - queueCommand(player, (-404530384), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_MENU1 || item == menu_info_types.SET_NAME) - { - queueCommand(player, (-1016613791), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_HARVESTER_MANAGE) - { - activateHarvesterExtractionPage (player, self); - } - else if (item == menu_info_types.SERVER_TERMINAL_CREATE_VENDOR) - { - sendSystemMessage(player, SID_TCG_VENDOR_CTS_WARNING); - queueCommand(player, (-303051094), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_MENU5) - { - queueCommand(player, (1801226979), null, "", COMMAND_PRIORITY_DEFAULT); - } - - else if (item == menu_info_types.SERVER_MENU12) - { - - if (!player_structure.isBuilding( structure )) - { - return SCRIPT_CONTINUE; - } - int lockoutEnds = -1; - if (hasObjVar(self, "findItems.lockout")) - { - lockoutEnds = getIntObjVar(self, "findItems.lockout"); - } - - int currentTime = getGameTime(); - if (currentTime > lockoutEnds || isGod(player)) - { - player_structure.initializeFindAllItemsInHouse(self, player); - setObjVar(self, "findItems.lockout", currentTime + player_structure.HOUSE_ITEMS_SEARCH_LOCKOUT); - } - else - { - string_id message = new string_id ("player_structure", "find_items_locked_out"); - prose_package pp = prose.getPackage(message, player, player); - prose.setTO(pp, utils.formatTimeVerbose(lockoutEnds - currentTime)); - sendSystemMessageProse(player, pp); - } - } - else if (item == menu_info_types.SERVER_MENU13) - { - - if (!player_structure.isBuilding( structure )) - { - return SCRIPT_CONTINUE; - } - - int lockoutEnds = -1; - if (hasObjVar(self, "findItems.lockout")) - { - lockoutEnds = getIntObjVar(self, "findItems.lockout"); - } - - int currentTime = getGameTime(); - if (currentTime > lockoutEnds || isGod(player)) - { - player_structure.initializeItemSearchInHouse(self, player); - setObjVar(self, "findItems.lockout", currentTime + player_structure.HOUSE_ITEMS_SEARCH_LOCKOUT); - } - else - { - string_id message = new string_id ("player_structure", "find_items_locked_out"); - prose_package pp = prose.getPackage(message, player, player); - prose.setTO(pp, utils.formatTimeVerbose(lockoutEnds - currentTime)); - sendSystemMessageProse(player, pp); - } - } - else if (item == menu_info_types.SERVER_MENU9) - { - if (!player_structure.isBuilding( structure )) - { - return SCRIPT_CONTINUE; - } - - moveFirstItem( self, player, structure ); - } - else if (item == menu_info_types.SERVER_MENU2) - { - if (!player_structure.isBuilding( structure )) - { - return SCRIPT_CONTINUE; - } - - deleteAllItems( self, player, structure ); - } - else if (item == menu_info_types.SERVER_MENU3) - { - - if (!turnstile.hasTurnstile( structure )) - { - return SCRIPT_CONTINUE; - } - turnstile.removeTurnstile( structure ); - sendSystemMessage( player, "Your building no longer has an access fee.", null ); - } - else if (item == menu_info_types.SERVER_MENU4) - { - if (!permissionsIsPublic(structure)) - { - sendSystemMessage( player, SID_PUBLIC_ONLY ); - return SCRIPT_CONTINUE; - } - if (!turnstile.canAddTurnstile( player, structure )) - { - return SCRIPT_CONTINUE; - } - if (turnstile.hasTurnstile( structure ) || utils.hasScriptVar( player, "turnstile.querySetTurnstile" )) - { - return SCRIPT_CONTINUE; - } - utils.setScriptVar( self, "turnstile.querySetTurnstile", 1 ); - utils.setScriptVar( self, STRUCTURE_MARK, structure); - - sui.inputbox( self, player, "@player_structure:access_fee", sui.OK_CANCEL, "@player_structure:access_fee_t", sui.INPUT_NORMAL, null, "handleSetAccessFee", null ); - } - else if (item == menu_info_types.SERVER_MENU6) - { - queueCommand(player, (-1893504550), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_MENU8) - { - queueCommand(player, (-707821905), null, "", COMMAND_PRIORITY_DEFAULT); - } - else if (item == menu_info_types.SERVER_MENU7) - { - player_structure.showChangeSignSui(structure, player); - } - else if (item == menu_info_types.SERVER_MENU10) - { - - if (player_structure.isAbandoned(structure) && player_structure.isPlayerGatedFromHousePackUp(player)) - { - return SCRIPT_CONTINUE; - } - - if (!player_structure.canPackStructureWithVendors(player, structure)) - { - return SCRIPT_CONTINUE; - } - - if (player_structure.isOwner(structure, player) && player_structure.canPackBuilding(player, structure)) - { - blog("owner is using pack up"); - player_structure.packBuilding(player, structure); - } - - else if (player_structure.canPlayerPackAbandonedStructure(player, structure) && !utils.hasScriptVar(structure, player_structure.SCRIPTVAR_HOUSE_PACKUP_LOCKOUT_TIME)) - { - blog("NON-OWNER is using pack up"); - dictionary params = new dictionary(); - params.put("player", player); - params.put("house", structure); - - messageTo (player, "handlePlayerStructurePackupLockout", params, 0, false); - messageTo (structure, "packAbandonedBuilding", params, 4, false); - } - - return SCRIPT_CONTINUE; - } - - else if (item == menu_info_types.SERVER_MENU11) - { - player_structure.revertCustomSign(player, structure); - } - else if (item == menu_info_types.SERVER_MENU14) - { - blog("terminal_structure.OnMenuSelect: Player selected Special Sign Radial Option"); - getSpecialSignManagementMenu(player, structure); - } - else if (item == menu_info_types.SERVER_MENU15) - { - blog("SERVER_MENU15 - selected"); - player_structure.getStructureDecorMenu(player, structure, template); - } - else if (item == menu_info_types.SERVER_MENU16) - { - blog("about to REMOVE DECOR"); - player_structure.removeStructureDecor(structure, player); - } - else if (item == menu_info_types.DICE_ROLL) - { - if (!hasObjVar(structure, player_structure.OBJVAR_STRUCTURE_STORAGE_INCREASE)) - { - return SCRIPT_CONTINUE; - } - - player_structure.displayAvailableNonGenericStorageTypes(player, self, structure); - - } - return SCRIPT_CONTINUE; - } - - - public int handleStorageRedeedChoice(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - String accessFee = sui.getInputBoxText(params); - int btn = sui.getIntButtonPressed(params); - - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id structure = player_structure.getStructure(player); - - if (!player_structure.isOwner(structure, player)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(structure, player_structure.OBJVAR_STRUCTURE_STORAGE_INCREASE)) - { - int storageRedeedSelected = 0; - if (params.containsKey(sui.LISTBOX_LIST + "." + sui.PROP_SELECTEDROW)) - { - storageRedeedSelected = sui.getListboxSelectedRow(params); - if (storageRedeedSelected < 0) - { - sendSystemMessage(player, new string_id("player_structure", "storage_redeed_no_selection")); - return SCRIPT_CONTINUE; - } - } - - if (player_structure.decrementStorageAmount(player, structure, self, storageRedeedSelected)) - { - sendSystemMessage(player, new string_id("player_structure", "storage_increase_redeeded")); - } - } - - return SCRIPT_CONTINUE; - } - - - public int handleSetAccessFee(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = sui.getPlayerId(params); - String accessFee = sui.getInputBoxText( params ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - utils.removeScriptVar( self, "turnstile.querySetTurnstile"); - return SCRIPT_CONTINUE; - } - - int fee = utils.stringToInt( accessFee ); - utils.setScriptVar( self, "turnstile.fee", fee ); - - if ((fee < 1) || (fee > 50000)) - { - sui.inputbox( self, player, "@player_structure:access_fee", sui.OK_CANCEL, "@player_structure:access_fee_t", sui.INPUT_NORMAL, null, "handleSetAccessFee", null ); - return SCRIPT_CONTINUE; - } - - sui.inputbox( self, player, "@player_structure:access_time", sui.OK_CANCEL, "@player_structure:access_time_t", sui.INPUT_NORMAL, null, "handleSetAccessLength", null ); - - return SCRIPT_CONTINUE; - } - - - public int handleSetAccessLength(obj_id self, dictionary params) throws InterruptedException - { - - obj_id player = sui.getPlayerId(params); - String accessLength = sui.getInputBoxText( params ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - utils.removeScriptVar( self, "turnstile.querySetTurnstile"); - return SCRIPT_CONTINUE; - } - - int length = utils.stringToInt( accessLength ); - if (length < 15 || length > 2880) - { - sui.inputbox( self, player, "@player_structure:access_time", sui.OK_CANCEL, "@player_structure:access_time_t", sui.INPUT_NORMAL, null, "handleSetAccessLength", null ); - return SCRIPT_CONTINUE; - } - length *= 60; - - int fee = utils.getIntScriptVar( self, "turnstile.fee"); - - obj_id structure = self; - if (!player_structure.isInstallation(structure)) - { - structure = utils.getObjIdScriptVar(self, STRUCTURE_MARK); - - if (!isIdValid(structure) || !structure.isLoaded()) - { - return SCRIPT_CONTINUE; - } - } - turnstile.addTurnstile( structure, fee, length ); - - sendSystemMessage( player, "Other players will now be charged "+ fee + " credits to access your building for "+ length/60 + " minutes.", null ); - - return SCRIPT_CONTINUE; - } - - - public void moveFirstItem(obj_id self, obj_id player, obj_id structure) throws InterruptedException - { - sui.msgbox( self, player, "@player_structure:move_first_item_d", sui.OK_CANCEL, "@player_structure:move_first_item", sui.MSG_QUESTION, "handleMoveFirstItem"); - } - - - public int handleMoveFirstItem(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId( params ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - obj_id building = player_structure.getStructure( player ); - moveHouseItemToPlayer( building, player, 0 ); - sendSystemMessage( player, SID_MOVED_FIRST_ITEM ); - - return SCRIPT_CONTINUE; - } - - - public void deleteAllItems(obj_id self, obj_id player, obj_id structure) throws InterruptedException - { - sui.msgbox( self, player, "@player_structure:delete_all_items_d", sui.OK_CANCEL, "@player_structure:delete_all_items", sui.MSG_QUESTION, "handleDeleteSecondConfirm"); - } - - - public int handleDeleteSecondConfirm(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId( params ); - int btn = sui.getIntButtonPressed( params ); - if (btn == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - - sui.msgbox( self, player, "@player_structure:delete_all_items_second_d", sui.OK_CANCEL, "@player_structure:delete_all_items", sui.MSG_QUESTION, "handleDeleteAllItemsCodeConfirm"); - - return SCRIPT_CONTINUE; - } - - - public int handleDeleteAllItemsCodeConfirm(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - - if (utils.hasScriptVar(self, "player_structure.destroyAllItems.pid")) - { - sui.closeSUI(player, utils.getIntScriptVar(self, "player_structure.destroyAllItems.pid")); - } - - int key = rand(100000, 999999); - utils.setScriptVar(self, "player_structure.destroyAllItems.key", key); - - int pid = sui.inputbox(self, player, "@player_structure:delete_all_items_prompt"+ "\n\nCode: "+ key, "@player_structure:delete_all_items_title", "handleDeleteAllItemsConfirmed", 6, false, ""); - if (pid > -1) - { - utils.setScriptVar(self, "player_structure.destroyAllItems.pid", pid); - } - - return SCRIPT_CONTINUE; - } - - - public int handleDeleteAllItemsConfirmed(obj_id self, dictionary params) throws InterruptedException - { - int bp = sui.getIntButtonPressed(params); - String text = sui.getInputBoxText(params); - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player)) - { - utils.removeScriptVarTree(self, "player_structure.destroyAllItems"); - return SCRIPT_CONTINUE; - } - if (bp == sui.BP_CANCEL || text == null || text.equals("")) - { - utils.removeScriptVarTree(self, "player_structure.destroyAllItems"); - return SCRIPT_CONTINUE; - } - - int key = utils.getIntScriptVar(self, "player_structure.destroyAllItems.key"); - String skey = Integer.toString(key); - - if (text.equals(skey)) - { - int btn = sui.getIntButtonPressed(params); - if (btn == sui.BP_CANCEL) - { - utils.removeScriptVarTree(self, "player_structure.destroyAllItems"); - return SCRIPT_CONTINUE; - } - - obj_id building = player_structure.getStructure(player); - if (!isIdValid(building)) - { - utils.removeScriptVarTree(self, "player_structure.destroyAllItems"); - return SCRIPT_CONTINUE; - } - deleteAllHouseItems(building, player); - fixHouseItemLimit(building); - sendSystemMessage(player, SID_ITEMS_DELETED); - CustomerServiceLog("playerStructure", "deleteAllItems (Deleting all objects in house by player's request. Player had to enter a 6 Digit Code to confirm Deleting All Items.) Player: "+ player + " ("+ getName(player) + ") Structure: "+ building); - } - else - { - sui.msgbox(player, "@player_structure:incorrect_destroy_all_items_code"); - utils.removeScriptVarTree(self, "player_structure.destroyAllItems"); - } - - return SCRIPT_CONTINUE; - } - - - public int clearCollectionMeatlumpCamera(obj_id self, dictionary params) throws InterruptedException - { - - obj_id target = params.getObjId("target"); - utils.removeScriptVar(target, "collection.picture_taken"); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerStructureFindItemsListResponse(obj_id self, dictionary params) throws InterruptedException - { - player_structure.handleFindItemsListResponse(self, params); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerStructureFindItemsPageResponse(obj_id self, dictionary params) throws InterruptedException - { - player_structure.handleFindItemsChangePageResponse(self, params); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerStructureSearchItemsGetKeyword(obj_id self, dictionary params) throws InterruptedException - { - player_structure.handleSearchItemsGetKeyword(self, params); - return SCRIPT_CONTINUE; - } - - - public int handlePlayerStructureSearchItemsSelectedResponse(obj_id self, dictionary params) throws InterruptedException - { - player_structure.handleSearchItemsSelectedResponse(self, params); - return SCRIPT_CONTINUE; - } - - - public boolean getSpecialSignManagementMenu(obj_id player, obj_id structure) throws InterruptedException - { - blog("terminal_structure.getSpecialSignManagementMenu: init"); - - if (!isValidId(player) || !isValidId(structure)) - { - return false; - } - if (player_structure.isInstallation(structure) || player_structure.isCivic(structure)) - { - return false; - } - if (!player_structure.hasSpecialSignSkillMod(player, structure) && !hasObjVar(structure, player_structure.SPECIAL_SIGN)) - { - return false; - } - if (sui.hasPid(player, player_structure.VAR_SPECIAL_SIGN_MENU_PID)) - { - int pid = sui.getPid(player, player_structure.VAR_SPECIAL_SIGN_MENU_PID); - forceCloseSUIPage(pid); - } - blog("terminal_structure.getSpecialSignManagementMenu: validation completed, getting menu options"); - - Vector menuOptions = new Vector(); - menuOptions.setSize(0); - Vector menuStrings = new Vector(); - menuStrings.setSize(0); - boolean replaceSign = false; - boolean removeSign = false; - - if (hasObjVar(structure, player_structure.SPECIAL_SIGN)) - { - utils.addElement(menuStrings, "@player_structure:remove_current_sign"); - utils.addElement(menuOptions, "remove"); - removeSign = true; - } - - if (player_structure.getSpecialSignList(player, structure)) - { - - String[] signList = utils.getStringArrayScriptVar(player, player_structure.VAR_SPECIAL_SIGN_LIST); - String[] signName = utils.getStringArrayScriptVar(player, player_structure.VAR_SPECIAL_SIGN_NAMES); - - if (signList != null && signList.length > 0 && signName != null && signName.length > 0) - { - - utils.addElement(menuStrings, "@player_structure:replace_current_sign"); - utils.addElement(menuOptions, "replace"); - replaceSign = true; - } - - if (replaceSign && !removeSign) - { - blog("terminal_structure.getSpecialSignManagementMenu: the only option was replace"); - int pid = sui.listbox(structure, player, "@base_player:special_sign_ui_prompt", sui.OK_CANCEL, "@base_player:special_sign_ui_title", signName, "handleSpecialSignSelection", true); - sui.setPid(player, pid, player_structure.VAR_SPECIAL_SIGN_MENU_PID); - return true; - } - } - blog("terminal_structure.getSpecialSignManagementMenu: the menu was either just remove or remove and replace"); - - String[] signList = new String[menuStrings.size()]; - String[] optionList = new String[menuOptions.size()]; - - menuStrings.toArray(signList); - menuOptions.toArray(optionList); - - blog("terminal_structure.getSpecialSignManagementMenu: menu options received"); - utils.setScriptVar(player, player_structure.VAR_SPECIAL_SIGN_MENU, optionList); - - int pid = sui.listbox(structure, player, "@base_player:special_sign_ui_prompt", sui.OK_CANCEL, "@base_player:special_sign_ui_title", signList, "handleSpecialSignManagementSelection", true); - sui.setPid(player, pid, player_structure.VAR_SPECIAL_SIGN_MENU_PID); - return true; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (msg == null || msg.equals("")) - { - return false; - } - if (LOGGING_ON) - { - LOG(TERMINAL_LOGGING, msg); - } - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant.java deleted file mode 100644 index e40061a6f..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant.java +++ /dev/null @@ -1,233 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.city; -import script.library.create; -import script.library.locations; -import script.library.pet_lib; -import script.library.player_structure; -import script.library.travel; -import script.library.utils; - - -public class terminal_travel_instant extends script.base_script -{ - public terminal_travel_instant() - { - } - public static final string_id SID_TIMEOUT = new string_id("travel", "pickup_timeout"); - public static final string_id SID_LEFT_ME = new string_id("travel", "left_pickup_zone"); - public static final string_id SID_NOT_YOUR_SHIP = new string_id("travel", "not_your_ship"); - public static final String TRIGGER_VOLUME_PICKUP_SHIP = "travel_instant_pickup_interest_range"; - public static final float PICKUP_INTEREST_RADIUS = 64f; - - public static final boolean CONST_FLAG_DO_LOGGING = false; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - debugLogging("//***// OnInitialize: ", "////>>>> ENTERED. "); - - messageTo(self, "timeOutSelfExpire", null, 60, false); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - obj_id owner = (playerCheck(self, "OnObjectMenuRequest - ")); - if (owner != player) - { - sendSystemMessage( player, SID_NOT_YOUR_SHIP ); - return SCRIPT_CONTINUE; - } - - menu_info_data data = mi.getMenuItemByType (menu_info_types.ITEM_USE); - - if (data != null) - { - data.setServerNotify (true); - } - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - obj_id owner = (playerCheck(self, "OnObjectMenuSelect - ")); - if (owner != player) - { - return SCRIPT_CONTINUE; - } - - if (getState(player, STATE_RIDING_MOUNT) == 1) - { - pet_lib.doDismountNow(player, true); - } - - if (item == menu_info_types.ITEM_USE) - { - String planet = getCurrentSceneName(); - String travel_point = "Starfighter"; - - int cityId = getCityAtLocation(getLocation(player), 1000); - debugLogging("//***// OnObjectMenuSelect: ", "////>>>> cityId at player's location is: "+cityId); - if (cityId != 0) - { - travel_point = cityGetName(cityId); - debugLogging("//***// OnObjectMenuSelect: ", "////>>>> city name at player's location is: "+travel_point); - } - - LOG("LOG_CHANNEL", "player ->"+ player + " planet ->"+ planet + " travel_point ->"+ travel_point); - - String config = getConfigSetting("GameServer", "disableTravelSystem"); - if (config != null) - { - if (config.equals("on")) - { - return SCRIPT_CONTINUE; - } - } - - utils.setScriptVar(player, travel.SCRIPT_VAR_TERMINAL, self); - utils.setScriptVar(player, "instantTravel", true); - boolean success = enterClientTicketPurchaseMode(player, planet, travel_point, true); - if (success) - { - - utils.setScriptVar(self, "transport", 1); - } - } - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id breacher) throws InterruptedException - { - obj_id player = (playerCheck(self, "OnTriggerVolumeEntered - ")); - debugLogging("//***// OnTriggerVolumeExited: ", "////>>>> player is leaving the instant travel terminal behind (the ship). Destroying self"); - sendSystemMessage( player, SID_LEFT_ME ); - messageTo(player, "cleanupInstantTravelScriptVars", null, 0, false); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - obj_id player = utils.getObjIdScriptVar(self, "player"); - if (isIdValid(player)) - { - messageTo(player, "cleanupInstantTravelScriptVars", null, 0, false); - } - - return SCRIPT_CONTINUE; - } - - - public void debugLogging(String section, String message) throws InterruptedException - { - if (CONST_FLAG_DO_LOGGING) - { - LOG("debug/terminal_travel_instant/"+section, message); - } - } - - - public void pickupObjectTriggerVolumeInitializer(obj_id self) throws InterruptedException - { - obj_id player = (playerCheck(self, "pickupObjectTriggerVolumeInitializer")); - - if (!hasTriggerVolume(self, TRIGGER_VOLUME_PICKUP_SHIP)) - { - - debugLogging("//***// pickupObjectTriggerVolumeInitializer: ", "////>>>> created new trigger volume TRIGGER_VOLUME_PICKUP_SHIP"); - createTriggerVolume(TRIGGER_VOLUME_PICKUP_SHIP, PICKUP_INTEREST_RADIUS, false); - addTriggerVolumeEventSource(TRIGGER_VOLUME_PICKUP_SHIP, player); - } - } - - - public obj_id playerCheck(obj_id self, String section) throws InterruptedException - { - if (utils.hasScriptVar(self,"playerOwner")) - { - obj_id player = utils.getObjIdScriptVar(self, "playerOwner"); - if (isIdValid(player)) - { - return player; - } - else - { - debugLogging(section, "////>>>> the player owner scriptvar isn't valid, so destroying self"); - } - } - else - { - debugLogging(section, "////>>>> we don't have a player owner scriptvar, so no way to know what to track. Destroying self"); - } - - destroyObject(self); - return null; - } - - - public int timeOutSelfExpire(obj_id self, dictionary params) throws InterruptedException - { - if (utils.hasScriptVar(self, "playerOwner")) - { - obj_id player = utils.getObjIdScriptVar(self, "playerOwner"); - if (isIdValid(player)) - { - messageTo(player, "cleanupInstantTravelScriptVars", null, 0, false); - } - if (isIdValid(player) && !utils.hasScriptVar(self, "transport")) - { - sendSystemMessage( player, SID_TIMEOUT ); - } - - } - destroyObject(self); - - return SCRIPT_CONTINUE; - } - - - public int initializeInstaTravelShip(obj_id self, dictionary params) throws InterruptedException - { - debugLogging("//***// OnInitialize: ", "////>>>> ENTERED. "); - - pickupObjectTriggerVolumeInitializer(self); - - if (utils.hasScriptVar(self,"playerOwner")) - { - obj_id player = utils.getObjIdScriptVar(self,"playerOwner"); - if (isIdValid(player)) - { - - } - else - { - debugLogging("//// OnInitialize: ", "////>>>> we don't have a valid scriptvar pointing to our owning player, so destroy self."); - destroyObject(self); - } - } - else - { - debugLogging("//// OnInitialize: ", "////>>>> apparently we don't have a playerOwner scriptvar, so destroy self."); - destroyObject(self); - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant_one_use.java b/sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant_one_use.java deleted file mode 100644 index 44faf412d..000000000 --- a/sku.0/sys.server/compiled/game/script/terminal/terminal_travel_instant_one_use.java +++ /dev/null @@ -1,144 +0,0 @@ -package script.terminal; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.city; -import script.library.create; -import script.library.locations; -import script.library.pet_lib; -import script.library.player_structure; -import script.library.travel; -import script.library.utils; - - -public class terminal_travel_instant_one_use extends script.base_script -{ - public terminal_travel_instant_one_use() - { - } - public static final string_id SID_LOCATION_NOGOOD_FOR_PICKUP = new string_id("travel", "no_pickup_location"); - public static final string_id SID_TIMEOUT = new string_id("travel", "pickup_timeout"); - public static final string_id SID_LEFT_ME = new string_id("travel", "left_pickup_zone"); - public static final string_id SID_NOT_YOUR_SHIP = new string_id("travel", "not_your_ship"); - public static final String TRIGGER_VOLUME_PICKUP_SHIP = "travel_instant_pickup_interest_range"; - public static final float PICKUP_INTEREST_RADIUS = 64f; - public static final string_id SID_CALLING_FOR_PICKUP = new string_id("travel", "calling_for_pickup"); - - public static final boolean CONST_FLAG_DO_LOGGING = true; - public static final int SHIP_TYPE_INSTANT_XWING_TIE = 1; - public static final int SHIP_TYPE_INSTANT_PRIVATEER = 2; - public static final int SHIP_TYPE_INSTANT_ROYAL_SHIP = 3; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - int mnu = mi.addRootMenu(menu_info_types.ITEM_USE, new string_id("ui_radial", "item_use")); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item == menu_info_types.ITEM_USE) - { - - sendSystemMessage(player, SID_CALLING_FOR_PICKUP ); - spawnPickupCraft(player, 2); - } - return SCRIPT_CONTINUE; - } - - - public obj_id spawnPickupCraft(obj_id player, int type) throws InterruptedException - { - debugLogging("//***// spawnPickupCraft", "////>>>> ENTERED"); - - if (!isIdValid(player)) - { - return null; - } - - location here = getLocation(player); - location spawnLoc = locations.getGoodLocationAroundLocation(here, 1f, 1f, 4f, 4f); - if (spawnLoc == null) - { - debugLogging("//***// spawnPickupCraft", "////>>>> getGoodLocationAroundLocation (player area) returned NULL! OH NO! Telling player that the location is no good."); - sendSystemMessage( player, SID_LOCATION_NOGOOD_FOR_PICKUP ); - return null; - } - - String pickupCraftType = "object/tangible/terminal/terminal_travel_instant_xwing.iff"; - - if (type == SHIP_TYPE_INSTANT_XWING_TIE) - { - - int playerFactionID = pvpGetAlignedFaction(player); - - if (playerFactionID == (-615855020)) - { - pickupCraftType = "object/tangible/terminal/terminal_travel_instant_tie.iff"; - spawnLoc.y+= 5f; - } - } - - if (type == SHIP_TYPE_INSTANT_PRIVATEER) - { - pickupCraftType = "object/tangible/terminal/terminal_travel_instant_privateer.iff"; - } - - if (type == SHIP_TYPE_INSTANT_ROYAL_SHIP) - { - pickupCraftType = "object/tangible/terminal/terminal_travel_instant_royal_ship.iff"; - } - - obj_id pickupCraft = create.object(pickupCraftType, spawnLoc); - debugLogging("//***// spawnPickupCraft", "////>>>> spawned the pickup craft. It was obj_id: "+pickupCraft); - if (!isIdValid(pickupCraft)) - { - debugLogging("//***// spawnPickupCraft", "////>>>> Apparently, we DIDN'T SPAWN A SHIP!"); - return null; - } - - utils.setScriptVar(player,"instantTravelShip",pickupCraft); - utils.setScriptVar(pickupCraft,"playerOwner",player); - - if (!utils.hasScriptVar(pickupCraft,"playerOwner")) - { - debugLogging("//***// spawnPickupCraft", "////>>>> FAILED TO WRITE PLAYER OID TO SHIP"); - } - - setObjVar(pickupCraft,"playerOwner",player); - if (!hasObjVar(pickupCraft,"playerOwner")) - { - debugLogging("//***// spawnPickupCraft", "////>>>> FAILED TO WRITE PLAYER OID TO SHIP - OBJVAR"); - } - - messageTo (pickupCraft, "initializeInstaTravelShip", null, 1, false); - - return pickupCraft; - } - - - public void debugLogging(String section, String message) throws InterruptedException - { - if (CONST_FLAG_DO_LOGGING) - { - LOG("travel_terminal", message); - } - } - -} diff --git a/sku.0/sys.server/compiled/game/script/test/cannot_die_healing_test.java b/sku.0/sys.server/compiled/game/script/test/cannot_die_healing_test.java deleted file mode 100644 index 418167643..000000000 --- a/sku.0/sys.server/compiled/game/script/test/cannot_die_healing_test.java +++ /dev/null @@ -1,37 +0,0 @@ -package script.test; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -public class cannot_die_healing_test extends script.base_script -{ - public cannot_die_healing_test() - { - } - - public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException - { - setAttrib(self, HEALTH, 100); - return SCRIPT_CONTINUE; - } - - - public int OnObjectDamaged(obj_id self, obj_id attacker, obj_id weapon, int damage) throws InterruptedException - { - setHitpoints(self, 100); - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - return SCRIPT_OVERRIDE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/test/jhaskell_test.java b/sku.0/sys.server/compiled/game/script/test/jhaskell_test.java deleted file mode 100644 index a14b02821..000000000 --- a/sku.0/sys.server/compiled/game/script/test/jhaskell_test.java +++ /dev/null @@ -1,237 +0,0 @@ -package script.test; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.city; -import script.library.qa; -import script.library.utils; - - -public class jhaskell_test extends script.base_script -{ - public jhaskell_test() - { - } - public static final int SF_COST_CITY_LOW = 16; - public static final int SF_SKILL_TRAINER = 64; - - public static final String CITY_SKILL_TRAINERS = "datatables/city/skill_trainers.iff"; - - - public int OnSpeaking(obj_id self, String text) throws InterruptedException - { - if (isGod(self)) - { - debugConsoleMsg( self, "jhaskell_test OnSpeaking: "+ text ); - - java.util.StringTokenizer tok = new java.util.StringTokenizer (text); - - if (tok.hasMoreTokens ()) - { - String priCommand = tok.nextToken (); - String secCommand = ""; - if (tok.hasMoreTokens ()) - { - secCommand = tok.nextToken (); - } - - debugConsoleMsg( self, "command is: "+ priCommand); - - if (priCommand.equalsIgnoreCase ("what_scene") && secCommand.equals("")) - { - sendSystemMessage(self, "You are in scene: "+ getCurrentSceneName(), null); - } - else if (priCommand.equalsIgnoreCase ("is_tutorial") && secCommand.equals("")) - { - sendSystemMessage(self, "Is in Tutorial: "+ isInTutorialArea(self), null); - } - else if (priCommand.equalsIgnoreCase ("city") && secCommand.equalsIgnoreCase ("set_trainers")) - { - - obj_id structure = qa.findTarget(self); - if (!isValidId(structure) || !exists(structure)) - { - - sendSystemMessage(self, "You must target object", null); - } - int city_id = findCityByCityHall( structure ); - if (city_id <= 0) - { - - sendSystemMessage(self, "You must target city hall", null); - } - if (!cityExists( city_id )) - { - - sendSystemMessage(self, "Structure does't exist", null); - return SCRIPT_CONTINUE; - } - - boolean successSkillTrainers = setCitySkillTrainers(self, city_id); - if (successSkillTrainers) - { - sendSystemMessage(self, "Legacy Trainer Spawners placed", null); - } - else - { - sendSystemMessage(self, "The Trainer Routine Failed", null); - } - - } - else if (priCommand.equalsIgnoreCase ("city") && secCommand.equalsIgnoreCase ("destroy_trainers")) - { - - obj_id structure = qa.findTarget(self); - if (!isValidId(structure) || !exists(structure)) - { - - sendSystemMessage(self, "You must target object", null); - } - int city_id = findCityByCityHall( structure ); - if (city_id <= 0) - { - - sendSystemMessage(self, "You must target city hall", null); - } - if (!cityExists( city_id )) - { - - sendSystemMessage(self, "Structure does't exist", null); - return SCRIPT_CONTINUE; - } - - boolean destroySuccess = destroyCitySkillTrainers(self, city_id); - } - else if (priCommand.equalsIgnoreCase ("city") && secCommand.equalsIgnoreCase ("get_structures")) - { - - obj_id structure = qa.findTarget(self); - if (!isValidId(structure) || !exists(structure)) - { - - sendSystemMessage(self, "You must target object", null); - } - int city_id = findCityByCityHall( structure ); - if (city_id <= 0) - { - - sendSystemMessage(self, "You must target city hall", null); - } - if (!cityExists( city_id )) - { - - sendSystemMessage(self, "Structure does't exist", null); - return SCRIPT_CONTINUE; - } - - obj_id[] structures = cityGetStructureIds( city_id ); - for (int i = 0; i < structures.length; i++) - { - testAbortScript(); - sendSystemMessage(self, "Found: "+getName(structures[i]), null); - } - sendSystemMessage(self, "getTrainerCount: "+city.getTrainerCount( city_id ), null); - sendSystemMessage(self, "getMaxTrainerCount: "+city.getMaxTrainerCount( city_id ), null); - } - else if (priCommand.equalsIgnoreCase ("get_name") && secCommand.equals("")) - { - - obj_id target = qa.findTarget(self); - if (!isValidId(target) || !exists(target)) - { - - sendSystemMessage(self, "You must target object", null); - } - sendSystemMessage(self, "Name: "+localize( getNameStringId(target)), null); - - } - else if (priCommand.equalsIgnoreCase ("get_loco") && secCommand.equals("")) - { - sendSystemMessage(self, "Locomotion:"+getLocomotion(self), null); - } - else if (priCommand.equalsIgnoreCase ("squad") && !secCommand.equals("")) - { - - sendSystemMessage(self, "Ship: "+secCommand, null); - obj_id secCmd = utils.stringToObjId(secCommand); - if (!isValidId(secCmd)) - { - sendSystemMessage(self, "Ship OID not valid ", null); - } - - sendSystemMessage(self, "Ship OID valid", null); - sendSystemMessage(self, "Ship Squad: "+_spaceUnitGetSquadId(secCmd), null); - } - } - } - return SCRIPT_CONTINUE; - } - - - public boolean setCitySkillTrainers(obj_id self, int city_id) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!cityExists( city_id )) - { - return false; - } - - location poiStartLocation = getLocation(self); - float yaw = getYaw( self ); - String[] arrayOfAllTrianerTemplates = dataTableGetStringColumn(CITY_SKILL_TRAINERS, "TEMPLATE"); - String[] arrayOfAllTrianerStrings = dataTableGetStringColumn(CITY_SKILL_TRAINERS, "STRING"); - - sendSystemMessage(self, "Number of Trainers Being Placed: "+ arrayOfAllTrianerTemplates.length, null); - if (arrayOfAllTrianerTemplates.length != arrayOfAllTrianerStrings.length) - { - return false; - } - - for (int i = 0; i < arrayOfAllTrianerTemplates.length; i++) - { - testAbortScript(); - location poiLocation = utils.getRandomAwayLocation(poiStartLocation, 5.f, 10.f); - obj_id poi = createObject(arrayOfAllTrianerTemplates[i], poiLocation); - - if (isValidId(poi) && exists(poi)) - { - setYaw( poi, yaw ); - setObjVar( poi, "creator", self ); - setName(poi, arrayOfAllTrianerStrings[i]); - int flags = SF_COST_CITY_LOW | SF_SKILL_TRAINER; - citySetStructureInfo( city_id, poi, flags, true ); - setObjVar( poi, "city_id", city_id ); - } - sendSystemMessage(self, arrayOfAllTrianerStrings[i] + " placed.", null); - - } - return true; - } - - - public boolean destroyCitySkillTrainers(obj_id self, int city_id) throws InterruptedException - { - obj_id[] structures = cityGetStructureIds( city_id ); - for (int i=0; i secretNumber) - { - - blog("handleDialogInput Too High"); - utils.setScriptVar(player, VAR_PREFIX + ".number_combo_guess_"+ guessPostion, " ("+ playerGuessInt + " too high)"); - utils.setScriptVar(player, TOTAL_GUESSES, totalGuesses++); - } - else - { - - blog("handleDialogInput Too Low"); - utils.setScriptVar(player, VAR_PREFIX + ".number_combo_guess_"+ guessPostion, " ("+ playerGuessInt + " too low)"); - utils.setScriptVar(player, TOTAL_GUESSES, totalGuesses++); - } - - createSui(self, player); - return SCRIPT_CONTINUE; - } - - - public boolean getRandomNumberCombinations(obj_id collectionItem, obj_id player) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - boolean hasBuff = false; - if (buff.hasBuff(player, CONTAINER_PUZZLE_BUFF)) - { - hasBuff = true; - } - - blog("HASBUFF: "+hasBuff); - - int amountOfNumbers = rand(4,6); - if (hasBuff) - { - amountOfNumbers = 3; - } - - blog("getRandomNumberCombinations amountOfNumbers = "+amountOfNumbers); - - for (int i = 1; i < amountOfNumbers+1; i++) - { - testAbortScript(); - - int randMax = MAX_INT_COMBO_1; - if (i == 2) - { - randMax = MAX_INT_COMBO_2; - } - else if (i == 3) - { - randMax = MAX_INT_COMBO_3; - } - else if (i == 4) - { - randMax = MAX_INT_COMBO_4; - } - else if (i == 5) - { - randMax = MAX_INT_COMBO_5; - } - else if (i == 6) - { - randMax = MAX_INT_COMBO_6; - } - - int tempRandVariable = rand(0, randMax); - - utils.setScriptVar(player, VAR_PREFIX + ".number_combo_"+ i, tempRandVariable); - - int lengthOfVar = (""+ tempRandVariable).length(); - String asterisks = ""; - for (int j = 0; j < lengthOfVar; j++) - { - testAbortScript(); - asterisks += "*"; - } - utils.setScriptVar(player, VAR_PREFIX + ".number_combo_asterisk_"+ i, asterisks); - } - - utils.setScriptVar(player, NUMBER_OF_COMBOS, amountOfNumbers); - utils.setScriptVar(player, TOTAL_GUESSES, TOTAL_GUESS_DEFAULT); - - int thresholdRow = dataTableSearchColumnForInt(amountOfNumbers, "combinations", THRESHOLD_TABLE); - if (thresholdRow < 0) - { - return false; - } - - dictionary threshDict = dataTableGetRow(THRESHOLD_TABLE, thresholdRow); - - for (int t = 1; t < amountOfNumbers + 1; t++) - { - testAbortScript(); - int threshold = threshDict.getInt("threshold"+t); - utils.setScriptVar(player, VAR_PREFIX + ".number_combo_threshold_"+ t, threshold); - blog("getRandomNumberCombinations - .number_combo_threshold_"+ t); - } - - return true; - } - - - public boolean calculateThreshold(obj_id collectionItem, obj_id player, int guessPosition) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - int threshold = utils.getIntScriptVar(player, VAR_PREFIX + ".number_combo_threshold_"+ guessPosition); - int totalGuesses = utils.getIntScriptVar(player, TOTAL_GUESSES); - - if (threshold < 0 || totalGuesses < 0) - { - return false; - } - else if (totalGuesses < threshold) - { - - blog("setting threshold to TRUE"); - utils.setScriptVar(player, VAR_PREFIX + ".under_threshold_"+ guessPosition, true); - } - else - { - - blog("setting threshold to FALSE"); - utils.setScriptVar(player, VAR_PREFIX + ".under_threshold_"+ guessPosition, false); - } - - utils.setScriptVar(player, TOTAL_GUESSES, TOTAL_GUESS_DEFAULT); - return true; - } - - - public boolean completeNumberGuess(obj_id collectionItem, obj_id player, int guessPosition) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - blog("completeNumberGuess - validation completed"); - - int totalNumberOfCombos = utils.getIntScriptVar(player, NUMBER_OF_COMBOS); - if (totalNumberOfCombos <= 0) - { - return false; - } - - blog("completeNumberGuess - totalNumberOfCombos: "+totalNumberOfCombos); - blog("completeNumberGuess - guessPosition: "+guessPosition); - - calculateThreshold(collectionItem, player, guessPosition); - - if (guessPosition < totalNumberOfCombos) - { - blog("completeNumberGuess - player still has more combinations to win."); - utils.setScriptVar(player, GUESS_POSITION, guessPosition + 1); - createSui(collectionItem, player); - return true; - } - - blog("completeNumberGuess - player completed all guesses."); - - boolean completedAllThresholds = true; - for (int i = 1; i < totalNumberOfCombos + 1; i++) - { - testAbortScript(); - if (!utils.hasScriptVar(player, VAR_PREFIX + ".under_threshold_" + i)) - { - blog("completeNumberGuess - player did not have the proper thresholds saved."); - return false; - } - - boolean guessThreshold = utils.getBooleanScriptVar(player, VAR_PREFIX + ".under_threshold_"+ i); - if (!guessThreshold) - { - completedAllThresholds = false; - } - } - - if (!collection.rewardPlayerCollectionSlot(player, collectionItem)) - { - blog("rewardPlayer - rewardPlayerCollectionSlot = FAIL!!!"); - closeOldWindow(player); - removePlayerVars(player); - return false; - } - blog("rewardPlayer - rewardPlayerCollectionSlot = GIVE LOOT"); - - loot.giveMeatlumpPuzzleLoot(player, completedAllThresholds, false); - - blog("rewardPlayer - rewardPlayerCollectionSlot = SUCCESS"); - closeOldWindow(player); - removePlayerVars(player); - - return true; - } - - - public int closeSui(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - if (buff.applyBuff(player, "locked_container_puzzle_downer")) - {; - } - { - sendSystemMessage(player, YOU_CANCELED_EARLY); - } - - blog("closeSui"); - closeOldWindow(player); - - return SCRIPT_CONTINUE; - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - int pid = sui.getPid(player, PID_NAME); - if (pid > -1) - { - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } - - - public void removePlayerVars(obj_id player) throws InterruptedException - { - blog("Removing Player Scriptvars and Objvars from player: "+player); - utils.removeScriptVarTree(player, VAR_PREFIX); - utils.removeObjVar(player, VAR_PREFIX); - } - - - public boolean blog(String msg) throws InterruptedException - { - LOG("minigame",msg); - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_food_supplies.java b/sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_food_supplies.java deleted file mode 100644 index 43c742bf4..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_food_supplies.java +++ /dev/null @@ -1,398 +0,0 @@ -package script.theme_park.meatlump; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.consumable; -import script.library.sui; -import script.library.stealth; -import script.library.utils; - - -public class destroy_food_supplies extends script.base_script -{ - public destroy_food_supplies() - { - } - public static final boolean LOGGING_ON = false; - - public static final String VAR_PREFIX = "meatlump_food_supplies"; - public static final String PID_NAME = VAR_PREFIX + ".pid"; - public static final String CALIBRATION_GOAL = VAR_PREFIX + ".goal"; - public static final String CALIBRATION_TRIES = VAR_PREFIX + ".tries"; - public static final String CALIBRATION_MAX_TRIES = VAR_PREFIX + ".max_tries"; - - public static final String CAPTION = "Mix Biological Yeast"; - public static final String DEVICE_TEMPLATE = "object/tangible/meatlump/event/slicing_device_meatlump_food.iff"; - public static final String DEVICE_OBJVAR = "puzzle"; - - public static final string_id SID_OPEN = new string_id("meatlump/meatlump", "food_calibration_use"); - public static final string_id YOU_FAILED = new string_id("meatlump/meatlump", "you_failed"); - public static final string_id YOU_CANCELED_EARLY = new string_id("meatlump/meatlump", "you_canceled_early"); - public static final string_id YOU_HAVE_DEBUFF = new string_id("meatlump/meatlump", "you_have_debuff"); - public static final string_id YOU_NEED_DEVICE = new string_id("meatlump/meatlump", "you_need_device"); - - public static final String CALIBRATION_ATTEMPTS_REMAINING = "@meatlump/meatlump:food_calibration_attempts_remaining"; - public static final String CALIBRATION_SUCCESS = "@meatlump/meatlump:food_calibration_success"; - public static final String CALIBRATION_FAILURE = "@meatlump/meatlump:food_calibration_failure"; - public static final String CALIBRATION_DESCRIPTION = "@meatlump/meatlump:food_calibration_description"; - public static final String SUI_SLIDER1 = "@meatlump/meatlump:food_calibration_slider1"; - public static final String SUI_SLIDER2 = "@meatlump/meatlump:food_calibration_slider2"; - public static final String SUI_SLIDER3 = "@meatlump/meatlump:food_calibration_slider3"; - public static final String FOOD_PUZZLE_BUFF = "food_supplies_puzzle_buff"; - - public static final int DEFAULT_TRIES = 10; - public static final int BUFF_TRIES_INCREASE = 10; - - public static final int[] DEFAULT_GOAL_CURRENT_ARRAY = - { - 0, - 0, - 0 - }; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - mi.addRootMenu(menu_info_types.ITEM_USE, SID_OPEN); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id collectionItem = self; - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - else if (!collection.canCollectCollectible(player, self)) - { - return SCRIPT_CONTINUE; - } - else if (buff.hasBuff(player, "food_supplies_puzzle_downer")) - { - sendSystemMessage(player, YOU_HAVE_DEBUFF); - return SCRIPT_CONTINUE; - } - else if (!consumable.decrementObjectInventoryOrEquipped(player, DEVICE_TEMPLATE, DEVICE_OBJVAR)) - { - sendSystemMessage(player, YOU_NEED_DEVICE); - return SCRIPT_CONTINUE; - } - - closeOldWindow(player); - blog("OnObjectMenuSelect"); - yeastAdjustmentPuzzle(collectionItem, player); - - return SCRIPT_CONTINUE; - } - - - public boolean yeastAdjustmentPuzzle(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("gyroReceiverPuzzle - INIT"); - if (!isIdValid(collectionItem) || !exists(collectionItem)) - { - return false; - } - else if (!isIdValid(player) || !exists(player)) - { - return false; - } - - dictionary params = new dictionary(); - int pid = createSUIPage("/Script.calibration.game3", collectionItem, player); - sui.setPid(player, pid, PID_NAME); - setSUIAssociatedLocation(pid, collectionItem); - setSUIMaxRangeToObject(pid, collection.MAX_RANGE_TO_COLLECT); - params.put("callingPid", pid); - - blog("gyroReceiverPuzzle - PID: "+pid); - - int[] goal = new int[DEFAULT_GOAL_CURRENT_ARRAY.length]; - System.arraycopy(DEFAULT_GOAL_CURRENT_ARRAY, 0, goal, 0, DEFAULT_GOAL_CURRENT_ARRAY.length); - - if (goal.length != DEFAULT_GOAL_CURRENT_ARRAY.length) - { - return false; - } - - for (int i = 0; i < goal.length; i++) - { - testAbortScript(); - goal[i] = rand(0, 100); - } - - int calibrationTries = DEFAULT_TRIES; - int calibrationMaxTries = DEFAULT_TRIES; - - if (buff.hasBuff(player, FOOD_PUZZLE_BUFF)) - { - calibrationTries += BUFF_TRIES_INCREASE; - calibrationMaxTries += BUFF_TRIES_INCREASE; - blog("HASBUFF: TRUE"); - } - blog("HASBUFF?"); - - utils.setScriptVar(collectionItem, CALIBRATION_GOAL, goal); - utils.setScriptVar(collectionItem, CALIBRATION_TRIES, calibrationTries); - utils.setScriptVar(collectionItem, CALIBRATION_MAX_TRIES, calibrationMaxTries); - - setSUIProperty(pid, "top.sliders.1.slider", "Value", "100"); - setSUIProperty(pid, "top.sliders.2.slider", "Value", "100"); - setSUIProperty(pid, "top.sliders.3.slider", "Value", "100"); - - setSUIProperty(pid, "top.sliders.1.title", "Text", SUI_SLIDER1); - setSUIProperty(pid, "top.sliders.2.title", "Text", SUI_SLIDER2); - setSUIProperty(pid, "top.sliders.3.title", "Text", SUI_SLIDER3); - - setSUIProperty(pid, "bg.caption.lbltitle", "Text", CAPTION); - setSUIProperty(pid, "description.desc", "Text", CALIBRATION_DESCRIPTION); - setSUIProperty(pid, "description.attempts", "Text", CALIBRATION_ATTEMPTS_REMAINING + " 100%"); - - for (int i = 0; i < goal.length; i++) - { - testAbortScript(); - float pct = (float)goal[i] / 100.0f; - int dec = (int)(255*pct); - String hex = Integer.toHexString(dec); - if (hex.length() == 1) - { - hex = "0"+ hex; - } - String hexValue = "#"+ hex + hex + hex; - setSUIProperty(pid, "top.bars.server."+ (i+1), "Color", hexValue); - } - - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "%buttonOK%", "yeastReceiverPuzzleCallback"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "%buttonOK%", "top.sliders.1.slider", "Value"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "%buttonOK%", "top.sliders.2.slider", "Value"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "%buttonOK%", "top.sliders.3.slider", "Value"); - subscribeToSUIEvent(pid, sui_event_type.SET_onClosedCancel, "%button0%", "closeSui"); - - setSUIAssociatedObject(pid, player); - setSUIMaxRangeToObject(pid, 10.0f); - showSUIPage(pid); - blog("gyroReceiverPuzzle - SUI Created"); - flushSUIPage(pid); - return true; - } - - - public int yeastReceiverPuzzleCallback(obj_id self, dictionary params) throws InterruptedException - { - blog("gyroReceiverPuzzleCallback - INIT"); - - String widgetName = params.getString("eventWidgetName"); - obj_id player = sui.getPlayerId(params); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int pid = sui.getPid(player, PID_NAME); - blog("gyroReceiverPuzzleCallback - PID: "+pid); - if (widgetName.equalsIgnoreCase("btnCancel") || widgetName.equalsIgnoreCase("")) - { - if (buff.applyBuff(player, "food_supplies_puzzle_downer")) - {; - } - { - sendSystemMessage(player, YOU_CANCELED_EARLY); - } - blog("gyroReceiverPuzzleCallback - btnCancel"); - removePlayerVars(player); - forceCloseSUIPage(pid); - return SCRIPT_CONTINUE; - } - blog("gyroReceiverPuzzleCallback - buttonOK"); - - int[] current = new int[DEFAULT_GOAL_CURRENT_ARRAY.length]; - System.arraycopy(DEFAULT_GOAL_CURRENT_ARRAY, 0, current, 0, DEFAULT_GOAL_CURRENT_ARRAY.length); - - int[] goal = utils.getIntArrayScriptVar(self, CALIBRATION_GOAL); - int tries = utils.getIntScriptVar(self, CALIBRATION_TRIES); - int max_tries = utils.getIntScriptVar(self, CALIBRATION_MAX_TRIES); - - boolean win = true; - blog("gyroReceiverPuzzleCallback - loop start"); - - for (int i = 0; i < current.length; i++) - { - testAbortScript(); - current[i] = utils.stringToInt(params.getString("top.sliders." + (i+1) + ".slider.Value")); - int delta = goal[i] - current[i]; - if (delta < -5 || delta > 5) - { - win = false; - } - - float pct = (float)current[i] / 100.0f; - int dec = (int)(255*pct); - String hex = Integer.toHexString(dec); - if (hex.length() == 1) - { - hex = "0"+ hex; - } - String hexValue = "#"+ hex + hex + hex; - setSUIProperty(pid, "top.bars.player."+ (i+1), "Color", hexValue); - } - blog("gyroReceiverPuzzleCallback - loop finish"); - - tries--; - int integrity = (int)(((float)tries / (float)max_tries) * 100); - - if (win) - { - blog("gyroReceiverPuzzleCallback - YOU WIN"); - rewardPlayer(self, player); - } - else if (tries <= 0) - { - blog("gyroReceiverPuzzleCallback - I LOSE"); - - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "%buttonOK%", "noCallback"); - setSUIProperty(pid, "%buttonOK%", "Visible", "false"); - setSUIProperty(pid, "top.sliders.1.slider", "GetsInput", "false"); - setSUIProperty(pid, "top.sliders.2.slider", "GetsInput", "false"); - setSUIProperty(pid, "top.sliders.3.slider", "GetsInput", "false"); - setSUIProperty(pid, "description.desc", "Text", CALIBRATION_FAILURE); - - for (int i = 0; i < current.length; i++) - { - testAbortScript(); - - float pct = (float)current[i] / 100.0f; - int dec = (int)(255*pct); - String hex = Integer.toHexString(dec); - if (hex.length() == 1) - { - hex = "0"+ hex; - } - String hexValue = "#"+ hex + "0000"; - setSUIProperty(pid, "top.bars.player."+ (i+1), "Color", hexValue); - setSUIProperty(pid, "top.bars.server."+ (i+1), "Color", hexValue); - } - setSUIProperty(pid, "description.attempts", "Text", CALIBRATION_ATTEMPTS_REMAINING + " "+ integrity + "%"); - if (buff.applyBuff(player, "food_supplies_puzzle_downer")) - {; - } - { - sendSystemMessage(player, YOU_FAILED); - } - closeOldWindow(player); - removePlayerVars(player); - } - else - { - blog("gyroReceiverPuzzleCallback - Try again"); - setSUIProperty(pid, "description.attempts", "Text", CALIBRATION_ATTEMPTS_REMAINING + " "+ integrity + "%"); - } - - utils.setScriptVar(self, CALIBRATION_TRIES, tries); - flushSUIPage(pid); - return SCRIPT_CONTINUE; - } - - - public boolean rewardPlayer(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("rewardPlayer - init"); - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - else if (!exists(collectionItem) || !exists(player)) - { - return false; - } - blog("rewardPlayer - validation complete"); - - if (!collection.rewardPlayerCollectionSlot(player, collectionItem)) - { - blog("rewardPlayer - rewardPlayerCollectionSlot = FAIL!!!"); - closeOldWindow(player); - removePlayerVars(player); - return false; - } - blog("rewardPlayer - rewardPlayerCollectionSlot = SUCCESS"); - - closeOldWindow(player); - removePlayerVars(player); - - return true; - } - - - public int closeSui(obj_id self, dictionary params) throws InterruptedException - { - blog("closeSui - init"); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - if (buff.applyBuff(player, "food_supplies_puzzle_downer")) - {; - } - { - blog("closeSui applying food_supplies_puzzle_downer"); - - sendSystemMessage(player, YOU_CANCELED_EARLY); - } - - blog("closeSui"); - closeOldWindow(player); - removePlayerVars(player); - return SCRIPT_CONTINUE; - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - blog("closeOldWindow - init"); - - int pid = sui.getPid(player, PID_NAME); - blog("closeOldWindow - pid: "+pid); - if (pid > -1) - { - blog("closeOldWindow - force closing: "+pid); - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } - - - public void removePlayerVars(obj_id player) throws InterruptedException - { - utils.removeScriptVarTree(player, VAR_PREFIX); - utils.removeObjVar(player, VAR_PREFIX); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG("minigame",msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_weapon_cache.java b/sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_weapon_cache.java deleted file mode 100644 index fd0fae1ac..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_weapon_cache.java +++ /dev/null @@ -1,589 +0,0 @@ -package script.theme_park.meatlump; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.consumable; -import script.library.sui; -import script.library.stealth; -import script.library.utils; -import java.lang.System; - - -public class destroy_weapon_cache extends script.base_script -{ - public destroy_weapon_cache() - { - } - public static final boolean LOGGING_ON = false; - - public static final String VAR_PREFIX = "meatlump_weapon_cache"; - public static final String PID_NAME = VAR_PREFIX + ".pid"; - public static final String CURRENTLY_CALIBRATION = VAR_PREFIX + ".calibration"; - public static final String CALIBRATION_GOAL = VAR_PREFIX + ".goal"; - public static final String CALIBRATION_CURRENT = VAR_PREFIX + ".current"; - public static final String CALIBRATION_TRIES = VAR_PREFIX + ".tries"; - public static final String CALIBRATION_MAX_TRIES = VAR_PREFIX + ".max_tries"; - - public static final String CAPTION = "Calibrate Power Cell Abatement"; - public static final String OBJVAR_SLOT_NAME = "collection.slotName"; - public static final String DEVICE_TEMPLATE = "object/tangible/meatlump/event/slicing_device_meatlump_weapon.iff"; - public static final String DEVICE_OBJVAR = "puzzle"; - public static final String WEAPON_PUZZLE_BUFF = "weapons_cache_puzzle_buff"; - - public static final string_id SID_OPEN = new string_id("meatlump/meatlump", "weapon_calibration_use"); - public static final String CALIBRATION_ATTEMPTS_REMAINING = "@meatlump/meatlump:weapon_calibration_attempts_remaining"; - public static final String CALIBRATION_SUCCESS = "@meatlump/meatlump:weapon_calibration_success"; - public static final String CALIBRATION_FAILURE = "@meatlump/meatlump:weapon_calibration_failure"; - public static final String CALIBRATION_DESCRIPTION = "@meatlump/meatlump:weapon_calibration_description"; - - public static final string_id MSG_CALIBRATION_ABORTED = new string_id("quest/force_sensitive/fs_crafting", "phase1_msg_calibration_aborted"); - public static final string_id YOU_FAILED = new string_id("meatlump/meatlump", "you_failed"); - public static final string_id YOU_CANCELED_EARLY = new string_id("meatlump/meatlump", "you_canceled_early"); - public static final string_id YOU_HAVE_DEBUFF = new string_id("meatlump/meatlump", "you_have_debuff"); - public static final string_id YOU_NEED_DEVICE = new string_id("meatlump/meatlump", "you_need_device"); - - public static final int DEFAULT_TRIES = 10; - public static final int BUFF_TRIES_INCREASE = 10; - - public static final String[] CONFIG_PLAYER_BUTTONS = - { - "top.triangles.player.right.1", - "top.triangles.player.right.2", - "top.triangles.player.right.3", - "top.triangles.player.left.2", - "top.triangles.player.left.3", - "top.triangles.player.left.1" - }; - - public static final String[] CONFIG_SERVER_BUTTONS = - { - "top.triangles.server.right.1", - "top.triangles.server.right.2", - "top.triangles.server.right.3", - "top.triangles.server.left.2", - "top.triangles.server.left.3", - "top.triangles.server.left.1" - }; - - public static final int[] DEFAULT_GOAL_CURRENT_ARRAY = - { - 0, - 0, - 0, - 0, - 0, - 0 - }; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - mi.addRootMenu(menu_info_types.ITEM_USE, SID_OPEN); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - obj_id collectionItem = self; - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - else if (!collection.canCollectCollectible(player, self)) - { - return SCRIPT_CONTINUE; - } - else if (buff.hasBuff(player, "weapons_cache_puzzle_downer")) - { - sendSystemMessage(player, YOU_HAVE_DEBUFF); - return SCRIPT_CONTINUE; - } - else if (!consumable.decrementObjectInventoryOrEquipped(player, DEVICE_TEMPLATE, DEVICE_OBJVAR)) - { - sendSystemMessage(player, YOU_NEED_DEVICE); - return SCRIPT_CONTINUE; - } - - closeOldWindow(player); - blog("OnObjectMenuSelect"); - createConfigUI(collectionItem, player); - - return SCRIPT_CONTINUE; - } - - - public boolean createConfigUI(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("createConfigUI - INIT"); - - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - else if (!exists(collectionItem) || !exists(player)) - { - return false; - } - - dictionary params = new dictionary(); - int pid = createSUIPage("/Script.calibration.game4", collectionItem, player); - sui.setPid(player, pid, PID_NAME); - setSUIAssociatedLocation(pid, collectionItem); - setSUIMaxRangeToObject(pid, collection.MAX_RANGE_TO_COLLECT); - params.put("callingPid", pid); - - blog("createConfigUI - sending to initializeCalibration"); - - if (!initializeCalibration(collectionItem, player)) - { - return false; - } - - setSUIProperty(pid, "bg.caption.lbltitle", "Text", CAPTION); - setSUIProperty(pid, "top.description.desc", "Text", CALIBRATION_DESCRIPTION); - setSUIProperty(pid, "top.description.attempts", "Text", CALIBRATION_ATTEMPTS_REMAINING + " 100%"); - - int[] goal = utils.getIntArrayScriptVar(player, CALIBRATION_GOAL); - if (goal == null) - { - return false; - } - - blog("createConfigUI - goal.length: "+goal.length); - - for (int i = 0; i < goal.length; i++) - { - testAbortScript(); - if (goal[i] == 1) - { - setSUIProperty(pid, CONFIG_SERVER_BUTTONS[i], "Color", "#000000"); - } - - setSUIProperty(pid, CONFIG_SERVER_BUTTONS[i], "IsCancelButton", "false"); - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "IsCancelButton", "false"); - } - - setSUIProperty(pid, "bg.mmc.close", "IsCancelButton", "true"); - - for (int i = 0; i < CONFIG_PLAYER_BUTTONS.length; i++) - { - testAbortScript(); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, CONFIG_PLAYER_BUTTONS[i], "configProcessorPuzzleCallback"); - } - - subscribeToSUIEvent(pid, sui_event_type.SET_onClosedCancel, "%button0%", "closeSui"); - - setSUIAssociatedObject(pid, player); - setSUIMaxRangeToObject(pid, 10.0f); - showSUIPage(pid); - return true; - } - - - public boolean initializeCalibration(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("initializeCalibration - INIT"); - - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - else if (!exists(collectionItem) || !exists(player)) - { - return false; - } - - blog("initializeCalibration - creating stuff"); - - int[] goal = new int[DEFAULT_GOAL_CURRENT_ARRAY.length]; - System.arraycopy(DEFAULT_GOAL_CURRENT_ARRAY, 0, goal, 0, DEFAULT_GOAL_CURRENT_ARRAY.length); - int[] current = new int[DEFAULT_GOAL_CURRENT_ARRAY.length]; - System.arraycopy(DEFAULT_GOAL_CURRENT_ARRAY, 0, current, 0, DEFAULT_GOAL_CURRENT_ARRAY.length); - int lastr = -1; - int r = -1; - boolean mixed = false; - - while (!mixed) - { - testAbortScript(); - - for (int i = 0; i < DEFAULT_GOAL_CURRENT_ARRAY.length; i++) - { - testAbortScript(); - do - { - testAbortScript(); - r = rand(0, 5); - } - while(r == lastr); - lastr = r; - goal = toggleButton(goal, r); - - } - - for (int j = 0; j < DEFAULT_GOAL_CURRENT_ARRAY.length; j++) - { - testAbortScript(); - if (goal[j] != current[j]) - { - mixed = true; - } - } - } - - int calibrationTries = DEFAULT_TRIES; - int calibrationMaxTries = DEFAULT_TRIES; - - if (buff.hasBuff(player, WEAPON_PUZZLE_BUFF)) - { - calibrationTries += BUFF_TRIES_INCREASE; - calibrationMaxTries += BUFF_TRIES_INCREASE; - blog("HASBUFF: TRUE"); - } - blog("HASBUFF?"); - - blog("initializeCalibration - saving data"); - utils.setScriptVar(player, CALIBRATION_GOAL, goal); - utils.setScriptVar(player, CALIBRATION_CURRENT, current); - utils.setScriptVar(player, CALIBRATION_TRIES, calibrationTries); - utils.setScriptVar(player, CALIBRATION_MAX_TRIES, calibrationMaxTries); - return true; - } - - - public int[] toggleButton(int[] config, int button) throws InterruptedException - { - if (config == null || button < 0) - { - return null; - } - - blog("toggleButton - init - BUTTON: "+button); - - int secondary1 = -1; - int secondary2 = -1; - - switch(button) - { - case 0: secondary1 = 3; - secondary2 = 4; - break; - case 1: secondary1 = 4; - secondary2 = 5; - break; - case 2: secondary1 = 3; - secondary2 = 5; - break; - case 3: secondary1 = 0; - secondary2 = 2; - break; - case 4: secondary1 = 0; - secondary2 = 1; - break; - case 5: secondary1 = 1; - secondary2 = 2; - break; - } - - if (secondary1 == -1 || secondary2 == -1) - { - return null; - } - blog("secondary1: "+secondary1); - blog("secondary2: "+secondary2); - - for (int i = 0; i < config.length; i++) - { - testAbortScript(); - blog("config"+i+ " "+secondary2); - } - - if (config[button] == 0) - { - config[button] = 1; - } - else - { - config[button] = 0; - } - - if (config[secondary1] == 0) - { - config[secondary1] = 1; - } - else - { - config[secondary1] = 0; - } - - if (config[secondary2] == 0) - { - config[secondary2] = 1; - } - else - { - config[secondary2] = 0; - } - - blog("toggleButton - returning config"); - return config; - } - - - public int configProcessorPuzzleCallback(obj_id self, dictionary params) throws InterruptedException - { - blog("configProcessorPuzzleCallback - INIT"); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - String widgetName = params.getString("eventWidgetName"); - blog("configProcessorPuzzleCallback widgetName - "+widgetName); - - int pid = sui.getPid(player, PID_NAME); - if (pid <= 0) - { - return SCRIPT_CONTINUE; - } - - blog("configProcessorPuzzleCallback pid - "+pid); - - if (widgetName == null || widgetName.equals("")) - { - blog("configProcessorPuzzleCallback widgetName = null "); - if (buff.applyBuff(player, "weapons_cache_puzzle_downer")) - {; - } - { - sendSystemMessage(player, YOU_CANCELED_EARLY); - } - - removePlayerVars(player); - forceCloseSUIPage(pid); - return SCRIPT_CONTINUE; - } - - blog("configProcessorPuzzleCallback widget != null"); - - int index = -1; - - for (int i = 0; i < CONFIG_PLAYER_BUTTONS.length; i++) - { - testAbortScript(); - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "Color", "#FFFFFF"); - if (widgetName.equalsIgnoreCase(CONFIG_PLAYER_BUTTONS[i])) - { - index = i; - break; - } - } - - blog("configProcessorPuzzleCallback index: "+index); - if (index < 0 || index > 5) - { - return SCRIPT_CONTINUE; - } - - int[] current = utils.getIntArrayScriptVar(player, CALIBRATION_CURRENT); - int[] goal = utils.getIntArrayScriptVar(player, CALIBRATION_GOAL); - int tries = utils.getIntScriptVar(player, CALIBRATION_TRIES); - int max_tries = utils.getIntScriptVar(player, CALIBRATION_MAX_TRIES); - - if (current == null || goal == null) - { - blog("configProcessorPuzzleCallback current or goal == null"); - removePlayerVars(player); - return SCRIPT_CONTINUE; - } - blog("configProcessorPuzzleCallback - About to toggle buttons"); - current = toggleButton(current, index); - if (current == null) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < CONFIG_PLAYER_BUTTONS.length; i++) - { - testAbortScript(); - if (current[i] == 1) - { - blog("configProcessorPuzzleCallback setting to BLACK: "+CONFIG_PLAYER_BUTTONS[i]); - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "Color", "#000000"); - } - else - { - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "Color", "#FFFFFF"); - } - } - - tries--; - int integrity = (int)(((float)tries / (float)max_tries) * 100); - blog("configProcessorPuzzleCallback integrity: "+integrity); - boolean win = true; - for (int i = 0; i < current.length; i++) - { - testAbortScript(); - if (current[i] != goal[i]) - { - win = false; - } - } - - blog("configProcessorPuzzleCallback win: "+win); - - if (win) - { - blog("configProcessorPuzzleCallback THE WIN "); - setSUIProperty(pid, "top.description.desc", "Text", CALIBRATION_SUCCESS); - for (int i = 0; i < CONFIG_PLAYER_BUTTONS.length; i++) - { - testAbortScript(); - - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, CONFIG_PLAYER_BUTTONS[i], "noCallback"); - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "GetsInput", "false"); - } - - rewardPlayer(self, player); - } - else if (tries <= 0) - { - if (buff.applyBuff(player, "weapons_cache_puzzle_downer")) - {; - } - { - sendSystemMessage(player, YOU_FAILED); - } - - blog("configProcessorPuzzleCallback YOU LOSE "); - setSUIProperty(pid, "top.description.attempts", "Text", CALIBRATION_ATTEMPTS_REMAINING + " "+ integrity + "%"); - setSUIProperty(pid, "top.description.desc", "Text", CALIBRATION_FAILURE); - for (int i = 0; i < CONFIG_PLAYER_BUTTONS.length; i++) - { - testAbortScript(); - - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, CONFIG_PLAYER_BUTTONS[i], "noCallback"); - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "GetsInput", "false"); - } - closeOldWindow(player); - removePlayerVars(player); - } - else - { - blog("configProcessorPuzzleCallback DECREMENT "); - - setSUIProperty(pid, "top.description.attempts", "Text", CALIBRATION_ATTEMPTS_REMAINING + " "+ integrity + "%"); - } - - utils.setScriptVar(player, CALIBRATION_CURRENT, current); - utils.setScriptVar(player, CALIBRATION_TRIES, tries); - - flushSUIPage(pid); - - return SCRIPT_CONTINUE; - } - - - public boolean rewardPlayer(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("rewardPlayer - init"); - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - else if (!exists(collectionItem) || !exists(player)) - { - return false; - } - blog("rewardPlayer - validation complete"); - - if (!collection.rewardPlayerCollectionSlot(player, collectionItem)) - { - blog("rewardPlayer - rewardPlayerCollectionSlot = FAIL!!!"); - closeOldWindow(player); - removePlayerVars(player); - return false; - } - - blog("rewardPlayer - rewardPlayerCollectionSlot = SUCCESS"); - closeOldWindow(player); - removePlayerVars(player); - - return true; - } - - - public int closeSui(obj_id self, dictionary params) throws InterruptedException - { - blog("closeSui - init"); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - if (buff.applyBuff(player, "weapons_cache_puzzle_downer")) - {; - } - { - blog("closeSui applying weapon_cache_puzzle_downer"); - - sendSystemMessage(player, YOU_CANCELED_EARLY); - } - - blog("closeSui"); - closeOldWindow(player); - removePlayerVars(player); - return SCRIPT_CONTINUE; - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - blog("closeOldWindow - init"); - - int pid = sui.getPid(player, PID_NAME); - blog("closeOldWindow - pid: "+pid); - if (pid > -1) - { - blog("closeOldWindow - force closing: "+pid); - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } - - - public void removePlayerVars(obj_id player) throws InterruptedException - { - utils.removeScriptVarTree(player, VAR_PREFIX); - utils.removeObjVar(player, VAR_PREFIX); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG("minigame",msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_weapon_cachev2.java b/sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_weapon_cachev2.java deleted file mode 100644 index bf303540a..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/destroy_weapon_cachev2.java +++ /dev/null @@ -1,595 +0,0 @@ -package script.theme_park.meatlump; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.collection; -import script.library.sui; -import script.library.stealth; -import script.library.utils; - - -public class destroy_weapon_cachev2 extends script.base_script -{ - public destroy_weapon_cachev2() - { - } - public static final String VAR_PREFIX = "meatlump_weapon_cache"; - public static final String PID_NAME = VAR_PREFIX + ".pid"; - public static final String CURRENTLY_CALIBRATION = VAR_PREFIX + ".calibration"; - public static final String CALIBRATION_GOAL = VAR_PREFIX + ".goal"; - public static final String CALIBRATION_CURRENT = VAR_PREFIX + ".current"; - public static final String CALIBRATION_TRIES = VAR_PREFIX + ".tries"; - public static final String CALIBRATION_MAX_TRIES = VAR_PREFIX + ".max_tries"; - public static final String STATUS_VAR = VAR_PREFIX + ".status"; - public static final String COMPONENT_VAR = VAR_PREFIX + ".component"; - - public static final String CAPTION = "Calibrate Power Cell Abatement"; - public static final String OBJVAR_SLOT_NAME = "collection.slotName"; - - public static final string_id SID_OPEN = new string_id("meatlump/meatlump", "weapon_calibration_use"); - public static final String CALIBRATION_ATTEMPTS_REMAINING = "@meatlump/meatlump:weapon_calibration_attempts_remaining"; - public static final String CALIBRATION_SUCCESS = "@meatlump/meatlump:weapon_calibration_success"; - public static final String CALIBRATION_FAILURE = "@meatlump/meatlump:weapon_calibration_failure"; - public static final String CALIBRATION_DESCRIPTION = "@meatlump/meatlump:weapon_calibration_description"; - - public static final string_id SID_ALREADY_FINISHED_COLLECTION = new string_id("collection", "already_finished_collection"); - public static final string_id SID_NOT_CLOSE_ENOUGH = new string_id("collection", "not_close_enough"); - public static final string_id SID_ALREADY_HAVE_SLOT = new string_id("collection", "already_have_slot"); - public static final string_id SID_REPORT_CONSUME_ITEM_FAIL = new string_id("collection", "report_consume_item_fail"); - public static final string_id MSG_CALIBRATION_ABORTED = new string_id("quest/force_sensitive/fs_crafting", "phase1_msg_calibration_aborted"); - - public static final int MAX_RANGE_TO_COLLECT = 3; - public static final int DEFAULT_TRIES = 10; - - public static final String[] CONFIG_PLAYER_BUTTONS = - { - "top.triangles.player.right.1", - "top.triangles.player.right.2", - "top.triangles.player.right.3", - "top.triangles.player.left.2", - "top.triangles.player.left.3", - "top.triangles.player.left.1" - }; - - public static final String[] CONFIG_SERVER_BUTTONS = - { - "top.triangles.server.right.1", - "top.triangles.server.right.2", - "top.triangles.server.right.3", - "top.triangles.server.left.2", - "top.triangles.server.left.3", - "top.triangles.server.left.1" - }; - - public static final int[] DEFAULT_GOAL_CURRENT_ARRAY = - { - 0, - 0, - 0, - 0, - 0, - 0 - }; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - mi.addRootMenu(menu_info_types.ITEM_USE, SID_OPEN); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - obj_id collectionItem = self; - - if (!hasObjVar(collectionItem, OBJVAR_SLOT_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - String baseSlotName = getStringObjVar(collectionItem, OBJVAR_SLOT_NAME); - - String[] splitSlotNames = split(baseSlotName, ':'); - - String slotName = splitSlotNames[1]; - String collectionName = splitSlotNames[0]; - - if (!hasCompletedCollectionSlotPrereq(player, slotName)) - { - - sendSystemMessage(player, collection.SID_NEED_TO_ACTIVATE_COLLECTION); - return SCRIPT_CONTINUE; - } - - else if (hasCompletedCollection(player, collectionName)) - { - - sendSystemMessage(player, SID_ALREADY_FINISHED_COLLECTION); - return SCRIPT_CONTINUE; - } - - else if ((slotName == null || slotName.equals("")) || hasCompletedCollectionSlot(player, slotName)) - { - - sendSystemMessage(player, SID_ALREADY_HAVE_SLOT); - return SCRIPT_CONTINUE; - } - - closeOldWindow(player); - blog("OnObjectMenuSelect"); - createConfigUI(collectionItem, player); - - return SCRIPT_CONTINUE; - } - - - public boolean createConfigUI(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("createConfigUI - INIT"); - - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - else if (!exists(collectionItem) || !exists(player)) - { - return false; - } - - dictionary params = new dictionary(); - int pid = createSUIPage("/Script.calibration.game4", collectionItem, player); - sui.setPid(player, pid, PID_NAME); - setSUIAssociatedLocation(pid, collectionItem); - setSUIMaxRangeToObject(pid, 8); - params.put("callingPid", pid); - - blog("createConfigUI - sending to initializeCalibration"); - - if (!initializeCalibration(collectionItem, player)) - { - return false; - } - - setSUIProperty(pid, "bg.caption.lbltitle", "Text", CAPTION); - setSUIProperty(pid, "top.description.desc", "Text", CALIBRATION_DESCRIPTION); - setSUIProperty(pid, "top.description.attempts", "Text", CALIBRATION_ATTEMPTS_REMAINING + " 100%"); - - int[] goal = utils.getIntArrayScriptVar(player, CALIBRATION_GOAL); - if (goal == null) - { - return false; - } - - blog("createConfigUI - goal.length: "+goal.length); - for (int i = 0; i < goal.length; i++) - { - testAbortScript(); - if (goal[i] == 1) - { - setSUIProperty(pid, CONFIG_SERVER_BUTTONS[i], "Color", "#000000"); - } - - setSUIProperty(pid, CONFIG_SERVER_BUTTONS[i], "IsCancelButton", "false"); - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "IsCancelButton", "false"); - } - - setSUIProperty(pid, "bg.mmc.close", "IsCancelButton", "true"); - - for (int i = 0; i < CONFIG_PLAYER_BUTTONS.length; i++) - { - testAbortScript(); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, CONFIG_PLAYER_BUTTONS[i], "configProcessorPuzzleCallback"); - } - - setSUIAssociatedObject(pid, player); - setSUIMaxRangeToObject(pid, 10.0f); - showSUIPage(pid); - return true; - } - - - public boolean initializeCalibration(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("initializeCalibration - INIT"); - - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - blog("initializeCalibration - creating stuff"); - - int[] goal = DEFAULT_GOAL_CURRENT_ARRAY; - int[] current = DEFAULT_GOAL_CURRENT_ARRAY; - int lastr = -1; - int r = -1; - int tries = DEFAULT_TRIES; - - boolean mixed = false; - - while (!mixed) - { - testAbortScript(); - - for (int h = 0; h < 6; h++) - { - testAbortScript(); - goal[h] = 0; - } - - for (int i = 0; i < 6; i++) - { - testAbortScript(); - - do - { - testAbortScript(); - - r = rand(0, 5); - - } - while(r == lastr); - - lastr = r; - - goal = toggleButton(goal, r); - } - - for (int j = 0; j < 6; j++) - { - testAbortScript(); - - if (goal[j] != current[j]) - { - mixed = true; - } - } - } - - blog("initializeCalibration - saving data"); - utils.setScriptVar(player, CALIBRATION_GOAL, goal); - utils.setScriptVar(player, CALIBRATION_CURRENT, current); - utils.setScriptVar(player, CALIBRATION_TRIES, tries); - utils.setScriptVar(player, CALIBRATION_MAX_TRIES, tries); - return true; - } - - - public int[] toggleButton(int[] config, int button) throws InterruptedException - { - if (config == null || button < 0) - { - return null; - } - - blog("toggleButton - init"); - - int secondary1 = -1; - int secondary2 = -1; - - switch(button) - { - case 0: secondary1 = 3; - secondary2 = 4; - break; - case 1: secondary1 = 4; - secondary2 = 5; - break; - case 2: secondary1 = 3; - secondary2 = 5; - break; - case 3: secondary1 = 0; - secondary2 = 2; - break; - case 4: secondary1 = 0; - secondary2 = 1; - break; - case 5: secondary1 = 1; - secondary2 = 2; - break; - } - - if (secondary1 == -1 || secondary2 == -1) - { - return null; - } - - if (config[button] == 0) - { - config[button] = 1; - } - else - { - config[button] = 0; - } - - if (config[secondary1] == 0) - { - config[secondary1] = 1; - } - else - { - config[secondary1] = 0; - } - - if (config[secondary2] == 0) - { - config[secondary2] = 1; - } - else - { - config[secondary2] = 0; - } - - blog("toggleButton - returning config"); - return config; - } - - - public int configProcessorPuzzleCallback(obj_id self, dictionary params) throws InterruptedException - { - blog("configProcessorPuzzleCallback - INIT"); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - blog("configProcessorPuzzleCallback - NO PLAYER"); - return SCRIPT_CONTINUE; - } - String widgetName = params.getString("eventWidgetName"); - blog("configProcessorPuzzleCallback widgetName - "+widgetName); - - int pid = sui.getPid(player, PID_NAME); - if (pid <= 0) - { - blog("configProcessorPuzzleCallback pid FAILED "+pid); - return SCRIPT_CONTINUE; - } - - blog("configProcessorPuzzleCallback pid - "+pid); - - if (widgetName == null || widgetName.equals("")) - { - blog("configProcessorPuzzleCallback widgetName = null "); - - obj_id component = utils.getObjIdScriptVar(self, COMPONENT_VAR); - if (!hasObjVar(component, STATUS_VAR)) - { - setObjVar(component, STATUS_VAR, -1); - sendSystemMessage(self, MSG_CALIBRATION_ABORTED); - } - removePlayerVars(player); - forceCloseSUIPage(pid); - - return SCRIPT_CONTINUE; - } - - blog("configProcessorPuzzleCallback widget != null"); - - int index = -1; - - for (int i = 0; i < CONFIG_PLAYER_BUTTONS.length; i++) - { - testAbortScript(); - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "Color", "#FFFFFF"); - - if (widgetName.equalsIgnoreCase(CONFIG_PLAYER_BUTTONS[i])) - { - index = i; - } - } - - blog("configProcessorPuzzleCallback index: "+index); - if (index < 0 || index > 5) - { - return SCRIPT_CONTINUE; - } - - int[] current = utils.getIntArrayScriptVar(player, CALIBRATION_CURRENT); - int[] goal = utils.getIntArrayScriptVar(player, CALIBRATION_GOAL); - int tries = utils.getIntScriptVar(player, CALIBRATION_TRIES); - int max_tries = utils.getIntScriptVar(player, CALIBRATION_MAX_TRIES); - - if (current == null || goal == null) - { - blog("configProcessorPuzzleCallback current or goal == null"); - removePlayerVars(player); - return SCRIPT_CONTINUE; - } - blog("configProcessorPuzzleCallback - About to toggle buttons"); - current = toggleButton(current, index); - if (current == null) - { - blog("configProcessorPuzzleCallback current is NULL"); - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < CONFIG_PLAYER_BUTTONS.length; i++) - { - testAbortScript(); - if (current[i] == 1) - { - blog("configProcessorPuzzleCallback setting to black: "+CONFIG_PLAYER_BUTTONS[i]); - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "Color", "#000000"); - } - } - - tries--; - int integrity = (int)(((float)tries / (float)max_tries) * 100); - blog("configProcessorPuzzleCallback integrity: "+integrity); - boolean win = true; - for (int i = 0; i < current.length; i++) - { - testAbortScript(); - if (current[i] != goal[i]) - { - win = false; - } - } - - blog("configProcessorPuzzleCallback win: "+win); - if (win) - { - blog("configProcessorPuzzleCallback THE WIN "); - - obj_id component = utils.getObjIdScriptVar(player, COMPONENT_VAR); - setObjVar(component, STATUS_VAR, 1); - setSUIProperty(pid, "top.description.desc", "Text", CALIBRATION_SUCCESS); - for (int i = 0; i < CONFIG_PLAYER_BUTTONS.length; i++) - { - testAbortScript(); - - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, CONFIG_PLAYER_BUTTONS[i], "noCallback"); - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "GetsInput", "false"); - } - rewardPlayer(self, player); - } - else if (tries <= 0) - { - blog("configProcessorPuzzleCallback YOU LOSE "); - obj_id component = utils.getObjIdScriptVar(player, COMPONENT_VAR); - setObjVar(component, STATUS_VAR, -1); - setSUIProperty(pid, "top.description.attempts", "Text", CALIBRATION_ATTEMPTS_REMAINING + " "+ integrity + "%"); - setSUIProperty(pid, "top.description.desc", "Text", CALIBRATION_FAILURE); - for (int i = 0; i < CONFIG_PLAYER_BUTTONS.length; i++) - { - testAbortScript(); - - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, CONFIG_PLAYER_BUTTONS[i], "noCallback"); - setSUIProperty(pid, CONFIG_PLAYER_BUTTONS[i], "GetsInput", "false"); - } - removePlayerVars(player); - } - else - { - blog("configProcessorPuzzleCallback DECREMENT "); - - setSUIProperty(pid, "top.description.attempts", "Text", CALIBRATION_ATTEMPTS_REMAINING + " "+ integrity + "%"); - } - utils.setScriptVar(player, CALIBRATION_CURRENT, current); - utils.setScriptVar(player, CALIBRATION_TRIES, tries); - flushSUIPage(pid); - - return SCRIPT_CONTINUE; - } - - - public boolean rewardPlayer(obj_id collectionItem, obj_id player) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - String baseSlotName = getStringObjVar(collectionItem, OBJVAR_SLOT_NAME); - - String[] splitSlotNames = split(baseSlotName, ':'); - - String slotName = splitSlotNames[1]; - String collectionName = splitSlotNames[0]; - - if (!hasCompletedCollectionSlotPrereq(player, slotName)) - { - - sendSystemMessage(player, collection.SID_NEED_TO_ACTIVATE_COLLECTION); - return false; - } - - else if (hasCompletedCollection(player, collectionName)) - { - - sendSystemMessage(player, SID_ALREADY_FINISHED_COLLECTION); - return false; - } - - else if ((slotName == null || slotName.equals("")) || hasCompletedCollectionSlot(player, slotName)) - { - - sendSystemMessage(player, SID_ALREADY_HAVE_SLOT); - return false; - } - - boolean currentState = collection.checkState(player); - if (!currentState) - { - return false; - } - - boolean isCloseEnough = collection.checkDistance(collectionItem, player, MAX_RANGE_TO_COLLECT); - if (!isCloseEnough) - { - blog("Not Close ENOUGH"); - sendSystemMessage(player, SID_NOT_CLOSE_ENOUGH); - return false; - } - - blog("Player collecting "+ slotName); - stealth.testInvisNonCombatAction(player, collectionItem); - collection.giveAreaMobsHate(collectionItem, player); - - closeOldWindow(player); - removePlayerVars(player); - - if (modifyCollectionSlotValue(player, slotName, 1)) - { - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was consumed into a collection, for player "+ getFirstName(player) + "("+ player + ")."); - - return false; - } - else - { - - CustomerServiceLog("CollectionConsume: ", "collectionItem ("+ collectionItem + ")"+ " was NOT consumed into a collection, for player "+ getFirstName(player) + "("+ player + ")."); - - sendSystemMessage(player, SID_REPORT_CONSUME_ITEM_FAIL); - } - - return false; - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - blog("closeOldWindow - init"); - - int pid = sui.getPid(player, PID_NAME); - blog("closeOldWindow - pid: "+pid); - if (pid > -1) - { - blog("closeOldWindow - force closing: "+pid); - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } - - - public void removePlayerVars(obj_id player) throws InterruptedException - { - utils.removeScriptVarTree(player, VAR_PREFIX); - utils.removeObjVar(player, VAR_PREFIX); - } - - - public boolean blog(String msg) throws InterruptedException - { - LOG("minigame",msg); - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/disarm_bomb_puzzle.java b/sku.0/sys.server/compiled/game/script/theme_park/meatlump/disarm_bomb_puzzle.java deleted file mode 100644 index 74daf4cb1..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/disarm_bomb_puzzle.java +++ /dev/null @@ -1,792 +0,0 @@ -package script.theme_park.meatlump; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.consumable; -import script.library.sui; -import script.library.stealth; -import script.library.utils; -import java.lang.System; -import java.util.Random; - - -public class disarm_bomb_puzzle extends script.base_script -{ - public disarm_bomb_puzzle() - { - } - public static final boolean LOGGING_ON = false; - - public static final String VAR_PREFIX = "meatlump_target_map"; - public static final String PID_NAME = VAR_PREFIX + ".pid"; - public static final String CURRENTLY_DEFUSING = VAR_PREFIX + ".defusing"; - public static final String BOMB_TIMER = VAR_PREFIX + ".bomb_timer"; - public static final String TIMER_RUNNING = VAR_PREFIX + ".timer_running"; - public static final String RED_WIRE = VAR_PREFIX + ".red_wire"; - public static final String BLACK_WIRE = VAR_PREFIX + ".black_wire"; - public static final String GREEN_WIRE = VAR_PREFIX + ".green_wire"; - public static final String YELLOW_WIRE = VAR_PREFIX + ".yellow_wire"; - public static final String BROWN_WIRE = VAR_PREFIX + ".brown_wire"; - public static final String WHITE_WIRE = VAR_PREFIX + ".white_wire"; - public static final String YELLOW_BROWN_WIRE = VAR_PREFIX + ".yellow_brown_wire"; - public static final String RED_BLACK_WIRE = VAR_PREFIX + ".red_black_wire"; - public static final String YELLOW_GREEN_WIRE = VAR_PREFIX + ".yellow_green_wire"; - public static final String BLACK_WHITE_WIRE = VAR_PREFIX + ".black_white_wire"; - public static final String WIRE_ARRAY = VAR_PREFIX + ".wire_array"; - public static final String COLOR_ARRAY = VAR_PREFIX + ".color_array"; - public static final String CUT_ARRAY = VAR_PREFIX + ".cut_array"; - public static final String BUTTON_NUMBER = VAR_PREFIX + ".button_number"; - public static final String BEING_DEFUSED = VAR_PREFIX + ".being_defused"; - public static final String TIME_DEFUSED = VAR_PREFIX + ".time_defused"; - public static final String PLAYER_MAX_TIMER = VAR_PREFIX + ".player_max_timer"; - public static final String PLAYER_BUFF = VAR_PREFIX + ".player_buff"; - - public static final String CAPTION = "Disarm Bomb"; - public static final String DEVICE_TEMPLATE = "object/tangible/meatlump/event/slicing_device_meatlump_bomb.iff"; - public static final String DEVICE_OBJVAR = "puzzle"; - public static final String BOMB_PUZZLE_BUFF = "bomb_defuse_puzzle_buff"; - - public static final string_id SID_OPEN = new string_id("meatlump/meatlump", "meatlump_defuse_bomb"); - public static final string_id BOMB_INTRO_TEXT = new string_id("meatlump/meatlump", "bomb_intro_text"); - public static final string_id TOOK_TOO_LONG = new string_id("meatlump/meatlump", "took_too_long"); - public static final string_id CURRENTLY_BEING_DEFUSED = new string_id("meatlump/meatlump", "currently_being_defused"); - public static final string_id YOU_FAILED = new string_id("meatlump/meatlump", "you_failed"); - public static final string_id YOU_CANCELED_EARLY = new string_id("meatlump/meatlump", "you_canceled_early"); - public static final string_id YOU_HAVE_DEBUFF = new string_id("meatlump/meatlump", "you_have_debuff"); - public static final string_id YOU_NEED_DEVICE = new string_id("meatlump/meatlump", "you_need_device"); - - public static final int MAX_RANGE_TO_COLLECT = 3; - public static final int DEFAULT_BOMB_TIMER = 65; - public static final int BUFF_TIMER_INCREASE = 10; - public static final int BUTTON_PENALTY = 5; - public static final int INITIAL_BUTTON_NUMBER = 0; - public static final int DEFUSE_TIME_OUT_SECONDS = 120; - public static final String[] WIRE_LIST = - { - "Power Source \\#FF3300+\\#FFFFFF ", - "Power Source \\#222222-\\#FFFFFF ", - "Explosive \\#FF3300+\\#FFFFFF ", - "Explosive \\#222222-\\#FFFFFF ", - "Detonator \\#FF3300+\\#FFFFFF ", - "Detonator \\#222222-\\#FFFFFF ", - "Initiation System \\#FF3300+\\#FFFFFF ", - "Initiation System \\#222222-\\#FFFFFF ", - "Tamper System \\#FF3300+\\#FFFFFF ", - "Tamper System \\#222222-\\#FFFFFF " - }; - - public static final String[] COLOR_LIST = - { - "\\#FF3300Red\\#FFFFFF", - "\\#222222Black\\#FFFFFF", - "\\#996600Brown\\#FFFFFF", - "\\#FFFF00Yellow\\#FFFFFF", - "White", - "\\#99FF33Green\\#FFFFFF", - "\\#FF3300Red \\#222222Black\\#FFFFFF", - "\\#FFFF00Yellow \\#99FF33Green\\#FFFFFF", - "\\#FFFF00Yellow \\#996600Brown\\#FFFFFF", - "\\#222222Black \\#FFFFFFWhite" - }; - - public static final String[] CUT_LIST = - { - "cut_red", - "cut_black", - "cut_brown", - "cut_yellow", - "cut_white", - "cut_green", - "cut_red_black", - "cut_yellow_green", - "cut_yellow_brown", - "cut_black_white" - }; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - mi.addRootMenu(menu_info_types.ITEM_USE, SID_OPEN); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - obj_id collectionItem = self; - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, BEING_DEFUSED)) - { - sendSystemMessage(player, CURRENTLY_BEING_DEFUSED); - return SCRIPT_CONTINUE; - } - else if (!collection.canCollectCollectible(player, self)) - { - return SCRIPT_CONTINUE; - } - else if (buff.hasBuff(player, "bomb_defuse_puzzle_downer")) - { - sendSystemMessage(player, YOU_HAVE_DEBUFF); - return SCRIPT_CONTINUE; - } - else if (!consumable.decrementObjectInventoryOrEquipped(player, DEVICE_TEMPLATE, DEVICE_OBJVAR)) - { - sendSystemMessage(player, YOU_NEED_DEVICE); - return SCRIPT_CONTINUE; - } - - closeOldWindow(player); - blog("OnObjectMenuSelect"); - createBombUI(collectionItem, player); - - return SCRIPT_CONTINUE; - } - - - public boolean createBombUI(obj_id collectionItem, obj_id player) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - blog("createBombUI - init"); - if (!utils.hasScriptVar(player, CURRENTLY_DEFUSING)) - { - blog("createBombUI - CURRENTLY_DEFUSING = false"); - boolean varsSet = initializePlayer(collectionItem, player); - if (!varsSet) - { - return false; - } - - utils.setScriptVar(player, CURRENTLY_DEFUSING, true); - } - else - { - closeOldWindow(player); - } - - blog("createBombUI - Getting Bomb Data"); - String questionnaireText = getBombData(collectionItem, player); - if (questionnaireText == null || questionnaireText.equals("")) - { - return false; - } - - blog("createBombUI - CREATING SUI"); - - dictionary params = new dictionary(); - int pid = createSUIPage("/Script.disarmBomb", collectionItem, player); - setSUIAssociatedLocation(pid, collectionItem); - setSUIMaxRangeToObject(pid, 8); - params.put("callingPid", pid); - sui.setPid(player, pid, PID_NAME); - - setSUIProperty(pid, "details.lblPrompt", "LocalText", questionnaireText); - setSUIProperty(pid, "bg.caption.lblTitle", "Text", CAPTION); - setSUIProperty(pid, "details.lblPrompt", "Editable", "false"); - setSUIProperty(pid, "details.lblPrompt", "GetsInput", "false"); - - setSUIProperty(pid, "btnCancel", "Visible", "true"); - - setSUIProperty(pid, "cut_red", "Visible", utils.getStringScriptVar(player, RED_WIRE)); - setSUIProperty(pid, "cut_green", "Visible", utils.getStringScriptVar(player, GREEN_WIRE)); - setSUIProperty(pid, "cut_yellow", "Visible", utils.getStringScriptVar(player, YELLOW_WIRE)); - setSUIProperty(pid, "cut_brown", "Visible", utils.getStringScriptVar(player, BROWN_WIRE)); - setSUIProperty(pid, "cut_white", "Visible", utils.getStringScriptVar(player, WHITE_WIRE)); - setSUIProperty(pid, "cut_yellow_brown", "Visible", utils.getStringScriptVar(player, YELLOW_BROWN_WIRE)); - setSUIProperty(pid, "cut_red_black", "Visible", utils.getStringScriptVar(player, RED_BLACK_WIRE)); - setSUIProperty(pid, "cut_yellow_green", "Visible", utils.getStringScriptVar(player, YELLOW_GREEN_WIRE)); - setSUIProperty(pid, "cut_black_white", "Visible", utils.getStringScriptVar(player, BLACK_WHITE_WIRE)); - setSUIProperty(pid, "cut_black", "Visible", utils.getStringScriptVar(player, BLACK_WIRE)); - - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "cut_red", "handleDialogInput"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "cut_red", "cut_red", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "cut_black", "handleDialogInput"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "cut_black", "cut_black", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "cut_green", "handleDialogInput"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "cut_green", "cut_green", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "cut_yellow", "handleDialogInput"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "cut_yellow", "cut_yellow", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "cut_brown", "handleDialogInput"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "cut_brown", "cut_brown", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "cut_yellow_brown", "handleDialogInput"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "cut_yellow_brown", "cut_yellow_brown", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "cut_red_black", "handleDialogInput"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "cut_red_black", "cut_red_black", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "cut_yellow_green", "handleDialogInput"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "cut_yellow_green", "cut_yellow_green", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "cut_white", "handleDialogInput"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "cut_white", "cut_white", "LocalText"); - subscribeToSUIEvent(pid, sui_event_type.SET_onButton, "cut_black_white", "handleDialogInput"); - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onButton, "cut_black_white", "cut_black_white", "LocalText"); - - subscribeToSUIEvent(pid, sui_event_type.SET_onClosedCancel, "%button0%", "closeSui"); - - showSUIPage(pid); - flushSUIPage(pid); - blog("createBombUI - FINISHED CREATING SUI"); - - utils.setScriptVar(collectionItem, BEING_DEFUSED, player); - utils.setScriptVar(player, TIME_DEFUSED, getGameTime()); - - messageTo(collectionItem, "removeDefuseVar", params, DEFUSE_TIME_OUT_SECONDS, false); - - return true; - } - - - public boolean initializePlayer(obj_id collectionItem, obj_id player) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - boolean hasBuff = false; - if (buff.hasBuff(player, BOMB_PUZZLE_BUFF)) - { - hasBuff = true; - } - - blog("HASBUFF: "+hasBuff); - - blog("initializePlayer - init"); - - utils.setScriptVar(player, RED_WIRE, "true"); - utils.setScriptVar(player, GREEN_WIRE, "true"); - utils.setScriptVar(player, YELLOW_WIRE, "true"); - utils.setScriptVar(player, BROWN_WIRE, "true"); - utils.setScriptVar(player, WHITE_WIRE, "true"); - utils.setScriptVar(player, YELLOW_BROWN_WIRE, "true"); - utils.setScriptVar(player, RED_BLACK_WIRE, "true"); - utils.setScriptVar(player, YELLOW_GREEN_WIRE, "true"); - utils.setScriptVar(player, BLACK_WHITE_WIRE, "true"); - utils.setScriptVar(player, BLACK_WIRE, "true"); - - Random rWire = new Random(); - String[] wireArray = new String[WIRE_LIST.length]; - System.arraycopy(WIRE_LIST, 0, wireArray, 0, WIRE_LIST.length); - - Random rColor = new Random(); - String[] colorArray = new String[COLOR_LIST.length]; - System.arraycopy(COLOR_LIST, 0, colorArray, 0, COLOR_LIST.length); - String[] cutArray = new String[CUT_LIST.length]; - System.arraycopy(CUT_LIST, 0, cutArray, 0, CUT_LIST.length); - - for (int i=0; i= cuts.length - 1) - { - blog("createBombUI - PLAYER WINS"); - - rewardPlayer(self, player); - return SCRIPT_CONTINUE; - } - blog("createBombUI - DECREMENTING TIMER"); - - int timer = utils.getIntScriptVar(player, BOMB_TIMER); - timer = timer - BUTTON_PENALTY; - utils.setScriptVar(player, BOMB_TIMER, timer); - - if (!utils.hasScriptVar(player, TIMER_RUNNING)) - { - blog("createBombUI - Starting the TIMER"); - utils.setScriptVar(player, TIMER_RUNNING, true); - messageTo(self, "refreshSuiBombTimerData", params, 1, false); - } - utils.setScriptVar(player, BUTTON_NUMBER, button + 1); - blog("createBombUI - Re-calling createBombUI"); - createBombUI(self, player); - blog("createBombUI - DONE Re-calling createBombUI"); - return SCRIPT_CONTINUE; - } - - - public boolean rewardPlayer(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("rewardPlayer - init"); - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - else if (!exists(collectionItem) || !exists(player)) - { - return false; - } - - utils.removeScriptVar(collectionItem, BEING_DEFUSED); - - blog("rewardPlayer - validation complete"); - - if (!collection.rewardPlayerCollectionSlot(player, collectionItem)) - { - blog("rewardPlayer - rewardPlayerCollectionSlot = FAIL!!!"); - closeOldWindow(player); - removePlayerVars(player); - return false; - } - - blog("rewardPlayer - rewardPlayerCollectionSlot = SUCCESS"); - closeOldWindow(player); - removePlayerVars(player); - - return true; - } - - - public int refreshSuiBombTimerData(obj_id self, dictionary params) throws InterruptedException - { - blog("refreshSuiBombTimerData - init"); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - blog("refreshSuiBombTimerData - player id: "+player); - - if (!sui.hasPid(player, PID_NAME)) - { - blog("refreshSuiBombTimerData - no PID"); - return SCRIPT_CONTINUE; - } - blog("refreshSuiBombTimerData - player has a pid scriptvar"); - int currentPid = sui.getPid(player, PID_NAME); - blog("refreshSuiBombTimerData - currentPid: "+ currentPid); - - String bombData = getBombData(self, player); - - if (bombData == null || bombData.equals("")) - { - return SCRIPT_CONTINUE; - } - - setSUIProperty(currentPid, "details.lblPrompt", "LocalText", bombData); - flushSUIPage(currentPid); - messageTo(self, "refreshSuiBombTimerData", params, 1, false); - return SCRIPT_CONTINUE; - } - - - public int removeDefuseVar(obj_id self, dictionary params) throws InterruptedException - { - blog("removeDefuseVar - init"); - if (utils.hasScriptVar(self, BEING_DEFUSED)) - { - obj_id player = utils.getObjIdScriptVar(self, BEING_DEFUSED); - if (utils.hasScriptVar(player, TIME_DEFUSED)) - { - int playerTime = utils.getIntScriptVar(player, TIME_DEFUSED); - int currentTime = getGameTime(); - blog("removeDefuseVar - playerTime: "+playerTime+" currentTime: "+currentTime+" playerTime - currentTime = "+(currentTime - playerTime)); - if ((currentTime - playerTime) < DEFUSE_TIME_OUT_SECONDS) - { - return SCRIPT_CONTINUE; - } - } - blog("removeDefuseVar - valid player"); - - if (utils.hasScriptVar(player, BOMB_TIMER) && utils.hasScriptVar(player, PLAYER_MAX_TIMER)) - { - int timer = utils.getIntScriptVar(player, BOMB_TIMER); - int maxtimer = utils.getIntScriptVar(player, PLAYER_MAX_TIMER); - - if (timer < maxtimer) - { - blog("removeDefuseVar - has bomb timer"); - return SCRIPT_CONTINUE; - } - } - blog("closeSui player validated"); - blog("removeDefuseVar - has bomb timer"); - - closeOldWindow(player); - removePlayerVars(player); - sendSystemMessage(player, TOOK_TOO_LONG); - } - - blog("removeDefuseVar - removing scriptvar"); - - utils.removeScriptVar(self, BEING_DEFUSED); - return SCRIPT_CONTINUE; - } - - - public int closeSui(obj_id self, dictionary params) throws InterruptedException - { - blog("closeSui - init"); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - int maxTimer = utils.getIntScriptVar(player, PLAYER_MAX_TIMER); - if (maxTimer < 0) - { - return SCRIPT_CONTINUE; - } - else if (utils.hasScriptVar(player, BOMB_TIMER)) - { - int currentTimer = utils.getIntScriptVar(player, BOMB_TIMER); - if (currentTimer < 0) - { - return SCRIPT_CONTINUE; - } - else if (currentTimer < maxTimer) - { - blowUpBomb(self, player); - return SCRIPT_CONTINUE; - } - } - - if (utils.hasScriptVar(self, BEING_DEFUSED)) - { - utils.removeScriptVar(self, BEING_DEFUSED); - } - - if (buff.applyBuff(player, "bomb_defuse_puzzle_downer")) - {; - } - { - sendSystemMessage(player, YOU_CANCELED_EARLY); - } - - blog("closeSui player validated"); - closeOldWindow(player); - removePlayerVars(player); - return SCRIPT_CONTINUE; - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - blog("closeOldWindow - init"); - - int pid = sui.getPid(player, PID_NAME); - blog("closeOldWindow - pid: "+pid); - if (pid > -1) - { - blog("closeOldWindow - force closing: "+pid); - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } - - - public void removePlayerVars(obj_id player) throws InterruptedException - { - utils.removeScriptVarTree(player, VAR_PREFIX); - utils.removeObjVar(player, VAR_PREFIX); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG("minigame",msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/grant_map_quest_object.java b/sku.0/sys.server/compiled/game/script/theme_park/meatlump/grant_map_quest_object.java deleted file mode 100644 index eeb0f1873..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/grant_map_quest_object.java +++ /dev/null @@ -1,136 +0,0 @@ -package script.theme_park.meatlump; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.city; -import script.library.collection; -import script.library.locations; -import script.library.groundquests; -import script.library.sui; -import script.library.utils; - - -public class grant_map_quest_object extends script.base_script -{ - public grant_map_quest_object() - { - } - public static final string_id RADIAL_INSPECT = new string_id ("quest/ground/util/quest_giver_object", "radial_inspect"); - public static final string_id OFFER_QUEST_MSG = new string_id ("quest/ground/util/quest_giver_object", "offer_quest"); - public static final string_id SUI_TITLE = new string_id ("quest/ground/util/quest_giver_object", "sui_title"); - public static final string_id BUTTON_DECLINE = new string_id ("quest/ground/util/quest_giver_object", "button_decline"); - public static final string_id BUTTON_ACCEPT = new string_id ("quest/ground/util/quest_giver_object", "button_accept"); - public static final string_id DECLINED_QUEST = new string_id ("quest/ground/util/quest_giver_object", "declined_quest"); - public static final string_id MUST_DISMOUNT = new string_id ("quest/ground/util/quest_giver_object", "must_dismount"); - public static final string_id PLAYER_IN_CELL = new string_id ("quest/ground/util/quest_giver_object", "player_in_cell"); - public static final string_id NOT_WHILE_INCAPPED = new string_id ("quest/ground/util/quest_giver_object", "not_while_incapped"); - public static final string_id SID_ELIGIBLE_FOR_GIFT_TITLE = new string_id ("quest/ground/util/quest_giver_object", "eligible_for_gift_title"); - public static final string_id SID_ELIGIBLE_FOR_GIFT_PROMPT = new string_id ("quest/ground/util/quest_giver_object", "eligible_for_gift_prompt"); - public static final string_id YOU_ALREADY_HAVE_QUEST = new string_id ("quest/ground/util/quest_giver_object", "you_already_have_quest"); - public static final string_id SID_NOT_WHILE_IN_COMBAT = new string_id("base_player", "not_while_in_combat"); - - public static final String PID_NAME = "map_quest_pid"; - public static final String QUEST_NAME = "chapter7_publish_gift_activation"; - - public static final String OBJECT_OBJVAR = "quest_string"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - int menuOption = mi.addRootMenu (menu_info_types.ITEM_USE, RADIAL_INSPECT); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - else if (!hasObjVar(self, OBJECT_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.ITEM_USE) - { - if (getState(player, STATE_COMBAT) > 0) - { - sendSystemMessage(player, SID_NOT_WHILE_IN_COMBAT); - return SCRIPT_CONTINUE; - } - else if (getState(player, STATE_RIDING_MOUNT) == 1) - { - sendSystemMessage(player, MUST_DISMOUNT); - return SCRIPT_CONTINUE; - } - else if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, NOT_WHILE_INCAPPED); - return SCRIPT_CONTINUE; - } - - String questString = getStringObjVar(self, OBJECT_OBJVAR); - if (questString == null || questString.equals("")) - { - return SCRIPT_CONTINUE; - } - - if (groundquests.isQuestActiveOrComplete(player, questString)) - { - - sendSystemMessage(player, YOU_ALREADY_HAVE_QUEST); - return SCRIPT_CONTINUE; - } - - int pid = sui.msgbox(self, player, "@"+ OFFER_QUEST_MSG, sui.YES_NO, "@"+ SUI_TITLE, "handlerGetQuest"); - sui.setPid(player, pid, PID_NAME); - } - return SCRIPT_CONTINUE; - } - - - public int handlerGetQuest(obj_id self, dictionary params) throws InterruptedException - { - int btn = sui.getIntButtonPressed(params); - - obj_id player = sui.getPlayerId(params); - if (btn == sui.BP_CANCEL) - { - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - if (!sui.hasPid(player, PID_NAME)) - { - return SCRIPT_CONTINUE; - } - if (btn == sui.BP_OK) - { - - String questString = getStringObjVar(self, OBJECT_OBJVAR); - if (questString == null || questString.equals("")) - { - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, questString) || groundquests.isQuestActive(player, questString)) - { - - sendSystemMessage(player, YOU_ALREADY_HAVE_QUEST); - return SCRIPT_CONTINUE; - } - - groundquests.grantQuest(player, questString); - sui.removePid(player, PID_NAME); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/meatlump_guard_trigger_volume.java b/sku.0/sys.server/compiled/game/script/theme_park/meatlump/meatlump_guard_trigger_volume.java deleted file mode 100644 index 3a87882d5..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/meatlump_guard_trigger_volume.java +++ /dev/null @@ -1,192 +0,0 @@ -package script.theme_park.meatlump; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.attrib; -import script.library.create; -import script.library.group; -import script.library.stealth; -import script.library.utils; - - -public class meatlump_guard_trigger_volume extends script.base_script -{ - public meatlump_guard_trigger_volume() - { - } - public static final boolean LOGGING_ON = false; - - public static final String MEATLUMP_TRIGGER_NAME_PREFIX = "meatlump_guardian_trigger_"; - public static final String MEATLUMP_TRIGGER = "meatlump_trigger"; - public static final String MEATLUMP_MOB = "meatlump_outpost_guard_spawned"; - public static final String MEATLUMP_ENEMY_SCRIPT = "creature.dynamic_enemy"; - public static final String PHRASE_STRING_FILE = "phrase_string_file"; - public static final String SPAM_STRING_FILE = "spam"; - public static final String MEATLUMP_LOG = "meatlump_trigger"; - public static final float MEATLUMP_TRIGGER_RADIUS = 8f; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - createTriggerVolume(MEATLUMP_TRIGGER_NAME_PREFIX + self, MEATLUMP_TRIGGER_RADIUS, true); - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - if (!isPlayer(whoTriggeredMe)) - { - return SCRIPT_CONTINUE; - } - - blog("Entered trigger volume: "+whoTriggeredMe); - - if (utils.hasScriptVar(whoTriggeredMe, MEATLUMP_TRIGGER) && utils.getStringScriptVar(whoTriggeredMe, MEATLUMP_TRIGGER).equals(MEATLUMP_TRIGGER_NAME_PREFIX+self)) - { - blog("Already triggered volume: "+whoTriggeredMe); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(whoTriggeredMe, MEATLUMP_TRIGGER, MEATLUMP_TRIGGER_NAME_PREFIX+self); - - String invis = stealth.getInvisBuff(whoTriggeredMe); - if (invis != null) - { - stealth.checkForAndMakeVisibleNoRecourse(self); - } - - int mobLevel = getLevel(whoTriggeredMe); - - location curLoc = getLocation(self); - - obj_id mob = create.object(MEATLUMP_MOB, curLoc, mobLevel); - - setObjVar(mob, "player", whoTriggeredMe); - - addHate(mob, whoTriggeredMe, 1); - - setObjVar(mob, PHRASE_STRING_FILE, SPAM_STRING_FILE); - - getRandomPhrases(mob); - - attachScript(mob, MEATLUMP_ENEMY_SCRIPT); - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - blog("Exited trigger volume: "+whoTriggeredMe); - return SCRIPT_CONTINUE; - } - - - public boolean getRandomPhrases(obj_id mob) throws InterruptedException - { - if (!isValidId(mob) || !exists(mob)) - { - return false; - } - - int attackPhraseInt = rand(1,10); - int defeatPhraseInt = rand(1,10); - - String attackPhrase = "enemy_attack_you_thief"; - String defeatPhrase = "enemy_defeat_tell_everyone"; - - switch(attackPhraseInt) - { - case 1: - attackPhrase = "enemy_attack_rest"; - break; - case 2: - attackPhrase = "enemy_attack_oh_look"; - break; - case 3: - attackPhrase = "enemy_attack_surprise"; - break; - case 4: - attackPhrase = "enemy_attack_now_got"; - break; - case 5: - attackPhrase = "enemy_attack_what_did"; - break; - case 6: - attackPhrase = "enemy_attack_sneaky"; - break; - case 7: - attackPhrase = "enemy_attack_youre_not"; - break; - case 8: - attackPhrase = "enemy_attack_lotta_nerve"; - break; - case 9: - attackPhrase = "enemy_attack_stop"; - break; - case 10: - attackPhrase = "enemy_attack_you_thief"; - break; - default : - break; - } - - switch(defeatPhraseInt) - { - case 1: - defeatPhrase = "enemy_defeat_oops"; - break; - case 2: - defeatPhrase = "enemy_defeat_challenging"; - break; - case 3: - defeatPhrase = "enemy_defeat_boo_hoo"; - break; - case 4: - defeatPhrase = "enemy_defeat_take_that"; - break; - case 5: - defeatPhrase = "enemy_defeat_entertainer"; - break; - case 6: - defeatPhrase = "enemy_defeat_trader"; - break; - case 7: - defeatPhrase = "enemy_defeat_sweat"; - break; - case 8: - defeatPhrase = "enemy_defeat_training"; - break; - case 9: - defeatPhrase = "enemy_defeat_lunch"; - break; - case 10: - defeatPhrase = "enemy_defeat_tell_everyone"; - break; - default : - break; - } - - setObjVar(mob, "attack_phrase", attackPhrase); - setObjVar(mob, "defeat_phrase", defeatPhrase); - return true; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(MEATLUMP_LOG,msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/meatlump_spy_trigger_volume.java b/sku.0/sys.server/compiled/game/script/theme_park/meatlump/meatlump_spy_trigger_volume.java deleted file mode 100644 index b697c4247..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/meatlump_spy_trigger_volume.java +++ /dev/null @@ -1,131 +0,0 @@ -package script.theme_park.meatlump; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.create; -import script.library.groundquests; -import script.library.stealth; -import script.library.utils; - - -public class meatlump_spy_trigger_volume extends script.base_script -{ - public meatlump_spy_trigger_volume() - { - } - public static final boolean LOGGING_ON = false; - - public static final String TRIGGER_NAME_PREFIX = "meatlump_spy_trigger_"; - public static final String TRIGGER = "meatlump_spy_trigger"; - public static final String ENEMY_MOB = "mtp_hideout_infiltrator"; - public static final String MEATLUMP_ENEMY_SCRIPT = "creature.dynamic_enemy"; - public static final String PHRASE_STRING_FILE = "phrase_string_file"; - public static final String SPAM_STRING_FILE = "spam"; - public static final String MEATLUMP_LOG = "meatlump_trigger"; - public static final String CLIENT_EFFECT = "appearance/pt_smoke_puff.prt"; - public static final String QUEST_STRING = "quest/mtp_find_infiltrator_"; - public static final String QUEST_TASK_NAME = "findInfiltrator"; - public static final String QUEST_SIGNAL = "findTheInfiltrator"; - public static final float TRIGGER_RADIUS = 2f; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - createTriggerVolume(TRIGGER_NAME_PREFIX + self, TRIGGER_RADIUS, true); - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - blog("OnTriggerVolumeEntered INIT: "+whoTriggeredMe); - - if (!isPlayer(whoTriggeredMe)) - { - return SCRIPT_CONTINUE; - } - - blog("Spawner: "+getIntObjVar(self, "spawner")); - - if (!hasObjVar(self, "spawner")) - { - return SCRIPT_CONTINUE; - } - - int spawner = getIntObjVar(self, "spawner"); - if (!groundquests.isQuestActive(whoTriggeredMe, QUEST_STRING+spawner)) - { - return SCRIPT_CONTINUE; - } - - blog("Ground Quest Found!"); - - if (!groundquests.isTaskActive(whoTriggeredMe, QUEST_STRING+spawner, QUEST_TASK_NAME)) - { - return SCRIPT_CONTINUE; - } - blog("Ground Task Found!"); - - String invis = stealth.getInvisBuff(whoTriggeredMe); - if (invis != null) - { - stealth.checkForAndMakeVisibleNoRecourse(self); - } - - blog("Sending Signal!"); - - groundquests.sendSignal(whoTriggeredMe, QUEST_SIGNAL); - - blog("Signal Sent!"); - - int mobLevel = getLevel(whoTriggeredMe); - - location curLoc = getLocation(self); - - blog("Creating Mob"); - obj_id mob = create.object(ENEMY_MOB, curLoc, mobLevel); - if (!isValidId(mob) || !exists(mob)) - { - return SCRIPT_CONTINUE; - } - - setObjVar(mob, "player", whoTriggeredMe); - - addHate(mob, whoTriggeredMe, 1); - - setObjVar(mob, PHRASE_STRING_FILE, SPAM_STRING_FILE); - - setObjVar(mob, "attack_phrase", "infiltrator_attack_oops"); - setObjVar(mob, "defeat_phrase", "infiltrator_defeat_tell"); - - playClientEffectObj(mob, CLIENT_EFFECT, mob, ""); - setObjVar(mob, "clientEffect", CLIENT_EFFECT); - attachScript(mob, MEATLUMP_ENEMY_SCRIPT); - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - blog("Exited trigger volume: "+whoTriggeredMe); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(MEATLUMP_LOG,msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/qrant_map_quest_object.java b/sku.0/sys.server/compiled/game/script/theme_park/meatlump/qrant_map_quest_object.java deleted file mode 100644 index 0ed000345..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/qrant_map_quest_object.java +++ /dev/null @@ -1,281 +0,0 @@ -package script.theme_park.meatlump; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.city; -import script.library.collection; -import script.library.locations; -import script.library.groundquests; -import script.library.sui; -import script.library.utils; - - -public class qrant_map_quest_object extends script.base_script -{ - public qrant_map_quest_object() - { - } - public static final string_id RADIAL_INSPECT = new string_id ("quest/ground/util/quest_giver_object", "radial_inspect"); - public static final string_id OFFER_QUEST_MSG = new string_id ("quest/ground/util/quest_giver_object", "offer_quest_teleport"); - public static final string_id SUI_TITLE = new string_id ("quest/ground/util/quest_giver_object", "sui_title"); - public static final string_id BUTTON_DECLINE = new string_id ("quest/ground/util/quest_giver_object", "button_decline"); - public static final string_id BUTTON_ACCEPT = new string_id ("quest/ground/util/quest_giver_object", "button_accept"); - public static final string_id DECLINED_QUEST = new string_id ("quest/ground/util/quest_giver_object", "declined_quest"); - public static final string_id MUST_DISMOUNT = new string_id ("quest/ground/util/quest_giver_object", "must_dismount"); - public static final string_id PLAYER_IN_CELL = new string_id ("quest/ground/util/quest_giver_object", "player_in_cell"); - public static final string_id NOT_WHILE_INCAPPED = new string_id ("quest/ground/util/quest_giver_object", "not_while_incapped"); - public static final string_id SID_ELIGIBLE_FOR_GIFT_TITLE = new string_id ("quest/ground/util/quest_giver_object", "eligible_for_gift_title"); - public static final string_id SID_ELIGIBLE_FOR_GIFT_PROMPT = new string_id ("quest/ground/util/quest_giver_object", "eligible_for_gift_prompt"); - public static final string_id SID_NOT_WHILE_IN_COMBAT = new string_id("base_player", "not_while_in_combat"); - - public static final String PID_NAME = "getCollectionGiftsHasCompletedQuests"; - public static final String QUEST_NAME = "chapter7_publish_gift_activation"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - int menuOption = mi.addRootMenu (menu_info_types.ITEM_USE, RADIAL_INSPECT); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.ITEM_USE) - { - - if (!wildLocation(player)) - { - return SCRIPT_CONTINUE; - } - - if (getState(player, STATE_COMBAT) > 0) - { - sendSystemMessage(player, SID_NOT_WHILE_IN_COMBAT); - return SCRIPT_CONTINUE; - } - if (getState(player, STATE_RIDING_MOUNT) == 1) - { - sendSystemMessage(player, MUST_DISMOUNT); - return SCRIPT_CONTINUE; - } - if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, NOT_WHILE_INCAPPED); - return SCRIPT_CONTINUE; - } - - if (getTopMostContainer(player) != player) - { - sendSystemMessage(player, PLAYER_IN_CELL); - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, QUEST_NAME) || groundquests.isQuestActive(player, QUEST_NAME)) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(player, "questGiver.openSui")) - { - int oldSui = utils.getIntScriptVar(player, "questGiver.openSui"); - utils.removeScriptVar(player, "questGiver.openSui"); - if (oldSui > -1) - { - forceCloseSUIPage(oldSui); - } - } - - if ((groundquests.isQuestActiveOrComplete(player, "chapter7_beginning_click_collection") || groundquests.isQuestActiveOrComplete(player, "chapter7_beginning_counter_collection") || groundquests.isQuestActiveOrComplete(player, "chapter7_beginning_inventory_collection_01") || groundquests.isQuestActiveOrComplete(player, "chapter7_beginning_inventory_collection_02") || groundquests.isQuestActiveOrComplete(player, "chapter7_beginning_inventory_collection_03") || groundquests.isQuestActiveOrComplete(player, "chapter7_beginning_inventory_collection_04"))) - { - - String title = utils.packStringId(SID_ELIGIBLE_FOR_GIFT_TITLE); - String prompt = utils.packStringId(SID_ELIGIBLE_FOR_GIFT_PROMPT); - - int pid = sui.msgbox(self, player, prompt, sui.YES_NO, title, "handleGrantPublishGiftFromComlink"); - sui.setPid(player, pid, PID_NAME); - } - else - { - string_id sid_offerText = SUI_TITLE; - - String title = utils.packStringId(sid_offerText); - String testMsg = utils.packStringId(OFFER_QUEST_MSG); - String ok_button = utils.packStringId(BUTTON_ACCEPT); - String cancel_button = utils.packStringId(BUTTON_DECLINE); - - int pid = sui.createSUIPage( sui.SUI_MSGBOX, self, player, "handleQuestOfferResponse"); - - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, title); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, testMsg); - - sui.msgboxButtonSetup(pid, sui.YES_NO); - setSUIProperty(pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, ok_button); - setSUIProperty(pid, sui.MSGBOX_BTN_CANCEL, sui.PROP_TEXT, cancel_button); - - utils.setScriptVar(player, "questGiver.openSui", pid); - sui.showSUIPage( pid ); - - } - } - return SCRIPT_CONTINUE; - } - - - public int handleGrantPublishGiftFromComlink(obj_id self, dictionary params) throws InterruptedException - { - int btn = sui.getIntButtonPressed(params); - - obj_id player = sui.getPlayerId(params); - if (btn == sui.BP_CANCEL) - { - sui.removePid(player, PID_NAME); - return SCRIPT_CONTINUE; - } - if (!sui.hasPid(player, PID_NAME)) - { - return SCRIPT_CONTINUE; - } - if (btn == sui.BP_OK) - { - groundquests.grantQuest(player, "chapter7_give_comlink_reward"); - groundquests.grantQuest(player, "chapter7_give_datapad_reward"); - destroySelf(self); - sui.removePid(player, PID_NAME); - } - return SCRIPT_CONTINUE; - } - - - public int handleQuestOfferResponse(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (!wildLocation(player)) - { - return SCRIPT_CONTINUE; - } - - if (groundquests.hasCompletedQuest(player, QUEST_NAME) || groundquests.isQuestActive(player, QUEST_NAME)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - switch ( bp ) - { - case sui.BP_OK: - callShuttle(self, player); - break; - - case sui.BP_CANCEL: - sendSystemMessage(player, DECLINED_QUEST); - break; - } - return SCRIPT_CONTINUE; - } - - - public void destroySelf(obj_id self) throws InterruptedException - { - detachScript(self,"item.special.nodestroy"); - destroyObject(self); - } - - - public boolean wildLocation(obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - location loc = getLocation(player); - - if (isIdValid(loc.cell)) - { - sendSystemMessage(player, new string_id("combat_effects", "not_indoors")); - return false; - } - - if (locations.isInMissionCity(loc)) - { - sendSystemMessage(player, new string_id("combat_effects", "not_in_city")); - return false; - } - - if (city.isInCity(loc)) - { - sendSystemMessage(player, new string_id("combat_effects", "not_in_city")); - return false; - } - return true; - } - - - public boolean callShuttle(obj_id self, obj_id player) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - if (!wildLocation(player)) - { - return false; - } - - location loc = getLocation(player); - float treasureXdelta = rand(15f, 18f); - float treasureZdelta = rand(15f, 18f); - - location landingLoc = (location)loc.clone(); - landingLoc.x += treasureXdelta; - landingLoc.z += treasureZdelta; - - landingLoc.y = getHeightAtLocation(landingLoc.x, landingLoc.z); - - obj_id shuttle = createObject("object/creature/npc/theme_park/event_transport.iff", landingLoc); - - if (!isIdValid(shuttle)) - { - return false; - } - - groundquests.grantQuest(player, QUEST_NAME); - modifyCollectionSlotValue(player, "publish_chapter7_click_activation_01", 1); - setObjVar(player,"publish_chapter7_click_activated", true); - - dictionary d = new dictionary(); - d.put("owner", player); - - attachScript(shuttle, "systems.collections.publish_gift.publish_gift_shuttle"); - - messageTo(shuttle, "startLandingSequence", d, 0.0f, false); - destroySelf(self); - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/slicing_minigame.java b/sku.0/sys.server/compiled/game/script/theme_park/meatlump/slicing_minigame.java deleted file mode 100644 index dd246cf13..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/slicing_minigame.java +++ /dev/null @@ -1,667 +0,0 @@ -package script.theme_park.meatlump; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.consumable; -import script.library.loot; -import script.library.sui; -import script.library.stealth; -import script.library.utils; -import java.util.Random; - - -public class slicing_minigame extends script.base_script -{ - public slicing_minigame() - { - } - public static final boolean LOGGING_ON = false; - - public static final String VAR_PREFIX = "meatlump_safe"; - public static final String NONIMPERATIVE_VAR_PREFIX = "meatlump_safe_nonimperative"; - public static final String PID_NAME = NONIMPERATIVE_VAR_PREFIX + ".pid"; - public static final String PASSWORD = VAR_PREFIX + ".password"; - public static final String PASSWORD_SCRAMBLED = VAR_PREFIX + ".password_scrambled"; - public static final String PASSWORD_ROW = VAR_PREFIX + ".password_row"; - public static final String PASSWORD_POINTS_NEEDED = VAR_PREFIX + ".password_points_needed"; - public static final String PASSWORD_POINTS_CURRENT = NONIMPERATIVE_VAR_PREFIX + ".password_points_current"; - public static final String CURRENTLY_SLICING = NONIMPERATIVE_VAR_PREFIX + ".slicing"; - public static final String ANAGRAM_GUESS_LIST = NONIMPERATIVE_VAR_PREFIX + ".anagram_guess_list"; - public static final String WRONG_ANSWER_COUNT = NONIMPERATIVE_VAR_PREFIX + ".wrong_answer_count"; - public static final String WRONG_ANSWER_THRESHOLD = NONIMPERATIVE_VAR_PREFIX + ".wrong_answer_threshold"; - - public static final String OBJVAR_SLOT_NAME = "collection.slotName"; - public static final String SAFE_CAPTION = "OLD SAFE"; - public static final String DEVICE_TEMPLATE = "object/tangible/meatlump/event/slicing_device_meatlump_safe.iff"; - public static final String DEVICE_OBJVAR = "puzzle"; - public static final String SAFE_PUZZLE_BUFF = "safe_puzzle_buff"; - - public static final String PASSWORD_TABLE = "datatables/theme_park/meatlump_safe_passwords.iff"; - - public static final string_id SID_OPEN_SAFE = new string_id("meatlump/meatlump", "meatlump_safe_open"); - public static final string_id SAFE_INTRO_TEXT = new string_id("meatlump/meatlump", "safe_minigame_text"); - public static final string_id SID_ALREADY_GUESSED_PREVIOUS = new string_id("meatlump/meatlump", "safe_guessed_previous"); - public static final string_id SID_YOU_FAILED_TO_SOLVE = new string_id("meatlump/meatlump", "you_failed_to_solve_slicing_puzzle"); - public static final string_id YOU_FAILED = new string_id("meatlump/meatlump", "you_failed"); - public static final string_id YOU_CANCELED_EARLY = new string_id("meatlump/meatlump", "you_canceled_early"); - public static final string_id YOU_HAVE_DEBUFF = new string_id("meatlump/meatlump", "you_have_debuff"); - public static final string_id YOU_NEED_DEVICE = new string_id("meatlump/meatlump", "you_need_device"); - - public static final int SKIPPED_COLUMNS = 2; - public static final int DEFAULT_ANAGRAM_POINT = 1; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - mi.addRootMenu(menu_info_types.ITEM_USE, SID_OPEN_SAFE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - obj_id collectionItem = self; - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - else if (!collection.canCollectCollectible(player, self)) - { - return SCRIPT_CONTINUE; - } - else if (buff.hasBuff(player, "safe_puzzle_downer")) - { - sendSystemMessage(player, YOU_HAVE_DEBUFF); - return SCRIPT_CONTINUE; - } - else if (!consumable.decrementObjectInventoryOrEquipped(player, DEVICE_TEMPLATE, DEVICE_OBJVAR)) - { - sendSystemMessage(player, YOU_NEED_DEVICE); - return SCRIPT_CONTINUE; - } - - closeOldWindow(player); - blog("OnObjectMenuSelect"); - createSafeSui(collectionItem, player); - - return SCRIPT_CONTINUE; - } - - - public boolean createSafeSui(obj_id collectionItem, obj_id player) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - blog("createSafeSui"); - - if (!utils.hasScriptVar(player, CURRENTLY_SLICING) && !utils.hasScriptVar(player, PASSWORD+"_"+collectionItem)) - { - blog("setting up password for slicing session"); - boolean varsSet = getRandomPassword(collectionItem, player); - if (!varsSet) - { - return false; - } - utils.setScriptVar(player, CURRENTLY_SLICING, true); - } - else - { - closeOldWindow(player); - } - - String jumbledPassword = utils.getStringScriptVar(player, PASSWORD_SCRAMBLED+"_"+collectionItem); - int datatableRow = utils.getIntScriptVar(player, PASSWORD_ROW+"_"+collectionItem); - int passwordPointsNeeded = utils.getIntScriptVar(player, PASSWORD_POINTS_NEEDED); - int passwordPointsCurrent = utils.getIntScriptVar(player, PASSWORD_POINTS_CURRENT); - int wrongAnswerCount = utils.getIntScriptVar(player, WRONG_ANSWER_COUNT); - int wrongAnswerThreshold = utils.getIntScriptVar(player, WRONG_ANSWER_THRESHOLD); - String questionnaireText = localize(SAFE_INTRO_TEXT); - String guessList = utils.getStringScriptVar(player, ANAGRAM_GUESS_LIST); - - blog("createSafeSui - displaying SUI data"); - - questionnaireText += sui.newLine(2); - questionnaireText += "Scrambled Password: "; - questionnaireText += sui.colorRed() + jumbledPassword + sui.colorWhite() + sui.newLine(); - questionnaireText += "Total Fail Attempts: "+ sui.colorRed() + wrongAnswerCount + sui.colorWhite() +sui.newLine(); - questionnaireText += "Maximum Fail Attempts Allowed: "+ sui.colorRed() + (wrongAnswerThreshold + 1) + sui.colorWhite() +sui.newLine(); - questionnaireText += "Points Needed: "; - questionnaireText += sui.colorRed() + passwordPointsNeeded + sui.colorWhite() + sui.newLine(); - questionnaireText += "Current Points: "; - questionnaireText += sui.colorRed() + passwordPointsCurrent + sui.colorWhite() + sui.newLine(2); - - if (guessList != null && !guessList.equals("")) - { - questionnaireText += sui.colorGreen() + guessList + sui.colorWhite() + sui.newLine(); - } - - dictionary params = new dictionary(); - int pid = createSUIPage("/Script.questionnaire", collectionItem, player); - setSUIAssociatedLocation(pid, collectionItem); - setSUIMaxRangeToObject(pid, 8); - params.put("callingPid", pid); - sui.setPid(player, pid, PID_NAME); - - setSUIProperty(pid, "Prompt.lblPrompt", "LocalText", questionnaireText); - setSUIProperty(pid, "bg.caption.lblTitle", "Text", SAFE_CAPTION); - setSUIProperty(pid, "Prompt.lblPrompt", "Editable", "false"); - setSUIProperty(pid, "Prompt.lblPrompt", "GetsInput", "false"); - setSUIProperty(pid, "txtInput", "Editable", "true"); - setSUIProperty(pid, "txtInput", "GetsInput", "true"); - - setSUIProperty(pid, "btnOk", "Visible", "true"); - setSUIProperty(pid, "btnCancel", "Visible", "true"); - - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onClosedOk, "%button2%", "txtInput", "LocalText"); - - subscribeToSUIEvent(pid, sui_event_type.SET_onClosedOk, "%button2%", "handleDialogInput"); - subscribeToSUIEvent(pid, sui_event_type.SET_onClosedCancel, "%button0%", "closeSui"); - - showSUIPage(pid); - flushSUIPage(pid); - - return true; - } - - - public int handleDialogInput(obj_id self, dictionary params) throws InterruptedException - { - blog("handleDialogInput"); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - blog("handleDialogInput - player validated"); - blog("handleDialogInput - params: "+params); - - if (params.getString("txtInput.LocalText") == null) - { - return SCRIPT_CONTINUE; - } - - blog("handleDialogInput - validation completed: "); - - String playerGuess = params.getString("txtInput.LocalText"); - blog("handleDialogInput - playerGuess: "+playerGuess); - - String correctPassword = utils.getStringScriptVar(player, PASSWORD+"_"+self); - if (playerGuess.equals(correctPassword)) - { - blog("handleDialogInput - Password Solved!! Rewardign Player"); - rewardPlayer(self, player); - return SCRIPT_CONTINUE; - } - - else if (isNameReserved(playerGuess)) - { - blog("handleDialogInput - reserved or foul language"); - if (!incrementWrongAnswer(self, player)) - { - applyPuzzleDebuff(self, player); - return SCRIPT_CONTINUE; - } - - createSafeSui(self, player); - } - - else if (utils.hasScriptVar(player, ANAGRAM_GUESS_LIST) && !checkGuessList(self, player, playerGuess)) - { - blog("handleDialogInput - player attempted to reuse a previously used guess: "+ playerGuess); - sendSystemMessage(player, SID_ALREADY_GUESSED_PREVIOUS); - if (!incrementWrongAnswer(self, player)) - { - applyPuzzleDebuff(self, player); - return SCRIPT_CONTINUE; - } - - createSafeSui(self, player); - return SCRIPT_CONTINUE; - } - - blog("handleDialogInput - Guess != password"); - - int datatableRow = utils.getIntScriptVar(player, PASSWORD_ROW+"_"+self); - if (datatableRow < 0) - { - return SCRIPT_CONTINUE; - } - - int totalCols = (dataTableGetNumColumns(PASSWORD_TABLE) - SKIPPED_COLUMNS); - if (totalCols < 0) - { - return SCRIPT_CONTINUE; - } - - dictionary dictRow = dataTableGetRow(PASSWORD_TABLE, datatableRow); - if (dictRow == null) - { - return SCRIPT_CONTINUE; - } - - blog("handleDialogInput - Datatable Validation Complete"); - - boolean recreateSui = true; - boolean incrementWrong = true; - - for (int i = 1; i < totalCols; i++) - { - testAbortScript(); - String anagram = dictRow.getString("anagram"+i); - if (anagram == null || anagram.equals("")) - { - continue; - } - else if (!playerGuess.equals(anagram)) - { - continue; - } - else - { - - blog("handleDialogInput - match found for: "+ playerGuess); - recreateSui = givePoints(self, player, anagram); - incrementWrong = false; - break; - } - } - - blog("handleDialogInput - No Match Found"); - - if (incrementWrong) - { - if (!incrementWrongAnswer(self, player)) - { - applyPuzzleDebuff(self, player); - return SCRIPT_CONTINUE; - } - else if (recreateSui) - { - createSafeSui(self, player); - } - } - return SCRIPT_CONTINUE; - } - - - public boolean applyPuzzleDebuff(obj_id collectionItem, obj_id player) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - closeOldWindow(player); - removePlayerNonImperativeVars(player); - return true; - } - - - public boolean incrementWrongAnswer(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("incrementWrongAnswer - INIT"); - - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - if (!utils.hasScriptVar(player, WRONG_ANSWER_COUNT)) - { - return false; - } - else if (!utils.hasScriptVar(player, WRONG_ANSWER_THRESHOLD)) - { - return false; - } - - int currentCount = utils.getIntScriptVar(player, WRONG_ANSWER_COUNT); - int threshold = utils.getIntScriptVar(player, WRONG_ANSWER_THRESHOLD); - if (currentCount < 0 || threshold < 0) - { - return false; - } - - blog("incrementWrongAnswer - currentCount: "+ currentCount); - blog("incrementWrongAnswer - threshold: "+ threshold); - - if (currentCount >= threshold) - { - if (buff.applyBuff(player, "safe_puzzle_downer")) - {; - } - { - sendSystemMessage(player, YOU_FAILED); - } - return false; - } - - blog("incrementWrongAnswer - INCREMENTING "+ currentCount); - utils.setScriptVar(player, WRONG_ANSWER_COUNT, currentCount+1); - blog("incrementWrongAnswer - INCREMENTED "+ utils.getIntScriptVar(player, WRONG_ANSWER_COUNT)); - return true; - } - - - public boolean getRandomPassword(obj_id collectionItem, obj_id player) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - int datatableLength = dataTableGetNumRows(PASSWORD_TABLE); - int randomNum = rand(0, datatableLength-1); - if (randomNum < 0) - { - return false; - } - - String password = dataTableGetString(PASSWORD_TABLE, randomNum, "password"); - if (password == null || password.equals("")) - { - return false; - } - - int pointsNeeded = dataTableGetInt(PASSWORD_TABLE, randomNum, "points_needed"); - if (pointsNeeded < 0) - { - return false; - } - int threshold = dataTableGetInt(PASSWORD_TABLE, randomNum, "threshold"); - if (threshold < 0) - { - return false; - } - - String scrambled = scramblePassword(password); - if (scrambled == null || scrambled.equals("")) - { - return false; - } - - boolean hasBuff = false; - if (buff.hasBuff(player, SAFE_PUZZLE_BUFF)) - { - if (pointsNeeded > 1) - { - pointsNeeded -= 1; - } - - threshold += 3; - } - - utils.setScriptVar(player, PASSWORD+"_"+collectionItem, password); - utils.setScriptVar(player, PASSWORD_SCRAMBLED+"_"+collectionItem, scrambled); - utils.setScriptVar(player, PASSWORD_ROW+"_"+collectionItem, randomNum); - utils.setScriptVar(player, PASSWORD_POINTS_NEEDED, pointsNeeded); - utils.setScriptVar(player, PASSWORD_POINTS_CURRENT, 0); - utils.setScriptVar(player, WRONG_ANSWER_THRESHOLD, threshold); - utils.setScriptVar(player, WRONG_ANSWER_COUNT, 0); - - return true; - } - - - public String scramblePassword(String password) throws InterruptedException - { - if (password == null || password.equals("")) - { - return null; - } - - String reversedPassword = ""; - String scrambled = ""; - java.util.Random r; - r = new java.util.Random(); - - for (int i = 0; i < password.length(); i++) - { - testAbortScript(); - if (r.nextBoolean()) - { - scrambled = scrambled + password.charAt(i); - } - else - { - scrambled = password.charAt(i) + scrambled; - } - } - - for (int d = (password.length() - 1); d >= 0; d--) - { - testAbortScript(); - reversedPassword += scrambled.charAt(d); - } - if (reversedPassword == null || reversedPassword.equals("") || reversedPassword.length() < 0) - { - return null; - } - else if (reversedPassword.length() != password.length()) - { - return null; - } - - return scrambled; - } - - - public boolean checkGuessList(obj_id collectionItem, obj_id player, String anagram) throws InterruptedException - { - blog("checkGuessList"); - - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - else if (anagram == null || anagram.equals("")) - { - return false; - } - - blog("checkGuessList validation completed. anagram = "+anagram); - - if (!utils.hasScriptVar(player, ANAGRAM_GUESS_LIST)) - { - return true; - } - - blog("checkGuessList anagram list found"); - - String guessList = utils.getStringScriptVar(player, ANAGRAM_GUESS_LIST); - if (guessList == null || guessList.equals("")) - { - return false; - } - - blog("checkGuessList guessList populated with previous list: "+ guessList); - - String[] splitAnagramList = split(guessList, ','); - if (splitAnagramList == null || splitAnagramList.length < 0) - { - return false; - } - - int listLength = splitAnagramList.length; - blog("checkGuessList listLength: "+listLength); - for (int i = 0; i < listLength; i++) - { - testAbortScript(); - blog("checkGuessList splitAnagramList:"+ splitAnagramList[i].trim() + "* anagram:"+anagram); - - if (splitAnagramList[i].trim().equals(anagram)) - { - return false; - } - } - - blog("checkGuessList went through the entire list and found no match."); - return true; - } - - - public boolean givePoints(obj_id collectionItem, obj_id player, String anagram) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - else if (anagram == null || anagram.equals("")) - { - return false; - } - int passwordPointsNeeded = utils.getIntScriptVar(player, PASSWORD_POINTS_NEEDED); - int passwordPointsCurrent = utils.getIntScriptVar(player, PASSWORD_POINTS_CURRENT); - if (passwordPointsNeeded < 0 || passwordPointsCurrent < 0) - { - return false; - } - else if (passwordPointsNeeded == passwordPointsCurrent) - { - rewardPlayer(collectionItem, player); - - return false; - } - else if (passwordPointsCurrent >= passwordPointsNeeded) - { - rewardPlayer(collectionItem, player); - - return false; - } - - String guessList = utils.getStringScriptVar(player, ANAGRAM_GUESS_LIST); - if (guessList != null && !guessList.equals("")) - { - utils.setScriptVar(player, ANAGRAM_GUESS_LIST, guessList + ", "+ anagram); - } - else - { - utils.setScriptVar(player, ANAGRAM_GUESS_LIST, anagram); - } - - int point = DEFAULT_ANAGRAM_POINT; - - if ((passwordPointsCurrent + point) >= passwordPointsNeeded) - { - rewardPlayer(collectionItem, player); - - return false; - } - - utils.setScriptVar(player, PASSWORD_POINTS_CURRENT, passwordPointsCurrent+point); - createSafeSui(collectionItem, player); - - return true; - } - - - public boolean rewardPlayer(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("rewardPlayer - init"); - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - else if (!exists(collectionItem) || !exists(player)) - { - return false; - } - blog("rewardPlayer - validation complete"); - - if (!collection.rewardPlayerCollectionSlot(player, collectionItem)) - { - blog("rewardPlayer - rewardPlayerCollectionSlot = FAIL!!!"); - closeOldWindow(player); - removePlayerNonImperativeVars(player); - return false; - } - blog("rewardPlayer - rewardPlayerCollectionSlot = GIVE LOOT"); - - loot.giveMeatlumpPuzzleLoot(player, true, false); - - blog("rewardPlayer - rewardPlayerCollectionSlot = SUCCESS"); - closeOldWindow(player); - removePlayerNonImperativeVars(player); - - removePlayerImperativeVars(player); - - return true; - } - - - public int closeSui(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - if (buff.applyBuff(player, "safe_puzzle_downer")) - {; - } - { - sendSystemMessage(player, YOU_CANCELED_EARLY); - } - - blog("closeSui"); - closeOldWindow(player); - - removePlayerNonImperativeVars(player); - return SCRIPT_CONTINUE; - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - int pid = sui.getPid(player, PID_NAME); - if (pid > -1) - { - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } - - - public void removePlayerNonImperativeVars(obj_id player) throws InterruptedException - { - utils.removeScriptVarTree(player, NONIMPERATIVE_VAR_PREFIX); - utils.removeObjVar(player, NONIMPERATIVE_VAR_PREFIX); - } - - - public void removePlayerImperativeVars(obj_id player) throws InterruptedException - { - utils.removeScriptVarTree(player, VAR_PREFIX); - utils.removeObjVar(player, VAR_PREFIX); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG("minigame",msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/target_map_puzzle.java b/sku.0/sys.server/compiled/game/script/theme_park/meatlump/target_map_puzzle.java deleted file mode 100644 index 97e9da398..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/meatlump/target_map_puzzle.java +++ /dev/null @@ -1,870 +0,0 @@ -package script.theme_park.meatlump; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.consumable; -import script.library.sui; -import script.library.stealth; -import script.library.utils; -import java.lang.System; - - -public class target_map_puzzle extends script.base_script -{ - public target_map_puzzle() - { - } - public static final boolean LOGGING_ON = false; - - public static final String VAR_PREFIX = "meatlump_target_map"; - public static final String PID_NAME = VAR_PREFIX + ".pid"; - public static final String CURRENTLY_DECIPHERING = VAR_PREFIX + ".slicing"; - public static final String PREFIX_SCRAMBLED = VAR_PREFIX + ".prefix_scrambled"; - public static final String TARGET_SCRAMBLED = VAR_PREFIX + ".target_scrambled"; - public static final String TRAIL_SCRAMBLED = VAR_PREFIX + ".trail_scrambled"; - public static final String PLANET_SCRAMBLED = VAR_PREFIX + ".planet_scrambled"; - public static final String PREFIX = VAR_PREFIX + ".prefix"; - public static final String TARGET = VAR_PREFIX + ".target"; - public static final String TRAIL = VAR_PREFIX + ".trail"; - public static final String PLANET = VAR_PREFIX + ".planet"; - public static final String TEXT_TO_BE_SOLVED = VAR_PREFIX + ".text_to_be_solved"; - public static final String TEXT_TARGET = VAR_PREFIX + ".text_target"; - public static final String TEXT_LOCATION = VAR_PREFIX + ".text_location"; - public static final String TEXT_PLANET = VAR_PREFIX + ".text_planet"; - public static final String CAPTION = "Target Map"; - public static final String DEVICE_TEMPLATE = "object/tangible/meatlump/event/slicing_device_meatlump_map.iff"; - public static final String DEVICE_OBJVAR = "puzzle"; - public static final String TARGET_MAP_BUFF = "target_map_puzzle_buff"; - - public static final String TEXT_DATATABLE = "datatables/theme_park/meatlump_target_map_text.iff"; - - public static final string_id SID_OPEN = new string_id("meatlump/meatlump", "meatlump_decipher_map"); - public static final string_id MAP_INTRO_TEXT = new string_id("meatlump/meatlump", "decipher_map_text"); - public static final string_id YOU_CANCELED_EARLY = new string_id("meatlump/meatlump", "you_canceled_early"); - public static final string_id YOU_HAVE_DEBUFF = new string_id("meatlump/meatlump", "you_have_debuff"); - public static final string_id YOU_NEED_DEVICE = new string_id("meatlump/meatlump", "you_need_device"); - - public static final char[][] CIPHER_ARRAY_1 = - { - { - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z' - } - , - { - '!', - '@', - '#', - '$', - '3', - '^', - '&', - '*', - '(', - ')', - '_', - '+', - '-', - '=', - '[', - ']', - '/', - '|', - '?', - '/', - '>', - '<', - '`', - '~', - ';', - '2', - '!', - '@', - '#', - '$', - '3', - '^', - '&', - '*', - '(', - ')', - '_', - '+', - '-', - '=', - '[', - ']', - '/', - '|', - '?', - '/', - '>', - '<', - '`', - '~', - ';', - '2' - } - }; - - public static final char[][] CIPHER_ARRAY_2 = - { - { - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z' - } - , - { - '¤', - 'þ', - '#', - 'ð', - 'ê', - 'f', - '&', - '*', - 'î', - 'j', - '_', - '¶', - '-', - 'n', - 'Ø', - '¿', - '/', - '®', - 's', - '^', - 'ü', - '<', - '`', - '~', - '¥', - 'z', - '¤', - 'þ', - '#', - 'ð', - 'ê', - 'f', - '&', - '*', - 'î', - 'j', - '_', - '¶', - '-', - 'n', - 'Ø', - '¿', - '/', - '®', - 's', - '^', - 'ü', - '<', - '`', - '~', - '¥', - 'z', - } - }; - - public static final char[][] CIPHER_ARRAY_3 = - { - { - 'a', - 'b', - 'c', - 'd', - 'e', - 'f', - 'g', - 'h', - 'i', - 'j', - 'k', - 'l', - 'm', - 'n', - 'o', - 'p', - 'q', - 'r', - 's', - 't', - 'u', - 'v', - 'w', - 'x', - 'y', - 'z', - 'A', - 'B', - 'C', - 'D', - 'E', - 'F', - 'G', - 'H', - 'I', - 'J', - 'K', - 'L', - 'M', - 'N', - 'O', - 'P', - 'Q', - 'R', - 'S', - 'T', - 'U', - 'V', - 'W', - 'X', - 'Y', - 'Z' - } - , - { - '4', - '8', - '©', - 'd', - '3', - 'f', - '6', - '#', - '1', - 'j', - '_', - '|', - 'm', - 'n', - '0', - 'Þ', - 'ð', - '®', - '5', - '+', - 'ü', - '<', - 'w', - '~', - '/', - '2', - '4', - '8', - '©', - 'd', - '3', - 'f', - '6', - '#', - '1', - 'j', - '_', - '|', - 'm', - 'n', - '0', - 'Þ', - 'ð', - '®', - '5', - '+', - 'ü', - '<', - 'w', - '~', - '/', - '2' - } - }; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - - mi.addRootMenu(menu_info_types.ITEM_USE, SID_OPEN); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - obj_id collectionItem = self; - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!collection.canCollectCollectible(player, self)) - { - return SCRIPT_CONTINUE; - } - else if (buff.hasBuff(player, "target_map_puzzle_downer")) - { - sendSystemMessage(player, YOU_HAVE_DEBUFF); - return SCRIPT_CONTINUE; - } - else if (!consumable.decrementObjectInventoryOrEquipped(player, DEVICE_TEMPLATE, DEVICE_OBJVAR)) - { - sendSystemMessage(player, YOU_NEED_DEVICE); - return SCRIPT_CONTINUE; - } - - closeOldWindow(player); - blog("OnObjectMenuSelect"); - createMapText(collectionItem, player); - - return SCRIPT_CONTINUE; - } - - - public boolean createMapText(obj_id collectionItem, obj_id player) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - blog("createMapText"); - - if (!utils.hasScriptVar(player, CURRENTLY_DECIPHERING)) - { - blog("setting up password for slicing session"); - boolean varsSet = getRandomText(collectionItem, player); - if (!varsSet) - { - return false; - } - utils.setScriptVar(player, CURRENTLY_DECIPHERING, true); - } - else - { - closeOldWindow(player); - } - - if ((!utils.hasScriptVar(player, CURRENTLY_DECIPHERING) || !utils.hasScriptVar(player, PREFIX_SCRAMBLED) || !utils.hasScriptVar(player, TARGET_SCRAMBLED) || !utils.hasScriptVar(player, TRAIL_SCRAMBLED) || !utils.hasScriptVar(player, PLANET_SCRAMBLED) || !utils.hasScriptVar(player, PREFIX) || !utils.hasScriptVar(player, TARGET) || !utils.hasScriptVar(player, TRAIL) || !utils.hasScriptVar(player, PLANET) || !utils.hasScriptVar(player, TEXT_TO_BE_SOLVED))) - { - blog("createMapText - failed script var validation"); - return false; - } - - String textToBeSolved = utils.getStringScriptVar(player, TEXT_TO_BE_SOLVED); - String prefixScrambled = utils.getStringScriptVar(player, PREFIX_SCRAMBLED); - String targetScrambled = utils.getStringScriptVar(player, TARGET_SCRAMBLED); - String trailScrambled = utils.getStringScriptVar(player, TRAIL_SCRAMBLED); - String planetScrambled = utils.getStringScriptVar(player, PLANET_SCRAMBLED); - - String questionnaireText = localize(MAP_INTRO_TEXT); - questionnaireText += sui.newLine(2); - questionnaireText += sui.colorGreen() + prefixScrambled + sui.colorWhite() + sui.newLine(2); - questionnaireText += "Target: "; - - if (textToBeSolved.equals(TEXT_TARGET)) - { - questionnaireText += sui.colorRed(); - } - - questionnaireText += targetScrambled + sui.colorWhite() + sui.newLine(2); - questionnaireText += "Target Location: "; - - if (textToBeSolved.equals(TEXT_LOCATION)) - { - questionnaireText += sui.colorRed(); - } - - questionnaireText += trailScrambled + sui.colorWhite() + sui.newLine(2); - questionnaireText += "Target Planet: "; - - if (textToBeSolved.equals(TEXT_PLANET)) - { - questionnaireText += sui.colorRed(); - } - - questionnaireText += planetScrambled + sui.colorWhite() + sui.newLine(2); - questionnaireText += "Solve the "+ sui.colorRed() + "RED"+ sui.colorWhite() + " text."; - - dictionary params = new dictionary(); - int pid = createSUIPage("/Script.questionnaire", collectionItem, player); - setSUIAssociatedLocation(pid, collectionItem); - setSUIMaxRangeToObject(pid, 8); - params.put("callingPid", pid); - sui.setPid(player, pid, PID_NAME); - - setSUIProperty(pid, "Prompt.lblPrompt", "LocalText", questionnaireText); - setSUIProperty(pid, "bg.caption.lblTitle", "Text", CAPTION); - setSUIProperty(pid, "Prompt.lblPrompt", "Editable", "false"); - setSUIProperty(pid, "Prompt.lblPrompt", "GetsInput", "false"); - setSUIProperty(pid, "txtInput", "Editable", "true"); - setSUIProperty(pid, "txtInput", "GetsInput", "true"); - - setSUIProperty(pid, "btnOk", "Visible", "true"); - setSUIProperty(pid, "btnCancel", "Visible", "true"); - - subscribeToSUIPropertyForEvent(pid, sui_event_type.SET_onClosedOk, "%button2%", "txtInput", "LocalText"); - - subscribeToSUIEvent(pid, sui_event_type.SET_onClosedOk, "%button2%", "handleDialogInput"); - subscribeToSUIEvent(pid, sui_event_type.SET_onClosedCancel, "%button0%", "closeSui"); - - showSUIPage(pid); - flushSUIPage(pid); - return true; - } - - - public int handleDialogInput(obj_id self, dictionary params) throws InterruptedException - { - blog("handleDialogInput"); - - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - blog("handleDialogInput - player validated"); - blog("handleDialogInput - params: "+params); - - if (params.getString("txtInput.LocalText") == null) - { - return SCRIPT_CONTINUE; - } - - blog("handleDialogInput - validation completed: "); - - String playerGuess = params.getString("txtInput.LocalText"); - blog("handleDialogInput - playerGuess: "+playerGuess); - - if ((!utils.hasScriptVar(player, CURRENTLY_DECIPHERING) || !utils.hasScriptVar(player, PREFIX_SCRAMBLED) || !utils.hasScriptVar(player, TARGET_SCRAMBLED) || !utils.hasScriptVar(player, TRAIL_SCRAMBLED) || !utils.hasScriptVar(player, PLANET_SCRAMBLED) || !utils.hasScriptVar(player, PREFIX) || !utils.hasScriptVar(player, TARGET) || !utils.hasScriptVar(player, TRAIL) || !utils.hasScriptVar(player, PLANET) || !utils.hasScriptVar(player, TEXT_TO_BE_SOLVED))) - { - blog("createMapText - failed script var validation"); - return SCRIPT_CONTINUE; - } - - String textToBeSolved = utils.getStringScriptVar(player, TEXT_TO_BE_SOLVED); - - String correctPhrase = ""; - if (textToBeSolved.equals(TEXT_TARGET)) - { - correctPhrase = utils.getStringScriptVar(player, TARGET); - } - else if (textToBeSolved.equals(TEXT_LOCATION)) - { - correctPhrase = utils.getStringScriptVar(player, TRAIL); - } - else if (textToBeSolved.equals(TEXT_PLANET)) - { - correctPhrase = utils.getStringScriptVar(player, PLANET); - } - - playerGuess = toLower(playerGuess); - correctPhrase = toLower(correctPhrase); - - if (playerGuess.equals(correctPhrase)) - { - blog("handleDialogInput - Password Solved!! Rewardign Player"); - rewardPlayer(self, player); - return SCRIPT_CONTINUE; - } - - createMapText(self, player); - return SCRIPT_CONTINUE; - } - - - public boolean getRandomText(obj_id collectionItem, obj_id player) throws InterruptedException - { - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - - int datatableLength = dataTableGetNumRows(TEXT_DATATABLE); - int randomNum = rand(0, datatableLength-1); - if (randomNum < 0) - { - return false; - } - - String targetString = dataTableGetString(TEXT_DATATABLE, randomNum, "target_text").trim(); - String prefixString = dataTableGetString(TEXT_DATATABLE, randomNum, "prefix_text").trim(); - String trailingString = dataTableGetString(TEXT_DATATABLE, randomNum, "trailing_text").trim(); - String planetString = dataTableGetString(TEXT_DATATABLE, randomNum, "planet_text").trim(); - - blog("targetString: "+targetString); - blog("prefixString: "+prefixString); - blog("trailingString: "+trailingString); - blog("planetString: "+planetString); - - if ((targetString == null || targetString.equals("") || prefixString == null || prefixString.equals("") || trailingString == null || trailingString.equals(""))) - { - return false; - } - - int targetLength = targetString.length(); - if (targetLength < 0) - { - return false; - } - - boolean hasBuff = false; - if (buff.hasBuff(player, TARGET_MAP_BUFF)) - { - hasBuff = true; - } - - blog("HASBUFF: "+hasBuff); - - char targetChar[] = targetString.toCharArray(); - - int arrayInt = rand(1,2); - - if (hasBuff) - { - arrayInt = 3; - } - - char[][] copiedArray = new char[2][52]; - - switch (arrayInt) - { - case 1: - for (int a = 0; a < CIPHER_ARRAY_1.length; a++) - { - testAbortScript(); - System.arraycopy(CIPHER_ARRAY_1[a],0, copiedArray[a],0,CIPHER_ARRAY_1[a].length); - } - break; - case 2: - for (int a = 0; a < CIPHER_ARRAY_2.length; a++) - { - testAbortScript(); - System.arraycopy(CIPHER_ARRAY_2[a],0, copiedArray[a],0,CIPHER_ARRAY_2[a].length); - } - break; - case 3: - for (int a = 0; a < CIPHER_ARRAY_3.length; a++) - { - testAbortScript(); - System.arraycopy(CIPHER_ARRAY_3[a],0, copiedArray[a],0,CIPHER_ARRAY_3[a].length); - } - break; - default: - for (int a = 0; a < CIPHER_ARRAY_1.length; a++) - { - testAbortScript(); - System.arraycopy(CIPHER_ARRAY_1[a],0, copiedArray[a],0,CIPHER_ARRAY_1[a].length); - } - } - - if (copiedArray == null) - { - blog("array copy must have failed "); - return false; - } - - String listOfChars = ""; - - for (int t = 0; t < targetChar.length; t++) - { - testAbortScript(); - if (targetChar[t] == ' ') - { - listOfChars += " "; - - continue; - } - - for (int i = 0; i < copiedArray[0].length; i++) - { - testAbortScript(); - if (targetChar[t] != copiedArray[0][i]) - { - continue; - } - else - { - listOfChars += ""+copiedArray[1][i]; - - } - } - } - - blog("listOfChars: "+listOfChars); - blog("listOfChars length: "+listOfChars.length()); - - char cipherChar[] = listOfChars.toCharArray(); - - blog("targetChar length: "+targetChar.length); - blog("cipherChar length: "+cipherChar.length); - - if (cipherChar.length != targetChar.length) - { - blog("length of cipherChar.length & targetChar.length are not equal."); - if (isGod(player)) - { - sendSystemMessageTestingOnly(player, "QA Message: failed to convert the target: "+targetString); - } - return false; - } - - String newTarget = targetString; - for (int i = 0; i < copiedArray[0].length; i++) - { - testAbortScript(); - newTarget = newTarget.replace(copiedArray[0][i], copiedArray[1][i]); - } - - blog("newTarget: "+newTarget); - - String newPrefix = prefixString; - for (int s = 0; s < targetLength; s++) - { - testAbortScript(); - newPrefix = newPrefix.replace(targetChar[s], cipherChar[s]); - } - - String newTrail = trailingString; - for (int s = 0; s < targetLength; s++) - { - testAbortScript(); - newTrail = newTrail.replace(targetChar[s], cipherChar[s]); - } - - String newPlanet = planetString; - for (int s = 0; s < targetLength; s++) - { - testAbortScript(); - newPlanet = newPlanet.replace(targetChar[s], cipherChar[s]); - } - - int selectPuzzle = 1; - if (hasBuff) - { - selectPuzzle = rand(2,3); - } - - blog("selectPuzzle: "+selectPuzzle); - switch (selectPuzzle) - { - case 1: - utils.setScriptVar(player, TEXT_TO_BE_SOLVED, TEXT_TARGET); - break; - case 2: - utils.setScriptVar(player, TEXT_TO_BE_SOLVED, TEXT_LOCATION); - break; - case 3: - utils.setScriptVar(player, TEXT_TO_BE_SOLVED, TEXT_PLANET); - break; - default: - utils.setScriptVar(player, TEXT_TO_BE_SOLVED, TEXT_TARGET); - } - - blog("setting script var newPrefix: "+newPrefix); - blog("setting script var newTarget: "+newTarget); - blog("setting script var newTrail: "+newTrail); - blog("setting script var newPlanet: "+newPlanet); - - utils.setScriptVar(player, PREFIX_SCRAMBLED, newPrefix); - utils.setScriptVar(player, TARGET_SCRAMBLED, newTarget); - utils.setScriptVar(player, TRAIL_SCRAMBLED, newTrail); - utils.setScriptVar(player, PLANET_SCRAMBLED, newPlanet); - utils.setScriptVar(player, PREFIX, prefixString); - utils.setScriptVar(player, TARGET, targetString); - utils.setScriptVar(player, TRAIL, trailingString); - utils.setScriptVar(player, PLANET, planetString); - return true; - } - - - public boolean rewardPlayer(obj_id collectionItem, obj_id player) throws InterruptedException - { - blog("rewardPlayer - init"); - if (!isValidId(collectionItem) || !isValidId(player)) - { - return false; - } - else if (!exists(collectionItem) || !exists(player)) - { - return false; - } - blog("rewardPlayer - validation complete"); - - if (!collection.rewardPlayerCollectionSlot(player, collectionItem)) - { - blog("rewardPlayer - rewardPlayerCollectionSlot = FAIL!!!"); - closeOldWindow(player); - removePlayerVars(player); - return false; - } - - blog("rewardPlayer - rewardPlayerCollectionSlot = SUCCESS"); - closeOldWindow(player); - removePlayerVars(player); - - return true; - } - - - public int closeSui(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = sui.getPlayerId(params); - if (!isValidId(player)) - { - return SCRIPT_CONTINUE; - } - - if (buff.applyBuff(player, "target_map_puzzle_downer")) - {; - } - { - sendSystemMessage(player, YOU_CANCELED_EARLY); - } - - blog("closeSui"); - closeOldWindow(player); - - return SCRIPT_CONTINUE; - } - - - public void closeOldWindow(obj_id player) throws InterruptedException - { - int pid = sui.getPid(player, PID_NAME); - if (pid > -1) - { - forceCloseSUIPage(pid); - sui.removePid(player, PID_NAME); - } - } - - - public void removePlayerVars(obj_id player) throws InterruptedException - { - utils.removeScriptVarTree(player, VAR_PREFIX); - utils.removeObjVar(player, VAR_PREFIX); - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG("minigame",msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_controller.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_controller.java deleted file mode 100644 index a4a248f2b..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_controller.java +++ /dev/null @@ -1,132 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.chat; -import script.library.hue; -import script.library.trial; -import script.library.utils; - - -public class boss_controller extends script.base_script -{ - public boss_controller() - { - } - - public void findNextTarget(obj_id self) throws InterruptedException - { - if (ai_lib.isDead(self)) - { - return; - } - - obj_id dungeon = getTopMostContainer(self); - obj_id target = null; - - if (!isIdValid(dungeon)) - { - - return; - } - - obj_id[] targets = trial.getNonStealthedTargetsInCell(dungeon, "r1"); - - if (targets == null || targets.length <= 0) - { - dictionary sessionDict = new dictionary(); - - messageTo(dungeon, "ig88_failed", sessionDict, 0, false); - return; - } - - target = trial.getClosest(self, targets); - - if (!isIdValid(target)) - { - return; - } - - int lastShieldTime = utils.getIntScriptVar(self, "lastShieldTime"); - - if (getGameTime() - lastShieldTime > 120) - { - utils.setScriptVar(self, "lastShieldTime", getGameTime()); - queueCommand(self, (-2086643447), self, "", COMMAND_PRIORITY_DEFAULT); - } - - setHate(self, target, 5000); - } - - - public int findTarget(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - findNextTarget(self); - - dictionary sessionDict = new dictionary(); - - messageTo(self, "findTarget", sessionDict, 1, false); - - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - findNextTarget(self); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id dungeon = getTopMostContainer(self); - - if (!isIdValid(dungeon)) - { - return SCRIPT_CONTINUE; - } - - dictionary sessionDict = new dictionary(); - - messageTo(self, "colorize", sessionDict, 0.25f, false); - - return SCRIPT_CONTINUE; - } - - - public int colorize(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - hue.setColor(self, hue.INDEX_1, 7); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_foreman.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_foreman.java deleted file mode 100644 index 062c8f3af..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_foreman.java +++ /dev/null @@ -1,132 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.chat; -import script.library.hue; -import script.library.trial; -import script.library.utils; - - -public class boss_foreman extends script.base_script -{ - public boss_foreman() - { - } - - public void findNextTarget(obj_id self) throws InterruptedException - { - if (ai_lib.isDead(self)) - { - return; - } - - obj_id dungeon = getTopMostContainer(self); - obj_id target = null; - - if (!isIdValid(dungeon)) - { - - return; - } - - obj_id[] targets = trial.getNonStealthedTargetsInCell(dungeon, "r1"); - - if (targets == null || targets.length <= 0) - { - dictionary sessionDict = new dictionary(); - - messageTo(dungeon, "ig88_failed", sessionDict, 0, false); - return; - } - - target = trial.getClosest(self, targets); - - if (!isIdValid(target)) - { - return; - } - - int lastShieldTime = utils.getIntScriptVar(self, "lastShieldTime"); - - if (getGameTime() - lastShieldTime > 120) - { - utils.setScriptVar(self, "lastShieldTime", getGameTime()); - queueCommand(self, (-2086643447), self, "", COMMAND_PRIORITY_DEFAULT); - } - - setHate(self, target, 5000); - } - - - public int findTarget(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - findNextTarget(self); - - dictionary sessionDict = new dictionary(); - - messageTo(self, "findTarget", sessionDict, 1, false); - - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - findNextTarget(self); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id dungeon = getTopMostContainer(self); - - if (!isIdValid(dungeon)) - { - return SCRIPT_CONTINUE; - } - - dictionary sessionDict = new dictionary(); - - messageTo(self, "colorize", sessionDict, 0.25f, false); - - return SCRIPT_CONTINUE; - } - - - public int colorize(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - hue.setColor(self, hue.INDEX_1, 7); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_kell_lapaz.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_kell_lapaz.java deleted file mode 100644 index 23f39f446..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_kell_lapaz.java +++ /dev/null @@ -1,132 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.chat; -import script.library.hue; -import script.library.trial; -import script.library.utils; - - -public class boss_kell_lapaz extends script.base_script -{ - public boss_kell_lapaz() - { - } - - public void findNextTarget(obj_id self) throws InterruptedException - { - if (ai_lib.isDead(self)) - { - return; - } - - obj_id dungeon = getTopMostContainer(self); - obj_id target = null; - - if (!isIdValid(dungeon)) - { - - return; - } - - obj_id[] targets = trial.getNonStealthedTargetsInCell(dungeon, "r1"); - - if (targets == null || targets.length <= 0) - { - dictionary sessionDict = new dictionary(); - - messageTo(dungeon, "ig88_failed", sessionDict, 0, false); - return; - } - - target = trial.getClosest(self, targets); - - if (!isIdValid(target)) - { - return; - } - - int lastShieldTime = utils.getIntScriptVar(self, "lastShieldTime"); - - if (getGameTime() - lastShieldTime > 120) - { - utils.setScriptVar(self, "lastShieldTime", getGameTime()); - queueCommand(self, (-2086643447), self, "", COMMAND_PRIORITY_DEFAULT); - } - - setHate(self, target, 5000); - } - - - public int findTarget(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - findNextTarget(self); - - dictionary sessionDict = new dictionary(); - - messageTo(self, "findTarget", sessionDict, 1, false); - - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - findNextTarget(self); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id dungeon = getTopMostContainer(self); - - if (!isIdValid(dungeon)) - { - return SCRIPT_CONTINUE; - } - - dictionary sessionDict = new dictionary(); - - messageTo(self, "colorize", sessionDict, 0.25f, false); - - return SCRIPT_CONTINUE; - } - - - public int colorize(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - hue.setColor(self, hue.INDEX_1, 7); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_nyms_girlfriend.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_nyms_girlfriend.java deleted file mode 100644 index a2c6fd7fa..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_nyms_girlfriend.java +++ /dev/null @@ -1,205 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.chat; -import script.library.group; -import script.library.hue; -import script.library.trial; -import script.library.utils; - - -public class boss_nyms_girlfriend extends script.base_script -{ - public boss_nyms_girlfriend() - { - } - public static final int RADIUS = 100; - public static final int MIN_DIST = 20; - - public static final String DISTANCE_CHECK = "distance_check"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitateTarget(obj_id self, obj_id victim) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isDead(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.setDynamicDataOnMob() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - if (getRandomCombatTarget(self, parent)) - { - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.OnIncapacitateTarget() Boss Mob has found someone in the player's group."); - return SCRIPT_CONTINUE; - } - - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isDead(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("quest", "dynamic_mob_opponent.OnExitedCombat() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - if (getRandomCombatTarget(self, parent)) - { - return SCRIPT_CONTINUE; - } - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return SCRIPT_CONTINUE; - } - - - public int handleBossDistanceCheck(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - location currentLoc = getLocation(self); - if (currentLoc == null) - { - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.handleBossDistanceCheck() current boss mob ("+self+") location NULL."); - return SCRIPT_CONTINUE; - } - - location creationLoc = aiGetHomeLocation(self); - if (creationLoc == null) - { - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.handleBossDistanceCheck() creation location for boss mob ("+self+") was NULL."); - return SCRIPT_CONTINUE; - } - - float distanceCheck = utils.getDistance2D(currentLoc, creationLoc); - int maxDist = getIntObjVar(self, DISTANCE_CHECK); - if (maxDist <= 0) - { - maxDist = MIN_DIST; - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.handleBossDistanceCheck() maximum distance from creation location for boss mob ("+self+") was invalid or NULL."); - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("quest", "dynamic_mob_opponent.OnExitedCombat() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - if (distanceCheck > maxDist) - { - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.handleBossDistanceCheck() boss mob ("+self+") has moved too far from creation location. Moving back to creation location."); - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - - } - else - { - messageTo(self, "handleBossDistanceCheck", null, 3, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean getRandomCombatTarget(obj_id self, obj_id parent) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.getRandomCombatTarget() FAILED to find self."); - return false; - } - - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.getRandomCombatTarget() FAILED to find parent object."); - return false; - } - - int maxDist = getIntObjVar(self, DISTANCE_CHECK); - - if (maxDist <= 0) - { - maxDist = MIN_DIST; - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.getRandomCombatTarget() maximum distance from creation location for boss mob ("+self+") was invalid or NULL."); - } - - obj_id[] targets = trial.getValidTargetsInRadiusIgnoreLOS(self, maxDist); - if (targets == null || targets.length == 0) - { - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.getRandomCombatTarget() no targets for boss ("+self+") is: "+maxDist); - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return false; - } - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - if (!isIdValid(targets[i])) - { - continue; - } - - startCombat(self, targets[i]); - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.getRandomCombatTarget(): Player "+ targets[i] + " was found as a valid target. Boss Mob: "+self+" attacking player."); - return true; - } - CustomerServiceLog("outbreak_themepark", "boss_fight_functionality.OnIncapacitateTarget(): Boss Mob: "+self+" failed to find a player to attack."); - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return false; - - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_nyms_themepark.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_nyms_themepark.java deleted file mode 100644 index ec1a5b8a6..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_nyms_themepark.java +++ /dev/null @@ -1,531 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.chat; -import script.library.group; -import script.library.groundquests; -import script.library.hue; -import script.library.trial; -import script.library.utils; - - -public class boss_nyms_themepark extends script.base_script -{ - public boss_nyms_themepark() - { - } - public static final int RADIUS = 100; - public static final int MIN_DIST = 25; - public static final string_id SID_SYS_TOO_FAR = new string_id("spam","too_far_from_spawn_point"); - public static final string_id SID_SYS_ONE_MINUTE_WARNING = new string_id("spam","one_minute_warning_before_despawn"); - - public static final String DISTANCE_CHECK = "distance_check"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "moveCreatureToWaypoint", null, 1, false); - messageTo(self, "checkCombatStatus", null, 1, false); - messageTo(self, "willDespawn", null, 540, false); - - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob "+self+" incapacitated by: "+killer); - - if (!hasObjVar(self, "theme_park_boss")) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "theme_park_boss_slot")) - { - return SCRIPT_CONTINUE; - } - - String bossQuest = getStringObjVar(self, "theme_park_boss"); - if (bossQuest == null || bossQuest.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String bossQuestSlot = getStringObjVar(self, "theme_park_boss_slot"); - if (bossQuestSlot == null || bossQuestSlot.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob slot and quest name data validated. Boss: "+bossQuest+" Slot: "+bossQuestSlot); - - obj_id[] attackerList = utils.getObjIdBatchScriptVar(self, "creditForKills.attackerList.attackers"); - - if (attackerList != null && attackerList.length > 0) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob attackerList = "+attackerList.length); - - for (int i = 0; i < attackerList.length; i++) - { - testAbortScript(); - if (!isIdValid(attackerList[i])) - { - continue; - } - - if (group.isGroupObject(attackerList[i])) - { - obj_id[] members = getGroupMemberIds(attackerList[i]); - - for (int j = 0, k = members.length; j < k; j++) - { - testAbortScript(); - if (isIdValid(members[j])) - { - if (!groundquests.isQuestActive(attackerList[i], bossQuest)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob attacker: "+attackerList[i]+" did not have boss quest: "+bossQuest); - continue; - } - - if (hasCompletedCollectionSlot(attackerList[i], bossQuestSlot)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob attacker: "+attackerList[i]+" has already attained: "+bossQuestSlot); - continue; - } - - if (!hasCompletedCollectionSlotPrereq(attackerList[i], bossQuestSlot)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob attacker: "+attackerList[i]+" hasn't fulfilled the prerequisite for boss slot/: "+bossQuestSlot); - continue; - } - modifyCollectionSlotValue(attackerList[i], bossQuestSlot, 1); - } - } - } - else - { - if (!groundquests.isQuestActive(attackerList[i], bossQuest)) - { - continue; - } - - if (hasCompletedCollectionSlot(attackerList[i], bossQuestSlot)) - { - continue; - } - - if (!hasCompletedCollectionSlotPrereq(attackerList[i], bossQuestSlot)) - { - continue; - } - - modifyCollectionSlotValue(attackerList[i], bossQuestSlot, 1); - } - } - } - - return SCRIPT_CONTINUE; - - } - - - public int OnEnteredCombat(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "shuttle")) - { - return SCRIPT_CONTINUE; - } - - int maxDist = getIntObjVar(self, DISTANCE_CHECK); - if (maxDist <= 0) - { - maxDist = MIN_DIST; - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnEnteredCombat() maximum distance from creation location for boss mob ("+self+") was invalid or NULL."); - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.willDespawn() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - obj_id playerEnemy = utils.getObjIdScriptVar(parent, "waveEventPlayer"); - if (!isIdValid(playerEnemy) || !exists(playerEnemy)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnEnteredCombat() Mob could not find the wave event player: "+playerEnemy); - return SCRIPT_CONTINUE; - } - - obj_id[] players = getPlayerCreaturesInRange(self, maxDist); - if (players != null && players.length > 0) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - if (!isIdValid(players[i]) && !exists(players[i]) || isIncapacitated(players[i]) || !isDead(players[i])) - { - continue; - } - - addHate(self, players[i], 1000.0f); - startCombat(self, players[i]); - } - } - - messageTo(self, "handleBossDistanceCheck", null, 3, false); - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitateTarget(obj_id self, obj_id victim) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "shuttle")) - { - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnIncapacitateTarget() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - if (getRandomCombatTarget(self, parent)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnIncapacitateTarget() Boss Mob has found someone in the player's group."); - return SCRIPT_CONTINUE; - } - - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "shuttle")) - { - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("quest", "boss_nyms_themepark.OnExitedCombat() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - if (getRandomCombatTarget(self, parent)) - { - return SCRIPT_CONTINUE; - } - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return SCRIPT_CONTINUE; - } - - - public int handleBossDistanceCheck(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!ai_lib.isInCombat(self)) - { - messageTo(self, "checkCombatStatus", null, 0, false); - return SCRIPT_CONTINUE; - } - - location currentLoc = getLocation(self); - if (currentLoc == null) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.handleBossDistanceCheck() current boss mob ("+self+") location NULL."); - return SCRIPT_CONTINUE; - } - - location creationLoc = aiGetHomeLocation(self); - if (creationLoc == null) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.handleBossDistanceCheck() creation location for boss mob ("+self+") was NULL."); - return SCRIPT_CONTINUE; - } - - float distanceCheck = utils.getDistance2D(currentLoc, creationLoc); - int maxDist = getIntObjVar(self, DISTANCE_CHECK); - if (maxDist <= 0) - { - maxDist = MIN_DIST; - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.handleBossDistanceCheck() maximum distance from creation location for boss mob ("+self+") was invalid or NULL."); - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("quest", "boss_nyms_themepark.handleBossDistanceCheck() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - if (distanceCheck > maxDist) - { - - obj_id playerEnemy = utils.getObjIdScriptVar(parent, "waveEventPlayer"); - if (isIdValid(playerEnemy) && exists(playerEnemy)) - { - sendSystemMessage(playerEnemy, SID_SYS_TOO_FAR); - - obj_id myGroup = getGroupObject(playerEnemy); - if (isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for (int i = 0; i < members.length; i++) - { - testAbortScript(); - if (!isIdValid(members[i])) - { - continue; - } - - sendSystemMessage(members[i], SID_SYS_TOO_FAR); - } - } - } - - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.handleBossDistanceCheck() boss mob ("+self+") has moved too far from creation location. Moving back to creation location."); - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - - } - else - { - messageTo(self, "handleBossDistanceCheck", null, 3, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean getRandomCombatTarget(obj_id self, obj_id parent) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget() FAILED to find self."); - return false; - } - - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget() FAILED to find parent object."); - return false; - } - - int maxDist = getIntObjVar(self, DISTANCE_CHECK); - - if (maxDist <= 0) - { - maxDist = MIN_DIST; - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget() maximum distance from creation location for boss mob ("+self+") was invalid or NULL."); - } - - obj_id[] targets = trial.getValidTargetsInRadiusIgnoreLOS(self, maxDist); - if (targets == null || targets.length == 0) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget() no targets for boss ("+self+") is: "+maxDist); - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return false; - } - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - if (!isIdValid(targets[i])) - { - continue; - } - - if (!isPlayer(targets[i])) - { - continue; - } - - startCombat(self, targets[i]); - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget(): Player "+ targets[i] + " was found as a valid target. Boss Mob: "+self+" attacking player."); - return true; - } - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget(): Boss Mob: "+self+" failed to find a player to attack."); - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return false; - - } - - - public int moveCreatureToWaypoint(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if ((!hasObjVar(self, "arena") && !hasObjVar(self, "shuttle") && !hasObjVar(self, "henchmen"))) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "arena")) - { - location startPos = new location(472.5f, 34.4f, 4815.6f, "lok", null); - - setLocation(self, startPos); - aiSetHomeLocation(self, startPos); - setYaw(self, 160.0f); - } - if (hasObjVar(self, "shuttle")) - { - location locCenter = new location(473.0f, 12.0f, 4868.0f, "lok", null); - location locDestination = utils.getRandomLocationInRing(locCenter, 4.0f, 6.0f); - setLocation(self, locDestination); - aiSetHomeLocation(self, locDestination); - } - if (hasObjVar(self, "henchmen")) - { - location locCenter = getLocation(self); - location locDestination = utils.getRandomLocationInRing(locCenter, 4.0f, 6.0f); - setLocation(self, locDestination); - aiSetHomeLocation(self, locDestination); - } - return SCRIPT_CONTINUE; - } - - - public int checkCombatStatus(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isInCombat(self)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.checkCombatStatus(): Boss Mob: "+self+" is already in combat."); - - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, "parent"); - if (isIdValid(parent)) - { - if (getRandomCombatTarget(self, parent)) - { - return SCRIPT_CONTINUE; - } - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - } - return SCRIPT_CONTINUE; - } - - - public int willDespawn(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (!ai_lib.isInCombat(self)) - { - messageTo(self, "checkCombatStatus", null, 0, false); - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.willDespawn() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - obj_id playerEnemy = utils.getObjIdScriptVar(parent, "waveEventPlayer"); - if (isIdValid(playerEnemy) && exists(playerEnemy)) - { - sendSystemMessage(playerEnemy, SID_SYS_ONE_MINUTE_WARNING); - - obj_id myGroup = getGroupObject(playerEnemy); - if (isValidId(myGroup)) - { - obj_id[] members = getGroupMemberIds(myGroup); - - for (int i = 0; i < members.length; i++) - { - testAbortScript(); - if (!isIdValid(members[i])) - { - continue; - } - - sendSystemMessage(members[i], SID_SYS_ONE_MINUTE_WARNING); - } - } - - } - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_udo_barnet.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_udo_barnet.java deleted file mode 100644 index 4f4f2f5a9..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/boss_udo_barnet.java +++ /dev/null @@ -1,132 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.chat; -import script.library.hue; -import script.library.trial; -import script.library.utils; - - -public class boss_udo_barnet extends script.base_script -{ - public boss_udo_barnet() - { - } - - public void findNextTarget(obj_id self) throws InterruptedException - { - if (ai_lib.isDead(self)) - { - return; - } - - obj_id dungeon = getTopMostContainer(self); - obj_id target = null; - - if (!isIdValid(dungeon)) - { - - return; - } - - obj_id[] targets = trial.getNonStealthedTargetsInCell(dungeon, "r1"); - - if (targets == null || targets.length <= 0) - { - dictionary sessionDict = new dictionary(); - - messageTo(dungeon, "ig88_failed", sessionDict, 0, false); - return; - } - - target = trial.getClosest(self, targets); - - if (!isIdValid(target)) - { - return; - } - - int lastShieldTime = utils.getIntScriptVar(self, "lastShieldTime"); - - if (getGameTime() - lastShieldTime > 120) - { - utils.setScriptVar(self, "lastShieldTime", getGameTime()); - queueCommand(self, (-2086643447), self, "", COMMAND_PRIORITY_DEFAULT); - } - - setHate(self, target, 5000); - } - - - public int findTarget(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - findNextTarget(self); - - dictionary sessionDict = new dictionary(); - - messageTo(self, "findTarget", sessionDict, 1, false); - - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - findNextTarget(self); - - return SCRIPT_CONTINUE; - } - - - public int OnAttach(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id dungeon = getTopMostContainer(self); - - if (!isIdValid(dungeon)) - { - return SCRIPT_CONTINUE; - } - - dictionary sessionDict = new dictionary(); - - messageTo(self, "colorize", sessionDict, 0.25f, false); - - return SCRIPT_CONTINUE; - } - - - public int colorize(obj_id self, dictionary params) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - hue.setColor(self, hue.INDEX_1, 7); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/cave_hacker.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/cave_hacker.java deleted file mode 100644 index 14b898def..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/cave_hacker.java +++ /dev/null @@ -1,345 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.money; - - -public class cave_hacker extends script.base_script -{ - public cave_hacker() - { - } - public static final String CONVO = "celebrity/lok_hacker"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - setName (self, "Hacker"); - ai_lib.setDefaultCalmBehavior( self, ai_lib.BEHAVIOR_SENTINEL ); - attachScript (self, "npc.converse.npc_converse_menu"); - setInvulnerable (self, true); - return SCRIPT_CONTINUE; - } - - - public int OnStartNpcConversation(obj_id self, obj_id speaker) throws InterruptedException - { - if (hasObjVar (speaker, "nym.kole.hack")) - { - string_id greeting = new string_id (CONVO,"doors_open"); - string_id response[] = new string_id[1]; - response[0] = new string_id (CONVO, "right"); - npcStartConversation (speaker, self, "celebConvo", greeting, response); - } - else - { - string_id greeting = new string_id (CONVO,"help_me_hack"); - string_id response[] = new string_id[2]; - response[0] = new string_id (CONVO, "what_are_you_doing"); - response[1] = new string_id (CONVO,"what_do_you_need"); - npcStartConversation (speaker, self, "celebConvo", greeting, response); - } - - return SCRIPT_CONTINUE; - } - - - public int OnNpcConversationResponse(obj_id self, String convo, obj_id speaker, string_id response) throws InterruptedException - { - if (response.getAsciiId().equals("what_are_you_doing")) - { - string_id message = new string_id (CONVO, "hacking"); - npcSpeak (speaker, message); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "what_are_you_doing")); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("what_do_you_need")) - { - string_id message = new string_id (CONVO, "cant_solve"); - - npcSpeak(speaker, message); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "what_do_you_need")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "what_are_you_doing")); - npcAddConversationResponse ( speaker, new string_id (CONVO, "helpful")); - npcAddConversationResponse ( speaker, new string_id (CONVO, "going_away")); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("helpful")) - { - string_id message = new string_id (CONVO, "explain"); - npcSpeak (speaker, message); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "helpful")); - - if (!hasObjVar (speaker, "nym.kole.codec")) - { - npcAddConversationResponse ( speaker, new string_id (CONVO, "codec")); - } - - if (!hasObjVar (speaker, "nym.kole.rewire")) - { - npcAddConversationResponse ( speaker, new string_id (CONVO, "rewire")); - } - - if (!hasObjVar (speaker, "nym.kole.defender")) - { - npcAddConversationResponse ( speaker, new string_id (CONVO, "defender")); - } - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("going_away")) - { - string_id message = new string_id (CONVO, "jerk"); - npcSpeak (speaker, message); - npcEndConversation(speaker); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("codec")) - { - string_id message = new string_id (CONVO, "color_codes"); - npcSpeak (speaker, message); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "codec")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "rewire")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "defender")); - npcAddConversationResponse ( speaker, new string_id (CONVO, "purple")); - npcAddConversationResponse ( speaker, new string_id (CONVO, "brown")); - npcAddConversationResponse ( speaker, new string_id (CONVO, "orange")); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("rewire")) - { - string_id message = new string_id (CONVO, "math_problem"); - npcSpeak (speaker, message); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "codec")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "rewire")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "defender")); - npcAddConversationResponse(speaker, new string_id (CONVO, "seven_twenty")); - npcAddConversationResponse(speaker, new string_id (CONVO, "two_twenty")); - npcAddConversationResponse(speaker, new string_id (CONVO, "nine")); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("defender")) - { - string_id message = new string_id (CONVO, "joke"); - npcSpeak (speaker, message); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "codec")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "rewire")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "defender")); - npcAddConversationResponse(speaker, new string_id (CONVO, "punchline")); - npcAddConversationResponse(speaker, new string_id (CONVO, "wrong_joke")); - npcAddConversationResponse(speaker, new string_id (CONVO, "bad_joke")); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("purple")) - { - string_id message = new string_id (CONVO, "wrong_color"); - npcSpeak (speaker, message); - npcEndConversation(speaker); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("brown")) - { - string_id message = new string_id (CONVO, "wrong_color"); - npcSpeak (speaker, message); - npcEndConversation(speaker); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("wrong_joke")) - { - string_id message = new string_id (CONVO, "not_funny"); - npcSpeak (speaker, message); - npcEndConversation(speaker); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("bad_joke")) - { - string_id message = new string_id (CONVO, "not_funny"); - npcSpeak (speaker, message); - npcEndConversation(speaker); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("two_twenty")) - { - string_id message = new string_id (CONVO, "wrong_answer"); - npcSpeak (speaker, message); - npcEndConversation(speaker); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("nine")) - { - string_id message = new string_id (CONVO, "wrong_answer"); - npcSpeak (speaker, message); - npcEndConversation(speaker); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("rewire_2")) - { - string_id message = new string_id (CONVO, "math_problem"); - npcSpeak (speaker, message); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "defender_2")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "codec_2")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "rewire_2")); - npcAddConversationResponse(speaker, new string_id (CONVO, "seven_twenty")); - npcAddConversationResponse(speaker, new string_id (CONVO, "two_twenty")); - npcAddConversationResponse(speaker, new string_id (CONVO, "nine")); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("codec_2")) - { - string_id message = new string_id (CONVO, "color_codes"); - npcSpeak (speaker, message); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "codec_2")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "rewire_2")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "defender_2")); - npcAddConversationResponse ( speaker, new string_id (CONVO, "purple")); - npcAddConversationResponse ( speaker, new string_id (CONVO, "brown")); - npcAddConversationResponse ( speaker, new string_id (CONVO, "orange")); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("defender_2")) - { - string_id message = new string_id (CONVO, "joke"); - npcSpeak (speaker, message); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "codec_2")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "rewire_2")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "defender_2")); - npcAddConversationResponse(speaker, new string_id (CONVO, "punchline")); - npcAddConversationResponse(speaker, new string_id (CONVO, "wrong_joke")); - npcAddConversationResponse(speaker, new string_id (CONVO, "bad_joke")); - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("seven_twenty")) - { - string_id message = new string_id (CONVO, "right_answer"); - setObjVar (speaker, "nym.kole.rewire", 1); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "seven_twenty")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "two_twenty")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "nine")); - if (!hasObjVar (speaker, "nym.kole.codec")) - { - npcAddConversationResponse(speaker, new string_id (CONVO, "codec_2")); - } - - if (!hasObjVar (speaker, "nym.kole.defender")) - { - npcAddConversationResponse(speaker, new string_id (CONVO, "defender_2")); - } - - if (hasObjVar (speaker, "nym.kole.defender") && hasObjVar (speaker, "nym.kole.codec")) - { - message = new string_id (CONVO, "success"); - setObjVar (speaker, "nym.kole.hack", 1); - removeObjVar (speaker, "nym.kole.defender"); - removeObjVar (speaker, "nym.kole.rewire"); - removeObjVar (speaker, "nym.kole.codec"); - npcSpeak(speaker, message); - npcEndConversation(speaker); - } - else - { - npcSpeak (speaker, message); - } - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("punchline")) - { - string_id message = new string_id (CONVO, "right_joke"); - setObjVar (speaker, "nym.kole.defender", 1); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "punchline")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "wrong_joke")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "bad_joke")); - if (!hasObjVar (speaker, "nym.kole.rewire")) - { - npcAddConversationResponse(speaker, new string_id (CONVO, "rewire_2")); - } - - if (!hasObjVar (speaker, "nym.kole.codec")) - { - npcAddConversationResponse(speaker, new string_id (CONVO, "codec_2")); - } - - if (hasObjVar (speaker, "nym.kole.codec") && hasObjVar (speaker, "nym.kole.rewire")) - { - message = new string_id (CONVO, "success"); - setObjVar (speaker, "nym.kole.hack", 1); - removeObjVar (speaker, "nym.kole.defender"); - removeObjVar (speaker, "nym.kole.rewire"); - removeObjVar (speaker, "nym.kole.codec"); - npcSpeak(speaker, message); - npcEndConversation(speaker); - } - else - { - npcSpeak (speaker, message); - } - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("orange")) - { - string_id message = new string_id (CONVO, "right_color"); - setObjVar (speaker, "nym.kole.codec", 1); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "purple")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "orange")); - npcRemoveConversationResponse ( speaker, new string_id (CONVO, "brown")); - if (!hasObjVar (speaker, "nym.kole.rewire")) - { - npcAddConversationResponse(speaker, new string_id (CONVO, "rewire_2")); - } - - if (!hasObjVar (speaker, "nym.kole.defender")) - { - npcAddConversationResponse(speaker, new string_id (CONVO, "defender_2")); - } - - if (hasObjVar (speaker, "nym.kole.defender") && hasObjVar (speaker, "nym.kole.rewire")) - { - message = new string_id (CONVO, "success"); - setObjVar (speaker, "nym.kole.hack", 1); - removeObjVar (speaker, "nym.kole.defender"); - removeObjVar (speaker, "nym.kole.rewire"); - removeObjVar (speaker, "nym.kole.codec"); - npcSpeak(speaker, message); - npcEndConversation(speaker); - } - else - { - npcSpeak (speaker, message); - } - return SCRIPT_CONTINUE; - } - - if (response.getAsciiId().equals("right")) - { - string_id message = new string_id (CONVO, "go_man_go"); - npcSpeak(speaker, message); - npcEndConversation (speaker); - return SCRIPT_CONTINUE; - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/computer.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/computer.java deleted file mode 100644 index cc9afe733..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/computer.java +++ /dev/null @@ -1,64 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.permissions; -import script.library.groundquests; - - -public class computer extends script.base_script -{ - public computer() - { - } - public static final String STF_FILE = "theme_park_nym/messages"; - public static final string_id RETRIEVE = new string_id("celebrity/nym", "retrieve_hard_drive"); - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - item.addRootMenu(menu_info_types.ITEM_USE, RETRIEVE); - return SCRIPT_CONTINUE; - } - - - public int makeNewDrive(obj_id self, dictionary params) throws InterruptedException - { - obj_id filter = createObject ("", self, ""); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, "u16_nym_themepark_research_facility", "getResearchData")) - { - sendSystemMessage(player, new string_id("quest/groundquests", "retrieve_item_no_interest")); - } - - groundquests.sendSignal(player, "hasReceivedResearchData"); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (hasScript(self, "item.container.base.base_container")) - { - detachScript(self, "item.container.base.base_container"); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave.java deleted file mode 100644 index c1ef2f0af..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave.java +++ /dev/null @@ -1,262 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.create; -import script.library.spawning; -import script.library.utils; - - -public class droid_cave extends script.base_script -{ - public droid_cave() - { - } - public static final String NYM_OBJECT_DATATABLE = "datatables/spawning/theme_park/nym_droid_cave_objects.iff"; - public static final String SPAWNER_DATATABLE = "datatables/spawning/theme_park/nym_droid_cave.iff"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "spawnQuestObjects", null, 3, false); - messageTo(self, "beginSpawnEnemies", null, 3, false); - - return SCRIPT_CONTINUE; - } - - - public int spawnQuestObjects(obj_id self, dictionary params) throws InterruptedException - { - obj_id living = getCellId (self, "r28"); - if (!isValidId(living)) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", droid_cave.spawnNonMobile handler could not find the cell named 'r28'"); - return SCRIPT_CONTINUE; - } - - attachScript (living, "theme_park.nym.droid_cave_gate"); - - obj_id foyer = getCellId (self, "r25"); - if (!isValidId(foyer)) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", droid_cave.spawnNonMobile handler could not find the cell named 'r25'"); - return SCRIPT_CONTINUE; - } - - location hackerLoc = new location (-62.52f, -65.80f, -142.43f, "lok", foyer); - - obj_id hacker = create.object("nym_themepark_slicer", hackerLoc); - setYaw (hacker, 74); - - ai_lib.setCustomIdleAnimation(hacker, "manipulate_medium"); - - if (!utils.hasScriptVar(self, "planet")) - { - location myself = getLocation(self); - String planet = myself.area; - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name from location."); - return SCRIPT_CONTINUE; - } - utils.setScriptVar(self, "planet", planet); - - } - - String planet = utils.getStringScriptVar(self, "planet"); - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name script var."); - return SCRIPT_CONTINUE; - } - - spawning.spawnObjectsInDungeonFromTable(self, planet, NYM_OBJECT_DATATABLE); - return SCRIPT_CONTINUE; - } - - - public int beginSpawnEnemies(obj_id self, dictionary params) throws InterruptedException - { - int numberOfCreaturesToSpawn = dataTableGetNumRows(SPAWNER_DATATABLE); - if (numberOfCreaturesToSpawn < 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", droid_cave.beginSpawnEnemies handler could not open datatables/spawning/theme_park/nym_droid_cave.iff"); - return SCRIPT_CONTINUE; - } - - int x = 0; - if (utils.hasScriptVar(self, "spawnCounter")) - { - x = utils.getIntScriptVar (self, "spawnCounter"); - } - - String spawn = dataTableGetString (SPAWNER_DATATABLE, x, "spawns"); - - float xCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_x"); - float yCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_y"); - float zCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_z"); - - if (!utils.hasScriptVar(self, "planet")) - { - location myself = getLocation(self); - String planet = myself.area; - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet Name from location."); - return SCRIPT_CONTINUE; - } - utils.setScriptVar(self, "planet", planet); - - } - - String planet = utils.getStringScriptVar(self, "planet"); - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name script var."); - return SCRIPT_CONTINUE; - } - - String spawnRoom = dataTableGetString (SPAWNER_DATATABLE, x, "room"); - obj_id room = getCellId (self, spawnRoom); - - if (!isIdValid (room) || (spawnRoom == null || spawnRoom.equals("")) && !spawnRoom.equals("world")) - { - CustomerServiceLog("bad_spawner_data", "spawner "+ self + ", datatable "+ SPAWNER_DATATABLE + ", row "+ x + ", mob "+ spawn + ", room "+ spawnRoom + " doesn't exist"); - } - else - { - location spawnPoint = new location (xCoord, yCoord, zCoord, planet, room); - - obj_id spawnedCreature = create.object (spawn, spawnPoint); - - String geoScript = dataTableGetString (SPAWNER_DATATABLE, x, "script"); - - if (geoScript != null && !geoScript.equals("")) - { - - attachScript (spawnedCreature, geoScript); - } - - String creatureName = dataTableGetString (SPAWNER_DATATABLE, x, "name"); - - if (creatureName != null && !creatureName.equals("")) - { - setName (spawnedCreature, creatureName); - } - - setObjVar (spawnedCreature, "spawn_number", x); - setObjVar (spawnedCreature, "mom", self ); - utils.setScriptVar (self, "spawned"+ x, spawnedCreature); - } - - x = x + 1; - utils.setScriptVar (self, "spawnCounter", x); - - if (x < numberOfCreaturesToSpawn) - { - messageTo(self, "beginSpawnEnemies", null, 1, false ); - } - - return SCRIPT_CONTINUE; - } - - - public int tellingMomIDied(obj_id self, dictionary params) throws InterruptedException - { - LOG("nym_elite_log","droid cave NPC: "+self+" tellingMomIDied init"); - - if (params == null) - { - CustomerServiceLog("bad_spawner_data", "Nym Pirate Cave Spawner Failed for "+self+" dungeon. Could not retrieve params from NPC messageTo."); - return SCRIPT_CONTINUE; - } - - int spawn_num = params.getInt ("spawnNumber"); - if (spawn_num <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Pirate Cave Spawner Failed for "+self+" dungeon. Could not retrieve NPC spawnNum from Params."); - return SCRIPT_CONTINUE; - } - - obj_id spawn_mob = params.getObjId ("spawnMob"); - - if (utils.hasScriptVar (self, "spawned" + spawn_num) && (spawn_mob == utils.getObjIdScriptVar (self, "spawned" + spawn_num))) - { - LOG("nym_elite_log","droid cave NPC: "+self+" spawning NPC correctly"); - - doSpawn (spawn_num); - } - return SCRIPT_CONTINUE; - } - - - public void doSpawn(int spawn_num) throws InterruptedException - { - obj_id self = getSelf(); - if (!isValidId(self)) - { - CustomerServiceLog("bad_spawner_data", "droid_cave.doSpawn - Nym Pirate Cave Spawner Failed.Could not retrieve Cave OID."); - return; - } - - int numberOfCreaturesToSpawn = dataTableGetNumRows(SPAWNER_DATATABLE); - if (numberOfCreaturesToSpawn < 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", droid_cave.beginSpawnEnemies handler could not open datatables/spawning/theme_park/nym_droid_cave.iff"); - return; - } - - int x = spawn_num; - - String spawn = dataTableGetString (SPAWNER_DATATABLE, x, "spawns"); - - float xCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_x"); - float yCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_y"); - float zCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_z"); - - location myself = getLocation (self); - String planet = myself.area; - - String spawnRoom = dataTableGetString (SPAWNER_DATATABLE, x, "room"); - obj_id room = getCellId (self, spawnRoom); - - if (!isIdValid (room) && !spawnRoom.equals("world")) - { - CustomerServiceLog("bad_spawner_data", "spawner "+ self + ", datatable "+ SPAWNER_DATATABLE + ", row "+ x + ", mob "+ spawn + ", room "+ spawnRoom + " doesn't exist"); - utils.removeScriptVar (self, "spawned"+ x); - return; - } - - location spawnPoint = new location (xCoord, yCoord, zCoord, planet, room); - - obj_id spawnedCreature = create.object (spawn, spawnPoint); - - String geoScript = dataTableGetString (SPAWNER_DATATABLE, x, "script"); - - if (geoScript != null && !geoScript.equals("")) - { - - attachScript (spawnedCreature, geoScript); - } - - String creatureName = dataTableGetString (SPAWNER_DATATABLE, x, "name"); - - if (creatureName != null && !creatureName.equals("")) - { - setName (spawnedCreature, creatureName); - } - - setObjVar (spawnedCreature, "spawn_number", x); - setObjVar (spawnedCreature, "mom", self ); - utils.setScriptVar (self, "spawned"+ x, spawnedCreature); - - return; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_collectible.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_collectible.java deleted file mode 100644 index 5e750421a..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_collectible.java +++ /dev/null @@ -1,65 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.groundquests; -import script.library.utils; -import script.library.permissions; - - -public class droid_cave_collectible extends script.base_script -{ - public droid_cave_collectible() - { - } - public static final String STF_FILE = "pet/droid_modules"; - public static final string_id RETRIEVE = new string_id("celebrity/jinkins", "retrieve"); - - - public int makeNewModule(obj_id self, dictionary params) throws InterruptedException - { - obj_id module = createObject ("object/tangible/loot/quest/nym_droid_memory_chip.iff", self, ""); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - item.addRootMenu(menu_info_types.ITEM_USE, RETRIEVE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "findDroidDisk")) - { - sendSystemMessage(player, new string_id("quest/groundquests", "retrieve_item_no_interest")); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, "hasFoundDroidDisk"); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (hasScript(self, "item.container.base.base_container")) - { - detachScript(self, "item.container.base.base_container"); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_died.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_died.java deleted file mode 100644 index e37ffa92c..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_died.java +++ /dev/null @@ -1,43 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -public class droid_cave_died extends script.base_script -{ - public droid_cave_died() - { - } - - public int OnDestroy(obj_id self) throws InterruptedException - { - obj_id mom = getObjIdObjVar (self, "mom"); - if (!isValidId(mom)) - { - CustomerServiceLog("bad_spawner_data", "droid_cave_died.OnIncapacitated() Nym Pirate Cave Spawner Failed. Could not retrieve Cave OID to respawn the NPC."); - return SCRIPT_CONTINUE; - } - - int spawnNum = getIntObjVar (self, "spawn_number"); - if (spawnNum <= 0) - { - CustomerServiceLog("bad_spawner_data", "droid_cave_died.OnIncapacitated() Nym Pirate Cave Spawner Failed. Could not retrieve NPC spawnNum from NPC Object."); - return SCRIPT_CONTINUE; - } - - dictionary info = new dictionary(); - info.put ("spawnNumber", spawnNum ); - info.put ("spawnMob", self ); - - int respawn = rand(120,200); - - messageTo(mom, "tellingMomIDied", info, respawn, false ); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_gate.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_gate.java deleted file mode 100644 index f7163c5ad..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_gate.java +++ /dev/null @@ -1,39 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.groundquests; - - -public class droid_cave_gate extends script.base_script -{ - public droid_cave_gate() - { - } - - public int OnAboutToReceiveItem(obj_id self, obj_id destinationCell, obj_id transferrer, obj_id item) throws InterruptedException - { - if (!isPlayer (item)) - { - return SCRIPT_CONTINUE; - } - - if ((!groundquests.isTaskActive(item, "u16_nym_themepark_pirate_hideout", "findDroidDisk") && !groundquests.isTaskActive(item, "u16_nym_themepark_pirate_hideout", "returnPirateComplete") && !groundquests.hasCompletedQuest(item, "u16_nym_themepark_pirate_hideout"))) - { - string_id warning = new string_id ("theme_park_nym/messages","hack_computer"); - sendSystemMessage (item, warning); - return SCRIPT_OVERRIDE; - } - - else - { - return SCRIPT_CONTINUE; - } - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_prisoner.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_prisoner.java deleted file mode 100644 index 6e086a5d2..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_cave_prisoner.java +++ /dev/null @@ -1,109 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.groundquests; -import script.library.utils; - - -public class droid_cave_prisoner extends script.base_script -{ - public droid_cave_prisoner() - { - } - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - failRescueQuest(self); - tellMomIDied(self); - return SCRIPT_CONTINUE; - } - - - public int handleUpdatePrisonerRescueQuest(obj_id self, dictionary params) throws InterruptedException - { - obj_id player = getObjIdObjVar(self, "player"); - if (!isValidId(player)) - { - messageTo(self, "handleDestroySelf", null, 1, false); - return SCRIPT_CONTINUE; - } - - String signal = getStringObjVar(self, "signal"); - if (signal == null || signal.length() <= 0) - { - messageTo(self, "handleDestroySelf", null, 1, false); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, signal); - messageTo(self, "handleDestroySelf", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public int handleDestroySelf(obj_id self, dictionary params) throws InterruptedException - { - tellMomIDied(self); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public boolean tellMomIDied(obj_id self) throws InterruptedException - { - if (!isValidId(self)) - { - return false; - } - - obj_id mom = getObjIdObjVar (self, "mom"); - if (!isValidId(mom)) - { - CustomerServiceLog("bad_spawner_data", "droid_cave_died.OnIncapacitated() Nym Pirate Cave Spawner Failed. Could not retrieve Cave OID to respawn the NPC."); - return false; - } - - int spawnNum = getIntObjVar (self, "spawn_number"); - if (spawnNum <= 0) - { - CustomerServiceLog("bad_spawner_data", "droid_cave_died.OnIncapacitated() Nym Pirate Cave Spawner Failed. Could not retrieve NPC spawnNum from NPC Object."); - return false; - } - - dictionary info = new dictionary(); - info.put ("spawnNumber", spawnNum ); - info.put ("spawnMob", self ); - - messageTo(mom, "tellingMomIDied", info, 120, false ); - return true; - } - - - public boolean failRescueQuest(obj_id self) throws InterruptedException - { - obj_id player = getObjIdObjVar(self, "player"); - if (!isValidId(player)) - { - messageTo(self, "handleDestroySelf", null, 1, false); - return false; - } - - String failSignal = getStringObjVar(self, "failSignal"); - if (failSignal == null || failSignal.length() <= 0) - { - messageTo(self, "handleDestroySelf", null, 1, false); - return false; - } - - groundquests.sendSignal(player, failSignal); - messageTo(self, "handleDestroySelf", null, 1, false); - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_module.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_module.java deleted file mode 100644 index 7a874d647..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/droid_module.java +++ /dev/null @@ -1,65 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.groundquests; -import script.library.utils; -import script.library.permissions; - - -public class droid_module extends script.base_script -{ - public droid_module() - { - } - public static final String STF_FILE = "pet/droid_modules"; - public static final string_id RETRIEVE = new string_id("celebrity/jinkins", "retrieve"); - - - public int makeNewModule(obj_id self, dictionary params) throws InterruptedException - { - obj_id module = createObject ("object/tangible/loot/quest/nym_droid_memory_chip.iff", self, ""); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - item.addRootMenu(menu_info_types.ITEM_USE, RETRIEVE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "findDroidDisk")) - { - sendSystemMessage(player, new string_id("quest/groundquests", "retrieve_item_no_interest")); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, "hasFoundDroidDisk"); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (hasScript(self, "item.container.base.base_container")) - { - detachScript(self, "item.container.base.base_container"); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/dumpster_quest_object.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/dumpster_quest_object.java deleted file mode 100644 index fe066ea1c..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/dumpster_quest_object.java +++ /dev/null @@ -1,192 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.pclib; -import script.library.pet_lib; -import script.library.static_item; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class dumpster_quest_object extends script.base_script -{ - public dumpster_quest_object() - { - } - public static final String QUEST_NAME = "u16_nym_themepark_weed_pulling"; - public static final String QUEST_TASK = "disposeOfWeeds"; - public static final String QUEST_SIGNAL = "hasDisposedOfWeeds"; - - public static final String THEMEPARK = "theme_park_nym/messages"; - - public static final string_id SID_NOT_WHILE_MOUNTED = new string_id(THEMEPARK, "dispose_weed_not_while_mounted"); - public static final string_id SID_ZIP_BAR = new string_id(THEMEPARK, "dispose_weed_zip_bar"); - public static final string_id SID_MNU_USE = new string_id(THEMEPARK, "dispose_weed"); - public static final string_id SID_NOT_SURE_HOW_DESTROY = new string_id(THEMEPARK, "dispose_weed_not_sure_what_to_do"); - public static final string_id SID_ALRDY_COMPLETED_QUEST = new string_id(THEMEPARK, "dispose_weed_already_completed_quest"); - - public static final int COUNTDOWN_TIMER = 3; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - int mnu2 = mi.addRootMenu (menu_info_types.ITEM_USE, SID_MNU_USE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (pet_lib.isMounted(player)) - { - sendSystemMessage(player, SID_NOT_WHILE_MOUNTED); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(player, QUEST_NAME)) - { - sendSystemMessage(player, SID_NOT_SURE_HOW_DESTROY); - CustomerServiceLog("nyms_themepark", "weed_quest_object.OnObjectMenuSelect() Player: "+player+" did not have the quest "+QUEST_NAME+" needed for this collection. canister: ("+self); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, QUEST_NAME, QUEST_TASK)) - { - sendSystemMessage(player, SID_NOT_SURE_HOW_DESTROY); - CustomerServiceLog("nyms_themepark", "weed_quest_object.OnObjectMenuSelect() Player: "+player+" did not have the quest "+QUEST_NAME+" needed for this collection. canister: ("+self); - return SCRIPT_CONTINUE; - } - - int startTime = 0; - int range = 3; - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - - stealth.testInvisNonCombatAction(player, self); - int countdownSui = sui.smartCountdownTimerSUI(self, player, "quest_countdown_timer", SID_ZIP_BAR, startTime, COUNTDOWN_TIMER, "handleObjectSwapTimer", range, flags); - CustomerServiceLog("nyms_themepark", "weed_quest_object.OnObjectMenuSelect() Player: "+player+" is destroying blackwing canister: "+self); - - return SCRIPT_CONTINUE; - } - - - public int handleObjectSwapTimer(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - obj_id player = params.getObjId("player"); - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - CustomerServiceLog("nyms_themepark", "weed_quest_object.handleObjectSwapTimer() cancelled"); - - return SCRIPT_CONTINUE; - } - - else if (bp == sui.BP_REVERT) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.handleObjectSwapTimer() Player: "+player+" failed to destroy the canister because the player moved or was disrupted. Deposit: "+self); - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_locomotion")); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_incapacitated")); - } - else if (event == sui.CD_EVENT_DAMAGED) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_damaged")); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR)) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.handleObjectSwapTimer() no countdowntimer"); - return SCRIPT_CONTINUE; - } - - int test_pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.handleObjectSwapTimer() pid != test_pid"); - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - if (!groundquests.isTaskActive(player, QUEST_NAME, QUEST_TASK)) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.handleObjectSwapTimer() Player: "+player+" did not have the quest "+QUEST_NAME+" needed for this collection. canister: ("+self); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, QUEST_SIGNAL); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/gas_filter.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/gas_filter.java deleted file mode 100644 index 551df2867..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/gas_filter.java +++ /dev/null @@ -1,66 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.groundquests; -import script.library.permissions; -import script.library.utils; - - -public class gas_filter extends script.base_script -{ - public gas_filter() - { - } - public static final String STF_FILE = "theme_park_nym/messages"; - public static final string_id RETRIEVE = new string_id("celebrity/kole", "retrieve"); - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - item.addRootMenu(menu_info_types.ITEM_USE, RETRIEVE); - return SCRIPT_CONTINUE; - } - - - public int makeNewModule(obj_id self, dictionary params) throws InterruptedException - { - obj_id filter = createObject ("object/tangible/loot/quest/nym_filtered_gas.iff", self, ""); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, "u16_nym_themepark_mine", "findFiltrationSystem")) - { - sendSystemMessage(player, new string_id("quest/groundquests", "retrieve_item_no_interest")); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, "hasFoundFiltrationSystem"); - - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (hasScript(self, "item.container.base.base_container")) - { - detachScript(self, "item.container.base.base_container"); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/grenade_crate.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/grenade_crate.java deleted file mode 100644 index a3885791d..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/grenade_crate.java +++ /dev/null @@ -1,64 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.utils; -import script.library.permissions; -import script.library.groundquests; - - -public class grenade_crate extends script.base_script -{ - public grenade_crate() - { - } - public static final String STF_FILE = "theme_park_nym/messages"; - public static final string_id RETRIEVE = new string_id("celebrity/nym", "retrieve_grenade"); - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - item.addRootMenu(menu_info_types.ITEM_USE, RETRIEVE); - return SCRIPT_CONTINUE; - } - - - public int makeNewGrenade(obj_id self, dictionary params) throws InterruptedException - { - obj_id filter = createObject ("", self, ""); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, "u16_nym_themepark_research_facility", "findIMGGCU")) - { - sendSystemMessage(player, new string_id("quest/groundquests", "retrieve_item_no_interest")); - } - - groundquests.sendSignal(player, "hasFoundIMGGCU"); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (hasScript(self, "item.container.base.base_container")) - { - detachScript(self, "item.container.base.base_container"); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/kusak_nyms_themepark.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/kusak_nyms_themepark.java deleted file mode 100644 index add9620aa..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/kusak_nyms_themepark.java +++ /dev/null @@ -1,391 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.chat; -import script.library.group; -import script.library.groundquests; -import script.library.hue; -import script.library.trial; -import script.library.utils; - - -public class kusak_nyms_themepark extends script.base_script -{ - public kusak_nyms_themepark() - { - } - public static final int RADIUS = 100; - public static final int MIN_DIST = 25; - - public static final String DISTANCE_CHECK = "distance_check"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "moveCreatureToWaypoint", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public int OnAboutToBeIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob "+self+" incapacitated by: "+killer); - - if (!hasObjVar(self, "theme_park_boss")) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "theme_park_boss_slot")) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob has boss slot and quest name data"); - - String bossQuest = getStringObjVar(self, "theme_park_boss"); - if (bossQuest == null || bossQuest.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - String bossQuestSlot = getStringObjVar(self, "theme_park_boss_slot"); - if (bossQuestSlot == null || bossQuestSlot.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob slot and quest name data validated"); - - obj_id[] attackerList = utils.getObjIdBatchScriptVar(self, "creditForKills.attackerList.attackers"); - - if (attackerList != null && attackerList.length > 0) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob attackerList = "+attackerList.length); - - for (int i = 0; i < attackerList.length; i++) - { - testAbortScript(); - if (!isIdValid(attackerList[i])) - { - continue; - } - - if (group.isGroupObject(attackerList[i])) - { - obj_id[] members = getGroupMemberIds(attackerList[i]); - - for (int j = 0, k = members.length; j < k; j++) - { - testAbortScript(); - if (isIdValid(members[j])) - { - if (!groundquests.isQuestActive(attackerList[i], bossQuest)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob attacker: "+attackerList[i]+" did not have boss quest: "+bossQuest); - continue; - } - - if (hasCompletedCollectionSlot(attackerList[i], bossQuestSlot)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob attacker: "+attackerList[i]+" has already attained: "+bossQuestSlot); - continue; - } - - if (!hasCompletedCollectionSlotPrereq(attackerList[i], bossQuestSlot)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnAboutToBeIncapacitated() Boss Mob attacker: "+attackerList[i]+" hasn't fulfilled the prerequisite for boss slot/: "+bossQuestSlot); - continue; - } - modifyCollectionSlotValue(attackerList[i], bossQuestSlot, 1); - } - } - } - else - { - if (!groundquests.isQuestActive(attackerList[i], bossQuest)) - { - continue; - } - - if (hasCompletedCollectionSlot(attackerList[i], bossQuestSlot)) - { - continue; - } - - if (!hasCompletedCollectionSlotPrereq(attackerList[i], bossQuestSlot)) - { - continue; - } - - modifyCollectionSlotValue(attackerList[i], bossQuestSlot, 1); - } - } - } - - return SCRIPT_CONTINUE; - - } - - - public int OnEnteredCombat(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "shuttle")) - { - return SCRIPT_CONTINUE; - } - - int maxDist = getIntObjVar(self, DISTANCE_CHECK); - if (maxDist <= 0) - { - maxDist = MIN_DIST; - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnEnteredCombat() maximum distance from creation location for boss mob ("+self+") was invalid or NULL."); - } - - obj_id playerEnemy = utils.getObjIdScriptVar(self, "waveEventPlayer"); - if (!isIdValid(playerEnemy) || !exists(playerEnemy)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnEnteredCombat() Mob found player but player was not part of owners group."); - return SCRIPT_CONTINUE; - } - - obj_id[] players = getPlayerCreaturesInRange(self, maxDist); - if (players != null && players.length > 0) - { - for (int i = 0; i < players.length; i++) - { - testAbortScript(); - if (!isIdValid(players[i]) && !exists(players[i]) || isIncapacitated(players[i]) || !isDead(players[i])) - { - continue; - } - - addHate(self, players[i], 1000.0f); - startCombat(self, players[i]); - } - } - - messageTo(self, "handleBossDistanceCheck", null, 3, false); - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitateTarget(obj_id self, obj_id victim) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "shuttle")) - { - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnIncapacitateTarget() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - if (getRandomCombatTarget(self, parent)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.OnIncapacitateTarget() Boss Mob has found someone in the player's group."); - return SCRIPT_CONTINUE; - } - - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - if (!isIdValid(self)) - { - return SCRIPT_CONTINUE; - } - - if (ai_lib.isDead(self)) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "shuttle")) - { - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("quest", "dynamic_mob_opponent.OnExitedCombat() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - if (getRandomCombatTarget(self, parent)) - { - return SCRIPT_CONTINUE; - } - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return SCRIPT_CONTINUE; - } - - - public int handleBossDistanceCheck(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - location currentLoc = getLocation(self); - if (currentLoc == null) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.handleBossDistanceCheck() current boss mob ("+self+") location NULL."); - return SCRIPT_CONTINUE; - } - - location creationLoc = aiGetHomeLocation(self); - if (creationLoc == null) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.handleBossDistanceCheck() creation location for boss mob ("+self+") was NULL."); - return SCRIPT_CONTINUE; - } - - float distanceCheck = utils.getDistance2D(currentLoc, creationLoc); - int maxDist = getIntObjVar(self, DISTANCE_CHECK); - if (maxDist <= 0) - { - maxDist = MIN_DIST; - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.handleBossDistanceCheck() maximum distance from creation location for boss mob ("+self+") was invalid or NULL."); - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("quest", "dynamic_mob_opponent.handleBossDistanceCheck() FAILED to find parent object."); - return SCRIPT_CONTINUE; - } - - if (distanceCheck > maxDist) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.handleBossDistanceCheck() boss mob ("+self+") has moved too far from creation location. Moving back to creation location."); - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - - } - else - { - messageTo(self, "handleBossDistanceCheck", null, 3, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean getRandomCombatTarget(obj_id self, obj_id parent) throws InterruptedException - { - if (!isIdValid(self) || !exists(self)) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget() FAILED to find self."); - return false; - } - - if (!isIdValid(parent) || !exists(parent)) - { - destroyObject(self); - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget() FAILED to find parent object."); - return false; - } - - int maxDist = getIntObjVar(self, DISTANCE_CHECK); - - if (maxDist <= 0) - { - maxDist = MIN_DIST; - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget() maximum distance from creation location for boss mob ("+self+") was invalid or NULL."); - } - - obj_id[] targets = trial.getValidTargetsInRadiusIgnoreLOS(self, maxDist); - if (targets == null || targets.length == 0) - { - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget() no targets for boss ("+self+") is: "+maxDist); - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return false; - } - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - if (!isIdValid(targets[i])) - { - continue; - } - - startCombat(self, targets[i]); - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget(): Player "+ targets[i] + " was found as a valid target. Boss Mob: "+self+" attacking player."); - return true; - } - CustomerServiceLog("nyms_themepark", "boss_nyms_themepark.getRandomCombatTarget(): Boss Mob: "+self+" failed to find a player to attack."); - dictionary webster = trial.getSessionDict(parent); - messageTo(parent, "defaultEventReset", webster, 2, false); - return false; - - } - - - public int moveCreatureToWaypoint(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "arena") && !hasObjVar(self, "shuttle")) - { - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "arena")) - { - location startPos = new location(472.5f, 34.4f, 4815.6f, "lok", null); - - setLocation(self, startPos); - aiSetHomeLocation(self, startPos); - setYaw(self, 160.0f); - } - if (hasObjVar(self, "shuttle")) - { - location locCenter = new location(473.0f, 12.0f, 4868.0f, "lok", null); - location locDestination = utils.getRandomLocationInRing(locCenter, 4.0f, 6.0f); - setLocation(self, locDestination); - aiSetHomeLocation(self, locDestination); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/mining_cave.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/mining_cave.java deleted file mode 100644 index ab6719d17..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/mining_cave.java +++ /dev/null @@ -1,252 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.ai.ai; -import script.ai.ai_combat; -import script.library.ai_lib; -import script.library.create; -import script.library.spawning; -import script.library.utils; - - -public class mining_cave extends script.base_script -{ - public mining_cave() - { - } - public static final String NYM_OBJECT_DATATABLE = "datatables/spawning/theme_park/nym_mining_cave_objects.iff"; - public static final String SPAWNER_DATATABLE = "datatables/spawning/theme_park/nym_imperial_mine.iff"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "spawnQuestObjects", null, 3, false); - messageTo(self, "handleSpawns", null, 3, false); - messageTo(self, "handleEliteSpawns", null, 3, false); - - return SCRIPT_CONTINUE; - } - - - public int spawnQuestObjects(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "planet")) - { - location myself = getLocation(self); - String planet = myself.area; - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name from location."); - return SCRIPT_OVERRIDE; - } - utils.setScriptVar(self, "planet", planet); - - } - - String planet = utils.getStringScriptVar(self, "planet"); - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name script var."); - return SCRIPT_OVERRIDE; - } - - spawning.spawnObjectsInDungeonFromTable(self, planet, NYM_OBJECT_DATATABLE); - - return SCRIPT_CONTINUE; - } - - - public int handleSpawns(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "planet")) - { - location myself = getLocation(self); - String planet = myself.area; - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name from location."); - return SCRIPT_CONTINUE; - } - utils.setScriptVar(self, "planet", planet); - - } - - String planet = utils.getStringScriptVar(self, "planet"); - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name script var."); - return SCRIPT_CONTINUE; - } - - int numberOfCreaturesToSpawn = dataTableGetNumRows(SPAWNER_DATATABLE); - if (numberOfCreaturesToSpawn <= 0) - { - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < numberOfCreaturesToSpawn; i++) - { - testAbortScript(); - doSpawn(i, planet, self); - } - return SCRIPT_CONTINUE; - } - - - public int tellingMomIDied(obj_id self, dictionary params) throws InterruptedException - { - LOG("nym_elite_log","NPC: "+self+" tellingMomIDied init"); - - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "planet")) - { - location myself = getLocation(self); - String planet = myself.area; - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name from location."); - return SCRIPT_CONTINUE; - } - utils.setScriptVar(self, "planet", planet); - - } - - String planet = utils.getStringScriptVar(self, "planet"); - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name script var."); - return SCRIPT_CONTINUE; - } - - int spawn_num = params.getInt("spawnNumber"); - if (spawn_num < 0) - { - return SCRIPT_CONTINUE; - } - - obj_id spawn_mob = params.getObjId("spawnMob"); - - if (utils.hasScriptVar (self, "spawned" + spawn_num) && (spawn_mob == utils.getObjIdScriptVar (self, "spawned" + spawn_num))) - { - LOG("nym_elite_log","NPC: "+self+" spawning NPC correctly"); - - doSpawn(spawn_num, planet, self); - } - - return SCRIPT_CONTINUE; - } - - - public boolean doSpawn(int spawn_num, String planet, obj_id self) throws InterruptedException - { - if (spawn_num < 0) - { - return false; - } - - if (planet == null || planet.length() <= 0) - { - return false; - } - - if (!isValidId(self) || !exists(self)) - { - return false; - } - - dictionary objToSpawn = dataTableGetRow(SPAWNER_DATATABLE, spawn_num); - if (objToSpawn == null) - { - return false; - } - - String object = objToSpawn.getString("spawns"); - if (object == null || object.length() <= 0) - { - return false; - } - - float xCoord = objToSpawn.getFloat("loc_x"); - float yCoord = objToSpawn.getFloat("loc_y"); - float zCoord = objToSpawn.getFloat("loc_z"); - float yaw = objToSpawn.getFloat("yaw"); - - String spawnRoom = objToSpawn.getString("room"); - if (spawnRoom == null || spawnRoom.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "mining_cave - doSpawn The creature "+object+" could not be spawned in room: "+spawnRoom+" in dungeon: "+self); - return false; - } - - obj_id room = getCellId(self, spawnRoom); - if (!isValidId(room)) - { - CustomerServiceLog("bad_spawner_data", "mining_cave - doSpawn The creature "+object+" could not be spawned in room: "+spawnRoom+" because the OID for that room was invalid. Dungeon: "+self); - return false; - } - - location objectLocation = new location (xCoord, yCoord, zCoord, planet, room); - - obj_id objectCreated = create.object (object, objectLocation); - if (!isValidId(objectCreated)) - { - CustomerServiceLog("bad_spawner_data", "mining_cave - doSpawn The creature "+object+" could not be spawned in room: "+spawnRoom+" because the creature was invalid or location wrong. Dungeon: "+self); - return false; - } - - String script = objToSpawn.getString("script"); - if (script != null && script.length() > 0) - { - - String[] scripts = split(script, ','); - for (int j = 0; j < scripts.length; j++) - { - testAbortScript(); - if (!hasScript(objectCreated, scripts[j])) - { - attachScript(objectCreated, scripts[j]); - } - } - } - - String objVars = objToSpawn.getString("objvar"); - if (objVars != null && objVars.length() > 0) - { - utils.setObjVarsListUsingSemiColon(objectCreated, objVars); - } - - String objName = objToSpawn.getString("name"); - if (objName != null && objName.length() > 0) - { - setName(objectCreated, objName); - } - - setObjVar(objectCreated, "spawn_number", spawn_num); - setObjVar(objectCreated, "mom", self ); - utils.setScriptVar (self, "spawned"+ spawn_num, objectCreated); - - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_ambush_ai.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_ambush_ai.java deleted file mode 100644 index b508eb10f..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_ambush_ai.java +++ /dev/null @@ -1,208 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.anims; -import script.library.buff; -import script.library.chat; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.group; -import script.library.prose; -import script.library.trial; -import script.library.utils; - - -public class nym_ambush_ai extends script.base_script -{ - public nym_ambush_ai() - { - } - public static final boolean LOGGING_ON = true; - public static final String SCRIPT_LOG = "outbreak_trigger"; - - public static final String FAIL_SIGNAL = "fail_signal"; - public static final String DISTANCE_CHECK = "distance_check"; - public static final String WAVE_GROUP_ID = "waveEventGroupId"; - public static final int RADIUS = 100; - public static final int MIN_DIST = 50; - - - public int OnAttach(obj_id self) throws InterruptedException - { - LOG("nym_themepark_log", "nym_ambush_ai: OnAttach: attaching script"); - - messageTo(self, "handleIntelligenceLoop", null, 3, false); - return SCRIPT_CONTINUE; - } - - - public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException - { - if (!hasObjVar(self,"invln")) - { - return SCRIPT_CONTINUE; - } - - setAttrib(self, HEALTH, getMaxAttrib( self, HEALTH )); - return SCRIPT_CONTINUE; - } - - - public int OnObjectDamaged(obj_id self, obj_id attacker, obj_id weapon, int damage) throws InterruptedException - { - if (!hasObjVar(self,"invln")) - { - return SCRIPT_CONTINUE; - } - - setHitpoints(self, getMaxHitpoints(self)); - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitateTarget(obj_id self, obj_id victim) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int OnExitedCombat(obj_id self) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int OnEnteredCombat(obj_id self) throws InterruptedException - { - - return SCRIPT_CONTINUE; - } - - - public int handleIntelligenceLoop(obj_id self, dictionary params) throws InterruptedException - { - LOG("nym_themepark_log", "nym_ambush_ai: handleIntelligenceLoop: loop start"); - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - obj_id parent = getObjIdObjVar(self, trial.PARENT); - if (!isIdValid(parent) || !exists(parent)) - { - return SCRIPT_CONTINUE; - } - - LOG("nym_themepark_log", "nym_ambush_ai: handleIntelligenceLoop: getting enemy"); - - getRandomCombatTarget(self, parent); - messageTo(self, "handleIntelligenceLoop", null, 3, false); - - return SCRIPT_CONTINUE; - } - - - public boolean getRandomCombatTarget(obj_id self, obj_id parent) throws InterruptedException - { - - if (ai_lib.isInCombat(self)) - { - return false; - } - - if (!isIdValid(self) || !exists(self)) - { - return false; - } - - if (!isIdValid(parent) || !exists(parent)) - { - return false; - } - - obj_id[] targets = getNPCsInRange(getLocation(self), 60); - if (targets == null || targets.length == 0) - { - return false; - } - - String myFaction = factions.getFaction(self); - - for (int i = 0; i < targets.length; i++) - { - testAbortScript(); - if (!isIdValid(targets[i])) - { - continue; - } - - if (targets[i] == self) - { - continue; - } - - if (isInvulnerable(targets[i])) - { - continue; - } - - if (hasScript(targets[i], "theme_park.nym.nym_ambush_ai")) - { - - continue; - } - - if (ai_lib.isDead(targets[i])) - { - - continue; - } - - String targetFaction = factions.getFaction(targets[i]); - - if (targetFaction == null || targetFaction.length() <= 0) - { - - continue; - } - - if (factions.areCreaturesAllied(self, targets[i])) - { - - continue; - } - - startCombat(self, targets[i]); - return true; - } - return false; - - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - messageTo(self, "destroySelf", null, 10, false); - return SCRIPT_CONTINUE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_dungeon_collectible.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_dungeon_collectible.java deleted file mode 100644 index 1393891d7..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_dungeon_collectible.java +++ /dev/null @@ -1,65 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.groundquests; -import script.library.utils; -import script.library.permissions; - - -public class nym_dungeon_collectible extends script.base_script -{ - public nym_dungeon_collectible() - { - } - public static final String STF_FILE = "pet/droid_modules"; - public static final string_id RETRIEVE = new string_id("celebrity/jinkins", "retrieve"); - - - public int makeNewModule(obj_id self, dictionary params) throws InterruptedException - { - obj_id module = createObject ("object/tangible/loot/quest/nym_droid_memory_chip.iff", self, ""); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info item) throws InterruptedException - { - item.addRootMenu(menu_info_types.ITEM_USE, RETRIEVE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, "u16_nym_themepark_pirate_hideout", "findDroidDisk")) - { - sendSystemMessage(player, new string_id("quest/groundquests", "retrieve_item_no_interest")); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, "hasFoundDroidDisk"); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - if (hasScript(self, "item.container.base.base_container")) - { - detachScript(self, "item.container.base.base_container"); - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_elevator_down.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_elevator_down.java deleted file mode 100644 index 19e279b29..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_elevator_down.java +++ /dev/null @@ -1,106 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.groundquests; -import script.library.locations; -import script.library.utils; - - -public class nym_elevator_down extends script.base_script -{ - public nym_elevator_down() - { - } - public static final String STF_FILE = "theme_park_nym/messages"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo (self, "makeElevatorWork", null, 5, true); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!hasObjVar(self, "stronghold_lobby")) - { - - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_nym_arena")) - { - - return SCRIPT_CONTINUE; - } - int mnu = mi.addRootMenu (menu_info_types.ITEM_USE, new string_id(STF_FILE,"ladder_down")); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!hasObjVar(self, "stronghold_lobby")) - { - - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_nym_arena")) - { - - return SCRIPT_CONTINUE; - } - - if (ai_lib.isInCombat(player)) - { - - return SCRIPT_CONTINUE; - } - - obj_id strongHoldLobby = getObjIdObjVar(self, "stronghold_lobby"); - if (!isValidId(strongHoldLobby)) - { - - return SCRIPT_CONTINUE; - } - - warpPlayer(player, "lok", 0f, 0f, 0f, strongHoldLobby, 0f, 8.9f, -32.0f); - return SCRIPT_CONTINUE; - } - - - public int makeElevatorWork(obj_id self, dictionary params) throws InterruptedException - { - String stronghold = "6595508"; - obj_id building = utils.stringToObjId(stronghold); - if (!isValidId(building)) - { - return SCRIPT_CONTINUE; - } - - obj_id room = getCellId(building, "lobby"); - if (!isValidId(room)) - { - return SCRIPT_CONTINUE; - } - - setObjVar(self, "stronghold_lobby", room); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_elevator_up.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_elevator_up.java deleted file mode 100644 index 06a955c3b..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/nym_elevator_up.java +++ /dev/null @@ -1,58 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.groundquests; -import script.library.locations; -import script.library.utils; - - -public class nym_elevator_up extends script.base_script -{ - public nym_elevator_up() - { - } - public static final String STF_FILE = "theme_park_nym/messages"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_nym_arena")) - { - - return SCRIPT_CONTINUE; - } - int mnu = mi.addRootMenu (menu_info_types.ITEM_USE, new string_id(STF_FILE,"ladder_up")); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActiveOrComplete(player, "u16_nym_themepark_nym_arena")) - { - - return SCRIPT_CONTINUE; - } - if (ai_lib.isInCombat(player)) - { - - return SCRIPT_CONTINUE; - } - - warpPlayer(player, "lok", 474, 33, 4781, null, 0, 0, 0); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/research_lab.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/research_lab.java deleted file mode 100644 index ff05c05dd..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/research_lab.java +++ /dev/null @@ -1,226 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.create; -import script.library.spawning; -import script.library.utils; - - -public class research_lab extends script.base_script -{ - public research_lab() - { - } - public static final String NYM_OBJECT_DATATABLE = "datatables/spawning/theme_park/nym_research_lab_objects.iff"; - public static final String SPAWNER_DATATABLE = "datatables/spawning/theme_park/nym_research_lab.iff"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "spawnQuestObjects", null, 3, false); - messageTo(self, "spawnOtherObjects", null, 3, false); - messageTo(self, "beginSpawn", null, 3, false); - return SCRIPT_CONTINUE; - } - - - public int spawnQuestObjects(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "planet")) - { - location myself = getLocation(self); - String planet = myself.area; - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name from location."); - return SCRIPT_CONTINUE; - } - utils.setScriptVar(self, "planet", planet); - - } - - String planet = utils.getStringScriptVar(self, "planet"); - if (planet == null || planet.length() <= 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Sulfur Pirate Cave spawner "+ self + ", Could not retrieve planet name script var."); - return SCRIPT_CONTINUE; - } - - spawning.spawnObjectsInDungeonFromTable(self, planet, NYM_OBJECT_DATATABLE); - return SCRIPT_CONTINUE; - } - - - public int beginSpawn(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - int numberOfCreaturesToSpawn = dataTableGetNumRows (SPAWNER_DATATABLE); - if (numberOfCreaturesToSpawn < 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Research Lab spawner "+ self + ", research_lab.beginSpawn handler could not open datatable."); - return SCRIPT_CONTINUE; - } - int x = 0; - if (utils.hasScriptVar(self, "spawnCounter")) - { - x = utils.getIntScriptVar (self, "spawnCounter"); - } - - String spawn = dataTableGetString (SPAWNER_DATATABLE, x, "spawns"); - - float xCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_x"); - float yCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_y"); - float zCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_z"); - - location myself = getLocation (self); - String planet = myself.area; - - String spawnRoom = dataTableGetString (SPAWNER_DATATABLE, x, "room"); - obj_id room = null; - - if (spawnRoom != null && spawnRoom.length() > 0) - { - room = getCellId (self, spawnRoom); - } - else - { - spawnRoom = ""; - } - - if (!isIdValid (room) && !spawnRoom.equals("world")) - { - CustomerServiceLog("bad_spawner_data", "spawner "+ self + ", datatable "+ SPAWNER_DATATABLE + ", row "+ x + ", mob "+ spawn + ", room "+ spawnRoom + " doesn't exist"); - } - else - { - location spawnPoint = new location (xCoord, yCoord, zCoord, planet, room); - - obj_id spawnedCreature = create.object (spawn, spawnPoint); - - String geoScript = dataTableGetString (SPAWNER_DATATABLE, x, "script"); - - if (geoScript != null && !geoScript.equals("")) - { - - attachScript (spawnedCreature, geoScript); - } - String objVars = dataTableGetString (SPAWNER_DATATABLE, x, "objvar"); - if (objVars != null && objVars.length() > 0) - { - utils.setObjVarsListUsingSemiColon(spawnedCreature, objVars); - } - - String creatureName = dataTableGetString (SPAWNER_DATATABLE, x, "name"); - - if (creatureName != null && !creatureName.equals("")) - { - setName (spawnedCreature, creatureName); - } - - setObjVar (spawnedCreature, "spawn_number", x); - setObjVar (spawnedCreature, "mom", self ); - utils.setScriptVar (self, "spawned"+ x, spawnedCreature); - } - - x = x + 1; - utils.setScriptVar (self, "spawnCounter", x); - - if (x <= numberOfCreaturesToSpawn) - { - messageTo ( self, "beginSpawn", null, 1, false ); - } - - return SCRIPT_CONTINUE; - } - - - public int tellingMomIDied(obj_id self, dictionary params) throws InterruptedException - { - - int spawn_num = params.getInt ("spawnNumber"); - obj_id spawn_mob = params.getObjId ("spawnMob"); - - if (utils.hasScriptVar (self, "spawned" + spawn_num) && (spawn_mob == utils.getObjIdScriptVar (self, "spawned" + spawn_num))) - { - doSpawn (spawn_num); - } - - return SCRIPT_CONTINUE; - } - - - public void doSpawn(int spawn_num) throws InterruptedException - { - obj_id self = getSelf(); - - int numberOfCreaturesToSpawn = dataTableGetNumRows (SPAWNER_DATATABLE); - if (numberOfCreaturesToSpawn < 0) - { - CustomerServiceLog("bad_spawner_data", "Nym Research Lab spawner "+ self + ", research_lab.beginSpawn handler could not open datatable."); - return; - } - int x = spawn_num; - - String spawn = dataTableGetString (SPAWNER_DATATABLE, x, "spawns"); - - float xCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_x"); - float yCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_y"); - float zCoord = dataTableGetFloat (SPAWNER_DATATABLE, x, "loc_z"); - - location myself = getLocation (self); - String planet = myself.area; - - String spawnRoom = dataTableGetString (SPAWNER_DATATABLE, x, "room"); - obj_id room = getCellId (self, spawnRoom); - - if (!isIdValid (room) && !spawnRoom.equals("world")) - { - CustomerServiceLog("bad_spawner_data", "spawner "+ self + ", datatable "+ SPAWNER_DATATABLE + ", row "+ x + ", mob "+ spawn + ", room "+ spawnRoom + " doesn't exist"); - utils.removeScriptVar (self, "spawned"+ x); - return; - } - - location spawnPoint = new location (xCoord, yCoord, zCoord, planet, room); - - obj_id spawnedCreature = create.object (spawn, spawnPoint); - - String geoScript = dataTableGetString (SPAWNER_DATATABLE, x, "script"); - - if (geoScript != null && !geoScript.equals("")) - { - - attachScript (spawnedCreature, geoScript); - } - - String creatureName = dataTableGetString (SPAWNER_DATATABLE, x, "name"); - - if (creatureName != null && !creatureName.equals("")) - { - setName (spawnedCreature, creatureName); - } - - setObjVar (spawnedCreature, "spawn_number", x); - setObjVar (spawnedCreature, "mom", self ); - utils.setScriptVar (self, "spawned"+ x, spawnedCreature); - - return; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/research_lab_died.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/research_lab_died.java deleted file mode 100644 index 6aba5b6ea..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/research_lab_died.java +++ /dev/null @@ -1,35 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -public class research_lab_died extends script.base_script -{ - public research_lab_died() - { - } - - public int OnDestroy(obj_id self) throws InterruptedException - { - obj_id mom = getObjIdObjVar (self, "mom"); - if (mom == null) - { - return SCRIPT_CONTINUE; - } - - int spawnNum = getIntObjVar (self, "spawn_number"); - - dictionary info = new dictionary(); - info.put ("spawnNumber", spawnNum ); - info.put ("spawnMob", self ); - - messageTo (mom, "tellingMomIDied", info, rand(90,200), false ); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/stronghold.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/stronghold.java deleted file mode 100644 index 354fe8330..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/stronghold.java +++ /dev/null @@ -1,683 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.ai.ai; -import script.library.ai_lib; -import script.library.create; -import script.ai.ai_combat; - - -public class stronghold extends script.base_script -{ - public stronghold() - { - } - - public int OnInitialize(obj_id self) throws InterruptedException - { - spawnEveryone(self); - return SCRIPT_CONTINUE; - } - - - public void spawnEveryone(obj_id self) throws InterruptedException - { - - spawnCelebs(self); - messageTo (self, "spawnGuards", null, 5, true); - messageTo (self, "spawnPirates", null, 10, true); - messageTo (self, "spawnParty", null, 15, true); - messageTo (self, "spawnElevatorHandler", null, 5, true); - - return; - } - - - public void spawnCelebs(obj_id self) throws InterruptedException - { - obj_id nym = spawnNym(self); - spawnKole(self, nym); - spawnJinkins(self, nym); - spawnDog1(self); - spawnDog2(self); - - spawnVanaSage(self, nym); - spawnMakoGhast(self, nym); - spawnGrenzZittoun(self, nym); - spawnStuvanyInglen(self, nym); - spawnRek(self, nym); - spawnSharphorn(self, nym); - } - - - public obj_id spawnNym(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location nymLocation = new location (-0.06f, 3.28f, -22.90f, "lok", lobby); - obj_id nym = create.staticObject ("nym", nymLocation ); - - setObjVar (self, "StrongholdInhabitants.nym", nym); - setAnimationMood(nym, "npc_sitting_chair"); - setYaw (nym, -4f); - setObjVar (nym, "Stronghold", self); - return nym; - } - - - public void spawnKole(obj_id self, obj_id nym) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location koleLocation = new location (-1.83f, 3.34f, -19.11f, "lok", lobby); - obj_id kole = create.staticObject("kole", koleLocation ); - - setObjVar (self, "StrongholdInhabitants.kole", kole); - setObjVar (kole, "Stronghold", self); - faceTo (kole, nym); - return; - } - - - public void spawnJinkins(obj_id self, obj_id nym) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location jinkinsLocation = new location (3.07f, 3.29f, -21.31f, "lok", lobby); - obj_id jinkins = create.staticObject("jinkins", jinkinsLocation ); - - setObjVar (self, "StrongholdInhabitants.jinkins", jinkins); - setObjVar (jinkins, "Stronghold", self); - faceTo (jinkins, nym); - return; - } - - - public void spawnVanaSage(obj_id self, obj_id nym) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location vanaLocation = new location (0.177338f, 3.31568f, -15.9878f, "lok", lobby); - obj_id vana = create.staticObject("nym_themepark_vana_sage", vanaLocation); - setObjVar (self, "StrongholdInhabitants.vana", vana); - setObjVar (vana, "Stronghold", self); - faceTo (vana, nym); - return; - } - - - public void spawnMakoGhast(obj_id self, obj_id nym) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location ghastLocation = new location (5.65913f, 4.07455f, -13.7886f, "lok", lobby); - obj_id ghast = create.staticObject("nym_themepark_mako_ghast", ghastLocation); - setObjVar (self, "StrongholdInhabitants.ghast", ghast); - setObjVar (ghast, "Stronghold", self); - faceTo (ghast, nym); - return; - } - - - public void spawnGrenzZittoun(obj_id self, obj_id nym) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location grenzLocation = new location (1.84116f, 4.0782f, -10.7134f, "lok", lobby); - obj_id grenz = create.staticObject("nym_themepark_grenz_zittoun", grenzLocation); - setObjVar (self, "StrongholdInhabitants.grenz", grenz); - setObjVar (grenz, "Stronghold", self); - faceTo (grenz, nym); - return; - } - - - public void spawnStuvanyInglen(obj_id self, obj_id nym) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location inglenLocation = new location (5.22391f, 3.38231f, -20.5942f, "lok", lobby); - obj_id inglen = create.staticObject("nym_themepark_stuvany_inglen", inglenLocation); - setObjVar (self, "StrongholdInhabitants.inglen", inglen); - setObjVar (inglen, "Stronghold", self); - faceTo (inglen, nym); - return; - } - - - public void spawnRek(obj_id self, obj_id nym) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location rekLocation = new location (-5.31335f, 3.42358f, -20.4917f, "lok", lobby); - obj_id rek = create.staticObject("nym_themepark_rek_thelcar", rekLocation); - setObjVar (self, "StrongholdInhabitants.rek", rek); - setObjVar (rek, "Stronghold", self); - faceTo (rek, nym); - return; - } - - - public void spawnSharphorn(obj_id self, obj_id nym) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location sharphornLocation = new location (-5.56208f, 1.00421f, 8.15896f, "lok", lobby); - obj_id sharphorn = create.staticObject("slicer_kelson_sharphorn", sharphornLocation); - setObjVar (self, "StrongholdInhabitants.sharphorn", sharphorn); - setObjVar (sharphorn, "Stronghold", self); - faceTo (sharphorn, nym); - return; - } - - - public void spawnElite1(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location e1Loc = new location (3.12f, 4.08f, -9.55f, "lok", lobby); - obj_id guard1 = create.staticObject ("nym_guard_elite", e1Loc); - setObjVar (self, "StrongholdInhabitants.guard1", guard1); - setObjVar (guard1, "Stronghold", self); - aiEquipPrimaryWeapon(guard1); - setYaw (guard1, -1); - return; - } - - - public void spawnElite2(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location e2Loc = new location (-3.12f, 4.08f, -9.55f, "lok", lobby); - obj_id guard2 = create.staticObject ("nym_guard_elite", e2Loc); - setObjVar (self, "StrongholdInhabitants.guard2", guard2); - setObjVar (guard2, "Stronghold", self); - aiEquipPrimaryWeapon(guard2); - setYaw (guard2, -1); - return; - } - - - public void spawnElite3(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location e1Loc = new location (1.98f, 8.9f, -30.50f, "lok", lobby); - obj_id guard3 = create.staticObject ("nym_guard_elite", e1Loc); - setObjVar (self, "StrongholdInhabitants.guard3", guard3); - setObjVar (guard3, "Stronghold", self); - aiEquipPrimaryWeapon(guard3); - setYaw (guard3, 0f); - return; - } - - - public void spawnElite4(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location e2Loc = new location (-1.91f, 8.9f, -30.50f, "lok", lobby); - obj_id guard4 = create.staticObject ("nym_guard_elite", e2Loc); - setObjVar (self, "StrongholdInhabitants.guard4", guard4); - setObjVar (guard4, "Stronghold", self); - aiEquipPrimaryWeapon(guard4); - setYaw (guard4, 0f); - return; - } - - - public void spawnElite5(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location e1Loc = new location (-18.91f, 2.3f, 9.74f, "lok", lobby); - obj_id guard5 = create.staticObject ("nym_guard_strong", e1Loc); - setObjVar (self, "StrongholdInhabitants.guard5", guard5); - setObjVar (guard5, "Stronghold", self); - aiEquipPrimaryWeapon(guard5); - setYaw (guard5, 178f); - return; - } - - - public void spawnElite6(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location e2Loc = new location (18.98f, 2.3f, 10.51f, "lok", lobby); - obj_id guard6 = create.staticObject ("nym_guard_weak", e2Loc); - setObjVar (self, "StrongholdInhabitants.guard6", guard6); - setObjVar (guard6, "Stronghold", self); - aiEquipPrimaryWeapon(guard6); - setYaw (guard6, -179f); - return; - } - - - public void spawnElite7(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location e1Loc = new location (-20.26f, 2.3f, -18.62f, "lok", lobby); - obj_id guard7 = create.staticObject ("nym_guard_weak", e1Loc); - setObjVar (self, "StrongholdInhabitants.guard7", guard7); - setObjVar (guard7, "Stronghold", self); - aiEquipPrimaryWeapon(guard7); - setYaw (guard7, 3f); - return; - } - - - public void spawnElite8(obj_id self) throws InterruptedException - { - obj_id meeting2 = getCellId (self, "meeting2"); - location e1Loc = new location (-28.92f, 2.3f, 0.73f, "lok", meeting2); - obj_id guard8 = create.staticObject ("nym_bodyguard", e1Loc); - setObjVar (self, "StrongholdInhabitants.guard8", guard8); - setObjVar (guard8, "Stronghold", self); - aiEquipPrimaryWeapon(guard8); - attachScript (guard8, "theme_park.nym.guard_path"); - return; - } - - - public void spawnPirate1(obj_id self) throws InterruptedException - { - obj_id meeting5 = getCellId (self, "meeting5"); - location p1Loc = new location (37.49f, 2.29f, -1.17f, "lok", meeting5); - obj_id pirate1 = create.staticObject ("nym_pirate_elite", p1Loc); - setObjVar (self, "StrongholdInhabitants.pirate1", pirate1); - setObjVar (pirate1, "Stronghold", self); - ai_lib.setDefaultCalmMood (pirate1, "npc_accusing"); - setYaw (pirate1, 88); - return; - } - - - public void spawnPirate2(obj_id self) throws InterruptedException - { - obj_id meeting5 = getCellId (self, "meeting5"); - location p2Loc = new location (36.71f, 2.29f, -2.92f, "lok", meeting5); - obj_id pirate2 = create.staticObject ("nym_pirate_elite", p2Loc); - setObjVar (self, "StrongholdInhabitants.pirate2", pirate2); - setObjVar (pirate2, "Stronghold", self); - ai_lib.setDefaultCalmMood (pirate2, "npc_angry"); - setYaw (pirate2, 88); - return; - } - - - public void spawnBoard(obj_id self) throws InterruptedException - { - obj_id meeting5 = getCellId (self, "meeting5"); - location boardLoc = new location (39.46f, 2.29f, -2.39f, "lok", meeting5); - obj_id board = create.staticObject ("object/tangible/furniture/all/frn_all_desk_radar_topology_screen.iff", boardLoc); - setObjVar (self, "StrongholdInhabitants.board", board); - setObjVar (board, "Stronghold", self); - setYaw (board, 88); - return; - } - - - public obj_id spawnPartygoer1(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location partygoer1Location = new location (-8.11f, 1.3f, -1.06f, "lok", lobby); - obj_id partygoer1 = create.staticObject ("nym_brawler", partygoer1Location ); - - setObjVar (self, "StrongholdInhabitants.partygoer1", partygoer1); - ai_lib.setDefaultCalmMood (partygoer1, "conversation"); - setYaw (partygoer1, 177f); - setObjVar (partygoer1, "Stronghold", self); - return partygoer1; - } - - - public obj_id spawnPartygoer2(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location partygoer2Location = new location (-8.05f, 1.3f, -2.3f, "lok", lobby); - obj_id partygoer2 = create.staticObject ("nym_surveyer", partygoer2Location ); - - setObjVar (self, "StrongholdInhabitants.partygoer2", partygoer2); - ai_lib.setDefaultCalmMood (partygoer2, "conversation"); - setYaw (partygoer2, 7f); - setObjVar (partygoer2, "Stronghold", self); - return partygoer2; - } - - - public obj_id spawnPartygoer3(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location partygoer3Location = new location (4.17f, 1.3f, -5.62f, "lok", lobby); - obj_id partygoer3 = create.staticObject ("nym_brawler", partygoer3Location ); - - setObjVar (self, "StrongholdInhabitants.partygoer3", partygoer3); - ai_lib.setDefaultCalmMood(partygoer3, "conversation"); - setYaw (partygoer3, 33f); - setObjVar (partygoer3, "Stronghold", self); - return partygoer3; - } - - - public obj_id spawnPartygoer4(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location partygoer4Location = new location (5.86f, 1.3f, -5.04f, "lok", lobby); - obj_id partygoer4 = create.staticObject ("nym_bodyguard", partygoer4Location ); - - setObjVar (self, "StrongholdInhabitants.partygoer4", partygoer4); - ai_lib.setDefaultCalmMood (partygoer4, "conversation"); - setYaw (partygoer4, -77f); - setObjVar (partygoer4, "Stronghold", self); - return partygoer4; - } - - - public obj_id spawnPartygoer5(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location partygoer5Location = new location (4.39f, 1.3f, -3.87f, "lok", lobby); - obj_id partygoer5 = create.staticObject ("nym_surveyer", partygoer5Location ); - - setObjVar (self, "StrongholdInhabitants.partygoer5", partygoer5); - ai_lib.setDefaultCalmMood (partygoer5, "conversation"); - setYaw (partygoer5, 149f); - setObjVar (partygoer5, "Stronghold", self); - return partygoer5; - } - - - public obj_id spawnPartygoer6(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location partygoer6Location = new location (-3.58f, 1.3f, 4.01f, "lok", lobby); - obj_id partygoer6 = create.staticObject ("nym_bodyguard", partygoer6Location ); - - setObjVar (self, "StrongholdInhabitants.partygoer6", partygoer6); - ai_lib.setDefaultCalmMood (partygoer6, "conversation"); - setYaw (partygoer6, 89f); - setObjVar (partygoer6, "Stronghold", self); - return partygoer6; - } - - - public obj_id spawnPartygoer7(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location partygoer7Location = new location (-1.79f, 1.3f, 3.94f, "lok", lobby); - obj_id partygoer7 = create.staticObject ("nym_destroyer", partygoer7Location ); - - setObjVar (self, "StrongholdInhabitants.partygoer7", partygoer7); - ai_lib.setDefaultCalmMood (partygoer7, "conversation"); - setYaw (partygoer7, -93f); - setObjVar (partygoer7, "Stronghold", self); - return partygoer7; - } - - - public obj_id spawnDog1(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location dog1Location = new location (-3.62f, 3.28f, -25.44f, "lok", lobby); - obj_id dog1 = create.object ("nym_kusak_guardian", dog1Location ); - setObjVar (self, "StrongholdInhabitants.dog1", dog1); - setYaw (dog1, 39f); - ai_lib.setDefaultCalmBehavior(dog1, ai_lib.BEHAVIOR_SENTINEL); - setName(dog1, "Scourge"); - dictionary dogs = new dictionary(); - dogs.put( "dog", dog1); - messageTo (self, "makeDogSit", dogs, 5, true); - setObjVar (dog1, "Stronghold", self); - setInvulnerable (dog1, true); - return dog1; - } - - - public obj_id spawnDog2(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - location dog2Location = new location (3.62f, 3.28f, -25.44f, "lok", lobby); - obj_id dog2 = create.object ("nym_kusak_guardian", dog2Location ); - setObjVar (self, "StrongholdInhabitants.dog2", dog2); - setYaw (dog2, -35f); - ai_lib.setDefaultCalmMood (dog2, "bored"); - ai_lib.setDefaultCalmBehavior(dog2, ai_lib.BEHAVIOR_SENTINEL); - setName(dog2, "Razor"); - dictionary dogs = new dictionary(); - dogs.put( "dog", dog2); - messageTo (self, "makeDogSit", dogs, 5, true); - setObjVar (dog2, "Stronghold", self); - setInvulnerable (dog2, true); - return dog2; - } - - - public boolean spawnElevator(obj_id self) throws InterruptedException - { - obj_id lobby = getCellId (self, "lobby"); - if (!isValidId(lobby)) - { - return false; - } - - location elevatorOneLoc = new location (0.0f, 8.9f, -30.5f, "lok", lobby); - location elevatorTwoLoc = new location (0.0f, 13.1f, -30.5f, "lok", lobby); - location hatchBaseLoc = new location (-0.05f, 18.5f, -31.5f, "lok", lobby); - - obj_id elevatorOne = createObject("object/tangible/theme_park/nym/ladder_to_roof.iff", elevatorOneLoc); - if (!isValidId(elevatorOne)) - { - return false; - } - - obj_id elevatorTwo = createObject("object/tangible/theme_park/nym/ladder_to_roof.iff", elevatorTwoLoc); - if (!isValidId(elevatorTwo)) - { - return false; - } - - obj_id hatchBase = createObject("object/static/item/item_medic_bacta_tank_large.iff", hatchBaseLoc); - if (!isValidId(elevatorOne)) - { - return false; - } - - modifyPitch(hatchBase, -180.0f); - setYaw(elevatorOne, 180f); - setYaw(elevatorTwo, 180f); - - return true; - } - - - public int OnHearSpeech(obj_id self, obj_id speaker, String text) throws InterruptedException - { - if (!hasObjVar (speaker, "gm")) - { - return SCRIPT_CONTINUE; - } - - if (text.equals("celebs")) - { - spawnCelebs(self); - } - - if (text.equals("guards")) - { - messageTo(self, "spawnGuards", null, 0, true); - } - - if (text.equals("party")) - { - messageTo(self, "spawnParty", null, 0, true); - } - - if (text.equals("kill celebs")) - { - killCelebs(self); - } - - if (text.equals("kill guards")) - { - killGuards(self); - } - - if (text.equals("pirates")) - { - messageTo (self, "spawnPirates", null, 0, true); - } - - if (text.equals("kill pirates")) - { - killPirates(self); - } - - if (text.equals("kill party")) - { - killParty(self); - } - - if (text.equals("kill all")) - { - killAll(self); - } - - return SCRIPT_CONTINUE; - } - - - public void killAll(obj_id self) throws InterruptedException - { - killCelebs(self); - killGuards(self); - killPirates(self); - return; - } - - - public void killCelebs(obj_id self) throws InterruptedException - { - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.nym")); - removeObjVar (self, "StrongholdInhabitants.nym"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.kole")); - removeObjVar (self, "StrongholdInhabitants.kole"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.jinkins")); - removeObjVar (self, "StrongholdInhabitants.jinkins"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.dog1")); - removeObjVar (self, "StrongholdInhabitants.dog1"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.dog2")); - removeObjVar (self, "StrongholdInhabitants.dog2"); - - return; - } - - - public void killGuards(obj_id self) throws InterruptedException - { - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.guard1")); - removeObjVar (self, "StrongholdInhabitants.guard1"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.guard2")); - removeObjVar (self, "StrongholdInhabitants.guard2"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.guard3")); - removeObjVar (self, "StrongholdInhabitants.guard3"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.guard4")); - removeObjVar (self, "StrongholdInhabitants.guard4"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.guard5")); - removeObjVar (self, "StrongholdInhabitants.guard5"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.guard6")); - removeObjVar (self, "StrongholdInhabitants.guard6"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.guard7")); - removeObjVar (self, "StrongholdInhabitants.guard7"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.guard8")); - removeObjVar (self, "StrongholdInhabitants.guard8"); - - return; - } - - - public void killPirates(obj_id self) throws InterruptedException - { - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.pirate1")); - removeObjVar (self, "StrongholdInhabitants.pirate1"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.pirate2")); - removeObjVar (self, "StrongholdInhabitants.pirate2"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.pirate3")); - removeObjVar (self, "StrongholdInhabitants.pirate3"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.pirate4")); - removeObjVar (self, "StrongholdInhabitants.pirate4"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.pirate5")); - removeObjVar (self, "StrongholdInhabitants.pirate5"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.board")); - removeObjVar (self, "StrongholdInhabitants.board"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.futon")); - removeObjVar (self, "StrongholdInhabitants.futon"); - - } - - - public void killParty(obj_id self) throws InterruptedException - { - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.partygoer1")); - removeObjVar (self, "StrongholdInhabitants.partygoer1"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.partygoer2")); - removeObjVar (self, "StrongholdInhabitants.partygoer2"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.partygoer3")); - removeObjVar (self, "StrongholdInhabitants.partygoer3"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.partygoer4")); - removeObjVar (self, "StrongholdInhabitants.partygoer4"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.partygoer5")); - removeObjVar (self, "StrongholdInhabitants.partygoer5"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.partygoer6")); - removeObjVar (self, "StrongholdInhabitants.partygoer6"); - destroyObject(getObjIdObjVar( self, "StrongholdInhabitants.partygoer7")); - removeObjVar (self, "StrongholdInhabitants.partygoer7"); - - } - - - public int spawnGuards(obj_id self, dictionary params) throws InterruptedException - { - spawnElite1( self ); - spawnElite2( self ); - spawnElite3( self ); - spawnElite4( self ); - spawnElite5( self ); - spawnElite6( self ); - spawnElite7( self ); - spawnElite8( self ); - - return SCRIPT_CONTINUE; - } - - - public int spawnPirates(obj_id self, dictionary params) throws InterruptedException - { - spawnPirate1( self ); - spawnPirate2( self ); - spawnBoard (self ); - return SCRIPT_CONTINUE; - } - - - public int spawnParty(obj_id self, dictionary params) throws InterruptedException - { - spawnPartygoer1( self ); - spawnPartygoer2( self ); - spawnPartygoer3( self ); - spawnPartygoer4( self ); - spawnPartygoer5( self ); - spawnPartygoer6( self ); - spawnPartygoer7( self ); - - return SCRIPT_CONTINUE; - } - - - public int makeDogSit(obj_id self, dictionary params) throws InterruptedException - { - obj_id dog1 = params.getObjId ("dog"); - ai_lib.aiSetPosture(dog1, POSTURE_SITTING); - return SCRIPT_CONTINUE; - } - - - public int spawnElevatorHandler(obj_id self, dictionary params) throws InterruptedException - { - spawnElevator(self); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/stronghold_ladder.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/stronghold_ladder.java deleted file mode 100644 index a28c9031f..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/stronghold_ladder.java +++ /dev/null @@ -1,52 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.groundquests; -import script.library.locations; -import script.library.utils; - - -public class stronghold_ladder extends script.base_script -{ - public stronghold_ladder() - { - } - public static final String STF_FILE = "theme_park/outbreak/outbreak"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if ((!groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "leaveFacility") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "leaveFacility") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "leaveFacility") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "coverSurvivors") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "coverSurvivors") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "coverSurvivors") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "seeHX138") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "seeHX138") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "seeHX138") && !groundquests.hasCompletedQuest(player, "outbreak_quest_final_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_final_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_final_neutral"))) - { - CustomerServiceLog("outbreak_themepark", "exit_ladder.OnObjectMenuRequest: Player did not have the appropriate quest task and has not finished the quest. player: "+player); - return SCRIPT_CONTINUE; - } - int mnu = mi.addRootMenu (menu_info_types.ITEM_USE, new string_id(STF_FILE,"open_hatch")); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if ((!groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "leaveFacility") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "leaveFacility") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "leaveFacility") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "coverSurvivors") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "coverSurvivors") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "coverSurvivors") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "seeHX138") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "seeHX138") && !groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "seeHX138") && !groundquests.hasCompletedQuest(player, "outbreak_quest_final_imperial") && !groundquests.hasCompletedQuest(player, "outbreak_quest_final_rebel") && !groundquests.hasCompletedQuest(player, "outbreak_quest_final_neutral"))) - { - CustomerServiceLog("outbreak_themepark", "exit_ladder.OnObjectMenuSelect: Player did not have the appropriate quest task and has not finished the quest. player: "+player); - return SCRIPT_CONTINUE; - } - - if ((groundquests.isTaskActive(player, "outbreak_quest_facility_05_imperial", "leaveFacility") || groundquests.isTaskActive(player, "outbreak_quest_facility_05_rebel", "leaveFacility") || groundquests.isTaskActive(player, "outbreak_quest_facility_05_neutral", "leaveFacility"))) - { - groundquests.sendSignal(player, "hasLeftFacility"); - } - - warpPlayer(player, "dathomir", -7390, 572, -7384, null, -7390, 572, -7384, null, true); - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/water_filtration_chemical_deposit.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/water_filtration_chemical_deposit.java deleted file mode 100644 index a3f90901d..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/water_filtration_chemical_deposit.java +++ /dev/null @@ -1,211 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.pclib; -import script.library.pet_lib; -import script.library.static_item; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class water_filtration_chemical_deposit extends script.base_script -{ - public water_filtration_chemical_deposit() - { - } - public static final String THEMEPARK = "theme_park_nym/messages"; - - public static final string_id SID_NOT_WHILE_MOUNTED = new string_id(THEMEPARK, "deposit_not_while_mounted"); - public static final string_id SID_ZIP_BAR = new string_id(THEMEPARK, "deposit_zip_bar"); - public static final string_id SID_MNU_USE = new string_id(THEMEPARK, "deposit_gather_menu"); - public static final string_id SID_NOT_SURE_HOW_DESTROY = new string_id(THEMEPARK, "deposit_not_sure_what_to_do"); - public static final string_id SID_ALRDY_COMPLETED_QUEST = new string_id(THEMEPARK, "deposit_already_completed_quest"); - - public static final int COUNTDOWN_TIMER = 3; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - int mnu2 = mi.addRootMenu (menu_info_types.ITEM_USE, SID_MNU_USE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (pet_lib.isMounted(player)) - { - sendSystemMessage(player, SID_NOT_WHILE_MOUNTED); - return SCRIPT_CONTINUE; - } - - String quest = getStringObjVar(self, "strQuest"); - if (quest == null || quest.length() <= 0) - { - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.OnObjectMenuSelect() Could not find the parent spawner quest for participating in the canister quest for canister: ("+self+"). The operation was aborted for Player: "+player); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(player, quest)) - { - sendSystemMessage(player, SID_NOT_SURE_HOW_DESTROY); - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.OnObjectMenuSelect() Player: "+player+" did not have the quest "+quest+" needed for this collection. canister: ("+self); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, quest, "needsToGatherChemical")) - { - sendSystemMessage(player, SID_NOT_SURE_HOW_DESTROY); - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.OnObjectMenuSelect() Player: "+player+" did not have the quest "+quest+" needed for this collection. canister: ("+self); - return SCRIPT_CONTINUE; - } - - String questSignal = getStringObjVar(self, "strSignal"); - if (questSignal == null || questSignal.length() <= 0) - { - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.OnObjectMenuSelect() Could not find the parent spawner quest SIGNAL for participating in the canister quest for canister: ("+self+"). The operation was aborted for Player: "+player); - return SCRIPT_CONTINUE; - } - - int startTime = 0; - int range = 3; - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - - stealth.testInvisNonCombatAction(player, self); - int countdownSui = sui.smartCountdownTimerSUI(self, player, "quest_countdown_timer", SID_ZIP_BAR, startTime, COUNTDOWN_TIMER, "handleObjectSwapTimer", range, flags); - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.OnObjectMenuSelect() Player: "+player+" is destroying blackwing canister: "+self); - - return SCRIPT_CONTINUE; - } - - - public int handleObjectSwapTimer(obj_id self, dictionary params) throws InterruptedException - { - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - obj_id player = params.getObjId("player"); - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.handleObjectSwapTimer() cancelled"); - - return SCRIPT_CONTINUE; - } - - else if (bp == sui.BP_REVERT) - { - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.handleObjectSwapTimer() Player: "+player+" failed to destroy the canister because the player moved or was disrupted. Deposit: "+self); - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_locomotion")); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_incapacitated")); - } - else if (event == sui.CD_EVENT_DAMAGED) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_damaged")); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR)) - { - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.handleObjectSwapTimer() no countdowntimer"); - return SCRIPT_CONTINUE; - } - - int test_pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.handleObjectSwapTimer() pid != test_pid"); - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - String quest = getStringObjVar(self, "strQuest"); - if (quest == null || quest.length() <= 0) - { - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.handleObjectSwapTimer() Could not find the parent spawner quest for participating in the canister quest for canister: ("+self+"). The operation was aborted for Player: "+player); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, quest, "needsToGatherChemical")) - { - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.handleObjectSwapTimer() Player: "+player+" did not have the quest "+quest+" needed for this collection. canister: ("+self); - return SCRIPT_CONTINUE; - } - - String questSignal = getStringObjVar(self, "strSignal"); - if (questSignal == null || questSignal.length() <= 0) - { - CustomerServiceLog("nyms_themepark", "water_filtration_chemical_deposit.handleObjectSwapTimer() Could not find the parent spawner quest SIGNAL for participating in the canister quest for canister: ("+self+"). The operation was aborted for Player: "+player); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, questSignal); - - messageTo(self, "destroySelf", null, 0, false); - return SCRIPT_CONTINUE; - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - destroyObject(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/weed_quest_object.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/weed_quest_object.java deleted file mode 100644 index 387ba6ad4..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/weed_quest_object.java +++ /dev/null @@ -1,346 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.buff; -import script.library.collection; -import script.library.colors; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.money; -import script.library.pclib; -import script.library.pet_lib; -import script.library.prose; -import script.library.static_item; -import script.library.stealth; -import script.library.sui; -import script.library.trial; -import script.library.utils; - - -public class weed_quest_object extends script.base_script -{ - public weed_quest_object() - { - } - public static final String QUEST_NAME = "u16_nym_themepark_weed_pulling"; - public static final String GENERAL_QUEST_TASK = "fulfillRequisition"; - - public static final String TASK_WEED_TYPE_1 = "lowGrowingWeeds"; - public static final String TASK_WEED_TYPE_2 = "tallStalkWeed"; - public static final String TASK_WEED_TYPE_3 = "paddleCactiWeed"; - public static final String TASK_WEED_TYPE_4 = "yellowPodWeed"; - public static final String TASK_WEED_TYPE_5 = "floweringCactiWeed"; - public static final String SIGNAL_WEED_TYPE_1 = "lowGrowingWeedsFound"; - public static final String SIGNAL_WEED_TYPE_2 = "tallStalkWeedFound"; - public static final String SIGNAL_WEED_TYPE_3 = "paddleCactiWeedFound"; - public static final String SIGNAL_WEED_TYPE_4 = "yellowPodWeedFound"; - public static final String SIGNAL_WEED_TYPE_5 = "floweringCactiWeedFound"; - - public static final String THEMEPARK = "theme_park_nym/messages"; - - public static final string_id SID_NOT_WHILE_MOUNTED = new string_id(THEMEPARK, "pull_weed_not_while_mounted"); - public static final string_id SID_ZIP_BAR = new string_id(THEMEPARK, "weed_zip_bar"); - public static final string_id SID_ZIP_BAR_PADDLE = new string_id(THEMEPARK, "weed_zip_bar_paddle"); - public static final string_id SID_ZIP_BAR_LOW = new string_id(THEMEPARK, "weed_zip_bar_low"); - public static final string_id SID_ZIP_BAR_FLOWER = new string_id(THEMEPARK, "weed_zip_bar_flower"); - public static final string_id SID_ZIP_BAR_YELLOW = new string_id(THEMEPARK, "weed_zip_bar_yellow"); - public static final string_id SID_ZIP_BAR_TALL = new string_id(THEMEPARK, "weed_zip_bar_tall"); - public static final string_id SID_DONT_NEED_WEED = new string_id(THEMEPARK, "dont_need_weed"); - public static final string_id SID_CHA_CHING = new string_id(THEMEPARK, "received_credits"); - - public static final string_id SID_MNU_USE = new string_id(THEMEPARK, "pull_weed"); - public static final string_id SID_NOT_SURE_HOW_DESTROY = new string_id(THEMEPARK, "weed_not_sure_what_to_do"); - public static final string_id SID_ALRDY_COMPLETED_QUEST = new string_id(THEMEPARK, "weed_already_completed_quest"); - - public static final int COUNTDOWN_TIMER = 3; - public static final int CASH_AMOUNT = 25; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "weed_type")) - { - return SCRIPT_CONTINUE; - } - - int mnu2 = mi.addRootMenu (menu_info_types.ITEM_USE, SID_MNU_USE); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "weed_type")) - { - return SCRIPT_CONTINUE; - } - - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (pet_lib.isMounted(player)) - { - sendSystemMessage(player, SID_NOT_WHILE_MOUNTED); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(player, QUEST_NAME)) - { - sendSystemMessage(player, SID_NOT_SURE_HOW_DESTROY); - CustomerServiceLog("nyms_themepark", "weed_quest_object.OnObjectMenuSelect() Player: "+player+" did not have the quest "+QUEST_NAME+" needed for this collection. canister: ("+self); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, QUEST_NAME, GENERAL_QUEST_TASK)) - { - sendSystemMessage(player, SID_NOT_SURE_HOW_DESTROY); - CustomerServiceLog("nyms_themepark", "weed_quest_object.OnObjectMenuSelect() Player: "+player+" did not have the quest "+QUEST_NAME+" needed for this collection. canister: ("+self); - return SCRIPT_CONTINUE; - } - - int weedType = getIntObjVar(self, "weed_type"); - if (weedType < 0) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.OnObjectMenuSelect() Weed: "+self+" did not have a valid weed type var"); - return SCRIPT_CONTINUE; - } - - string_id zipBar = SID_ZIP_BAR; - - switch(weedType) - { - case 1: - zipBar = SID_ZIP_BAR_LOW; - break; - case 2: - zipBar = SID_ZIP_BAR_TALL; - break; - case 3: - zipBar = SID_ZIP_BAR_PADDLE; - break; - case 4: - zipBar = SID_ZIP_BAR_YELLOW; - break; - case 5: - zipBar = SID_ZIP_BAR_FLOWER; - break; - default: - break; - } - - int startTime = 0; - int range = 3; - int flags = 0; - - flags |= sui.CD_EVENT_INCAPACITATE; - flags |= sui.CD_EVENT_DAMAGED; - - stealth.testInvisNonCombatAction(player, self); - int countdownSui = sui.smartCountdownTimerSUI(self, player, "quest_countdown_timer", zipBar, startTime, COUNTDOWN_TIMER, "handleObjectSwapTimer", range, flags); - CustomerServiceLog("nyms_themepark", "weed_quest_object.OnObjectMenuSelect() Player: "+player+" is destroying Nym Weed: "+self); - - return SCRIPT_CONTINUE; - } - - - public int handleObjectSwapTimer(obj_id self, dictionary params) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (params == null || params.equals("")) - { - return SCRIPT_CONTINUE; - } - - int pid = params.getInt("id"); - obj_id player = params.getObjId("player"); - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - - if (bp == sui.BP_CANCEL) - { - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - CustomerServiceLog("nyms_themepark", "weed_quest_object.handleObjectSwapTimer() cancelled"); - - return SCRIPT_CONTINUE; - } - - else if (bp == sui.BP_REVERT) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.handleObjectSwapTimer() Player: "+player+" failed to destroy the canister because the player moved or was disrupted. Deposit: "+self); - - int event = params.getInt("event"); - - if (event == sui.CD_EVENT_LOCOMOTION) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_locomotion")); - } - else if (event == sui.CD_EVENT_INCAPACITATE) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_incapacitated")); - } - else if (event == sui.CD_EVENT_DAMAGED) - { - sendSystemMessage(player, new string_id("quest/groundquests", "countdown_interrupted_damaged")); - } - - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR)) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.handleObjectSwapTimer() no countdowntimer"); - return SCRIPT_CONTINUE; - } - - int test_pid = getIntObjVar(player, sui.COUNTDOWNTIMER_SUI_VAR); - - if (pid != test_pid) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.handleObjectSwapTimer() pid != test_pid"); - return SCRIPT_CONTINUE; - } - - forceCloseSUIPage(pid); - detachScript(player, sui.COUNTDOWNTIMER_PLAYER_SCRIPT); - - if (!groundquests.isTaskActive(player, QUEST_NAME, GENERAL_QUEST_TASK)) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.handleObjectSwapTimer() Player: "+player+" did not have the quest "+QUEST_NAME+" needed for this collection. canister: ("+self); - return SCRIPT_CONTINUE; - } - - int weedType = getIntObjVar(self, "weed_type"); - if (weedType < 0) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.OnObjectMenuSelect() Weed: "+self+" did not have a valid weed type var"); - return SCRIPT_CONTINUE; - } - - String questTask = ""; - String questSignal = ""; - - switch(weedType) - { - case 1: - questTask = TASK_WEED_TYPE_1; - questSignal = SIGNAL_WEED_TYPE_1; - break; - case 2: - questTask = TASK_WEED_TYPE_2; - questSignal = SIGNAL_WEED_TYPE_2; - break; - case 3: - questTask = TASK_WEED_TYPE_3; - questSignal = SIGNAL_WEED_TYPE_3; - break; - case 4: - questTask = TASK_WEED_TYPE_4; - questSignal = SIGNAL_WEED_TYPE_4; - break; - case 5: - questTask = TASK_WEED_TYPE_5; - questSignal = SIGNAL_WEED_TYPE_5; - break; - default: - break; - } - - if (questTask == null || questTask.length() <= 0) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.OnObjectMenuSelect() Player: "+player+" could not attain a valid quest task off the weed object: "+self); - return SCRIPT_CONTINUE; - } - - if (questSignal == null || questSignal.length() <= 0) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.OnObjectMenuSelect() Player: "+player+" could not attain a valid quest signal off the weed object: "+self); - return SCRIPT_CONTINUE; - } - - if (groundquests.isTaskActive(player, QUEST_NAME, questTask)) - { - groundquests.sendSignal(player, questSignal); - } - else - { - sendSystemMessage(player, SID_DONT_NEED_WEED); - if (!utils.hasScriptVar(player, "commPlayerWeeds")) - { - String npc = "object/mobile/nym_themepark_ran_machado.iff"; - String sound = "sound/sys_comm_rebel_male.snd"; - prose_package pp = new prose_package(); - prose.setStringId(pp, new string_id("theme_park_nym/messages", "extra_credit_weeds")); - commPlayers(player, npc, sound, 10f, player, pp); - - utils.setScriptVar(player, "commPlayerWeeds", true); - } - money.bankTo(money.ACCT_NEW_PLAYER_QUESTS, player, CASH_AMOUNT); - play2dNonLoopingSound(player, groundquests.MUSIC_QUEST_RECEIVED_CREDITS); - showFlyText(player, SID_CHA_CHING, 3.0f, colors.TOMATO); - - } - - messageTo(self, "destroySelf", null, 0, false); - return SCRIPT_CONTINUE; - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - - if (!hasObjVar(self, "mySpawner")) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.destroySelf() The Weed: "+self+" did not have a parent objvar. The parent cannot be told to destroy self."); - } - - obj_id parent = getObjIdObjVar(self, "mySpawner"); - if (!isValidId(parent)) - { - CustomerServiceLog("nyms_themepark", "weed_quest_object.destroySelf() The Weed: "+self+" did not have a valid parent objvar. The parent may already be destroyed."); - } - - messageTo(parent, "destroySelf", null, 0, false); - destroyObject(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/nym/weed_spawning.java b/sku.0/sys.server/compiled/game/script/theme_park/nym/weed_spawning.java deleted file mode 100644 index 942028806..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/nym/weed_spawning.java +++ /dev/null @@ -1,161 +0,0 @@ -package script.theme_park.nym; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.create; - - -public class weed_spawning extends script.base_script -{ - public weed_spawning() - { - } - public static final String[] WEEDS = - { - "object/tangible/furniture/nym_themepark/nym_themepark_plant_01.iff", - "object/tangible/furniture/nym_themepark/nym_themepark_plant_02.iff", - "object/tangible/furniture/nym_themepark/nym_themepark_plant_03.iff", - "object/tangible/furniture/nym_themepark/nym_themepark_plant_04.iff", - "object/tangible/furniture/nym_themepark/nym_themepark_plant_05.iff", - "object/tangible/furniture/nym_themepark/nym_themepark_plant_06.iff", - "object/tangible/furniture/nym_themepark/nym_themepark_plant_07.iff", - "object/tangible/furniture/nym_themepark/nym_themepark_plant_08.iff", - "object/tangible/furniture/nym_themepark/nym_themepark_plant_09.iff", - "object/tangible/furniture/nym_themepark/nym_themepark_plant_10.iff", - "object/tangible/furniture/nym_themepark/nym_themepark_plant_11.iff" - }; - - - public int OnAttach(obj_id self) throws InterruptedException - { - CustomerServiceLog("nyms_themepark", "weed_spawning.OnAttach() Initializing spawning functionality for spawner: "+self); - messageTo(self, "spawnObject", null, 1, false); - - return SCRIPT_CONTINUE; - } - - - public int spawnObject(obj_id self, dictionary params) throws InterruptedException - { - if (hasObjVar(self, "child")) - { - return SCRIPT_CONTINUE; - } - CustomerServiceLog("nyms_themepark", "weed_spawning.spawnObject() Spawning functionality is initialized for spawner: "+self); - - obj_id parentObject = getObjIdObjVar(self, "objParent"); - if (!isValidId(parentObject)) - { - CustomerServiceLog("nyms_themepark", "weed_spawning.spawnObject() Master Object does not exist"); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "strQuest") || !hasObjVar(self, "strSignal")) - { - CustomerServiceLog("nyms_themepark", "weed_spawning.spawnObject() Spawner Object does not have quest data"); - return SCRIPT_CONTINUE; - } - - String questName = getStringObjVar(self, "strQuest"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("nyms_themepark", "weed_spawning.spawnObject() Spawner Object hase invalid quest string"); - return SCRIPT_CONTINUE; - } - - String signalName = getStringObjVar(self, "strSignal"); - if (signalName == null || signalName.length() <= 0) - { - CustomerServiceLog("nyms_themepark", "weed_spawning.spawnObject() Spawner Object hase invalid quest signal string"); - return SCRIPT_CONTINUE; - } - - int randomSpawnObject = rand(0,10); - if (randomSpawnObject < 0) - { - randomSpawnObject = 0; - } - obj_id object = obj_id.NULL_ID; - - switch(randomSpawnObject) - { - case 0: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - case 1: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - case 2: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - case 3: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - case 4: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - case 5: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - case 6: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - case 7: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - case 8: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - case 9: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - case 10: - object = create.object(WEEDS[randomSpawnObject], getLocation(self)); - break; - default: - object = create.object(WEEDS[0], getLocation(self)); - break; - } - - if (!isValidId(object) || !exists(object)) - { - CustomerServiceLog("nyms_themepark", "weed_spawning.spawnObject() object: "+object+" could not be found. Critical failure. Aborting."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("nyms_themepark", "weed_spawning.spawnObject() Mob: "+object+" WAS SUCCESSFULLY CREATED for spawner: "+self); - - setObjVar(object, "mySpawner", self); - setObjVar(object, "parentNode", parentObject); - setObjVar(object, "objParent", parentObject); - setObjVar(object, "questName", questName); - setObjVar(object, "signalName", signalName); - setObjVar(self, "child", object); - return SCRIPT_CONTINUE; - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - - if (hasObjVar(self, "child")) - { - obj_id child = getObjIdObjVar(self, "child"); - if (isValidId(child) && exists(child)) - { - destroyObject(child); - } - } - - destroyObject(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/beast_pathing.java b/sku.0/sys.server/compiled/game/script/theme_park/outbreak/beast_pathing.java deleted file mode 100644 index ec1d1560d..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/beast_pathing.java +++ /dev/null @@ -1,618 +0,0 @@ -package script.theme_park.outbreak; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.attrib; -import script.library.chat; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.stealth; -import script.library.trial; -import script.library.utils; - - -public class beast_pathing extends script.base_script -{ - public beast_pathing() - { - } - public static final boolean LOGGING_ON = true; - public static final String SCRIPT_LOG = "outbreak_pathing"; - public static final String PATHING_NODE = "pathing_node"; - public static final String SPAWNER_PATH = "spawner_path"; - public static final String SUCCESS_SIGNAL = "success_signal"; - public static final String FAIL_SIGNAL = "fail_signal"; - public static final String UPDATE_SIGNAL = "update_signal"; - public static final String STORMTROOPER_RETREAT = "stormtrooper_retreat"; - public static final String ENEMY_LIST = "enemyList"; - public static final String WAYPOINT_LIST = "wayPointList"; - public static final String WAYPOINT_LOCS = "wayPtLocs"; - - public static final int RADIUS = 2000; - public static final int MAXDIST = 30; - - public static final String CREATURE_TABLE = "datatables/mob/creatures.iff"; - - public static final string_id SID_YOU_WENT_TOO_FAR = new string_id("theme_park/outbreak/outbreak","delivery_you_went_too_far"); - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - messageTo(self, "blowUp", null, 2, false); - return SCRIPT_CONTINUE; - } - - - public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException - { - if (!hasObjVar(self,"invln")) - { - return SCRIPT_CONTINUE; - } - - setAttrib(self, HEALTH, getMaxAttrib( self, HEALTH )); - return SCRIPT_CONTINUE; - } - - - public int OnObjectDamaged(obj_id self, obj_id attacker, obj_id weapon, int damage) throws InterruptedException - { - if (!hasObjVar(self,"invln")) - { - return SCRIPT_CONTINUE; - } - - setHitpoints(self, getMaxHitpoints(self)); - return SCRIPT_CONTINUE; - } - - - public int blowUp(obj_id self, dictionary params) throws InterruptedException - { - obj_id[] playerTargets = trial.getValidPlayersInRadius(self, 7); - obj_id[] npcTargets = getNPCsInRange(getLocation(self), 10); - - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0.4f); - - if (playerTargets != null && playerTargets.length > 0) - { - - for (int i=0; i 0) - { - - for (int a=0; a 1 && i != wayPtLocs.length - 1) - { - spawnUndead(self, wayPtLocs[i]); - } - } - - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-10)); - patrolOnce(self, wayPtLocs, 0); - messageTo(self, "checkOwnerValidity", null, 10, false); - - return SCRIPT_CONTINUE; - } - - - public int cleanUpDeliveryBeast(obj_id self, dictionary params) throws InterruptedException - { - - obj_id[] enemyArray = utils.getObjIdArrayScriptVar(self, ENEMY_LIST); - if (enemyArray != null && enemyArray.length > 0) - { - for (int i=0; i MAXDIST) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" has been left alone and is destroying self, failing quest for player. The distance between player and NPC was: "+distanceCheck); - - sendSystemMessage(owner, SID_YOU_WENT_TOO_FAR); - failBeastDeliveryQuest(self); - return SCRIPT_CONTINUE; - } - - if (!ai_lib.isInCombat(self)) - { - - if (!hasObjVar(self, "lastLocation")) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" is checking its very first location. Will check again later to see if stuck."); - setObjVar(self,"lastLocation", getLocation(self)); - } - else - { - - location currentLocation = getLocation(self); - location lastLocation = getLocationObjVar(self, "lastLocation"); - if (Math.abs(currentLocation.x - lastLocation.x) < 0.5 && Math.abs(currentLocation.z - lastLocation.z) < 0.5) - { - - if (!hasObjVar(self, WAYPOINT_LIST)) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" is STUCK and doesnt have waypoint object list. Blowing up this NPC!"); - messageTo(self, "blowUp", null, 2, false); - } - if (!hasObjVar(self, WAYPOINT_LOCS)) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" is STUCK and doesnt have waypoint location list. Blowing up this NPC!"); - messageTo(self, "blowUp", null, 2, false); - } - - obj_id waypointList[] = getObjIdArrayObjVar(self, WAYPOINT_LIST); - if (waypointList == null || waypointList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" is STUCK and doesnt have a valid waypoint object list. Blowing up this NPC!"); - messageTo(self, "blowUp", null, 2, false); - } - - location waypointLocList[] = getLocationArrayObjVar(self, WAYPOINT_LOCS); - if (waypointLocList == null || waypointLocList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" is STUCK and doesnt have a valid waypoint location list. Blowing up this NPC!"); - messageTo(self, "blowUp", null, 2, false); - } - - float smallestDist = 300; - obj_id closestObj = obj_id.NULL_ID; - boolean modified = false; - for (int i = 0; i < waypointList.length; i++) - { - testAbortScript(); - if (!isValidId(waypointList[i]) || !exists(waypointList[i])) - { - continue; - } - - float npcAndWaypointDist = getDistance(self, waypointList[i]); - if (npcAndWaypointDist > smallestDist) - { - - continue; - } - else - { - - smallestDist = npcAndWaypointDist; - closestObj = waypointList[i]; - modified = true; - } - } - - if (isValidId(closestObj) && exists(closestObj)) - { - - if (!hasObjVar(closestObj, "pathNode")) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" is STUCK and the closest pathNode has not pathNode number. Blowing up this NPC!"); - messageTo(self, "blowUp", null, 2, false); - } - - int pathNodePriority = getIntObjVar(closestObj, "pathNode"); - int newArrayLength = (waypointList.length - (pathNodePriority - 1)); - - if (newArrayLength < 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" is STUCK and the pathNode priority was: "+pathNodePriority+" while the waypoint length was: "+waypointList.length+". subtracting the 2 gave an invalid number. Blowing up this NPC!"); - messageTo(self, "blowUp", null, 2, false); - } - else if (newArrayLength == 0 || newArrayLength == 1) - { - - pathTo(self, waypointLocList[waypointLocList.length-1]); - } - else - { - - location[] newPathLocs = new location[newArrayLength]; - System.arraycopy(waypointLocList, (pathNodePriority - 1), newPathLocs, 0, newArrayLength); - patrolOnce(self,newPathLocs); - } - } - - } - else - { - - setObjVar(self,"lastLocation", getLocation(self)); - } - } - } - else - { - - } - messageTo(self, "checkOwnerValidity", null, 10, false); - - return SCRIPT_CONTINUE; - } - - - public int cleanUpCampNpcAndParent(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self,"owner")) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self,"questName")) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self,"escortTask")) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self,"successSignalName")) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self,"collectionSlot")) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() Initial validation completed for creature: "+self); - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() My Location is: "+getLocation(self)); - - obj_id owner = getObjIdObjVar(self, "owner"); - if (!isValidId(owner) || !exists(owner)) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() Mob: "+self+" FAILED TO FIND OWNER OBJVAR."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() creature: "+self+" has owner: "+owner); - String collectionSlot = getStringObjVar(self,"collectionSlot"); - if (collectionSlot == null || collectionSlot.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" FAILED TO FIND collectionSlot OBJVAR."); - return SCRIPT_CONTINUE; - } - - String questName = getStringObjVar(self,"questName"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() Mob: "+self+" FAILED TO FIND QUESTNAME OBJVAR for player: "+owner); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() creature: "+self+" has quest: "+questName); - - String escortTask = getStringObjVar(self,"escortTask"); - if (escortTask == null || escortTask.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() Mob: "+self+" FAILED TO FIND ESCORT TASK OBJVAR for player: "+owner); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() creature: "+self+" has escort task: "+escortTask); - - String successSignalName = getStringObjVar(self,"successSignalName"); - if (escortTask == null || escortTask.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() Mob: "+self+" FAILED TO FIND success TASK OBJVAR for player: "+owner); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() creature: "+self+" has successSignalName: "+successSignalName); - - if (!groundquests.isTaskActive(owner, questName, escortTask)) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() Mob: "+self+" FAILED TO FIND success TASK OBJVAR for player: "+owner); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "beast_pathing.cleanUpCampNpcAndParent() creature: "+self+" is sending success signal to player "+owner+" quest"); - groundquests.sendSignal(owner, successSignalName); - - messageTo(self, "cleanUpDeliveryBeast", null, 5, true); - - if (!hasCompletedCollection(owner, collectionSlot)) - { - modifyCollectionSlotValue(owner, collectionSlot, 1); - } - return SCRIPT_CONTINUE; - } - - - public boolean failBeastDeliveryQuest(obj_id self) throws InterruptedException - { - - if (!hasObjVar(self,"owner")) - { - return false; - } - if (!hasObjVar(self,"questName")) - { - return false; - } - if (!hasObjVar(self,"escortTask")) - { - return false; - } - if (!hasObjVar(self,"failSignalName")) - { - return false; - } - - obj_id owner = getObjIdObjVar(self, "owner"); - if (!isValidId(owner) || !exists(owner)) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.failBeastDeliveryQuest() Mob: "+self+" FAILED TO FIND OWNER OBJVAR."); - return false; - } - - String questName = getStringObjVar(self,"questName"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.failBeastDeliveryQuest() Mob: "+self+" FAILED TO FIND QUESTNAME OBJVAR for player: "+owner); - return false; - } - - String escortTask = getStringObjVar(self,"escortTask"); - if (escortTask == null || escortTask.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.failBeastDeliveryQuest() Mob: "+self+" FAILED TO FIND ESCORT TASK OBJVAR for player: "+owner); - return false; - } - - String failSignalName = getStringObjVar(self,"failSignalName"); - if (escortTask == null || escortTask.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.failBeastDeliveryQuest() Mob: "+self+" FAILED TO FIND FAIL TASK OBJVAR for player: "+owner); - return false; - } - - CustomerServiceLog("outbreak_themepark", "beast_pathing.failBeastDeliveryQuest() creature: "+self+" has failSignalName: "+failSignalName); - - if (!groundquests.isTaskActive(owner, questName, escortTask)) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.failBeastDeliveryQuest() Mob: "+self+" FAILED TO FIND FAIL TASK OBJVAR for player: "+owner); - return false; - } - CustomerServiceLog("outbreak_themepark", "beast_pathing.failBeastDeliveryQuest() creature: "+self+" is sending fail signal to player "+owner+" quest"); - - groundquests.sendSignal(owner, failSignalName); - messageTo(self, "cleanUpDeliveryBeast", null, 1, false); - - return true; - } - - - public boolean spawnUndead(obj_id self, location wayptLoc) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.spawnUndead() Init."); - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (wayptLoc == null) - { - return false; - } - - if (!hasObjVar(self,"owner")) - { - return false; - } - if (!hasObjVar(self,"combatLevel")) - { - return false; - } - - obj_id owner = getObjIdObjVar(self, "owner"); - if (!isValidId(owner) || !exists(owner)) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.spawnUndead() Mob: "+self+" FAILED TO FIND OWNER OBJVAR."); - return false; - } - CustomerServiceLog("outbreak_themepark", "beast_pathing.spawnUndead() Initial validation completed."); - - int combatLevel = getIntObjVar(self, "combatLevel") - 5; - CustomerServiceLog("outbreak_themepark", "beast_pathing.spawnUndead() NPC combatLevel: "+combatLevel); - int spawnCount = 0; - int spawnDecider = rand(0,4); - if (spawnDecider == 2 || spawnDecider == 3) - { - spawnCount = 1; - } - else if (spawnDecider == 4) - { - spawnCount = 2; - } - - String creatureName = "outbreak_afflicted_defense"; - for (int i = 0; i < spawnCount; i++) - { - testAbortScript(); - location randomLoc = utils.getRandomLocationInRing(wayptLoc, 5.0f, 10.0f); - - obj_id mob = create.object(creatureName, randomLoc); - if (!isValidId(mob) || !exists(mob)) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.spawnUndead() Mob: "+mob+" could not be created!"); - continue; - } - - CustomerServiceLog("outbreak_themepark", "beast_pathing.spawnUndead() Mob level is set to match player level"); - - setObjVar(mob, create.INITIALIZE_CREATURE_DO_NOT_SCALE_OBJVAR, 1); - - dictionary creatureDict = utils.dataTableGetRow(CREATURE_TABLE, creatureName); - if (creatureDict != null) - { - create.initializeCreature (mob, creatureName, creatureDict, combatLevel); - } - CustomerServiceLog("outbreak_themepark", "beast_pathing.spawnUndead() Mob level is set to match player level."); - - setInvulnerable(mob, false); - clearCondition(mob, CONDITION_CONVERSABLE); - setAttributeAttained(mob, attrib.OUTBREAK_AFFLICTED); - setObjVar(mob, "owner", self); - - attachScript(mob, "theme_park.outbreak.dynamic_enemy"); - CustomerServiceLog("outbreak_themepark", "beast_pathing.spawnUndead() the NPC is spawned for beast: "+self); - - if (!utils.hasScriptVar(self, ENEMY_LIST)) - { - Vector enemies = null; - enemies = utils.addElement(enemies, mob); - utils.setScriptVar(self, ENEMY_LIST, enemies); - } - else - { - Vector enemyVector = null; - obj_id[] enemyArray = utils.getObjIdArrayScriptVar(self, ENEMY_LIST); - Vector enemies = utils.concatArrays(enemyVector, enemyArray); - enemies = utils.addElement(enemies, mob); - utils.setScriptVar(self, ENEMY_LIST, enemies); - } - - } - return true; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/blackwing_canister_destroy.java b/sku.0/sys.server/compiled/game/script/theme_park/outbreak/blackwing_canister_destroy.java deleted file mode 100644 index 75df70ed0..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/blackwing_canister_destroy.java +++ /dev/null @@ -1,173 +0,0 @@ -package script.theme_park.outbreak; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.factions; -import script.library.groundquests; -import script.library.trial; -import script.library.utils; - - -public class blackwing_canister_destroy extends script.base_script -{ - public blackwing_canister_destroy() - { - } - - public int OnAttach(obj_id self) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_destroy.OnAttach() Canister ("+self+") has the proper script"); - messageTo(self, "setUp", null, 1, false); - return SCRIPT_CONTINUE; - } - - - public int setUp(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_destroy.setUp() Canister ("+self+") is getting the player owner OID."); - - obj_id player = getObjIdObjVar(self, "owner"); - if (isValidId(player) && exists(player)) - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_destroy.OnAttach() Canister ("+self+") has the player OID: "+player); - playClientEffectObj(player, "sound/amb_beeping_timer.snd", self, ""); - } - messageTo(self, "blowUp", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int blowUp(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_destroy.blowUp() blowUp ("+self+") is blowing up. the player owner OID."); - obj_id player = getObjIdObjVar(self, "owner"); - if (!isValidId(player) || !exists(player)) - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_collection.blowUp() Could not find the player owner for this object: "+self); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - if (hasCompletedCollection(player, "deathtrooper_virus_canister_demo")) - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_collection.blowUp() Player completed collection already. Aborting credit for Player: "+player); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - String quest = getStringObjVar(self, "quest"); - if (quest == null || quest.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_collection.blowUp() Could not find the parent spawner quest for participating in the canister quest for canister: ("+self+"). The operation was aborted for Player: "+player); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, quest, "canisterWaitingForSignal")) - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_collection.blowUp() Player: "+player+" did not have the quest "+quest+" needed for this collection. canister: ("+self); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - String questSignal = getStringObjVar(self, "questSignal"); - if (questSignal == null || questSignal.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_collection.blowUp() Could not find the parent spawner quest SIGNAL for participating in the canister quest for canister: ("+self+"). The operation was aborted for Player: "+player); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - String collectionSlot = getStringObjVar(self, "collectionSlot"); - if (collectionSlot == null || collectionSlot.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_collection.blowUp() Could not find canister: "+self+" collection slot: "+collectionSlot); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - if (!hasCompletedCollectionSlotPrereq(player, collectionSlot)) - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_collection.blowUp() The player: "+player+" somehow managed to destroy the canister even though they do not have the collection prereq slot. object: "+self); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - if (hasCompletedCollectionSlot(player, collectionSlot)) - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_collection.blowUp() Player completed collection SLOT. Aborting credit for Player: "+player); - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - destroyObject(self); - return SCRIPT_CONTINUE; - } - - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0); - - if (modifyCollectionSlotValue(player, collectionSlot, 1)) - { - CustomerServiceLog("outbreak_themepark", "blackwing_canister_collection.blowUp() Player: "+player+" has received collection credit for the collection slot: "+collectionSlot+"completed collection SLOT. Aborting credit for Player: "+player); - - if (hasCompletedCollectionSlot(player, collectionSlot)) - { - groundquests.sendSignal(player, questSignal); - } - } - obj_id[] playerTargets = trial.getValidPlayersInRadius(self, 7); - obj_id[] npcTargets = getNPCsInRange(getLocation(self), 10); - - playClientEffectLoc(self, "clienteffect/combat_explosion_lair_large.cef", getLocation(self), 0.4f); - - if (playerTargets != null && playerTargets.length > 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.blowUp() Valid player in radius found."); - - for (int i=0; i 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.blowUp() Valid NPCs in radius."); - - for (int a=0; a 90) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.OnTriggerVolumeEntered() Player "+whoTriggeredMe+" has a level that is invalid. Player level is: "+combatLevel+". Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - - dictionary webster = new dictionary(); - webster.put("player", whoTriggeredMe); - webster.put("questName", questName); - webster.put("combatLevel", combatLevel); - webster.put("ourSpawner", ourSpawner); - messageTo(self, "updatePlayerDefense", webster, WAIT_DELAY, false); - messageTo(self, "failPlayerDefense", webster, FAIL_TIMER, false); - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - blog("Exited trigger volume: "+whoTriggeredMe); - if (!hasObjVar(self, "questObject")) - { - return SCRIPT_CONTINUE; - } - - if (!isPlayer(whoTriggeredMe)) - { - return SCRIPT_CONTINUE; - } - - String questName = getStringObjVar(self, "questObject"); - if (questName == null || questName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(self, GUARD_OCCUPIED)) - { - obj_id occupyingPlayer = utils.getObjIdScriptVar(self,GUARD_OCCUPIED); - if (!isValidId(whoTriggeredMe) || !exists(whoTriggeredMe) || occupyingPlayer == whoTriggeredMe) - { - utils.removeScriptVar(self,GUARD_OCCUPIED); - } - } - - if (!groundquests.isQuestActive(whoTriggeredMe, questName)) - { - return SCRIPT_CONTINUE; - } - - if ((!groundquests.isTaskActive(whoTriggeredMe, questName, "surviveTimer") && !groundquests.isTaskActive(whoTriggeredMe, questName, "waitToCleanUpAll"))) - { - return SCRIPT_CONTINUE; - } - - dictionary webster = new dictionary(); - webster.put("player", whoTriggeredMe); - webster.put("questName", questName); - messageTo(self, "failPlayerDefense", webster, 0, false); - return SCRIPT_CONTINUE; - } - - - public int updatePlayerDefense(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() initialized."); - - if ((params == null) || (params.isEmpty())) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() Params invalid."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("player")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() player param not found."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("questName")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() questName param not found."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("combatLevel")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() questName param not found."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("ourSpawner")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() ourSpawner param not found."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() validation completed."); - - obj_id player = params.getObjId("player"); - if (!isValidId(player) || !exists(player)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() player OID invalid."); - return SCRIPT_CONTINUE; - } - String questName = params.getString("questName"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() player "+player+" has received an invalid quest name."); - return SCRIPT_CONTINUE; - } - int combatLevel = params.getInt("combatLevel"); - if (combatLevel < 0 || combatLevel > 90) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() Player "+player+" has a level that is invalid. Player level is: "+combatLevel+". Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(player, questName)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() Player "+player+" did not have the appropriate quest active. Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, questName, WAITING_TO_START)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() Player "+player+" did not have the appropriate quest TASK active. Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - obj_id ourSpawner = params.getObjId("ourSpawner"); - if (!isValidId(ourSpawner) || !exists(ourSpawner)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() ourSpawner OID invalid."); - return SCRIPT_CONTINUE; - } - if (utils.hasScriptVar(player, "enemyList")) - { - utils.removeScriptVar(player, "enemyList"); - } - - groundquests.sendSignal(player, BEGIN_DEFENSE_SIGNAL); - CustomerServiceLog("outbreak_themepark", "camp_defense.updatePlayerDefense() messaging Spawner."); - messageTo(ourSpawner, "startSpawning", params, 1, false); - utils.setScriptVar(self, GUARD_OCCUPIED, player); - utils.setScriptVar(player, GUARD_OCCUPIED, self); - - return SCRIPT_CONTINUE; - } - - - public int failPlayerDefense(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "camp_defense.failPlayerDefense() has initialized"); - - if ((params == null) || (params.isEmpty())) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.failPlayerDefense() Params invalid."); - return SCRIPT_CONTINUE; - - } - if (!params.containsKey("player")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.failPlayerDefense() player param not found."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("questName")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.failPlayerDefense() questName param not found."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense.failPlayerDefense() validation completed"); - - obj_id player = params.getObjId("player"); - if (!isValidId(player) || !exists(player)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.failPlayerDefense() player OID invalid."); - return SCRIPT_CONTINUE; - } - - String questName = params.getString("questName"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.failPlayerDefense() player "+player+" has received an invalid quest name."); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(player, questName)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.failPlayerDefense() Player "+player+" did not have the appropriate quest active. Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - - if ((!utils.hasScriptVar(player, "givenMoreDefenseTime") && ai_lib.isInCombat(player) && utils.hasScriptVar(player, "enemyList") && utils.hasScriptVar(self, "ourSpawner"))) - { - obj_id ourSpawner = utils.getObjIdScriptVar(self, "ourSpawner"); - if (isValidId(ourSpawner) && exists(ourSpawner)) - { - int spawnAmt = getIntObjVar(ourSpawner, "numberOfEnemies"); - if (spawnAmt > 0) - { - obj_id[] enemyList = utils.getObjIdArrayScriptVar(player, "enemyList"); - if (enemyList != null && enemyList.length > 0) - { - if (spawnAmt > enemyList.length) - { - utils.setScriptVar(player, "givenMoreDefenseTime", true); - messageTo(self, "failPlayerDefense", params, FAIL_TIMER, false); - return SCRIPT_CONTINUE; - } - } - } - } - } - - groundquests.sendSignal(player, FAIL_DEFENSE_SIGNAL); - utils.removeScriptVar(self,GUARD_OCCUPIED); - return SCRIPT_CONTINUE; - } - - - public int triggerVolFailsafe(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "camp_defense.triggerVolFailsafe() initializing triggerVolFailsafe to make sure the object has a volume trigger on "+self); - - createTriggerVolume(TRIGGER_NAME_PREFIX + self, TRIGGER_RADIUS, true); - if (!hasTriggerVolume(self, TRIGGER_NAME_PREFIX + self)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.triggerVolFailsafe() initializing triggerVolFailsafe has failed for "+self+". Critical failure."); - messageTo(self, "triggerVolFailsafe", null, 2, false); - } - return SCRIPT_CONTINUE; - } - - - public int findPathNodes(obj_id self, dictionary params) throws InterruptedException - { - if (!hasObjVar(self, "questObject")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findPathNodes() initializing failed. The controller, "+self+" had no questObject objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - String questName = getStringObjVar(self, "questObject"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findPathNodes() initializing failed. The controller, "+self+" had no questName objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - obj_id[] spawnerList = getAllObjectsWithObjVar(getLocation(self), SEARCH_RADIUS, SPAWNER_OBJVAR); - if (spawnerList == null || spawnerList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findPathNodes() the controller, "+self+" failed to find any valid spawner objects within "+SEARCH_RADIUS+" of "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - obj_id ourSpawner = obj_id.NULL_ID; - - for (int i = 0; i < spawnerList.length; i++) - { - testAbortScript(); - String spawnerQuestNameMatch = getStringObjVar(spawnerList[i], SPAWNER_OBJVAR); - if (spawnerQuestNameMatch == null || spawnerQuestNameMatch.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findPathNodes() the controller, "+self+" found a spawner object that did not have a quest string. Spawner: "+spawnerList[i]); - continue; - } - if (!spawnerQuestNameMatch.equals(questName)) - { - continue; - } - - ourSpawner = spawnerList[i]; - break; - } - - if (!isValidId(ourSpawner) || !exists(ourSpawner)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense.findPathNodes() the controller, "+self+" failed to find any valid spawner objects (after a loop of all objects) within "+SEARCH_RADIUS+" of "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, "ourSpawner", ourSpawner); - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(SCRIPT_LOG,msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/camp_defense_spawner.java b/sku.0/sys.server/compiled/game/script/theme_park/outbreak/camp_defense_spawner.java deleted file mode 100644 index 41cd94b4c..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/camp_defense_spawner.java +++ /dev/null @@ -1,352 +0,0 @@ -package script.theme_park.outbreak; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.attrib; -import script.library.create; -import script.library.groundquests; -import script.library.stealth; -import script.library.utils; - - -public class camp_defense_spawner extends script.base_script -{ - public camp_defense_spawner() - { - } - public static final boolean LOGGING_ON = true; - - public static final String SCRIPT_LOG = "outbreak_trigger"; - public static final String CLIENT_EFFECT = "appearance/pt_smoke_puff.prt"; - public static final String SPAWNER_OBJVAR = "spawnerObject"; - public static final String PATHNODE_OBJVAR = "pathObject"; - public static final String PATHNODE_PRIORITY = "pathPriority"; - public static final String SURVIVAL_TASK = "surviveTimer"; - public static final String MOB_TO_SPAWN = "outbreak_afflicted_defense"; - public static final String NUMBER_ENEMIES_VAR = "numberOfEnemies"; - public static final String LEVEL_ENEMIES_VAR = "maxLevelOfEnemies"; - public static final String ENEMY_LIST = "enemyList"; - - public static final float SEARCH_RADIUS = 300f; - public static final String CREATURE_TABLE = "datatables/mob/creatures.iff"; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.OnInitialize() initializing a spawner for camp defense."); - - if (!hasObjVar(self, SPAWNER_OBJVAR)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.OnInitialize() initializing failed. The spawner, "+self+" had no objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - messageTo(self, "findPathNodes", null, 3, false); - return SCRIPT_CONTINUE; - } - - - public int startSpawning(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() Initialized!"); - - if ((params == null) || (params.isEmpty())) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() Params invalid."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("player")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() player param not found."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("questName")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() questName param not found."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("combatLevel")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() questName param not found."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("ourSpawner")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() ourSpawner param not found."); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, NUMBER_ENEMIES_VAR)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() number of enemies objvar not found."); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() validation completed."); - - int numberOfEnemies = getIntObjVar(self,NUMBER_ENEMIES_VAR); - if (numberOfEnemies <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() number of enemies objvar not valid."); - return SCRIPT_CONTINUE; - } - - int maxLevelOfEnemies = getIntObjVar(self,LEVEL_ENEMIES_VAR); - if (maxLevelOfEnemies <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() number of enemies objvar not valid."); - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId("player"); - if (!isValidId(player) || !exists(player)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() player OID invalid."); - return SCRIPT_CONTINUE; - } - String questName = params.getString("questName"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() player "+player+" has received an invalid quest name."); - return SCRIPT_CONTINUE; - } - int combatLevel = params.getInt("combatLevel"); - if (combatLevel < 0 || combatLevel > 90) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() Player "+player+" has a level that is invalid. Player level is: "+combatLevel+". Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - - if (combatLevel > maxLevelOfEnemies) - { - params.put("creatureLevel", maxLevelOfEnemies); - } - else - { - params.put("creatureLevel", combatLevel); - } - - if (!groundquests.isQuestActive(player, questName)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() Player "+player+" did not have the appropriate quest active. Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isTaskActive(player, questName, SURVIVAL_TASK)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() Player "+player+" did not have the appropriate quest TASK active. Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.startSpawning() Spawn Loop starting."); - - int delay = 0; - for (int i = 0; i < numberOfEnemies; i++) - { - testAbortScript(); - messageTo(self, "spawnDynamicEnemy", params, delay, false); - delay += 5; - } - - return SCRIPT_CONTINUE; - } - - - public int spawnDynamicEnemy(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() Params invalid."); - return SCRIPT_CONTINUE; - - } - if (!params.containsKey("player")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() player param not found."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("questName")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() questName param not found."); - return SCRIPT_CONTINUE; - } - if (!params.containsKey("creatureLevel")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() creatureLevel param not found."); - return SCRIPT_CONTINUE; - } - obj_id player = params.getObjId("player"); - if (!isValidId(player) || !exists(player)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() player OID invalid."); - return SCRIPT_CONTINUE; - } - String questName = params.getString("questName"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() player "+player+" has received an invalid quest name."); - return SCRIPT_CONTINUE; - } - if (!groundquests.isQuestActive(player, questName)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() Player "+player+" did not have the appropriate quest active. Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - if (!groundquests.isTaskActive(player, questName, SURVIVAL_TASK)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() Player "+player+" did not have the appropriate quest TASK active. Aborting the camp defense."); - return SCRIPT_CONTINUE; - } - int combatLevel = params.getInt("creatureLevel"); - if (combatLevel <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() Player "+player+" did not have the appropriate combat level for spawner. Aborting."); - return SCRIPT_CONTINUE; - } - - if (!utils.hasScriptVar(self, "patrolList")) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() spawner, "+self+", did not have the path node script var. Aborting."); - return SCRIPT_CONTINUE; - } - - location patrolList[] = utils.getLocationArrayScriptVar(self, "patrolList"); - if (patrolList == null || patrolList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() spawner, "+self+", did not have valid path nodes. Aborting."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() patrolList[0]: "+patrolList[0]); - - obj_id mob = create.object(MOB_TO_SPAWN, getLocation(self)); - if (!isValidId(mob) || !exists(mob)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() Mob: "+MOB_TO_SPAWN+" could not be created!"); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() Mob level is set to match player level"); - - setObjVar(mob, create.INITIALIZE_CREATURE_DO_NOT_SCALE_OBJVAR, 1); - - String creatureName = getStringObjVar(mob, "creature_type"); - if (creatureName != null && creatureName.length() > 0) - { - dictionary creatureDict = utils.dataTableGetRow(CREATURE_TABLE, creatureName); - if (creatureDict != null) - { - create.initializeCreature (mob, creatureName, creatureDict, combatLevel); - } - } - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() Mob level is set to match player level."); - - setInvulnerable(mob, false); - clearCondition(mob, CONDITION_CONVERSABLE); - setMovementRun(mob); - setBaseRunSpeed(mob, (getBaseRunSpeed(self)-8)); - setAttributeAttained(mob, attrib.OUTBREAK_AFFLICTED); - - setObjVar(mob, "owner", player); - setObjVar(mob, "questName", questName); - setObjVar(mob, "survivalTaskName", SURVIVAL_TASK); - setObjVar(mob, "cleanUpTaskName", "waitToCleanUpAll"); - - attachScript(mob, "theme_park.outbreak.outbreak_defense_enemy"); - utils.setScriptVar(mob, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, patrolList); - utils.setScriptVar(mob, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(mob, patrolList, 0); - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() the NPC is successfully pathing."); - - if (!utils.hasScriptVar(player, ENEMY_LIST)) - { - Vector enemies = null; - enemies = utils.addElement(enemies, mob); - utils.setScriptVar(player, ENEMY_LIST, enemies); - } - else - { - Vector enemyVector = null; - obj_id[] enemyArray = utils.getObjIdArrayScriptVar(player, ENEMY_LIST); - Vector enemies = utils.concatArrays(enemyVector, enemyArray); - if (enemies == null || enemies.size() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.spawnDynamicEnemy() could not retrieve data from the current enemy list on the spawner: "+self); - return SCRIPT_CONTINUE; - } - enemies = utils.addElement(enemies, mob); - utils.setScriptVar(player, ENEMY_LIST, enemies); - } - - return SCRIPT_CONTINUE; - } - - - public int findPathNodes(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.findPathNodes() handler init."); - if (!hasObjVar(self, SPAWNER_OBJVAR)) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.OnInitialize() initializing failed. The spawner, "+self+" had no objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - String questName = getStringObjVar(self, SPAWNER_OBJVAR); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.OnInitialize() initializing failed. The spawner, "+self+" didnt have a valid questName objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - obj_id[] pathNodeList = getAllObjectsWithObjVar(getLocation(self), SEARCH_RADIUS, PATHNODE_OBJVAR); - if (pathNodeList == null || pathNodeList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.OnInitialize() the spawner, "+self+" failed to find any valid path node objects within "+SEARCH_RADIUS+" of "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.findPathNodes() pathNodeList.length: "+pathNodeList.length); - - Vector nodePtLocs = new Vector(); - nodePtLocs.setSize(0); - - for (int i = 0; i < pathNodeList.length; i++) - { - testAbortScript(); - if (!getStringObjVar(pathNodeList[i], PATHNODE_OBJVAR).equals(questName)) - { - continue; - } - - utils.addElement(nodePtLocs, getLocation(pathNodeList[i])); - } - - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.findPathNodes() nodePtLocs.length: "+nodePtLocs.size()); - if (nodePtLocs == null || nodePtLocs.size() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.OnInitialize() the spawner, "+self+" failed to get a list of nodes for all spawns to follow."); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "camp_defense_spawner.findPathNodes() nodePtLocs[0] "+((location)(nodePtLocs.get(0)))); - - utils.setScriptVar(self, "patrolList", nodePtLocs); - - return SCRIPT_CONTINUE; - } - - - public boolean blog(String msg) throws InterruptedException - { - if (LOGGING_ON) - { - LOG(SCRIPT_LOG,msg); - } - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/camp_survivor_spawning.java b/sku.0/sys.server/compiled/game/script/theme_park/outbreak/camp_survivor_spawning.java deleted file mode 100644 index 389a2099e..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/camp_survivor_spawning.java +++ /dev/null @@ -1,130 +0,0 @@ -package script.theme_park.outbreak; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.ai_lib; -import script.library.attrib; -import script.library.create; -import script.library.holiday; -import script.library.utils; - - -public class camp_survivor_spawning extends script.base_script -{ - public camp_survivor_spawning() - { - } - public static final int RADIUS = 1000; - - - public int OnAttach(obj_id self) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.OnAttach() Initializing spawning functionality for spawner: "+self); - if (!hasScript(self, holiday.EVENT_TRACKER_SCRIPT)) - { - attachScript(self, holiday.EVENT_TRACKER_SCRIPT); - } - - int randomTime = rand(3,25); - if (randomTime < 0 || randomTime > 25) - { - randomTime = 3; - } - - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.OnAttach() Spawning functionality beginning in: "+randomTime+" frames for spawner: "+self); - - messageTo(self, "spawnSurvivor", null, randomTime, false); - - messageTo(self, "destroySelf", null, 600, false); - - return SCRIPT_CONTINUE; - } - - - public int spawnSurvivor(obj_id self, dictionary params) throws InterruptedException - { - if (hasObjVar(self, "child")) - { - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Spawning functionality is initialized for spawner: "+self); - - obj_id parentObject = getObjIdObjVar(self, "objParent"); - if (!isValidId(parentObject) || !exists(parentObject)) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Master Object does not exist"); - return SCRIPT_CONTINUE; - } - - String questName = getStringObjVar(parentObject, "questName"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Master Object: "+parentObject+" does not have a valid questName."); - return SCRIPT_CONTINUE; - } - - String failMessage = getStringObjVar(parentObject, "failMessage"); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Master Object: "+parentObject+" does not have a valid questName."); - return SCRIPT_CONTINUE; - } - - String creatureType = getStringObjVar(self, "mob"); - if (creatureType == null || creatureType.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Spawning failed because mob var was null for spawner: "+self); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Preparing to spawn mob: "+creatureType+" at: "+getLocation(self)+" for spawner: "+self); - obj_id mob = create.object(creatureType, getLocation(self)); - if (!isValidId(mob) || !exists(mob)) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Mob: "+mob+" could not be created!"); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Mob: "+mob+" WAS SUCCESSFULLY CREATED for spawner: "+self); - - setObjVar(mob, "mySpawner", self); - setObjVar(mob, "parentNode", parentObject); - setObjVar(mob, "objParent", parentObject); - setObjVar(mob, "questName", questName); - setObjVar(mob, "failMessage", failMessage); - setObjVar(self, "child", mob); - - utils.setScriptVar(mob, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - setAttributeAttained(mob, attrib.OUTBREAK_SURVIVOR); - - pathTo(mob,getLocation(parentObject)); - - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() the mob is now set to run path."); - return SCRIPT_CONTINUE; - } - - - public int destroySelf(obj_id self, dictionary params) throws InterruptedException - { - - if (hasObjVar(self, "child")) - { - obj_id child = getObjIdObjVar(self, "child"); - if (isValidId(child) && exists(child)) - { - destroyObject(child); - } - } - - destroyObject(self); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/delivery_beast_spawner.java b/sku.0/sys.server/compiled/game/script/theme_park/outbreak/delivery_beast_spawner.java deleted file mode 100644 index 633b5d940..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/delivery_beast_spawner.java +++ /dev/null @@ -1,311 +0,0 @@ -package script.theme_park.outbreak; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.attrib; -import script.library.chat; -import script.library.create; -import script.library.groundquests; -import script.library.utils; - - -public class delivery_beast_spawner extends script.base_script -{ - public delivery_beast_spawner() - { - } - public static final boolean LOGGING_ON = true; - - public static final String SCRIPT_LOG = "outbreak_delivery_trigger"; - public static final String CREATURE_NAME_OBJVAR = "creatureName"; - public static final String QUEST_NAME_OBJVAR = "questName"; - public static final String TASK_NAME_OBJVAR = "taskName"; - public static final String UPDATE_TASK_NAME_OBJVAR = "updateTaskName"; - public static final String FAIL_SIGNAL_NAME_OBJVAR = "failSignalName"; - public static final String ESCORT_TASK_NAME_OBJVAR = "escortTaskName"; - public static final String SUCCESS_SIGNAL_NAME_OBJVAR = "successSignal"; - public static final String TRIGGER_NAME_PREFIX = "camp_delivery_trigger_"; - public static final String CREATURE_TABLE = "datatables/mob/creatures.iff"; - public static final String MAX_LEVEL = "intMaxLevel"; - public static final String WAYPOINT_LIST = "wayPointList"; - public static final String WAYPOINT_LOCS = "wayPtLocs"; - public static final String COLLECTION_SLOT = "collectionSlot"; - - public static final int WAIT_DELAY = 5; - public static final float TRIGGER_RADIUS = 5f; - public static final int RADIUS = 2000; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.OnInitialize() initializing a spawner for camp defense."); - - if (!hasObjVar(self, CREATURE_NAME_OBJVAR)) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.OnInitialize() initializing failed. The spawner, "+self+" had no creature name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, QUEST_NAME_OBJVAR)) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.OnInitialize() initializing failed. The spawner, "+self+" had no camp name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, TASK_NAME_OBJVAR)) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.OnInitialize() initializing failed. The spawner, "+self+" had no quest task name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, UPDATE_TASK_NAME_OBJVAR)) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.OnInitialize() initializing failed. The spawner, "+self+" had no quest task name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, ESCORT_TASK_NAME_OBJVAR)) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.OnInitialize() initializing failed. The spawner, "+self+" had no quest task name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, FAIL_SIGNAL_NAME_OBJVAR)) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.OnInitialize() initializing failed. The spawner, "+self+" had no Fail Signal name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, SUCCESS_SIGNAL_NAME_OBJVAR)) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.OnInitialize() initializing failed. The spawner, "+self+" had no Fail Signal name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, COLLECTION_SLOT)) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.OnInitialize() initializing failed. The spawner, "+self+" had no Collection Slot name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - messageTo(self, "getAllEscortPathNodes", null, 5, false); - messageTo(self, "spawnVolunteerNPC", null, 15, false); - return SCRIPT_CONTINUE; - } - - - public int spawnVolunteerNPC(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnVolunteerNPC() Spawner: "+self+" is attempting to spawn a delivery volunteer."); - - if (!hasObjVar(self, CREATURE_NAME_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, QUEST_NAME_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, TASK_NAME_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, UPDATE_TASK_NAME_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, ESCORT_TASK_NAME_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, FAIL_SIGNAL_NAME_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, SUCCESS_SIGNAL_NAME_OBJVAR)) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, COLLECTION_SLOT)) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, WAYPOINT_LIST)) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnVolunteerNPC() Spawner: "+self+" could not find the WAYPOINT LIST OF OBJVARS on self. Attempting to use failsafe in approx 15 seconds."); - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, WAYPOINT_LOCS)) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnVolunteerNPC() Spawner: "+self+" could not find the WAYPOINT LIST OF LOCATIONS on self. Attempting to use failsafe in approx 15 seconds."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnVolunteerNPC() Initial validation completed."); - - String questName = getStringObjVar(self, QUEST_NAME_OBJVAR); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.spawnVolunteerNPC() trigger failed. The spawner, "+self+" had an INVALID quest name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - if (hasObjVar(self, "objChild")) - { - obj_id objChild = getObjIdObjVar(self,"objChild"); - if (isValidId(objChild) && exists(objChild)) - { - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnVolunteerNPC() Spawner: "+self+" was not ready for a spawner. deliveryVolunteerReady var was none existant or false"); - return SCRIPT_CONTINUE; - } - } - - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnVolunteerNPC() No existing objChild for spawner: "+questName); - - String collectionSlot = getStringObjVar(self, COLLECTION_SLOT); - if (collectionSlot == null || collectionSlot.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.spawnVolunteerNPC() trigger failed. The spawner, "+self+" had an INVALID collectionSlot name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - String creatureName = getStringObjVar(self, CREATURE_NAME_OBJVAR); - if (creatureName == null || creatureName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.spawnVolunteerNPC() trigger failed. The spawner, "+self+" had an INVALID creature name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - String taskName = getStringObjVar(self, TASK_NAME_OBJVAR); - if (taskName == null || taskName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.spawnVolunteerNPC() trigger failed. The spawner, "+self+" had an INVALID task name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - String updateTaskName = getStringObjVar(self, UPDATE_TASK_NAME_OBJVAR); - if (updateTaskName == null || updateTaskName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.spawnVolunteerNPC() trigger failed. The spawner, "+self+" had an INVALID updateTaskName objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - String escortTask = getStringObjVar(self, ESCORT_TASK_NAME_OBJVAR); - if (escortTask == null || escortTask.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.spawnVolunteerNPC() trigger failed. The spawner, "+self+" had an INVALID escortTask objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - String failSignalName = getStringObjVar(self, FAIL_SIGNAL_NAME_OBJVAR); - if (failSignalName == null || failSignalName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.spawnVolunteerNPC() trigger failed. The spawner, "+self+" had an INVALID failSignalName objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - String successSignalName = getStringObjVar(self, SUCCESS_SIGNAL_NAME_OBJVAR); - if (successSignalName == null || successSignalName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.spawnVolunteerNPC() trigger failed. The spawner, "+self+" had an INVALID successSignalName objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - int maxLevel = getIntObjVar(self, MAX_LEVEL); - if (maxLevel <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.spawnVolunteerNPC() trigger failed. The spawner, "+self+" had an INVALID maxLevel objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnVolunteerNPC() Variables created. Getting all waypoints for the NPC path"); - - location[] wayPtLocs = getLocationArrayObjVar(self, WAYPOINT_LOCS); - if (wayPtLocs == null || wayPtLocs.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" FAILED TO FIND wayPtLocs OBJVAR."); - return SCRIPT_CONTINUE; - } - - obj_id[] wayPointList = getObjIdArrayObjVar(self, WAYPOINT_LIST); - if (wayPointList == null || wayPointList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "beast_pathing.startBeastDeliveryPathing() Mob: "+self+" FAILED TO FIND wayPointList OBJVAR."); - return SCRIPT_CONTINUE; - } - - obj_id mob = create.object(creatureName, getLocation(self)); - if (!isValidId(mob) || !exists(mob)) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.spawnVolunteerNPC() Mob: "+mob+" could not be created!"); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "camp_survivor_spawning.spawnSurvivor() Mob: "+mob+" WAS SUCCESSFULLY CREATED for spawner: "+self); - setObjVar(self, "objChild", mob); - - setObjVar(mob, "objParent", self); - setObjVar(mob, "maxLevel", maxLevel); - setObjVar(mob, "ai.defaultCalmBehavior",1); - setObjVar(mob, "questName", questName); - setObjVar(mob, "escortTask", escortTask); - setObjVar(mob, "failSignalName", failSignalName); - setObjVar(mob, "successSignalName", successSignalName); - setObjVar(mob, WAYPOINT_LIST, wayPointList); - setObjVar(mob, WAYPOINT_LOCS, wayPtLocs); - setObjVar(mob, COLLECTION_SLOT, collectionSlot); - - setAttributeAttained(mob, attrib.OUTBREAK_SURVIVOR); - - return SCRIPT_CONTINUE; - } - - - public int getAllEscortPathNodes(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.getAllEscortPathNodes() the spawner "+self+" is attempting to get all path nodes for escort quests."); - - if (!hasObjVar(self, QUEST_NAME_OBJVAR)) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.getAllEscortPathNodes() Failed. The spawner, "+self+" had no camp name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - String questName = getStringObjVar(self, QUEST_NAME_OBJVAR); - if (questName == null || questName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.getAllEscortPathNodes() Failed. The spawner, "+self+" had an INVALID quest name objvar. Location: "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - obj_id[] wayPointList = getAllObjectsWithObjVar(getLocation(self), RADIUS, questName); - if (wayPointList == null || wayPointList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "delivery_beast_spawner.getAllEscortPathNodes() the spawner "+self+" failed to find any node objects within "+RADIUS+" of "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - setObjVar(self, WAYPOINT_LIST, wayPointList); - - location[] wayPtLocs = new location[wayPointList.length]; - - for (int i = 0; i < wayPointList.length; i++) - { - testAbortScript(); - int orderNumber = getIntObjVar(wayPointList[i], "pathNode") - 1; - if (orderNumber < 0) - { - continue; - } - wayPtLocs[orderNumber] = getLocation(wayPointList[i]); - } - - setObjVar(self, WAYPOINT_LOCS, wayPtLocs); - - return SCRIPT_CONTINUE; - - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/outbreak_defense_enemy.java b/sku.0/sys.server/compiled/game/script/theme_park/outbreak/outbreak_defense_enemy.java deleted file mode 100644 index 677b12b20..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/outbreak_defense_enemy.java +++ /dev/null @@ -1,235 +0,0 @@ -package script.theme_park.outbreak; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.utils; -import script.library.groundquests; - -public class outbreak_defense_enemy extends script.base_script -{ - public outbreak_defense_enemy() - { - } - public static final String GUARD_OCCUPIED = "occupied"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "checkValidityOfOwner", null, 5, false); - - return SCRIPT_CONTINUE; - } - - - public int OnMovePathComplete(obj_id self) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnMovePathComplete() initialized."); - if (!hasObjVar(self, "owner")) - { - return SCRIPT_CONTINUE; - } - - obj_id owner = getObjIdObjVar(self, "owner"); - if (!isValidId(owner) || !exists(owner)) - { - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnMovePathComplete() Starting Combat with Owner."); - - startCombat(self, owner); - - return SCRIPT_CONTINUE; - } - - - public int OnDeath(obj_id self, obj_id killer, obj_id corpseId) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnDeath() Undead NPC has died. Crediting Player."); - - if (!hasObjVar(self, "questName")) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, "survivalTaskName")) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, "cleanUpTaskName")) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnDeath() Undead NPC Validation completed."); - - obj_id player = getObjIdObjVar(self, "owner"); - if (isValidId(player) && exists(player)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnDeath() Undead NPC is owned by player: "+player); - - String questName = getStringObjVar(self, "questName"); - if (questName == null || questName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - String survivalTaskName = getStringObjVar(self, "survivalTaskName"); - if (survivalTaskName == null || survivalTaskName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - String cleanUpTaskName = getStringObjVar(self, "cleanUpTaskName"); - if (cleanUpTaskName == null || cleanUpTaskName.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnDeath() Undead NPC is is sending message to player: "+player); - - dictionary webster = new dictionary(); - webster.put("questName", questName); - webster.put("survivalTaskName", survivalTaskName); - webster.put("cleanUpTaskName", cleanUpTaskName); - messageTo(player, "recalculateCampDefenseUndeadArray", webster, 0, false ); - } - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitateTarget(obj_id self, obj_id victim) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnIncapacitateTarget() Player has died. Checking if quest needs updating."); - if (!hasObjVar(self, "questName")) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, "survivalTaskName")) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, "cleanUpTaskName")) - { - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, "owner")) - { - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnIncapacitateTarget() Undead NPC Validation completed."); - - obj_id player = getObjIdObjVar(self, "owner"); - if (!isValidId(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (victim != player) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnIncapacitateTarget() Failing player's quest."); - groundquests.sendSignal(player, "campDefenseFailed"); - - if (utils.hasScriptVar(player, GUARD_OCCUPIED)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnIncapacitateTarget() Attempting to set the guard post to available."); - - obj_id guardPost = utils.getObjIdScriptVar(self,GUARD_OCCUPIED); - if (!isValidId(guardPost) || !exists(guardPost)) - { - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnIncapacitateTarget() could not find guard post objvar on player!!!"); - return SCRIPT_CONTINUE; - } - utils.removeScriptVar(guardPost, GUARD_OCCUPIED); - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.OnIncapacitateTarget() Set guard post: "+guardPost+" to available."); - } - - return SCRIPT_CONTINUE; - } - - - public int checkValidityOfOwner(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.checkValidityOfOwner() Initalized Message Handler."); - - if (!hasObjVar(self, "questName")) - { - messageTo(self, "cleanUpEnemy", null, 0, false); - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, "survivalTaskName")) - { - messageTo(self, "cleanUpEnemy", null, 0, false); - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, "cleanUpTaskName")) - { - messageTo(self, "cleanUpEnemy", null, 0, false); - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, "owner")) - { - messageTo(self, "cleanUpEnemy", null, 0, false); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.checkValidityOfOwner() Undead NPC Validation completed."); - - obj_id player = getObjIdObjVar(self, "owner"); - if (!isValidId(player) || !exists(player)) - { - messageTo(self, "cleanUpEnemy", null, 0, false); - return SCRIPT_CONTINUE; - } - String questName = getStringObjVar(self, "questName"); - if (questName == null || questName.length() <= 0) - { - messageTo(self, "cleanUpEnemy", null, 0, false); - return SCRIPT_CONTINUE; - } - if (!groundquests.isQuestActive(player, questName)) - { - removeGuardPostFlag(player); - messageTo(self, "cleanUpEnemy", null, 0, false); - return SCRIPT_CONTINUE; - } - messageTo(self, "checkValidityOfOwner", null, 5, false); - return SCRIPT_CONTINUE; - } - - - public int cleanUpEnemy(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.cleanUpEnemy() Initalized Message Handler."); - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public boolean removeGuardPostFlag(obj_id player) throws InterruptedException - { - if (!isValidId(player) || !exists(player)) - { - return false; - } - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.removeGuardPostFlag() Player "+player+" is attempting to remove the guard post occupied flagging."); - - if (utils.hasScriptVar(player, GUARD_OCCUPIED)) - { - obj_id guardPost = utils.getObjIdScriptVar(player, GUARD_OCCUPIED); - if (isValidId(guardPost) && exists(guardPost)) - { - utils.removeScriptVar(guardPost, GUARD_OCCUPIED); - return true; - } - } - CustomerServiceLog("outbreak_themepark", "outbreak_defense_enemy.removeGuardPostFlag() Player "+player+" did not have the guard post oid or the oid was invalid."); - return false; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/rescue_trigger_volume.java b/sku.0/sys.server/compiled/game/script/theme_park/outbreak/rescue_trigger_volume.java deleted file mode 100644 index 16e9574ec..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/rescue_trigger_volume.java +++ /dev/null @@ -1,223 +0,0 @@ -package script.theme_park.outbreak; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.create; -import script.library.groundquests; -import script.library.stealth; -import script.library.utils; - - -public class rescue_trigger_volume extends script.base_script -{ - public rescue_trigger_volume() - { - } - public static final boolean LOGGING_ON = true; - - public static final String TRIGGER_NAME_PREFIX = "rescue_trigger_"; - public static final String TRIGGER = "meatlump_spy_trigger"; - public static final String MEATLUMP_ENEMY_SCRIPT = "creature.dynamic_enemy"; - public static final String PHRASE_STRING_FILE = "phrase_string_file"; - public static final String SPAM_STRING_FILE = "spam"; - public static final String SCRIPT_LOG = "outbreak_trigger"; - public static final String CLIENT_EFFECT = "appearance/pt_smoke_puff.prt"; - public static final String QUEST_STRING = "quest/outbreak_quest_rescue_0"; - public static final String QUEST_TASK_NAME = "spawnSurvivor"; - public static final String QUEST_SIGNAL = "survivorHasBeenSpawned"; - public static final String WAYPOINT_LIST = "wayPointList"; - public static final String WAYPOINT_LOCS = "wayPtLocs"; - - public static final float TRIGGER_RADIUS = 3f; - public static final int RADIUS = 300; - - public static final String[] MOB_FOR_QUEST = - { - "outbreak_rescue_inquisitor", - "outbreak_rescue_officer", - "outbreak_rescue_prisoner", - "outbreak_rescue_scientist", - "outbreak_rescue_inquisitor", - "outbreak_rescue_inquisitor", - "outbreak_rescue_inquisitor", - "outbreak_rescue_officer", - "outbreak_rescue_officer", - "outbreak_rescue_officer", - "outbreak_rescue_prisoner", - "outbreak_rescue_prisoner", - "outbreak_rescue_prisoner", - "outbreak_rescue_scientist", - "outbreak_rescue_scientist", - "outbreak_rescue_scientist" - }; - - - public int OnInitialize(obj_id self) throws InterruptedException - { - - createTriggerVolume(TRIGGER_NAME_PREFIX + self, TRIGGER_RADIUS, true); - messageTo(self, "getAllEscortPathNodes", null, 5, false); - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeEntered(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - if (!isPlayer(whoTriggeredMe)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "spawner")) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, WAYPOINT_LIST)) - { - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() Spawner: "+self+" could not find the WAYPOINT LIST OF OBJVARS on self."); - - return SCRIPT_CONTINUE; - } - if (!hasObjVar(self, WAYPOINT_LOCS)) - { - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() Spawner: "+self+" could not find the WAYPOINT LIST OF LOCATIONS on self."); - return SCRIPT_CONTINUE; - } - - int spawner = getIntObjVar(self, "spawner"); - - location[] wayPtLocs = getLocationArrayObjVar(self, WAYPOINT_LOCS); - if (wayPtLocs == null || wayPtLocs.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() Spawner: "+self+" FAILED TO FIND wayPtLocs OBJVAR."); - return SCRIPT_CONTINUE; - } - - obj_id[] wayPointList = getObjIdArrayObjVar(self, WAYPOINT_LIST); - if (wayPointList == null || wayPointList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() Spawner: "+self+" FAILED TO FIND wayPointList OBJVAR."); - return SCRIPT_CONTINUE; - } - - if (!groundquests.isQuestActive(whoTriggeredMe, QUEST_STRING+spawner)) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() Ground Quest found for Player: "+getPlayerName(whoTriggeredMe)+" ("+whoTriggeredMe+ ")"); - - if (!groundquests.isTaskActive(whoTriggeredMe, QUEST_STRING+spawner, QUEST_TASK_NAME)) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() Ground Quest Task found for Player: "+getPlayerName(whoTriggeredMe)+" ("+whoTriggeredMe+ ")"); - - String invis = stealth.getInvisBuff(whoTriggeredMe); - if (invis != null) - { - stealth.checkForAndMakeVisibleNoRecourse(self); - } - - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() Sending Ground Quest signal for Player: "+getPlayerName(whoTriggeredMe)+" ("+whoTriggeredMe+ ")"); - groundquests.sendSignal(whoTriggeredMe, QUEST_SIGNAL); - - location curLoc = utils.getRandomLocationInRing(getLocation(self), 0.01f, 1.0f); - - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() Preparing to spawn NPC at: "+curLoc+" for Player: "+getPlayerName(whoTriggeredMe)+" ("+whoTriggeredMe+ ")"); - obj_id mob = create.object(MOB_FOR_QUEST[spawner-1], curLoc); - if (!isValidId(mob) || !exists(mob)) - { - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() Mob: "+MOB_FOR_QUEST[spawner-1]+" could not be created!"); - return SCRIPT_CONTINUE; - } - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() Mob: "+MOB_FOR_QUEST[spawner-1]+" WAS SICCESSFULLY CREATED for Player: "+getPlayerName(whoTriggeredMe)+" ("+whoTriggeredMe+ ")"); - - setObjVar(mob, "myEscort", whoTriggeredMe); - playClientEffectObj(mob, CLIENT_EFFECT, whoTriggeredMe, ""); - setObjVar(mob, "clientEffect", CLIENT_EFFECT); - setObjVar(mob, WAYPOINT_LIST, wayPointList); - setObjVar(mob, WAYPOINT_LOCS, wayPtLocs); - - pathTo(mob,getLocation(whoTriggeredMe)); - - messageTo(mob, "cleanUpNpcTimer", null, 60, false); - setObjVar(mob, "neverSpokenTo", true); - - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.OnTriggerVolumeEntered() NPC spawned "+mob+" for Player: "+getPlayerName(whoTriggeredMe)+" ("+whoTriggeredMe+ "). This NPC is now ready to talk to the player"); - - return SCRIPT_CONTINUE; - } - - - public int OnTriggerVolumeExited(obj_id self, String volumeName, obj_id whoTriggeredMe) throws InterruptedException - { - return SCRIPT_CONTINUE; - } - - - public int getAllEscortPathNodes(obj_id self, dictionary params) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.getAllEscortPathNodes() the spawner "+self+" is attempting to get all path nodes for escort quests."); - - int spawner = getIntObjVar(self, "spawner"); - if (spawner < 0) - { - CustomerServiceLog("outbreak_themepark", "rescue_trigger_volume.getAllEscortPathNodes() the spawner "+self+" could not find the appropriate spawner integer objvar on self."); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "survivor_pathing.getAllEscortPathNodes() spawner: "+spawner); - - String creatureType = MOB_FOR_QUEST[spawner-1]; - if (creatureType == null || creatureType.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.getAllEscortPathNodes() the NPC creature_type was not valid"); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "survivor_pathing.getAllEscortPathNodes() the NPC creature_type is: "+creatureType); - - obj_id[] wayPointList = getAllObjectsWithObjVar(getLocation(self), RADIUS, creatureType); - if (wayPointList == null || wayPointList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.startSurvivorPathing() the NPC failed to find any objects within "+RADIUS+" of "+getLocation(self)); - return SCRIPT_CONTINUE; - } - - location[] wayPtLocs = new location[wayPointList.length]; - - for (int i = 0; i < wayPointList.length; i++) - { - testAbortScript(); - int orderNumber = getIntObjVar(wayPointList[i], creatureType) - 1; - if (orderNumber < 0) - { - - continue; - } - wayPtLocs[orderNumber] = getLocation(wayPointList[i]); - } - - if (wayPtLocs == null || wayPtLocs.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.startSurvivorPathing() unable to get a list of locations for hte NPC"); - return SCRIPT_CONTINUE; - } - setObjVar(self, WAYPOINT_LIST, wayPointList); - setObjVar(self, WAYPOINT_LOCS, wayPtLocs); - - return SCRIPT_CONTINUE; - - } - -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/survivor_pathing.java b/sku.0/sys.server/compiled/game/script/theme_park/outbreak/survivor_pathing.java deleted file mode 100644 index c9642bc1f..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/outbreak/survivor_pathing.java +++ /dev/null @@ -1,375 +0,0 @@ -package script.theme_park.outbreak; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.attrib; -import script.library.create; -import script.library.groundquests; -import script.library.stealth; -import script.library.utils; - - -public class survivor_pathing extends script.base_script -{ - public survivor_pathing() - { - } - public static final boolean LOGGING_ON = true; - public static final String SCRIPT_LOG = "outbreak_pathing"; - public static final String PATHING_NODE = "pathing_node"; - public static final String SPAWNER_PATH = "spawner_path"; - public static final String SUCCESS_SIGNAL = "success_signal"; - public static final String FAIL_SIGNAL = "fail_signal"; - public static final String UPDATE_SIGNAL = "update_signal"; - public static final String WAYPOINT_LIST = "wayPointList"; - public static final String WAYPOINT_LOCS = "wayPtLocs"; - - public static final int RADIUS = 300; - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - if (hasObjVar(self, "rescue") || hasObjVar(self, "incap")) - { - return SCRIPT_CONTINUE; - } - - setObjVar(self, "incap", true); - playerFailedQuest(self); - - return SCRIPT_CONTINUE; - } - - - public int OnDestroy(obj_id self) throws InterruptedException - { - obj_id player = getObjIdObjVar(self, "myEscort"); - if (isValidId(player)) - { - npcEndConversation(player); - } - - if (hasObjVar(self, "rescue") || hasObjVar(self, "incap")) - { - return SCRIPT_CONTINUE; - } - - playerFailedQuest(self); - return SCRIPT_CONTINUE; - } - - - public int OnMovePathComplete(obj_id self) throws InterruptedException - { - - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); - - return SCRIPT_CONTINUE; - } - - - public int OnMoveMoving(obj_id self) throws InterruptedException - { - - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); - - return SCRIPT_CONTINUE; - } - - - public int startSurvivorPathing(obj_id self, dictionary params) throws InterruptedException - { - - String creatureType = getStringObjVar(self, "creature_type"); - if (creatureType == null || creatureType.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.startSurvivorPathing() the NPC creature_type was not valid"); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, WAYPOINT_LOCS)) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.startSurvivorPathing() Mob: "+self+" FAILED TO FIND waypointPathNodeLocations OBJVAR."); - return SCRIPT_CONTINUE; - } - - location[] wayPtLocs = getLocationArrayObjVar(self, WAYPOINT_LOCS); - if (wayPtLocs == null || wayPtLocs.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.startSurvivorPathing() Mob: "+self+" FAILED TO FIND waypointPathNodeLocations OBJVAR."); - return SCRIPT_CONTINUE; - } - - setMovementRun(self); - setBaseRunSpeed(self, (getBaseRunSpeed(self)-8)); - - setInvulnerable(self, false); - - utils.setScriptVar(self, ai_lib.SCRIPTVAR_CACHED_PATROL_NAMED_PATH, wayPtLocs); - utils.setScriptVar(self, ai_lib.SCRIPTVAR_CACHED_PATROL_TYPE, 0); - patrolOnce(self, wayPtLocs, 0); - detachScript(self, "conversation.survivor_01"); - clearCondition(self, CONDITION_CONVERSABLE); - setAttributeAttained(self, attrib.OUTBREAK_SURVIVOR); - - messageTo(self, "checkOwnerValidity", null, 10, false); - - return SCRIPT_CONTINUE; - } - - - public int creditPlayerRescue(obj_id self, dictionary params) throws InterruptedException - { - - if (!playerSuccessQuest(self)) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.creditPlayerRescue() ERROR - Player could not be properly credited for rescuing this NPC."); - } - else - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.creditPlayerRescue() Player was properly credited for rescuing this NPC."); - destroyObject(self); - } - return SCRIPT_CONTINUE; - } - - - public int cleanUpNpcTimer(obj_id self, dictionary params) throws InterruptedException - { - - if (!isValidId(self) || !exists(self)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, "neverSpokenTo")) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.cleanUpNpcTimer() The player owner has alread spoken to this NPC, this NPC will not destroy self early."); - return SCRIPT_CONTINUE; - } - - destroyObject(self); - return SCRIPT_CONTINUE; - } - - - public boolean playerFailedQuest(obj_id self) throws InterruptedException - { - - obj_id player = getObjIdObjVar(self, "myEscort"); - if (!isValidId(player)) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.playerFailedQuest() Player: "+player+" IOD was invalid so the player could not receive the fail signal."); - return false; - } - - String signalFail = getStringObjVar(self, FAIL_SIGNAL); - if (signalFail == null || signalFail.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.playerFailedQuest() The Rescued NPC did not have the appropriate FAIL signal as an objvar for Player: "+player+" ("+getPlayerName(player)+")."); - return false; - } - - groundquests.sendSignal(player, signalFail); - return true; - } - - - public boolean playerSuccessQuest(obj_id self) throws InterruptedException - { - - if (hasObjVar(self, "incap")) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.playerSuccessQuest() The NPC was incapacitated and the player actually didn't rescue the NPC before death. Exiting this function."); - return false; - } - - obj_id player = getObjIdObjVar(self, "myEscort"); - if (!isValidId(player)) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.playerSuccessQuest() Player: "+player+" IOD was invalid so the player could not receive the fail signal."); - return false; - } - - String signalUpdate = getStringObjVar(self, UPDATE_SIGNAL); - if (signalUpdate == null || signalUpdate.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.playerSuccessQuest() The Rescued NPC did not have the appropriate signal to update the players quest for Player: "+player+" ("+getPlayerName(player)+"). The player may not receive credit for the rescue."); - return false; - } - - groundquests.sendSignal(player, signalUpdate); - - String signalSuccess = getStringObjVar(self, SUCCESS_SIGNAL); - if (signalSuccess == null || signalSuccess.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.playerSuccessQuest() The Rescued NPC did not have the appropriate signal as an objvar for Player: "+player+" ("+getPlayerName(player)+"). The player may not receive credit for the rescue."); - return false; - } - - groundquests.sendSignal(player, signalSuccess); - - setObjVar(self, "rescue", true); - return true; - } - - - public int checkOwnerValidity(obj_id self, dictionary params) throws InterruptedException - { - - if (hasScript(self, "conversation.survivor_02")) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self,"myEscort")) - { - return SCRIPT_CONTINUE; - } - - obj_id owner = getObjIdObjVar(self, "myEscort"); - if (!isValidId(owner) || !exists(owner)) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.checkOwnerValidity() Mob: "+self+" FAILED TO FIND OWNER OBJVAR."); - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self,"creature_type")) - { - return SCRIPT_CONTINUE; - } - - String creatureType = getStringObjVar(self, "creature_type"); - if (creatureType == null || creatureType.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.startSurvivorPathing() the NPC creature_type was not valid"); - return SCRIPT_CONTINUE; - } - - if (!ai_lib.isInCombat(self)) - { - - if (!hasObjVar(self, "lastLocation")) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.checkOwnerValidity() Mob: "+self+" is checking its very first location. Will check again later to see if stuck."); - setObjVar(self,"lastLocation", getLocation(self)); - } - else - { - - location currentLocation = getLocation(self); - location lastLocation = getLocationObjVar(self, "lastLocation"); - if (Math.abs(currentLocation.x - lastLocation.x) < 0.5 && Math.abs(currentLocation.z - lastLocation.z) < 0.5) - { - - if (!hasObjVar(self, WAYPOINT_LIST)) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.checkOwnerValidity() Mob: "+self+" is STUCK and doesnt have waypoint object list. Blowing up this NPC!"); - messageTo(self, "blowUp", null, 2, false); - } - if (!hasObjVar(self, WAYPOINT_LOCS)) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.checkOwnerValidity() Mob: "+self+" is STUCK and doesnt have waypoint location list. Blowing up this NPC!"); - messageTo(self, "blowUp", null, 2, false); - } - - obj_id waypointList[] = getObjIdArrayObjVar(self, WAYPOINT_LIST); - if (waypointList == null || waypointList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.checkOwnerValidity() Mob: "+self+" is STUCK and doesnt have a valid waypoint object list. Blowing up this NPC!"); - messageTo(self, "blowUp", null, 2, false); - } - - location waypointLocList[] = getLocationArrayObjVar(self, WAYPOINT_LOCS); - if (waypointLocList == null || waypointLocList.length <= 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.checkOwnerValidity() Mob: "+self+" is STUCK and doesnt have a valid waypoint location list. Blowing up this NPC!"); - messageTo(self, "blowUp", null, 2, false); - } - - float smallestDist = 300; - obj_id closestObj = obj_id.NULL_ID; - boolean modified = false; - for (int i = 0; i < waypointList.length; i++) - { - testAbortScript(); - if (!isValidId(waypointList[i]) || !exists(waypointList[i])) - { - continue; - } - - float npcAndWaypointDist = getDistance(self, waypointList[i]); - if (npcAndWaypointDist > smallestDist) - { - - continue; - } - else - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.checkOwnerValidity() Mob: "+self+" has found a node ("+waypointList[i]+") that is closer than any previously found node. Previous dist: "+smallestDist+". New Dist: "+npcAndWaypointDist); - - smallestDist = npcAndWaypointDist; - closestObj = waypointList[i]; - modified = true; - } - } - - if (isValidId(closestObj) && exists(closestObj)) - { - - if (!hasObjVar(closestObj, creatureType)) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.checkOwnerValidity() Mob: "+self+" is STUCK and the closest pathNode has no pathNode number!"); - return SCRIPT_CONTINUE; - } - - int pathNodePriority = getIntObjVar(closestObj, creatureType); - int newArrayLength = (waypointList.length - (pathNodePriority - 1)); - - if (newArrayLength < 0) - { - CustomerServiceLog("outbreak_themepark", "survivor_pathing.checkOwnerValidity() Mob: "+self+" pathNode priority was: "+pathNodePriority+" while the waypoint length was: "+waypointList.length+". subtracting the 2 gave an invalid number!"); - return SCRIPT_CONTINUE; - - } - else if (newArrayLength == 0 || newArrayLength == 1) - { - - pathTo(self, waypointLocList[waypointLocList.length-1]); - return SCRIPT_CONTINUE; - } - else - { - - location[] newPathLocs = new location[newArrayLength]; - System.arraycopy(waypointLocList, (pathNodePriority-1), newPathLocs, 0, newArrayLength); - patrolOnce(self,newPathLocs); - } - } - - } - else - { - - setObjVar(self,"lastLocation", getLocation(self)); - } - } - } - else - { - - } - messageTo(self, "checkOwnerValidity", null, 10, false); - - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/outbreak_prolog/dead_npc_script.java b/sku.0/sys.server/compiled/game/script/theme_park/outbreak_prolog/dead_npc_script.java deleted file mode 100644 index a9ce23f1a..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/outbreak_prolog/dead_npc_script.java +++ /dev/null @@ -1,269 +0,0 @@ -package script.theme_park.outbreak_prolog; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.ai_lib; -import script.library.attrib; -import script.library.create; -import script.library.factions; -import script.library.groundquests; -import script.library.holiday; -import script.library.utils; - - -public class dead_npc_script extends script.base_script -{ - public dead_npc_script() - { - } - public static final String MENU_STRING_FILE = "theme_park/outbreak/outbreak"; - public static final String MENU_OBJ_VAR = "menu_string"; - public static final String NO_MENU_OBJ_VAR = "none"; - public static final String KEY_QUEST_INT_OBJVAR = "quest"; - public static final String SIGNAL_INT_OBJVAR = "signal"; - public static final String IMPERIAL_KEY_QUEST = "outbreak_quest_administrative_building_imperial_0"; - public static final String REBEL_KEY_QUEST = "outbreak_quest_administrative_building_rebel_0"; - public static final String NEUTRAL_KEY_QUEST = "outbreak_quest_administrative_building_neutral_0"; - public static final String NEUTRAL_SEARCH_QUEST = "outbreak_quest_facility_02_neutral"; - public static final String IMPERIAL_SEARCH_QUEST = "outbreak_quest_facility_02_imperial"; - public static final String REBEL_SEARCH_QUEST = "outbreak_quest_facility_02_rebel"; - public static final String FOUND_KEY_SIGNAL = "hasFoundKey"; - public static final String OUTBREAK_KEY_SEARCH = "search_body_outbreak_key"; - public static final String OUTBREAK_VIRUS_SEARCH = "scientist_body_searched"; - - public static final string_id SID_YOU_FIND_NOTHING = new string_id(MENU_STRING_FILE, "you_find_nothing"); - public static final string_id SID_THIS_NOT_FOR_YOU = new string_id(MENU_STRING_FILE, "this_isnt_for_you"); - public static final String CREATURE_TABLE = "datatables/mob/creatures.iff"; - - - public int OnAttach(obj_id self) throws InterruptedException - { - messageTo(self, "knockDown", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int OnInitialize(obj_id self) throws InterruptedException - { - messageTo(self, "knockDown", null, 10, false); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, MENU_OBJ_VAR)) - { - return SCRIPT_CONTINUE; - } - - String menuObjVar = getStringObjVar(self, MENU_OBJ_VAR); - if (menuObjVar == null || menuObjVar.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - if (menuObjVar.equals(NO_MENU_OBJ_VAR)) - { - return SCRIPT_CONTINUE; - } - - menu_info_data data = mi.getMenuItemByType (menu_info_types.SERVER_MENU2); - mi.addRootMenu(menu_info_types.SERVER_MENU2, new string_id(MENU_STRING_FILE, menuObjVar)); - - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (isDead(player) || isIncapacitated(player)) - { - return SCRIPT_CONTINUE; - } - - if (!hasObjVar(self, MENU_OBJ_VAR)) - { - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.SERVER_MENU2) - { - return SCRIPT_CONTINUE; - } - - String menuObjVar = getStringObjVar(self, MENU_OBJ_VAR); - if (menuObjVar == null || menuObjVar.length() <= 0) - { - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "dead_npc_script.OnObjectMenuSelect() menuObjVar: "+menuObjVar); - - if (menuObjVar.equals("content_biologist_01")) - { - if (!groundquests.isTaskActive(player, "quest_03_investigate_biolab", "getDataDisk")) - { - sendSystemMessage(player, SID_THIS_NOT_FOR_YOU); - return SCRIPT_CONTINUE; - } - - groundquests.sendSignal(player, "playerFoundDataDisk"); - return SCRIPT_CONTINUE; - } - else if (menuObjVar.equals(OUTBREAK_KEY_SEARCH)) - { - CustomerServiceLog("outbreak_themepark", "dead_npc_script.OnObjectMenuSelect() Key menu selected by Player: "+player); - - int questNumber = getIntObjVar(self, KEY_QUEST_INT_OBJVAR); - if (questNumber < 1) - { - - CustomerServiceLog("outbreak_themepark", "dead_npc_script.OnObjectMenuSelect() Quest Integer not found. Designer error for player: "+player); - sendSystemMessage(player, SID_YOU_FIND_NOTHING); - return SCRIPT_CONTINUE; - } - else if ((!groundquests.isQuestActive(player, IMPERIAL_KEY_QUEST+questNumber) && !groundquests.isQuestActive(player, REBEL_KEY_QUEST+questNumber) && !groundquests.isQuestActive(player, NEUTRAL_KEY_QUEST+questNumber))) - { - - CustomerServiceLog("outbreak_themepark", "dead_npc_script.OnObjectMenuSelect() Quest Integer found: "+questNumber+ ". Player: "+player+" didn't have proper quest."); - sendSystemMessage(player, SID_YOU_FIND_NOTHING); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "dead_npc_script.OnObjectMenuSelect() Quest Integer found: "+questNumber+ ". Player: "+player+" has quest and the quest is being updated with signal to player."); - groundquests.sendSignal(player, FOUND_KEY_SIGNAL); - spawnEnemy(self, player, getLocation(self)); - return SCRIPT_CONTINUE; - - } - else if (menuObjVar.equals(OUTBREAK_VIRUS_SEARCH)) - { - CustomerServiceLog("outbreak_themepark", "dead_npc_script.OnObjectMenuSelect() virus menu selected by Player: "+player); - - int signalNumber = getIntObjVar(self, SIGNAL_INT_OBJVAR); - if (signalNumber < 1) - { - - CustomerServiceLog("outbreak_themepark", "dead_npc_script.OnObjectMenuSelect() Signal Integer not found. Designer error for player: "+player); - sendSystemMessage(player, SID_YOU_FIND_NOTHING); - return SCRIPT_CONTINUE; - } - else if ((!groundquests.isTaskActive(player, NEUTRAL_SEARCH_QUEST, "waitForTasks") && !groundquests.isTaskActive(player, IMPERIAL_SEARCH_QUEST, "waitForTasks") && !groundquests.isTaskActive(player, REBEL_SEARCH_QUEST, "waitForTasks"))) - { - - CustomerServiceLog("outbreak_themepark", "dead_npc_script.OnObjectMenuSelect() Quest not found for Player: "+player); - sendSystemMessage(player, SID_YOU_FIND_NOTHING); - return SCRIPT_CONTINUE; - } - - CustomerServiceLog("outbreak_themepark", "dead_npc_script.OnObjectMenuSelect() Quest task found for Player: "+player); - groundquests.sendSignal(player, OUTBREAK_VIRUS_SEARCH+"_"+signalNumber); - return SCRIPT_CONTINUE; - - } - sendSystemMessage(player, SID_YOU_FIND_NOTHING); - - return SCRIPT_CONTINUE; - } - - - public int knockDown(obj_id self, dictionary params) throws InterruptedException - { - ai_lib.aiSetPosture(self, POSTURE_KNOCKED_DOWN); - return SCRIPT_CONTINUE; - } - - - public boolean spawnEnemy(obj_id self, obj_id player, location spawnLoc) throws InterruptedException - { - CustomerServiceLog("outbreak_themepark", "dead_npc_script.spawnEnemy() Initialized!"); - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!isValidId(player) || !exists(player)) - { - return false; - } - if (spawnLoc == null) - { - return false; - } - - if (!hasObjVar(self, "creature_type")) - { - CustomerServiceLog("outbreak_themepark", "dead_npc_script.spawnEnemy() No creature name var on object: "+self); - return false; - } - - String creatureName = getStringObjVar(self,"creature_type"); - if (creatureName == null || creatureName.length() <= 0) - { - CustomerServiceLog("outbreak_themepark", "dead_npc_script.spawnEnemy() Creature var INVALID on object: "+self); - return false; - } - - int spawnCount = 1; - if (hasObjVar(self, "spawnCount")) - { - CustomerServiceLog("outbreak_themepark", "dead_npc_script.spawnEnemy() creature spawn count var is overwriting default value of 1"); - spawnCount = getIntObjVar(self,"spawnCount"); - return false; - } - - int combatLevel = getLevel(player); - if (combatLevel < 0 || combatLevel > 90) - { - CustomerServiceLog("outbreak_themepark", "dead_npc_script.spawnEnemy() Player "+player+" has a level that is invalid. Player level is: "+combatLevel+". Aborting the camp defense."); - return false; - } - - for (int i = 0; i < spawnCount; i++) - { - testAbortScript(); - - obj_id mob = create.object(creatureName + "_undead", spawnLoc); - if (!isValidId(mob) || !exists(mob)) - { - CustomerServiceLog("outbreak_themepark", "dead_npc_script.spawnEnemy() Mob: "+mob+" could not be created!"); - return false; - } - - CustomerServiceLog("outbreak_themepark", "dead_npc_script.spawnEnemy() Mob level is set to match player level"); - - setObjVar(mob, create.INITIALIZE_CREATURE_DO_NOT_SCALE_OBJVAR, 1); - - dictionary creatureDict = utils.dataTableGetRow(CREATURE_TABLE, creatureName); - if (creatureDict != null) - { - create.initializeCreature (mob, creatureName, creatureDict, combatLevel); - } - CustomerServiceLog("outbreak_themepark", "dead_npc_script.spawnEnemy() Mob level is set to match player level."); - - setInvulnerable(mob, false); - clearCondition(mob, CONDITION_CONVERSABLE); - setMovementRun(mob); - setBaseRunSpeed(mob, (getBaseRunSpeed(self)-8)); - setAttributeAttained(mob, attrib.OUTBREAK_AFFLICTED); - setObjVar(mob, "owner", player); - - attachScript(mob, "theme_park.outbreak.dynamic_enemy"); - startCombat(mob, player); - CustomerServiceLog("outbreak_themepark", "dead_npc_script.spawnEnemy() the NPC is attacking player: "+player); - } - - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/theme_park/outbreak_prolog/publish_gift_prolog_quest.java b/sku.0/sys.server/compiled/game/script/theme_park/outbreak_prolog/publish_gift_prolog_quest.java deleted file mode 100644 index d420af19f..000000000 --- a/sku.0/sys.server/compiled/game/script/theme_park/outbreak_prolog/publish_gift_prolog_quest.java +++ /dev/null @@ -1,210 +0,0 @@ -package script.theme_park.outbreak_prolog; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -import script.library.factions; -import script.library.groundquests; -import script.library.sui; -import script.library.utils; - - -public class publish_gift_prolog_quest extends script.base_script -{ - public publish_gift_prolog_quest() - { - } - public static final string_id CALL_JABBA = new string_id ("quest/ground/util/quest_giver_object", "call_jabba"); - public static final string_id OFFER_QUEST_MSG = new string_id ("quest/ground/util/quest_giver_object", "offer_quest_comlink"); - public static final string_id SUI_TITLE = new string_id ("quest/ground/util/quest_giver_object", "sui_title"); - public static final string_id BUTTON_DECLINE = new string_id ("quest/ground/util/quest_giver_object", "button_decline"); - public static final string_id BUTTON_ACCEPT = new string_id ("quest/ground/util/quest_giver_object", "button_accept"); - public static final string_id DECLINED_QUEST = new string_id ("quest/ground/util/quest_giver_object", "declined_quest"); - public static final string_id NOT_WHILE_INCAPPED = new string_id ("quest/ground/util/quest_giver_object", "not_while_incapped"); - public static final string_id SID_NOT_WHILE_IN_COMBAT = new string_id("base_player", "not_while_in_combat"); - - public static final String PID_NAME = "prologPid"; - - public static final String QUEST_NAME_NEG_FACTION = "quest_01_comlink_call_to_adventure_neg_faction"; - public static final String QUEST_NAME_NEUT_FACTION = "quest_01_comlink_call_to_adventure_neut_faction"; - public static final String QUEST_NAME_POS_FACTION = "quest_01_comlink_call_to_adventure_pos_faction"; - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (isFreeTrialAccount(player)) - { - return SCRIPT_CONTINUE; - } - if (isInTutorialArea(player)) - { - return SCRIPT_CONTINUE; - } - int menuOption = mi.addRootMenu (menu_info_types.ITEM_USE, CALL_JABBA); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (isFreeTrialAccount(player)) - { - return SCRIPT_CONTINUE; - } - if (isInTutorialArea(player)) - { - return SCRIPT_CONTINUE; - } - - if (item != menu_info_types.ITEM_USE) - { - return SCRIPT_CONTINUE; - } - - if (getState(player, STATE_COMBAT) > 0) - { - sendSystemMessage(player, SID_NOT_WHILE_IN_COMBAT); - return SCRIPT_CONTINUE; - } - else if (isDead(player) || isIncapacitated(player)) - { - sendSystemMessage(player, NOT_WHILE_INCAPPED); - return SCRIPT_CONTINUE; - } - - if (((groundquests.isQuestActiveOrComplete(player, QUEST_NAME_POS_FACTION)) || (groundquests.isQuestActiveOrComplete(player, QUEST_NAME_NEG_FACTION)) || (groundquests.isQuestActiveOrComplete(player, QUEST_NAME_NEUT_FACTION)))) - { - CustomerServiceLog("outbreak_themepark", "publish_gift_prolog_quest: Deleting Object: "+self+" because player has Deathtrooper Quest active or complete already."); - destroySelf(self); - return SCRIPT_CONTINUE; - } - - if (utils.hasScriptVar(player, "questGiver.openSui")) - { - int oldSui = utils.getIntScriptVar(player, "questGiver.openSui"); - utils.removeScriptVar(player, "questGiver.openSui"); - if (oldSui > -1) - { - forceCloseSUIPage(oldSui); - } - } - - string_id sid_offerText = SUI_TITLE; - - String title = utils.packStringId(sid_offerText); - String testMsg = utils.packStringId(OFFER_QUEST_MSG); - String ok_button = utils.packStringId(BUTTON_ACCEPT); - String cancel_button = utils.packStringId(BUTTON_DECLINE); - - int pid = sui.createSUIPage( sui.SUI_MSGBOX, self, player, "handleQuestOfferResponse"); - - setSUIProperty(pid, sui.MSGBOX_TITLE, sui.PROP_TEXT, title); - setSUIProperty(pid, sui.MSGBOX_PROMPT, sui.PROP_TEXT, testMsg); - - sui.msgboxButtonSetup(pid, sui.YES_NO); - setSUIProperty(pid, sui.MSGBOX_BTN_OK, sui.PROP_TEXT, ok_button); - setSUIProperty(pid, sui.MSGBOX_BTN_CANCEL, sui.PROP_TEXT, cancel_button); - - utils.setScriptVar(player, "questGiver.openSui", pid); - sui.showSUIPage( pid ); - - return SCRIPT_CONTINUE; - } - - - public int handleQuestOfferResponse(obj_id self, dictionary params) throws InterruptedException - { - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - obj_id player = sui.getPlayerId(params); - - if (!isIdValid(player) || !exists(player)) - { - return SCRIPT_CONTINUE; - } - - if (((groundquests.isQuestActiveOrComplete(player, QUEST_NAME_POS_FACTION)) || (groundquests.isQuestActiveOrComplete(player, QUEST_NAME_NEG_FACTION)) || (groundquests.isQuestActiveOrComplete(player, QUEST_NAME_NEUT_FACTION)))) - { - CustomerServiceLog("outbreak_themepark", "publish_gift_prolog_quest: Deleting Object: "+self+" because player has Deathtrooper Quest active or complete already."); - destroySelf(self); - return SCRIPT_CONTINUE; - } - - int bp = sui.getIntButtonPressed(params); - switch ( bp ) - { - case sui.BP_OK: - grantTheCorrectQuest(self, player); - break; - - case sui.BP_CANCEL: - sendSystemMessage(player, DECLINED_QUEST); - break; - } - return SCRIPT_CONTINUE; - } - - - public void destroySelf(obj_id self) throws InterruptedException - { - detachScript(self,"item.special.nodestroy"); - destroyObject(self); - } - - - public boolean grantTheCorrectQuest(obj_id comlink, obj_id player) throws InterruptedException - { - if (!isIdValid(comlink) || !exists(comlink)) - { - return false; - } - - if (!isIdValid(player) || !exists(player)) - { - return false; - } - - if (hasCompletedCollectionSlot(player, "bdg_thm_park_jabba_badge")) - { - groundquests.grantQuest(player, QUEST_NAME_POS_FACTION); - } - - else - { - float factionAmount = factions.getFactionStanding(player, "jabba"); - if (factionAmount < -2000) - { - groundquests.grantQuest(player, QUEST_NAME_NEG_FACTION); - } - else if (factionAmount >= 100) - { - groundquests.grantQuest(player, QUEST_NAME_POS_FACTION); - } - else - { - groundquests.grantQuest(player, QUEST_NAME_NEUT_FACTION); - } - } - destroySelf(comlink); - return true; - } -} diff --git a/sku.0/sys.server/compiled/game/script/working/cannot_die.java b/sku.0/sys.server/compiled/game/script/working/cannot_die.java deleted file mode 100644 index 875751594..000000000 --- a/sku.0/sys.server/compiled/game/script/working/cannot_die.java +++ /dev/null @@ -1,37 +0,0 @@ -package script.working; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - - -public class cannot_die extends script.base_script -{ - public cannot_die() - { - } - - public int OnCreatureDamaged(obj_id self, obj_id attacker, obj_id weapon, int[] damage) throws InterruptedException - { - setAttrib(self, HEALTH, 100); - return SCRIPT_CONTINUE; - } - - - public int OnObjectDamaged(obj_id self, obj_id attacker, obj_id weapon, int damage) throws InterruptedException - { - setHitpoints(self, 100); - return SCRIPT_CONTINUE; - } - - - public int OnIncapacitated(obj_id self, obj_id killer) throws InterruptedException - { - return SCRIPT_OVERRIDE; - } - -} diff --git a/sku.0/sys.server/compiled/game/script/working/color_index_testing.java b/sku.0/sys.server/compiled/game/script/working/color_index_testing.java deleted file mode 100644 index 416b0a8e7..000000000 --- a/sku.0/sys.server/compiled/game/script/working/color_index_testing.java +++ /dev/null @@ -1,115 +0,0 @@ -package script.working; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.hue; -import script.library.sui; -import script.library.utils; - - -public class color_index_testing extends script.base_script -{ - public color_index_testing() - { - } - public static final string_id PCOLOR = new string_id("sui", "set_primary_color"); - public static final string_id SCOLOR = new string_id("sui", "set_secondary_color"); - - - public int OnObjectMenuRequest(obj_id self, obj_id player, menu_info mi) throws InterruptedException - { - if (!isGod(player)) - { - return SCRIPT_CONTINUE; - } - obj_id hueObject = self; - if (!utils.isNestedWithin(hueObject, player)) - { - return SCRIPT_CONTINUE; - } - - int mnuPrimaryColor = mi.addRootMenu(menu_info_types.SERVER_MENU9, PCOLOR); - int mnuSecondaryColor = mi.addRootMenu(menu_info_types.SERVER_MENU10, SCOLOR); - return SCRIPT_CONTINUE; - } - - - public int OnObjectMenuSelect(obj_id self, obj_id player, int item) throws InterruptedException - { - if (!isGod(player)) - { - return SCRIPT_CONTINUE; - } - obj_id hueObject = self; - if (!utils.isNestedWithin(hueObject, player)) - { - return SCRIPT_CONTINUE; - } - - if (item == menu_info_types.SERVER_MENU9) - { - sui.colorize(hueObject, player, hueObject, hue.INDEX_1, "handlePrimaryColorize"); - } - if (item == menu_info_types.SERVER_MENU10) - { - sui.colorize(hueObject, player, hueObject, hue.INDEX_2, "handleSecondaryColorize"); - } - - return SCRIPT_CONTINUE; - } - - - public int handlePrimaryColorize(obj_id self, dictionary params) throws InterruptedException - { - obj_id hueObject = self; - int idx = sui.getColorPickerIndex(params); - int bp = sui.getIntButtonPressed(params); - obj_id player = sui.getPlayerId(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - if (idx > -1) - { - custom_var myVar = getCustomVarByName(hueObject, hue.INDEX_1); - if (myVar != null && myVar.isPalColor()) - { - palcolor_custom_var pcVar = (palcolor_custom_var)myVar; - pcVar.setValue(idx); - debugConsoleMsg(player, "index_color_1: "+ idx ); - - } - } - return SCRIPT_CONTINUE; - } - - - public int handleSecondaryColorize(obj_id self, dictionary params) throws InterruptedException - { - obj_id hueObject = self; - int idx = sui.getColorPickerIndex(params); - int bp = sui.getIntButtonPressed(params); - obj_id player = sui.getPlayerId(params); - if (bp == sui.BP_CANCEL) - { - return SCRIPT_CONTINUE; - } - if (idx > -1) - { - custom_var myVar = getCustomVarByName(hueObject, hue.INDEX_2); - if (myVar != null && myVar.isPalColor()) - { - palcolor_custom_var pcVar = (palcolor_custom_var)myVar; - pcVar.setValue(idx); - debugConsoleMsg(player, "index_color_2: "+ idx ); - } - } - return SCRIPT_CONTINUE; - } -} diff --git a/sku.0/sys.server/compiled/game/script/working/jhaskell_test.java b/sku.0/sys.server/compiled/game/script/working/jhaskell_test.java deleted file mode 100644 index e12901627..000000000 --- a/sku.0/sys.server/compiled/game/script/working/jhaskell_test.java +++ /dev/null @@ -1,2709 +0,0 @@ -package script.working; - -import script.*; -import script.base_class.*; -import script.combat_engine.*; -import java.util.Arrays; -import java.util.Hashtable; -import java.util.Vector; -import script.base_script; - -import script.library.advanced_turret; -import script.library.ai_lib; -import script.library.armor; -import script.library.buff; -import script.library.city; -import script.library.camping; -import script.library.collection; -import script.library.factions; -import script.library.holiday; -import script.library.house_pet; -import script.library.gcw; -import script.library.groundquests; -import script.library.loot; -import script.library.money; -import script.library.player_structure; -import script.library.qa; -import script.library.performance; -import script.library.player_structure; -import script.library.static_item; -import script.library.stealth; -import script.library.trial; -import script.library.utils; -import script.library.vendor_lib; -import script.library.weapons; - - -public class jhaskell_test extends script.base_script -{ - public jhaskell_test() - { - } - public static final int SF_COST_CITY_LOW = 16; - public static final int SF_SKILL_TRAINER = 64; - public static final String CITY_SKILL_TRAINERS = "datatables/city/skill_trainers.iff"; - - public static final string_id SID_SYS_FOUND = new string_id("treasure_map/treasure_map", "sys_found"); - public static final String SCRIPT_DUMMY_CHEST = "systems.treasure_map.base.dummy_treasure_drum"; - public static final String TREASURE_TABLE = "datatables/treasure_map/treasure_map.iff"; - public static final String DUMMY_CHEST = "object/tangible/container/drum/nonopening_treasure_drum.iff"; - public static final String LOOT_TABLE_81_90 = "treasure/treasure_81_90"; - public static final String TREASURE_GUARDS = "treasure_guard_jedi_elite"; - public static final String BOSS_MOB = "none"; - public static final int TREASURE_GUARD_LEVEL = 90; - public static final int GROUP_MODIFIER = 1; - public static final int ENEMY_COUNT = 3; - public static final int DATATABLE_IDX = 8; - - public static final String[] ALL_PLAYER_HOUSING = - { - "object/building/player/player_garage_corellia_style_01.iff", - "object/building/player/player_garage_naboo_style_01.iff", - "object/building/player/player_garage_tatooine_style_01.iff", - "object/building/player/player_guildhall_corellia_style_01.iff", - "object/building/player/player_guildhall_generic_style_01.iff", - "object/building/player/player_guildhall_naboo_style_01.iff", - "object/building/player/player_guildhall_tatooine_style_01.iff", - "object/building/player/player_guildhall_tatooine_style_02.iff", - "object/building/player/player_house_corellia_large_style_01.iff", - "object/building/player/player_house_corellia_large_style_02.iff", - "object/building/player/player_house_corellia_medium_style_01.iff", - "object/building/player/player_house_corellia_medium_style_02.iff", - "object/building/player/player_house_corellia_small_style_01.iff", - "object/building/player/player_house_corellia_small_style_01_floorplan_02.iff", - "object/building/player/player_house_corellia_small_style_02.iff", - "object/building/player/player_house_corellia_small_style_02_floorplan_02.iff", - "object/building/player/player_house_generic_large_style_01.iff", - "object/building/player/player_house_generic_large_style_02.iff", - "object/building/player/player_house_generic_medium_style_01.iff", - "object/building/player/player_house_generic_medium_style_02.iff", - "object/building/player/player_house_generic_small_style_01.iff", - "object/building/player/player_house_generic_small_style_01_floorplan_02.iff", - "object/building/player/player_house_generic_small_style_02.iff", - "object/building/player/player_house_generic_small_style_02_floorplan_02.iff", - "object/building/player/player_house_mustafar_lg.iff", - "object/building/player/player_house_naboo_large_style_01.iff", - "object/building/player/player_house_naboo_medium_style_01.iff", - "object/building/player/player_house_naboo_small_style_01.iff", - "object/building/player/player_house_naboo_small_style_02.iff", - "object/building/player/player_house_tatooine_large_style_01.iff", - "object/building/player/player_house_tatooine_medium_style_01.iff", - "object/building/player/player_house_tatooine_small_style_01.iff", - "object/building/player/player_house_tatooine_small_style_02.iff", - "object/building/player/player_merchant_tent_style_01.iff", - "object/building/player/player_merchant_tent_style_02.iff", - "object/building/player/player_merchant_tent_style_03.iff", - "object/building/player/player_mustafar_house_lg.iff" - }; - - public static final String[] ALL_PLAYER_CITY_STRUCTURES = - { - "object/building/player/city/bank_corellia.iff", - "object/building/player/city/bank_naboo.iff", - "object/building/player/city/bank_tatooine.iff", - "object/building/player/city/barn_no_planet_restriction.iff", - "object/building/player/city/cantina_corellia.iff", - "object/building/player/city/cantina_naboo.iff", - "object/building/player/city/cantina_tatooine.iff", - "object/building/player/city/cityhall_corellia.iff", - "object/building/player/city/cityhall_naboo.iff", - "object/building/player/city/cityhall_tatooine.iff", - "object/building/player/city/cloning_corellia.iff", - "object/building/player/city/cloning_naboo.iff", - "object/building/player/city/cloning_tatooine.iff", - "object/building/player/city/diner_no_planet_restriction.iff", - "object/building/player/city/e3_demo_cityhall_tatooine.iff", - "object/building/player/city/e3_demo_shuttleport_tatooine.iff", - "object/building/player/city/garden_corellia_lrg_01.iff", - "object/building/player/city/garden_corellia_lrg_02.iff", - "object/building/player/city/garden_corellia_lrg_03.iff", - "object/building/player/city/garden_corellia_lrg_04.iff", - "object/building/player/city/garden_corellia_lrg_05.iff", - "object/building/player/city/garden_corellia_med_01.iff", - "object/building/player/city/garden_corellia_med_02.iff", - "object/building/player/city/garden_corellia_med_03.iff", - "object/building/player/city/garden_corellia_med_04.iff", - "object/building/player/city/garden_corellia_med_05.iff", - "object/building/player/city/garden_corellia_sml_01.iff", - "object/building/player/city/garden_corellia_sml_02.iff", - "object/building/player/city/garden_corellia_sml_03.iff", - "object/building/player/city/garden_corellia_sml_04.iff", - "object/building/player/city/garden_corellia_sml_05.iff", - "object/building/player/city/garden_dantooine_lrg_01.iff", - "object/building/player/city/garden_dantooine_med_01.iff", - "object/building/player/city/garden_dantooine_sml_01.iff", - "object/building/player/city/garden_dathomir_lrg_01.iff", - "object/building/player/city/garden_dathomir_med_01.iff", - "object/building/player/city/garden_dathomir_sml_01.iff", - "object/building/player/city/garden_endor_lrg_01.iff", - "object/building/player/city/garden_endor_med_01.iff", - "object/building/player/city/garden_endor_sml_01.iff", - "object/building/player/city/garden_naboo_large.iff", - "object/building/player/city/garden_naboo_lrg_01.iff", - "object/building/player/city/garden_naboo_lrg_02.iff", - "object/building/player/city/garden_naboo_lrg_03.iff", - "object/building/player/city/garden_naboo_lrg_04.iff", - "object/building/player/city/garden_naboo_lrg_05.iff", - "object/building/player/city/garden_naboo_med_01.iff", - "object/building/player/city/garden_naboo_med_02.iff", - "object/building/player/city/garden_naboo_med_03.iff", - "object/building/player/city/garden_naboo_med_04.iff", - "object/building/player/city/garden_naboo_med_05.iff", - "object/building/player/city/garden_naboo_sml_01.iff", - "object/building/player/city/garden_naboo_sml_02.iff", - "object/building/player/city/garden_naboo_sml_03.iff", - "object/building/player/city/garden_naboo_sml_04.iff", - "object/building/player/city/garden_naboo_sml_05.iff", - "object/building/player/city/garden_tatooine_lrg_01.iff", - "object/building/player/city/garden_tatooine_lrg_02.iff", - "object/building/player/city/garden_tatooine_lrg_03.iff", - "object/building/player/city/garden_tatooine_lrg_04.iff", - "object/building/player/city/garden_tatooine_lrg_05.iff", - "object/building/player/city/garden_tatooine_med_01.iff", - "object/building/player/city/garden_tatooine_med_02.iff", - "object/building/player/city/garden_tatooine_med_03.iff", - "object/building/player/city/garden_tatooine_med_04.iff", - "object/building/player/city/garden_tatooine_med_05.iff", - "object/building/player/city/garden_tatooine_sml_01.iff", - "object/building/player/city/garden_tatooine_sml_02.iff", - "object/building/player/city/garden_tatooine_sml_03.iff", - "object/building/player/city/garden_tatooine_sml_04.iff", - "object/building/player/city/garden_tatooine_sml_05.iff", - "object/building/player/city/hospital_corellia.iff", - "object/building/player/city/hospital_naboo.iff", - "object/building/player/city/hospital_tatooine.iff", - "object/building/player/city/shuttleport_corellia.iff", - "object/building/player/city/shuttleport_naboo.iff", - "object/building/player/city/shuttleport_tatooine.iff", - "object/building/player/city/theater_corellia.iff", - "object/building/player/city/theater_naboo.iff", - "object/building/player/city/theater_tatooine.iff" - }; - - public static final String[] TCG_EXPANSION = - { - "item_tcg_loot_reward_series1_v_wing", - "item_tcg_loot_reward_series1_podracer_mawhonic", - "item_tcg_loot_reward_series1_sanyassan_skull", - "item_tcg_loot_reward_series1_video_game_table", - "item_tcg_loot_reward_series1_organizational_datapad", - "item_tcg_loot_reward_series1_barn", - "item_tcg_loot_reward_series1_versafunction88_datapad", - "item_tcg_loot_reward_series1_keelkana_tooth", - "item_tcg_loot_reward_series1_painting_darth_vader", - "item_tcg_loot_reward_series1_diner", - "item_tcg_loot_reward_series1_display_case_02", - "item_tcg_loot_reward_series1_greeter_ewok", - "item_tcg_loot_reward_series1_chon_bust", - "item_tcg_loot_reward_series1_vendor_bomarr_monk", - "item_tcg_loot_reward_series1_greeter_serving_droid", - "item_tcg_loot_reward_series1_drink_dispenser", - "item_tcg_loot_reward_series1_painting_alliance_propaganda", - "item_tcg_loot_reward_series1_vendor_meatlump", - "item_tcg_loot_reward_series1_arc170_flightsuit", - "item_tcg_loot_reward_series1_indoor_garden_01", - "item_tcg_loot_reward_series1_mandalorian_strongbox", - "item_tcg_loot_reward_series1_computer_console_02", - "item_tcg_loot_reward_series1_indoor_fountain_02", - "item_tcg_loot_reward_series1_lepese_dictionary", - "item_tcg_loot_reward_series1_morgukai_shadow_scroll", - "item_tcg_loot_reward_series1_snow_jacket", - "item_tcg_loot_reward_series1_darth_vader_statuette", - "item_tcg_loot_reward_series1_princess_leia_statuette", - "item_tcg_loot_reward_series1_greeter_jawa", - "item_tcg_loot_reward_series1_vendor_serving_droid", - "item_tcg_loot_reward_series1_fish_tank", - "item_tcg_loot_reward_series1_greeter_gungan" - - }; - - public static final String[] TCG_LAUNCH = - { - "item_tcg_loot_reward_series1_black_corset_dress", - "item_tcg_loot_reward_series1_naboo_jacket", - "item_tcg_loot_reward_series1_dooku_bust", - "item_tcg_loot_reward_series1_display_case_01", - "item_tcg_loot_reward_series1_gorax_ear", - "item_tcg_loot_reward_series1_bas_relief", - "item_tcg_loot_reward_series1_glowing_blue_eyes", - "item_tcg_loot_reward_series1_glowing_red_eyes", - "item_tcg_loot_reward_series1_vendor_gungan", - "item_tcg_loot_reward_series1_housecleaning_kit", - "item_tcg_loot_reward_series1_indoor_fountain_01", - "item_tcg_loot_reward_series1_vendor_jawa", - "item_tcg_loot_reward_series1_greeter_meatlump", - "item_tcg_loot_reward_series1_mechno_chair", - "item_tcg_loot_reward_series1_nuna_ball_advertisement", - "item_tcg_loot_reward_series1_podracer_gasgano", - "item_tcg_loot_reward_series1_painting_jedi_crest", - "item_tcg_loot_reward_series1_painting_trooper", - "item_tcg_loot_reward_series1_radtrooper_badge", - "item_tcg_loot_reward_series1_sith_speeder", - "item_tcg_loot_reward_series1_tusken_talisman", - "item_tcg_loot_reward_series1_organa_speeder", - "item_tcg_loot_reward_series1_computer_console_01", - "item_tcg_loot_reward_series1_vendor_ewok", - "item_tcg_loot_reward_series1_hans_hydrospanner", - "item_tcg_loot_reward_series1_painting_imperial_propaganda", - "item_tcg_loot_reward_series1_indoor_garden_02", - "item_tcg_loot_reward_series1_orange_flightsuit", - "item_tcg_loot_reward_series1_vendor_bomarr_monk", - "item_tcg_loot_reward_series1_target_creature", - "item_tcg_loot_reward_series1_beru_whitesuns_cookbook", - "item_tcg_loot_reward_series1_jedi_library_bookshelf" - }; - - public static final String[] TCG_ANIMATIONS = - { - "greeter_anims_face", - "greeter_anims_happy", - "greeter_anims_sick_sad", - "greeter_anims_polite", - "greeter_anims_rude", - "greeter_anims_expression", - "emote_greeter_ewok", - "emote_greeter_jawa" - }; - - - public int OnSpeaking(obj_id self, String text) throws InterruptedException - { - if (isGod(self)) - { - debugConsoleMsg( self, "jhaskell_test OnSpeaking: "+ text ); - - java.util.StringTokenizer tok = new java.util.StringTokenizer (text); - - if (tok.hasMoreTokens ()) - { - String priCommand = tok.nextToken (); - String secCommand = ""; - String thirdCommand = ""; - if (tok.hasMoreTokens ()) - { - secCommand = tok.nextToken (); - } - if (tok.hasMoreTokens ()) - { - thirdCommand = tok.nextToken (); - } - debugConsoleMsg( self, "command is: "+ priCommand); - - if (priCommand.equalsIgnoreCase ("what_scene") && secCommand.equals("")) - { - sendSystemMessage(self, "You are in scene: "+ getCurrentSceneName(), null); - } - else if (priCommand.equalsIgnoreCase ("is_tutorial") && secCommand.equals("")) - { - sendSystemMessage(self, "Is in Tutorial: "+ isInTutorialArea(self), null); - } - else if (priCommand.equalsIgnoreCase ("city") && secCommand.equalsIgnoreCase ("set_trainers")) - { - - obj_id structure = qa.findTarget(self); - if (!isValidId(structure) || !exists(structure)) - { - - sendSystemMessage(self, "You must target object", null); - } - int city_id = findCityByCityHall( structure ); - if (city_id <= 0) - { - - sendSystemMessage(self, "You must target city hall", null); - } - if (!cityExists( city_id )) - { - - sendSystemMessage(self, "Structure does't exist", null); - return SCRIPT_CONTINUE; - } - - boolean successSkillTrainers = setCitySkillTrainers(self, city_id); - if (successSkillTrainers) - { - sendSystemMessage(self, "Legacy Trainer Spawners placed", null); - } - else - { - sendSystemMessage(self, "The Trainer Routine Failed", null); - } - - } - else if (priCommand.equalsIgnoreCase ("city") && secCommand.equalsIgnoreCase ("destroy_trainers")) - { - - obj_id structure = qa.findTarget(self); - if (!isValidId(structure) || !exists(structure)) - { - - sendSystemMessage(self, "You must target object", null); - } - int city_id = findCityByCityHall( structure ); - if (city_id <= 0) - { - - sendSystemMessage(self, "You must target city hall", null); - } - if (!cityExists( city_id )) - { - - sendSystemMessage(self, "Structure does't exist", null); - return SCRIPT_CONTINUE; - } - - boolean destroySuccess = destroyCitySkillTrainers(self, city_id); - } - else if (priCommand.equalsIgnoreCase ("city") && secCommand.equalsIgnoreCase ("get_structures")) - { - - obj_id structure = qa.findTarget(self); - if (!isValidId(structure) || !exists(structure)) - { - - sendSystemMessage(self, "You must target object", null); - } - int city_id = findCityByCityHall( structure ); - if (city_id <= 0) - { - - sendSystemMessage(self, "You must target city hall", null); - } - if (!cityExists( city_id )) - { - - sendSystemMessage(self, "Structure does't exist", null); - return SCRIPT_CONTINUE; - } - - obj_id[] structures = cityGetStructureIds( city_id ); - for (int i = 0; i < structures.length; i++) - { - testAbortScript(); - sendSystemMessage(self, "Found: "+getName(structures[i]), null); - } - sendSystemMessage(self, "getTrainerCount: "+city.getTrainerCount( city_id ), null); - sendSystemMessage(self, "getMaxTrainerCount: "+city.getMaxTrainerCount( city_id ), null); - } - else if (priCommand.equalsIgnoreCase ("get_name") && secCommand.equals("")) - { - - obj_id target = qa.findTarget(self); - if (!isValidId(target) || !exists(target)) - { - - sendSystemMessage(self, "You must target object", null); - } - sendSystemMessage(self, "Name: "+localize( getNameStringId(target)), null); - - } - else if (priCommand.equalsIgnoreCase ("get_loco") && secCommand.equals("")) - { - sendSystemMessage(self, "Locomotion:"+getLocomotion(self), null); - } - else if (priCommand.equalsIgnoreCase ("squad") && !secCommand.equals("")) - { - - sendSystemMessage(self, "Ship: "+secCommand, null); - obj_id secCmd = utils.stringToObjId(secCommand); - if (!isValidId(secCmd)) - { - sendSystemMessage(self, "Ship OID not valid ", null); - } - - sendSystemMessage(self, "Ship OID valid", null); - sendSystemMessage(self, "Ship Squad: "+_spaceUnitGetSquadId(secCmd), null); - } - else if (priCommand.equalsIgnoreCase ("grant_schematic") && !secCommand.equals("")) - { - grantSchematic(self, secCommand); - } - else if (priCommand.equalsIgnoreCase ("test_chest") && secCommand.equals("")) - { - dictionary params = new dictionary(); - params.put("player", self); - messageTo(self, "spawnTreasure", params, 5, false); - - } - else if (priCommand.equalsIgnoreCase ("get_tat") && secCommand.equals("")) - { - - obj_id planetId = getPlanetByName("tatooine"); - - sendSystemMessageTestingOnly(self, ""+planetId); - - } - else if (priCommand.equalsIgnoreCase ("force_init") && secCommand.equals("")) - { - obj_id lookAtTarget = findTarget(self); - - if (!isIdValid(lookAtTarget)) - { - sendSystemMessageTestingOnly(self, "You need to target a deprecated collection reactor."); - } - else - { - sendSystemMessageTestingOnly(self, "Forcing initialization on object."); - messageTo(lookAtTarget, "forceCollectionReactorInit", null, 1, false); - } - } - else if (priCommand.equalsIgnoreCase ("force_init") && !secCommand.equals("")) - { - obj_id lookAtTarget = utils.stringToObjId(secCommand); - if (!isValidId(lookAtTarget)) - { - sendSystemMessageTestingOnly(self, "You need to specify a valid OID of a collection reactor."); - } - else - { - sendSystemMessageTestingOnly(self, "Forcing initialization on object."); - messageTo(lookAtTarget, "forceCollectionReactorInit", null, 1, false); - } - } - else if (priCommand.equalsIgnoreCase("bypass_forage_roll") && secCommand.equals("")) - { - utils.setScriptVar(self, "qa.main_forage_roll_bypass", "testing"); - sendSystemMessageTestingOnly(self, "main_forage_roll_bypass is 100%"); - } - else if (priCommand.equalsIgnoreCase("bypass_worm_roll") && secCommand.equals("")) - { - utils.setScriptVar(self, "qa.bypass_worm_roll", "testing"); - sendSystemMessageTestingOnly(self, "bypass_worm_roll is 100%"); - } - else if (priCommand.equalsIgnoreCase("bypass_component_roll") && secCommand.equals("")) - { - utils.setScriptVar(self, "qa.component_roll_bypass", "testing"); - sendSystemMessageTestingOnly(self, "bypass_component_roll is 100%"); - } - else if (priCommand.equalsIgnoreCase("bypass_treasure_roll") && secCommand.equals("")) - { - utils.setScriptVar(self, "qa.treasure_roll_bypass", "testing"); - sendSystemMessageTestingOnly(self, "bypass_treasure_roll is 100%"); - } - else if (priCommand.equalsIgnoreCase("bypass_enzyme_roll") && secCommand.equals("")) - { - utils.setScriptVar(self, "qa.enzyme_roll_bypass", "testing"); - sendSystemMessageTestingOnly(self, "bypass_enzyme_roll is 100%"); - } - else if (priCommand.equalsIgnoreCase("remove_bypass") && secCommand.equals("")) - { - utils.removeScriptVarTree(self, "qa"); - sendSystemMessageTestingOnly(self, "Bypass scriptvars removed"); - } - else if (priCommand.equalsIgnoreCase("bypass_searchlair_roll") && secCommand.equals("")) - { - utils.setScriptVar(self, "qa.egg_roll_bypass", "testing"); - sendSystemMessageTestingOnly(self, "egg_roll_bypass is setting roll to 89 so you only receive eggs."); - } - else if (priCommand.equalsIgnoreCase("bypass_milk_roll") && secCommand.equals("")) - { - utils.setScriptVar(self, "qa.milk_roll_bypass", "testing"); - sendSystemMessageTestingOnly(self, "milk_roll_bypass is setting roll to receive milk repeatedly...as if magic."); - } - else if (priCommand.equalsIgnoreCase("give_forage_data") && secCommand.equals("")) - { - utils.setScriptVar(self, "qa.give_forage_data", "testing"); - sendSystemMessageTestingOnly(self, "Forage data will be displayed in console."); - } - else if (priCommand.equalsIgnoreCase("rare_forage_loot_logger")) - { - - utils.removeScriptVarTree(self, "qa"); - utils.setScriptVar(self, "qa.main_forage_roll_bypass", "testing"); - utils.setScriptVar(self, "qa.give_forage_data", "testing"); - int iteration = 25; - sendSystemMessageTestingOnly(self, "Foraging Rares "+ iteration + " times. You must keep Godmode on for this to work"); - for (int i = 0; i < iteration; i++) - { - testAbortScript(); - messageTo(self, "handlerForPlayerForaging", null, (5+i), false); - } - } - else if (priCommand.equalsIgnoreCase("forage_loot_logger")) - { - utils.removeScriptVarTree(self, "qa"); - utils.setScriptVar(self, "qa.give_forage_data", "testing"); - int iteration = 25; - sendSystemMessageTestingOnly(self, "Foraging Normally for "+ iteration + " times. You must keep Godmode on for this to work"); - for (int i = 0; i < iteration; i++) - { - testAbortScript(); - messageTo(self, "handlerForPlayerForaging", null, (5+i), false); - } - } - - else if (priCommand.equalsIgnoreCase("buff_list") && secCommand.equals("")) - { - int[] buffs = buff.getAllBuffs(self); - - if (buffs == null || buffs.length == 0) - { - sendSystemMessageTestingOnly(self, "No Buffs found"); - return SCRIPT_CONTINUE; - } - for (int i = 0; i < buffs.length; i++) - { - testAbortScript(); - sendSystemMessageTestingOnly(self, "Buff "+ i + " is "+ buff.getBuffNameFromCrc(buffs[i])); - - } - } - else if (priCommand.equalsIgnoreCase("fs_crystal") && secCommand.equals("")) - { - obj_id createdObject = createObjectInInventoryAllowOverload("object/tangible/item/quest/force_sensitive/fs_buff_item.iff", self); - if (isValidId(createdObject)) - { - setObjVar (createdObject,"item.time.reuse_time",259200); - setObjVar (createdObject,"item.buff.type",0); - setObjVar (createdObject,"item.buff.value",2000); - setObjVar (createdObject,"item.buff.duration",7200); - } - } - else if (priCommand.equalsIgnoreCase("give_lumps") && secCommand.equals("")) - { - obj_id pInv = utils.getInventoryContainer(self); - loot.addMeatlumpLumpsAsLoot(self, pInv, 5); - } - else if (priCommand.equalsIgnoreCase("meatlump_container") && secCommand.equals("buff")) - { - loot.giveMeatlumpPuzzleLoot(self, false, true); - } - else if (priCommand.equalsIgnoreCase("meatlump_container") && secCommand.equals("threshold")) - { - loot.giveMeatlumpPuzzleLoot(self, true, false); - } - else if (priCommand.equalsIgnoreCase("meatlump_container") && secCommand.equals("both")) - { - sendSystemMessageTestingOnly(self, "both received"); - loot.giveMeatlumpPuzzleLoot(self, true, true); - } - else if (priCommand.equalsIgnoreCase("meatlump_trigger") && secCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "removing all trigger scriptvars"); - utils.removeScriptVar(self, "meatlump_trigger"); - } - else if (priCommand.equalsIgnoreCase("remove_safe") && secCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "removing all trigger scriptvars"); - utils.removeScriptVarTree(self, "meatlump_safe"); - utils.removeScriptVarTree(self, "meatlump_safe_nonimperative"); - } - else if (priCommand.equalsIgnoreCase("num_combos")) - { - - if (secCommand.equals("") || thirdCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "num_combos number1 number2"); - return SCRIPT_CONTINUE; - } - - int number1 = utils.stringToInt(secCommand); - int number2 = utils.stringToInt(thirdCommand); - - int numCombos = 0; - - for (int i = 70; i < 88; i++) - { - testAbortScript(); - for (int j = 70; j < 88; j++) - { - testAbortScript(); - sendSystemMessageTestingOnly(self, " "+ i +"*"+j +"= "+ (i*j)); - if ((i*j) >= number1 && (i*j) <= number2) - { - numCombos++; - sendSystemMessageTestingOnly(self, "Valid hit "+ i +"*"+j +"= "+ (i*j) ); - } - } - } - sendSystemMessageTestingOnly(self, "numbCombos ="+ numCombos); - } - else if (priCommand.equalsIgnoreCase("set_scriptvar")) - { - if (secCommand.equals("") || thirdCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "set_scriptvar value"); - return SCRIPT_CONTINUE; - } - - utils.setScriptVar(self, secCommand, thirdCommand); - sendSystemMessageTestingOnly(self, "Set "+secCommand+ " to "+thirdCommand); - } - else if (priCommand.equalsIgnoreCase("removescriptvar") && !secCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "removing scriptvar: "+secCommand); - utils.removeScriptVar(self, secCommand); - } - else if (priCommand.equalsIgnoreCase("removescriptvartree") && !secCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "removing scriptvartree: "+secCommand); - utils.removeScriptVarTree(self, secCommand); - } - else if (priCommand.equalsIgnoreCase("addscriptvar") && !secCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "adding scriptvar: "+secCommand); - utils.removeScriptVar(self, secCommand); - } - else if (priCommand.equalsIgnoreCase("add_skill_mod") && !secCommand.equals("") && !thirdCommand.equals("")) - { - int amount = utils.stringToInt(thirdCommand); - applySkillStatisticModifier(self, secCommand, amount); - sendSystemMessageTestingOnly(self, "Attempting to apply Skill Mod: "+secCommand+" to : "+amount); - } - else if (priCommand.equalsIgnoreCase("has_skill_mod") && !secCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "Attempting to find Skill Mod: "+secCommand); - - int hasMod = getSkillStatMod(self, secCommand); - if (hasMod > 0) - { - sendSystemMessageTestingOnly(self, "You have Skill Mod: "+secCommand+" and the value is: "+getSkillStatisticModifier(self, secCommand)); - } - else - { - sendSystemMessageTestingOnly(self, "CANNOT FIND SKILL MOD: "+secCommand); - } - } - - else if (priCommand.equalsIgnoreCase("get_skill_mod") && !secCommand.equals("")) - { - String skillMod = secCommand; - if (skillMod == null || skillMod.equals("")) - { - sendSystemMessageTestingOnly(self, "skill mod example: vendor.special_vendor_skillmod"); - return SCRIPT_CONTINUE; - } - - sendSystemMessageTestingOnly(self, "Getting: "+secCommand+": "+getSkillStatMod(self, skillMod)); - } - else if (priCommand.equalsIgnoreCase("set_skill_mod") && !secCommand.equals("")) - { - String skillMod = secCommand; - if (skillMod == null || skillMod.equals("")) - { - sendSystemMessageTestingOnly(self, "skill mod example: vendor.special_vendor_skillmod"); - return SCRIPT_CONTINUE; - } - - sendSystemMessageTestingOnly(self, "Setting: "+secCommand+" to +1"); - applySkillStatisticModifier(self, skillMod, 1); - } - - else if (priCommand.equalsIgnoreCase("test_greeter_anim") && !secCommand.equals("") && !thirdCommand.equals("")) - { - obj_id greeter = utils.stringToObjId(secCommand); - if (!isValidId(greeter) || !exists(greeter)) - { - sendSystemMessageTestingOnly(self, "Couldn't find Greeter with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - - sendSystemMessageTestingOnly(self, "Attempting to player animation: "+thirdCommand+" on greeter: "+greeter); - doAnimationAction(greeter, thirdCommand); - } - else if (priCommand.equalsIgnoreCase("test_greeter_sound") && !secCommand.equals("") && !thirdCommand.equals("")) - { - obj_id greeter = utils.stringToObjId(secCommand); - if (!isValidId(greeter) || !exists(greeter)) - { - sendSystemMessageTestingOnly(self, "Couldn't find Greeter with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - - String sound = thirdCommand; - if (sound == null || sound.equals("")) - { - sendSystemMessageTestingOnly(self, "Couldn't find sound argument"); - return SCRIPT_CONTINUE; - } - location loc = getLocation(greeter); - if (loc == null) - { - sendSystemMessageTestingOnly(self, "Couldn't find greeter location"); - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self, "Attempting to player sound: "+sound+" on greeter: "+greeter); - if (!playClientEffectLoc(greeter, sound, loc, 0.f)) - { - sendSystemMessageTestingOnly(self, "The sound could not be played per the game system."); - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self, "The sound should have played."); - } - else if (priCommand.equalsIgnoreCase("test_greeter_voice") && !secCommand.equals("") && !thirdCommand.equals("")) - { - obj_id greeter = utils.stringToObjId(secCommand); - if (!isValidId(greeter) || !exists(greeter)) - { - sendSystemMessageTestingOnly(self, "Couldn't find Greeter with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - - String voice = thirdCommand; - if (voice == null && voice.equals("")) - { - sendSystemMessageTestingOnly(self, "Couldn't find voice argument"); - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self, "Attempting to player sound: "+voice+" on greeter: "+greeter); - if (!play2dNonLoopingSound(self, voice)) - { - sendSystemMessageTestingOnly(self, "The sound could not be played per the game system."); - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self, "The sound should have played."); - } - else if (priCommand.equalsIgnoreCase("get_tcg_expansion_templates")) - { - String data = ""; - int iteration = TCG_EXPANSION.length; - for (int i = 0; i < iteration; i++) - { - testAbortScript(); - dictionary itemData = dataTableGetRow(static_item.MASTER_ITEM_TABLE, TCG_EXPANSION[i]); - data += itemData.getString("template_name"); - data += "\n\r"; - - } - saveTextOnClient(self, "templates.txt", data); - } - else if (priCommand.equalsIgnoreCase("get_tcg_expansion_items")) - { - - obj_id pInv = utils.getInventoryContainer(self); - if (!isValidId(pInv) || !exists(pInv)) - { - return SCRIPT_CONTINUE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessage(self, vendor_lib.SID_INVENTORY_FULL_GENERIC); - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < TCG_EXPANSION.length; i++) - { - testAbortScript(); - static_item.createNewItemFunction(TCG_EXPANSION[i], pInv); - } - } - else if (priCommand.equalsIgnoreCase("get_tcg_launch_items")) - { - obj_id pInv = utils.getInventoryContainer(self); - if (!isValidId(pInv) || !exists(pInv)) - { - return SCRIPT_CONTINUE; - } - - if (getVolumeFree(pInv) <= 0) - { - sendSystemMessage(self, vendor_lib.SID_INVENTORY_FULL_GENERIC); - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < TCG_LAUNCH.length; i++) - { - testAbortScript(); - static_item.createNewItemFunction(TCG_LAUNCH[i], pInv); - } - } - else if (priCommand.equalsIgnoreCase("play_client_test")) - { - playClientEffectObj(self, "sound/utinni.snd", self, ""); - } - else if (priCommand.equalsIgnoreCase("play_2d_test")) - { - play2dNonLoopingSound(self, "sound/utinni.snd"); - } - else if (priCommand.equalsIgnoreCase("play_music_test")) - { - playMusic(self, "sound/utinni.snd"); - } - else if (priCommand.equalsIgnoreCase("play_client") && !secCommand.equals("")) - { - if (secCommand == null || secCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "Sound Invalid. Valid sound: sound/utinni.snd"); - return SCRIPT_CONTINUE; - } - if (!playClientEffectObj(self, secCommand, self, "")) - { - sendSystemMessageTestingOnly(self, "Sound Failed."); - } - else - { - sendSystemMessageTestingOnly(self, "Sound should have played."); - } - } - else if (priCommand.equalsIgnoreCase("play_2d") && !secCommand.equals("")) - { - if (secCommand == null || secCommand.equals("") || !secCommand.startsWith("sound/") || secCommand.indexOf(".snd") < 0) - { - sendSystemMessageTestingOnly(self, "Sound Invalid. Valid sound: sound/utinni.snd"); - return SCRIPT_CONTINUE; - } - if (!play2dNonLoopingSound(self, secCommand)) - { - sendSystemMessageTestingOnly(self, "Sound Failed."); - } - else - { - sendSystemMessageTestingOnly(self, "Sound should have played."); - } - } - else if (priCommand.equalsIgnoreCase("play_music") && !secCommand.equals("")) - { - if (secCommand == null || secCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "Sound Invalid. Valid sound: sound/utinni.snd"); - return SCRIPT_CONTINUE; - } - if (!playMusic(self, "sound/"+secCommand+".snd")) - { - sendSystemMessageTestingOnly(self, "Sound Failed."); - } - else - { - sendSystemMessageTestingOnly(self, "Sound should have played."); - } - } - else if (priCommand.equalsIgnoreCase("tcg_booster_msg")) - { - sendSystemMessage(self, new string_id("veteran_new", "tcg_available_monthly_bonus_booster_pack")); - } - else if (priCommand.equalsIgnoreCase("packup_points_100")) - { - int[] housePacking = new int[2]; - housePacking[0] = 100; - housePacking[1] = 100; - setObjVar(self, "housePackup", housePacking); - sendSystemMessageTestingOnly(self,"You now have points equal to a player that has destroyed 100 houses."); - } - else if (priCommand.equalsIgnoreCase("packup_points") && !secCommand.equals("")) - { - if (secCommand == null || secCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "Define how many abandoned houses you want to pack up"); - return SCRIPT_CONTINUE; - } - int number1 = utils.stringToInt(secCommand); - - int[] housePacking = new int[2]; - housePacking[0] = number1; - housePacking[1] = number1; - setObjVar(self, "housePackup", housePacking); - sendSystemMessageTestingOnly(self,"You now have points equal to a player that has destroyed "+number1+" houses."); - } - else if (priCommand.equalsIgnoreCase("packup_daily_max")) - { - if (!hasObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TALLY_OBJVAR)) - { - sendSystemMessageTestingOnly(self,"No houses destroyed today."); - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self,"You currently have destroyed "+ getIntObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TALLY_OBJVAR) + " houses today."); - } - else if (priCommand.equalsIgnoreCase("packup_remove_daily")) - { - if (!hasObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TALLY_OBJVAR)) - { - sendSystemMessageTestingOnly(self,"No objvar found."); - return SCRIPT_CONTINUE; - } - removeObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TALLY_OBJVAR); - sendSystemMessageTestingOnly(self,"You currently have destroyed "+ getIntObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TALLY_OBJVAR) + " houses today."); - } - else if (priCommand.equalsIgnoreCase("packup_remove_all")) - { - messageTo(self, "handlePlayerStructurePackupLockoutRemoval", null, 0, false); - - if (!hasObjVar(self, player_structure.HOUSE_PACKUP_ARRAY_OBJVAR)) - { - sendSystemMessageTestingOnly(self,"No houses destroyed ever."); - return SCRIPT_CONTINUE; - } - removeObjVar(self, player_structure.HOUSE_PACKUP_ARRAY_OBJVAR); - if (!hasObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TALLY_OBJVAR)) - { - sendSystemMessageTestingOnly(self,"No House Pack up tracking objvar found, removal skipped."); - return SCRIPT_CONTINUE; - } - removeObjVar(self, player_structure.HOUSE_PACKUP_DAILY_TALLY_OBJVAR); - messageTo(self, "handlePlayerStructurePackupLockoutRemoval", null, 0, false); - - sendSystemMessageTestingOnly(self,"All House Pack Up tracking and Lock Outs removed."); - } - - else if (priCommand.equalsIgnoreCase("packup_houses")) - { - if (!hasObjVar(self, player_structure.HOUSE_PACKUP_ARRAY_OBJVAR)) - { - sendSystemMessageTestingOnly(self,"No houses destroyed ever."); - return SCRIPT_CONTINUE; - } - int[] array = getIntArrayObjVar(self, player_structure.HOUSE_PACKUP_ARRAY_OBJVAR); - sendSystemMessageTestingOnly(self,"You have destroyed "+ array[1] + " houses total."); - } - else if (priCommand.equalsIgnoreCase("packup_remove_lockout")) - { - messageTo(self, "handleFailedStructurePackup", null, 0, false); - sendSystemMessageTestingOnly(self,"If you had a house pack up lockout it no longer exists."); - } - else if (priCommand.equalsIgnoreCase("check_abandonable")) - { - obj_id lookAtTarget = findTarget(self); - sendSystemMessageTestingOnly(self,"Can be abandoned: "+player_structure.doesUnmarkedStructureQualifyForHousePackup(lookAtTarget)); - } - else if (priCommand.equalsIgnoreCase("isowner")) - { - obj_id lookAtTarget = findTarget(self); - sendSystemMessageTestingOnly(self,"Are you owner? "+player_structure.isOwner(lookAtTarget, self)); - if (isGod(self)) - { - sendSystemMessageTestingOnly(self,"You are in godmode and the isowner check may not work"); - } - } - else if (priCommand.equalsIgnoreCase("set_abandoned")) - { - obj_id lookAtTarget = findTarget(self); - if (!player_structure.doesUnmarkedStructureQualifyForHousePackup(lookAtTarget)) - { - sendSystemMessageTestingOnly(self,"Please target a valid player house or factory. This object cannot be packed up."); - return SCRIPT_CONTINUE; - } - if (hasObjVar(lookAtTarget, "player_structure.abandoned") && getIntObjVar(lookAtTarget, "player_structure.abandoned") == 1) - { - sendSystemMessageTestingOnly(self,"This structure is already abandoned."); - return SCRIPT_CONTINUE; - } - setObjVar(lookAtTarget, "player_structure.abandoned", 1); - sendSystemMessageTestingOnly(self,"Structure set abandoned."); - } - else if (priCommand.equalsIgnoreCase("setlots")) - { - adjustLotCount(getPlayerObject(self), -10); - sendSystemMessageTestingOnly(self,"Lots set to 10"); - } - else if (priCommand.equalsIgnoreCase("set_sarlacc")) - { - obj_id lookAtTarget = findTarget(self); - if (!isValidId(lookAtTarget)) - { - return SCRIPT_CONTINUE; - } - - String sarlaccObjTemplate = getTemplateName(lookAtTarget); - if (sarlaccObjTemplate == null || sarlaccObjTemplate.equals("")) - { - return SCRIPT_CONTINUE; - } - if (sarlaccObjTemplate.indexOf("mini_s02.iff") < 0) - { - return SCRIPT_CONTINUE; - } - - setObjVar(lookAtTarget, house_pet.SARLACC_FAST_UPDATE_RATE, true); - - sendSystemMessageTestingOnly(self,"Sarlacc God Hack Applied."); - } - - else if (priCommand.equalsIgnoreCase("get_player_housing_lots")) - { - String data = ""; - - for (int i = 0; i < ALL_PLAYER_HOUSING.length; i++) - { - testAbortScript(); - String lotStr = ""; - int lot = getAdjustedLotCount(ALL_PLAYER_HOUSING[i]); - if (lot == -99) - { - lotStr = "Lot count set to 1 because of error"; - } - else if (lot == -1) - { - lotStr = "template error"; - } - else if (lot == -2) - { - lotStr = "footprint template error"; - } - else if (lot == -3) - { - lotStr = "index error"; - } - else if (lot > 0) - { - lotStr = ""+lot; - } - else if (lot == 0) - { - lotStr = "none"; - } - else if (lot == -69) - { - lotStr = "Exempt"; - } - data += ALL_PLAYER_HOUSING[i] + "\t"+ lotStr + "\n"; - } - - saveTextOnClient(self, "playerHousingLots.txt", data); - - } - else if (priCommand.equalsIgnoreCase("get_player_city_lots")) - { - String data = ""; - - for (int i = 0; i < ALL_PLAYER_CITY_STRUCTURES.length; i++) - { - testAbortScript(); - String lotStr = ""; - int lot = getAdjustedLotCount(ALL_PLAYER_CITY_STRUCTURES[i]); - if (lot == -99) - { - lotStr = "Lot count set to 1 because of error"; - } - else if (lot == -1) - { - lotStr = "template error"; - } - else if (lot == -2) - { - lotStr = "footprint template error"; - } - else if (lot == -3) - { - lotStr = "index error"; - } - else if (lot > 0) - { - lotStr = ""+lot; - } - else if (lot == 0) - { - lotStr = "none"; - } - else if (lot == -69) - { - lotStr = "Exempt"; - } - - data += ALL_PLAYER_CITY_STRUCTURES[i] + "\t"+ lotStr + "\n"; - } - - saveTextOnClient(self, "cityStructureLots.txt", data); - } - else if (priCommand.equalsIgnoreCase("persist_obj") && !secCommand.equals("")) - { - obj_id object = utils.stringToObjId(secCommand); - if (!isValidId(object) || !exists(object)) - { - sendSystemMessageTestingOnly(self, "Couldn't find object with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - persistObject(object); - sendSystemMessageTestingOnly(self, "Object: "+secCommand+" persisted."); - } - else if (priCommand.equalsIgnoreCase("is_persisted") && !secCommand.equals("")) - { - obj_id object = utils.stringToObjId(secCommand); - if (!isValidId(object) || !exists(object)) - { - sendSystemMessageTestingOnly(self, "Couldn't find object with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - if (isObjectPersisted(self)) - { - sendSystemMessageTestingOnly(self, "Object: "+secCommand+" IS INDEED persisted."); - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self, "Object: "+secCommand+" IS NOT persisted."); - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("get_sign_skillmod")) - { - int special_sign_tcg_series3 = getSkillStatMod(self, "special_sign_tcg_series3"); - sendSystemMessageTestingOnly(self, "special_sign_tcg_series3: "+special_sign_tcg_series3); - int special_sign_halloween_hanging_sign = getSkillStatMod(self, "special_sign_halloween_hanging_sign"); - sendSystemMessageTestingOnly(self, "special_sign_halloween_hanging_sign: "+special_sign_halloween_hanging_sign); - int special_sign_halloween_standing_sign = getSkillStatMod(self, "special_sign_halloween_standing_sign"); - sendSystemMessageTestingOnly(self, "special_sign_halloween_standing_sign: "+special_sign_halloween_standing_sign); - int shop_sign = getSkillStatMod(self, "shop_sign"); - sendSystemMessageTestingOnly(self, "shop_sign: "+shop_sign); - - return SCRIPT_CONTINUE; - - } - else if (priCommand.equalsIgnoreCase("give_shop_sign")) - { - applySkillStatisticModifier(self, "shop_sign",1); - int shop_sign = getSkillStatMod(self, "shop_sign"); - sendSystemMessageTestingOnly(self, "shop_sign: "+shop_sign); - - return SCRIPT_CONTINUE; - - } - else if (priCommand.equalsIgnoreCase("remove_shop_sign")) - { - applySkillStatisticModifier(self, "shop_sign",-1); - int shop_sign = getSkillStatMod(self, "shop_sign"); - sendSystemMessageTestingOnly(self, "shop_sign: "+shop_sign); - - return SCRIPT_CONTINUE; - - } - else if (priCommand.equalsIgnoreCase("decrease_sign_skillmod") && !secCommand.equals("")) - { - int skillModAmount = getSkillStatMod(self, "special_sign_tcg_series3"); - sendSystemMessageTestingOnly(self, "Before: "+skillModAmount); - int number1 = utils.stringToInt(secCommand); - if (number1 <= 0) - { - return SCRIPT_CONTINUE; - } - if (!applySkillStatisticModifier(self, "special_sign_tcg_series3", -1*number1)) - { - return SCRIPT_CONTINUE; - } - - skillModAmount = getSkillStatMod(self, "special_sign_tcg_series3"); - sendSystemMessageTestingOnly(self, "Now: "+skillModAmount); - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("increase_sign_skillmod") && !secCommand.equals("")) - { - int skillModAmount = getSkillStatMod(self, "special_sign_tcg_series3"); - sendSystemMessageTestingOnly(self, "Before: "+skillModAmount); - int number1 = utils.stringToInt(secCommand); - if (number1 <= 0) - { - return SCRIPT_CONTINUE; - } - if (!applySkillStatisticModifier(self, "special_sign_tcg_series3", number1)) - { - return SCRIPT_CONTINUE; - } - - skillModAmount = getSkillStatMod(self, "special_sign_tcg_series3"); - sendSystemMessageTestingOnly(self, "Now: "+skillModAmount); - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("play_particle") && !secCommand.equals("")) - { - playClientEffectObj(self, secCommand, self, ""); - sendSystemMessageTestingOnly(self, "Particle should have played"); - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("sarlacc_day") && !secCommand.equals("")) - { - obj_id object = utils.stringToObjId(secCommand); - if (!isValidId(object) || !exists(object)) - { - sendSystemMessageTestingOnly(self, "Couldn't find object with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - if (isDeluxSarlacc(object)) - { - int totalSubtractedTime = house_pet.getUpdateDaily(object); - int lastFed = getIntObjVar(object, house_pet.SARLACC_BORN); - if (hasObjVar(object, house_pet.SARLACC_LAST_FED)) - { - lastFed = getIntObjVar(object, house_pet.SARLACC_LAST_FED); - } - - int newFed = lastFed - totalSubtractedTime; - - setObjVar(object, house_pet.SARLACC_LAST_FED, newFed); - - sendSystemMessageTestingOnly(self, "Deluxe Sarlacc: "+secCommand+" Last Feeding Time has had "+totalSubtractedTime+" subtracted from it."); - } - else - { - sendSystemMessageTestingOnly(self, "Object: "+secCommand+" IS NOT a Deluxe Sarlacc or has never been fed."); - } - - utils.removeScriptVar(object, house_pet.SARLACC_AVOID_REPEATED_UPDATES); - - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("sarlacc_phase_very_hungry") && !secCommand.equals("")) - { - obj_id object = utils.stringToObjId(secCommand); - if (!isValidId(object) || !exists(object)) - { - sendSystemMessageTestingOnly(self, "Couldn't find object with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - if (isDeluxSarlacc(object)) - { - setObjVar(object, house_pet.SARLACC_CURRENT_PHASE, 2); - - sendSystemMessageTestingOnly(self, "Deluxe Sarlacc: "+secCommand+" has been set to very hungry."); - } - else - { - sendSystemMessageTestingOnly(self, "Object: "+secCommand+" IS NOT a Deluxe Sarlacc or has never been fed."); - } - - utils.removeScriptVar(object, house_pet.SARLACC_AVOID_REPEATED_UPDATES); - - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("in_world") && !secCommand.equals("")) - { - obj_id object = utils.stringToObjId(secCommand); - if (!isValidId(object) || !exists(object)) - { - sendSystemMessageTestingOnly(self, "Couldn't find object with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self, "Is in World Cell: "+isInWorldCell(object)); - } - else if (priCommand.equalsIgnoreCase("get_feed_list") && !secCommand.equals("")) - { - obj_id object = utils.stringToObjId(secCommand); - if (!isValidId(object) || !exists(object)) - { - sendSystemMessageTestingOnly(self, "Couldn't find object with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - String list = getListOfFoodItems(object); - if (list == null || list.equals("")) - { - sendSystemMessageTestingOnly(self, "Nothing returned"); - } - else - { - sendSystemMessageTestingOnly(self, "List of Items Fed: "+list); - } - } - else if (priCommand.equalsIgnoreCase("massiff_day") && !secCommand.equals("")) - { - obj_id object = utils.stringToObjId(secCommand); - if (!isValidId(object) || !exists(object)) - { - sendSystemMessageTestingOnly(self, "Couldn't find object with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - if (isMassiffBowl(object)) - { - int totalSubtractedTime = house_pet.getUpdateDaily(object); - int lastFed = getIntObjVar(object, house_pet.MASSIFF_LAST_FED); - - int newFed = lastFed - totalSubtractedTime; - - setObjVar(object, house_pet.MASSIFF_LAST_FED, newFed); - - sendSystemMessageTestingOnly(self, "Massif Bowl: "+secCommand+" Last Feeding Time has had "+totalSubtractedTime+" subtracted from it."); - } - else - { - sendSystemMessageTestingOnly(self, "Object: "+secCommand+" IS NOT a Massif Bowl or has no spawned and fed Massif."); - } - - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("massiff_emote") && !secCommand.equals("")) - { - obj_id object = utils.stringToObjId(secCommand); - if (!isValidId(object) || !exists(object)) - { - sendSystemMessageTestingOnly(self, "Couldn't find object with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - - playClientEffectObj(object, house_pet.MASSIFF_HUNGRY_EMOTE, object, ""); - } - else if (priCommand.equalsIgnoreCase("getyaw") && !secCommand.equals("")) - { - obj_id object = utils.stringToObjId(secCommand); - if (!isValidId(object) || !exists(object)) - { - sendSystemMessageTestingOnly(self, "Couldn't find object with OID of: "+secCommand); - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self, "The yaw of that object is: "+getYaw(object)); - - } - else if (priCommand.equalsIgnoreCase("test_player_anim") && !secCommand.equals("")) - { - sendSystemMessageTestingOnly(self, "Animating using: "+secCommand); - doAnimationAction(self, secCommand); - } - else if (priCommand.equalsIgnoreCase("remove_lockout")) - { - removeObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT); - removeObjVar(self, holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT); - removeObjVar(self, holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT); - removeObjVar(self, holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT); - removeObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - removeObjVar(self, holiday.EMPIRE_DAY_RESISTANCE_TIMESTAMP); - removeObjVar(self, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - removeObjVar(self, holiday.EMPIRE_DAY_VANDAL_TIMESTAMP); - removeObjVar(self, "empire_day_events.locked_out"); - sendSystemMessageTestingOnly(self, "Lockouts removed."); - } - else if (priCommand.equalsIgnoreCase("collections_removed")) - { - collection.removeCollectionForRealsies(self, holiday.REBEL_RESISTANCE_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.REBEL_VANDAL_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.REBEL_ENGINEERING_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.REBEL_ENTERTAINER_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.REBEL_RESCUE_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_RECRUITING_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_ANTIPROP_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_ENGINEERING_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_ENTERTAINER_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_RESCUE_COLLECTION); - } - else if (priCommand.equalsIgnoreCase("buffs_removed")) - { - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT); - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF); - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT); - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_VANDAL_SF); - buff.removeBuff(self, holiday.BUFF_IMPERIAL_RECRUITMENT_COUNTER); - buff.removeBuff(self, holiday.BUFF_REBEL_RESISTANCE_COUNTER); - buff.removeBuff(self, holiday.BUFF_IMPERIAL_ANTIPROPAGANDA_COUNTER); - buff.removeBuff(self, holiday.BUFF_REBEL_PLAYER_VANDAL_COUNTER); - } - else if (priCommand.equalsIgnoreCase("apply_recruit_combat_buff")) - { - buff.applyBuff(self, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT); - } - else if (priCommand.equalsIgnoreCase("apply_resist_combat_buff")) - { - buff.applyBuff(self, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT); - } - else if (priCommand.equalsIgnoreCase("apply_recruit_sf_buff")) - { - buff.applyBuff(self, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF); - } - else if (priCommand.equalsIgnoreCase("apply_resist_sf_buff")) - { - buff.applyBuff(self, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF); - } - else if (priCommand.equalsIgnoreCase("apply_antiprop_combat_buff")) - { - buff.applyBuff(self, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT); - } - else if (priCommand.equalsIgnoreCase("apply_antiprop_sf_buff")) - { - buff.applyBuff(self, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF); - } - else if (priCommand.equalsIgnoreCase("apply_vandal_combat_buff")) - { - buff.applyBuff(self, holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT); - } - else if (priCommand.equalsIgnoreCase("apply_vandal_sf_buff")) - { - buff.applyBuff(self, holiday.BUFF_REB_EMPIREDAY_VANDAL_SF); - } - else if (priCommand.equalsIgnoreCase("apply_recruit_counter_buff")) - { - buff.applyBuff(self, holiday.BUFF_IMPERIAL_RECRUITMENT_COUNTER); - } - else if (priCommand.equalsIgnoreCase("apply_resist_counter_buff")) - { - buff.applyBuff(self, holiday.BUFF_REBEL_RESISTANCE_COUNTER); - } - else if (priCommand.equalsIgnoreCase("apply_antiprop_counter_buff")) - { - buff.applyBuff(self, holiday.BUFF_IMPERIAL_ANTIPROPAGANDA_COUNTER); - } - else if (priCommand.equalsIgnoreCase("apply_vandal_counter_buff")) - { - buff.applyBuff(self, holiday.BUFF_REBEL_PLAYER_VANDAL_COUNTER); - } - else if (priCommand.equalsIgnoreCase("hasImpTraderQuest")) - { - String quest = ""; - for (int i = 0; i < holiday.ALL_IMPERIAL_QUESTS.length; i++) - { - testAbortScript(); - if (groundquests.isQuestActive(self, holiday.ALL_IMPERIAL_QUESTS[i])) - { - quest = holiday.ALL_IMPERIAL_QUESTS[i]; - sendSystemMessageTestingOnly(self, "FOUND QUEST: "+holiday.ALL_IMPERIAL_QUESTS[i]); - break; - } - else - { - sendSystemMessageTestingOnly(self, "is not quest: "+holiday.ALL_IMPERIAL_QUESTS[i]); - } - } - if (quest == null || quest.equals("")) - { - sendSystemMessageTestingOnly(self, "no quest, exiting"); - return SCRIPT_CONTINUE; - - } - - if (groundquests.isTaskActive(self, quest, quest)) - { - sendSystemMessageTestingOnly(self, "TASK QUEST: "+quest); - } - else - { - sendSystemMessageTestingOnly(self, "Task not found: "+quest); - } - } - else if (priCommand.equalsIgnoreCase("showBuildoutArea")) - { - location here = getLocation(self); - - obj_id containingBuilding = getTopMostContainer(self); - if (isIdValid(containingBuilding)) - { - here = getLocation(containingBuilding); - } - - String buildoutAreaName = getBuildoutAreaName(here.x, here.z); - sendSystemMessageTestingOnly(self, "You are in buildout area: "+ buildoutAreaName); - } - - else if (priCommand.equalsIgnoreCase("detach_spawner")) - { - obj_id lookAtTarget = findTarget(self); - if (!isValidId(lookAtTarget)) - { - sendSystemMessageTestingOnly(self, "failed"); - return SCRIPT_CONTINUE; - - } - detachScript(lookAtTarget, "theme_park.dungeon.empire_day_interior_npc_spawner"); - sendSystemMessageTestingOnly(self, "removed"); - } - else if (priCommand.equalsIgnoreCase("attach_spawner")) - { - obj_id lookAtTarget = findTarget(self); - if (!isValidId(lookAtTarget)) - { - sendSystemMessageTestingOnly(self, "failed"); - return SCRIPT_CONTINUE; - - } - attachScript(lookAtTarget, "theme_park.dungeon.empire_day_interior_npc_spawner"); - sendSystemMessageTestingOnly(self, "removed"); - } - else if (priCommand.equalsIgnoreCase("make_dead")) - { - obj_id lookAtTarget = findTarget(self); - if (!isValidId(lookAtTarget)) - { - sendSystemMessageTestingOnly(self, "failed"); - return SCRIPT_CONTINUE; - - } - - ai_lib.aiSetPosture(lookAtTarget, POSTURE_KNOCKED_DOWN); - sendSystemMessageTestingOnly(self, "done"); - } - else if (priCommand.equalsIgnoreCase("has_lock_out_timer")) - { - if (hasObjVar(self, holiday.EMPIRE_DAY_VANDAL_TIMESTAMP)) - { - sendSystemMessageTestingOnly(self, "HAS: "+holiday.EMPIRE_DAY_VANDAL_TIMESTAMP); - } - else - { - sendSystemMessageTestingOnly(self, "DOES NOT HAVE: "+holiday.EMPIRE_DAY_VANDAL_TIMESTAMP); - } - if (hasObjVar(self, holiday.EMPIRE_DAY_RESISTANCE_TIMESTAMP)) - { - sendSystemMessageTestingOnly(self, "HAS: "+holiday.EMPIRE_DAY_RESISTANCE_TIMESTAMP); - } - else - { - sendSystemMessageTestingOnly(self, "DOES NOT HAVE: "+holiday.EMPIRE_DAY_RESISTANCE_TIMESTAMP); - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP)) - { - sendSystemMessageTestingOnly(self, "HAS: "+holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - } - else - { - sendSystemMessageTestingOnly(self, "DOES NOT HAVE: "+holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - } - if (hasObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP)) - { - sendSystemMessageTestingOnly(self, "HAS: "+holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - } - else - { - sendSystemMessageTestingOnly(self, "DOES NOT HAVE: "+holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - } - } - else if (priCommand.equalsIgnoreCase("has_lock_out_flag")) - { - if (hasObjVar(self, holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT)) - { - sendSystemMessageTestingOnly(self, "HAS: "+holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT); - } - else - { - sendSystemMessageTestingOnly(self, "DOES NOT HAVE: "+holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT); - } - if (hasObjVar(self, holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT)) - { - sendSystemMessageTestingOnly(self, "HAS: "+holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT); - } - else - { - sendSystemMessageTestingOnly(self, "DOES NOT HAVE: "+holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT); - } - - if (hasObjVar(self, holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT)) - { - sendSystemMessageTestingOnly(self, "HAS: "+holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT); - } - else - { - sendSystemMessageTestingOnly(self, "DOES NOT HAVE: "+holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT); - } - if (hasObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT)) - { - sendSystemMessageTestingOnly(self, "HAS: "+holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT); - } - else - { - sendSystemMessageTestingOnly(self, "DOES NOT HAVE: "+holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT); - } - - } - else if (priCommand.equalsIgnoreCase("tatooine_vars")) - { - obj_id tatooine = getPlanetByName("tatooine"); - if (!isValidId(tatooine)) - { - sendSystemMessageTestingOnly(self, "No Tatooine Found."); - return SCRIPT_CONTINUE; - } - sendSystemMessageTestingOnly(self, "has script: "+hasScript(tatooine, "event.planet_event_handler")); - sendSystemMessageTestingOnly(self, "OID: "+tatooine); - - String data = holiday.getEventHighScores(tatooine, holiday.PLANET_VAR_EVENT_PREFIX + holiday.PLANET_VAR_EMPIRE_DAY + holiday.PLANET_VAR_SCORE, true); - if (data == null || data.length() <= 0) - { - sendSystemMessageTestingOnly(self, "High Score Data Invalid."); - return SCRIPT_CONTINUE; - - } - if (!holiday.createEventLeaderBoardUI(self, holiday.LEADER_BOARD_TITLE, data)) - { - sendSystemMessageTestingOnly(self, "createEventLeaderBoardUI failed."); - return SCRIPT_CONTINUE; - - } - sendSystemMessageTestingOnly(self, "High Score Data should have worked."); - - } - else if (priCommand.equalsIgnoreCase("score_vars")) - { - if (hasObjVar(self, holiday.PLAYER_EMPIRE_DAY_SCORE)) - { - sendSystemMessageTestingOnly(self, "Score var: "+getIntObjVar(self, holiday.PLAYER_EMPIRE_DAY_SCORE)); - } - else - { - sendSystemMessageTestingOnly(self, "You don't have var"); - } - } - else if (priCommand.equalsIgnoreCase("score_var_removed")) - { - if (hasObjVar(self, holiday.PLAYER_EMPIRE_DAY_SCORE)) - { - removeObjVar(self, holiday.PLAYER_EMPIRE_DAY_SCORE); - sendSystemMessageTestingOnly(self, "Score var removed."); - } - } - else if (priCommand.equalsIgnoreCase("set_score_var")) - { - setObjVar(self, holiday.PLAYER_EMPIRE_DAY_SCORE, 33); - sendSystemMessageTestingOnly(self, "Set to 33"); - - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT); - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF); - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT); - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_VANDAL_SF); - buff.removeBuff(self, holiday.BUFF_IMPERIAL_RECRUITMENT_COUNTER); - buff.removeBuff(self, holiday.BUFF_REBEL_RESISTANCE_COUNTER); - buff.removeBuff(self, holiday.BUFF_IMPERIAL_ANTIPROPAGANDA_COUNTER); - buff.removeBuff(self, holiday.BUFF_REBEL_PLAYER_VANDAL_COUNTER); - - } - else if (priCommand.equalsIgnoreCase("empire_day_remove_all")) - { - if (hasObjVar(self, holiday.PLAYER_EMPIRE_DAY_SCORE)) - { - removeObjVar(self, holiday.PLAYER_EMPIRE_DAY_SCORE); - sendSystemMessageTestingOnly(self, "Score var removed."); - } - - removeObjVar(self, holiday.EMPIRE_DAY_BUFF_TRACKER); - removeObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_LOCKED_OUT); - removeObjVar(self, holiday.EMPIRE_DAY_RESISTANCE_LOCKED_OUT); - removeObjVar(self, holiday.EMPIRE_DAY_PROPAGANDA_LOCKED_OUT); - removeObjVar(self, holiday.EMPIRE_DAY_VANDAL_LOCKED_OUT); - removeObjVar(self, holiday.EMPIRE_DAY_RECRUITMENT_TIMESTAMP); - removeObjVar(self, holiday.EMPIRE_DAY_RESISTANCE_TIMESTAMP); - removeObjVar(self, holiday.EMPIRE_DAY_PROPAGANDA_TIMESTAMP); - removeObjVar(self, holiday.EMPIRE_DAY_VANDAL_TIMESTAMP); - removeObjVar(self, "empire_day_events.locked_out"); - sendSystemMessageTestingOnly(self, "Lockouts removed."); - - collection.removeCollectionForRealsies(self, holiday.REBEL_RESISTANCE_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.REBEL_VANDAL_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.REBEL_ENGINEERING_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.REBEL_ENTERTAINER_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.REBEL_RESCUE_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_RECRUITING_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_ANTIPROP_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_ENGINEERING_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_ENTERTAINER_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_RESCUE_COLLECTION); - - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT); - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_SF); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_SF); - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT); - buff.removeBuff(self, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_SF); - buff.removeBuff(self, holiday.BUFF_REB_EMPIREDAY_VANDAL_SF); - buff.removeBuff(self, holiday.BUFF_IMPERIAL_RECRUITMENT_COUNTER); - buff.removeBuff(self, holiday.BUFF_REBEL_RESISTANCE_COUNTER); - buff.removeBuff(self, holiday.BUFF_IMPERIAL_ANTIPROPAGANDA_COUNTER); - buff.removeBuff(self, holiday.BUFF_REBEL_PLAYER_VANDAL_COUNTER); - } - else if (priCommand.equalsIgnoreCase("give_both_faction_kiosk_collections")) - { - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_RECRUITING_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ANTIPROP_START_SLOT, 1); - - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_COUNTER_SLOT, 1); - - modifyCollectionSlotValue(self, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT, 1); - } - else if (priCommand.equalsIgnoreCase("give_reb_kiosk_collections")) - { - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_START_SLOT, 1); - } - else if (priCommand.equalsIgnoreCase("complete_imp_kiosk_collection")) - { - - modifyCollectionSlotValue(self, holiday.IMPERIAL_RECRUITING_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ANTIPROP_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_RECRUITING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ANTIPROP_COUNTER_SLOT, 1); - } - else if (priCommand.equalsIgnoreCase("complete_reb_kiosk_collection")) - { - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_RESISTANCE_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.REBEL_VANDAL_COUNTER_SLOT, 1); - } - else if (priCommand.equalsIgnoreCase("remove_imp_kiosk_collection")) - { - - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_RECRUITING_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_ANTIPROP_COLLECTION); - } - else if (priCommand.equalsIgnoreCase("remove_reb_kiosk_collection")) - { - collection.removeCollectionForRealsies(self, holiday.REBEL_RESISTANCE_COLLECTION); - collection.removeCollectionForRealsies(self, holiday.REBEL_VANDAL_COLLECTION); - } - else if (priCommand.equalsIgnoreCase("complete_imp_engineer_collection")) - { - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENGINEERING_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENGINEERING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENGINEERING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENGINEERING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENGINEERING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENGINEERING_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENGINEERING_COUNTER_SLOT, 1); - } - else if (priCommand.equalsIgnoreCase("complete_imp_entertainer_collection")) - { - - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENTERTAINER_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENTERTAINER_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENTERTAINER_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENTERTAINER_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENTERTAINER_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENTERTAINER_COUNTER_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENTERTAINER_COUNTER_SLOT, 1); - } - else if (priCommand.equalsIgnoreCase("start_imp_engineer_collection")) - { - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENGINEERING_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENGINEERING_COUNTER_SLOT, 1); - } - else if (priCommand.equalsIgnoreCase("start_imp_entertainer_collection")) - { - - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENTERTAINER_START_SLOT, 1); - modifyCollectionSlotValue(self, holiday.IMPERIAL_ENTERTAINER_COUNTER_SLOT, 1); - } - else if (priCommand.equalsIgnoreCase("remove_imp_engineer_collection")) - { - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_ENGINEERING_COLLECTION); - } - else if (priCommand.equalsIgnoreCase("remove_imp_entertainer_collection")) - { - collection.removeCollectionForRealsies(self, holiday.IMPERIAL_ENTERTAINER_COLLECTION); - } - else if (priCommand.equalsIgnoreCase("get_reb_buffs")) - { - buff.applyBuff(self, holiday.BUFF_REB_EMPIREDAY_RESISTANCE_COMBATANT); - buff.applyBuff(self, holiday.BUFF_REB_EMPIREDAY_VANDAL_COMBATANT); - } - else if (priCommand.equalsIgnoreCase("reb_leader_board") && !secCommand.equals("")) - { - int buffNumber = utils.stringToInt(secCommand); - if (buffNumber > 0) - { - setObjVar(self, holiday.PLAYER_EMPIRE_DAY_SCORE, buffNumber); - buffNumber = buffNumber / 2; - for (int i = 0; i < buffNumber; i++) - { - testAbortScript(); - buff.applyBuff(self, holiday.BUFF_REBEL_RESISTANCE_COUNTER); - buff.applyBuff(self, holiday.BUFF_REBEL_PLAYER_VANDAL_COUNTER); - } - } - } - else if (priCommand.equalsIgnoreCase("get_imp_buffs")) - { - buff.applyBuff(self, holiday.BUFF_IMP_EMPIREDAY_RECRUITMENT_COMBATANT); - buff.applyBuff(self, holiday.BUFF_IMP_EMPIREDAY_ANTIPROP_COMBATANT); - } - else if (priCommand.equalsIgnoreCase("imp_leader_board") && !secCommand.equals("")) - { - int buffNumber = utils.stringToInt(secCommand); - if (buffNumber > 0) - { - setObjVar(self, holiday.PLAYER_EMPIRE_DAY_SCORE, buffNumber); - buffNumber = buffNumber / 2; - for (int i = 0; i < buffNumber; i++) - { - testAbortScript(); - buff.applyBuff(self, holiday.BUFF_IMPERIAL_RECRUITMENT_COUNTER); - buff.applyBuff(self, holiday.BUFF_IMPERIAL_ANTIPROPAGANDA_COUNTER); - } - } - } - else if (priCommand.equalsIgnoreCase("reset_leaderboards")) - { - - dictionary params = new dictionary(); - params.put("eventVar", holiday.PLANET_VAR_EMPIRE_DAY); - params.put("eventConfig", "empireday_ceremony"); - obj_id tatooine = getPlanetByName("tatooine"); - if (isValidId(tatooine)) - { - sendSystemMessageTestingOnly(self, "Resetting Leaderboard"); - messageTo(tatooine, "resetEventDataAfterDelay", params, 1, false); - } - } - else if (priCommand.equalsIgnoreCase("remove_console_vars")) - { - - utils.removeScriptVarTree(self, "consoleMiniGame"); - sendSystemMessageTestingOnly(self, "done"); - } - else if (priCommand.equalsIgnoreCase("giveSignal1")) - { - if (groundquests.isQuestActive(self, "outbreak_quest_facility_02_imperial")) - { - sendSystemMessageTestingOnly(self,"has outbreak_quest_facility_02_imperial"); - } - - if (groundquests.isTaskActive(self, "outbreak_quest_facility_02_imperial", "body1Searched")) - { - sendSystemMessageTestingOnly(self,"has tsk"); - } - - sendSystemMessageTestingOnly(self, "done"); - } - else if (priCommand.equalsIgnoreCase("goAlpha")) - { - warpPlayer(self, "dathomir", -5925, 559, -6667, null, -5925, 559, -6667, null, true); - sendSystemMessageTestingOnly(self, "done"); - } - else if (priCommand.equalsIgnoreCase("goBeta")) - { - warpPlayer(self, "dathomir", -6283, 561, -7521, null, -6283, 561, -7521, null, true); - sendSystemMessageTestingOnly(self, "done"); - } - else if (priCommand.equalsIgnoreCase("goGamma")) - { - warpPlayer(self, "dathomir", -6824, 553, -6456, null, -6824, 553, -6456, null, true); - sendSystemMessageTestingOnly(self, "done"); - } - else if (priCommand.equalsIgnoreCase("goDelta")) - { - warpPlayer(self, "dathomir", -7145, 562, -6922, null, -7145, 562, -6922, null, true); - sendSystemMessageTestingOnly(self, "done"); - } - else if (priCommand.equalsIgnoreCase("goEpsilon")) - { - warpPlayer(self, "dathomir", -7448, 570, -7342, null, -7448, 570, -7342, null, true); - sendSystemMessageTestingOnly(self, "done"); - } - else if (priCommand.equalsIgnoreCase("giveSignal") && !secCommand.equals("")) - { - if (secCommand == null || secCommand.length() <=0) - { - - } - else - { - groundquests.sendSignal(self, secCommand); - } - } - else if (priCommand.equalsIgnoreCase("stopAi") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - stop(secCmd); - } - else if (priCommand.equalsIgnoreCase("getDeliveryObject")) - { - obj_id[] myList = getAllObjectsWithScript(getLocation(self), 100, "theme_park.outbreak.camp_arrival_trigger_volume"); - if (myList == null || myList.length <= 0) - { - sendSystemMessageTestingOnly(self, "failed"); - } - else - { - for (int i = 0; i < myList.length; i++) - { - testAbortScript(); - sendSystemMessageTestingOnly(self, "found: "+myList[i]); - } - sendSystemMessageTestingOnly(self, "done"); - } - } - else if (priCommand.equalsIgnoreCase("finishSignal")) - { - if ((groundquests.isTaskActive(self, "outbreak_quest_facility_05_imperial", "leaveFacility") || groundquests.isTaskActive(self, "outbreak_quest_facility_05_rebel", "leaveFacility") || groundquests.isTaskActive(self, "outbreak_quest_facility_05_neutral", "leaveFacility"))) - { - groundquests.sendSignal(self, "hasLeftFacility"); - } - - if ((groundquests.isTaskActive(self, "outbreak_quest_facility_05_imperial", "coverSurvivors") || groundquests.isTaskActive(self, "outbreak_quest_facility_05_rebel", "coverSurvivors") || groundquests.isTaskActive(self, "outbreak_quest_facility_05_neutral", "coverSurvivors"))) - { - groundquests.sendSignal(self, "allDoneSurvivors"); - } - - } - else if (priCommand.equalsIgnoreCase("isInEntertainmentCamp")) - { - obj_id camp = getCurrentAdvancedCamp(self); - if (isIdValid(camp)) - { - sendSystemMessageTestingOnly(self, "camp: "+camp); - if (camping.isInEntertainmentCamp(self, camp)) - { - - sendSystemMessageTestingOnly(self, "You are in entertainer camp"); - } - else - { - sendSystemMessageTestingOnly(self, "You are NOT in entertainer camp"); - - } - sendSystemMessageTestingOnly(self, "can performance heal: "+performance.canPerformanceHeal(self)); - sendSystemMessageTestingOnly(self, "Max Duration: "+performance.inspireGetMaxDuration(self)); - } - else - { - sendSystemMessageTestingOnly(self, "not a valid camp"); - - } - - } - else if (priCommand.equalsIgnoreCase("gethp") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - sendSystemMessageTestingOnly(self, "CUR HP: "+getHitpoints(secCmd)); - sendSystemMessageTestingOnly(self, "MAX HP: "+getMaxHitpoints(secCmd)); - } - else if (priCommand.equalsIgnoreCase("sethp") && !secCommand.equals("") && !thirdCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - int thrdCmd = utils.stringToInt(thirdCommand); - setHitpoints(secCmd, thrdCmd); - sendSystemMessageTestingOnly(self, "CUR HP: "+getHitpoints(secCmd)); - sendSystemMessageTestingOnly(self, "MAX HP: "+getMaxHitpoints(secCmd)); - } - else if (priCommand.equalsIgnoreCase("incrementstack")) - { - buff.applyBuff(self, "event_lifeday_imperial_present_counter"); - } - else if (priCommand.equalsIgnoreCase("normalbuff")) - { - buff.applyBuff(self, "bh_dm_cc_1"); - } - else if (priCommand.equalsIgnoreCase("damagelittle") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - int maxHp = getMaxHitpoints(secCmd); - - int threshold = (maxHp/3); - - setHitpoints(secCmd, (maxHp - threshold)); - } - else if (priCommand.equalsIgnoreCase("damagehalf") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - int maxHp = getMaxHitpoints(secCmd); - - int threshold = (maxHp/2); - - setHitpoints(secCmd, (maxHp - threshold)); - } - else if (priCommand.equalsIgnoreCase("damagemore") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - int maxHp = getMaxHitpoints(secCmd); - - int threshold = (maxHp/3); - - setHitpoints(secCmd, (maxHp - (threshold + threshold))); - } - else if (priCommand.equalsIgnoreCase("destroyturret") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - advanced_turret.explodeTurret(secCmd, self); - - } - else if (priCommand.equalsIgnoreCase("getTemplateNoPath") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - String template = utils.getTemplateFilenameNoPath(secCmd); - sendSystemMessageTestingOnly(self, "template: "+template); - } - else if (priCommand.equalsIgnoreCase("getAttackerList") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - - obj_id[] attackerList = utils.getObjIdBatchScriptVar(secCmd, "creditForKills.attackerList.attackers"); - String list = utils.getStringScriptVar(secCmd, "creditForKills.attackerList"); - if (attackerList == null) - { - debugSpeakMsg(self, "attackerList was null"); - debugSpeakMsg(self, "list was "+ list); - return SCRIPT_CONTINUE; - } - - for (int i = 0; i < attackerList.length; ++i) - { - testAbortScript(); - debugSpeakMsg(self, "attackerList["+i+"] "+ attackerList[i]); - } - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("getskillmodresists") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - if (!isValidId(secCmd)) - { - sendSystemMessageTestingOnly(self, "invalid object"); - } - else - { - for (int i = 0; i < armor.DATATABLE_SPECIAL_PROTECTIONS.length; i++) - { - testAbortScript(); - sendSystemMessageTestingOnly(self, "resist: "+ armor.DATATABLE_SPECIAL_PROTECTIONS[i] +": "+getSkillStatisticModifier(secCmd, "expertise_innate_protection_"+ armor.DATATABLE_SPECIAL_PROTECTIONS[i])); - } - sendSystemMessageTestingOnly(self, "resist: all: "+getSkillStatisticModifier(secCmd, "expertise_innate_protection_all")); - - } - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("playorbital")) - { - playClientEffectLoc(self, "clienteffect/combat_pt_orbitalstrike_low_pt.cef", getLocation(self), 0); - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("planet_message")) - { - location loc = getLocation(self); - string_id message = new string_id("gcw", "static_base_capture_imperial"+ loc.area); - - sendFactionalSystemMessagePlanet(message, null, -1.0f, true, true); - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("defense_camp")) - { - obj_id lookAtTarget = findTarget(self); - if (!isValidId(lookAtTarget)) - { - sendSystemMessageTestingOnly(self, "invalid object"); - } - if (!utils.hasScriptVar(lookAtTarget, "defense_camp")) - { - sendSystemMessageTestingOnly(self, "failed hasScriptVar check"); - return SCRIPT_CONTINUE; - } - - obj_id defendingGeneral = utils.getObjIdScriptVar(lookAtTarget, "defense_camp"); - if (!isValidId(defendingGeneral) || !exists(defendingGeneral)) - { - sendSystemMessageTestingOnly(self, "no object defense_camp"); - } - else - { - sendSystemMessageTestingOnly(self, "defense_camp found"); - } - return SCRIPT_CONTINUE; - } - else if (priCommand.equalsIgnoreCase("get_faction_flag") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - if (!isValidId(secCmd)) - { - sendSystemMessageTestingOnly(self, "invalid object"); - } - else - { - int factionFlag = factions.getFactionFlag(secCmd); - if (factionFlag == 0) - { - sendSystemMessageTestingOnly(self, "UNKNOWN FACTION"); - - } - else if (factionFlag == 1) - { - sendSystemMessageTestingOnly(self, "REBEL FACTION"); - - } - else if (factionFlag == 2) - { - sendSystemMessageTestingOnly(self, "IMPERIAL FACTION"); - - } - else if (factionFlag == 3) - { - sendSystemMessageTestingOnly(self, "NEUTRAL FACTION"); - - } - - } - } - else if (priCommand.equalsIgnoreCase("reduce_hp") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - if (!isValidId(secCmd)) - { - sendSystemMessageTestingOnly(self, "invalid object"); - } - - int currentHp = getHitpoints(secCmd); - setHitpoints(secCmd, currentHp - 5000); - - } - else if (priCommand.equalsIgnoreCase("get_fatigue") && !secCommand.equals("")) - { - int secCmd = utils.stringToInt(secCommand); - if (secCmd < 0) - { - sendSystemMessageTestingOnly(self, "invalid amt"); - } - sendSystemMessageTestingOnly(self, "amt: "+secCmd); - buff.applyBuffWithStackCount(self, gcw.BUFF_PLAYER_FATIGUE, secCmd); - } - else if (priCommand.equalsIgnoreCase("isonlist") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - if (!isValidId(secCmd)) - { - sendSystemMessageTestingOnly(self, "invalid object"); - } - if (trial.isNonInstanceFactionParticipant(self, secCmd)) - { - sendSystemMessageTestingOnly(self, "You are on list"); - } - else - { - sendSystemMessageTestingOnly(self, "You are NOT on list"); - } - } - else if (priCommand.equalsIgnoreCase("removemefromlist") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - if (!isValidId(secCmd)) - { - sendSystemMessageTestingOnly(self, "invalid object"); - } - if (trial.removeNonInstanceFactionParticipant(self, secCmd)) - { - sendSystemMessageTestingOnly(self, "You are removed"); - } - else - { - sendSystemMessageTestingOnly(self, "You werent on it"); - } - } - else if (priCommand.equalsIgnoreCase("getgcwtools")) - { - obj_id pInv = utils.getInventoryContainer(self); - obj_id barricade = createObject("object/tangible/gcw/crafting_quest/gcw_barricade_tool.iff", pInv, null); - if (isValidId(barricade)) - { - setCount(barricade, 100); - } - obj_id patrol = createObject("object/tangible/gcw/crafting_quest/gcw_patrol_tool.iff", pInv, null); - if (isValidId(patrol)) - { - setCount(patrol, 100); - } - - obj_id spawner = createObject("object/tangible/gcw/crafting_quest/gcw_spawner_tool.iff", pInv, null); - if (isValidId(spawner)) - { - setCount(spawner, 100); - } - - obj_id tower = createObject("object/tangible/gcw/crafting_quest/gcw_tower_tool.iff", pInv, null); - if (isValidId(tower)) - { - setCount(tower, 100); - } - - obj_id turret = createObject("object/tangible/gcw/crafting_quest/gcw_turret_tool.iff", pInv, null); - if (isValidId(turret)) - { - setCount(turret, 100); - } - - obj_id vehicle = createObject("object/tangible/gcw/crafting_quest/gcw_vehicle_tool.iff", pInv, null); - if (isValidId(vehicle)) - { - setCount(vehicle, 100); - } - - } - else if (priCommand.equalsIgnoreCase("remove_tutorial_flag")) - { - removeObjVar(self, gcw.GCW_TUTORIAL_FLAG); - sendSystemMessageTestingOnly(self, "Tutorial Flag Removed"); - } - else if (priCommand.equalsIgnoreCase("nym_warp_choster")) - { - String cantina = "8145375"; - obj_id building = utils.stringToObjId(cantina); - obj_id room = getCellId(building, "alcove3"); - - warpPlayer(self, "lok", 0.0f, 0.0f, 0.0f, room, 9.0f, -0.9f, -16.1f); - - } - else if (priCommand.equalsIgnoreCase("nym_warp_moore")) - { - String cantina = "8145375"; - obj_id building = utils.stringToObjId(cantina); - obj_id room = getCellId(building, "back_hallway"); - - warpPlayer(self, "lok", 0.0f, 0.0f, 0.0f, room, -36.0f, 0.1f, -14.5f); - - } - else if (priCommand.equalsIgnoreCase("nym_warp_vana")) - { - String stronghold = "6595508"; - obj_id building = utils.stringToObjId(stronghold); - obj_id room = getCellId(building, "lobby"); - - warpPlayer(self, "lok", 0.0f, 0.0f, 0.0f, room, -3.7f, 3.5f, -14.9f); - } - else if (priCommand.equalsIgnoreCase("nym_warp_pirate_troll")) - { - String pirateCave = "5126308"; - obj_id building = utils.stringToObjId(pirateCave); - obj_id room = getCellId(building, "r15"); - - warpPlayer(self, "lok", 0.0f, 0.0f, 0.0f, room, -104.1f, -40.9f, -40.6f); - } - else if (priCommand.equalsIgnoreCase("nym_warp_pirate_hacker")) - { - String pirateCave = "5126308"; - obj_id building = utils.stringToObjId(pirateCave); - obj_id room = getCellId(building, "r25"); - - warpPlayer(self, "lok", 0.0f, 0.0f, 0.0f, room, -63.1f, -65.9f, -140.8f); - } - else if (priCommand.equalsIgnoreCase("nym_warp_mine_wes")) - { - String pirateCave = "5645584"; - obj_id building = utils.stringToObjId(pirateCave); - obj_id room = getCellId(building, "r5"); - - warpPlayer(self, "lok", 0.0f, 0.0f, 0.0f, room, -3.1f, -45.0f, -133.9f); - } - else if (priCommand.equalsIgnoreCase("nym_warp_mine_raynar")) - { - String pirateCave = "5645584"; - obj_id building = utils.stringToObjId(pirateCave); - obj_id room = getCellId(building, "r8"); - - warpPlayer(self, "lok", 0.0f, 0.0f, 0.0f, room, -92.0f, -73.3f, -170.7f); - } - else if (priCommand.equalsIgnoreCase("nym_warp_mine_filter")) - { - String pirateCave = "5645584"; - obj_id building = utils.stringToObjId(pirateCave); - obj_id room = getCellId(building, "r11"); - - warpPlayer(self, "lok", 0.0f, 0.0f, 0.0f, room, -84.0f, -100.0f, -95.6f); - } - else if (priCommand.equalsIgnoreCase("nym_warp_facility_kendo_platt")) - { - String pirateCave = "5126270"; - obj_id building = utils.stringToObjId(pirateCave); - obj_id room = getCellId(building, "crittercell"); - - warpPlayer(self, "lok", 0.0f, 0.0f, 0.0f, room, 70.4f, -12.0f, 79.4f); - } - else if (priCommand.equalsIgnoreCase("nym_warp_facility_jeran_goll")) - { - String pirateCave = "5126270"; - obj_id building = utils.stringToObjId(pirateCave); - obj_id room = getCellId(building, "researchlab2"); - - warpPlayer(self, "lok", 0.0f, 0.0f, 0.0f, room, 20.0f, -20.0f, 139.1f); - } - else if (priCommand.equalsIgnoreCase("nym_warp_roof")) - { - warpPlayer(self, "lok", 477.0f, 33.0f, 4785.0f, null, 0f, 0f, 0f); - } - else if (priCommand.equalsIgnoreCase("nym_prisoner_quest")) - { - if (groundquests.isQuestActive(self, "u16_nym_themepark_pirate_prisoner_rescue_collection")) - { - groundquests.clearQuest(self, "u16_nym_themepark_pirate_prisoner_rescue_collection"); - } - groundquests.grantQuest(self, "u16_nym_themepark_pirate_prisoner_rescue_collection"); - - if (hasCompletedCollectionSlot(self, "icon_nyms_rescue_prisoner")) - { - modifyCollectionSlotValue(self, "icon_nyms_rescue_prisoner", -1); - } - } - else if (priCommand.equalsIgnoreCase("nym_prisoner_log")) - { - LOG("prisoner_error_log","prisoner log test!!"); - - } - else if (priCommand.equalsIgnoreCase("nym_rifle_old")) - { - obj_id playerInv = utils.getInventoryContainer(self); - obj_id prize = weapons.createWeapon("object/weapon/ranged/carbine/carbine_nym_slugthrower.iff", playerInv, rand(0.8f, 1.1f)); - } - else if (priCommand.equalsIgnoreCase("nym_weed_signals")) - { - groundquests.sendSignal(self, "tallStalkWeedFound"); - groundquests.sendSignal(self, "yellowPodWeedFound"); - groundquests.sendSignal(self, "floweringCactiWeedFound"); - groundquests.sendSignal(self, "lowGrowingWeedsFound"); - groundquests.sendSignal(self, "paddleCactiWeedFound"); - groundquests.sendSignal(self, "hasDisposedOfWeeds"); - } - else if (priCommand.equalsIgnoreCase("nym_weed_signals_no_disposal")) - { - groundquests.sendSignal(self, "tallStalkWeedFound"); - groundquests.sendSignal(self, "yellowPodWeedFound"); - groundquests.sendSignal(self, "floweringCactiWeedFound"); - groundquests.sendSignal(self, "lowGrowingWeedsFound"); - groundquests.sendSignal(self, "paddleCactiWeedFound"); - } - else if (priCommand.equalsIgnoreCase("remove_sale_flag") && !secCommand.equals("")) - { - obj_id secCmd = utils.stringToObjId(secCommand); - if (!isValidId(secCmd)) - { - sendSystemMessageTestingOnly(self, "invalid object"); - } - - utils.removeScriptVar(secCmd, "soldAsJunk"); - removeObjVar(secCmd, "soldAsJunk"); - sendSystemMessageTestingOnly(self, "Done"); - } - } - } - return SCRIPT_CONTINUE; - } - - - public int spawnTreasure(obj_id self, dictionary params) throws InterruptedException - { - obj_id map = self; - if ((params == null) || (params.isEmpty())) - { - return SCRIPT_CONTINUE; - } - - obj_id player = params.getObjId( "player"); - - int treasureLevel = 90; - sendSystemMessage(player, SID_SYS_FOUND); - - location playerLocation = getLocation(player); - playerLocation.y = getHeightAtLocation( playerLocation.x, playerLocation.z ); - - sendSystemMessage(self, "Creating Chest", null); - obj_id treasureChest = createObject(DUMMY_CHEST, playerLocation); - if (isValidId(treasureChest)) - { - - setObjVar(treasureChest, "owner", player); - setOwner(treasureChest, player); - - String invis = stealth.getInvisBuff(player); - if (invis != null) - { - stealth.checkForAndMakeVisibleNoRecourse(player); - } - - attachScript(treasureChest, SCRIPT_DUMMY_CHEST); - - setObjVar(treasureChest, "treasureLevel", treasureLevel); - - String loot_table = LOOT_TABLE_81_90; - setObjVar(treasureChest, "loot_table", loot_table); - String type = TREASURE_GUARDS; - int mobLevel = TREASURE_GUARD_LEVEL; - int groupModifier = GROUP_MODIFIER; - int count = ENEMY_COUNT; - int dataTableIdx = DATATABLE_IDX; - - boolean verifiedAllVars = verifyVariablesNotNull(loot_table, type, mobLevel, groupModifier, count, dataTableIdx); - if (!verifiedAllVars) - { - sendSystemMessage(self, "The treasure chest didn't get all the correct data.", null); - return SCRIPT_CONTINUE; - } - - dictionary outparams = new dictionary(); - outparams.put("loot_table", loot_table); - outparams.put("count", count); - outparams.put("type", type); - outparams.put("mobLevel", mobLevel); - outparams.put("location", playerLocation); - outparams.put("player", player); - outparams.put("boss_mob", BOSS_MOB); - - sendSystemMessage(self, "Spawning Guards", null); - messageTo(treasureChest, "spawnTreasureGuards", outparams, 0, false); - } - return SCRIPT_CONTINUE; - } - - - public boolean verifyVariablesNotNull(String loot_table, String type, int mobLevel, int groupModifier, int count, int datTableIdx) throws InterruptedException - { - if (loot_table == null || loot_table.equals("")) - { - return false; - } - if (type == null || type.equals("")) - { - return false; - } - if (mobLevel <= 0) - { - return false; - } - if (groupModifier < 0) - { - return false; - } - if (count < 2) - { - return false; - } - if (datTableIdx < 0) - { - return false; - } - - return true; - } - - - public boolean setCitySkillTrainers(obj_id self, int city_id) throws InterruptedException - { - if (!isValidId(self) || !exists(self)) - { - return false; - } - if (!cityExists( city_id )) - { - return false; - } - - location poiStartLocation = getLocation(self); - float yaw = getYaw( self ); - String[] arrayOfAllTrianerTemplates = dataTableGetStringColumn(CITY_SKILL_TRAINERS, "TEMPLATE"); - String[] arrayOfAllTrianerStrings = dataTableGetStringColumn(CITY_SKILL_TRAINERS, "STRING"); - - sendSystemMessage(self, "Number of Trainers Being Placed: "+ arrayOfAllTrianerTemplates.length, null); - if (arrayOfAllTrianerTemplates.length != arrayOfAllTrianerStrings.length) - { - return false; - } - - for (int i = 0; i < arrayOfAllTrianerTemplates.length; i++) - { - testAbortScript(); - location poiLocation = utils.getRandomAwayLocation(poiStartLocation, 5.f, 10.f); - obj_id poi = createObject(arrayOfAllTrianerTemplates[i], poiLocation); - - if (isValidId(poi) && exists(poi)) - { - setYaw( poi, yaw ); - setObjVar( poi, "creator", self ); - setName(poi, arrayOfAllTrianerStrings[i]); - int flags = SF_COST_CITY_LOW | SF_SKILL_TRAINER; - citySetStructureInfo( city_id, poi, flags, true ); - setObjVar( poi, "city_id", city_id ); - } - sendSystemMessage(self, arrayOfAllTrianerStrings[i] + " placed.", null); - - } - return true; - } - - - public boolean destroyCitySkillTrainers(obj_id self, int city_id) throws InterruptedException - { - obj_id[] structures = cityGetStructureIds( city_id ); - for (int i=0; i 0) - { - for (int i = 0; i < feedingList.length; i++) - { - testAbortScript(); - debugSpeakMsg(sarlacc, "Fed Item: "+i+" "+feedingList[i]); - logData += " Fed Item "+i+": "+ feedingList[i] + ". "; - } - debugSpeakMsg(sarlacc, "Data: "+logData); - } - return logData; - } - - - public obj_id getCurrentAdvancedCamp(obj_id player) throws InterruptedException - { - obj_id[] objects = getNonCreaturesInRange(player, 25.0f); - - if (objects == null || objects.length == 0) - { - return null; - } - - for (int i = 0; i < objects.length; i++) - { - testAbortScript(); - if (hasScript(objects[i], "item.camp.camp_advanced")) - { - sendSystemMessageTestingOnly(player, "found script."); - if (isInTriggerVolume(objects[i], "campsite", player)) - { - return objects[i]; - } - else - { - sendSystemMessageTestingOnly(player, "no objects found."); - } - } - } - - return null; - } -}